diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:54:04 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:54:04 +0000 |
commit | dc6b8e72fed2586239e3514819238c520636c9d9 (patch) | |
tree | 88b200df0a0b7fab9d6f147596173556f1ed9a13 /quanta/parsers/qtag.h | |
parent | 6927d4436e54551917f600b706a8d6109e49de1c (diff) | |
download | tdewebdev-dc6b8e72fed2586239e3514819238c520636c9d9.tar.gz tdewebdev-dc6b8e72fed2586239e3514819238c520636c9d9.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1157656 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'quanta/parsers/qtag.h')
-rw-r--r-- | quanta/parsers/qtag.h | 170 |
1 files changed, 85 insertions, 85 deletions
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; }; |