00001 //======================================================================== 00002 // 00003 // Outline.h 00004 // 00005 // Copyright 2002-2003 Glyph & Cog, LLC 00006 // 00007 //======================================================================== 00008 00009 #ifndef OUTLINE_H 00010 #define OUTLINE_H 00011 00012 #include <aconf.h> 00013 00014 #ifdef USE_GCC_PRAGMAS 00015 #pragma interface 00016 #endif 00017 00018 #include "Object.h" 00019 #include "CharTypes.h" 00020 00021 class GString; 00022 class GList; 00023 class XRef; 00024 class LinkAction; 00025 00026 //------------------------------------------------------------------------ 00027 00028 class Outline { 00029 public: 00030 00031 Outline(Object *outlineObj, XRef *xref); 00032 ~Outline(); 00033 00034 GList *getItems() { return items; } 00035 00036 private: 00037 00038 GList *items; // NULL if document has no outline 00039 // [OutlineItem] 00040 }; 00041 00042 //------------------------------------------------------------------------ 00043 00044 class OutlineItem { 00045 public: 00046 00047 OutlineItem(Dict *dict, XRef *xrefA); 00048 ~OutlineItem(); 00049 00050 static GList *readItemList(Object *firstItemRef, Object *lastItemRef, 00051 XRef *xrefA); 00052 00053 void open(); 00054 void close(); 00055 00056 Unicode *getTitle() { return title; } 00057 int getTitleLength() { return titleLen; } 00058 LinkAction *getAction() { return action; } 00059 GBool isOpen() { return startsOpen; } 00060 GBool hasKids() { return firstRef.isRef(); } 00061 GList *getKids() { return kids; } 00062 00063 private: 00064 00065 XRef *xref; 00066 Unicode *title; 00067 int titleLen; 00068 LinkAction *action; 00069 Object firstRef; 00070 Object lastRef; 00071 Object nextRef; 00072 GBool startsOpen; 00073 GList *kids; // NULL unless this item is open [OutlineItem] 00074 }; 00075 00076 #endif