38#ifndef _POPPLER_ANNOTATION_H_
39#define _POPPLER_ANNOTATION_H_
41#include <QtCore/QDateTime>
42#include <QtCore/QSharedDataPointer>
43#include <QtCore/QList>
44#include <QtCore/QPointF>
45#include <QtCore/QRectF>
46#include <QtCore/QScopedPointer>
47#include <QtCore/QVector>
48#include <QtGui/QColor>
50#include "poppler-export.h"
51#include "poppler-converter.h"
58class AnnotationPrivate;
59class AnnotationAppearancePrivate;
60class TextAnnotationPrivate;
61class LineAnnotationPrivate;
62class GeomAnnotationPrivate;
63class HighlightAnnotationPrivate;
64class StampAnnotationPrivate;
65class SignatureAnnotationPrivate;
66class InkAnnotationPrivate;
67class LinkAnnotationPrivate;
68class CaretAnnotationPrivate;
69class FileAttachmentAnnotationPrivate;
70class SoundAnnotationPrivate;
71class MovieAnnotationPrivate;
72class ScreenAnnotationPrivate;
73class WidgetAnnotationPrivate;
74class RichMediaAnnotationPrivate;
94class POPPLER_QT6_EXPORT AnnotationAppearance
96 friend class Annotation;
99 explicit AnnotationAppearance(AnnotationAppearancePrivate *annotationAppearancePrivate);
100 ~AnnotationAppearance();
103 AnnotationAppearancePrivate *d;
104 Q_DISABLE_COPY(AnnotationAppearance)
182 friend class LinkMovie;
183 friend class LinkRendition;
227 ToggleHidingOnMouse = 64,
230 Q_DECLARE_FLAGS(Flags, Flag)
272 QString contents()
const;
273 void setContents(
const QString &contents);
286 QDateTime modificationDate()
const;
287 void setModificationDate(
const QDateTime &date);
289 QDateTime creationDate()
const;
290 void setCreationDate(
const QDateTime &date);
326 class POPPLER_QT6_EXPORT Style
330 Style(
const Style &other);
331 Style &operator=(
const Style &other);
335 QColor color()
const;
336 void setColor(
const QColor &color);
337 double opacity()
const;
338 void setOpacity(
double opacity);
341 double width()
const;
342 void setWidth(
double width);
343 LineStyle lineStyle()
const;
344 void setLineStyle(LineStyle style);
345 double xCorners()
const;
346 void setXCorners(
double radius);
347 double yCorners()
const;
348 void setYCorners(
double radius);
349 const QVector<double> &dashArray()
const;
350 void setDashArray(
const QVector<double> &array);
353 LineEffect lineEffect()
const;
354 void setLineEffect(LineEffect effect);
355 double effectIntensity()
const;
356 void setEffectIntensity(
double intens);
360 QSharedDataPointer<Private> d;
364 void setStyle(
const Style &style);
369 class POPPLER_QT6_EXPORT Popup
373 Popup(
const Popup &other);
374 Popup &operator=(
const Popup &other);
379 void setFlags(
int flags);
382 QRectF geometry()
const;
383 void setGeometry(
const QRectF &geom);
386 QString title()
const;
387 void setTitle(
const QString &title);
388 QString summary()
const;
389 void setSummary(
const QString &summary);
390 QString text()
const;
391 void setText(
const QString &text);
395 QSharedDataPointer<Private> d;
402 RevScope revisionScope()
const;
404 RevType revisionType()
const;
409 std::vector<std::unique_ptr<Annotation>>
revisions()
const;
459 QExplicitlySharedDataPointer<AnnotationPrivate> d_ptr;
474 friend class AnnotationPrivate;
489 enum InplaceAlignPosition
496 explicit TextAnnotation(TextType type);
497 ~TextAnnotation()
override;
539 QFont textFont()
const;
540 void setTextFont(
const QFont &font);
543 void setTextColor(
const QColor &color);
545 InplaceAlignPosition inplaceAlign()
const;
546 void setInplaceAlign(InplaceAlignPosition align);
548 QPointF calloutPoint(
int id)
const;
549 QVector<QPointF> calloutPoints()
const;
550 void setCalloutPoints(
const QVector<QPointF> &points);
552 InplaceIntent inplaceIntent()
const;
553 void setInplaceIntent(InplaceIntent intent);
556 explicit TextAnnotation(TextAnnotationPrivate &dd);
557 void setTextType(TextType type);
558 Q_DECLARE_PRIVATE(TextAnnotation)
559 Q_DISABLE_COPY(TextAnnotation)
569 friend class AnnotationPrivate;
599 explicit LineAnnotation(LineType type);
600 ~LineAnnotation()
override;
603 LineType lineType()
const;
605 QVector<QPointF> linePoints()
const;
606 void setLinePoints(
const QVector<QPointF> &points);
608 TermStyle lineStartStyle()
const;
609 void setLineStartStyle(TermStyle style);
611 TermStyle lineEndStyle()
const;
612 void setLineEndStyle(TermStyle style);
614 bool isLineClosed()
const;
615 void setLineClosed(
bool closed);
617 QColor lineInnerColor()
const;
618 void setLineInnerColor(
const QColor &color);
620 double lineLeadingForwardPoint()
const;
621 void setLineLeadingForwardPoint(
double point);
623 double lineLeadingBackPoint()
const;
624 void setLineLeadingBackPoint(
double point);
626 bool lineShowCaption()
const;
627 void setLineShowCaption(
bool show);
629 LineIntent lineIntent()
const;
630 void setLineIntent(LineIntent intent);
633 explicit LineAnnotation(LineAnnotationPrivate &dd);
634 void setLineType(LineType type);
635 Q_DECLARE_PRIVATE(LineAnnotation)
636 Q_DISABLE_COPY(LineAnnotation)
647 friend class AnnotationPrivate;
651 ~GeomAnnotation()
override;
661 GeomType geomType()
const;
662 void setGeomType(GeomType type);
664 QColor geomInnerColor()
const;
665 void setGeomInnerColor(
const QColor &color);
678class POPPLER_QT6_EXPORT HighlightAnnotation :
public Annotation
680 friend class AnnotationPrivate;
683 HighlightAnnotation();
684 ~HighlightAnnotation()
override;
734 explicit HighlightAnnotation(HighlightAnnotationPrivate &dd);
735 Q_DECLARE_PRIVATE(HighlightAnnotation)
736 Q_DISABLE_COPY(HighlightAnnotation)
746 friend class AnnotationPrivate;
750 ~StampAnnotation()
override;
789 explicit StampAnnotation(StampAnnotationPrivate &dd);
790 Q_DECLARE_PRIVATE(StampAnnotation)
791 Q_DISABLE_COPY(StampAnnotation)
804class POPPLER_QT6_EXPORT SignatureAnnotation :
public Annotation
806 friend class AnnotationPrivate;
829 void setText(
const QString &text);
830 void setLeftText(
const QString &text);
842 void setLeftFontSize(
double fontSize);
848 void setFontColor(
const QColor &color);
854 void setBorderColor(
const QColor &color);
862 void setBorderWidth(
double width);
868 void setBackgroundColor(
const QColor &color);
870 QString imagePath()
const;
871 void setImagePath(
const QString &imagePath);
873 QString fieldPartialName()
const;
874 void setFieldPartialName(
const QString &fieldPartialName);
876 [[nodiscard]]
SigningResult sign(
const QString &outputFileName,
const PDFConverter::NewSignatureData &data);
886 explicit SignatureAnnotation(SignatureAnnotationPrivate &dd);
887 Q_DECLARE_PRIVATE(SignatureAnnotation)
888 Q_DISABLE_COPY(SignatureAnnotation)
898 friend class AnnotationPrivate;
902 ~InkAnnotation()
override;
905 QList<QVector<QPointF>> inkPaths()
const;
906 void setInkPaths(
const QList<QVector<QPointF>> &paths);
909 explicit InkAnnotation(InkAnnotationPrivate &dd);
910 Q_DECLARE_PRIVATE(InkAnnotation)
911 Q_DISABLE_COPY(InkAnnotation)
916 friend class AnnotationPrivate;
919 ~LinkAnnotation()
override;
931 Link *linkDestination()
const;
932 void setLinkDestination(std::unique_ptr<Link> &&link);
934 HighlightMode linkHighlightMode()
const;
935 void setLinkHighlightMode(HighlightMode mode);
937 QPointF linkRegionPoint(
int id)
const;
938 void setLinkRegionPoint(
int id, QPointF point);
954 friend class AnnotationPrivate;
958 ~CaretAnnotation()
override;
970 CaretSymbol caretSymbol()
const;
971 void setCaretSymbol(CaretSymbol symbol);
984class POPPLER_QT6_EXPORT FileAttachmentAnnotation :
public Annotation
986 friend class AnnotationPrivate;
989 ~FileAttachmentAnnotation()
override;
1013 FileAttachmentAnnotation();
1014 explicit FileAttachmentAnnotation(FileAttachmentAnnotationPrivate &dd);
1015 Q_DECLARE_PRIVATE(FileAttachmentAnnotation)
1016 Q_DISABLE_COPY(FileAttachmentAnnotation)
1026 friend class AnnotationPrivate;
1029 ~SoundAnnotation()
override;
1054 explicit SoundAnnotation(SoundAnnotationPrivate &dd);
1055 Q_DECLARE_PRIVATE(SoundAnnotation)
1056 Q_DISABLE_COPY(SoundAnnotation)
1066 friend class AnnotationPrivate;
1069 ~MovieAnnotation()
override;
1094 explicit MovieAnnotation(MovieAnnotationPrivate &dd);
1095 Q_DECLARE_PRIVATE(MovieAnnotation)
1096 Q_DISABLE_COPY(MovieAnnotation)
1106 friend class AnnotationPrivate;
1109 ~ScreenAnnotation()
override;
1143 explicit ScreenAnnotation(ScreenAnnotationPrivate &dd);
1144 Q_DECLARE_PRIVATE(ScreenAnnotation)
1145 Q_DISABLE_COPY(ScreenAnnotation)
1158 friend class AnnotationPrivate;
1161 ~WidgetAnnotation()
override;
1173 explicit WidgetAnnotation(WidgetAnnotationPrivate &dd);
1174 Q_DECLARE_PRIVATE(WidgetAnnotation)
1175 Q_DISABLE_COPY(WidgetAnnotation)
1185 friend class AnnotationPrivate;
1188 ~RichMediaAnnotation()
override;
1200 class POPPLER_QT6_EXPORT Params
1202 friend class AnnotationPrivate;
1214 void setFlashVars(
const QString &
flashVars);
1217 QScopedPointer<Private> d;
1227 class POPPLER_QT6_EXPORT Instance
1229 friend class AnnotationPrivate;
1265 void setParams(std::unique_ptr<RichMediaAnnotation::Params> &&
params);
1266 void setEmbeddedFile(std::unique_ptr<EmbeddedFile> &&
embeddedFile);
1269 QScopedPointer<Private> d;
1278 class POPPLER_QT6_EXPORT Configuration
1280 friend class AnnotationPrivate;
1314 void setName(
const QString &
name);
1315 void setInstances(
const QList<RichMediaAnnotation::Instance *> &
instances);
1318 QScopedPointer<Private> d;
1328 class POPPLER_QT6_EXPORT Asset
1330 friend class AnnotationPrivate;
1347 void setName(
const QString &
name);
1348 void setEmbeddedFile(std::unique_ptr<EmbeddedFile> &&
embeddedFile);
1351 QScopedPointer<Private> d;
1360 class POPPLER_QT6_EXPORT Content
1362 friend class AnnotationPrivate;
1376 QList<RichMediaAnnotation::Asset *>
assets()
const;
1379 void setConfigurations(
const QList<RichMediaAnnotation::Configuration *> &
configurations);
1380 void setAssets(
const QList<RichMediaAnnotation::Asset *> &
assets);
1383 QScopedPointer<Private> d;
1392 class POPPLER_QT6_EXPORT Activation
1394 friend class AnnotationPrivate;
1419 QScopedPointer<Private> d;
1428 class POPPLER_QT6_EXPORT Deactivation
1430 friend class AnnotationPrivate;
1455 QScopedPointer<Private> d;
1464 class POPPLER_QT6_EXPORT Settings
1466 friend class AnnotationPrivate;
1483 void setActivation(std::unique_ptr<RichMediaAnnotation::Activation> &&
activation);
1484 void setDeactivation(std::unique_ptr<RichMediaAnnotation::Deactivation> &&
deactivation);
1487 QScopedPointer<Private> d;
1501 void setSettings(std::unique_ptr<RichMediaAnnotation::Settings> &&
settings);
1502 void setContent(std::unique_ptr<RichMediaAnnotation::Content> &&
content);
1504 RichMediaAnnotation();
1505 explicit RichMediaAnnotation(RichMediaAnnotationPrivate &dd);
1506 Q_DECLARE_PRIVATE(RichMediaAnnotation)
1507 Q_DISABLE_COPY(RichMediaAnnotation)
AnnotationAppearance class wrapping Poppler's AP stream object.
Definition poppler-annotation.h:95
Container class for Annotation style information.
Definition poppler-annotation.h:327
Annotation class holding properties shared by all annotations.
Definition poppler-annotation.h:181
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:194
@ AHighlight
HighlightAnnotation.
Definition poppler-annotation.h:198
@ AWidget
WidgetAnnotation.
Definition poppler-annotation.h:207
@ ACaret
CaretAnnotation.
Definition poppler-annotation.h:202
@ AStamp
StampAnnotation.
Definition poppler-annotation.h:199
@ AFileAttachment
FileAttachmentAnnotation.
Definition poppler-annotation.h:203
@ AMovie
MovieAnnotation.
Definition poppler-annotation.h:205
@ ASound
SoundAnnotation.
Definition poppler-annotation.h:204
@ ARichMedia
RichMediaAnnotation.
Definition poppler-annotation.h:208
@ AText
TextAnnotation.
Definition poppler-annotation.h:195
@ AInk
InkAnnotation.
Definition poppler-annotation.h:200
@ ALink
LinkAnnotation.
Definition poppler-annotation.h:201
@ AScreen
ScreenAnnotation.
Definition poppler-annotation.h:206
@ AGeom
GeomAnnotation.
Definition poppler-annotation.h:197
@ ALine
LineAnnotation.
Definition poppler-annotation.h:196
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:220
@ FixedRotation
Do not rotate the annotation according to page orientation and rendering rotation.
Definition poppler-annotation.h:223
@ Hidden
Do not display or print the annotation.
Definition poppler-annotation.h:221
@ DenyPrint
Do not print the annotation.
Definition poppler-annotation.h:224
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:442
@ MouseReleasedAction
Performed when the mouse button is released inside the annotation's active area.
Definition poppler-annotation.h:446
@ FocusInAction
Performed when the annotation receives the input focus.
Definition poppler-annotation.h:447
@ PageOpeningAction
Performed when the page containing the annotation is opened.
Definition poppler-annotation.h:449
@ MousePressedAction
Performed when the mouse button is pressed inside the annotation's active area.
Definition poppler-annotation.h:445
@ FocusOutAction
Performed when the annotation loses the input focus.
Definition poppler-annotation.h:448
@ PageInvisibleAction
Performed when the page containing the annotation becomes invisible.
Definition poppler-annotation.h:452
@ PageClosingAction
Performed when the page containing the annotation is closed.
Definition poppler-annotation.h:450
@ CursorLeavingAction
Performed when the cursor exists the annotation's active area.
Definition poppler-annotation.h:444
@ PageVisibleAction
Performed when the page containing the annotation becomes visible.
Definition poppler-annotation.h:451
@ CursorEnteringAction
Performed when the cursor enters the annotation's active area.
Definition poppler-annotation.h:443
virtual SubType subType() const =0
The type of the annotation.
Caret annotation.
Definition poppler-annotation.h:953
SubType subType() const override
The type of the annotation.
CaretSymbol
The symbols for the caret annotation.
Definition poppler-annotation.h:965
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:646
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:691
@ Squiggly
jagged or squiggly underline
Definition poppler-annotation.h:693
@ Underline
straight line underline
Definition poppler-annotation.h:694
@ StrikeOut
straight line through-line
Definition poppler-annotation.h:695
@ Highlight
highlighter pen style annotation
Definition poppler-annotation.h:692
SubType subType() const override
The type of the annotation.
SubType subType() const override
The type of the annotation.
Definition poppler-annotation.h:915
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:1361
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:805
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:813
@ SigningSuccess
No error.
Definition poppler-annotation.h:814
@ WriteFailed
Write failed (permissions, faulty disk, ...).
Definition poppler-annotation.h:819
@ InternalError
Unexpected error, likely a bug in poppler.
Definition poppler-annotation.h:817
@ UnsupportedSignatureType
User asked for a signature type that the current backend/key combo can't deliver.
Definition poppler-annotation.h:822
@ FieldAlreadySigned
Trying to sign a field that is already signed.
Definition poppler-annotation.h:815
@ BadPassphrase
User entered bad passphrase.
Definition poppler-annotation.h:821
@ KeyMissing
Key not found (Either the input key is not from the list or the available keys has changed underneath...
Definition poppler-annotation.h:818
@ GenericSigningError
Unclassified error.
Definition poppler-annotation.h:816
@ UserCancelled
User cancelled the process.
Definition poppler-annotation.h:820
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:55
Structure corresponding to a QuadPoints array.
Definition poppler-annotation.h:704