Poppler Qt6 25.12.90
poppler-annotation.h
1/* poppler-annotation.h: qt interface to poppler
2 * Copyright (C) 2006-2008, 2012, 2013, 2018-2022 Albert Astals Cid <aacid@kde.org>
3 * Copyright (C) 2006, 2008 Pino Toscano <pino@kde.org>
4 * Copyright (C) 2007, Brad Hards <bradh@frogmouth.net>
5 * Copyright (C) 2010, Philip Lorenz <lorenzph+freedesktop@gmail.com>
6 * Copyright (C) 2012, 2015, Tobias Koenig <tobias.koenig@kdab.com>
7 * Copyright (C) 2012, Guillermo A. Amaral B. <gamaral@kde.org>
8 * Copyright (C) 2012, 2013 Fabio D'Urso <fabiodurso@hotmail.it>
9 * Copyright (C) 2013, Anthony Granger <grangeranthony@gmail.com>
10 * Copyright (C) 2018, Dileep Sankhla <sankhla.dileep96@gmail.com>
11 * Copyright (C) 2020, Katarina Behrens <Katarina.Behrens@cib.de>
12 * Copyright (C) 2020, 2024, Klarälvdalens Datakonsult AB, a KDAB Group company, <info@kdab.com>. Work sponsored by Technische Universität Dresden
13 * Copyright (C) 2021, Oliver Sander <oliver.sander@tu-dresden.de>
14 * Copyright (C) 2021, Mahmoud Ahmed Khalil <mahmoudkhalil11@gmail.com>
15 * Copyright (C) 2024, 2025, g10 Code GmbH, Author: Sune Stolborg Vuorela <sune@vuorela.dk>
16 * Copyright (C) 2025, Aditya Tiwari <suntiwari3495@gmail.com>
17 * Adapting code from
18 * Copyright (C) 2004 by Enrico Ros <eros.kde@email.it>
19 *
20 * This program is free software; you can redistribute it and/or modify
21 * it under the terms of the GNU General Public License as published by
22 * the Free Software Foundation; either version 2, or (at your option)
23 * any later version.
24 *
25 * This program is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 * GNU General Public License for more details.
29 *
30 * You should have received a copy of the GNU General Public License
31 * along with this program; if not, write to the Free Software
32 * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
33 */
34
35#ifndef _POPPLER_ANNOTATION_H_
36#define _POPPLER_ANNOTATION_H_
37
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>
46#include <QtGui/QFont>
47#include "poppler-export.h"
48#include "poppler-converter.h"
49
50#include <memory>
51
52namespace Poppler {
53
54class Annotation;
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;
72class EmbeddedFile;
73class Link;
74class SoundObject;
75class MovieObject;
76class LinkRendition;
77class Page;
78
91class POPPLER_QT6_EXPORT AnnotationAppearance
92{
93 friend class Annotation;
94
95public:
96 explicit AnnotationAppearance(AnnotationAppearancePrivate *annotationAppearancePrivate);
97 ~AnnotationAppearance();
98
99private:
100 AnnotationAppearancePrivate *d;
101 Q_DISABLE_COPY(AnnotationAppearance)
102};
103
177class POPPLER_QT6_EXPORT Annotation
178{
179 friend class LinkMovie;
180 friend class LinkRendition;
181
182public:
183 // enum definitions
189 // WARNING!!! oKular uses that very same values so if you change them notify the author!
207
215 // NOTE: Only flags that are known to work are documented
216 enum Flag
217 {
218 Hidden = 1,
219 FixedSize = 2,
222 DenyWrite = 16,
223 DenyDelete = 32,
224 ToggleHidingOnMouse = 64,
225 External = 128
226 };
227 Q_DECLARE_FLAGS(Flags, Flag)
228
229 enum LineStyle
230 {
231 Solid = 1,
232 Dashed = 2,
233 Beveled = 4,
234 Inset = 8,
235 Underline = 16
236 };
237 enum LineEffect
238 {
239 NoEffect = 1,
240 Cloudy = 2
241 };
242 enum RevScope
243 {
244 Root = 0,
245 Reply = 1,
246 Group = 2,
247 Delete = 4
248 };
249 enum RevType
250 {
251 None = 1,
252 Marked = 2,
253 Unmarked = 4,
254 Accepted = 8,
255 Rejected = 16,
256 Cancelled = 32,
257 Completed = 64
258 };
259
263 QString author() const;
267 void setAuthor(const QString &author);
268
269 QString contents() const;
270 void setContents(const QString &contents);
271
275 QString uniqueName() const;
281 void setUniqueName(const QString &uniqueName);
282
283 QDateTime modificationDate() const;
284 void setModificationDate(const QDateTime &date);
285
286 QDateTime creationDate() const;
287 void setCreationDate(const QDateTime &date);
288
294 Flags flags() const;
300 void setFlags(Flags flags);
301
307 QRectF boundary() const;
318 void setBoundary(const QRectF &boundary);
319
323 class POPPLER_QT6_EXPORT Style
324 {
325 public:
326 Style();
327 Style(const Style &other);
328 Style &operator=(const Style &other);
329 ~Style();
330
331 // appearance properties
332 QColor color() const; // black
333 void setColor(const QColor &color);
334 double opacity() const; // 1.0
335 void setOpacity(double opacity);
336
337 // pen properties
338 double width() const; // 1.0
339 void setWidth(double width);
340 LineStyle lineStyle() const; // LineStyle::Solid
341 void setLineStyle(LineStyle style);
342 double xCorners() const; // 0.0
343 void setXCorners(double radius);
344 double yCorners() const; // 0.0
345 void setYCorners(double radius);
346 const QVector<double> &dashArray() const; // [ 3 ]
347 void setDashArray(const QVector<double> &array);
348
349 // pen effects
350 LineEffect lineEffect() const; // LineEffect::NoEffect
351 void setLineEffect(LineEffect effect);
352 double effectIntensity() const; // 1.0
353 void setEffectIntensity(double intens);
354
355 private:
356 class Private;
357 QSharedDataPointer<Private> d;
358 };
359
360 Style style() const;
361 void setStyle(const Style &style);
362
366 class POPPLER_QT6_EXPORT Popup
367 {
368 public:
369 Popup();
370 Popup(const Popup &other);
371 Popup &operator=(const Popup &other);
372 ~Popup();
373
374 // window state (Hidden, FixedRotation, Deny* flags allowed)
375 int flags() const; // -1 (never initialized) -> 0 (if inited and shown)
376 void setFlags(int flags);
377
378 // geometric properties
379 QRectF geometry() const; // no default
380 void setGeometry(const QRectF &geom);
381
382 // window contents/override properties
383 QString title() const; // '' text in the titlebar (overrides author)
384 void setTitle(const QString &title);
385 QString summary() const; // '' short description (displayed if not empty)
386 void setSummary(const QString &summary);
387 QString text() const; // '' text for the window (overrides annot->contents)
388 void setText(const QString &text);
389
390 private:
391 class Private;
392 QSharedDataPointer<Private> d;
393 };
394
395 Popup popup() const;
397 void setPopup(const Popup &popup);
398
399 RevScope revisionScope() const; // Root
400
401 RevType revisionType() const; // None
402
406 std::vector<std::unique_ptr<Annotation>> revisions() const;
407
411 virtual SubType subType() const = 0;
412
418 std::unique_ptr<AnnotationAppearance> annotationAppearance() const;
419
426
430 virtual ~Annotation();
431
451
452protected:
454 explicit Annotation(AnnotationPrivate &dd);
455 Q_DECLARE_PRIVATE(Annotation)
456 QExplicitlySharedDataPointer<AnnotationPrivate> d_ptr;
458
459private:
460 Q_DISABLE_COPY(Annotation)
461};
462
469class POPPLER_QT6_EXPORT TextAnnotation : public Annotation
470{
471 friend class AnnotationPrivate;
472
473public:
474 // local enums
475 enum TextType
476 {
477 Linked,
478 InPlace
479 };
480 enum InplaceIntent
481 {
482 Unknown,
483 Callout,
484 TypeWriter
485 };
486 enum InplaceAlignPosition
487 {
488 InplaceAlignLeft,
489 InplaceAlignCenter,
490 InplaceAlignRight
491 };
492
493 explicit TextAnnotation(TextType type);
494 ~TextAnnotation() override;
495 SubType subType() const override;
496
500 TextType textType() const;
501
527 QString textIcon() const;
528
534 void setTextIcon(const QString &icon);
535
536 QFont textFont() const;
537 void setTextFont(const QFont &font);
539 QColor textColor() const;
540 void setTextColor(const QColor &color);
541
542 InplaceAlignPosition inplaceAlign() const;
543 void setInplaceAlign(InplaceAlignPosition align);
544
545 QPointF calloutPoint(int id) const;
546 QVector<QPointF> calloutPoints() const;
547 void setCalloutPoints(const QVector<QPointF> &points);
548
549 InplaceIntent inplaceIntent() const;
550 void setInplaceIntent(InplaceIntent intent);
551
552private:
553 explicit TextAnnotation(TextAnnotationPrivate &dd);
554 void setTextType(TextType type);
555 Q_DECLARE_PRIVATE(TextAnnotation)
556 Q_DISABLE_COPY(TextAnnotation)
557};
558
564class POPPLER_QT6_EXPORT LineAnnotation : public Annotation
565{
566 friend class AnnotationPrivate;
567
568public:
569 // local enums
570 enum LineType
571 {
572 StraightLine,
573 Polyline
574 };
575 enum TermStyle
576 {
577 Square,
578 Circle,
579 Diamond,
580 OpenArrow,
581 ClosedArrow,
582 None,
583 Butt,
584 ROpenArrow,
585 RClosedArrow,
586 Slash
587 };
588 enum LineIntent
589 {
590 Unknown,
591 Arrow,
592 Dimension,
593 PolygonCloud
594 };
595
596 explicit LineAnnotation(LineType type);
597 ~LineAnnotation() override;
598 SubType subType() const override;
599
600 LineType lineType() const;
601
602 QVector<QPointF> linePoints() const;
603 void setLinePoints(const QVector<QPointF> &points);
604
605 TermStyle lineStartStyle() const;
606 void setLineStartStyle(TermStyle style);
607
608 TermStyle lineEndStyle() const;
609 void setLineEndStyle(TermStyle style);
610
611 bool isLineClosed() const;
612 void setLineClosed(bool closed);
613
614 QColor lineInnerColor() const;
615 void setLineInnerColor(const QColor &color);
616
617 double lineLeadingForwardPoint() const;
618 void setLineLeadingForwardPoint(double point);
619
620 double lineLeadingBackPoint() const;
621 void setLineLeadingBackPoint(double point);
622
623 bool lineShowCaption() const;
624 void setLineShowCaption(bool show);
625
626 LineIntent lineIntent() const;
627 void setLineIntent(LineIntent intent);
628
629private:
630 explicit LineAnnotation(LineAnnotationPrivate &dd);
631 void setLineType(LineType type);
632 Q_DECLARE_PRIVATE(LineAnnotation)
633 Q_DISABLE_COPY(LineAnnotation)
634};
635
642class POPPLER_QT6_EXPORT GeomAnnotation : public Annotation
643{
644 friend class AnnotationPrivate;
645
646public:
647 GeomAnnotation();
648 ~GeomAnnotation() override;
649 SubType subType() const override;
650
651 // common enums
652 enum GeomType
653 {
654 InscribedSquare,
655 InscribedCircle
656 };
657
658 GeomType geomType() const;
659 void setGeomType(GeomType type);
660
661 QColor geomInnerColor() const;
662 void setGeomInnerColor(const QColor &color);
663
664private:
665 explicit GeomAnnotation(GeomAnnotationPrivate &dd);
666 Q_DECLARE_PRIVATE(GeomAnnotation)
667 Q_DISABLE_COPY(GeomAnnotation)
668};
669
675class POPPLER_QT6_EXPORT HighlightAnnotation : public Annotation
676{
677 friend class AnnotationPrivate;
678
679public:
680 HighlightAnnotation();
681 ~HighlightAnnotation() override;
682 SubType subType() const override;
683
694
700 struct Quad
701 {
702 QPointF points[4]; // 8 valid coords
703 bool capStart; // false (vtx 1-4) [K]
704 bool capEnd; // false (vtx 2-3) [K]
705 double feather; // 0.1 (in range 0..1) [K]
706 };
707
713
719
723 QList<Quad> highlightQuads() const;
724
728 void setHighlightQuads(const QList<Quad> &quads);
729
730private:
731 explicit HighlightAnnotation(HighlightAnnotationPrivate &dd);
732 Q_DECLARE_PRIVATE(HighlightAnnotation)
733 Q_DISABLE_COPY(HighlightAnnotation)
734};
735
741class POPPLER_QT6_EXPORT StampAnnotation : public Annotation
742{
743 friend class AnnotationPrivate;
744
745public:
746 StampAnnotation();
747 ~StampAnnotation() override;
748 SubType subType() const override;
749
769 QString stampIconName() const;
770
776 void setStampIconName(const QString &name);
777
783 void setStampCustomImage(const QImage &image);
784
785private:
786 explicit StampAnnotation(StampAnnotationPrivate &dd);
787 Q_DECLARE_PRIVATE(StampAnnotation)
788 Q_DISABLE_COPY(StampAnnotation)
789};
790
801class POPPLER_QT6_EXPORT SignatureAnnotation : public Annotation
802{
803 friend class AnnotationPrivate;
804
805public:
820
822 ~SignatureAnnotation() override;
823 SubType subType() const override;
824
825 void setText(const QString &text);
826 void setLeftText(const QString &text);
827
831 double fontSize() const;
832 void setFontSize(double fontSize);
833
837 double leftFontSize() const;
838 void setLeftFontSize(double fontSize);
839
843 QColor fontColor() const;
844 void setFontColor(const QColor &color);
845
849 QColor borderColor() const;
850 void setBorderColor(const QColor &color);
851
857 double borderWidth() const;
858 void setBorderWidth(double width);
859
863 QColor backgroundColor() const;
864 void setBackgroundColor(const QColor &color);
865
866 QString imagePath() const;
867 void setImagePath(const QString &imagePath);
868
869 QString fieldPartialName() const;
870 void setFieldPartialName(const QString &fieldPartialName);
871
872 [[nodiscard]] SigningResult sign(const QString &outputFileName, const PDFConverter::NewSignatureData &data);
873
879 ErrorString lastSigningErrorDetails() const;
880
881private:
882 explicit SignatureAnnotation(SignatureAnnotationPrivate &dd);
883 Q_DECLARE_PRIVATE(SignatureAnnotation)
884 Q_DISABLE_COPY(SignatureAnnotation)
885};
886
892class POPPLER_QT6_EXPORT InkAnnotation : public Annotation
893{
894 friend class AnnotationPrivate;
895
896public:
897 InkAnnotation();
898 ~InkAnnotation() override;
899 SubType subType() const override;
900
901 QList<QVector<QPointF>> inkPaths() const;
902 void setInkPaths(const QList<QVector<QPointF>> &paths);
903
904private:
905 explicit InkAnnotation(InkAnnotationPrivate &dd);
906 Q_DECLARE_PRIVATE(InkAnnotation)
907 Q_DISABLE_COPY(InkAnnotation)
908};
909
910class POPPLER_QT6_EXPORT LinkAnnotation : public Annotation
911{
912 friend class AnnotationPrivate;
913
914public:
915 ~LinkAnnotation() override;
916 SubType subType() const override;
917
918 // local enums
919 enum HighlightMode
920 {
921 None,
922 Invert,
923 Outline,
924 Push
925 };
926
927 Link *linkDestination() const;
928 void setLinkDestination(std::unique_ptr<Link> &&link);
929
930 HighlightMode linkHighlightMode() const;
931 void setLinkHighlightMode(HighlightMode mode);
932
933 QPointF linkRegionPoint(int id) const;
934 void setLinkRegionPoint(int id, const QPointF point);
935
936private:
938 explicit LinkAnnotation(LinkAnnotationPrivate &dd);
939 Q_DECLARE_PRIVATE(LinkAnnotation)
940 Q_DISABLE_COPY(LinkAnnotation)
941};
942
948class POPPLER_QT6_EXPORT CaretAnnotation : public Annotation
949{
950 friend class AnnotationPrivate;
951
952public:
953 CaretAnnotation();
954 ~CaretAnnotation() override;
955 SubType subType() const override;
956
961 {
962 None,
963 P
964 };
965
966 CaretSymbol caretSymbol() const;
967 void setCaretSymbol(CaretSymbol symbol);
968
969private:
970 explicit CaretAnnotation(CaretAnnotationPrivate &dd);
971 Q_DECLARE_PRIVATE(CaretAnnotation)
972 Q_DISABLE_COPY(CaretAnnotation)
973};
974
980class POPPLER_QT6_EXPORT FileAttachmentAnnotation : public Annotation
981{
982 friend class AnnotationPrivate;
983
984public:
985 ~FileAttachmentAnnotation() override;
986 SubType subType() const override;
987
991 QString fileIconName() const;
995 void setFileIconName(const QString &icon);
996
1007
1008private:
1009 FileAttachmentAnnotation();
1010 explicit FileAttachmentAnnotation(FileAttachmentAnnotationPrivate &dd);
1011 Q_DECLARE_PRIVATE(FileAttachmentAnnotation)
1012 Q_DISABLE_COPY(FileAttachmentAnnotation)
1013};
1014
1020class POPPLER_QT6_EXPORT SoundAnnotation : public Annotation
1021{
1022 friend class AnnotationPrivate;
1023
1024public:
1025 ~SoundAnnotation() override;
1026 SubType subType() const override;
1027
1031 QString soundIconName() const;
1035 void setSoundIconName(const QString &icon);
1036
1047
1048private:
1049 SoundAnnotation();
1050 explicit SoundAnnotation(SoundAnnotationPrivate &dd);
1051 Q_DECLARE_PRIVATE(SoundAnnotation)
1052 Q_DISABLE_COPY(SoundAnnotation)
1053};
1054
1060class POPPLER_QT6_EXPORT MovieAnnotation : public Annotation
1061{
1062 friend class AnnotationPrivate;
1063
1064public:
1065 ~MovieAnnotation() override;
1066 SubType subType() const override;
1067
1078
1082 QString movieTitle() const;
1086 void setMovieTitle(const QString &title);
1087
1088private:
1089 MovieAnnotation();
1090 explicit MovieAnnotation(MovieAnnotationPrivate &dd);
1091 Q_DECLARE_PRIVATE(MovieAnnotation)
1092 Q_DISABLE_COPY(MovieAnnotation)
1093};
1094
1100class POPPLER_QT6_EXPORT ScreenAnnotation : public Annotation
1101{
1102 friend class AnnotationPrivate;
1103
1104public:
1105 ~ScreenAnnotation() override;
1106
1107 SubType subType() const override;
1108
1112 LinkRendition *action() const;
1113
1119 void setAction(LinkRendition *action);
1120
1124 QString screenTitle() const;
1125
1129 void setScreenTitle(const QString &title);
1130
1135 std::unique_ptr<Link> additionalAction(AdditionalActionType type) const;
1136
1137private:
1138 ScreenAnnotation();
1139 explicit ScreenAnnotation(ScreenAnnotationPrivate &dd);
1140 Q_DECLARE_PRIVATE(ScreenAnnotation)
1141 Q_DISABLE_COPY(ScreenAnnotation)
1142};
1143
1152class POPPLER_QT6_EXPORT WidgetAnnotation : public Annotation
1153{
1154 friend class AnnotationPrivate;
1155
1156public:
1157 ~WidgetAnnotation() override;
1158
1159 SubType subType() const override;
1160
1165 std::unique_ptr<Link> additionalAction(AdditionalActionType type) const;
1166
1167private:
1168 WidgetAnnotation();
1169 explicit WidgetAnnotation(WidgetAnnotationPrivate &dd);
1170 Q_DECLARE_PRIVATE(WidgetAnnotation)
1171 Q_DISABLE_COPY(WidgetAnnotation)
1172};
1173
1179class POPPLER_QT6_EXPORT RichMediaAnnotation : public Annotation
1180{
1181 friend class AnnotationPrivate;
1182
1183public:
1184 ~RichMediaAnnotation() override;
1185
1186 SubType subType() const override;
1187
1196 class POPPLER_QT6_EXPORT Params
1197 {
1198 friend class AnnotationPrivate;
1199
1200 public:
1201 Params();
1202 ~Params();
1203
1207 QString flashVars() const;
1208
1209 private:
1210 void setFlashVars(const QString &flashVars);
1211
1212 class Private;
1213 QScopedPointer<Private> d;
1214 };
1215
1223 class POPPLER_QT6_EXPORT Instance
1224 {
1225 friend class AnnotationPrivate;
1226
1227 public:
1238
1239 Instance();
1240 ~Instance();
1241
1245 Type type() const;
1246
1251
1252 private:
1253 void setType(Type type);
1254 void setParams(RichMediaAnnotation::Params *params);
1255
1256 class Private;
1257 QScopedPointer<Private> d;
1258 };
1259
1266 class POPPLER_QT6_EXPORT Configuration
1267 {
1268 friend class AnnotationPrivate;
1269
1270 public:
1281
1282 Configuration();
1284
1288 Type type() const;
1289
1293 QString name() const;
1294
1298 QList<RichMediaAnnotation::Instance *> instances() const;
1299
1300 private:
1301 void setType(Type type);
1302 void setName(const QString &name);
1303 void setInstances(const QList<RichMediaAnnotation::Instance *> &instances);
1304
1305 class Private;
1306 QScopedPointer<Private> d;
1307 };
1308
1316 class POPPLER_QT6_EXPORT Asset
1317 {
1318 friend class AnnotationPrivate;
1319
1320 public:
1321 Asset();
1322 ~Asset();
1323
1327 QString name() const;
1328
1333
1334 private:
1335 void setName(const QString &name);
1336 void setEmbeddedFile(EmbeddedFile *embeddedFile);
1337
1338 class Private;
1339 QScopedPointer<Private> d;
1340 };
1341
1348 class POPPLER_QT6_EXPORT Content
1349 {
1350 friend class AnnotationPrivate;
1351
1352 public:
1353 Content();
1354 ~Content();
1355
1359 QList<RichMediaAnnotation::Configuration *> configurations() const;
1360
1364 QList<RichMediaAnnotation::Asset *> assets() const;
1365
1366 private:
1367 void setConfigurations(const QList<RichMediaAnnotation::Configuration *> &configurations);
1368 void setAssets(const QList<RichMediaAnnotation::Asset *> &assets);
1369
1370 class Private;
1371 QScopedPointer<Private> d;
1372 };
1373
1380 class POPPLER_QT6_EXPORT Activation
1381 {
1382 friend class AnnotationPrivate;
1383
1384 public:
1394
1395 Activation();
1396 ~Activation();
1397
1402
1403 private:
1404 void setCondition(Condition condition);
1405
1406 class Private;
1407 QScopedPointer<Private> d;
1408 };
1409
1416 class POPPLER_QT6_EXPORT Deactivation
1417 {
1418 friend class AnnotationPrivate;
1419
1420 public:
1430
1431 Deactivation();
1432 ~Deactivation();
1433
1438
1439 private:
1440 void setCondition(Condition condition);
1441
1442 class Private;
1443 QScopedPointer<Private> d;
1444 };
1445
1452 class POPPLER_QT6_EXPORT Settings
1453 {
1454 friend class AnnotationPrivate;
1455
1456 public:
1457 Settings();
1458 ~Settings();
1459
1464
1469
1470 private:
1471 void setActivation(RichMediaAnnotation::Activation *activation);
1472 void setDeactivation(RichMediaAnnotation::Deactivation *deactivation);
1473
1474 class Private;
1475 QScopedPointer<Private> d;
1476 };
1477
1482
1487
1488private:
1489 void setSettings(RichMediaAnnotation::Settings *settings);
1490 void setContent(RichMediaAnnotation::Content *content);
1491
1492 RichMediaAnnotation();
1493 explicit RichMediaAnnotation(RichMediaAnnotationPrivate &dd);
1494 Q_DECLARE_PRIVATE(RichMediaAnnotation)
1495 Q_DISABLE_COPY(RichMediaAnnotation)
1496};
1497
1498}
1499
1500#endif
AnnotationAppearance class wrapping Poppler's AP stream object.
Definition poppler-annotation.h:92
Container class for Annotation pop-up window information.
Definition poppler-annotation.h:367
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
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 activation object of the RichMediaAnnotation::Settings object.
Definition poppler-annotation.h:1381
Condition
Describes the condition for activating the rich media.
Definition poppler-annotation.h:1389
@ PageVisible
Activate when page becomes visible.
Definition poppler-annotation.h:1391
@ PageOpened
Activate when page is opened.
Definition poppler-annotation.h:1390
@ UserAction
Activate when user interacts with the annotation.
Definition poppler-annotation.h:1392
Condition condition() const
Returns the activation condition.
EmbeddedFile * embeddedFile() const
Returns the embedded file the asset points to.
QString name() const
Returns the identifier name of the asset.
The configuration object of a RichMediaAnnotation::Content object.
Definition poppler-annotation.h:1267
Type
Describes the media type of the configuration.
Definition poppler-annotation.h:1275
@ Type3D
A 3D media file.
Definition poppler-annotation.h:1276
@ TypeVideo
A video media file.
Definition poppler-annotation.h:1279
@ TypeSound
A sound media file.
Definition poppler-annotation.h:1278
@ TypeFlash
A Flash media file.
Definition poppler-annotation.h:1277
Type type() const
Returns the media type of the configuration.
QList< RichMediaAnnotation::Instance * > instances() const
Returns the list of Instance objects of the configuration.
QString name() const
Returns the name of the configuration.
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.
The deactivation object of the RichMediaAnnotation::Settings object.
Definition poppler-annotation.h:1417
Condition
Describes the condition for deactivating the rich media.
Definition poppler-annotation.h:1425
@ PageClosed
Deactivate when page is closed.
Definition poppler-annotation.h:1426
@ UserAction
Deactivate when user interacts with the annotation.
Definition poppler-annotation.h:1428
@ PageInvisible
Deactivate when page becomes invisible.
Definition poppler-annotation.h:1427
Condition condition() const
Returns the deactivation condition.
The instance object of a RichMediaAnnotation::Configuration object.
Definition poppler-annotation.h:1224
RichMediaAnnotation::Params * params() const
Returns the params object of the instance or 0 if it doesn't exist.
Type
Describes the media type of the instance.
Definition poppler-annotation.h:1232
@ TypeVideo
A video media file.
Definition poppler-annotation.h:1236
@ TypeFlash
A Flash media file.
Definition poppler-annotation.h:1234
@ TypeSound
A sound media file.
Definition poppler-annotation.h:1235
@ Type3D
A 3D media file.
Definition poppler-annotation.h:1233
Type type() const
Returns the media type of the instance.
The params object of a RichMediaAnnotation::Instance object.
Definition poppler-annotation.h:1197
QString flashVars() const
Returns the parameters for the flash player.
The settings object of a RichMediaAnnotation.
Definition poppler-annotation.h:1453
RichMediaAnnotation::Activation * activation() const
Returns the Activation object of the settings object or 0 if it doesn't exist.
RichMediaAnnotation::Deactivation * deactivation() const
Returns the Deactivation object of the settings object or 0 if it doesn't exist.
SubType subType() const override
The type of the annotation.
RichMediaAnnotation::Settings * settings() const
Returns the Settings object of the rich media annotation or 0 if it doesn't exist.
RichMediaAnnotation::Content * content() const
Returns the Content object of the rich media annotation or 0 if it doesn't exist.
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.
SubType subType() const override
The type of the 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...
The Poppler Qt6 binding.
Definition poppler-annotation.h:52
Structure corresponding to a QuadPoints array.
Definition poppler-annotation.h:701