My Project
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pagedef.h
Go to the documentation of this file.
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 
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 setShowToc(bool b);
38 
39  // getters
40  DefType definitionType() const { return TypePage; }
41  bool isLinkableInProject() const
42  {
43  return /*hasDocumentation() &&*/ !isReference();
44  }
45  bool isLinkable() const
46  {
47  return isLinkableInProject() || isReference();
48  }
49 
50  // functions to get a uniform interface with Definitions
51  QCString getOutputFileBase() const;
52  QCString anchor() const { return QCString(); }
54  QCString title() const { return m_title; }
55  GroupDef * getGroupDef() const;
56  PageSDict * getSubPages() const { return m_subPageDict; }
58  bool visibleInIndex() const;
59  bool documentedPage() const;
60  bool hasSubPages() const;
61  bool hasParentPage() const;
62  bool showToc() const { return m_showToc; }
64  Definition *getPageScope() const { return m_pageScope; }
65  QCString displayName(bool=TRUE) const { return !m_title.isEmpty() ? m_title : Definition::name(); }
66 
68  void writeTagFile(FTextStream &);
69 
70  private:
71  void setNestingLevel(int l);
73  QCString m_fileName;
74  QCString m_title;
75  PageSDict *m_subPageDict; // list of pages in the group
78  bool m_showToc;
79 };
80 
81 class PageSDict : public SDict<PageDef>
82 {
83  public:
84  PageSDict(int size) : SDict<PageDef>(size) {}
85  virtual ~PageSDict() {}
86  private:
87  int compareValues(const PageDef *i1,const PageDef *i2) const
88  {
89  return qstricmp(i1->name(),i2->name());
90  }
91 };
92 
93 #endif
94