kexi
kexidbcursor.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef KROSS_KEXIDB_KEXIDBCURSOR_H
00021 #define KROSS_KEXIDB_KEXIDBCURSOR_H
00022
00023 #include <qstring.h>
00024
00025 #include <api/object.h>
00026 #include <api/variant.h>
00027 #include <api/list.h>
00028 #include <api/class.h>
00029
00030 #include <kexidb/cursor.h>
00031 #include <kexidb/roweditbuffer.h>
00032
00033 namespace Kross { namespace KexiDB {
00034
00035
00036 class KexiDBConnection;
00037
00085 class KexiDBCursor : public Kross::Api::Class<KexiDBCursor>
00086 {
00087 public:
00088 KexiDBCursor(::KexiDB::Cursor* cursor);
00089 virtual ~KexiDBCursor();
00090 virtual const QString getClassName() const;
00091
00092 private:
00093
00095 bool open();
00097 bool isOpened();
00099 bool reopen();
00101 bool close();
00102
00104 bool moveFirst();
00106 bool moveLast();
00108 bool movePrev();
00110 bool moveNext();
00111
00113 bool bof();
00115 bool eof();
00116
00120 Q_LLONG at();
00122 uint fieldCount();
00124 QVariant value(uint index);
00127 bool setValue(uint index, QVariant value);
00128
00132 bool save();
00133
00134 private:
00135 ::KexiDB::Cursor* m_cursor;
00136
00137 class Record {
00138 public:
00139 ::KexiDB::RowData rowdata;
00140 ::KexiDB::RowEditBuffer* buffer;
00141 Record(::KexiDB::Cursor* cursor)
00142 : buffer( new ::KexiDB::RowEditBuffer(true) )
00143 {
00144 cursor->storeCurrentRow(rowdata);
00145 }
00146 ~Record()
00147 {
00148 delete buffer;
00149 }
00150 };
00151 QMap<Q_LLONG, Record*> m_modifiedrecords;
00152
00153 void clearBuffers();
00154 };
00155
00156 }}
00157
00158 #endif
00159
|