home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / qt3_emx.zip / include / qsqlresult.h < prev    next >
C/C++ Source or Header  |  2001-07-26  |  3KB  |  109 lines

  1. /****************************************************************************
  2. **
  3. ** Definition of QSqlResult class
  4. **
  5. ** Created : 2000-11-03
  6. **
  7. ** Copyright (C) 2000 Trolltech AS.  All rights reserved.
  8. **
  9. ** This file is part of the sql module of the Qt GUI Toolkit.
  10. **
  11. ** This file may be distributed under the terms of the Q Public License
  12. ** as defined by Trolltech AS of Norway and appearing in the file
  13. ** LICENSE.QPL included in the packaging of this file.
  14. **
  15. ** This file may be distributed and/or modified under the terms of the
  16. ** GNU General Public License version 2 as published by the Free Software
  17. ** Foundation and appearing in the file LICENSE.GPL included in the
  18. ** packaging of this file.
  19. **
  20. ** Licensees holding valid Qt Enterprise Edition licenses may use this
  21. ** file in accordance with the Qt Commercial License Agreement provided
  22. ** with the Software.
  23. **
  24. ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
  25. ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  26. **
  27. ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
  28. **   information about Qt Commercial License Agreements.
  29. ** See http://www.trolltech.com/qpl/ for QPL licensing information.
  30. ** See http://www.trolltech.com/gpl/ for GPL licensing information.
  31. **
  32. ** Contact info@trolltech.com if any conditions of this licensing are
  33. ** not clear to you.
  34. **
  35. **********************************************************************/
  36.  
  37. #ifndef QSQLRESULT_H
  38. #define QSQLRESULT_H
  39.  
  40. #ifndef QT_H
  41. #include "qstring.h"
  42. #include "qvariant.h"
  43. #include "qsqlerror.h"
  44. #include "qsqlfield.h"
  45. #include "qsql.h"
  46. #endif // QT_H
  47.  
  48. #if !defined( QT_MODULE_SQL ) || defined( QT_LICENSE_PROFESSIONAL )
  49. #define QM_EXPORT_SQL
  50. #else
  51. #define QM_EXPORT_SQL Q_EXPORT
  52. #endif
  53.  
  54. #ifndef QT_NO_SQL
  55.  
  56. class QSqlDriver;
  57. class QSql;
  58. class QSqlResultInfo;
  59. class QSqlResultPrivate;
  60.  
  61. class QM_EXPORT_SQL QSqlResult
  62. {
  63. friend class QSqlQuery;
  64. friend class QSqlResultShared;
  65. public:
  66.     virtual ~QSqlResult();
  67. protected:
  68.     QSqlResult(const QSqlDriver * db );
  69.     int            at() const;
  70.     QString         lastQuery() const;
  71.     QSqlError       lastError() const;
  72.     bool            isValid() const;
  73.     bool            isActive() const;
  74.     bool            isSelect() const;
  75.     bool            isForwardOnly() const;
  76.     const QSqlDriver* driver() const;
  77.     virtual void    setAt( int at );
  78.     virtual void    setActive( bool a );
  79.     virtual void    setLastError( const QSqlError& e );
  80.     virtual void    setQuery( const QString& query );
  81.     virtual void    setSelect( bool s );
  82.     virtual void    setForwardOnly( bool forward );
  83.  
  84.     virtual QVariant data( int i ) = 0;
  85.     virtual bool    isNull( int i ) = 0;
  86.     virtual bool    reset ( const QString& sqlquery ) = 0;
  87.     virtual bool    fetch( int i ) = 0;
  88.     virtual bool    fetchNext();
  89.     virtual bool    fetchPrev();
  90.     virtual bool    fetchFirst() = 0;
  91.     virtual bool    fetchLast() = 0;
  92.     virtual int     size() = 0;
  93.     virtual int     numRowsAffected() = 0;
  94. private:
  95.     QSqlResultPrivate* d;
  96.     bool forwardOnly;
  97.  
  98.  
  99. private:    // Disabled copy constructor and operator=
  100. #if defined(Q_DISABLE_COPY)
  101.     QSqlResult( const QSqlResult & );
  102.     QSqlResult &operator=( const QSqlResult & );
  103. #endif
  104.  
  105. };
  106.  
  107. #endif    // QT_NO_SQL
  108. #endif
  109.