|
Packit |
1c1d7e |
/******************************************************************************
|
|
Packit |
1c1d7e |
*
|
|
Packit |
1c1d7e |
* $Id$
|
|
Packit |
1c1d7e |
*
|
|
Packit |
1c1d7e |
*
|
|
Packit |
1c1d7e |
* Copyright (C) 1997-2015 by Dimitri van Heesch.
|
|
Packit |
1c1d7e |
*
|
|
Packit |
1c1d7e |
* Permission to use, copy, modify, and distribute this software and its
|
|
Packit |
1c1d7e |
* documentation under the terms of the GNU General Public License is hereby
|
|
Packit |
1c1d7e |
* granted. No representations are made about the suitability of this software
|
|
Packit |
1c1d7e |
* for any purpose. It is provided "as is" without express or implied warranty.
|
|
Packit |
1c1d7e |
* See the GNU General Public License for more details.
|
|
Packit |
1c1d7e |
*
|
|
Packit |
1c1d7e |
*/
|
|
Packit |
1c1d7e |
#ifndef _COMPOUNDHANDLER_H
|
|
Packit |
1c1d7e |
#define _COMPOUNDHANDLER_H
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
#include <qstring.h>
|
|
Packit |
1c1d7e |
#include <qlist.h>
|
|
Packit |
1c1d7e |
#include <qxml.h>
|
|
Packit |
1c1d7e |
#include <doxmlintf.h>
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
#include "stringimpl.h"
|
|
Packit |
1c1d7e |
#include "basehandler.h"
|
|
Packit |
1c1d7e |
#include "baseiterator.h"
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
class MainHandler;
|
|
Packit |
1c1d7e |
class DocHandler;
|
|
Packit |
1c1d7e |
class ProgramListingHandler;
|
|
Packit |
1c1d7e |
class GraphHandler;
|
|
Packit |
1c1d7e |
class MemberHandler;
|
|
Packit |
1c1d7e |
class CompoundHandler;
|
|
Packit |
1c1d7e |
class SectionHandler;
|
|
Packit |
1c1d7e |
class ParamHandler;
|
|
Packit |
1c1d7e |
class TemplateParamListHandler;
|
|
Packit |
1c1d7e |
class TitleHandler;
|
|
Packit |
1c1d7e |
class ListOfAllMembersHandler;
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
class IncludeHandler : public IInclude, public BaseHandler<IncludeHandler>
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
public:
|
|
Packit |
1c1d7e |
IncludeHandler(IBaseHandler *parent,const char *endtag);
|
|
Packit |
1c1d7e |
virtual ~IncludeHandler();
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
void startInclude(const QXmlAttributes &attrib);
|
|
Packit |
1c1d7e |
void endInclude();
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
// IInclude
|
|
Packit |
1c1d7e |
virtual const IString * name() const
|
|
Packit |
1c1d7e |
{ return &m_name; }
|
|
Packit |
1c1d7e |
virtual const IString * refId() const
|
|
Packit |
1c1d7e |
{ return &m_refId; }
|
|
Packit |
1c1d7e |
virtual bool isLocal() const
|
|
Packit |
1c1d7e |
{ return &m_isLocal; }
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
private:
|
|
Packit |
1c1d7e |
IBaseHandler *m_parent;
|
|
Packit |
1c1d7e |
StringImpl m_name; // element's content
|
|
Packit |
1c1d7e |
StringImpl m_refId; // refid
|
|
Packit |
1c1d7e |
bool m_isLocal; // local
|
|
Packit |
1c1d7e |
};
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
class IncludeIterator : public BaseIterator<IIncludeIterator,IInclude,IncludeHandler>
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
public:
|
|
Packit |
1c1d7e |
IncludeIterator(const QList<IncludeHandler> &list) :
|
|
Packit |
1c1d7e |
BaseIterator<IIncludeIterator,IInclude,IncludeHandler>(list) {}
|
|
Packit |
1c1d7e |
};
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
class RelatedCompound : public IRelatedCompound
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
public:
|
|
Packit |
1c1d7e |
RelatedCompound(CompoundHandler *parent,
|
|
Packit |
1c1d7e |
const QString &id,
|
|
Packit |
1c1d7e |
Protection prot,
|
|
Packit |
1c1d7e |
Kind kind
|
|
Packit |
1c1d7e |
) :
|
|
Packit |
1c1d7e |
m_parent(parent), m_id(id), m_protection(prot), m_kind(kind) {}
|
|
Packit |
1c1d7e |
virtual ~RelatedCompound() {}
|
|
Packit |
1c1d7e |
void setName(const QString &str) { m_name = str; }
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
virtual ICompound *compound() const;
|
|
Packit |
1c1d7e |
virtual Protection protection() const { return m_protection; }
|
|
Packit |
1c1d7e |
virtual Kind kind() const { return m_kind; }
|
|
Packit |
1c1d7e |
virtual const IString *name() const { return &m_name; }
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
private:
|
|
Packit |
1c1d7e |
CompoundHandler *m_parent;
|
|
Packit |
1c1d7e |
QString m_id; // refid
|
|
Packit |
1c1d7e |
Protection m_protection; // prot
|
|
Packit |
1c1d7e |
Kind m_kind; // virt
|
|
Packit |
1c1d7e |
StringImpl m_name; // element's content
|
|
Packit |
1c1d7e |
};
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
class RelatedCompoundIterator : public BaseIterator<IRelatedCompoundIterator,IRelatedCompound,RelatedCompound>
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
public:
|
|
Packit |
1c1d7e |
RelatedCompoundIterator(const QList<RelatedCompound> &list) :
|
|
Packit |
1c1d7e |
BaseIterator<IRelatedCompoundIterator,IRelatedCompound,RelatedCompound>(list) {}
|
|
Packit |
1c1d7e |
};
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
class CompoundHandler : public IClass,
|
|
Packit |
1c1d7e |
public IStruct,
|
|
Packit |
1c1d7e |
public IUnion,
|
|
Packit |
1c1d7e |
public IException,
|
|
Packit |
1c1d7e |
public IInterface,
|
|
Packit |
1c1d7e |
public INamespace,
|
|
Packit |
1c1d7e |
public IFile,
|
|
Packit |
1c1d7e |
public IGroup,
|
|
Packit |
1c1d7e |
public IPage,
|
|
Packit |
1c1d7e |
public IDir,
|
|
Packit |
1c1d7e |
public BaseHandler<CompoundHandler>
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
friend class RelatedCompound;
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
public:
|
|
Packit |
1c1d7e |
virtual void startSection(const QXmlAttributes& attrib);
|
|
Packit |
1c1d7e |
virtual void startCompound(const QXmlAttributes& attrib);
|
|
Packit |
1c1d7e |
virtual void startSuperClass(const QXmlAttributes& attrib);
|
|
Packit |
1c1d7e |
virtual void endSuperClass();
|
|
Packit |
1c1d7e |
virtual void startSubClass(const QXmlAttributes& attrib);
|
|
Packit |
1c1d7e |
virtual void endSubClass();
|
|
Packit |
1c1d7e |
virtual void endCompound();
|
|
Packit |
1c1d7e |
virtual void endCompoundName();
|
|
Packit |
1c1d7e |
virtual void startBriefDesc(const QXmlAttributes& attrib);
|
|
Packit |
1c1d7e |
virtual void startDetailedDesc(const QXmlAttributes& attrib);
|
|
Packit |
1c1d7e |
virtual void startLocation(const QXmlAttributes& attrib);
|
|
Packit |
1c1d7e |
virtual void startProgramListing(const QXmlAttributes& attrib);
|
|
Packit |
1c1d7e |
virtual void startInheritanceGraph(const QXmlAttributes& attrib);
|
|
Packit |
1c1d7e |
virtual void startCollaborationGraph(const QXmlAttributes& attrib);
|
|
Packit |
1c1d7e |
virtual void startIncludeDependencyGraph(const QXmlAttributes& attrib);
|
|
Packit |
1c1d7e |
virtual void startIncludedByDependencyGraph(const QXmlAttributes& attrib);
|
|
Packit |
1c1d7e |
virtual void startIncludes(const QXmlAttributes& attrib);
|
|
Packit |
1c1d7e |
virtual void startIncludedBy(const QXmlAttributes& attrib);
|
|
Packit |
1c1d7e |
virtual void startInnerDir(const QXmlAttributes& attrib);
|
|
Packit |
1c1d7e |
virtual void startInnerClass(const QXmlAttributes& attrib);
|
|
Packit |
1c1d7e |
virtual void startInnerNamespace(const QXmlAttributes& attrib);
|
|
Packit |
1c1d7e |
virtual void startInnerFile(const QXmlAttributes& attrib);
|
|
Packit |
1c1d7e |
virtual void startInnerGroup(const QXmlAttributes& attrib);
|
|
Packit |
1c1d7e |
virtual void startInnerPage(const QXmlAttributes& attrib);
|
|
Packit |
1c1d7e |
virtual void startTitle(const QXmlAttributes& attrib);
|
|
Packit |
1c1d7e |
virtual void startTemplateParamList(const QXmlAttributes& attrib);
|
|
Packit |
1c1d7e |
virtual void startListOfAllMembers(const QXmlAttributes& attrib);
|
|
Packit |
1c1d7e |
virtual void addref() { m_refCount++; }
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
CompoundHandler(const QString &dirName);
|
|
Packit |
1c1d7e |
virtual ~CompoundHandler();
|
|
Packit |
1c1d7e |
bool parseXML(const char *compId);
|
|
Packit |
1c1d7e |
void initialize(MainHandler *mh);
|
|
Packit |
1c1d7e |
void insertMember(MemberHandler *mh);
|
|
Packit |
1c1d7e |
ICompound *toICompound() const;
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
// ICompound implementation
|
|
Packit |
1c1d7e |
const IString *name() const { return &m_name; }
|
|
Packit |
1c1d7e |
const IString *id() const { return &m_id; }
|
|
Packit |
1c1d7e |
CompoundKind kind() const { return m_kind; }
|
|
Packit |
1c1d7e |
const IString *kindString() const { return &m_kindString; }
|
|
Packit |
1c1d7e |
ISectionIterator *sections() const;
|
|
Packit |
1c1d7e |
IDocRoot *briefDescription() const;
|
|
Packit |
1c1d7e |
IDocRoot *detailedDescription() const;
|
|
Packit |
1c1d7e |
IMember *memberById(const char *id) const;
|
|
Packit |
1c1d7e |
IMemberIterator *memberByName(const char *name) const;
|
|
Packit |
1c1d7e |
IParamIterator *templateParameters() const;
|
|
Packit |
1c1d7e |
void release();
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
// IClass implementation
|
|
Packit |
1c1d7e |
IGraph *inheritanceGraph() const;
|
|
Packit |
1c1d7e |
IGraph *collaborationGraph() const;
|
|
Packit |
1c1d7e |
IRelatedCompoundIterator *baseCompounds() const;
|
|
Packit |
1c1d7e |
IRelatedCompoundIterator *derivedCompounds() const;
|
|
Packit |
1c1d7e |
ICompoundIterator *nestedCompounds() const;
|
|
Packit |
1c1d7e |
ICompoundIterator *nestedGroup() const;
|
|
Packit |
1c1d7e |
const IString *locationFile() const { return &m_defFile; }
|
|
Packit |
1c1d7e |
int locationLine() const { return m_defLine; }
|
|
Packit |
1c1d7e |
const IString *locationBodyFile() const { return &m_defBodyFile; }
|
|
Packit |
1c1d7e |
int locationBodyStartLine() const { return m_defBodyStart; }
|
|
Packit |
1c1d7e |
int locationBodyEndLine() const { return m_defBodyEnd; }
|
|
Packit |
1c1d7e |
IMemberReferenceIterator *members() const;
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
// IFile implementation
|
|
Packit |
1c1d7e |
IGraph *includeDependencyGraph() const;
|
|
Packit |
1c1d7e |
IGraph *includedByDependencyGraph() const;
|
|
Packit |
1c1d7e |
IDocProgramListing *source() const;
|
|
Packit |
1c1d7e |
IIncludeIterator *includes() const;
|
|
Packit |
1c1d7e |
IIncludeIterator *includedBy() const;
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
// IPage implementation
|
|
Packit |
1c1d7e |
const IDocTitle *title() const;
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
private:
|
|
Packit |
1c1d7e |
// XML elements:
|
|
Packit |
1c1d7e |
// -------------
|
|
Packit |
1c1d7e |
StringImpl m_name; // compoundname
|
|
Packit |
1c1d7e |
TitleHandler* m_titleHandler; // title
|
|
Packit |
1c1d7e |
QList<RelatedCompound> m_subClasses; // basecompoundref
|
|
Packit |
1c1d7e |
QList<RelatedCompound> m_superClasses; // derivedcompoundref
|
|
Packit |
1c1d7e |
QList<IncludeHandler> m_includes; // includes
|
|
Packit |
1c1d7e |
QList<IncludeHandler> m_includedBy; // includedBy
|
|
Packit |
1c1d7e |
GraphHandler* m_includeDependencyGraph; // incdepgraph
|
|
Packit |
1c1d7e |
GraphHandler* m_includedByDependencyGraph; // invincdepgraph
|
|
Packit |
1c1d7e |
QList<QString> m_innerCompounds; // innerdir/innerfile/innerclass/innernamespace/innergroup
|
|
Packit |
1c1d7e |
TemplateParamListHandler* m_templateParamList; // templateparamlist
|
|
Packit |
1c1d7e |
QList<SectionHandler> m_sections; // sectiondef
|
|
Packit |
1c1d7e |
DocHandler* m_brief; // briefdescription
|
|
Packit |
1c1d7e |
DocHandler* m_detailed; // detaileddescription
|
|
Packit |
1c1d7e |
GraphHandler* m_inheritanceGraph; // inheritancegraph
|
|
Packit |
1c1d7e |
GraphHandler* m_collaborationGraph; // collaborationgraph
|
|
Packit |
1c1d7e |
ProgramListingHandler* m_programListing; // programlisting
|
|
Packit |
1c1d7e |
// location
|
|
Packit |
1c1d7e |
StringImpl m_defFile; // - file
|
|
Packit |
1c1d7e |
int m_defLine; // - line
|
|
Packit |
1c1d7e |
StringImpl m_defBodyFile; // - bodyfile
|
|
Packit |
1c1d7e |
int m_defBodyStart; // - bodystart
|
|
Packit |
1c1d7e |
int m_defBodyEnd; // - bodyend
|
|
Packit |
1c1d7e |
ListOfAllMembersHandler* m_members; // listofallmember
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
// XML attributes:
|
|
Packit |
1c1d7e |
// ---------------
|
|
Packit |
1c1d7e |
StringImpl m_id; // id
|
|
Packit |
1c1d7e |
CompoundKind m_kind; // kind
|
|
Packit |
1c1d7e |
StringImpl m_kindString; // kind as a string
|
|
Packit |
1c1d7e |
StringImpl m_protection; // prot
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
// local variables
|
|
Packit |
1c1d7e |
QString m_xmlDir; // directory where the info is found
|
|
Packit |
1c1d7e |
int m_refCount; // object reference counter
|
|
Packit |
1c1d7e |
QDict<MemberHandler> m_memberDict; // id->member lookup
|
|
Packit |
1c1d7e |
QDict<QList<MemberHandler> > m_memberNameDict; // name->memberlist lookup
|
|
Packit |
1c1d7e |
MainHandler* m_mainHandler; // parent object
|
|
Packit |
1c1d7e |
};
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
void compoundhandler_init();
|
|
Packit |
1c1d7e |
void compoundhandler_exit();
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
#endif
|