/*************************************************************************** qtag.h - description ------------------- begin : Thu Aug 15 2002 copyright : (C) 2002, 2003 by Andras Mantia ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; version 2 of the License. * * * ***************************************************************************/ #ifndef TQTAG_H #define TQTAG_H /**Quanta style tag (XML tag or code tag), as they are defined in the DTD. Contains all the possible attributes and the possible values for the attributes. Do not confund with the Tag class, which can change as the user types other attributes and changes their values. *@author Andras Mantia */ //qt includes #include #include #include #include #include //app includes class TQTag; class Node; //an attribute of a tag looks like: struct Attribute { 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: TQString name; /// AttributeList; typedef TQDict AttributeListDict; typedef TQDict TQTagList; enum DTDFamily{Unknown = 0, Xml, Script}; #define MAX_STRUCTGROUPSCOUNT 10 //an internal representation of a DTD struct DTDStruct { TQString name; ///< DTD name TQString nickName; ///< DTD nickname bool loaded; ///< true = DTD is complet in memory 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 TQString documentation; ///< the name of the documentation package TQTagList* tagsList; ///< the list of all defined tags in the DTD TQString fileName; ///< the DTD decription.rc with path AttributeListDict* commonAttrs; ///< the attributes of the common groups TQString booleanAttributes; ///< simple or extended or TQString booleanTrue; ///< "true" or "1" or whatever TQString booleanFalse; ///< "false" or "0" or whatever TQString singleTagStyle; ///< "xml" or "html" ( or ) TQString defaultAttrType; ///< "input", "string" or whatever /****************** FOR THE NEW PARSER **********************/ /* Special, not to be parsed areas. It is the area of the nested DTD's (script, css) and special areas like comments. Special areas can be in form: or they can be inside special tags, like . */ /* The starting and closing strings of a special area. For PHP the special areas are and <* *>, so the entries are (),(<*,*>). */ TQMap 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 ( specialAreaNames; /* A regular expression which matches the starting strings of all the possible special areas. */ 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. E.g for the