00001 00002 00003 00004 00005 00006 00007 00008 00009 #include <config.h> 00010 00011 #if HAVE_LIBQTXML 00012 00013 #ifndef LOADCOLLECTIONXMLPARSER_H 00014 #define LOADCOLLECTIONXMLPARSER_H 00015 00016 #include "deviceCollection.h" 00017 00018 #include <QtXml/QXmlDefaultHandler> 00019 00020 00021 class loadCollectionXMLParser : public QXmlDefaultHandler { 00022 public: 00023 loadCollectionXMLParser(); 00024 virtual ~loadCollectionXMLParser(); 00025 bool startElement(const QString& namespaceURI, 00026 const QString& localName, 00027 const QString& qName, 00028 const QXmlAttributes& atts); 00029 bool endElement (const QString& namespaceURI, 00030 const QString& localName, 00031 const QString& qName); 00032 bool characters (const QString& ch); 00033 00034 std::vector<deviceCollection> deviceCollectionV; 00035 00036 00037 private: 00038 enum 00039 { 00040 NotWaiting, 00041 WaitingForDescription, 00042 WaitingForDevice, 00043 WaitingForAttribute 00044 } state; 00045 00046 deviceCollection devCollection; 00047 collectionMember cMember; 00048 00049 std::string attributeName; 00050 static const QString& tagConfig; 00051 static const QString& tagGroup; 00052 static const QString& tagDescription; 00053 static const QString& tagAttributes; 00054 static const QString& tagAttribute; 00055 static const QString& tagMember; 00056 static const QString& tagDevice; 00057 }; 00058 00059 #endif 00060 00061 00062 #endif // LOADCOLLECTIONXMLPARSER_H