pdfium_render/pdf/document/page/annotation/
strikeout.rs1use crate::bindgen::{FPDF_ANNOTATION, FPDF_DOCUMENT, FPDF_PAGE};
5use crate::bindings::PdfiumLibraryBindings;
6use crate::pdf::document::page::annotation::attachment_points::PdfPageAnnotationAttachmentPoints;
7use crate::pdf::document::page::annotation::objects::PdfPageAnnotationObjects;
8use crate::pdf::document::page::annotation::private::internal::PdfPageAnnotationPrivate;
9
10pub struct PdfPageStrikeoutAnnotation<'a> {
12 handle: FPDF_ANNOTATION,
13 objects: PdfPageAnnotationObjects<'a>,
14 attachment_points: PdfPageAnnotationAttachmentPoints<'a>,
15 bindings: &'a dyn PdfiumLibraryBindings,
16}
17
18impl<'a> PdfPageStrikeoutAnnotation<'a> {
19 pub(crate) fn from_pdfium(
20 document_handle: FPDF_DOCUMENT,
21 page_handle: FPDF_PAGE,
22 annotation_handle: FPDF_ANNOTATION,
23 bindings: &'a dyn PdfiumLibraryBindings,
24 ) -> Self {
25 PdfPageStrikeoutAnnotation {
26 handle: annotation_handle,
27 objects: PdfPageAnnotationObjects::from_pdfium(
28 document_handle,
29 page_handle,
30 annotation_handle,
31 bindings,
32 ),
33 attachment_points: PdfPageAnnotationAttachmentPoints::from_pdfium(
34 annotation_handle,
35 bindings,
36 ),
37 bindings,
38 }
39 }
40
41 #[inline]
43 pub fn attachment_points_mut(&mut self) -> &mut PdfPageAnnotationAttachmentPoints<'a> {
44 &mut self.attachment_points
45 }
46}
47
48impl<'a> PdfPageAnnotationPrivate<'a> for PdfPageStrikeoutAnnotation<'a> {
49 #[inline]
50 fn handle(&self) -> FPDF_ANNOTATION {
51 self.handle
52 }
53
54 #[inline]
55 fn bindings(&self) -> &dyn PdfiumLibraryBindings {
56 self.bindings
57 }
58
59 #[inline]
60 fn objects_impl(&self) -> &PdfPageAnnotationObjects {
61 &self.objects
62 }
63
64 #[inline]
65 fn objects_mut_impl(&mut self) -> &mut PdfPageAnnotationObjects<'a> {
66 &mut self.objects
67 }
68
69 #[inline]
70 fn attachment_points_impl(&self) -> &PdfPageAnnotationAttachmentPoints {
71 &self.attachment_points
72 }
73
74 #[inline]
75 fn attachment_points_mut_impl(&mut self) -> &mut PdfPageAnnotationAttachmentPoints<'a> {
76 &mut self.attachment_points
77 }
78}