root/trunk/src/DocumentOutline.h
| Revision 148, 2.5 kB (checked in by jordi, 2 years ago) |
|---|
| Line | |
|---|---|
| 1 | // ePDFView - A lightweight PDF Viewer. |
| 2 | // Copyright (C) 2006 Emma's Software. |
| 3 | // |
| 4 | // This program is free software; you can redistribute it and/or modify |
| 5 | // it under the terms of the GNU General Public License as published by |
| 6 | // the Free Software Foundation; either version 2 of the License, or |
| 7 | // (at your option) any later version. |
| 8 | // |
| 9 | // This program is distributed in the hope that it will be useful, |
| 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | // GNU General Public License for more details. |
| 13 | // |
| 14 | // You should have received a copy of the GNU General Public License |
| 15 | // along with this program; if not, write to the Free Software |
| 16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 17 | |
| 18 | #if !defined (__DOCUMENT_OUTLINE_H__) |
| 19 | #define __DOCUMENT_OUTLINE_H__ |
| 20 | |
| 21 | namespace ePDFView |
| 22 | { |
| 23 | /// |
| 24 | /// @class DocumentOutline |
| 25 | /// @brief Stores the document's outline title, page num. and its children. |
| 26 | /// |
| 27 | /// Some documents have an index with them. This index can be used to |
| 28 | /// help the user navigate through the document, similar to a table of |
| 29 | /// contents. |
| 30 | /// |
| 31 | /// Each node contains a title, a destination page an possibly children |
| 32 | /// nodes. The only node that have an empty name and a 0 page number is the |
| 33 | /// top level DocumentOutline, that is only used as a container for all |
| 34 | /// other DocumentOutline objects. |
| 35 | /// |
| 36 | class DocumentOutline |
| 37 | { |
| 38 | public: |
| 39 | DocumentOutline (void); |
| 40 | ~DocumentOutline (void); |
| 41 | |
| 42 | void addChild (DocumentOutline *child); |
| 43 | gint getDestinationPage (void); |
| 44 | DocumentOutline *getFirstChild (void); |
| 45 | DocumentOutline *getNextChild (void); |
| 46 | gint getNumChildren (void); |
| 47 | const gchar *getTitle (void); |
| 48 | void setParent (DocumentOutline *parent); |
| 49 | void setTitle (const gchar *title); |
| 50 | void setDestination (gint destination); |
| 51 | |
| 52 | protected: |
| 53 | /// The list of this outline's children. |
| 54 | GList *m_Children; |
| 55 | /// The page number this outline points to. |
| 56 | gint m_Destination; |
| 57 | /// @brief This is used to know which child to return when calling |
| 58 | /// the DocumentOutline::getNextChild() function. |
| 59 | GList *m_LastReturnedChild; |
| 60 | /// The outline's parent outline. |
| 61 | DocumentOutline *m_Parent; |
| 62 | /// The outline's name or title. |
| 63 | gchar *m_Title; |
| 64 | }; |
| 65 | } |
| 66 | |
| 67 | #endif // !__DOCUMENT_OUTLINE_H__ |
Note: See TracBrowser
for help on using the browser.
