Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
CodeLineHandler Class Reference

Node representing a line of code. More...

#include <dochandler.h>

Inheritance diagram for CodeLineHandler:
BaseHandler< CodeLineHandler > QXmlDefaultHandler ElementMapper< CodeLineHandler > LocatorContainer IBaseHandler QXmlContentHandler QXmlErrorHandler QXmlDTDHandler QXmlEntityResolver QXmlLexicalHandler QXmlDeclHandler

Public Member Functions

virtual void startCodeLine (const QXmlAttributes &)
 
virtual void endCodeLine ()
 
virtual void startLineNumber (const QXmlAttributes &)
 
virtual void endLineNumber ()
 
virtual void startHighlight (const QXmlAttributes &)
 
virtual void startRef (const QXmlAttributes &)
 
 CodeLineHandler (IBaseHandler *parent)
 
virtual ~CodeLineHandler ()
 
virtual Kind kind () const
 
virtual int lineNumber () const
 
virtual const IStringrefId () const
 
virtual IDocIteratorcodeElements () const
 
- Public Member Functions inherited from BaseHandler< CodeLineHandler >
 BaseHandler ()
 
virtual ~BaseHandler ()
 
virtual bool startDocument ()
 
virtual bool startElement (const QString &namespaceURI, const QString &localName, const QString &name, const QXmlAttributes &attrib)
 
virtual bool endElement (const QString &namespaceURI, const QString &localName, const QString &name)
 
bool skippedEntity (const QString &s)
 
virtual bool characters (const QString &ch)
 
void setDelegate (QXmlDefaultHandler *delegate)
 
QXmlDefaultHandlerdelegate () const
 
void setFallBackHandler (IFallBackHandler *h)
 
IFallBackHandlerfallBackHandler () const
 
void setDocumentLocator (QXmlLocator *locator)
 
- Public Member Functions inherited from QXmlDefaultHandler
 QXmlDefaultHandler ()
 
virtual ~QXmlDefaultHandler ()
 
bool endDocument ()
 
bool startPrefixMapping (const QString &prefix, const QString &uri)
 
bool endPrefixMapping (const QString &prefix)
 
bool ignorableWhitespace (const QString &ch)
 
bool processingInstruction (const QString &target, const QString &data)
 
bool warning (const QXmlParseException &exception)
 
bool error (const QXmlParseException &exception)
 
bool fatalError (const QXmlParseException &exception)
 
bool notationDecl (const QString &name, const QString &publicId, const QString &systemId)
 
bool unparsedEntityDecl (const QString &name, const QString &publicId, const QString &systemId, const QString &notationName)
 
bool resolveEntity (const QString &publicId, const QString &systemId, QXmlInputSource *&ret)
 
bool startDTD (const QString &name, const QString &publicId, const QString &systemId)
 
bool endDTD ()
 
bool startCDATA ()
 
bool endCDATA ()
 
bool comment (const QString &ch)
 
bool attributeDecl (const QString &eName, const QString &aName, const QString &type, const QString &valueDefault, const QString &value)
 
bool internalEntityDecl (const QString &name, const QString &value)
 
bool externalEntityDecl (const QString &name, const QString &publicId, const QString &systemId)
 
QString errorString ()
 
- Public Member Functions inherited from QXmlContentHandler
virtual ~QXmlContentHandler ()
 
- Public Member Functions inherited from QXmlErrorHandler
virtual ~QXmlErrorHandler ()
 
- Public Member Functions inherited from QXmlDTDHandler
virtual ~QXmlDTDHandler ()
 
- Public Member Functions inherited from QXmlEntityResolver
virtual ~QXmlEntityResolver ()
 
- Public Member Functions inherited from QXmlLexicalHandler
virtual ~QXmlLexicalHandler ()
 
- Public Member Functions inherited from QXmlDeclHandler
virtual ~QXmlDeclHandler ()
 
- Public Member Functions inherited from ElementMapper< CodeLineHandler >
 ElementMapper ()
 
virtual ~ElementMapper ()
 
void addStartHandler (const char *key)
 
void addStartHandler (const char *key, CodeLineHandler *obj, void(CodeLineHandler::*handler)(const QXmlAttributes &))
 
void addEndHandler (const char *key)
 
void addEndHandler (const char *key, CodeLineHandler *obj, void(CodeLineHandler::*handler)())
 
- Public Member Functions inherited from IBaseHandler
virtual ~IBaseHandler ()
 

Private Member Functions

void addTextNode ()
 

Private Attributes

IBaseHandlerm_parent
 
int m_lineNumber
 
StringImpl m_refId
 
QList< DocImplm_children
 

Friends

class CodeLineIterator
 

Additional Inherited Members

- Public Types inherited from BaseHandler< CodeLineHandler >
typedef ElementMapper< CodeLineHandler >::StartElementHandlerT StartElementHandlerT
 
typedef ElementMapper< CodeLineHandler >::EndElementHandlerT EndElementHandlerT
 
- Public Types inherited from ElementMapper< CodeLineHandler >
typedef StartElementHandler StartElementHandlerT
 
typedef EndElementHandler EndElementHandlerT
 
- Static Public Attributes inherited from LocatorContainer
static QXmlLocators_theLocator =0
 
- Protected Attributes inherited from BaseHandler< CodeLineHandler >
QString m_curString
 
QString m_skipUntil
 
int m_skipCount
 
QXmlDefaultHandlerm_delegateHandler
 
IFallBackHandlerm_fallBackHandler
 
- Protected Attributes inherited from ElementMapper< CodeLineHandler >
QDict< StartElementHandlerTm_startHandlers
 
QDict< EndElementHandlerTm_endHandlers
 

Detailed Description

Node representing a line of code.

Definition at line 828 of file dochandler.h.

Constructor & Destructor Documentation

CodeLineHandler::CodeLineHandler ( IBaseHandler parent)

Definition at line 1139 of file dochandler.cpp.

1140  : m_parent(parent)
1141 {
1143  addEndHandler("codeline",this,&CodeLineHandler::endCodeLine);
1144  addEndHandler("linenumber",this,&CodeLineHandler::endLineNumber);
1147  m_lineNumber = 0;
1148 }
virtual void startRef(const QXmlAttributes &)
IBaseHandler * m_parent
Definition: dochandler.h:852
virtual void startHighlight(const QXmlAttributes &)
virtual void endLineNumber()
virtual void endCodeLine()
QList< DocImpl > m_children
Definition: dochandler.h:855
void addStartHandler(const char *key)
Definition: basehandler.h:91
void setAutoDelete(bool enable)
Definition: qlist.h:99
const bool TRUE
Definition: qglobal.h:371
void addEndHandler(const char *key)
Definition: basehandler.h:101
CodeLineHandler::~CodeLineHandler ( )
virtual

Definition at line 1150 of file dochandler.cpp.

1151 {
1152 }

Member Function Documentation

void CodeLineHandler::addTextNode ( )
private

Definition at line 1196 of file dochandler.cpp.

1197 {
1198  if (!m_curString.isEmpty())
1199  {
1201  debug(2,"addTextNode() text=\"%s\"\n",
1202  m_curString.data());
1203  m_curString="";
1204  }
1205 }
bool isEmpty() const
Definition: qstring.h:682
void append(const type *d)
Definition: qlist.h:73
const char * data() const
Definition: qstring.h:542
Node representing a piece of text.
Definition: dochandler.h:86
QList< DocImpl > m_children
Definition: dochandler.h:855
IDocIterator * CodeLineHandler::codeElements ( ) const
virtual

Definition at line 1207 of file dochandler.cpp.

1208 {
1209  return new CodeLineIterator(*this);
1210 }
friend class CodeLineIterator
Definition: dochandler.h:830
void CodeLineHandler::endCodeLine ( )
virtual

Definition at line 1160 of file dochandler.cpp.

1161 {
1162  addTextNode();
1163  debug(2,"end codeline\n");
1164  m_parent->setDelegate(0);
1165 }
IBaseHandler * m_parent
Definition: dochandler.h:852
virtual void setDelegate(QXmlDefaultHandler *delegate)=0
void CodeLineHandler::endLineNumber ( )
virtual

Definition at line 1175 of file dochandler.cpp.

1176 {
1177  m_parent->setDelegate(0);
1178 }
IBaseHandler * m_parent
Definition: dochandler.h:852
virtual void setDelegate(QXmlDefaultHandler *delegate)=0
virtual Kind CodeLineHandler::kind ( ) const
inlinevirtual

Definition at line 844 of file dochandler.h.

844 { return DocImpl::CodeLine; }
virtual int CodeLineHandler::lineNumber ( ) const
inlinevirtual

Definition at line 845 of file dochandler.h.

845 { return m_lineNumber; }
virtual const IString* CodeLineHandler::refId ( ) const
inlinevirtual

Definition at line 846 of file dochandler.h.

846 { return &m_refId; }
StringImpl m_refId
Definition: dochandler.h:854
void CodeLineHandler::startCodeLine ( const QXmlAttributes )
virtual

Definition at line 1154 of file dochandler.cpp.

1155 {
1156  m_parent->setDelegate(this);
1157  debug(2,"start codeline\n");
1158 }
IBaseHandler * m_parent
Definition: dochandler.h:852
virtual void setDelegate(QXmlDefaultHandler *delegate)=0
void CodeLineHandler::startHighlight ( const QXmlAttributes attrib)
virtual

Definition at line 1180 of file dochandler.cpp.

1181 {
1182  addTextNode();
1183  HighlightHandler *hlh = new HighlightHandler(this);
1184  m_children.append(hlh);
1185  hlh->startHighlight(attrib);
1186 }
void append(const type *d)
Definition: qlist.h:73
void startHighlight(const QXmlAttributes &attrib)
QList< DocImpl > m_children
Definition: dochandler.h:855
Node representing a highlighted text fragment.
Definition: dochandler.h:790
void CodeLineHandler::startLineNumber ( const QXmlAttributes attrib)
virtual

Definition at line 1167 of file dochandler.cpp.

1168 {
1169  m_parent->setDelegate(this);
1170  debug(2,"start linenumber\n");
1171  m_lineNumber = attrib.value("line").toInt();
1172  m_refId = attrib.value("refid");
1173 }
IBaseHandler * m_parent
Definition: dochandler.h:852
QString value(int index) const
Definition: qxml.cpp:664
StringImpl m_refId
Definition: dochandler.h:854
virtual void setDelegate(QXmlDefaultHandler *delegate)=0
int toInt(bool *ok=0, int base=10) const
Definition: qstring.cpp:14045
void CodeLineHandler::startRef ( const QXmlAttributes attrib)
virtual

Definition at line 1188 of file dochandler.cpp.

1189 {
1190  addTextNode();
1191  RefHandler *rh = new RefHandler(this);
1192  m_children.append(rh);
1193  rh->startRef(attrib);
1194 }
void append(const type *d)
Definition: qlist.h:73
void startRef(const QXmlAttributes &attrib)
Definition: dochandler.cpp:829
QList< DocImpl > m_children
Definition: dochandler.h:855

Friends And Related Function Documentation

friend class CodeLineIterator
friend

Definition at line 830 of file dochandler.h.

Member Data Documentation

QList<DocImpl> CodeLineHandler::m_children
private

Definition at line 855 of file dochandler.h.

int CodeLineHandler::m_lineNumber
private

Definition at line 853 of file dochandler.h.

IBaseHandler* CodeLineHandler::m_parent
private

Definition at line 852 of file dochandler.h.

StringImpl CodeLineHandler::m_refId
private

Definition at line 854 of file dochandler.h.


The documentation for this class was generated from the following files: