diff options
Diffstat (limited to 'quanta/parsers')
-rw-r--r-- | quanta/parsers/dtd/dtd.cpp | 128 | ||||
-rw-r--r-- | quanta/parsers/dtd/dtd.h | 34 | ||||
-rw-r--r-- | quanta/parsers/dtd/dtdparser.cpp | 84 | ||||
-rw-r--r-- | quanta/parsers/dtd/dtdparser.h | 22 | ||||
-rw-r--r-- | quanta/parsers/node.cpp | 50 | ||||
-rw-r--r-- | quanta/parsers/node.h | 30 | ||||
-rw-r--r-- | quanta/parsers/parser.cpp | 134 | ||||
-rw-r--r-- | quanta/parsers/parser.h | 28 | ||||
-rw-r--r-- | quanta/parsers/parsercommon.cpp | 26 | ||||
-rw-r--r-- | quanta/parsers/parsercommon.h | 12 | ||||
-rw-r--r-- | quanta/parsers/qtag.cpp | 28 | ||||
-rw-r--r-- | quanta/parsers/qtag.h | 170 | ||||
-rw-r--r-- | quanta/parsers/sagroupparser.cpp | 28 | ||||
-rw-r--r-- | quanta/parsers/sagroupparser.h | 4 | ||||
-rw-r--r-- | quanta/parsers/saparser.cpp | 50 | ||||
-rw-r--r-- | quanta/parsers/saparser.h | 30 | ||||
-rw-r--r-- | quanta/parsers/tag.cpp | 114 | ||||
-rw-r--r-- | quanta/parsers/tag.h | 56 |
18 files changed, 514 insertions, 514 deletions
diff --git a/quanta/parsers/dtd/dtd.cpp b/quanta/parsers/dtd/dtd.cpp index 18e3d712..964c35fb 100644 --- a/quanta/parsers/dtd/dtd.cpp +++ b/quanta/parsers/dtd/dtd.cpp @@ -16,11 +16,11 @@ ***************************************************************************/ -#include <qfile.h> -#include <qfileinfo.h> -#include <qregexp.h> -#include <qstringlist.h> -#include <qdom.h> +#include <tqfile.h> +#include <tqfileinfo.h> +#include <tqregexp.h> +#include <tqstringlist.h> +#include <tqdom.h> #include <klocale.h> #include <kurl.h> @@ -34,42 +34,42 @@ #include "../qextfileinfo.h" -DTD::DTD(const KURL &dtdURL, const QString &dtepDir) +DTD::DTD(const KURL &dtdURL, const TQString &dtepDir) { m_dtdURL = dtdURL; - m_dtepDir = dtepDir + "/"+QFileInfo(dtdURL.fileName()).baseName(); //TODO: get the dir name from the DTD or from the user + m_dtepDir = dtepDir + "/"+TQFileInfo(dtdURL.fileName()).baseName(); //TODO: get the dir name from the DTD or from the user } DTD::~DTD() { } -QStringList DTD::getTags() +TQStringList DTD::getTags() { return tags; } -AttributeList* DTD::getTagAttributes(QString tag) +AttributeList* DTD::getTagAttributes(TQString tag) { return tagAttributes.find(tag); } -QStringList DTD::getTextCompletion(QString tag) +TQStringList DTD::getTextCompletion(TQString tag) { - return QStringList(); + return TQStringList(); } void DTD::printContents() { - for ( QStringList::Iterator tagIt = tags.begin(); tagIt != tags.end(); ++tagIt ) { - QString tag = *tagIt; + for ( TQStringList::Iterator tagIt = tags.begin(); tagIt != tags.end(); ++tagIt ) { + TQString tag = *tagIt; kdDebug(24000) << tag << endl; AttributeList *attributes = getTagAttributes(tag); for ( uint i = 0; i < attributes->count(); i++) { Attribute *attribute = attributes->at(i); - QString s = " " + attribute->name + ": "; + TQString s = " " + attribute->name + ": "; for (uint j = 0; j < attribute->values.count(); j++) { s += attribute->values[j] + ", "; @@ -81,7 +81,7 @@ void DTD::printContents() void DTD::writeTagFiles() { - QString dirName = m_dtepDir; + TQString dirName = m_dtepDir; KURL u; u.setPath(dirName); if (!QExtFileInfo::createDir(dirName)) { @@ -89,13 +89,13 @@ void DTD::writeTagFiles() return; } dirName.append("/"); - for ( QStringList::Iterator tagIt = tags.begin(); tagIt != tags.end(); ++tagIt ) { - QString tag = *tagIt; + for ( TQStringList::Iterator tagIt = tags.begin(); tagIt != tags.end(); ++tagIt ) { + TQString tag = *tagIt; - QFile file( dirName + tag.lower() + ".tag" ); + TQFile file( dirName + tag.lower() + ".tag" ); if ( file.open( IO_WriteOnly ) ) { - QTextStream stream( &file ); - stream.setEncoding(QTextStream::UnicodeUTF8); + TQTextStream stream( &file ); + stream.setEncoding(TQTextStream::UnicodeUTF8); stream << "<!DOCTYPE TAGS>" << endl << "<TAGS>" << endl << "<tag name=\"" << tag << "\">" << endl << endl; @@ -114,31 +114,31 @@ void DTD::writeTagFiles() KConfig config(dirName + "description.rc"); config.setGroup("General"); - config.writeEntry("Name", QFileInfo(m_dtdURL.fileName()).baseName()); //TODO: get from the DTD! - config.writeEntry("NickName", QFileInfo(m_dtdURL.fileName()).baseName()); //TODO: get from the user! + config.writeEntry("Name", TQFileInfo(m_dtdURL.fileName()).baseName()); //TODO: get from the DTD! + config.writeEntry("NickName", TQFileInfo(m_dtdURL.fileName()).baseName()); //TODO: get from the user! config.sync(); } bool DTD::parseDTD(const KURL &url) { - QString fileName = QString::null; + TQString fileName = TQString::null; if (!KIO::NetAccess::download(url, fileName)) { KMessageBox::error(0, i18n("<qt>Cannot download the DTD from <b>%1</b>.</qt>").arg(url.prettyURL(0, KURL::StripFileProtocol))); return false; } - QFile file(fileName); + TQFile file(fileName); if (file.open(IO_ReadOnly)) { - QTextStream fileStream(&file); - fileStream.setEncoding(QTextStream::UnicodeUTF8); - QString entireDTD = fileStream.read(); + TQTextStream fileStream(&file); + fileStream.setEncoding(TQTextStream::UnicodeUTF8); + TQString entireDTD = fileStream.read(); file.close(); removeComments(entireDTD); - QString line; - QStringList lines = QStringList::split("\n",entireDTD); - QStringList::Iterator it = lines.begin(); + TQString line; + TQStringList lines = TQStringList::split("\n",entireDTD); + TQStringList::Iterator it = lines.begin(); while (it != lines.end()) { line = *it; @@ -183,7 +183,7 @@ bool DTD::parseDTD(const KURL &url) parseDTD(entityURL); } else { - kdDebug(24000) << QString("Unknown tag: [%1]").arg(line) << endl; + kdDebug(24000) << TQString("Unknown tag: [%1]").arg(line) << endl; } if (it != lines.end()) ++it; @@ -191,16 +191,16 @@ bool DTD::parseDTD(const KURL &url) } } -void DTD::parseDTDEntity(QString line) { - QString name; - QString *value; +void DTD::parseDTDEntity(TQString line) { + TQString name; + TQString *value; line.replace("\\end", " "); name = line.mid(11); int firstSpace = name.find(' '); name = name.remove(firstSpace, name.length()-firstSpace); - value = new QString(line.mid(11+firstSpace)); + value = new TQString(line.mid(11+firstSpace)); value->remove(0, value->find("\"")+1); value->remove(value->findRev("\""), value->length()); @@ -212,17 +212,17 @@ void DTD::parseDTDEntity(QString line) { //kdDebug() << "Entity --- Name: " << name << " --- Value: " << *value << endl; } -void DTD::parseDTDElement(const QString &l) { - QString name; - QString *value; +void DTD::parseDTDElement(const TQString &l) { + TQString name; + TQString *value; - QString line = l; + TQString line = l; line.replace("\\end", " "); name = line.mid(10); int firstSpace = name.find(' '); name.remove(firstSpace, name.length()-firstSpace); - value = new QString(line.mid(10+firstSpace)); + value = new TQString(line.mid(10+firstSpace)); //value->remove(0, value->find("\"")+1); value->remove(value->find(">"), 10000); @@ -232,8 +232,8 @@ void DTD::parseDTDElement(const QString &l) { if ( name.startsWith("(") && name.endsWith(")") ) { name.remove(0,1); name.remove(name.length()-1,1); - QStringList multipleTags = QStringList::split("|", name); - QStringList::Iterator it = multipleTags.begin(); + TQStringList multipleTags = TQStringList::split("|", name); + TQStringList::Iterator it = multipleTags.begin(); while(it != multipleTags.end()) { name = *it; name = name.stripWhiteSpace(); @@ -249,17 +249,17 @@ void DTD::parseDTDElement(const QString &l) { } } -void DTD::parseDTDAttlist(const QString &l) { - QString name; - QString *value; +void DTD::parseDTDAttlist(const TQString &l) { + TQString name; + TQString *value; - QString line = l; + TQString line = l; line.replace("\\end", " "); name = line.mid(10); int firstSpace = name.find(' '); name.remove(firstSpace, name.length()-firstSpace); - value = new QString(line.mid(10+firstSpace)); + value = new TQString(line.mid(10+firstSpace)); //value->remove(0, value->find("\"")+1); value->remove(value->find(">"), 10000); @@ -269,8 +269,8 @@ void DTD::parseDTDAttlist(const QString &l) { if ( name.startsWith("(") && name.endsWith(")") ) { name.remove(0,1); name.remove(name.length()-1,1); - QStringList multipleTags = QStringList::split("|", name); - QStringList::Iterator it = multipleTags.begin(); + TQStringList multipleTags = TQStringList::split("|", name); + TQStringList::Iterator it = multipleTags.begin(); while(it != multipleTags.end()) { name = *it; name = name.stripWhiteSpace(); @@ -287,16 +287,16 @@ void DTD::parseDTDAttlist(const QString &l) { } -void DTD::parseTagAttributeValues(const QString &name, QString *value) { +void DTD::parseTagAttributeValues(const TQString &name, TQString *value) { AttributeList *attributes = new AttributeList(); - QStringList attrLines = QStringList::split("\\end",*value); - QStringList::Iterator lineIt = attrLines.begin(); + TQStringList attrLines = TQStringList::split("\\end",*value); + TQStringList::Iterator lineIt = attrLines.begin(); while (lineIt != attrLines.end()) //iterate through the attribute lines { //split the attribute line - QStringList all = QStringList::split(" ", *lineIt); - QStringList::Iterator it = all.begin(); + TQStringList all = TQStringList::split(" ", *lineIt); + TQStringList::Iterator it = all.begin(); while(it != all.end()) { Attribute *attr = new Attribute(); @@ -304,14 +304,14 @@ void DTD::parseTagAttributeValues(const QString &name, QString *value) { //kdDebug() << "Inserting for tag " << name << ": " << *it << endl; ++it; - QString values = *it; + TQString values = *it; //list of possible values if ( values.startsWith("(") && values.endsWith(")") ) { values.remove(0,1); values.remove(values.length()-1,1); - attr->values = QStringList::split("|", values); - QString s = (attr->values[0]+attr->values[1]).lower(); + attr->values = TQStringList::split("|", values); + TQString s = (attr->values[0]+attr->values[1]).lower(); stripSpaces(&s); if ((s == "truefalse") || (s == "falsetrue")) { @@ -330,7 +330,7 @@ void DTD::parseTagAttributeValues(const QString &name, QString *value) { if (it != all.end()) { ++it; - QString s=*it; + TQString s=*it; if (s.startsWith("\"") && s.endsWith("\"") && it!=all.end()) { s.remove(0,1); @@ -360,13 +360,13 @@ void DTD::parseTagAttributeValues(const QString &name, QString *value) { tagAttributes.insert(name, attributes); } -void DTD::parseDTDReplace(QString *value) { +void DTD::parseDTDReplace(TQString *value) { int begin, end; begin = value->find("%"); end = value->find(";"); while (begin != -1 && end != -1) { - QString replaceText = value->mid(begin+1, end-begin-1); - QString *replaceValue = entities.find(replaceText); + TQString replaceText = value->mid(begin+1, end-begin-1); + TQString *replaceValue = entities.find(replaceText); if (replaceValue != 0L) { value->replace(begin, end-begin+1, *replaceValue); @@ -380,7 +380,7 @@ void DTD::parseDTDReplace(QString *value) { } } -void DTD::stripSpaces(QString *value) { +void DTD::stripSpaces(TQString *value) { int index=-1; while ( (index=value->find(' ',++index)) != -1 ) { if ( value->findRev('(',index) != -1 && value->find(')',index) != -1) @@ -388,7 +388,7 @@ void DTD::stripSpaces(QString *value) { } } -void DTD::removeComments(QString &value) { +void DTD::removeComments(TQString &value) { int begin, end; begin = value.find("<!--"); end = value.find("-->",begin+2); @@ -406,7 +406,7 @@ void DTD::removeComments(QString &value) { end = value.find("--",begin+2); } - value.replace(QRegExp("<!>"), ""); + value.replace(TQRegExp("<!>"), ""); } bool DTD::parseDTD() diff --git a/quanta/parsers/dtd/dtd.h b/quanta/parsers/dtd/dtd.h index 45b0e213..cc0cf238 100644 --- a/quanta/parsers/dtd/dtd.h +++ b/quanta/parsers/dtd/dtd.h @@ -19,7 +19,7 @@ #define DTD_H //qt includes -#include <qdict.h> +#include <tqdict.h> //app includes #include "qtag.h" @@ -30,13 +30,13 @@ class DTD { public: - DTD(const KURL &dtdURL, const QString& dtepDir); + DTD(const KURL &dtdURL, const TQString& dtepDir); ~DTD(); public: - QStringList getTags(); - AttributeList* getTagAttributes(QString tag); - QStringList getTextCompletion(QString tag); + TQStringList getTags(); + AttributeList* getTagAttributes(TQString tag); + TQStringList getTextCompletion(TQString tag); void printContents(); void writeTagFiles(); /** No descriptions */ @@ -44,21 +44,21 @@ public: private: bool parseDTD(const KURL& url); - void parseDTDEntity(const QString &line); - void parseDTDElement(const QString &line); - void parseDTDAttlist(const QString &line); - void parseTagAttributeValues(const QString &name, QString *value); - void parseDTDReplace(QString *value); - void stripSpaces(QString *value); - void removeComments(QString &value); + void parseDTDEntity(const TQString &line); + void parseDTDElement(const TQString &line); + void parseDTDAttlist(const TQString &line); + void parseTagAttributeValues(const TQString &name, TQString *value); + void parseDTDReplace(TQString *value); + void stripSpaces(TQString *value); + void removeComments(TQString &value); - QDict<QString> entities; - QDict<QString> elements; - QStringList tags; - QDict<AttributeList> tagAttributes; + TQDict<TQString> entities; + TQDict<TQString> elements; + TQStringList tags; + TQDict<AttributeList> tagAttributes; /** From where to load the DTD file. */ KURL m_dtdURL; - QString m_dtepDir; + TQString m_dtepDir; }; #endif diff --git a/quanta/parsers/dtd/dtdparser.cpp b/quanta/parsers/dtd/dtdparser.cpp index 86060967..0d623978 100644 --- a/quanta/parsers/dtd/dtdparser.cpp +++ b/quanta/parsers/dtd/dtdparser.cpp @@ -14,13 +14,13 @@ ***************************************************************************/ //qt includes -#include <qcheckbox.h> -#include <qfile.h> -#include <qfileinfo.h> -#include <qlabel.h> -#include <qlineedit.h> -#include <qregexp.h> -#include <qstring.h> +#include <tqcheckbox.h> +#include <tqfile.h> +#include <tqfileinfo.h> +#include <tqlabel.h> +#include <tqlineedit.h> +#include <tqregexp.h> +#include <tqstring.h> //kde includes #include <kconfig.h> @@ -51,15 +51,15 @@ namespace DTD { - QString dirName; + TQString dirName; xmlDtdPtr dtd_ptr; /* Pointer to the parsed DTD */ - QTextStream entityStream; + TQTextStream entityStream; } void saveElement(xmlElementPtr elem, xmlBufferPtr buf); void saveEntity(xmlEntityPtr entity, xmlBufferPtr buf); -DTDParser::DTDParser(const KURL& dtdURL, const QString &dtepDir) +DTDParser::DTDParser(const KURL& dtdURL, const TQString &dtepDir) { m_dtdURL = dtdURL; m_dtepDir = dtepDir; @@ -69,10 +69,10 @@ DTDParser::~DTDParser() { } -bool DTDParser::parse(const QString &targetDir, bool entitiesOnly) +bool DTDParser::parse(const TQString &targetDir, bool entitiesOnly) { bool fineTune = false; - QString fileName = QString::null; + TQString fileName = TQString::null; if (!KIO::NetAccess::download(m_dtdURL, fileName, 0)) { KMessageBox::error(0, i18n("<qt>Cannot download the DTD from <b>%1</b>.</qt>").arg( m_dtdURL.prettyURL(0, KURL::StripFileProtocol))); @@ -81,24 +81,24 @@ bool DTDParser::parse(const QString &targetDir, bool entitiesOnly) DTD::dtd_ptr = xmlParseDTD(NULL, xmlCharStrndup(fileName.utf8(), fileName.utf8().length())); if( DTD::dtd_ptr == NULL ) { - QString errorStr = i18n("Unknown"); + TQString errorStr = i18n("Unknown"); #ifndef LIBXML_2_5 xmlErrorPtr errorPtr = xmlGetLastError(); if (errorPtr != NULL) { - QString s = QString::fromLatin1(errorPtr->message); + TQString s = TQString::fromLatin1(errorPtr->message); if (!s.isEmpty()) errorStr = s; - s = QString::fromLatin1(errorPtr->str1); + s = TQString::fromLatin1(errorPtr->str1); if (!s.isEmpty()) errorStr += "<br>" + s; - s = QString::fromLatin1(errorPtr->str2); + s = TQString::fromLatin1(errorPtr->str2); if (!s.isEmpty()) errorStr += "<br>" + s; - s = QString::fromLatin1(errorPtr->str2); + s = TQString::fromLatin1(errorPtr->str2); if (!s.isEmpty()) errorStr += "<br>" + s; - errorStr += QString("(%1, %2)").arg(errorPtr->line).arg(errorPtr->int2); + errorStr += TQString("(%1, %2)").arg(errorPtr->line).arg(errorPtr->int2); xmlResetError(errorPtr); } #endif @@ -110,20 +110,20 @@ bool DTDParser::parse(const QString &targetDir, bool entitiesOnly) KDialogBase dlg(0L, 0L, true, i18n("DTD - > DTEP Conversion"), KDialogBase::Ok | KDialogBase::Cancel); DTEPCreationDlg w(&dlg); dlg.setMainWidget(&w); - QString name = QString((const char*)DTD::dtd_ptr->name); + TQString name = TQString((const char*)DTD::dtd_ptr->name); if (name == "none") - name = QFileInfo(m_dtdURL.fileName()).baseName(); + name = TQFileInfo(m_dtdURL.fileName()).baseName(); w.dtdName->setText(name); w.nickName->setText(name); - w.directory->setText(QFileInfo(m_dtdURL.fileName()).baseName()); - w.doctype->setText(QString((const char*)DTD::dtd_ptr->ExternalID)); - w.dtdURL->setText(QString((const char*)DTD::dtd_ptr->SystemID)); + w.directory->setText(TQFileInfo(m_dtdURL.fileName()).baseName()); + w.doctype->setText(TQString((const char*)DTD::dtd_ptr->ExternalID)); + w.dtdURL->setText(TQString((const char*)DTD::dtd_ptr->SystemID)); if (!dlg.exec()) return false; m_name = w.dtdName->text(); m_nickName = w.nickName->text(); m_doctype = w.doctype->text(); - m_doctype.replace(QRegExp("<!doctype", false), ""); + m_doctype.replace(TQRegExp("<!doctype", false), ""); m_doctype = m_doctype.left(m_doctype.findRev(">")); m_dtdURLLine = w.dtdURL->text(); m_defaultExtension = w.defaultExtension->text(); @@ -141,11 +141,11 @@ bool DTDParser::parse(const QString &targetDir, bool entitiesOnly) DTD::dirName.append("/"); if (DTD::dtd_ptr->entities) { - QFile file( DTD::dirName + "entities.tag" ); + TQFile file( DTD::dirName + "entities.tag" ); if ( file.open( IO_WriteOnly ) ) { DTD::entityStream.setDevice(&file); - DTD::entityStream.setEncoding(QTextStream::UnicodeUTF8); + DTD::entityStream.setEncoding(TQTextStream::UnicodeUTF8); DTD::entityStream << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << endl; DTD::entityStream << "<!DOCTYPE TAGS>" << endl << "<TAGS>" << endl; @@ -211,12 +211,12 @@ void saveElement(xmlElementPtr elem, xmlBufferPtr buf) Q_UNUSED(buf); if (elem) { - QString elemName = QString((const char*)elem->name); - QFile file( DTD::dirName + elemName + ".tag" ); + TQString elemName = TQString((const char*)elem->name); + TQFile file( DTD::dirName + elemName + ".tag" ); if ( file.open( IO_WriteOnly ) ) { - QTextStream stream( &file ); - stream.setEncoding(QTextStream::UnicodeUTF8); + TQTextStream stream( &file ); + stream.setEncoding(TQTextStream::UnicodeUTF8); stream << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << endl; stream << "<!DOCTYPE TAGS>" << endl << "<TAGS>" << endl @@ -232,21 +232,21 @@ void saveElement(xmlElementPtr elem, xmlBufferPtr buf) at_ptr = el_ptr->attributes; while (at_ptr) { Attribute *attr = new Attribute; - attr->name = QString((const char*)at_ptr->name); + attr->name = TQString((const char*)at_ptr->name); switch (at_ptr->def) { case 1: {attr->status = "optional"; break;} //NONE case 2: {attr->status = "required"; break;} //REQUIRED case 3: {attr->status = "implied"; break;} //IMPLIED case 4: {attr->status = "fixed"; break;} //FIXED } - attr->defaultValue = QString((const char*)at_ptr->defaultValue); + attr->defaultValue = TQString((const char*)at_ptr->defaultValue); xmlEnumerationPtr enum_ptr; enum_ptr = at_ptr->tree; while (enum_ptr) { - attr->values += QString((const char*)enum_ptr->name); + attr->values += TQString((const char*)enum_ptr->name); enum_ptr = enum_ptr->next; } - QString attrtype; + TQString attrtype; switch (at_ptr->atype) { case 9: {attrtype = "list"; break;} default: {attrtype = "input"; break;} //TODO handle the rest of types @@ -268,7 +268,7 @@ void saveElement(xmlElementPtr elem, xmlBufferPtr buf) stream << "<children>" << endl; for( int i = 0; i < childNum; i++ ) { - stream << " <child name=\"" << QString((const char*)list_ptr[i]) << "\""; + stream << " <child name=\"" << TQString((const char*)list_ptr[i]) << "\""; xmlElementPtr child_ptr = xmlGetDtdElementDesc(DTD::dtd_ptr, list_ptr[i]); if (child_ptr && child_ptr->content && child_ptr->content->ocur) { @@ -276,7 +276,7 @@ void saveElement(xmlElementPtr elem, xmlBufferPtr buf) //{ // stream << " usage=\"required\""; // } - QString ocur; + TQString ocur; switch (child_ptr->content->ocur) { case 1: {ocur = "once"; break;} @@ -285,7 +285,7 @@ void saveElement(xmlElementPtr elem, xmlBufferPtr buf) case 4: {ocur = "plus"; break;} } stream << " usage=\"" << ocur << "\""; - QString name = QString((const char*)child_ptr->content->name); + TQString name = TQString((const char*)child_ptr->content->name); if (name == "#PCDATA") name == "#text"; stream << " name2=\"" << name << "\""; @@ -303,10 +303,10 @@ void saveElement(xmlElementPtr elem, xmlBufferPtr buf) stream << "<children>" << endl; while (content_ptr) { - if (!QString((const char*)content_ptr->name).isEmpty()) + if (!TQString((const char*)content_ptr->name).isEmpty()) { - stream << " <child name=\"" << QString((const char*)content_ptr->name) << "\""; - QString ocur; + stream << " <child name=\"" << TQString((const char*)content_ptr->name) << "\""; + TQString ocur; switch (content_ptr->ocur) { case 1: {ocur = "once"; break;} @@ -350,12 +350,12 @@ void saveEntity(xmlEntityPtr entity, xmlBufferPtr buf) Q_UNUSED(buf); if (entity) { - QString name = QString((const char*)entity->name); + TQString name = TQString((const char*)entity->name); DTD::entityStream << "<tag name=\"" << name << "\" type=\"entity\" />" << endl << endl; } } -QString DTDParser::dirName() +TQString DTDParser::dirName() { return DTD::dirName; } diff --git a/quanta/parsers/dtd/dtdparser.h b/quanta/parsers/dtd/dtdparser.h index b5b66d01..77c608ee 100644 --- a/quanta/parsers/dtd/dtdparser.h +++ b/quanta/parsers/dtd/dtdparser.h @@ -16,7 +16,7 @@ #define DTDPARSER_H //qt includes -#include <qdict.h> +#include <tqdict.h> //forward declarations class KURL; @@ -26,30 +26,30 @@ struct Attribute; /** libxml2 based XML DTD parser and DTEP creation class*/ class DTDParser { public: - DTDParser(const KURL& dtdURL, const QString &dtepDir); + DTDParser(const KURL& dtdURL, const TQString &dtepDir); ~DTDParser(); - QString dirName(); + TQString dirName(); /** * Parse the DTD file. * @param targetDir the directory of the destination DTEP. If empty, a dialog is shown to configure the destination. * @param entitiesOnly if true, only the entities are extracted from the DTD into the entities.tag file * @return true on success, false if some error happened */ - bool parse(const QString &targetDir = QString::null, bool entitiesOnly = false); + bool parse(const TQString &targetDir = TQString::null, bool entitiesOnly = false); protected: void writeDescriptionRC(); private: KURL m_dtdURL; - QString m_dtepDir; - QString m_name; - QString m_nickName; - QString m_doctype; - QString m_dtdURLLine; + TQString m_dtepDir; + TQString m_name; + TQString m_nickName; + TQString m_doctype; + TQString m_dtdURLLine; bool m_caseSensitive; - QString m_defaultExtension; - QDict<Attribute> m_tags; + TQString m_defaultExtension; + TQDict<Attribute> m_tags; }; #endif diff --git a/quanta/parsers/node.cpp b/quanta/parsers/node.cpp index 0831a67c..219716e9 100644 --- a/quanta/parsers/node.cpp +++ b/quanta/parsers/node.cpp @@ -15,8 +15,8 @@ * * ***************************************************************************/ //qt includes -#include <qlistview.h> -#include <qdom.h> +#include <tqlistview.h> +#include <tqdom.h> #include <kdebug.h> @@ -27,7 +27,7 @@ #include "structtreetag.h" #include "kafkacommon.h" -QMap<Node*, int> nodes; //list of all created nodes. Used to do some own memory management and avoid double deletes, for whatever reason they happen... +TQMap<Node*, int> nodes; //list of all created nodes. Used to do some own memory management and avoid double deletes, for whatever reason they happen... int NN = 0; //for debugging purposes: count the Node objects @@ -112,10 +112,10 @@ Node::~Node() NN--; } -void Node::save(QDomElement& element) const +void Node::save(TQDomElement& element) const { //kdDebug(25001) << "Save:\n" << element.ownerDocument().toString() << endl; - QDomElement child_element; + TQDomElement child_element; if(next) { child_element = element.ownerDocument().createElement("nodeNext"); @@ -150,26 +150,26 @@ void Node::save(QDomElement& element) const element.setAttribute("specialInsideXml", specialInsideXml); // bool element.setAttribute("fileName", fileName); // QString -/* QString s_element; - QTextStream stream(&s_element, IO_WriteOnly); +/* TQString s_element; + TQTextStream stream(&s_element, IO_WriteOnly); element.save(stream, 3);*/ //kdDebug(25001) << "Load:\n" << s_element << endl; //kdDebug(25001) << "Save:\n" << element.ownerDocument().toString() << endl; } -bool Node::load(QDomElement const& element) +bool Node::load(TQDomElement const& element) { -/* QString s_element; - QTextStream stream(&s_element, IO_WriteOnly); +/* TQString s_element; + TQTextStream stream(&s_element, IO_WriteOnly); element.save(stream, 3);*/ //kdDebug(25001) << "Load:\n" << s_element << endl; - QDomNodeList list = element.childNodes(); + TQDomNodeList list = element.childNodes(); for(unsigned int i = 0; i != list.count(); ++i) { if(list.item(i).isElement()) { - QDomElement e = list.item(i).toElement(); + TQDomElement e = list.item(i).toElement(); if(e.tagName() == "nodeNext") { next = new Node(0); @@ -196,11 +196,11 @@ bool Node::load(QDomElement const& element) } } - closesPrevious = QString(element.attribute("closesPrevious")).toInt(); // bool - opened = QString(element.attribute("opened")).toInt(); // bool - removeAll = QString(element.attribute("removeAll")).toInt(); // bool - insideSpecial = QString(element.attribute("insideSpecial")).toInt(); // bool - specialInsideXml = QString(element.attribute("specialInsideXml")).toInt(); // bool + closesPrevious = TQString(element.attribute("closesPrevious")).toInt(); // bool + opened = TQString(element.attribute("opened")).toInt(); // bool + removeAll = TQString(element.attribute("removeAll")).toInt(); // bool + insideSpecial = TQString(element.attribute("insideSpecial")).toInt(); // bool + specialInsideXml = TQString(element.attribute("specialInsideXml")).toInt(); // bool fileName = element.attribute("fileName"); // QString //kafkaCommon::coutTree(this, 3); @@ -287,21 +287,21 @@ Node *Node::nextNotChild() } } -QString Node::nodeName() +TQString Node::nodeName() { if(tag) return tag->name; - return QString::null; + return TQString::null; } -QString Node::nodeValue() +TQString Node::nodeValue() { if(tag) return tag->tagStr(); - return QString::null; + return TQString::null; } -void Node::setNodeValue(const QString &value) +void Node::setNodeValue(const TQString &value) { if(!tag) tag = new Tag(); @@ -500,7 +500,7 @@ Node *Node::getOpeningNode() int Node::size() { int l = tag->size(); - l += 5*sizeof(Node*) + sizeof(QListViewItem*) + 2*sizeof(Tag*) + 2*sizeof(DOM::Node); + l += 5*sizeof(Node*) + sizeof(TQListViewItem*) + 2*sizeof(Tag*) + 2*sizeof(DOM::Node); return l; } @@ -530,7 +530,7 @@ void Node::detachNode() //kdDebug(24000) << &m_groupElements << " " << this << endl; //Remove the references to this node from the list of group elements. //They are actually stored in globalGroupMap. - for (QValueListIterator<GroupElement*> it = m_groupElements.begin(); it != m_groupElements.end(); ++it) + for (TQValueListIterator<GroupElement*> it = m_groupElements.begin(); it != m_groupElements.end(); ++it) { GroupElement *groupElement = (*it); groupElement->node = 0L; @@ -546,7 +546,7 @@ void Node::detachNode() kdDebug(24001) << count << " GroupElement scheduled for deletion. " << &m_groupElements << endl; #endif - QValueListIterator<QListViewItem*> listItem; + TQValueListIterator<TQListViewItem*> listItem; for ( listItem = listItems.begin(); listItem != listItems.end(); ++listItem) { static_cast<StructTreeTag*>(*listItem)->node = 0L; diff --git a/quanta/parsers/node.h b/quanta/parsers/node.h index e3587c05..87d54141 100644 --- a/quanta/parsers/node.h +++ b/quanta/parsers/node.h @@ -18,9 +18,9 @@ #ifndef NODE_H #define NODE_H -#include <qptrlist.h> -#include <qvaluelist.h> -#include <qmap.h> +#include <tqptrlist.h> +#include <tqvaluelist.h> +#include <tqmap.h> #include <dom/dom_node.h> class QDomElement; @@ -40,12 +40,12 @@ struct GroupElement{ Node *parentNode; bool global; bool deleted; - QString type; + TQString type; XMLStructGroup *group; ///<is part of this group }; -typedef QValueList<GroupElement*> GroupElementList; -typedef QMap<QString, GroupElementList> GroupElementMapList; +typedef TQValueList<GroupElement*> GroupElementList; +typedef TQMap<TQString, GroupElementList> GroupElementMapList; /** * A Node is a basic unit of a Tree. It keeps track of his parent, his left neighbour, his right neighbour @@ -79,8 +79,8 @@ public: void operator =(Node* node); /** For Kafka copy/paste */ - void save(QDomElement& element) const; - bool load(QDomElement const& element); + void save(TQDomElement& element) const; + bool load(TQDomElement const& element); Node *next; Node *prev; @@ -96,9 +96,9 @@ public: Node *nextNotChild(); /** DOM like functions cf dom/dom_node.h */ - QString nodeName(); - QString nodeValue(); - void setNodeValue(const QString &value); + TQString nodeName(); + TQString nodeValue(); + void setNodeValue(const TQString &value); Node* parentNode() {return parent;} Node* firstChild() {return child;} Node* lastChild(); @@ -162,15 +162,15 @@ public: */ Tag *tag; - QValueList<QListViewItem *> listItems; ///<points to the listview items which represents this node in the structure tree - QListViewItem *mainListItem; ///< the main listview item (from under the root node) associated with this node + TQValueList<TQListViewItem *> listItems; ///<points to the listview items which represents this node in the structure tree + TQListViewItem *mainListItem; ///< the main listview item (from under the root node) associated with this node bool closesPrevious; //this node "closes" the tag from previous node bool opened; bool removeAll; //set to false if you don't want to remove the "next" and "child" when deleting the node. bool insideSpecial; //true if the node is part of a special area bool specialInsideXml; //< true if the node is a special area defined inside a tag, like the PHP in <a href="<? echo $a ?>"> - QString fileName; //the node is in this file. If empty, it's in the current document - QValueList<GroupElement*> m_groupElements; ///< all the group elements pointing to this node + TQString fileName; //the node is in this file. If empty, it's in the current document + TQValueList<GroupElement*> m_groupElements; ///< all the group elements pointing to this node private: /** diff --git a/quanta/parsers/parser.cpp b/quanta/parsers/parser.cpp index 7559f1ec..1225aaa3 100644 --- a/quanta/parsers/parser.cpp +++ b/quanta/parsers/parser.cpp @@ -14,18 +14,18 @@ ***************************************************************************/ //qt includes -#include <qeventloop.h> -#include <qstring.h> -#include <qpoint.h> -#include <qregexp.h> -#include <qcstring.h> -#include <qstringlist.h> -#include <qstrlist.h> -#include <qdatetime.h> -#include <qfile.h> -#include <qtextcodec.h> -#include <qvaluelist.h> -#include <qvaluestack.h> +#include <tqeventloop.h> +#include <tqstring.h> +#include <tqpoint.h> +#include <tqregexp.h> +#include <tqcstring.h> +#include <tqstringlist.h> +#include <tqstrlist.h> +#include <tqdatetime.h> +#include <tqfile.h> +#include <tqtextcodec.h> +#include <tqvaluelist.h> +#include <tqvaluestack.h> //standard library includes #include <stdio.h> @@ -65,10 +65,10 @@ #include <ktexteditor/viewcursorinterface.h> extern GroupElementMapList globalGroupMap; -static const QChar space(' '); +static const TQChar space(' '); extern int NN; -extern QMap<Node*, int> nodes; +extern TQMap<Node*, int> nodes; Parser::Parser() { @@ -79,10 +79,10 @@ Parser::Parser() m_parsingNeeded = true; m_parseIncludedFiles = true; m_saParser = new SAParser(); - connect(m_saParser, SIGNAL(rebuildStructureTree(bool)), SIGNAL(rebuildStructureTree(bool))); - connect(m_saParser, SIGNAL(cleanGroups()), SLOT(cleanGroups())); + connect(m_saParser, TQT_SIGNAL(rebuildStructureTree(bool)), TQT_SIGNAL(rebuildStructureTree(bool))); + connect(m_saParser, TQT_SIGNAL(cleanGroups()), TQT_SLOT(cleanGroups())); ParserCommon::includeWatch = new KDirWatch(); - connect(ParserCommon::includeWatch, SIGNAL(dirty(const QString&)), SLOT(slotIncludedFileChanged(const QString&))); + connect(ParserCommon::includeWatch, TQT_SIGNAL(dirty(const TQString&)), TQT_SLOT(slotIncludedFileChanged(const TQString&))); } Parser::~Parser() @@ -94,7 +94,7 @@ Parser::~Parser() Node *Parser::parseArea(int startLine, int startCol, int endLine, int endCol, Node **lastNode, Node *a_node) { //first parse as an XML document - QString textLine; + TQString textLine; textLine.fill(space, startCol); int line = startLine; int col = 0; @@ -147,7 +147,7 @@ Node *Parser::parseArea(int startLine, int startCol, int endLine, int endCol, No currentNode = ParserCommon::createTextNode(write, currentNode, line, specialStartPos, parentNode); if (!rootNode) rootNode = currentNode; - QString foundText = m_dtd->specialAreaStartRx.cap(); + TQString foundText = m_dtd->specialAreaStartRx.cap(); //create a toplevel node for the special area AreaStruct area(line, specialStartPos, line, specialStartPos + foundText.length() - 1); Node *node = ParserCommon::createScriptTagNode(write, area, foundText, m_dtd, parentNode, currentNode); @@ -247,7 +247,7 @@ Node *Parser::parseArea(int startLine, int startCol, int endLine, int endCol, No //build an xml tag node here AreaStruct area(tagStartLine, tagStartPos, tagEndLine, tagEndCol); tag = new Tag(area, write, m_dtd, true); - QString tagStr = tag->tagStr(); + TQString tagStr = tag->tagStr(); tag->type = Tag::XmlTag; tag->validXMLTag = (openNum == 0); tag->single = QuantaCommon::isSingleTag(m_dtd->name, tag->name); @@ -282,15 +282,15 @@ Node *Parser::parseArea(int startLine, int startCol, int endLine, int endCol, No if (!rootNode) rootNode = node; //find the DTD that needs to be used for the special area - QString tmpStr = m_dtd->specialTags[tag->name.lower()]; + TQString tmpStr = m_dtd->specialTags[tag->name.lower()]; int defPos = tmpStr.find('['); - QString defValue; + TQString defValue; if (defPos != 0) { defValue = tmpStr.mid(defPos+1, tmpStr.findRev(']')-defPos-1).stripWhiteSpace(); tmpStr = tmpStr.left(defPos); } - QString s = tag->attributeValue(tmpStr); + TQString s = tag->attributeValue(tmpStr); if (s.isEmpty()) s = defValue; const DTDStruct *dtd = DTDs::ref()->find(s); @@ -325,7 +325,7 @@ Node *Parser::parseArea(int startLine, int startCol, int endLine, int endCol, No qTag = QuantaCommon::tagFromDTD(m_dtd, parentNode->tag->name); if ( qTag ) { - QString searchFor = (m_dtd->caseSensitive)?tag->name:tag->name.upper(); + TQString searchFor = (m_dtd->caseSensitive)?tag->name:tag->name.upper(); searchFor.remove('/'); if ( qTag->stoppingTags.contains(searchFor)) { @@ -364,7 +364,7 @@ Node *Parser::parseArea(int startLine, int startCol, int endLine, int endCol, No { //handle the case when a tag is a stopping tag for parent, and grandparent and so on. Node *n = parentNode; - QString searchFor = (m_dtd->caseSensitive)?tag->name:tag->name.upper(); + TQString searchFor = (m_dtd->caseSensitive)?tag->name:tag->name.upper(); while (qTag && n) { qTag = QuantaCommon::tagFromDTD(m_dtd, n->tag->name); @@ -505,7 +505,7 @@ Node *Parser::parseArea(int startLine, int startCol, int endLine, int endCol, No from Nodes */ Node *Parser::parse(Document *w, bool force) { - QTime t; + TQTime t; t.start(); QuantaView *view = ViewManager::ref()->activeView(); //If VPL is loaded, there shouldn't be any rebuild @@ -527,8 +527,8 @@ Node *Parser::parse(Document *w, bool force) Node::deleteNode(baseNode); baseNode = 0L; kdDebug(24000) << "Node objects after delete = " << NN << " ; list count = " << nodes.count() << endl; -/* QMap<Node*, int> nList = nodes; - for (QValueList<Node*>::ConstIterator it = nList.constBegin(); it != nList.constEnd(); ++it) +/* TQMap<Node*, int> nList = nodes; + for (TQValueList<Node*>::ConstIterator it = nList.constBegin(); it != nList.constEnd(); ++it) Node::deleteNode(*it); kdDebug(24000) << "Node objects after cleanup = " << NN << " ; list count = " << nodes.count() << endl; */ } @@ -567,7 +567,7 @@ Node *Parser::parse(Document *w, bool force) emit nodeTreeChanged(); if (saParserEnabled) - QTimer::singleShot(0, this, SLOT(slotParseInDetail())); + TQTimer::singleShot(0, this, TQT_SLOT(slotParseInDetail())); return m_node; } @@ -702,8 +702,8 @@ bool Parser::invalidArea(Document *w, AreaStruct &area, Node **firstNode, Node * w->viewCursorIf->cursorPositionReal(&line, &col); Node *node = nodeAt(line, col, false); int bl, bc, el, ec; - QString text; - QString tagStr; + TQString text; + TQString tagStr; area.bLine = area.bCol = 0; area.eLine = maxLines; area.eCol = w->editIf->lineLength(maxLines) - 1; @@ -976,7 +976,7 @@ void Parser::deleteNodes(Node *firstNode, Node *lastNode, NodeModifsSet *modifs) Node *Parser::rebuild(Document *w) { kdDebug(24000) << "Rebuild started. " << endl; - QTime t; + TQTime t; t.start(); bool saParserEnabled = m_saParser->parsingEnabled(); @@ -1002,8 +1002,8 @@ Node *Parser::rebuild(Document *w) m_saParser->setParsingEnabled(false); m_saParser->init(0L, w); parsingEnabled = true; - QString text; - QString tagStr; + TQString text; + TQString tagStr; Node *firstNode = 0L; Node *lastNode = 0L; @@ -1020,7 +1020,7 @@ Node *Parser::rebuild(Document *w) return n; } - kdDebug(24000) << QString("Invalid area: %1,%2,%3,%4").arg(area.bLine).arg(area.bCol).arg(area.eLine).arg(area.eCol) << "\n"; + kdDebug(24000) << TQString("Invalid area: %1,%2,%3,%4").arg(area.bLine).arg(area.bCol).arg(area.eLine).arg(area.eCol) << "\n"; // kdDebug(24000) << "lastNode1: " << lastNode << " " << lastNode->tag << endl; deleteNodes(firstNode->nextSibling(), lastNode, modifs); @@ -1082,7 +1082,7 @@ Node *Parser::rebuild(Document *w) lastNode->tag->endPos(area.eLine, area.eCol); Tag *_tag = new Tag(*(lastNode->tag)); lastNode->tag->setTagPosition(area); - QString s = write->text(area); + TQString s = write->text(area); lastNode->tag->setStr(s); if (!s.simplifyWhiteSpace().isEmpty()) { @@ -1141,7 +1141,7 @@ Node *Parser::rebuild(Document *w) qTag = QuantaCommon::tagFromDTD(m_dtd, node->parent->tag->name); if ( qTag ) { - QString searchFor = (m_dtd->caseSensitive)?lastNode->tag->name:lastNode->tag->name.upper(); + TQString searchFor = (m_dtd->caseSensitive)?lastNode->tag->name:lastNode->tag->name.upper(); searchFor.remove('/'); if ( qTag->stoppingTags.contains( searchFor ) ) { @@ -1172,7 +1172,7 @@ Node *Parser::rebuild(Document *w) { //handle the case when a tag is a stopping tag for parent, and grandparent and so on. I'm not sure it's needed here, but anyway... Node *n = node->parent; - QString searchFor = (m_dtd->caseSensitive) ? lastNode->tag->name : lastNode->tag->name.upper(); + TQString searchFor = (m_dtd->caseSensitive) ? lastNode->tag->name : lastNode->tag->name.upper(); while (qTag && n) { qTag = QuantaCommon::tagFromDTD(m_dtd, n->tag->name); @@ -1226,7 +1226,7 @@ Node *Parser::rebuild(Document *w) return n; } /* if (lastNode) - QString s = lastNode->tag->tagStr();*/ + TQString s = lastNode->tag->tagStr();*/ } } /* kdDebug(24000)<< "END"<< endl; @@ -1244,7 +1244,7 @@ Node *Parser::rebuild(Document *w) m_saParser->init(m_node, w); if (saParserEnabled) - QTimer::singleShot(0, this, SLOT(slotParseInDetail())); + TQTimer::singleShot(0, this, TQT_SLOT(slotParseInDetail())); emit nodeTreeChanged(); m_parsingNeeded = false; return m_node; @@ -1297,7 +1297,7 @@ void Parser::clearGroups() ParserCommon::includedFilesDTD.clear(); delete ParserCommon::includeWatch; ParserCommon::includeWatch = new KDirWatch(); - connect(ParserCommon::includeWatch, SIGNAL(dirty(const QString&)), SLOT(slotIncludedFileChanged(const QString&))); + connect(ParserCommon::includeWatch, TQT_SIGNAL(dirty(const TQString&)), TQT_SLOT(slotIncludedFileChanged(const TQString&))); m_parseIncludedFiles = true; } @@ -1345,7 +1345,7 @@ void Parser::cleanGroups() { delete ParserCommon::includeWatch; ParserCommon::includeWatch = new KDirWatch(); - connect(ParserCommon::includeWatch, SIGNAL(dirty(const QString&)), SLOT(slotIncludedFileChanged(const QString&))); + connect(ParserCommon::includeWatch, TQT_SIGNAL(dirty(const TQString&)), TQT_SLOT(slotIncludedFileChanged(const TQString&))); parseIncludedFiles(); } } @@ -1404,33 +1404,33 @@ struct GroupElementPosition{ int endPos; }; -void Parser::parseIncludedFile(const QString& fileName, const DTDStruct *dtd) +void Parser::parseIncludedFile(const TQString& fileName, const DTDStruct *dtd) { #ifdef DEBUG_PARSER kdDebug(24000) << "parseIncludedFile: " << fileName << endl; #endif StructTreeGroup group; - QString content; - QFile file(fileName); + TQString content; + TQFile file(fileName); if (file.open(IO_ReadOnly)) { IncludedGroupElements *elements = &includedMap[fileName]; - QTextStream str(&file); - QString encoding; + TQTextStream str(&file); + TQString encoding; KTextEditor::EncodingInterface* encodingIf = dynamic_cast<KTextEditor::EncodingInterface*>(write->doc()); if (encodingIf) encoding = encodingIf->encoding(); if (encoding.isEmpty()) encoding = "utf8"; //final fallback - str.setCodec(QTextCodec::codecForName(encoding)); + str.setCodec(TQTextCodec::codecForName(encoding)); content = str.read(); file.close(); if (dtd->specialAreas.count()) { int areaPos = 0; int lastAreaPos = 0; - QString foundStr; - QString specialEndStr; + TQString foundStr; + TQString specialEndStr; while (areaPos != -1) { areaPos = content.find(dtd->specialAreaStartRx, lastAreaPos); @@ -1452,7 +1452,7 @@ void Parser::parseIncludedFile(const QString& fileName, const DTDStruct *dtd) QuantaCommon::removeCommentsAndQuotes(foundStr, dtd); //gather the starting position of structures - QValueList<uint> structPositions; + TQValueList<uint> structPositions; int structPos = 0; while (structPos !=-1) { @@ -1464,10 +1464,10 @@ void Parser::parseIncludedFile(const QString& fileName, const DTDStruct *dtd) } } - QValueList<GroupElementPosition> gPositions; + TQValueList<GroupElementPosition> gPositions; //go through the list of found structures and search for groups int structStartPosition = 0; //from where to start the group search. This is before the structure begin position - QString savedStr = foundStr; + TQString savedStr = foundStr; for (uint i = 0; i < structPositions.count(); i++) { foundStr = savedStr; @@ -1492,7 +1492,7 @@ void Parser::parseIncludedFile(const QString& fileName, const DTDStruct *dtd) pos = foundStr.length(); int structEndPos = pos; foundStr = foundStr.left(pos); - QString spaces; + TQString spaces; spaces.fill(' ', pos - structPos + 1); foundStr.replace(structPos, pos - structPos + 1, spaces); @@ -1522,7 +1522,7 @@ void Parser::parseIncludedFile(const QString& fileName, const DTDStruct *dtd) //now check which groups are present in this area structPos = pos + 1; - QValueList<StructTreeGroup>::ConstIterator it; + TQValueList<StructTreeGroup>::ConstIterator it; for (it = dtd->structTreeGroups.begin(); it != dtd->structTreeGroups.end(); ++it) { group = *it; @@ -1535,7 +1535,7 @@ void Parser::parseIncludedFile(const QString& fileName, const DTDStruct *dtd) if (pos != -1) { int l; - QString ss = group.definitionRx.cap(); + TQString ss = group.definitionRx.cap(); if (group.definitionRx.pos(1) > pos) { pos = group.definitionRx.pos(1); @@ -1546,7 +1546,7 @@ void Parser::parseIncludedFile(const QString& fileName, const DTDStruct *dtd) { l = group.definitionRx.cap().length(); } - QString s = content.mid(areaPos + pos, l); + TQString s = content.mid(areaPos + pos, l); pos += l; if (!(*elements)[group.name].contains(s)) { @@ -1554,7 +1554,7 @@ void Parser::parseIncludedFile(const QString& fileName, const DTDStruct *dtd) tag->name = s; tag->setDtd(dtd); tag->setWrite(write); - QString s2 = content.left(areaPos + pos); + TQString s2 = content.left(areaPos + pos); int newLineNum = s2.contains('\n'); int tmpCol = s2.length() - s2.findRev('\n') - 1; tag->setTagPosition(newLineNum, tmpCol - s.length(), newLineNum, tmpCol); @@ -1565,7 +1565,7 @@ void Parser::parseIncludedFile(const QString& fileName, const DTDStruct *dtd) groupElement->node = node; groupElement->parentNode = 0L; int minPos = areaPos + pos + 1; - for (QValueList<GroupElementPosition>::Iterator gPosIt = gPositions.begin(); gPosIt != gPositions.end(); ++gPosIt) + for (TQValueList<GroupElementPosition>::Iterator gPosIt = gPositions.begin(); gPosIt != gPositions.end(); ++gPosIt) { GroupElementPosition gPos = (*gPosIt); if ( (areaPos + pos > gPos.startPos) && (areaPos + pos < gPos.endPos) && (gPos.startPos < minPos)) @@ -1604,7 +1604,7 @@ void Parser::parseIncludedFile(const QString& fileName, const DTDStruct *dtd) } } -void Parser::slotIncludedFileChanged(const QString& fileName) +void Parser::slotIncludedFileChanged(const TQString& fileName) { int pos = ParserCommon::includedFiles.findIndex(fileName); if (pos != -1) @@ -1640,8 +1640,8 @@ void Parser::parseForXMLGroup(Node *node) { XMLStructGroup group = xmlGroupIt.data(); Tag *newTag = new Tag(*node->tag); - QString title = ""; - QStringList::Iterator it; + TQString title = ""; + TQStringList::Iterator it; for (it = group.attributes.begin(); it != group.attributes.end(); ++it) { if (newTag->hasAttribute(*it)) @@ -1674,10 +1674,10 @@ bool Parser::parseScriptInsideTag(Node *startNode) const DTDStruct *dtd = startNode->tag->dtd(); if (dtd->specialAreas.count()) { - QString foundText; - QString s; - QString specialEndStr; - QString text = startNode->tag->tagStr(); + TQString foundText; + TQString s; + TQString specialEndStr; + TQString text = startNode->tag->tagStr(); int pos = 0; int col = startNode->tag->structBeginStr.length(); @@ -1751,7 +1751,7 @@ void Parser::synchParseInDetail() void Parser::setSAParserEnabled(bool enabled) { m_saParser->setParsingEnabled(enabled); - //kapp->processEvents(QEventLoop::ExcludeUserInput | QEventLoop::ExcludeSocketNotifiers); //this makes sure that the parsing is really disabled + //kapp->processEvents(TQEventLoop::ExcludeUserInput | TQEventLoop::ExcludeSocketNotifiers); //this makes sure that the parsing is really disabled } #include "parser.moc" diff --git a/quanta/parsers/parser.h b/quanta/parsers/parser.h index db797df0..94f24aff 100644 --- a/quanta/parsers/parser.h +++ b/quanta/parsers/parser.h @@ -16,13 +16,13 @@ #ifndef PARSER_H #define PARSER_H -#include <qobject.h> -#include <qdict.h> -#include <qstringlist.h> -#include <qmap.h> -#include <qguardedptr.h> +#include <tqobject.h> +#include <tqdict.h> +#include <tqstringlist.h> +#include <tqmap.h> +#include <tqguardedptr.h> -#include <qvaluestack.h> +#include <tqvaluestack.h> #include "node.h" #include "tag.h" @@ -38,11 +38,11 @@ class QRegExp; class NodeModifsSet; class SAParser; -typedef QMap<QString, GroupElementMapList> IncludedGroupElements; -typedef QMap<QString, IncludedGroupElements> IncludedGroupElementsMap; +typedef TQMap<TQString, GroupElementMapList> IncludedGroupElements; +typedef TQMap<TQString, IncludedGroupElements> IncludedGroupElementsMap; -class Parser: public QObject { +class Parser: public TQObject { Q_OBJECT @@ -95,7 +95,7 @@ public slots: void cleanGroups(); private slots: - void slotIncludedFileChanged(const QString& fileName); + void slotIncludedFileChanged(const TQString& fileName); signals: void nodeTreeChanged(); @@ -103,19 +103,19 @@ signals: private: Node* m_node; //the internal Node pointer - QString m_dtdName; //the DTD name of write + TQString m_dtdName; //the DTD name of write const DTDStruct* m_dtd; //the dtd used for main parsing - QGuardedPtr<Document> write; //pointer to the parsed document + TQGuardedPtr<Document> write; //pointer to the parsed document int maxLines; // how many lines are in the current document int oldMaxLines; int treeSize; - QMap<QString, XMLStructGroup>::ConstIterator xmlGroupIt; + TQMap<TQString, XMLStructGroup>::ConstIterator xmlGroupIt; bool m_parsingEnabled; bool m_parsingNeeded; /** Clears the group elements found in the included files */ void clearIncludedGroupElements(); - void parseIncludedFile(const QString &fileName, const DTDStruct *dtd); + void parseIncludedFile(const TQString &fileName, const DTDStruct *dtd); /** Searches for scripts inside the text from startNode. It looks only for the script begin/and delimiters, and not for the <script> or other special tags. Useful when parsing for script inside the xml tags. diff --git a/quanta/parsers/parsercommon.cpp b/quanta/parsers/parsercommon.cpp index 3283ed52..be660255 100644 --- a/quanta/parsers/parsercommon.cpp +++ b/quanta/parsers/parsercommon.cpp @@ -15,7 +15,7 @@ ***************************************************************************/ //qt includes -#include <qstring.h> +#include <tqstring.h> //kde includes #include <kdebug.h> @@ -36,14 +36,14 @@ class KDirWatch; int nodeNum; //for memory debugging - remove if not needed namespace ParserCommon { - QStringList includedFiles; - QPtrList<const DTDStruct> includedFilesDTD; + TQStringList includedFiles; + TQPtrList<const DTDStruct> includedFilesDTD; KDirWatch *includeWatch; //common methods. -QString getLine(Document *write, int line, int endLine, int endCol) +TQString getLine(Document *write, int line, int endLine, int endCol) { - QString textLine = write->editIf->textLine(line); + TQString textLine = write->editIf->textLine(line); if (line == endLine) { if (endCol >0) @@ -56,12 +56,12 @@ QString getLine(Document *write, int line, int endLine, int endCol) void appendAreaToTextNode(Document *write, const AreaStruct &area, Node *node) { - QString tagStr = write->text(area); - QString cleanStr = node->tag->cleanStr; + TQString tagStr = write->text(area); + TQString cleanStr = node->tag->cleanStr; node->tag->setStr(node->tag->tagStr() + tagStr); if (node->tag->type == Tag::Empty) { - QString s = tagStr; + TQString s = tagStr; if (s.simplifyWhiteSpace().isEmpty()) { node->tag->type = Tag::Empty; @@ -70,7 +70,7 @@ void appendAreaToTextNode(Document *write, const AreaStruct &area, Node *node) node->tag->type = Tag::Text; } } - QString cleanedTagStr = tagStr; + TQString cleanedTagStr = tagStr; QuantaCommon::removeCommentsAndQuotes(cleanedTagStr, node->tag->dtd()); node->tag->cleanStr = cleanStr + cleanedTagStr; int bLine, bCol; @@ -100,7 +100,7 @@ Node* createTextNode(Document *write, Node *node, int eLine, int eCol, Node *par { AreaStruct area(bLine, bCol + 1, eLine, eCol); textTag = new Tag(area, write, dtd); - QString s = textTag->tagStr(); + TQString s = textTag->tagStr(); textTag->single = true; if (s.simplifyWhiteSpace().isEmpty()) { @@ -162,7 +162,7 @@ Node* createTextNode(Document *write, Node *node, int eLine, int eCol, Node *par return node; } -Node* createScriptTagNode(Document *write, const AreaStruct &area, const QString &areaName, +Node* createScriptTagNode(Document *write, const AreaStruct &area, const TQString &areaName, const DTDStruct *dtd, Node *parentNode, Node *currentNode) { Tag *tag = new Tag(); @@ -205,7 +205,7 @@ Node* createScriptTagNode(Document *write, const AreaStruct &area, const QString void coutTree(Node *node, int indent) { - QString output; + TQString output; int bLine, bCol, eLine, eCol; if (!node) kdDebug(24000)<< "undoRedo::coutTree() - bad node!" << endl; @@ -238,7 +238,7 @@ void coutTree(Node *node, int indent) void verifyTree(Node *node) { - QString output; + TQString output; int bLine, bCol, eLine, eCol; while (node) { diff --git a/quanta/parsers/parsercommon.h b/quanta/parsers/parsercommon.h index 7a7677ec..9b0c01f4 100644 --- a/quanta/parsers/parsercommon.h +++ b/quanta/parsers/parsercommon.h @@ -18,8 +18,8 @@ #define PARSERCOMMON_H //qt includes -#include <qptrlist.h> -#include <qstringlist.h> +#include <tqptrlist.h> +#include <tqstringlist.h> //own includes #include "tag.h" @@ -30,12 +30,12 @@ class Node; class KDirWatch; namespace ParserCommon{ - extern QStringList includedFiles; - extern QPtrList<const DTDStruct> includedFilesDTD; + extern TQStringList includedFiles; + extern TQPtrList<const DTDStruct> includedFilesDTD; extern KDirWatch *includeWatch; //this methods may go in a common class as well - QString getLine(Document *write, int line, int endLine, int endCol); + TQString getLine(Document *write, int line, int endLine, int endCol); /** Appends a text area to a text node. */ void appendAreaToTextNode(Document *write, const AreaStruct &area, Node *node); /** Creates a text/empty node between node and the provided position */ @@ -47,7 +47,7 @@ namespace ParserCommon{ parentNode: the parent of the node currentNode: the last child of the parent, if it exists */ - Node* createScriptTagNode(Document *write, const AreaStruct &area, const QString &areaName, + Node* createScriptTagNode(Document *write, const AreaStruct &area, const TQString &areaName, const DTDStruct *dtd, Node *parentNode, Node *currentNode); /** Print the doc structure tree to the standard output. diff --git a/quanta/parsers/qtag.cpp b/quanta/parsers/qtag.cpp index 77031eee..46b5b411 100644 --- a/quanta/parsers/qtag.cpp +++ b/quanta/parsers/qtag.cpp @@ -63,8 +63,8 @@ void QTag::addAttribute(Attribute* attr) a = new Attribute; a->name = attr->name; a->type = attr->type; - QStringList::ConstIterator end = attr->values.constEnd(); - for ( QStringList::ConstIterator it = attr->values.constBegin(); it != end; ++it ) + TQStringList::ConstIterator end = attr->values.constEnd(); + for ( TQStringList::ConstIterator it = attr->values.constBegin(); it != end; ++it ) { a->values.append(*it); } @@ -90,7 +90,7 @@ Attribute* QTag::attributeAt(int index) } /** Returns true if the attribute exists */ -bool QTag::isAttribute(const QString &attrName) +bool QTag::isAttribute(const TQString &attrName) { Attribute *a; int i; @@ -129,12 +129,12 @@ void QTag::setOptional(bool isOptional) optional = isOptional; } /** No descriptions */ -void QTag::setName(const QString& theName) +void QTag::setName(const TQString& theName) { tagName = theName; } /** No descriptions */ -QString QTag::name(bool doNotConvert) +TQString QTag::name(bool doNotConvert) { if (doNotConvert || !parentDTD || parentDTD->caseSensitive) return tagName; @@ -152,13 +152,13 @@ bool QTag::isOptional() return optional; } /** No descriptions */ -void QTag::setFileName(const QString& fileName) +void QTag::setFileName(const TQString& fileName) { m_fileName = fileName; } /** No descriptions */ -QString QTag::fileName() +TQString QTag::fileName() { return m_fileName; } @@ -186,7 +186,7 @@ QTag QTag::operator = (QTag &t) } /** Returns the attribute with name, or 0 if the tag does not have any attribute with name. */ -Attribute* QTag::attribute(const QString& name) +Attribute* QTag::attribute(const TQString& name) { Attribute *attr = 0L; for (uint i = 0; i < attrs.count(); i++) @@ -201,9 +201,9 @@ Attribute* QTag::attribute(const QString& name) return attr; } -bool QTag::isChild(const QString& tag, bool trueIfNoChildsDefined) +bool QTag::isChild(const TQString& tag, bool trueIfNoChildsDefined) { - QString tagName = tag; + TQString tagName = tag; tagName = parentDTD->caseSensitive ? tagName : tagName.upper(); if(trueIfNoChildsDefined) return (childTags.isEmpty() || childTags.contains(tagName)); @@ -213,7 +213,7 @@ bool QTag::isChild(const QString& tag, bool trueIfNoChildsDefined) bool QTag::isChild(Node *node, bool trueIfNoChildsDefined, bool treatEmptyNodesAsText) { - QString nodeName; + TQString nodeName; if(!node) return false; @@ -247,10 +247,10 @@ bool QTag::isChild(Node *node, bool trueIfNoChildsDefined, bool treatEmptyNodesA return isChild(node->tag->name, trueIfNoChildsDefined); } -QPtrList<QTag> QTag::parents() +TQPtrList<QTag> QTag::parents() { - QPtrList<QTag> qTagList; - QDictIterator<QTag> it((*parentDTD->tagsList)); + TQPtrList<QTag> qTagList; + TQDictIterator<QTag> it((*parentDTD->tagsList)); for(; it.current(); ++it) { if(it.current()->isChild(name())) diff --git a/quanta/parsers/qtag.h b/quanta/parsers/qtag.h index 6c38c334..89aa1e46 100644 --- a/quanta/parsers/qtag.h +++ b/quanta/parsers/qtag.h @@ -25,11 +25,11 @@ *@author Andras Mantia */ //qt includes -#include <qdict.h> -#include <qmap.h> -#include <qptrlist.h> -#include <qstringlist.h> -#include <qregexp.h> +#include <tqdict.h> +#include <tqmap.h> +#include <tqptrlist.h> +#include <tqstringlist.h> +#include <tqregexp.h> //app includes @@ -38,49 +38,49 @@ class Node; //an attribute of a tag looks like: typedef struct Attribute{ - QString name; - QString type; //"input", "check", "list" - QStringList values; //the possible values it can have - QString defaultValue; //the default value - QString status; // "optional", "required","implied" - QString source; - QString interface; - QString method; - QString arguments; + TQString name; + TQString type; //"input", "check", "list" + TQStringList values; //the possible values it can have + TQString defaultValue; //the default value + TQString status; // "optional", "required","implied" + TQString source; + TQString interface; + TQString method; + TQString arguments; }; class XMLStructGroup { public: - QString name; ///<the name of the group - QString noName; ///<the text when there are no elements in the group - QString icon; ///<the icon of the group - QStringList attributes; ///<the attributes of the above tag to be displayed + TQString name; ///<the name of the group + TQString noName; ///<the text when there are no elements in the group + TQString icon; ///<the icon of the group + TQStringList attributes; ///<the attributes of the above tag to be displayed bool hasFileName; ///<the group contains filename(s) - QRegExp fileNameRx; ///<delete the matches of this regexp to obtain a filename (eg. linked, included file name) + TQRegExp fileNameRx; ///<delete the matches of this regexp to obtain a filename (eg. linked, included file name) bool appendToTags; ///<true if the group elements must be used as normal tags in autocompletion - QString parentGroup; ///<if the group element can be a child of another group (eg. member function of a class), holds the parent name. Makes sense only if appentToTags is true + TQString parentGroup; ///<if the group element can be a child of another group (eg. member function of a class), holds the parent name. Makes sense only if appentToTags is true }; //the groups in structure tree are defined with the help of: class StructTreeGroup:public XMLStructGroup { public: - QRegExp definitionRx; //regular expression to help us find the group element definition - for pseudo DTDs - QRegExp usageRx; //regexp to find the usage of a group element in the document + TQRegExp definitionRx; //regular expression to help us find the group element definition - for pseudo DTDs + TQRegExp usageRx; //regexp to find the usage of a group element in the document bool hasDefinitionRx; //true if searchRx should be used bool isMinimalDefinitionRx; // true if the searchRx should be non-greedy - QRegExp typeRx; //regular expression to help us find the group element type from the definition string - for pseudo DTDs + TQRegExp typeRx; //regular expression to help us find the group element type from the definition string - for pseudo DTDs int tagType; //the tag type for which this is valid - QRegExp autoCompleteAfterRx; //holds the char after the autocompletion box should be shown for this group elements. Null, if autocompletion shouldn't be used - QRegExp removeFromAutoCompleteWordRx; + TQRegExp autoCompleteAfterRx; //holds the char after the autocompletion box should be shown for this group elements. Null, if autocompletion shouldn't be used + TQRegExp removeFromAutoCompleteWordRx; bool parseFile; //parse the files belonging to this group }; -typedef QPtrList<Attribute> AttributeList; -typedef QDict<AttributeList> AttributeListDict; +typedef TQPtrList<Attribute> AttributeList; +typedef TQDict<AttributeList> AttributeListDict; -typedef QDict<QTag> QTagList; +typedef TQDict<QTag> QTagList; enum DTDFamily{Unknown = 0, Xml, Script}; @@ -89,27 +89,27 @@ enum DTDFamily{Unknown = 0, Xml, Script}; //an internal representation of a DTD typedef struct DTDStruct { - QString name; ///< DTD name - QString nickName; ///< DTD nickname + TQString name; ///< DTD name + TQString nickName; ///< DTD nickname bool loaded; ///< true = DTD is complet in memory - QString url; ///< the url of the DTD definition file - QString doctypeStr; ///< the string that appears right after !doctype - QString inheritsTagsFrom; ///< Inherited DTD name - QString defaultExtension; ///< default extension when creating new files - QStringList mimeTypes; + TQString url; ///< the url of the DTD definition file + TQString doctypeStr; ///< the string that appears right after !doctype + TQString inheritsTagsFrom; ///< Inherited DTD name + TQString defaultExtension; ///< default extension when creating new files + TQStringList mimeTypes; bool caseSensitive; ///< the tags&attributes in DTD are case sensitive or not int family; ///< xml, script type bool toplevel; ///< true if the DTD can be the main DTD of a document. Always true for XML like DTD's - QString documentation; ///< the name of the documentation package + TQString documentation; ///< the name of the documentation package QTagList* tagsList; ///< the list of all defined tags in the DTD - QString fileName; ///< the DTD decription.rc with path + TQString fileName; ///< the DTD decription.rc with path AttributeListDict* commonAttrs; ///< the attributes of the common groups - QString booleanAttributes; ///< simple or extended <tag booleanAttr> or <tag booleanAttr="1"> - QString booleanTrue; ///< "true" or "1" or whatever - QString booleanFalse; ///< "false" or "0" or whatever - QString singleTagStyle; ///< "xml" or "html" (<tag/> or <tag>) - QString defaultAttrType; ///< "input", "string" or whatever + TQString booleanAttributes; ///< simple or extended <tag booleanAttr> or <tag booleanAttr="1"> + TQString booleanTrue; ///< "true" or "1" or whatever + TQString booleanFalse; ///< "false" or "0" or whatever + TQString singleTagStyle; ///< "xml" or "html" (<tag/> or <tag>) + TQString defaultAttrType; ///< "input", "string" or whatever /****************** FOR THE NEW PARSER **********************/ @@ -122,18 +122,18 @@ typedef struct DTDStruct /* The starting and closing strings of a special area. For PHP the special areas are <? ?> and <* *>, so the entries are (<?,?>),(<*,*>). */ - QMap<QString, QString> specialAreas; + TQMap<TQString, TQString> specialAreas; /* To which DTD this special area belongs. It may be a non-dtd name, like "comment", which is treated as a special case. Entries are in for of (<?,php) or (<!--,comment). */ - QMap<QString, QString> specialAreaNames; + TQMap<TQString, TQString> specialAreaNames; /* A regular expression which matches the starting strings of all the possible special areas. */ - mutable QRegExp specialAreaStartRx; + mutable TQRegExp specialAreaStartRx; /* For each special tag name, holds an attribute name. This attribute is used to figure out the DTD which is valid in the special tag area. @@ -141,7 +141,7 @@ typedef struct DTDStruct Special tags are skipped during parsing and parsed later according to their DTD definition. */ - QMap<QString, QString> specialTags; + TQMap<TQString, TQString> specialTags; /* A list of DTDs that can be present inside the DTD. For each DTD specified here the definitionAreaBegin/definitionAreaEnd is @@ -150,58 +150,58 @@ typedef struct DTDStruct Basically this means that we use the DTD definitions when building the special area and tag definitions. */ - QStringList insideDTDs; + TQStringList insideDTDs; /* The definition tags for this DTD in the same for as the above. */ - QMap<QString, QString> definitionTags; + TQMap<TQString, TQString> definitionTags; /* The beginning and end string of the definition areas for this DTD. It is stored in (area_begin_str,area_end_str) pairs. E.g (<?,?>) */ - QMap<QString, QString> definitionAreas; + TQMap<TQString, TQString> definitionAreas; /* Start/end pairs for comments. Eg. (//,\n); (<!--,-->) */ - QMap<QString, QString> comments; + TQMap<TQString, TQString> comments; /* Regular expression to match the start of the comments (//, <!--)*/ - mutable QRegExp commentsStartRx; + mutable TQRegExp commentsStartRx; /* How does a structure starts in this DTD. Eg. "{" or "begin".*/ - QString structBeginStr; + TQString structBeginStr; /* How does a structure ends in this DTD. Eg. "}" or "end".*/ - QString structEndStr; + TQString structEndStr; /* A regular expression to match the structe begin or end. */ - mutable QRegExp structRx; + mutable TQRegExp structRx; /* Regular expression to match the possible keywords that can appear before a structure, like "function", "for", etc. */ - mutable QRegExp structKeywordsRx; + mutable TQRegExp structKeywordsRx; /* Regular expression containing the keywords that indicate that the groups defined in the structure after the keyword have local scope */ - mutable QRegExp localScopeKeywordsRx; + mutable TQRegExp localScopeKeywordsRx; /* A list of structure tree groups definition */ - mutable QValueList<StructTreeGroup> structTreeGroups; - QMap<QString, XMLStructGroup> xmlStructTreeGroups; + mutable TQValueList<StructTreeGroup> structTreeGroups; + TQMap<TQString, XMLStructGroup> xmlStructTreeGroups; /****************** END FOR THE NEW PARSER **********************/ - QStringList toolbars; + TQStringList toolbars; /* True if foo-foo2 should be considered as one word. False (default) otherwise. */ bool minusAllowedInWord; - mutable QChar tagAutoCompleteAfter; + mutable TQChar tagAutoCompleteAfter; bool requestSpaceBeforeTagAutoCompletion; - QChar attrAutoCompleteAfter; - QChar attributeSeparator; - QChar tagSeparator; + TQChar attrAutoCompleteAfter; + TQChar attributeSeparator; + TQChar tagSeparator; /* Script language related items */ int variableGroupIndex; ///< the index of the structure tree group holding the variables. -1 if there is no such group. int functionGroupIndex; ///< the index of the structure tree group holding the functions. -1 if there is no such group. int classGroupIndex; ///< the index of the structure tree group holding the classes. -1 if there is no such group. int objectGroupIndex; ///< the index of the structure tree group holding the classes. -1 if there is no such group. - mutable QRegExp memberAutoCompleteAfter; ///< the regular expression after which a list with the existing member methods and variables for a class should be shown. Makes sense only if the language supports classes. - QMap<QString, QString> classInheritance; ///<stores the inheritance tree + mutable TQRegExp memberAutoCompleteAfter; ///< the regular expression after which a list with the existing member methods and variables for a class should be shown. Makes sense only if the language supports classes. + TQMap<TQString, TQString> classInheritance; ///<stores the inheritance tree }; @@ -219,15 +219,15 @@ public: Attribute* attributeAt(int index); AttributeList *attributes() { return &attrs;} /** Returns true if the attribute exists */ - bool isAttribute(const QString &attrName); + bool isAttribute(const TQString &attrName); /** No descriptions */ void setSingle(bool isSingle); /** No descriptions */ void setOptional(bool isOptional); /** No descriptions */ - void setName(const QString& theName); + void setName(const TQString& theName); /** No descriptions */ - QString name(bool doNotConvert = false); + TQString name(bool doNotConvert = false); /** No descriptions */ bool isSingle(); /** No descriptions */ @@ -239,44 +239,44 @@ public: * the scope is a "word", i.e., the whole word will be affected by the action. * Instead, if center is pressed, all surrounding inline nodes will be affected by the new tag. */ - QString const& scope() const {return m_scope;} - void setScope(QString const& scope) {m_scope = scope;} + TQString const& scope() const {return m_scope;} + void setScope(TQString const& scope) {m_scope = scope;} /** Returns true if tag is a possible child of this tag, or if there are no children defined and if trueIfNoChildsDefined is set to true. */ - bool isChild(const QString& tag, bool trueIfNoChildsDefined = true); + bool isChild(const TQString& tag, bool trueIfNoChildsDefined = true); //prefer using this variant, it handle Text, Empty, XmlTagEnd nodes! bool isChild(Node *node, bool trueIfNoChildsDefined = true, bool treatEmptyNodesAsText = false); /*** Returns the list of parent of this tag. */ - QPtrList<QTag> parents(); + TQPtrList<QTag> parents(); /** No descriptions */ - QString fileName(); + TQString fileName(); /** No descriptions */ - void setFileName(const QString& fileName); + void setFileName(const TQString& fileName); /** Returns the attribute with name, or 0 if the tag does not have any attribute with name. */ - Attribute* attribute(const QString& name); + Attribute* attribute(const TQString& name); /** The tag belongs to this DTD */ const DTDStruct *parentDTD; /** The tag has the attributes of the above common groups */ - QStringList commonGroups; - QStringList stoppingTags; - QMap<QString, bool> childTags; ///<list of the possible child tags. If the value is true, the child is mandatory - QString type; ///<function, class, xmltag, etc. - QString returnType; ///<useful is type="function"; may be int, string or whatever - QString className; ///< the name of the class where the tag belongs to. Used only for script DTEP tags - QString comment; ///< comment associated to the tag. Will appear as a tooltip in the autocompletion box. Useful for specifying version information (eg. since PHP5) + TQStringList commonGroups; + TQStringList stoppingTags; + TQMap<TQString, bool> childTags; ///<list of the possible child tags. If the value is true, the child is mandatory + TQString type; ///<function, class, xmltag, etc. + TQString returnType; ///<useful is type="function"; may be int, string or whatever + TQString className; ///< the name of the class where the tag belongs to. Used only for script DTEP tags + TQString comment; ///< comment associated to the tag. Will appear as a tooltip in the autocompletion box. Useful for specifying version information (eg. since PHP5) protected: // Protected attributes /** List of the possible attributes */ AttributeList attrs; bool single; bool optional; - QString tagName; - QString m_scope; + TQString tagName; + TQString m_scope; /** The path to the tag file. Null if there is no tag file for the tag. */ - QString m_fileName; + TQString m_fileName; }; diff --git a/quanta/parsers/sagroupparser.cpp b/quanta/parsers/sagroupparser.cpp index 77698a45..6e409509 100644 --- a/quanta/parsers/sagroupparser.cpp +++ b/quanta/parsers/sagroupparser.cpp @@ -14,8 +14,8 @@ * * ***************************************************************************/ //qt includes -#include <qtimer.h> -#include <qvaluelist.h> +#include <tqtimer.h> +#include <tqvaluelist.h> //kde includes #include <kdebug.h> @@ -45,8 +45,8 @@ SAGroupParser::SAGroupParser(SAParser *parent, Document *write, Node *startNode, m_parent = parent; m_write = write; m_count = 0; - m_parseForGroupTimer = new QTimer(this); - connect(m_parseForGroupTimer, SIGNAL(timeout()), this, SLOT(slotParseForScriptGroup())); + m_parseForGroupTimer = new TQTimer(this); + connect(m_parseForGroupTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotParseForScriptGroup())); } void SAGroupParser::slotParseForScriptGroup() @@ -106,23 +106,23 @@ void SAGroupParser::slotParseForScriptGroup() void SAGroupParser::parseForScriptGroup(Node *node) { #ifdef DEBUG_PARSER - QTime t; + TQTime t; t.start(); #endif int bl, bc, el, ec; int pos; - QString title; - QString tmpStr; + TQString title; + TQString tmpStr; StructTreeGroup group; GroupElement *groupElement; GroupElementList* groupElementList; KURL baseURL = QExtFileInfo::path(m_write->url()); - QString str = node->tag->cleanStr; - QString tagStr = node->tag->tagStr(); + TQString str = node->tag->cleanStr; + TQString tagStr = node->tag->tagStr(); const DTDStruct* dtd = node->tag->dtd(); node->tag->beginPos(bl, bc); - QValueList<StructTreeGroup>::ConstIterator it; + TQValueList<StructTreeGroup>::ConstIterator it; for (it = dtd->structTreeGroups.begin(); it != dtd->structTreeGroups.end(); ++it) { group = *it; @@ -158,7 +158,7 @@ void SAGroupParser::parseForScriptGroup(Node *node) //have the same title. For example get the list of all group //element which are variable and the matched string was "$i" int cap1Pos = str.find(group.definitionRx.cap(1)); - QString s = tagStr.mid(cap1Pos, group.definitionRx.cap(1).length()); + TQString s = tagStr.mid(cap1Pos, group.definitionRx.cap(1).length()); groupElementList = & (globalGroupMap[group.name + "|" + s]); //Create a new tag which point to the exact location of the matched string. //For example when the group defined PHP variables it @@ -228,14 +228,14 @@ void SAGroupParser::parseForScriptGroup(Node *node) if(qTag->className.length() != 0 && tagStr.contains('(') && tagStr.contains(')')) { // First we want to determine the whole line the tag is on - QString tagWholeLineStr = tagStr; + TQString tagWholeLineStr = tagStr; // Remove lines before target line while(tagWholeLineStr.length() > 0) // this stops infinit looping in case something goes wrong! { int firstNewline = tagWholeLineStr.find('\n'); if(firstNewline == -1) //no new lines so we must be on the last break; - QString checkLineStr = tagWholeLineStr.mid(firstNewline+1,tagWholeLineStr.length()); + TQString checkLineStr = tagWholeLineStr.mid(firstNewline+1,tagWholeLineStr.length()); if(checkLineStr.contains(s)) tagWholeLineStr = checkLineStr; else @@ -247,7 +247,7 @@ void SAGroupParser::parseForScriptGroup(Node *node) int lastNewLine = tagWholeLineStr.findRev('\n'); if(lastNewLine == -1) break; - QString checkLineStr = tagWholeLineStr.mid(0,lastNewLine); + TQString checkLineStr = tagWholeLineStr.mid(0,lastNewLine); if(checkLineStr.contains(s)) tagWholeLineStr = checkLineStr; else diff --git a/quanta/parsers/sagroupparser.h b/quanta/parsers/sagroupparser.h index 1f2f184c..6cc15311 100644 --- a/quanta/parsers/sagroupparser.h +++ b/quanta/parsers/sagroupparser.h @@ -18,7 +18,7 @@ #define SAGROUPPARSER_H //qt includes -#include <qobject.h> +#include <tqobject.h> //forward definitions class QTimer; @@ -37,7 +37,7 @@ public: SAGroupParser(SAParser *parent, Document *write, Node *startNode, Node *endNode, bool synchronous, bool parsingLastNode, bool paringLastGroup); ~SAGroupParser() {}; - QTimer *m_parseForGroupTimer; + TQTimer *m_parseForGroupTimer; public slots: void slotParseForScriptGroup(); diff --git a/quanta/parsers/saparser.cpp b/quanta/parsers/saparser.cpp index 230ddbe0..f402e0c8 100644 --- a/quanta/parsers/saparser.cpp +++ b/quanta/parsers/saparser.cpp @@ -15,7 +15,7 @@ ***************************************************************************/ //qt includes -#include <qtimer.h> +#include <tqtimer.h> //kde includes #include <kdebug.h> @@ -39,14 +39,14 @@ SAParser::SAParser() m_write = 0L; m_baseNode = 0L; m_currentNode = 0L; - m_quotesRx = QRegExp("\"|'"); + m_quotesRx = TQRegExp("\"|'"); m_specialInsideXml = false; m_parsingEnabled = true; m_synchronous = true; - m_parseOneLineTimer = new QTimer(this); - connect(m_parseOneLineTimer, SIGNAL(timeout()), this, SLOT(slotParseOneLine())); - m_parseInDetailTimer = new QTimer(this); - connect(m_parseInDetailTimer, SIGNAL(timeout()), this, SLOT(slotParseNodeInDetail())); + m_parseOneLineTimer = new TQTimer(this); + connect(m_parseOneLineTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotParseOneLine())); + m_parseInDetailTimer = new TQTimer(this); + connect(m_parseInDetailTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotParseNodeInDetail())); } SAParser::~SAParser() @@ -143,7 +143,7 @@ bool SAParser::slotParseOneLine() if ( (groupKeywordPos < specialAreaPos || specialAreaPos == -1) && (groupKeywordPos < areaEndPos || areaEndPos == -1) ) { - QString foundText = s_dtd->structRx.cap(); + TQString foundText = s_dtd->structRx.cap(); if (foundText == s_dtd->structBeginStr) { s_context.type = Group; @@ -201,7 +201,7 @@ bool SAParser::slotParseOneLine() } s_currentContext.area.eLine = s_line; s_currentContext.area.eCol = groupKeywordPos - 1; - //kdDebug(24000) << QString("Group Struct s_context: %1, %2, %3, %4").arg( s_currentContext.bLine).arg(s_currentContext.bCol).arg(s_currentContext.eLine).arg(s_currentContext.eCol) << endl; + //kdDebug(24000) << TQString("Group Struct s_context: %1, %2, %3, %4").arg( s_currentContext.bLine).arg(s_currentContext.bCol).arg(s_currentContext.eLine).arg(s_currentContext.eCol) << endl; if (s_currentNode && (s_currentNode->tag->type == Tag::Text || @@ -265,7 +265,7 @@ bool SAParser::slotParseOneLine() { if (specialAreaPos < areaEndPos || areaEndPos == -1) { - QString foundText = s_dtd->specialAreaStartRx.cap(); + TQString foundText = s_dtd->specialAreaStartRx.cap(); s_currentContext.area.eLine = s_line; s_currentContext.area.eCol = specialAreaPos - 1; if (s_fullParse) @@ -351,7 +351,7 @@ bool SAParser::slotParseOneLine() s_currentNode->specialInsideXml = m_specialInsideXml; } } - //kdDebug(24000) << QString("Special area %1 ends at %2, %3").arg(s_dtd->name).arg(s_line).arg(lastCol) << endl; + //kdDebug(24000) << TQString("Special area %1 ends at %2, %3").arg(s_dtd->name).arg(s_line).arg(lastCol) << endl; //create a closing node for the special area Tag *tag = new Tag(); @@ -396,9 +396,9 @@ bool SAParser::slotParseOneLine() } } SAGroupParser *groupParser = new SAGroupParser(this, write(), g_node, g_endNode, m_synchronous, parsingLastNode, true); - connect(groupParser, SIGNAL(rebuildStructureTree(bool)), SIGNAL(rebuildStructureTree(bool))); - connect(groupParser, SIGNAL(cleanGroups()), SIGNAL(cleanGroups())); - connect(groupParser, SIGNAL(parsingDone(SAGroupParser*)), SLOT(slotGroupParsingDone(SAGroupParser*))); + connect(groupParser, TQT_SIGNAL(rebuildStructureTree(bool)), TQT_SIGNAL(rebuildStructureTree(bool))); + connect(groupParser, TQT_SIGNAL(cleanGroups()), TQT_SIGNAL(cleanGroups())); + connect(groupParser, TQT_SIGNAL(parsingDone(SAGroupParser*)), TQT_SLOT(slotGroupParsingDone(SAGroupParser*))); groupParser->slotParseForScriptGroup(); m_groupParsers.append(groupParser); } @@ -439,7 +439,7 @@ bool SAParser::slotParseOneLine() { //create a tag from the s_currentContext Tag *tag = new Tag(s_currentContext.area, m_write, s_dtd); - QString tagStr = tag->tagStr(); + TQString tagStr = tag->tagStr(); tag->cleanStr = tagStr; QuantaCommon::removeCommentsAndQuotes(tag->cleanStr, s_dtd); if (tagStr.simplifyWhiteSpace().isEmpty()) @@ -468,7 +468,7 @@ bool SAParser::slotParseOneLine() s_currentNode = node; } } - //kdDebug(24000) << QString("%1 s_context: %2, %3, %4, %5").arg(s_currentContext.type).arg( s_currentContext.bLine).arg(s_currentContext.bCol).arg(s_currentContext.eLine).arg(s_currentContext.eCol) << endl; + //kdDebug(24000) << TQString("%1 s_context: %2, %3, %4, %5").arg(s_currentContext.type).arg( s_currentContext.bLine).arg(s_currentContext.bCol).arg(s_currentContext.eLine).arg(s_currentContext.eCol) << endl; s_currentContext = s_context; s_col = s_context.area.bCol + s_context.startString.length(); @@ -514,7 +514,7 @@ bool SAParser::slotParseOneLine() // if (pos != 0) pos++; s_currentContext.area.eLine = s_line; s_currentContext.area.eCol = pos; - //kdDebug(24000) << QString("Quoted String s_context: %1, %2, %3, %4").arg( s_currentContext.bLine).arg(s_currentContext.bCol).arg(s_currentContext.eLine).arg(s_currentContext.eCol) << endl; + //kdDebug(24000) << TQString("Quoted String s_context: %1, %2, %3, %4").arg( s_currentContext.bLine).arg(s_currentContext.bCol).arg(s_currentContext.eLine).arg(s_currentContext.eCol) << endl; if (s_fullParse) { if ( s_currentNode && @@ -561,7 +561,7 @@ bool SAParser::slotParseOneLine() s_currentContext.area.eLine = s_line; s_currentContext.area.eCol = pos + s_dtd->comments[s_currentContext.startString].length() - 1; s_currentContext.type = s_previousContext.type; - //kdDebug(24000) << QString("Comment s_context: %1, %2, %3, %4").arg( s_currentContext.bLine).arg(s_currentContext.bCol).arg(s_currentContext.eLine).arg(s_currentContext.eCol) << endl; + //kdDebug(24000) << TQString("Comment s_context: %1, %2, %3, %4").arg( s_currentContext.bLine).arg(s_currentContext.bCol).arg(s_currentContext.eLine).arg(s_currentContext.eCol) << endl; if (s_fullParse) { @@ -633,8 +633,8 @@ bool SAParser::slotParseOneLine() } Node* SAParser::parseArea(const AreaStruct &specialArea, - const QString &areaStartString, - const QString &forcedAreaEndString, + const TQString &areaStartString, + const TQString &forcedAreaEndString, Node *parentNode, bool fullParse, bool synchronous) { @@ -649,7 +649,7 @@ Node* SAParser::parseArea(const AreaStruct &specialArea, int s_startCol = specialArea.bCol; s_endLine = specialArea.eLine; s_endCol = specialArea.eCol; - //kdDebug(24000) << QString("Starting to parse at %1, %2 for %3").arg(s_startLine).arg(s_startCol).arg(areaStartString) << endl; + //kdDebug(24000) << TQString("Starting to parse at %1, %2 for %3").arg(s_startLine).arg(s_startCol).arg(areaStartString) << endl; s_searchForAreaEnd = false; s_searchForForcedAreaEnd = false; @@ -818,9 +818,9 @@ Node *SAParser::parsingDone() if (!m_synchronous) { SAGroupParser *groupParser = new SAGroupParser(this, write(), g_node, 0L, m_synchronous, true /*last node*/, true); - connect(groupParser, SIGNAL(rebuildStructureTree(bool)), SIGNAL(rebuildStructureTree(bool))); - connect(groupParser, SIGNAL(cleanGroups()), SIGNAL(cleanGroups())); - connect(groupParser, SIGNAL(parsingDone(SAGroupParser*)), SLOT(slotGroupParsingDone(SAGroupParser*))); + connect(groupParser, TQT_SIGNAL(rebuildStructureTree(bool)), TQT_SIGNAL(rebuildStructureTree(bool))); + connect(groupParser, TQT_SIGNAL(cleanGroups()), TQT_SIGNAL(cleanGroups())); + connect(groupParser, TQT_SIGNAL(parsingDone(SAGroupParser*)), TQT_SLOT(slotGroupParsingDone(SAGroupParser*))); groupParser->slotParseForScriptGroup(); m_groupParsers.append(groupParser); } @@ -925,7 +925,7 @@ void SAParser::slotParseNodeInDetail() #ifdef DEBUG_PARSER kdDebug(24001) << "Calling parseArea from slotParseNodeInDetail." << endl; #endif - QString areaStartString = m_currentNode->tag->tagStr(); + TQString areaStartString = m_currentNode->tag->tagStr(); if (m_currentNode->tag->dtd()->specialAreaNames[areaStartString].isEmpty()) { AreaStruct area2(m_currentNode->tag->area()); @@ -967,7 +967,7 @@ void SAParser::setParsingEnabled(bool enabled) { m_parseOneLineTimer->stop(); m_parseInDetailTimer->stop(); - for (QValueList<SAGroupParser*>::Iterator it = m_groupParsers.begin(); it != m_groupParsers.end(); ++it) + for (TQValueList<SAGroupParser*>::Iterator it = m_groupParsers.begin(); it != m_groupParsers.end(); ++it) { (*it)->m_parseForGroupTimer->stop(); delete (*it); diff --git a/quanta/parsers/saparser.h b/quanta/parsers/saparser.h index 50c3dd41..c59a01bc 100644 --- a/quanta/parsers/saparser.h +++ b/quanta/parsers/saparser.h @@ -18,9 +18,9 @@ #define SAPARSER_H //qt includes -#include <qobject.h> -#include <qregexp.h> -#include <qvaluestack.h> +#include <tqobject.h> +#include <tqregexp.h> +#include <tqvaluestack.h> //own includes #include "tag.h" //for AreaStruct @@ -63,8 +63,8 @@ public: return value: in synchronous case returns the last inserted node, otherwise return 0L. */ Node* parseArea(const AreaStruct &specialArea, - const QString &areaStartString, - const QString &forcedAreaEndString, + const TQString &areaStartString, + const TQString &forcedAreaEndString, Node *parentNode, bool fullParse, bool synchronous); /** Returns the line where the last parsing run ended. */ @@ -95,7 +95,7 @@ private: struct ContextStruct{ int type; AreaStruct area; - QString startString; + TQString startString; Node *parentNode; Node *lastNode; }; @@ -117,34 +117,34 @@ private: Node* m_currentNode; ///< the currently parsed script node for details. Changes only after the whole area between m_currentNode and m_currentNode->next is parsed. int m_lastParsedLine, m_lastParsedCol; const DTDStruct *m_dtd; - QRegExp m_quotesRx; + TQRegExp m_quotesRx; bool m_specialInsideXml; //< true if the special area is defined inside a tag, like the PHP in <a href="<? echo $a ?>"> bool s_contextFound; ContextStruct s_currentContext; Node *s_parentNode; bool s_searchContent; - QString s_searchedString; - QString s_textLine; + TQString s_searchedString; + TQString s_textLine; int s_line, s_col; int s_endLine, s_endCol; bool s_fullParse; - QString s_areaEndString; + TQString s_areaEndString; bool s_searchForAreaEnd; bool s_searchForForcedAreaEnd; - QRegExp s_forcedAreaRx; + TQRegExp s_forcedAreaRx; const DTDStruct *s_dtd; bool s_searchForSpecialAreas; ContextStruct s_context; - QValueStack<ContextStruct> s_contextStack; + TQValueStack<ContextStruct> s_contextStack; ContextStruct s_previousContext; Node *s_currentNode; ///< the current detailed node while parsing for details Node *s_returnNode; bool s_useReturnVars; Node *s_next; - QValueList<SAGroupParser*> m_groupParsers; - QTimer *m_parseOneLineTimer; - QTimer *m_parseInDetailTimer; + TQValueList<SAGroupParser*> m_groupParsers; + TQTimer *m_parseOneLineTimer; + TQTimer *m_parseInDetailTimer; }; #endif diff --git a/quanta/parsers/tag.cpp b/quanta/parsers/tag.cpp index 8a1921db..54779d57 100644 --- a/quanta/parsers/tag.cpp +++ b/quanta/parsers/tag.cpp @@ -15,10 +15,10 @@ #include <ctype.h> -#include <qdict.h> -#include <qstring.h> -#include <qcstring.h> -#include <qdom.h> +#include <tqdict.h> +#include <tqstring.h> +#include <tqcstring.h> +#include <tqdom.h> #include <kdebug.h> @@ -31,7 +31,7 @@ #include "node.h" -void TagAttr::save(QDomElement& element) const +void TagAttr::save(TQDomElement& element) const { element.setAttribute("name", name); // QString element.setAttribute("value", value); // QString @@ -43,16 +43,16 @@ void TagAttr::save(QDomElement& element) const element.setAttribute("special", special); // bool } -bool TagAttr::load(QDomElement const& element) +bool TagAttr::load(TQDomElement const& element) { name = element.attribute("name"); value = element.attribute("value"); - nameLine = QString(element.attribute("nameLine")).toInt(); - nameCol = QString(element.attribute("nameCol")).toInt(); - valueLine = QString(element.attribute("valueLine")).toInt(); - valueCol = QString(element.attribute("valueCol")).toInt(); - quoted = QString(element.attribute("quoted")).toInt(); - special = QString(element.attribute("special")).toInt(); + nameLine = TQString(element.attribute("nameLine")).toInt(); + nameCol = TQString(element.attribute("nameCol")).toInt(); + valueLine = TQString(element.attribute("valueLine")).toInt(); + valueCol = TQString(element.attribute("valueCol")).toInt(); + quoted = TQString(element.attribute("quoted")).toInt(); + special = TQString(element.attribute("special")).toInt(); return true; } @@ -66,7 +66,7 @@ Tag::Tag() Tag::Tag(const AreaStruct &area, Document *write, const DTDStruct *dtd, bool doParse) { init(); - QString s = write->text(area); + TQString s = write->text(area); m_area = area; m_dtd = dtd; if (doParse) @@ -125,7 +125,7 @@ void Tag::init() m_notInTree = false; } -void Tag::save(QDomElement& element) const +void Tag::save(TQDomElement& element) const { element.setAttribute("name", name); // QString element.setAttribute("nameSpace", nameSpace); // QString @@ -141,10 +141,10 @@ void Tag::save(QDomElement& element) const element.setAttribute("nameLine", m_nameLine); // int element.setAttribute("nameCol", m_nameCol); // int - QValueList<TagAttr>::const_iterator it; + TQValueList<TagAttr>::const_iterator it; for (it = attrs.begin(); it != attrs.end(); ++it) { - QDomElement child_element = element.ownerDocument().createElement("tagAttr"); + TQDomElement child_element = element.ownerDocument().createElement("tagAttr"); element.appendChild(child_element); (*it).save(child_element); } @@ -152,28 +152,28 @@ void Tag::save(QDomElement& element) const element.setAttribute("tagStr", m_tagStr); // QString } -bool Tag::load(QDomElement const& element) +bool Tag::load(TQDomElement const& element) { name = element.attribute("name"); // QString nameSpace = element.attribute("nameSpace"); // QString cleanStr = element.attribute("cleanStr"); // QString - type = QString(element.attribute("type")).toInt(); // int - single = QString(element.attribute("single")).toInt(); // bool - closingMissing = QString(element.attribute("closingMissing")).toInt(); // bool + type = TQString(element.attribute("type")).toInt(); // int + single = TQString(element.attribute("single")).toInt(); // bool + closingMissing = TQString(element.attribute("closingMissing")).toInt(); // bool structBeginStr = element.attribute("structBeginStr"); // QString - validXMLTag = QString(element.attribute("validXMLTag")).toInt(); // bool - m_cleanStrBuilt = QString(element.attribute("cleanStrBuilt")).toInt(); // bool - m_indentationDone = QString(element.attribute("indentationDone")).toInt(); // bool - m_notInTree = QString(element.attribute("notInTree")).toInt(); // bool - m_nameLine = QString(element.attribute("nameLine")).toInt(); // int - m_nameCol = QString(element.attribute("nameCol")).toInt(); // int - - QDomNodeList list = element.childNodes(); + validXMLTag = TQString(element.attribute("validXMLTag")).toInt(); // bool + m_cleanStrBuilt = TQString(element.attribute("cleanStrBuilt")).toInt(); // bool + m_indentationDone = TQString(element.attribute("indentationDone")).toInt(); // bool + m_notInTree = TQString(element.attribute("notInTree")).toInt(); // bool + m_nameLine = TQString(element.attribute("nameLine")).toInt(); // int + m_nameCol = TQString(element.attribute("nameCol")).toInt(); // int + + TQDomNodeList list = element.childNodes(); for (unsigned int i = 0; i != list.count(); ++i) { if (list.item(i).isElement()) { - QDomElement e = list.item(i).toElement(); + TQDomElement e = list.item(i).toElement(); if (e.tagName() == "tagAttr") { TagAttr tag_attr; @@ -188,7 +188,7 @@ bool Tag::load(QDomElement const& element) return true; } -void Tag::parse(const QString &p_tagStr, Document *p_write) +void Tag::parse(const TQString &p_tagStr, Document *p_write) { attrs.clear(); m_tagStr = p_tagStr; @@ -216,7 +216,7 @@ void Tag::parse(const QString &p_tagStr, Document *p_write) name = name.mid(++nameSpacePos); m_nameCol += nameSpacePos; } - QString attrStr; + TQString attrStr; TagAttr attr; attr.special = false; //by default non of the attributes are special while (pos < strLength && m_tagStr[pos].isSpace()) @@ -242,7 +242,7 @@ void Tag::parse(const QString &p_tagStr, Document *p_write) attr.nameCol = sPos + m_area.bCol; else attr.nameCol = m_tagStr.left(sPos).section('\n',-1).length(); - attr.value = (m_dtd != 0) ? m_dtd->booleanTrue : QString("checked"); + attr.value = (m_dtd != 0) ? m_dtd->booleanTrue : TQString("checked"); attr.valueCol = attr.nameCol; attr.valueLine = attr.nameLine; attr.quoted = false; @@ -264,7 +264,7 @@ void Tag::parse(const QString &p_tagStr, Document *p_write) //treate it as a "true" boolean if (m_tagStr[pos] != '=' || pos == strLength) { - attr.value = (m_dtd != 0) ? m_dtd->booleanTrue : QString("checked"); + attr.value = (m_dtd != 0) ? m_dtd->booleanTrue : TQString("checked"); attr.valueCol = attr.nameCol; attr.valueLine = attr.nameLine; attr.quoted = false; @@ -278,7 +278,7 @@ void Tag::parse(const QString &p_tagStr, Document *p_write) { attr.quoted = true; valueStartPos = pos + 1; - QChar quotation = m_tagStr[pos]; + TQChar quotation = m_tagStr[pos]; pos += 1; while (pos < strLength && (m_tagStr[pos] != quotation || @@ -316,8 +316,8 @@ void Tag::parse(const QString &p_tagStr, Document *p_write) //add the tag to the document usertag list if it's not present in the dtd if (m_tagStr.startsWith("<") && m_tagStr.endsWith(">") && m_dtd) { - //QString tagName = (m_parsingDTD->caseSensitive) ? name : name.upper(); - QString tagName = name.lower(); + //TQString tagName = (m_parsingDTD->caseSensitive) ? name : name.upper(); + TQString tagName = name.lower(); //add the new xml tags to the userTagList if ( !QuantaCommon::isKnownTag(m_dtd->name, tagName) && name[0] != '/' ) @@ -347,9 +347,9 @@ void Tag::parse(const QString &p_tagStr, Document *p_write) } -QString Tag::attribute(int index) +TQString Tag::attribute(int index) { - QString attr=""; + TQString attr=""; if ( index != -1 && index < (int)attrs.count() ) { attr = attrs[index].name; @@ -357,9 +357,9 @@ QString Tag::attribute(int index) return attr; } -QString Tag::attributeValue(int index) +TQString Tag::attributeValue(int index) { - QString val = ""; + TQString val = ""; if ( index != -1 && index < (int)attrs.count() ) { val = attrs[index].value; @@ -367,9 +367,9 @@ QString Tag::attributeValue(int index) return val; } -QString Tag::attributeValue(const QString &attr, bool ignoreCase) +TQString Tag::attributeValue(const TQString &attr, bool ignoreCase) { - QString val = ""; + TQString val = ""; for (uint i = 0 ; i < attrs.count(); i++) { @@ -384,7 +384,7 @@ QString Tag::attributeValue(const QString &attr, bool ignoreCase) } /** Check if this tag has the attr attribute defined */ -bool Tag::hasAttribute(const QString &attr, bool ignoreCase) +bool Tag::hasAttribute(const TQString &attr, bool ignoreCase) { for (uint i = 0; i < attrs.count(); i++) { @@ -424,7 +424,7 @@ void Tag::setTagPosition(const AreaStruct &area) } /** Return the index of attr. */ -int Tag::attributeIndex(const QString &attr) +int Tag::attributeIndex(const TQString &attr) { int index = -1; uint i = 0; @@ -483,7 +483,7 @@ void Tag::namePos(int &line, int &col) col = m_nameCol; } -void Tag::setStr(const QString &p_tagStr) +void Tag::setStr(const TQString &p_tagStr) { m_tagStr = p_tagStr; cleanStr = m_tagStr; } @@ -520,7 +520,7 @@ void Tag::attributeValuePos(int index, int &line, int &col) } } -bool Tag::editAttribute(const QString& attrName, const QString& attrValue) +bool Tag::editAttribute(const TQString& attrName, const TQString& attrValue) { TagAttr attr; @@ -552,7 +552,7 @@ bool Tag::editAttribute(const QString& attrName, const QString& attrValue) return false; } -void Tag::deleteAttribute(const QString& attrName) +void Tag::deleteAttribute(const TQString& attrName) { for (uint i = 0 ; i < attrs.count(); i++) { @@ -564,12 +564,12 @@ void Tag::deleteAttribute(const QString& attrName) } } -void Tag::modifyAttributes(QDict<QString> *attrDict) +void Tag::modifyAttributes(TQDict<TQString> *attrDict) { QTag *qTag = QuantaCommon::tagFromDTD(m_dtd, name); - QDictIterator<QString> it(*attrDict); - QString attribute; - QString value; + TQDictIterator<TQString> it(*attrDict); + TQString attribute; + TQString value; while ( it.current() ) { attribute = it.currentKey(); @@ -591,13 +591,13 @@ void Tag::modifyAttributes(QDict<QString> *attrDict) } } -QString Tag::toString() +TQString Tag::toString() { QTag *qTag = QuantaCommon::tagFromDTD(m_dtd, name); - QValueList<TagAttr>::Iterator it; + TQValueList<TagAttr>::Iterator it; TagAttr attr; - QString attrString; - QString tagString; + TQString attrString; + TQString tagString; for (it = attrs.begin(); it != attrs.end(); ++it) { attr = *it; @@ -652,7 +652,7 @@ void Tag::setDtd(const DTDStruct *dtd) m_dtd = dtd; } -bool Tag::isInsideScript(const QString &str) +bool Tag::isInsideScript(const TQString &str) { if (!m_dtd) return false; //happens when the DTD is not known yet, e.g in Document::findDTDName @@ -662,7 +662,7 @@ bool Tag::isInsideScript(const QString &str) //TODO: speed up if you can... if (str.find(m_dtd->specialAreaStartRx) != -1) { - QString foundString = m_dtd->specialAreaStartRx.cap(); + TQString foundString = m_dtd->specialAreaStartRx.cap(); if (str.find(m_dtd->specialAreas[foundString]) == -1) { return true; diff --git a/quanta/parsers/tag.h b/quanta/parsers/tag.h index de2c0a7b..43ed610a 100644 --- a/quanta/parsers/tag.h +++ b/quanta/parsers/tag.h @@ -16,9 +16,9 @@ #ifndef TAG_H #define TAG_H -#include <qstring.h> -#include <qdict.h> -#include <qvaluelist.h> +#include <tqstring.h> +#include <tqdict.h> +#include <tqvaluelist.h> class QDomElement; #include "qtag.h" @@ -39,11 +39,11 @@ struct TagAttr { TagAttr() {nameLine = nameCol = valueLine = valueCol = 0; quoted = true; special = false;} /** For Kafka copy/paste */ - void save(QDomElement& element) const; - bool load(QDomElement const& element); + void save(TQDomElement& element) const; + bool load(TQDomElement const& element); - QString name; //attr name - QString value; //attr value + TQString name; //attr name + TQString value; //attr value int nameLine, nameCol; //where the attr name begins int valueLine, valueCol;//where the attr value begins bool quoted; //quote or not the attribute @@ -73,17 +73,17 @@ public: Tag operator = ( const Tag& ); /** For Kafka copy/paste */ - void save(QDomElement& element) const; - bool load(QDomElement const& element); + void save(TQDomElement& element) const; + bool load(TQDomElement const& element); /** Parse the p_tagStr in p_write and build up the tag's attributes and values */ - void parse (const QString &p_tagStr, Document *p_write); + void parse (const TQString &p_tagStr, Document *p_write); /** Return the attribute at index*/ - QString attribute(int index); + TQString attribute(int index); /** Return the attribute value at index*/ - QString attributeValue(int index); + TQString attributeValue(int index); /** Return the value of attr*/ - QString attributeValue(const QString &attr, bool ignoreCase = false); + TQString attributeValue(const TQString &attr, bool ignoreCase = false); /** Add an attribute */ void addAttribute(TagAttr attr) {attrs.append(attr);} /** Get the attribute number index */ @@ -92,13 +92,13 @@ public: void deleteAttribute(uint index) {attrs.remove(attrs.at(index));} /** Insert a new Attribute, even if it already exists. Prefer using editAttribute. Return true if something was mdofied. */ - bool editAttribute(const QString& attrName, const QString& attrValue); + bool editAttribute(const TQString& attrName, const TQString& attrValue); /** Delete the attribute attrName */ - void deleteAttribute(const QString& attrName); + void deleteAttribute(const TQString& attrName); /** Returns the quotation status of the attribute */ bool isQuotedAttribute(int index) const {return attrs[index].quoted;} /** Check if this tag has the attr attribute defined */ - bool hasAttribute(const QString &attr, bool ignoreCase = false); + bool hasAttribute(const TQString &attr, bool ignoreCase = false); /** set the coordinates of a tag attribute */ void setAttributePosition(int index, int bLineName, int bColName, int bLineValue, int bColValue); /** Set the coordinates of tag inside the document */ @@ -116,9 +116,9 @@ public: /** Where the attr value at index begins in the document */ void attributeValuePos(int index, int &line, int &col); /** Set the internal string which is parsed */ - void setStr(const QString &p_tagStr); + void setStr(const TQString &p_tagStr); /** Get the tag in string format */ - QString tagStr() const {return m_tagStr;}; + TQString tagStr() const {return m_tagStr;}; /** Get the document where the tag lies */ Document *write() {return m_write;} /** Set the document where the tag lies */ @@ -128,14 +128,14 @@ public: /** Returns the index of attributevalue at (line,col). */ int valueIndexAtPos(int line, int col); /** Return the index of attr. */ - int attributeIndex(const QString &attr); + int attributeIndex(const TQString &attr); void namePos(int &line, int &col); int attrCount() const {return attrs.count();} /** modify the attributes of tag according to the attrDict*/ - void modifyAttributes(QDict<QString> *attrDict); + void modifyAttributes(TQDict<TQString> *attrDict); /** returns the tag as a string */ - QString toString(); + TQString toString(); /** returns true if the tag is a closing tag (name or namespace starts with "/") */ bool isClosingTag(); /** Sets the special flag of attribute at index*/ @@ -163,13 +163,13 @@ public: //TODO: write setting/retrieving methods for the below attributes, and add //them the m_ prefix - QString name; - QString nameSpace; - QString cleanStr; + TQString name; + TQString nameSpace; + TQString cleanStr; int type; //one of the TokenType bool single; // tags like <tag /> bool closingMissing; //closing tag is optional and missing - QString structBeginStr; //if it's a special block, contains the block beginning definition string (like <? or <style language="foo">) + TQString structBeginStr; //if it's a special block, contains the block beginning definition string (like <? or <style language="foo">) bool validXMLTag; //false if the closing ">" was not found bool cleanStrBuilt() {return m_cleanStrBuilt;} @@ -196,15 +196,15 @@ private: void init(); /** Verifies if the last char from @param str is inside a script area or not */ - bool isInsideScript(const QString& str); + bool isInsideScript(const TQString& str); AreaStruct m_area; //where the tag is in the doc int m_nameLine;//where the tag name begins int m_nameCol; const DTDStruct* m_dtd; //the tag belongs to this DTD - QValueList<TagAttr> attrs; //attributes in a tag - QString m_tagStr; //the tag in string format (as it is in the document) + TQValueList<TagAttr> attrs; //attributes in a tag + TQString m_tagStr; //the tag in string format (as it is in the document) Document *m_write; //the document }; |