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