ISLEman
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 
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(); }
53  void findSectionsInDocumentation();
54  QCString title() const { return m_title; }
55  GroupDef * getGroupDef() const;
56  PageSDict * getSubPages() const { return m_subPageDict; }
57  void addInnerCompound(Definition *d);
58  bool visibleInIndex() const;
59  bool documentedPage() const;
60  bool hasSubPages() const;
61  bool hasParentPage() const;
62  bool showToc() const { return m_showToc; }
63  void setPageScope(Definition *d){ m_pageScope = d; }
64  Definition *getPageScope() const { return m_pageScope; }
65  QCString displayName(bool=TRUE) const { return !m_title.isEmpty() ? m_title : Definition::name(); }
66 
67  void writeDocumentation(OutputList &ol);
68  void writeTagFile(FTextStream &);
69 
70  private:
71  void setNestingLevel(int l);
72  void writePageDocumentation(OutputList &ol);
73  QCString m_fileName;
74  QCString m_title;
75  PageSDict *m_subPageDict; // list of pages in the group
76  Definition *m_pageScope;
77  int m_nestingLevel;
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 
QCString getOutputFileBase() const
Definition: pagedef.cpp:57
The common base class of all entity definitions found in the sources.
Definition: definition.h:92
bool isLinkable() const
Definition: pagedef.h:45
Definition: pagedef.h:81
bool isLinkableInProject() const
Definition: pagedef.h:41
Simplified and optimized version of QTextStream.
Definition: ftextstream.h:11
virtual bool isReference() const
Definition: definition.cpp:1854
Ordered dictionary of elements of type T.
Definition: sortdict.h:73
const QCString & name() const
Definition: definition.h:114
DefType
Definition: definition.h:71
DefType definitionType() const
Definition: pagedef.h:40
QCString displayName(bool=TRUE) const
Definition: pagedef.h:65
QCString anchor() const
Definition: pagedef.h:52
A model of a page symbol.
Definition: pagedef.h:29
Class representing a list of output generators that are written to in parallel.
Definition: outputlist.h:54
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition: qcstring.h:189
This is an alternative implementation of QCString.
Definition: qcstring.h:131
A model of a group of symbols.
Definition: groupdef.h:45