1#[derive(Debug, Clone, Copy, PartialEq, Eq)]
3pub enum PdfDocumentNotification {
4 DidUnlock,
6 DidBeginFind,
8 DidEndFind,
10 DidBeginPageFind,
12 DidEndPageFind,
14 DidFindMatch,
16 DidBeginWrite,
18 DidEndWrite,
20 DidBeginPageWrite,
22 DidEndPageWrite,
24}
25
26impl PdfDocumentNotification {
27 #[must_use]
29 pub const fn name(self) -> &'static str {
30 match self {
31 Self::DidUnlock => "PDFDocumentDidUnlockNotification",
32 Self::DidBeginFind => "PDFDocumentDidBeginFindNotification",
33 Self::DidEndFind => "PDFDocumentDidEndFindNotification",
34 Self::DidBeginPageFind => "PDFDocumentDidBeginPageFindNotification",
35 Self::DidEndPageFind => "PDFDocumentDidEndPageFindNotification",
36 Self::DidFindMatch => "PDFDocumentDidFindMatchNotification",
37 Self::DidBeginWrite => "PDFDocumentDidBeginWriteNotification",
38 Self::DidEndWrite => "PDFDocumentDidEndWriteNotification",
39 Self::DidBeginPageWrite => "PDFDocumentDidBeginPageWriteNotification",
40 Self::DidEndPageWrite => "PDFDocumentDidEndPageWriteNotification",
41 }
42 }
43
44 pub(crate) const fn from_raw(raw: i32) -> Option<Self> {
45 match raw {
46 0 => Some(Self::DidUnlock),
47 1 => Some(Self::DidBeginFind),
48 2 => Some(Self::DidEndFind),
49 3 => Some(Self::DidBeginPageFind),
50 4 => Some(Self::DidEndPageFind),
51 5 => Some(Self::DidFindMatch),
52 6 => Some(Self::DidBeginWrite),
53 7 => Some(Self::DidEndWrite),
54 8 => Some(Self::DidBeginPageWrite),
55 9 => Some(Self::DidEndPageWrite),
56 _ => None,
57 }
58 }
59}
60
61#[derive(Debug, Clone, Copy, PartialEq, Eq)]
63pub enum PdfDocumentNotificationUserInfoKey {
64 FoundSelection,
66 PageIndex,
68}
69
70impl PdfDocumentNotificationUserInfoKey {
71 #[must_use]
73 pub const fn name(self) -> &'static str {
74 match self {
75 Self::FoundSelection => "PDFDocumentFoundSelection",
76 Self::PageIndex => "PDFDocumentPageIndex",
77 }
78 }
79}
80
81#[derive(Debug, Clone, Copy, PartialEq, Eq)]
83pub enum PdfViewNotification {
84 AnnotationHit,
86 AnnotationWillHit,
88 ChangedHistory,
90 CopyPermission,
92 DisplayBoxChanged,
94 DisplayModeChanged,
96 DocumentChanged,
98 PageChanged,
100 PrintPermission,
102 ScaleChanged,
104 SelectionChanged,
106 VisiblePagesChanged,
108}
109
110impl PdfViewNotification {
111 #[must_use]
113 pub const fn name(self) -> &'static str {
114 match self {
115 Self::AnnotationHit => "PDFViewAnnotationHitNotification",
116 Self::AnnotationWillHit => "PDFViewAnnotationWillHitNotification",
117 Self::ChangedHistory => "PDFViewChangedHistoryNotification",
118 Self::CopyPermission => "PDFViewCopyPermissionNotification",
119 Self::DisplayBoxChanged => "PDFViewDisplayBoxChangedNotification",
120 Self::DisplayModeChanged => "PDFViewDisplayModeChangedNotification",
121 Self::DocumentChanged => "PDFViewDocumentChangedNotification",
122 Self::PageChanged => "PDFViewPageChangedNotification",
123 Self::PrintPermission => "PDFViewPrintPermissionNotification",
124 Self::ScaleChanged => "PDFViewScaleChangedNotification",
125 Self::SelectionChanged => "PDFViewSelectionChangedNotification",
126 Self::VisiblePagesChanged => "PDFViewVisiblePagesChangedNotification",
127 }
128 }
129}
130
131#[derive(Debug, Clone, Copy, PartialEq, Eq)]
133pub enum PdfThumbnailViewNotification {
134 DocumentEdited,
136}
137
138impl PdfThumbnailViewNotification {
139 #[must_use]
141 pub const fn name(self) -> &'static str {
142 match self {
143 Self::DocumentEdited => "PDFThumbnailViewDocumentEditedNotification",
144 }
145 }
146}