1namespace Poppler
2{
3
4class AnnotationUtils
5{
6%Docstring
7Helper class for (recursive) Annotation retrieval/storage.
8%End
9%TypeHeaderCode
10#include <qt5/poppler-qt5.h>
11#include <qt5/poppler-annotation.h>
12%End
13
14  public:
15%If(QTXML_AVAILABLE)
16    static Poppler::Annotation * createAnnotation( const QDomElement & annElement );
17%Docstring
18Restore an ``Annotation`` (with revisions if needed) from the DOM element
19``annElement``.
20
21Returns the complete Annotation or None if element is invalid.
22%End
23    static void storeAnnotation( const Poppler::Annotation * ann,
24        QDomElement & annElement, QDomDocument & document );
25    static QDomElement findChildElement( const QDomNode & parentNode,
26        const QString & name );
27%End
28}; // class AnnotationUtils
29
30
31class Annotation
32{
33%Docstring
34Annotation class holding properties shared by all annotations.
35%End
36
37%TypeHeaderCode
38#include <qt5/poppler-qt5.h>
39#include <qt5/poppler-annotation.h>
40%End
41
42public:
43    enum SubType
44    {
45        AText = 1,
46        ALine = 2,
47        AGeom = 3,
48        AHighlight = 4,
49        AStamp = 5,
50        AInk = 6,
51        ALink = 7,
52        ACaret = 8,
53        AFileAttachment = 9,
54        ASound = 10,
55        AMovie = 11,
56%If(POPPLER_V0_20_0 -)
57        AScreen = 12,
58%End
59%If(POPPLER_V0_22_0 -)
60        AWidget = 13,
61%End
62%If(POPPLER_V0_36_0 -)
63        ARichMedia = 14,
64%End
65        A_BASE = 0
66    };
67    enum Flag
68    {
69        Hidden = 1,
70        FixedSize = 2,
71        FixedRotation = 4,
72        DenyPrint = 8,
73        DenyWrite = 16,
74        DenyDelete = 32,
75        ToggleHidingOnMouse = 64,
76        External = 128
77    };
78    enum LineStyle
79    {
80         Solid = 1,
81         Dashed = 2,
82         Beveled = 4,
83         Inset = 8,
84         Underline = 16
85    };
86    enum LineEffect
87    {
88        NoEffect = 1,
89        Cloudy = 2
90    };
91    enum RevScope
92    {
93%If(POPPLER_V0_20_0 -)
94        Root = 0,
95%End
96        Reply = 1,
97        Group = 2,
98        Delete = 4
99    };
100    enum RevType
101    {
102        None = 1,
103        Marked = 2,
104        Unmarked = 4,
105        Accepted = 8,
106        Rejected = 16,
107        Cancelled = 32,
108        Completed = 64
109    };
110    QString author() const;
111    void setAuthor( const QString &author );
112    QString contents() const;
113    void setContents( const QString &contents );
114    QString uniqueName() const;
115    void setUniqueName( const QString &uniqueName );
116    QDateTime modificationDate() const;
117    void setModificationDate( const QDateTime &date );
118    QDateTime creationDate() const;
119    void setCreationDate( const QDateTime &date );
120    int flags() const;
121    void setFlags( int flags );
122    QRectF boundary() const;
123    void setBoundary( const QRectF &boundary );
124
125%If(POPPLER_V0_20_0 -)
126    class Style
127    {
128    public:
129        Style();
130        Style( const Poppler::Annotation::Style &other );
131        //Style& operator=( const Style &other );
132        ~Style();
133
134        // appearance properties
135        QColor color() const;                     // black
136        void setColor(const QColor &color);
137        double opacity() const;                   // 1.0
138        void setOpacity(double opacity);
139
140        // pen properties
141        double width() const;                     // 1.0
142        void setWidth(double width);
143        Poppler::Annotation::LineStyle lineStyle() const;              // LineStyle::Solid
144        void setLineStyle(Poppler::Annotation::LineStyle style);
145        double xCorners() const;                  // 0.0
146        void setXCorners(double radius);
147        double yCorners() const;                  // 0.0
148        void setYCorners(double radius);
149        const QVector<double>& dashArray() const; // [ 3 ]
150        void setDashArray(const QVector<double> &array);
151
152        // pen effects
153        Poppler::Annotation::LineEffect lineEffect() const;            // LineEffect::NoEffect
154        void setLineEffect(Poppler::Annotation::LineEffect effect);
155        double effectIntensity() const;           // 1.0
156        void setEffectIntensity(double intens);
157
158    };
159
160    Poppler::Annotation::Style style() const;
161    void setStyle( const Poppler::Annotation::Style& style );
162%End
163
164%If(POPPLER_V0_20_0 -)
165    class Popup
166    {
167%Docstring
168Container class for Annotation pop-up window information
169%End
170    public:
171        Popup();
172        Popup( const Poppler::Annotation::Popup &other );
173        //Popup& operator=( const Popup &other );
174        ~Popup();
175
176        // window state (Hidden, FixedRotation, Deny* flags allowed)
177        int flags() const;       // -1 (never initialized) -> 0 (if inited and shown)
178        void setFlags( int flags );
179
180        // geometric properties
181        QRectF geometry() const; // no default
182        void setGeometry( const QRectF &geom );
183
184        // window contens/override properties
185        QString title() const;   // '' text in the titlebar (overrides author)
186        void setTitle( const QString &title );
187        QString summary() const; // '' short description (displayed if not empty)
188        void setSummary( const QString &summary );
189        QString text() const;    // '' text for the window (overrides annot->contents)
190        void setText( const QString &text );
191
192    };
193
194    Poppler::Annotation::Popup popup() const;
195    void setPopup( const Poppler::Annotation::Popup& popup );
196%Docstring
197Warning: Currently does nothing
198%End
199%End
200
201%If(POPPLER_V0_20_0 -)
202    RevScope revisionScope() const; // Root
203    RevType revisionType() const;   // None
204%End
205
206%If(POPPLER_V0_20_0 -)
207    /**
208     * Returns the revisions of this annotation
209     *
210     * \note The caller owns the returned annotations and they should
211     *       be deleted when no longer required.
212     *
213     * \since 0.20
214     */
215    QList<Poppler::Annotation*> revisions() const;
216%End
217
218    /**
219     * The type of the annotation.
220     */
221    virtual SubType subType() const = 0;
222
223    /**
224     * Destructor.
225     */
226    virtual ~Annotation();
227
228%If(POPPLER_V0_22_0 -)
229    /**
230     * Describes the flags from an annotations 'AA' dictionary.
231     *
232     * This flag is used by the additionalAction() method for ScreenAnnotation
233     * and WidgetAnnotation.
234     *
235     * \since 0.22
236     */
237    enum AdditionalActionType
238    {
239        CursorEnteringAction, ///< Performed when the cursor enters the annotation's active area
240        CursorLeavingAction,  ///< Performed when the cursor exists the annotation's active area
241        MousePressedAction,   ///< Performed when the mouse button is pressed inside the annotation's active area
242        MouseReleasedAction,  ///< Performed when the mouse button is released inside the annotation's active area
243        FocusInAction,        ///< Performed when the annotation receives the input focus
244        FocusOutAction,       ///< Performed when the annotation loses the input focus
245        PageOpeningAction,    ///< Performed when the page containing the annotation is opened
246        PageClosingAction,    ///< Performed when the page containing the annotation is closed
247        PageVisibleAction,    ///< Performed when the page containing the annotation becomes visible
248        PageInvisibleAction   ///< Performed when the page containing the annotation becomes invisible
249    };
250%End
251
252protected:
253%If(QTXML_AVAILABLE)
254    void storeBaseAnnotationProperties( QDomNode & parentNode, QDomDocument & document ) const;
255%End
256
257private:
258    Annotation(const Poppler::Annotation&);
259%If(QTXML_AVAILABLE)
260    virtual void store( QDomNode & parentNode, QDomDocument & document ) const;
261%End
262
263%If(- POPPLER_V0_36_0)
264%ConvertToSubClassCode
265    switch (sipCpp->subType()) {
266        case Poppler::Annotation::AText:
267            sipType = sipType_Poppler_TextAnnotation;
268            break;
269        case Poppler::Annotation::ALine:
270            sipType = sipType_Poppler_LineAnnotation;
271            break;
272        case Poppler::Annotation::AGeom:
273            sipType = sipType_Poppler_GeomAnnotation;
274            break;
275        case Poppler::Annotation::AHighlight:
276            sipType = sipType_Poppler_HighlightAnnotation;
277            break;
278        case Poppler::Annotation::AStamp:
279            sipType = sipType_Poppler_StampAnnotation;
280            break;
281        case Poppler::Annotation::AInk:
282            sipType = sipType_Poppler_InkAnnotation;
283            break;
284        case Poppler::Annotation::ALink:
285            sipType = sipType_Poppler_LinkAnnotation;
286            break;
287        case Poppler::Annotation::ACaret:
288            sipType = sipType_Poppler_CaretAnnotation;
289            break;
290        case Poppler::Annotation::AFileAttachment:
291            sipType = sipType_Poppler_FileAttachmentAnnotation;
292            break;
293        case Poppler::Annotation::ASound:
294            sipType = sipType_Poppler_SoundAnnotation;
295            break;
296        case Poppler::Annotation::AMovie:
297            sipType = sipType_Poppler_MovieAnnotation;
298            break;
299        case Poppler::Annotation::AScreen:
300            sipType = sipType_Poppler_ScreenAnnotation;
301            break;
302        case Poppler::Annotation::AWidget:
303            sipType = sipType_Poppler_WidgetAnnotation;
304            break;
305        default:
306            sipType = sipType_Poppler_Annotation;
307    }
308%End
309%End
310%If(POPPLER_V0_36_0 -)
311%ConvertToSubClassCode
312    switch (sipCpp->subType()) {
313        case Poppler::Annotation::AText:
314            sipType = sipType_Poppler_TextAnnotation;
315            break;
316        case Poppler::Annotation::ALine:
317            sipType = sipType_Poppler_LineAnnotation;
318            break;
319        case Poppler::Annotation::AGeom:
320            sipType = sipType_Poppler_GeomAnnotation;
321            break;
322        case Poppler::Annotation::AHighlight:
323            sipType = sipType_Poppler_HighlightAnnotation;
324            break;
325        case Poppler::Annotation::AStamp:
326            sipType = sipType_Poppler_StampAnnotation;
327            break;
328        case Poppler::Annotation::AInk:
329            sipType = sipType_Poppler_InkAnnotation;
330            break;
331        case Poppler::Annotation::ALink:
332            sipType = sipType_Poppler_LinkAnnotation;
333            break;
334        case Poppler::Annotation::ACaret:
335            sipType = sipType_Poppler_CaretAnnotation;
336            break;
337        case Poppler::Annotation::AFileAttachment:
338            sipType = sipType_Poppler_FileAttachmentAnnotation;
339            break;
340        case Poppler::Annotation::ASound:
341            sipType = sipType_Poppler_SoundAnnotation;
342            break;
343        case Poppler::Annotation::AMovie:
344            sipType = sipType_Poppler_MovieAnnotation;
345            break;
346        case Poppler::Annotation::AScreen:
347            sipType = sipType_Poppler_ScreenAnnotation;
348            break;
349        case Poppler::Annotation::AWidget:
350            sipType = sipType_Poppler_WidgetAnnotation;
351            break;
352        case Poppler::Annotation::ARichMedia:
353            sipType = sipType_Poppler_RichMediaAnnotation;
354            break;
355        default:
356            sipType = sipType_Poppler_Annotation;
357    }
358%End
359%End
360
361}; // class Annotation
362
363
364class TextAnnotation : Poppler::Annotation
365{
366%Docstring
367Annotation containing text.
368
369A text annotation is an object showing some text directly on the page, or
370linked to the contents using an icon shown on a page.
371%End
372
373%TypeHeaderCode
374#include <qt5/poppler-qt5.h>
375#include <qt5/poppler-annotation.h>
376%End
377
378  public:
379    // local enums
380    enum TextType
381    {
382        Linked,
383        InPlace
384    };
385    enum InplaceIntent
386    {
387        Unknown,
388        Callout,
389        TypeWriter
390    };
391
392    TextAnnotation( TextType type );
393    virtual ~TextAnnotation();
394    virtual SubType subType() const;
395
396    /**
397       The type of text annotation represented by this object
398    */
399    TextType textType() const;
400
401    /**
402       The name of the icon for this text annotation.
403
404       Standard names for text annotation icons are:
405       - Comment
406       - Help
407       - Insert
408       - Key
409       - NewParagraph
410       - Note (this is the default icon to use)
411       - Paragraph
412    */
413    QString textIcon() const;
414
415    /**
416       Set the name of the icon to use for this text annotation.
417
418       \sa textIcon for the list of standard names
419    */
420    void setTextIcon( const QString &icon );
421
422    QFont textFont() const;
423    void setTextFont( const QFont &font );
424
425    int inplaceAlign() const;
426    void setInplaceAlign( int align );
427
428    QPointF calloutPoint( int id ) const;
429%If(POPPLER_V0_20_0 -)
430    QVector<QPointF> calloutPoints() const;
431    void setCalloutPoints( const QVector<QPointF> &points );
432%End
433
434    InplaceIntent inplaceIntent() const;
435    void setInplaceIntent( InplaceIntent intent );
436
437private:
438%If(QTXML_AVAILABLE)
439    TextAnnotation( const QDomNode &node );
440    virtual void store( QDomNode &parentNode, QDomDocument &document ) const;
441%End
442    void setTextType( TextType type );
443
444}; // class TextAnnotation
445
446
447class LineAnnotation : Poppler::Annotation
448{
449%Docstring
450Polygon/polyline annotation.
451
452This annotation represents a polygon (or polyline) to be drawn on a page.
453%End
454%TypeHeaderCode
455#include <qt5/poppler-qt5.h>
456#include <qt5/poppler-annotation.h>
457%End
458
459  public:
460    // local enums
461%If(POPPLER_V0_20_0 -)
462    enum LineType
463    {
464        StraightLine,
465        Polyline
466    };
467%End
468    enum TermStyle
469    {
470        Square,
471        Circle,
472        Diamond,
473        OpenArrow,
474        ClosedArrow,
475        None,
476        Butt,
477        ROpenArrow,
478        RClosedArrow,
479        Slash
480     };
481    enum LineIntent
482    {
483        Unknown,
484        Arrow,
485        Dimension,
486        PolygonCloud
487    };
488
489%If(POPPLER_V0_20_0 -)
490    LineAnnotation( LineType type );
491%End
492    virtual ~LineAnnotation();
493    virtual SubType subType() const;
494
495%If(POPPLER_V0_20_0 -)
496    LineType lineType() const;
497%End
498
499    QLinkedList<QPointF> linePoints() const;
500    void setLinePoints( const QLinkedList<QPointF> &points );
501
502    TermStyle lineStartStyle() const;
503    void setLineStartStyle( TermStyle style );
504
505    TermStyle lineEndStyle() const;
506    void setLineEndStyle( TermStyle style );
507
508    bool isLineClosed() const;
509    void setLineClosed( bool closed );
510
511    QColor lineInnerColor() const;
512    void setLineInnerColor( const QColor &color );
513
514    double lineLeadingForwardPoint() const;
515    void setLineLeadingForwardPoint( double point );
516
517    double lineLeadingBackPoint() const;
518    void setLineLeadingBackPoint( double point );
519
520    bool lineShowCaption() const;
521    void setLineShowCaption( bool show );
522
523    LineIntent lineIntent() const;
524    void setLineIntent( LineIntent intent );
525
526  private:
527%If(QTXML_AVAILABLE)
528    LineAnnotation( const QDomNode &node );
529    virtual void store( QDomNode &parentNode, QDomDocument &document ) const;
530%End
531
532    void setLineType( LineType type );
533
534
535}; // class LineAnnotation
536
537
538class GeomAnnotation : Poppler::Annotation
539{
540%Docstring
541Geometric annotation.
542
543The geometric annotation represents a geometric figure, like a rectangle or
544an ellipse.
545%End
546%TypeHeaderCode
547#include <qt5/poppler-qt5.h>
548#include <qt5/poppler-annotation.h>
549%End
550
551  public:
552    GeomAnnotation();
553    virtual ~GeomAnnotation();
554    virtual SubType subType() const;
555
556    // common enums
557    enum GeomType
558    {
559        InscribedSquare,
560        InscribedCircle
561    };
562
563    GeomType geomType() const;
564    void setGeomType( GeomType style );
565
566    QColor geomInnerColor() const;
567    void setGeomInnerColor( const QColor &color );
568
569  private:
570%If(QTXML_AVAILABLE)
571    GeomAnnotation( const QDomNode &node );
572    virtual void store( QDomNode &parentNode, QDomDocument &document ) const;
573%End
574
575}; // class GeomAnnotation
576
577
578class HighlightAnnotation : Poppler::Annotation
579{
580%Docstring
581Text highlight annotation.
582
583The highlight annotation represents some areas of text being "highlighted".
584%End
585%TypeHeaderCode
586#include <qt5/poppler-qt5.h>
587#include <qt5/poppler-annotation.h>
588%End
589
590  public:
591    HighlightAnnotation();
592    virtual ~HighlightAnnotation();
593    virtual SubType subType() const;
594
595    /**
596       The type of highlight
597    */
598    enum HighlightType
599    {
600        Highlight,
601        Squiggly,
602        Underline,
603        StrikeOut,
604    };
605
606    /**
607       Structure corresponding to a QuadPoints array. This matches a
608       quadrilateral that describes the area around a word (or set of
609       words) that are to be highlighted.
610    */
611    struct Quad {
612        QPointF *    points
613        {
614            %GetCode
615                sipPy = PyList_New(4);
616                PyObject* obj;
617                for (SIP_SSIZE_T i = 0; i < 4; ++i)
618                {
619                    QPointF *point = new QPointF(sipCpp->points[i]);
620                    obj = sipConvertFromNewType(point, sipType_QPointF, NULL);
621                    PyList_SET_ITEM(sipPy, i, obj);
622                }
623            %End
624            %SetCode
625                SIP_SSIZE_T len;
626                if (!PySequence_Check(sipPy) || (len = PySequence_Size(sipPy)) != 4)
627                    sipErr = 1;
628                else
629                {
630                    for (SIP_SSIZE_T i = 0; i < 4; ++i)
631                    {
632                        PyObject *itm = PySequence_ITEM(sipPy, i);
633                        bool ok = (itm && sipCanConvertToType(itm, sipType_QPointF, SIP_NOT_NONE));
634                        Py_XDECREF(itm);
635
636                        if (!ok)
637                        {
638                            sipErr = 1;
639                            break;
640                        }
641                    }
642                }
643
644                if (sipErr == 1)
645                    PyErr_SetString(PyExc_ValueError, "Quad.points must be a sequence of exactly 4 QPointF() instances");
646                else
647                {
648                    int iserr = 0;
649                    for (SIP_SSIZE_T i = 0; i < 4; ++i)
650                    {
651                        PyObject *itm = PySequence_ITEM(sipPy, i);
652                        QPointF *point = reinterpret_cast<QPointF *>(sipConvertToType(itm, sipType_QPointF, 0, 0, 0, &iserr));
653                        sipCpp->points[i] = *point;
654                        Py_DECREF(itm);
655                    }
656                }
657            %End
658        };
659        bool            capStart;
660        bool            capEnd;
661        double          feather;
662    };
663    /**
664       The type (style) of highlighting to use for this area
665       or these areas.
666    */
667    HighlightType highlightType() const;
668
669    /**
670       Set the type of highlighting to use for the given area
671       or areas.
672    */
673    void setHighlightType( HighlightType type );
674
675    /**
676       The list of areas to highlight.
677    */
678    QList< Poppler::HighlightAnnotation::Quad > highlightQuads() const;
679
680    /**
681       Set the areas to highlight.
682    */
683    void setHighlightQuads( const QList< Poppler::HighlightAnnotation::Quad > &quads );
684
685  private:
686%If(QTXML_AVAILABLE)
687    HighlightAnnotation( const QDomNode &node );
688    virtual void store( QDomNode &parentNode, QDomDocument &document ) const;
689%End
690
691}; // class HighlightAnnotation
692
693
694class StampAnnotation : Poppler::Annotation
695{
696%Docstring
697Stamp annotation.
698
699A simple annotation drawing a stamp on a page.
700%End
701%TypeHeaderCode
702#include <qt5/poppler-qt5.h>
703#include <qt5/poppler-annotation.h>
704%End
705
706  public:
707    StampAnnotation();
708    virtual ~StampAnnotation();
709    virtual SubType subType() const;
710
711    /**
712       The name of the icon for this stamp annotation.
713
714       Standard names for stamp annotation icons are:
715       - Approved
716       - AsIs
717       - Confidential
718       - Departmental
719       - Draft (this is the default icon type)
720       - Experimental
721       - Expired
722       - Final
723       - ForComment
724       - ForPublicRelease
725       - NotApproved
726       - NotForPublicRelease
727       - Sold
728       - TopSecret
729    */
730    QString stampIconName() const;
731
732    /**
733       Set the icon type for this stamp annotation.
734
735       \sa stampIconName for the list of standard icon names
736    */
737    void setStampIconName( const QString &name );
738
739  private:
740%If(QTXML_AVAILABLE)
741    StampAnnotation( const QDomNode &node );
742    virtual void store( QDomNode &parentNode, QDomDocument &document ) const;
743%End
744
745}; // class StampAnnotation
746
747
748class InkAnnotation : Poppler::Annotation
749{
750%Docstring
751Ink Annotation.
752
753Annotation representing an ink path on a page.
754%End
755%TypeHeaderCode
756#include <qt5/poppler-qt5.h>
757#include <qt5/poppler-annotation.h>
758%End
759
760  public:
761    InkAnnotation();
762    virtual ~InkAnnotation();
763    virtual SubType subType() const;
764
765    QList< QLinkedList<QPointF> > inkPaths() const;
766    void setInkPaths( const QList< QLinkedList<QPointF> > &paths );
767
768  private:
769%If(QTXML_AVAILABLE)
770    InkAnnotation( const QDomNode &node );
771    virtual void store( QDomNode &parentNode, QDomDocument &document ) const;
772%End
773
774}; // class InkAnnotation
775
776
777class LinkAnnotation : Poppler::Annotation
778{
779%Docstring
780Link Annotation.
781
782Annotation representing a link on a page.
783%End
784%TypeHeaderCode
785#include <qt5/poppler-qt5.h>
786#include <qt5/poppler-annotation.h>
787%End
788
789  public:
790    virtual ~LinkAnnotation();
791    virtual SubType subType() const;
792
793    // local enums
794    enum HighlightMode
795    {
796        None,
797        Invert,
798        Outline,
799        Push
800    };
801
802%If(POPPLER_V0_20_0 -)
803    Poppler::Link* linkDestination() const;
804    void setLinkDestination( Poppler::Link *link );
805%End
806
807    HighlightMode linkHighlightMode() const;
808    void setLinkHighlightMode( HighlightMode mode );
809
810    QPointF linkRegionPoint( int id ) const;
811    void setLinkRegionPoint( int id, const QPointF &point );
812
813  private:
814    LinkAnnotation();
815%If(QTXML_AVAILABLE)
816    LinkAnnotation( const QDomNode &node );
817    virtual void store( QDomNode &parentNode, QDomDocument &document ) const;
818%End
819
820}; // class LinkAnnotation
821
822
823class CaretAnnotation : Poppler::Annotation
824{
825%Docstring
826Caret annotation.
827
828The caret annotation represents a symbol to indicate the presence of text.
829%End
830%TypeHeaderCode
831#include <qt5/poppler-qt5.h>
832#include <qt5/poppler-annotation.h>
833%End
834
835  public:
836    CaretAnnotation();
837    virtual ~CaretAnnotation();
838    virtual SubType subType() const;
839
840    /**
841     * The symbols for the caret annotation.
842     */
843    enum CaretSymbol
844    {
845        None,
846        P
847    };
848
849    CaretSymbol caretSymbol() const;
850    void setCaretSymbol( CaretSymbol symbol );
851
852  private:
853%If(QTXML_AVAILABLE)
854    CaretAnnotation( const QDomNode &node );
855    virtual void store( QDomNode &parentNode, QDomDocument &document ) const;
856%End
857
858}; // class CaretAnnotation
859
860
861class FileAttachmentAnnotation : Poppler::Annotation
862{
863%Docstring
864File attachment annotation.
865
866The file attachment annotation represents a file embedded in the document.
867%End
868%TypeHeaderCode
869#include <qt5/poppler-qt5.h>
870#include <qt5/poppler-annotation.h>
871%End
872
873  public:
874    virtual ~FileAttachmentAnnotation();
875    virtual SubType subType() const;
876
877    /**
878     * Returns the name of the icon of this annotation.
879     */
880    QString fileIconName() const;
881    /**
882     * Sets a new name for the icon of this annotation.
883     */
884    void setFileIconName( const QString &icon );
885
886    /**
887     * Returns the EmbeddedFile of this annotation.
888     */
889    Poppler::EmbeddedFile* embeddedFile() const;
890    /**
891     * Sets a new EmbeddedFile for this annotation.
892     *
893     * \note FileAttachmentAnnotation takes ownership of the object
894     */
895    void setEmbeddedFile( Poppler::EmbeddedFile *ef );
896
897  private:
898    FileAttachmentAnnotation();
899%If(QTXML_AVAILABLE)
900    FileAttachmentAnnotation( const QDomNode &node );
901    virtual void store( QDomNode &parentNode, QDomDocument &document ) const;
902%End
903
904}; // class FileAttachmentAnnotation
905
906
907class SoundAnnotation : Poppler::Annotation
908{
909%Docstring
910Sound annotation.
911
912The sound annotation represents a sound to be played when activated.
913%End
914%TypeHeaderCode
915#include <qt5/poppler-qt5.h>
916#include <qt5/poppler-annotation.h>
917%End
918
919  public:
920    virtual ~SoundAnnotation();
921    virtual SubType subType() const;
922
923    /**
924     * Returns the name of the icon of this annotation.
925     */
926    QString soundIconName() const;
927    /**
928     * Sets a new name for the icon of this annotation.
929     */
930    void setSoundIconName( const QString &icon );
931
932    /**
933     * Returns the SoundObject of this annotation.
934     */
935    Poppler::SoundObject* sound() const;
936    /**
937     * Sets a new SoundObject for this annotation.
938     *
939     * \note SoundAnnotation takes ownership of the object
940     */
941    void setSound( Poppler::SoundObject *ef );
942
943  private:
944    SoundAnnotation();
945%If(QTXML_AVAILABLE)
946    SoundAnnotation( const QDomNode &node );
947    virtual void store( QDomNode &parentNode, QDomDocument &document ) const;
948%End
949
950}; // class SoundAnnotation
951
952
953class MovieAnnotation : Poppler::Annotation
954{
955%Docstring
956Movie annotation.
957
958The movie annotation represents a movie to be played when activated.
959%End
960%TypeHeaderCode
961#include <qt5/poppler-qt5.h>
962#include <qt5/poppler-annotation.h>
963%End
964
965  public:
966    virtual ~MovieAnnotation();
967    virtual SubType subType() const;
968
969    /**
970     * Returns the MovieObject of this annotation.
971     */
972    Poppler::MovieObject* movie() const;
973    /**
974     * Sets a new MovieObject for this annotation.
975     *
976     * \note MovieAnnotation takes ownership of the object
977     */
978    void setMovie( Poppler::MovieObject *movie );
979
980    /**
981     * Returns the title of the movie of this annotation.
982     */
983    QString movieTitle() const;
984    /**
985     * Sets a new title for the movie of this annotation.
986     */
987    void setMovieTitle( const QString &title );
988
989  private:
990    MovieAnnotation();
991%If(QTXML_AVAILABLE)
992    MovieAnnotation( const QDomNode &node );
993    virtual void store( QDomNode &parentNode, QDomDocument &document ) const;
994%End
995
996}; // class MovieAnnotation
997
998
999class  ScreenAnnotation : Poppler::Annotation
1000{
1001%Docstring
1002Screen annotation.
1003
1004The screen annotation represents a screen to be played when activated.
1005%End
1006%TypeHeaderCode
1007#include <qt5/poppler-qt5.h>
1008#include <qt5/poppler-annotation.h>
1009%End
1010
1011  public:
1012    virtual ~ScreenAnnotation();
1013
1014    virtual SubType subType() const;
1015
1016    /**
1017     * Returns the LinkRendition of this annotation.
1018     */
1019    Poppler::LinkRendition* action() const;
1020
1021    /**
1022     * Sets a new LinkRendition for this annotation.
1023     *
1024     * \note ScreenAnnotation takes ownership of the object
1025     */
1026    void setAction( Poppler::LinkRendition *action );
1027
1028    /**
1029     * Returns the title of the screen of this annotation.
1030     */
1031    QString screenTitle() const;
1032
1033    /**
1034     * Sets a new title for the screen of this annotation.
1035     */
1036    void setScreenTitle( const QString &title );
1037
1038    /**
1039     * Returns the additional action of the given @p type fo the annotation or
1040     * @c 0 if no action has been defined.
1041     *
1042     * \since 0.22
1043     */
1044%If(POPPLER_V0_22_0 -)
1045    Poppler::Link* additionalAction( AdditionalActionType type ) const;
1046%End
1047
1048  private:
1049    ScreenAnnotation();
1050%If(QTXML_AVAILABLE)
1051    virtual void store( QDomNode &parentNode, QDomDocument &document ) const; // stub
1052%End
1053
1054}; // class ScreenAnnotation
1055
1056
1057class WidgetAnnotation : Poppler::Annotation
1058{
1059%Docstring
1060Widget annotation.
1061
1062The widget annotation represents a widget (form field) on a page.
1063
1064Note: this class is just provided for consistency of the annotation API,
1065use the FormField classes to get all the form-related information.
1066%End
1067%TypeHeaderCode
1068#include <qt5/poppler-qt5.h>
1069#include <qt5/poppler-annotation.h>
1070%End
1071
1072  public:
1073    virtual ~WidgetAnnotation();
1074
1075    virtual SubType subType() const;
1076
1077    /**
1078     * Returns the additional action of the given @p type fo the annotation or
1079     * @c 0 if no action has been defined.
1080     *
1081     * \since 0.22
1082     */
1083%If(POPPLER_V0_22_0 -)
1084    Poppler::Link* additionalAction( AdditionalActionType type ) const;
1085%End
1086
1087  private:
1088    WidgetAnnotation();
1089%If(QTXML_AVAILABLE)
1090    virtual void store( QDomNode &parentNode, QDomDocument &document ) const; // stub
1091%End
1092
1093}; // class WidgetAnnotation
1094
1095%If(POPPLER_V0_36_0 -)
1096class RichMediaAnnotation : Poppler::Annotation
1097{
1098%TypeHeaderCode
1099#include <qt5/poppler-qt5.h>
1100#include <qt5/poppler-annotation.h>
1101%End
1102  public:
1103    ~RichMediaAnnotation();
1104
1105    SubType subType() const;
1106    class Params
1107    {
1108      public:
1109        ~Params();
1110
1111        /**
1112         * Returns the parameters for the flash player.
1113         */
1114        QString flashVars() const;
1115      private:
1116        Params();
1117        Params(const Poppler::RichMediaAnnotation::Params&);
1118    };
1119    class Instance
1120    {
1121      public:
1122        enum Type
1123        {
1124          Type3D,     ///< A 3D media file.
1125          TypeFlash,  ///< A Flash media file.
1126          TypeSound,  ///< A sound media file.
1127          TypeVideo   ///< A video media file.
1128        };
1129
1130        ~Instance();
1131        Type type() const;
1132        Poppler::RichMediaAnnotation::Params* params() const;
1133      private:
1134        Instance();
1135        Instance(const Poppler::RichMediaAnnotation::Instance&);
1136    };
1137    class Configuration
1138    {
1139      public:
1140        enum Type
1141        {
1142          Type3D,     ///< A 3D media file.
1143          TypeFlash,  ///< A Flash media file.
1144          TypeSound,  ///< A sound media file.
1145          TypeVideo   ///< A video media file.
1146        };
1147
1148        ~Configuration();
1149        Type type() const;
1150        QString name() const;
1151        QList< Poppler::RichMediaAnnotation::Instance* > instances() const;
1152      private:
1153        Configuration();
1154        Configuration(const Poppler::RichMediaAnnotation::Configuration&);
1155    };
1156
1157    class Asset
1158    {
1159      public:
1160        ~Asset();
1161        QString name() const;
1162        EmbeddedFile* embeddedFile() const;
1163      private:
1164        Asset();
1165        Asset(const Poppler::RichMediaAnnotation::Asset&);
1166    };
1167    class Content
1168    {
1169      public:
1170        ~Content();
1171        QList< Poppler::RichMediaAnnotation::Configuration* > configurations() const;
1172        QList< Poppler::RichMediaAnnotation::Asset* > assets() const;
1173      private:
1174        Content();
1175        Content(const Poppler::RichMediaAnnotation::Content&);
1176    };
1177    class Activation
1178    {
1179      public:
1180        enum Condition {
1181          PageOpened,   ///< Activate when page is opened.
1182          PageVisible,  ///< Activate when page becomes visible.
1183          UserAction    ///< Activate when user interacts with the annotation.
1184        };
1185        ~Activation();
1186        Condition condition() const;
1187      private:
1188        Activation();
1189        Activation(const Poppler::RichMediaAnnotation::Activation&);
1190
1191    };
1192    class Deactivation
1193    {
1194      public:
1195        enum Condition {
1196          PageClosed,     ///< Deactivate when page is closed.
1197          PageInvisible,  ///< Deactivate when page becomes invisible.
1198          UserAction      ///< Deactivate when user interacts with the annotation.
1199        };
1200
1201        Condition condition() const;
1202        ~Deactivation();
1203      private:
1204        Deactivation();
1205        Deactivation(const Poppler::RichMediaAnnotation::Deactivation&);
1206    };
1207    class Settings
1208    {
1209      public:
1210        Poppler::RichMediaAnnotation::Activation* activation() const;
1211        Poppler::RichMediaAnnotation::Deactivation* deactivation() const;
1212        ~Settings();
1213      private:
1214        Settings();
1215        Settings(const Poppler::RichMediaAnnotation::Settings&);
1216    };
1217    Poppler::RichMediaAnnotation::Settings* settings() const;
1218    Poppler::RichMediaAnnotation::Content* content() const;
1219
1220  private:
1221    RichMediaAnnotation();
1222
1223}; // class RichMediaAnnotation
1224%End
1225
1226
1227
1228}; // namespace Poppler
1229
1230/* kate: indent-width 4; space-indent on; hl c++; indent-mode cstyle; */
1231