35#ifndef _POPPLER_ANNOTATION_H_
36#define _POPPLER_ANNOTATION_H_
38#include <QtCore/QDateTime>
39#include <QtCore/QSharedDataPointer>
40#include <QtCore/QList>
41#include <QtCore/QPointF>
42#include <QtCore/QRectF>
43#include <QtCore/QScopedPointer>
44#include <QtCore/QVector>
45#include <QtGui/QColor>
47#include "poppler-export.h"
48#include "poppler-converter.h"
55class AnnotationPrivate;
56class AnnotationAppearancePrivate;
57class TextAnnotationPrivate;
58class LineAnnotationPrivate;
59class GeomAnnotationPrivate;
60class HighlightAnnotationPrivate;
61class StampAnnotationPrivate;
62class SignatureAnnotationPrivate;
63class InkAnnotationPrivate;
64class LinkAnnotationPrivate;
65class CaretAnnotationPrivate;
66class FileAttachmentAnnotationPrivate;
67class SoundAnnotationPrivate;
68class MovieAnnotationPrivate;
69class ScreenAnnotationPrivate;
70class WidgetAnnotationPrivate;
71class RichMediaAnnotationPrivate;
91class POPPLER_QT6_EXPORT AnnotationAppearance
93 friend class Annotation;
96 explicit AnnotationAppearance(AnnotationAppearancePrivate *annotationAppearancePrivate);
97 ~AnnotationAppearance();
100 AnnotationAppearancePrivate *d;
101 Q_DISABLE_COPY(AnnotationAppearance)
179 friend class LinkMovie;
180 friend class LinkRendition;
224 ToggleHidingOnMouse = 64,
227 Q_DECLARE_FLAGS(Flags, Flag)
269 QString contents()
const;
270 void setContents(
const QString &contents);
283 QDateTime modificationDate()
const;
284 void setModificationDate(
const QDateTime &date);
286 QDateTime creationDate()
const;
287 void setCreationDate(
const QDateTime &date);
323 class POPPLER_QT6_EXPORT Style
327 Style(
const Style &other);
328 Style &operator=(
const Style &other);
332 QColor color()
const;
333 void setColor(
const QColor &color);
334 double opacity()
const;
335 void setOpacity(
double opacity);
338 double width()
const;
339 void setWidth(
double width);
340 LineStyle lineStyle()
const;
341 void setLineStyle(LineStyle style);
342 double xCorners()
const;
343 void setXCorners(
double radius);
344 double yCorners()
const;
345 void setYCorners(
double radius);
346 const QVector<double> &dashArray()
const;
347 void setDashArray(
const QVector<double> &array);
350 LineEffect lineEffect()
const;
351 void setLineEffect(LineEffect effect);
352 double effectIntensity()
const;
353 void setEffectIntensity(
double intens);
357 QSharedDataPointer<Private> d;
361 void setStyle(
const Style &style);
366 class POPPLER_QT6_EXPORT Popup
370 Popup(
const Popup &other);
371 Popup &operator=(
const Popup &other);
376 void setFlags(
int flags);
379 QRectF geometry()
const;
380 void setGeometry(
const QRectF &geom);
383 QString title()
const;
384 void setTitle(
const QString &title);
385 QString summary()
const;
386 void setSummary(
const QString &summary);
387 QString text()
const;
388 void setText(
const QString &text);
392 QSharedDataPointer<Private> d;
399 RevScope revisionScope()
const;
401 RevType revisionType()
const;
406 std::vector<std::unique_ptr<Annotation>>
revisions()
const;
456 QExplicitlySharedDataPointer<AnnotationPrivate> d_ptr;
471 friend class AnnotationPrivate;
486 enum InplaceAlignPosition
493 explicit TextAnnotation(TextType type);
494 ~TextAnnotation()
override;
536 QFont textFont()
const;
537 void setTextFont(
const QFont &font);
540 void setTextColor(
const QColor &color);
542 InplaceAlignPosition inplaceAlign()
const;
543 void setInplaceAlign(InplaceAlignPosition align);
545 QPointF calloutPoint(
int id)
const;
546 QVector<QPointF> calloutPoints()
const;
547 void setCalloutPoints(
const QVector<QPointF> &points);
549 InplaceIntent inplaceIntent()
const;
550 void setInplaceIntent(InplaceIntent intent);
553 explicit TextAnnotation(TextAnnotationPrivate &dd);
554 void setTextType(TextType type);
555 Q_DECLARE_PRIVATE(TextAnnotation)
556 Q_DISABLE_COPY(TextAnnotation)
566 friend class AnnotationPrivate;
596 explicit LineAnnotation(LineType type);
597 ~LineAnnotation()
override;
600 LineType lineType()
const;
602 QVector<QPointF> linePoints()
const;
603 void setLinePoints(
const QVector<QPointF> &points);
605 TermStyle lineStartStyle()
const;
606 void setLineStartStyle(TermStyle style);
608 TermStyle lineEndStyle()
const;
609 void setLineEndStyle(TermStyle style);
611 bool isLineClosed()
const;
612 void setLineClosed(
bool closed);
614 QColor lineInnerColor()
const;
615 void setLineInnerColor(
const QColor &color);
617 double lineLeadingForwardPoint()
const;
618 void setLineLeadingForwardPoint(
double point);
620 double lineLeadingBackPoint()
const;
621 void setLineLeadingBackPoint(
double point);
623 bool lineShowCaption()
const;
624 void setLineShowCaption(
bool show);
626 LineIntent lineIntent()
const;
627 void setLineIntent(LineIntent intent);
630 explicit LineAnnotation(LineAnnotationPrivate &dd);
631 void setLineType(LineType type);
632 Q_DECLARE_PRIVATE(LineAnnotation)
633 Q_DISABLE_COPY(LineAnnotation)
644 friend class AnnotationPrivate;
648 ~GeomAnnotation()
override;
658 GeomType geomType()
const;
659 void setGeomType(GeomType type);
661 QColor geomInnerColor()
const;
662 void setGeomInnerColor(
const QColor &color);
675class POPPLER_QT6_EXPORT HighlightAnnotation :
public Annotation
677 friend class AnnotationPrivate;
680 HighlightAnnotation();
681 ~HighlightAnnotation()
override;
731 explicit HighlightAnnotation(HighlightAnnotationPrivate &dd);
732 Q_DECLARE_PRIVATE(HighlightAnnotation)
733 Q_DISABLE_COPY(HighlightAnnotation)
743 friend class AnnotationPrivate;
747 ~StampAnnotation()
override;
786 explicit StampAnnotation(StampAnnotationPrivate &dd);
787 Q_DECLARE_PRIVATE(StampAnnotation)
788 Q_DISABLE_COPY(StampAnnotation)
801class POPPLER_QT6_EXPORT SignatureAnnotation :
public Annotation
803 friend class AnnotationPrivate;
825 void setText(
const QString &text);
826 void setLeftText(
const QString &text);
838 void setLeftFontSize(
double fontSize);
844 void setFontColor(
const QColor &color);
850 void setBorderColor(
const QColor &color);
858 void setBorderWidth(
double width);
864 void setBackgroundColor(
const QColor &color);
866 QString imagePath()
const;
867 void setImagePath(
const QString &imagePath);
869 QString fieldPartialName()
const;
870 void setFieldPartialName(
const QString &fieldPartialName);
872 [[nodiscard]]
SigningResult sign(
const QString &outputFileName,
const PDFConverter::NewSignatureData &data);
882 explicit SignatureAnnotation(SignatureAnnotationPrivate &dd);
883 Q_DECLARE_PRIVATE(SignatureAnnotation)
884 Q_DISABLE_COPY(SignatureAnnotation)
894 friend class AnnotationPrivate;
898 ~InkAnnotation()
override;
901 QList<QVector<QPointF>> inkPaths()
const;
902 void setInkPaths(
const QList<QVector<QPointF>> &paths);
905 explicit InkAnnotation(InkAnnotationPrivate &dd);
906 Q_DECLARE_PRIVATE(InkAnnotation)
907 Q_DISABLE_COPY(InkAnnotation)
912 friend class AnnotationPrivate;
915 ~LinkAnnotation()
override;
927 Link *linkDestination()
const;
928 void setLinkDestination(std::unique_ptr<Link> &&link);
930 HighlightMode linkHighlightMode()
const;
931 void setLinkHighlightMode(HighlightMode mode);
933 QPointF linkRegionPoint(
int id)
const;
934 void setLinkRegionPoint(
int id,
const QPointF point);
950 friend class AnnotationPrivate;
954 ~CaretAnnotation()
override;
966 CaretSymbol caretSymbol()
const;
967 void setCaretSymbol(CaretSymbol symbol);
980class POPPLER_QT6_EXPORT FileAttachmentAnnotation :
public Annotation
982 friend class AnnotationPrivate;
985 ~FileAttachmentAnnotation()
override;
1009 FileAttachmentAnnotation();
1010 explicit FileAttachmentAnnotation(FileAttachmentAnnotationPrivate &dd);
1011 Q_DECLARE_PRIVATE(FileAttachmentAnnotation)
1012 Q_DISABLE_COPY(FileAttachmentAnnotation)
1022 friend class AnnotationPrivate;
1025 ~SoundAnnotation()
override;
1050 explicit SoundAnnotation(SoundAnnotationPrivate &dd);
1051 Q_DECLARE_PRIVATE(SoundAnnotation)
1052 Q_DISABLE_COPY(SoundAnnotation)
1062 friend class AnnotationPrivate;
1065 ~MovieAnnotation()
override;
1090 explicit MovieAnnotation(MovieAnnotationPrivate &dd);
1091 Q_DECLARE_PRIVATE(MovieAnnotation)
1092 Q_DISABLE_COPY(MovieAnnotation)
1102 friend class AnnotationPrivate;
1105 ~ScreenAnnotation()
override;
1139 explicit ScreenAnnotation(ScreenAnnotationPrivate &dd);
1140 Q_DECLARE_PRIVATE(ScreenAnnotation)
1141 Q_DISABLE_COPY(ScreenAnnotation)
1154 friend class AnnotationPrivate;
1157 ~WidgetAnnotation()
override;
1169 explicit WidgetAnnotation(WidgetAnnotationPrivate &dd);
1170 Q_DECLARE_PRIVATE(WidgetAnnotation)
1171 Q_DISABLE_COPY(WidgetAnnotation)
1181 friend class AnnotationPrivate;
1184 ~RichMediaAnnotation()
override;
1196 class POPPLER_QT6_EXPORT Params
1198 friend class AnnotationPrivate;
1210 void setFlashVars(
const QString &
flashVars);
1213 QScopedPointer<Private> d;
1223 class POPPLER_QT6_EXPORT Instance
1225 friend class AnnotationPrivate;
1257 QScopedPointer<Private> d;
1266 class POPPLER_QT6_EXPORT Configuration
1268 friend class AnnotationPrivate;
1302 void setName(
const QString &
name);
1303 void setInstances(
const QList<RichMediaAnnotation::Instance *> &
instances);
1306 QScopedPointer<Private> d;
1316 class POPPLER_QT6_EXPORT Asset
1318 friend class AnnotationPrivate;
1335 void setName(
const QString &
name);
1339 QScopedPointer<Private> d;
1348 class POPPLER_QT6_EXPORT Content
1350 friend class AnnotationPrivate;
1364 QList<RichMediaAnnotation::Asset *>
assets()
const;
1367 void setConfigurations(
const QList<RichMediaAnnotation::Configuration *> &
configurations);
1368 void setAssets(
const QList<RichMediaAnnotation::Asset *> &
assets);
1371 QScopedPointer<Private> d;
1380 class POPPLER_QT6_EXPORT Activation
1382 friend class AnnotationPrivate;
1407 QScopedPointer<Private> d;
1416 class POPPLER_QT6_EXPORT Deactivation
1418 friend class AnnotationPrivate;
1443 QScopedPointer<Private> d;
1452 class POPPLER_QT6_EXPORT Settings
1454 friend class AnnotationPrivate;
1475 QScopedPointer<Private> d;
1492 RichMediaAnnotation();
1493 explicit RichMediaAnnotation(RichMediaAnnotationPrivate &dd);
1494 Q_DECLARE_PRIVATE(RichMediaAnnotation)
1495 Q_DISABLE_COPY(RichMediaAnnotation)
AnnotationAppearance class wrapping Poppler's AP stream object.
Definition poppler-annotation.h:92
Container class for Annotation style information.
Definition poppler-annotation.h:324
Annotation class holding properties shared by all annotations.
Definition poppler-annotation.h:178
void setFlags(Flags flags)
Sets this annotation's flags.
std::unique_ptr< AnnotationAppearance > annotationAppearance() const
Returns the current appearance stream of this annotation.
SubType
Annotation subclasses.
Definition poppler-annotation.h:191
@ AHighlight
HighlightAnnotation.
Definition poppler-annotation.h:195
@ AWidget
WidgetAnnotation.
Definition poppler-annotation.h:204
@ ACaret
CaretAnnotation.
Definition poppler-annotation.h:199
@ AStamp
StampAnnotation.
Definition poppler-annotation.h:196
@ AFileAttachment
FileAttachmentAnnotation.
Definition poppler-annotation.h:200
@ AMovie
MovieAnnotation.
Definition poppler-annotation.h:202
@ ASound
SoundAnnotation.
Definition poppler-annotation.h:201
@ ARichMedia
RichMediaAnnotation.
Definition poppler-annotation.h:205
@ AText
TextAnnotation.
Definition poppler-annotation.h:192
@ AInk
InkAnnotation.
Definition poppler-annotation.h:197
@ ALink
LinkAnnotation.
Definition poppler-annotation.h:198
@ AScreen
ScreenAnnotation.
Definition poppler-annotation.h:203
@ AGeom
GeomAnnotation.
Definition poppler-annotation.h:194
@ ALine
LineAnnotation.
Definition poppler-annotation.h:193
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.
std::vector< std::unique_ptr< Annotation > > revisions() const
Returns the revisions of this annotation.
Flag
Annotation flags.
Definition poppler-annotation.h:217
@ FixedRotation
Do not rotate the annotation according to page orientation and rendering rotation.
Definition poppler-annotation.h:220
@ Hidden
Do not display or print the annotation.
Definition poppler-annotation.h:218
@ DenyPrint
Do not print the annotation.
Definition poppler-annotation.h:221
QString author() const
Returns the author of the annotation.
void setUniqueName(const QString &uniqueName)
Sets a new unique name for the annotation.
Flags flags() const
Returns this annotation's flags.
virtual ~Annotation()
Destructor.
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:439
@ MouseReleasedAction
Performed when the mouse button is released inside the annotation's active area.
Definition poppler-annotation.h:443
@ FocusInAction
Performed when the annotation receives the input focus.
Definition poppler-annotation.h:444
@ PageOpeningAction
Performed when the page containing the annotation is opened.
Definition poppler-annotation.h:446
@ MousePressedAction
Performed when the mouse button is pressed inside the annotation's active area.
Definition poppler-annotation.h:442
@ FocusOutAction
Performed when the annotation loses the input focus.
Definition poppler-annotation.h:445
@ PageInvisibleAction
Performed when the page containing the annotation becomes invisible.
Definition poppler-annotation.h:449
@ PageClosingAction
Performed when the page containing the annotation is closed.
Definition poppler-annotation.h:447
@ CursorLeavingAction
Performed when the cursor exists the annotation's active area.
Definition poppler-annotation.h:441
@ PageVisibleAction
Performed when the page containing the annotation becomes visible.
Definition poppler-annotation.h:448
@ CursorEnteringAction
Performed when the cursor enters the annotation's active area.
Definition poppler-annotation.h:440
virtual SubType subType() const =0
The type of the annotation.
Caret annotation.
Definition poppler-annotation.h:949
SubType subType() const override
The type of the annotation.
CaretSymbol
The symbols for the caret annotation.
Definition poppler-annotation.h:961
Container class for an embedded file with a PDF document.
Definition poppler-qt6.h:340
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:643
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:688
@ Squiggly
jagged or squiggly underline
Definition poppler-annotation.h:690
@ Underline
straight line underline
Definition poppler-annotation.h:691
@ StrikeOut
straight line through-line
Definition poppler-annotation.h:692
@ Highlight
highlighter pen style annotation
Definition poppler-annotation.h:689
SubType subType() const override
The type of the annotation.
SubType subType() const override
The type of the annotation.
Definition poppler-annotation.h:911
SubType subType() const override
The type of the annotation.
Rendition: Rendition link.
Definition poppler-link.h:475
Encapsulates data that describes a link.
Definition poppler-link.h:183
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-qt6.h:1877
A page in a document.
Definition poppler-qt6.h:426
The content object of a RichMediaAnnotation.
Definition poppler-annotation.h:1349
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.
std::unique_ptr< Link > additionalAction(AdditionalActionType type) const
Returns the additional action of the given type for 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.
Signature annotation.
Definition poppler-annotation.h:802
double fontSize() const
Default: 10.
QColor borderColor() const
Default: red.
double borderWidth() const
border width in points
double leftFontSize() const
Default: 20.
QColor fontColor() const
Default: red.
ErrorString lastSigningErrorDetails() const
A string with a string that might offer more details of the signing result failure.
QColor backgroundColor() const
Default: QColor(240, 240, 240).
SubType subType() const override
The type of the annotation.
SigningResult
Definition poppler-annotation.h:810
@ SigningSuccess
No error.
Definition poppler-annotation.h:811
@ WriteFailed
Write failed (permissions, faulty disk, ...).
Definition poppler-annotation.h:816
@ InternalError
Unexpected error, likely a bug in poppler.
Definition poppler-annotation.h:814
@ FieldAlreadySigned
Trying to sign a field that is already signed.
Definition poppler-annotation.h:812
@ BadPassphrase
User entered bad passphrase.
Definition poppler-annotation.h:818
@ KeyMissing
Key not found (Either the input key is not from the list or the available keys has changed underneath...
Definition poppler-annotation.h:815
@ GenericSigningError
Unclassified error.
Definition poppler-annotation.h:813
@ UserCancelled
User cancelled the process.
Definition poppler-annotation.h:817
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-qt6.h:1801
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.
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.
The Poppler Qt6 binding.
Definition poppler-annotation.h:52
Structure corresponding to a QuadPoints array.
Definition poppler-annotation.h:701