37#ifndef _POPPLER_ANNOTATION_H_
38#define _POPPLER_ANNOTATION_H_
40#include <QtCore/QDateTime>
41#include <QtCore/QSharedDataPointer>
42#include <QtCore/QList>
43#include <QtCore/QPointF>
44#include <QtCore/QRectF>
45#include <QtCore/QScopedPointer>
46#include <QtCore/QVector>
47#include <QtGui/QColor>
49#include "poppler-export.h"
50#include "poppler-converter.h"
57class AnnotationPrivate;
58class AnnotationAppearancePrivate;
59class TextAnnotationPrivate;
60class LineAnnotationPrivate;
61class GeomAnnotationPrivate;
62class HighlightAnnotationPrivate;
63class StampAnnotationPrivate;
64class SignatureAnnotationPrivate;
65class InkAnnotationPrivate;
66class LinkAnnotationPrivate;
67class CaretAnnotationPrivate;
68class FileAttachmentAnnotationPrivate;
69class SoundAnnotationPrivate;
70class MovieAnnotationPrivate;
71class ScreenAnnotationPrivate;
72class WidgetAnnotationPrivate;
73class RichMediaAnnotationPrivate;
93class POPPLER_QT6_EXPORT AnnotationAppearance
95 friend class Annotation;
98 explicit AnnotationAppearance(AnnotationAppearancePrivate *annotationAppearancePrivate);
99 ~AnnotationAppearance();
102 AnnotationAppearancePrivate *d;
103 Q_DISABLE_COPY(AnnotationAppearance)
181 friend class LinkMovie;
182 friend class LinkRendition;
226 ToggleHidingOnMouse = 64,
229 Q_DECLARE_FLAGS(Flags, Flag)
271 QString contents()
const;
272 void setContents(
const QString &contents);
285 QDateTime modificationDate()
const;
286 void setModificationDate(
const QDateTime &date);
288 QDateTime creationDate()
const;
289 void setCreationDate(
const QDateTime &date);
325 class POPPLER_QT6_EXPORT Style
329 Style(
const Style &other);
330 Style &operator=(
const Style &other);
334 QColor color()
const;
335 void setColor(
const QColor &color);
336 double opacity()
const;
337 void setOpacity(
double opacity);
340 double width()
const;
341 void setWidth(
double width);
342 LineStyle lineStyle()
const;
343 void setLineStyle(LineStyle style);
344 double xCorners()
const;
345 void setXCorners(
double radius);
346 double yCorners()
const;
347 void setYCorners(
double radius);
348 const QVector<double> &dashArray()
const;
349 void setDashArray(
const QVector<double> &array);
352 LineEffect lineEffect()
const;
353 void setLineEffect(LineEffect effect);
354 double effectIntensity()
const;
355 void setEffectIntensity(
double intens);
359 QSharedDataPointer<Private> d;
363 void setStyle(
const Style &style);
368 class POPPLER_QT6_EXPORT Popup
372 Popup(
const Popup &other);
373 Popup &operator=(
const Popup &other);
378 void setFlags(
int flags);
381 QRectF geometry()
const;
382 void setGeometry(
const QRectF &geom);
385 QString title()
const;
386 void setTitle(
const QString &title);
387 QString summary()
const;
388 void setSummary(
const QString &summary);
389 QString text()
const;
390 void setText(
const QString &text);
394 QSharedDataPointer<Private> d;
401 RevScope revisionScope()
const;
403 RevType revisionType()
const;
408 std::vector<std::unique_ptr<Annotation>>
revisions()
const;
458 QExplicitlySharedDataPointer<AnnotationPrivate> d_ptr;
473 friend class AnnotationPrivate;
488 enum InplaceAlignPosition
495 explicit TextAnnotation(TextType type);
496 ~TextAnnotation()
override;
538 QFont textFont()
const;
539 void setTextFont(
const QFont &font);
542 void setTextColor(
const QColor &color);
544 InplaceAlignPosition inplaceAlign()
const;
545 void setInplaceAlign(InplaceAlignPosition align);
547 QPointF calloutPoint(
int id)
const;
548 QVector<QPointF> calloutPoints()
const;
549 void setCalloutPoints(
const QVector<QPointF> &points);
551 InplaceIntent inplaceIntent()
const;
552 void setInplaceIntent(InplaceIntent intent);
555 explicit TextAnnotation(TextAnnotationPrivate &dd);
556 void setTextType(TextType type);
557 Q_DECLARE_PRIVATE(TextAnnotation)
558 Q_DISABLE_COPY(TextAnnotation)
568 friend class AnnotationPrivate;
598 explicit LineAnnotation(LineType type);
599 ~LineAnnotation()
override;
602 LineType lineType()
const;
604 QVector<QPointF> linePoints()
const;
605 void setLinePoints(
const QVector<QPointF> &points);
607 TermStyle lineStartStyle()
const;
608 void setLineStartStyle(TermStyle style);
610 TermStyle lineEndStyle()
const;
611 void setLineEndStyle(TermStyle style);
613 bool isLineClosed()
const;
614 void setLineClosed(
bool closed);
616 QColor lineInnerColor()
const;
617 void setLineInnerColor(
const QColor &color);
619 double lineLeadingForwardPoint()
const;
620 void setLineLeadingForwardPoint(
double point);
622 double lineLeadingBackPoint()
const;
623 void setLineLeadingBackPoint(
double point);
625 bool lineShowCaption()
const;
626 void setLineShowCaption(
bool show);
628 LineIntent lineIntent()
const;
629 void setLineIntent(LineIntent intent);
632 explicit LineAnnotation(LineAnnotationPrivate &dd);
633 void setLineType(LineType type);
634 Q_DECLARE_PRIVATE(LineAnnotation)
635 Q_DISABLE_COPY(LineAnnotation)
646 friend class AnnotationPrivate;
650 ~GeomAnnotation()
override;
660 GeomType geomType()
const;
661 void setGeomType(GeomType type);
663 QColor geomInnerColor()
const;
664 void setGeomInnerColor(
const QColor &color);
677class POPPLER_QT6_EXPORT HighlightAnnotation :
public Annotation
679 friend class AnnotationPrivate;
682 HighlightAnnotation();
683 ~HighlightAnnotation()
override;
733 explicit HighlightAnnotation(HighlightAnnotationPrivate &dd);
734 Q_DECLARE_PRIVATE(HighlightAnnotation)
735 Q_DISABLE_COPY(HighlightAnnotation)
745 friend class AnnotationPrivate;
749 ~StampAnnotation()
override;
788 explicit StampAnnotation(StampAnnotationPrivate &dd);
789 Q_DECLARE_PRIVATE(StampAnnotation)
790 Q_DISABLE_COPY(StampAnnotation)
803class POPPLER_QT6_EXPORT SignatureAnnotation :
public Annotation
805 friend class AnnotationPrivate;
828 void setText(
const QString &text);
829 void setLeftText(
const QString &text);
841 void setLeftFontSize(
double fontSize);
847 void setFontColor(
const QColor &color);
853 void setBorderColor(
const QColor &color);
861 void setBorderWidth(
double width);
867 void setBackgroundColor(
const QColor &color);
869 QString imagePath()
const;
870 void setImagePath(
const QString &imagePath);
872 QString fieldPartialName()
const;
873 void setFieldPartialName(
const QString &fieldPartialName);
875 [[nodiscard]]
SigningResult sign(
const QString &outputFileName,
const PDFConverter::NewSignatureData &data);
885 explicit SignatureAnnotation(SignatureAnnotationPrivate &dd);
886 Q_DECLARE_PRIVATE(SignatureAnnotation)
887 Q_DISABLE_COPY(SignatureAnnotation)
897 friend class AnnotationPrivate;
901 ~InkAnnotation()
override;
904 QList<QVector<QPointF>> inkPaths()
const;
905 void setInkPaths(
const QList<QVector<QPointF>> &paths);
908 explicit InkAnnotation(InkAnnotationPrivate &dd);
909 Q_DECLARE_PRIVATE(InkAnnotation)
910 Q_DISABLE_COPY(InkAnnotation)
915 friend class AnnotationPrivate;
918 ~LinkAnnotation()
override;
930 Link *linkDestination()
const;
931 void setLinkDestination(std::unique_ptr<Link> &&link);
933 HighlightMode linkHighlightMode()
const;
934 void setLinkHighlightMode(HighlightMode mode);
936 QPointF linkRegionPoint(
int id)
const;
937 void setLinkRegionPoint(
int id, QPointF point);
953 friend class AnnotationPrivate;
957 ~CaretAnnotation()
override;
969 CaretSymbol caretSymbol()
const;
970 void setCaretSymbol(CaretSymbol symbol);
983class POPPLER_QT6_EXPORT FileAttachmentAnnotation :
public Annotation
985 friend class AnnotationPrivate;
988 ~FileAttachmentAnnotation()
override;
1012 FileAttachmentAnnotation();
1013 explicit FileAttachmentAnnotation(FileAttachmentAnnotationPrivate &dd);
1014 Q_DECLARE_PRIVATE(FileAttachmentAnnotation)
1015 Q_DISABLE_COPY(FileAttachmentAnnotation)
1025 friend class AnnotationPrivate;
1028 ~SoundAnnotation()
override;
1053 explicit SoundAnnotation(SoundAnnotationPrivate &dd);
1054 Q_DECLARE_PRIVATE(SoundAnnotation)
1055 Q_DISABLE_COPY(SoundAnnotation)
1065 friend class AnnotationPrivate;
1068 ~MovieAnnotation()
override;
1093 explicit MovieAnnotation(MovieAnnotationPrivate &dd);
1094 Q_DECLARE_PRIVATE(MovieAnnotation)
1095 Q_DISABLE_COPY(MovieAnnotation)
1105 friend class AnnotationPrivate;
1108 ~ScreenAnnotation()
override;
1142 explicit ScreenAnnotation(ScreenAnnotationPrivate &dd);
1143 Q_DECLARE_PRIVATE(ScreenAnnotation)
1144 Q_DISABLE_COPY(ScreenAnnotation)
1157 friend class AnnotationPrivate;
1160 ~WidgetAnnotation()
override;
1172 explicit WidgetAnnotation(WidgetAnnotationPrivate &dd);
1173 Q_DECLARE_PRIVATE(WidgetAnnotation)
1174 Q_DISABLE_COPY(WidgetAnnotation)
1184 friend class AnnotationPrivate;
1187 ~RichMediaAnnotation()
override;
1199 class POPPLER_QT6_EXPORT Params
1201 friend class AnnotationPrivate;
1213 void setFlashVars(
const QString &
flashVars);
1216 QScopedPointer<Private> d;
1226 class POPPLER_QT6_EXPORT Instance
1228 friend class AnnotationPrivate;
1260 QScopedPointer<Private> d;
1269 class POPPLER_QT6_EXPORT Configuration
1271 friend class AnnotationPrivate;
1305 void setName(
const QString &
name);
1306 void setInstances(
const QList<RichMediaAnnotation::Instance *> &
instances);
1309 QScopedPointer<Private> d;
1319 class POPPLER_QT6_EXPORT Asset
1321 friend class AnnotationPrivate;
1338 void setName(
const QString &
name);
1342 QScopedPointer<Private> d;
1351 class POPPLER_QT6_EXPORT Content
1353 friend class AnnotationPrivate;
1367 QList<RichMediaAnnotation::Asset *>
assets()
const;
1370 void setConfigurations(
const QList<RichMediaAnnotation::Configuration *> &
configurations);
1371 void setAssets(
const QList<RichMediaAnnotation::Asset *> &
assets);
1374 QScopedPointer<Private> d;
1383 class POPPLER_QT6_EXPORT Activation
1385 friend class AnnotationPrivate;
1410 QScopedPointer<Private> d;
1419 class POPPLER_QT6_EXPORT Deactivation
1421 friend class AnnotationPrivate;
1446 QScopedPointer<Private> d;
1455 class POPPLER_QT6_EXPORT Settings
1457 friend class AnnotationPrivate;
1478 QScopedPointer<Private> d;
1495 RichMediaAnnotation();
1496 explicit RichMediaAnnotation(RichMediaAnnotationPrivate &dd);
1497 Q_DECLARE_PRIVATE(RichMediaAnnotation)
1498 Q_DISABLE_COPY(RichMediaAnnotation)
AnnotationAppearance class wrapping Poppler's AP stream object.
Definition poppler-annotation.h:94
Container class for Annotation style information.
Definition poppler-annotation.h:326
Annotation class holding properties shared by all annotations.
Definition poppler-annotation.h:180
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:193
@ AHighlight
HighlightAnnotation.
Definition poppler-annotation.h:197
@ AWidget
WidgetAnnotation.
Definition poppler-annotation.h:206
@ ACaret
CaretAnnotation.
Definition poppler-annotation.h:201
@ AStamp
StampAnnotation.
Definition poppler-annotation.h:198
@ AFileAttachment
FileAttachmentAnnotation.
Definition poppler-annotation.h:202
@ AMovie
MovieAnnotation.
Definition poppler-annotation.h:204
@ ASound
SoundAnnotation.
Definition poppler-annotation.h:203
@ ARichMedia
RichMediaAnnotation.
Definition poppler-annotation.h:207
@ AText
TextAnnotation.
Definition poppler-annotation.h:194
@ AInk
InkAnnotation.
Definition poppler-annotation.h:199
@ ALink
LinkAnnotation.
Definition poppler-annotation.h:200
@ AScreen
ScreenAnnotation.
Definition poppler-annotation.h:205
@ AGeom
GeomAnnotation.
Definition poppler-annotation.h:196
@ ALine
LineAnnotation.
Definition poppler-annotation.h:195
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:219
@ FixedRotation
Do not rotate the annotation according to page orientation and rendering rotation.
Definition poppler-annotation.h:222
@ Hidden
Do not display or print the annotation.
Definition poppler-annotation.h:220
@ DenyPrint
Do not print the annotation.
Definition poppler-annotation.h:223
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:441
@ MouseReleasedAction
Performed when the mouse button is released inside the annotation's active area.
Definition poppler-annotation.h:445
@ FocusInAction
Performed when the annotation receives the input focus.
Definition poppler-annotation.h:446
@ PageOpeningAction
Performed when the page containing the annotation is opened.
Definition poppler-annotation.h:448
@ MousePressedAction
Performed when the mouse button is pressed inside the annotation's active area.
Definition poppler-annotation.h:444
@ FocusOutAction
Performed when the annotation loses the input focus.
Definition poppler-annotation.h:447
@ PageInvisibleAction
Performed when the page containing the annotation becomes invisible.
Definition poppler-annotation.h:451
@ PageClosingAction
Performed when the page containing the annotation is closed.
Definition poppler-annotation.h:449
@ CursorLeavingAction
Performed when the cursor exists the annotation's active area.
Definition poppler-annotation.h:443
@ PageVisibleAction
Performed when the page containing the annotation becomes visible.
Definition poppler-annotation.h:450
@ CursorEnteringAction
Performed when the cursor enters the annotation's active area.
Definition poppler-annotation.h:442
virtual SubType subType() const =0
The type of the annotation.
Caret annotation.
Definition poppler-annotation.h:952
SubType subType() const override
The type of the annotation.
CaretSymbol
The symbols for the caret annotation.
Definition poppler-annotation.h:964
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:645
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:690
@ Squiggly
jagged or squiggly underline
Definition poppler-annotation.h:692
@ Underline
straight line underline
Definition poppler-annotation.h:693
@ StrikeOut
straight line through-line
Definition poppler-annotation.h:694
@ Highlight
highlighter pen style annotation
Definition poppler-annotation.h:691
SubType subType() const override
The type of the annotation.
SubType subType() const override
The type of the annotation.
Definition poppler-annotation.h:914
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:1881
A page in a document.
Definition poppler-qt6.h:426
The content object of a RichMediaAnnotation.
Definition poppler-annotation.h:1352
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:804
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:812
@ SigningSuccess
No error.
Definition poppler-annotation.h:813
@ WriteFailed
Write failed (permissions, faulty disk, ...).
Definition poppler-annotation.h:818
@ InternalError
Unexpected error, likely a bug in poppler.
Definition poppler-annotation.h:816
@ UnsupportedSignatureType
User asked for a signature type that the current backend/key combo can't deliver.
Definition poppler-annotation.h:821
@ FieldAlreadySigned
Trying to sign a field that is already signed.
Definition poppler-annotation.h:814
@ BadPassphrase
User entered bad passphrase.
Definition poppler-annotation.h:820
@ KeyMissing
Key not found (Either the input key is not from the list or the available keys has changed underneath...
Definition poppler-annotation.h:817
@ GenericSigningError
Unclassified error.
Definition poppler-annotation.h:815
@ UserCancelled
User cancelled the process.
Definition poppler-annotation.h:819
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:1805
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:54
Structure corresponding to a QuadPoints array.
Definition poppler-annotation.h:703