Poppler Qt5  21.05.0
poppler-annotation.h
1 /* poppler-annotation.h: qt interface to poppler
2  * Copyright (C) 2006-2008, 2012, 2013, 2018-2020 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  * Adapting code from
14  * Copyright (C) 2004 by Enrico Ros <eros.kde@email.it>
15  *
16  * This program is free software; you can redistribute it and/or modify
17  * it under the terms of the GNU General Public License as published by
18  * the Free Software Foundation; either version 2, or (at your option)
19  * any later version.
20  *
21  * This program is distributed in the hope that it will be useful,
22  * but WITHOUT ANY WARRANTY; without even the implied warranty of
23  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24  * GNU General Public License for more details.
25  *
26  * You should have received a copy of the GNU General Public License
27  * along with this program; if not, write to the Free Software
28  * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
29  */
30 
31 #ifndef _POPPLER_ANNOTATION_H_
32 #define _POPPLER_ANNOTATION_H_
33 
34 #include <QtCore/QDateTime>
35 #include <QtCore/QSharedDataPointer>
36 #include <QtCore/QLinkedList>
37 #include <QtCore/QList>
38 #include <QtCore/QPointF>
39 #include <QtCore/QRectF>
40 #include <QtCore/QScopedPointer>
41 #include <QtCore/QVector>
42 #include <QtGui/QColor>
43 #include <QtGui/QFont>
44 #include <QtXml/QDomDocument>
45 #include "poppler-export.h"
46 
47 namespace Poppler {
48 
49 class Annotation;
50 class AnnotationPrivate;
51 class TextAnnotationPrivate;
52 class LineAnnotationPrivate;
53 class GeomAnnotationPrivate;
54 class HighlightAnnotationPrivate;
55 class StampAnnotationPrivate;
56 class InkAnnotationPrivate;
57 class LinkAnnotationPrivate;
58 class CaretAnnotationPrivate;
59 class FileAttachmentAnnotationPrivate;
60 class SoundAnnotationPrivate;
61 class MovieAnnotationPrivate;
62 class ScreenAnnotationPrivate;
63 class WidgetAnnotationPrivate;
64 class RichMediaAnnotationPrivate;
65 class EmbeddedFile;
66 class Link;
67 class SoundObject;
68 class MovieObject;
69 class LinkRendition;
70 class Page;
71 
76 class POPPLER_QT5_EXPORT AnnotationUtils
77 {
78 public:
85  Q_DECL_DEPRECATED static Annotation *createAnnotation(const QDomElement &annElement);
86 
91  Q_DECL_DEPRECATED static void storeAnnotation(const Annotation *ann, QDomElement &annElement, QDomDocument &document);
92 
97  Q_DECL_DEPRECATED static QDomElement findChildElement(const QDomNode &parentNode, const QString &name);
98 };
99 
173 class POPPLER_QT5_EXPORT Annotation
174 {
175  friend class AnnotationUtils;
176  friend class LinkMovie;
177  friend class LinkRendition;
178 
179 public:
180  // enum definitions
186  // WARNING!!! oKular uses that very same values so if you change them notify the author!
187  enum SubType
188  {
189  AText = 1,
190  ALine = 2,
191  AGeom = 3,
192  AHighlight = 4,
193  AStamp = 5,
194  AInk = 6,
195  ALink = 7,
196  ACaret = 8,
197  AFileAttachment = 9,
198  ASound = 10,
199  AMovie = 11,
200  AScreen = 12,
201  AWidget = 13,
202  ARichMedia = 14,
203  A_BASE = 0
204  };
205 
213  // NOTE: Only flags that are known to work are documented
214  enum Flag
215  {
216  Hidden = 1,
217  FixedSize = 2,
218  FixedRotation = 4,
219  DenyPrint = 8,
220  DenyWrite = 16,
221  DenyDelete = 32,
222  ToggleHidingOnMouse = 64,
223  External = 128
224  };
225 
226  enum LineStyle
227  {
228  Solid = 1,
229  Dashed = 2,
230  Beveled = 4,
231  Inset = 8,
232  Underline = 16
233  };
234  enum LineEffect
235  {
236  NoEffect = 1,
237  Cloudy = 2
238  };
239  enum RevScope
240  {
241  Root = 0 ,
242  Reply = 1,
243  Group = 2,
244  Delete = 4
245  };
246  enum RevType
247  {
248  None = 1,
249  Marked = 2,
250  Unmarked = 4,
251  Accepted = 8,
252  Rejected = 16,
253  Cancelled = 32,
254  Completed = 64
255  };
256 
260  QString author() const;
264  void setAuthor(const QString &author);
265 
266  QString contents() const;
267  void setContents(const QString &contents);
268 
272  QString uniqueName() const;
278  void setUniqueName(const QString &uniqueName);
279 
280  QDateTime modificationDate() const;
281  void setModificationDate(const QDateTime &date);
282 
283  QDateTime creationDate() const;
284  void setCreationDate(const QDateTime &date);
285 
291  int flags() const;
297  void setFlags(int flags);
298 
304  QRectF boundary() const;
315  void setBoundary(const QRectF &boundary);
316 
322  class POPPLER_QT5_EXPORT Style
323  {
324  public:
325  Style();
326  Style(const Style &other);
327  Style &operator=(const Style &other);
328  ~Style();
329 
330  // appearance properties
331  QColor color() const; // black
332  void setColor(const QColor &color);
333  double opacity() const; // 1.0
334  void setOpacity(double opacity);
335 
336  // pen properties
337  double width() const; // 1.0
338  void setWidth(double width);
339  LineStyle lineStyle() const; // LineStyle::Solid
340  void setLineStyle(LineStyle style);
341  double xCorners() const; // 0.0
342  void setXCorners(double radius);
343  double yCorners() const; // 0.0
344  void setYCorners(double radius);
345  const QVector<double> &dashArray() const; // [ 3 ]
346  void setDashArray(const QVector<double> &array);
347 
348  // pen effects
349  LineEffect lineEffect() const; // LineEffect::NoEffect
350  void setLineEffect(LineEffect effect);
351  double effectIntensity() const; // 1.0
352  void setEffectIntensity(double intens);
353 
354  private:
355  class Private;
356  QSharedDataPointer<Private> d;
357  };
358 
360  Style style() const;
362  void setStyle(const Style &style);
363 
369  class POPPLER_QT5_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 
399  Popup popup() const;
401  void setPopup(const Popup &popup);
402 
404  RevScope revisionScope() const; // Root
405 
407  RevType revisionType() const; // None
408 
417  QList<Annotation *> revisions() const;
418 
422  virtual SubType subType() const = 0;
423 
427  virtual ~Annotation();
428 
438  {
448  PageInvisibleAction
449  };
450 
451 protected:
453  Annotation(AnnotationPrivate &dd);
454  Annotation(AnnotationPrivate &dd, const QDomNode &annNode);
455  void storeBaseAnnotationProperties(QDomNode &annNode, QDomDocument &document) const;
456  Q_DECLARE_PRIVATE(Annotation)
457  QExplicitlySharedDataPointer<AnnotationPrivate> d_ptr;
459 
460 private:
461  virtual void store(QDomNode &parentNode, QDomDocument &document) const = 0;
462  Q_DISABLE_COPY(Annotation)
463 };
464 
471 class POPPLER_QT5_EXPORT TextAnnotation : public Annotation
472 {
473  friend class AnnotationUtils;
474  friend class AnnotationPrivate;
475 
476 public:
477  // local enums
478  enum TextType
479  {
480  Linked,
481  InPlace
482  };
483  enum InplaceIntent
484  {
485  Unknown,
486  Callout,
487  TypeWriter
488  };
489 
490  TextAnnotation(TextType type);
491  ~TextAnnotation() override;
492  SubType subType() const override;
493 
497  TextType textType() const;
498 
511  QString textIcon() const;
512 
518  void setTextIcon(const QString &icon);
519 
520  QFont textFont() const;
521  void setTextFont(const QFont &font);
523  QColor textColor() const;
525  void setTextColor(const QColor &color);
526 
527  // 0:left, 1:center, 2:right
528  int inplaceAlign() const;
529  void setInplaceAlign(int align);
530 
531  QPointF calloutPoint(int id) const;
533  QVector<QPointF> calloutPoints() const;
535  void setCalloutPoints(const QVector<QPointF> &points);
536 
537  InplaceIntent inplaceIntent() const;
538  void setInplaceIntent(InplaceIntent intent);
539 
540 private:
541  TextAnnotation(const QDomNode &node);
542  TextAnnotation(TextAnnotationPrivate &dd);
543  void store(QDomNode &parentNode, QDomDocument &document) const override;
544  void setTextType(TextType type);
545  Q_DECLARE_PRIVATE(TextAnnotation)
546  Q_DISABLE_COPY(TextAnnotation)
547 };
548 
554 class POPPLER_QT5_EXPORT LineAnnotation : public Annotation
555 {
556  friend class AnnotationUtils;
557  friend class AnnotationPrivate;
558 
559 public:
560  // local enums
562  enum LineType
563  {
564  StraightLine,
565  Polyline
566  };
567  enum TermStyle
568  {
569  Square,
570  Circle,
571  Diamond,
572  OpenArrow,
573  ClosedArrow,
574  None,
575  Butt,
576  ROpenArrow,
577  RClosedArrow,
578  Slash
579  };
580  enum LineIntent
581  {
582  Unknown,
583  Arrow,
584  Dimension,
585  PolygonCloud
586  };
587 
590  ~LineAnnotation() override;
591  SubType subType() const override;
592 
595 
596  QLinkedList<QPointF> linePoints() const;
597  void setLinePoints(const QLinkedList<QPointF> &points);
598 
599  TermStyle lineStartStyle() const;
600  void setLineStartStyle(TermStyle style);
601 
602  TermStyle lineEndStyle() const;
603  void setLineEndStyle(TermStyle style);
604 
605  bool isLineClosed() const;
606  void setLineClosed(bool closed);
607 
608  QColor lineInnerColor() const;
609  void setLineInnerColor(const QColor &color);
610 
611  double lineLeadingForwardPoint() const;
612  void setLineLeadingForwardPoint(double point);
613 
614  double lineLeadingBackPoint() const;
615  void setLineLeadingBackPoint(double point);
616 
617  bool lineShowCaption() const;
618  void setLineShowCaption(bool show);
619 
620  LineIntent lineIntent() const;
621  void setLineIntent(LineIntent intent);
622 
623 private:
624  LineAnnotation(const QDomNode &node);
625  LineAnnotation(LineAnnotationPrivate &dd);
626  void store(QDomNode &parentNode, QDomDocument &document) const override;
627  void setLineType(LineType type);
628  Q_DECLARE_PRIVATE(LineAnnotation)
629  Q_DISABLE_COPY(LineAnnotation)
630 };
631 
638 class POPPLER_QT5_EXPORT GeomAnnotation : public Annotation
639 {
640  friend class AnnotationUtils;
641  friend class AnnotationPrivate;
642 
643 public:
644  GeomAnnotation();
645  ~GeomAnnotation() override;
646  SubType subType() const override;
647 
648  // common enums
649  enum GeomType
650  {
651  InscribedSquare,
652  InscribedCircle
653  };
654 
655  GeomType geomType() const;
656  void setGeomType(GeomType type);
657 
658  QColor geomInnerColor() const;
659  void setGeomInnerColor(const QColor &color);
660 
661 private:
662  GeomAnnotation(const QDomNode &node);
663  GeomAnnotation(GeomAnnotationPrivate &dd);
664  void store(QDomNode &parentNode, QDomDocument &document) const override;
665  Q_DECLARE_PRIVATE(GeomAnnotation)
666  Q_DISABLE_COPY(GeomAnnotation)
667 };
668 
674 class POPPLER_QT5_EXPORT HighlightAnnotation : public Annotation
675 {
676  friend class AnnotationUtils;
677  friend class AnnotationPrivate;
678 
679 public:
681  ~HighlightAnnotation() override;
682  SubType subType() const override;
683 
688  {
692  StrikeOut
693  };
694 
700  struct Quad
701  {
702  QPointF points[4]; // 8 valid coords
703  bool capStart; // false (vtx 1-4) [K]
704  bool capEnd; // false (vtx 2-3) [K]
705  double feather; // 0.1 (in range 0..1) [K]
706  };
707 
713 
719 
723  QList<Quad> highlightQuads() const;
724 
728  void setHighlightQuads(const QList<Quad> &quads);
729 
730 private:
731  HighlightAnnotation(const QDomNode &node);
732  HighlightAnnotation(HighlightAnnotationPrivate &dd);
733  void store(QDomNode &parentNode, QDomDocument &document) const override;
734  Q_DECLARE_PRIVATE(HighlightAnnotation)
735  Q_DISABLE_COPY(HighlightAnnotation)
736 };
737 
743 class POPPLER_QT5_EXPORT StampAnnotation : public Annotation
744 {
745  friend class AnnotationUtils;
746  friend class AnnotationPrivate;
747 
748 public:
749  StampAnnotation();
750  ~StampAnnotation() override;
751  SubType subType() const override;
752 
772  QString stampIconName() const;
773 
779  void setStampIconName(const QString &name);
780 
781 private:
782  StampAnnotation(const QDomNode &node);
783  StampAnnotation(StampAnnotationPrivate &dd);
784  void store(QDomNode &parentNode, QDomDocument &document) const override;
785  Q_DECLARE_PRIVATE(StampAnnotation)
786  Q_DISABLE_COPY(StampAnnotation)
787 };
788 
794 class POPPLER_QT5_EXPORT InkAnnotation : public Annotation
795 {
796  friend class AnnotationUtils;
797  friend class AnnotationPrivate;
798 
799 public:
800  InkAnnotation();
801  ~InkAnnotation() override;
802  SubType subType() const override;
803 
804  QList<QLinkedList<QPointF>> inkPaths() const;
805  void setInkPaths(const QList<QLinkedList<QPointF>> &paths);
806 
807 private:
808  InkAnnotation(const QDomNode &node);
809  void store(QDomNode &parentNode, QDomDocument &document) const override;
810  InkAnnotation(InkAnnotationPrivate &dd);
811  Q_DECLARE_PRIVATE(InkAnnotation)
812  Q_DISABLE_COPY(InkAnnotation)
813 };
814 
815 class POPPLER_QT5_EXPORT LinkAnnotation : public Annotation
816 {
817  friend class AnnotationUtils;
818  friend class AnnotationPrivate;
819 
820 public:
821  ~LinkAnnotation() override;
822  SubType subType() const override;
823 
824  // local enums
825  enum HighlightMode
826  {
827  None,
828  Invert,
829  Outline,
830  Push
831  };
832 
835  void setLinkDestination(Link *link);
836 
837  HighlightMode linkHighlightMode() const;
838  void setLinkHighlightMode(HighlightMode mode);
839 
840  QPointF linkRegionPoint(int id) const;
841  // TODO Next ABI break, remove ref from point
842  void setLinkRegionPoint(int id, const QPointF &point);
843 
844 private:
845  LinkAnnotation();
846  LinkAnnotation(const QDomNode &node);
847  LinkAnnotation(LinkAnnotationPrivate &dd);
848  void store(QDomNode &parentNode, QDomDocument &document) const override;
849  Q_DECLARE_PRIVATE(LinkAnnotation)
850  Q_DISABLE_COPY(LinkAnnotation)
851 };
852 
858 class POPPLER_QT5_EXPORT CaretAnnotation : public Annotation
859 {
860  friend class AnnotationUtils;
861  friend class AnnotationPrivate;
862 
863 public:
864  CaretAnnotation();
865  ~CaretAnnotation() override;
866  SubType subType() const override;
867 
872  {
873  None,
874  P
875  };
876 
877  CaretSymbol caretSymbol() const;
878  void setCaretSymbol(CaretSymbol symbol);
879 
880 private:
881  CaretAnnotation(const QDomNode &node);
882  CaretAnnotation(CaretAnnotationPrivate &dd);
883  void store(QDomNode &parentNode, QDomDocument &document) const override;
884  Q_DECLARE_PRIVATE(CaretAnnotation)
885  Q_DISABLE_COPY(CaretAnnotation)
886 };
887 
895 class POPPLER_QT5_EXPORT FileAttachmentAnnotation : public Annotation
896 {
897  friend class AnnotationPrivate;
898 
899 public:
900  ~FileAttachmentAnnotation() override;
901  SubType subType() const override;
902 
906  QString fileIconName() const;
910  void setFileIconName(const QString &icon);
911 
922 
923 private:
925  FileAttachmentAnnotation(const QDomNode &node);
926  FileAttachmentAnnotation(FileAttachmentAnnotationPrivate &dd);
927  void store(QDomNode &parentNode, QDomDocument &document) const override;
928  Q_DECLARE_PRIVATE(FileAttachmentAnnotation)
929  Q_DISABLE_COPY(FileAttachmentAnnotation)
930 };
931 
939 class POPPLER_QT5_EXPORT SoundAnnotation : public Annotation
940 {
941  friend class AnnotationPrivate;
942 
943 public:
944  ~SoundAnnotation() override;
945  SubType subType() const override;
946 
950  QString soundIconName() const;
954  void setSoundIconName(const QString &icon);
955 
959  SoundObject *sound() const;
966 
967 private:
968  SoundAnnotation();
969  SoundAnnotation(const QDomNode &node);
970  SoundAnnotation(SoundAnnotationPrivate &dd);
971  void store(QDomNode &parentNode, QDomDocument &document) const override;
972  Q_DECLARE_PRIVATE(SoundAnnotation)
973  Q_DISABLE_COPY(SoundAnnotation)
974 };
975 
983 class POPPLER_QT5_EXPORT MovieAnnotation : public Annotation
984 {
985  friend class AnnotationPrivate;
986 
987 public:
988  ~MovieAnnotation() override;
989  SubType subType() const override;
990 
994  MovieObject *movie() const;
1000  void setMovie(MovieObject *movie);
1001 
1005  QString movieTitle() const;
1009  void setMovieTitle(const QString &title);
1010 
1011 private:
1012  MovieAnnotation();
1013  MovieAnnotation(const QDomNode &node);
1014  MovieAnnotation(MovieAnnotationPrivate &dd);
1015  void store(QDomNode &parentNode, QDomDocument &document) const override;
1016  Q_DECLARE_PRIVATE(MovieAnnotation)
1017  Q_DISABLE_COPY(MovieAnnotation)
1018 };
1019 
1027 class POPPLER_QT5_EXPORT ScreenAnnotation : public Annotation
1028 {
1029  friend class AnnotationPrivate;
1030 
1031 public:
1032  ~ScreenAnnotation() override;
1033 
1034  SubType subType() const override;
1035 
1040 
1046  void setAction(LinkRendition *action);
1047 
1051  QString screenTitle() const;
1052 
1056  void setScreenTitle(const QString &title);
1057 
1065 
1066 private:
1067  ScreenAnnotation();
1068  ScreenAnnotation(ScreenAnnotationPrivate &dd);
1069  void store(QDomNode &parentNode, QDomDocument &document) const override; // stub
1070  Q_DECLARE_PRIVATE(ScreenAnnotation)
1071  Q_DISABLE_COPY(ScreenAnnotation)
1072 };
1073 
1084 class POPPLER_QT5_EXPORT WidgetAnnotation : public Annotation
1085 {
1086  friend class AnnotationPrivate;
1087 
1088 public:
1089  ~WidgetAnnotation() override;
1090 
1091  SubType subType() const override;
1092 
1100 
1101 private:
1102  WidgetAnnotation();
1103  WidgetAnnotation(WidgetAnnotationPrivate &dd);
1104  void store(QDomNode &parentNode, QDomDocument &document) const override; // stub
1105  Q_DECLARE_PRIVATE(WidgetAnnotation)
1106  Q_DISABLE_COPY(WidgetAnnotation)
1107 };
1108 
1116 class POPPLER_QT5_EXPORT RichMediaAnnotation : public Annotation
1117 {
1118  friend class AnnotationPrivate;
1119 
1120 public:
1121  ~RichMediaAnnotation() override;
1122 
1123  SubType subType() const override;
1124 
1133  class POPPLER_QT5_EXPORT Params
1134  {
1135  friend class AnnotationPrivate;
1136 
1137  public:
1138  Params();
1139  ~Params();
1140 
1144  QString flashVars() const;
1145 
1146  private:
1147  void setFlashVars(const QString &flashVars);
1148 
1149  class Private;
1150  QScopedPointer<Private> d;
1151  };
1152 
1160  class POPPLER_QT5_EXPORT Instance
1161  {
1162  friend class AnnotationPrivate;
1163 
1164  public:
1168  enum Type
1169  {
1173  TypeVideo
1174  };
1175 
1176  Instance();
1177  ~Instance();
1178 
1182  Type type() const;
1183 
1188 
1189  private:
1190  void setType(Type type);
1191  void setParams(RichMediaAnnotation::Params *params);
1192 
1193  class Private;
1194  QScopedPointer<Private> d;
1195  };
1196 
1203  class POPPLER_QT5_EXPORT Configuration
1204  {
1205  friend class AnnotationPrivate;
1206 
1207  public:
1211  enum Type
1212  {
1216  TypeVideo
1217  };
1218 
1219  Configuration();
1220  ~Configuration();
1221 
1225  Type type() const;
1226 
1230  QString name() const;
1231 
1235  QList<RichMediaAnnotation::Instance *> instances() const;
1236 
1237  private:
1238  void setType(Type type);
1239  void setName(const QString &name);
1240  void setInstances(const QList<RichMediaAnnotation::Instance *> &instances);
1241 
1242  class Private;
1243  QScopedPointer<Private> d;
1244  };
1245 
1253  class POPPLER_QT5_EXPORT Asset
1254  {
1255  friend class AnnotationPrivate;
1256 
1257  public:
1258  Asset();
1259  ~Asset();
1260 
1264  QString name() const;
1265 
1270 
1271  private:
1272  void setName(const QString &name);
1273  void setEmbeddedFile(EmbeddedFile *embeddedFile);
1274 
1275  class Private;
1276  QScopedPointer<Private> d;
1277  };
1278 
1285  class POPPLER_QT5_EXPORT Content
1286  {
1287  friend class AnnotationPrivate;
1288 
1289  public:
1290  Content();
1291  ~Content();
1292 
1296  QList<RichMediaAnnotation::Configuration *> configurations() const;
1297 
1301  QList<RichMediaAnnotation::Asset *> assets() const;
1302 
1303  private:
1304  void setConfigurations(const QList<RichMediaAnnotation::Configuration *> &configurations);
1305  void setAssets(const QList<RichMediaAnnotation::Asset *> &assets);
1306 
1307  class Private;
1308  QScopedPointer<Private> d;
1309  };
1310 
1317  class POPPLER_QT5_EXPORT Activation
1318  {
1319  friend class AnnotationPrivate;
1320 
1321  public:
1326  {
1329  UserAction
1330  };
1331 
1332  Activation();
1333  ~Activation();
1334 
1339 
1340  private:
1341  void setCondition(Condition condition);
1342 
1343  class Private;
1344  QScopedPointer<Private> d;
1345  };
1346 
1353  class POPPLER_QT5_EXPORT Deactivation
1354  {
1355  friend class AnnotationPrivate;
1356 
1357  public:
1362  {
1365  UserAction
1366  };
1367 
1368  Deactivation();
1369  ~Deactivation();
1370 
1375 
1376  private:
1377  void setCondition(Condition condition);
1378 
1379  class Private;
1380  QScopedPointer<Private> d;
1381  };
1382 
1389  class POPPLER_QT5_EXPORT Settings
1390  {
1391  friend class AnnotationPrivate;
1392 
1393  public:
1394  Settings();
1395  ~Settings();
1396 
1401 
1406 
1407  private:
1408  void setActivation(RichMediaAnnotation::Activation *activation);
1409  void setDeactivation(RichMediaAnnotation::Deactivation *deactivation);
1410 
1411  class Private;
1412  QScopedPointer<Private> d;
1413  };
1414 
1419 
1424 
1425 private:
1426  void setSettings(RichMediaAnnotation::Settings *settings);
1427  void setContent(RichMediaAnnotation::Content *content);
1428 
1430  RichMediaAnnotation(const QDomNode &node);
1431  RichMediaAnnotation(RichMediaAnnotationPrivate &dd);
1432  void store(QDomNode &parentNode, QDomDocument &document) const override;
1433  Q_DECLARE_PRIVATE(RichMediaAnnotation)
1434  Q_DISABLE_COPY(RichMediaAnnotation)
1435 };
1436 
1437 }
1438 
1439 #endif
Helper class for (recursive) Annotation retrieval/storage.
Definition: poppler-annotation.h:77
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:370
Container class for Annotation style information.
Definition: poppler-annotation.h:323
Annotation class holding properties shared by all annotations.
Definition: poppler-annotation.h:174
RevType revisionType() const
SubType
Annotation subclasses.
Definition: poppler-annotation.h:188
int flags() const
Returns this annotation's flags.
RevScope revisionScope() const
QList< Annotation * > revisions() const
Returns the revisions of this annotation.
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.
Flag
Annotation flags.
Definition: poppler-annotation.h:215
Popup popup() const
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:438
@ MouseReleasedAction
Performed when the mouse button is released inside the annotation's active area.
Definition: poppler-annotation.h:442
@ FocusInAction
Performed when the annotation receives the input focus.
Definition: poppler-annotation.h:443
@ PageOpeningAction
Performed when the page containing the annotation is opened.
Definition: poppler-annotation.h:445
@ MousePressedAction
Performed when the mouse button is pressed inside the annotation's active area.
Definition: poppler-annotation.h:441
@ FocusOutAction
Performed when the annotation loses the input focus.
Definition: poppler-annotation.h:444
@ PageClosingAction
Performed when the page containing the annotation is closed.
Definition: poppler-annotation.h:446
@ CursorLeavingAction
Performed when the cursor exists the annotation's active area.
Definition: poppler-annotation.h:440
@ PageVisibleAction
Performed when the page containing the annotation becomes visible.
Definition: poppler-annotation.h:447
@ CursorEnteringAction
Performed when the cursor enters the annotation's active area.
Definition: poppler-annotation.h:439
virtual SubType subType() const =0
The type of the annotation.
void setStyle(const Style &style)
Style style() const
Caret annotation.
Definition: poppler-annotation.h:859
SubType subType() const override
The type of the annotation.
CaretSymbol
The symbols for the caret annotation.
Definition: poppler-annotation.h:872
Container class for an embedded file with a PDF document.
Definition: poppler-qt5.h:339
File attachment annotation.
Definition: poppler-annotation.h:896
void setFileIconName(const QString &icon)
Sets a new name for the icon of this annotation.
EmbeddedFile * embeddedFile() const
Returns the EmbeddedFile 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.
SubType subType() const override
The type of the annotation.
Geometric annotation.
Definition: poppler-annotation.h:639
SubType subType() const override
The type of the annotation.
Text highlight annotation.
Definition: poppler-annotation.h:675
void setHighlightQuads(const QList< Quad > &quads)
Set the 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:688
@ Squiggly
jagged or squiggly underline
Definition: poppler-annotation.h:690
@ Underline
straight line underline
Definition: poppler-annotation.h:691
@ Highlight
highlighter pen style annotation
Definition: poppler-annotation.h:689
QList< Quad > highlightQuads() const
The list of areas to highlight.
Ink Annotation.
Definition: poppler-annotation.h:795
SubType subType() const override
The type of the annotation.
Polygon/polyline annotation.
Definition: poppler-annotation.h:555
LineType
Definition: poppler-annotation.h:563
LineType lineType() const
LineAnnotation(LineType type)
SubType subType() const override
The type of the annotation.
Definition: poppler-annotation.h:816
SubType subType() const override
The type of the annotation.
Link * linkDestination() const
Movie: a movie to be played.
Definition: poppler-link.h:579
Rendition: Rendition link.
Definition: poppler-link.h:474
Movie annotation.
Definition: poppler-annotation.h:984
MovieObject * movie() const
Returns the MovieObject of this annotation.
void setMovieTitle(const QString &title)
Sets a new title for the movie 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:2370
A page in a document.
Definition: poppler-qt5.h:429
The activation object of the RichMediaAnnotation::Settings object.
Definition: poppler-annotation.h:1318
Condition
Describes the condition for activating the rich media.
Definition: poppler-annotation.h:1326
@ PageVisible
Activate when page becomes visible.
Definition: poppler-annotation.h:1328
@ PageOpened
Activate when page is opened.
Definition: poppler-annotation.h:1327
Condition condition() const
Returns the activation condition.
The asset object of a RichMediaAnnotation::Content object.
Definition: poppler-annotation.h:1254
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:1204
Type
Describes the media type of the configuration.
Definition: poppler-annotation.h:1212
@ Type3D
A 3D media file.
Definition: poppler-annotation.h:1213
@ TypeSound
A sound media file.
Definition: poppler-annotation.h:1215
@ TypeFlash
A Flash media file.
Definition: poppler-annotation.h:1214
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:1286
QList< RichMediaAnnotation::Asset * > assets() const
Returns the list of asset objects of the content object.
QList< RichMediaAnnotation::Configuration * > configurations() const
Returns the list of configuration objects of the content object.
The deactivation object of the RichMediaAnnotation::Settings object.
Definition: poppler-annotation.h:1354
Condition
Describes the condition for deactivating the rich media.
Definition: poppler-annotation.h:1362
@ PageClosed
Deactivate when page is closed.
Definition: poppler-annotation.h:1363
@ PageInvisible
Deactivate when page becomes invisible.
Definition: poppler-annotation.h:1364
Condition condition() const
Returns the deactivation condition.
The instance object of a RichMediaAnnotation::Configuration object.
Definition: poppler-annotation.h:1161
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:1169
@ TypeFlash
A Flash media file.
Definition: poppler-annotation.h:1171
@ TypeSound
A sound media file.
Definition: poppler-annotation.h:1172
@ Type3D
A 3D media file.
Definition: poppler-annotation.h:1170
Type type() const
Returns the media type of the instance.
The params object of a RichMediaAnnotation::Instance object.
Definition: poppler-annotation.h:1134
QString flashVars() const
Returns the parameters for the flash player.
The settings object of a RichMediaAnnotation.
Definition: poppler-annotation.h:1390
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:1117
RichMediaAnnotation::Settings * settings() const
Returns the Settings object of the rich media annotation or 0 if it doesn't exist.
SubType subType() const override
The type of the annotation.
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:1028
SubType subType() const override
The type of the annotation.
void setAction(LinkRendition *action)
Sets a new LinkRendition for this annotation.
LinkRendition * action() const
Returns the LinkRendition of this annotation.
void setScreenTitle(const QString &title)
Sets a new title for the screen of 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.
QString screenTitle() const
Returns the title of the screen of this annotation.
Sound annotation.
Definition: poppler-annotation.h:940
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:2294
Stamp annotation.
Definition: poppler-annotation.h:744
SubType subType() const override
The type of the 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:472
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
QVector< QPointF > calloutPoints() const
void setTextColor(const QColor &color)
Widget annotation.
Definition: poppler-annotation.h:1085
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:47
Structure corresponding to a QuadPoints array.
Definition: poppler-annotation.h:701