]> www.fi.muni.cz Git - evince.git/blob - pdf/xpdf/Catalog.h
Lots of cvsignores
[evince.git] / pdf / xpdf / Catalog.h
1 //========================================================================
2 //
3 // Catalog.h
4 //
5 // Copyright 1996 Derek B. Noonburg
6 //
7 //========================================================================
8
9 #ifndef CATALOG_H
10 #define CATALOG_H
11
12 #ifdef __GNUC__
13 #pragma interface
14 #endif
15
16 class Object;
17 class Page;
18 class PageAttrs;
19 struct Ref;
20 class LinkDest;
21
22 //------------------------------------------------------------------------
23 // Catalog
24 //------------------------------------------------------------------------
25
26 class Catalog {
27 public:
28
29   // Constructor.
30   Catalog(Object *catDict);
31
32   // Destructor.
33   ~Catalog();
34
35   // Is catalog valid?
36   GBool isOk() { return ok; }
37
38   // Get number of pages.
39   int getNumPages() { return numPages; }
40
41   // Get a page.
42   Page *getPage(int i) { return pages[i-1]; }
43
44   // Find a page, given its object ID.  Returns page number, or 0 if
45   // not found.
46   int findPage(int num, int gen);
47
48   // Find a named destination.  Returns the link destination, or
49   // NULL if <name> is not a destination.
50   LinkDest *findDest(GString *name);
51
52 private:
53
54   Page **pages;                 // array of pages
55   Ref *pageRefs;                // object ID for each page
56   int numPages;                 // number of pages
57   Object dests;                 // named destination dictionary
58   Object nameTree;              // name tree
59   GBool ok;                     // true if catalog is valid
60
61   int readPageTree(Dict *pages, PageAttrs *attrs, int start);
62   Object *findDestInTree(Object *tree, GString *name, Object *obj);
63 };
64
65 #endif