COPASI API  4.16.103
Public Member Functions | Private Attributes | List of all members
CQNotesContentHandler Class Reference

#include <CQNotes.h>

Inheritance diagram for CQNotesContentHandler:
Inheritance graph
[legend]
Collaboration diagram for CQNotesContentHandler:
Collaboration graph
[legend]

Public Member Functions

 CQNotesContentHandler ()
 
virtual bool endElement (const QString &namespaceURI, const QString &localName, const QString &qName)
 
const bool & isFreeText () const
 
bool needsWrap () const
 
virtual bool startDocument ()
 
virtual bool startElement (const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &atts)
 
 ~CQNotesContentHandler ()
 

Private Attributes

bool mIsFreeText
 
size_t mLevel
 
bool mNeedsWrap
 

Detailed Description

Definition at line 35 of file CQNotes.h.

Constructor & Destructor Documentation

CQNotesContentHandler::CQNotesContentHandler ( )

Definition at line 73 of file CQNotes.cpp.

73  :
74  QXmlDefaultHandler(),
75  mIsFreeText(true),
76  mNeedsWrap(true),
77  mLevel(0)
78 {}
CQNotesContentHandler::~CQNotesContentHandler ( )

Definition at line 80 of file CQNotes.cpp.

81 {}

Member Function Documentation

bool CQNotesContentHandler::endElement ( const QString &  namespaceURI,
const QString &  localName,
const QString &  qName 
)
virtual

Definition at line 113 of file CQNotes.cpp.

References mLevel.

116 {
117  mLevel--;
118 
119  return QXmlDefaultHandler::endElement(namespaceURI, localName, qName);
120 }
const bool & CQNotesContentHandler::isFreeText ( ) const

Definition at line 122 of file CQNotes.cpp.

References mIsFreeText.

Referenced by CQValidatorXML::validate().

123 {
124  return mIsFreeText;
125 }
bool CQNotesContentHandler::needsWrap ( ) const

Definition at line 127 of file CQNotes.cpp.

References mIsFreeText, and mNeedsWrap.

Referenced by CQValidatorXML::validate().

128 {
129  return (mNeedsWrap && !mIsFreeText);
130 }
bool CQNotesContentHandler::startDocument ( )
virtual

Definition at line 84 of file CQNotes.cpp.

References mIsFreeText, mLevel, and mNeedsWrap.

85 {
86  mIsFreeText = true;
87  mNeedsWrap = true;
88  mLevel = 0;
89  return true;
90 }
bool CQNotesContentHandler::startElement ( const QString &  namespaceURI,
const QString &  localName,
const QString &  qName,
const QXmlAttributes &  atts 
)
virtual

Definition at line 93 of file CQNotes.cpp.

References mIsFreeText, mLevel, and mNeedsWrap.

97 {
98  if (namespaceURI != "http://www.copasi.org/Validate" ||
99  qName != "Validate:XML")
100  mIsFreeText = false;
101 
102  if (mLevel == 1 &&
103  namespaceURI == "http://www.w3.org/1999/xhtml" &&
104  (localName == "html" || localName == "body"))
105  mNeedsWrap = false;
106 
107  mLevel++;
108 
109  return QXmlDefaultHandler::startElement(namespaceURI, localName, qName, atts);
110 }

Member Data Documentation

bool CQNotesContentHandler::mIsFreeText
private

Definition at line 60 of file CQNotes.h.

Referenced by isFreeText(), needsWrap(), startDocument(), and startElement().

size_t CQNotesContentHandler::mLevel
private

Definition at line 64 of file CQNotes.h.

Referenced by endElement(), startDocument(), and startElement().

bool CQNotesContentHandler::mNeedsWrap
private

Definition at line 62 of file CQNotes.h.

Referenced by needsWrap(), startDocument(), and startElement().


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