Chameleon

Chameleon Svn Source Tree

Root/branches/xZenu/src/util/doxygen/addon/doxmlparser/include/doxmlintf.h

Source at commit 1322 created 12 years 8 months ago.
By meklort, Add doxygen to utils folder
1/******************************************************************************
2 *
3 * $Id: doxmlintf.h,v 1.29 2002/10/13 21:01:58 dimitri Exp $
4 *
5 *
6 * Copyright (C) 1997-2006 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 */
15
16#ifndef _DOXMLINTF_H
17#define _DOXMLINTF_H
18
19/*! \file
20 * \brief The interface to the object model provided by the XML parser
21 * library.
22 *
23 * To start using this library one calls createObjectModel() and then
24 * uses the returned IDoxygen interface to read doxygen generated
25 * XML output and navigate through the information contained in it.
26 *
27 * @see createObjectModel()
28 */
29
30class IMember;
31class IDocIterator;
32class ICompound;
33class ISection;
34class INode;
35class IDocInternal;
36class IDocRoot;
37
38#define VIRTUAL_DESTRUCTOR(x) virtual ~x() {}
39
40/*! \brief Read only interface to a string.
41 */
42class IString
43{
44 public:
45 VIRTUAL_DESTRUCTOR(IString)
46 /*! Returns a latin1 character representation of the string. */
47 virtual const char *latin1() const = 0;
48 /*! Returns a utf8 character representation of the string. */
49 virtual const char *utf8() const = 0;
50 /*! Returns a 16-bit unicode character representation of the character at
51 * position \a index in the string. The first character is at index 0.
52 */
53 virtual unsigned short unicodeCharAt(int index) const = 0;
54 /*! Returns true if this string is empty or false otherwise */
55 virtual bool isEmpty() const = 0;
56 /*! Returns the number of characters in the string. */
57 virtual int length() const = 0;
58};
59
60/*! \brief Base interface for hyperlinked text
61 *
62 * Depending on the result of kind() the interface is extended by
63 * ILT_Text or ILT_Ref.
64 */
65class ILinkedText
66{
67 public:
68 VIRTUAL_DESTRUCTOR(ILinkedText)
69 enum Kind { Kind_Text, Kind_Ref };
70 virtual Kind kind() const = 0;
71};
72
73/*! \brief Plain text fragment.
74 */
75class ILT_Text : public ILinkedText
76{
77 public:
78 VIRTUAL_DESTRUCTOR(ILT_Text)
79 virtual const IString *text() const = 0;
80};
81
82/*! \brief Reference to an object.
83 */
84class ILT_Ref : public ILinkedText
85{
86 public:
87 VIRTUAL_DESTRUCTOR(ILT_Ref)
88 enum TargetKind { Member, Compound };
89 virtual const IString *id() const = 0;
90 virtual TargetKind targetKind() const = 0;
91 virtual const IString *external() const = 0;
92 virtual const IString *text() const = 0;
93};
94
95/*! \brief Iterates over a list of ILinkedText fragments.
96 */
97class ILinkedTextIterator
98{
99 public:
100 VIRTUAL_DESTRUCTOR(ILinkedTextIterator)
101 virtual ILinkedText *toFirst() = 0;
102 virtual ILinkedText *toLast() = 0;
103 virtual ILinkedText *toNext() = 0;
104 virtual ILinkedText *toPrev() = 0;
105 virtual ILinkedText *current() const = 0;
106 virtual void release() = 0;
107};
108
109/*! \brief Representation of a parameter of a function. */
110class IParam
111{
112 public:
113 VIRTUAL_DESTRUCTOR(IParam)
114 virtual ILinkedTextIterator *type() const = 0;
115 virtual const IString * declarationName() const = 0;
116 virtual const IString * definitionName() const = 0;
117 virtual const IString * attrib() const = 0;
118 virtual const IString * arraySpecifier() const = 0;
119 virtual ILinkedTextIterator *defaultValue() const = 0;
120 virtual IDocRoot *briefDescription() const = 0;
121};
122
123class IParamIterator
124{
125 public:
126 VIRTUAL_DESTRUCTOR(IParamIterator)
127 virtual IParam *toFirst() = 0;
128 virtual IParam *toLast() = 0;
129 virtual IParam *toNext() = 0;
130 virtual IParam *toPrev() = 0;
131 virtual IParam *current() const = 0;
132 virtual void release() = 0;
133};
134
135class IMemberReference
136{
137 public:
138 VIRTUAL_DESTRUCTOR(IMemberReference)
139 virtual IMember *member() const = 0;
140 virtual const IString * name() const = 0;
141 virtual const IString * scope() const = 0;
142 virtual const IString * protection() const = 0;
143 virtual const IString * virtualness() const = 0;
144 virtual const IString * ambiguityScope() const = 0;
145};
146
147class IMemberReferenceIterator
148{
149 public:
150 VIRTUAL_DESTRUCTOR(IMemberReferenceIterator)
151 virtual IMemberReference *toFirst() = 0;
152 virtual IMemberReference *toLast() = 0;
153 virtual IMemberReference *toNext() = 0;
154 virtual IMemberReference *toPrev() = 0;
155 virtual IMemberReference *current() const = 0;
156 virtual void release() = 0;
157};
158
159class IDoc
160{
161 public:
162 VIRTUAL_DESTRUCTOR(IDoc)
163 enum Kind
164 {
165 Invalid = 0, // 0
166 Para, // 1 -> IDocPara
167 Text, // 2 -> IDocText
168 MarkupModifier, // 3 -> IDocMarkupModifier
169 ItemizedList, // 4 -> IDocItemizedList
170 OrderedList, // 5 -> IDocOrderedList
171 ListItem, // 6 -> IDocListItem
172 ParameterList, // 7 -> IDocParameterList
173 Parameter, // 8 -> IDocParameter
174 SimpleSect, // 9 -> IDocSimpleSect
175 Title, // 10 -> IDocTitle
176 Ref, // 11 -> IDocRef
177 VariableList, // 12 -> IDocVariableList
178 VariableListEntry, // 13 -> IDocVariableListEntry
179 HRuler, // 14 -> IDocHRuler
180 LineBreak, // 15 -> IDocLineBreak
181 ULink, // 16 -> IDocULink
182 EMail, // 17 -> IDocEMail
183 Link, // 18 -> IDocLink
184 ProgramListing, // 19 -> IDocProgramListing
185 CodeLine, // 20 -> IDocCodeLine
186 Highlight, // 21 -> IDocHighlight
187 Formula, // 22 -> IDocFormula
188 Image, // 23 -> IDocImage
189 DotFile, // 24 -> IDocDotFile
190 IndexEntry, // 25 -> IDocIndexEntry
191 Table, // 26 -> IDocTable
192 Row, // 27 -> IDocRow
193 Entry, // 28 -> IDocEntry
194 Section, // 29 -> IDocSection
195 Verbatim, // 30 -> IDocVerbatim
196 Copy, // 31 -> IDocCopy
197 TocList, // 32 -> IDocTocList
198 TocItem, // 33 -> IDocTocItem
199 Anchor, // 34 -> IDocAnchor
200 Symbol, // 35 -> IDocSymbol
201 Internal, // 36 -> IDocInternal
202 Root, // 37 -> IDocRoot
203 ParameterItem // 38 -> IDocParameterItem
204 };
205 virtual Kind kind() const = 0;
206};
207
208class IDocMarkup : public IDoc
209{
210 public:
211 enum Markup
212 {
213 Normal = 0x000,
214 Bold = 0x001,
215 Emphasis = 0x002,
216 ComputerOutput = 0x004,
217 Subscript = 0x008,
218 Superscript = 0x010,
219 SmallFont = 0x020,
220 Center = 0x040,
221 Preformatted = 0x080,
222 Heading = 0x100
223 };
224};
225
226class IDocPara : public IDoc
227{
228 public:
229 virtual IDocIterator *contents() const = 0;
230};
231
232class IDocText : public IDocMarkup
233{
234 public:
235 virtual const IString * text() const = 0;
236 virtual int markup() const = 0;
237 virtual int headingLevel() const = 0;
238};
239
240class IDocMarkupModifier : public IDoc
241{
242 public:
243 virtual bool enabled() const = 0;
244 virtual int markup() const = 0;
245 virtual int headingLevel() const = 0;
246};
247
248class IDocItemizedList : public IDoc
249{
250 public:
251 virtual IDocIterator *elements() const = 0;
252};
253
254class IDocOrderedList : public IDoc
255{
256 public:
257 virtual IDocIterator *elements() const = 0;
258};
259
260class IDocListItem : public IDoc
261{
262 public:
263 virtual IDocIterator *contents() const = 0;
264};
265
266class IDocParameterList : public IDoc
267{
268 public:
269 enum Types { Param, RetVal, Exception };
270 virtual Types sectType() const = 0;
271 virtual IDocIterator *params() const = 0;
272};
273
274class IDocParameterItem : public IDoc
275{
276 public:
277 virtual IDocIterator *paramNames() const = 0;
278 virtual IDocPara *description() const = 0;
279};
280
281class IDocParameter : public IDoc
282{
283 public:
284 virtual const IString * name() const = 0;
285};
286
287class IDocTitle : public IDoc
288{
289 public:
290 virtual IDocIterator *title() const = 0;
291};
292
293class IDocSimpleSect : public IDoc
294{
295 public:
296 enum Types { Invalid = 0,
297 See, Return, Author, Version,
298 Since, Date, Bug, Note,
299 Warning, Par, Deprecated, Pre,
300 Post, Invar, Remark, Attention,
301 Todo, Test, RCS, EnumValues,
302 Examples
303 };
304 virtual Types type() const = 0;
305 virtual const IString * typeString() const = 0;
306 virtual IDocTitle *title() const = 0;
307 virtual IDocPara *description() const = 0;
308};
309
310class IDocRef : public IDoc
311{
312 public:
313 enum TargetKind { Member, Compound };
314 virtual const IString * refId() const = 0;
315 virtual TargetKind targetKind() const = 0;
316 virtual const IString * external() const = 0;
317 virtual const IString * text() const = 0;
318};
319
320class IDocVariableList : public IDoc
321{
322 public:
323 virtual IDocIterator *entries() const = 0;
324};
325
326class IDocVariableListEntry : public IDoc
327{
328 public:
329 virtual ILinkedTextIterator * term() const = 0;
330 virtual IDocPara *description() const = 0;
331};
332
333class IDocHRuler : public IDoc
334{
335};
336
337class IDocLineBreak : public IDoc
338{
339};
340
341class IDocULink : public IDoc
342{
343 public:
344 virtual const IString * url() const = 0;
345 virtual const IString * text() const = 0;
346};
347
348class IDocEMail : public IDoc
349{
350 public:
351 virtual const IString * address() const = 0;
352};
353
354class IDocLink : public IDoc
355{
356 public:
357 virtual const IString * refId() const = 0;
358 virtual const IString * text() const = 0;
359};
360
361class IDocProgramListing : public IDoc
362{
363 public:
364 virtual IDocIterator *codeLines() const = 0;
365};
366
367class IDocCodeLine : public IDoc
368{
369 public:
370 virtual int lineNumber() const = 0;
371 virtual const IString * refId() const = 0;
372 virtual IDocIterator *codeElements() const = 0;
373};
374
375class IDocHighlight : public IDoc
376{
377 public:
378 enum HighlightKind
379 { Invalid=0,
380 Comment, Keyword,
381 KeywordType, KeywordFlow, CharLiteral,
382 StringLiteral, Preprocessor
383 };
384 virtual HighlightKind highlightKind() const = 0;
385 virtual IDocIterator *codeElements() const = 0;
386};
387
388class IDocFormula : public IDoc
389{
390 public:
391 virtual const IString * id() const = 0;
392 virtual const IString * text() const = 0;
393};
394
395class IDocImage : public IDoc
396{
397 public:
398 virtual const IString * name() const = 0;
399 virtual const IString * caption() const = 0;
400};
401
402class IDocDotFile : public IDoc
403{
404 public:
405 virtual const IString * name() const = 0;
406 virtual const IString * caption() const = 0;
407};
408
409class IDocIndexEntry : public IDoc
410{
411 public:
412 virtual const IString * primary() const = 0;
413 virtual const IString * secondary() const = 0;
414};
415
416class IDocTable : public IDoc
417{
418 public:
419 virtual IDocIterator *rows() const = 0;
420 virtual int numColumns() const = 0;
421 virtual const IString * caption() const = 0;
422};
423
424class IDocRow : public IDoc
425{
426 public:
427 virtual IDocIterator *entries() const = 0;
428};
429
430class IDocEntry : public IDoc
431{
432 public:
433 virtual IDocIterator *contents() const = 0;
434};
435
436class IDocSection : public IDoc
437{
438 public:
439 virtual const IString * id() const = 0;
440 virtual int level() const = 0;
441 virtual IDocTitle *title() const = 0;
442 virtual IDocIterator *paragraphs() const = 0;
443 virtual IDocIterator *subSections() const = 0;
444 virtual IDocInternal *internal() const = 0;
445};
446
447class IDocInternal : public IDoc
448{
449 public:
450 virtual IDocIterator *paragraphs() const = 0;
451 virtual IDocIterator *subSections() const = 0;
452};
453
454class IDocTocList : public IDoc
455{
456 public:
457 virtual IDocIterator *elements() const = 0;
458};
459
460class IDocTocItem : public IDoc
461{
462 public:
463 virtual const IString *id() const = 0;
464 virtual const IString *title() const = 0;
465};
466
467class IDocCopy : public IDoc
468{
469 public:
470 virtual IDocIterator *contents() const = 0;
471};
472
473class IDocVerbatim : public IDoc
474{
475 public:
476 enum Types { Invalid = 0, HtmlOnly, LatexOnly, Verbatim };
477 virtual const IString *text() const = 0;
478 virtual Types type() const = 0;
479};
480
481class IDocAnchor : public IDoc
482{
483 public:
484 virtual const IString *id() const = 0;
485};
486
487class IDocSymbol : public IDoc
488{
489 public:
490 enum Types
491 { Invalid = 0,
492 Umlaut, Acute, Grave, Circ, Tilde, Szlig, Cedil, Ring, Nbsp, Copy
493 };
494 virtual Types type() const = 0;
495 virtual const IString * typeString() const = 0;
496 virtual char letter() const = 0;
497};
498
499class IDocRoot : public IDoc
500{
501 public:
502 virtual IDocIterator *contents() const = 0;
503 virtual IDocInternal *internal() const = 0;
504};
505
506class IDocIterator
507{
508 public:
509 VIRTUAL_DESTRUCTOR(IDocIterator)
510 virtual IDoc *toFirst() = 0;
511 virtual IDoc *toLast() = 0;
512 virtual IDoc *toNext() = 0;
513 virtual IDoc *toPrev() = 0;
514 virtual IDoc *current() const = 0;
515 virtual void release() = 0;
516};
517
518class IEdgeLabel
519{
520 public:
521 VIRTUAL_DESTRUCTOR(IEdgeLabel)
522 virtual const IString * label() const = 0;
523};
524
525class IEdgeLabelIterator
526{
527 public:
528 VIRTUAL_DESTRUCTOR(IEdgeLabelIterator)
529 virtual IEdgeLabel *toFirst() = 0;
530 virtual IEdgeLabel *toLast() = 0;
531 virtual IEdgeLabel *toNext() = 0;
532 virtual IEdgeLabel *toPrev() = 0;
533 virtual IEdgeLabel *current() const = 0;
534 virtual void release() = 0;
535};
536
537class IChildNode
538{
539 public:
540 VIRTUAL_DESTRUCTOR(IChildNode)
541 enum NodeRelation { PublicInheritance, ProtectedInheritance,
542 PrivateInheritance, Usage, TemplateInstance
543 };
544 virtual INode * node() const = 0;
545 virtual NodeRelation relation() const = 0;
546 virtual const IString * relationString() const = 0;
547 virtual IEdgeLabelIterator *edgeLabels() const = 0;
548};
549
550class IChildNodeIterator
551{
552 public:
553 VIRTUAL_DESTRUCTOR(IChildNodeIterator)
554 virtual IChildNode *toFirst() = 0;
555 virtual IChildNode *toLast() = 0;
556 virtual IChildNode *toNext() = 0;
557 virtual IChildNode *toPrev() = 0;
558 virtual IChildNode *current() const = 0;
559 virtual void release() = 0;
560};
561
562class INode
563{
564 public:
565 VIRTUAL_DESTRUCTOR(INode)
566 virtual const IString * id() const = 0;
567 virtual const IString * label() const = 0;
568 virtual const IString * linkId() const = 0;
569 virtual IChildNodeIterator *children() const = 0;
570};
571
572class INodeIterator
573{
574 public:
575 VIRTUAL_DESTRUCTOR(INodeIterator)
576 virtual INode *toFirst() = 0;
577 virtual INode *toLast() = 0;
578 virtual INode *toNext() = 0;
579 virtual INode *toPrev() = 0;
580 virtual INode *current() const = 0;
581 virtual void release() = 0;
582};
583
584class IGraph
585{
586 public:
587 VIRTUAL_DESTRUCTOR(IGraph)
588 virtual INodeIterator *nodes() const = 0;
589};
590
591class IMember
592{
593 public:
594 VIRTUAL_DESTRUCTOR(IMember)
595 enum MemberKind { Invalid=0,
596 Define, Property, Variable, Typedef, Enum,
597 Function, Signal, Prototype, Friend, DCOP, Slot,
598 EnumValue
599 };
600 virtual ICompound *compound() const = 0;
601 virtual ISection *section() const = 0;
602 virtual MemberKind kind() const = 0;
603 virtual const IString * kindString() const = 0;
604 virtual const IString * id() const = 0;
605 virtual const IString * protection() const = 0;
606 virtual const IString * virtualness() const = 0;
607 virtual ILinkedTextIterator *type() const = 0;
608 virtual const IString * typeString() const = 0;
609 virtual const IString * name() const = 0;
610 virtual const IString * readAccessor() const = 0;
611 virtual const IString * writeAccessor() const = 0;
612 virtual const IString * definition() const = 0;
613 virtual const IString * argsstring() const = 0;
614 virtual bool isConst() const = 0;
615 virtual bool isVolatile() const = 0;
616 virtual bool isStatic() const = 0;
617 virtual bool isExplicit() const = 0;
618 virtual bool isInline() const = 0;
619 virtual bool isMutable() const = 0;
620 virtual bool isReadable() const = 0;
621 virtual bool isWritable() const = 0;
622 virtual IParamIterator *parameters() const = 0;
623 virtual IParamIterator *templateParameters() const = 0;
624 virtual ILinkedTextIterator *initializer() const = 0;
625 virtual ILinkedTextIterator *exceptions() const = 0;
626 virtual IMemberReferenceIterator *references() const = 0;
627 virtual IMemberReferenceIterator *referencedBy() const = 0;
628 virtual const IString *bodyFile() const = 0;
629 virtual int bodyStart() const = 0;
630 virtual int bodyEnd() const = 0;
631 virtual const IString * definitionFile() const = 0;
632 virtual int definitionLine() const = 0;
633 virtual IMemberReference *reimplements() const = 0;
634 virtual IMemberReferenceIterator *reimplementedBy() const = 0;
635 virtual IDocRoot *briefDescription() const = 0;
636 virtual IDocRoot *detailedDescription() const = 0;
637 virtual IDocRoot *inbodyDescription() const = 0;
638};
639
640class IDefine : public IMember
641{
642 public:
643};
644
645class IProperty : public IMember
646{
647 public:
648};
649
650class IVariable : public IMember
651{
652 public:
653};
654
655class ITypedef : public IMember
656{
657 public:
658};
659
660class IFunction : public IMember
661{
662 public:
663};
664
665class ISignal : public IMember
666{
667 public:
668};
669
670class IPrototype : public IMember
671{
672 public:
673};
674
675class IFriend : public IMember
676{
677 public:
678};
679
680class IDCOP : public IMember
681{
682 public:
683};
684
685class ISlot : public IMember
686{
687 public:
688};
689
690class IEnumValue : public IMember
691{
692 public:
693 virtual const IString * name() const = 0;
694};
695
696/*! \brief Include relation
697 */
698class IInclude
699{
700 public:
701 VIRTUAL_DESTRUCTOR(IInclude)
702 virtual const IString * name() const = 0;
703 virtual const IString * refId() const = 0;
704 virtual bool isLocal() const = 0;
705};
706
707class IIncludeIterator
708{
709 public:
710 VIRTUAL_DESTRUCTOR(IIncludeIterator)
711 virtual IInclude *toFirst() = 0;
712 virtual IInclude *toLast() = 0;
713 virtual IInclude *toNext() = 0;
714 virtual IInclude *toPrev() = 0;
715 virtual IInclude *current() const = 0;
716 virtual void release() = 0;
717};
718
719class IMemberIterator
720{
721 public:
722 VIRTUAL_DESTRUCTOR(IMemberIterator)
723 virtual IMember *toFirst() = 0;
724 virtual IMember *toLast() = 0;
725 virtual IMember *toNext() = 0;
726 virtual IMember *toPrev() = 0;
727 virtual IMember *current() const = 0;
728 virtual void release() = 0;
729};
730
731class IEnum : public IMember
732{
733 public:
734 virtual IMemberIterator *enumValues() const = 0;
735};
736
737/*! \brief The interface to a section in the object model.
738 *
739 * A compound can have a number of sections, where each
740 * section contains a set of members with the properties implied by
741 * the section kind. The kind() method returns the kind of the section.
742 * The members of the section can be accessed via members(). Apart
743 * from using kind(), some of the individual properties of the section can
744 * also be inspected via isStatic(), isPublic(), isProtected() and
745 * isPrivate().
746 */
747class ISection
748{
749 public:
750 VIRTUAL_DESTRUCTOR(ISection)
751 /*! Possible section types */
752 enum SectionKind
753 { Invalid=0,
754 UserDefined, //!< A user defined member group
755 PubTypes, //!< Public member typedefs
756 PubFuncs, //!< Public member functions
757 PubAttribs, //!< Public member attributes
758 PubSlots, //!< Public Qt Slots
759 Signals, //!< Qt Signals
760 DCOPFuncs, //!< KDE-DCOP interface functions
761 Properties, //!< IDL properties
762 Events, //!< C# events
763 PubStatFuncs, //!< Public static member functions
764 PubStatAttribs, //!< Public static attributes
765 ProTypes, //!< Protected member typedefs
766 ProFuncs, //!< Protected member functions
767 ProAttribs, //!< Protected member attributes
768 ProSlots, //!< Protected slots
769 ProStatFuncs, //!< Protected static member functions
770 ProStatAttribs, //!< Protected static member attributes
771 PacTypes, //!< Package member typedefs
772 PacFuncs, //!< Package member functions
773 PacAttribs, //!< Package member attributes
774 PacStatFuncs, //!< Package static member functions
775 PacStatAttribs, //!< Package static member attributes
776 PriTypes, //!< Private member typedefs
777 PriFuncs, //!< Private member functions
778 PriAttribs, //!< Private member attributes
779 PriSlots, //!< Private Qt slots
780 PriStatFuncs, //!< Private static member functions
781 PriStatAttribs, //!< Private static member attributes
782 Friend, //!< Friends
783 Related, //!< Function marked as related
784 Defines, //!< Preprocessor defines
785 Prototypes, //!< Global function prototypes
786 Typedefs, //!< Global typedefs
787 Enums, //!< Enumerations
788 Functions, //!< Global functions
789 Variables //!< Global variables
790 };
791
792 /*! Returns a string representation of the value returned by kind() */
793 virtual const IString * kindString() const = 0;
794
795 /*! Returns what kind of section this is */
796 virtual SectionKind kind() const = 0;
797
798 /*! Returns the description attached to this section (for user defined
799 * sections, also known as member groups).
800 */
801 virtual IDocRoot *description() const = 0;
802
803 /*! Returns an iterator for the members of this section */
804 virtual IMemberIterator *members() const = 0;
805
806 /*! Returns \c true if this section contains statics */
807 virtual bool isStatic() const = 0;
808
809 /*! Returns \c true if this section belongs to a
810 * public section of a class
811 */
812 virtual bool isPublic() const = 0;
813
814 /*! Returns \c true if this section belongs to a
815 * private section of a class
816 */
817 virtual bool isPrivate() const = 0;
818
819 /*! Returns \c true if this section belongs to a
820 * protected section of a class
821 * */
822 virtual bool isProtected() const = 0;
823};
824
825class IUserDefined : public ISection
826{
827 public:
828 virtual const IString * header() const = 0;
829};
830
831class ISectionIterator
832{
833 public:
834 VIRTUAL_DESTRUCTOR(ISectionIterator)
835 virtual ISection *toFirst() = 0;
836 virtual ISection *toLast() = 0;
837 virtual ISection *toNext() = 0;
838 virtual ISection *toPrev() = 0;
839 virtual ISection *current() const = 0;
840 virtual void release() = 0;
841};
842
843/*! \brief The interface to a compound in the object model.
844 *
845 * A compound has a name which can be obtained via the name() method
846 * and a unique id, which is return via the id() method.
847 * A compound consists zero or more members which are grouped into sections.
848 * The sections() method can be used to access the individual sections.
849 * Alternatively, members can be obtained by name or id. There are
850 * different types of compounds. The kind() method returns what kind of
851 * compound this is. Depending on the return value one can dynamically
852 * cast an interface pointer to an more specialised interface that provides
853 * additional methods.
854 * Example:
855 * \code
856 * ICompound *comp=...;
857 * if (comp->kind()==ICompound::Class)
858 * {
859 * IClass *cls = dynamic_cast<IClass*>(comp);
860 * // use methods of IClass
861 * }
862 * \endcode
863 * The documentation that is provided by a compound is available via
864 * the briefDescription() and detailedDescription() methods.
865 * To avoid excessive memory usage, release() should be called (once) on each
866 * compound interface pointer that is no longer needed.
867 */
868class ICompound
869{
870 public:
871 VIRTUAL_DESTRUCTOR(ICompound)
872 /*! Represents the kind of compounds recognised by doxygen. */
873 enum CompoundKind { Invalid=0,
874 Class, Struct, Union, Interface, Protocol, Category,
875 Exception, File, Namespace, Group, Page, Example, Dir
876 };
877
878 /*! Returns the name of this compound */
879 virtual const IString * name() const = 0;
880
881 /*! Returns the id of this compound. The id is a
882 * unique string representing a specific compound object.
883 */
884 virtual const IString * id() const = 0;
885
886 /*! Returns the kind of compound. See #CompoundKind for possible
887 * values.
888 */
889 virtual CompoundKind kind() const = 0;
890
891 /*! Returns a string representation of the compound kind.
892 * @see kind()
893 */
894 virtual const IString * kindString() const = 0;
895
896 /*! Returns an iterator for the different member sections in this
897 * compound.
898 */
899 virtual ISectionIterator *sections() const = 0;
900
901 /*! Returns a tree-structured representation of the brief
902 * description that is attached to this compound.
903 */
904 virtual IDocRoot *briefDescription() const = 0;
905
906 /*! Returns a tree-structured representation of the detailed
907 * description that is attached to this compound.
908 */
909 virtual IDocRoot *detailedDescription() const = 0;
910
911 /*! Returns an interface to a member given its id.
912 * @param id The member id.
913 */
914 virtual IMember *memberById(const char * id) const = 0;
915
916 /*! Returns a list of all members within the compound having a certain
917 * name. Member overloading is the reason why there can be more than
918 * one member.
919 * @param name The name of the member.
920 */
921 virtual IMemberIterator *memberByName(const char * name) const = 0;
922
923 /*! Decreases the reference counter for this compound. If it reaches
924 * zero, the memory for the compound will be released.
925 */
926 virtual void release() = 0;
927};
928
929class ICompoundIterator
930{
931 public:
932 VIRTUAL_DESTRUCTOR(ICompoundIterator)
933 virtual void toFirst() = 0;
934 virtual void toLast() = 0;
935 virtual void toNext() = 0;
936 virtual void toPrev() = 0;
937 virtual ICompound *current() const = 0;
938 virtual void release() = 0;
939};
940
941class IRelatedCompound
942{
943 public:
944 VIRTUAL_DESTRUCTOR(IRelatedCompound)
945 enum Protection { Public, Protected, Private };
946 enum Kind { Normal, Virtual };
947 virtual ICompound *compound() const = 0;
948 virtual Protection protection() const = 0;
949 virtual Kind kind() const = 0;
950 virtual const IString *name() const = 0;
951
952};
953
954class IRelatedCompoundIterator
955{
956 public:
957 VIRTUAL_DESTRUCTOR(IRelatedCompoundIterator)
958 virtual IRelatedCompound *toFirst() = 0;
959 virtual IRelatedCompound *toLast() = 0;
960 virtual IRelatedCompound *toNext() = 0;
961 virtual IRelatedCompound *toPrev() = 0;
962 virtual IRelatedCompound *current() const = 0;
963 virtual void release() = 0;
964};
965
966/*! \brief The interface to a class in the object model.
967 */
968class IClass : public ICompound
969{
970 public:
971 virtual IGraph *inheritanceGraph() const = 0;
972 virtual IGraph *collaborationGraph() const = 0;
973 virtual IRelatedCompoundIterator *baseCompounds() const = 0;
974 virtual IRelatedCompoundIterator *derivedCompounds() const = 0;
975 virtual ICompoundIterator *nestedCompounds() const = 0;
976 virtual IParamIterator *templateParameters() const = 0;
977 virtual const IString *locationFile() const = 0;
978 virtual int locationLine() const = 0;
979 virtual const IString *locationBodyFile() const = 0;
980 virtual int locationBodyStartLine() const = 0;
981 virtual int locationBodyEndLine() const = 0;
982
983 // TODO:
984 // class:
985 // listOfAllMembers()
986 // protection()
987 // isAbstract()
988};
989
990/*! \brief The interface to a struct in the object model.
991 */
992class IStruct : public ICompound
993{
994 public:
995 virtual ICompoundIterator *nestedCompounds() const = 0;
996 virtual IRelatedCompoundIterator *baseCompounds() const = 0;
997 virtual IRelatedCompoundIterator *derivedCompounds() const = 0;
998 virtual const IString *locationFile() const = 0;
999 virtual int locationLine() const = 0;
1000 virtual int locationBodyStartLine() const = 0;
1001 virtual int locationBodyEndLine() const = 0;
1002};
1003
1004/*! \brief The interface to a union in the object model.
1005 */
1006class IUnion : public ICompound
1007{
1008 public:
1009 virtual ICompoundIterator *nestedCompounds() const = 0;
1010};
1011
1012/*! \brief The interface to a Java/IDL interface in the object model.
1013 */
1014class IInterface : public ICompound
1015{
1016 public:
1017 virtual IRelatedCompoundIterator *baseCompounds() const = 0;
1018 virtual IRelatedCompoundIterator *derivedCompounds() const = 0;
1019};
1020
1021
1022/*! \brief The interface to a Java/IDL exception in the object model.
1023 */
1024class IException : public ICompound
1025{
1026};
1027
1028/*! \brief The interface to a namespace in the object model.
1029 */
1030class INamespace : public ICompound
1031{
1032 public:
1033 virtual ICompoundIterator *nestedCompounds() const = 0;
1034};
1035
1036/*! \brief The interface to a file in the object model.
1037 */
1038class IFile : public ICompound
1039{
1040 public:
1041 virtual IGraph *includeDependencyGraph() const = 0;
1042 virtual IGraph *includedByDependencyGraph() const = 0;
1043 virtual IDocProgramListing *source() const = 0;
1044 virtual ICompoundIterator *nestedCompounds() const = 0;
1045
1046 virtual IIncludeIterator *includes() const = 0;
1047 virtual IIncludeIterator *includedBy() const = 0;
1048
1049 // ICompound *innerNamespaces()
1050 // ICompoundIterator *innerClasses()
1051};
1052
1053/*! \brief The interface to a group in the object model.
1054 */
1055class IGroup : public ICompound
1056{
1057 public:
1058 virtual ICompoundIterator *nestedCompounds() const = 0;
1059 // group:
1060 // Title()
1061 // innerFile()
1062 // innerPage()
1063};
1064
1065/*! \brief The interface to a page in the object model.
1066 */
1067class IPage : public ICompound
1068{
1069 public:
1070 virtual const IDocTitle *title() const = 0;
1071};
1072
1073/*! Root node of the object model. */
1074class IDoxygen
1075{
1076 public:
1077 VIRTUAL_DESTRUCTOR(IDoxygen)
1078
1079 /*! Returns an iterator that can be used to iterate over the list
1080 * of compounds found in the project.
1081 */
1082 virtual ICompoundIterator *compounds() const = 0;
1083
1084 /*! Returns a compound given its unique \a id. If you have a
1085 * compound id this function is much more efficient than iterating
1086 * over the compound list. Returns 0 if the id is not valid.
1087 */
1088 virtual ICompound *compoundById(const char * id) const = 0;
1089
1090 /*! Returns a compound given its name (including the scope).
1091 * Returns 0 if the name is not found in the project.
1092 */
1093 virtual ICompound *compoundByName(const char * name) const = 0;
1094
1095 /*! Returns an interface to a compound containing a member given it the
1096 * member's id. Given the ICompound interface one can use the same id
1097 * to obtain the IMember interface.
1098 * @param id The member id.
1099 */
1100 virtual ICompound *memberById(const char * id) const = 0;
1101
1102 /*! Returns a list of all compounds containing at least one members
1103 * with a certain name. Each compound can be asked to return the
1104 * list of members with that name.
1105 * @param name The name of the member.
1106 */
1107 virtual ICompoundIterator *memberByName(const char * name) const = 0;
1108
1109 /*! Releases the memory for the object hierarchy obtained by
1110 * createdObjecModelFromXML(). First release all iterators before calling
1111 * this function.
1112 */
1113 virtual void release() = 0;
1114
1115 /*! Sets the debug level.
1116 * - 0 all debugging messages are disabled (the default).
1117 * - 1 display important messages only
1118 * - 2 display any messages.
1119 */
1120 virtual void setDebugLevel(int level) = 0;
1121
1122 /*! Reads an XML directory produced by doxygen and builds up a data
1123 * structure representing the contents of the XML files in the directory.
1124 */
1125 virtual bool readXMLDir(const char *xmlDirName) = 0;
1126};
1127
1128/*! Factory method that creates an empty object model for a doxygen generated XML file.
1129 * Use the readXMLDir() method to build the model from an XML output
1130 * directory containing doxygen output.
1131 */
1132IDoxygen *createObjectModel();
1133
1134#endif
1135

Archive Download this file

Revision: 1322