Poppler Qt6 25.06.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 * Adapting code from
17 * Copyright (C) 2004 by Enrico Ros <eros.kde@email.it>
18 *
19 * This program is free software; you can redistribute it and/or modify
20 * it under the terms of the GNU General Public License as published by
21 * the Free Software Foundation; either version 2, or (at your option)
22 * any later version.
23 *
24 * This program is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 * GNU General Public License for more details.
28 *
29 * You should have received a copy of the GNU General Public License
30 * along with this program; if not, write to the Free Software
31 * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
32 */
33
34#ifndef _POPPLER_ANNOTATION_H_
35#define _POPPLER_ANNOTATION_H_
36
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>
45#include <QtGui/QFont>
46#include "poppler-export.h"
47#include "poppler-converter.h"
48
49#include <memory>
50
51namespace Poppler {
52
53class Annotation;
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;
71class EmbeddedFile;
72class Link;
73class SoundObject;
74class MovieObject;
75class LinkRendition;
76class Page;
77
90class POPPLER_QT6_EXPORT AnnotationAppearance
91{
92 friend class Annotation;
93
94public:
95 explicit AnnotationAppearance(AnnotationAppearancePrivate *annotationAppearancePrivate);
97
98private:
99 AnnotationAppearancePrivate *d;
100 Q_DISABLE_COPY(AnnotationAppearance)
101};
102
176class POPPLER_QT6_EXPORT Annotation
177{
178 friend class LinkMovie;
179 friend class LinkRendition;
180
181public:
182 // enum definitions
188 // WARNING!!! oKular uses that very same values so if you change them notify the author!
190 {
191 AText = 1,
192 ALine = 2,
193 AGeom = 3,
194 AHighlight = 4,
195 AStamp = 5,
196 AInk = 6,
197 ALink = 7,
198 ACaret = 8,
199 AFileAttachment = 9,
200 ASound = 10,
201 AMovie = 11,
202 AScreen = 12,
203 AWidget = 13,
204 ARichMedia = 14
205 };
206
214 // NOTE: Only flags that are known to work are documented
215 enum Flag
216 {
217 Hidden = 1,
218 FixedSize = 2,
219 FixedRotation = 4,
220 DenyPrint = 8,
221 DenyWrite = 16,
222 DenyDelete = 32,
223 ToggleHidingOnMouse = 64,
224 External = 128
225 };
226 Q_DECLARE_FLAGS(Flags, Flag)
227
228 enum LineStyle
229 {
230 Solid = 1,
231 Dashed = 2,
232 Beveled = 4,
233 Inset = 8,
234 Underline = 16
235 };
236 enum LineEffect
237 {
238 NoEffect = 1,
239 Cloudy = 2
240 };
241 enum RevScope
242 {
243 Root = 0,
244 Reply = 1,
245 Group = 2,
246 Delete = 4
247 };
248 enum RevType
249 {
250 None = 1,
251 Marked = 2,
252 Unmarked = 4,
253 Accepted = 8,
254 Rejected = 16,
255 Cancelled = 32,
256 Completed = 64
257 };
258
262 QString author() const;
266 void setAuthor(const QString &author);
267
268 QString contents() const;
269 void setContents(const QString &contents);
270
274 QString uniqueName() const;
280 void setUniqueName(const QString &uniqueName);
281
282 QDateTime modificationDate() const;
283 void setModificationDate(const QDateTime &date);
284
285 QDateTime creationDate() const;
286 void setCreationDate(const QDateTime &date);
287
293 Flags flags() const;
299 void setFlags(Flags flags);
300
306 QRectF boundary() const;
317 void setBoundary(const QRectF &boundary);
318
322 class POPPLER_QT6_EXPORT Style
323 {
324 public:
325 Style();
326 Style(const Style &other);
327 Style &operator=(const Style &other);
328 ~Style();
329
330 // appearance properties
331 QColor color() const; // black
332 void setColor(const QColor &color);
333 double opacity() const; // 1.0
334 void setOpacity(double opacity);
335
336 // pen properties
337 double width() const; // 1.0
338 void setWidth(double width);
339 LineStyle lineStyle() const; // LineStyle::Solid
340 void setLineStyle(LineStyle style);
341 double xCorners() const; // 0.0
342 void setXCorners(double radius);
343 double yCorners() const; // 0.0
344 void setYCorners(double radius);
345 const QVector<double> &dashArray() const; // [ 3 ]
346 void setDashArray(const QVector<double> &array);
347
348 // pen effects
349 LineEffect lineEffect() const; // LineEffect::NoEffect
350 void setLineEffect(LineEffect effect);
351 double effectIntensity() const; // 1.0
352 void setEffectIntensity(double intens);
353
354 private:
355 class Private;
356 QSharedDataPointer<Private> d;
357 };
358
359 Style style() const;
360 void setStyle(const Style &style);
361
365 class POPPLER_QT6_EXPORT Popup
366 {
367 public:
368 Popup();
369 Popup(const Popup &other);
370 Popup &operator=(const Popup &other);
371 ~Popup();
372
373 // window state (Hidden, FixedRotation, Deny* flags allowed)
374 int flags() const; // -1 (never initialized) -> 0 (if inited and shown)
375 void setFlags(int flags);
376
377 // geometric properties
378 QRectF geometry() const; // no default
379 void setGeometry(const QRectF &geom);
380
381 // window contents/override properties
382 QString title() const; // '' text in the titlebar (overrides author)
383 void setTitle(const QString &title);
384 QString summary() const; // '' short description (displayed if not empty)
385 void setSummary(const QString &summary);
386 QString text() const; // '' text for the window (overrides annot->contents)
387 void setText(const QString &text);
388
389 private:
390 class Private;
391 QSharedDataPointer<Private> d;
392 };
393
394 Popup popup() const;
396 void setPopup(const Popup &popup);
397
398 RevScope revisionScope() const; // Root
399
400 RevType revisionType() const; // None
401
405 std::vector<std::unique_ptr<Annotation>> revisions() const;
406
410 virtual SubType subType() const = 0;
411
417 std::unique_ptr<AnnotationAppearance> annotationAppearance() const;
418
424 void setAnnotationAppearance(const AnnotationAppearance &annotationAppearance);
425
429 virtual ~Annotation();
430
450
451protected:
453 explicit Annotation(AnnotationPrivate &dd);
454 Q_DECLARE_PRIVATE(Annotation)
455 QExplicitlySharedDataPointer<AnnotationPrivate> d_ptr;
457
458private:
459 Q_DISABLE_COPY(Annotation)
460};
461
468class POPPLER_QT6_EXPORT TextAnnotation : public Annotation
469{
470 friend class AnnotationPrivate;
471
472public:
473 // local enums
474 enum TextType
475 {
476 Linked,
477 InPlace
478 };
479 enum InplaceIntent
480 {
481 Unknown,
482 Callout,
483 TypeWriter
484 };
485 enum InplaceAlignPosition
486 {
487 InplaceAlignLeft,
488 InplaceAlignCenter,
489 InplaceAlignRight
490 };
491
492 explicit TextAnnotation(TextType type);
493 ~TextAnnotation() override;
494 SubType subType() const override;
495
499 TextType textType() const;
500
513 QString textIcon() const;
514
520 void setTextIcon(const QString &icon);
521
522 QFont textFont() const;
523 void setTextFont(const QFont &font);
525 QColor textColor() const;
526 void setTextColor(const QColor &color);
527
528 InplaceAlignPosition inplaceAlign() const;
529 void setInplaceAlign(InplaceAlignPosition align);
530
531 QPointF calloutPoint(int id) const;
532 QVector<QPointF> calloutPoints() const;
533 void setCalloutPoints(const QVector<QPointF> &points);
534
535 InplaceIntent inplaceIntent() const;
536 void setInplaceIntent(InplaceIntent intent);
537
538private:
539 explicit TextAnnotation(TextAnnotationPrivate &dd);
540 void setTextType(TextType type);
541 Q_DECLARE_PRIVATE(TextAnnotation)
542 Q_DISABLE_COPY(TextAnnotation)
543};
544
550class POPPLER_QT6_EXPORT LineAnnotation : public Annotation
551{
552 friend class AnnotationPrivate;
553
554public:
555 // local enums
556 enum LineType
557 {
558 StraightLine,
559 Polyline
560 };
561 enum TermStyle
562 {
563 Square,
564 Circle,
565 Diamond,
566 OpenArrow,
567 ClosedArrow,
568 None,
569 Butt,
570 ROpenArrow,
571 RClosedArrow,
572 Slash
573 };
574 enum LineIntent
575 {
576 Unknown,
577 Arrow,
578 Dimension,
579 PolygonCloud
580 };
581
582 explicit LineAnnotation(LineType type);
583 ~LineAnnotation() override;
584 SubType subType() const override;
585
586 LineType lineType() const;
587
588 QVector<QPointF> linePoints() const;
589 void setLinePoints(const QVector<QPointF> &points);
590
591 TermStyle lineStartStyle() const;
592 void setLineStartStyle(TermStyle style);
593
594 TermStyle lineEndStyle() const;
595 void setLineEndStyle(TermStyle style);
596
597 bool isLineClosed() const;
598 void setLineClosed(bool closed);
599
600 QColor lineInnerColor() const;
601 void setLineInnerColor(const QColor &color);
602
603 double lineLeadingForwardPoint() const;
604 void setLineLeadingForwardPoint(double point);
605
606 double lineLeadingBackPoint() const;
607 void setLineLeadingBackPoint(double point);
608
609 bool lineShowCaption() const;
610 void setLineShowCaption(bool show);
611
612 LineIntent lineIntent() const;
613 void setLineIntent(LineIntent intent);
614
615private:
616 explicit LineAnnotation(LineAnnotationPrivate &dd);
617 void setLineType(LineType type);
618 Q_DECLARE_PRIVATE(LineAnnotation)
619 Q_DISABLE_COPY(LineAnnotation)
620};
621
628class POPPLER_QT6_EXPORT GeomAnnotation : public Annotation
629{
630 friend class AnnotationPrivate;
631
632public:
634 ~GeomAnnotation() override;
635 SubType subType() const override;
636
637 // common enums
638 enum GeomType
639 {
640 InscribedSquare,
641 InscribedCircle
642 };
643
644 GeomType geomType() const;
645 void setGeomType(GeomType type);
646
647 QColor geomInnerColor() const;
648 void setGeomInnerColor(const QColor &color);
649
650private:
651 explicit GeomAnnotation(GeomAnnotationPrivate &dd);
652 Q_DECLARE_PRIVATE(GeomAnnotation)
653 Q_DISABLE_COPY(GeomAnnotation)
654};
655
661class POPPLER_QT6_EXPORT HighlightAnnotation : public Annotation
662{
663 friend class AnnotationPrivate;
664
665public:
667 ~HighlightAnnotation() override;
668 SubType subType() const override;
669
680
686 struct Quad
687 {
688 QPointF points[4]; // 8 valid coords
689 bool capStart; // false (vtx 1-4) [K]
690 bool capEnd; // false (vtx 2-3) [K]
691 double feather; // 0.1 (in range 0..1) [K]
692 };
693
699
705
709 QList<Quad> highlightQuads() const;
710
714 void setHighlightQuads(const QList<Quad> &quads);
715
716private:
717 explicit HighlightAnnotation(HighlightAnnotationPrivate &dd);
718 Q_DECLARE_PRIVATE(HighlightAnnotation)
719 Q_DISABLE_COPY(HighlightAnnotation)
720};
721
727class POPPLER_QT6_EXPORT StampAnnotation : public Annotation
728{
729 friend class AnnotationPrivate;
730
731public:
733 ~StampAnnotation() override;
734 SubType subType() const override;
735
755 QString stampIconName() const;
756
762 void setStampIconName(const QString &name);
763
769 void setStampCustomImage(const QImage &image);
770
771private:
772 explicit StampAnnotation(StampAnnotationPrivate &dd);
773 Q_DECLARE_PRIVATE(StampAnnotation)
774 Q_DISABLE_COPY(StampAnnotation)
775};
776
787class POPPLER_QT6_EXPORT SignatureAnnotation : public Annotation
788{
789 friend class AnnotationPrivate;
790
791public:
806
808 ~SignatureAnnotation() override;
809 SubType subType() const override;
810
811 void setText(const QString &text);
812 void setLeftText(const QString &text);
813
817 double fontSize() const;
818 void setFontSize(double fontSize);
819
823 double leftFontSize() const;
824 void setLeftFontSize(double fontSize);
825
829 QColor fontColor() const;
830 void setFontColor(const QColor &color);
831
835 QColor borderColor() const;
836 void setBorderColor(const QColor &color);
837
843 double borderWidth() const;
844 void setBorderWidth(double width);
845
849 QColor backgroundColor() const;
850 void setBackgroundColor(const QColor &color);
851
852 QString imagePath() const;
853 void setImagePath(const QString &imagePath);
854
855 QString fieldPartialName() const;
856 void setFieldPartialName(const QString &fieldPartialName);
857
858 [[nodiscard]] SigningResult sign(const QString &outputFileName, const PDFConverter::NewSignatureData &data);
859
865 ErrorString lastSigningErrorDetails() const;
866
867private:
868 explicit SignatureAnnotation(SignatureAnnotationPrivate &dd);
869 Q_DECLARE_PRIVATE(SignatureAnnotation)
870 Q_DISABLE_COPY(SignatureAnnotation)
871};
872
878class POPPLER_QT6_EXPORT InkAnnotation : public Annotation
879{
880 friend class AnnotationPrivate;
881
882public:
884 ~InkAnnotation() override;
885 SubType subType() const override;
886
887 QList<QVector<QPointF>> inkPaths() const;
888 void setInkPaths(const QList<QVector<QPointF>> &paths);
889
890private:
891 explicit InkAnnotation(InkAnnotationPrivate &dd);
892 Q_DECLARE_PRIVATE(InkAnnotation)
893 Q_DISABLE_COPY(InkAnnotation)
894};
895
896class POPPLER_QT6_EXPORT LinkAnnotation : public Annotation
897{
898 friend class AnnotationPrivate;
899
900public:
901 ~LinkAnnotation() override;
902 SubType subType() const override;
903
904 // local enums
905 enum HighlightMode
906 {
907 None,
908 Invert,
909 Outline,
910 Push
911 };
912
913 Link *linkDestination() const;
914 void setLinkDestination(std::unique_ptr<Link> &&link);
915
916 HighlightMode linkHighlightMode() const;
917 void setLinkHighlightMode(HighlightMode mode);
918
919 QPointF linkRegionPoint(int id) const;
920 void setLinkRegionPoint(int id, const QPointF point);
921
922private:
924 explicit LinkAnnotation(LinkAnnotationPrivate &dd);
925 Q_DECLARE_PRIVATE(LinkAnnotation)
926 Q_DISABLE_COPY(LinkAnnotation)
927};
928
934class POPPLER_QT6_EXPORT CaretAnnotation : public Annotation
935{
936 friend class AnnotationPrivate;
937
938public:
940 ~CaretAnnotation() override;
941 SubType subType() const override;
942
947 {
948 None,
949 P
950 };
951
952 CaretSymbol caretSymbol() const;
953 void setCaretSymbol(CaretSymbol symbol);
954
955private:
956 explicit CaretAnnotation(CaretAnnotationPrivate &dd);
957 Q_DECLARE_PRIVATE(CaretAnnotation)
958 Q_DISABLE_COPY(CaretAnnotation)
959};
960
966class POPPLER_QT6_EXPORT FileAttachmentAnnotation : public Annotation
967{
968 friend class AnnotationPrivate;
969
970public:
971 ~FileAttachmentAnnotation() override;
972 SubType subType() const override;
973
977 QString fileIconName() const;
981 void setFileIconName(const QString &icon);
982
993
994private:
996 explicit FileAttachmentAnnotation(FileAttachmentAnnotationPrivate &dd);
997 Q_DECLARE_PRIVATE(FileAttachmentAnnotation)
998 Q_DISABLE_COPY(FileAttachmentAnnotation)
999};
1000
1006class POPPLER_QT6_EXPORT SoundAnnotation : public Annotation
1007{
1008 friend class AnnotationPrivate;
1009
1010public:
1011 ~SoundAnnotation() override;
1012 SubType subType() const override;
1013
1017 QString soundIconName() const;
1021 void setSoundIconName(const QString &icon);
1022
1033
1034private:
1036 explicit SoundAnnotation(SoundAnnotationPrivate &dd);
1037 Q_DECLARE_PRIVATE(SoundAnnotation)
1038 Q_DISABLE_COPY(SoundAnnotation)
1039};
1040
1046class POPPLER_QT6_EXPORT MovieAnnotation : public Annotation
1047{
1048 friend class AnnotationPrivate;
1049
1050public:
1051 ~MovieAnnotation() override;
1052 SubType subType() const override;
1053
1063 void setMovie(MovieObject *movie);
1064
1068 QString movieTitle() const;
1072 void setMovieTitle(const QString &title);
1073
1074private:
1076 explicit MovieAnnotation(MovieAnnotationPrivate &dd);
1077 Q_DECLARE_PRIVATE(MovieAnnotation)
1078 Q_DISABLE_COPY(MovieAnnotation)
1079};
1080
1086class POPPLER_QT6_EXPORT ScreenAnnotation : public Annotation
1087{
1088 friend class AnnotationPrivate;
1089
1090public:
1091 ~ScreenAnnotation() override;
1092
1093 SubType subType() const override;
1094
1099
1106
1110 QString screenTitle() const;
1111
1115 void setScreenTitle(const QString &title);
1116
1121 std::unique_ptr<Link> additionalAction(AdditionalActionType type) const;
1122
1123private:
1125 explicit ScreenAnnotation(ScreenAnnotationPrivate &dd);
1126 Q_DECLARE_PRIVATE(ScreenAnnotation)
1127 Q_DISABLE_COPY(ScreenAnnotation)
1128};
1129
1138class POPPLER_QT6_EXPORT WidgetAnnotation : public Annotation
1139{
1140 friend class AnnotationPrivate;
1141
1142public:
1143 ~WidgetAnnotation() override;
1144
1145 SubType subType() const override;
1146
1151 std::unique_ptr<Link> additionalAction(AdditionalActionType type) const;
1152
1153private:
1155 explicit WidgetAnnotation(WidgetAnnotationPrivate &dd);
1156 Q_DECLARE_PRIVATE(WidgetAnnotation)
1157 Q_DISABLE_COPY(WidgetAnnotation)
1158};
1159
1165class POPPLER_QT6_EXPORT RichMediaAnnotation : public Annotation
1166{
1167 friend class AnnotationPrivate;
1168
1169public:
1170 ~RichMediaAnnotation() override;
1171
1172 SubType subType() const override;
1173
1182 class POPPLER_QT6_EXPORT Params
1183 {
1184 friend class AnnotationPrivate;
1185
1186 public:
1187 Params();
1188 ~Params();
1189
1193 QString flashVars() const;
1194
1195 private:
1196 void setFlashVars(const QString &flashVars);
1197
1198 class Private;
1199 QScopedPointer<Private> d;
1200 };
1201
1209 class POPPLER_QT6_EXPORT Instance
1210 {
1211 friend class AnnotationPrivate;
1212
1213 public:
1217 enum Type
1218 {
1222 TypeVideo
1224
1225 Instance();
1226 ~Instance();
1227
1231 Type type() const;
1232
1237
1238 private:
1239 void setType(Type type);
1240 void setParams(RichMediaAnnotation::Params *params);
1241
1242 class Private;
1243 QScopedPointer<Private> d;
1244 };
1245
1252 class POPPLER_QT6_EXPORT Configuration
1253 {
1254 friend class AnnotationPrivate;
1255
1256 public:
1260 enum Type
1261 {
1265 TypeVideo
1267
1268 Configuration();
1270
1274 Type type() const;
1275
1279 QString name() const;
1280
1284 QList<RichMediaAnnotation::Instance *> instances() const;
1285
1286 private:
1287 void setType(Type type);
1288 void setName(const QString &name);
1289 void setInstances(const QList<RichMediaAnnotation::Instance *> &instances);
1290
1291 class Private;
1292 QScopedPointer<Private> d;
1293 };
1294
1302 class POPPLER_QT6_EXPORT Asset
1303 {
1304 friend class AnnotationPrivate;
1305
1306 public:
1307 Asset();
1308 ~Asset();
1309
1313 QString name() const;
1314
1319
1320 private:
1321 void setName(const QString &name);
1322 void setEmbeddedFile(EmbeddedFile *embeddedFile);
1323
1324 class Private;
1325 QScopedPointer<Private> d;
1326 };
1327
1334 class POPPLER_QT6_EXPORT Content
1335 {
1336 friend class AnnotationPrivate;
1337
1338 public:
1339 Content();
1340 ~Content();
1341
1345 QList<RichMediaAnnotation::Configuration *> configurations() const;
1346
1350 QList<RichMediaAnnotation::Asset *> assets() const;
1351
1352 private:
1353 void setConfigurations(const QList<RichMediaAnnotation::Configuration *> &configurations);
1354 void setAssets(const QList<RichMediaAnnotation::Asset *> &assets);
1355
1356 class Private;
1357 QScopedPointer<Private> d;
1358 };
1359
1366 class POPPLER_QT6_EXPORT Activation
1367 {
1368 friend class AnnotationPrivate;
1369
1370 public:
1375 {
1378 UserAction
1380
1381 Activation();
1382 ~Activation();
1383
1388
1389 private:
1390 void setCondition(Condition condition);
1391
1392 class Private;
1393 QScopedPointer<Private> d;
1394 };
1395
1402 class POPPLER_QT6_EXPORT Deactivation
1403 {
1404 friend class AnnotationPrivate;
1405
1406 public:
1411 {
1414 UserAction
1416
1417 Deactivation();
1418 ~Deactivation();
1419
1424
1425 private:
1426 void setCondition(Condition condition);
1427
1428 class Private;
1429 QScopedPointer<Private> d;
1430 };
1431
1438 class POPPLER_QT6_EXPORT Settings
1439 {
1440 friend class AnnotationPrivate;
1441
1442 public:
1443 Settings();
1444 ~Settings();
1445
1450
1455
1456 private:
1457 void setActivation(RichMediaAnnotation::Activation *activation);
1458 void setDeactivation(RichMediaAnnotation::Deactivation *deactivation);
1459
1460 class Private;
1461 QScopedPointer<Private> d;
1462 };
1463
1468
1473
1474private:
1475 void setSettings(RichMediaAnnotation::Settings *settings);
1476 void setContent(RichMediaAnnotation::Content *content);
1477
1479 explicit RichMediaAnnotation(RichMediaAnnotationPrivate &dd);
1480 Q_DECLARE_PRIVATE(RichMediaAnnotation)
1481 Q_DISABLE_COPY(RichMediaAnnotation)
1482};
1483
1484}
1485
1486#endif
AnnotationAppearance class wrapping Poppler's AP stream object.
Definition poppler-annotation.h:91
Container class for Annotation pop-up window information.
Definition poppler-annotation.h:366
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
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
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
@ 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
File attachment annotation.
Definition poppler-annotation.h:967
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.
Text highlight annotation.
Definition poppler-annotation.h:662
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
@ Highlight
highlighter pen style annotation
Definition poppler-annotation.h:675
Ink Annotation.
Definition poppler-annotation.h:879
SubType subType() const override
The type of the annotation.
Polygon/polyline annotation.
Definition poppler-annotation.h:551
SubType subType() const override
The type of the annotation.
Definition poppler-annotation.h:897
SubType subType() const override
The type of the annotation.
Movie: a movie to be played.
Definition poppler-link.h:577
Rendition: Rendition link.
Definition poppler-link.h:475
Movie annotation.
Definition poppler-annotation.h:1047
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:1875
A page in a document.
Definition poppler-qt6.h:425
The activation object of the RichMediaAnnotation::Settings object.
Definition poppler-annotation.h:1367
Condition
Describes the condition for activating the rich media.
Definition poppler-annotation.h:1375
@ PageVisible
Activate when page becomes visible.
Definition poppler-annotation.h:1377
@ PageOpened
Activate when page is opened.
Definition poppler-annotation.h:1376
Condition condition() const
Returns the activation condition.
The asset object of a RichMediaAnnotation::Content object.
Definition poppler-annotation.h:1303
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:1253
Type
Describes the media type of the configuration.
Definition poppler-annotation.h:1261
@ Type3D
A 3D media file.
Definition poppler-annotation.h:1262
@ TypeSound
A sound media file.
Definition poppler-annotation.h:1264
@ TypeFlash
A Flash media file.
Definition poppler-annotation.h:1263
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: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.
The deactivation object of the RichMediaAnnotation::Settings object.
Definition poppler-annotation.h:1403
Condition
Describes the condition for deactivating the rich media.
Definition poppler-annotation.h:1411
@ PageClosed
Deactivate when page is closed.
Definition poppler-annotation.h:1412
@ PageInvisible
Deactivate when page becomes invisible.
Definition poppler-annotation.h:1413
Condition condition() const
Returns the deactivation condition.
The instance object of a RichMediaAnnotation::Configuration object.
Definition poppler-annotation.h:1210
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:1218
@ TypeFlash
A Flash media file.
Definition poppler-annotation.h:1220
@ TypeSound
A sound media file.
Definition poppler-annotation.h:1221
@ Type3D
A 3D media file.
Definition poppler-annotation.h:1219
Type type() const
Returns the media type of the instance.
The params object of a RichMediaAnnotation::Instance object.
Definition poppler-annotation.h:1183
QString flashVars() const
Returns the parameters for the flash player.
The settings object of a RichMediaAnnotation.
Definition poppler-annotation.h:1439
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.
RichMedia annotation.
Definition poppler-annotation.h:1166
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.
Screen annotation.
Definition poppler-annotation.h:1087
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
Sound annotation.
Definition poppler-annotation.h:1007
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:1799
Stamp annotation.
Definition poppler-annotation.h:728
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.
Annotation containing text.
Definition poppler-annotation.h:469
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.
Widget annotation.
Definition poppler-annotation.h:1139
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:51
Structure corresponding to a QuadPoints array.
Definition poppler-annotation.h:687