My Project
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
layout.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  *
4  *
5  *
6  * Copyright (C) 1997-2015 by Dimitri van Heesch.
7  *
8  * Permission to use, copy, modify, and distribute this software and its
9  * documentation under the terms of the GNU General Public License is hereby
10  * granted. No representations are made about the suitability of this software
11  * for any purpose. It is provided "as is" without express or implied warranty.
12  * See the GNU General Public License for more details.
13  *
14  * Documents produced by Doxygen are derivative works derived from the
15  * input used in their production; they are not affected by this license.
16  *
17  */
18 
19 #ifndef LAYOUT_H
20 #define LAYOUT_H
21 
22 #include <qlist.h>
23 #include "types.h"
24 
25 class LayoutParser;
26 class MemberList;
27 class QTextStream;
28 
31 {
32  virtual ~LayoutDocEntry() {}
33  enum Kind {
34  // Generic items for all pages
40 
41  // Class specific items
46 
47  // Namespace specific items
50 
51  // File specific items
56 
57  // Group specific items
61 
62  // Directory specific items
64 
65  };
66  virtual Kind kind() const = 0;
67 };
68 
71 {
72  public:
74  Kind kind() const { return m_kind; }
75  private:
77 };
78 
80 {
81  LayoutDocEntrySection(Kind k,const QCString &tl) :
82  LayoutDocEntrySimple(k), m_title(tl) {}
83  QCString title(SrcLangExt lang) const;
84 private:
85  QCString m_title;
86 };
87 
90 {
92  const QCString &tl,const QCString &ss)
93  : type(tp), m_title(tl), m_subscript(ss) {}
94 
95  Kind kind() const { return MemberDecl; }
97  QCString title(SrcLangExt lang) const;
98  QCString subtitle(SrcLangExt lang) const;
99 private:
100  QCString m_title;
101  QCString m_subscript;
102 };
103 
106 {
107  LayoutDocEntryMemberDef(MemberListType tp,const QCString &tl)
108  : type(tp), m_title(tl) {}
109 
110  Kind kind() const { return MemberDef; }
112  QCString title(SrcLangExt lang) const;
113 private:
114  QCString m_title;
115 };
116 
119 {
120  public:
121  enum Kind {
136  //Dirs,
140  };
141  LayoutNavEntry(LayoutNavEntry *parent,Kind k,bool vs,const QCString &bf,
142  const QCString &tl,const QCString &intro,bool prepend=FALSE)
143  : m_parent(parent), m_kind(k), m_visible(vs), m_baseFile(bf), m_title(tl), m_intro(intro)
144  { m_children.setAutoDelete(TRUE);
145  if (parent) { if (prepend) parent->prependChild(this); else parent->addChild(this); }
146  }
147  LayoutNavEntry *parent() const { return m_parent; }
148  Kind kind() const { return m_kind; }
149  QCString baseFile() const { return m_baseFile; }
150  QCString title() const { return m_title; }
151  QCString intro() const { return m_intro; }
152  QCString url() const;
153  bool visible() { return m_visible; }
154  void clear() { m_children.clear(); }
155  void addChild(LayoutNavEntry *e) { m_children.append(e); }
156  void prependChild(LayoutNavEntry *e) { m_children.prepend(e); }
157  const QList<LayoutNavEntry> &children() const { return m_children; }
158  LayoutNavEntry *find(LayoutNavEntry::Kind k,const char *file=0) const;
159 
160  private:
164  bool m_visible;
165  QCString m_baseFile;
166  QCString m_title;
167  QCString m_intro;
168  QList<LayoutNavEntry> m_children;
169  friend class LayoutDocManager;
170 };
171 
174 {
175  class Private;
176  public:
178  {
181  };
183  static LayoutDocManager &instance();
184 
186  const QList<LayoutDocEntry> &docEntries(LayoutPart part) const;
187 
189  LayoutNavEntry *rootNavEntry() const;
190 
192  void parse(QTextStream &t,const char *fileName);
193  void init();
194  private:
196  void clear(LayoutPart p);
200  friend class LayoutParser;
201 };
202 
203 void writeDefaultLayoutFile(const char *fileName);
204 
205 #endif
206