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

Node representing a highlighted text fragment. More...

#include <dochandler.h>

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

Public Member Functions

 HighlightHandler (IBaseHandler *parent)
 
virtual ~HighlightHandler ()
 
void startHighlight (const QXmlAttributes &attrib)
 
void endHighlight ()
 
virtual void startRef (const QXmlAttributes &)
 
virtual void startSpace (const QXmlAttributes &)
 
virtual Kind kind () const
 
virtual HighlightKind highlightKind () const
 
virtual IDocIteratorcodeElements () const
 
- Public Member Functions inherited from BaseHandler< HighlightHandler >
 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< HighlightHandler >
 ElementMapper ()
 
virtual ~ElementMapper ()
 
void addStartHandler (const char *key)
 
void addStartHandler (const char *key, HighlightHandler *obj, void(HighlightHandler::*handler)(const QXmlAttributes &))
 
void addEndHandler (const char *key)
 
void addEndHandler (const char *key, HighlightHandler *obj, void(HighlightHandler::*handler)())
 
- Public Member Functions inherited from IBaseHandler
virtual ~IBaseHandler ()
 

Private Member Functions

void addTextNode ()
 

Private Attributes

IBaseHandlerm_parent
 
HighlightKind m_hl
 
QString m_hlString
 
QList< DocImplm_children
 

Friends

class HighlightIterator
 

Additional Inherited Members

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

Detailed Description

Node representing a highlighted text fragment.

Definition at line 790 of file dochandler.h.

Constructor & Destructor Documentation

HighlightHandler::HighlightHandler ( IBaseHandler parent)

Definition at line 1075 of file dochandler.cpp.

1076  : m_parent(parent)
1077 {
1079  addEndHandler("highlight",this,&HighlightHandler::endHighlight);
1083 }
HighlightKind m_hl
Definition: dochandler.h:810
QList< DocImpl > m_children
Definition: dochandler.h:812
IBaseHandler * m_parent
Definition: dochandler.h:809
virtual void startSpace(const QXmlAttributes &)
virtual void startRef(const QXmlAttributes &)
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
HighlightHandler::~HighlightHandler ( )
virtual

Definition at line 1085 of file dochandler.cpp.

1086 {
1087 }

Member Function Documentation

void HighlightHandler::addTextNode ( )
private

Definition at line 1119 of file dochandler.cpp.

1120 {
1121  if (!m_curString.isEmpty())
1122  {
1124  debug(2,"addTextNode() text=\"%s\"\n",
1125  m_curString.data());
1126  m_curString="";
1127  }
1128 }
bool isEmpty() const
Definition: qstring.h:682
void append(const type *d)
Definition: qlist.h:73
const char * data() const
Definition: qstring.h:542
QList< DocImpl > m_children
Definition: dochandler.h:812
Node representing a piece of text.
Definition: dochandler.h:86
IDocIterator * HighlightHandler::codeElements ( ) const
virtual

Definition at line 1130 of file dochandler.cpp.

1131 {
1132  return new HighlightIterator(*this);
1133 }
friend class HighlightIterator
Definition: dochandler.h:792
void HighlightHandler::endHighlight ( )

Definition at line 1098 of file dochandler.cpp.

1099 {
1100  addTextNode();
1101  debug(2,"end highlight class=`%s'\n",m_hlString.data());
1102  m_parent->setDelegate(0);
1103 }
const char * data() const
Definition: qstring.h:542
virtual void setDelegate(QXmlDefaultHandler *delegate)=0
IBaseHandler * m_parent
Definition: dochandler.h:809
QString m_hlString
Definition: dochandler.h:811
virtual HighlightKind HighlightHandler::highlightKind ( ) const
inlinevirtual

Definition at line 803 of file dochandler.h.

803 { return m_hl; }
HighlightKind m_hl
Definition: dochandler.h:810
virtual Kind HighlightHandler::kind ( ) const
inlinevirtual

Definition at line 802 of file dochandler.h.

void HighlightHandler::startHighlight ( const QXmlAttributes attrib)

Definition at line 1089 of file dochandler.cpp.

1090 {
1091  m_hlString = attrib.value("class");
1093  m_curString="";
1094  m_parent->setDelegate(this);
1095  debug(2,"start highlight\n");
1096 }
HighlightHandler::HighlightKind stringToKind(const QString &kindStr)
Definition: dochandler.cpp:73
static HighlightMapper * s_highlightMapper
Definition: dochandler.cpp:82
QString value(int index) const
Definition: qxml.cpp:664
HighlightKind m_hl
Definition: dochandler.h:810
virtual void setDelegate(QXmlDefaultHandler *delegate)=0
IBaseHandler * m_parent
Definition: dochandler.h:809
QString m_hlString
Definition: dochandler.h:811
void HighlightHandler::startRef ( const QXmlAttributes attrib)
virtual

Definition at line 1105 of file dochandler.cpp.

1106 {
1107  addTextNode();
1108  RefHandler *rh = new RefHandler(this);
1109  m_children.append(rh);
1110  rh->startRef(attrib);
1111 }
void append(const type *d)
Definition: qlist.h:73
QList< DocImpl > m_children
Definition: dochandler.h:812
void startRef(const QXmlAttributes &attrib)
Definition: dochandler.cpp:829
void HighlightHandler::startSpace ( const QXmlAttributes )
virtual

Definition at line 1113 of file dochandler.cpp.

1114 {
1115  m_curString=" ";
1116  addTextNode();
1117 }

Friends And Related Function Documentation

friend class HighlightIterator
friend

Definition at line 792 of file dochandler.h.

Member Data Documentation

QList<DocImpl> HighlightHandler::m_children
private

Definition at line 812 of file dochandler.h.

HighlightKind HighlightHandler::m_hl
private

Definition at line 810 of file dochandler.h.

QString HighlightHandler::m_hlString
private

Definition at line 811 of file dochandler.h.

IBaseHandler* HighlightHandler::m_parent
private

Definition at line 809 of file dochandler.h.


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