pdfium_render/pdf/document/page/field/
signature.rs1use crate::bindgen::{FPDF_ANNOTATION, FPDF_FORMHANDLE};
5use crate::pdf::document::page::field::private::internal::PdfFormFieldPrivate;
6use crate::pdfium::PdfiumLibraryBindingsAccessor;
7use std::marker::PhantomData;
8
9#[cfg(doc)]
10use {
11 crate::pdf::document::form::PdfForm,
12 crate::pdf::document::page::annotation::PdfPageAnnotationType,
13 crate::pdf::document::page::field::{PdfFormField, PdfFormFieldType},
14};
15
16pub struct PdfFormSignatureField<'a> {
24 form_handle: FPDF_FORMHANDLE,
25 annotation_handle: FPDF_ANNOTATION,
26 lifetime: PhantomData<&'a FPDF_ANNOTATION>,
27}
28
29impl<'a> PdfFormSignatureField<'a> {
30 pub(crate) fn from_pdfium(
31 form_handle: FPDF_FORMHANDLE,
32 annotation_handle: FPDF_ANNOTATION,
33 ) -> Self {
34 PdfFormSignatureField {
35 form_handle,
36 annotation_handle,
37 lifetime: PhantomData,
38 }
39 }
40}
41
42impl<'a> PdfFormFieldPrivate<'a> for PdfFormSignatureField<'a> {
43 #[inline]
44 fn form_handle(&self) -> FPDF_FORMHANDLE {
45 self.form_handle
46 }
47
48 #[inline]
49 fn annotation_handle(&self) -> FPDF_ANNOTATION {
50 self.annotation_handle
51 }
52}
53
54impl<'a> PdfiumLibraryBindingsAccessor<'a> for PdfFormSignatureField<'a> {}
55
56#[cfg(feature = "thread_safe")]
57unsafe impl<'a> Send for PdfFormSignatureField<'a> {}
58
59#[cfg(feature = "thread_safe")]
60unsafe impl<'a> Sync for PdfFormSignatureField<'a> {}