7#ifndef _OKULAR_ANNOTATIONS_H_
8#define _OKULAR_ANNOTATIONS_H_
11#include <QDomDocument>
18#include "okularcore_export.h"
24class AnnotationObjectRect;
25class AnnotationPrivate;
32class TextAnnotationPrivate;
33class LineAnnotationPrivate;
34class GeomAnnotationPrivate;
35class HighlightAnnotationPrivate;
36class StampAnnotationPrivate;
37class InkAnnotationPrivate;
38class CaretAnnotationPrivate;
39class FileAttachmentAnnotationPrivate;
40class SoundAnnotationPrivate;
41class MovieAnnotationPrivate;
42class ScreenAnnotationPrivate;
43class WidgetAnnotationPrivate;
44class RichMediaAnnotationPrivate;
75 static QRect annotationGeometry(
const Annotation *annotation,
double scaleX,
double scaleY);
86 static QPixmap loadStamp(
const QString &nameOrPath,
int size,
bool keepAspectRatio =
true);
100 friend class DocumentPrivate;
103 friend class PagePrivate;
137 ToggleHidingOnMouse = 64,
139 ExternallyDrawn = 256,
219 void setAuthor(
const QString &author);
229 void setContents(
const QString &contents);
239 void setUniqueName(
const QString &name);
251 void setModificationDate(
const QDateTime &date);
263 void setCreationDate(
const QDateTime &date);
274 void setFlags(
int flags);
339 void setColor(
const QColor &color);
349 void setOpacity(
double opacity);
354 double opacity()
const;
359 void setWidth(
double width);
364 double width()
const;
379 void setXCorners(
double xCorners);
384 double xCorners()
const;
389 void setYCorners(
double yCorners);
394 double yCorners()
const;
399 void setMarks(
int marks);
409 void setSpaces(
int spaces);
429 void setEffectIntensity(
double intensity);
434 double effectIntensity()
const;
449 const Style &style()
const;
474 void setFlags(
int flags);
494 void setWidth(
int width);
504 void setHeight(
int height);
514 void setTitle(
const QString &title);
524 void setSummary(
const QString &summary);
544 const Window &window()
const;
624 void setNativeId(
const QVariant &
id);
641 void setDisposeDataFunction(DisposeDataFunction func);
648 bool canBeMoved()
const;
653 bool canBeResized()
const;
660 bool openDialogAfterCreation()
const;
677 QDomNode getAnnotationPropertiesDomNode()
const;
684 void setAnnotationProperties(
const QDomNode &node);
691 AnnotationPrivate *d_ptr;
755class OKULARCORE_EXPORT TextAnnotation :
public Annotation
783 explicit TextAnnotation(
const QDomNode &description);
788 ~TextAnnotation()
override;
794 void setTextType(TextType type);
799 TextType textType()
const;
804 void setTextIcon(
const QString &icon);
814 void setTextFont(
const QFont &font);
819 QFont textFont()
const;
826 void setTextColor(
const QColor &color);
839 void setInplaceAlignment(
int alignment);
845 int inplaceAlignment()
const;
852 void setInplaceCallout(
const NormalizedPoint &point,
int index);
859 NormalizedPoint inplaceCallout(
int index)
const;
866 NormalizedPoint transformedInplaceCallout(
int index)
const;
872 void setInplaceIntent(InplaceIntent intent);
877 InplaceIntent inplaceIntent()
const;
882 SubType subType()
const override;
890 Q_DECLARE_PRIVATE(TextAnnotation)
891 Q_DISABLE_COPY(TextAnnotation)
894class OKULARCORE_EXPORT LineAnnotation :
public Annotation
931 explicit LineAnnotation(
const QDomNode &description);
936 ~LineAnnotation()
override;
964 void setLineStartStyle(TermStyle style);
969 TermStyle lineStartStyle()
const;
975 void setLineEndStyle(TermStyle style);
980 TermStyle lineEndStyle()
const;
985 void setLineClosed(
bool closed);
990 bool lineClosed()
const;
995 void setLineInnerColor(
const QColor &color);
1000 QColor lineInnerColor()
const;
1005 void setLineLeadingForwardPoint(
double point);
1010 double lineLeadingForwardPoint()
const;
1015 void setLineLeadingBackwardPoint(
double point);
1020 double lineLeadingBackwardPoint()
const;
1025 void setShowCaption(
bool shown);
1030 bool showCaption()
const;
1036 void setLineIntent(LineIntent intent);
1041 LineIntent lineIntent()
const;
1046 SubType subType()
const override;
1054 Q_DECLARE_PRIVATE(LineAnnotation)
1055 Q_DISABLE_COPY(LineAnnotation)
1058class OKULARCORE_EXPORT GeomAnnotation :
public Annotation
1075 explicit GeomAnnotation(
const QDomNode &description);
1080 ~GeomAnnotation()
override;
1086 void setGeometricalType(GeomType type);
1091 GeomType geometricalType()
const;
1096 void setGeometricalInnerColor(
const QColor &color);
1101 QColor geometricalInnerColor()
const;
1106 SubType subType()
const override;
1115 Q_DECLARE_PRIVATE(GeomAnnotation)
1116 Q_DISABLE_COPY(GeomAnnotation)
1119class OKULARCORE_EXPORT HighlightAnnotation :
public Annotation
1125 enum HighlightType {
1135 HighlightAnnotation();
1140 explicit HighlightAnnotation(
const QDomNode &description);
1145 ~HighlightAnnotation()
override;
1151 void setHighlightType(HighlightType type);
1156 HighlightType highlightType()
const;
1186 Quad &operator=(
const Quad &other);
1212 void setCapStart(
bool value);
1217 bool capStart()
const;
1222 void setCapEnd(
bool value);
1227 bool capEnd()
const;
1232 void setFeather(
double width);
1237 double feather()
const;
1267 SubType subType()
const override;
1276 Q_DECLARE_PRIVATE(HighlightAnnotation)
1277 Q_DISABLE_COPY(HighlightAnnotation)
1280class OKULARCORE_EXPORT StampAnnotation :
public Annotation
1291 explicit StampAnnotation(
const QDomNode &description);
1296 ~StampAnnotation()
override;
1301 void setStampIconName(
const QString &name);
1306 QString stampIconName()
const;
1311 SubType subType()
const override;
1320 Q_DECLARE_PRIVATE(StampAnnotation)
1321 Q_DISABLE_COPY(StampAnnotation)
1324class OKULARCORE_EXPORT InkAnnotation :
public Annotation
1335 explicit InkAnnotation(
const QDomNode &description);
1340 ~InkAnnotation()
override;
1367 SubType subType()
const override;
1376 Q_DECLARE_PRIVATE(InkAnnotation)
1377 Q_DISABLE_COPY(InkAnnotation)
1380class OKULARCORE_EXPORT CaretAnnotation :
public Annotation
1399 explicit CaretAnnotation(
const QDomNode &description);
1404 ~CaretAnnotation()
override;
1409 void setCaretSymbol(CaretAnnotation::CaretSymbol symbol);
1414 CaretAnnotation::CaretSymbol caretSymbol()
const;
1419 SubType subType()
const override;
1428 Q_DECLARE_PRIVATE(CaretAnnotation)
1429 Q_DISABLE_COPY(CaretAnnotation)
1432class OKULARCORE_EXPORT FileAttachmentAnnotation :
public Annotation
1438 FileAttachmentAnnotation();
1442 explicit FileAttachmentAnnotation(
const QDomNode &description);
1446 ~FileAttachmentAnnotation()
override;
1456 void setFileIconName(
const QString &iconName);
1461 EmbeddedFile *embeddedFile()
const;
1467 void setEmbeddedFile(EmbeddedFile *ef);
1472 SubType subType()
const override;
1481 Q_DECLARE_PRIVATE(FileAttachmentAnnotation)
1482 Q_DISABLE_COPY(FileAttachmentAnnotation)
1511 QString soundIconName()
const;
1516 void setSoundIconName(
const QString &iconName);
1521 Sound *sound()
const;
1527 void setSound(
Sound *s);
1532 SubType subType()
const override;
1570 Movie *movie()
const;
1574 void setMovie(
Movie *movie);
1578 SubType subType()
const override;
1619 SubType subType()
const override;
1632 void setAction(
Action *action);
1688 SubType subType()
const override;
1743 SubType subType()
const override;
1754 Movie *movie()
const;
1759 void setMovie(
Movie *movie);
Encapsulates data that describes an action.
This class describes the object rectangle for an annotation.
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.
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.
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.
An embedded file into the document.
Describes a highlight quad of a text markup annotation.
Contains information about a movie object.
NormalizedPoint is a helper class which stores the coordinates of a normalized point.
A NormalizedRect is a rectangle which can be defined by two NormalizedPoints.
An area with normalized coordinates that contains a reference to an object.
Collector for all the data belonging to a page.
Contains information about a sound object.