pdfium_render/pdf/document/page/field/
button.rs1use crate::bindgen::{FPDF_ANNOTATION, FPDF_FORMHANDLE};
5use crate::bindings::PdfiumLibraryBindings;
6use crate::pdf::document::page::field::private::internal::PdfFormFieldPrivate;
7
8#[cfg(doc)]
9use {
10 crate::pdf::document::form::PdfForm,
11 crate::pdf::document::page::annotation::PdfPageAnnotationType,
12 crate::pdf::document::page::field::{PdfFormField, PdfFormFieldType},
13};
14
15pub struct PdfFormPushButtonField<'a> {
23 form_handle: FPDF_FORMHANDLE,
24 annotation_handle: FPDF_ANNOTATION,
25 bindings: &'a dyn PdfiumLibraryBindings,
26}
27
28impl<'a> PdfFormPushButtonField<'a> {
29 #[inline]
30 pub(crate) fn from_pdfium(
31 form_handle: FPDF_FORMHANDLE,
32 annotation_handle: FPDF_ANNOTATION,
33 bindings: &'a dyn PdfiumLibraryBindings,
34 ) -> Self {
35 PdfFormPushButtonField {
36 form_handle,
37 annotation_handle,
38 bindings,
39 }
40 }
41
42 #[inline]
44 pub fn bindings(&self) -> &'a dyn PdfiumLibraryBindings {
45 self.bindings
46 }
47}
48
49impl<'a> PdfFormFieldPrivate<'a> for PdfFormPushButtonField<'a> {
50 #[inline]
51 fn form_handle(&self) -> FPDF_FORMHANDLE {
52 self.form_handle
53 }
54
55 #[inline]
56 fn annotation_handle(&self) -> FPDF_ANNOTATION {
57 self.annotation_handle
58 }
59
60 #[inline]
61 fn bindings(&self) -> &dyn PdfiumLibraryBindings {
62 self.bindings
63 }
64}