Eneboo - Documentación para desarrolladores
|
00001 /**************************************************************************** 00002 ** 00003 ** Definition of QSqlResult class 00004 ** 00005 ** Created : 2000-11-03 00006 ** 00007 ** Copyright (C) 2005-2007 Trolltech ASA. All rights reserved. 00008 ** 00009 ** This file is part of the sql module of the Qt GUI Toolkit. 00010 ** 00011 ** This file may be distributed under the terms of the Q Public License 00012 ** as defined by Trolltech ASA of Norway and appearing in the file 00013 ** LICENSE.QPL included in the packaging of this file. 00014 ** 00015 ** This file may be distributed and/or modified under the terms of the 00016 ** GNU General Public License version 2 as published by the Free Software 00017 ** Foundation and appearing in the file LICENSE.GPL included in the 00018 ** packaging of this file. 00019 ** 00020 ** Licensees holding valid Qt Enterprise Edition licenses may use this 00021 ** file in accordance with the Qt Commercial License Agreement provided 00022 ** with the Software. 00023 ** 00024 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00025 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00026 ** 00027 ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 00028 ** information about Qt Commercial License Agreements. 00029 ** See http://www.trolltech.com/qpl/ for QPL licensing information. 00030 ** See http://www.trolltech.com/gpl/ for GPL licensing information. 00031 ** 00032 ** Contact info@trolltech.com if any conditions of this licensing are 00033 ** not clear to you. 00034 ** 00035 **********************************************************************/ 00036 00037 #ifndef QSQLRESULT_H 00038 #define QSQLRESULT_H 00039 00040 #ifndef QT_H 00041 #include "qstring.h" 00042 #include "qvariant.h" 00043 #include "qsqlerror.h" 00044 #include "qsqlfield.h" 00045 #include "qsql.h" 00046 #endif // QT_H 00047 00048 #if !defined( QT_MODULE_SQL ) || defined( QT_LICENSE_PROFESSIONAL ) 00049 #define QM_EXPORT_SQL 00050 #else 00051 #define QM_EXPORT_SQL Q_EXPORT 00052 #endif 00053 00054 #ifndef QT_NO_SQL 00055 00056 class QSqlDriver; 00057 class QSql; 00058 class QSqlResultPrivate; 00059 class QSqlExtension; 00060 00061 class QM_EXPORT_SQL QSqlResult 00062 { 00063 friend class QSqlQuery; 00064 friend class QSqlResultShared; 00065 public: 00066 virtual ~QSqlResult(); 00067 00068 // BCI HACK - remove in 4.0 00069 void setExtension( QSqlExtension * ext ); 00070 QSqlExtension * extension(); 00071 00072 protected: 00073 QSqlResult(const QSqlDriver * db ); 00074 int at() const; 00075 QString lastQuery() const; 00076 QSqlError lastError() const; 00077 bool isValid() const; 00078 bool isActive() const; 00079 bool isSelect() const; 00080 bool isForwardOnly() const; 00081 const QSqlDriver* driver() const; 00082 virtual void setAt( int at ); 00083 virtual void setActive( bool a ); 00084 virtual void setLastError( const QSqlError& e ); 00085 virtual void setQuery( const QString& query ); 00086 virtual void setSelect( bool s ); 00087 virtual void setForwardOnly( bool forward ); 00088 00089 virtual QVariant data( int i ) = 0; 00090 virtual bool isNull( int i ) = 0; 00091 virtual bool reset ( const QString& sqlquery ) = 0; 00092 virtual bool fetch( int i ) = 0; 00093 virtual bool fetchNext(); 00094 virtual bool fetchPrev(); 00095 virtual bool fetchFirst() = 0; 00096 virtual bool fetchLast() = 0; 00097 virtual int size() = 0; 00098 virtual int numRowsAffected() = 0; 00099 private: 00100 QSqlResultPrivate* d; 00101 bool forwardOnly; 00102 00103 private: // Disabled copy constructor and operator= 00104 #if defined(Q_DISABLE_COPY) 00105 QSqlResult( const QSqlResult & ); 00106 QSqlResult &operator=( const QSqlResult & ); 00107 #endif 00108 }; 00109 00110 #endif // QT_NO_SQL 00111 #endif