Okular

annotations.h
1/*
2 SPDX-FileCopyrightText: 2005 Enrico Ros <eros.kde@email.it>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#ifndef _OKULAR_ANNOTATIONS_H_
8#define _OKULAR_ANNOTATIONS_H_
9
10#include <QDateTime>
11#include <QDomDocument>
12#include <QDomElement>
13#include <QFont>
14#include <QRect>
15#include <QString>
16
17#include "area.h"
18#include "okularcore_export.h"
19#include "signatureutils.h"
20
21namespace Okular
22{
23class Action;
24class Annotation;
25class AnnotationObjectRect;
26class AnnotationPrivate;
27class Document;
28class EmbeddedFile;
29class Page;
30class PagePrivate;
31class Sound;
32class Movie;
33class TextAnnotationPrivate;
34class LineAnnotationPrivate;
35class GeomAnnotationPrivate;
36class HighlightAnnotationPrivate;
37class StampAnnotationPrivate;
38class SignatureAnnotationPrivate;
39class InkAnnotationPrivate;
40class CaretAnnotationPrivate;
41class FileAttachmentAnnotationPrivate;
42class SoundAnnotationPrivate;
43class MovieAnnotationPrivate;
44class ScreenAnnotationPrivate;
45class WidgetAnnotationPrivate;
46class RichMediaAnnotationPrivate;
47class NewSignatureData;
48
49/**
50 * @short Helper class for (recursive) annotation retrieval/storage.
51 */
52class OKULARCORE_EXPORT AnnotationUtils
53{
54public:
55 /**
56 * Restore an annotation (with revisions if needed) from the dom @p element.
57 *
58 * Returns a pointer to the complete annotation or 0 if element is invalid.
59 */
60 static Annotation *createAnnotation(const QDomElement &element);
61
62 /**
63 * Saves the @p annotation as a child of @p element taking
64 * care of saving all revisions if it has any.
65 */
66 static void storeAnnotation(const Annotation *annotation, QDomElement &element, QDomDocument &document);
67
68 /**
69 * Returns the child element with the given @p name from the direct
70 * children of @p parentNode or a null element if not found.
71 */
72 static QDomElement findChildElement(const QDomNode &parentNode, const QString &name);
73
74 /**
75 * Returns the geometry of the given @p annotation scaled by
76 * @p scaleX and @p scaleY.
77 */
78 static QRect annotationGeometry(const Annotation *annotation, double scaleX, double scaleY);
79
80 /**
81 * Returns a pixmap for a stamp symbol
82 *
83 * @p name Name of a Okular stamp symbol, icon or path to an image
84 * @p size Size of the pixmap side
85 * @p keepAspectRatio Whether to keep aspect ratio of the stamp or not
86 *
87 * @since 21.12
88 */
89 static QPixmap loadStamp(const QString &nameOrPath, int size, bool keepAspectRatio = true);
90};
91
92/**
93 * @short Annotation struct holds properties shared by all annotations.
94 *
95 * An Annotation is an object (text note, highlight, sound, popup window, ..)
96 * contained by a Page in the document.
97 */
98class OKULARCORE_EXPORT Annotation
99{
100 /// @cond PRIVATE
101 friend class AnnotationObjectRect;
102 friend class Document;
103 friend class DocumentPrivate;
104 friend class ObjectRect;
105 friend class Page;
106 friend class PagePrivate;
107 /// @endcond
108
109public:
110 /**
111 * Describes the type of annotation as defined in PDF standard.
112 */
113 enum SubType {
114 AText = 1, ///< A textual annotation
115 ALine = 2, ///< A line annotation
116 AGeom = 3, ///< A geometrical annotation
117 AHighlight = 4, ///< A highlight annotation
118 AStamp = 5, ///< A stamp annotation
119 AInk = 6, ///< An ink annotation
120 ACaret = 8, ///< A caret annotation
121 AFileAttachment = 9, ///< A file attachment annotation
122 ASound = 10, ///< A sound annotation
123 AMovie = 11, ///< A movie annotation
124 AScreen = 12, ///< A screen annotation
125 AWidget = 13, ///< A widget annotation
126 ARichMedia = 14, ///< A rich media annotation
127 A_BASE = 0 ///< The annotation base class
128 };
129
130 /**
131 * Describes additional properties of an annotation.
132 */
133 enum Flag {
134 Hidden = 1, ///< Is not shown in the document
135 FixedSize = 2, ///< Has a fixed size
136 FixedRotation = 4, ///< Has a fixed rotation
137 DenyPrint = 8, ///< Cannot be printed
138 DenyWrite = 16, ///< Cannot be changed
139 DenyDelete = 32, ///< Cannot be deleted
140 ToggleHidingOnMouse = 64, ///< Can be hidden/shown by mouse click
141 External = 128, ///< Is stored external
142 ExternallyDrawn = 256, ///< Is drawn externally (by the generator which provided it) @since 0.10 (KDE 4.4)
143 BeingMoved = 512, ///< Is being moved (mouse drag and drop). If ExternallyDrawn, the generator must not draw it @since 0.15 (KDE 4.9)
144 BeingResized = 1024 ///< Is being resized (mouse drag and drop). If ExternallyDrawn, the generator must not draw it @since 1.1.0
145 };
146
147 /**
148 * Describes possible line styles for @see ALine annotation.
149 */
151 Solid = 1, ///< A solid line
152 Dashed = 2, ///< A dashed line
153 Beveled = 4, ///< A beveled line
154 Inset = 8, ///< An inset line
155 Underline = 16 ///< An underline
156 };
157
158 /**
159 * Describes possible line effects for @see ALine annotation.
160 */
162 NoEffect = 1, ///< No effect
163 Cloudy = 2 ///< The cloudy effect
164 };
165
166 /**
167 * Describes the scope of revision information.
168 */
170 Reply = 1, ///< Belongs to a reply
171 Group = 2, ///< Belongs to a group
172 Delete = 4 ///< Belongs to a deleted paragraph
173 };
174
175 /**
176 * Describes the type of revision information.
177 */
179 None = 1, ///< Not specified
180 Marked = 2, ///< Is marked
181 Unmarked = 4, ///< Is unmarked
182 Accepted = 8, ///< Has been accepted
183 Rejected = 16, ///< Was rejected
184 Cancelled = 32, ///< Has been cancelled
185 Completed = 64 ///< Has been completed
186 };
187
188 /**
189 * Describes the type of additional actions.
190 *
191 * @since 0.16 (KDE 4.10)
192 */
194 PageOpening, ///< Performed when the page containing the annotation is opened.
195 PageClosing, ///< Performed when the page containing the annotation is closed.
196 CursorEntering, ///< Performed when the cursor enters the annotation's active area @since 1.5
197 CursorLeaving, ///< Performed when the cursor exists the annotation's active area @since 1.5
198 MousePressed, ///< Performed when the mouse button is pressed inside the annotation's active area @since 1.5
199 MouseReleased, ///< Performed when the mouse button is released inside the annotation's active area @since 1.5
200 FocusIn, ///< Performed when the annotation receives the input focus @since 1.5
201 FocusOut, ///< Performed when the annotation loses the input focus @since 1.5
202 };
203
204 /**
205 * A function to be called when the annotation is destroyed.
206 *
207 * @warning the function must *not* call any virtual function,
208 * nor subcast.
209 *
210 * @since 0.7 (KDE 4.1)
211 */
212 typedef void (*DisposeDataFunction)(const Okular::Annotation *);
213
214 /**
215 * Destroys the annotation.
216 */
217 virtual ~Annotation();
218
219 /**
220 * Sets the @p author of the annotation.
221 */
222 void setAuthor(const QString &author);
223
224 /**
225 * Returns the author of the annotation.
226 */
227 QString author() const;
228
229 /**
230 * Sets the @p contents of the annotation.
231 */
232 void setContents(const QString &contents);
233
234 /**
235 * Returns the contents of the annotation.
236 */
237 QString contents() const;
238
239 /**
240 * Sets the unique @p name of the annotation.
241 */
242 void setUniqueName(const QString &name);
243
244 /**
245 * Returns the unique name of the annotation.
246 */
247 QString uniqueName() const;
248
249 /**
250 * Sets the last modification @p date of the annotation.
251 *
252 * The date must be before or equal to QDateTime::currentDateTime()
253 */
254 void setModificationDate(const QDateTime &date);
255
256 /**
257 * Returns the last modification date of the annotation.
258 */
259 QDateTime modificationDate() const;
260
261 /**
262 * Sets the creation @p date of the annotation.
263 *
264 * The date must be before or equal to @see modificationDate()
265 */
266 void setCreationDate(const QDateTime &date);
267
268 /**
269 * Returns the creation date of the annotation.
270 */
271 QDateTime creationDate() const;
272
273 /**
274 * Sets the @p flags of the annotation.
275 * @see @ref Flag
276 */
277 void setFlags(int flags);
278
279 /**
280 * Returns the flags of the annotation.
281 * @see @ref Flag
282 */
283 int flags() const;
284
285 /**
286 * Sets the bounding @p rectangle of the annotation.
287 */
288 void setBoundingRectangle(const NormalizedRect &rectangle);
289
290 /**
291 * Returns the bounding rectangle of the annotation.
292 */
293 NormalizedRect boundingRectangle() const;
294
295 /**
296 * Returns the transformed bounding rectangle of the annotation.
297 *
298 * This rectangle must be used when showing annotations on screen
299 * to have them rotated correctly.
300 */
301 NormalizedRect transformedBoundingRectangle() const;
302
303 /**
304 * Move the annotation by the specified coordinates.
305 *
306 * @see canBeMoved()
307 */
308 void translate(const NormalizedPoint &coord);
309
310 /**
311 * Adjust the annotation by the specified coordinates.
312 * Adds coordinates of @p deltaCoord1 to annotations top left corner,
313 * and @p deltaCoord2 to the bottom right.
314 *
315 * @see canBeResized()
316 */
317 void adjust(const NormalizedPoint &deltaCoord1, const NormalizedPoint &deltaCoord2);
318
319 /**
320 * The Style class contains all information about style of the
321 * annotation.
322 */
323 class OKULARCORE_EXPORT Style
324 {
325 public:
326 /**
327 * Creates a new style.
328 */
329 Style();
330
331 /**
332 * Destroys the style.
333 */
334 ~Style();
335
336 Style(const Style &other);
337 Style &operator=(const Style &other);
338
339 /**
340 * Sets the @p color of the style.
341 */
342 void setColor(const QColor &color);
343
344 /**
345 * Returns the color of the style.
346 */
347 QColor color() const;
348
349 /**
350 * Sets the @p opacity of the style.
351 */
352 void setOpacity(double opacity);
353
354 /**
355 * Returns the opacity of the style.
356 */
357 double opacity() const;
358
359 /**
360 * Sets the @p width of the style.
361 */
362 void setWidth(double width);
363
364 /**
365 * Returns the width of the style.
366 */
367 double width() const;
368
369 /**
370 * Sets the line @p style of the style.
371 */
372 void setLineStyle(LineStyle style);
373
374 /**
375 * Returns the line style of the style.
376 */
377 LineStyle lineStyle() const;
378
379 /**
380 * Sets the x-corners of the style.
381 */
382 void setXCorners(double xCorners);
383
384 /**
385 * Returns the x-corners of the style.
386 */
387 double xCorners() const;
388
389 /**
390 * Sets the y-corners of the style.
391 */
392 void setYCorners(double yCorners);
393
394 /**
395 * Returns the y-corners of the style.
396 */
397 double yCorners() const;
398
399 /**
400 * Sets the @p marks of the style.
401 */
402 void setMarks(int marks);
403
404 /**
405 * Returns the marks of the style.
406 */
407 int marks() const;
408
409 /**
410 * Sets the @p spaces of the style.
411 */
412 void setSpaces(int spaces);
413
414 /**
415 * Returns the spaces of the style.
416 */
417 int spaces() const;
418
419 /**
420 * Sets the line @p effect of the style.
421 */
422 void setLineEffect(LineEffect effect);
423
424 /**
425 * Returns the line effect of the style.
426 */
427 LineEffect lineEffect() const;
428
429 /**
430 * Sets the effect @p intensity of the style.
431 */
432 void setEffectIntensity(double intensity);
433
434 /**
435 * Returns the effect intensity of the style.
436 */
437 double effectIntensity() const;
438
439 private:
440 class Private;
441 Private *const d;
442 };
443
444 /**
445 * Returns a reference to the style object of the annotation.
446 */
447 Style &style();
448
449 /**
450 * Returns a const reference to the style object of the annotation.
451 */
452 const Style &style() const;
453
454 /**
455 * The Window class contains all information about the popup window
456 * of the annotation that is used to edit the content and properties.
457 */
458 class OKULARCORE_EXPORT Window
459 {
460 public:
461 /**
462 * Creates a new window.
463 */
464 Window();
465
466 /**
467 * Destroys the window.
468 */
469 ~Window();
470
471 Window(const Window &other);
472 Window &operator=(const Window &other);
473
474 /**
475 * Sets the @p flags of the window.
476 */
477 void setFlags(int flags);
478
479 /**
480 * Returns the flags of the window.
481 */
482 int flags() const;
483
484 /**
485 * Sets the top-left @p point of the window.
486 */
487 void setTopLeft(const NormalizedPoint &point);
488
489 /**
490 * Returns the top-left point of the window.
491 */
492 NormalizedPoint topLeft() const;
493
494 /**
495 * Sets the @p width of the window.
496 */
497 void setWidth(int width);
498
499 /**
500 * Returns the width of the window.
501 */
502 int width() const;
503
504 /**
505 * Sets the @p height of the window.
506 */
507 void setHeight(int height);
508
509 /**
510 * Returns the height of the window.
511 */
512 int height() const;
513
514 /**
515 * Sets the @p title of the window.
516 */
517 void setTitle(const QString &title);
518
519 /**
520 * Returns the title of the window.
521 */
522 QString title() const;
523
524 /**
525 * Sets the @p summary of the window.
526 */
527 void setSummary(const QString &summary);
528
529 /**
530 * Returns the summary of the window.
531 */
532 QString summary() const;
533
534 private:
535 class Private;
536 Private *const d;
537 };
538
539 /**
540 * Returns a reference to the window object of the annotation.
541 */
542 Window &window();
543
544 /**
545 * Returns a const reference to the window object of the annotation.
546 */
547 const Window &window() const;
548
549 /**
550 * The Revision class contains all information about the revision
551 * of the annotation.
552 */
553 class OKULARCORE_EXPORT Revision
554 {
555 public:
556 /**
557 * Creates a new revision.
558 */
559 Revision();
560
561 /**
562 * Destroys the revision.
563 */
564 ~Revision();
565
566 Revision(const Revision &other);
567 Revision &operator=(const Revision &other);
568
569 /**
570 * Sets the @p annotation the revision belongs to.
571 */
572 void setAnnotation(Annotation *annotation);
573
574 /**
575 * Returns the annotation the revision belongs to.
576 */
577 Annotation *annotation() const;
578
579 /**
580 * Sets the @p scope of the revision.
581 * @see RevisionScope
582 */
583 void setScope(RevisionScope scope);
584
585 /**
586 * Returns the scope of the revision.
587 */
588 RevisionScope scope() const;
589
590 /**
591 * Sets the @p type of the revision.
592 * @see RevisionType
593 */
594 void setType(RevisionType type);
595
596 /**
597 * Returns the type of the revision.
598 */
599 RevisionType type() const;
600
601 private:
602 class Private;
603 Private *const d;
604 };
605
606 /**
607 * Returns a reference to the revision list of the annotation.
608 */
609 QList<Revision> &revisions();
610
611 /**
612 * Returns a reference to the revision list of the annotation.
613 */
614 const QList<Revision> &revisions() const;
615
616 /**
617 * Sets the "native" @p id of the annotation.
618 *
619 * This is for use of the Generator, that can optionally store an
620 * handle (a pointer, an identifier, etc) of the "native" annotation
621 * object, if any.
622 *
623 * @note Okular makes no use of this
624 *
625 * @since 0.7 (KDE 4.1)
626 */
627 void setNativeId(const QVariant &id);
628
629 /**
630 * Returns the "native" id of the annotation.
631 *
632 * @since 0.7 (KDE 4.1)
633 */
634 QVariant nativeId() const;
635
636 /**
637 * Sets a function to be called when the annotation is destroyed.
638 *
639 * @warning the function must *not* call any virtual function,
640 * nor subcast.
641 *
642 * @since 0.7 (KDE 4.1)
643 */
644 void setDisposeDataFunction(DisposeDataFunction func);
645
646 /**
647 * Returns whether the annotation can be moved.
648 *
649 * @since 0.7 (KDE 4.1)
650 */
651 bool canBeMoved() const;
652
653 /**
654 * Returns whether the annotation can be resized.
655 */
656 bool canBeResized() const;
657
658 /**
659 * Returns whether the annotation dialog should be open after creation of the annotation or not
660 *
661 * @since 0.13 (KDE 4.7)
662 */
663 bool openDialogAfterCreation() const;
664
665 /**
666 * Returns the sub type of the annotation.
667 */
668 virtual SubType subType() const = 0;
669
670 /**
671 * Stores the annotation as xml in @p document under the given parent @p node.
672 */
673 virtual void store(QDomNode &node, QDomDocument &document) const;
674
675 /**
676 * Retrieve the QDomNode representing this annotation's properties
677
678 * @since 0.17 (KDE 4.11)
679 */
680 QDomNode getAnnotationPropertiesDomNode() const;
681
682 /**
683 * Sets annotations internal properties according to the contents of @p node
684 *
685 * @since 0.17 (KDE 4.11)
686 */
687
688 void setAnnotationProperties(const QDomNode &node);
689
690 /**
691 * Sets some native internal data with shared ownership.
692 *
693 * data is kept alive according to shared_ptr refcount.
694 *
695 * Can be cleared in here with just setting a nullptr.
696 *
697 * @since 24.12
698 */
699 void setNativeData(std::shared_ptr<void> data);
700
701 /**
702 * @returns the native data content, or nullptr if nothing set.
703 *
704 * You set it, you know what's in it
705 *
706 * @since 24.12
707 */
708 const void *nativeData() const;
709
710protected:
711 /// @cond PRIVATE
712 explicit Annotation(AnnotationPrivate &dd);
713 Annotation(AnnotationPrivate &dd, const QDomNode &description);
714 Q_DECLARE_PRIVATE(Annotation)
715 AnnotationPrivate *d_ptr;
716 /// @endcond
717
718private:
719 Q_DISABLE_COPY(Annotation)
720};
721
722/**
723 * @short Native annotation interface
724 *
725 * Generators can subclass it to provide native annotation support.
726 * Generators can use Annotation::setNativeId to store per-annotation data.
727 *
728 * @since 0.15 (KDE 4.9)
729 */
730class OKULARCORE_EXPORT AnnotationProxy
731{
732public:
734 Addition, ///< Generator can create native annotations
735 Modification, ///< Generator can edit native annotations
736 Removal ///< Generator can remove native annotations
737 };
738
740
741 /**
742 * Destroys the annotation proxy.
743 */
744 virtual ~AnnotationProxy();
745
746 AnnotationProxy(const AnnotationProxy &) = delete;
747 AnnotationProxy &operator=(const AnnotationProxy &) = delete;
748
749 /**
750 * Query for the supported capabilities.
751 */
752 virtual bool supports(Capability capability) const = 0;
753
754 /**
755 * Called when a new @p annotation is added to a @p page.
756 *
757 * @note Only called if supports(Addition) == true
758 */
759 virtual void notifyAddition(Annotation *annotation, int page) = 0;
760
761 /**
762 * Called after an existing @p annotation at a given @p page is modified.
763 *
764 * Generator can call @p annotation getters to get the new values.
765 * @p appearanceChanged tells if a non-visible property was modified
766 *
767 * @note Only called if supports(Modification) == true
768 */
769 virtual void notifyModification(const Annotation *annotation, int page, bool appearanceChanged) = 0;
770
771 /**
772 * Called when an existing @p annotation at a given @p page is removed.
773 *
774 * @note Only called if supports(Removal) == true
775 */
776 virtual void notifyRemoval(Annotation *annotation, int page) = 0;
777};
778
779class OKULARCORE_EXPORT TextAnnotation : public Annotation
780{
781public:
782 /**
783 * Describes the type of the text.
784 */
785 enum TextType {
786 Linked, ///< The annotation is linked to a text
787 InPlace ///< The annotation is located next to the text
788 };
789
790 /**
791 * Describes the style of the text.
792 */
793 enum InplaceIntent {
794 Unknown, ///< Unknown style
795 Callout, ///< Callout style
796 TypeWriter ///< Type writer style
797 };
798
799 /**
800 * Creates a new text annotation.
801 */
802 TextAnnotation();
803
804 /**
805 * Creates a new text annotation from the xml @p description
806 */
807 explicit TextAnnotation(const QDomNode &description);
808
809 /**
810 * Destroys the text annotation.
811 */
812 ~TextAnnotation() override;
813
814 /**
815 * Sets the text @p type of the text annotation.
816 * @see TextType
817 */
818 void setTextType(TextType type);
819
820 /**
821 * Returns the text type of the text annotation.
822 */
823 TextType textType() const;
824
825 /**
826 * Sets the @p icon of the text annotation.
827 */
828 void setTextIcon(const QString &icon);
829
830 /**
831 * Returns the icon of the text annotation.
832 */
833 QString textIcon() const;
834
835 /**
836 * Sets the @p font of the text annotation.
837 */
838 void setTextFont(const QFont &font);
839
840 /**
841 * Returns the font of the text annotation.
842 */
843 QFont textFont() const;
844
845 /**
846 * Sets the @p color of inplace text.
847 *
848 * @since 1.6
849 */
850 void setTextColor(const QColor &color);
851
852 /**
853 * Returns the color of inplace text.
854 *
855 * @since 1.6
856 */
857 QColor textColor() const;
858
859 /**
860 * Sets the inplace @p alignment of the text annotation.
861 * 0:left, 1:center, 2:right
862 */
863 void setInplaceAlignment(int alignment);
864
865 /**
866 * Returns the inplace alignment of the text annotation.
867 * 0:left, 1:center, 2:right
868 */
869 int inplaceAlignment() const;
870
871 /**
872 * Sets the inplace callout @p point at @p index.
873 *
874 * @p index must be between 0 and 2.
875 */
876 void setInplaceCallout(const NormalizedPoint &point, int index);
877
878 /**
879 * Returns the inplace callout point for @p index.
880 *
881 * @p index must be between 0 and 2.
882 */
883 NormalizedPoint inplaceCallout(int index) const;
884
885 /**
886 * Returns the transformed (e.g. rotated) inplace callout point for @p index.
887 *
888 * @p index must be between 0 and 2.
889 */
890 NormalizedPoint transformedInplaceCallout(int index) const;
891
892 /**
893 * Returns the inplace @p intent of the text annotation.
894 * @see InplaceIntent
895 */
896 void setInplaceIntent(InplaceIntent intent);
897
898 /**
899 * Returns the inplace intent of the text annotation.
900 */
901 InplaceIntent inplaceIntent() const;
902
903 /**
904 * Returns the sub type of the text annotation.
905 */
906 SubType subType() const override;
907
908 /**
909 * Stores the text annotation as xml in @p document under the given parent @p node.
910 */
911 void store(QDomNode &node, QDomDocument &document) const override;
912
913private:
914 Q_DECLARE_PRIVATE(TextAnnotation)
915 Q_DISABLE_COPY(TextAnnotation)
916};
917
918class OKULARCORE_EXPORT LineAnnotation : public Annotation
919{
920public:
921 /**
922 * Describes the line ending style.
923 */
924 enum TermStyle {
925 Square, ///< Using a square
926 Circle, ///< Using a circle
927 Diamond, ///< Using a diamond
928 OpenArrow, ///< Using an open arrow
929 ClosedArrow, ///< Using a closed arrow
930 None, ///< No special ending style
931 Butt, ///< Using a butt ending
932 ROpenArrow, ///< Using an arrow opened at the right side
933 RClosedArrow, ///< Using an arrow closed at the right side
934 Slash ///< Using a slash
935 };
936
937 /**
938 * Describes the line intent.
939 */
940 enum LineIntent {
941 Unknown, ///< Unknown intent
942 Arrow, ///< Arrow intent
943 Dimension, ///< Dimension intent
944 PolygonCloud ///< Polygon cloud intent
945 };
946
947 /**
948 * Creates a new line annotation.
949 */
950 LineAnnotation();
951
952 /**
953 * Creates a new line annotation from the xml @p description
954 */
955 explicit LineAnnotation(const QDomNode &description);
956
957 /**
958 * Destroys the line annotation.
959 */
960 ~LineAnnotation() override;
961
962 /**
963 * Sets the normalized line @p points of the line annotation.
964 *
965 * @since 22.08
966 */
967 void setLinePoints(const QList<NormalizedPoint> &points);
968
969 /**
970 * Returns the normalized line points of the line annotation.
971 *
972 * @since 22.08
973 */
974 QList<NormalizedPoint> linePoints() const;
975
976 /**
977 * Returns the transformed (e.g. rotated) normalized line points
978 * of the line annotation.
979 *
980 * @since 22.08
981 */
982 QList<NormalizedPoint> transformedLinePoints() const;
983
984 /**
985 * Sets the line starting @p style of the line annotation.
986 * @see TermStyle
987 */
988 void setLineStartStyle(TermStyle style);
989
990 /**
991 * Returns the line starting style of the line annotation.
992 */
993 TermStyle lineStartStyle() const;
994
995 /**
996 * Sets the line ending @p style of the line annotation.
997 * @see TermStyle
998 */
999 void setLineEndStyle(TermStyle style);
1000
1001 /**
1002 * Returns the line ending style of the line annotation.
1003 */
1004 TermStyle lineEndStyle() const;
1005
1006 /**
1007 * Sets whether the line shall be @p closed.
1008 */
1009 void setLineClosed(bool closed);
1010
1011 /**
1012 * Returns whether the line shall be closed.
1013 */
1014 bool lineClosed() const;
1015
1016 /**
1017 * Sets the inner line @p color of the line annotation.
1018 */
1019 void setLineInnerColor(const QColor &color);
1020
1021 /**
1022 * Returns the inner line color of the line annotation.
1023 */
1024 QColor lineInnerColor() const;
1025
1026 /**
1027 * Sets the leading forward @p point of the line annotation.
1028 */
1029 void setLineLeadingForwardPoint(double point);
1030
1031 /**
1032 * Returns the leading forward point of the line annotation.
1033 */
1034 double lineLeadingForwardPoint() const;
1035
1036 /**
1037 * Sets the leading backward @p point of the line annotation.
1038 */
1039 void setLineLeadingBackwardPoint(double point);
1040
1041 /**
1042 * Returns the leading backward point of the line annotation.
1043 */
1044 double lineLeadingBackwardPoint() const;
1045
1046 /**
1047 * Sets whether the caption shall be @p shown.
1048 */
1049 void setShowCaption(bool shown);
1050
1051 /**
1052 * Returns whether the caption shall be shown.
1053 */
1054 bool showCaption() const;
1055
1056 /**
1057 * Sets the line @p intent of the line annotation.
1058 * @see LineIntent
1059 */
1060 void setLineIntent(LineIntent intent);
1061
1062 /**
1063 * Returns the line intent of the line annotation.
1064 */
1065 LineIntent lineIntent() const;
1066
1067 /**
1068 * Returns the sub type of the line annotation.
1069 */
1070 SubType subType() const override;
1071
1072 /**
1073 * Stores the line annotation as xml in @p document under the given parent @p node.
1074 */
1075 void store(QDomNode &node, QDomDocument &document) const override;
1076
1077private:
1078 Q_DECLARE_PRIVATE(LineAnnotation)
1079 Q_DISABLE_COPY(LineAnnotation)
1080};
1081
1082class OKULARCORE_EXPORT GeomAnnotation : public Annotation
1083{
1084public:
1085 // common enums
1086 enum GeomType {
1087 InscribedSquare, ///< Draw a square
1088 InscribedCircle ///< Draw a circle
1089 };
1090
1091 /**
1092 * Creates a new geometrical annotation.
1093 */
1094 GeomAnnotation();
1095
1096 /**
1097 * Creates a new geometrical annotation from the xml @p description
1098 */
1099 explicit GeomAnnotation(const QDomNode &description);
1100
1101 /**
1102 * Destroys the geometrical annotation.
1103 */
1104 ~GeomAnnotation() override;
1105
1106 /**
1107 * Sets the geometrical @p type of the geometrical annotation.
1108 * @see GeomType
1109 */
1110 void setGeometricalType(GeomType type);
1111
1112 /**
1113 * Returns the geometrical type of the geometrical annotation.
1114 */
1115 GeomType geometricalType() const;
1116
1117 /**
1118 * Sets the inner @p color of the geometrical annotation.
1119 */
1120 void setGeometricalInnerColor(const QColor &color);
1121
1122 /**
1123 * Returns the inner color of the geometrical annotation.
1124 */
1125 QColor geometricalInnerColor() const;
1126
1127 /**
1128 * Returns the sub type of the geometrical annotation.
1129 */
1130 SubType subType() const override;
1131
1132 /**
1133 * Stores the geometrical annotation as xml in @p document
1134 * under the given parent @p node.
1135 */
1136 void store(QDomNode &node, QDomDocument &document) const override;
1137
1138private:
1139 Q_DECLARE_PRIVATE(GeomAnnotation)
1140 Q_DISABLE_COPY(GeomAnnotation)
1141};
1142
1143class OKULARCORE_EXPORT HighlightAnnotation : public Annotation
1144{
1145public:
1146 /**
1147 * Describes the highlighting style of the annotation.
1148 */
1149 enum HighlightType {
1150 Highlight, ///< Highlights the text
1151 Squiggly, ///< Squiggles the text
1152 Underline, ///< Underlines the text
1153 StrikeOut ///< Strikes out the text
1154 };
1155
1156 /**
1157 * Creates a new highlight annotation.
1158 */
1159 HighlightAnnotation();
1160
1161 /**
1162 * Creates a new highlight annotation from the xml @p description
1163 */
1164 explicit HighlightAnnotation(const QDomNode &description);
1165
1166 /**
1167 * Destroys the highlight annotation.
1168 */
1169 ~HighlightAnnotation() override;
1170
1171 /**
1172 * Sets the @p type of the highlight annotation.
1173 * @see HighlightType
1174 */
1175 void setHighlightType(HighlightType type);
1176
1177 /**
1178 * Returns the type of the highlight annotation.
1179 */
1180 HighlightType highlightType() const;
1181
1182 /**
1183 * @short Describes a highlight quad of a text markup annotation.
1184 *
1185 * The Quad is a closed path of 4 NormalizedPoints.
1186 * Another set of 4 NormalizedPoints can be generated with transform(),
1187 * e. g. to get highlighting coordinates on a rotated PageViewItem.
1188 * Additionally, Quad stores some geometry related style attributes.
1189 *
1190 * To enable correct rendering of the annotation,
1191 * the points 0 and 1 must describe the bottom edge of the quad
1192 * (relative to the text orientation).
1193 *
1194 * @see NormalizedPoint
1195 */
1196 class OKULARCORE_EXPORT Quad
1197 {
1198 public:
1199 /**
1200 * Creates a new quad.
1201 */
1202 Quad();
1203
1204 /**
1205 * Destroys the quad.
1206 */
1207 ~Quad();
1208
1209 Quad(const Quad &other);
1210 Quad &operator=(const Quad &other);
1211
1212 /**
1213 * Sets the normalized @p point at @p index.
1214 *
1215 * @p index must be between 0 and 3.
1216 */
1217 void setPoint(const NormalizedPoint &point, int index);
1218
1219 /**
1220 * Returns the normalized point at @p index.
1221 *
1222 * @p index must be between 0 and 3.
1223 */
1224 NormalizedPoint point(int index) const;
1225
1226 /**
1227 * Returns the transformed (e.g. rotated) normalized point at @p index.
1228 *
1229 * @p index must be between 0 and 3.
1230 */
1231 NormalizedPoint transformedPoint(int index) const;
1232
1233 /**
1234 * Sets whether a cap should be used at the start.
1235 */
1236 void setCapStart(bool value);
1237
1238 /**
1239 * Returns whether a cap should be used at the start.
1240 */
1241 bool capStart() const;
1242
1243 /**
1244 * Sets whether a cap should be used at the end.
1245 */
1246 void setCapEnd(bool value);
1247
1248 /**
1249 * Returns whether a cap should be used at the end.
1250 */
1251 bool capEnd() const;
1252
1253 /**
1254 * Sets the @p width of the drawing feather.
1255 */
1256 void setFeather(double width);
1257
1258 /**
1259 * Returns the width of the drawing feather.
1260 */
1261 double feather() const;
1262
1263 /**
1264 * Transforms the quad coordinates with the transformation defined
1265 * by @p matrix.
1266 *
1267 * The transformed coordinates will be accessible with transformedPoint().
1268 * The coordinates returned by point() are not affected.
1269 */
1270 void transform(const QTransform &matrix);
1271
1272 private:
1273 class Private;
1274 Private *const d;
1275 };
1276
1277 /**
1278 * Returns a reference to the quad list of the highlight annotation.
1279 */
1280 QList<Quad> &highlightQuads();
1281
1282 /**
1283 * Returns a const reference to the quad list of the highlight annotation.
1284 * @since 20.12
1285 */
1286 const QList<Quad> &highlightQuads() const;
1287
1288 /**
1289 * Returns the sub type of the highlight annotation.
1290 */
1291 SubType subType() const override;
1292
1293 /**
1294 * Stores the highlight annotation as xml in @p document
1295 * under the given parent @p node.
1296 */
1297 void store(QDomNode &node, QDomDocument &document) const override;
1298
1299private:
1300 Q_DECLARE_PRIVATE(HighlightAnnotation)
1301 Q_DISABLE_COPY(HighlightAnnotation)
1302};
1303
1304class OKULARCORE_EXPORT StampAnnotation : public Annotation
1305{
1306public:
1307 /**
1308 * Creates a new stamp annotation.
1309 */
1310 StampAnnotation();
1311
1312 /**
1313 * Creates a new stamp annotation from the xml @p description
1314 */
1315 explicit StampAnnotation(const QDomNode &description);
1316
1317 /**
1318 * Destroys the stamp annotation.
1319 */
1320 ~StampAnnotation() override;
1321
1322 /**
1323 * Sets the @p name of the icon for the stamp annotation.
1324 */
1325 void setStampIconName(const QString &name);
1326
1327 /**
1328 * Returns the name of the icon.
1329 */
1330 QString stampIconName() const;
1331
1332 /**
1333 * Returns the sub type of the stamp annotation.
1334 */
1335 SubType subType() const override;
1336
1337 /**
1338 * Stores the stamp annotation as xml in @p document
1339 * under the given parent @p node.
1340 */
1341 void store(QDomNode &node, QDomDocument &document) const override;
1342
1343private:
1344 Q_DECLARE_PRIVATE(StampAnnotation)
1345 Q_DISABLE_COPY(StampAnnotation)
1346};
1347
1348#if HAVE_NEW_SIGNATURE_API
1349/**
1350 * \since 24.12
1351 */
1352class OKULARCORE_EXPORT SignatureAnnotation : public Annotation
1353{
1354public:
1355 /**
1356 * Creates a new signature annotation.
1357 */
1358 SignatureAnnotation();
1359
1360 /**
1361 * Destroys the signature annotation.
1362 */
1363 ~SignatureAnnotation() override;
1364
1365 QString text() const;
1366 void setText(const QString &text);
1367
1368 QString leftText() const;
1369 void setLeftText(const QString &text);
1370
1371 QString imagePath() const;
1372 void setImagePath(const QString &imagePath);
1373
1374 QString fieldPartialName() const;
1375 void setFieldPartialName(const QString &fieldPartialName);
1376
1377 double fontSize() const;
1378 void setFontSize(double fontSize);
1379
1380 double leftFontSize() const;
1381 void setLeftFontSize(double fontSize);
1382
1383 int page() const;
1384 void setPage(int page);
1385
1386 void setSignFunction(std::function<SigningResult(const Okular::NewSignatureData &, const QString &)> func);
1387
1388 SigningResult sign(const Okular::NewSignatureData &data, const QString &fileName);
1389
1390 /**
1391 * Returns the sub type of the stamp annotation.
1392 */
1393 SubType subType() const override;
1394
1395 /**
1396 * Stores the stamp annotation as xml in @p document
1397 * under the given parent @p node.
1398 */
1399 void store(QDomNode &node, QDomDocument &document) const override;
1400
1401private:
1402 Q_DECLARE_PRIVATE(SignatureAnnotation)
1403 Q_DISABLE_COPY(SignatureAnnotation)
1404};
1405#endif
1406
1407class OKULARCORE_EXPORT InkAnnotation : public Annotation
1408{
1409public:
1410 /**
1411 * Creates a new ink annotation.
1412 */
1413 InkAnnotation();
1414
1415 /**
1416 * Creates a new ink annotation from the xml @p description
1417 */
1418 explicit InkAnnotation(const QDomNode &description);
1419
1420 /**
1421 * Destroys the ink annotation.
1422 */
1423 ~InkAnnotation() override;
1424
1425 /**
1426 * Sets the @p paths of points for the ink annotation.
1427 *
1428 * @since 22.08
1429 */
1430 void setInkPaths(const QList<QList<NormalizedPoint>> &paths);
1431
1432 /**
1433 * Returns the paths of points of the ink annotation.
1434 *
1435 * @since 22.08
1436 */
1437 QList<QList<NormalizedPoint>> inkPaths() const;
1438
1439 /**
1440 * Returns the paths of transformed (e.g. rotated) points of
1441 * the ink annotation.
1442 *
1443 * @since 22.08
1444 */
1445 QList<QList<NormalizedPoint>> transformedInkPaths() const;
1446
1447 /**
1448 * Returns the sub type of the ink annotation.
1449 */
1450 SubType subType() const override;
1451
1452 /**
1453 * Stores the ink annotation as xml in @p document
1454 * under the given parent @p node.
1455 */
1456 void store(QDomNode &node, QDomDocument &document) const override;
1457
1458private:
1459 Q_DECLARE_PRIVATE(InkAnnotation)
1460 Q_DISABLE_COPY(InkAnnotation)
1461};
1462
1463class OKULARCORE_EXPORT CaretAnnotation : public Annotation
1464{
1465public:
1466 /**
1467 * Describes the highlighting style of the annotation.
1468 */
1469 enum CaretSymbol {
1470 None, ///< No symbol to be associated with the text
1471 P ///< A 'paragraph' symbol
1472 };
1473
1474 /**
1475 * Creates a new caret annotation.
1476 */
1477 CaretAnnotation();
1478
1479 /**
1480 * Creates a new caret annotation from the xml @p description
1481 */
1482 explicit CaretAnnotation(const QDomNode &description);
1483
1484 /**
1485 * Destroys the caret annotation.
1486 */
1487 ~CaretAnnotation() override;
1488
1489 /**
1490 * Sets the @p symbol for the caret annotation.
1491 */
1492 void setCaretSymbol(CaretAnnotation::CaretSymbol symbol);
1493
1494 /**
1495 * Returns the symbol of the annotation.
1496 */
1497 CaretAnnotation::CaretSymbol caretSymbol() const;
1498
1499 /**
1500 * Returns the sub type of the caret annotation.
1501 */
1502 SubType subType() const override;
1503
1504 /**
1505 * Stores the caret annotation as xml in @p document
1506 * under the given parent @p node.
1507 */
1508 void store(QDomNode &node, QDomDocument &document) const override;
1509
1510private:
1511 Q_DECLARE_PRIVATE(CaretAnnotation)
1512 Q_DISABLE_COPY(CaretAnnotation)
1513};
1514
1515class OKULARCORE_EXPORT FileAttachmentAnnotation : public Annotation
1516{
1517public:
1518 /**
1519 * Creates a new file attachment annotation.
1520 */
1521 FileAttachmentAnnotation();
1522 /**
1523 * Creates a new file attachment annotation from the xml @p description
1524 */
1525 explicit FileAttachmentAnnotation(const QDomNode &description);
1526 /**
1527 * Destroys the file attachment annotation.
1528 */
1529 ~FileAttachmentAnnotation() override;
1530
1531 /**
1532 * Gets the name of the icon.
1533 */
1534 QString fileIconName() const;
1535
1536 /**
1537 * Sets the @p iconName of the icon for the file attachment annotation.
1538 */
1539 void setFileIconName(const QString &iconName);
1540
1541 /**
1542 * Gets the embedded file object.
1543 */
1544 EmbeddedFile *embeddedFile() const;
1545
1546 /**
1547 * Sets the @p ef representing the embedded file of the file
1548 * attachment annotation.
1549 */
1550 void setEmbeddedFile(EmbeddedFile *ef);
1551
1552 /**
1553 * Returns the sub type of the file attachment annotation.
1554 */
1555 SubType subType() const override;
1556
1557 /**
1558 * Stores the file attachment annotation as xml in @p document
1559 * under the given parent @p node.
1560 */
1561 void store(QDomNode &node, QDomDocument &document) const override;
1562
1563private:
1564 Q_DECLARE_PRIVATE(FileAttachmentAnnotation)
1565 Q_DISABLE_COPY(FileAttachmentAnnotation)
1566};
1567
1568/**
1569 * \short Sound annotation.
1570 *
1571 * The sound annotation represents a sound to be played when activated.
1572 *
1573 * @since 0.7 (KDE 4.1)
1574 */
1575class OKULARCORE_EXPORT SoundAnnotation : public Annotation
1576{
1577public:
1578 /**
1579 * Creates a new sound annotation.
1580 */
1582 /**
1583 * Creates a new sound annotation from the xml @p description
1584 */
1585 explicit SoundAnnotation(const QDomNode &description);
1586 /**
1587 * Destroys the sound annotation.
1588 */
1589 ~SoundAnnotation() override;
1590
1591 /**
1592 * Gets the name of the icon.
1593 */
1594 QString soundIconName() const;
1595
1596 /**
1597 * Sets the @p iconName of the icon for the sound annotation.
1598 */
1599 void setSoundIconName(const QString &iconName);
1600
1601 /**
1602 * Gets the sound object.
1603 */
1604 Sound *sound() const;
1605
1606 /**
1607 * Sets the @p s representing the sound of the file
1608 * attachment annotation.
1609 */
1610 void setSound(Sound *s);
1611
1612 /**
1613 * Returns the sub type of the sound annotation.
1614 */
1615 SubType subType() const override;
1616
1617 /**
1618 * Stores the sound annotation as xml in @p document
1619 * under the given parent @p node.
1620 */
1621 void store(QDomNode &node, QDomDocument &document) const override;
1622
1623private:
1624 Q_DECLARE_PRIVATE(SoundAnnotation)
1625 Q_DISABLE_COPY(SoundAnnotation)
1626};
1627
1628/**
1629 * \short Movie annotation.
1630 *
1631 * The movie annotation represents a movie to be played when activated.
1632 *
1633 * @since 0.8 (KDE 4.2)
1634 */
1635class OKULARCORE_EXPORT MovieAnnotation : public Annotation
1636{
1637public:
1638 /**
1639 * Creates a new movie annotation.
1640 */
1642 /**
1643 * Creates a new movie annotation from the xml @p description
1644 */
1645 explicit MovieAnnotation(const QDomNode &description);
1646 /**
1647 * Destroys the movie annotation.
1648 */
1649 ~MovieAnnotation() override;
1650 /**
1651 * Gets the movie object.
1652 */
1653 Movie *movie() const;
1654 /**
1655 * Sets the new @p movie object.
1656 */
1657 void setMovie(Movie *movie);
1658 /**
1659 * Returns the sub type of the movie annotation.
1660 */
1661 SubType subType() const override;
1662 /**
1663 * Stores the movie annotation as xml in @p document
1664 * under the given @p parentNode.
1665 */
1666 void store(QDomNode &parentNode, QDomDocument &document) const override;
1667
1668private:
1669 Q_DECLARE_PRIVATE(MovieAnnotation)
1670 Q_DISABLE_COPY(MovieAnnotation)
1671};
1672
1673/**
1674 * \short Screen annotation.
1675 *
1676 * The screen annotation specifies a region of a page upon which media clips
1677 * may be played. It also serves as an object from which actions can be triggered.
1678 *
1679 * @since 0.16 (KDE 4.10)
1680 */
1681class OKULARCORE_EXPORT ScreenAnnotation : public Annotation
1682{
1683public:
1684 /**
1685 * Creates a new screen annotation.
1686 */
1688
1689 /**
1690 * Creates a new screen annotation from the xml @p description
1691 */
1692 explicit ScreenAnnotation(const QDomNode &description);
1693
1694 /**
1695 * Destroys the screen annotation.
1696 */
1697 ~ScreenAnnotation() override;
1698
1699 /**
1700 * Returns the sub type of the screen annotation.
1701 */
1702 SubType subType() const override;
1703
1704 /**
1705 * Stores the screen annotation as xml in @p document
1706 * under the given @p parentNode.
1707 */
1708 void store(QDomNode &parentNode, QDomDocument &document) const override;
1709
1710 /**
1711 * Sets the @p action that is executed when the annotation is triggered.
1712 *
1713 * @since 0.16 (KDE 4.10)
1714 */
1715 void setAction(Action *action);
1716
1717 /**
1718 * Returns the action that is executed when the annotation is triggered or @c 0 if not action has been defined.
1719 *
1720 * @since 0.16 (KDE 4.10)
1721 */
1722 Action *action() const;
1723
1724 /**
1725 * Sets the additional @p action of the given @p type.
1726 *
1727 * @since 0.16 (KDE 4.10)
1728 */
1729 void setAdditionalAction(AdditionalActionType type, Action *action);
1730
1731 /**
1732 * Returns the additional action of the given @p type or @c 0 if no action has been defined.
1733 *
1734 * @since 0.16 (KDE 4.10)
1735 */
1736 Action *additionalAction(AdditionalActionType type) const;
1737
1738private:
1739 Q_DECLARE_PRIVATE(ScreenAnnotation)
1740 Q_DISABLE_COPY(ScreenAnnotation)
1741};
1742
1743/**
1744 * \short Widget annotation.
1745 *
1746 * The widget annotation represents a widget on a page.
1747 *
1748 * @since 0.16 (KDE 4.10)
1749 */
1750class OKULARCORE_EXPORT WidgetAnnotation : public Annotation
1751{
1752public:
1753 /**
1754 * Creates a new widget annotation.
1755 */
1757
1758 /**
1759 * Creates a new widget annotation from the xml @p description
1760 */
1761 explicit WidgetAnnotation(const QDomNode &description);
1762
1763 /**
1764 * Destroys the widget annotation.
1765 */
1766 ~WidgetAnnotation() override;
1767
1768 /**
1769 * Returns the sub type of the widget annotation.
1770 */
1771 SubType subType() const override;
1772
1773 /**
1774 * Stores the widget annotation as xml in @p document
1775 * under the given @p parentNode.
1776 */
1777 void store(QDomNode &parentNode, QDomDocument &document) const override;
1778
1779 /**
1780 * Sets the additional @p action of the given @p type.
1781 *
1782 * @since 0.16 (KDE 4.10)
1783 */
1784 void setAdditionalAction(AdditionalActionType type, Action *action);
1785
1786 /**
1787 * Returns the additional action of the given @p type or @c 0 if no action has been defined.
1788 *
1789 * @since 0.16 (KDE 4.10)
1790 */
1791 Action *additionalAction(AdditionalActionType type) const;
1792
1793private:
1794 Q_DECLARE_PRIVATE(WidgetAnnotation)
1795 Q_DISABLE_COPY(WidgetAnnotation)
1796};
1797
1798/**
1799 * \short RichMedia annotation.
1800 *
1801 * The rich media annotation represents an video or sound on a page.
1802 *
1803 * @since 1.0
1804 */
1805class OKULARCORE_EXPORT RichMediaAnnotation : public Annotation
1806{
1807public:
1808 /**
1809 * Creates a new rich media annotation.
1810 */
1812
1813 /**
1814 * Creates a new rich media annotation from the xml @p description
1815 */
1816 explicit RichMediaAnnotation(const QDomNode &description);
1817
1818 /**
1819 * Destroys the rich media annotation.
1820 */
1821 ~RichMediaAnnotation() override;
1822
1823 /**
1824 * Returns the sub type of the rich media annotation.
1825 */
1826 SubType subType() const override;
1827
1828 /**
1829 * Stores the rich media annotation as xml in @p document
1830 * under the given @p parentNode.
1831 */
1832 void store(QDomNode &parentNode, QDomDocument &document) const override;
1833
1834 /**
1835 * Gets the movie object.
1836 */
1837 Movie *movie() const;
1838
1839 /**
1840 * Sets the new @p movie object.
1841 */
1842 void setMovie(Movie *movie);
1843
1844 /**
1845 * Sets the @p embeddedFile representing the embedded file.
1846 */
1847 void setEmbeddedFile(EmbeddedFile *embeddedFile);
1848
1849 /**
1850 * Gets the embedded file object.
1851 */
1852 EmbeddedFile *embeddedFile() const;
1853
1854private:
1855 Q_DECLARE_PRIVATE(RichMediaAnnotation)
1856 Q_DISABLE_COPY(RichMediaAnnotation)
1857};
1858
1859}
1860
1861#endif
Encapsulates data that describes an action.
Definition action.h:41
This class describes the object rectangle for an annotation.
Definition area.h:556
Native annotation interface.
virtual bool supports(Capability capability) const =0
Query for the supported capabilities.
virtual void notifyRemoval(Annotation *annotation, int page)=0
Called when an existing annotation at a given page is removed.
virtual void notifyAddition(Annotation *annotation, int page)=0
Called when a new annotation is added to a page.
virtual void notifyModification(const Annotation *annotation, int page, bool appearanceChanged)=0
Called after an existing annotation at a given page is modified.
@ Modification
Generator can edit native annotations.
@ Addition
Generator can create native annotations.
Helper class for (recursive) annotation retrieval/storage.
Definition annotations.h:53
The Revision class contains all information about the revision of the annotation.
The Style class contains all information about style of the annotation.
The Window class contains all information about the popup window of the annotation that is used to ed...
Annotation struct holds properties shared by all annotations.
Definition annotations.h:99
RevisionType
Describes the type of revision information.
Flag
Describes additional properties of an annotation.
LineEffect
Describes possible line effects for.
RevisionScope
Describes the scope of revision information.
AdditionalActionType
Describes the type of additional actions.
@ FocusIn
Performed when the annotation receives the input focus.
@ PageClosing
Performed when the page containing the annotation is closed.
@ MousePressed
Performed when the mouse button is pressed inside the annotation's active area.
@ PageOpening
Performed when the page containing the annotation is opened.
@ MouseReleased
Performed when the mouse button is released inside the annotation's active area.
@ CursorEntering
Performed when the cursor enters the annotation's active area.
@ FocusOut
Performed when the annotation loses the input focus.
@ CursorLeaving
Performed when the cursor exists the annotation's active area.
LineStyle
Describes possible line styles for.
SubType
Describes the type of annotation as defined in PDF standard.
virtual SubType subType() const =0
Returns the sub type of the annotation.
The Document.
Definition document.h:192
An embedded file into the document.
Definition document.h:1555
Describes a highlight quad of a text markup annotation.
Movie annotation.
Contains information about a movie object.
Definition movie.h:26
Data needed to create a new signature.
Definition document.h:1638
NormalizedPoint is a helper class which stores the coordinates of a normalized point.
Definition area.h:117
A NormalizedRect is a rectangle which can be defined by two NormalizedPoints.
Definition area.h:189
An area with normalized coordinates that contains a reference to an object.
Definition area.h:458
Collector for all the data belonging to a page.
Definition page.h:48
RichMedia annotation.
Screen annotation.
Sound annotation.
Contains information about a sound object.
Definition sound.h:24
Widget annotation.
global.h
Definition action.h:17
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:58:33 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.