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 ADOCUMENT_H
00031 #define ADOCUMENT_H
00032
00033 #include <qdatetime.h>
00034 #include "acfg.h"
00035 #include "aobject.h"
00036
00037
00038 class aDocJournal;
00039
00040 class aDatabase;
00041
00042
00043
00062 class ANANAS_EXPORT aDocument :public aObject
00063 {
00064 Q_OBJECT
00065 ERR_Code tableDeleteLines( const QString & tablename );
00066 ERR_Code tableSelect( const QString & tablename, Q_ULLONG = 0 );
00067 public:
00068
00069 aDocument( aCfgItem context, aDatabase * adb = 0 );
00070 aDocument( const QString & name, aDatabase * adb = 0 );
00071 virtual ~aDocument();
00072
00073 virtual ERR_Code select ( Q_ULLONG uid );
00074 virtual ERR_Code initObject();
00075 virtual QString trSysName( const QString & sname );
00076 virtual QVariant sysValue( const QString & sname, const QString & = "");
00077 virtual ERR_Code setSysValue( const QString & sname, QVariant value, const QString & = "");
00078
00079 aSQLTable * getTable( const QString & tablename );
00080 public slots:
00081
00082 virtual ERR_Code New();
00083 virtual ERR_Code Delete();
00084 virtual ERR_Code Update();
00085 virtual ERR_Code Select( QDateTime from, QDateTime to );
00086 virtual bool Select();
00087 virtual ERR_Code Select( const QString & num );
00088 virtual int SelectDocument( QVariant uid );
00089 virtual ERR_Code Copy();
00090
00091 virtual bool Next();
00092 virtual bool Prev();
00093 virtual bool First();
00094 virtual bool Last();
00095
00096 virtual ERR_Code TableNewLine( const QString & tablename );
00097 virtual ERR_Code TableDelete(const QString & tablename);
00098 virtual ERR_Code TableSelect( const QString & name );
00099
00100 virtual QVariant TableValue( const QString & tablename, const QString & name );
00101 virtual ERR_Code TableSetValue( const QString & tablename, const QString & name,
00102 const QVariant &value );
00103 virtual ERR_Code TableUpdate( const QString & tablename = "" );
00104
00105 virtual bool TableNext( const QString & name);
00106 virtual bool TablePrev( const QString & name);
00107 virtual bool TableFirst( const QString & name);
00108 virtual bool TableLast( const QString & name);
00109
00110 virtual bool IsMarkDeleted();
00111 virtual bool IsMarked();
00112 virtual ERR_Code SetMarkDeleted( bool Deleted );
00113 virtual ERR_Code SetMarked( bool Marked );
00114
00115 void SetPrefix( const QString & pr );
00116 QString Prefix();
00117
00118 virtual QVariant Value( const QString & name, const QString &tableName = "" );
00119
00120 virtual ERR_Code SetFilter( const QString & valname, const QVariant & value );
00121 virtual ERR_Code ClearFilter();
00122
00123 ERR_Code Conduct();
00124 ERR_Code UnConduct();
00125 bool IsConducted();
00126 ERR_Code SignIn();
00127 ERR_Code SignOut();
00128 bool IsSignedIn();
00129
00130
00131 void Seek(int pos, const QString &tname);
00132 QVariant GetDocumentValue(QVariant ide, const QString &fname);
00133
00134 private:
00135 QString pref;
00136 aDocJournal* sysJournal;
00137 ERR_Code setConduct( bool cond );
00138 };
00139
00140 #endif// ADOCUMENT_H