Imported Upstream version 1.8.15
[platform/upstream/doxygen.git] / src / pagedef.h
1 /******************************************************************************
2  *
3  * 
4  *
5  * Copyright (C) 1997-2015 by Dimitri van Heesch.
6  *
7  * Permission to use, copy, modify, and distribute this software and its
8  * documentation under the terms of the GNU General Public License is hereby 
9  * granted. No representations are made about the suitability of this software 
10  * for any purpose. It is provided "as is" without express or implied warranty.
11  * See the GNU General Public License for more details.
12  *
13  * Documents produced by Doxygen are derivative works derived from the
14  * input used in their production; they are not affected by this license.
15  *
16  */
17
18 #ifndef PAGEDEF_H
19 #define PAGEDEF_H
20
21 #include "definition.h"
22 #include "sortdict.h"
23
24 class PageSDict;
25 class OutputList;
26 class FTextStream;
27
28 /** @brief A model of a page symbol. */
29 class PageDef : public Definition
30 {
31   public:
32     PageDef(const char *f,int l,const char *n,const char *d,const char *t);
33    ~PageDef();
34
35     // setters
36     void setFileName(const char *name);
37     void setLocalToc(const LocalToc &tl);
38     void setShowLineNo(bool);
39
40     // getters
41     DefType definitionType() const { return TypePage; }
42     bool isLinkableInProject() const 
43     { 
44       return /*hasDocumentation() &&*/ !isReference();
45     }
46     bool isLinkable() const 
47     {
48       return isLinkableInProject() || isReference();
49     } 
50
51     // functions to get a uniform interface with Definitions
52     QCString getOutputFileBase() const;
53     QCString anchor() const { return QCString(); }
54     void findSectionsInDocumentation();
55     QCString title() const { return m_title; }
56     GroupDef *  getGroupDef() const;
57     PageSDict * getSubPages() const { return m_subPageDict; }
58     void addInnerCompound(Definition *d);
59     bool visibleInIndex() const;
60     bool documentedPage() const;
61     bool hasSubPages() const;
62     bool hasParentPage() const;
63     LocalToc localToc() const { return m_localToc; }
64     void setPageScope(Definition *d){ m_pageScope = d; }
65     Definition *getPageScope() const { return m_pageScope; }
66     QCString displayName(bool=TRUE) const { return !m_title.isEmpty() ? m_title : Definition::name(); }
67     bool showLineNo() const;
68
69     void writeDocumentation(OutputList &ol);
70     void writeTagFile(FTextStream &);
71
72   private:
73     void setNestingLevel(int l);
74     void writePageDocumentation(OutputList &ol);
75     QCString m_fileName;
76     QCString m_title;
77     PageSDict *m_subPageDict;                 // list of pages in the group
78     Definition *m_pageScope;
79     int m_nestingLevel;
80     LocalToc m_localToc;
81     bool m_showLineNo;
82 };
83
84 class PageSDict : public SDict<PageDef>
85 {
86   public:
87     PageSDict(int size) : SDict<PageDef>(size) {}
88     virtual ~PageSDict() {}
89   private:
90     int compareValues(const PageDef *i1,const PageDef *i2) const
91     {
92       return qstricmp(i1->name(),i2->name());
93     }
94 };
95
96 #endif
97