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 * Copyright (C) 2026, Valentin Pohu <pohuvalentin@gmail.com>
19 *
20 * Adapting code from
21 * Copyright (C) 2004 by Enrico Ros <eros.kde@email.it>
22 *
23 * This program is free software; you can redistribute it and/or modify
24 * it under the terms of the GNU General Public License as published by
25 * the Free Software Foundation; either version 2, or (at your option)
26 * any later version.
27 *
28 * This program is distributed in the hope that it will be useful,
29 * but WITHOUT ANY WARRANTY; without even the implied warranty of
30 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31 * GNU General Public License for more details.
32 *
33 * You should have received a copy of the GNU General Public License
34 * along with this program; if not, write to the Free Software
35 * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
36 */
37
38#ifndef _POPPLER_ANNOTATION_H_
39#define _POPPLER_ANNOTATION_H_
40
41#include <QtCore/QDateTime>
42#include <QtCore/QSharedDataPointer>
43#include <QtCore/QList>
44#include <QtCore/QPointF>
45#include <QtCore/QRectF>
46#include <QtCore/QScopedPointer>
47#include <QtCore/QVector>
48#include <QtGui/QColor>
49#include <QtGui/QFont>
50#include "poppler-export.h"
51#include "poppler-converter.h"
52
53#include <memory>
54
55namespace Poppler {
56
57class Annotation;
58class AnnotationPrivate;
59class AnnotationAppearancePrivate;
60class TextAnnotationPrivate;
61class LineAnnotationPrivate;
62class GeomAnnotationPrivate;
63class HighlightAnnotationPrivate;
64class StampAnnotationPrivate;
65class SignatureAnnotationPrivate;
66class InkAnnotationPrivate;
67class LinkAnnotationPrivate;
68class CaretAnnotationPrivate;
69class FileAttachmentAnnotationPrivate;
70class SoundAnnotationPrivate;
71class MovieAnnotationPrivate;
72class ScreenAnnotationPrivate;
73class WidgetAnnotationPrivate;
74class RichMediaAnnotationPrivate;
75class EmbeddedFile;
76class Link;
77class SoundObject;
78class MovieObject;
79class LinkRendition;
80class Page;
81
94class POPPLER_QT6_EXPORT AnnotationAppearance
95{
96 friend class Annotation;
97
98public:
99 explicit AnnotationAppearance(AnnotationAppearancePrivate *annotationAppearancePrivate);
100 ~AnnotationAppearance();
101
102private:
103 AnnotationAppearancePrivate *d;
104 Q_DISABLE_COPY(AnnotationAppearance)
105};
106
180class POPPLER_QT6_EXPORT Annotation
181{
182 friend class LinkMovie;
183 friend class LinkRendition;
184
185public:
186 // enum definitions
192 // WARNING!!! oKular uses that very same values so if you change them notify the author!
210
218 // NOTE: Only flags that are known to work are documented
219 enum Flag
220 {
221 Hidden = 1,
222 FixedSize = 2,
225 DenyWrite = 16,
226 DenyDelete = 32,
227 ToggleHidingOnMouse = 64,
228 External = 128
229 };
230 Q_DECLARE_FLAGS(Flags, Flag)
231
232 enum LineStyle
233 {
234 Solid = 1,
235 Dashed = 2,
236 Beveled = 4,
237 Inset = 8,
238 Underline = 16
239 };
240 enum LineEffect
241 {
242 NoEffect = 1,
243 Cloudy = 2
244 };
245 enum RevScope
246 {
247 Root = 0,
248 Reply = 1,
249 Group = 2,
250 Delete = 4
251 };
252 enum RevType
253 {
254 None = 1,
255 Marked = 2,
256 Unmarked = 4,
257 Accepted = 8,
258 Rejected = 16,
259 Cancelled = 32,
260 Completed = 64
261 };
262
266 QString author() const;
270 void setAuthor(const QString &author);
271
272 QString contents() const;
273 void setContents(const QString &contents);
274
278 QString uniqueName() const;
284 void setUniqueName(const QString &uniqueName);
285
286 QDateTime modificationDate() const;
287 void setModificationDate(const QDateTime &date);
288
289 QDateTime creationDate() const;
290 void setCreationDate(const QDateTime &date);
291
297 Flags flags() const;
303 void setFlags(Flags flags);
304
310 QRectF boundary() const;
321 void setBoundary(const QRectF &boundary);
322
326 class POPPLER_QT6_EXPORT Style
327 {
328 public:
329 Style();
330 Style(const Style &other);
331 Style &operator=(const Style &other);
332 ~Style();
333
334 // appearance properties
335 QColor color() const; // black
336 void setColor(const QColor &color);
337 double opacity() const; // 1.0
338 void setOpacity(double opacity);
339
340 // pen properties
341 double width() const; // 1.0
342 void setWidth(double width);
343 LineStyle lineStyle() const; // LineStyle::Solid
344 void setLineStyle(LineStyle style);
345 double xCorners() const; // 0.0
346 void setXCorners(double radius);
347 double yCorners() const; // 0.0
348 void setYCorners(double radius);
349 const QVector<double> &dashArray() const; // [ 3 ]
350 void setDashArray(const QVector<double> &array);
351
352 // pen effects
353 LineEffect lineEffect() const; // LineEffect::NoEffect
354 void setLineEffect(LineEffect effect);
355 double effectIntensity() const; // 1.0
356 void setEffectIntensity(double intens);
357
358 private:
359 class Private;
360 QSharedDataPointer<Private> d;
361 };
362
363 Style style() const;
364 void setStyle(const Style &style);
365
369 class POPPLER_QT6_EXPORT Popup
370 {
371 public:
372 Popup();
373 Popup(const Popup &other);
374 Popup &operator=(const Popup &other);
375 ~Popup();
376
377 // window state (Hidden, FixedRotation, Deny* flags allowed)
378 int flags() const; // -1 (never initialized) -> 0 (if inited and shown)
379 void setFlags(int flags);
380
381 // geometric properties
382 QRectF geometry() const; // no default
383 void setGeometry(const QRectF &geom);
384
385 // window contents/override properties
386 QString title() const; // '' text in the titlebar (overrides author)
387 void setTitle(const QString &title);
388 QString summary() const; // '' short description (displayed if not empty)
389 void setSummary(const QString &summary);
390 QString text() const; // '' text for the window (overrides annot->contents)
391 void setText(const QString &text);
392
393 private:
394 class Private;
395 QSharedDataPointer<Private> d;
396 };
397
398 Popup popup() const;
400 void setPopup(const Popup &popup);
401
402 RevScope revisionScope() const; // Root
403
404 RevType revisionType() const; // None
405
409 std::vector<std::unique_ptr<Annotation>> revisions() const;
410
414 virtual SubType subType() const = 0;
415
421 std::unique_ptr<AnnotationAppearance> annotationAppearance() const;
422
429
433 virtual ~Annotation();
434
454
455protected:
457 explicit Annotation(AnnotationPrivate &dd);
458 Q_DECLARE_PRIVATE(Annotation)
459 QExplicitlySharedDataPointer<AnnotationPrivate> d_ptr;
461
462private:
463 Q_DISABLE_COPY(Annotation)
464};
465
472class POPPLER_QT6_EXPORT TextAnnotation : public Annotation
473{
474 friend class AnnotationPrivate;
475
476public:
477 // local enums
478 enum TextType
479 {
480 Linked,
481 InPlace
482 };
483 enum InplaceIntent
484 {
485 Unknown,
486 Callout,
487 TypeWriter
488 };
489 enum InplaceAlignPosition
490 {
491 InplaceAlignLeft,
492 InplaceAlignCenter,
493 InplaceAlignRight
494 };
495
496 explicit TextAnnotation(TextType type);
497 ~TextAnnotation() override;
498 SubType subType() const override;
499
503 TextType textType() const;
504
530 QString textIcon() const;
531
537 void setTextIcon(const QString &icon);
538
539 QFont textFont() const;
540 void setTextFont(const QFont &font);
542 QColor textColor() const;
543 void setTextColor(const QColor &color);
544
545 InplaceAlignPosition inplaceAlign() const;
546 void setInplaceAlign(InplaceAlignPosition align);
547
548 QPointF calloutPoint(int id) const;
549 QVector<QPointF> calloutPoints() const;
550 void setCalloutPoints(const QVector<QPointF> &points);
551
552 InplaceIntent inplaceIntent() const;
553 void setInplaceIntent(InplaceIntent intent);
554
555private:
556 explicit TextAnnotation(TextAnnotationPrivate &dd);
557 void setTextType(TextType type);
558 Q_DECLARE_PRIVATE(TextAnnotation)
559 Q_DISABLE_COPY(TextAnnotation)
560};
561
567class POPPLER_QT6_EXPORT LineAnnotation : public Annotation
568{
569 friend class AnnotationPrivate;
570
571public:
572 // local enums
573 enum LineType
574 {
575 StraightLine,
576 Polyline
577 };
578 enum TermStyle
579 {
580 Square,
581 Circle,
582 Diamond,
583 OpenArrow,
584 ClosedArrow,
585 None,
586 Butt,
587 ROpenArrow,
588 RClosedArrow,
589 Slash
590 };
591 enum LineIntent
592 {
593 Unknown,
594 Arrow,
595 Dimension,
596 PolygonCloud
597 };
598
599 explicit LineAnnotation(LineType type);
600 ~LineAnnotation() override;
601 SubType subType() const override;
602
603 LineType lineType() const;
604
605 QVector<QPointF> linePoints() const;
606 void setLinePoints(const QVector<QPointF> &points);
607
608 TermStyle lineStartStyle() const;
609 void setLineStartStyle(TermStyle style);
610
611 TermStyle lineEndStyle() const;
612 void setLineEndStyle(TermStyle style);
613
614 bool isLineClosed() const;
615 void setLineClosed(bool closed);
616
617 QColor lineInnerColor() const;
618 void setLineInnerColor(const QColor &color);
619
620 double lineLeadingForwardPoint() const;
621 void setLineLeadingForwardPoint(double point);
622
623 double lineLeadingBackPoint() const;
624 void setLineLeadingBackPoint(double point);
625
626 bool lineShowCaption() const;
627 void setLineShowCaption(bool show);
628
629 LineIntent lineIntent() const;
630 void setLineIntent(LineIntent intent);
631
632private:
633 explicit LineAnnotation(LineAnnotationPrivate &dd);
634 void setLineType(LineType type);
635 Q_DECLARE_PRIVATE(LineAnnotation)
636 Q_DISABLE_COPY(LineAnnotation)
637};
638
645class POPPLER_QT6_EXPORT GeomAnnotation : public Annotation
646{
647 friend class AnnotationPrivate;
648
649public:
650 GeomAnnotation();
651 ~GeomAnnotation() override;
652 SubType subType() const override;
653
654 // common enums
655 enum GeomType
656 {
657 InscribedSquare,
658 InscribedCircle
659 };
660
661 GeomType geomType() const;
662 void setGeomType(GeomType type);
663
664 QColor geomInnerColor() const;
665 void setGeomInnerColor(const QColor &color);
666
667private:
668 explicit GeomAnnotation(GeomAnnotationPrivate &dd);
669 Q_DECLARE_PRIVATE(GeomAnnotation)
670 Q_DISABLE_COPY(GeomAnnotation)
671};
672
678class POPPLER_QT6_EXPORT HighlightAnnotation : public Annotation
679{
680 friend class AnnotationPrivate;
681
682public:
683 HighlightAnnotation();
684 ~HighlightAnnotation() override;
685 SubType subType() const override;
686
697
703 struct Quad
704 {
705 QPointF points[4]; // 8 valid coords
706 bool capStart; // false (vtx 1-4) [K]
707 bool capEnd; // false (vtx 2-3) [K]
708 double feather; // 0.1 (in range 0..1) [K]
709 };
710
716
722
726 QList<Quad> highlightQuads() const;
727
731 void setHighlightQuads(const QList<Quad> &quads);
732
733private:
734 explicit HighlightAnnotation(HighlightAnnotationPrivate &dd);
735 Q_DECLARE_PRIVATE(HighlightAnnotation)
736 Q_DISABLE_COPY(HighlightAnnotation)
737};
738
744class POPPLER_QT6_EXPORT StampAnnotation : public Annotation
745{
746 friend class AnnotationPrivate;
747
748public:
749 StampAnnotation();
750 ~StampAnnotation() override;
751 SubType subType() const override;
752
772 QString stampIconName() const;
773
779 void setStampIconName(const QString &name);
780
786 void setStampCustomImage(const QImage &image);
787
788private:
789 explicit StampAnnotation(StampAnnotationPrivate &dd);
790 Q_DECLARE_PRIVATE(StampAnnotation)
791 Q_DISABLE_COPY(StampAnnotation)
792};
793
804class POPPLER_QT6_EXPORT SignatureAnnotation : public Annotation
805{
806 friend class AnnotationPrivate;
807
808public:
824
826 ~SignatureAnnotation() override;
827 SubType subType() const override;
828
829 void setText(const QString &text);
830 void setLeftText(const QString &text);
831
835 double fontSize() const;
836 void setFontSize(double fontSize);
837
841 double leftFontSize() const;
842 void setLeftFontSize(double fontSize);
843
847 QColor fontColor() const;
848 void setFontColor(const QColor &color);
849
853 QColor borderColor() const;
854 void setBorderColor(const QColor &color);
855
861 double borderWidth() const;
862 void setBorderWidth(double width);
863
867 QColor backgroundColor() const;
868 void setBackgroundColor(const QColor &color);
869
870 QString imagePath() const;
871 void setImagePath(const QString &imagePath);
872
873 QString fieldPartialName() const;
874 void setFieldPartialName(const QString &fieldPartialName);
875
876 [[nodiscard]] SigningResult sign(const QString &outputFileName, const PDFConverter::NewSignatureData &data);
877
883 ErrorString lastSigningErrorDetails() const;
884
885private:
886 explicit SignatureAnnotation(SignatureAnnotationPrivate &dd);
887 Q_DECLARE_PRIVATE(SignatureAnnotation)
888 Q_DISABLE_COPY(SignatureAnnotation)
889};
890
896class POPPLER_QT6_EXPORT InkAnnotation : public Annotation
897{
898 friend class AnnotationPrivate;
899
900public:
901 InkAnnotation();
902 ~InkAnnotation() override;
903 SubType subType() const override;
904
905 QList<QVector<QPointF>> inkPaths() const;
906 void setInkPaths(const QList<QVector<QPointF>> &paths);
907
908private:
909 explicit InkAnnotation(InkAnnotationPrivate &dd);
910 Q_DECLARE_PRIVATE(InkAnnotation)
911 Q_DISABLE_COPY(InkAnnotation)
912};
913
914class POPPLER_QT6_EXPORT LinkAnnotation : public Annotation
915{
916 friend class AnnotationPrivate;
917
918public:
919 ~LinkAnnotation() override;
920 SubType subType() const override;
921
922 // local enums
923 enum HighlightMode
924 {
925 None,
926 Invert,
927 Outline,
928 Push
929 };
930
931 Link *linkDestination() const;
932 void setLinkDestination(std::unique_ptr<Link> &&link);
933
934 HighlightMode linkHighlightMode() const;
935 void setLinkHighlightMode(HighlightMode mode);
936
937 QPointF linkRegionPoint(int id) const;
938 void setLinkRegionPoint(int id, QPointF point);
939
940private:
942 explicit LinkAnnotation(LinkAnnotationPrivate &dd);
943 Q_DECLARE_PRIVATE(LinkAnnotation)
944 Q_DISABLE_COPY(LinkAnnotation)
945};
946
952class POPPLER_QT6_EXPORT CaretAnnotation : public Annotation
953{
954 friend class AnnotationPrivate;
955
956public:
957 CaretAnnotation();
958 ~CaretAnnotation() override;
959 SubType subType() const override;
960
965 {
966 None,
967 P
968 };
969
970 CaretSymbol caretSymbol() const;
971 void setCaretSymbol(CaretSymbol symbol);
972
973private:
974 explicit CaretAnnotation(CaretAnnotationPrivate &dd);
975 Q_DECLARE_PRIVATE(CaretAnnotation)
976 Q_DISABLE_COPY(CaretAnnotation)
977};
978
984class POPPLER_QT6_EXPORT FileAttachmentAnnotation : public Annotation
985{
986 friend class AnnotationPrivate;
987
988public:
989 ~FileAttachmentAnnotation() override;
990 SubType subType() const override;
991
995 QString fileIconName() const;
999 void setFileIconName(const QString &icon);
1000
1011
1012private:
1013 FileAttachmentAnnotation();
1014 explicit FileAttachmentAnnotation(FileAttachmentAnnotationPrivate &dd);
1015 Q_DECLARE_PRIVATE(FileAttachmentAnnotation)
1016 Q_DISABLE_COPY(FileAttachmentAnnotation)
1017};
1018
1024class POPPLER_QT6_EXPORT SoundAnnotation : public Annotation
1025{
1026 friend class AnnotationPrivate;
1027
1028public:
1029 ~SoundAnnotation() override;
1030 SubType subType() const override;
1031
1035 QString soundIconName() const;
1039 void setSoundIconName(const QString &icon);
1040
1051
1052private:
1053 SoundAnnotation();
1054 explicit SoundAnnotation(SoundAnnotationPrivate &dd);
1055 Q_DECLARE_PRIVATE(SoundAnnotation)
1056 Q_DISABLE_COPY(SoundAnnotation)
1057};
1058
1064class POPPLER_QT6_EXPORT MovieAnnotation : public Annotation
1065{
1066 friend class AnnotationPrivate;
1067
1068public:
1069 ~MovieAnnotation() override;
1070 SubType subType() const override;
1071
1082
1086 QString movieTitle() const;
1090 void setMovieTitle(const QString &title);
1091
1092private:
1093 MovieAnnotation();
1094 explicit MovieAnnotation(MovieAnnotationPrivate &dd);
1095 Q_DECLARE_PRIVATE(MovieAnnotation)
1096 Q_DISABLE_COPY(MovieAnnotation)
1097};
1098
1104class POPPLER_QT6_EXPORT ScreenAnnotation : public Annotation
1105{
1106 friend class AnnotationPrivate;
1107
1108public:
1109 ~ScreenAnnotation() override;
1110
1111 SubType subType() const override;
1112
1116 LinkRendition *action() const;
1117
1123 void setAction(LinkRendition *action);
1124
1128 QString screenTitle() const;
1129
1133 void setScreenTitle(const QString &title);
1134
1139 std::unique_ptr<Link> additionalAction(AdditionalActionType type) const;
1140
1141private:
1142 ScreenAnnotation();
1143 explicit ScreenAnnotation(ScreenAnnotationPrivate &dd);
1144 Q_DECLARE_PRIVATE(ScreenAnnotation)
1145 Q_DISABLE_COPY(ScreenAnnotation)
1146};
1147
1156class POPPLER_QT6_EXPORT WidgetAnnotation : public Annotation
1157{
1158 friend class AnnotationPrivate;
1159
1160public:
1161 ~WidgetAnnotation() override;
1162
1163 SubType subType() const override;
1164
1169 std::unique_ptr<Link> additionalAction(AdditionalActionType type) const;
1170
1171private:
1172 WidgetAnnotation();
1173 explicit WidgetAnnotation(WidgetAnnotationPrivate &dd);
1174 Q_DECLARE_PRIVATE(WidgetAnnotation)
1175 Q_DISABLE_COPY(WidgetAnnotation)
1176};
1177
1183class POPPLER_QT6_EXPORT RichMediaAnnotation : public Annotation
1184{
1185 friend class AnnotationPrivate;
1186
1187public:
1188 ~RichMediaAnnotation() override;
1189
1190 SubType subType() const override;
1191
1200 class POPPLER_QT6_EXPORT Params
1201 {
1202 friend class AnnotationPrivate;
1203
1204 public:
1205 Params();
1206 ~Params();
1207
1211 QString flashVars() const;
1212
1213 private:
1214 void setFlashVars(const QString &flashVars);
1215
1216 class Private;
1217 QScopedPointer<Private> d;
1218 };
1219
1227 class POPPLER_QT6_EXPORT Instance
1228 {
1229 friend class AnnotationPrivate;
1230
1231 public:
1242
1243 Instance();
1244 ~Instance();
1245
1249 Type type() const;
1250
1255
1262
1263 private:
1264 void setType(Type type);
1265 void setParams(std::unique_ptr<RichMediaAnnotation::Params> &&params);
1266 void setEmbeddedFile(std::unique_ptr<EmbeddedFile> &&embeddedFile);
1267
1268 class Private;
1269 QScopedPointer<Private> d;
1270 };
1271
1278 class POPPLER_QT6_EXPORT Configuration
1279 {
1280 friend class AnnotationPrivate;
1281
1282 public:
1293
1294 Configuration();
1296
1300 Type type() const;
1301
1305 QString name() const;
1306
1310 QList<RichMediaAnnotation::Instance *> instances() const;
1311
1312 private:
1313 void setType(Type type);
1314 void setName(const QString &name);
1315 void setInstances(const QList<RichMediaAnnotation::Instance *> &instances);
1316
1317 class Private;
1318 QScopedPointer<Private> d;
1319 };
1320
1328 class POPPLER_QT6_EXPORT Asset
1329 {
1330 friend class AnnotationPrivate;
1331
1332 public:
1333 Asset();
1334 ~Asset();
1335
1339 QString name() const;
1340
1345
1346 private:
1347 void setName(const QString &name);
1348 void setEmbeddedFile(std::unique_ptr<EmbeddedFile> &&embeddedFile);
1349
1350 class Private;
1351 QScopedPointer<Private> d;
1352 };
1353
1360 class POPPLER_QT6_EXPORT Content
1361 {
1362 friend class AnnotationPrivate;
1363
1364 public:
1365 Content();
1366 ~Content();
1367
1371 QList<RichMediaAnnotation::Configuration *> configurations() const;
1372
1376 QList<RichMediaAnnotation::Asset *> assets() const;
1377
1378 private:
1379 void setConfigurations(const QList<RichMediaAnnotation::Configuration *> &configurations);
1380 void setAssets(const QList<RichMediaAnnotation::Asset *> &assets);
1381
1382 class Private;
1383 QScopedPointer<Private> d;
1384 };
1385
1392 class POPPLER_QT6_EXPORT Activation
1393 {
1394 friend class AnnotationPrivate;
1395
1396 public:
1406
1407 Activation();
1408 ~Activation();
1409
1414
1415 private:
1416 void setCondition(Condition condition);
1417
1418 class Private;
1419 QScopedPointer<Private> d;
1420 };
1421
1428 class POPPLER_QT6_EXPORT Deactivation
1429 {
1430 friend class AnnotationPrivate;
1431
1432 public:
1442
1443 Deactivation();
1444 ~Deactivation();
1445
1450
1451 private:
1452 void setCondition(Condition condition);
1453
1454 class Private;
1455 QScopedPointer<Private> d;
1456 };
1457
1464 class POPPLER_QT6_EXPORT Settings
1465 {
1466 friend class AnnotationPrivate;
1467
1468 public:
1469 Settings();
1470 ~Settings();
1471
1476
1481
1482 private:
1483 void setActivation(std::unique_ptr<RichMediaAnnotation::Activation> &&activation);
1484 void setDeactivation(std::unique_ptr<RichMediaAnnotation::Deactivation> &&deactivation);
1485
1486 class Private;
1487 QScopedPointer<Private> d;
1488 };
1489
1494
1499
1500private:
1501 void setSettings(std::unique_ptr<RichMediaAnnotation::Settings> &&settings);
1502 void setContent(std::unique_ptr<RichMediaAnnotation::Content> &&content);
1503
1504 RichMediaAnnotation();
1505 explicit RichMediaAnnotation(RichMediaAnnotationPrivate &dd);
1506 Q_DECLARE_PRIVATE(RichMediaAnnotation)
1507 Q_DISABLE_COPY(RichMediaAnnotation)
1508};
1509
1510}
1511
1512#endif
AnnotationAppearance class wrapping Poppler's AP stream object.
Definition poppler-annotation.h:95
Container class for Annotation pop-up window information.
Definition poppler-annotation.h:370
Container class for Annotation style information.
Definition poppler-annotation.h:327
Annotation class holding properties shared by all annotations.
Definition poppler-annotation.h:181
void setFlags(Flags flags)
Sets this annotation's flags.
std::unique_ptr< AnnotationAppearance > annotationAppearance() const
Returns the current appearance stream of this annotation.
SubType
Annotation subclasses.
Definition poppler-annotation.h:194
@ AHighlight
HighlightAnnotation.
Definition poppler-annotation.h:198
@ AWidget
WidgetAnnotation.
Definition poppler-annotation.h:207
@ ACaret
CaretAnnotation.
Definition poppler-annotation.h:202
@ AStamp
StampAnnotation.
Definition poppler-annotation.h:199
@ AFileAttachment
FileAttachmentAnnotation.
Definition poppler-annotation.h:203
@ AMovie
MovieAnnotation.
Definition poppler-annotation.h:205
@ ASound
SoundAnnotation.
Definition poppler-annotation.h:204
@ ARichMedia
RichMediaAnnotation.
Definition poppler-annotation.h:208
@ AText
TextAnnotation.
Definition poppler-annotation.h:195
@ AInk
InkAnnotation.
Definition poppler-annotation.h:200
@ ALink
LinkAnnotation.
Definition poppler-annotation.h:201
@ AScreen
ScreenAnnotation.
Definition poppler-annotation.h:206
@ AGeom
GeomAnnotation.
Definition poppler-annotation.h:197
@ ALine
LineAnnotation.
Definition poppler-annotation.h:196
void setAuthor(const QString &author)
Sets a new author for the annotation.
void setPopup(const Popup &popup)
QRectF boundary() const
Returns this annotation's boundary rectangle in normalized coordinates.
void setAnnotationAppearance(const AnnotationAppearance &annotationAppearance)
Sets the annotation's appearance stream with the annotationAppearance.
std::vector< std::unique_ptr< Annotation > > revisions() const
Returns the revisions of this annotation.
Flag
Annotation flags.
Definition poppler-annotation.h:220
@ FixedRotation
Do not rotate the annotation according to page orientation and rendering rotation.
Definition poppler-annotation.h:223
@ Hidden
Do not display or print the annotation.
Definition poppler-annotation.h:221
@ DenyPrint
Do not print the annotation.
Definition poppler-annotation.h:224
QString author() const
Returns the author of the annotation.
void setUniqueName(const QString &uniqueName)
Sets a new unique name for the annotation.
Flags flags() const
Returns this annotation's flags.
virtual ~Annotation()
Destructor.
QString uniqueName() const
Returns the unique name (ID) of the annotation.
void setBoundary(const QRectF &boundary)
Sets this annotation's boundary rectangle.
AdditionalActionType
Describes the flags from an annotations 'AA' dictionary.
Definition poppler-annotation.h:442
@ MouseReleasedAction
Performed when the mouse button is released inside the annotation's active area.
Definition poppler-annotation.h:446
@ FocusInAction
Performed when the annotation receives the input focus.
Definition poppler-annotation.h:447
@ PageOpeningAction
Performed when the page containing the annotation is opened.
Definition poppler-annotation.h:449
@ MousePressedAction
Performed when the mouse button is pressed inside the annotation's active area.
Definition poppler-annotation.h:445
@ FocusOutAction
Performed when the annotation loses the input focus.
Definition poppler-annotation.h:448
@ PageInvisibleAction
Performed when the page containing the annotation becomes invisible.
Definition poppler-annotation.h:452
@ PageClosingAction
Performed when the page containing the annotation is closed.
Definition poppler-annotation.h:450
@ CursorLeavingAction
Performed when the cursor exists the annotation's active area.
Definition poppler-annotation.h:444
@ PageVisibleAction
Performed when the page containing the annotation becomes visible.
Definition poppler-annotation.h:451
@ CursorEnteringAction
Performed when the cursor enters the annotation's active area.
Definition poppler-annotation.h:443
virtual SubType subType() const =0
The type of the annotation.
Caret annotation.
Definition poppler-annotation.h:953
SubType subType() const override
The type of the annotation.
CaretSymbol
The symbols for the caret annotation.
Definition poppler-annotation.h:965
Container class for an embedded file with a PDF document.
Definition poppler-qt6.h:340
void setFileIconName(const QString &icon)
Sets a new name for the icon of this annotation.
QString fileIconName() const
Returns the name of the icon of this annotation.
void setEmbeddedFile(EmbeddedFile *ef)
Sets a new EmbeddedFile for this annotation.
EmbeddedFile * embeddedFile() const
Returns the EmbeddedFile of this annotation.
SubType subType() const override
The type of the annotation.
Geometric annotation.
Definition poppler-annotation.h:646
SubType subType() const override
The type of the annotation.
void setHighlightQuads(const QList< Quad > &quads)
Set the areas to highlight.
QList< Quad > highlightQuads() const
The list of areas to highlight.
void setHighlightType(HighlightType type)
Set the type of highlighting to use for the given area or areas.
SubType subType() const override
The type of the annotation.
HighlightType highlightType() const
The type (style) of highlighting to use for this area or these areas.
HighlightType
The type of highlight.
Definition poppler-annotation.h:691
@ Squiggly
jagged or squiggly underline
Definition poppler-annotation.h:693
@ Underline
straight line underline
Definition poppler-annotation.h:694
@ StrikeOut
straight line through-line
Definition poppler-annotation.h:695
@ Highlight
highlighter pen style annotation
Definition poppler-annotation.h:692
SubType subType() const override
The type of the annotation.
SubType subType() const override
The type of the annotation.
Definition poppler-annotation.h:915
SubType subType() const override
The type of the annotation.
Rendition: Rendition link.
Definition poppler-link.h:475
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:1393
Condition
Describes the condition for activating the rich media.
Definition poppler-annotation.h:1401
@ PageVisible
Activate when page becomes visible.
Definition poppler-annotation.h:1403
@ PageOpened
Activate when page is opened.
Definition poppler-annotation.h:1402
@ UserAction
Activate when user interacts with the annotation.
Definition poppler-annotation.h:1404
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:1279
Type
Describes the media type of the configuration.
Definition poppler-annotation.h:1287
@ Type3D
A 3D media file.
Definition poppler-annotation.h:1288
@ TypeVideo
A video media file.
Definition poppler-annotation.h:1291
@ TypeSound
A sound media file.
Definition poppler-annotation.h:1290
@ TypeFlash
A Flash media file.
Definition poppler-annotation.h:1289
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:1361
QList< RichMediaAnnotation::Configuration * > configurations() const
Returns the list of configuration objects of the content object.
QList< RichMediaAnnotation::Asset * > assets() const
Returns the list of asset objects of the content object.
The deactivation object of the RichMediaAnnotation::Settings object.
Definition poppler-annotation.h:1429
Condition
Describes the condition for deactivating the rich media.
Definition poppler-annotation.h:1437
@ PageClosed
Deactivate when page is closed.
Definition poppler-annotation.h:1438
@ UserAction
Deactivate when user interacts with the annotation.
Definition poppler-annotation.h:1440
@ PageInvisible
Deactivate when page becomes invisible.
Definition poppler-annotation.h:1439
Condition condition() const
Returns the deactivation condition.
The instance object of a RichMediaAnnotation::Configuration object.
Definition poppler-annotation.h:1228
EmbeddedFile * embeddedFile() const
Returns the embedded file of the instance asset or nullptr if the asset is missing or has no embedded...
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:1236
@ TypeVideo
A video media file.
Definition poppler-annotation.h:1240
@ TypeFlash
A Flash media file.
Definition poppler-annotation.h:1238
@ TypeSound
A sound media file.
Definition poppler-annotation.h:1239
@ Type3D
A 3D media file.
Definition poppler-annotation.h:1237
Type type() const
Returns the media type of the instance.
The params object of a RichMediaAnnotation::Instance object.
Definition poppler-annotation.h:1201
QString flashVars() const
Returns the parameters for the flash player.
The settings object of a RichMediaAnnotation.
Definition poppler-annotation.h:1465
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:805
double fontSize() const
Default: 10.
QColor borderColor() const
Default: red.
double borderWidth() const
border width in points
double leftFontSize() const
Default: 20.
QColor fontColor() const
Default: red.
ErrorString lastSigningErrorDetails() const
A string with a string that might offer more details of the signing result failure.
QColor backgroundColor() const
Default: QColor(240, 240, 240).
SubType subType() const override
The type of the annotation.
SigningResult
Definition poppler-annotation.h:813
@ SigningSuccess
No error.
Definition poppler-annotation.h:814
@ WriteFailed
Write failed (permissions, faulty disk, ...).
Definition poppler-annotation.h:819
@ InternalError
Unexpected error, likely a bug in poppler.
Definition poppler-annotation.h:817
@ UnsupportedSignatureType
User asked for a signature type that the current backend/key combo can't deliver.
Definition poppler-annotation.h:822
@ FieldAlreadySigned
Trying to sign a field that is already signed.
Definition poppler-annotation.h:815
@ BadPassphrase
User entered bad passphrase.
Definition poppler-annotation.h:821
@ KeyMissing
Key not found (Either the input key is not from the list or the available keys has changed underneath...
Definition poppler-annotation.h:818
@ GenericSigningError
Unclassified error.
Definition poppler-annotation.h:816
@ UserCancelled
User cancelled the process.
Definition poppler-annotation.h:820
SubType subType() const override
The type of the annotation.
void setSound(SoundObject *s)
Sets a new SoundObject for this annotation.
void setSoundIconName(const QString &icon)
Sets a new name for the icon of this annotation.
QString soundIconName() const
Returns the name of the icon of this annotation.
SoundObject * sound() const
Returns the SoundObject of this annotation.
Container class for a sound file in a PDF document.
Definition poppler-qt6.h:1805
SubType subType() const override
The type of the annotation.
void setStampCustomImage(const QImage &image)
Set a custom icon for this stamp annotation.
void setStampIconName(const QString &name)
Set the icon type for this stamp annotation.
QString stampIconName() const
The name of the icon for this stamp annotation.
QString textIcon() const
The name of the icon for this text annotation.
TextType textType() const
The type of text annotation represented by this object.
void setTextIcon(const QString &icon)
Set the name of the icon to use for this text annotation.
SubType subType() const override
The type of the annotation.
QColor textColor() const
Default text color is black.
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:55
Structure corresponding to a QuadPoints array.
Definition poppler-annotation.h:704