Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

xmlmodelevents.h

Go to the documentation of this file.
00001 /***************************************************************************
00002     xmlmodelevents.h  -  Definitions of XML model events.
00003                              -------------------
00004     begin                : June 21 2002
00005     copyright            : (C) 2003 by Vojtìch Toman
00006     email                : vtoman@lit.cz
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00025 #ifndef XMLMODELEVENTS_H
00026 #define XMLMODELEVENTS_H
00027 
00028 #include "defs.h"
00029 #include "xmldefs.h"
00030 
00031 
00037 struct XmlModelEvent
00038 {
00042   enum XmlModelEventType
00043   {
00045     StartElement,
00046 
00048     EndElement,
00049 
00051     Characters,
00052 
00054     StartCDATA,
00055 
00057     EndCDATA,
00058 
00060     Comment,
00061 
00063     PI,
00064 
00066     StartDoctype,
00067 
00069     EndDoctype,
00070 
00072     XmlDecl,
00073 
00075     EntityDecl,
00076 
00078     NotationDecl,
00079 
00081     Default
00082   };
00083 
00089   XmlModelEventType type;
00090 };
00091 
00092 
00093 
00097 struct XmlStartElementEvent : public XmlModelEvent
00098 {
00104   XmlStartElementEvent(const XmlChar *name, const XmlChar **attr)
00105     : XmlModelEvent()
00106   {
00107     type = XmlModelEvent::StartElement;
00108     this->name = name;
00109     this->attr = attr;
00110   }
00111 
00113   const XmlChar *name;
00114 
00116   const XmlChar **attr;
00117 };
00118 
00119 
00120 
00121 
00125 struct XmlEndElementEvent : public XmlModelEvent
00126 {
00131   XmlEndElementEvent(const XmlChar *name)
00132     : XmlModelEvent()
00133   {
00134     type = XmlModelEvent::EndElement;
00135     this->name = name;
00136   }
00137 
00139   const XmlChar *name;
00140 };
00141 
00142 
00143 
00147 struct XmlCharactersEvent : public XmlModelEvent
00148 {
00154   XmlCharactersEvent(const XmlChar *data, int length)
00155     : XmlModelEvent()
00156   {
00157     type = XmlModelEvent::Characters;
00158     this->data = data;
00159     this->length = length;
00160   }
00161 
00163   const XmlChar *data;
00164 
00166   int length;
00167 };
00168 
00169 
00173 struct XmlDefaultEvent : public XmlModelEvent
00174 {
00180   XmlDefaultEvent(const XmlChar *data, int length)
00181     : XmlModelEvent()
00182   {
00183     type = XmlModelEvent::Default;
00184     this->data = data;
00185     this->length = length;
00186   }
00187 
00189   const XmlChar *data;
00190 
00192   int length;
00193 };
00194 
00195 
00196 
00200 struct XmlStartCDATAEvent : public XmlModelEvent
00201 {
00203   XmlStartCDATAEvent(void)
00204   {
00205     type = XmlModelEvent::StartCDATA;
00206   }
00207 };
00208 
00212 struct XmlEndCDATAEvent : public XmlModelEvent
00213 {
00215   XmlEndCDATAEvent(void)
00216   {
00217     type = XmlModelEvent::EndCDATA;
00218   }
00219 };
00220 
00221 
00225 struct XmlPIEvent : public XmlModelEvent
00226 {
00233   XmlPIEvent(const XmlChar *target, const XmlChar *data)
00234     : XmlModelEvent()
00235   {
00236     type = XmlModelEvent::PI;
00237     this->target = target;
00238     this->data = data;
00239   }
00240 
00242   const XmlChar *target;
00243 
00245   const XmlChar *data;
00246 };
00247 
00248 
00249 
00253 struct XmlCommentEvent : public XmlModelEvent
00254 {
00259   XmlCommentEvent(const XmlChar *data)
00260     : XmlModelEvent()
00261   {
00262     type = XmlModelEvent::Comment;
00263     this->data = data;
00264   }
00265 
00267   const XmlChar *data;
00268 };
00269 
00270 
00271 
00275 struct XmlDeclEvent : public XmlModelEvent
00276 {
00283   XmlDeclEvent(const XmlChar *version, const XmlChar *encoding, int standalone)
00284     : XmlModelEvent()
00285   {
00286     type = XmlModelEvent::XmlDecl;
00287     this->version = version;
00288     this->encoding = encoding;
00289     this->standalone = standalone;
00290   }
00291 
00293   const XmlChar *version;
00294 
00296   const XmlChar *encoding;
00297 
00299   int standalone;
00300 };
00301 
00302 
00303 
00307 struct XmlStartDoctypeEvent : public XmlModelEvent
00308 {
00316   XmlStartDoctypeEvent(const XmlChar *doctypeName, const XmlChar *systemId, const XmlChar *publicId, int hasInternalSubset)
00317     : XmlModelEvent()
00318   {
00319     type = XmlModelEvent::StartDoctype;
00320     this->doctypeName = doctypeName;
00321     this->systemId = systemId;
00322     this->publicId = publicId;
00323     this->hasInternalSubset = hasInternalSubset;
00324   }
00325 
00327   const XmlChar *doctypeName;
00328 
00330   const XmlChar *systemId;
00331 
00333   const XmlChar *publicId;
00334 
00340   int hasInternalSubset;
00341 };
00342 
00343 
00347 struct XmlEndDoctypeEvent : public XmlModelEvent
00348 {
00350   XmlEndDoctypeEvent(void) : XmlModelEvent()
00351   {
00352     type = XmlModelEvent::EndDoctype;
00353   }
00354 };
00355 
00356 
00357 
00361 struct XmlEntityDeclEvent : public XmlModelEvent
00362 {
00373   XmlEntityDeclEvent(const XmlChar *entityName, int isParameterEntity, const XmlChar *value, int valueLength, /* const XmlChar *base, */
00374                      const XmlChar *systemId, const XmlChar *publicId, const XmlChar *notationName)
00375     : XmlModelEvent()
00376   {
00377     type = XmlModelEvent::EntityDecl;
00378     this->entityName = entityName;
00379     this->isParameterEntity = isParameterEntity;
00380     this->value = value;
00381     this->valueLength = valueLength;
00382     //this->base = base;
00383     this->systemId = systemId;
00384     this->publicId = publicId;
00385     this->notationName = notationName;
00386   }
00387 
00389   const XmlChar *entityName;
00390 
00392   int isParameterEntity;
00393 
00395   const XmlChar *value;
00396 
00398   int valueLength;
00399 
00401   const XmlChar *systemId;
00402 
00404   const XmlChar *publicId;
00405 
00407   const XmlChar *notationName;
00408 };
00409 
00410 
00411 
00415 struct XmlNotationDeclEvent : public XmlModelEvent
00416 {
00423   XmlNotationDeclEvent(const XmlChar *notationName, /* const XmlChar *base, */ const XmlChar *systemId, const XmlChar *publicId)
00424     : XmlModelEvent()
00425   {
00426     type = XmlModelEvent::NotationDecl;
00427     this->notationName = notationName;
00428     //this->base = base;
00429     this->systemId = systemId;
00430     this->publicId = publicId;
00431   }
00432 
00434   const XmlChar *notationName;
00435 
00436 //    //! Base name.
00437 //    const XmlChar *base;
00438 
00440   const XmlChar *systemId;
00441 
00443   const XmlChar *publicId;
00444 };
00445 
00446 
00447 
00448 #endif //XMLEVENTS_H
00449 
00450 
00451 

Generated on Wed Feb 5 10:43:02 2003 for Exalt by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002