kexi
sqlitecursor.h
00001 /* This file is part of the KDE project 00002 Copyright (C) 2003-2006 Jaroslaw Staniek <js@iidea.pl> 00003 00004 This program is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License as published by the Free Software Foundation; either 00007 version 2 of the License, or (at your option) any later version. 00008 00009 This program is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this program; see the file COPYING. If not, write to 00016 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00017 * Boston, MA 02110-1301, USA. 00018 */ 00019 00020 #ifndef KEXIDB_SQLITECURSOR_H 00021 #define KEXIDB_SQLITECURSOR_H 00022 00023 #include <qstring.h> 00024 00025 #include <kexidb/cursor.h> 00026 #include "connection.h" 00027 00028 namespace KexiDB { 00029 00030 class SQLiteCursorData; 00031 00035 class SQLiteCursor : public Cursor 00036 { 00037 public: 00038 virtual ~SQLiteCursor(); 00039 virtual QVariant value(uint i); 00040 00042 //TODO virtual const char *** bufferData() 00044 virtual const char ** rowData() const; 00045 00046 virtual void storeCurrentRow(RowData &data) const; 00047 00048 // virtual bool save(RowData& data, RowEditBuffer& buf); 00049 00050 virtual int serverResult(); 00051 virtual QString serverResultName(); 00052 virtual QString serverErrorMsg(); 00053 00054 protected: 00056 SQLiteCursor(Connection* conn, const QString& statement, uint options = NoOptions ); 00057 00059 SQLiteCursor(Connection* conn, QuerySchema& query, 00060 uint options = NoOptions ); 00061 00062 virtual bool drv_open(); 00063 00064 virtual bool drv_close(); 00065 // virtual bool drv_moveFirst(); 00066 virtual void drv_getNextRecord(); 00067 //unused virtual bool drv_getPrevRecord(); 00068 00069 virtual void drv_appendCurrentRecordToBuffer(); 00070 virtual void drv_bufferMovePointerNext(); 00071 virtual void drv_bufferMovePointerPrev(); 00072 virtual void drv_bufferMovePointerTo(Q_LLONG at); 00073 00074 //TODO virtual void drv_storeCurrentRecord(); 00075 00076 //PROTOTYPE: 00079 virtual void drv_clearBuffer(); 00080 00081 virtual void drv_clearServerResult(); 00082 00083 SQLiteCursorData *d; 00084 00085 friend class SQLiteConnection; 00086 }; 00087 00088 } //namespace KexiDB 00089 00090 #endif 00091 00092