KNewStuff
entryhandler.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef KNEWSTUFF2_ENTRY_HANDLER_H
00020 #define KNEWSTUFF2_ENTRY_HANDLER_H
00021
00022 #include <knewstuff2/core/entry.h>
00023
00024 #include <QtXml/QDomDocument>
00025 #include <QtXml/QDomElement>
00026 #include <QtCore/QString>
00027
00028 namespace KNS
00029 {
00030
00042 class KNEWSTUFF_EXPORT EntryHandler
00043 {
00044 public:
00045 EntryHandler(const QDomElement& entryxml);
00046 EntryHandler(const Entry& entry);
00047
00048 bool isValid();
00049 void setCompatibilityFormat();
00050
00051 Entry entry();
00052 Entry *entryptr();
00053 QDomElement entryXML();
00054
00055 private:
00056 void init();
00057
00058 QDomElement serializeElement(const Entry& entry);
00059 Entry deserializeElement(const QDomElement& entryxml);
00060 QDomElement addElement(QDomDocument& doc, QDomElement& parent,
00061 const QString& tag, const QString& value);
00062
00063 Entry mEntry;
00064 QDomElement mEntryXML;
00065 bool mValid;
00066 bool mCompat;
00067 };
00068
00069 }
00070
00071 #endif