upgrade to xpdf 3.00.
[swftools.git] / pdf2swf / xpdf / Outline.h
1 //========================================================================
2 //
3 // Outline.h
4 //
5 // Copyright 2002-2003 Glyph & Cog, LLC
6 //
7 //========================================================================
8
9 #ifndef OUTLINE_H
10 #define OUTLINE_H
11
12 #include <aconf.h>
13
14 #ifdef USE_GCC_PRAGMAS
15 #pragma interface
16 #endif
17
18 #include "Object.h"
19 #include "CharTypes.h"
20
21 class GString;
22 class GList;
23 class XRef;
24 class LinkAction;
25
26 //------------------------------------------------------------------------
27
28 class Outline {
29 public:
30
31   Outline(Object *outlineObj, XRef *xref);
32   ~Outline();
33
34   GList *getItems() { return items; }
35
36 private:
37
38   GList *items;                 // NULL if document has no outline
39                                 //   [OutlineItem]
40 };
41
42 //------------------------------------------------------------------------
43
44 class OutlineItem {
45 public:
46
47   OutlineItem(Dict *dict, XRef *xrefA);
48   ~OutlineItem();
49
50   static GList *readItemList(Object *firstItemRef, Object *lastItemRef,
51                              XRef *xrefA);
52
53   void open();
54   void close();
55
56   Unicode *getTitle() { return title; }
57   int getTitleLength() { return titleLen; }
58   LinkAction *getAction() { return action; }
59   GBool isOpen() { return startsOpen; }
60   GBool hasKids() { return firstRef.isRef(); }
61   GList *getKids() { return kids; }
62
63 private:
64
65   XRef *xref;
66   Unicode *title;
67   int titleLen;
68   LinkAction *action;
69   Object firstRef;
70   Object lastRef;
71   Object nextRef;
72   GBool startsOpen;
73   GList *kids;                  // NULL unless this item is open [OutlineItem]
74 };
75
76 #endif