Poppler Qt5 26.01.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, Klarälvdalens Datakonsult AB, a KDAB Group company, <info@kdab.com>. Work sponsored by Technische Universität Dresden
13 * Copyright (C) 2021, Mahmoud Ahmed Khalil <mahmoudkhalil11@gmail.com>
14 * Copyright (C) 2025, Aditya Tiwari <suntiwari3495@gmail.com>
15 * Adapting code from
16 * Copyright (C) 2004 by Enrico Ros <eros.kde@email.it>
17 *
18 * This program is free software; you can redistribute it and/or modify
19 * it under the terms of the GNU General Public License as published by
20 * the Free Software Foundation; either version 2, or (at your option)
21 * any later version.
22 *
23 * This program is distributed in the hope that it will be useful,
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 * GNU General Public License for more details.
27 *
28 * You should have received a copy of the GNU General Public License
29 * along with this program; if not, write to the Free Software
30 * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
31 */
32
33#ifndef _POPPLER_ANNOTATION_H_
34#define _POPPLER_ANNOTATION_H_
35
36#include <QtCore/QDateTime>
37#include <QtCore/QSharedDataPointer>
38#include <QtCore/QLinkedList>
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 <QtXml/QDomDocument>
47#include "poppler-export.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 InkAnnotationPrivate;
62class LinkAnnotationPrivate;
63class CaretAnnotationPrivate;
64class FileAttachmentAnnotationPrivate;
65class SoundAnnotationPrivate;
66class MovieAnnotationPrivate;
67class ScreenAnnotationPrivate;
68class WidgetAnnotationPrivate;
69class RichMediaAnnotationPrivate;
70class EmbeddedFile;
71class Link;
72class SoundObject;
73class MovieObject;
74class LinkRendition;
75class Page;
76
81class POPPLER_QT5_EXPORT AnnotationUtils
82{
83public:
90 Q_DECL_DEPRECATED static Annotation *createAnnotation(const QDomElement &annElement);
91
96 Q_DECL_DEPRECATED static void storeAnnotation(const Annotation *ann, QDomElement &annElement, QDomDocument &document);
97
102 Q_DECL_DEPRECATED static QDomElement findChildElement(const QDomNode &parentNode, const QString &name);
103};
104
117class POPPLER_QT5_EXPORT AnnotationAppearance
118{
119 friend class Annotation;
120
121public:
122 explicit AnnotationAppearance(AnnotationAppearancePrivate *annotationAppearancePrivate);
123 ~AnnotationAppearance();
124
125private:
126 AnnotationAppearancePrivate *d;
127 Q_DISABLE_COPY(AnnotationAppearance)
128};
129
203class POPPLER_QT5_EXPORT Annotation
204{
205 friend class AnnotationUtils;
206 friend class LinkMovie;
207 friend class LinkRendition;
208
209public:
210 // enum definitions
216 // WARNING!!! oKular uses that very same values so if you change them notify the author!
218 {
219 AText = 1,
220 ALine = 2,
221 AGeom = 3,
223 AStamp = 5,
224 AInk = 6,
225 ALink = 7,
226 ACaret = 8,
228 ASound = 10,
229 AMovie = 11,
230 AScreen = 12,
231 AWidget = 13,
233 A_BASE = 0
234 };
235
243 // NOTE: Only flags that are known to work are documented
244 enum Flag
245 {
246 Hidden = 1,
247 FixedSize = 2,
250 DenyWrite = 16,
251 DenyDelete = 32,
252 ToggleHidingOnMouse = 64,
253 External = 128
254 };
255
256 enum LineStyle
257 {
258 Solid = 1,
259 Dashed = 2,
260 Beveled = 4,
261 Inset = 8,
262 Underline = 16
263 };
264 enum LineEffect
265 {
266 NoEffect = 1,
267 Cloudy = 2
268 };
269 enum RevScope
270 {
271 Root = 0 ,
272 Reply = 1,
273 Group = 2,
274 Delete = 4
275 };
276 enum RevType
277 {
278 None = 1,
279 Marked = 2,
280 Unmarked = 4,
281 Accepted = 8,
282 Rejected = 16,
283 Cancelled = 32,
284 Completed = 64
285 };
286
290 QString author() const;
294 void setAuthor(const QString &author);
295
296 QString contents() const;
297 void setContents(const QString &contents);
298
302 QString uniqueName() const;
308 void setUniqueName(const QString &uniqueName);
309
310 QDateTime modificationDate() const;
311 void setModificationDate(const QDateTime &date);
312
313 QDateTime creationDate() const;
314 void setCreationDate(const QDateTime &date);
315
321 int flags() const;
327 void setFlags(int flags);
328
334 QRectF boundary() const;
345 void setBoundary(const QRectF &boundary);
346
352 class POPPLER_QT5_EXPORT Style
353 {
354 public:
355 Style();
356 Style(const Style &other);
357 Style &operator=(const Style &other);
358 ~Style();
359
360 // appearance properties
361 QColor color() const; // black
362 void setColor(const QColor &color);
363 double opacity() const; // 1.0
364 void setOpacity(double opacity);
365
366 // pen properties
367 double width() const; // 1.0
368 void setWidth(double width);
369 LineStyle lineStyle() const; // LineStyle::Solid
370 void setLineStyle(LineStyle style);
371 double xCorners() const; // 0.0
372 void setXCorners(double radius);
373 double yCorners() const; // 0.0
374 void setYCorners(double radius);
375 const QVector<double> &dashArray() const; // [ 3 ]
376 void setDashArray(const QVector<double> &array);
377
378 // pen effects
379 LineEffect lineEffect() const; // LineEffect::NoEffect
380 void setLineEffect(LineEffect effect);
381 double effectIntensity() const; // 1.0
382 void setEffectIntensity(double intens);
383
384 private:
385 class Private;
386 QSharedDataPointer<Private> d;
387 };
388
390 Style style() const;
392 void setStyle(const Style &style);
393
399 class POPPLER_QT5_EXPORT Popup
400 {
401 public:
402 Popup();
403 Popup(const Popup &other);
404 Popup &operator=(const Popup &other);
405 ~Popup();
406
407 // window state (Hidden, FixedRotation, Deny* flags allowed)
408 int flags() const; // -1 (never initialized) -> 0 (if inited and shown)
409 void setFlags(int flags);
410
411 // geometric properties
412 QRectF geometry() const; // no default
413 void setGeometry(const QRectF &geom);
414
415 // window contents/override properties
416 QString title() const; // '' text in the titlebar (overrides author)
417 void setTitle(const QString &title);
418 QString summary() const; // '' short description (displayed if not empty)
419 void setSummary(const QString &summary);
420 QString text() const; // '' text for the window (overrides annot->contents)
421 void setText(const QString &text);
422
423 private:
424 class Private;
425 QSharedDataPointer<Private> d;
426 };
427
429 Popup popup() const;
431 void setPopup(const Popup &popup);
432
434 RevScope revisionScope() const; // Root
435
437 RevType revisionType() const; // None
438
447 QList<Annotation *> revisions() const;
448
452 virtual SubType subType() const = 0;
453
459 std::unique_ptr<AnnotationAppearance> annotationAppearance() const;
460
467
471 virtual ~Annotation();
472
494
495protected:
497 explicit Annotation(AnnotationPrivate &dd);
498 Annotation(AnnotationPrivate &dd, const QDomNode &annNode);
499 void storeBaseAnnotationProperties(QDomNode &annNode, QDomDocument &document) const;
500 Q_DECLARE_PRIVATE(Annotation)
501 QExplicitlySharedDataPointer<AnnotationPrivate> d_ptr;
503
504private:
505 virtual void store(QDomNode &parentNode, QDomDocument &document) const = 0;
506 Q_DISABLE_COPY(Annotation)
507};
508
515class POPPLER_QT5_EXPORT TextAnnotation : public Annotation
516{
517 friend class AnnotationUtils;
518 friend class AnnotationPrivate;
519
520public:
521 // local enums
522 enum TextType
523 {
524 Linked,
525 InPlace
526 };
527 enum InplaceIntent
528 {
529 Unknown,
530 Callout,
531 TypeWriter
532 };
533
534 explicit TextAnnotation(TextType type);
535 ~TextAnnotation() override;
536 SubType subType() const override;
537
541 TextType textType() const;
542
568 QString textIcon() const;
569
575 void setTextIcon(const QString &icon);
576
577 QFont textFont() const;
578 void setTextFont(const QFont &font);
580 QColor textColor() const;
582 void setTextColor(const QColor &color);
583
584 // 0:left, 1:center, 2:right
585 int inplaceAlign() const;
586 void setInplaceAlign(int align);
587
588 QPointF calloutPoint(int id) const;
590 QVector<QPointF> calloutPoints() const;
592 void setCalloutPoints(const QVector<QPointF> &points);
593
594 InplaceIntent inplaceIntent() const;
595 void setInplaceIntent(InplaceIntent intent);
596
597private:
598 explicit TextAnnotation(const QDomNode &node);
599 explicit TextAnnotation(TextAnnotationPrivate &dd);
600 void store(QDomNode &parentNode, QDomDocument &document) const override;
601 void setTextType(TextType type);
602 Q_DECLARE_PRIVATE(TextAnnotation)
603 Q_DISABLE_COPY(TextAnnotation)
604};
605
611class POPPLER_QT5_EXPORT LineAnnotation : public Annotation
612{
613 friend class AnnotationUtils;
614 friend class AnnotationPrivate;
615
616public:
617 // local enums
620 {
621 StraightLine,
622 Polyline
623 };
624 enum TermStyle
625 {
626 Square,
627 Circle,
628 Diamond,
629 OpenArrow,
630 ClosedArrow,
631 None,
632 Butt,
633 ROpenArrow,
634 RClosedArrow,
635 Slash
636 };
637 enum LineIntent
638 {
639 Unknown,
640 Arrow,
641 Dimension,
642 PolygonCloud
643 };
644
646 explicit LineAnnotation(LineType type);
647 ~LineAnnotation() override;
648 SubType subType() const override;
649
652
653 QLinkedList<QPointF> linePoints() const;
654 void setLinePoints(const QLinkedList<QPointF> &points);
655
656 TermStyle lineStartStyle() const;
657 void setLineStartStyle(TermStyle style);
658
659 TermStyle lineEndStyle() const;
660 void setLineEndStyle(TermStyle style);
661
662 bool isLineClosed() const;
663 void setLineClosed(bool closed);
664
665 QColor lineInnerColor() const;
666 void setLineInnerColor(const QColor &color);
667
668 double lineLeadingForwardPoint() const;
669 void setLineLeadingForwardPoint(double point);
670
671 double lineLeadingBackPoint() const;
672 void setLineLeadingBackPoint(double point);
673
674 bool lineShowCaption() const;
675 void setLineShowCaption(bool show);
676
677 LineIntent lineIntent() const;
678 void setLineIntent(LineIntent intent);
679
680private:
681 explicit LineAnnotation(const QDomNode &node);
682 explicit LineAnnotation(LineAnnotationPrivate &dd);
683 void store(QDomNode &parentNode, QDomDocument &document) const override;
684 void setLineType(LineType type);
685 Q_DECLARE_PRIVATE(LineAnnotation)
686 Q_DISABLE_COPY(LineAnnotation)
687};
688
695class POPPLER_QT5_EXPORT GeomAnnotation : public Annotation
696{
697 friend class AnnotationUtils;
698 friend class AnnotationPrivate;
699
700public:
701 GeomAnnotation();
702 ~GeomAnnotation() override;
703 SubType subType() const override;
704
705 // common enums
706 enum GeomType
707 {
708 InscribedSquare,
709 InscribedCircle
710 };
711
712 GeomType geomType() const;
713 void setGeomType(GeomType type);
714
715 QColor geomInnerColor() const;
716 void setGeomInnerColor(const QColor &color);
717
718private:
719 explicit GeomAnnotation(const QDomNode &node);
720 explicit GeomAnnotation(GeomAnnotationPrivate &dd);
721 void store(QDomNode &parentNode, QDomDocument &document) const override;
722 Q_DECLARE_PRIVATE(GeomAnnotation)
723 Q_DISABLE_COPY(GeomAnnotation)
724};
725
731class POPPLER_QT5_EXPORT HighlightAnnotation : public Annotation
732{
733 friend class AnnotationUtils;
734 friend class AnnotationPrivate;
735
736public:
737 HighlightAnnotation();
738 ~HighlightAnnotation() override;
739 SubType subType() const override;
740
751
757 struct Quad
758 {
759 QPointF points[4]; // 8 valid coords
760 bool capStart; // false (vtx 1-4) [K]
761 bool capEnd; // false (vtx 2-3) [K]
762 double feather; // 0.1 (in range 0..1) [K]
763 };
764
770
776
780 QList<Quad> highlightQuads() const;
781
785 void setHighlightQuads(const QList<Quad> &quads);
786
787private:
788 explicit HighlightAnnotation(const QDomNode &node);
789 explicit HighlightAnnotation(HighlightAnnotationPrivate &dd);
790 void store(QDomNode &parentNode, QDomDocument &document) const override;
791 Q_DECLARE_PRIVATE(HighlightAnnotation)
792 Q_DISABLE_COPY(HighlightAnnotation)
793};
794
800class POPPLER_QT5_EXPORT StampAnnotation : public Annotation
801{
802 friend class AnnotationUtils;
803 friend class AnnotationPrivate;
804
805public:
806 StampAnnotation();
807 ~StampAnnotation() override;
808 SubType subType() const override;
809
829 QString stampIconName() const;
830
836 void setStampIconName(const QString &name);
837
843 void setStampCustomImage(const QImage &image);
844
845private:
846 explicit StampAnnotation(const QDomNode &node);
847 explicit StampAnnotation(StampAnnotationPrivate &dd);
848 void store(QDomNode &parentNode, QDomDocument &document) const override;
849 Q_DECLARE_PRIVATE(StampAnnotation)
850 Q_DISABLE_COPY(StampAnnotation)
851};
852
858class POPPLER_QT5_EXPORT InkAnnotation : public Annotation
859{
860 friend class AnnotationUtils;
861 friend class AnnotationPrivate;
862
863public:
864 InkAnnotation();
865 ~InkAnnotation() override;
866 SubType subType() const override;
867
868 QList<QLinkedList<QPointF>> inkPaths() const;
869 void setInkPaths(const QList<QLinkedList<QPointF>> &paths);
870
871private:
872 explicit InkAnnotation(const QDomNode &node);
873 void store(QDomNode &parentNode, QDomDocument &document) const override;
874 explicit InkAnnotation(InkAnnotationPrivate &dd);
875 Q_DECLARE_PRIVATE(InkAnnotation)
876 Q_DISABLE_COPY(InkAnnotation)
877};
878
879class POPPLER_QT5_EXPORT LinkAnnotation : public Annotation
880{
881 friend class AnnotationUtils;
882 friend class AnnotationPrivate;
883
884public:
885 ~LinkAnnotation() override;
886 SubType subType() const override;
887
888 // local enums
889 enum HighlightMode
890 {
891 None,
892 Invert,
893 Outline,
894 Push
895 };
896
899 void setLinkDestination(Link *link);
900
901 HighlightMode linkHighlightMode() const;
902 void setLinkHighlightMode(HighlightMode mode);
903
904 QPointF linkRegionPoint(int id) const;
905 // TODO Next ABI break, remove ref from point
906 void setLinkRegionPoint(int id, const QPointF &point);
907
908private:
909 LinkAnnotation();
910 explicit LinkAnnotation(const QDomNode &node);
911 explicit LinkAnnotation(LinkAnnotationPrivate &dd);
912 void store(QDomNode &parentNode, QDomDocument &document) const override;
913 Q_DECLARE_PRIVATE(LinkAnnotation)
914 Q_DISABLE_COPY(LinkAnnotation)
915};
916
922class POPPLER_QT5_EXPORT CaretAnnotation : public Annotation
923{
924 friend class AnnotationUtils;
925 friend class AnnotationPrivate;
926
927public:
928 CaretAnnotation();
929 ~CaretAnnotation() override;
930 SubType subType() const override;
931
936 {
937 None,
938 P
939 };
940
941 CaretSymbol caretSymbol() const;
942 void setCaretSymbol(CaretSymbol symbol);
943
944private:
945 explicit CaretAnnotation(const QDomNode &node);
946 explicit CaretAnnotation(CaretAnnotationPrivate &dd);
947 void store(QDomNode &parentNode, QDomDocument &document) const override;
948 Q_DECLARE_PRIVATE(CaretAnnotation)
949 Q_DISABLE_COPY(CaretAnnotation)
950};
951
959class POPPLER_QT5_EXPORT FileAttachmentAnnotation : public Annotation
960{
961 friend class AnnotationPrivate;
962
963public:
964 ~FileAttachmentAnnotation() override;
965 SubType subType() const override;
966
970 QString fileIconName() const;
974 void setFileIconName(const QString &icon);
975
986
987private:
988 FileAttachmentAnnotation();
989 explicit FileAttachmentAnnotation(const QDomNode &node);
990 explicit FileAttachmentAnnotation(FileAttachmentAnnotationPrivate &dd);
991 void store(QDomNode &parentNode, QDomDocument &document) const override;
992 Q_DECLARE_PRIVATE(FileAttachmentAnnotation)
993 Q_DISABLE_COPY(FileAttachmentAnnotation)
994};
995
1003class POPPLER_QT5_EXPORT SoundAnnotation : public Annotation
1004{
1005 friend class AnnotationPrivate;
1006
1007public:
1008 ~SoundAnnotation() override;
1009 SubType subType() const override;
1010
1014 QString soundIconName() const;
1018 void setSoundIconName(const QString &icon);
1019
1030
1031private:
1032 SoundAnnotation();
1033 explicit SoundAnnotation(const QDomNode &node);
1034 explicit SoundAnnotation(SoundAnnotationPrivate &dd);
1035 void store(QDomNode &parentNode, QDomDocument &document) const override;
1036 Q_DECLARE_PRIVATE(SoundAnnotation)
1037 Q_DISABLE_COPY(SoundAnnotation)
1038};
1039
1047class POPPLER_QT5_EXPORT MovieAnnotation : public Annotation
1048{
1049 friend class AnnotationPrivate;
1050
1051public:
1052 ~MovieAnnotation() override;
1053 SubType subType() const override;
1054
1065
1069 QString movieTitle() const;
1073 void setMovieTitle(const QString &title);
1074
1075private:
1076 MovieAnnotation();
1077 explicit MovieAnnotation(const QDomNode &node);
1078 explicit MovieAnnotation(MovieAnnotationPrivate &dd);
1079 void store(QDomNode &parentNode, QDomDocument &document) const override;
1080 Q_DECLARE_PRIVATE(MovieAnnotation)
1081 Q_DISABLE_COPY(MovieAnnotation)
1082};
1083
1091class POPPLER_QT5_EXPORT ScreenAnnotation : public Annotation
1092{
1093 friend class AnnotationPrivate;
1094
1095public:
1096 ~ScreenAnnotation() override;
1097
1098 SubType subType() const override;
1099
1103 LinkRendition *action() const;
1104
1110 void setAction(LinkRendition *action);
1111
1115 QString screenTitle() const;
1116
1120 void setScreenTitle(const QString &title);
1121
1129
1130private:
1131 ScreenAnnotation();
1132 explicit ScreenAnnotation(ScreenAnnotationPrivate &dd);
1133 void store(QDomNode &parentNode, QDomDocument &document) const override; // stub
1134 Q_DECLARE_PRIVATE(ScreenAnnotation)
1135 Q_DISABLE_COPY(ScreenAnnotation)
1136};
1137
1148class POPPLER_QT5_EXPORT WidgetAnnotation : public Annotation
1149{
1150 friend class AnnotationPrivate;
1151
1152public:
1153 ~WidgetAnnotation() override;
1154
1155 SubType subType() const override;
1156
1164
1165private:
1166 WidgetAnnotation();
1167 explicit WidgetAnnotation(WidgetAnnotationPrivate &dd);
1168 void store(QDomNode &parentNode, QDomDocument &document) const override; // stub
1169 Q_DECLARE_PRIVATE(WidgetAnnotation)
1170 Q_DISABLE_COPY(WidgetAnnotation)
1171};
1172
1180class POPPLER_QT5_EXPORT RichMediaAnnotation : public Annotation
1181{
1182 friend class AnnotationPrivate;
1183
1184public:
1185 ~RichMediaAnnotation() override;
1186
1187 SubType subType() const override;
1188
1197 class POPPLER_QT5_EXPORT Params
1198 {
1199 friend class AnnotationPrivate;
1200
1201 public:
1202 Params();
1203 ~Params();
1204
1208 QString flashVars() const;
1209
1210 private:
1211 void setFlashVars(const QString &flashVars);
1212
1213 class Private;
1214 QScopedPointer<Private> d;
1215 };
1216
1224 class POPPLER_QT5_EXPORT Instance
1225 {
1226 friend class AnnotationPrivate;
1227
1228 public:
1239
1240 Instance();
1241 ~Instance();
1242
1246 Type type() const;
1247
1252
1253 private:
1254 void setType(Type type);
1255 void setParams(RichMediaAnnotation::Params *params);
1256
1257 class Private;
1258 QScopedPointer<Private> d;
1259 };
1260
1267 class POPPLER_QT5_EXPORT Configuration
1268 {
1269 friend class AnnotationPrivate;
1270
1271 public:
1282
1283 Configuration();
1285
1289 Type type() const;
1290
1294 QString name() const;
1295
1299 QList<RichMediaAnnotation::Instance *> instances() const;
1300
1301 private:
1302 void setType(Type type);
1303 void setName(const QString &name);
1304 void setInstances(const QList<RichMediaAnnotation::Instance *> &instances);
1305
1306 class Private;
1307 QScopedPointer<Private> d;
1308 };
1309
1317 class POPPLER_QT5_EXPORT Asset
1318 {
1319 friend class AnnotationPrivate;
1320
1321 public:
1322 Asset();
1323 ~Asset();
1324
1328 QString name() const;
1329
1334
1335 private:
1336 void setName(const QString &name);
1337 void setEmbeddedFile(EmbeddedFile *embeddedFile);
1338
1339 class Private;
1340 QScopedPointer<Private> d;
1341 };
1342
1349 class POPPLER_QT5_EXPORT Content
1350 {
1351 friend class AnnotationPrivate;
1352
1353 public:
1354 Content();
1355 ~Content();
1356
1360 QList<RichMediaAnnotation::Configuration *> configurations() const;
1361
1365 QList<RichMediaAnnotation::Asset *> assets() const;
1366
1367 private:
1368 void setConfigurations(const QList<RichMediaAnnotation::Configuration *> &configurations);
1369 void setAssets(const QList<RichMediaAnnotation::Asset *> &assets);
1370
1371 class Private;
1372 QScopedPointer<Private> d;
1373 };
1374
1381 class POPPLER_QT5_EXPORT Activation
1382 {
1383 friend class AnnotationPrivate;
1384
1385 public:
1395
1396 Activation();
1397 ~Activation();
1398
1403
1404 private:
1405 void setCondition(Condition condition);
1406
1407 class Private;
1408 QScopedPointer<Private> d;
1409 };
1410
1417 class POPPLER_QT5_EXPORT Deactivation
1418 {
1419 friend class AnnotationPrivate;
1420
1421 public:
1431
1432 Deactivation();
1433 ~Deactivation();
1434
1439
1440 private:
1441 void setCondition(Condition condition);
1442
1443 class Private;
1444 QScopedPointer<Private> d;
1445 };
1446
1453 class POPPLER_QT5_EXPORT Settings
1454 {
1455 friend class AnnotationPrivate;
1456
1457 public:
1458 Settings();
1459 ~Settings();
1460
1465
1470
1471 private:
1472 void setActivation(RichMediaAnnotation::Activation *activation);
1473 void setDeactivation(RichMediaAnnotation::Deactivation *deactivation);
1474
1475 class Private;
1476 QScopedPointer<Private> d;
1477 };
1478
1483
1488
1489private:
1490 void setSettings(RichMediaAnnotation::Settings *settings);
1491 void setContent(RichMediaAnnotation::Content *content);
1492
1493 RichMediaAnnotation();
1494 explicit RichMediaAnnotation(const QDomNode &node);
1495 explicit RichMediaAnnotation(RichMediaAnnotationPrivate &dd);
1496 void store(QDomNode &parentNode, QDomDocument &document) const override;
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:118
Helper class for (recursive) Annotation retrieval/storage.
Definition poppler-annotation.h:82
static Annotation * createAnnotation(const QDomElement &annElement)
Restore an Annotation (with revisions if needed) from the DOM element annElement.
static void storeAnnotation(const Annotation *ann, QDomElement &annElement, QDomDocument &document)
Save the Annotation ann as a child of annElement taking care of saving all revisions if ann has any.
static QDomElement findChildElement(const QDomNode &parentNode, const QString &name)
Returns an element called name from the direct children of parentNode or a null element if not found.
Container class for Annotation pop-up window information.
Definition poppler-annotation.h:400
Container class for Annotation style information.
Definition poppler-annotation.h:353
Annotation class holding properties shared by all annotations.
Definition poppler-annotation.h:204
RevType revisionType() const
std::unique_ptr< AnnotationAppearance > annotationAppearance() const
Returns the current appearance stream of this annotation.
SubType
Annotation subclasses.
Definition poppler-annotation.h:218
@ AHighlight
HighlightAnnotation.
Definition poppler-annotation.h:222
@ AWidget
WidgetAnnotation.
Definition poppler-annotation.h:231
@ ACaret
CaretAnnotation.
Definition poppler-annotation.h:226
@ AStamp
StampAnnotation.
Definition poppler-annotation.h:223
@ AFileAttachment
FileAttachmentAnnotation.
Definition poppler-annotation.h:227
@ AMovie
MovieAnnotation.
Definition poppler-annotation.h:229
@ ASound
SoundAnnotation.
Definition poppler-annotation.h:228
@ ARichMedia
RichMediaAnnotation.
Definition poppler-annotation.h:232
@ AText
TextAnnotation.
Definition poppler-annotation.h:219
@ AInk
InkAnnotation.
Definition poppler-annotation.h:224
@ ALink
LinkAnnotation.
Definition poppler-annotation.h:225
@ AScreen
ScreenAnnotation.
Definition poppler-annotation.h:230
@ AGeom
GeomAnnotation.
Definition poppler-annotation.h:221
@ ALine
LineAnnotation.
Definition poppler-annotation.h:220
int flags() const
Returns this annotation's flags.
RevScope revisionScope() const
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.
Flag
Annotation flags.
Definition poppler-annotation.h:245
@ FixedRotation
Do not rotate the annotation according to page orientation and rendering rotation.
Definition poppler-annotation.h:248
@ Hidden
Do not display or print the annotation.
Definition poppler-annotation.h:246
@ DenyPrint
Do not print the annotation.
Definition poppler-annotation.h:249
Popup popup() const
QList< Annotation * > revisions() const
Returns the revisions of this annotation.
QString author() const
Returns the author of the annotation.
void setUniqueName(const QString &uniqueName)
Sets a new unique name for the annotation.
virtual ~Annotation()
Destructor.
void setFlags(int flags)
Sets this annotation's flags.
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:482
@ MouseReleasedAction
Performed when the mouse button is released inside the annotation's active area.
Definition poppler-annotation.h:486
@ FocusInAction
Performed when the annotation receives the input focus.
Definition poppler-annotation.h:487
@ PageOpeningAction
Performed when the page containing the annotation is opened.
Definition poppler-annotation.h:489
@ MousePressedAction
Performed when the mouse button is pressed inside the annotation's active area.
Definition poppler-annotation.h:485
@ FocusOutAction
Performed when the annotation loses the input focus.
Definition poppler-annotation.h:488
@ PageInvisibleAction
Performed when the page containing the annotation becomes invisible.
Definition poppler-annotation.h:492
@ PageClosingAction
Performed when the page containing the annotation is closed.
Definition poppler-annotation.h:490
@ CursorLeavingAction
Performed when the cursor exists the annotation's active area.
Definition poppler-annotation.h:484
@ PageVisibleAction
Performed when the page containing the annotation becomes visible.
Definition poppler-annotation.h:491
@ CursorEnteringAction
Performed when the cursor enters the annotation's active area.
Definition poppler-annotation.h:483
virtual SubType subType() const =0
The type of the annotation.
void setStyle(const Style &style)
Style style() const
Caret annotation.
Definition poppler-annotation.h:923
SubType subType() const override
The type of the annotation.
CaretSymbol
The symbols for the caret annotation.
Definition poppler-annotation.h:936
Container class for an embedded file with a PDF document.
Definition poppler-qt5.h:372
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:696
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:745
@ Squiggly
jagged or squiggly underline
Definition poppler-annotation.h:747
@ Underline
straight line underline
Definition poppler-annotation.h:748
@ StrikeOut
straight line through-line
Definition poppler-annotation.h:749
@ Highlight
highlighter pen style annotation
Definition poppler-annotation.h:746
SubType subType() const override
The type of the annotation.
LineType
Definition poppler-annotation.h:620
LineType lineType() const
LineAnnotation(LineType type)
SubType subType() const override
The type of the annotation.
Link * linkDestination() const
SubType subType() const override
The type of the annotation.
Rendition: Rendition link.
Definition poppler-link.h:482
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-qt5.h:2569
A page in a document.
Definition poppler-qt5.h:462
The activation object of the RichMediaAnnotation::Settings object.
Definition poppler-annotation.h:1382
Condition
Describes the condition for activating the rich media.
Definition poppler-annotation.h:1390
@ PageVisible
Activate when page becomes visible.
Definition poppler-annotation.h:1392
@ PageOpened
Activate when page is opened.
Definition poppler-annotation.h:1391
@ UserAction
Activate when user interacts with the annotation.
Definition poppler-annotation.h:1393
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:1268
Type
Describes the media type of the configuration.
Definition poppler-annotation.h:1276
@ Type3D
A 3D media file.
Definition poppler-annotation.h:1277
@ TypeVideo
A video media file.
Definition poppler-annotation.h:1280
@ TypeSound
A sound media file.
Definition poppler-annotation.h:1279
@ TypeFlash
A Flash media file.
Definition poppler-annotation.h:1278
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:1350
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:1418
Condition
Describes the condition for deactivating the rich media.
Definition poppler-annotation.h:1426
@ PageClosed
Deactivate when page is closed.
Definition poppler-annotation.h:1427
@ UserAction
Deactivate when user interacts with the annotation.
Definition poppler-annotation.h:1429
@ PageInvisible
Deactivate when page becomes invisible.
Definition poppler-annotation.h:1428
Condition condition() const
Returns the deactivation condition.
The instance object of a RichMediaAnnotation::Configuration object.
Definition poppler-annotation.h:1225
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:1233
@ TypeVideo
A video media file.
Definition poppler-annotation.h:1237
@ TypeFlash
A Flash media file.
Definition poppler-annotation.h:1235
@ TypeSound
A sound media file.
Definition poppler-annotation.h:1236
@ Type3D
A 3D media file.
Definition poppler-annotation.h:1234
Type type() const
Returns the media type of the instance.
The params object of a RichMediaAnnotation::Instance object.
Definition poppler-annotation.h:1198
QString flashVars() const
Returns the parameters for the flash player.
The settings object of a RichMediaAnnotation.
Definition poppler-annotation.h:1454
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.
Link * additionalAction(AdditionalActionType type) const
Returns the additional action of the given type fo 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.
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-qt5.h:2493
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.
void setCalloutPoints(const QVector< QPointF > &points)
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.
QVector< QPointF > calloutPoints() const
void setTextColor(const QColor &color)
SubType subType() const override
The type of the annotation.
Link * additionalAction(AdditionalActionType type) const
Returns the additional action of the given type fo the annotation or 0 if no action has been defined.
The Poppler Qt5 binding.
Definition poppler-annotation.h:51
Structure corresponding to a QuadPoints array.
Definition poppler-annotation.h:758