]> www.fi.muni.cz Git - evince.git/blob - pdf/xpdf/Catalog.h
Auto activate, Scrolled panel, functioning zoom.
[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   // Return base URI, or NULL if none.
45   GString *getBaseURI() { return baseURI; }
46
47   // Find a page, given its object ID.  Returns page number, or 0 if
48   // not found.
49   int findPage(int num, int gen);
50
51   // Find a named destination.  Returns the link destination, or
52   // NULL if <name> is not a destination.
53   LinkDest *findDest(GString *name);
54
55 private:
56
57   Page **pages;                 // array of pages
58   Ref *pageRefs;                // object ID for each page
59   int numPages;                 // number of pages
60   Object dests;                 // named destination dictionary
61   Object nameTree;              // name tree
62   GString *baseURI;             // base URI for URI-type links
63   GBool ok;                     // true if catalog is valid
64
65   int readPageTree(Dict *pages, PageAttrs *attrs, int start);
66   Object *findDestInTree(Object *tree, GString *name, Object *obj);
67 };
68
69 #endif