/src/xpdf-4.06/xpdf/Outline.h
Line | Count | Source |
1 | | //======================================================================== |
2 | | // |
3 | | // Outline.h |
4 | | // |
5 | | // Copyright 2002-2013 Glyph & Cog, LLC |
6 | | // |
7 | | //======================================================================== |
8 | | |
9 | | #ifndef OUTLINE_H |
10 | | #define OUTLINE_H |
11 | | |
12 | | #include <aconf.h> |
13 | | |
14 | | #include "Object.h" |
15 | | #include "CharTypes.h" |
16 | | |
17 | | class GString; |
18 | | class GList; |
19 | | class XRef; |
20 | | class LinkAction; |
21 | | class TextString; |
22 | | |
23 | | //------------------------------------------------------------------------ |
24 | | |
25 | | class Outline { |
26 | | public: |
27 | | |
28 | | Outline(Object *outlineObj, XRef *xref); |
29 | | ~Outline(); |
30 | | |
31 | 0 | GList *getItems() { return items; } |
32 | | |
33 | | private: |
34 | | |
35 | | GList *items; // NULL if document has no outline |
36 | | // [OutlineItem] |
37 | | }; |
38 | | |
39 | | //------------------------------------------------------------------------ |
40 | | |
41 | | class OutlineItem { |
42 | | public: |
43 | | |
44 | | OutlineItem(Object *itemRefA, Dict *dict, OutlineItem *parentA, XRef *xrefA); |
45 | | ~OutlineItem(); |
46 | | |
47 | | static GList *readItemList(Object *firstItemRef, Object *lastItemRef, |
48 | | OutlineItem *parentA, XRef *xrefA); |
49 | | |
50 | | void open(); |
51 | | void close(); |
52 | | |
53 | | Unicode *getTitle(); |
54 | | int getTitleLength(); |
55 | 0 | TextString *getTitleTextString() { return title; } |
56 | 0 | LinkAction *getAction() { return action; } |
57 | 0 | GBool isOpen() { return startsOpen; } |
58 | 0 | GBool hasKids() { return firstRef.isRef(); } |
59 | 0 | GList *getKids() { return kids; } |
60 | 0 | OutlineItem *getParent() { return parent; } |
61 | | |
62 | | private: |
63 | | |
64 | | friend class PDFDoc; |
65 | | |
66 | | XRef *xref; |
67 | | TextString *title; // may be NULL |
68 | | LinkAction *action; |
69 | | Object itemRef; |
70 | | Object firstRef; |
71 | | Object lastRef; |
72 | | Object nextRef; |
73 | | GBool startsOpen; |
74 | | int pageNum; // page number (used by |
75 | | // PDFDoc::getOutlineTargetPage) |
76 | | GList *kids; // NULL unless this item is open [OutlineItem] |
77 | | OutlineItem *parent; |
78 | | }; |
79 | | |
80 | | #endif |