objc2_pdf_kit/generated/
PDFAnnotation.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-app-kit")]
7#[cfg(target_os = "macos")]
8use objc2_app_kit::*;
9#[cfg(feature = "objc2-core-graphics")]
10use objc2_core_graphics::*;
11use objc2_foundation::*;
12
13use crate::*;
14
15pub type PDFAnnotationSubtype = NSString;
18
19pub type PDFAnnotationKey = NSString;
22
23extern "C" {
24 pub static PDFAnnotationKeyAppearanceDictionary: &'static PDFAnnotationKey;
26}
27
28extern "C" {
29 pub static PDFAnnotationKeyAppearanceState: &'static PDFAnnotationKey;
31}
32
33extern "C" {
34 pub static PDFAnnotationKeyBorder: &'static PDFAnnotationKey;
36}
37
38extern "C" {
39 pub static PDFAnnotationKeyColor: &'static PDFAnnotationKey;
41}
42
43extern "C" {
44 pub static PDFAnnotationKeyContents: &'static PDFAnnotationKey;
46}
47
48extern "C" {
49 pub static PDFAnnotationKeyFlags: &'static PDFAnnotationKey;
51}
52
53extern "C" {
54 pub static PDFAnnotationKeyDate: &'static PDFAnnotationKey;
56}
57
58extern "C" {
59 pub static PDFAnnotationKeyName: &'static PDFAnnotationKey;
61}
62
63extern "C" {
64 pub static PDFAnnotationKeyPage: &'static PDFAnnotationKey;
66}
67
68extern "C" {
69 pub static PDFAnnotationKeyRect: &'static PDFAnnotationKey;
71}
72
73extern "C" {
74 pub static PDFAnnotationKeySubtype: &'static PDFAnnotationKey;
76}
77
78extern "C" {
79 pub static PDFAnnotationKeyAction: &'static PDFAnnotationKey;
81}
82
83extern "C" {
84 pub static PDFAnnotationKeyAdditionalActions: &'static PDFAnnotationKey;
86}
87
88extern "C" {
89 pub static PDFAnnotationKeyBorderStyle: &'static PDFAnnotationKey;
91}
92
93extern "C" {
94 pub static PDFAnnotationKeyDefaultAppearance: &'static PDFAnnotationKey;
96}
97
98extern "C" {
99 pub static PDFAnnotationKeyDestination: &'static PDFAnnotationKey;
101}
102
103extern "C" {
104 pub static PDFAnnotationKeyHighlightingMode: &'static PDFAnnotationKey;
106}
107
108extern "C" {
109 pub static PDFAnnotationKeyInklist: &'static PDFAnnotationKey;
111}
112
113extern "C" {
114 pub static PDFAnnotationKeyInteriorColor: &'static PDFAnnotationKey;
116}
117
118extern "C" {
119 pub static PDFAnnotationKeyLinePoints: &'static PDFAnnotationKey;
121}
122
123extern "C" {
124 pub static PDFAnnotationKeyLineEndingStyles: &'static PDFAnnotationKey;
126}
127
128extern "C" {
129 pub static PDFAnnotationKeyIconName: &'static PDFAnnotationKey;
131}
132
133extern "C" {
134 pub static PDFAnnotationKeyOpen: &'static PDFAnnotationKey;
136}
137
138extern "C" {
139 pub static PDFAnnotationKeyParent: &'static PDFAnnotationKey;
141}
142
143extern "C" {
144 pub static PDFAnnotationKeyPopup: &'static PDFAnnotationKey;
146}
147
148extern "C" {
149 pub static PDFAnnotationKeyQuadding: &'static PDFAnnotationKey;
151}
152
153extern "C" {
154 pub static PDFAnnotationKeyQuadPoints: &'static PDFAnnotationKey;
156}
157
158extern "C" {
159 pub static PDFAnnotationKeyTextLabel: &'static PDFAnnotationKey;
161}
162
163extern "C" {
164 pub static PDFAnnotationKeyWidgetDownCaption: &'static PDFAnnotationKey;
166}
167
168extern "C" {
169 pub static PDFAnnotationKeyWidgetBorderColor: &'static PDFAnnotationKey;
171}
172
173extern "C" {
174 pub static PDFAnnotationKeyWidgetBackgroundColor: &'static PDFAnnotationKey;
176}
177
178extern "C" {
179 pub static PDFAnnotationKeyWidgetCaption: &'static PDFAnnotationKey;
181}
182
183extern "C" {
184 pub static PDFAnnotationKeyWidgetDefaultValue: &'static PDFAnnotationKey;
186}
187
188extern "C" {
189 pub static PDFAnnotationKeyWidgetFieldFlags: &'static PDFAnnotationKey;
191}
192
193extern "C" {
194 pub static PDFAnnotationKeyWidgetFieldType: &'static PDFAnnotationKey;
196}
197
198extern "C" {
199 pub static PDFAnnotationKeyWidgetAppearanceDictionary: &'static PDFAnnotationKey;
201}
202
203extern "C" {
204 pub static PDFAnnotationKeyWidgetMaxLen: &'static PDFAnnotationKey;
206}
207
208extern "C" {
209 pub static PDFAnnotationKeyWidgetOptions: &'static PDFAnnotationKey;
211}
212
213extern "C" {
214 pub static PDFAnnotationKeyWidgetRotation: &'static PDFAnnotationKey;
216}
217
218extern "C" {
219 pub static PDFAnnotationKeyWidgetRolloverCaption: &'static PDFAnnotationKey;
221}
222
223extern "C" {
224 pub static PDFAnnotationKeyWidgetTextLabelUI: &'static PDFAnnotationKey;
226}
227
228extern "C" {
229 pub static PDFAnnotationKeyWidgetValue: &'static PDFAnnotationKey;
231}
232
233extern_class!(
234 #[unsafe(super(NSObject))]
236 #[derive(Debug, PartialEq, Eq, Hash)]
237 pub struct PDFAnnotation;
238);
239
240extern_conformance!(
241 unsafe impl NSCoding for PDFAnnotation {}
242);
243
244extern_conformance!(
245 unsafe impl NSCopying for PDFAnnotation {}
246);
247
248unsafe impl CopyingHelper for PDFAnnotation {
249 type Result = Self;
250}
251
252extern_conformance!(
253 unsafe impl NSObjectProtocol for PDFAnnotation {}
254);
255
256impl PDFAnnotation {
257 extern_methods!(
258 #[unsafe(method(initWithBounds:forType:withProperties:))]
262 #[unsafe(method_family = init)]
263 pub unsafe fn initWithBounds_forType_withProperties(
264 this: Allocated<Self>,
265 bounds: NSRect,
266 annotation_type: &PDFAnnotationSubtype,
267 properties: Option<&NSDictionary>,
268 ) -> Retained<Self>;
269
270 #[cfg(feature = "PDFPage")]
271 #[unsafe(method(page))]
272 #[unsafe(method_family = none)]
273 pub unsafe fn page(&self) -> Option<Retained<PDFPage>>;
274
275 #[cfg(feature = "PDFPage")]
276 #[unsafe(method(setPage:))]
280 #[unsafe(method_family = none)]
281 pub unsafe fn setPage(&self, page: Option<&PDFPage>);
282
283 #[unsafe(method(type))]
284 #[unsafe(method_family = none)]
285 pub unsafe fn r#type(&self) -> Option<Retained<NSString>>;
286
287 #[unsafe(method(setType:))]
291 #[unsafe(method_family = none)]
292 pub unsafe fn setType(&self, r#type: Option<&NSString>);
293
294 #[unsafe(method(bounds))]
295 #[unsafe(method_family = none)]
296 pub unsafe fn bounds(&self) -> NSRect;
297
298 #[unsafe(method(setBounds:))]
300 #[unsafe(method_family = none)]
301 pub unsafe fn setBounds(&self, bounds: NSRect);
302
303 #[unsafe(method(shouldDisplay))]
304 #[unsafe(method_family = none)]
305 pub unsafe fn shouldDisplay(&self) -> bool;
306
307 #[unsafe(method(setShouldDisplay:))]
309 #[unsafe(method_family = none)]
310 pub unsafe fn setShouldDisplay(&self, should_display: bool);
311
312 #[unsafe(method(shouldPrint))]
313 #[unsafe(method_family = none)]
314 pub unsafe fn shouldPrint(&self) -> bool;
315
316 #[unsafe(method(setShouldPrint:))]
318 #[unsafe(method_family = none)]
319 pub unsafe fn setShouldPrint(&self, should_print: bool);
320
321 #[unsafe(method(modificationDate))]
322 #[unsafe(method_family = none)]
323 pub unsafe fn modificationDate(&self) -> Option<Retained<NSDate>>;
324
325 #[unsafe(method(setModificationDate:))]
329 #[unsafe(method_family = none)]
330 pub unsafe fn setModificationDate(&self, modification_date: Option<&NSDate>);
331
332 #[unsafe(method(userName))]
333 #[unsafe(method_family = none)]
334 pub unsafe fn userName(&self) -> Option<Retained<NSString>>;
335
336 #[unsafe(method(setUserName:))]
340 #[unsafe(method_family = none)]
341 pub unsafe fn setUserName(&self, user_name: Option<&NSString>);
342
343 #[unsafe(method(popup))]
344 #[unsafe(method_family = none)]
345 pub unsafe fn popup(&self) -> Option<Retained<PDFAnnotation>>;
346
347 #[unsafe(method(setPopup:))]
349 #[unsafe(method_family = none)]
350 pub unsafe fn setPopup(&self, popup: Option<&PDFAnnotation>);
351
352 #[cfg(feature = "PDFBorder")]
353 #[unsafe(method(border))]
354 #[unsafe(method_family = none)]
355 pub unsafe fn border(&self) -> Option<Retained<PDFBorder>>;
356
357 #[cfg(feature = "PDFBorder")]
358 #[unsafe(method(setBorder:))]
360 #[unsafe(method_family = none)]
361 pub unsafe fn setBorder(&self, border: Option<&PDFBorder>);
362
363 #[cfg(feature = "objc2-app-kit")]
364 #[cfg(target_os = "macos")]
365 #[unsafe(method(color))]
366 #[unsafe(method_family = none)]
367 pub unsafe fn color(&self) -> Retained<NSColor>;
368
369 #[cfg(feature = "objc2-app-kit")]
370 #[cfg(target_os = "macos")]
371 #[unsafe(method(setColor:))]
375 #[unsafe(method_family = none)]
376 pub unsafe fn setColor(&self, color: &NSColor);
377
378 #[unsafe(method(contents))]
379 #[unsafe(method_family = none)]
380 pub unsafe fn contents(&self) -> Option<Retained<NSString>>;
381
382 #[unsafe(method(setContents:))]
386 #[unsafe(method_family = none)]
387 pub unsafe fn setContents(&self, contents: Option<&NSString>);
388
389 #[cfg(feature = "PDFAction")]
390 #[unsafe(method(action))]
391 #[unsafe(method_family = none)]
392 pub unsafe fn action(&self) -> Option<Retained<PDFAction>>;
393
394 #[cfg(feature = "PDFAction")]
395 #[unsafe(method(setAction:))]
397 #[unsafe(method_family = none)]
398 pub unsafe fn setAction(&self, action: Option<&PDFAction>);
399
400 #[unsafe(method(hasAppearanceStream))]
401 #[unsafe(method_family = none)]
402 pub unsafe fn hasAppearanceStream(&self) -> bool;
403
404 #[unsafe(method(isHighlighted))]
405 #[unsafe(method_family = none)]
406 pub unsafe fn isHighlighted(&self) -> bool;
407
408 #[unsafe(method(setHighlighted:))]
410 #[unsafe(method_family = none)]
411 pub unsafe fn setHighlighted(&self, highlighted: bool);
412
413 #[cfg(all(feature = "PDFPage", feature = "objc2-core-graphics"))]
414 #[unsafe(method(drawWithBox:inContext:))]
415 #[unsafe(method_family = none)]
416 pub unsafe fn drawWithBox_inContext(&self, r#box: PDFDisplayBox, context: &CGContext);
417
418 #[unsafe(method(setValue:forAnnotationKey:))]
422 #[unsafe(method_family = none)]
423 pub unsafe fn setValue_forAnnotationKey(
424 &self,
425 value: &AnyObject,
426 key: &PDFAnnotationKey,
427 ) -> bool;
428
429 #[unsafe(method(setBoolean:forAnnotationKey:))]
430 #[unsafe(method_family = none)]
431 pub unsafe fn setBoolean_forAnnotationKey(
432 &self,
433 value: bool,
434 key: &PDFAnnotationKey,
435 ) -> bool;
436
437 #[unsafe(method(setRect:forAnnotationKey:))]
438 #[unsafe(method_family = none)]
439 pub unsafe fn setRect_forAnnotationKey(
440 &self,
441 value: NSRect,
442 key: &PDFAnnotationKey,
443 ) -> bool;
444
445 #[unsafe(method(annotationKeyValues))]
446 #[unsafe(method_family = none)]
447 pub unsafe fn annotationKeyValues(&self) -> Retained<NSDictionary>;
448
449 #[unsafe(method(valueForAnnotationKey:))]
450 #[unsafe(method_family = none)]
451 pub unsafe fn valueForAnnotationKey(
452 &self,
453 key: &PDFAnnotationKey,
454 ) -> Option<Retained<AnyObject>>;
455
456 #[unsafe(method(removeValueForAnnotationKey:))]
457 #[unsafe(method_family = none)]
458 pub unsafe fn removeValueForAnnotationKey(&self, key: &PDFAnnotationKey);
459 );
460}
461
462impl PDFAnnotation {
464 extern_methods!(
465 #[unsafe(method(init))]
466 #[unsafe(method_family = init)]
467 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
468
469 #[unsafe(method(new))]
470 #[unsafe(method_family = new)]
471 pub unsafe fn new() -> Retained<Self>;
472 );
473}
474
475impl PDFAnnotation {
477 extern_methods!(
478 #[cfg(feature = "PDFPage")]
479 #[deprecated]
483 #[unsafe(method(initWithDictionary:forPage:))]
484 #[unsafe(method_family = init)]
485 pub unsafe fn initWithDictionary_forPage(
486 this: Allocated<Self>,
487 dictionary: &NSDictionary,
488 page: Option<&PDFPage>,
489 ) -> Retained<Self>;
490
491 #[deprecated]
492 #[unsafe(method(initWithBounds:))]
493 #[unsafe(method_family = init)]
494 pub unsafe fn initWithBounds(this: Allocated<Self>, bounds: NSRect) -> Retained<Self>;
495
496 #[deprecated]
497 #[unsafe(method(toolTip))]
498 #[unsafe(method_family = none)]
499 pub unsafe fn toolTip(&self) -> Option<Retained<NSString>>;
500
501 #[cfg(feature = "PDFAction")]
502 #[deprecated]
503 #[unsafe(method(mouseUpAction))]
504 #[unsafe(method_family = none)]
505 pub unsafe fn mouseUpAction(&self) -> Option<Retained<PDFAction>>;
506
507 #[cfg(feature = "PDFAction")]
508 #[deprecated]
510 #[unsafe(method(setMouseUpAction:))]
511 #[unsafe(method_family = none)]
512 pub unsafe fn setMouseUpAction(&self, mouse_up_action: Option<&PDFAction>);
513
514 #[deprecated]
515 #[unsafe(method(removeAllAppearanceStreams))]
516 #[unsafe(method_family = none)]
517 pub unsafe fn removeAllAppearanceStreams(&self);
518
519 #[cfg(feature = "PDFPage")]
520 #[deprecated]
521 #[unsafe(method(drawWithBox:))]
522 #[unsafe(method_family = none)]
523 pub unsafe fn drawWithBox(&self, r#box: PDFDisplayBox);
524 );
525}
526
527extern "C" {
528 #[deprecated]
530 pub static kPDFAnnotationKey_AppearanceDictionary: &'static PDFAnnotationKey;
531}
532
533extern "C" {
534 #[deprecated]
536 pub static kPDFAnnotationKey_AppearanceState: &'static PDFAnnotationKey;
537}
538
539extern "C" {
540 #[deprecated]
542 pub static kPDFAnnotationKey_Border: &'static PDFAnnotationKey;
543}
544
545extern "C" {
546 #[deprecated]
548 pub static kPDFAnnotationKey_Color: &'static PDFAnnotationKey;
549}
550
551extern "C" {
552 #[deprecated]
554 pub static kPDFAnnotationKey_Contents: &'static PDFAnnotationKey;
555}
556
557extern "C" {
558 #[deprecated]
560 pub static kPDFAnnotationKey_Flags: &'static PDFAnnotationKey;
561}
562
563extern "C" {
564 #[deprecated]
566 pub static kPDFAnnotationKey_Date: &'static PDFAnnotationKey;
567}
568
569extern "C" {
570 #[deprecated]
572 pub static kPDFAnnotationKey_Name: &'static PDFAnnotationKey;
573}
574
575extern "C" {
576 #[deprecated]
578 pub static kPDFAnnotationKey_Page: &'static PDFAnnotationKey;
579}
580
581extern "C" {
582 #[deprecated]
584 pub static kPDFAnnotationKey_Rect: &'static PDFAnnotationKey;
585}
586
587extern "C" {
588 #[deprecated]
590 pub static kPDFAnnotationKey_Subtype: &'static PDFAnnotationKey;
591}
592
593extern "C" {
594 #[deprecated]
596 pub static kPDFAnnotationKey_Action: &'static PDFAnnotationKey;
597}
598
599extern "C" {
600 #[deprecated]
602 pub static kPDFAnnotationKey_AdditionalActions: &'static PDFAnnotationKey;
603}
604
605extern "C" {
606 #[deprecated]
608 pub static kPDFAnnotationKey_BorderStyle: &'static PDFAnnotationKey;
609}
610
611extern "C" {
612 #[deprecated]
614 pub static kPDFAnnotationKey_DefaultAppearance: &'static PDFAnnotationKey;
615}
616
617extern "C" {
618 #[deprecated]
620 pub static kPDFAnnotationKey_Destination: &'static PDFAnnotationKey;
621}
622
623extern "C" {
624 #[deprecated]
626 pub static kPDFAnnotationKey_HighlightingMode: &'static PDFAnnotationKey;
627}
628
629extern "C" {
630 #[deprecated]
632 pub static kPDFAnnotationKey_Inklist: &'static PDFAnnotationKey;
633}
634
635extern "C" {
636 #[deprecated]
638 pub static kPDFAnnotationKey_InteriorColor: &'static PDFAnnotationKey;
639}
640
641extern "C" {
642 #[deprecated]
644 pub static kPDFAnnotationKey_LinePoints: &'static PDFAnnotationKey;
645}
646
647extern "C" {
648 #[deprecated]
650 pub static kPDFAnnotationKey_LineEndingStyles: &'static PDFAnnotationKey;
651}
652
653extern "C" {
654 #[deprecated]
656 pub static kPDFAnnotationKey_IconName: &'static PDFAnnotationKey;
657}
658
659extern "C" {
660 #[deprecated]
662 pub static kPDFAnnotationKey_Open: &'static PDFAnnotationKey;
663}
664
665extern "C" {
666 #[deprecated]
668 pub static kPDFAnnotationKey_Parent: &'static PDFAnnotationKey;
669}
670
671extern "C" {
672 #[deprecated]
674 pub static kPDFAnnotationKey_Popup: &'static PDFAnnotationKey;
675}
676
677extern "C" {
678 #[deprecated]
680 pub static kPDFAnnotationKey_Quadding: &'static PDFAnnotationKey;
681}
682
683extern "C" {
684 #[deprecated]
686 pub static kPDFAnnotationKey_QuadPoints: &'static PDFAnnotationKey;
687}
688
689extern "C" {
690 #[deprecated]
692 pub static kPDFAnnotationKey_TextLabel: &'static PDFAnnotationKey;
693}
694
695extern "C" {
696 #[deprecated]
698 pub static kPDFAnnotationKey_WidgetDefaultValue: &'static PDFAnnotationKey;
699}
700
701extern "C" {
702 #[deprecated]
704 pub static kPDFAnnotationKey_WidgetFieldFlags: &'static PDFAnnotationKey;
705}
706
707extern "C" {
708 #[deprecated]
710 pub static kPDFAnnotationKey_WidgetFieldType: &'static PDFAnnotationKey;
711}
712
713extern "C" {
714 #[deprecated]
716 pub static kPDFAnnotationKey_WidgetAppearanceDictionary: &'static PDFAnnotationKey;
717}
718
719extern "C" {
720 #[deprecated]
722 pub static kPDFAnnotationKey_WidgetMaxLen: &'static PDFAnnotationKey;
723}
724
725extern "C" {
726 #[deprecated]
728 pub static kPDFAnnotationKey_WidgetOptions: &'static PDFAnnotationKey;
729}
730
731extern "C" {
732 #[deprecated]
734 pub static kPDFAnnotationKey_WidgetTextLabelUI: &'static PDFAnnotationKey;
735}
736
737extern "C" {
738 #[deprecated]
740 pub static kPDFAnnotationKey_WidgetValue: &'static PDFAnnotationKey;
741}