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 
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 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
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);
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 
PageSDict * getSubPages() const
Definition: pagedef.h:56
bool isEmpty() const
Definition: qcstring.h:189
QCString title() const
Definition: pagedef.h:54
Definition * getPageScope() const
Definition: pagedef.h:64
void setPageScope(Definition *d)
Definition: pagedef.h:63
virtual bool isReference() const
~PageDef()
Definition: pagedef.cpp:42
Simplified and optimized version of QTextStream.
Definition: ftextstream.h:11
void findSectionsInDocumentation()
Definition: pagedef.cpp:47
static QStrList * l
Definition: config.cpp:1044
void setFileName(const char *name)
Definition: pagedef.cpp:66
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:92
Definition: sortdict.h:73
bool hasSubPages() const
Definition: pagedef.cpp:300
bool hasParentPage() const
Definition: pagedef.cpp:89
int compareValues(const PageDef *i1, const PageDef *i2) const
Definition: pagedef.h:87
int m_nestingLevel
Definition: pagedef.h:77
const QCString & name() const
Definition: definition.h:114
DefType definitionType() const
Definition: pagedef.h:40
int qstricmp(const char *str1, const char *str2)
Definition: qcstring.cpp:567
bool visibleInIndex() const
Definition: pagedef.cpp:282
QCString displayName(bool=TRUE) const
Definition: pagedef.h:65
std::void_t< T > n
void writeTagFile(FTextStream &)
Definition: pagedef.cpp:95
QCString m_fileName
Definition: pagedef.h:73
Definition * m_pageScope
Definition: pagedef.h:76
PageDef(const char *f, int l, const char *n, const char *d, const char *t)
Definition: pagedef.cpp:29
QCString anchor() const
Definition: pagedef.h:52
PageSDict * m_subPageDict
Definition: pagedef.h:75
QCString m_title
Definition: pagedef.h:74
bool showToc() const
Definition: pagedef.h:62
bool isLinkable() const
Definition: pagedef.h:45
bool isLinkableInProject() const
Definition: pagedef.h:41
PageSDict(int size)
Definition: pagedef.h:84
void addInnerCompound(Definition *d)
Definition: pagedef.cpp:71
A model of a page symbol.
Definition: pagedef.h:29
bool m_showToc
Definition: pagedef.h:78
void writePageDocumentation(OutputList &ol)
Definition: pagedef.cpp:223
void setShowToc(bool b)
Definition: pagedef.cpp:310
void writeDocumentation(OutputList &ol)
Definition: pagedef.cpp:119
static bool * b
Definition: config.cpp:1043
virtual ~PageSDict()
Definition: pagedef.h:85
bool documentedPage() const
Definition: pagedef.cpp:292
QCString getOutputFileBase() const
Definition: pagedef.cpp:58
const bool TRUE
Definition: qglobal.h:371
GroupDef * getGroupDef() const
Definition: pagedef.cpp:52
void setNestingLevel(int l)
Definition: pagedef.cpp:305