33#ifndef _POPPLER_ANNOTATION_H_
34#define _POPPLER_ANNOTATION_H_
36#include <QtCore/QDateTime>
37#include <QtCore/QSharedDataPointer>
38#include <QtCore/QLinkedList>
39#include <QtCore/QList>
40#include <QtCore/QPointF>
41#include <QtCore/QRectF>
42#include <QtCore/QScopedPointer>
43#include <QtCore/QVector>
44#include <QtGui/QColor>
46#include <QtXml/QDomDocument>
47#include "poppler-export.h"
54class AnnotationPrivate;
55class AnnotationAppearancePrivate;
56class TextAnnotationPrivate;
57class LineAnnotationPrivate;
58class GeomAnnotationPrivate;
59class HighlightAnnotationPrivate;
60class StampAnnotationPrivate;
61class InkAnnotationPrivate;
62class LinkAnnotationPrivate;
63class CaretAnnotationPrivate;
64class FileAttachmentAnnotationPrivate;
65class SoundAnnotationPrivate;
66class MovieAnnotationPrivate;
67class ScreenAnnotationPrivate;
68class WidgetAnnotationPrivate;
69class RichMediaAnnotationPrivate;
102 Q_DECL_DEPRECATED
static QDomElement
findChildElement(
const QDomNode &parentNode,
const QString &name);
117class POPPLER_QT5_EXPORT AnnotationAppearance
119 friend class Annotation;
122 explicit AnnotationAppearance(AnnotationAppearancePrivate *annotationAppearancePrivate);
123 ~AnnotationAppearance();
126 AnnotationAppearancePrivate *d;
127 Q_DISABLE_COPY(AnnotationAppearance)
205 friend class AnnotationUtils;
206 friend class LinkMovie;
207 friend class LinkRendition;
252 ToggleHidingOnMouse = 64,
296 QString contents()
const;
297 void setContents(
const QString &contents);
310 QDateTime modificationDate()
const;
311 void setModificationDate(
const QDateTime &date);
313 QDateTime creationDate()
const;
314 void setCreationDate(
const QDateTime &date);
352 class POPPLER_QT5_EXPORT Style
356 Style(
const Style &other);
357 Style &operator=(
const Style &other);
361 QColor color()
const;
362 void setColor(
const QColor &color);
363 double opacity()
const;
364 void setOpacity(
double opacity);
367 double width()
const;
368 void setWidth(
double width);
369 LineStyle lineStyle()
const;
370 void setLineStyle(LineStyle
style);
371 double xCorners()
const;
372 void setXCorners(
double radius);
373 double yCorners()
const;
374 void setYCorners(
double radius);
375 const QVector<double> &dashArray()
const;
376 void setDashArray(
const QVector<double> &array);
379 LineEffect lineEffect()
const;
380 void setLineEffect(LineEffect effect);
381 double effectIntensity()
const;
382 void setEffectIntensity(
double intens);
386 QSharedDataPointer<Private> d;
399 class POPPLER_QT5_EXPORT Popup
403 Popup(
const Popup &other);
404 Popup &operator=(
const Popup &other);
409 void setFlags(
int flags);
412 QRectF geometry()
const;
413 void setGeometry(
const QRectF &geom);
416 QString title()
const;
417 void setTitle(
const QString &title);
418 QString summary()
const;
419 void setSummary(
const QString &summary);
420 QString text()
const;
421 void setText(
const QString &text);
425 QSharedDataPointer<Private> d;
498 Annotation(AnnotationPrivate &dd,
const QDomNode &annNode);
499 void storeBaseAnnotationProperties(QDomNode &annNode, QDomDocument &document)
const;
501 QExplicitlySharedDataPointer<AnnotationPrivate> d_ptr;
505 virtual void store(QDomNode &parentNode, QDomDocument &document)
const = 0;
517 friend class AnnotationUtils;
518 friend class AnnotationPrivate;
534 explicit TextAnnotation(TextType type);
535 ~TextAnnotation()
override;
577 QFont textFont()
const;
578 void setTextFont(
const QFont &font);
585 int inplaceAlign()
const;
586 void setInplaceAlign(
int align);
588 QPointF calloutPoint(
int id)
const;
594 InplaceIntent inplaceIntent()
const;
595 void setInplaceIntent(InplaceIntent intent);
598 explicit TextAnnotation(
const QDomNode &node);
599 explicit TextAnnotation(TextAnnotationPrivate &dd);
600 void store(QDomNode &parentNode, QDomDocument &document)
const override;
601 void setTextType(TextType type);
602 Q_DECLARE_PRIVATE(TextAnnotation)
603 Q_DISABLE_COPY(TextAnnotation)
613 friend class AnnotationUtils;
614 friend class AnnotationPrivate;
653 QLinkedList<QPointF> linePoints()
const;
654 void setLinePoints(
const QLinkedList<QPointF> &points);
656 TermStyle lineStartStyle()
const;
657 void setLineStartStyle(TermStyle
style);
659 TermStyle lineEndStyle()
const;
660 void setLineEndStyle(TermStyle
style);
662 bool isLineClosed()
const;
663 void setLineClosed(
bool closed);
665 QColor lineInnerColor()
const;
666 void setLineInnerColor(
const QColor &color);
668 double lineLeadingForwardPoint()
const;
669 void setLineLeadingForwardPoint(
double point);
671 double lineLeadingBackPoint()
const;
672 void setLineLeadingBackPoint(
double point);
674 bool lineShowCaption()
const;
675 void setLineShowCaption(
bool show);
677 LineIntent lineIntent()
const;
678 void setLineIntent(LineIntent intent);
683 void store(QDomNode &parentNode, QDomDocument &document)
const override;
697 friend class AnnotationUtils;
698 friend class AnnotationPrivate;
702 ~GeomAnnotation()
override;
712 GeomType geomType()
const;
713 void setGeomType(GeomType type);
715 QColor geomInnerColor()
const;
716 void setGeomInnerColor(
const QColor &color);
721 void store(QDomNode &parentNode, QDomDocument &document)
const override;
731class POPPLER_QT5_EXPORT HighlightAnnotation :
public Annotation
733 friend class AnnotationUtils;
734 friend class AnnotationPrivate;
737 HighlightAnnotation();
738 ~HighlightAnnotation()
override;
788 explicit HighlightAnnotation(
const QDomNode &node);
789 explicit HighlightAnnotation(HighlightAnnotationPrivate &dd);
790 void store(QDomNode &parentNode, QDomDocument &document)
const override;
791 Q_DECLARE_PRIVATE(HighlightAnnotation)
792 Q_DISABLE_COPY(HighlightAnnotation)
802 friend class AnnotationUtils;
803 friend class AnnotationPrivate;
807 ~StampAnnotation()
override;
846 explicit StampAnnotation(
const QDomNode &node);
847 explicit StampAnnotation(StampAnnotationPrivate &dd);
848 void store(QDomNode &parentNode, QDomDocument &document)
const override;
849 Q_DECLARE_PRIVATE(StampAnnotation)
850 Q_DISABLE_COPY(StampAnnotation)
860 friend class AnnotationUtils;
861 friend class AnnotationPrivate;
865 ~InkAnnotation()
override;
868 QList<QLinkedList<QPointF>> inkPaths()
const;
869 void setInkPaths(
const QList<QLinkedList<QPointF>> &paths);
872 explicit InkAnnotation(
const QDomNode &node);
873 void store(QDomNode &parentNode, QDomDocument &document)
const override;
874 explicit InkAnnotation(InkAnnotationPrivate &dd);
875 Q_DECLARE_PRIVATE(InkAnnotation)
876 Q_DISABLE_COPY(InkAnnotation)
881 friend class AnnotationUtils;
882 friend class AnnotationPrivate;
885 ~LinkAnnotation()
override;
899 void setLinkDestination(
Link *link);
901 HighlightMode linkHighlightMode()
const;
902 void setLinkHighlightMode(HighlightMode mode);
904 QPointF linkRegionPoint(
int id)
const;
906 void setLinkRegionPoint(
int id,
const QPointF &point);
910 explicit LinkAnnotation(
const QDomNode &node);
911 explicit LinkAnnotation(LinkAnnotationPrivate &dd);
912 void store(QDomNode &parentNode, QDomDocument &document)
const override;
913 Q_DECLARE_PRIVATE(LinkAnnotation)
914 Q_DISABLE_COPY(LinkAnnotation)
924 friend class AnnotationUtils;
925 friend class AnnotationPrivate;
929 ~CaretAnnotation()
override;
941 CaretSymbol caretSymbol()
const;
942 void setCaretSymbol(CaretSymbol symbol);
947 void store(QDomNode &parentNode, QDomDocument &document)
const override;
959class POPPLER_QT5_EXPORT FileAttachmentAnnotation :
public Annotation
961 friend class AnnotationPrivate;
964 ~FileAttachmentAnnotation()
override;
988 FileAttachmentAnnotation();
989 explicit FileAttachmentAnnotation(
const QDomNode &node);
990 explicit FileAttachmentAnnotation(FileAttachmentAnnotationPrivate &dd);
991 void store(QDomNode &parentNode, QDomDocument &document)
const override;
992 Q_DECLARE_PRIVATE(FileAttachmentAnnotation)
993 Q_DISABLE_COPY(FileAttachmentAnnotation)
1005 friend class AnnotationPrivate;
1008 ~SoundAnnotation()
override;
1033 explicit SoundAnnotation(
const QDomNode &node);
1034 explicit SoundAnnotation(SoundAnnotationPrivate &dd);
1035 void store(QDomNode &parentNode, QDomDocument &document)
const override;
1036 Q_DECLARE_PRIVATE(SoundAnnotation)
1037 Q_DISABLE_COPY(SoundAnnotation)
1049 friend class AnnotationPrivate;
1052 ~MovieAnnotation()
override;
1077 explicit MovieAnnotation(
const QDomNode &node);
1078 explicit MovieAnnotation(MovieAnnotationPrivate &dd);
1079 void store(QDomNode &parentNode, QDomDocument &document)
const override;
1080 Q_DECLARE_PRIVATE(MovieAnnotation)
1081 Q_DISABLE_COPY(MovieAnnotation)
1093 friend class AnnotationPrivate;
1096 ~ScreenAnnotation()
override;
1132 explicit ScreenAnnotation(ScreenAnnotationPrivate &dd);
1133 void store(QDomNode &parentNode, QDomDocument &document)
const override;
1134 Q_DECLARE_PRIVATE(ScreenAnnotation)
1135 Q_DISABLE_COPY(ScreenAnnotation)
1150 friend class AnnotationPrivate;
1153 ~WidgetAnnotation()
override;
1167 explicit WidgetAnnotation(WidgetAnnotationPrivate &dd);
1168 void store(QDomNode &parentNode, QDomDocument &document)
const override;
1169 Q_DECLARE_PRIVATE(WidgetAnnotation)
1170 Q_DISABLE_COPY(WidgetAnnotation)
1182 friend class AnnotationPrivate;
1185 ~RichMediaAnnotation()
override;
1197 class POPPLER_QT5_EXPORT Params
1199 friend class AnnotationPrivate;
1211 void setFlashVars(
const QString &
flashVars);
1214 QScopedPointer<Private> d;
1224 class POPPLER_QT5_EXPORT Instance
1226 friend class AnnotationPrivate;
1258 QScopedPointer<Private> d;
1267 class POPPLER_QT5_EXPORT Configuration
1269 friend class AnnotationPrivate;
1303 void setName(
const QString &
name);
1304 void setInstances(
const QList<RichMediaAnnotation::Instance *> &
instances);
1307 QScopedPointer<Private> d;
1317 class POPPLER_QT5_EXPORT Asset
1319 friend class AnnotationPrivate;
1336 void setName(
const QString &
name);
1340 QScopedPointer<Private> d;
1349 class POPPLER_QT5_EXPORT Content
1351 friend class AnnotationPrivate;
1365 QList<RichMediaAnnotation::Asset *>
assets()
const;
1368 void setConfigurations(
const QList<RichMediaAnnotation::Configuration *> &
configurations);
1369 void setAssets(
const QList<RichMediaAnnotation::Asset *> &
assets);
1372 QScopedPointer<Private> d;
1381 class POPPLER_QT5_EXPORT Activation
1383 friend class AnnotationPrivate;
1408 QScopedPointer<Private> d;
1417 class POPPLER_QT5_EXPORT Deactivation
1419 friend class AnnotationPrivate;
1444 QScopedPointer<Private> d;
1453 class POPPLER_QT5_EXPORT Settings
1455 friend class AnnotationPrivate;
1476 QScopedPointer<Private> d;
1493 RichMediaAnnotation();
1494 explicit RichMediaAnnotation(
const QDomNode &node);
1495 explicit RichMediaAnnotation(RichMediaAnnotationPrivate &dd);
1496 void store(QDomNode &parentNode, QDomDocument &document)
const override;
1497 Q_DECLARE_PRIVATE(RichMediaAnnotation)
1498 Q_DISABLE_COPY(RichMediaAnnotation)
AnnotationAppearance class wrapping Poppler's AP stream object.
Definition poppler-annotation.h:118
Helper class for (recursive) Annotation retrieval/storage.
Definition poppler-annotation.h:82
static Annotation * createAnnotation(const QDomElement &annElement)
Restore an Annotation (with revisions if needed) from the DOM element annElement.
static void storeAnnotation(const Annotation *ann, QDomElement &annElement, QDomDocument &document)
Save the Annotation ann as a child of annElement taking care of saving all revisions if ann has any.
static QDomElement findChildElement(const QDomNode &parentNode, const QString &name)
Returns an element called name from the direct children of parentNode or a null element if not found.
Container class for Annotation style information.
Definition poppler-annotation.h:353
Annotation class holding properties shared by all annotations.
Definition poppler-annotation.h:204
RevType revisionType() const
std::unique_ptr< AnnotationAppearance > annotationAppearance() const
Returns the current appearance stream of this annotation.
SubType
Annotation subclasses.
Definition poppler-annotation.h:218
@ AHighlight
HighlightAnnotation.
Definition poppler-annotation.h:222
@ AWidget
WidgetAnnotation.
Definition poppler-annotation.h:231
@ ACaret
CaretAnnotation.
Definition poppler-annotation.h:226
@ AStamp
StampAnnotation.
Definition poppler-annotation.h:223
@ AFileAttachment
FileAttachmentAnnotation.
Definition poppler-annotation.h:227
@ AMovie
MovieAnnotation.
Definition poppler-annotation.h:229
@ ASound
SoundAnnotation.
Definition poppler-annotation.h:228
@ ARichMedia
RichMediaAnnotation.
Definition poppler-annotation.h:232
@ AText
TextAnnotation.
Definition poppler-annotation.h:219
@ AInk
InkAnnotation.
Definition poppler-annotation.h:224
@ ALink
LinkAnnotation.
Definition poppler-annotation.h:225
@ AScreen
ScreenAnnotation.
Definition poppler-annotation.h:230
@ AGeom
GeomAnnotation.
Definition poppler-annotation.h:221
@ ALine
LineAnnotation.
Definition poppler-annotation.h:220
int flags() const
Returns this annotation's flags.
RevScope revisionScope() const
void setAuthor(const QString &author)
Sets a new author for the annotation.
void setPopup(const Popup &popup)
QRectF boundary() const
Returns this annotation's boundary rectangle in normalized coordinates.
void setAnnotationAppearance(const AnnotationAppearance &annotationAppearance)
Sets the annotation's appearance stream with the annotationAppearance.
Flag
Annotation flags.
Definition poppler-annotation.h:245
@ FixedRotation
Do not rotate the annotation according to page orientation and rendering rotation.
Definition poppler-annotation.h:248
@ Hidden
Do not display or print the annotation.
Definition poppler-annotation.h:246
@ DenyPrint
Do not print the annotation.
Definition poppler-annotation.h:249
QList< Annotation * > revisions() const
Returns the revisions of this annotation.
QString author() const
Returns the author of the annotation.
void setUniqueName(const QString &uniqueName)
Sets a new unique name for the annotation.
virtual ~Annotation()
Destructor.
void setFlags(int flags)
Sets this annotation's flags.
QString uniqueName() const
Returns the unique name (ID) of the annotation.
void setBoundary(const QRectF &boundary)
Sets this annotation's boundary rectangle.
AdditionalActionType
Describes the flags from an annotations 'AA' dictionary.
Definition poppler-annotation.h:482
@ MouseReleasedAction
Performed when the mouse button is released inside the annotation's active area.
Definition poppler-annotation.h:486
@ FocusInAction
Performed when the annotation receives the input focus.
Definition poppler-annotation.h:487
@ PageOpeningAction
Performed when the page containing the annotation is opened.
Definition poppler-annotation.h:489
@ MousePressedAction
Performed when the mouse button is pressed inside the annotation's active area.
Definition poppler-annotation.h:485
@ FocusOutAction
Performed when the annotation loses the input focus.
Definition poppler-annotation.h:488
@ PageInvisibleAction
Performed when the page containing the annotation becomes invisible.
Definition poppler-annotation.h:492
@ PageClosingAction
Performed when the page containing the annotation is closed.
Definition poppler-annotation.h:490
@ CursorLeavingAction
Performed when the cursor exists the annotation's active area.
Definition poppler-annotation.h:484
@ PageVisibleAction
Performed when the page containing the annotation becomes visible.
Definition poppler-annotation.h:491
@ CursorEnteringAction
Performed when the cursor enters the annotation's active area.
Definition poppler-annotation.h:483
virtual SubType subType() const =0
The type of the annotation.
void setStyle(const Style &style)
Caret annotation.
Definition poppler-annotation.h:923
SubType subType() const override
The type of the annotation.
CaretSymbol
The symbols for the caret annotation.
Definition poppler-annotation.h:936
Container class for an embedded file with a PDF document.
Definition poppler-qt5.h:372
void setFileIconName(const QString &icon)
Sets a new name for the icon of this annotation.
QString fileIconName() const
Returns the name of the icon of this annotation.
void setEmbeddedFile(EmbeddedFile *ef)
Sets a new EmbeddedFile for this annotation.
EmbeddedFile * embeddedFile() const
Returns the EmbeddedFile of this annotation.
SubType subType() const override
The type of the annotation.
Geometric annotation.
Definition poppler-annotation.h:696
SubType subType() const override
The type of the annotation.
void setHighlightQuads(const QList< Quad > &quads)
Set the areas to highlight.
QList< Quad > highlightQuads() const
The list of areas to highlight.
void setHighlightType(HighlightType type)
Set the type of highlighting to use for the given area or areas.
SubType subType() const override
The type of the annotation.
HighlightType highlightType() const
The type (style) of highlighting to use for this area or these areas.
HighlightType
The type of highlight.
Definition poppler-annotation.h:745
@ Squiggly
jagged or squiggly underline
Definition poppler-annotation.h:747
@ Underline
straight line underline
Definition poppler-annotation.h:748
@ StrikeOut
straight line through-line
Definition poppler-annotation.h:749
@ Highlight
highlighter pen style annotation
Definition poppler-annotation.h:746
SubType subType() const override
The type of the annotation.
LineType
Definition poppler-annotation.h:620
LineType lineType() const
LineAnnotation(LineType type)
SubType subType() const override
The type of the annotation.
Link * linkDestination() const
SubType subType() const override
The type of the annotation.
Rendition: Rendition link.
Definition poppler-link.h:482
Encapsulates data that describes a link.
Definition poppler-link.h:185
void setMovieTitle(const QString &title)
Sets a new title for the movie of this annotation.
MovieObject * movie() const
Returns the MovieObject of this annotation.
SubType subType() const override
The type of the annotation.
void setMovie(MovieObject *movie)
Sets a new MovieObject for this annotation.
QString movieTitle() const
Returns the title of the movie of this annotation.
Container class for a movie object in a PDF document.
Definition poppler-qt5.h:2569
A page in a document.
Definition poppler-qt5.h:462
The content object of a RichMediaAnnotation.
Definition poppler-annotation.h:1350
QList< RichMediaAnnotation::Configuration * > configurations() const
Returns the list of configuration objects of the content object.
QList< RichMediaAnnotation::Asset * > assets() const
Returns the list of asset objects of the content object.
LinkRendition * action() const
Returns the LinkRendition of this annotation.
SubType subType() const override
The type of the annotation.
void setAction(LinkRendition *action)
Sets a new LinkRendition for this annotation.
Link * additionalAction(AdditionalActionType type) const
Returns the additional action of the given type fo the annotation or 0 if no action has been defined.
void setScreenTitle(const QString &title)
Sets a new title for the screen of this annotation.
QString screenTitle() const
Returns the title of the screen of this annotation.
SubType subType() const override
The type of the annotation.
void setSound(SoundObject *s)
Sets a new SoundObject for this annotation.
void setSoundIconName(const QString &icon)
Sets a new name for the icon of this annotation.
QString soundIconName() const
Returns the name of the icon of this annotation.
SoundObject * sound() const
Returns the SoundObject of this annotation.
Container class for a sound file in a PDF document.
Definition poppler-qt5.h:2493
SubType subType() const override
The type of the annotation.
void setStampCustomImage(const QImage &image)
Set a custom icon for this stamp annotation.
void setStampIconName(const QString &name)
Set the icon type for this stamp annotation.
QString stampIconName() const
The name of the icon for this stamp annotation.
QString textIcon() const
The name of the icon for this text annotation.
void setCalloutPoints(const QVector< QPointF > &points)
TextType textType() const
The type of text annotation represented by this object.
void setTextIcon(const QString &icon)
Set the name of the icon to use for this text annotation.
SubType subType() const override
The type of the annotation.
QColor textColor() const
Default text color is black.
QVector< QPointF > calloutPoints() const
void setTextColor(const QColor &color)
The Poppler Qt5 binding.
Definition poppler-annotation.h:51
Structure corresponding to a QuadPoints array.
Definition poppler-annotation.h:758