Go to the documentation of this file.00001
00002
00003
00004
00005
00006 #ifndef WOLF_WOBJECT_H
00007 #define WOLF_WOBJECT_H
00008
00009 #include <QObject>
00010 #include <QList>
00011
00012 #include "nullable.h"
00013 #include "exception.h"
00014 #include "WHelper"
00015
00016 class QDomElement;
00017 class QDomDocument;
00018 class QScriptValue;
00019 class QScriptEngine;
00020
00022 class WObject:public WHelper
00023 {
00024 protected:
00025 WObject(){}
00026 WObject(const WObject&):WHelper(){}
00027 WObject(const QDomElement&){}
00028 virtual ~WObject(){}
00029 virtual QDomElement toXml(QDomDocument&,QString name="Object");
00030 virtual WObject& operator=(const WObject&){return *this;}
00031 virtual void toXml(QDomDocument&,QDomElement&){}
00032 };
00033
00035 class WDeserializerException:public WException
00036 {
00037 public:
00038 WDeserializerException(QString e):WException(e,"Deserializer"){}
00039 };
00040
00042 #define WOBJECT(wob) public: \
00043 wob():wob ## Abstract(){} \
00044 wob(const wob&w):wob ## Abstract(w){} \
00045 wob(const wob ## Abstract&w):wob ## Abstract(w){} \
00046 wob(const QDomElement&w):wob ## Abstract(w){} \
00047 wob& operator=(const wob&w){wob ## Abstract::operator=(w);return *this;} \
00048 wob& operator=(const wob ## Abstract&w){wob ## Abstract::operator=(w);return *this;} \
00049 private:
00050
00051
00052 #define WOSCRIPT(wob) public: \
00053 static QScriptValue toScriptValue(QScriptEngine*,const wob &); \
00054 static void fromScriptValue(const QScriptValue&,wob &); \
00055 private:
00056
00057 #define WOSCRIPT_IMP(wob)
00058
00059
00060
00061
00062
00063
00064 #endif