/*************************************************************************** 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 QTAG_H #define QTAG_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 QTag; 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; }; class XMLStructGroup { public: QString name; /// AttributeList; typedef QDict AttributeListDict; typedef QDict QTagList; enum DTDFamily{Unknown = 0, Xml, Script}; #define MAX_STRUCTGROUPSCOUNT 10 //an internal representation of a DTD typedef struct DTDStruct { QString name; ///< DTD name QString 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; 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 QTagList* tagsList; ///< the list of all defined tags in the DTD QString fileName; ///< the DTD decription.rc with path AttributeListDict* commonAttrs; ///< the attributes of the common groups QString booleanAttributes; ///< simple or extended or QString booleanTrue; ///< "true" or "1" or whatever QString booleanFalse; ///< "false" or "0" or whatever QString singleTagStyle; ///< "xml" or "html" ( or ) QString 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 (),(<*,*>). */ QMap 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 QRegExp 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