diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2008-01-16 19:20:21 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2008-01-16 19:20:21 (GMT) |
commit | fc90c25edfba404f54319eaeeacca39246f95c9e (patch) | |
tree | 78bac4e928b25e139605aceefa82537f378d8af0 /src/index.h | |
parent | f57b7d974fec18d1d8f325c102efd8be5930131d (diff) | |
download | Doxygen-fc90c25edfba404f54319eaeeacca39246f95c9e.zip Doxygen-fc90c25edfba404f54319eaeeacca39246f95c9e.tar.gz Doxygen-fc90c25edfba404f54319eaeeacca39246f95c9e.tar.bz2 |
Release-1.5.4
Diffstat (limited to 'src/index.h')
-rw-r--r-- | src/index.h | 67 |
1 files changed, 66 insertions, 1 deletions
diff --git a/src/index.h b/src/index.h index ebe563e..88dc2e6 100644 --- a/src/index.h +++ b/src/index.h @@ -1,6 +1,6 @@ /****************************************************************************** * - * + * $Id$ * * Copyright (C) 1997-2007 by Dimitri van Heesch. * @@ -20,10 +20,75 @@ #include "qtbc.h" #include <qfile.h> +#include <qlist.h> class MemberDef; class OutputList; + +class IndexIntf +{ + public: + virtual ~IndexIntf() {} + virtual void initialize() = 0; + virtual void finalize() = 0; + virtual void incContentsDepth() = 0; + virtual void decContentsDepth() = 0; + virtual void addContentsItem(bool isDir, const char *name, const char *ref = 0, + const char *file = 0, const char *anchor = 0) = 0; + virtual void addIndexItem(const char *level1, const char *level2, const char *contRef, + const char *memRef, const char *anchor) = 0; + virtual void addIndexFile(const char *name) = 0; +}; + +class IndexList : public IndexIntf +{ + void foreach(void (IndexIntf::*methodPtr)()) + { + QListIterator<IndexIntf> li(m_intfs); + for (li.toFirst();li.current();++li) (li.current()->*methodPtr)(); + }; + template<typename A1> + void foreach(void (IndexIntf::*methodPtr)(A1),A1 a1) + { + QListIterator<IndexIntf> li(m_intfs); + for (li.toFirst();li.current();++li) (li.current()->*methodPtr)(a1); + }; + template<typename A1,typename A2,typename A3,typename A4,typename A5> + void foreach(void (IndexIntf::*methodPtr)(A1,A2,A3,A4,A5),A1 a1,A2 a2,A3 a3,A4 a4,A5 a5) + { + QListIterator<IndexIntf> li(m_intfs); + for (li.toFirst();li.current();++li) (li.current()->*methodPtr)(a1,a2,a3,a4,a5); + }; + + public: + IndexList() { m_intfs.setAutoDelete(TRUE); } + void addIndex(IndexIntf *intf) + { m_intfs.append(intf); } + void initialize() + { foreach(&IndexIntf::initialize); } + void finalize() + { foreach(&IndexIntf::finalize); } + void incContentsDepth() + { foreach(&IndexIntf::incContentsDepth); } + void decContentsDepth() + { foreach(&IndexIntf::decContentsDepth); } + void addContentsItem(bool isDir, const char *name, const char *ref = 0, + const char *file = 0, const char *anchor = 0) + { foreach<bool,const char *,const char *,const char *,const char*> + (&IndexIntf::addContentsItem,isDir,name,ref,file,anchor); } + void addIndexItem(const char *level1, const char *level2, const char *contRef, + const char *memRef, const char *anchor) + { foreach<const char *,const char *,const char *,const char *,const char *> + (&IndexIntf::addIndexItem,level1,level2,contRef,memRef,anchor); } + void addIndexFile(const char *name) + { foreach<const char *>(&IndexIntf::addIndexFile,name); } + + private: + QList<IndexIntf> m_intfs; +}; + + enum IndexSections { isTitlePageStart, |