My Project
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
outputlist.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 OUTPUTLIST_H
19 #define OUTPUTLIST_H
20 
21 #include <qlist.h>
22 #include "index.h" // for IndexSections
23 #include "outputgen.h"
24 
25 #define FORALLPROTO1(arg1) \
26  void forall(void (OutputGenerator::*func)(arg1),arg1)
27 #define FORALLPROTO2(arg1,arg2) \
28  void forall(void (OutputGenerator::*func)(arg1,arg2),arg1,arg2)
29 #define FORALLPROTO3(arg1,arg2,arg3) \
30  void forall(void (OutputGenerator::*func)(arg1,arg2,arg3),arg1,arg2,arg3)
31 #define FORALLPROTO4(arg1,arg2,arg3,arg4) \
32  void forall(void (OutputGenerator::*func)(arg1,arg2,arg3,arg4),arg1,arg2,arg3,arg4)
33 #define FORALLPROTO5(arg1,arg2,arg3,arg4,arg5) \
34  void forall(void (OutputGenerator::*func)(arg1,arg2,arg3,arg4,arg5),arg1,arg2,arg3,arg4,arg5)
35 #define FORALLPROTO6(arg1,arg2,arg3,arg4,arg5,arg6) \
36  void forall(void (OutputGenerator::*func)(arg1,arg2,arg3,arg4,arg5,arg6),arg1,arg2,arg3,arg4,arg5,arg6)
37 #define FORALLPROTO7(arg1,arg2,arg3,arg4,arg5,arg6,arg7) \
38  void forall(void (OutputGenerator::*func)(arg1,arg2,arg3,arg4,arg5,arg6,arg7),arg1,arg2,arg3,arg4,arg5,arg6,arg7)
39 #define FORALLPROTO8(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) \
40  void forall(void (OutputGenerator::*func)(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8),arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8)
41 
42 class ClassDiagram;
43 class DotClassGraph;
44 class DotDirDeps;
45 class DotInclDepGraph;
47 class SectionDict;
49 class DocRoot;
50 
55 {
56  public:
57  OutputList(bool);
58  virtual ~OutputList();
59 
60  void add(const OutputGenerator *);
61  uint count() const { return m_outputs.count(); }
62 
64  void enableAll();
65  void disableAll();
69  void pushGeneratorState();
70  void popGeneratorState();
71 
72 
74  // OutputDocInterface implementation
76 
77  bool generateDoc(const char *fileName,int startLine,
78  Definition *ctx,MemberDef *md,const QCString &docStr,
79  bool indexWords,bool isExample,const char *exampleName=0,
80  bool singleLine=FALSE,bool linkFromIndex=FALSE);
81  void writeDoc(DocRoot *root,Definition *ctx,MemberDef *md);
82  bool parseText(const QCString &textStr);
83 
84 
89  void writePageLink(const char *name,bool first)
90  { forall(&OutputGenerator::writePageLink,name,first); }
95  void writeStyleInfo(int part)
97  void startFile(const char *name,const char *manName,const char *title)
98  { forall(&OutputGenerator::startFile,name,manName,title); }
101  void writeFooter(const char *navPath)
102  { forall(&OutputGenerator::writeFooter,navPath); }
103  void endFile()
105  void startTitleHead(const char *fileName)
107  void endTitleHead(const char *fileName,const char *name)
108  { forall(&OutputGenerator::endTitleHead,fileName,name); }
109  void startTitle()
111  void endTitle()
113  //void newParagraph()
114  //{ forall(&OutputGenerator::newParagraph); }
117  void endParagraph()
119  void writeString(const char *text)
127  void endIndexList()
131  void endIndexKey()
133  void startIndexValue(bool b)
135  void endIndexValue(const char *name,bool b)
139  void endItemList()
141  void startIndexItem(const char *ref,const char *file)
143  void endIndexItem(const char *ref,const char *file)
144  { forall(&OutputGenerator::endIndexItem,ref,file); }
145  void docify(const char *s)
147  void codify(const char *s)
149  void writeObjectLink(const char *ref,const char *file,
150  const char *anchor, const char *name)
151  { forall(&OutputGenerator::writeObjectLink,ref,file,anchor,name); }
152  void writeCodeLink(const char *ref,const char *file,
153  const char *anchor,const char *name,
154  const char *tooltip)
155  { forall(&OutputGenerator::writeCodeLink,ref,file,anchor,name,tooltip); }
156  void writeTooltip(const char *id, const DocLinkInfo &docInfo, const char *decl,
157  const char *desc, const SourceLinkInfo &defInfo, const SourceLinkInfo &declInfo)
158  { forall(&OutputGenerator::writeTooltip,id,docInfo,decl,desc,defInfo,declInfo); }
159  void startTextLink(const char *file,const char *anchor)
160  { forall(&OutputGenerator::startTextLink,file,anchor); }
161  void endTextLink()
163  void startHtmlLink(const char *url)
165  void endHtmlLink()
167  void writeStartAnnoItem(const char *type,const char *file,
168  const char *path,const char *name)
169  { forall(&OutputGenerator::writeStartAnnoItem,type,file,path,name); }
170  void writeEndAnnoItem(const char *name)
176  void startGroupHeader(int extraLevels=0)
177  { forall(&OutputGenerator::startGroupHeader,extraLevels); }
178  void endGroupHeader(int extraLevels=0)
179  { forall(&OutputGenerator::endGroupHeader,extraLevels); }
180  //void writeListItem()
181  //{ forall(&OutputGenerator::writeListItem); }
194  void startMemberHeader(const char *anchor)
214  void startAnonTypeScope(int i1)
216  void endAnonTypeScope(int i1)
218  void startMemberItem(const char *anchor,int i1,const char *id=0)
219  { forall(&OutputGenerator::startMemberItem,anchor,i1,id); }
224  void endMemberTemplateParams(const char *anchor,const char *inheritId)
225  { forall(&OutputGenerator::endMemberTemplateParams,anchor,inheritId); }
236  void endMemberGroup(bool last)
238  void insertMemberAlign(bool templ=FALSE)
240  void writeRuler()
242  void writeAnchor(const char *fileName,const char *name)
243  { forall(&OutputGenerator::writeAnchor,fileName,name); }
248  void startCodeLine(bool hasLineNumbers)
249  { forall(&OutputGenerator::startCodeLine,hasLineNumbers); }
250  void endCodeLine()
252  void writeLineNumber(const char *ref,const char *file,const char *anchor,
253  int lineNumber)
254  { forall(&OutputGenerator::writeLineNumber,ref,file,anchor,lineNumber); }
257  void endEmphasis()
259  void writeChar(char c)
261  void startMemberDoc(const char *clName,const char *memName,
262  const char *anchor,const char *title,
263  int memCount,int memTotal,bool showInline)
264  { forall(&OutputGenerator::startMemberDoc,clName,memName,anchor,title,memCount,memTotal,showInline); }
265  void endMemberDoc(bool hasArgs)
267  void startDoxyAnchor(const char *fName,const char *manName,
268  const char *anchor, const char *name,
269  const char *args)
270  { forall(&OutputGenerator::startDoxyAnchor,fName,manName,anchor,name,args); }
271  void endDoxyAnchor(const char *fn,const char *anchor)
272  { forall(&OutputGenerator::endDoxyAnchor,fn,anchor); }
281  void endDescItem()
295  void startCenter()
297  void endCenter()
299  void startSmall()
301  void endSmall()
303  void lineBreak(const char *style=0)
305  void startBold()
307  void endBold()
309  void startMemberDescription(const char *anchor,const char *inheritId=0)
310  { forall(&OutputGenerator::startMemberDescription,anchor,inheritId); }
315  void endMemberDeclaration(const char *anchor,const char *inheritId)
316  { forall(&OutputGenerator::endMemberDeclaration,anchor,inheritId); }
317  void writeInheritedSectionTitle(const char *id, const char *ref,
318  const char *file, const char *anchor,
319  const char *title,const char *name)
321  file,anchor,title,name); }
322  void startSimpleSect(SectionTypes t,const char *file,const char *anchor,
323  const char *title)
324  { forall(&OutputGenerator::startSimpleSect,t,file,anchor,title); }
327  void startParamList(ParamListTypes t,const char *title)
329  void endParamList()
331  void startIndent()
333  void endIndent()
335  void startSection(const char *lab,const char *title,SectionInfo::SectionType t)
336  { forall(&OutputGenerator::startSection,lab,title,t); }
337  void endSection(const char *lab,SectionInfo::SectionType t)
339  void addIndexItem(const char *s1,const char *s2)
345  void endClassDiagram(const ClassDiagram &d,const char *f,const char *n)
349  void endPageRef(const char *c,const char *a)
355  void writeSplitBar(const char *name)
357  void writeNavigationPath(const char *s)
359  void writeLogo()
361  void writeQuickLinks(bool compact,HighlightedItem hli,const char *file)
362  { forall(&OutputGenerator::writeQuickLinks,compact,hli,file); }
363  void writeSummaryLink(const char *file,const char *anchor,const char *title,bool first)
364  { forall(&OutputGenerator::writeSummaryLink,file,anchor,title,first); }
367  void endContents()
371  void startDescTable(const char *title)
389  void endDotGraph(const DotClassGraph &g)
397  void endCallGraph(const DotCallGraph &g)
401  void endDirDepGraph(const DotDirDeps &g)
409  void startTextBlock(bool dense=FALSE)
411  void endTextBlock(bool paraBreak=FALSE)
412  { forall(&OutputGenerator::endTextBlock,paraBreak); }
423  void startParameterType(bool first,const char *key)
427  void startParameterName(bool one)
429  void endParameterName(bool last,bool one,bool bracket)
430  { forall(&OutputGenerator::endParameterName,last,one,bracket); }
431  void startParameterList(bool openBracket)
435  void exceptionEntry(const char* prefix,bool closeBracket)
436  { forall(&OutputGenerator::exceptionEntry,prefix,closeBracket); }
437 
438  void startConstraintList(const char *header)
454 
455  void startMemberDocSimple(bool b)
457  void endMemberDocSimple(bool b)
471 
472  void startLabels()
474  void writeLabel(const char *l,bool isLast)
475  { forall(&OutputGenerator::writeLabel,l,isLast); }
476  void endLabels()
478 
479  void startFontClass(const char *c)
483  void writeCodeAnchor(const char *name)
485  void setCurrentDoc(Definition *context,const char *anchor,bool isSourceFile)
486  { forall(&OutputGenerator::setCurrentDoc,context,anchor,isSourceFile); }
487  void addWord(const char *word,bool hiPriority)
488  { forall(&OutputGenerator::addWord,word,hiPriority); }
489 
490  void startPlainFile(const char *name)
491  {
492  QListIterator<OutputGenerator> it(m_outputs);
493  OutputGenerator *og;
494  for (;(og=it.current());++it)
495  {
496  if (og->isEnabled()) (og->startPlainFile)(name);
497  }
498  }
500  {
501  QListIterator<OutputGenerator> it(m_outputs);
502  OutputGenerator *og;
503  for (;(og=it.current());++it)
504  {
505  if (og->isEnabled()) (og->endPlainFile)();
506  }
507  }
508 
509  private:
510  void debug();
511  void clear();
512 
513  void forall(void (OutputGenerator::*func)());
514  FORALLPROTO1(const char *);
515  FORALLPROTO1(char);
517  FORALLPROTO1(int);
518  FORALLPROTO1(const DotClassGraph &);
519  FORALLPROTO1(const DotInclDepGraph &);
520  FORALLPROTO1(const DotCallGraph &);
522  FORALLPROTO1(const DotDirDeps &);
525 #if defined(HAS_BOOL_TYPE) || defined(Q_HAS_BOOL_TYPE)
526  FORALLPROTO1(bool);
527  FORALLPROTO2(bool,int);
528  FORALLPROTO2(bool,bool);
529  FORALLPROTO2(const char *,bool);
530  FORALLPROTO4(const char *,const char *,const char *,int);
531 #endif
532  FORALLPROTO2(int,bool);
533  FORALLPROTO2(bool,const char *);
534  FORALLPROTO2(ParamListTypes,const char *);
535  FORALLPROTO2(const char *,const char *);
536  FORALLPROTO2(const char *,int);
538  FORALLPROTO3(bool,HighlightedItem,const char *);
539  FORALLPROTO3(bool,bool,bool);
540  FORALLPROTO3(const char *,const char *,bool);
541  FORALLPROTO3(const char *,int,const char *);
542  FORALLPROTO3(const char *,const char *,SectionInfo::SectionType);
543  FORALLPROTO3(uchar,uchar,uchar);
544  FORALLPROTO3(const char *,const char *,const char *);
545  FORALLPROTO3(const ClassDiagram &,const char *,const char *);
546  FORALLPROTO3(Definition*,const char *,bool);
547  FORALLPROTO4(SectionTypes,const char *,const char *,const char *);
548  FORALLPROTO4(const char *,const char *,const char *,const char *);
549  FORALLPROTO4(const char *,const char *,const char *,bool);
550  FORALLPROTO5(const char *,const char *,const char *,const char *,const char *);
551  FORALLPROTO5(const char *,const char *,const char *,const char *,bool);
552  FORALLPROTO6(const char *,const char *,const char *,const char *,const char *,const char *);
553  FORALLPROTO6(const char *,const DocLinkInfo &,const char *,const char *,const SourceLinkInfo &,const SourceLinkInfo &);
554  FORALLPROTO7(const char *,const char *,const char *,const char *,int,int,bool);
555 
556  OutputList(const OutputList &ol);
557  QList<OutputGenerator> m_outputs;
558 };
559 
560 #endif