Commit de20cde3 authored by dimitri's avatar dimitri

Release-1.2.15

parent 21587da4
DOXYGEN Version 1.2.14-20020324 DOXYGEN Version 1.2.15
Please read the installation section of the manual for instructions. Please read the installation section of the manual for instructions.
-------- --------
Dimitri van Heesch (24 March 2002) Dimitri van Heesch (01 April 2002)
DOXYGEN Version 1.2.14_20020324 DOXYGEN Version 1.2.15
Please read INSTALL for compilation instructions. Please read INSTALL for compilation instructions.
...@@ -17,4 +17,4 @@ to subscribe to the lists or to visit the archives. ...@@ -17,4 +17,4 @@ to subscribe to the lists or to visit the archives.
Enjoy, Enjoy,
Dimitri van Heesch (dimitri@stack.nl) (24 March 2002) Dimitri van Heesch (dimitri@stack.nl) (01 April 2002)
1.2.14-20020324 1.2.15
...@@ -7,13 +7,13 @@ class IMember; ...@@ -7,13 +7,13 @@ class IMember;
class IDocIterator; class IDocIterator;
class ICompound; class ICompound;
class ISection; class ISection;
class INode;
class ILinkedText class ILinkedText
{ {
public: public:
enum Kind { Kind_Text, Kind_Ref }; enum Kind { Kind_Text, Kind_Ref };
virtual Kind kind() const = 0; virtual Kind kind() const = 0;
virtual ~ILinkedText() {}
}; };
class ILT_Text : public ILinkedText class ILT_Text : public ILinkedText
...@@ -52,7 +52,6 @@ class IParam ...@@ -52,7 +52,6 @@ class IParam
virtual QString attrib() const = 0; virtual QString attrib() const = 0;
virtual QString arraySpecifier() const = 0; virtual QString arraySpecifier() const = 0;
virtual ILinkedTextIterator *defaultValue() const = 0; virtual ILinkedTextIterator *defaultValue() const = 0;
virtual ~IParam() {}
}; };
class IParamIterator class IParamIterator
...@@ -71,7 +70,6 @@ class IMemberReference ...@@ -71,7 +70,6 @@ class IMemberReference
public: public:
virtual IMember *member() const = 0; virtual IMember *member() const = 0;
virtual QString memberName() const = 0; virtual QString memberName() const = 0;
virtual ~IMemberReference() {}
}; };
class IMemberReferenceIterator class IMemberReferenceIterator
...@@ -90,7 +88,6 @@ class IEnumValue ...@@ -90,7 +88,6 @@ class IEnumValue
public: public:
virtual QString name() const = 0; virtual QString name() const = 0;
virtual QString initializer() const = 0; virtual QString initializer() const = 0;
virtual ~IEnumValue() {}
}; };
class IEnumValueIterator class IEnumValueIterator
...@@ -142,7 +139,6 @@ class IDoc ...@@ -142,7 +139,6 @@ class IDoc
Root // 30 -> IDocRoot Root // 30 -> IDocRoot
}; };
virtual Kind kind() const = 0; virtual Kind kind() const = 0;
virtual ~IDoc() {}
}; };
class IDocMarkup : public IDoc class IDocMarkup : public IDoc
...@@ -232,7 +228,8 @@ class IDocSimpleSect : public IDoc ...@@ -232,7 +228,8 @@ class IDocSimpleSect : public IDoc
Todo, Test, RCS, EnumValues, Todo, Test, RCS, EnumValues,
Examples Examples
}; };
virtual Types sectionType() const = 0; virtual Types type() const = 0;
virtual QString typeString() const = 0;
virtual IDocTitle *title() const = 0; virtual IDocTitle *title() const = 0;
virtual IDocPara *description() const = 0; virtual IDocPara *description() const = 0;
}; };
...@@ -411,7 +408,7 @@ class IChildNode ...@@ -411,7 +408,7 @@ class IChildNode
enum NodeRelation { PublicInheritance, ProtectedInheritance, enum NodeRelation { PublicInheritance, ProtectedInheritance,
PrivateInheritance, Usage, TemplateInstance PrivateInheritance, Usage, TemplateInstance
}; };
virtual QString id() const = 0; virtual INode * node() const = 0;
virtual NodeRelation relation() const = 0; virtual NodeRelation relation() const = 0;
virtual QString relationString() const = 0; virtual QString relationString() const = 0;
virtual IEdgeLabelIterator *edgeLabels() const = 0; virtual IEdgeLabelIterator *edgeLabels() const = 0;
...@@ -452,7 +449,6 @@ class IGraph ...@@ -452,7 +449,6 @@ class IGraph
{ {
public: public:
virtual INodeIterator *nodes() const = 0; virtual INodeIterator *nodes() const = 0;
virtual ~IGraph() {}
}; };
class IMember class IMember
...@@ -488,7 +484,6 @@ class IMember ...@@ -488,7 +484,6 @@ class IMember
virtual IEnumValueIterator *enumValues() const = 0; virtual IEnumValueIterator *enumValues() const = 0;
virtual IDocRoot *briefDescription() const = 0; virtual IDocRoot *briefDescription() const = 0;
virtual IDocRoot *detailedDescription() const = 0; virtual IDocRoot *detailedDescription() const = 0;
virtual ~IMember() {}
}; };
class IMemberIterator class IMemberIterator
...@@ -524,7 +519,6 @@ class ISection ...@@ -524,7 +519,6 @@ class ISection
virtual bool isPublic() const = 0; virtual bool isPublic() const = 0;
virtual bool isPrivate() const = 0; virtual bool isPrivate() const = 0;
virtual bool isProtected() const = 0; virtual bool isProtected() const = 0;
virtual ~ISection() {}
}; };
class ISectionIterator class ISectionIterator
...@@ -541,19 +535,43 @@ class ISectionIterator ...@@ -541,19 +535,43 @@ class ISectionIterator
class ICompound class ICompound
{ {
public: public:
/*! Represents the kind of compounds recognised by doxygen. */
enum CompoundKind { Invalid=0, enum CompoundKind { Invalid=0,
Class, Struct, Union, Interface, Exception, Class, Struct, Union, Interface, Exception,
Namespace, File, Group, Page, Package Namespace, File, Group, Page
}; };
/*! Returns the name of this compound */
virtual QString name() const = 0; virtual QString name() const = 0;
/*! Returns the id of this compound. The id is a
* unique string representing a specific compound object.
*/
virtual QString id() const = 0; virtual QString id() const = 0;
/*! Returns the kind of compound. See #CompoundKind for possible
* values.
*/
virtual CompoundKind kind() const = 0; virtual CompoundKind kind() const = 0;
/*! Returns a string representation of the compound kind.
* @see kind()
*/
virtual QString kindString() const = 0; virtual QString kindString() const = 0;
/*! Returns an iterator for the different member sections in this
* compound.
*/
virtual ISectionIterator *sections() const = 0; virtual ISectionIterator *sections() const = 0;
/*! Returns a tree-structured representation of the brief
* description that is attached to this compound.
*/
virtual IDocRoot *briefDescription() const = 0; virtual IDocRoot *briefDescription() const = 0;
/*! Returns a tree-structured representation of the detailed
* description that is attached to this compound.
*/
virtual IDocRoot *detailedDescription() const = 0; virtual IDocRoot *detailedDescription() const = 0;
virtual IGraph *inheritanceGraph() const = 0;
virtual IGraph *collaborationGraph() const = 0;
/*! Returns an interface to a member given its id. /*! Returns an interface to a member given its id.
* @param id The member id. * @param id The member id.
...@@ -561,7 +579,8 @@ class ICompound ...@@ -561,7 +579,8 @@ class ICompound
virtual IMember *memberById(const QString &id) const = 0; virtual IMember *memberById(const QString &id) const = 0;
/*! Returns a list of all members within the compound having a certain /*! Returns a list of all members within the compound having a certain
* name. Overloading is the reason why there can be more than one member. * name. Member overloading is the reason why there can be more than
* one member.
* @param name The name of the member. * @param name The name of the member.
*/ */
virtual IMemberIterator *memberByName(const QString &name) const = 0; virtual IMemberIterator *memberByName(const QString &name) const = 0;
...@@ -570,44 +589,105 @@ class ICompound ...@@ -570,44 +589,105 @@ class ICompound
* zero, the memory for the compound will be released. * zero, the memory for the compound will be released.
*/ */
virtual void release() = 0; virtual void release() = 0;
};
class ICompoundIterator
{
public:
virtual void toFirst() = 0;
virtual void toLast() = 0;
virtual void toNext() = 0;
virtual void toPrev() = 0;
virtual ICompound *current() const = 0;
virtual void release() = 0;
};
class IRelatedCompound
{
public:
enum Protection { Public, Protected, Private };
enum Kind { Normal, Virtual };
virtual ICompound *compound() const = 0;
virtual Protection protection() const = 0;
virtual Kind kind() const = 0;
};
class IRelatedCompoundIterator
{
public:
virtual IRelatedCompound *toFirst() = 0;
virtual IRelatedCompound *toLast() = 0;
virtual IRelatedCompound *toNext() = 0;
virtual IRelatedCompound *toPrev() = 0;
virtual IRelatedCompound *current() const = 0;
virtual void release() = 0;
};
class IClass : public ICompound
{
public:
virtual IGraph *inheritanceGraph() const = 0;
virtual IGraph *collaborationGraph() const = 0;
virtual IRelatedCompoundIterator *baseClasses() const = 0;
virtual IRelatedCompoundIterator *derivedClasses() const = 0;
virtual ICompoundIterator *nestedClasses() const = 0;
// TODO: // TODO:
// class: // class:
// IRelatedCompoundIterator *baseClasses()
// IRelatedCompoundIterator *derivedClasses()
// ICompoundIterator *innerClasses()
// ITemplateParamListIterator *templateParamLists() // ITemplateParamListIterator *templateParamLists()
// listOfAllMembers() // listOfAllMembers()
// IDotGraph *inheritanceGraph()
// IDotGraph *collaborationGraph()
// locationFile() // locationFile()
// locationLine() // locationLine()
// locationBodyStartLine() // locationBodyStartLine()
// locationBodyEndLine() // locationBodyEndLine()
};
class IStruct : public ICompound
{
};
class IUnion : public ICompound
{
};
class IInterface : public ICompound
{
};
class IException : public ICompound
{
};
class INamespace : public ICompound
{
// namespace: // namespace:
// ICompound *innerNamespaces() // ICompound *innerNamespaces()
// ICompoundIterator *innerClasses()
};
class IFile : public ICompound
{
// file: // file:
// includes() // includes()
// includedBy() // includedBy()
// IDotGraph *includeDependencyGraph() // IDotGraph *includeDependencyGraph()
// IDotGraph *includedByDependencyGraph() // IDotGraph *includedByDependencyGraph()
// IDocProgramListing *source() // IDocProgramListing *source()
// ICompound *innerNamespaces()
// ICompoundIterator *innerClasses()
};
class IGroup : public ICompound
{
// group: // group:
// Title() // Title()
// innerFile() // innerFile()
// innerPage() // innerPage()
// page:
}; };
class ICompoundIterator class IPage : public ICompound
{ {
public:
virtual void toFirst() = 0;
virtual void toLast() = 0;
virtual void toNext() = 0;
virtual void toPrev() = 0;
virtual ICompound *current() const = 0;
virtual void release() = 0;
}; };
/*! Root node of the object model. */ /*! Root node of the object model. */
......
...@@ -75,8 +75,8 @@ template<class T> class ElementMapper ...@@ -75,8 +75,8 @@ template<class T> class ElementMapper
Handler m_handler; Handler m_handler;
}; };
typedef StartElementHandler<T> StartElementHandlerT; typedef StartElementHandler StartElementHandlerT;
typedef EndElementHandler<T> EndElementHandlerT; typedef EndElementHandler EndElementHandlerT;
public: public:
ElementMapper() : m_startHandlers(67), m_endHandlers(67) ElementMapper() : m_startHandlers(67), m_endHandlers(67)
......
...@@ -32,4 +32,19 @@ template<class Intf,class ElemIntf,class ElemImpl> class BaseIterator : ...@@ -32,4 +32,19 @@ template<class Intf,class ElemIntf,class ElemImpl> class BaseIterator :
virtual void release() { delete this; } virtual void release() { delete this; }
}; };
template<class Intf,class ElemIntf,class ElemImpl,class Intermediate>
class BaseIteratorVia :
public Intf, public QListIterator<ElemImpl>
{
public:
BaseIteratorVia(const QList<ElemImpl> &list) : QListIterator<ElemImpl>(list) {}
virtual ~BaseIteratorVia() {}
virtual ElemIntf *toFirst() { return static_cast<Intermediate *>(QListIterator<ElemImpl>::toFirst()); }
virtual ElemIntf *toLast() { return static_cast<Intermediate *>(QListIterator<ElemImpl>::toLast()); }
virtual ElemIntf *toNext() { return static_cast<Intermediate *>(QListIterator<ElemImpl>::operator++()); }
virtual ElemIntf *toPrev() { return static_cast<Intermediate *>(QListIterator<ElemImpl>::operator--()); }
virtual ElemIntf *current() const { return static_cast<Intermediate *>(QListIterator<ElemImpl>::current()); }
virtual void release() { delete this; }
};
#endif #endif
...@@ -20,6 +20,53 @@ ...@@ -20,6 +20,53 @@
#include "graphhandler.h" #include "graphhandler.h"
#include "sectionhandler.h" #include "sectionhandler.h"
//----------------------------------------------------------------------------
class CompoundIdIterator : public ICompoundIterator,
public QListIterator<QString>
{
public:
CompoundIdIterator(const MainHandler *m,const QList<QString> &list) :
QListIterator<QString>(list), m_mainHandler(m) {}
virtual ~CompoundIdIterator() {}
virtual void toFirst()
{
QListIterator<QString>::toFirst();
}
virtual void toLast()
{
QListIterator<QString>::toLast();
}
virtual void toNext()
{
QListIterator<QString>::operator++();
}
virtual void toPrev()
{
QListIterator<QString>::operator--();
}
virtual ICompound *current() const
{
QString *id = QListIterator<QString>::current();
return id ? m_mainHandler->compoundById(*id) : 0;
}
virtual void release()
{ delete this; }
private:
const MainHandler *m_mainHandler;
};
//----------------------------------------------------------------------------
ICompound *RelatedCompound::compound() const
{
return m_parent->m_mainHandler->compoundById(m_id);
}
//----------------------------------------------------------------------------
class CompoundErrorHandler : public QXmlErrorHandler class CompoundErrorHandler : public QXmlErrorHandler
{ {
public: public:
...@@ -62,7 +109,6 @@ class CompoundTypeMap ...@@ -62,7 +109,6 @@ class CompoundTypeMap
m_map.insert("file",new int(ICompound::File)); m_map.insert("file",new int(ICompound::File));
m_map.insert("group",new int(ICompound::Group)); m_map.insert("group",new int(ICompound::Group));
m_map.insert("page",new int(ICompound::Page)); m_map.insert("page",new int(ICompound::Page));
m_map.insert("package",new int(ICompound::Package));
} }
virtual ~CompoundTypeMap() virtual ~CompoundTypeMap()
{ {
...@@ -104,6 +150,7 @@ CompoundHandler::CompoundHandler(const QString &xmlDir) ...@@ -104,6 +150,7 @@ CompoundHandler::CompoundHandler(const QString &xmlDir)
m_subClasses.setAutoDelete(TRUE); m_subClasses.setAutoDelete(TRUE);
m_sections.setAutoDelete(TRUE); m_sections.setAutoDelete(TRUE);
m_memberNameDict.setAutoDelete(TRUE); m_memberNameDict.setAutoDelete(TRUE);
m_innerClasses.setAutoDelete(TRUE);
addStartHandler("doxygen"); addStartHandler("doxygen");
addEndHandler("doxygen"); addEndHandler("doxygen");
...@@ -135,6 +182,9 @@ CompoundHandler::CompoundHandler(const QString &xmlDir) ...@@ -135,6 +182,9 @@ CompoundHandler::CompoundHandler(const QString &xmlDir)
addStartHandler("collaborationgraph",this,&CompoundHandler::startCollaborationGraph); addStartHandler("collaborationgraph",this,&CompoundHandler::startCollaborationGraph);
addStartHandler("innerclass",this,&CompoundHandler::startInnerClass);
addEndHandler("innerclass");
} }
CompoundHandler::~CompoundHandler() CompoundHandler::~CompoundHandler()
...@@ -143,6 +193,8 @@ CompoundHandler::~CompoundHandler() ...@@ -143,6 +193,8 @@ CompoundHandler::~CompoundHandler()
delete m_brief; delete m_brief;
delete m_detailed; delete m_detailed;
delete m_programListing; delete m_programListing;
delete m_inheritanceGraph;
delete m_collaborationGraph;
} }
void CompoundHandler::startSection(const QXmlAttributes& attrib) void CompoundHandler::startSection(const QXmlAttributes& attrib)
...@@ -198,31 +250,56 @@ void CompoundHandler::endCompoundName() ...@@ -198,31 +250,56 @@ void CompoundHandler::endCompoundName()
debug(2,"Compound name `%s'\n",m_name.data()); debug(2,"Compound name `%s'\n",m_name.data());
} }
void CompoundHandler::startInnerClass(const QXmlAttributes& attrib)
{
m_innerClasses.append(new QString(attrib.value("refid")));
}
void CompoundHandler::addSuperClass(const QXmlAttributes& attrib) void CompoundHandler::addSuperClass(const QXmlAttributes& attrib)
{ {
RelatedClass *sc=new RelatedClass( IRelatedCompound::Protection prot = IRelatedCompound::Public;
QString protString = attrib.value("prot");
if (protString=="protected") prot = IRelatedCompound::Protected;
else if (protString=="private") prot = IRelatedCompound::Private;
IRelatedCompound::Kind kind = IRelatedCompound::Normal;
QString kindString = attrib.value("virt");
if (kindString=="virtual") kind = IRelatedCompound::Virtual;
RelatedCompound *sc=new RelatedCompound(
this,
attrib.value("refid"), attrib.value("refid"),
attrib.value("prot"), prot,
attrib.value("virt") kind
); );
debug(2,"super class id=`%s' prot=`%s' virt=`%s'\n", debug(2,"super class id=`%s' prot=`%s' virt=`%s'\n",
sc->m_id.data(), attrib.value("refid").data(),
sc->m_protection.data(), protString.data(),
sc->m_virtualness.data()); kindString.data());
m_superClasses.append(sc); m_superClasses.append(sc);
} }
void CompoundHandler::addSubClass(const QXmlAttributes& attrib) void CompoundHandler::addSubClass(const QXmlAttributes& attrib)
{ {
RelatedClass *sc = new RelatedClass( IRelatedCompound::Protection prot = IRelatedCompound::Public;
QString protString = attrib.value("prot");
if (protString=="protected") prot = IRelatedCompound::Protected;
else if (protString=="private") prot = IRelatedCompound::Private;
IRelatedCompound::Kind kind = IRelatedCompound::Normal;
QString kindString = attrib.value("virt");
if (kindString=="virtual") kind = IRelatedCompound::Virtual;
RelatedCompound *sc = new RelatedCompound(
this,
attrib.value("refid"), attrib.value("refid"),
attrib.value("prot"), prot,
attrib.value("virt") kind
); );
debug(2,"sub class id=`%s' prot=`%s' virt=`%s'\n", debug(2,"sub class id=`%s' prot=`%s' virt=`%s'\n",
sc->m_id.data(), attrib.value("refid").data(),
sc->m_protection.data(), protString.data(),
sc->m_virtualness.data()); kindString.data());
m_subClasses.append(sc); m_subClasses.append(sc);
} }
...@@ -242,9 +319,9 @@ bool CompoundHandler::parseXML(const QString &compId) ...@@ -242,9 +319,9 @@ bool CompoundHandler::parseXML(const QString &compId)
void CompoundHandler::initialize(MainHandler *mh) void CompoundHandler::initialize(MainHandler *mh)
{ {
m_mainHandler = mh; m_mainHandler = mh;
QListIterator<ISection> msi(m_sections); QListIterator<SectionHandler> msi(m_sections);
SectionHandler *sec; SectionHandler *sec;
for (;(sec=(SectionHandler *)msi.current());++msi) for (;(sec=msi.current());++msi)
{ {
sec->initialize(this); sec->initialize(this);
} }
...@@ -262,6 +339,24 @@ void CompoundHandler::insertMember(MemberHandler *mh) ...@@ -262,6 +339,24 @@ void CompoundHandler::insertMember(MemberHandler *mh)
mhl->append(mh); mhl->append(mh);
} }
ICompound *CompoundHandler::toICompound() const
{
switch (m_kind)
{
case IClass::Class: return (IClass *)this;
case IStruct::Struct: return (IStruct *)this;
case IUnion::Union: return (IUnion *)this;
case IException::Exception: return (IException *)this;
case IInterface::Interface: return (IInterface *)this;
case INamespace::Namespace: return (INamespace *)this;
case IFile::File: return (IFile *)this;
case IGroup::Group: return (IGroup *)this;
case IPage::Page: return (IPage *)this;
default: return 0;
}
return 0;
}
void CompoundHandler::release() void CompoundHandler::release()
{ {
debug(2,"CompoundHandler::release() %d->%d\n",m_refCount,m_refCount-1); debug(2,"CompoundHandler::release() %d->%d\n",m_refCount,m_refCount-1);
...@@ -321,3 +416,18 @@ IGraph *CompoundHandler::collaborationGraph() const ...@@ -321,3 +416,18 @@ IGraph *CompoundHandler::collaborationGraph() const
return m_collaborationGraph; return m_collaborationGraph;
} }
IRelatedCompoundIterator *CompoundHandler::baseClasses() const
{
return new RelatedCompoundIterator(m_superClasses);
}
IRelatedCompoundIterator *CompoundHandler::derivedClasses() const
{
return new RelatedCompoundIterator(m_subClasses);
}
ICompoundIterator *CompoundHandler::nestedClasses() const
{
return new CompoundIdIterator(m_mainHandler,m_innerClasses);
}
...@@ -28,9 +28,52 @@ class DocHandler; ...@@ -28,9 +28,52 @@ class DocHandler;
class ProgramListingHandler; class ProgramListingHandler;
class GraphHandler; class GraphHandler;
class MemberHandler; class MemberHandler;
class CompoundHandler;
class SectionHandler;
class CompoundHandler : public ICompound, public BaseHandler<CompoundHandler>
class RelatedCompound : public IRelatedCompound
{ {
public:
RelatedCompound(CompoundHandler *parent,
const QString &id,
Protection prot,
Kind kind
) :
m_parent(parent), m_id(id), m_protection(prot), m_kind(kind) {}
virtual ~RelatedCompound() {}
virtual ICompound *compound() const;
virtual Protection protection() const { return m_protection; }
virtual Kind kind() const { return m_kind; }
private:
CompoundHandler *m_parent;
QString m_id;
Protection m_protection;
Kind m_kind;
};
class RelatedCompoundIterator : public BaseIterator<IRelatedCompoundIterator,IRelatedCompound,RelatedCompound>
{
public:
RelatedCompoundIterator(const QList<RelatedCompound> &list) :
BaseIterator<IRelatedCompoundIterator,IRelatedCompound,RelatedCompound>(list) {}
};
class CompoundHandler : public IClass,
public IStruct,
public IUnion,
public IException,
public IInterface,
public INamespace,
public IFile,
public IGroup,
public IPage,
public BaseHandler<CompoundHandler>
{
friend class RelatedCompound;
public: public:
virtual void startSection(const QXmlAttributes& attrib); virtual void startSection(const QXmlAttributes& attrib);
virtual void startCompound(const QXmlAttributes& attrib); virtual void startCompound(const QXmlAttributes& attrib);
...@@ -44,6 +87,7 @@ class CompoundHandler : public ICompound, public BaseHandler<CompoundHandler> ...@@ -44,6 +87,7 @@ class CompoundHandler : public ICompound, public BaseHandler<CompoundHandler>
virtual void startProgramListing(const QXmlAttributes& attrib); virtual void startProgramListing(const QXmlAttributes& attrib);
virtual void startInheritanceGraph(const QXmlAttributes& attrib); virtual void startInheritanceGraph(const QXmlAttributes& attrib);
virtual void startCollaborationGraph(const QXmlAttributes& attrib); virtual void startCollaborationGraph(const QXmlAttributes& attrib);
virtual void startInnerClass(const QXmlAttributes& attrib);
virtual void addref() { m_refCount++; } virtual void addref() { m_refCount++; }
CompoundHandler(const QString &dirName); CompoundHandler(const QString &dirName);
...@@ -51,6 +95,7 @@ class CompoundHandler : public ICompound, public BaseHandler<CompoundHandler> ...@@ -51,6 +95,7 @@ class CompoundHandler : public ICompound, public BaseHandler<CompoundHandler>
bool parseXML(const QString &compId); bool parseXML(const QString &compId);
void initialize(MainHandler *mh); void initialize(MainHandler *mh);
void insertMember(MemberHandler *mh); void insertMember(MemberHandler *mh);
ICompound *toICompound() const;
// ICompound implementation // ICompound implementation
QString name() const { return m_name; } QString name() const { return m_name; }
...@@ -60,25 +105,21 @@ class CompoundHandler : public ICompound, public BaseHandler<CompoundHandler> ...@@ -60,25 +105,21 @@ class CompoundHandler : public ICompound, public BaseHandler<CompoundHandler>
ISectionIterator *sections() const; ISectionIterator *sections() const;
IDocRoot *briefDescription() const; IDocRoot *briefDescription() const;
IDocRoot *detailedDescription() const; IDocRoot *detailedDescription() const;
IGraph *inheritanceGraph() const;
IGraph *collaborationGraph() const;
IMember *memberById(const QString &id) const; IMember *memberById(const QString &id) const;
IMemberIterator *memberByName(const QString &name) const; IMemberIterator *memberByName(const QString &name) const;
void release(); void release();
private: // IClass implementation
struct RelatedClass IGraph *inheritanceGraph() const;
{ IGraph *collaborationGraph() const;
RelatedClass(const QString &id,const QString &prot,const QString &virt) : IRelatedCompoundIterator *baseClasses() const;
m_id(id),m_protection(prot),m_virtualness(virt) {} IRelatedCompoundIterator *derivedClasses() const;
ICompoundIterator *nestedClasses() const;
QString m_id; private:
QString m_protection; QList<RelatedCompound> m_superClasses;
QString m_virtualness; QList<RelatedCompound> m_subClasses;
}; QList<SectionHandler> m_sections;
QList<RelatedClass> m_superClasses;
QList<RelatedClass> m_subClasses;
QList<ISection> m_sections;
DocHandler *m_brief; DocHandler *m_brief;
DocHandler *m_detailed; DocHandler *m_detailed;
ProgramListingHandler *m_programListing; ProgramListingHandler *m_programListing;
...@@ -95,6 +136,7 @@ class CompoundHandler : public ICompound, public BaseHandler<CompoundHandler> ...@@ -95,6 +136,7 @@ class CompoundHandler : public ICompound, public BaseHandler<CompoundHandler>
MainHandler *m_mainHandler; MainHandler *m_mainHandler;
GraphHandler *m_inheritanceGraph; GraphHandler *m_inheritanceGraph;
GraphHandler *m_collaborationGraph; GraphHandler *m_collaborationGraph;
QList<QString> m_innerClasses;
}; };
......
...@@ -94,7 +94,7 @@ void dochandler_exit() ...@@ -94,7 +94,7 @@ void dochandler_exit()
// MarkupHandler // MarkupHandler
//---------------------------------------------------------------------- //----------------------------------------------------------------------
MarkupHandler::MarkupHandler(QList<IDoc> &children,QString &curString) MarkupHandler::MarkupHandler(QList<DocImpl> &children,QString &curString)
: m_children(children), m_curString(curString), m_curMarkup(IDocMarkup::Normal) : m_children(children), m_curString(curString), m_curMarkup(IDocMarkup::Normal)
{ {
addStartHandler("bold",this,&MarkupHandler::startBold); addStartHandler("bold",this,&MarkupHandler::startBold);
...@@ -700,8 +700,9 @@ SimpleSectHandler::~SimpleSectHandler() ...@@ -700,8 +700,9 @@ SimpleSectHandler::~SimpleSectHandler()
void SimpleSectHandler::startSimpleSect(const QXmlAttributes& attrib) void SimpleSectHandler::startSimpleSect(const QXmlAttributes& attrib)
{ {
m_type = s_typeMapper->stringToType(attrib.value("kind")); m_typeString = attrib.value("kind");
debug(2,"start simple section %s\n",attrib.value("kind").data()); m_type = s_typeMapper->stringToType(m_typeString);
debug(2,"start simple section %s\n",m_typeString.data());
m_parent->setDelegate(this); m_parent->setDelegate(this);
} }
...@@ -846,7 +847,7 @@ HighlightHandler::HighlightHandler(IBaseHandler *parent) ...@@ -846,7 +847,7 @@ HighlightHandler::HighlightHandler(IBaseHandler *parent)
m_children.setAutoDelete(TRUE); m_children.setAutoDelete(TRUE);
addEndHandler("highlight",this,&HighlightHandler::endHighlight); addEndHandler("highlight",this,&HighlightHandler::endHighlight);
addStartHandler("ref",this,&HighlightHandler::startRef); addStartHandler("ref",this,&HighlightHandler::startRef);
m_hl = Invalid; m_hl = IDocHighlight::Invalid;
} }
HighlightHandler::~HighlightHandler() HighlightHandler::~HighlightHandler()
......
...@@ -28,11 +28,50 @@ class ParagraphHandler; ...@@ -28,11 +28,50 @@ class ParagraphHandler;
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
class DocImpl : public IDoc { public: virtual ~DocImpl() {} };
#define DEFINE_CLS_IMPL(cls) \
class cls##Impl : public I##cls, public DocImpl { public: virtual ~cls##Impl() {} }
DEFINE_CLS_IMPL(DocMarkup);
DEFINE_CLS_IMPL(DocPara);
DEFINE_CLS_IMPL(DocText);
DEFINE_CLS_IMPL(DocMarkupModifier);
DEFINE_CLS_IMPL(DocItemizedList);
DEFINE_CLS_IMPL(DocOrderedList);
DEFINE_CLS_IMPL(DocListItem);
DEFINE_CLS_IMPL(DocParameterList);
DEFINE_CLS_IMPL(DocParameter);
DEFINE_CLS_IMPL(DocTitle);
DEFINE_CLS_IMPL(DocSimpleSect);
DEFINE_CLS_IMPL(DocRef);
DEFINE_CLS_IMPL(DocVariableList);
DEFINE_CLS_IMPL(DocVariableListEntry);
DEFINE_CLS_IMPL(DocHRuler);
DEFINE_CLS_IMPL(DocLineBreak);
DEFINE_CLS_IMPL(DocULink);
DEFINE_CLS_IMPL(DocEMail);
DEFINE_CLS_IMPL(DocLink);
DEFINE_CLS_IMPL(DocProgramListing);
DEFINE_CLS_IMPL(DocCodeLine);
DEFINE_CLS_IMPL(DocHighlight);
DEFINE_CLS_IMPL(DocFormula);
DEFINE_CLS_IMPL(DocImage);
DEFINE_CLS_IMPL(DocDotFile);
DEFINE_CLS_IMPL(DocIndexEntry);
DEFINE_CLS_IMPL(DocTable);
DEFINE_CLS_IMPL(DocRow);
DEFINE_CLS_IMPL(DocEntry);
DEFINE_CLS_IMPL(DocSection);
DEFINE_CLS_IMPL(DocRoot);
//-----------------------------------------------------------------------------
/*! \brief Node representing a piece of text. /*! \brief Node representing a piece of text.
* *
*/ */
class TextNode : public IDocText class TextNode : public DocTextImpl
{ {
public: public:
TextNode(const QString &t,int markup) TextNode(const QString &t,int markup)
...@@ -40,7 +79,7 @@ class TextNode : public IDocText ...@@ -40,7 +79,7 @@ class TextNode : public IDocText
virtual ~TextNode() {} virtual ~TextNode() {}
// IDocText // IDocText
virtual Kind kind() const { return Text; } virtual Kind kind() const { return DocImpl::Text; }
virtual QString text() const { return m_text; } virtual QString text() const { return m_text; }
virtual int markup() const { return m_markup; } virtual int markup() const { return m_markup; }
...@@ -54,7 +93,7 @@ class TextNode : public IDocText ...@@ -54,7 +93,7 @@ class TextNode : public IDocText
/*! \brief Node representing a change in the markup style. /*! \brief Node representing a change in the markup style.
* *
*/ */
class MarkupModifierNode : public IDocMarkupModifier class MarkupModifierNode : public DocMarkupModifierImpl
{ {
public: public:
MarkupModifierNode(int markup,bool enabled) MarkupModifierNode(int markup,bool enabled)
...@@ -62,7 +101,7 @@ class MarkupModifierNode : public IDocMarkupModifier ...@@ -62,7 +101,7 @@ class MarkupModifierNode : public IDocMarkupModifier
virtual ~MarkupModifierNode() {} virtual ~MarkupModifierNode() {}
// IDocMarkupModifier // IDocMarkupModifier
virtual Kind kind() const { return MarkupModifier; } virtual Kind kind() const { return DocImpl::MarkupModifier; }
virtual bool enabled() const { return m_enabled; } virtual bool enabled() const { return m_enabled; }
virtual int markup() const { return m_markup; } virtual int markup() const { return m_markup; }
...@@ -80,7 +119,7 @@ class MarkupModifierNode : public IDocMarkupModifier ...@@ -80,7 +119,7 @@ class MarkupModifierNode : public IDocMarkupModifier
class MarkupHandler : public BaseFallBackHandler<MarkupHandler> class MarkupHandler : public BaseFallBackHandler<MarkupHandler>
{ {
public: public:
MarkupHandler(QList<IDoc> &children,QString &curString); MarkupHandler(QList<DocImpl> &children,QString &curString);
virtual ~MarkupHandler(); virtual ~MarkupHandler();
int markup() const { return m_curMarkup; } int markup() const { return m_curMarkup; }
...@@ -103,7 +142,7 @@ class MarkupHandler : public BaseFallBackHandler<MarkupHandler> ...@@ -103,7 +142,7 @@ class MarkupHandler : public BaseFallBackHandler<MarkupHandler>
private: private:
void addTextNode(); void addTextNode();
QList<IDoc> &m_children; QList<DocImpl> &m_children;
QString &m_curString; QString &m_curString;
int m_curMarkup; int m_curMarkup;
}; };
...@@ -122,7 +161,7 @@ class MarkupHandler : public BaseFallBackHandler<MarkupHandler> ...@@ -122,7 +161,7 @@ class MarkupHandler : public BaseFallBackHandler<MarkupHandler>
// bold, computeroutput, emphasis, center, // bold, computeroutput, emphasis, center,
// small, subscript, superscript. // small, subscript, superscript.
// //
class ParagraphHandler : public IDocPara, class ParagraphHandler : public DocParaImpl,
public BaseHandler<ParagraphHandler> public BaseHandler<ParagraphHandler>
{ {
friend class ParagraphIterator; friend class ParagraphIterator;
...@@ -152,21 +191,21 @@ class ParagraphHandler : public IDocPara, ...@@ -152,21 +191,21 @@ class ParagraphHandler : public IDocPara,
virtual ~ParagraphHandler(); virtual ~ParagraphHandler();
// IDocPara // IDocPara
virtual Kind kind() const { return Para; } virtual Kind kind() const { return DocImpl::Para; }
virtual IDocIterator *contents() const; virtual IDocIterator *contents() const;
private: private:
void addTextNode(); void addTextNode();
IBaseHandler *m_parent; IBaseHandler *m_parent;
QList<IDoc> m_children; QList<DocImpl> m_children;
MarkupHandler *m_markupHandler; MarkupHandler *m_markupHandler;
}; };
class ParagraphIterator : public BaseIterator<IDocIterator,IDoc,IDoc> class ParagraphIterator : public BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>
{ {
public: public:
ParagraphIterator(const ParagraphHandler &handler) : ParagraphIterator(const ParagraphHandler &handler) :
BaseIterator<IDocIterator,IDoc,IDoc>(handler.m_children) {} BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>(handler.m_children) {}
}; };
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
...@@ -174,7 +213,7 @@ class ParagraphIterator : public BaseIterator<IDocIterator,IDoc,IDoc> ...@@ -174,7 +213,7 @@ class ParagraphIterator : public BaseIterator<IDocIterator,IDoc,IDoc>
/*! \brief Node representing a list item. /*! \brief Node representing a list item.
* *
*/ */
class ListItemHandler : public IDocListItem, public BaseHandler<ListItemHandler> class ListItemHandler : public DocListItemImpl, public BaseHandler<ListItemHandler>
{ {
friend class ListItemIterator; friend class ListItemIterator;
public: public:
...@@ -185,19 +224,19 @@ class ListItemHandler : public IDocListItem, public BaseHandler<ListItemHandler> ...@@ -185,19 +224,19 @@ class ListItemHandler : public IDocListItem, public BaseHandler<ListItemHandler>
virtual void startParagraph(const QXmlAttributes& attrib); virtual void startParagraph(const QXmlAttributes& attrib);
// IDocItem // IDocItem
virtual Kind kind() const { return ListItem; } virtual Kind kind() const { return DocImpl::ListItem; }
virtual IDocIterator *contents() const; virtual IDocIterator *contents() const;
private: private:
IBaseHandler *m_parent; IBaseHandler *m_parent;
QList<IDoc> m_children; QList<DocImpl> m_children;
}; };
class ListItemIterator : public BaseIterator<IDocIterator,IDoc,IDoc> class ListItemIterator : public BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>
{ {
public: public:
ListItemIterator(const ListItemHandler &handler) : ListItemIterator(const ListItemHandler &handler) :
BaseIterator<IDocIterator,IDoc,IDoc>(handler.m_children) {} BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>(handler.m_children) {}
}; };
...@@ -206,7 +245,7 @@ class ListItemIterator : public BaseIterator<IDocIterator,IDoc,IDoc> ...@@ -206,7 +245,7 @@ class ListItemIterator : public BaseIterator<IDocIterator,IDoc,IDoc>
/*! \brief Node representing list of items. /*! \brief Node representing list of items.
* *
*/ */
class OrderedListHandler : public IDocOrderedList, public BaseHandler<OrderedListHandler> class OrderedListHandler : public DocOrderedListImpl, public BaseHandler<OrderedListHandler>
{ {
friend class OrderedListIterator; friend class OrderedListIterator;
public: public:
...@@ -217,19 +256,19 @@ class OrderedListHandler : public IDocOrderedList, public BaseHandler<OrderedLis ...@@ -217,19 +256,19 @@ class OrderedListHandler : public IDocOrderedList, public BaseHandler<OrderedLis
virtual void startOrderedListItem(const QXmlAttributes& attrib); virtual void startOrderedListItem(const QXmlAttributes& attrib);
// IDocOrderedList // IDocOrderedList
virtual Kind kind() const { return OrderedList; } virtual Kind kind() const { return DocImpl::OrderedList; }
virtual IDocIterator *elements() const; virtual IDocIterator *elements() const;
private: private:
IBaseHandler *m_parent; IBaseHandler *m_parent;
QList<IDoc> m_children; QList<DocImpl> m_children;
}; };
class OrderedListIterator : public BaseIterator<IDocIterator,IDoc,IDoc> class OrderedListIterator : public BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>
{ {
public: public:
OrderedListIterator(const OrderedListHandler &handler) : OrderedListIterator(const OrderedListHandler &handler) :
BaseIterator<IDocIterator,IDoc,IDoc>(handler.m_children) {} BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>(handler.m_children) {}
}; };
...@@ -238,7 +277,7 @@ class OrderedListIterator : public BaseIterator<IDocIterator,IDoc,IDoc> ...@@ -238,7 +277,7 @@ class OrderedListIterator : public BaseIterator<IDocIterator,IDoc,IDoc>
/*! \brief Node representing list of items. /*! \brief Node representing list of items.
* *
*/ */
class ItemizedListHandler : public IDocItemizedList, public BaseHandler<ItemizedListHandler> class ItemizedListHandler : public DocItemizedListImpl, public BaseHandler<ItemizedListHandler>
{ {
friend class ItemizedListIterator; friend class ItemizedListIterator;
public: public:
...@@ -249,19 +288,19 @@ class ItemizedListHandler : public IDocItemizedList, public BaseHandler<Itemized ...@@ -249,19 +288,19 @@ class ItemizedListHandler : public IDocItemizedList, public BaseHandler<Itemized
virtual void startItemizedListItem(const QXmlAttributes& attrib); virtual void startItemizedListItem(const QXmlAttributes& attrib);
// IDocItemizedList // IDocItemizedList
virtual Kind kind() const { return ItemizedList; } virtual Kind kind() const { return DocImpl::ItemizedList; }
virtual IDocIterator *elements() const; virtual IDocIterator *elements() const;
private: private:
IBaseHandler *m_parent; IBaseHandler *m_parent;
QList<IDoc> m_children; QList<DocImpl> m_children;
}; };
class ItemizedListIterator : public BaseIterator<IDocIterator,IDoc,IDoc> class ItemizedListIterator : public BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>
{ {
public: public:
ItemizedListIterator(const ItemizedListHandler &handler) : ItemizedListIterator(const ItemizedListHandler &handler) :
BaseIterator<IDocIterator,IDoc,IDoc>(handler.m_children) {} BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>(handler.m_children) {}
}; };
...@@ -269,7 +308,7 @@ class ItemizedListIterator : public BaseIterator<IDocIterator,IDoc,IDoc> ...@@ -269,7 +308,7 @@ class ItemizedListIterator : public BaseIterator<IDocIterator,IDoc,IDoc>
/*! \brief Node representing a parameter. /*! \brief Node representing a parameter.
* *
*/ */
class ParameterHandler : public IDocParameter, class ParameterHandler : public DocParameterImpl,
public BaseHandler<ParameterHandler> public BaseHandler<ParameterHandler>
{ {
public: public:
...@@ -282,7 +321,7 @@ class ParameterHandler : public IDocParameter, ...@@ -282,7 +321,7 @@ class ParameterHandler : public IDocParameter,
virtual void startParagraph(const QXmlAttributes& attrib); virtual void startParagraph(const QXmlAttributes& attrib);
// IDocParameter // IDocParameter
virtual Kind kind() const { return Parameter; } virtual Kind kind() const { return DocImpl::Parameter; }
virtual QString name() const { return m_name; } virtual QString name() const { return m_name; }
virtual IDocPara *description() const { return m_description; } virtual IDocPara *description() const { return m_description; }
...@@ -297,7 +336,7 @@ class ParameterHandler : public IDocParameter, ...@@ -297,7 +336,7 @@ class ParameterHandler : public IDocParameter,
/* \brief Node representing a parameter list. /* \brief Node representing a parameter list.
* *
*/ */
class ParameterListHandler : public IDocParameterList, class ParameterListHandler : public DocParameterListImpl,
public BaseHandler<ParameterListHandler> public BaseHandler<ParameterListHandler>
{ {
friend class ParameterListIterator; friend class ParameterListIterator;
...@@ -310,7 +349,7 @@ class ParameterListHandler : public IDocParameterList, ...@@ -310,7 +349,7 @@ class ParameterListHandler : public IDocParameterList,
virtual void startParameterDescription(const QXmlAttributes& attrib); virtual void startParameterDescription(const QXmlAttributes& attrib);
// IDocParameterList // IDocParameterList
virtual Kind kind() const { return ParameterList; } virtual Kind kind() const { return DocImpl::ParameterList; }
virtual Types listType() const { return m_type; } virtual Types listType() const { return m_type; }
virtual IDocIterator *params() const; virtual IDocIterator *params() const;
...@@ -321,11 +360,11 @@ class ParameterListHandler : public IDocParameterList, ...@@ -321,11 +360,11 @@ class ParameterListHandler : public IDocParameterList,
Types m_type; Types m_type;
}; };
class ParameterListIterator : public BaseIterator<IDocIterator,IDoc,ParameterHandler> class ParameterListIterator : public BaseIteratorVia<IDocIterator,IDoc,ParameterHandler,DocImpl>
{ {
public: public:
ParameterListIterator(const ParameterListHandler &handler) : ParameterListIterator(const ParameterListHandler &handler) :
BaseIterator<IDocIterator,IDoc,ParameterHandler>(handler.m_parameters) {} BaseIteratorVia<IDocIterator,IDoc,ParameterHandler,DocImpl>(handler.m_parameters) {}
}; };
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
...@@ -333,7 +372,7 @@ class ParameterListIterator : public BaseIterator<IDocIterator,IDoc,ParameterHan ...@@ -333,7 +372,7 @@ class ParameterListIterator : public BaseIterator<IDocIterator,IDoc,ParameterHan
/* \brief Node representing a horizontal ruler /* \brief Node representing a horizontal ruler
* *
*/ */
class LineBreakHandler : public IDocLineBreak, public BaseHandler<LineBreakHandler> class LineBreakHandler : public DocLineBreakImpl, public BaseHandler<LineBreakHandler>
{ {
public: public:
LineBreakHandler(IBaseHandler *parent); LineBreakHandler(IBaseHandler *parent);
...@@ -343,7 +382,7 @@ class LineBreakHandler : public IDocLineBreak, public BaseHandler<LineBreakHandl ...@@ -343,7 +382,7 @@ class LineBreakHandler : public IDocLineBreak, public BaseHandler<LineBreakHandl
void endLineBreak(); void endLineBreak();
// IDocLineBreak // IDocLineBreak
virtual Kind kind() const { return LineBreak; } virtual Kind kind() const { return DocImpl::LineBreak; }
private: private:
IBaseHandler *m_parent; IBaseHandler *m_parent;
...@@ -354,7 +393,7 @@ class LineBreakHandler : public IDocLineBreak, public BaseHandler<LineBreakHandl ...@@ -354,7 +393,7 @@ class LineBreakHandler : public IDocLineBreak, public BaseHandler<LineBreakHandl
/* \brief Node representing a link to section /* \brief Node representing a link to section
* *
*/ */
class LinkHandler : public IDocLink, public BaseHandler<LinkHandler> class LinkHandler : public DocLinkImpl, public BaseHandler<LinkHandler>
{ {
public: public:
LinkHandler(IBaseHandler *parent); LinkHandler(IBaseHandler *parent);
...@@ -364,7 +403,7 @@ class LinkHandler : public IDocLink, public BaseHandler<LinkHandler> ...@@ -364,7 +403,7 @@ class LinkHandler : public IDocLink, public BaseHandler<LinkHandler>
void endLink(); void endLink();
// IDocLink // IDocLink
virtual Kind kind() const { return Link; } virtual Kind kind() const { return DocImpl::Link; }
virtual QString refId() const { return m_ref; } virtual QString refId() const { return m_ref; }
virtual QString text() const { return m_text; } virtual QString text() const { return m_text; }
...@@ -380,7 +419,7 @@ class LinkHandler : public IDocLink, public BaseHandler<LinkHandler> ...@@ -380,7 +419,7 @@ class LinkHandler : public IDocLink, public BaseHandler<LinkHandler>
/* \brief Node representing a link to an email address /* \brief Node representing a link to an email address
* *
*/ */
class EMailHandler : public IDocEMail, public BaseHandler<EMailHandler> class EMailHandler : public DocEMailImpl, public BaseHandler<EMailHandler>
{ {
public: public:
EMailHandler(IBaseHandler *parent); EMailHandler(IBaseHandler *parent);
...@@ -390,7 +429,7 @@ class EMailHandler : public IDocEMail, public BaseHandler<EMailHandler> ...@@ -390,7 +429,7 @@ class EMailHandler : public IDocEMail, public BaseHandler<EMailHandler>
void endEMail(); void endEMail();
// IDocEMail // IDocEMail
virtual Kind kind() const { return EMail; } virtual Kind kind() const { return DocImpl::EMail; }
virtual QString address() const { return m_address; } virtual QString address() const { return m_address; }
private: private:
...@@ -404,7 +443,7 @@ class EMailHandler : public IDocEMail, public BaseHandler<EMailHandler> ...@@ -404,7 +443,7 @@ class EMailHandler : public IDocEMail, public BaseHandler<EMailHandler>
/* \brief Node representing a link to an URL /* \brief Node representing a link to an URL
* *
*/ */
class ULinkHandler : public IDocULink, public BaseHandler<ULinkHandler> class ULinkHandler : public DocULinkImpl, public BaseHandler<ULinkHandler>
{ {
public: public:
ULinkHandler(IBaseHandler *parent); ULinkHandler(IBaseHandler *parent);
...@@ -414,7 +453,7 @@ class ULinkHandler : public IDocULink, public BaseHandler<ULinkHandler> ...@@ -414,7 +453,7 @@ class ULinkHandler : public IDocULink, public BaseHandler<ULinkHandler>
void endULink(); void endULink();
// IDocULink // IDocULink
virtual Kind kind() const { return ULink; } virtual Kind kind() const { return DocImpl::ULink; }
virtual QString url() const { return m_url; } virtual QString url() const { return m_url; }
virtual QString text() const { return m_text; } virtual QString text() const { return m_text; }
...@@ -429,7 +468,7 @@ class ULinkHandler : public IDocULink, public BaseHandler<ULinkHandler> ...@@ -429,7 +468,7 @@ class ULinkHandler : public IDocULink, public BaseHandler<ULinkHandler>
/* \brief Node representing a horizontal ruler /* \brief Node representing a horizontal ruler
* *
*/ */
class HRulerHandler : public IDocHRuler, public BaseHandler<HRulerHandler> class HRulerHandler : public DocHRulerImpl, public BaseHandler<HRulerHandler>
{ {
public: public:
HRulerHandler(IBaseHandler *parent); HRulerHandler(IBaseHandler *parent);
...@@ -439,7 +478,7 @@ class HRulerHandler : public IDocHRuler, public BaseHandler<HRulerHandler> ...@@ -439,7 +478,7 @@ class HRulerHandler : public IDocHRuler, public BaseHandler<HRulerHandler>
void endHRuler(); void endHRuler();
// IDocHRuler // IDocHRuler
virtual Kind kind() const { return HRuler; } virtual Kind kind() const { return DocImpl::HRuler; }
private: private:
IBaseHandler *m_parent; IBaseHandler *m_parent;
...@@ -450,7 +489,7 @@ class HRulerHandler : public IDocHRuler, public BaseHandler<HRulerHandler> ...@@ -450,7 +489,7 @@ class HRulerHandler : public IDocHRuler, public BaseHandler<HRulerHandler>
/* \brief Node representing a reference to another item /* \brief Node representing a reference to another item
* *
*/ */
class RefHandler : public IDocRef, public BaseHandler<RefHandler> class RefHandler : public DocRefImpl, public BaseHandler<RefHandler>
{ {
public: public:
RefHandler(IBaseHandler *parent); RefHandler(IBaseHandler *parent);
...@@ -459,7 +498,7 @@ class RefHandler : public IDocRef, public BaseHandler<RefHandler> ...@@ -459,7 +498,7 @@ class RefHandler : public IDocRef, public BaseHandler<RefHandler>
void endRef(); void endRef();
// IDocRef // IDocRef
virtual Kind kind() const { return Ref; } virtual Kind kind() const { return DocImpl::Ref; }
virtual QString refId() const { return m_refId; } virtual QString refId() const { return m_refId; }
virtual TargetKind targetKind() const { return m_targetKind; } virtual TargetKind targetKind() const { return m_targetKind; }
virtual QString external() const { return m_extId; } virtual QString external() const { return m_extId; }
...@@ -482,7 +521,7 @@ class RefHandler : public IDocRef, public BaseHandler<RefHandler> ...@@ -482,7 +521,7 @@ class RefHandler : public IDocRef, public BaseHandler<RefHandler>
// children handled by MarkupHandler: // children handled by MarkupHandler:
// bold, computeroutput, emphasis, center, // bold, computeroutput, emphasis, center,
// small, subscript, superscript. // small, subscript, superscript.
class TitleHandler : public IDocTitle, public BaseHandler<TitleHandler> class TitleHandler : public DocTitleImpl, public BaseHandler<TitleHandler>
{ {
friend class TitleIterator; friend class TitleIterator;
public: public:
...@@ -494,20 +533,20 @@ class TitleHandler : public IDocTitle, public BaseHandler<TitleHandler> ...@@ -494,20 +533,20 @@ class TitleHandler : public IDocTitle, public BaseHandler<TitleHandler>
void addTextNode(); void addTextNode();
// IDocTitle // IDocTitle
virtual Kind kind() const { return Title; } virtual Kind kind() const { return DocImpl::Title; }
virtual IDocIterator *title() const; virtual IDocIterator *title() const;
private: private:
IBaseHandler *m_parent; IBaseHandler *m_parent;
QList<IDoc> m_children; QList<DocImpl> m_children;
MarkupHandler *m_markupHandler; MarkupHandler *m_markupHandler;
}; };
class TitleIterator : public BaseIterator<IDocIterator,IDoc,IDoc> class TitleIterator : public BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>
{ {
public: public:
TitleIterator(const TitleHandler &handler) : TitleIterator(const TitleHandler &handler) :
BaseIterator<IDocIterator,IDoc,IDoc>(handler.m_children) {} BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>(handler.m_children) {}
}; };
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
...@@ -516,7 +555,7 @@ class TitleIterator : public BaseIterator<IDocIterator,IDoc,IDoc> ...@@ -516,7 +555,7 @@ class TitleIterator : public BaseIterator<IDocIterator,IDoc,IDoc>
* *
*/ */
// children: title, para // children: title, para
class SimpleSectHandler : public IDocSimpleSect, class SimpleSectHandler : public DocSimpleSectImpl,
public BaseHandler<SimpleSectHandler> public BaseHandler<SimpleSectHandler>
{ {
public: public:
...@@ -528,8 +567,9 @@ class SimpleSectHandler : public IDocSimpleSect, ...@@ -528,8 +567,9 @@ class SimpleSectHandler : public IDocSimpleSect,
virtual void startParagraph(const QXmlAttributes& attrib); virtual void startParagraph(const QXmlAttributes& attrib);
// IDocSimpleSect // IDocSimpleSect
virtual Kind kind() const { return SimpleSect; } virtual Kind kind() const { return DocImpl::SimpleSect; }
virtual Types sectionType() const { return m_type; } virtual Types type() const { return m_type; }
virtual QString typeString() const { return m_typeString; }
virtual IDocTitle *title() const { return m_title; } virtual IDocTitle *title() const { return m_title; }
virtual IDocPara *description() const { return m_paragraph; } virtual IDocPara *description() const { return m_paragraph; }
...@@ -537,6 +577,7 @@ class SimpleSectHandler : public IDocSimpleSect, ...@@ -537,6 +577,7 @@ class SimpleSectHandler : public IDocSimpleSect,
IBaseHandler *m_parent; IBaseHandler *m_parent;
ParagraphHandler *m_paragraph; ParagraphHandler *m_paragraph;
Types m_type; Types m_type;
QString m_typeString;
TitleHandler *m_title; TitleHandler *m_title;
}; };
...@@ -545,7 +586,7 @@ class SimpleSectHandler : public IDocSimpleSect, ...@@ -545,7 +586,7 @@ class SimpleSectHandler : public IDocSimpleSect,
/* \brief Node representing an named item of a VariableList. /* \brief Node representing an named item of a VariableList.
* *
*/ */
class VariableListEntryHandler : public IDocVariableListEntry, class VariableListEntryHandler : public DocVariableListEntryImpl,
public BaseHandler<VariableListEntryHandler> public BaseHandler<VariableListEntryHandler>
{ {
public: public:
...@@ -561,7 +602,7 @@ class VariableListEntryHandler : public IDocVariableListEntry, ...@@ -561,7 +602,7 @@ class VariableListEntryHandler : public IDocVariableListEntry,
virtual ~VariableListEntryHandler(); virtual ~VariableListEntryHandler();
// IDocVariableListEntry // IDocVariableListEntry
virtual Kind kind() const { return VariableListEntry; } virtual Kind kind() const { return DocImpl::VariableListEntry; }
virtual QString term() const { return m_term; } virtual QString term() const { return m_term; }
virtual IDocPara *description() const { return m_description; } virtual IDocPara *description() const { return m_description; }
...@@ -577,7 +618,7 @@ class VariableListEntryHandler : public IDocVariableListEntry, ...@@ -577,7 +618,7 @@ class VariableListEntryHandler : public IDocVariableListEntry,
* *
*/ */
// children: varlistentry, listitem // children: varlistentry, listitem
class VariableListHandler : public IDocVariableList, class VariableListHandler : public DocVariableListImpl,
public BaseHandler<VariableListHandler> public BaseHandler<VariableListHandler>
{ {
friend class VariableListIterator; friend class VariableListIterator;
...@@ -592,7 +633,7 @@ class VariableListHandler : public IDocVariableList, ...@@ -592,7 +633,7 @@ class VariableListHandler : public IDocVariableList,
virtual ~VariableListHandler(); virtual ~VariableListHandler();
// IDocVariableList // IDocVariableList
virtual Kind kind() const { return VariableList; } virtual Kind kind() const { return DocImpl::VariableList; }
virtual IDocIterator *entries() const; virtual IDocIterator *entries() const;
private: private:
...@@ -601,11 +642,11 @@ class VariableListHandler : public IDocVariableList, ...@@ -601,11 +642,11 @@ class VariableListHandler : public IDocVariableList,
VariableListEntryHandler *m_curEntry; VariableListEntryHandler *m_curEntry;
}; };
class VariableListIterator : public BaseIterator<IDocIterator,IDoc,VariableListEntryHandler> class VariableListIterator : public BaseIteratorVia<IDocIterator,IDoc,VariableListEntryHandler,DocImpl>
{ {
public: public:
VariableListIterator(const VariableListHandler &handler) : VariableListIterator(const VariableListHandler &handler) :
BaseIterator<IDocIterator,IDoc,VariableListEntryHandler>(handler.m_entries) {} BaseIteratorVia<IDocIterator,IDoc,VariableListEntryHandler,DocImpl>(handler.m_entries) {}
}; };
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
...@@ -614,7 +655,7 @@ class VariableListIterator : public BaseIterator<IDocIterator,IDoc,VariableListE ...@@ -614,7 +655,7 @@ class VariableListIterator : public BaseIterator<IDocIterator,IDoc,VariableListE
* *
*/ */
// children: ref // children: ref
class HighlightHandler : public IDocHighlight, public BaseHandler<HighlightHandler> class HighlightHandler : public DocHighlightImpl, public BaseHandler<HighlightHandler>
{ {
friend class HighlightIterator; friend class HighlightIterator;
public: public:
...@@ -625,7 +666,7 @@ class HighlightHandler : public IDocHighlight, public BaseHandler<HighlightHandl ...@@ -625,7 +666,7 @@ class HighlightHandler : public IDocHighlight, public BaseHandler<HighlightHandl
virtual void startRef(const QXmlAttributes&); virtual void startRef(const QXmlAttributes&);
// IDocHighlight // IDocHighlight
virtual Kind kind() const { return Highlight; } virtual Kind kind() const { return DocImpl::Highlight; }
virtual HighlightKind highlightKind() const { return m_hl; } virtual HighlightKind highlightKind() const { return m_hl; }
virtual IDocIterator *codeElements() const; virtual IDocIterator *codeElements() const;
...@@ -635,14 +676,14 @@ class HighlightHandler : public IDocHighlight, public BaseHandler<HighlightHandl ...@@ -635,14 +676,14 @@ class HighlightHandler : public IDocHighlight, public BaseHandler<HighlightHandl
IBaseHandler *m_parent; IBaseHandler *m_parent;
HighlightKind m_hl; HighlightKind m_hl;
QString m_hlString; QString m_hlString;
QList<IDoc> m_children; QList<DocImpl> m_children;
}; };
class HighlightIterator : public BaseIterator<IDocIterator,IDoc,IDoc> class HighlightIterator : public BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>
{ {
public: public:
HighlightIterator(const HighlightHandler &handler) : HighlightIterator(const HighlightHandler &handler) :
BaseIterator<IDocIterator,IDoc,IDoc>(handler.m_children) {} BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>(handler.m_children) {}
}; };
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
...@@ -651,7 +692,7 @@ class HighlightIterator : public BaseIterator<IDocIterator,IDoc,IDoc> ...@@ -651,7 +692,7 @@ class HighlightIterator : public BaseIterator<IDocIterator,IDoc,IDoc>
* *
*/ */
// children: linenumber, highlight, anchor, ref // children: linenumber, highlight, anchor, ref
class CodeLineHandler : public IDocCodeLine, public BaseHandler<CodeLineHandler> class CodeLineHandler : public DocCodeLineImpl, public BaseHandler<CodeLineHandler>
{ {
friend class CodeLineIterator; friend class CodeLineIterator;
public: public:
...@@ -667,7 +708,7 @@ class CodeLineHandler : public IDocCodeLine, public BaseHandler<CodeLineHandler> ...@@ -667,7 +708,7 @@ class CodeLineHandler : public IDocCodeLine, public BaseHandler<CodeLineHandler>
virtual ~CodeLineHandler(); virtual ~CodeLineHandler();
// IDocCodeLine // IDocCodeLine
virtual Kind kind() const { return CodeLine; } virtual Kind kind() const { return DocImpl::CodeLine; }
virtual int lineNumber() const { return m_lineNumber; } virtual int lineNumber() const { return m_lineNumber; }
virtual QString refId() const { return m_refId; } virtual QString refId() const { return m_refId; }
virtual IDocIterator *codeElements() const; virtual IDocIterator *codeElements() const;
...@@ -678,14 +719,14 @@ class CodeLineHandler : public IDocCodeLine, public BaseHandler<CodeLineHandler> ...@@ -678,14 +719,14 @@ class CodeLineHandler : public IDocCodeLine, public BaseHandler<CodeLineHandler>
IBaseHandler *m_parent; IBaseHandler *m_parent;
int m_lineNumber; int m_lineNumber;
QString m_refId; QString m_refId;
QList<IDoc> m_children; QList<DocImpl> m_children;
}; };
class CodeLineIterator : public BaseIterator<IDocIterator,IDoc,IDoc> class CodeLineIterator : public BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>
{ {
public: public:
CodeLineIterator(const CodeLineHandler &handler) : CodeLineIterator(const CodeLineHandler &handler) :
BaseIterator<IDocIterator,IDoc,IDoc>(handler.m_children) {} BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>(handler.m_children) {}
}; };
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
...@@ -694,7 +735,7 @@ class CodeLineIterator : public BaseIterator<IDocIterator,IDoc,IDoc> ...@@ -694,7 +735,7 @@ class CodeLineIterator : public BaseIterator<IDocIterator,IDoc,IDoc>
* *
*/ */
// children: codeline, linenumber // children: codeline, linenumber
class ProgramListingHandler : public IDocProgramListing, public BaseHandler<ProgramListingHandler> class ProgramListingHandler : public DocProgramListingImpl, public BaseHandler<ProgramListingHandler>
{ {
friend class ProgramListingIterator; friend class ProgramListingIterator;
public: public:
...@@ -707,7 +748,7 @@ class ProgramListingHandler : public IDocProgramListing, public BaseHandler<Prog ...@@ -707,7 +748,7 @@ class ProgramListingHandler : public IDocProgramListing, public BaseHandler<Prog
virtual ~ProgramListingHandler(); virtual ~ProgramListingHandler();
// IDocProgramListing // IDocProgramListing
virtual Kind kind() const { return ProgramListing; } virtual Kind kind() const { return DocImpl::ProgramListing; }
virtual IDocIterator *codeLines() const; virtual IDocIterator *codeLines() const;
private: private:
...@@ -718,11 +759,11 @@ class ProgramListingHandler : public IDocProgramListing, public BaseHandler<Prog ...@@ -718,11 +759,11 @@ class ProgramListingHandler : public IDocProgramListing, public BaseHandler<Prog
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
class ProgramListingIterator : public BaseIterator<IDocIterator,IDoc,CodeLineHandler> class ProgramListingIterator : public BaseIteratorVia<IDocIterator,IDoc,CodeLineHandler,DocImpl>
{ {
public: public:
ProgramListingIterator(const ProgramListingHandler &handler) : ProgramListingIterator(const ProgramListingHandler &handler) :
BaseIterator<IDocIterator,IDoc,CodeLineHandler>(handler.m_children) {} BaseIteratorVia<IDocIterator,IDoc,CodeLineHandler,DocImpl>(handler.m_children) {}
}; };
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
...@@ -731,7 +772,7 @@ class ProgramListingIterator : public BaseIterator<IDocIterator,IDoc,CodeLineHan ...@@ -731,7 +772,7 @@ class ProgramListingIterator : public BaseIterator<IDocIterator,IDoc,CodeLineHan
* *
*/ */
// children: - // children: -
class FormulaHandler : public IDocFormula, public BaseHandler<FormulaHandler> class FormulaHandler : public DocFormulaImpl, public BaseHandler<FormulaHandler>
{ {
public: public:
FormulaHandler(IBaseHandler *parent); FormulaHandler(IBaseHandler *parent);
...@@ -740,7 +781,7 @@ class FormulaHandler : public IDocFormula, public BaseHandler<FormulaHandler> ...@@ -740,7 +781,7 @@ class FormulaHandler : public IDocFormula, public BaseHandler<FormulaHandler>
void endFormula(); void endFormula();
// IDocFormula // IDocFormula
virtual Kind kind() const { return Formula; } virtual Kind kind() const { return DocImpl::Formula; }
virtual QString id() const { return m_id; } virtual QString id() const { return m_id; }
virtual QString text() const { return m_text; } virtual QString text() const { return m_text; }
...@@ -756,7 +797,7 @@ class FormulaHandler : public IDocFormula, public BaseHandler<FormulaHandler> ...@@ -756,7 +797,7 @@ class FormulaHandler : public IDocFormula, public BaseHandler<FormulaHandler>
* *
*/ */
// children: - // children: -
class ImageHandler : public IDocImage, public BaseHandler<ImageHandler> class ImageHandler : public DocImageImpl, public BaseHandler<ImageHandler>
{ {
public: public:
ImageHandler(IBaseHandler *parent); ImageHandler(IBaseHandler *parent);
...@@ -765,7 +806,7 @@ class ImageHandler : public IDocImage, public BaseHandler<ImageHandler> ...@@ -765,7 +806,7 @@ class ImageHandler : public IDocImage, public BaseHandler<ImageHandler>
void endImage(); void endImage();
// IDocImage // IDocImage
virtual Kind kind() const { return Image; } virtual Kind kind() const { return DocImpl::Image; }
virtual QString name() const { return m_name; } virtual QString name() const { return m_name; }
virtual QString caption() const { return m_caption; } virtual QString caption() const { return m_caption; }
...@@ -781,7 +822,7 @@ class ImageHandler : public IDocImage, public BaseHandler<ImageHandler> ...@@ -781,7 +822,7 @@ class ImageHandler : public IDocImage, public BaseHandler<ImageHandler>
* *
*/ */
// children: - // children: -
class DotFileHandler : public IDocDotFile, public BaseHandler<DotFileHandler> class DotFileHandler : public DocDotFileImpl, public BaseHandler<DotFileHandler>
{ {
public: public:
DotFileHandler(IBaseHandler *parent); DotFileHandler(IBaseHandler *parent);
...@@ -790,7 +831,7 @@ class DotFileHandler : public IDocDotFile, public BaseHandler<DotFileHandler> ...@@ -790,7 +831,7 @@ class DotFileHandler : public IDocDotFile, public BaseHandler<DotFileHandler>
void endDotFile(); void endDotFile();
// IDocDotFile // IDocDotFile
virtual Kind kind() const { return DotFile; } virtual Kind kind() const { return DocImpl::DotFile; }
virtual QString name() const { return m_name; } virtual QString name() const { return m_name; }
virtual QString caption() const { return m_caption; } virtual QString caption() const { return m_caption; }
...@@ -806,7 +847,7 @@ class DotFileHandler : public IDocDotFile, public BaseHandler<DotFileHandler> ...@@ -806,7 +847,7 @@ class DotFileHandler : public IDocDotFile, public BaseHandler<DotFileHandler>
* *
*/ */
// children: - // children: -
class IndexEntryHandler : public IDocIndexEntry, public BaseHandler<IndexEntryHandler> class IndexEntryHandler : public DocIndexEntryImpl, public BaseHandler<IndexEntryHandler>
{ {
public: public:
IndexEntryHandler(IBaseHandler *parent); IndexEntryHandler(IBaseHandler *parent);
...@@ -819,7 +860,7 @@ class IndexEntryHandler : public IDocIndexEntry, public BaseHandler<IndexEntryHa ...@@ -819,7 +860,7 @@ class IndexEntryHandler : public IDocIndexEntry, public BaseHandler<IndexEntryHa
void endSecondaryIE(); void endSecondaryIE();
// IDocIndexEntry // IDocIndexEntry
virtual Kind kind() const { return IndexEntry; } virtual Kind kind() const { return DocImpl::IndexEntry; }
virtual QString primary() const { return m_primary; } virtual QString primary() const { return m_primary; }
virtual QString secondary() const { return m_secondary; } virtual QString secondary() const { return m_secondary; }
...@@ -835,7 +876,7 @@ class IndexEntryHandler : public IDocIndexEntry, public BaseHandler<IndexEntryHa ...@@ -835,7 +876,7 @@ class IndexEntryHandler : public IDocIndexEntry, public BaseHandler<IndexEntryHa
* *
*/ */
// children: para // children: para
class EntryHandler : public IDocEntry, public BaseHandler<EntryHandler> class EntryHandler : public DocEntryImpl, public BaseHandler<EntryHandler>
{ {
friend class EntryIterator; friend class EntryIterator;
public: public:
...@@ -846,19 +887,19 @@ class EntryHandler : public IDocEntry, public BaseHandler<EntryHandler> ...@@ -846,19 +887,19 @@ class EntryHandler : public IDocEntry, public BaseHandler<EntryHandler>
void startParagraph(const QXmlAttributes& attrib); void startParagraph(const QXmlAttributes& attrib);
// IDocEntry // IDocEntry
virtual Kind kind() const { return Entry; } virtual Kind kind() const { return DocImpl::Entry; }
virtual IDocIterator *contents() const; virtual IDocIterator *contents() const;
private: private:
IBaseHandler *m_parent; IBaseHandler *m_parent;
QList<IDoc> m_children; QList<DocImpl> m_children;
}; };
class EntryIterator : public BaseIterator<IDocIterator,IDoc,IDoc> class EntryIterator : public BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>
{ {
public: public:
EntryIterator(const EntryHandler &handler) : EntryIterator(const EntryHandler &handler) :
BaseIterator<IDocIterator,IDoc,IDoc>(handler.m_children) {} BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>(handler.m_children) {}
}; };
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
...@@ -867,7 +908,7 @@ class EntryIterator : public BaseIterator<IDocIterator,IDoc,IDoc> ...@@ -867,7 +908,7 @@ class EntryIterator : public BaseIterator<IDocIterator,IDoc,IDoc>
* *
*/ */
// children: entry // children: entry
class RowHandler : public IDocRow, public BaseHandler<RowHandler> class RowHandler : public DocRowImpl, public BaseHandler<RowHandler>
{ {
friend class RowIterator; friend class RowIterator;
public: public:
...@@ -878,7 +919,7 @@ class RowHandler : public IDocRow, public BaseHandler<RowHandler> ...@@ -878,7 +919,7 @@ class RowHandler : public IDocRow, public BaseHandler<RowHandler>
void startEntry(const QXmlAttributes& attrib); void startEntry(const QXmlAttributes& attrib);
// IDocRow // IDocRow
virtual Kind kind() const { return Row; } virtual Kind kind() const { return DocImpl::Row; }
virtual IDocIterator *entries() const; virtual IDocIterator *entries() const;
private: private:
...@@ -886,11 +927,11 @@ class RowHandler : public IDocRow, public BaseHandler<RowHandler> ...@@ -886,11 +927,11 @@ class RowHandler : public IDocRow, public BaseHandler<RowHandler>
QList<EntryHandler> m_children; QList<EntryHandler> m_children;
}; };
class RowIterator : public BaseIterator<IDocIterator,IDoc,EntryHandler> class RowIterator : public BaseIteratorVia<IDocIterator,IDoc,EntryHandler,DocImpl>
{ {
public: public:
RowIterator(const RowHandler &handler) : RowIterator(const RowHandler &handler) :
BaseIterator<IDocIterator,IDoc,EntryHandler>(handler.m_children) {} BaseIteratorVia<IDocIterator,IDoc,EntryHandler,DocImpl>(handler.m_children) {}
}; };
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
...@@ -899,7 +940,7 @@ class RowIterator : public BaseIterator<IDocIterator,IDoc,EntryHandler> ...@@ -899,7 +940,7 @@ class RowIterator : public BaseIterator<IDocIterator,IDoc,EntryHandler>
* *
*/ */
// children: row, caption // children: row, caption
class TableHandler : public IDocTable, public BaseHandler<TableHandler> class TableHandler : public DocTableImpl, public BaseHandler<TableHandler>
{ {
friend class TableIterator; friend class TableIterator;
public: public:
...@@ -912,7 +953,7 @@ class TableHandler : public IDocTable, public BaseHandler<TableHandler> ...@@ -912,7 +953,7 @@ class TableHandler : public IDocTable, public BaseHandler<TableHandler>
void endCaption(); void endCaption();
// IDocTable // IDocTable
virtual Kind kind() const { return Table; } virtual Kind kind() const { return DocImpl::Table; }
virtual IDocIterator *rows() const; virtual IDocIterator *rows() const;
virtual int numColumns() const { return m_numColumns; } virtual int numColumns() const { return m_numColumns; }
virtual QString caption() const { return m_caption; } virtual QString caption() const { return m_caption; }
...@@ -924,11 +965,11 @@ class TableHandler : public IDocTable, public BaseHandler<TableHandler> ...@@ -924,11 +965,11 @@ class TableHandler : public IDocTable, public BaseHandler<TableHandler>
QString m_caption; QString m_caption;
}; };
class TableIterator : public BaseIterator<IDocIterator,IDoc,RowHandler> class TableIterator : public BaseIteratorVia<IDocIterator,IDoc,RowHandler,DocImpl>
{ {
public: public:
TableIterator(const TableHandler &handler) : TableIterator(const TableHandler &handler) :
BaseIterator<IDocIterator,IDoc,RowHandler>(handler.m_children) {} BaseIteratorVia<IDocIterator,IDoc,RowHandler,DocImpl>(handler.m_children) {}
}; };
...@@ -941,7 +982,7 @@ class TableIterator : public BaseIterator<IDocIterator,IDoc,RowHandler> ...@@ -941,7 +982,7 @@ class TableIterator : public BaseIterator<IDocIterator,IDoc,RowHandler>
// children handled by MarkupHandler: // children handled by MarkupHandler:
// bold, computeroutput, emphasis, center, // bold, computeroutput, emphasis, center,
// small, subscript, superscript. // small, subscript, superscript.
class DocSectionHandler : public IDocSection, public BaseHandler<DocSectionHandler> class DocSectionHandler : public DocSectionImpl, public BaseHandler<DocSectionHandler>
{ {
friend class DocSectionIterator; friend class DocSectionIterator;
public: public:
...@@ -953,24 +994,24 @@ class DocSectionHandler : public IDocSection, public BaseHandler<DocSectionHandl ...@@ -953,24 +994,24 @@ class DocSectionHandler : public IDocSection, public BaseHandler<DocSectionHandl
void addTextNode(); void addTextNode();
// IDocSection // IDocSection
virtual Kind kind() const { return Section; } virtual Kind kind() const { return DocImpl::Section; }
virtual QString id() const { return m_id; } virtual QString id() const { return m_id; }
virtual int level() const { return m_level; } virtual int level() const { return m_level; }
virtual IDocIterator *title() const; virtual IDocIterator *title() const;
private: private:
IBaseHandler *m_parent; IBaseHandler *m_parent;
QList<IDoc> m_children; QList<DocImpl> m_children;
MarkupHandler *m_markupHandler; MarkupHandler *m_markupHandler;
QString m_id; QString m_id;
int m_level; int m_level;
}; };
class DocSectionIterator : public BaseIterator<IDocIterator,IDoc,IDoc> class DocSectionIterator : public BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>
{ {
public: public:
DocSectionIterator(const DocSectionHandler &handler) : DocSectionIterator(const DocSectionHandler &handler) :
BaseIterator<IDocIterator,IDoc,IDoc>(handler.m_children) {} BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>(handler.m_children) {}
}; };
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
...@@ -979,7 +1020,7 @@ class DocSectionIterator : public BaseIterator<IDocIterator,IDoc,IDoc> ...@@ -979,7 +1020,7 @@ class DocSectionIterator : public BaseIterator<IDocIterator,IDoc,IDoc>
* *
*/ */
// children: para, title, sect1, sect2, sect3 // children: para, title, sect1, sect2, sect3
class DocHandler : public IDocRoot, public BaseHandler<DocHandler> class DocHandler : public DocRootImpl, public BaseHandler<DocHandler>
{ {
friend class DocIterator; friend class DocIterator;
public: public:
...@@ -995,19 +1036,19 @@ class DocHandler : public IDocRoot, public BaseHandler<DocHandler> ...@@ -995,19 +1036,19 @@ class DocHandler : public IDocRoot, public BaseHandler<DocHandler>
virtual ~DocHandler(); virtual ~DocHandler();
// IDocRoot // IDocRoot
virtual Kind kind() const { return Root; } virtual Kind kind() const { return DocImpl::Root; }
virtual IDocIterator *contents() const; virtual IDocIterator *contents() const;
private: private:
IBaseHandler *m_parent; IBaseHandler *m_parent;
QList<IDoc> m_children; QList<DocImpl> m_children;
}; };
class DocIterator : public BaseIterator<IDocIterator,IDoc,IDoc> class DocIterator : public BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>
{ {
public: public:
DocIterator(const DocHandler &handler) : DocIterator(const DocHandler &handler) :
BaseIterator<IDocIterator,IDoc,IDoc>(handler.m_children) {} BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>(handler.m_children) {}
}; };
void dochandler_init(); void dochandler_init();
......
...@@ -7,13 +7,13 @@ class IMember; ...@@ -7,13 +7,13 @@ class IMember;
class IDocIterator; class IDocIterator;
class ICompound; class ICompound;
class ISection; class ISection;
class INode;
class ILinkedText class ILinkedText
{ {
public: public:
enum Kind { Kind_Text, Kind_Ref }; enum Kind { Kind_Text, Kind_Ref };
virtual Kind kind() const = 0; virtual Kind kind() const = 0;
virtual ~ILinkedText() {}
}; };
class ILT_Text : public ILinkedText class ILT_Text : public ILinkedText
...@@ -52,7 +52,6 @@ class IParam ...@@ -52,7 +52,6 @@ class IParam
virtual QString attrib() const = 0; virtual QString attrib() const = 0;
virtual QString arraySpecifier() const = 0; virtual QString arraySpecifier() const = 0;
virtual ILinkedTextIterator *defaultValue() const = 0; virtual ILinkedTextIterator *defaultValue() const = 0;
virtual ~IParam() {}
}; };
class IParamIterator class IParamIterator
...@@ -71,7 +70,6 @@ class IMemberReference ...@@ -71,7 +70,6 @@ class IMemberReference
public: public:
virtual IMember *member() const = 0; virtual IMember *member() const = 0;
virtual QString memberName() const = 0; virtual QString memberName() const = 0;
virtual ~IMemberReference() {}
}; };
class IMemberReferenceIterator class IMemberReferenceIterator
...@@ -90,7 +88,6 @@ class IEnumValue ...@@ -90,7 +88,6 @@ class IEnumValue
public: public:
virtual QString name() const = 0; virtual QString name() const = 0;
virtual QString initializer() const = 0; virtual QString initializer() const = 0;
virtual ~IEnumValue() {}
}; };
class IEnumValueIterator class IEnumValueIterator
...@@ -142,7 +139,6 @@ class IDoc ...@@ -142,7 +139,6 @@ class IDoc
Root // 30 -> IDocRoot Root // 30 -> IDocRoot
}; };
virtual Kind kind() const = 0; virtual Kind kind() const = 0;
virtual ~IDoc() {}
}; };
class IDocMarkup : public IDoc class IDocMarkup : public IDoc
...@@ -232,7 +228,8 @@ class IDocSimpleSect : public IDoc ...@@ -232,7 +228,8 @@ class IDocSimpleSect : public IDoc
Todo, Test, RCS, EnumValues, Todo, Test, RCS, EnumValues,
Examples Examples
}; };
virtual Types sectionType() const = 0; virtual Types type() const = 0;
virtual QString typeString() const = 0;
virtual IDocTitle *title() const = 0; virtual IDocTitle *title() const = 0;
virtual IDocPara *description() const = 0; virtual IDocPara *description() const = 0;
}; };
...@@ -411,7 +408,7 @@ class IChildNode ...@@ -411,7 +408,7 @@ class IChildNode
enum NodeRelation { PublicInheritance, ProtectedInheritance, enum NodeRelation { PublicInheritance, ProtectedInheritance,
PrivateInheritance, Usage, TemplateInstance PrivateInheritance, Usage, TemplateInstance
}; };
virtual QString id() const = 0; virtual INode * node() const = 0;
virtual NodeRelation relation() const = 0; virtual NodeRelation relation() const = 0;
virtual QString relationString() const = 0; virtual QString relationString() const = 0;
virtual IEdgeLabelIterator *edgeLabels() const = 0; virtual IEdgeLabelIterator *edgeLabels() const = 0;
...@@ -452,7 +449,6 @@ class IGraph ...@@ -452,7 +449,6 @@ class IGraph
{ {
public: public:
virtual INodeIterator *nodes() const = 0; virtual INodeIterator *nodes() const = 0;
virtual ~IGraph() {}
}; };
class IMember class IMember
...@@ -488,7 +484,6 @@ class IMember ...@@ -488,7 +484,6 @@ class IMember
virtual IEnumValueIterator *enumValues() const = 0; virtual IEnumValueIterator *enumValues() const = 0;
virtual IDocRoot *briefDescription() const = 0; virtual IDocRoot *briefDescription() const = 0;
virtual IDocRoot *detailedDescription() const = 0; virtual IDocRoot *detailedDescription() const = 0;
virtual ~IMember() {}
}; };
class IMemberIterator class IMemberIterator
...@@ -524,7 +519,6 @@ class ISection ...@@ -524,7 +519,6 @@ class ISection
virtual bool isPublic() const = 0; virtual bool isPublic() const = 0;
virtual bool isPrivate() const = 0; virtual bool isPrivate() const = 0;
virtual bool isProtected() const = 0; virtual bool isProtected() const = 0;
virtual ~ISection() {}
}; };
class ISectionIterator class ISectionIterator
...@@ -541,19 +535,43 @@ class ISectionIterator ...@@ -541,19 +535,43 @@ class ISectionIterator
class ICompound class ICompound
{ {
public: public:
/*! Represents the kind of compounds recognised by doxygen. */
enum CompoundKind { Invalid=0, enum CompoundKind { Invalid=0,
Class, Struct, Union, Interface, Exception, Class, Struct, Union, Interface, Exception,
Namespace, File, Group, Page, Package Namespace, File, Group, Page
}; };
/*! Returns the name of this compound */
virtual QString name() const = 0; virtual QString name() const = 0;
/*! Returns the id of this compound. The id is a
* unique string representing a specific compound object.
*/
virtual QString id() const = 0; virtual QString id() const = 0;
/*! Returns the kind of compound. See #CompoundKind for possible
* values.
*/
virtual CompoundKind kind() const = 0; virtual CompoundKind kind() const = 0;
/*! Returns a string representation of the compound kind.
* @see kind()
*/
virtual QString kindString() const = 0; virtual QString kindString() const = 0;
/*! Returns an iterator for the different member sections in this
* compound.
*/
virtual ISectionIterator *sections() const = 0; virtual ISectionIterator *sections() const = 0;
/*! Returns a tree-structured representation of the brief
* description that is attached to this compound.
*/
virtual IDocRoot *briefDescription() const = 0; virtual IDocRoot *briefDescription() const = 0;
/*! Returns a tree-structured representation of the detailed
* description that is attached to this compound.
*/
virtual IDocRoot *detailedDescription() const = 0; virtual IDocRoot *detailedDescription() const = 0;
virtual IGraph *inheritanceGraph() const = 0;
virtual IGraph *collaborationGraph() const = 0;
/*! Returns an interface to a member given its id. /*! Returns an interface to a member given its id.
* @param id The member id. * @param id The member id.
...@@ -561,7 +579,8 @@ class ICompound ...@@ -561,7 +579,8 @@ class ICompound
virtual IMember *memberById(const QString &id) const = 0; virtual IMember *memberById(const QString &id) const = 0;
/*! Returns a list of all members within the compound having a certain /*! Returns a list of all members within the compound having a certain
* name. Overloading is the reason why there can be more than one member. * name. Member overloading is the reason why there can be more than
* one member.
* @param name The name of the member. * @param name The name of the member.
*/ */
virtual IMemberIterator *memberByName(const QString &name) const = 0; virtual IMemberIterator *memberByName(const QString &name) const = 0;
...@@ -570,44 +589,105 @@ class ICompound ...@@ -570,44 +589,105 @@ class ICompound
* zero, the memory for the compound will be released. * zero, the memory for the compound will be released.
*/ */
virtual void release() = 0; virtual void release() = 0;
};
class ICompoundIterator
{
public:
virtual void toFirst() = 0;
virtual void toLast() = 0;
virtual void toNext() = 0;
virtual void toPrev() = 0;
virtual ICompound *current() const = 0;
virtual void release() = 0;
};
class IRelatedCompound
{
public:
enum Protection { Public, Protected, Private };
enum Kind { Normal, Virtual };
virtual ICompound *compound() const = 0;
virtual Protection protection() const = 0;
virtual Kind kind() const = 0;
};
class IRelatedCompoundIterator
{
public:
virtual IRelatedCompound *toFirst() = 0;
virtual IRelatedCompound *toLast() = 0;
virtual IRelatedCompound *toNext() = 0;
virtual IRelatedCompound *toPrev() = 0;
virtual IRelatedCompound *current() const = 0;
virtual void release() = 0;
};
class IClass : public ICompound
{
public:
virtual IGraph *inheritanceGraph() const = 0;
virtual IGraph *collaborationGraph() const = 0;
virtual IRelatedCompoundIterator *baseClasses() const = 0;
virtual IRelatedCompoundIterator *derivedClasses() const = 0;
virtual ICompoundIterator *nestedClasses() const = 0;
// TODO: // TODO:
// class: // class:
// IRelatedCompoundIterator *baseClasses()
// IRelatedCompoundIterator *derivedClasses()
// ICompoundIterator *innerClasses()
// ITemplateParamListIterator *templateParamLists() // ITemplateParamListIterator *templateParamLists()
// listOfAllMembers() // listOfAllMembers()
// IDotGraph *inheritanceGraph()
// IDotGraph *collaborationGraph()
// locationFile() // locationFile()
// locationLine() // locationLine()
// locationBodyStartLine() // locationBodyStartLine()
// locationBodyEndLine() // locationBodyEndLine()
};
class IStruct : public ICompound
{
};
class IUnion : public ICompound
{
};
class IInterface : public ICompound
{
};
class IException : public ICompound
{
};
class INamespace : public ICompound
{
// namespace: // namespace:
// ICompound *innerNamespaces() // ICompound *innerNamespaces()
// ICompoundIterator *innerClasses()
};
class IFile : public ICompound
{
// file: // file:
// includes() // includes()
// includedBy() // includedBy()
// IDotGraph *includeDependencyGraph() // IDotGraph *includeDependencyGraph()
// IDotGraph *includedByDependencyGraph() // IDotGraph *includedByDependencyGraph()
// IDocProgramListing *source() // IDocProgramListing *source()
// ICompound *innerNamespaces()
// ICompoundIterator *innerClasses()
};
class IGroup : public ICompound
{
// group: // group:
// Title() // Title()
// innerFile() // innerFile()
// innerPage() // innerPage()
// page:
}; };
class ICompoundIterator class IPage : public ICompound
{ {
public:
virtual void toFirst() = 0;
virtual void toLast() = 0;
virtual void toNext() = 0;
virtual void toPrev() = 0;
virtual ICompound *current() const = 0;
virtual void release() = 0;
}; };
/*! Root node of the object model. */ /*! Root node of the object model. */
......
...@@ -39,19 +39,23 @@ GraphHandler::GraphHandler(IBaseHandler *parent,const char *endTag) ...@@ -39,19 +39,23 @@ GraphHandler::GraphHandler(IBaseHandler *parent,const char *endTag)
addEndHandler(endTag,this,&GraphHandler::endGraph); addEndHandler(endTag,this,&GraphHandler::endGraph);
addStartHandler("node",this,&GraphHandler::startNode); addStartHandler("node",this,&GraphHandler::startNode);
m_nodes.setAutoDelete(TRUE); m_nodes.setAutoDelete(TRUE);
m_nodeDict = new QDict<NodeHandler>(1009);
} }
GraphHandler::~GraphHandler() GraphHandler::~GraphHandler()
{ {
delete m_nodeDict;
} }
void GraphHandler::startGraph(const QXmlAttributes &) void GraphHandler::startGraph(const QXmlAttributes &)
{ {
debug(2,"startGraph\n");
m_parent->setDelegate(this); m_parent->setDelegate(this);
} }
void GraphHandler::endGraph() void GraphHandler::endGraph()
{ {
debug(2,"endGraph\n");
m_parent->setDelegate(0); m_parent->setDelegate(0);
} }
...@@ -60,6 +64,7 @@ void GraphHandler::startNode(const QXmlAttributes &attrib) ...@@ -60,6 +64,7 @@ void GraphHandler::startNode(const QXmlAttributes &attrib)
NodeHandler *n = new NodeHandler(this); NodeHandler *n = new NodeHandler(this);
n->startNode(attrib); n->startNode(attrib);
m_nodes.append(n); m_nodes.append(n);
m_nodeDict->insert(attrib.value("id"),n);
} }
INodeIterator *GraphHandler::nodes() const INodeIterator *GraphHandler::nodes() const
...@@ -67,10 +72,15 @@ INodeIterator *GraphHandler::nodes() const ...@@ -67,10 +72,15 @@ INodeIterator *GraphHandler::nodes() const
return new NodeIterator(*this); return new NodeIterator(*this);
} }
NodeHandler *GraphHandler::getNodeById(const QString &id) const
{
return m_nodeDict->find(id);
}
//------------------------------------------------------------------------ //------------------------------------------------------------------------
NodeHandler::NodeHandler(IBaseHandler *parent) NodeHandler::NodeHandler(GraphHandler *gh)
: m_parent(parent) : m_parent(gh), m_graph(gh)
{ {
addEndHandler("node",this,&NodeHandler::endNode); addEndHandler("node",this,&NodeHandler::endNode);
addStartHandler("link",this,&NodeHandler::startLink); addStartHandler("link",this,&NodeHandler::startLink);
...@@ -87,12 +97,14 @@ NodeHandler::~NodeHandler() ...@@ -87,12 +97,14 @@ NodeHandler::~NodeHandler()
void NodeHandler::startNode(const QXmlAttributes &attrib) void NodeHandler::startNode(const QXmlAttributes &attrib)
{ {
debug(2,"startNode\n");
m_parent->setDelegate(this); m_parent->setDelegate(this);
m_id = attrib.value("id"); m_id = attrib.value("id");
} }
void NodeHandler::endNode() void NodeHandler::endNode()
{ {
debug(2,"endNode\n");
m_parent->setDelegate(0); m_parent->setDelegate(0);
} }
...@@ -117,7 +129,7 @@ void NodeHandler::endLabel() ...@@ -117,7 +129,7 @@ void NodeHandler::endLabel()
void NodeHandler::startChildNode(const QXmlAttributes &attrib) void NodeHandler::startChildNode(const QXmlAttributes &attrib)
{ {
ChildNodeHandler *cnh = new ChildNodeHandler(this); ChildNodeHandler *cnh = new ChildNodeHandler(this,m_graph);
cnh->startChildNode(attrib); cnh->startChildNode(attrib);
m_children.append(cnh); m_children.append(cnh);
} }
...@@ -129,9 +141,10 @@ IChildNodeIterator *NodeHandler::children() const ...@@ -129,9 +141,10 @@ IChildNodeIterator *NodeHandler::children() const
//------------------------------------------------------------------------ //------------------------------------------------------------------------
ChildNodeHandler::ChildNodeHandler(IBaseHandler *parent) ChildNodeHandler::ChildNodeHandler(IBaseHandler *parent,GraphHandler *gh)
: m_parent(parent) : m_parent(parent), m_graph(gh)
{ {
addEndHandler("childnode",this,&ChildNodeHandler::endChildNode);
addStartHandler("edgelabel",this,&ChildNodeHandler::startEdgeLabel); addStartHandler("edgelabel",this,&ChildNodeHandler::startEdgeLabel);
m_edgeLabels.setAutoDelete(TRUE); m_edgeLabels.setAutoDelete(TRUE);
} }
...@@ -142,6 +155,7 @@ ChildNodeHandler::~ChildNodeHandler() ...@@ -142,6 +155,7 @@ ChildNodeHandler::~ChildNodeHandler()
void ChildNodeHandler::startChildNode(const QXmlAttributes &attrib) void ChildNodeHandler::startChildNode(const QXmlAttributes &attrib)
{ {
debug(2,"startChildNode\n");
m_id = attrib.value("id"); m_id = attrib.value("id");
m_relationString = attrib.value("relation"); m_relationString = attrib.value("relation");
m_relation = s_edgeRelationMapper->stringToNodeRelation(m_relationString); m_relation = s_edgeRelationMapper->stringToNodeRelation(m_relationString);
...@@ -150,6 +164,7 @@ void ChildNodeHandler::startChildNode(const QXmlAttributes &attrib) ...@@ -150,6 +164,7 @@ void ChildNodeHandler::startChildNode(const QXmlAttributes &attrib)
void ChildNodeHandler::endChildNode() void ChildNodeHandler::endChildNode()
{ {
debug(2,"endChildNode\n");
m_parent->setDelegate(0); m_parent->setDelegate(0);
} }
...@@ -166,12 +181,17 @@ IEdgeLabelIterator *ChildNodeHandler::edgeLabels() const ...@@ -166,12 +181,17 @@ IEdgeLabelIterator *ChildNodeHandler::edgeLabels() const
return new EdgeLabelIterator(*this); return new EdgeLabelIterator(*this);
} }
INode *ChildNodeHandler::node() const
{
return m_graph->getNodeById(m_id);
}
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
EdgeLabelHandler::EdgeLabelHandler(IBaseHandler *parent) EdgeLabelHandler::EdgeLabelHandler(IBaseHandler *parent)
: m_parent(parent) : m_parent(parent)
{ {
addEndHandler("edgelabel",this,&EdgeLabelHandler::endEdgeLabel);
} }
EdgeLabelHandler::~EdgeLabelHandler() EdgeLabelHandler::~EdgeLabelHandler()
......
...@@ -34,6 +34,7 @@ class GraphHandler : public IGraph, public BaseHandler<GraphHandler> ...@@ -34,6 +34,7 @@ class GraphHandler : public IGraph, public BaseHandler<GraphHandler>
void startGraph(const QXmlAttributes &attrib); void startGraph(const QXmlAttributes &attrib);
void endGraph(); void endGraph();
void startNode(const QXmlAttributes &attrib); void startNode(const QXmlAttributes &attrib);
NodeHandler *getNodeById(const QString &id) const;
// IGraph // IGraph
virtual INodeIterator *nodes() const; virtual INodeIterator *nodes() const;
...@@ -41,6 +42,7 @@ class GraphHandler : public IGraph, public BaseHandler<GraphHandler> ...@@ -41,6 +42,7 @@ class GraphHandler : public IGraph, public BaseHandler<GraphHandler>
private: private:
IBaseHandler *m_parent; IBaseHandler *m_parent;
QList<NodeHandler> m_nodes; QList<NodeHandler> m_nodes;
QDict<NodeHandler> *m_nodeDict;
}; };
//---------------------------------------------------------------------- //----------------------------------------------------------------------
...@@ -49,7 +51,7 @@ class NodeHandler : public INode, public BaseHandler<NodeHandler> ...@@ -49,7 +51,7 @@ class NodeHandler : public INode, public BaseHandler<NodeHandler>
{ {
friend class ChildNodeIterator; friend class ChildNodeIterator;
public: public:
NodeHandler(IBaseHandler *parent); NodeHandler(GraphHandler *gh);
virtual ~NodeHandler(); virtual ~NodeHandler();
void startNode(const QXmlAttributes &attrib); void startNode(const QXmlAttributes &attrib);
...@@ -72,6 +74,7 @@ class NodeHandler : public INode, public BaseHandler<NodeHandler> ...@@ -72,6 +74,7 @@ class NodeHandler : public INode, public BaseHandler<NodeHandler>
QString m_label; QString m_label;
QString m_link; QString m_link;
QList<ChildNodeHandler> m_children; QList<ChildNodeHandler> m_children;
GraphHandler *m_graph;
}; };
class NodeIterator : public BaseIterator<INodeIterator,INode,NodeHandler> class NodeIterator : public BaseIterator<INodeIterator,INode,NodeHandler>
...@@ -87,7 +90,7 @@ class ChildNodeHandler : public IChildNode, public BaseHandler<ChildNodeHandler> ...@@ -87,7 +90,7 @@ class ChildNodeHandler : public IChildNode, public BaseHandler<ChildNodeHandler>
{ {
friend class EdgeLabelIterator; friend class EdgeLabelIterator;
public: public:
ChildNodeHandler(IBaseHandler *parent); ChildNodeHandler(IBaseHandler *parent,GraphHandler *gh);
virtual ~ChildNodeHandler(); virtual ~ChildNodeHandler();
void startChildNode(const QXmlAttributes &attrib); void startChildNode(const QXmlAttributes &attrib);
...@@ -95,7 +98,7 @@ class ChildNodeHandler : public IChildNode, public BaseHandler<ChildNodeHandler> ...@@ -95,7 +98,7 @@ class ChildNodeHandler : public IChildNode, public BaseHandler<ChildNodeHandler>
void startEdgeLabel(const QXmlAttributes &attrib); void startEdgeLabel(const QXmlAttributes &attrib);
// IChildNode // IChildNode
virtual QString id() const { return m_id; } virtual INode *node() const;
virtual NodeRelation relation() const { return m_relation; } virtual NodeRelation relation() const { return m_relation; }
virtual QString relationString() const { return m_relationString; } virtual QString relationString() const { return m_relationString; }
virtual IEdgeLabelIterator *edgeLabels() const; virtual IEdgeLabelIterator *edgeLabels() const;
...@@ -106,6 +109,7 @@ class ChildNodeHandler : public IChildNode, public BaseHandler<ChildNodeHandler> ...@@ -106,6 +109,7 @@ class ChildNodeHandler : public IChildNode, public BaseHandler<ChildNodeHandler>
NodeRelation m_relation; NodeRelation m_relation;
QString m_relationString; QString m_relationString;
QList<EdgeLabelHandler> m_edgeLabels; QList<EdgeLabelHandler> m_edgeLabels;
GraphHandler *m_graph;
}; };
class ChildNodeIterator : public BaseIterator<IChildNodeIterator,IChildNode,ChildNodeHandler> class ChildNodeIterator : public BaseIterator<IChildNodeIterator,IChildNode,ChildNodeHandler>
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#include "debug.h" #include "debug.h"
#include <doxmlintf.h> #include <doxmlintf.h>
class LT_Text : public ILT_Text class LT_Text : public LinkedTextImpl, public ILT_Text
{ {
public: public:
LT_Text(const QString &text) : m_text(text) {} LT_Text(const QString &text) : m_text(text) {}
...@@ -24,12 +24,12 @@ class LT_Text : public ILT_Text ...@@ -24,12 +24,12 @@ class LT_Text : public ILT_Text
// ILT_Text // ILT_Text
virtual QString text() const { return m_text; } virtual QString text() const { return m_text; }
virtual Kind kind() const { return Kind_Text; } virtual Kind kind() const { return LinkedTextImpl::Kind_Text; }
private: private:
QString m_text; QString m_text;
}; };
class LT_Ref : public ILT_Ref class LT_Ref : public LinkedTextImpl, public ILT_Ref
{ {
public: public:
LT_Ref() {} LT_Ref() {}
...@@ -44,7 +44,7 @@ class LT_Ref : public ILT_Ref ...@@ -44,7 +44,7 @@ class LT_Ref : public ILT_Ref
virtual QString id() const { return m_refId; } virtual QString id() const { return m_refId; }
virtual TargetKind targetKind() const { return m_targetKind; } virtual TargetKind targetKind() const { return m_targetKind; }
virtual QString external() const { return m_extId; } virtual QString external() const { return m_extId; }
virtual Kind kind() const { return Kind_Ref; } virtual Kind kind() const { return LinkedTextImpl::Kind_Ref; }
private: private:
QString m_refId; QString m_refId;
...@@ -54,7 +54,7 @@ class LT_Ref : public ILT_Ref ...@@ -54,7 +54,7 @@ class LT_Ref : public ILT_Ref
}; };
LinkedTextHandler::LinkedTextHandler(IBaseHandler *parent, LinkedTextHandler::LinkedTextHandler(IBaseHandler *parent,
QList<ILinkedText> &children QList<LinkedTextImpl> &children
) )
: m_parent(parent), m_children(children) : m_parent(parent), m_children(children)
{ {
...@@ -110,11 +110,11 @@ void LinkedTextHandler::endRef() ...@@ -110,11 +110,11 @@ void LinkedTextHandler::endRef()
m_ref=0; m_ref=0;
} }
QString LinkedTextHandler::toString(const QList<ILinkedText> &list) QString LinkedTextHandler::toString(const QList<LinkedTextImpl> &list)
{ {
QListIterator<ILinkedText> li(list); QListIterator<LinkedTextImpl> li(list);
QString result; QString result;
ILinkedText *lt; LinkedTextImpl *lt;
for (li.toFirst();(lt=li.current());++li) for (li.toFirst();(lt=li.current());++li)
{ {
switch(lt->kind()) switch(lt->kind())
......
...@@ -19,29 +19,36 @@ ...@@ -19,29 +19,36 @@
#include "basehandler.h" #include "basehandler.h"
class LT_Ref; class LT_Ref;
class LinkedTextImpl : public ILinkedText
class LinkedTextIterator : public BaseIterator<ILinkedTextIterator,ILinkedText,ILinkedText>
{ {
public: public:
LinkedTextIterator(const QList<ILinkedText> &list) : virtual ~LinkedTextImpl() {}
BaseIterator<ILinkedTextIterator,ILinkedText,ILinkedText>(list) {}
}; };
class LinkedTextHandler : public BaseHandler<LinkedTextHandler> class LinkedTextHandler : public BaseHandler<LinkedTextHandler>
{ {
public: public:
LinkedTextHandler(IBaseHandler *parent,QList<ILinkedText> &children); LinkedTextHandler(IBaseHandler *parent,QList<LinkedTextImpl> &children);
virtual ~LinkedTextHandler(); virtual ~LinkedTextHandler();
virtual void start(const char *endTag); virtual void start(const char *endTag);
virtual void end(); virtual void end();
virtual void startRef(const QXmlAttributes& attrib); virtual void startRef(const QXmlAttributes& attrib);
virtual void endRef(); virtual void endRef();
static QString toString(const QList<ILinkedText> &list); static QString toString(const QList<LinkedTextImpl> &list);
// ILinkedText
private: private:
IBaseHandler *m_parent; IBaseHandler *m_parent;
QList<ILinkedText> &m_children; QList<LinkedTextImpl> &m_children;
LT_Ref *m_ref; LT_Ref *m_ref;
}; };
class LinkedTextIterator : public BaseIterator<ILinkedTextIterator,ILinkedText,LinkedTextImpl>
{
public:
LinkedTextIterator(const QList<LinkedTextImpl> &list) :
BaseIterator<ILinkedTextIterator,ILinkedText,LinkedTextImpl>(list) {}
};
#endif #endif
...@@ -201,7 +201,7 @@ ICompound *MainHandler::compoundById(const QString &id) const ...@@ -201,7 +201,7 @@ ICompound *MainHandler::compoundById(const QString &id) const
if (ch) // compound already in memory if (ch) // compound already in memory
{ {
ch->addref(); // returning alias -> increase reference counter ch->addref(); // returning alias -> increase reference counter
return ch; return ch->toICompound();
} }
CompoundEntry *ce = m_compoundDict.find(id); CompoundEntry *ce = m_compoundDict.find(id);
if (ce==0) return 0; // id not found if (ce==0) return 0; // id not found
...@@ -219,7 +219,7 @@ ICompound *MainHandler::compoundById(const QString &id) const ...@@ -219,7 +219,7 @@ ICompound *MainHandler::compoundById(const QString &id) const
MainHandler *that = (MainHandler *)this; MainHandler *that = (MainHandler *)this;
ch->initialize(that); ch->initialize(that);
that->m_compoundsLoaded.insert(id,ch); that->m_compoundsLoaded.insert(id,ch);
return ch; return ch->toICompound();
} }
void MainHandler::unloadCompound(CompoundHandler *ch) void MainHandler::unloadCompound(CompoundHandler *ch)
......
...@@ -360,7 +360,7 @@ void MemberHandler::setCompoundHandler(CompoundHandler *c) ...@@ -360,7 +360,7 @@ void MemberHandler::setCompoundHandler(CompoundHandler *c)
ICompound *MemberHandler::compound() const ICompound *MemberHandler::compound() const
{ {
m_compound->addref(); m_compound->addref();
return m_compound; return m_compound->toICompound();
} }
void MemberHandler::setSectionHandler(SectionHandler *c) void MemberHandler::setSectionHandler(SectionHandler *c)
......
...@@ -175,13 +175,13 @@ class MemberHandler : public IMember, public BaseHandler<MemberHandler> ...@@ -175,13 +175,13 @@ class MemberHandler : public IMember, public BaseHandler<MemberHandler>
QString m_id; QString m_id;
QString m_protection; QString m_protection;
QString m_virtualness; QString m_virtualness;
QList<ILinkedText> m_type; QList<LinkedTextImpl> m_type;
QList<ILinkedText> m_initializer; QList<LinkedTextImpl> m_initializer;
QList<ILinkedText> m_exception; QList<LinkedTextImpl> m_exception;
QString m_name; QString m_name;
DocHandler *m_brief; DocHandler *m_brief;
DocHandler *m_detailed; DocHandler *m_detailed;
QList<IParam> m_params; QList<ParamHandler> m_params;
QList<MemberReference> m_references; QList<MemberReference> m_references;
QList<MemberReference> m_referencedBy; QList<MemberReference> m_referencedBy;
MemberReference *m_reimplements; MemberReference *m_reimplements;
......
...@@ -25,13 +25,6 @@ ...@@ -25,13 +25,6 @@
#include "baseiterator.h" #include "baseiterator.h"
#include "linkedtexthandler.h" #include "linkedtexthandler.h"
class ParamIterator : public BaseIterator<IParamIterator,IParam,IParam>
{
public:
ParamIterator(const QList<IParam> &list) :
BaseIterator<IParamIterator,IParam,IParam>(list) {}
};
class ParamHandler : public IParam, public BaseHandler<ParamHandler> class ParamHandler : public IParam, public BaseHandler<ParamHandler>
{ {
public: public:
...@@ -59,13 +52,21 @@ class ParamHandler : public IParam, public BaseHandler<ParamHandler> ...@@ -59,13 +52,21 @@ class ParamHandler : public IParam, public BaseHandler<ParamHandler>
private: private:
IBaseHandler *m_parent; IBaseHandler *m_parent;
QList<ILinkedText> m_type; QList<LinkedTextImpl> m_type;
QString m_declName; QString m_declName;
QString m_defName; QString m_defName;
QString m_attrib; QString m_attrib;
QString m_array; QString m_array;
QList<ILinkedText> m_defVal; QList<LinkedTextImpl> m_defVal;
LinkedTextHandler *m_linkedTextHandler; LinkedTextHandler *m_linkedTextHandler;
}; };
class ParamIterator : public BaseIterator<IParamIterator,IParam,ParamHandler>
{
public:
ParamIterator(const QList<ParamHandler> &list) :
BaseIterator<IParamIterator,IParam,ParamHandler>(list) {}
};
#endif #endif
...@@ -26,13 +26,12 @@ ...@@ -26,13 +26,12 @@
class MainHandler; class MainHandler;
class SectionIterator : class SectionIterator :
public BaseIterator<ISectionIterator,ISection,ISection> public BaseIterator<ISectionIterator,ISection,SectionHandler>
{ {
public: public:
SectionIterator(const QList<ISection> &list) : SectionIterator(const QList<SectionHandler> &list) :
BaseIterator<ISectionIterator,ISection,ISection>(list) {} BaseIterator<ISectionIterator,ISection,SectionHandler>(list) {}
}; };
......
...@@ -140,6 +140,10 @@ void DumpDoc(IDoc *doc) ...@@ -140,6 +140,10 @@ void DumpDoc(IDoc *doc)
{ {
IDocSimpleSect *ss = dynamic_cast<IDocSimpleSect*>(doc); IDocSimpleSect *ss = dynamic_cast<IDocSimpleSect*>(doc);
ASSERT(ss!=0); ASSERT(ss!=0);
printf(" --- simplesect type=%s --- \n",ss->typeString().data());
DumpDoc(ss->title());
DumpDoc(ss->description());
printf(" --- end simplesect --- \n");
} }
break; break;
case IDoc::Title: case IDoc::Title:
...@@ -158,8 +162,12 @@ void DumpDoc(IDoc *doc) ...@@ -158,8 +162,12 @@ void DumpDoc(IDoc *doc)
break; break;
case IDoc::Ref: case IDoc::Ref:
{ {
IDocRef *ref = dynamic_cast<IDocRef*>(ref); IDocRef *ref = dynamic_cast<IDocRef*>(doc);
ASSERT(ref!=0); ASSERT(ref!=0);
printf(" ref=%p\n",ref);
printf(" --- ref id=%s text=%s --- \n",
ref->refId().data(),ref->text().data());
printf(" --- end ref --- \n");
} }
break; break;
case IDoc::VariableList: case IDoc::VariableList:
...@@ -312,6 +320,43 @@ void DumpDoc(IDoc *doc) ...@@ -312,6 +320,43 @@ void DumpDoc(IDoc *doc)
} }
} }
void DumpGraph(IGraph *graph)
{
if (graph==0) { printf(" --- no graph ---\n"); return; }
printf(" --- graph ----\n");
INodeIterator *ni = graph->nodes();
INode *node;
for (ni->toFirst();(node=ni->current());ni->toNext())
{
printf(" --- node id=%s label=%s linkId=%s\n",
node->id().data(),
node->label().data(),
node->linkId().data()
);
IChildNodeIterator *cni = node->children();
IChildNode *cn;
for (cni->toFirst();(cn=cni->current());cni->toNext())
{
printf(" + child id=%s label=%s relation=%s\n",
cn->node()->id().data(),
cn->node()->label().data(),
cn->relationString().data()
);
IEdgeLabelIterator *eli = cn->edgeLabels();
IEdgeLabel *el;
for (eli->toFirst();(el=eli->current());eli->toNext())
{
printf(" edgeLabel=%s\n",el->label().data());
}
eli->release();
}
cni->release();
}
ni->release();
printf(" --- end graph ----\n");
}
int main(int argc,char **argv) int main(int argc,char **argv)
{ {
if (argc!=2) if (argc!=2)
...@@ -322,6 +367,8 @@ int main(int argc,char **argv) ...@@ -322,6 +367,8 @@ int main(int argc,char **argv)
IDoxygen *dox = createObjectModel(); IDoxygen *dox = createObjectModel();
dox->setDebugLevel(0);
if (!dox->readXMLDir(argv[1])) if (!dox->readXMLDir(argv[1]))
{ {
printf("Error reading %s/index.xml\n",argv[1]); printf("Error reading %s/index.xml\n",argv[1]);
...@@ -422,6 +469,41 @@ int main(int argc,char **argv) ...@@ -422,6 +469,41 @@ int main(int argc,char **argv)
printf("===== detailed description ==== \n"); printf("===== detailed description ==== \n");
DumpDoc(doc); DumpDoc(doc);
} }
if (comp->kind()==ICompound::Class)
{
IClass *cls = dynamic_cast<IClass*>(comp);
ASSERT(cls!=0);
printf("==== inheritance graph ==== \n");
DumpGraph(cls->inheritanceGraph());
printf("==== collabration graph ==== \n");
DumpGraph(cls->collaborationGraph());
printf("==== base classes ==== \n");
IRelatedCompoundIterator *bcli = cls->baseClasses();
IRelatedCompound *bClass;
for (bcli->toFirst();(bClass=bcli->current());bcli->toNext())
{
ICompound *bc = bClass->compound();
printf(" + class %s\n",bc->name().data());
bc->release();
}
bcli->release();
printf("==== derived classes ==== \n");
IRelatedCompoundIterator *dcli = cls->derivedClasses();
IRelatedCompound *dClass;
for (dcli->toFirst();(dClass=dcli->current());dcli->toNext())
{
ICompound *dc = dClass->compound();
printf(" + class %s\n",dc->name().data());
dc->release();
}
dcli->release();
}
comp->release(); comp->release();
} }
cli->release(); cli->release();
......
...@@ -2,6 +2,13 @@ class Test ...@@ -2,6 +2,13 @@ class Test
{ {
public: public:
enum TEnum { Val1, Val2 }; enum TEnum { Val1, Val2 };
/*! Another enum, with inline docs */
enum AnotherEnum
{
V1, /*!< value 1 */
V2 /*!< value 2 */
};
}; };
/*! \class Test /*! \class Test
......
...@@ -30,6 +30,8 @@ type makeconfig > doc\Makefile ...@@ -30,6 +30,8 @@ type makeconfig > doc\Makefile
type doc\Makefile.win_%MAKE%.in >>doc\Makefile type doc\Makefile.win_%MAKE%.in >>doc\Makefile
type makeconfig > addon\doxywizard\Makefile type makeconfig > addon\doxywizard\Makefile
type addon\doxywizard\Makefile.win_%MAKE%.in >>addon\doxywizard\Makefile type addon\doxywizard\Makefile.win_%MAKE%.in >>addon\doxywizard\Makefile
type makeconfig > addon\doxmlparser\src\Makefile
type addon\doxmlparser\src\Makefile.in >>addon\doxmlparser\src\Makefile
REM build in release or debug mode REM build in release or debug mode
REM sed is used to replace $extraopts by either debug or release while copying REM sed is used to replace $extraopts by either debug or release while copying
......
Summary: A documentation system for C/C++. Summary: A documentation system for C/C++.
Name: doxygen Name: doxygen
Version: 1.2.14_20020324 Version: 1.2.15
Release: 1 Release: 1
Epoch: 1 Epoch: 1
Source0: ftp://ftp.stack.nl/pub/users/dimitri/%{name}-%{version}.src.tar.gz Source0: ftp://ftp.stack.nl/pub/users/dimitri/%{name}-%{version}.src.tar.gz
......
...@@ -606,6 +606,7 @@ static void addDocCrossReference(MemberDef *src,MemberDef *dst) ...@@ -606,6 +606,7 @@ static void addDocCrossReference(MemberDef *src,MemberDef *dst)
{ {
src->addSourceReferences(dst); src->addSourceReferences(dst);
} }
} }
static void generateClassOrGlobalLink(OutputDocInterface &ol,char *clName,int *clNameLen=0) static void generateClassOrGlobalLink(OutputDocInterface &ol,char *clName,int *clNameLen=0)
...@@ -752,6 +753,22 @@ static bool generateClassMemberLink(OutputDocInterface &ol,ClassDef *mcd,const c ...@@ -752,6 +753,22 @@ static bool generateClassMemberLink(OutputDocInterface &ol,ClassDef *mcd,const c
// xmd->typeString(),xmd->argsString(), // xmd->typeString(),xmd->argsString(),
// xmd->getClassDef()->name().data()); // xmd->getClassDef()->name().data());
if (g_exampleBlock)
{
QCString anchor;
anchor.sprintf("a%d",g_anchorCount);
//printf("addExampleFile(%s,%s,%s)\n",anchor.data(),g_exampleName.data(),
// g_exampleFile.data());
if (xmd->addExample(anchor,g_exampleName,g_exampleFile))
{
ol.pushGeneratorState();
ol.disable(OutputGenerator::Latex);
ol.writeAnchor(0,anchor);
ol.popGeneratorState();
g_anchorCount++;
}
}
g_theCallContext.setClass(stripClassName(xmd->typeString())); g_theCallContext.setClass(stripClassName(xmd->typeString()));
Definition *xd = xmd->getOuterScope()==Doxygen::globalScope ? Definition *xd = xmd->getOuterScope()==Doxygen::globalScope ?
...@@ -771,6 +788,7 @@ static bool generateClassMemberLink(OutputDocInterface &ol,ClassDef *mcd,const c ...@@ -771,6 +788,7 @@ static bool generateClassMemberLink(OutputDocInterface &ol,ClassDef *mcd,const c
xd->getOutputFileBase(),xmd->getBodyAnchor(),memName); xd->getOutputFileBase(),xmd->getBodyAnchor(),memName);
return TRUE; return TRUE;
} }
} }
} }
...@@ -1081,7 +1099,7 @@ TYPEKW ("bool"|"char"|"double"|"float"|"int"|"long"|"short"|"signed"|"unsigned" ...@@ -1081,7 +1099,7 @@ TYPEKW ("bool"|"char"|"double"|"float"|"int"|"long"|"short"|"signed"|"unsigned"
g_type.resize(0); g_type.resize(0);
g_name.resize(0); g_name.resize(0);
} }
<Body>"}" { <Body,MemberCall,MemberCall2>"}" {
g_theVarContext.popScope(); g_theVarContext.popScope();
if (g_scopeStack.pop()==SCOPEBLOCK) if (g_scopeStack.pop()==SCOPEBLOCK)
...@@ -1099,6 +1117,7 @@ TYPEKW ("bool"|"char"|"double"|"float"|"int"|"long"|"short"|"signed"|"unsigned" ...@@ -1099,6 +1117,7 @@ TYPEKW ("bool"|"char"|"double"|"float"|"int"|"long"|"short"|"signed"|"unsigned"
g_currentMemberDef=0; g_currentMemberDef=0;
g_currentDefinition=0; g_currentDefinition=0;
} }
BEGIN(Body);
} }
<ClassName,ClassVar>";" { <ClassName,ClassVar>";" {
g_code->codify(yytext); g_code->codify(yytext);
...@@ -1629,7 +1648,7 @@ TYPEKW ("bool"|"char"|"double"|"float"|"int"|"long"|"short"|"signed"|"unsigned" ...@@ -1629,7 +1648,7 @@ TYPEKW ("bool"|"char"|"double"|"float"|"int"|"long"|"short"|"signed"|"unsigned"
generateClassOrGlobalLink(*g_code,yytext); generateClassOrGlobalLink(*g_code,yytext);
BEGIN( MemberCall2 ); BEGIN( MemberCall2 );
} }
<FuncCall,MemberCall2>("("{B}*("*"{B}*)*[a-z_A-Z][a-z_A-Z0-9]*{B}*")"{B}*)/("."|"->") { <FuncCall,MemberCall2>("("{B}*("*"{B}*)+[a-z_A-Z][a-z_A-Z0-9]*{B}*")"{B}*)/("."|"->") {
g_code->codify(yytext); g_code->codify(yytext);
int s=0;while (!isId(yytext[s])) s++; int s=0;while (!isId(yytext[s])) s++;
int e=yyleng-1;while (!isId(yytext[e])) e--; int e=yyleng-1;while (!isId(yytext[e])) e--;
......
...@@ -3077,7 +3077,8 @@ static void computeClassRelations() ...@@ -3077,7 +3077,8 @@ static void computeClassRelations()
{ {
findBaseClassesForClass(root,cd,cd,DocumentedOnly,FALSE); findBaseClassesForClass(root,cd,cd,DocumentedOnly,FALSE);
} }
if ((cd==0 || !cd->hasDocumentation()) && bName.right(2)!="::") if ((cd==0 || (!cd->hasDocumentation() && !cd->isReference())) &&
bName.right(2)!="::")
{ {
if (!root->name.isEmpty() && root->name[0]!='@') if (!root->name.isEmpty() && root->name[0]!='@')
warn_undoc( warn_undoc(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment