compile
[kdegraphics.git] / okular / core / annotations.h
blob3584073ba3624a0283d3ea75e37c2f7b8708df4d
1 /***************************************************************************
2 * Copyright (C) 2005 by Enrico Ros <eros.kde@email.it> *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 ***************************************************************************/
10 #ifndef _OKULAR_ANNOTATIONS_H_
11 #define _OKULAR_ANNOTATIONS_H_
13 #include <QtCore/QString>
14 #include <QtCore/QDateTime>
15 #include <QtCore/QLinkedList>
16 #include <QtCore/QRect>
17 #include <QtGui/QFont>
18 #include <QtXml/QDomDocument>
19 #include <QtXml/QDomElement>
21 #include <okular/core/okular_export.h>
22 #include <okular/core/area.h>
24 namespace Okular {
26 class Annotation;
27 class AnnotationObjectRect;
28 class AnnotationPrivate;
29 class Document;
30 class EmbeddedFile;
31 class Page;
32 class PagePrivate;
33 class Sound;
34 class Movie;
35 class TextAnnotationPrivate;
36 class LineAnnotationPrivate;
37 class GeomAnnotationPrivate;
38 class HighlightAnnotationPrivate;
39 class StampAnnotationPrivate;
40 class InkAnnotationPrivate;
41 class CaretAnnotationPrivate;
42 class FileAttachmentAnnotationPrivate;
43 class SoundAnnotationPrivate;
44 class MovieAnnotationPrivate;
46 /**
47 * @short Helper class for (recursive) annotation retrieval/storage.
49 class OKULAR_EXPORT AnnotationUtils
51 public:
52 /**
53 * Restore an annotation (with revisions if needed) from the dom @p element.
55 * Returns a pointer to the complete annotation or 0 if element is invalid.
57 static Annotation * createAnnotation( const QDomElement & element );
59 /**
60 * Saves the @p annotation as a child of @p element taking
61 * care of saving all revisions if it has any.
63 static void storeAnnotation( const Annotation * annotation,
64 QDomElement & element, QDomDocument & document );
66 /**
67 * Returns the child element with the given @p name from the direct
68 * children of @p parentNode or a null element if not found.
70 static QDomElement findChildElement( const QDomNode & parentNode,
71 const QString & name );
73 /**
74 * Returns the geometry of the given @p annotation scaled by
75 * @p scaleX and @p scaleY.
77 static QRect annotationGeometry( const Annotation * annotation,
78 double scaleX, double scaleY );
81 /**
82 * @short Annotation struct holds properties shared by all annotations.
84 * An Annotation is an object (text note, highlight, sound, popup window, ..)
85 * contained by a Page in the document.
87 * For current state in relations to pdf embedded annotations:
88 * @see generator_pdf/README.Annotations
90 class OKULAR_EXPORT Annotation
92 /// @cond PRIVATE
93 friend class AnnotationObjectRect;
94 friend class Document;
95 friend class Page;
96 friend class PagePrivate;
97 /// @endcond
99 public:
101 * Describes the type of annotation as defined in PDF standard.
103 enum SubType
105 AText = 1, ///< A textual annotation
106 ALine = 2, ///< A line annotation
107 AGeom = 3, ///< A geometrical annotation
108 AHighlight = 4, ///< A highlight annotation
109 AStamp = 5, ///< A stamp annotation
110 AInk = 6, ///< An ink annotation
111 ACaret = 8, ///< A caret annotation
112 AFileAttachment = 9, ///< A file attachment annotation
113 ASound = 10, ///< A sound annotation
114 AMovie = 11, ///< A movie annotation
115 A_BASE = 0 ///< The annotation base class
119 * Describes additional properties of an annotation.
121 enum Flag
123 Hidden = 1, ///< Is not shown in the document
124 FixedSize = 2, ///< Has a fixed size
125 FixedRotation = 4, ///< Has a fixed rotation
126 DenyPrint = 8, ///< Cannot be printed
127 DenyWrite = 16, ///< Cannot be changed
128 DenyDelete = 32, ///< Cannot be deleted
129 ToggleHidingOnMouse = 64, ///< Can be hidden/shown by mouse click
130 External = 128 ///< Is stored external
134 * Describes possible line styles for @see ALine annotation.
136 enum LineStyle
138 Solid = 1, ///< A solid line
139 Dashed = 2, ///< A dashed line
140 Beveled = 4, ///< A beveled line
141 Inset = 8, ///< A inseted line
142 Underline = 16 ///< An underline
146 * Describes possible line effects for @see ALine annotation.
148 enum LineEffect
150 NoEffect = 1, ///< No effect
151 Cloudy = 2 ///< The cloudy effect
155 * Describes the scope of revision information.
157 enum RevisionScope
159 Reply = 1, ///< Belongs to a reply
160 Group = 2, ///< Belongs to a group
161 Delete = 4 ///< Belongs to a deleted paragraph
165 * Describes the type of revision information.
167 enum RevisionType
169 None = 1, ///< Not specified
170 Marked = 2, ///< Is marked
171 Unmarked = 4, ///< Is unmarked
172 Accepted = 8, ///< Has been accepted
173 Rejected = 16, ///< Was rejected
174 Cancelled = 32, ///< Has been cancelled
175 Completed = 64 ///< Has been completed
179 * A function to be called when the annotation is destroyed.
181 * @warning the function must *not* call any virtual function,
182 * nor subcast.
184 * @since 0.7 (KDE 4.1)
186 typedef void ( * DisposeDataFunction )( const Okular::Annotation * );
189 * Destroys the annotation.
191 virtual ~Annotation();
194 * Sets the @p author of the annotation.
196 void setAuthor( const QString &author );
199 * Returns the author of the annotation.
201 QString author() const;
204 * Sets the @p contents of the annotation.
206 void setContents( const QString &contents );
209 * Returns the contents of the annotation.
211 QString contents() const;
214 * Sets the unique @p name of the annotation.
216 void setUniqueName( const QString &name );
219 * Returns the unique name of the annotation.
221 QString uniqueName() const;
224 * Sets the last modification @p date of the annotation.
226 * The date must be before or equal to QDateTime::currentDateTime()
228 void setModificationDate( const QDateTime &date );
231 * Returns the last modification date of the annotation.
233 QDateTime modificationDate() const;
236 * Sets the creation @p date of the annotation.
238 * The date must be before or equal to @see modificationDate()
240 void setCreationDate( const QDateTime &date );
243 * Returns the creation date of the annotation.
245 QDateTime creationDate() const;
248 * Sets the @p flags of the annotation.
249 * @see @ref Flag
251 void setFlags( int flags );
254 * Returns the flags of the annotation.
255 * @see @ref Flag
257 int flags() const;
260 * Sets the bounding @p rectangle of the annotation.
262 void setBoundingRectangle( const NormalizedRect &rectangle );
265 * Returns the bounding rectangle of the annotation.
267 NormalizedRect boundingRectangle() const;
270 * Returns the transformed bounding rectangle of the annotation.
272 * This rectangle must be used when showing annotations on screen
273 * to have them rotated correctly.
275 NormalizedRect transformedBoundingRectangle() const;
278 * Move the annotation by the specified coordinates.
280 * @see canBeMoved()
282 void translate( const NormalizedPoint &coord );
285 * The Style class contains all information about style of the
286 * annotation.
288 class OKULAR_EXPORT Style
290 public:
292 * Creates a new style.
294 Style();
297 * Destroys the style.
299 ~Style();
301 Style( const Style &other );
302 Style& operator=( const Style &other );
305 * Sets the @p color of the style.
307 void setColor( const QColor &color );
310 * Returns the color of the style.
312 QColor color() const;
315 * Sets the @p opacity of the style.
317 void setOpacity( double opacity );
320 * Returns the opacity of the style.
322 double opacity() const;
325 * Sets the @p width of the style.
327 void setWidth( double width );
330 * Returns the width of the style.
332 double width() const;
335 * Sets the line @p style of the style.
337 void setLineStyle( LineStyle style );
340 * Returns the line style of the style.
342 LineStyle lineStyle() const;
345 * Sets the x-corners of the style.
347 void setXCorners( double xCorners );
350 * Returns the x-corners of the style.
352 double xCorners() const;
355 * Sets the y-corners of the style.
357 void setYCorners( double yCorners );
360 * Returns the y-corners of the style.
362 double yCorners() const;
365 * Sets the @p marks of the style.
367 void setMarks( int marks );
370 * Returns the marks of the style.
372 int marks() const;
375 * Sets the @p spaces of the style.
377 void setSpaces( int spaces );
380 * Returns the spaces of the style.
382 int spaces() const;
385 * Sets the line @p effect of the style.
387 void setLineEffect( LineEffect effect );
390 * Returns the line effect of the style.
392 LineEffect lineEffect() const;
395 * Sets the effect @p intensity of the style.
397 void setEffectIntensity( double intensity );
400 * Returns the effect intensity of the style.
402 double effectIntensity() const;
404 private:
405 class Private;
406 Private* const d;
410 * Returns a reference to the style object of the annotation.
412 Style & style();
415 * Returns a const reference to the style object of the annotation.
417 const Style & style() const;
420 * The Window class contains all information about the popup window
421 * of the annotation that is used to edit the content and properties.
423 class OKULAR_EXPORT Window
425 public:
427 * Creates a new window.
429 Window();
432 * Destroys the window.
434 ~Window();
436 Window( const Window &other );
437 Window& operator=( const Window &other );
440 * Sets the @p flags of the window.
442 void setFlags( int flags );
445 * Returns the flags of the window.
447 int flags() const;
450 * Sets the top-left @p point of the window.
452 void setTopLeft( const NormalizedPoint &point );
455 * Returns the top-left point of the window.
457 NormalizedPoint topLeft() const;
460 * Sets the @p width of the window.
462 void setWidth( int width );
465 * Returns the width of the window.
467 int width() const;
470 * Sets the @p height of the window.
472 void setHeight( int height );
475 * Returns the height of the window.
477 int height() const;
480 * Sets the @p title of the window.
482 void setTitle( const QString &title );
485 * Returns the title of the window.
487 QString title() const;
490 * Sets the @p summary of the window.
492 void setSummary( const QString &summary );
495 * Returns the summary of the window.
497 QString summary() const;
500 * Sets the @p text of the window.
502 void setText( const QString &text );
505 * Returns the text of the window.
507 QString text() const;
509 private:
510 class Private;
511 Private* const d;
515 * Returns a reference to the window object of the annotation.
517 Window & window();
520 * Returns a const reference to the window object of the annotation.
522 const Window & window() const;
525 * The Revision class contains all information about the revision
526 * of the annotation.
528 class Revision
530 public:
532 * Creates a new revision.
534 Revision();
537 * Destroys the revision.
539 ~Revision();
541 Revision( const Revision &other );
542 Revision& operator=( const Revision &other );
545 * Sets the @p annotation the revision belongs to.
547 void setAnnotation( Annotation *annotation );
550 * Returns the annotation the revision belongs to.
552 Annotation *annotation() const;
555 * Sets the @p scope of the revision.
556 * @see RevisionScope
558 void setScope( RevisionScope scope );
561 * Returns the scope of the revision.
563 RevisionScope scope() const;
566 * Sets the @p type of the revision.
567 * @see RevisionType
569 void setType( RevisionType type );
572 * Returns the type of the revision.
574 RevisionType type() const;
576 private:
577 class Private;
578 Private* const d;
582 * Returns a reference to the revision list of the annotation.
584 QLinkedList< Revision > & revisions();
587 * Returns a reference to the revision list of the annotation.
589 const QLinkedList< Revision > & revisions() const;
592 * Sets the "native" @p id of the annotation.
594 * This is for use of the Generator, that can optionally store an
595 * handle (a pointer, an identifier, etc) of the "native" annotation
596 * object, if any.
598 * @note Okular makes no use of this
600 * @since 0.7 (KDE 4.1)
602 void setNativeId( const QVariant &id );
605 * Returns the "native" id of the annotation.
607 * @since 0.7 (KDE 4.1)
609 QVariant nativeId() const;
612 * Sets a function to be called when the annotation is destroyed.
614 * @warning the function must *not* call any virtual function,
615 * nor subcast.
617 * @since 0.7 (KDE 4.1)
619 void setDisposeDataFunction( DisposeDataFunction func );
622 * Returns whether the annotation can be moved.
624 * @since 0.7 (KDE 4.1)
626 bool canBeMoved() const;
629 * Returns the sub type of the annotation.
631 virtual SubType subType() const = 0;
634 * Stores the annotation as xml in @p document under the given parent @p node.
636 virtual void store( QDomNode & node, QDomDocument & document ) const;
638 protected:
639 /// @cond PRIVATE
640 Annotation( AnnotationPrivate &dd );
641 Annotation( AnnotationPrivate &dd, const QDomNode &description );
642 Q_DECLARE_PRIVATE( Annotation )
643 AnnotationPrivate *d_ptr;
644 /// @endcond
646 private:
647 Q_DISABLE_COPY( Annotation )
650 class OKULAR_EXPORT TextAnnotation : public Annotation
652 public:
654 * Describes the type of the text.
656 enum TextType
658 Linked, ///< The annotation is linked to a text
659 InPlace ///< The annotation is located next to the text
663 * Describes the style of the text.
665 enum InplaceIntent
667 Unknown, ///< Unknown style
668 Callout, ///< Callout style
669 TypeWriter ///< Type writer style
673 * Creates a new text annotation.
675 TextAnnotation();
678 * Creates a new text annotation from the xml @p description
680 TextAnnotation( const QDomNode &description );
683 * Destroys the text annotation.
685 ~TextAnnotation();
688 * Sets the text @p type of the text annotation.
689 * @see TextType
691 void setTextType( TextType type );
694 * Returns the text type of the text annotation.
696 TextType textType() const;
699 * Sets the @p icon of the text annotation.
701 void setTextIcon( const QString &icon );
704 * Returns the icon of the text annotation.
706 QString textIcon() const;
709 * Sets the @p font of the text annotation.
711 void setTextFont( const QFont &font );
714 * Returns the font of the text annotation.
716 QFont textFont() const;
719 * Sets the inplace @p alignment of the text annotation.
721 void setInplaceAlignment( int alignment );
724 * Returns the inplace alignment of the text annotation.
726 int inplaceAlignment() const;
729 * Sets the inplace @p text of the text annotation.
731 void setInplaceText( const QString &text );
734 * Returns the inplace text of the text annotation.
736 QString inplaceText() const;
739 * Sets the inplace callout @p point at @p index.
741 * @p index must be between 0 and 2.
743 void setInplaceCallout( const NormalizedPoint &point, int index );
746 * Returns the inplace callout point for @p index.
748 * @p index must be between 0 and 2.
750 NormalizedPoint inplaceCallout( int index ) const;
753 * Returns the transformed (e.g. rotated) inplace callout point for @p index.
755 * @p index must be between 0 and 2.
757 NormalizedPoint transformedInplaceCallout( int index ) const;
760 * Returns the inplace @p intent of the text annotation.
761 * @see InplaceIntent
763 void setInplaceIntent( InplaceIntent intent );
766 * Returns the inplace intent of the text annotation.
768 InplaceIntent inplaceIntent() const;
771 * Returns the sub type of the text annotation.
773 SubType subType() const;
776 * Stores the text annotation as xml in @p document under the given parent @p node.
778 void store( QDomNode &node, QDomDocument &document ) const;
780 private:
781 Q_DECLARE_PRIVATE( TextAnnotation )
782 Q_DISABLE_COPY( TextAnnotation )
785 class OKULAR_EXPORT LineAnnotation : public Annotation
787 public:
789 * Describes the line ending style.
791 enum TermStyle
793 Square, ///< Using a square
794 Circle, ///< Using a circle
795 Diamond, ///< Using a diamond
796 OpenArrow, ///< Using an open arrow
797 ClosedArrow, ///< Using a closed arrow
798 None, ///< No special ending style
799 Butt, ///< Using a butt ending
800 ROpenArrow, ///< Using an arrow opened at the right side
801 RClosedArrow, ///< Using an arrow closed at the right side
802 Slash ///< Using a slash
806 * Describes the line intent.
808 enum LineIntent
810 Unknown, ///< Unknown intent
811 Arrow, ///< Arrow intent
812 Dimension, ///< Dimension intent
813 PolygonCloud ///< Polygon cloud intent
817 * Creates a new line annotation.
819 LineAnnotation();
822 * Creates a new line annotation from the xml @p description
824 explicit LineAnnotation( const QDomNode &description );
827 * Destroys the line annotation.
829 ~LineAnnotation();
832 * Sets the normalized line @p points of the line annotation.
834 void setLinePoints( const QLinkedList<NormalizedPoint> &points );
837 * Returns the normalized line points of the line annotation.
839 QLinkedList<NormalizedPoint> linePoints() const;
842 * Returns the transformed (e.g. rotated) normalized line points
843 * of the line annotation.
845 QLinkedList<NormalizedPoint> transformedLinePoints() const;
848 * Sets the line starting @p style of the line annotation.
849 * @see TermStyle
851 void setLineStartStyle( TermStyle style );
854 * Returns the line starting style of the line annotation.
856 TermStyle lineStartStyle() const;
859 * Sets the line ending @p style of the line annotation.
860 * @see TermStyle
862 void setLineEndStyle( TermStyle style );
865 * Returns the line ending style of the line annotation.
867 TermStyle lineEndStyle() const;
870 * Sets whether the line shall be @p closed.
872 void setLineClosed( bool closed );
875 * Returns whether the line shall be closed.
877 bool lineClosed() const;
880 * Sets the inner line @p color of the line annotation.
882 void setLineInnerColor( const QColor &color );
885 * Returns the inner line color of the line annotation.
887 QColor lineInnerColor() const;
890 * Sets the leading forward @p point of the line annotation.
892 void setLineLeadingForwardPoint( double point );
895 * Returns the leading forward point of the line annotation.
897 double lineLeadingForwardPoint() const;
900 * Sets the leading backward @p point of the line annotation.
902 void setLineLeadingBackwardPoint( double point );
905 * Returns the leading backward point of the line annotation.
907 double lineLeadingBackwardPoint() const;
910 * Sets whether the caption shall be @p shown.
912 void setShowCaption( bool shown );
915 * Returns whether the caption shall be shown.
917 bool showCaption() const;
920 * Sets the line @p intent of the line annotation.
921 * @see LineIntent
923 void setLineIntent( LineIntent intent );
926 * Returns the line intent of the line annotation.
928 LineIntent lineIntent() const;
931 * Returns the sub type of the line annotation.
933 SubType subType() const;
936 * Stores the line annotation as xml in @p document under the given parent @p node.
938 void store( QDomNode &node, QDomDocument &document ) const;
940 private:
941 Q_DECLARE_PRIVATE( LineAnnotation )
942 Q_DISABLE_COPY( LineAnnotation )
945 class OKULAR_EXPORT GeomAnnotation : public Annotation
947 public:
948 // common enums
949 enum GeomType
951 InscribedSquare, ///< Draw a square
952 InscribedCircle ///< Draw a circle
956 * Creates a new geometrical annotation.
958 GeomAnnotation();
961 * Creates a new geometrical annotation from the xml @p description
963 GeomAnnotation( const QDomNode &description );
966 * Destroys the geometrical annotation.
968 ~GeomAnnotation();
971 * Sets the geometrical @p type of the geometrical annotation.
972 * @see GeomType
974 void setGeometricalType( GeomType type );
977 * Returns the geometrical type of the geometrical annotation.
979 GeomType geometricalType() const;
982 * Sets the inner @p color of the geometrical annotation.
984 void setGeometricalInnerColor( const QColor &color );
987 * Returns the inner color of the geometrical annotation.
989 QColor geometricalInnerColor() const;
992 * Sets the point @p width of the geometrical annotation.
994 KDE_DEPRECATED void setGeometricalPointWidth( int width );
997 * Returns the point width of the geometrical annotation.
999 KDE_DEPRECATED int geometricalPointWidth() const;
1002 * Returns the sub type of the geometrical annotation.
1004 SubType subType() const;
1007 * Stores the geometrical annotation as xml in @p document
1008 * under the given parent @p node.
1010 void store( QDomNode &node, QDomDocument &document ) const;
1012 private:
1013 Q_DECLARE_PRIVATE( GeomAnnotation )
1014 Q_DISABLE_COPY( GeomAnnotation )
1017 class OKULAR_EXPORT HighlightAnnotation : public Annotation
1019 public:
1021 * Describes the highlighting style of the annotation.
1023 enum HighlightType
1025 Highlight, ///< Highlights the text
1026 Squiggly, ///< Squiggles the text
1027 Underline, ///< Underlines the text
1028 StrikeOut ///< Strikes out the text
1032 * Creates a new highlight annotation.
1034 HighlightAnnotation();
1037 * Creates a new highlight annotation from the xml @p description
1039 explicit HighlightAnnotation( const QDomNode &description );
1042 * Destroys the highlight annotation.
1044 ~HighlightAnnotation();
1047 * Sets the @p type of the highlight annotation.
1048 * @see HighlightType
1050 void setHighlightType( HighlightType type );
1053 * Returns the type of the highlight annotation.
1055 HighlightType highlightType() const;
1058 * The Quad class contains 8 coordinates and style definitions
1059 * which describe a line part of the whole highlight annotation.
1061 class OKULAR_EXPORT Quad
1063 public:
1065 * Creates a new quad.
1067 Quad();
1070 * Destroys the quad.
1072 ~Quad();
1074 Quad( const Quad &other );
1075 Quad& operator=( const Quad &other );
1078 * Sets the normalized @p point at @p index.
1080 * @p index must be between 0 and 3.
1082 void setPoint( const NormalizedPoint &point, int index );
1085 * Returns the normalized point at @p index.
1087 * @p index must be between 0 and 3.
1089 NormalizedPoint point( int index ) const;
1092 * Returns the transformed (e.g. rotated) normalized point at @p index.
1094 * @p index must be between 0 and 3.
1096 NormalizedPoint transformedPoint( int index ) const;
1099 * Sets whether a cap should be used at the start.
1101 void setCapStart( bool value );
1104 * Returns whether a cap should be used at the start.
1106 bool capStart() const;
1109 * Sets whether a cap should be used at the end.
1111 void setCapEnd( bool value );
1114 * Returns whether a cap should be used at the end.
1116 bool capEnd() const;
1119 * Sets the @p width of the drawing feather.
1121 void setFeather( double width );
1124 * Returns the width of the drawing feather.
1126 double feather() const;
1129 * Transforms the quad coordinates with the transformation defined
1130 * by @p matrix.
1132 void transform( const QMatrix &matrix );
1134 private:
1135 class Private;
1136 Private* const d;
1140 * Returns a reference to the quad list of the highlight annotation.
1142 QList< Quad > & highlightQuads();
1145 * Returns the sub type of the highlight annotation.
1147 SubType subType() const;
1150 * Stores the highlight annotation as xml in @p document
1151 * under the given parent @p node.
1153 void store( QDomNode &node, QDomDocument &document ) const;
1155 private:
1156 Q_DECLARE_PRIVATE( HighlightAnnotation )
1157 Q_DISABLE_COPY( HighlightAnnotation )
1160 class OKULAR_EXPORT StampAnnotation : public Annotation
1162 public:
1164 * Creates a new stamp annotation.
1166 StampAnnotation();
1169 * Creates a new stamp annotation from the xml @p description
1171 explicit StampAnnotation( const QDomNode &description );
1174 * Destroys the stamp annotation.
1176 ~StampAnnotation();
1179 * Sets the @p name of the icon for the stamp annotation.
1181 void setStampIconName( const QString &name );
1184 * Returns the name of the icon.
1186 QString stampIconName() const;
1189 * Returns the sub type of the stamp annotation.
1191 SubType subType() const;
1194 * Stores the stamp annotation as xml in @p document
1195 * under the given parent @p node.
1197 void store( QDomNode &node, QDomDocument &document ) const;
1199 private:
1200 Q_DECLARE_PRIVATE( StampAnnotation )
1201 Q_DISABLE_COPY( StampAnnotation )
1204 class OKULAR_EXPORT InkAnnotation : public Annotation
1206 public:
1208 * Creates a new ink annotation.
1210 InkAnnotation();
1213 * Creates a new ink annotation from the xml @p description
1215 InkAnnotation( const QDomNode &description );
1218 * Destroys the ink annotation.
1220 ~InkAnnotation();
1223 * Sets the @p paths of points for the ink annotation.
1225 void setInkPaths( const QList< QLinkedList<NormalizedPoint> > &paths );
1228 * Returns the paths of points of the ink annotation.
1230 QList< QLinkedList<NormalizedPoint> > inkPaths() const;
1233 * Returns the paths of transformed (e.g. rotated) points of
1234 * the ink annotation.
1236 QList< QLinkedList<NormalizedPoint> > transformedInkPaths() const;
1239 * Returns the sub type of the ink annotation.
1241 SubType subType() const;
1244 * Stores the ink annotation as xml in @p document
1245 * under the given parent @p node.
1247 void store( QDomNode &node, QDomDocument &document ) const;
1249 private:
1250 Q_DECLARE_PRIVATE( InkAnnotation )
1251 Q_DISABLE_COPY( InkAnnotation )
1254 class OKULAR_EXPORT CaretAnnotation : public Annotation
1256 public:
1258 * Describes the highlighting style of the annotation.
1260 enum CaretSymbol
1262 None, ///< No symbol to be associated with the text
1263 P ///< A 'paragraph' symbol
1267 * Creates a new caret annotation.
1269 CaretAnnotation();
1272 * Creates a new caret annotation from the xml @p description
1274 explicit CaretAnnotation( const QDomNode &description );
1277 * Destroys the caret annotation.
1279 ~CaretAnnotation();
1282 * Sets the @p symbol for the caret annotation.
1284 void setCaretSymbol( CaretAnnotation::CaretSymbol symbol );
1287 * Returns the symbol of the annotation.
1289 CaretAnnotation::CaretSymbol caretSymbol() const;
1292 * Returns the sub type of the caret annotation.
1294 SubType subType() const;
1297 * Stores the caret annotation as xml in @p document
1298 * under the given parent @p node.
1300 void store( QDomNode &node, QDomDocument &document ) const;
1302 private:
1303 Q_DECLARE_PRIVATE( CaretAnnotation )
1304 Q_DISABLE_COPY( CaretAnnotation )
1307 class OKULAR_EXPORT FileAttachmentAnnotation : public Annotation
1309 public:
1311 * Creates a new file attachment annotation.
1313 FileAttachmentAnnotation();
1315 * Creates a new file attachment annotation from the xml @p description
1317 explicit FileAttachmentAnnotation( const QDomNode &description );
1319 * Destroys the file attachment annotation.
1321 virtual ~FileAttachmentAnnotation();
1324 * Gets the name of the icon.
1326 QString fileIconName() const;
1329 * Sets the @p name of the icon for the file attachment annotation.
1331 void setFileIconName( const QString &name );
1334 * Gets the embedded file object.
1336 EmbeddedFile* embeddedFile() const;
1339 * Sets the @p object representing the embedded file of the file
1340 * attachment annotation.
1342 void setEmbeddedFile( EmbeddedFile *object );
1345 * Returns the sub type of the file attachment annotation.
1347 SubType subType() const;
1350 * Stores the file attachment annotation as xml in @p document
1351 * under the given parent @p node.
1353 void store( QDomNode &node, QDomDocument &document ) const;
1355 private:
1356 Q_DECLARE_PRIVATE( FileAttachmentAnnotation )
1357 Q_DISABLE_COPY( FileAttachmentAnnotation )
1361 * \short Sound annotation.
1363 * The sound annotation represents a sound to be played when activated.
1365 * @since 0.7 (KDE 4.1)
1367 class OKULAR_EXPORT SoundAnnotation : public Annotation
1369 public:
1371 * Creates a new sound annotation.
1373 SoundAnnotation();
1375 * Creates a new sound annotation from the xml @p description
1377 SoundAnnotation( const QDomNode &description );
1379 * Destroys the sound annotation.
1381 virtual ~SoundAnnotation();
1384 * Gets the name of the icon.
1386 QString soundIconName() const;
1389 * Sets the @p name of the icon for the sound annotation.
1391 void setSoundIconName( const QString &name );
1394 * Gets the sound object.
1396 Sound* sound() const;
1399 * Sets the @p object representing the sound of the file
1400 * attachment annotation.
1402 void setSound( Sound *object );
1405 * Returns the sub type of the sound annotation.
1407 SubType subType() const;
1410 * Stores the sound annotation as xml in @p document
1411 * under the given parent @p node.
1413 void store( QDomNode &node, QDomDocument &document ) const;
1415 private:
1416 Q_DECLARE_PRIVATE( SoundAnnotation )
1417 Q_DISABLE_COPY( SoundAnnotation )
1421 * \short Movie annotation.
1423 * The movie annotation represents a movie to be played when activated.
1425 * @since 0.8 (KDE 4.2)
1427 class OKULAR_EXPORT MovieAnnotation : public Annotation
1429 public:
1431 * Creates a new movie annotation.
1433 MovieAnnotation();
1435 * Creates a new movie annotation from the xml @p description
1437 MovieAnnotation( const QDomNode &description );
1439 * Destroys the movie annotation.
1441 virtual ~MovieAnnotation();
1443 * Gets the movie object.
1445 Movie* movie() const;
1447 * Sets the new @p movie object.
1449 void setMovie( Movie *movie );
1451 * Returns the sub type of the movie annotation.
1453 SubType subType() const;
1455 * Stores the movie annotation as xml in @p document
1456 * under the given @p parentNode.
1458 void store( QDomNode &parentNode, QDomDocument &document ) const;
1460 private:
1461 Q_DECLARE_PRIVATE( MovieAnnotation )
1462 Q_DISABLE_COPY( MovieAnnotation )
1467 #endif