00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef ACMANIFEST_H
00032 #define ACMANIFEST_H
00033
00034 #include "qdom.h"
00035 #include "qstringlist.h"
00036 #include "ananas.h"
00037 #include <qobject.h>
00038
00039
00040
00051 #define mf_invalid 0
00052 #define mf_metadata 1
00053 #define mf_template 2
00054 #define mf_dir 3
00055 #define mf_script 4
00056 #define mf_form 5
00057 #define mf_picture 6
00058 #define mf_other 100
00059
00060 class ANANAS_EXPORT aCManifest: public QObject
00061 {
00062 Q_OBJECT
00063 public:
00064
00065 aCManifest();
00066 virtual ~aCManifest();
00067
00068 struct record
00069 {
00070 QString name;
00071 int type;
00072 };
00073
00074
00075 virtual void create();
00076 virtual QString toString();
00077 virtual bool write(const QString& fname);
00078 virtual bool read(const QString& fname);
00079 virtual void clear();
00080 virtual bool isValid();
00081
00082 virtual aCManifest::record first();
00083 virtual aCManifest::record next();
00084
00085 virtual bool isExists( const QString &fname );
00086 virtual bool addEntry( const QString &fname, int type);
00087 virtual bool removeEntry( const QString &fname, bool withChilds );
00088 virtual QString lastError() const;
00089
00090 private:
00091 QString txtError;
00092 QDomDocument manifest;
00093 QDomElement rootNode, currentNode;
00094
00095 };
00096
00097
00098 #endif //ACMANIFEST_H