beta-0.89.2
[luatex.git] / source / libs / poppler / poppler-src / poppler / Annot.h
blobd90c8080ffed878524acb0af60fac20b17443a1d
1 //========================================================================
2 //
3 // Annot.h
4 //
5 // Copyright 2000-2003 Glyph & Cog, LLC
6 //
7 //========================================================================
9 //========================================================================
11 // Modified under the Poppler project - http://poppler.freedesktop.org
13 // All changes made under the Poppler project to this file are licensed
14 // under GPL version 2 or later
16 // Copyright (C) 2006 Scott Turner <scotty1024@mac.com>
17 // Copyright (C) 2007, 2008 Julien Rebetez <julienr@svn.gnome.org>
18 // Copyright (C) 2007-2011, 2013, 2015 Carlos Garcia Campos <carlosgc@gnome.org>
19 // Copyright (C) 2007, 2008 Iñigo Martínez <inigomartinez@gmail.com>
20 // Copyright (C) 2008 Michael Vrable <mvrable@cs.ucsd.edu>
21 // Copyright (C) 2008 Hugo Mercier <hmercier31@gmail.com>
22 // Copyright (C) 2008 Pino Toscano <pino@kde.org>
23 // Copyright (C) 2008 Tomas Are Haavet <tomasare@gmail.com>
24 // Copyright (C) 2009-2011, 2013 Albert Astals Cid <aacid@kde.org>
25 // Copyright (C) 2012, 2013 Fabio D'Urso <fabiodurso@hotmail.it>
26 // Copyright (C) 2012, 2015 Tobias Koenig <tokoe@kdab.com>
27 // Copyright (C) 2013 Thomas Freitag <Thomas.Freitag@alfa.de>
28 // Copyright (C) 2013 Adrian Johnson <ajohnson@redneon.com>
30 // To see a description of the changes please see the Changelog file that
31 // came with your tarball or type make ChangeLog if you are building from git
33 //========================================================================
35 #ifndef ANNOT_H
36 #define ANNOT_H
38 #ifdef USE_GCC_PRAGMAS
39 #pragma interface
40 #endif
42 #include "Object.h"
44 class XRef;
45 class Gfx;
46 class CharCodeToUnicode;
47 class GfxFont;
48 class GfxResources;
49 class Page;
50 class PDFDoc;
51 class Form;
52 class FormWidget;
53 class FormField;
54 class FormFieldChoice;
55 class PDFRectangle;
56 class Movie;
57 class LinkAction;
58 class Sound;
59 class FileSpec;
61 enum AnnotLineEndingStyle {
62 annotLineEndingSquare, // Square
63 annotLineEndingCircle, // Circle
64 annotLineEndingDiamond, // Diamond
65 annotLineEndingOpenArrow, // OpenArrow
66 annotLineEndingClosedArrow, // ClosedArrow
67 annotLineEndingNone, // None
68 annotLineEndingButt, // Butt
69 annotLineEndingROpenArrow, // ROpenArrow
70 annotLineEndingRClosedArrow, // RClosedArrow
71 annotLineEndingSlash // Slash
74 enum AnnotExternalDataType {
75 annotExternalDataMarkupUnknown,
76 annotExternalDataMarkup3D // Markup3D
79 //------------------------------------------------------------------------
80 // AnnotCoord
81 //------------------------------------------------------------------------
83 class AnnotCoord {
84 public:
86 AnnotCoord() : x(0), y(0) { }
87 AnnotCoord(double _x, double _y) : x(_x), y(_y) { }
89 double getX() const { return x; }
90 double getY() const { return y; }
92 protected:
94 double x, y;
97 //------------------------------------------------------------------------
98 // AnnotPath
99 //------------------------------------------------------------------------
101 class AnnotPath {
102 public:
103 AnnotPath();
104 AnnotPath(Array *array);
105 AnnotPath(AnnotCoord **coords, int coordLength);
106 ~AnnotPath();
108 double getX(int coord) const;
109 double getY(int coord) const;
110 AnnotCoord *getCoord(int coord) const;
111 int getCoordsLength() const { return coordsLength; }
112 protected:
113 AnnotCoord **coords;
114 int coordsLength;
116 void parsePathArray(Array *array);
119 //------------------------------------------------------------------------
120 // AnnotCalloutLine
121 //------------------------------------------------------------------------
123 class AnnotCalloutLine {
124 public:
126 AnnotCalloutLine(double x1, double y1, double x2, double y2);
127 virtual ~AnnotCalloutLine() { }
129 double getX1() const { return coord1.getX(); }
130 double getY1() const { return coord1.getY(); }
131 double getX2() const { return coord2.getX(); }
132 double getY2() const { return coord2.getY(); }
134 protected:
136 AnnotCoord coord1, coord2;
139 //------------------------------------------------------------------------
140 // AnnotCalloutMultiLine
141 //------------------------------------------------------------------------
143 class AnnotCalloutMultiLine: public AnnotCalloutLine {
144 public:
146 AnnotCalloutMultiLine(double x1, double y1, double x2, double y2,
147 double x3, double y3);
149 double getX3() const { return coord3.getX(); }
150 double getY3() const { return coord3.getY(); }
152 protected:
154 AnnotCoord coord3;
157 //------------------------------------------------------------------------
158 // AnnotBorderEffect
159 //------------------------------------------------------------------------
161 class AnnotBorderEffect {
162 public:
164 enum AnnotBorderEffectType {
165 borderEffectNoEffect, // S
166 borderEffectCloudy // C
169 AnnotBorderEffect(Dict *dict);
171 AnnotBorderEffectType getEffectType() const { return effectType; }
172 double getIntensity() const { return intensity; }
174 private:
176 AnnotBorderEffectType effectType; // S (Default S)
177 double intensity; // I (Default 0)
180 //------------------------------------------------------------------------
181 // AnnotQuadrilateral
182 //------------------------------------------------------------------------
184 class AnnotQuadrilaterals {
185 public:
186 class AnnotQuadrilateral {
187 public:
188 AnnotQuadrilateral(double x1, double y1, double x2, double y2, double x3,
189 double y3, double x4, double y4);
191 AnnotCoord coord1, coord2, coord3, coord4;
194 AnnotQuadrilaterals(Array *array, PDFRectangle *rect);
195 AnnotQuadrilaterals(AnnotQuadrilateral **quads, int quadsLength);
196 ~AnnotQuadrilaterals();
198 double getX1(int quadrilateral);
199 double getY1(int quadrilateral);
200 double getX2(int quadrilateral);
201 double getY2(int quadrilateral);
202 double getX3(int quadrilateral);
203 double getY3(int quadrilateral);
204 double getX4(int quadrilateral);
205 double getY4(int quadrilateral);
206 int getQuadrilateralsLength() const { return quadrilateralsLength; }
207 protected:
209 AnnotQuadrilateral** quadrilaterals;
210 int quadrilateralsLength;
213 //------------------------------------------------------------------------
214 // AnnotBorder
215 //------------------------------------------------------------------------
217 class AnnotBorder {
218 public:
219 enum AnnotBorderType {
220 typeArray,
221 typeBS
224 enum AnnotBorderStyle {
225 borderSolid, // Solid
226 borderDashed, // Dashed
227 borderBeveled, // Beveled
228 borderInset, // Inset
229 borderUnderlined // Underlined
232 virtual ~AnnotBorder();
234 virtual void setWidth(double new_width) { width = new_width; }
236 virtual AnnotBorderType getType() const = 0;
237 virtual double getWidth() const { return width; }
238 virtual int getDashLength() const { return dashLength; }
239 virtual double *getDash() const { return dash; }
240 virtual AnnotBorderStyle getStyle() const { return style; }
242 virtual void writeToObject(XRef *xref, Object *obj1) const = 0;
244 protected:
245 AnnotBorder();
247 GBool parseDashArray(Object *dashObj);
249 AnnotBorderType type;
250 double width;
251 static const int DASH_LIMIT = 10; // implementation note 82 in Appendix H.
252 int dashLength;
253 double *dash;
254 AnnotBorderStyle style;
257 //------------------------------------------------------------------------
258 // AnnotBorderArray
259 //------------------------------------------------------------------------
261 class AnnotBorderArray: public AnnotBorder {
262 public:
263 AnnotBorderArray();
264 AnnotBorderArray(Array *array);
266 void setHorizontalCorner(double hc) { horizontalCorner = hc; }
267 void setVerticalCorner(double vc) { verticalCorner = vc; }
269 double getHorizontalCorner() const { return horizontalCorner; }
270 double getVerticalCorner() const { return verticalCorner; }
272 private:
273 virtual AnnotBorderType getType() const { return typeArray; }
274 virtual void writeToObject(XRef *xref, Object *obj1) const;
276 double horizontalCorner; // (Default 0)
277 double verticalCorner; // (Default 0)
278 // double width; // (Default 1) (inherited from AnnotBorder)
281 //------------------------------------------------------------------------
282 // AnnotBorderBS
283 //------------------------------------------------------------------------
285 class AnnotBorderBS: public AnnotBorder {
286 public:
288 AnnotBorderBS();
289 AnnotBorderBS(Dict *dict);
291 private:
292 virtual AnnotBorderType getType() const { return typeBS; }
293 virtual void writeToObject(XRef *xref, Object *obj1) const;
295 const char *getStyleName() const;
297 // double width; // W (Default 1) (inherited from AnnotBorder)
298 // AnnotBorderStyle style; // S (Default S) (inherited from AnnotBorder)
299 // double *dash; // D (Default [3]) (inherited from AnnotBorder)
302 //------------------------------------------------------------------------
303 // AnnotColor
304 //------------------------------------------------------------------------
306 class AnnotColor {
307 public:
309 enum AnnotColorSpace {
310 colorTransparent = 0,
311 colorGray = 1,
312 colorRGB = 3,
313 colorCMYK = 4
316 AnnotColor();
317 AnnotColor(double gray);
318 AnnotColor(double r, double g, double b);
319 AnnotColor(double c, double m, double y, double k);
320 AnnotColor(Array *array, int adjust = 0);
322 void adjustColor(int adjust);
324 AnnotColorSpace getSpace() const { return (AnnotColorSpace) length; }
325 const double *getValues() const { return values; }
327 void writeToObject(XRef *xref, Object *dest) const;
329 private:
331 double values[4];
332 int length;
335 //------------------------------------------------------------------------
336 // AnnotIconFit
337 //------------------------------------------------------------------------
339 class AnnotIconFit {
340 public:
342 enum AnnotIconFitScaleWhen {
343 scaleAlways, // A
344 scaleBigger, // B
345 scaleSmaller, // S
346 scaleNever // N
349 enum AnnotIconFitScale {
350 scaleAnamorphic, // A
351 scaleProportional // P
354 AnnotIconFit(Dict *dict);
356 AnnotIconFitScaleWhen getScaleWhen() { return scaleWhen; }
357 AnnotIconFitScale getScale() { return scale; }
358 double getLeft() { return left; }
359 double getBottom() { return bottom; }
360 bool getFullyBounds() { return fullyBounds; }
362 protected:
364 AnnotIconFitScaleWhen scaleWhen; // SW (Default A)
365 AnnotIconFitScale scale; // S (Default P)
366 double left; // A (Default [0.5 0.5]
367 double bottom; // Only if scale is P
368 bool fullyBounds; // FB (Default false)
371 //------------------------------------------------------------------------
372 // AnnotAppearance
373 //------------------------------------------------------------------------
375 class AnnotAppearance {
376 public:
378 enum AnnotAppearanceType {
379 appearNormal,
380 appearRollover,
381 appearDown
384 AnnotAppearance(PDFDoc *docA, Object *dict);
385 ~AnnotAppearance();
387 // State is ignored if no subdictionary is present
388 void getAppearanceStream(AnnotAppearanceType type, const char *state, Object *dest);
390 // Access keys in normal appearance subdictionary (N)
391 GooString * getStateKey(int i);
392 int getNumStates();
394 // Removes all associated streams in the xref table. Caller is required to
395 // reset parent annotation's AP and AS after this call.
396 void removeAllStreams();
398 // Test if this AnnotAppearance references the specified stream
399 GBool referencesStream(Ref targetStreamRef);
401 private:
402 static GBool referencesStream(Object *stateObj, Ref targetStreamRef);
403 void removeStream(Ref refToStream);
404 void removeStateStreams(Object *state);
406 protected:
407 PDFDoc *doc;
408 XRef *xref; // the xref table for this PDF file
409 Object appearDict; // Annotation's AP
412 //------------------------------------------------------------------------
413 // AnnotAppearanceCharacs
414 //------------------------------------------------------------------------
416 class AnnotAppearanceCharacs {
417 public:
419 enum AnnotAppearanceCharacsTextPos {
420 captionNoIcon, // 0
421 captionNoCaption, // 1
422 captionBelow, // 2
423 captionAbove, // 3
424 captionRight, // 4
425 captionLeft, // 5
426 captionOverlaid // 6
429 AnnotAppearanceCharacs(Dict *dict);
430 ~AnnotAppearanceCharacs();
432 int getRotation() { return rotation; }
433 AnnotColor *getBorderColor() { return borderColor; }
434 AnnotColor *getBackColor() { return backColor; }
435 GooString *getNormalCaption() { return normalCaption; }
436 GooString *getRolloverCaption() { return rolloverCaption; }
437 GooString *getAlternateCaption() { return alternateCaption; }
438 AnnotIconFit *getIconFit() { return iconFit; }
439 AnnotAppearanceCharacsTextPos getPosition() { return position; }
441 protected:
443 int rotation; // R (Default 0)
444 AnnotColor *borderColor; // BC
445 AnnotColor *backColor; // BG
446 GooString *normalCaption; // CA
447 GooString *rolloverCaption; // RC
448 GooString *alternateCaption; // AC
449 // I
450 // RI
451 // IX
452 AnnotIconFit *iconFit; // IF
453 AnnotAppearanceCharacsTextPos position; // TP (Default 0)
456 //------------------------------------------------------------------------
457 // AnnotAppearanceBBox
458 //------------------------------------------------------------------------
460 class AnnotAppearanceBBox
462 public:
463 AnnotAppearanceBBox(PDFRectangle *init);
465 void setBorderWidth(double w) { borderWidth = w; }
467 // The following functions operate on coords relative to [origX origY]
468 void extendTo(double x, double y);
469 void getBBoxRect(double bbox[4]) const;
471 // Get boundaries in page coordinates
472 double getPageXMin() const;
473 double getPageYMin() const;
474 double getPageXMax() const;
475 double getPageYMax() const;
477 private:
478 double origX, origY, borderWidth;
479 double minX, minY, maxX, maxY;
482 //------------------------------------------------------------------------
483 // Annot
484 //------------------------------------------------------------------------
486 class Annot {
487 friend class Annots;
488 friend class Page;
489 public:
490 enum AnnotFlag {
491 flagUnknown = 0x0000,
492 flagInvisible = 0x0001,
493 flagHidden = 0x0002,
494 flagPrint = 0x0004,
495 flagNoZoom = 0x0008,
496 flagNoRotate = 0x0010,
497 flagNoView = 0x0020,
498 flagReadOnly = 0x0040,
499 flagLocked = 0x0080,
500 flagToggleNoView = 0x0100,
501 flagLockedContents = 0x0200
504 enum AnnotSubtype {
505 typeUnknown, // 0
506 typeText, // Text 1
507 typeLink, // Link 2
508 typeFreeText, // FreeText 3
509 typeLine, // Line 4
510 typeSquare, // Square 5
511 typeCircle, // Circle 6
512 typePolygon, // Polygon 7
513 typePolyLine, // PolyLine 8
514 typeHighlight, // Highlight 9
515 typeUnderline, // Underline 10
516 typeSquiggly, // Squiggly 11
517 typeStrikeOut, // StrikeOut 12
518 typeStamp, // Stamp 13
519 typeCaret, // Caret 14
520 typeInk, // Ink 15
521 typePopup, // Popup 16
522 typeFileAttachment, // FileAttachment 17
523 typeSound, // Sound 18
524 typeMovie, // Movie 19
525 typeWidget, // Widget 20
526 typeScreen, // Screen 21
527 typePrinterMark, // PrinterMark 22
528 typeTrapNet, // TrapNet 23
529 typeWatermark, // Watermark 24
530 type3D, // 3D 25
531 typeRichMedia // RichMedia 26
535 * Describes the additional actions of a screen or widget annotation.
537 enum AdditionalActionsType {
538 actionCursorEntering, ///< Performed when the cursor enters the annotation's active area
539 actionCursorLeaving, ///< Performed when the cursor exists the annotation's active area
540 actionMousePressed, ///< Performed when the mouse button is pressed inside the annotation's active area
541 actionMouseReleased, ///< Performed when the mouse button is released inside the annotation's active area
542 actionFocusIn, ///< Performed when the annotation receives the input focus
543 actionFocusOut, ///< Performed when the annotation loses the input focus
544 actionPageOpening, ///< Performed when the page containing the annotation is opened
545 actionPageClosing, ///< Performed when the page containing the annotation is closed
546 actionPageVisible, ///< Performed when the page containing the annotation becomes visible
547 actionPageInvisible ///< Performed when the page containing the annotation becomes invisible
550 enum FormAdditionalActionsType {
551 actionFieldModified, ///< Performed when the when the user modifies the field
552 actionFormatField, ///< Performed before the field is formatted to display its value
553 actionValidateField, ///< Performed when the field value changes
554 actionCalculateField, ///< Performed when the field needs to be recalculated
557 Annot(PDFDoc *docA, PDFRectangle *rectA);
558 Annot(PDFDoc *docA, Dict *dict);
559 Annot(PDFDoc *docA, Dict *dict, Object *obj);
560 GBool isOk() { return ok; }
562 void incRefCnt();
563 void decRefCnt();
565 virtual void draw(Gfx *gfx, GBool printing);
566 // Get the resource dict of the appearance stream
567 virtual Object *getAppearanceResDict(Object *dest);
569 GBool match(Ref *refA)
570 { return ref.num == refA->num && ref.gen == refA->gen; }
572 double getXMin();
573 double getYMin();
574 double getXMax();
575 double getYMax();
577 double getFontSize() { return fontSize; }
579 void setRect(PDFRectangle *rect);
580 void setRect(double x1, double y1, double x2, double y2);
582 // Sets the annot contents to new_content
583 // new_content should never be NULL
584 virtual void setContents(GooString *new_content);
585 void setName(GooString *new_name);
586 void setModified(GooString *new_date);
587 void setFlags(Guint new_flags);
589 void setBorder(AnnotBorder *new_border); // Takes ownership
591 // The annotation takes the ownership of
592 // new_color.
593 void setColor(AnnotColor *new_color);
595 void setAppearanceState(const char *state);
597 // getters
598 PDFDoc *getDoc() const { return doc; }
599 XRef *getXRef() const { return xref; }
600 GBool getHasRef() const { return hasRef; }
601 Ref getRef() const { return ref; }
602 AnnotSubtype getType() const { return type; }
603 PDFRectangle *getRect() const { return rect; }
604 void getRect(double *x1, double *y1, double *x2, double *y2) const;
605 GooString *getContents() const { return contents; }
606 int getPageNum() const { return page; }
607 GooString *getName() const { return name; }
608 GooString *getModified() const { return modified; }
609 Guint getFlags() const { return flags; }
610 AnnotAppearance *getAppearStreams() const { return appearStreams; }
611 GooString *getAppearState() const { return appearState; }
612 AnnotBorder *getBorder() const { return border; }
613 AnnotColor *getColor() const { return color; }
614 int getTreeKey() const { return treeKey; }
616 int getId() { return ref.num; }
618 // Check if point is inside the annot rectangle.
619 GBool inRect(double x, double y) const;
621 private:
622 void readArrayNum(Object *pdfArray, int key, double *value);
623 // write vStr[i:j[ in appearBuf
625 void initialize (PDFDoc *docA, Dict *dict);
626 void setPage (int new_page, GBool updateP); // Called by Page::addAnnot and Annots ctor
629 protected:
630 virtual ~Annot();
631 virtual void removeReferencedObjects(); // Called by Page::removeAnnot
632 void setColor(AnnotColor *color, GBool fill);
633 void setLineStyleForBorder(AnnotBorder *border);
634 void drawCircle(double cx, double cy, double r, GBool fill);
635 void drawCircleTopLeft(double cx, double cy, double r);
636 void drawCircleBottomRight(double cx, double cy, double r);
637 void layoutText(GooString *text, GooString *outBuf, int *i, GfxFont *font,
638 double *width, double widthLimit, int *charCount,
639 GBool noReencode);
640 void writeString(GooString *str, GooString *appearBuf);
641 void createForm(double *bbox, GBool transparencyGroup, Object *resDict, Object *aStream);
642 void createResourcesDict(const char *formName, Object *formStream, const char *stateName,
643 double opacity, const char *blendMode, Object *resDict);
644 GBool isVisible(GBool printing);
645 int getRotation() const;
647 // Updates the field key of the annotation dictionary
648 // and sets M to the current time
649 void update(const char *key, Object *value);
651 // Delete appearance streams and reset appearance state
652 void invalidateAppearance();
654 int refCnt;
656 Object annotObj;
658 // required data
659 AnnotSubtype type; // Annotation type
660 PDFRectangle *rect; // Rect
662 // optional data
663 GooString *contents; // Contents
664 int page; // P
665 GooString *name; // NM
666 GooString *modified; // M
667 Guint flags; // F (must be a 32 bit unsigned int)
668 AnnotAppearance *appearStreams; // AP
669 Object appearance; // a reference to the Form XObject stream
670 // for the normal appearance
671 AnnotAppearanceBBox *appearBBox; // BBox of generated appearance
672 GooString *appearState; // AS
673 int treeKey; // Struct Parent;
674 Object oc; // OC
676 PDFDoc *doc;
677 XRef *xref; // the xref table for this PDF file
678 Ref ref; // object ref identifying this annotation
679 GooString *appearBuf;
680 AnnotBorder *border; // Border, BS
681 AnnotColor *color; // C
682 double fontSize;
683 GBool ok;
685 bool hasRef;
686 #if MULTITHREADED
687 GooMutex mutex;
688 #endif
691 //------------------------------------------------------------------------
692 // AnnotPopup
693 //------------------------------------------------------------------------
695 class AnnotPopup: public Annot {
696 public:
697 AnnotPopup(PDFDoc *docA, PDFRectangle *rect);
698 AnnotPopup(PDFDoc *docA, Dict *dict, Object *obj);
699 ~AnnotPopup();
701 Object *getParent(Object *obj) { return parent.fetch (xref, obj); }
702 Object *getParentNF() { return &parent; }
703 void setParent(Object *parentA);
704 void setParent(Annot *parentA);
705 GBool getOpen() const { return open; }
706 void setOpen(GBool openA);
708 protected:
709 void initialize(PDFDoc *docA, Dict *dict);
711 Object parent; // Parent
712 GBool open; // Open
715 //------------------------------------------------------------------------
716 // AnnotMarkup
717 //------------------------------------------------------------------------
719 class AnnotMarkup: public Annot {
720 public:
721 enum AnnotMarkupReplyType {
722 replyTypeR, // R
723 replyTypeGroup // Group
726 AnnotMarkup(PDFDoc *docA, PDFRectangle *rect);
727 AnnotMarkup(PDFDoc *docA, Dict *dict, Object *obj);
728 virtual ~AnnotMarkup();
730 // getters
731 GooString *getLabel() const { return label; }
732 AnnotPopup *getPopup() const { return popup; }
733 double getOpacity() const { return opacity; }
734 // getRC
735 GooString *getDate() const { return date; }
736 int getInReplyToID() const { return inReplyTo.num; }
737 GooString *getSubject() const { return subject; }
738 AnnotMarkupReplyType getReplyTo() const { return replyTo; }
739 AnnotExternalDataType getExData() const { return exData; }
741 // The annotation takes the ownership of new_popup
742 void setPopup(AnnotPopup *new_popup);
743 void setLabel(GooString *new_label);
744 void setOpacity(double opacityA);
745 void setDate(GooString *new_date);
747 protected:
748 virtual void removeReferencedObjects();
750 GooString *label; // T (Default autor)
751 AnnotPopup *popup; // Popup
752 double opacity; // CA (Default 1.0)
753 // RC
754 GooString *date; // CreationDate
755 Ref inReplyTo; // IRT
756 GooString *subject; // Subj
757 AnnotMarkupReplyType replyTo; // RT (Default R)
758 // this object is overrided by the custom intent fields defined in some
759 // annotation types.
760 //GooString *intent; // IT
761 AnnotExternalDataType exData; // ExData
763 private:
764 void initialize(PDFDoc *docA, Dict *dict, Object *obj);
767 //------------------------------------------------------------------------
768 // AnnotText
769 //------------------------------------------------------------------------
771 class AnnotText: public AnnotMarkup {
772 public:
773 enum AnnotTextState {
774 stateUnknown,
775 // Marked state model
776 stateMarked, // Marked
777 stateUnmarked, // Unmarked
778 // Review state model
779 stateAccepted, // Accepted
780 stateRejected, // Rejected
781 stateCancelled, // Cancelled
782 stateCompleted, // Completed
783 stateNone // None
786 AnnotText(PDFDoc *docA, PDFRectangle *rect);
787 AnnotText(PDFDoc *docA, Dict *dict, Object *obj);
788 ~AnnotText();
790 virtual void draw(Gfx *gfx, GBool printing);
792 // getters
793 GBool getOpen() const { return open; }
794 GooString *getIcon() const { return icon; }
795 AnnotTextState getState() const { return state; }
797 void setOpen(GBool openA);
798 void setIcon(GooString *new_icon);
800 private:
802 void initialize(PDFDoc *docA, Dict *dict);
804 GBool open; // Open (Default false)
805 GooString *icon; // Name (Default Note)
806 AnnotTextState state; // State (Default Umarked if
807 // StateModel Marked
808 // None if StareModel Review)
811 //------------------------------------------------------------------------
812 // AnnotMovie
813 //------------------------------------------------------------------------
817 class AnnotMovie: public Annot {
818 public:
819 AnnotMovie(PDFDoc *docA, PDFRectangle *rect, Movie *movieA);
820 AnnotMovie(PDFDoc *docA, Dict *dict, Object *obj);
821 ~AnnotMovie();
823 virtual void draw(Gfx *gfx, GBool printing);
825 GooString* getTitle() { return title; }
826 Movie* getMovie() { return movie; }
828 private:
829 void initialize(PDFDoc *docA, Dict *dict);
831 GooString* title; // T
832 Movie* movie; // Movie + A
836 //------------------------------------------------------------------------
837 // AnnotScreen
838 //------------------------------------------------------------------------
840 class AnnotScreen: public Annot {
841 public:
843 AnnotScreen(PDFDoc *docA, PDFRectangle *rect);
844 AnnotScreen(PDFDoc *docA, Dict *dict, Object *obj);
845 ~AnnotScreen();
847 GooString* getTitle() { return title; }
849 AnnotAppearanceCharacs *getAppearCharacs() { return appearCharacs; }
850 LinkAction* getAction() { return action; }
851 LinkAction *getAdditionalAction(AdditionalActionsType type);
853 private:
854 void initialize(PDFDoc *docA, Dict *dict);
857 GooString* title; // T
859 AnnotAppearanceCharacs* appearCharacs; // MK
861 LinkAction *action; // A
862 Object additionalActions; // AA
865 //------------------------------------------------------------------------
866 // AnnotLink
867 //------------------------------------------------------------------------
869 class AnnotLink: public Annot {
870 public:
872 enum AnnotLinkEffect {
873 effectNone, // N
874 effectInvert, // I
875 effectOutline, // O
876 effectPush // P
879 AnnotLink(PDFDoc *docA, PDFRectangle *rect);
880 AnnotLink(PDFDoc *docA, Dict *dict, Object *obj);
881 virtual ~AnnotLink();
883 virtual void draw(Gfx *gfx, GBool printing);
885 // getters
886 LinkAction *getAction() const { return action; }
887 AnnotLinkEffect getLinkEffect() const { return linkEffect; }
888 Dict *getUriAction() const { return uriAction; }
889 AnnotQuadrilaterals *getQuadrilaterals() const { return quadrilaterals; }
891 protected:
893 void initialize(PDFDoc *docA, Dict *dict);
895 LinkAction *action; // A, Dest
896 AnnotLinkEffect linkEffect; // H (Default I)
897 Dict *uriAction; // PA
899 AnnotQuadrilaterals *quadrilaterals; // QuadPoints
902 //------------------------------------------------------------------------
903 // AnnotFreeText
904 //------------------------------------------------------------------------
906 class AnnotFreeText: public AnnotMarkup {
907 public:
909 enum AnnotFreeTextQuadding {
910 quaddingLeftJustified, // 0
911 quaddingCentered, // 1
912 quaddingRightJustified // 2
915 enum AnnotFreeTextIntent {
916 intentFreeText, // FreeText
917 intentFreeTextCallout, // FreeTextCallout
918 intentFreeTextTypeWriter // FreeTextTypeWriter
921 AnnotFreeText(PDFDoc *docA, PDFRectangle *rect, GooString *da);
922 AnnotFreeText(PDFDoc *docA, Dict *dict, Object *obj);
923 ~AnnotFreeText();
925 virtual void draw(Gfx *gfx, GBool printing);
926 virtual Object *getAppearanceResDict(Object *dest);
927 virtual void setContents(GooString *new_content);
929 void setAppearanceString(GooString *new_string);
930 void setQuadding(AnnotFreeTextQuadding new_quadding);
931 void setStyleString(GooString *new_string);
932 void setCalloutLine(AnnotCalloutLine *line);
933 void setIntent(AnnotFreeTextIntent new_intent);
935 // getters
936 GooString *getAppearanceString() const { return appearanceString; }
937 AnnotFreeTextQuadding getQuadding() const { return quadding; }
938 // return rc
939 GooString *getStyleString() const { return styleString; }
940 AnnotCalloutLine *getCalloutLine() const { return calloutLine; }
941 AnnotFreeTextIntent getIntent() const { return intent; }
942 AnnotBorderEffect *getBorderEffect() const { return borderEffect; }
943 PDFRectangle *getRectangle() const { return rectangle; }
944 AnnotLineEndingStyle getEndStyle() const { return endStyle; }
946 protected:
948 void initialize(PDFDoc *docA, Dict *dict);
949 static void parseAppearanceString(GooString *da, double &fontsize, AnnotColor* &fontcolor);
950 void generateFreeTextAppearance();
952 // required
953 GooString *appearanceString; // DA
955 // optional
956 AnnotFreeTextQuadding quadding; // Q (Default 0)
957 // RC
958 GooString *styleString; // DS
959 AnnotCalloutLine *calloutLine; // CL
960 AnnotFreeTextIntent intent; // IT
961 AnnotBorderEffect *borderEffect; // BE
962 PDFRectangle *rectangle; // RD
963 // inherited from Annot
964 // AnnotBorderBS border; // BS
965 AnnotLineEndingStyle endStyle; // LE (Default None)
968 //------------------------------------------------------------------------
969 // AnnotLine
970 //------------------------------------------------------------------------
972 class AnnotLine: public AnnotMarkup {
973 public:
975 enum AnnotLineIntent {
976 intentLineArrow, // LineArrow
977 intentLineDimension // LineDimension
980 enum AnnotLineCaptionPos {
981 captionPosInline, // Inline
982 captionPosTop // Top
985 AnnotLine(PDFDoc *docA, PDFRectangle *rect);
986 AnnotLine(PDFDoc *docA, Dict *dict, Object *obj);
987 ~AnnotLine();
989 virtual void draw(Gfx *gfx, GBool printing);
990 virtual Object *getAppearanceResDict(Object *dest);
991 virtual void setContents(GooString *new_content);
993 void setVertices(double x1, double y1, double x2, double y2);
994 void setStartEndStyle(AnnotLineEndingStyle start, AnnotLineEndingStyle end);
995 void setInteriorColor(AnnotColor *new_color);
996 void setLeaderLineLength(double len);
997 void setLeaderLineExtension(double len);
998 void setCaption(bool new_cap);
999 void setIntent(AnnotLineIntent new_intent);
1001 // getters
1002 AnnotLineEndingStyle getStartStyle() const { return startStyle; }
1003 AnnotLineEndingStyle getEndStyle() const { return endStyle; }
1004 AnnotColor *getInteriorColor() const { return interiorColor; }
1005 double getLeaderLineLength() const { return leaderLineLength; }
1006 double getLeaderLineExtension() const { return leaderLineExtension; }
1007 bool getCaption() const { return caption; }
1008 AnnotLineIntent getIntent() const { return intent; }
1009 double getLeaderLineOffset() const { return leaderLineOffset; }
1010 AnnotLineCaptionPos getCaptionPos() const { return captionPos; }
1011 Dict *getMeasure() const { return measure; }
1012 double getCaptionTextHorizontal() const { return captionTextHorizontal; }
1013 double getCaptionTextVertical() const { return captionTextVertical; }
1014 double getX1() const { return coord1->getX(); }
1015 double getY1() const { return coord1->getY(); }
1016 double getX2() const { return coord2->getX(); }
1017 double getY2() const { return coord2->getY(); }
1019 protected:
1021 void initialize(PDFDoc *docA, Dict *dict);
1022 void generateLineAppearance();
1024 // required
1025 AnnotCoord *coord1, *coord2;
1027 // optional
1028 // inherited from Annot
1029 // AnnotBorderBS border; // BS
1030 AnnotLineEndingStyle startStyle; // LE (Default [/None /None])
1031 AnnotLineEndingStyle endStyle; //
1032 AnnotColor *interiorColor; // IC
1033 double leaderLineLength; // LL (Default 0)
1034 double leaderLineExtension; // LLE (Default 0)
1035 bool caption; // Cap (Default false)
1036 AnnotLineIntent intent; // IT
1037 double leaderLineOffset; // LLO
1038 AnnotLineCaptionPos captionPos; // CP (Default Inline)
1039 Dict *measure; // Measure
1040 double captionTextHorizontal; // CO (Default [0, 0])
1041 double captionTextVertical; //
1044 //------------------------------------------------------------------------
1045 // AnnotTextMarkup
1046 //------------------------------------------------------------------------
1048 class AnnotTextMarkup: public AnnotMarkup {
1049 public:
1051 AnnotTextMarkup(PDFDoc *docA, PDFRectangle *rect, AnnotSubtype subType);
1052 AnnotTextMarkup(PDFDoc *docA, Dict *dict, Object *obj);
1053 virtual ~AnnotTextMarkup();
1055 virtual void draw(Gfx *gfx, GBool printing);
1057 // typeHighlight, typeUnderline, typeSquiggly or typeStrikeOut
1058 void setType(AnnotSubtype new_type);
1060 void setQuadrilaterals(AnnotQuadrilaterals *quadPoints);
1062 AnnotQuadrilaterals *getQuadrilaterals() const { return quadrilaterals; }
1064 protected:
1066 void initialize(PDFDoc *docA, Dict *dict);
1068 AnnotQuadrilaterals *quadrilaterals; // QuadPoints
1071 //------------------------------------------------------------------------
1072 // AnnotStamp
1073 //------------------------------------------------------------------------
1075 class AnnotStamp: public AnnotMarkup {
1076 public:
1078 AnnotStamp(PDFDoc *docA, PDFRectangle *rect);
1079 AnnotStamp(PDFDoc *docA, Dict *dict, Object *obj);
1080 ~AnnotStamp();
1082 void setIcon(GooString *new_icon);
1084 // getters
1085 GooString *getIcon() const { return icon; }
1087 private:
1089 void initialize(PDFDoc *docA, Dict *dict);
1091 GooString *icon; // Name (Default Draft)
1094 //------------------------------------------------------------------------
1095 // AnnotGeometry
1096 //------------------------------------------------------------------------
1098 class AnnotGeometry: public AnnotMarkup {
1099 public:
1101 AnnotGeometry(PDFDoc *docA, PDFRectangle *rect, AnnotSubtype subType);
1102 AnnotGeometry(PDFDoc *docA, Dict *dict, Object *obj);
1103 ~AnnotGeometry();
1105 virtual void draw(Gfx *gfx, GBool printing);
1107 void setType(AnnotSubtype new_type); // typeSquare or typeCircle
1108 void setInteriorColor(AnnotColor *new_color);
1110 // getters
1111 AnnotColor *getInteriorColor() const { return interiorColor; }
1112 AnnotBorderEffect *getBorderEffect() const { return borderEffect; }
1113 PDFRectangle *getGeometryRect() const { return geometryRect; }
1115 private:
1117 void initialize(PDFDoc *docA, Dict *dict);
1119 AnnotColor *interiorColor; // IC
1120 AnnotBorderEffect *borderEffect; // BE
1121 PDFRectangle *geometryRect; // RD (combined with Rect)
1124 //------------------------------------------------------------------------
1125 // AnnotPolygon
1126 //------------------------------------------------------------------------
1128 class AnnotPolygon: public AnnotMarkup {
1129 public:
1131 enum AnnotPolygonIntent {
1132 polygonCloud, // PolygonCloud
1133 polylineDimension, // PolyLineDimension
1134 polygonDimension // PolygonDimension
1137 AnnotPolygon(PDFDoc *docA, PDFRectangle *rect, AnnotSubtype subType);
1138 AnnotPolygon(PDFDoc *docA, Dict *dict, Object *obj);
1139 ~AnnotPolygon();
1141 virtual void draw(Gfx *gfx, GBool printing);
1143 void setType(AnnotSubtype new_type); // typePolygon or typePolyLine
1144 void setVertices(AnnotPath *path);
1145 void setStartEndStyle(AnnotLineEndingStyle start, AnnotLineEndingStyle end);
1146 void setInteriorColor(AnnotColor *new_color);
1147 void setIntent(AnnotPolygonIntent new_intent);
1149 // getters
1150 AnnotPath *getVertices() const { return vertices; }
1151 AnnotLineEndingStyle getStartStyle() const { return startStyle; }
1152 AnnotLineEndingStyle getEndStyle() const { return endStyle; }
1153 AnnotColor *getInteriorColor() const { return interiorColor; }
1154 AnnotBorderEffect *getBorderEffect() const { return borderEffect; }
1155 AnnotPolygonIntent getIntent() const { return intent; }
1157 private:
1159 void initialize(PDFDoc *docA, Dict *dict);
1161 // required
1162 AnnotPath *vertices; // Vertices
1164 // optional
1165 AnnotLineEndingStyle startStyle; // LE (Default [/None /None])
1166 AnnotLineEndingStyle endStyle; //
1167 // inherited from Annot
1168 // AnnotBorderBS border; // BS
1169 AnnotColor *interiorColor; // IC
1170 AnnotBorderEffect *borderEffect; // BE
1171 AnnotPolygonIntent intent; // IT
1172 // Measure
1175 //------------------------------------------------------------------------
1176 // AnnotCaret
1177 //------------------------------------------------------------------------
1179 class AnnotCaret: public AnnotMarkup {
1180 public:
1182 enum AnnotCaretSymbol {
1183 symbolNone, // None
1184 symbolP // P
1187 AnnotCaret(PDFDoc *docA, PDFRectangle *rect);
1188 AnnotCaret(PDFDoc *docA, Dict *dict, Object *obj);
1189 ~AnnotCaret();
1191 void setSymbol(AnnotCaretSymbol new_symbol);
1193 // getters
1194 AnnotCaretSymbol getSymbol() const { return symbol; }
1195 PDFRectangle *getCaretRect() const { return caretRect; }
1197 private:
1199 void initialize(PDFDoc *docA, Dict *dict);
1201 AnnotCaretSymbol symbol; // Sy (Default None)
1202 PDFRectangle *caretRect; // RD (combined with Rect)
1205 //------------------------------------------------------------------------
1206 // AnnotInk
1207 //------------------------------------------------------------------------
1209 class AnnotInk: public AnnotMarkup {
1210 public:
1212 AnnotInk(PDFDoc *docA, PDFRectangle *rect);
1213 AnnotInk(PDFDoc *docA, Dict *dict, Object *obj);
1214 ~AnnotInk();
1216 virtual void draw(Gfx *gfx, GBool printing);
1218 void setInkList(AnnotPath **paths, int n_paths);
1220 // getters
1221 AnnotPath **getInkList() const { return inkList; }
1222 int getInkListLength() const { return inkListLength; }
1224 private:
1226 void initialize(PDFDoc *docA, Dict *dict);
1227 void writeInkList(AnnotPath **paths, int n_paths, Array *dest_array);
1228 void parseInkList(Array *src_array);
1229 void freeInkList();
1231 // required
1232 AnnotPath **inkList; // InkList
1233 int inkListLength;
1235 // optional
1236 // inherited from Annot
1237 // AnnotBorderBS border; // BS
1240 //------------------------------------------------------------------------
1241 // AnnotFileAttachment
1242 //------------------------------------------------------------------------
1244 class AnnotFileAttachment: public AnnotMarkup {
1245 public:
1247 AnnotFileAttachment(PDFDoc *docA, PDFRectangle *rect, GooString *filename);
1248 AnnotFileAttachment(PDFDoc *docA, Dict *dict, Object *obj);
1249 ~AnnotFileAttachment();
1251 virtual void draw(Gfx *gfx, GBool printing);
1253 // getters
1254 Object *getFile() { return &file; }
1255 GooString *getName() const { return name; }
1257 private:
1259 void initialize(PDFDoc *docA, Dict *dict);
1261 // required
1262 Object file; // FS
1264 // optional
1265 GooString *name; // Name
1268 //------------------------------------------------------------------------
1269 // AnnotSound
1270 //------------------------------------------------------------------------
1272 class AnnotSound: public AnnotMarkup {
1273 public:
1275 AnnotSound(PDFDoc *docA, PDFRectangle *rect, Sound *soundA);
1276 AnnotSound(PDFDoc *docA, Dict *dict, Object *obj);
1277 ~AnnotSound();
1279 virtual void draw(Gfx *gfx, GBool printing);
1281 // getters
1282 Sound *getSound() { return sound; }
1283 GooString *getName() const { return name; }
1285 private:
1287 void initialize(PDFDoc *docA, Dict *dict);
1289 // required
1290 Sound *sound; // Sound
1292 // optional
1293 GooString *name; // Name
1296 //------------------------------------------------------------------------
1297 // AnnotWidget
1298 //------------------------------------------------------------------------
1300 class AnnotWidget: public Annot {
1301 public:
1303 enum AnnotWidgetHighlightMode {
1304 highlightModeNone, // N
1305 highlightModeInvert, // I
1306 highlightModeOutline, // O
1307 highlightModePush // P,T
1310 AnnotWidget(PDFDoc *docA, Dict *dict, Object *obj);
1311 AnnotWidget(PDFDoc *docA, Dict *dict, Object *obj, FormField *fieldA);
1312 virtual ~AnnotWidget();
1314 virtual void draw(Gfx *gfx, GBool printing);
1316 void drawBorder();
1317 void drawFormFieldButton(GfxResources *resources, GooString *da);
1318 void drawFormFieldText(GfxResources *resources, GooString *da);
1319 void drawFormFieldChoice(GfxResources *resources, GooString *da);
1320 void generateFieldAppearance ();
1321 void updateAppearanceStream ();
1323 AnnotWidgetHighlightMode getMode() { return mode; }
1324 AnnotAppearanceCharacs *getAppearCharacs() { return appearCharacs; }
1325 LinkAction *getAction() { return action; }
1326 LinkAction *getAdditionalAction(AdditionalActionsType type);
1327 LinkAction *getFormAdditionalAction(FormAdditionalActionsType type);
1328 Dict *getParent() { return parent; }
1330 private:
1332 void initialize(PDFDoc *docA, Dict *dict);
1334 void drawText(GooString *text, GooString *da, GfxResources *resources,
1335 GBool multiline, int comb, int quadding,
1336 GBool txField, GBool forceZapfDingbats,
1337 GBool password=false);
1338 void drawListBox(FormFieldChoice *fieldChoice,
1339 GooString *da, GfxResources *resources, int quadding);
1341 Form *form;
1342 FormField *field; // FormField object for this annotation
1343 AnnotWidgetHighlightMode mode; // H (Default I)
1344 AnnotAppearanceCharacs *appearCharacs; // MK
1345 LinkAction *action; // A
1346 Object additionalActions; // AA
1347 // inherited from Annot
1348 // AnnotBorderBS border; // BS
1349 Dict *parent; // Parent
1350 GBool addDingbatsResource;
1351 Ref updatedAppearanceStream; // {-1,-1} if updateAppearanceStream has never been called
1354 //------------------------------------------------------------------------
1355 // Annot3D
1356 //------------------------------------------------------------------------
1358 class Annot3D: public Annot {
1359 class Activation {
1360 public:
1361 enum ActivationATrigger {
1362 aTriggerUnknown,
1363 aTriggerPageOpened, // PO
1364 aTriggerPageVisible, // PV
1365 aTriggerUserAction // XA
1368 enum ActivationAState {
1369 aStateUnknown,
1370 aStateEnabled, // I
1371 aStateDisabled // L
1374 enum ActivationDTrigger {
1375 dTriggerUnknown,
1376 dTriggerPageClosed, // PC
1377 dTriggerPageInvisible, // PI
1378 dTriggerUserAction // XD
1381 enum ActivationDState {
1382 dStateUnknown,
1383 dStateUninstantiaded, // U
1384 dStateInstantiated, // I
1385 dStateLive // L
1388 Activation(Dict *dict);
1389 private:
1391 ActivationATrigger aTrigger; // A (Default XA)
1392 ActivationAState aState; // AIS (Default L)
1393 ActivationDTrigger dTrigger; // D (Default PI)
1394 ActivationDState dState; // DIS (Default U)
1395 GBool displayToolbar; // TB (Default true)
1396 GBool displayNavigation; // NP (Default false);
1398 public:
1400 Annot3D(PDFDoc *docA, PDFRectangle *rect);
1401 Annot3D(PDFDoc *docA, Dict *dict, Object *obj);
1402 ~Annot3D();
1404 // getters
1406 private:
1408 void initialize(PDFDoc *docA, Dict *dict);
1410 Activation *activation; // 3DA
1413 //------------------------------------------------------------------------
1414 // AnnotRichMedia
1415 //------------------------------------------------------------------------
1417 class AnnotRichMedia: public Annot {
1418 public:
1419 class Params {
1420 public:
1421 Params(Dict *dict);
1422 ~Params();
1424 GooString* getFlashVars() const;
1426 private:
1427 // optional
1428 GooString *flashVars; // FlashVars
1431 class Instance {
1432 public:
1433 enum Type {
1434 type3D, // 3D
1435 typeFlash, // Flash
1436 typeSound, // Sound
1437 typeVideo // Video
1440 Instance(Dict *dict);
1441 ~Instance();
1443 Type getType() const;
1444 Params* getParams() const;
1446 private:
1447 // optional
1448 Type type; // Subtype
1449 Params *params; // Params
1452 class Configuration {
1453 public:
1454 enum Type {
1455 type3D, // 3D
1456 typeFlash, // Flash
1457 typeSound, // Sound
1458 typeVideo // Video
1461 Configuration(Dict *dict);
1462 ~Configuration();
1464 Type getType() const;
1465 GooString* getName() const;
1466 int getInstancesCount() const;
1467 Instance* getInstance(int index) const;
1469 private:
1470 // optional
1471 Type type; // Subtype
1472 GooString *name; // Name
1473 Instance **instances; // Instances
1474 int nInstances;
1477 class Content;
1479 class Asset {
1480 public:
1481 Asset();
1482 ~Asset();
1484 GooString* getName() const;
1485 Object* getFileSpec() const;
1487 private:
1488 friend class AnnotRichMedia::Content;
1490 GooString *name;
1491 Object fileSpec;
1494 class Content {
1495 public:
1496 Content(Dict *dict);
1497 ~Content();
1499 int getConfigurationsCount() const;
1500 Configuration* getConfiguration(int index) const;
1502 int getAssetsCount() const;
1503 Asset* getAsset(int index) const;
1505 private:
1506 // optional
1507 Configuration **configurations; // Configurations
1508 int nConfigurations;
1510 Asset **assets; // Assets
1511 int nAssets;
1514 class Activation {
1515 public:
1516 enum Condition {
1517 conditionPageOpened, // PO
1518 conditionPageVisible, // PV
1519 conditionUserAction // XA
1522 Activation(Dict *dict);
1524 Condition getCondition() const;
1526 private:
1527 // optional
1528 Condition condition;
1531 class Deactivation {
1532 public:
1533 enum Condition {
1534 conditionPageClosed, // PC
1535 conditionPageInvisible, // PI
1536 conditionUserAction // XD
1539 Deactivation(Dict *dict);
1541 Condition getCondition() const;
1543 private:
1544 // optional
1545 Condition condition;
1548 class Settings {
1549 public:
1550 Settings(Dict *dict);
1551 ~Settings();
1553 Activation* getActivation() const;
1554 Deactivation* getDeactivation() const;
1556 private:
1557 // optional
1558 Activation *activation;
1559 Deactivation *deactivation;
1562 AnnotRichMedia(PDFDoc *docA, PDFRectangle *rect);
1563 AnnotRichMedia(PDFDoc *docA, Dict *dict, Object *obj);
1564 ~AnnotRichMedia();
1566 Content* getContent() const;
1568 Settings* getSettings() const;
1570 private:
1571 void initialize(PDFDoc *docA, Dict *dict);
1573 // required
1574 Content *content; // RichMediaContent
1576 // optional
1577 Settings *settings; // RichMediaSettings
1581 //------------------------------------------------------------------------
1582 // Annots
1583 //------------------------------------------------------------------------
1585 class Annots {
1586 public:
1588 // Build a list of Annot objects and call setPage on them
1589 Annots(PDFDoc *docA, int page, Object *annotsObj);
1591 ~Annots();
1593 // Iterate through list of annotations.
1594 int getNumAnnots() { return nAnnots; }
1595 Annot *getAnnot(int i) { return annots[i]; }
1596 void appendAnnot(Annot *annot);
1597 GBool removeAnnot(Annot *annot);
1599 private:
1600 Annot* createAnnot(Dict* dict, Object *obj);
1601 Annot *findAnnot(Ref *ref);
1603 PDFDoc *doc;
1604 Annot **annots;
1605 int nAnnots;
1606 int size;
1609 #endif