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 #ifndef ACATALOGUE_H
00031 #define ACATALOGUE_H
00032
00033 #include "acfg.h"
00034 #include "aobject.h"
00035
00036 class aDatabase;
00037 class aCatGroup;
00038
00039
00040
00041
00054 class ANANAS_EXPORT aCatalogue :public aObject
00055 {
00056 Q_OBJECT
00057 public:
00058
00059 aCatalogue(aCfgItem context, aDatabase * adb = 0);
00060 aCatalogue(QString name, aDatabase * adb = 0);
00061
00062 virtual ERR_Code initObject();
00063
00064 protected:
00065 virtual aCfgItem displayStringContext();
00066
00067 private:
00068
00069 Q_ULLONG getGroup();
00070
00071
00072
00073 ERR_Code selectByOwner ( Q_ULLONG ido );
00074 ERR_Code groupSelect ();
00075 ERR_Code groupByParent(Q_ULLONG idp );
00076 public slots:
00077
00078 virtual int New( bool child);
00079 virtual int New();
00080 virtual int Delete();
00081
00082 virtual int newGroup( Q_ULLONG parentId );
00083 virtual int newElement( Q_ULLONG parentId );
00084
00085 virtual int Update();
00086 virtual int Copy();
00087
00088
00089 virtual int Select( bool grouponly = false );
00090 void UnSelect( bool grouponly = false );
00091 virtual int selectByLevel ( int level );
00092 virtual int selectByGroup ( Q_ULLONG idg );
00093 virtual Q_ULLONG idGroupByElement(Q_ULLONG ide );
00094 virtual int groupSelect ( Q_ULLONG idg );
00095
00096 virtual QVariant GetElementValue(QVariant ide, const QString &fname);
00097 virtual bool FindById(QString el_id);
00098
00099 virtual Q_ULLONG delElement();
00100 virtual Q_ULLONG delGroup(Q_ULLONG idg, QValueList<Q_ULLONG> &listDelId);
00101
00102 Q_ULLONG setMarkDeletedElement(Q_ULLONG el_id, bool del);
00103 Q_ULLONG setMarkDeletedGroup(Q_ULLONG gr_id, bool del);
00104 void getMarkDeletedList(Q_ULLONG idg, QValueList<Q_ULLONG> &listDelId);
00105
00106 virtual bool isGroupMarkDeleted();
00107 virtual bool isElementMarkDeleted();
00108
00109 virtual bool Next();
00110 virtual bool Prev();
00111 virtual bool First();
00112 virtual bool Last();
00113
00114 virtual bool NextInGroupTable();
00115 virtual bool PrevInGroupTable();
00116 virtual bool FirstInGroupTable();
00117 virtual bool LastInGroupTable();
00118
00119 virtual int GroupNew( bool reparent = false );
00120 virtual int GroupDelete();
00121 virtual int GroupMarkDeleted();
00122 virtual int GroupUpdate();
00123 virtual int GroupSelect();
00124 virtual int GroupSetGroup( aCatalogue * cat );
00125 virtual QVariant GroupValue( const QString & name );
00126 virtual int GroupSetValue( const QString & name, const QVariant & value);
00127 virtual QVariant GroupSysValue( const QString & name );
00128 virtual int GroupSetSysValue( const QString & name, const QVariant & value);
00129
00130 virtual QStringList getUserFields();
00131 virtual QStringList getGroupUserFields();
00132 };
00133
00134 class ANANAS_EXPORT aCatElement :public aObject
00135 {
00136 Q_OBJECT
00137 public:
00138 aCatElement(aCfgItem context, aDatabase * adb = 0);
00139
00140 };
00141
00142
00143
00154 class ANANAS_EXPORT aCatGroup :public aObject
00155 {
00156 Q_OBJECT
00157 void setLevel( Q_ULLONG newlevel );
00158 virtual QString trSysName( const QString & sname );
00159 QVariant sysValue( const QString & sname );
00160 public:
00161 aCatGroup(aCfgItem context, aDatabase * adb = 0);
00162 aCatGroup(QString name, aDatabase * adb = 0);
00163 virtual ERR_Code initObject();
00164 Q_ULLONG parentUid();
00165 public slots:
00166 ERR_Code New();
00167 ERR_Code New(aCatGroup *gr);
00168 ERR_Code Select();
00169 ERR_Code SelectChild( aCatGroup * parent = 0 );
00170 ERR_Code SetParent( aCatGroup * parent );
00171 protected:
00172 virtual aCfgItem displayStringContext();
00173 };
00174
00175 #endif// ACATALOGUE_H