Poppler Qt6 26.10.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 * Copyright (C) 2026, Sune Stolborg Vuorela <sune@vuorela.dk>, work sponsored by the Direction Interministérielle du Numérique
18 *
19 * Adapting code from
20 * Copyright (C) 2004 by Enrico Ros <eros.kde@email.it>
21 *
22 * This program is free software; you can redistribute it and/or modify
23 * it under the terms of the GNU General Public License as published by
24 * the Free Software Foundation; either version 2, or (at your option)
25 * any later version.
26 *
27 * This program is distributed in the hope that it will be useful,
28 * but WITHOUT ANY WARRANTY; without even the implied warranty of
29 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 * GNU General Public License for more details.
31 *
32 * You should have received a copy of the GNU General Public License
33 * along with this program; if not, write to the Free Software
34 * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
35 */
36
37#ifndef _POPPLER_ANNOTATION_H_
38#define _POPPLER_ANNOTATION_H_
39
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>
48#include <QtGui/QFont>
49#include "poppler-export.h"
50#include "poppler-converter.h"
51
52#include <memory>
53
54namespace Poppler {
55
56class Annotation;
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;
74class EmbeddedFile;
75class Link;
76class SoundObject;
77class MovieObject;
78class LinkRendition;
79class Page;
80
93class POPPLER_QT6_EXPORT AnnotationAppearance
94{
95 friend class Annotation;
96
97public:
98 explicit AnnotationAppearance(AnnotationAppearancePrivate *annotationAppearancePrivate);
99 ~AnnotationAppearance();
100
101private:
102 AnnotationAppearancePrivate *d;
103 Q_DISABLE_COPY(AnnotationAppearance)
104};
105
179class POPPLER_QT6_EXPORT Annotation
180{
181 friend class LinkMovie;
182 friend class LinkRendition;
183
184public:
185 // enum definitions
191 // WARNING!!! oKular uses that very same values so if you change them notify the author!
209
217 // NOTE: Only flags that are known to work are documented
218 enum Flag
219 {
220 Hidden = 1,
221 FixedSize = 2,
224 DenyWrite = 16,
225 DenyDelete = 32,
226 ToggleHidingOnMouse = 64,
227 External = 128
228 };
229 Q_DECLARE_FLAGS(Flags, Flag)
230
231 enum LineStyle
232 {
233 Solid = 1,
234 Dashed = 2,
235 Beveled = 4,
236 Inset = 8,
237 Underline = 16
238 };
239 enum LineEffect
240 {
241 NoEffect = 1,
242 Cloudy = 2
243 };
244 enum RevScope
245 {
246 Root = 0,
247 Reply = 1,
248 Group = 2,
249 Delete = 4
250 };
251 enum RevType
252 {
253 None = 1,
254 Marked = 2,
255 Unmarked = 4,
256 Accepted = 8,
257 Rejected = 16,
258 Cancelled = 32,
259 Completed = 64
260 };
261
265 QString author() const;
269 void setAuthor(const QString &author);
270
271 QString contents() const;
272 void setContents(const QString &contents);
273
277 QString uniqueName() const;
283 void setUniqueName(const QString &uniqueName);
284
285 QDateTime modificationDate() const;
286 void setModificationDate(const QDateTime &date);
287
288 QDateTime creationDate() const;
289 void setCreationDate(const QDateTime &date);
290
296 Flags flags() const;
302 void setFlags(Flags flags);
303
309 QRectF boundary() const;
320 void setBoundary(const QRectF &boundary);
321
325 class POPPLER_QT6_EXPORT Style
326 {
327 public:
328 Style();
329 Style(const Style &other);
330 Style &operator=(const Style &other);
331 ~Style();
332
333 // appearance properties
334 QColor color() const; // black
335 void setColor(const QColor &color);
336 double opacity() const; // 1.0
337 void setOpacity(double opacity);
338
339 // pen properties
340 double width() const; // 1.0
341 void setWidth(double width);
342 LineStyle lineStyle() const; // LineStyle::Solid
343 void setLineStyle(LineStyle style);
344 double xCorners() const; // 0.0
345 void setXCorners(double radius);
346 double yCorners() const; // 0.0
347 void setYCorners(double radius);
348 const QVector<double> &dashArray() const; // [ 3 ]
349 void setDashArray(const QVector<double> &array);
350
351 // pen effects
352 LineEffect lineEffect() const; // LineEffect::NoEffect
353 void setLineEffect(LineEffect effect);
354 double effectIntensity() const; // 1.0
355 void setEffectIntensity(double intens);
356
357 private:
358 class Private;
359 QSharedDataPointer<Private> d;
360 };
361
362 Style style() const;
363 void setStyle(const Style &style);
364
368 class POPPLER_QT6_EXPORT Popup
369 {
370 public:
371 Popup();
372 Popup(const Popup &other);
373 Popup &operator=(const Popup &other);
374 ~Popup();
375
376 // window state (Hidden, FixedRotation, Deny* flags allowed)
377 int flags() const; // -1 (never initialized) -> 0 (if inited and shown)
378 void setFlags(int flags);
379
380 // geometric properties
381 QRectF geometry() const; // no default
382 void setGeometry(const QRectF &geom);
383
384 // window contents/override properties
385 QString title() const; // '' text in the titlebar (overrides author)
386 void setTitle(const QString &title);
387 QString summary() const; // '' short description (displayed if not empty)
388 void setSummary(const QString &summary);
389 QString text() const; // '' text for the window (overrides annot->contents)
390 void setText(const QString &text);
391
392 private:
393 class Private;
394 QSharedDataPointer<Private> d;
395 };
396
397 Popup popup() const;
399 void setPopup(const Popup &popup);
400
401 RevScope revisionScope() const; // Root
402
403 RevType revisionType() const; // None
404
408 std::vector<std::unique_ptr<Annotation>> revisions() const;
409
413 virtual SubType subType() const = 0;
414
420 std::unique_ptr<AnnotationAppearance> annotationAppearance() const;
421
428
432 virtual ~Annotation();
433
453
454protected:
456 explicit Annotation(AnnotationPrivate &dd);
457 Q_DECLARE_PRIVATE(Annotation)
458 QExplicitlySharedDataPointer<AnnotationPrivate> d_ptr;
460
461private:
462 Q_DISABLE_COPY(Annotation)
463};
464
471class POPPLER_QT6_EXPORT TextAnnotation : public Annotation
472{
473 friend class AnnotationPrivate;
474
475public:
476 // local enums
477 enum TextType
478 {
479 Linked,
480 InPlace
481 };
482 enum InplaceIntent
483 {
484 Unknown,
485 Callout,
486 TypeWriter
487 };
488 enum InplaceAlignPosition
489 {
490 InplaceAlignLeft,
491 InplaceAlignCenter,
492 InplaceAlignRight
493 };
494
495 explicit TextAnnotation(TextType type);
496 ~TextAnnotation() override;
497 SubType subType() const override;
498
502 TextType textType() const;
503
529 QString textIcon() const;
530
536 void setTextIcon(const QString &icon);
537
538 QFont textFont() const;
539 void setTextFont(const QFont &font);
541 QColor textColor() const;
542 void setTextColor(const QColor &color);
543
544 InplaceAlignPosition inplaceAlign() const;
545 void setInplaceAlign(InplaceAlignPosition align);
546
547 QPointF calloutPoint(int id) const;
548 QVector<QPointF> calloutPoints() const;
549 void setCalloutPoints(const QVector<QPointF> &points);
550
551 InplaceIntent inplaceIntent() const;
552 void setInplaceIntent(InplaceIntent intent);
553
554private:
555 explicit TextAnnotation(TextAnnotationPrivate &dd);
556 void setTextType(TextType type);
557 Q_DECLARE_PRIVATE(TextAnnotation)
558 Q_DISABLE_COPY(TextAnnotation)
559};
560
566class POPPLER_QT6_EXPORT LineAnnotation : public Annotation
567{
568 friend class AnnotationPrivate;
569
570public:
571 // local enums
572 enum LineType
573 {
574 StraightLine,
575 Polyline
576 };
577 enum TermStyle
578 {
579 Square,
580 Circle,
581 Diamond,
582 OpenArrow,
583 ClosedArrow,
584 None,
585 Butt,
586 ROpenArrow,
587 RClosedArrow,
588 Slash
589 };
590 enum LineIntent
591 {
592 Unknown,
593 Arrow,
594 Dimension,
595 PolygonCloud
596 };
597
598 explicit LineAnnotation(LineType type);
599 ~LineAnnotation() override;
600 SubType subType() const override;
601
602 LineType lineType() const;
603
604 QVector<QPointF> linePoints() const;
605 void setLinePoints(const QVector<QPointF> &points);
606
607 TermStyle lineStartStyle() const;
608 void setLineStartStyle(TermStyle style);
609
610 TermStyle lineEndStyle() const;
611 void setLineEndStyle(TermStyle style);
612
613 bool isLineClosed() const;
614 void setLineClosed(bool closed);
615
616 QColor lineInnerColor() const;
617 void setLineInnerColor(const QColor &color);
618
619 double lineLeadingForwardPoint() const;
620 void setLineLeadingForwardPoint(double point);
621
622 double lineLeadingBackPoint() const;
623 void setLineLeadingBackPoint(double point);
624
625 bool lineShowCaption() const;
626 void setLineShowCaption(bool show);
627
628 LineIntent lineIntent() const;
629 void setLineIntent(LineIntent intent);
630
631private:
632 explicit LineAnnotation(LineAnnotationPrivate &dd);
633 void setLineType(LineType type);
634 Q_DECLARE_PRIVATE(LineAnnotation)
635 Q_DISABLE_COPY(LineAnnotation)
636};
637
644class POPPLER_QT6_EXPORT GeomAnnotation : public Annotation
645{
646 friend class AnnotationPrivate;
647
648public:
649 GeomAnnotation();
650 ~GeomAnnotation() override;
651 SubType subType() const override;
652
653 // common enums
654 enum GeomType
655 {
656 InscribedSquare,
657 InscribedCircle
658 };
659
660 GeomType geomType() const;
661 void setGeomType(GeomType type);
662
663 QColor geomInnerColor() const;
664 void setGeomInnerColor(const QColor &color);
665
666private:
667 explicit GeomAnnotation(GeomAnnotationPrivate &dd);
668 Q_DECLARE_PRIVATE(GeomAnnotation)
669 Q_DISABLE_COPY(GeomAnnotation)
670};
671
677class POPPLER_QT6_EXPORT HighlightAnnotation : public Annotation
678{
679 friend class AnnotationPrivate;
680
681public:
682 HighlightAnnotation();
683 ~HighlightAnnotation() override;
684 SubType subType() const override;
685
696
702 struct Quad
703 {
704 QPointF points[4]; // 8 valid coords
705 bool capStart; // false (vtx 1-4) [K]
706 bool capEnd; // false (vtx 2-3) [K]
707 double feather; // 0.1 (in range 0..1) [K]
708 };
709
715
721
725 QList<Quad> highlightQuads() const;
726
730 void setHighlightQuads(const QList<Quad> &quads);
731
732private:
733 explicit HighlightAnnotation(HighlightAnnotationPrivate &dd);
734 Q_DECLARE_PRIVATE(HighlightAnnotation)
735 Q_DISABLE_COPY(HighlightAnnotation)
736};
737
743class POPPLER_QT6_EXPORT StampAnnotation : public Annotation
744{
745 friend class AnnotationPrivate;
746
747public:
748 StampAnnotation();
749 ~StampAnnotation() override;
750 SubType subType() const override;
751
771 QString stampIconName() const;
772
778 void setStampIconName(const QString &name);
779
785 void setStampCustomImage(const QImage &image);
786
787private:
788 explicit StampAnnotation(StampAnnotationPrivate &dd);
789 Q_DECLARE_PRIVATE(StampAnnotation)
790 Q_DISABLE_COPY(StampAnnotation)
791};
792
803class POPPLER_QT6_EXPORT SignatureAnnotation : public Annotation
804{
805 friend class AnnotationPrivate;
806
807public:
823
825 ~SignatureAnnotation() override;
826 SubType subType() const override;
827
828 void setText(const QString &text);
829 void setLeftText(const QString &text);
830
834 double fontSize() const;
835 void setFontSize(double fontSize);
836
840 double leftFontSize() const;
841 void setLeftFontSize(double fontSize);
842
846 QColor fontColor() const;
847 void setFontColor(const QColor &color);
848
852 QColor borderColor() const;
853 void setBorderColor(const QColor &color);
854
860 double borderWidth() const;
861 void setBorderWidth(double width);
862
866 QColor backgroundColor() const;
867 void setBackgroundColor(const QColor &color);
868
869 QString imagePath() const;
870 void setImagePath(const QString &imagePath);
871
872 QString fieldPartialName() const;
873 void setFieldPartialName(const QString &fieldPartialName);
874
875 [[nodiscard]] SigningResult sign(const QString &outputFileName, const PDFConverter::NewSignatureData &data);
876
882 ErrorString lastSigningErrorDetails() const;
883
884private:
885 explicit SignatureAnnotation(SignatureAnnotationPrivate &dd);
886 Q_DECLARE_PRIVATE(SignatureAnnotation)
887 Q_DISABLE_COPY(SignatureAnnotation)
888};
889
895class POPPLER_QT6_EXPORT InkAnnotation : public Annotation
896{
897 friend class AnnotationPrivate;
898
899public:
900 InkAnnotation();
901 ~InkAnnotation() override;
902 SubType subType() const override;
903
904 QList<QVector<QPointF>> inkPaths() const;
905 void setInkPaths(const QList<QVector<QPointF>> &paths);
906
907private:
908 explicit InkAnnotation(InkAnnotationPrivate &dd);
909 Q_DECLARE_PRIVATE(InkAnnotation)
910 Q_DISABLE_COPY(InkAnnotation)
911};
912
913class POPPLER_QT6_EXPORT LinkAnnotation : public Annotation
914{
915 friend class AnnotationPrivate;
916
917public:
918 ~LinkAnnotation() override;
919 SubType subType() const override;
920
921 // local enums
922 enum HighlightMode
923 {
924 None,
925 Invert,
926 Outline,
927 Push
928 };
929
930 Link *linkDestination() const;
931 void setLinkDestination(std::unique_ptr<Link> &&link);
932
933 HighlightMode linkHighlightMode() const;
934 void setLinkHighlightMode(HighlightMode mode);
935
936 QPointF linkRegionPoint(int id) const;
937 void setLinkRegionPoint(int id, QPointF point);
938
939private:
941 explicit LinkAnnotation(LinkAnnotationPrivate &dd);
942 Q_DECLARE_PRIVATE(LinkAnnotation)
943 Q_DISABLE_COPY(LinkAnnotation)
944};
945
951class POPPLER_QT6_EXPORT CaretAnnotation : public Annotation
952{
953 friend class AnnotationPrivate;
954
955public:
956 CaretAnnotation();
957 ~CaretAnnotation() override;
958 SubType subType() const override;
959
964 {
965 None,
966 P
967 };
968
969 CaretSymbol caretSymbol() const;
970 void setCaretSymbol(CaretSymbol symbol);
971
972private:
973 explicit CaretAnnotation(CaretAnnotationPrivate &dd);
974 Q_DECLARE_PRIVATE(CaretAnnotation)
975 Q_DISABLE_COPY(CaretAnnotation)
976};
977
983class POPPLER_QT6_EXPORT FileAttachmentAnnotation : public Annotation
984{
985 friend class AnnotationPrivate;
986
987public:
988 ~FileAttachmentAnnotation() override;
989 SubType subType() const override;
990
994 QString fileIconName() const;
998 void setFileIconName(const QString &icon);
999
1010
1011private:
1012 FileAttachmentAnnotation();
1013 explicit FileAttachmentAnnotation(FileAttachmentAnnotationPrivate &dd);
1014 Q_DECLARE_PRIVATE(FileAttachmentAnnotation)
1015 Q_DISABLE_COPY(FileAttachmentAnnotation)
1016};
1017
1023class POPPLER_QT6_EXPORT SoundAnnotation : public Annotation
1024{
1025 friend class AnnotationPrivate;
1026
1027public:
1028 ~SoundAnnotation() override;
1029 SubType subType() const override;
1030
1034 QString soundIconName() const;
1038 void setSoundIconName(const QString &icon);
1039
1050
1051private:
1052 SoundAnnotation();
1053 explicit SoundAnnotation(SoundAnnotationPrivate &dd);
1054 Q_DECLARE_PRIVATE(SoundAnnotation)
1055 Q_DISABLE_COPY(SoundAnnotation)
1056};
1057
1063class POPPLER_QT6_EXPORT MovieAnnotation : public Annotation
1064{
1065 friend class AnnotationPrivate;
1066
1067public:
1068 ~MovieAnnotation() override;
1069 SubType subType() const override;
1070
1081
1085 QString movieTitle() const;
1089 void setMovieTitle(const QString &title);
1090
1091private:
1092 MovieAnnotation();
1093 explicit MovieAnnotation(MovieAnnotationPrivate &dd);
1094 Q_DECLARE_PRIVATE(MovieAnnotation)
1095 Q_DISABLE_COPY(MovieAnnotation)
1096};
1097
1103class POPPLER_QT6_EXPORT ScreenAnnotation : public Annotation
1104{
1105 friend class AnnotationPrivate;
1106
1107public:
1108 ~ScreenAnnotation() override;
1109
1110 SubType subType() const override;
1111
1115 LinkRendition *action() const;
1116
1122 void setAction(LinkRendition *action);
1123
1127 QString screenTitle() const;
1128
1132 void setScreenTitle(const QString &title);
1133
1138 std::unique_ptr<Link> additionalAction(AdditionalActionType type) const;
1139
1140private:
1141 ScreenAnnotation();
1142 explicit ScreenAnnotation(ScreenAnnotationPrivate &dd);
1143 Q_DECLARE_PRIVATE(ScreenAnnotation)
1144 Q_DISABLE_COPY(ScreenAnnotation)
1145};
1146
1155class POPPLER_QT6_EXPORT WidgetAnnotation : public Annotation
1156{
1157 friend class AnnotationPrivate;
1158
1159public:
1160 ~WidgetAnnotation() override;
1161
1162 SubType subType() const override;
1163
1168 std::unique_ptr<Link> additionalAction(AdditionalActionType type) const;
1169
1170private:
1171 WidgetAnnotation();
1172 explicit WidgetAnnotation(WidgetAnnotationPrivate &dd);
1173 Q_DECLARE_PRIVATE(WidgetAnnotation)
1174 Q_DISABLE_COPY(WidgetAnnotation)
1175};
1176
1182class POPPLER_QT6_EXPORT RichMediaAnnotation : public Annotation
1183{
1184 friend class AnnotationPrivate;
1185
1186public:
1187 ~RichMediaAnnotation() override;
1188
1189 SubType subType() const override;
1190
1199 class POPPLER_QT6_EXPORT Params
1200 {
1201 friend class AnnotationPrivate;
1202
1203 public:
1204 Params();
1205 ~Params();
1206
1210 QString flashVars() const;
1211
1212 private:
1213 void setFlashVars(const QString &flashVars);
1214
1215 class Private;
1216 QScopedPointer<Private> d;
1217 };
1218
1226 class POPPLER_QT6_EXPORT Instance
1227 {
1228 friend class AnnotationPrivate;
1229
1230 public:
1241
1242 Instance();
1243 ~Instance();
1244
1248 Type type() const;
1249
1254
1255 private:
1256 void setType(Type type);
1257 void setParams(RichMediaAnnotation::Params *params);
1258
1259 class Private;
1260 QScopedPointer<Private> d;
1261 };
1262
1269 class POPPLER_QT6_EXPORT Configuration
1270 {
1271 friend class AnnotationPrivate;
1272
1273 public:
1284
1285 Configuration();
1287
1291 Type type() const;
1292
1296 QString name() const;
1297
1301 QList<RichMediaAnnotation::Instance *> instances() const;
1302
1303 private:
1304 void setType(Type type);
1305 void setName(const QString &name);
1306 void setInstances(const QList<RichMediaAnnotation::Instance *> &instances);
1307
1308 class Private;
1309 QScopedPointer<Private> d;
1310 };
1311
1319 class POPPLER_QT6_EXPORT Asset
1320 {
1321 friend class AnnotationPrivate;
1322
1323 public:
1324 Asset();
1325 ~Asset();
1326
1330 QString name() const;
1331
1336
1337 private:
1338 void setName(const QString &name);
1339 void setEmbeddedFile(EmbeddedFile *embeddedFile);
1340
1341 class Private;
1342 QScopedPointer<Private> d;
1343 };
1344
1351 class POPPLER_QT6_EXPORT Content
1352 {
1353 friend class AnnotationPrivate;
1354
1355 public:
1356 Content();
1357 ~Content();
1358
1362 QList<RichMediaAnnotation::Configuration *> configurations() const;
1363
1367 QList<RichMediaAnnotation::Asset *> assets() const;
1368
1369 private:
1370 void setConfigurations(const QList<RichMediaAnnotation::Configuration *> &configurations);
1371 void setAssets(const QList<RichMediaAnnotation::Asset *> &assets);
1372
1373 class Private;
1374 QScopedPointer<Private> d;
1375 };
1376
1383 class POPPLER_QT6_EXPORT Activation
1384 {
1385 friend class AnnotationPrivate;
1386
1387 public:
1397
1398 Activation();
1399 ~Activation();
1400
1405
1406 private:
1407 void setCondition(Condition condition);
1408
1409 class Private;
1410 QScopedPointer<Private> d;
1411 };
1412
1419 class POPPLER_QT6_EXPORT Deactivation
1420 {
1421 friend class AnnotationPrivate;
1422
1423 public:
1433
1434 Deactivation();
1435 ~Deactivation();
1436
1441
1442 private:
1443 void setCondition(Condition condition);
1444
1445 class Private;
1446 QScopedPointer<Private> d;
1447 };
1448
1455 class POPPLER_QT6_EXPORT Settings
1456 {
1457 friend class AnnotationPrivate;
1458
1459 public:
1460 Settings();
1461 ~Settings();
1462
1467
1472
1473 private:
1474 void setActivation(RichMediaAnnotation::Activation *activation);
1475 void setDeactivation(RichMediaAnnotation::Deactivation *deactivation);
1476
1477 class Private;
1478 QScopedPointer<Private> d;
1479 };
1480
1485
1490
1491private:
1492 void setSettings(RichMediaAnnotation::Settings *settings);
1493 void setContent(RichMediaAnnotation::Content *content);
1494
1495 RichMediaAnnotation();
1496 explicit RichMediaAnnotation(RichMediaAnnotationPrivate &dd);
1497 Q_DECLARE_PRIVATE(RichMediaAnnotation)
1498 Q_DISABLE_COPY(RichMediaAnnotation)
1499};
1500
1501}
1502
1503#endif
AnnotationAppearance class wrapping Poppler's AP stream object.
Definition poppler-annotation.h:94
Container class for Annotation pop-up window information.
Definition poppler-annotation.h:369
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
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 activation object of the RichMediaAnnotation::Settings object.
Definition poppler-annotation.h:1384
Condition
Describes the condition for activating the rich media.
Definition poppler-annotation.h:1392
@ PageVisible
Activate when page becomes visible.
Definition poppler-annotation.h:1394
@ PageOpened
Activate when page is opened.
Definition poppler-annotation.h:1393
@ UserAction
Activate when user interacts with the annotation.
Definition poppler-annotation.h:1395
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:1270
Type
Describes the media type of the configuration.
Definition poppler-annotation.h:1278
@ Type3D
A 3D media file.
Definition poppler-annotation.h:1279
@ TypeVideo
A video media file.
Definition poppler-annotation.h:1282
@ TypeSound
A sound media file.
Definition poppler-annotation.h:1281
@ TypeFlash
A Flash media file.
Definition poppler-annotation.h:1280
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: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.
The deactivation object of the RichMediaAnnotation::Settings object.
Definition poppler-annotation.h:1420
Condition
Describes the condition for deactivating the rich media.
Definition poppler-annotation.h:1428
@ PageClosed
Deactivate when page is closed.
Definition poppler-annotation.h:1429
@ UserAction
Deactivate when user interacts with the annotation.
Definition poppler-annotation.h:1431
@ PageInvisible
Deactivate when page becomes invisible.
Definition poppler-annotation.h:1430
Condition condition() const
Returns the deactivation condition.
The instance object of a RichMediaAnnotation::Configuration object.
Definition poppler-annotation.h:1227
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:1235
@ TypeVideo
A video media file.
Definition poppler-annotation.h:1239
@ TypeFlash
A Flash media file.
Definition poppler-annotation.h:1237
@ TypeSound
A sound media file.
Definition poppler-annotation.h:1238
@ Type3D
A 3D media file.
Definition poppler-annotation.h:1236
Type type() const
Returns the media type of the instance.
The params object of a RichMediaAnnotation::Instance object.
Definition poppler-annotation.h:1200
QString flashVars() const
Returns the parameters for the flash player.
The settings object of a RichMediaAnnotation.
Definition poppler-annotation.h:1456
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: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.
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:54
Structure corresponding to a QuadPoints array.
Definition poppler-annotation.h:703