Doxygen
types.h
浏览该文件的文档.
1 /******************************************************************************
2  *
3  * Copyright (C) 1997-2015 by Dimitri van Heesch.
4  *
5  * Permission to use, copy, modify, and distribute this software and its
6  * documentation under the terms of the GNU General Public License is hereby
7  * granted. No representations are made about the suitability of this software
8  * for any purpose. It is provided "as is" without express or implied warranty.
9  * See the GNU General Public License for more details.
10  *
11  * Documents produced by Doxygen are derivative works derived from the
12  * input used in their production; they are not affected by this license.
13  *
14  */
15 
16 #ifndef TYPES_H
17 #define TYPES_H
18 
19 #include "qcstring.h"
20 
21 /** @file
22  * @brief This file contains a number of basic enums and types.
23  */
24 
25 /** Protection level of members */
27 
28 /** Virtualness of a member. */
30 
31 /** Kind of method */
33 
34 /** Type of member relation */
36 
37 /** Kind of member relationship */
39 
40 /** Language as given by extension */
42 {
43  SrcLangExt_Unknown = 0x00000,
44  SrcLangExt_IDL = 0x00008,
45  SrcLangExt_Java = 0x00010,
46  SrcLangExt_CSharp = 0x00020,
47  SrcLangExt_D = 0x00040,
48  SrcLangExt_PHP = 0x00080,
49  SrcLangExt_ObjC = 0x00100,
50  SrcLangExt_Cpp = 0x00200,
51  SrcLangExt_JS = 0x00400,
52  SrcLangExt_Python = 0x00800,
53  SrcLangExt_Fortran = 0x01000,
54  SrcLangExt_VHDL = 0x02000,
55  SrcLangExt_XML = 0x04000,
56  //SrcLangExt_Tcl = 0x08000, // no longer supported
58  SrcLangExt_SQL = 0x20000,
59  SrcLangExt_Slice = 0x40000,
60  SrcLangExt_Lex = 0x80000
61 };
62 
63 /** Grouping info */
64 struct Grouping
65 {
66  /** Grouping priority */
68  {
70  GROUPING_AUTO_WEAK = GROUPING_LOWEST, //!< membership in group was defined via \@weakgroup
71  GROUPING_AUTO_ADD, //!< membership in group was defined via \@add[to]group
72  GROUPING_AUTO_DEF, //!< membership in group was defined via \@defgroup
74  GROUPING_INGROUP, //!< membership in group was defined by \@ingroup
76  };
77 
78  static const char *getGroupPriName( GroupPri_t priority )
79  {
80  switch( priority )
81  {
82  case GROUPING_AUTO_WEAK:
83  return "@weakgroup";
84  case GROUPING_AUTO_ADD:
85  return "@addtogroup";
86  case GROUPING_AUTO_DEF:
87  return "@defgroup";
88  case GROUPING_INGROUP:
89  return "@ingroup";
90  }
91  return "???";
92  }
93 
94  Grouping( const QCString &gn, GroupPri_t p ) : groupname(gn), pri(p) {}
95  QCString groupname; //!< name of the group
96  GroupPri_t pri; //!< priority of this definition
97 
98 };
99 
101 {
106 
136 
146 
148 
163 
178 
182 
183  // this one is for the summary section on the class page
185  // this one is for the detailed section on the class page
189 
194 };
195 
197 {
198  File,
199  Namespace,
200  Group,
201  Class
202 };
203 
204 enum class CodeSymbolType
205 {
206  Default,
207  // Class types
208  Class,
209  Struct,
210  Union,
211  Interface,
212  Protocol,
213  Category,
214  Exception,
215  Service,
216  Singleton,
217  // Other container types
218  Concept,
219  Namespace,
220  Package,
221  // Member types
222  Define,
223  Function,
224  Variable,
225  Typedef,
226  EnumValue,
227  Enumeration,
228  Signal,
229  Slot,
230  Friend,
231  DCOP,
232  Property,
233  Event,
234  Sequence,
235  Dictionary
236 };
237 
238 constexpr const char *codeSymbolType2Str(CodeSymbolType type)
239 {
240  switch (type)
241  {
242  case CodeSymbolType::Class: return "class";
243  case CodeSymbolType::Struct: return "struct";
244  case CodeSymbolType::Union: return "union";
245  case CodeSymbolType::Interface: return "interface";
246  case CodeSymbolType::Protocol: return "protocol";
247  case CodeSymbolType::Category: return "category";
248  case CodeSymbolType::Exception: return "exception";
249  case CodeSymbolType::Service: return "service";
250  case CodeSymbolType::Singleton: return "singleton";
251  case CodeSymbolType::Concept: return "concept";
252  case CodeSymbolType::Namespace: return "namespace";
253  case CodeSymbolType::Package: return "package";
254  case CodeSymbolType::Define: return "define";
255  case CodeSymbolType::Function: return "function";
256  case CodeSymbolType::Variable: return "variable";
257  case CodeSymbolType::Typedef: return "typedef";
258  case CodeSymbolType::EnumValue: return "enumvalue";
259  case CodeSymbolType::Enumeration: return "enumeration";
260  case CodeSymbolType::Signal: return "signal";
261  case CodeSymbolType::Slot: return "slot";
262  case CodeSymbolType::Friend: return "friend";
263  case CodeSymbolType::DCOP: return "dcop";
264  case CodeSymbolType::Property: return "property";
265  case CodeSymbolType::Event: return "event";
266  case CodeSymbolType::Sequence: return "sequence";
267  case CodeSymbolType::Dictionary: return "dictionary";
268  default:
269  return 0;
270  }
271 }
272 
273 
275 {
292 };
293 
295 {
299 };
300 
301 class LocalToc
302 {
303  public:
304  enum Type {
305  None = 0, // initial value
306  Html = 0, // index / also to be used as bit position in mask (1 << Html)
307  Latex = 1, // ...
308  Xml = 2, // ...
309  Docbook = 3, // ...
310  numTocTypes = 4 // number of enum values
311  };
312  LocalToc() : m_mask(None) { memset(m_level,0,sizeof(m_level)); }
313 
314  // setters
315  void enableHtml(int level)
316  {
317  m_mask|=(1<<Html);
318  m_level[Html]=level;
319  }
320  void enableLatex(int level)
321  {
322  m_mask|=(1<<Latex);
323  m_level[Latex]=level;
324  }
325  void enableXml(int level)
326  {
327  m_mask|=(1<<Xml);
328  m_level[Xml]=level;
329  }
330  void enableDocbook(int level)
331  {
332  m_mask|=(1<<Docbook);
333  m_level[Docbook]=level;
334  }
335 
336  // getters
337  bool isHtmlEnabled() const { return (m_mask & (1<<Html))!=0; }
338  bool isLatexEnabled() const { return (m_mask & (1<<Latex))!=0; }
339  bool isXmlEnabled() const { return (m_mask & (1<<Xml))!=0; }
340  bool isDocbookEnabled() const { return (m_mask & (1<<Docbook))!=0; }
341  bool nothingEnabled() const { return m_mask == None; }
342  int htmlLevel() const { return m_level[Html]; }
343  int latexLevel() const { return m_level[Latex]; }
344  int xmlLevel() const { return m_level[Xml]; }
345  int docbookLevel() const { return m_level[Docbook]; }
346  int mask() const { return m_mask; }
347 
348  private:
349  int m_mask;
351 };
352 
353 #endif
LocalToc::enableXml
void enableXml(int level)
Definition: types.h:325
CodeSymbolType::Class
@ Class
SrcLangExt_Unknown
@ SrcLangExt_Unknown
Definition: types.h:43
Grouping::getGroupPriName
static const char * getGroupPriName(GroupPri_t priority)
Definition: types.h:78
MemberListType_typedefMembers
@ MemberListType_typedefMembers
Definition: types.h:137
MemberListType_decEnumValMembers
@ MemberListType_decEnumValMembers
Definition: types.h:155
MemberType_Variable
@ MemberType_Variable
Definition: types.h:278
CodeSymbolType::Exception
@ Exception
MemberListType_docDictionaryMembers
@ MemberListType_docDictionaryMembers
Definition: types.h:193
MemberListType_priStaticMethods
@ MemberListType_priStaticMethods
Definition: types.h:114
MemberListType_decEventMembers
@ MemberListType_decEventMembers
Definition: types.h:160
MemberListType_priStaticAttribs
@ MemberListType_priStaticAttribs
Definition: types.h:125
Normal
@ Normal
Definition: types.h:29
MemberListType_signals
@ MemberListType_signals
Definition: types.h:131
Protection
Protection
Protection level of members
Definition: types.h:26
CodeSymbolType::Friend
@ Friend
CodeSymbolType::Union
@ Union
MemberListType_functionMembers
@ MemberListType_functionMembers
Definition: types.h:140
MemberListType
MemberListType
Definition: types.h:100
MemberListType_docProSlotMembers
@ MemberListType_docProSlotMembers
Definition: types.h:172
MemberListType_docEnumMembers
@ MemberListType_docEnumMembers
Definition: types.h:167
CodeSymbolType::Variable
@ Variable
MemberListType_pacStaticAttribs
@ MemberListType_pacStaticAttribs
Definition: types.h:124
MemberType_EnumValue
@ MemberType_EnumValue
Definition: types.h:281
MemberListType_services
@ MemberListType_services
Definition: types.h:187
Private
@ Private
Definition: types.h:26
MemberListType_constructors
@ MemberListType_constructors
Definition: types.h:145
MemberListType_decProSlotMembers
@ MemberListType_decProSlotMembers
Definition: types.h:157
CodeSymbolType::Namespace
@ Namespace
MemberType_Signal
@ MemberType_Signal
Definition: types.h:282
Grouping::pri
GroupPri_t pri
priority of this definition
Definition: types.h:96
LocalToc::m_mask
int m_mask
Definition: types.h:349
SrcLangExt_XML
@ SrcLangExt_XML
Definition: types.h:55
MemberType_Interface
@ MemberType_Interface
Definition: types.h:288
CodeSymbolType::Property
@ Property
SrcLangExt_PHP
@ SrcLangExt_PHP
Definition: types.h:48
SrcLangExt_JS
@ SrcLangExt_JS
Definition: types.h:51
MemberListType_priAttribs
@ MemberListType_priAttribs
Definition: types.h:121
MemberListType_allMembersList
@ MemberListType_allMembersList
Definition: types.h:147
LocalToc::latexLevel
int latexLevel() const
Definition: types.h:343
LocalToc::enableDocbook
void enableDocbook(int level)
Definition: types.h:330
CodeSymbolType::Package
@ Package
MemberListType_pubTypes
@ MemberListType_pubTypes
Definition: types.h:126
CodeSymbolType::Slot
@ Slot
SrcLangExt
SrcLangExt
Language as given by extension
Definition: types.h:41
MemberType_Friend
@ MemberType_Friend
Definition: types.h:284
MemberListType_priSlots
@ MemberListType_priSlots
Definition: types.h:117
MemberListType_docSequenceMembers
@ MemberListType_docSequenceMembers
Definition: types.h:191
MemberType_Enumeration
@ MemberType_Enumeration
Definition: types.h:280
Grouping
Grouping info
Definition: types.h:64
MemberListType_dcopMethods
@ MemberListType_dcopMethods
Definition: types.h:133
Virtual
@ Virtual
Definition: types.h:29
Grouping::GROUPING_LOWEST
@ GROUPING_LOWEST
Definition: types.h:69
LocalToc::nothingEnabled
bool nothingEnabled() const
Definition: types.h:341
MemberType_Typedef
@ MemberType_Typedef
Definition: types.h:279
Specifier
Specifier
Virtualness of a member.
Definition: types.h:29
MemberListType_docDefineMembers
@ MemberListType_docDefineMembers
Definition: types.h:164
LocalToc::isLatexEnabled
bool isLatexEnabled() const
Definition: types.h:338
Public
@ Public
Definition: types.h:26
SrcLangExt_Lex
@ SrcLangExt_Lex
Definition: types.h:60
CodeSymbolType::Singleton
@ Singleton
Package
@ Package
Definition: types.h:26
MemberListType_decDictionaryMembers
@ MemberListType_decDictionaryMembers
Definition: types.h:192
MemberType
MemberType
Definition: types.h:274
SrcLangExt_Java
@ SrcLangExt_Java
Definition: types.h:45
Event
@ Event
Definition: types.h:32
MemberListType_friends
@ MemberListType_friends
Definition: types.h:132
MemberListType_proAttribs
@ MemberListType_proAttribs
Definition: types.h:119
CodeSymbolType::Service
@ Service
MemberListType_pubMethods
@ MemberListType_pubMethods
Definition: types.h:107
qcstring.h
CodeSymbolType::Typedef
@ Typedef
LocalToc::isDocbookEnabled
bool isDocbookEnabled() const
Definition: types.h:340
MemberListContainer::Namespace
@ Namespace
MemberListType_interfaces
@ MemberListType_interfaces
Definition: types.h:184
CodeSymbolType::Event
@ Event
MemberListType_declarationLists
@ MemberListType_declarationLists
Definition: types.h:104
CodeSymbolType::DCOP
@ DCOP
MethodTypes
MethodTypes
Kind of method
Definition: types.h:32
MemberListType_decFriendMembers
@ MemberListType_decFriendMembers
Definition: types.h:161
MemberListType_decSequenceMembers
@ MemberListType_decSequenceMembers
Definition: types.h:190
MemberType_Service
@ MemberType_Service
Definition: types.h:289
FortranFormat_Free
@ FortranFormat_Free
Definition: types.h:297
SrcLangExt_ObjC
@ SrcLangExt_ObjC
Definition: types.h:49
LocalToc
Definition: types.h:301
Member
@ Member
Definition: types.h:38
MemberListType_docFriendMembers
@ MemberListType_docFriendMembers
Definition: types.h:176
MemberType_Function
@ MemberType_Function
Definition: types.h:277
CodeSymbolType::Dictionary
@ Dictionary
MemberListType_decPropMembers
@ MemberListType_decPropMembers
Definition: types.h:162
Method
@ Method
Definition: types.h:32
MemberListType_decProtoMembers
@ MemberListType_decProtoMembers
Definition: types.h:150
LocalToc::Latex
@ Latex
Definition: types.h:307
MemberListType_pubSlots
@ MemberListType_pubSlots
Definition: types.h:115
MemberListType_decVarMembers
@ MemberListType_decVarMembers
Definition: types.h:154
MemberType_Slot
@ MemberType_Slot
Definition: types.h:283
MemberListType_proStaticMethods
@ MemberListType_proStaticMethods
Definition: types.h:112
LocalToc::Docbook
@ Docbook
Definition: types.h:309
MemberListType_decPriSlotMembers
@ MemberListType_decPriSlotMembers
Definition: types.h:158
MemberListType_redefinedBy
@ MemberListType_redefinedBy
Definition: types.h:179
codeSymbolType2Str
constexpr const char * codeSymbolType2Str(CodeSymbolType type)
Definition: types.h:238
SrcLangExt_D
@ SrcLangExt_D
Definition: types.h:47
MemberListType_events
@ MemberListType_events
Definition: types.h:135
LocalToc::LocalToc
LocalToc()
Definition: types.h:312
MemberListType_decPubSlotMembers
@ MemberListType_decPubSlotMembers
Definition: types.h:156
SrcLangExt_Cpp
@ SrcLangExt_Cpp
Definition: types.h:50
MemberType_DCOP
@ MemberType_DCOP
Definition: types.h:285
MemberListType_enumFields
@ MemberListType_enumFields
Definition: types.h:180
MemberListType_docSignalMembers
@ MemberListType_docSignalMembers
Definition: types.h:174
Grouping::GroupPri_t
GroupPri_t
Grouping priority
Definition: types.h:67
SrcLangExt_Python
@ SrcLangExt_Python
Definition: types.h:52
MemberListType_docFuncMembers
@ MemberListType_docFuncMembers
Definition: types.h:168
MemberListContainer
MemberListContainer
Definition: types.h:196
CodeSymbolType::Define
@ Define
MemberListType_variableMembers
@ MemberListType_variableMembers
Definition: types.h:142
SrcLangExt_Fortran
@ SrcLangExt_Fortran
Definition: types.h:53
LocalToc::Type
Type
Definition: types.h:304
MemberListType_pacAttribs
@ MemberListType_pacAttribs
Definition: types.h:120
LocalToc::htmlLevel
int htmlLevel() const
Definition: types.h:342
FortranFormat
FortranFormat
Definition: types.h:294
MemberListType_enumMembers
@ MemberListType_enumMembers
Definition: types.h:138
MemberListType_decEnumMembers
@ MemberListType_decEnumMembers
Definition: types.h:152
SrcLangExt_CSharp
@ SrcLangExt_CSharp
Definition: types.h:46
SrcLangExt_SQL
@ SrcLangExt_SQL
Definition: types.h:58
MemberListType_pacTypes
@ MemberListType_pacTypes
Definition: types.h:128
MemberListType_priTypes
@ MemberListType_priTypes
Definition: types.h:129
CodeSymbolType::Category
@ Category
MemberListType_pubStaticAttribs
@ MemberListType_pubStaticAttribs
Definition: types.h:122
MemberType_Property
@ MemberType_Property
Definition: types.h:286
MemberListType_decDefineMembers
@ MemberListType_decDefineMembers
Definition: types.h:149
Grouping::GROUPING_AUTO_DEF
@ GROUPING_AUTO_DEF
membership in group was defined via @defgroup
Definition: types.h:72
MemberType_Dictionary
@ MemberType_Dictionary
Definition: types.h:291
LocalToc::enableLatex
void enableLatex(int level)
Definition: types.h:320
MemberListType_proMethods
@ MemberListType_proMethods
Definition: types.h:108
Grouping::groupname
QCString groupname
name of the group
Definition: types.h:95
MemberListType_decFuncMembers
@ MemberListType_decFuncMembers
Definition: types.h:153
MemberListType_proTypes
@ MemberListType_proTypes
Definition: types.h:127
MemberListContainer::File
@ File
MemberListType_docPubSlotMembers
@ MemberListType_docPubSlotMembers
Definition: types.h:171
Protected
@ Protected
Definition: types.h:26
MemberListType_pacMethods
@ MemberListType_pacMethods
Definition: types.h:109
MemberListType_interfaceMembers
@ MemberListType_interfaceMembers
Definition: types.h:186
MemberOf
@ MemberOf
Definition: types.h:35
MemberListType_proStaticAttribs
@ MemberListType_proStaticAttribs
Definition: types.h:123
MemberListType_detailedLists
@ MemberListType_detailedLists
Definition: types.h:103
LocalToc::isHtmlEnabled
bool isHtmlEnabled() const
Definition: types.h:337
MemberListType_related
@ MemberListType_related
Definition: types.h:130
CodeSymbolType::Concept
@ Concept
Grouping::GROUPING_AUTO_HIGHEST
@ GROUPING_AUTO_HIGHEST
Definition: types.h:73
MemberListType_serviceMembers
@ MemberListType_serviceMembers
Definition: types.h:188
MemberListType_priMethods
@ MemberListType_priMethods
Definition: types.h:110
Related
@ Related
Definition: types.h:38
MemberListType_documentationLists
@ MemberListType_documentationLists
Definition: types.h:105
MemberListType_docVarMembers
@ MemberListType_docVarMembers
Definition: types.h:169
CodeSymbolType::Struct
@ Struct
MemberType_Event
@ MemberType_Event
Definition: types.h:287
Grouping::GROUPING_INGROUP
@ GROUPING_INGROUP
membership in group was defined by @ingroup
Definition: types.h:74
LocalToc::Xml
@ Xml
Definition: types.h:308
MemberListType_proSlots
@ MemberListType_proSlots
Definition: types.h:116
MemberListType_decTypedefMembers
@ MemberListType_decTypedefMembers
Definition: types.h:151
MemberType_Sequence
@ MemberType_Sequence
Definition: types.h:290
Grouping::GROUPING_AUTO_ADD
@ GROUPING_AUTO_ADD
membership in group was defined via @add[to]group
Definition: types.h:71
SrcLangExt_IDL
@ SrcLangExt_IDL
Definition: types.h:44
LocalToc::xmlLevel
int xmlLevel() const
Definition: types.h:344
Grouping::Grouping
Grouping(const QCString &gn, GroupPri_t p)
Definition: types.h:94
CodeSymbolType::EnumValue
@ EnumValue
MemberListType_decSignalMembers
@ MemberListType_decSignalMembers
Definition: types.h:159
MemberListType_docPriSlotMembers
@ MemberListType_docPriSlotMembers
Definition: types.h:173
MemberListType_pubAttribs
@ MemberListType_pubAttribs
Definition: types.h:118
SrcLangExt_Markdown
@ SrcLangExt_Markdown
Definition: types.h:57
LocalToc::docbookLevel
int docbookLevel() const
Definition: types.h:345
Signal
@ Signal
Definition: types.h:32
LocalToc::numTocTypes
@ numTocTypes
Definition: types.h:310
MemberListType_docEnumValMembers
@ MemberListType_docEnumValMembers
Definition: types.h:170
MemberType_Define
@ MemberType_Define
Definition: types.h:276
CodeSymbolType::Sequence
@ Sequence
SrcLangExt_VHDL
@ SrcLangExt_VHDL
Definition: types.h:54
MemberListType_enumValMembers
@ MemberListType_enumValMembers
Definition: types.h:139
MemberListContainer::Group
@ Group
CodeSymbolType::Default
@ Default
MemberListType_eventMembers
@ MemberListType_eventMembers
Definition: types.h:144
LocalToc::isXmlEnabled
bool isXmlEnabled() const
Definition: types.h:339
Property
@ Property
Definition: types.h:32
MemberListType_pacStaticMethods
@ MemberListType_pacStaticMethods
Definition: types.h:113
FortranFormat_Fixed
@ FortranFormat_Fixed
Definition: types.h:298
MemberListType_properties
@ MemberListType_properties
Definition: types.h:134
Grouping::GROUPING_AUTO_WEAK
@ GROUPING_AUTO_WEAK
membership in group was defined via @weakgroup
Definition: types.h:70
LocalToc::mask
int mask() const
Definition: types.h:346
CodeSymbolType::Signal
@ Signal
FortranFormat_Unknown
@ FortranFormat_Unknown
Definition: types.h:296
LocalToc::Html
@ Html
Definition: types.h:306
Grouping::GROUPING_HIGHEST
@ GROUPING_HIGHEST
Definition: types.h:75
Foreign
@ Foreign
Definition: types.h:38
MemberListType_relatedMembers
@ MemberListType_relatedMembers
Definition: types.h:141
MemberListType_pubStaticMethods
@ MemberListType_pubStaticMethods
Definition: types.h:111
LocalToc::None
@ None
Definition: types.h:305
MemberListType_docProtoMembers
@ MemberListType_docProtoMembers
Definition: types.h:165
RelatesType
RelatesType
Type of member relation
Definition: types.h:35
CodeSymbolType
CodeSymbolType
Definition: types.h:204
Relationship
Relationship
Kind of member relationship
Definition: types.h:38
Simple
@ Simple
Definition: types.h:35
MemberListContainer::Class
@ Class
MemberListType_memberGroup
@ MemberListType_memberGroup
Definition: types.h:181
CodeSymbolType::Function
@ Function
CodeSymbolType::Interface
@ Interface
MemberListType_docEventMembers
@ MemberListType_docEventMembers
Definition: types.h:175
MemberListType_docTypedefMembers
@ MemberListType_docTypedefMembers
Definition: types.h:166
MemberListType_docPropMembers
@ MemberListType_docPropMembers
Definition: types.h:177
LocalToc::m_level
int m_level[numTocTypes]
Definition: types.h:350
MemberListType_propertyMembers
@ MemberListType_propertyMembers
Definition: types.h:143
CodeSymbolType::Protocol
@ Protocol
Slot
@ Slot
Definition: types.h:32
MemberListType_privateLists
@ MemberListType_privateLists
Definition: types.h:102
DCOP
@ DCOP
Definition: types.h:32
CodeSymbolType::Enumeration
@ Enumeration
Pure
@ Pure
Definition: types.h:29
Duplicate
@ Duplicate
Definition: types.h:35
SrcLangExt_Slice
@ SrcLangExt_Slice
Definition: types.h:59
QCString
This is an alternative implementation of QCString.
Definition: qcstring.h:108
LocalToc::enableHtml
void enableHtml(int level)
Definition: types.h:315