34#ifndef _POPPLER_ANNOTATION_H_
35#define _POPPLER_ANNOTATION_H_
37#include <QtCore/QDateTime>
38#include <QtCore/QSharedDataPointer>
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 "poppler-export.h"
47#include "poppler-converter.h"
54class AnnotationPrivate;
55class AnnotationAppearancePrivate;
56class TextAnnotationPrivate;
57class LineAnnotationPrivate;
58class GeomAnnotationPrivate;
59class HighlightAnnotationPrivate;
60class StampAnnotationPrivate;
61class SignatureAnnotationPrivate;
62class InkAnnotationPrivate;
63class LinkAnnotationPrivate;
64class CaretAnnotationPrivate;
65class FileAttachmentAnnotationPrivate;
66class SoundAnnotationPrivate;
67class MovieAnnotationPrivate;
68class ScreenAnnotationPrivate;
69class WidgetAnnotationPrivate;
70class RichMediaAnnotationPrivate;
90class POPPLER_QT6_EXPORT AnnotationAppearance
92 friend class Annotation;
95 explicit AnnotationAppearance(AnnotationAppearancePrivate *annotationAppearancePrivate);
96 ~AnnotationAppearance();
99 AnnotationAppearancePrivate *d;
100 Q_DISABLE_COPY(AnnotationAppearance)
178 friend class LinkMovie;
179 friend class LinkRendition;
223 ToggleHidingOnMouse = 64,
226 Q_DECLARE_FLAGS(Flags, Flag)
268 QString contents()
const;
269 void setContents(
const QString &contents);
282 QDateTime modificationDate()
const;
283 void setModificationDate(
const QDateTime &date);
285 QDateTime creationDate()
const;
286 void setCreationDate(
const QDateTime &date);
322 class POPPLER_QT6_EXPORT Style
326 Style(
const Style &other);
327 Style &operator=(
const Style &other);
331 QColor color()
const;
332 void setColor(
const QColor &color);
333 double opacity()
const;
334 void setOpacity(
double opacity);
337 double width()
const;
338 void setWidth(
double width);
339 LineStyle lineStyle()
const;
340 void setLineStyle(LineStyle style);
341 double xCorners()
const;
342 void setXCorners(
double radius);
343 double yCorners()
const;
344 void setYCorners(
double radius);
345 const QVector<double> &dashArray()
const;
346 void setDashArray(
const QVector<double> &array);
349 LineEffect lineEffect()
const;
350 void setLineEffect(LineEffect effect);
351 double effectIntensity()
const;
352 void setEffectIntensity(
double intens);
356 QSharedDataPointer<Private> d;
360 void setStyle(
const Style &style);
365 class POPPLER_QT6_EXPORT Popup
369 Popup(
const Popup &other);
370 Popup &operator=(
const Popup &other);
375 void setFlags(
int flags);
378 QRectF geometry()
const;
379 void setGeometry(
const QRectF &geom);
382 QString title()
const;
383 void setTitle(
const QString &title);
384 QString summary()
const;
385 void setSummary(
const QString &summary);
386 QString text()
const;
387 void setText(
const QString &text);
391 QSharedDataPointer<Private> d;
398 RevScope revisionScope()
const;
400 RevType revisionType()
const;
405 std::vector<std::unique_ptr<Annotation>>
revisions()
const;
455 QExplicitlySharedDataPointer<AnnotationPrivate> d_ptr;
470 friend class AnnotationPrivate;
485 enum InplaceAlignPosition
492 explicit TextAnnotation(TextType type);
493 ~TextAnnotation()
override;
522 QFont textFont()
const;
523 void setTextFont(
const QFont &font);
526 void setTextColor(
const QColor &color);
528 InplaceAlignPosition inplaceAlign()
const;
529 void setInplaceAlign(InplaceAlignPosition align);
531 QPointF calloutPoint(
int id)
const;
532 QVector<QPointF> calloutPoints()
const;
533 void setCalloutPoints(
const QVector<QPointF> &points);
535 InplaceIntent inplaceIntent()
const;
536 void setInplaceIntent(InplaceIntent intent);
539 explicit TextAnnotation(TextAnnotationPrivate &dd);
540 void setTextType(TextType type);
541 Q_DECLARE_PRIVATE(TextAnnotation)
542 Q_DISABLE_COPY(TextAnnotation)
552 friend class AnnotationPrivate;
582 explicit LineAnnotation(LineType type);
583 ~LineAnnotation()
override;
586 LineType lineType()
const;
588 QVector<QPointF> linePoints()
const;
589 void setLinePoints(
const QVector<QPointF> &points);
591 TermStyle lineStartStyle()
const;
592 void setLineStartStyle(TermStyle style);
594 TermStyle lineEndStyle()
const;
595 void setLineEndStyle(TermStyle style);
597 bool isLineClosed()
const;
598 void setLineClosed(
bool closed);
600 QColor lineInnerColor()
const;
601 void setLineInnerColor(
const QColor &color);
603 double lineLeadingForwardPoint()
const;
604 void setLineLeadingForwardPoint(
double point);
606 double lineLeadingBackPoint()
const;
607 void setLineLeadingBackPoint(
double point);
609 bool lineShowCaption()
const;
610 void setLineShowCaption(
bool show);
612 LineIntent lineIntent()
const;
613 void setLineIntent(LineIntent intent);
616 explicit LineAnnotation(LineAnnotationPrivate &dd);
617 void setLineType(LineType type);
618 Q_DECLARE_PRIVATE(LineAnnotation)
619 Q_DISABLE_COPY(LineAnnotation)
630 friend class AnnotationPrivate;
634 ~GeomAnnotation()
override;
644 GeomType geomType()
const;
645 void setGeomType(GeomType type);
647 QColor geomInnerColor()
const;
648 void setGeomInnerColor(
const QColor &color);
661class POPPLER_QT6_EXPORT HighlightAnnotation :
public Annotation
663 friend class AnnotationPrivate;
666 HighlightAnnotation();
667 ~HighlightAnnotation()
override;
717 explicit HighlightAnnotation(HighlightAnnotationPrivate &dd);
718 Q_DECLARE_PRIVATE(HighlightAnnotation)
719 Q_DISABLE_COPY(HighlightAnnotation)
729 friend class AnnotationPrivate;
733 ~StampAnnotation()
override;
772 explicit StampAnnotation(StampAnnotationPrivate &dd);
773 Q_DECLARE_PRIVATE(StampAnnotation)
774 Q_DISABLE_COPY(StampAnnotation)
787class POPPLER_QT6_EXPORT SignatureAnnotation :
public Annotation
789 friend class AnnotationPrivate;
811 void setText(
const QString &text);
812 void setLeftText(
const QString &text);
824 void setLeftFontSize(
double fontSize);
830 void setFontColor(
const QColor &color);
836 void setBorderColor(
const QColor &color);
844 void setBorderWidth(
double width);
850 void setBackgroundColor(
const QColor &color);
852 QString imagePath()
const;
853 void setImagePath(
const QString &imagePath);
855 QString fieldPartialName()
const;
856 void setFieldPartialName(
const QString &fieldPartialName);
858 [[nodiscard]]
SigningResult sign(
const QString &outputFileName,
const PDFConverter::NewSignatureData &data);
868 explicit SignatureAnnotation(SignatureAnnotationPrivate &dd);
869 Q_DECLARE_PRIVATE(SignatureAnnotation)
870 Q_DISABLE_COPY(SignatureAnnotation)
880 friend class AnnotationPrivate;
884 ~InkAnnotation()
override;
887 QList<QVector<QPointF>> inkPaths()
const;
888 void setInkPaths(
const QList<QVector<QPointF>> &paths);
891 explicit InkAnnotation(InkAnnotationPrivate &dd);
892 Q_DECLARE_PRIVATE(InkAnnotation)
893 Q_DISABLE_COPY(InkAnnotation)
898 friend class AnnotationPrivate;
901 ~LinkAnnotation()
override;
913 Link *linkDestination()
const;
914 void setLinkDestination(std::unique_ptr<Link> &&link);
916 HighlightMode linkHighlightMode()
const;
917 void setLinkHighlightMode(HighlightMode mode);
919 QPointF linkRegionPoint(
int id)
const;
920 void setLinkRegionPoint(
int id,
const QPointF point);
936 friend class AnnotationPrivate;
940 ~CaretAnnotation()
override;
952 CaretSymbol caretSymbol()
const;
953 void setCaretSymbol(CaretSymbol symbol);
966class POPPLER_QT6_EXPORT FileAttachmentAnnotation :
public Annotation
968 friend class AnnotationPrivate;
971 ~FileAttachmentAnnotation()
override;
995 FileAttachmentAnnotation();
996 explicit FileAttachmentAnnotation(FileAttachmentAnnotationPrivate &dd);
997 Q_DECLARE_PRIVATE(FileAttachmentAnnotation)
998 Q_DISABLE_COPY(FileAttachmentAnnotation)
1008 friend class AnnotationPrivate;
1011 ~SoundAnnotation()
override;
1036 explicit SoundAnnotation(SoundAnnotationPrivate &dd);
1037 Q_DECLARE_PRIVATE(SoundAnnotation)
1038 Q_DISABLE_COPY(SoundAnnotation)
1048 friend class AnnotationPrivate;
1051 ~MovieAnnotation()
override;
1076 explicit MovieAnnotation(MovieAnnotationPrivate &dd);
1077 Q_DECLARE_PRIVATE(MovieAnnotation)
1078 Q_DISABLE_COPY(MovieAnnotation)
1088 friend class AnnotationPrivate;
1091 ~ScreenAnnotation()
override;
1125 explicit ScreenAnnotation(ScreenAnnotationPrivate &dd);
1126 Q_DECLARE_PRIVATE(ScreenAnnotation)
1127 Q_DISABLE_COPY(ScreenAnnotation)
1140 friend class AnnotationPrivate;
1143 ~WidgetAnnotation()
override;
1155 explicit WidgetAnnotation(WidgetAnnotationPrivate &dd);
1156 Q_DECLARE_PRIVATE(WidgetAnnotation)
1157 Q_DISABLE_COPY(WidgetAnnotation)
1167 friend class AnnotationPrivate;
1170 ~RichMediaAnnotation()
override;
1182 class POPPLER_QT6_EXPORT Params
1184 friend class AnnotationPrivate;
1196 void setFlashVars(
const QString &
flashVars);
1199 QScopedPointer<Private> d;
1209 class POPPLER_QT6_EXPORT Instance
1211 friend class AnnotationPrivate;
1243 QScopedPointer<Private> d;
1252 class POPPLER_QT6_EXPORT Configuration
1254 friend class AnnotationPrivate;
1288 void setName(
const QString &
name);
1289 void setInstances(
const QList<RichMediaAnnotation::Instance *> &
instances);
1292 QScopedPointer<Private> d;
1302 class POPPLER_QT6_EXPORT Asset
1304 friend class AnnotationPrivate;
1321 void setName(
const QString &
name);
1325 QScopedPointer<Private> d;
1334 class POPPLER_QT6_EXPORT Content
1336 friend class AnnotationPrivate;
1350 QList<RichMediaAnnotation::Asset *>
assets()
const;
1353 void setConfigurations(
const QList<RichMediaAnnotation::Configuration *> &
configurations);
1354 void setAssets(
const QList<RichMediaAnnotation::Asset *> &
assets);
1357 QScopedPointer<Private> d;
1366 class POPPLER_QT6_EXPORT Activation
1368 friend class AnnotationPrivate;
1393 QScopedPointer<Private> d;
1402 class POPPLER_QT6_EXPORT Deactivation
1404 friend class AnnotationPrivate;
1429 QScopedPointer<Private> d;
1438 class POPPLER_QT6_EXPORT Settings
1440 friend class AnnotationPrivate;
1461 QScopedPointer<Private> d;
1478 RichMediaAnnotation();
1479 explicit RichMediaAnnotation(RichMediaAnnotationPrivate &dd);
1480 Q_DECLARE_PRIVATE(RichMediaAnnotation)
1481 Q_DISABLE_COPY(RichMediaAnnotation)
AnnotationAppearance class wrapping Poppler's AP stream object.
Definition poppler-annotation.h:91
Container class for Annotation style information.
Definition poppler-annotation.h:323
Annotation class holding properties shared by all annotations.
Definition poppler-annotation.h:177
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:190
@ AHighlight
HighlightAnnotation.
Definition poppler-annotation.h:194
@ AWidget
WidgetAnnotation.
Definition poppler-annotation.h:203
@ ACaret
CaretAnnotation.
Definition poppler-annotation.h:198
@ AStamp
StampAnnotation.
Definition poppler-annotation.h:195
@ AFileAttachment
FileAttachmentAnnotation.
Definition poppler-annotation.h:199
@ AMovie
MovieAnnotation.
Definition poppler-annotation.h:201
@ ASound
SoundAnnotation.
Definition poppler-annotation.h:200
@ ARichMedia
RichMediaAnnotation.
Definition poppler-annotation.h:204
@ AText
TextAnnotation.
Definition poppler-annotation.h:191
@ AInk
InkAnnotation.
Definition poppler-annotation.h:196
@ ALink
LinkAnnotation.
Definition poppler-annotation.h:197
@ AScreen
ScreenAnnotation.
Definition poppler-annotation.h:202
@ AGeom
GeomAnnotation.
Definition poppler-annotation.h:193
@ ALine
LineAnnotation.
Definition poppler-annotation.h:192
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:216
@ FixedRotation
Do not rotate the annotation according to page orientation and rendering rotation.
Definition poppler-annotation.h:219
@ Hidden
Do not display or print the annotation.
Definition poppler-annotation.h:217
@ DenyPrint
Do not print the annotation.
Definition poppler-annotation.h:220
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:438
@ MouseReleasedAction
Performed when the mouse button is released inside the annotation's active area.
Definition poppler-annotation.h:442
@ FocusInAction
Performed when the annotation receives the input focus.
Definition poppler-annotation.h:443
@ PageOpeningAction
Performed when the page containing the annotation is opened.
Definition poppler-annotation.h:445
@ MousePressedAction
Performed when the mouse button is pressed inside the annotation's active area.
Definition poppler-annotation.h:441
@ FocusOutAction
Performed when the annotation loses the input focus.
Definition poppler-annotation.h:444
@ PageInvisibleAction
Performed when the page containing the annotation becomes invisible.
Definition poppler-annotation.h:448
@ PageClosingAction
Performed when the page containing the annotation is closed.
Definition poppler-annotation.h:446
@ CursorLeavingAction
Performed when the cursor exists the annotation's active area.
Definition poppler-annotation.h:440
@ PageVisibleAction
Performed when the page containing the annotation becomes visible.
Definition poppler-annotation.h:447
@ CursorEnteringAction
Performed when the cursor enters the annotation's active area.
Definition poppler-annotation.h:439
virtual SubType subType() const =0
The type of the annotation.
Caret annotation.
Definition poppler-annotation.h:935
SubType subType() const override
The type of the annotation.
CaretSymbol
The symbols for the caret annotation.
Definition poppler-annotation.h:947
Container class for an embedded file with a PDF document.
Definition poppler-qt6.h:339
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:629
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:674
@ Squiggly
jagged or squiggly underline
Definition poppler-annotation.h:676
@ Underline
straight line underline
Definition poppler-annotation.h:677
@ StrikeOut
straight line through-line
Definition poppler-annotation.h:678
@ Highlight
highlighter pen style annotation
Definition poppler-annotation.h:675
SubType subType() const override
The type of the annotation.
SubType subType() const override
The type of the annotation.
Definition poppler-annotation.h:897
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:1876
A page in a document.
Definition poppler-qt6.h:425
The content object of a RichMediaAnnotation.
Definition poppler-annotation.h:1335
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:788
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:796
@ SigningSuccess
No error.
Definition poppler-annotation.h:797
@ WriteFailed
Write failed (permissions, faulty disk, ...).
Definition poppler-annotation.h:802
@ InternalError
Unexpected error, likely a bug in poppler.
Definition poppler-annotation.h:800
@ FieldAlreadySigned
Trying to sign a field that is already signed.
Definition poppler-annotation.h:798
@ BadPassphrase
User entered bad passphrase.
Definition poppler-annotation.h:804
@ KeyMissing
Key not found (Either the input key is not from the list or the available keys has changed underneath...
Definition poppler-annotation.h:801
@ GenericSigningError
Unclassified error.
Definition poppler-annotation.h:799
@ UserCancelled
User cancelled the process.
Definition poppler-annotation.h:803
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:1800
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:51
Structure corresponding to a QuadPoints array.
Definition poppler-annotation.h:687