Poppler Qt5 24.06.0
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 * Adapting code from
15 * Copyright (C) 2004 by Enrico Ros <eros.kde@email.it>
16 *
17 * This program is free software; you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License as published by
19 * the Free Software Foundation; either version 2, or (at your option)
20 * any later version.
21 *
22 * This program is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU General Public License for more details.
26 *
27 * You should have received a copy of the GNU General Public License
28 * along with this program; if not, write to the Free Software
29 * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
30 */
31
32#ifndef _POPPLER_ANNOTATION_H_
33#define _POPPLER_ANNOTATION_H_
34
35#include <QtCore/QDateTime>
36#include <QtCore/QSharedDataPointer>
37#include <QtCore/QLinkedList>
38#include <QtCore/QList>
39#include <QtCore/QPointF>
40#include <QtCore/QRectF>
41#include <QtCore/QScopedPointer>
42#include <QtCore/QVector>
43#include <QtGui/QColor>
44#include <QtGui/QFont>
45#include <QtXml/QDomDocument>
46#include "poppler-export.h"
47
48#include <memory>
49
50namespace Poppler {
51
52class Annotation;
53class AnnotationPrivate;
54class AnnotationAppearancePrivate;
55class TextAnnotationPrivate;
56class LineAnnotationPrivate;
57class GeomAnnotationPrivate;
58class HighlightAnnotationPrivate;
59class StampAnnotationPrivate;
60class InkAnnotationPrivate;
61class LinkAnnotationPrivate;
62class CaretAnnotationPrivate;
63class FileAttachmentAnnotationPrivate;
64class SoundAnnotationPrivate;
65class MovieAnnotationPrivate;
66class ScreenAnnotationPrivate;
67class WidgetAnnotationPrivate;
68class RichMediaAnnotationPrivate;
69class EmbeddedFile;
70class Link;
71class SoundObject;
72class MovieObject;
73class LinkRendition;
74class Page;
75
80class POPPLER_QT5_EXPORT AnnotationUtils
81{
82public:
89 Q_DECL_DEPRECATED static Annotation *createAnnotation(const QDomElement &annElement);
90
95 Q_DECL_DEPRECATED static void storeAnnotation(const Annotation *ann, QDomElement &annElement, QDomDocument &document);
96
101 Q_DECL_DEPRECATED static QDomElement findChildElement(const QDomNode &parentNode, const QString &name);
102};
103
116class POPPLER_QT5_EXPORT AnnotationAppearance
117{
118 friend class Annotation;
119
120public:
121 explicit AnnotationAppearance(AnnotationAppearancePrivate *annotationAppearancePrivate);
123
124private:
125 AnnotationAppearancePrivate *d;
126 Q_DISABLE_COPY(AnnotationAppearance)
127};
128
202class POPPLER_QT5_EXPORT Annotation
203{
204 friend class AnnotationUtils;
205 friend class LinkMovie;
206 friend class LinkRendition;
207
208public:
209 // enum definitions
215 // WARNING!!! oKular uses that very same values so if you change them notify the author!
217 {
218 AText = 1,
219 ALine = 2,
220 AGeom = 3,
221 AHighlight = 4,
222 AStamp = 5,
223 AInk = 6,
224 ALink = 7,
225 ACaret = 8,
226 AFileAttachment = 9,
227 ASound = 10,
228 AMovie = 11,
229 AScreen = 12,
230 AWidget = 13,
231 ARichMedia = 14,
232 A_BASE = 0
233 };
234
242 // NOTE: Only flags that are known to work are documented
243 enum Flag
244 {
245 Hidden = 1,
246 FixedSize = 2,
247 FixedRotation = 4,
248 DenyPrint = 8,
249 DenyWrite = 16,
250 DenyDelete = 32,
251 ToggleHidingOnMouse = 64,
252 External = 128
253 };
254
255 enum LineStyle
256 {
257 Solid = 1,
258 Dashed = 2,
259 Beveled = 4,
260 Inset = 8,
261 Underline = 16
262 };
263 enum LineEffect
264 {
265 NoEffect = 1,
266 Cloudy = 2
267 };
268 enum RevScope
269 {
270 Root = 0 ,
271 Reply = 1,
272 Group = 2,
273 Delete = 4
274 };
275 enum RevType
276 {
277 None = 1,
278 Marked = 2,
279 Unmarked = 4,
280 Accepted = 8,
281 Rejected = 16,
282 Cancelled = 32,
283 Completed = 64
284 };
285
289 QString author() const;
293 void setAuthor(const QString &author);
294
295 QString contents() const;
296 void setContents(const QString &contents);
297
301 QString uniqueName() const;
307 void setUniqueName(const QString &uniqueName);
308
309 QDateTime modificationDate() const;
310 void setModificationDate(const QDateTime &date);
311
312 QDateTime creationDate() const;
313 void setCreationDate(const QDateTime &date);
314
320 int flags() const;
326 void setFlags(int flags);
327
333 QRectF boundary() const;
344 void setBoundary(const QRectF &boundary);
345
351 class POPPLER_QT5_EXPORT Style
352 {
353 public:
354 Style();
355 Style(const Style &other);
356 Style &operator=(const Style &other);
357 ~Style();
358
359 // appearance properties
360 QColor color() const; // black
361 void setColor(const QColor &color);
362 double opacity() const; // 1.0
363 void setOpacity(double opacity);
364
365 // pen properties
366 double width() const; // 1.0
367 void setWidth(double width);
368 LineStyle lineStyle() const; // LineStyle::Solid
369 void setLineStyle(LineStyle style);
370 double xCorners() const; // 0.0
371 void setXCorners(double radius);
372 double yCorners() const; // 0.0
373 void setYCorners(double radius);
374 const QVector<double> &dashArray() const; // [ 3 ]
375 void setDashArray(const QVector<double> &array);
376
377 // pen effects
378 LineEffect lineEffect() const; // LineEffect::NoEffect
379 void setLineEffect(LineEffect effect);
380 double effectIntensity() const; // 1.0
381 void setEffectIntensity(double intens);
382
383 private:
384 class Private;
385 QSharedDataPointer<Private> d;
386 };
387
389 Style style() const;
391 void setStyle(const Style &style);
392
398 class POPPLER_QT5_EXPORT Popup
399 {
400 public:
401 Popup();
402 Popup(const Popup &other);
403 Popup &operator=(const Popup &other);
404 ~Popup();
405
406 // window state (Hidden, FixedRotation, Deny* flags allowed)
407 int flags() const; // -1 (never initialized) -> 0 (if inited and shown)
408 void setFlags(int flags);
409
410 // geometric properties
411 QRectF geometry() const; // no default
412 void setGeometry(const QRectF &geom);
413
414 // window contents/override properties
415 QString title() const; // '' text in the titlebar (overrides author)
416 void setTitle(const QString &title);
417 QString summary() const; // '' short description (displayed if not empty)
418 void setSummary(const QString &summary);
419 QString text() const; // '' text for the window (overrides annot->contents)
420 void setText(const QString &text);
421
422 private:
423 class Private;
424 QSharedDataPointer<Private> d;
425 };
426
428 Popup popup() const;
430 void setPopup(const Popup &popup);
431
433 RevScope revisionScope() const; // Root
434
436 RevType revisionType() const; // None
437
446 QList<Annotation *> revisions() const;
447
451 virtual SubType subType() const = 0;
452
458 std::unique_ptr<AnnotationAppearance> annotationAppearance() const;
459
465 void setAnnotationAppearance(const AnnotationAppearance &annotationAppearance);
466
470 virtual ~Annotation();
471
493
494protected:
496 explicit Annotation(AnnotationPrivate &dd);
497 Annotation(AnnotationPrivate &dd, const QDomNode &annNode);
498 void storeBaseAnnotationProperties(QDomNode &annNode, QDomDocument &document) const;
499 Q_DECLARE_PRIVATE(Annotation)
500 QExplicitlySharedDataPointer<AnnotationPrivate> d_ptr;
502
503private:
504 virtual void store(QDomNode &parentNode, QDomDocument &document) const = 0;
505 Q_DISABLE_COPY(Annotation)
506};
507
514class POPPLER_QT5_EXPORT TextAnnotation : public Annotation
515{
516 friend class AnnotationUtils;
517 friend class AnnotationPrivate;
518
519public:
520 // local enums
521 enum TextType
522 {
523 Linked,
524 InPlace
525 };
526 enum InplaceIntent
527 {
528 Unknown,
529 Callout,
530 TypeWriter
531 };
532
533 explicit TextAnnotation(TextType type);
534 ~TextAnnotation() override;
535 SubType subType() const override;
536
540 TextType textType() const;
541
554 QString textIcon() const;
555
561 void setTextIcon(const QString &icon);
562
563 QFont textFont() const;
564 void setTextFont(const QFont &font);
566 QColor textColor() const;
568 void setTextColor(const QColor &color);
569
570 // 0:left, 1:center, 2:right
571 int inplaceAlign() const;
572 void setInplaceAlign(int align);
573
574 QPointF calloutPoint(int id) const;
576 QVector<QPointF> calloutPoints() const;
578 void setCalloutPoints(const QVector<QPointF> &points);
579
580 InplaceIntent inplaceIntent() const;
581 void setInplaceIntent(InplaceIntent intent);
582
583private:
584 explicit TextAnnotation(const QDomNode &node);
585 explicit TextAnnotation(TextAnnotationPrivate &dd);
586 void store(QDomNode &parentNode, QDomDocument &document) const override;
587 void setTextType(TextType type);
588 Q_DECLARE_PRIVATE(TextAnnotation)
589 Q_DISABLE_COPY(TextAnnotation)
590};
591
597class POPPLER_QT5_EXPORT LineAnnotation : public Annotation
598{
599 friend class AnnotationUtils;
600 friend class AnnotationPrivate;
601
602public:
603 // local enums
606 {
607 StraightLine,
608 Polyline
609 };
610 enum TermStyle
611 {
612 Square,
613 Circle,
614 Diamond,
615 OpenArrow,
616 ClosedArrow,
617 None,
618 Butt,
619 ROpenArrow,
620 RClosedArrow,
621 Slash
622 };
623 enum LineIntent
624 {
625 Unknown,
626 Arrow,
627 Dimension,
628 PolygonCloud
629 };
630
632 explicit LineAnnotation(LineType type);
633 ~LineAnnotation() override;
634 SubType subType() const override;
635
638
639 QLinkedList<QPointF> linePoints() const;
640 void setLinePoints(const QLinkedList<QPointF> &points);
641
642 TermStyle lineStartStyle() const;
643 void setLineStartStyle(TermStyle style);
644
645 TermStyle lineEndStyle() const;
646 void setLineEndStyle(TermStyle style);
647
648 bool isLineClosed() const;
649 void setLineClosed(bool closed);
650
651 QColor lineInnerColor() const;
652 void setLineInnerColor(const QColor &color);
653
654 double lineLeadingForwardPoint() const;
655 void setLineLeadingForwardPoint(double point);
656
657 double lineLeadingBackPoint() const;
658 void setLineLeadingBackPoint(double point);
659
660 bool lineShowCaption() const;
661 void setLineShowCaption(bool show);
662
663 LineIntent lineIntent() const;
664 void setLineIntent(LineIntent intent);
665
666private:
667 explicit LineAnnotation(const QDomNode &node);
668 explicit LineAnnotation(LineAnnotationPrivate &dd);
669 void store(QDomNode &parentNode, QDomDocument &document) const override;
670 void setLineType(LineType type);
671 Q_DECLARE_PRIVATE(LineAnnotation)
672 Q_DISABLE_COPY(LineAnnotation)
673};
674
681class POPPLER_QT5_EXPORT GeomAnnotation : public Annotation
682{
683 friend class AnnotationUtils;
684 friend class AnnotationPrivate;
685
686public:
688 ~GeomAnnotation() override;
689 SubType subType() const override;
690
691 // common enums
692 enum GeomType
693 {
694 InscribedSquare,
695 InscribedCircle
696 };
697
698 GeomType geomType() const;
699 void setGeomType(GeomType type);
700
701 QColor geomInnerColor() const;
702 void setGeomInnerColor(const QColor &color);
703
704private:
705 explicit GeomAnnotation(const QDomNode &node);
706 explicit GeomAnnotation(GeomAnnotationPrivate &dd);
707 void store(QDomNode &parentNode, QDomDocument &document) const override;
708 Q_DECLARE_PRIVATE(GeomAnnotation)
709 Q_DISABLE_COPY(GeomAnnotation)
710};
711
717class POPPLER_QT5_EXPORT HighlightAnnotation : public Annotation
718{
719 friend class AnnotationUtils;
720 friend class AnnotationPrivate;
721
722public:
724 ~HighlightAnnotation() override;
725 SubType subType() const override;
726
737
743 struct Quad
744 {
745 QPointF points[4]; // 8 valid coords
746 bool capStart; // false (vtx 1-4) [K]
747 bool capEnd; // false (vtx 2-3) [K]
748 double feather; // 0.1 (in range 0..1) [K]
749 };
750
756
762
766 QList<Quad> highlightQuads() const;
767
771 void setHighlightQuads(const QList<Quad> &quads);
772
773private:
774 explicit HighlightAnnotation(const QDomNode &node);
775 explicit HighlightAnnotation(HighlightAnnotationPrivate &dd);
776 void store(QDomNode &parentNode, QDomDocument &document) const override;
777 Q_DECLARE_PRIVATE(HighlightAnnotation)
778 Q_DISABLE_COPY(HighlightAnnotation)
779};
780
786class POPPLER_QT5_EXPORT StampAnnotation : public Annotation
787{
788 friend class AnnotationUtils;
789 friend class AnnotationPrivate;
790
791public:
793 ~StampAnnotation() override;
794 SubType subType() const override;
795
815 QString stampIconName() const;
816
822 void setStampIconName(const QString &name);
823
829 void setStampCustomImage(const QImage &image);
830
831private:
832 explicit StampAnnotation(const QDomNode &node);
833 explicit StampAnnotation(StampAnnotationPrivate &dd);
834 void store(QDomNode &parentNode, QDomDocument &document) const override;
835 Q_DECLARE_PRIVATE(StampAnnotation)
836 Q_DISABLE_COPY(StampAnnotation)
837};
838
844class POPPLER_QT5_EXPORT InkAnnotation : public Annotation
845{
846 friend class AnnotationUtils;
847 friend class AnnotationPrivate;
848
849public:
851 ~InkAnnotation() override;
852 SubType subType() const override;
853
854 QList<QLinkedList<QPointF>> inkPaths() const;
855 void setInkPaths(const QList<QLinkedList<QPointF>> &paths);
856
857private:
858 explicit InkAnnotation(const QDomNode &node);
859 void store(QDomNode &parentNode, QDomDocument &document) const override;
860 explicit InkAnnotation(InkAnnotationPrivate &dd);
861 Q_DECLARE_PRIVATE(InkAnnotation)
862 Q_DISABLE_COPY(InkAnnotation)
863};
864
865class POPPLER_QT5_EXPORT LinkAnnotation : public Annotation
866{
867 friend class AnnotationUtils;
868 friend class AnnotationPrivate;
869
870public:
871 ~LinkAnnotation() override;
872 SubType subType() const override;
873
874 // local enums
875 enum HighlightMode
876 {
877 None,
878 Invert,
879 Outline,
880 Push
881 };
882
885 void setLinkDestination(Link *link);
886
887 HighlightMode linkHighlightMode() const;
888 void setLinkHighlightMode(HighlightMode mode);
889
890 QPointF linkRegionPoint(int id) const;
891 // TODO Next ABI break, remove ref from point
892 void setLinkRegionPoint(int id, const QPointF &point);
893
894private:
896 explicit LinkAnnotation(const QDomNode &node);
897 explicit LinkAnnotation(LinkAnnotationPrivate &dd);
898 void store(QDomNode &parentNode, QDomDocument &document) const override;
899 Q_DECLARE_PRIVATE(LinkAnnotation)
900 Q_DISABLE_COPY(LinkAnnotation)
901};
902
908class POPPLER_QT5_EXPORT CaretAnnotation : public Annotation
909{
910 friend class AnnotationUtils;
911 friend class AnnotationPrivate;
912
913public:
915 ~CaretAnnotation() override;
916 SubType subType() const override;
917
922 {
923 None,
924 P
925 };
926
927 CaretSymbol caretSymbol() const;
928 void setCaretSymbol(CaretSymbol symbol);
929
930private:
931 explicit CaretAnnotation(const QDomNode &node);
932 explicit CaretAnnotation(CaretAnnotationPrivate &dd);
933 void store(QDomNode &parentNode, QDomDocument &document) const override;
934 Q_DECLARE_PRIVATE(CaretAnnotation)
935 Q_DISABLE_COPY(CaretAnnotation)
936};
937
945class POPPLER_QT5_EXPORT FileAttachmentAnnotation : public Annotation
946{
947 friend class AnnotationPrivate;
948
949public:
950 ~FileAttachmentAnnotation() override;
951 SubType subType() const override;
952
956 QString fileIconName() const;
960 void setFileIconName(const QString &icon);
961
972
973private:
975 explicit FileAttachmentAnnotation(const QDomNode &node);
976 explicit FileAttachmentAnnotation(FileAttachmentAnnotationPrivate &dd);
977 void store(QDomNode &parentNode, QDomDocument &document) const override;
978 Q_DECLARE_PRIVATE(FileAttachmentAnnotation)
979 Q_DISABLE_COPY(FileAttachmentAnnotation)
980};
981
989class POPPLER_QT5_EXPORT SoundAnnotation : public Annotation
990{
991 friend class AnnotationPrivate;
992
993public:
994 ~SoundAnnotation() override;
995 SubType subType() const override;
996
1000 QString soundIconName() const;
1004 void setSoundIconName(const QString &icon);
1005
1016
1017private:
1019 explicit SoundAnnotation(const QDomNode &node);
1020 explicit SoundAnnotation(SoundAnnotationPrivate &dd);
1021 void store(QDomNode &parentNode, QDomDocument &document) const override;
1022 Q_DECLARE_PRIVATE(SoundAnnotation)
1023 Q_DISABLE_COPY(SoundAnnotation)
1024};
1025
1033class POPPLER_QT5_EXPORT MovieAnnotation : public Annotation
1034{
1035 friend class AnnotationPrivate;
1036
1037public:
1038 ~MovieAnnotation() override;
1039 SubType subType() const override;
1040
1050 void setMovie(MovieObject *movie);
1051
1055 QString movieTitle() const;
1059 void setMovieTitle(const QString &title);
1060
1061private:
1063 explicit MovieAnnotation(const QDomNode &node);
1064 explicit MovieAnnotation(MovieAnnotationPrivate &dd);
1065 void store(QDomNode &parentNode, QDomDocument &document) const override;
1066 Q_DECLARE_PRIVATE(MovieAnnotation)
1067 Q_DISABLE_COPY(MovieAnnotation)
1068};
1069
1077class POPPLER_QT5_EXPORT ScreenAnnotation : public Annotation
1078{
1079 friend class AnnotationPrivate;
1080
1081public:
1082 ~ScreenAnnotation() override;
1083
1084 SubType subType() const override;
1085
1090
1097
1101 QString screenTitle() const;
1102
1106 void setScreenTitle(const QString &title);
1107
1115
1116private:
1118 explicit ScreenAnnotation(ScreenAnnotationPrivate &dd);
1119 void store(QDomNode &parentNode, QDomDocument &document) const override; // stub
1120 Q_DECLARE_PRIVATE(ScreenAnnotation)
1121 Q_DISABLE_COPY(ScreenAnnotation)
1122};
1123
1134class POPPLER_QT5_EXPORT WidgetAnnotation : public Annotation
1135{
1136 friend class AnnotationPrivate;
1137
1138public:
1139 ~WidgetAnnotation() override;
1140
1141 SubType subType() const override;
1142
1150
1151private:
1153 explicit WidgetAnnotation(WidgetAnnotationPrivate &dd);
1154 void store(QDomNode &parentNode, QDomDocument &document) const override; // stub
1155 Q_DECLARE_PRIVATE(WidgetAnnotation)
1156 Q_DISABLE_COPY(WidgetAnnotation)
1157};
1158
1166class POPPLER_QT5_EXPORT RichMediaAnnotation : public Annotation
1167{
1168 friend class AnnotationPrivate;
1169
1170public:
1171 ~RichMediaAnnotation() override;
1172
1173 SubType subType() const override;
1174
1183 class POPPLER_QT5_EXPORT Params
1184 {
1185 friend class AnnotationPrivate;
1186
1187 public:
1188 Params();
1189 ~Params();
1190
1194 QString flashVars() const;
1195
1196 private:
1197 void setFlashVars(const QString &flashVars);
1198
1199 class Private;
1200 QScopedPointer<Private> d;
1201 };
1202
1210 class POPPLER_QT5_EXPORT Instance
1211 {
1212 friend class AnnotationPrivate;
1213
1214 public:
1218 enum Type
1219 {
1223 TypeVideo
1225
1226 Instance();
1227 ~Instance();
1228
1232 Type type() const;
1233
1238
1239 private:
1240 void setType(Type type);
1241 void setParams(RichMediaAnnotation::Params *params);
1242
1243 class Private;
1244 QScopedPointer<Private> d;
1245 };
1246
1253 class POPPLER_QT5_EXPORT Configuration
1254 {
1255 friend class AnnotationPrivate;
1256
1257 public:
1261 enum Type
1262 {
1266 TypeVideo
1268
1269 Configuration();
1271
1275 Type type() const;
1276
1280 QString name() const;
1281
1285 QList<RichMediaAnnotation::Instance *> instances() const;
1286
1287 private:
1288 void setType(Type type);
1289 void setName(const QString &name);
1290 void setInstances(const QList<RichMediaAnnotation::Instance *> &instances);
1291
1292 class Private;
1293 QScopedPointer<Private> d;
1294 };
1295
1303 class POPPLER_QT5_EXPORT Asset
1304 {
1305 friend class AnnotationPrivate;
1306
1307 public:
1308 Asset();
1309 ~Asset();
1310
1314 QString name() const;
1315
1320
1321 private:
1322 void setName(const QString &name);
1323 void setEmbeddedFile(EmbeddedFile *embeddedFile);
1324
1325 class Private;
1326 QScopedPointer<Private> d;
1327 };
1328
1335 class POPPLER_QT5_EXPORT Content
1336 {
1337 friend class AnnotationPrivate;
1338
1339 public:
1340 Content();
1341 ~Content();
1342
1346 QList<RichMediaAnnotation::Configuration *> configurations() const;
1347
1351 QList<RichMediaAnnotation::Asset *> assets() const;
1352
1353 private:
1354 void setConfigurations(const QList<RichMediaAnnotation::Configuration *> &configurations);
1355 void setAssets(const QList<RichMediaAnnotation::Asset *> &assets);
1356
1357 class Private;
1358 QScopedPointer<Private> d;
1359 };
1360
1367 class POPPLER_QT5_EXPORT Activation
1368 {
1369 friend class AnnotationPrivate;
1370
1371 public:
1376 {
1379 UserAction
1381
1382 Activation();
1383 ~Activation();
1384
1389
1390 private:
1391 void setCondition(Condition condition);
1392
1393 class Private;
1394 QScopedPointer<Private> d;
1395 };
1396
1403 class POPPLER_QT5_EXPORT Deactivation
1404 {
1405 friend class AnnotationPrivate;
1406
1407 public:
1412 {
1415 UserAction
1417
1418 Deactivation();
1419 ~Deactivation();
1420
1425
1426 private:
1427 void setCondition(Condition condition);
1428
1429 class Private;
1430 QScopedPointer<Private> d;
1431 };
1432
1439 class POPPLER_QT5_EXPORT Settings
1440 {
1441 friend class AnnotationPrivate;
1442
1443 public:
1444 Settings();
1445 ~Settings();
1446
1451
1456
1457 private:
1458 void setActivation(RichMediaAnnotation::Activation *activation);
1459 void setDeactivation(RichMediaAnnotation::Deactivation *deactivation);
1460
1461 class Private;
1462 QScopedPointer<Private> d;
1463 };
1464
1469
1474
1475private:
1476 void setSettings(RichMediaAnnotation::Settings *settings);
1477 void setContent(RichMediaAnnotation::Content *content);
1478
1480 explicit RichMediaAnnotation(const QDomNode &node);
1481 explicit RichMediaAnnotation(RichMediaAnnotationPrivate &dd);
1482 void store(QDomNode &parentNode, QDomDocument &document) const override;
1483 Q_DECLARE_PRIVATE(RichMediaAnnotation)
1484 Q_DISABLE_COPY(RichMediaAnnotation)
1485};
1486
1487}
1488
1489#endif
AnnotationAppearance class wrapping Poppler's AP stream object.
Definition poppler-annotation.h:117
Helper class for (recursive) Annotation retrieval/storage.
Definition poppler-annotation.h:81
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:399
Container class for Annotation style information.
Definition poppler-annotation.h:352
Annotation class holding properties shared by all annotations.
Definition poppler-annotation.h:203
RevType revisionType() const
std::unique_ptr< AnnotationAppearance > annotationAppearance() const
Returns the current appearance stream of this annotation.
SubType
Annotation subclasses.
Definition poppler-annotation.h:217
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:244
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:481
@ MouseReleasedAction
Performed when the mouse button is released inside the annotation's active area.
Definition poppler-annotation.h:485
@ FocusInAction
Performed when the annotation receives the input focus.
Definition poppler-annotation.h:486
@ PageOpeningAction
Performed when the page containing the annotation is opened.
Definition poppler-annotation.h:488
@ MousePressedAction
Performed when the mouse button is pressed inside the annotation's active area.
Definition poppler-annotation.h:484
@ FocusOutAction
Performed when the annotation loses the input focus.
Definition poppler-annotation.h:487
@ PageClosingAction
Performed when the page containing the annotation is closed.
Definition poppler-annotation.h:489
@ CursorLeavingAction
Performed when the cursor exists the annotation's active area.
Definition poppler-annotation.h:483
@ PageVisibleAction
Performed when the page containing the annotation becomes visible.
Definition poppler-annotation.h:490
@ CursorEnteringAction
Performed when the cursor enters the annotation's active area.
Definition poppler-annotation.h:482
virtual SubType subType() const =0
The type of the annotation.
void setStyle(const Style &style)
Style style() const
Caret annotation.
Definition poppler-annotation.h:909
SubType subType() const override
The type of the annotation.
CaretSymbol
The symbols for the caret annotation.
Definition poppler-annotation.h:922
Container class for an embedded file with a PDF document.
Definition poppler-qt5.h:345
File attachment annotation.
Definition poppler-annotation.h:946
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:682
SubType subType() const override
The type of the annotation.
Text highlight annotation.
Definition poppler-annotation.h:718
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:731
@ Squiggly
jagged or squiggly underline
Definition poppler-annotation.h:733
@ Underline
straight line underline
Definition poppler-annotation.h:734
@ Highlight
highlighter pen style annotation
Definition poppler-annotation.h:732
Ink Annotation.
Definition poppler-annotation.h:845
SubType subType() const override
The type of the annotation.
Polygon/polyline annotation.
Definition poppler-annotation.h:598
LineType
Definition poppler-annotation.h:606
LineType lineType() const
LineAnnotation(LineType type)
SubType subType() const override
The type of the annotation.
Definition poppler-annotation.h:866
Link * linkDestination() const
SubType subType() const override
The type of the annotation.
Movie: a movie to be played.
Definition poppler-link.h:593
Rendition: Rendition link.
Definition poppler-link.h:477
Movie annotation.
Definition poppler-annotation.h:1034
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:2501
A page in a document.
Definition poppler-qt5.h:435
The activation object of the RichMediaAnnotation::Settings object.
Definition poppler-annotation.h:1368
Condition
Describes the condition for activating the rich media.
Definition poppler-annotation.h:1376
@ PageVisible
Activate when page becomes visible.
Definition poppler-annotation.h:1378
@ PageOpened
Activate when page is opened.
Definition poppler-annotation.h:1377
Condition condition() const
Returns the activation condition.
The asset object of a RichMediaAnnotation::Content object.
Definition poppler-annotation.h:1304
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:1254
Type
Describes the media type of the configuration.
Definition poppler-annotation.h:1262
@ Type3D
A 3D media file.
Definition poppler-annotation.h:1263
@ TypeSound
A sound media file.
Definition poppler-annotation.h:1265
@ TypeFlash
A Flash media file.
Definition poppler-annotation.h:1264
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:1336
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:1404
Condition
Describes the condition for deactivating the rich media.
Definition poppler-annotation.h:1412
@ PageClosed
Deactivate when page is closed.
Definition poppler-annotation.h:1413
@ PageInvisible
Deactivate when page becomes invisible.
Definition poppler-annotation.h:1414
Condition condition() const
Returns the deactivation condition.
The instance object of a RichMediaAnnotation::Configuration object.
Definition poppler-annotation.h:1211
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:1219
@ TypeFlash
A Flash media file.
Definition poppler-annotation.h:1221
@ TypeSound
A sound media file.
Definition poppler-annotation.h:1222
@ Type3D
A 3D media file.
Definition poppler-annotation.h:1220
Type type() const
Returns the media type of the instance.
The params object of a RichMediaAnnotation::Instance object.
Definition poppler-annotation.h:1184
QString flashVars() const
Returns the parameters for the flash player.
The settings object of a RichMediaAnnotation.
Definition poppler-annotation.h:1440
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:1167
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:1078
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.
Sound annotation.
Definition poppler-annotation.h:990
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:2425
Stamp annotation.
Definition poppler-annotation.h:787
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:515
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)
Widget annotation.
Definition poppler-annotation.h:1135
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:50
Structure corresponding to a QuadPoints array.
Definition poppler-annotation.h:744