7#ifndef _OKULAR_ANNOTATIONS_H_
8#define _OKULAR_ANNOTATIONS_H_
11#include <QDomDocument>
18#include "okularcore_export.h"
19#include "signatureutils.h"
25class AnnotationObjectRect;
26class AnnotationPrivate;
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;
78 static QRect annotationGeometry(
const Annotation *annotation,
double scaleX,
double scaleY);
89 static QPixmap loadStamp(
const QString &nameOrPath,
int size,
bool keepAspectRatio =
true);
103 friend class DocumentPrivate;
106 friend class PagePrivate;
140 ToggleHidingOnMouse = 64,
142 ExternallyDrawn = 256,
222 void setAuthor(
const QString &author);
232 void setContents(
const QString &contents);
242 void setUniqueName(
const QString &name);
254 void setModificationDate(
const QDateTime &date);
266 void setCreationDate(
const QDateTime &date);
277 void setFlags(
int flags);
342 void setColor(
const QColor &color);
352 void setOpacity(
double opacity);
357 double opacity()
const;
362 void setWidth(
double width);
367 double width()
const;
382 void setXCorners(
double xCorners);
387 double xCorners()
const;
392 void setYCorners(
double yCorners);
397 double yCorners()
const;
402 void setMarks(
int marks);
412 void setSpaces(
int spaces);
432 void setEffectIntensity(
double intensity);
437 double effectIntensity()
const;
452 const Style &style()
const;
477 void setFlags(
int flags);
497 void setWidth(
int width);
507 void setHeight(
int height);
517 void setTitle(
const QString &title);
527 void setSummary(
const QString &summary);
547 const Window &window()
const;
627 void setNativeId(
const QVariant &
id);
644 void setDisposeDataFunction(DisposeDataFunction func);
651 bool canBeMoved()
const;
656 bool canBeResized()
const;
663 bool openDialogAfterCreation()
const;
680 QDomNode getAnnotationPropertiesDomNode()
const;
688 void setAnnotationProperties(
const QDomNode &node);
699 void setNativeData(std::shared_ptr<void> data);
708 const void *nativeData()
const;
715 AnnotationPrivate *d_ptr;
779class OKULARCORE_EXPORT TextAnnotation :
public Annotation
807 explicit TextAnnotation(
const QDomNode &description);
812 ~TextAnnotation()
override;
818 void setTextType(TextType type);
823 TextType textType()
const;
828 void setTextIcon(
const QString &icon);
838 void setTextFont(
const QFont &font);
843 QFont textFont()
const;
850 void setTextColor(
const QColor &color);
863 void setInplaceAlignment(
int alignment);
869 int inplaceAlignment()
const;
876 void setInplaceCallout(
const NormalizedPoint &point,
int index);
883 NormalizedPoint inplaceCallout(
int index)
const;
890 NormalizedPoint transformedInplaceCallout(
int index)
const;
896 void setInplaceIntent(InplaceIntent intent);
901 InplaceIntent inplaceIntent()
const;
906 SubType subType()
const override;
914 Q_DECLARE_PRIVATE(TextAnnotation)
915 Q_DISABLE_COPY(TextAnnotation)
918class OKULARCORE_EXPORT LineAnnotation :
public Annotation
955 explicit LineAnnotation(
const QDomNode &description);
960 ~LineAnnotation()
override;
988 void setLineStartStyle(TermStyle style);
993 TermStyle lineStartStyle()
const;
999 void setLineEndStyle(TermStyle style);
1004 TermStyle lineEndStyle()
const;
1009 void setLineClosed(
bool closed);
1014 bool lineClosed()
const;
1019 void setLineInnerColor(
const QColor &color);
1024 QColor lineInnerColor()
const;
1029 void setLineLeadingForwardPoint(
double point);
1034 double lineLeadingForwardPoint()
const;
1039 void setLineLeadingBackwardPoint(
double point);
1044 double lineLeadingBackwardPoint()
const;
1049 void setShowCaption(
bool shown);
1054 bool showCaption()
const;
1060 void setLineIntent(LineIntent intent);
1065 LineIntent lineIntent()
const;
1070 SubType subType()
const override;
1078 Q_DECLARE_PRIVATE(LineAnnotation)
1079 Q_DISABLE_COPY(LineAnnotation)
1082class OKULARCORE_EXPORT GeomAnnotation :
public Annotation
1099 explicit GeomAnnotation(
const QDomNode &description);
1104 ~GeomAnnotation()
override;
1110 void setGeometricalType(GeomType type);
1115 GeomType geometricalType()
const;
1120 void setGeometricalInnerColor(
const QColor &color);
1125 QColor geometricalInnerColor()
const;
1130 SubType subType()
const override;
1139 Q_DECLARE_PRIVATE(GeomAnnotation)
1140 Q_DISABLE_COPY(GeomAnnotation)
1143class OKULARCORE_EXPORT HighlightAnnotation :
public Annotation
1149 enum HighlightType {
1159 HighlightAnnotation();
1164 explicit HighlightAnnotation(
const QDomNode &description);
1169 ~HighlightAnnotation()
override;
1175 void setHighlightType(HighlightType type);
1180 HighlightType highlightType()
const;
1210 Quad &operator=(
const Quad &other);
1236 void setCapStart(
bool value);
1241 bool capStart()
const;
1246 void setCapEnd(
bool value);
1251 bool capEnd()
const;
1256 void setFeather(
double width);
1261 double feather()
const;
1291 SubType subType()
const override;
1300 Q_DECLARE_PRIVATE(HighlightAnnotation)
1301 Q_DISABLE_COPY(HighlightAnnotation)
1304class OKULARCORE_EXPORT StampAnnotation :
public Annotation
1315 explicit StampAnnotation(
const QDomNode &description);
1320 ~StampAnnotation()
override;
1325 void setStampIconName(
const QString &name);
1330 QString stampIconName()
const;
1335 SubType subType()
const override;
1344 Q_DECLARE_PRIVATE(StampAnnotation)
1345 Q_DISABLE_COPY(StampAnnotation)
1348#if HAVE_NEW_SIGNATURE_API
1352class OKULARCORE_EXPORT SignatureAnnotation :
public Annotation
1358 SignatureAnnotation();
1363 ~SignatureAnnotation()
override;
1366 void setText(
const QString &text);
1369 void setLeftText(
const QString &text);
1372 void setImagePath(
const QString &imagePath);
1374 QString fieldPartialName()
const;
1375 void setFieldPartialName(
const QString &fieldPartialName);
1378 void setPage(
int page);
1387 SubType subType()
const override;
1396 Q_DECLARE_PRIVATE(SignatureAnnotation)
1397 Q_DISABLE_COPY(SignatureAnnotation)
1401class OKULARCORE_EXPORT InkAnnotation :
public Annotation
1412 explicit InkAnnotation(
const QDomNode &description);
1417 ~InkAnnotation()
override;
1444 SubType subType()
const override;
1453 Q_DECLARE_PRIVATE(InkAnnotation)
1454 Q_DISABLE_COPY(InkAnnotation)
1457class OKULARCORE_EXPORT CaretAnnotation :
public Annotation
1476 explicit CaretAnnotation(
const QDomNode &description);
1481 ~CaretAnnotation()
override;
1486 void setCaretSymbol(CaretAnnotation::CaretSymbol symbol);
1491 CaretAnnotation::CaretSymbol caretSymbol()
const;
1496 SubType subType()
const override;
1505 Q_DECLARE_PRIVATE(CaretAnnotation)
1506 Q_DISABLE_COPY(CaretAnnotation)
1509class OKULARCORE_EXPORT FileAttachmentAnnotation :
public Annotation
1515 FileAttachmentAnnotation();
1519 explicit FileAttachmentAnnotation(
const QDomNode &description);
1523 ~FileAttachmentAnnotation()
override;
1533 void setFileIconName(
const QString &iconName);
1538 EmbeddedFile *embeddedFile()
const;
1544 void setEmbeddedFile(EmbeddedFile *ef);
1549 SubType subType()
const override;
1558 Q_DECLARE_PRIVATE(FileAttachmentAnnotation)
1559 Q_DISABLE_COPY(FileAttachmentAnnotation)
1588 QString soundIconName()
const;
1593 void setSoundIconName(
const QString &iconName);
1598 Sound *sound()
const;
1604 void setSound(
Sound *s);
1609 SubType subType()
const override;
1647 Movie *movie()
const;
1651 void setMovie(
Movie *movie);
1655 SubType subType()
const override;
1696 SubType subType()
const override;
1709 void setAction(
Action *action);
1765 SubType subType()
const override;
1820 SubType subType()
const override;
1831 Movie *movie()
const;
1836 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.
Data needed to create a new signature.
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.