kexi

mysqlcursor.h

00001 /* This file is part of the KDE project
00002 Copyright (C) 2003 Joseph Wenninger<jowenn@kde.org>
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 _MYSQLCURSOR_H_
00021 #define _MYSQLCURSOR_H_
00022 
00023 #include <kexidb/cursor.h>
00024 #include <kexidb/connection.h>
00025 
00026 namespace KexiDB {
00027 
00028 class MySqlCursorData;
00029 
00030 class MySqlCursor: public Cursor {
00031 public:
00032     MySqlCursor(Connection* conn, const QString& statement = QString::null, uint cursor_options = NoOptions );
00033     MySqlCursor(Connection* conn, QuerySchema& query, uint options = NoOptions );
00034     virtual ~MySqlCursor();
00035     virtual bool drv_open();
00036     virtual bool drv_close();
00037 //        virtual bool drv_moveFirst();
00038     virtual void drv_getNextRecord();
00039         //virtual bool drv_getPrevRecord();
00040     virtual QVariant value(uint);
00041 
00042     virtual void drv_clearServerResult();
00043     virtual void drv_appendCurrentRecordToBuffer();
00044     virtual void drv_bufferMovePointerNext();
00045     virtual void drv_bufferMovePointerPrev();
00046     virtual void drv_bufferMovePointerTo(Q_LLONG to);
00047     virtual const char** rowData() const;
00048     virtual void storeCurrentRow(RowData &data) const;
00049 //        virtual bool save(RowData& data, RowEditBuffer& buf);
00050 
00051     virtual int serverResult();
00052     virtual QString serverResultName();
00053     virtual QString serverErrorMsg();
00054 
00055 protected:
00056     QVariant pValue(uint pos) const;
00057 //  MYSQL_RES *m_res;   
00058 //  MYSQL_ROW m_row;
00059 //  MYSQL *my_conn;
00060 //  unsigned long *m_lengths;
00061 //js: int m_numFields;
00062 //  unsigned long m_numRows;
00063     MySqlCursorData *d;
00064 };
00065 
00066 }
00067 
00068 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys