32#ifndef _POPPLER_ANNOTATION_H_
33#define _POPPLER_ANNOTATION_H_
35#include <QtCore/QDateTime>
36#include <QtCore/QSharedDataPointer>
37#include <QtCore/QLinkedList>
38#include <QtCore/QList>
39#include <QtCore/QPointF>
40#include <QtCore/QRectF>
41#include <QtCore/QScopedPointer>
42#include <QtCore/QVector>
43#include <QtGui/QColor>
45#include <QtXml/QDomDocument>
46#include "poppler-export.h"
53class AnnotationPrivate;
54class AnnotationAppearancePrivate;
55class TextAnnotationPrivate;
56class LineAnnotationPrivate;
57class GeomAnnotationPrivate;
58class HighlightAnnotationPrivate;
59class StampAnnotationPrivate;
60class InkAnnotationPrivate;
61class LinkAnnotationPrivate;
62class CaretAnnotationPrivate;
63class FileAttachmentAnnotationPrivate;
64class SoundAnnotationPrivate;
65class MovieAnnotationPrivate;
66class ScreenAnnotationPrivate;
67class WidgetAnnotationPrivate;
68class RichMediaAnnotationPrivate;
101 Q_DECL_DEPRECATED
static QDomElement
findChildElement(
const QDomNode &parentNode,
const QString &name);
116class POPPLER_QT5_EXPORT AnnotationAppearance
118 friend class Annotation;
121 explicit AnnotationAppearance(AnnotationAppearancePrivate *annotationAppearancePrivate);
122 ~AnnotationAppearance();
125 AnnotationAppearancePrivate *d;
126 Q_DISABLE_COPY(AnnotationAppearance)
204 friend class AnnotationUtils;
205 friend class LinkMovie;
206 friend class LinkRendition;
251 ToggleHidingOnMouse = 64,
295 QString contents()
const;
296 void setContents(
const QString &contents);
309 QDateTime modificationDate()
const;
310 void setModificationDate(
const QDateTime &date);
312 QDateTime creationDate()
const;
313 void setCreationDate(
const QDateTime &date);
351 class POPPLER_QT5_EXPORT Style
355 Style(
const Style &other);
356 Style &operator=(
const Style &other);
360 QColor color()
const;
361 void setColor(
const QColor &color);
362 double opacity()
const;
363 void setOpacity(
double opacity);
366 double width()
const;
367 void setWidth(
double width);
368 LineStyle lineStyle()
const;
369 void setLineStyle(LineStyle
style);
370 double xCorners()
const;
371 void setXCorners(
double radius);
372 double yCorners()
const;
373 void setYCorners(
double radius);
374 const QVector<double> &dashArray()
const;
375 void setDashArray(
const QVector<double> &array);
378 LineEffect lineEffect()
const;
379 void setLineEffect(LineEffect effect);
380 double effectIntensity()
const;
381 void setEffectIntensity(
double intens);
385 QSharedDataPointer<Private> d;
398 class POPPLER_QT5_EXPORT Popup
402 Popup(
const Popup &other);
403 Popup &operator=(
const Popup &other);
408 void setFlags(
int flags);
411 QRectF geometry()
const;
412 void setGeometry(
const QRectF &geom);
415 QString title()
const;
416 void setTitle(
const QString &title);
417 QString summary()
const;
418 void setSummary(
const QString &summary);
419 QString text()
const;
420 void setText(
const QString &text);
424 QSharedDataPointer<Private> d;
497 Annotation(AnnotationPrivate &dd,
const QDomNode &annNode);
498 void storeBaseAnnotationProperties(QDomNode &annNode, QDomDocument &document)
const;
500 QExplicitlySharedDataPointer<AnnotationPrivate> d_ptr;
504 virtual void store(QDomNode &parentNode, QDomDocument &document)
const = 0;
516 friend class AnnotationUtils;
517 friend class AnnotationPrivate;
533 explicit TextAnnotation(TextType type);
534 ~TextAnnotation()
override;
563 QFont textFont()
const;
564 void setTextFont(
const QFont &font);
571 int inplaceAlign()
const;
572 void setInplaceAlign(
int align);
574 QPointF calloutPoint(
int id)
const;
580 InplaceIntent inplaceIntent()
const;
581 void setInplaceIntent(InplaceIntent intent);
584 explicit TextAnnotation(
const QDomNode &node);
585 explicit TextAnnotation(TextAnnotationPrivate &dd);
586 void store(QDomNode &parentNode, QDomDocument &document)
const override;
587 void setTextType(TextType type);
588 Q_DECLARE_PRIVATE(TextAnnotation)
589 Q_DISABLE_COPY(TextAnnotation)
599 friend class AnnotationUtils;
600 friend class AnnotationPrivate;
639 QLinkedList<QPointF> linePoints()
const;
640 void setLinePoints(
const QLinkedList<QPointF> &points);
642 TermStyle lineStartStyle()
const;
643 void setLineStartStyle(TermStyle
style);
645 TermStyle lineEndStyle()
const;
646 void setLineEndStyle(TermStyle
style);
648 bool isLineClosed()
const;
649 void setLineClosed(
bool closed);
651 QColor lineInnerColor()
const;
652 void setLineInnerColor(
const QColor &color);
654 double lineLeadingForwardPoint()
const;
655 void setLineLeadingForwardPoint(
double point);
657 double lineLeadingBackPoint()
const;
658 void setLineLeadingBackPoint(
double point);
660 bool lineShowCaption()
const;
661 void setLineShowCaption(
bool show);
663 LineIntent lineIntent()
const;
664 void setLineIntent(LineIntent intent);
669 void store(QDomNode &parentNode, QDomDocument &document)
const override;
683 friend class AnnotationUtils;
684 friend class AnnotationPrivate;
688 ~GeomAnnotation()
override;
698 GeomType geomType()
const;
699 void setGeomType(GeomType type);
701 QColor geomInnerColor()
const;
702 void setGeomInnerColor(
const QColor &color);
707 void store(QDomNode &parentNode, QDomDocument &document)
const override;
717class POPPLER_QT5_EXPORT HighlightAnnotation :
public Annotation
719 friend class AnnotationUtils;
720 friend class AnnotationPrivate;
723 HighlightAnnotation();
724 ~HighlightAnnotation()
override;
774 explicit HighlightAnnotation(
const QDomNode &node);
775 explicit HighlightAnnotation(HighlightAnnotationPrivate &dd);
776 void store(QDomNode &parentNode, QDomDocument &document)
const override;
777 Q_DECLARE_PRIVATE(HighlightAnnotation)
778 Q_DISABLE_COPY(HighlightAnnotation)
788 friend class AnnotationUtils;
789 friend class AnnotationPrivate;
793 ~StampAnnotation()
override;
832 explicit StampAnnotation(
const QDomNode &node);
833 explicit StampAnnotation(StampAnnotationPrivate &dd);
834 void store(QDomNode &parentNode, QDomDocument &document)
const override;
835 Q_DECLARE_PRIVATE(StampAnnotation)
836 Q_DISABLE_COPY(StampAnnotation)
846 friend class AnnotationUtils;
847 friend class AnnotationPrivate;
851 ~InkAnnotation()
override;
854 QList<QLinkedList<QPointF>> inkPaths()
const;
855 void setInkPaths(
const QList<QLinkedList<QPointF>> &paths);
858 explicit InkAnnotation(
const QDomNode &node);
859 void store(QDomNode &parentNode, QDomDocument &document)
const override;
860 explicit InkAnnotation(InkAnnotationPrivate &dd);
861 Q_DECLARE_PRIVATE(InkAnnotation)
862 Q_DISABLE_COPY(InkAnnotation)
867 friend class AnnotationUtils;
868 friend class AnnotationPrivate;
871 ~LinkAnnotation()
override;
885 void setLinkDestination(
Link *link);
887 HighlightMode linkHighlightMode()
const;
888 void setLinkHighlightMode(HighlightMode mode);
890 QPointF linkRegionPoint(
int id)
const;
892 void setLinkRegionPoint(
int id,
const QPointF &point);
896 explicit LinkAnnotation(
const QDomNode &node);
897 explicit LinkAnnotation(LinkAnnotationPrivate &dd);
898 void store(QDomNode &parentNode, QDomDocument &document)
const override;
899 Q_DECLARE_PRIVATE(LinkAnnotation)
900 Q_DISABLE_COPY(LinkAnnotation)
910 friend class AnnotationUtils;
911 friend class AnnotationPrivate;
915 ~CaretAnnotation()
override;
927 CaretSymbol caretSymbol()
const;
928 void setCaretSymbol(CaretSymbol symbol);
933 void store(QDomNode &parentNode, QDomDocument &document)
const override;
945class POPPLER_QT5_EXPORT FileAttachmentAnnotation :
public Annotation
947 friend class AnnotationPrivate;
950 ~FileAttachmentAnnotation()
override;
974 FileAttachmentAnnotation();
975 explicit FileAttachmentAnnotation(
const QDomNode &node);
976 explicit FileAttachmentAnnotation(FileAttachmentAnnotationPrivate &dd);
977 void store(QDomNode &parentNode, QDomDocument &document)
const override;
978 Q_DECLARE_PRIVATE(FileAttachmentAnnotation)
979 Q_DISABLE_COPY(FileAttachmentAnnotation)
991 friend class AnnotationPrivate;
994 ~SoundAnnotation()
override;
1019 explicit SoundAnnotation(
const QDomNode &node);
1020 explicit SoundAnnotation(SoundAnnotationPrivate &dd);
1021 void store(QDomNode &parentNode, QDomDocument &document)
const override;
1022 Q_DECLARE_PRIVATE(SoundAnnotation)
1023 Q_DISABLE_COPY(SoundAnnotation)
1035 friend class AnnotationPrivate;
1038 ~MovieAnnotation()
override;
1063 explicit MovieAnnotation(
const QDomNode &node);
1064 explicit MovieAnnotation(MovieAnnotationPrivate &dd);
1065 void store(QDomNode &parentNode, QDomDocument &document)
const override;
1066 Q_DECLARE_PRIVATE(MovieAnnotation)
1067 Q_DISABLE_COPY(MovieAnnotation)
1079 friend class AnnotationPrivate;
1082 ~ScreenAnnotation()
override;
1118 explicit ScreenAnnotation(ScreenAnnotationPrivate &dd);
1119 void store(QDomNode &parentNode, QDomDocument &document)
const override;
1120 Q_DECLARE_PRIVATE(ScreenAnnotation)
1121 Q_DISABLE_COPY(ScreenAnnotation)
1136 friend class AnnotationPrivate;
1139 ~WidgetAnnotation()
override;
1153 explicit WidgetAnnotation(WidgetAnnotationPrivate &dd);
1154 void store(QDomNode &parentNode, QDomDocument &document)
const override;
1155 Q_DECLARE_PRIVATE(WidgetAnnotation)
1156 Q_DISABLE_COPY(WidgetAnnotation)
1168 friend class AnnotationPrivate;
1171 ~RichMediaAnnotation()
override;
1183 class POPPLER_QT5_EXPORT Params
1185 friend class AnnotationPrivate;
1197 void setFlashVars(
const QString &
flashVars);
1200 QScopedPointer<Private> d;
1210 class POPPLER_QT5_EXPORT Instance
1212 friend class AnnotationPrivate;
1244 QScopedPointer<Private> d;
1253 class POPPLER_QT5_EXPORT Configuration
1255 friend class AnnotationPrivate;
1289 void setName(
const QString &
name);
1290 void setInstances(
const QList<RichMediaAnnotation::Instance *> &
instances);
1293 QScopedPointer<Private> d;
1303 class POPPLER_QT5_EXPORT Asset
1305 friend class AnnotationPrivate;
1322 void setName(
const QString &
name);
1326 QScopedPointer<Private> d;
1335 class POPPLER_QT5_EXPORT Content
1337 friend class AnnotationPrivate;
1351 QList<RichMediaAnnotation::Asset *>
assets()
const;
1354 void setConfigurations(
const QList<RichMediaAnnotation::Configuration *> &
configurations);
1355 void setAssets(
const QList<RichMediaAnnotation::Asset *> &
assets);
1358 QScopedPointer<Private> d;
1367 class POPPLER_QT5_EXPORT Activation
1369 friend class AnnotationPrivate;
1394 QScopedPointer<Private> d;
1403 class POPPLER_QT5_EXPORT Deactivation
1405 friend class AnnotationPrivate;
1430 QScopedPointer<Private> d;
1439 class POPPLER_QT5_EXPORT Settings
1441 friend class AnnotationPrivate;
1462 QScopedPointer<Private> d;
1479 RichMediaAnnotation();
1480 explicit RichMediaAnnotation(
const QDomNode &node);
1481 explicit RichMediaAnnotation(RichMediaAnnotationPrivate &dd);
1482 void store(QDomNode &parentNode, QDomDocument &document)
const override;
1483 Q_DECLARE_PRIVATE(RichMediaAnnotation)
1484 Q_DISABLE_COPY(RichMediaAnnotation)
AnnotationAppearance class wrapping Poppler's AP stream object.
Definition poppler-annotation.h:117
Helper class for (recursive) Annotation retrieval/storage.
Definition poppler-annotation.h:81
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:352
Annotation class holding properties shared by all annotations.
Definition poppler-annotation.h:203
RevType revisionType() const
std::unique_ptr< AnnotationAppearance > annotationAppearance() const
Returns the current appearance stream of this annotation.
SubType
Annotation subclasses.
Definition poppler-annotation.h:217
@ AHighlight
HighlightAnnotation.
Definition poppler-annotation.h:221
@ AWidget
WidgetAnnotation.
Definition poppler-annotation.h:230
@ ACaret
CaretAnnotation.
Definition poppler-annotation.h:225
@ AStamp
StampAnnotation.
Definition poppler-annotation.h:222
@ AFileAttachment
FileAttachmentAnnotation.
Definition poppler-annotation.h:226
@ AMovie
MovieAnnotation.
Definition poppler-annotation.h:228
@ ASound
SoundAnnotation.
Definition poppler-annotation.h:227
@ ARichMedia
RichMediaAnnotation.
Definition poppler-annotation.h:231
@ AText
TextAnnotation.
Definition poppler-annotation.h:218
@ AInk
InkAnnotation.
Definition poppler-annotation.h:223
@ ALink
LinkAnnotation.
Definition poppler-annotation.h:224
@ AScreen
ScreenAnnotation.
Definition poppler-annotation.h:229
@ AGeom
GeomAnnotation.
Definition poppler-annotation.h:220
@ ALine
LineAnnotation.
Definition poppler-annotation.h:219
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:244
@ FixedRotation
Do not rotate the annotation according to page orientation and rendering rotation.
Definition poppler-annotation.h:247
@ Hidden
Do not display or print the annotation.
Definition poppler-annotation.h:245
@ DenyPrint
Do not print the annotation.
Definition poppler-annotation.h:248
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:481
@ MouseReleasedAction
Performed when the mouse button is released inside the annotation's active area.
Definition poppler-annotation.h:485
@ FocusInAction
Performed when the annotation receives the input focus.
Definition poppler-annotation.h:486
@ PageOpeningAction
Performed when the page containing the annotation is opened.
Definition poppler-annotation.h:488
@ MousePressedAction
Performed when the mouse button is pressed inside the annotation's active area.
Definition poppler-annotation.h:484
@ FocusOutAction
Performed when the annotation loses the input focus.
Definition poppler-annotation.h:487
@ PageInvisibleAction
Performed when the page containing the annotation becomes invisible.
Definition poppler-annotation.h:491
@ PageClosingAction
Performed when the page containing the annotation is closed.
Definition poppler-annotation.h:489
@ CursorLeavingAction
Performed when the cursor exists the annotation's active area.
Definition poppler-annotation.h:483
@ PageVisibleAction
Performed when the page containing the annotation becomes visible.
Definition poppler-annotation.h:490
@ CursorEnteringAction
Performed when the cursor enters the annotation's active area.
Definition poppler-annotation.h:482
virtual SubType subType() const =0
The type of the annotation.
void setStyle(const Style &style)
Caret annotation.
Definition poppler-annotation.h:909
SubType subType() const override
The type of the annotation.
CaretSymbol
The symbols for the caret annotation.
Definition poppler-annotation.h:922
Container class for an embedded file with a PDF document.
Definition poppler-qt5.h:371
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:682
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:731
@ Squiggly
jagged or squiggly underline
Definition poppler-annotation.h:733
@ Underline
straight line underline
Definition poppler-annotation.h:734
@ StrikeOut
straight line through-line
Definition poppler-annotation.h:735
@ Highlight
highlighter pen style annotation
Definition poppler-annotation.h:732
SubType subType() const override
The type of the annotation.
LineType
Definition poppler-annotation.h:606
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:2564
A page in a document.
Definition poppler-qt5.h:461
The content object of a RichMediaAnnotation.
Definition poppler-annotation.h:1336
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:2488
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:50
Structure corresponding to a QuadPoints array.
Definition poppler-annotation.h:744