source: trunk/include/qsqlselectcursor.h@ 203

Last change on this file since 203 was 196, checked in by rudi, 14 years ago

Add SQL module (currently it isn't build by default, however it's needed for QtDesigner)

File size: 3.6 KB
Line 
1/****************************************************************************
2**
3** Definition of QSqlSelectCursor class
4**
5** Created : 2002-11-13
6**
7** Copyright (C) 2005-2007 Trolltech ASA. 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 ASA 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 QSQLSELECTCURSOR_H
38#define QSQLSELECTCURSOR_H
39
40#ifndef QT_H
41#include "qsqlcursor.h"
42#endif // QT_H
43
44#if !defined( QT_MODULE_SQL ) || defined( QT_LICENSE_PROFESSIONAL )
45#define QM_EXPORT_SQL
46#else
47#define QM_EXPORT_SQL Q_EXPORT
48#endif
49
50#ifndef QT_NO_SQL
51
52class QSqlSelectCursorPrivate;
53
54class QM_EXPORT_SQL QSqlSelectCursor : public QSqlCursor
55{
56public:
57 QSqlSelectCursor( const QString& query = QString::null, QSqlDatabase* db = 0 );
58 QSqlSelectCursor( const QSqlSelectCursor& other );
59 ~QSqlSelectCursor();
60 bool exec( const QString& query );
61 bool select() { return QSqlCursor::select(); }
62
63protected:
64 QSqlIndex primaryIndex( bool = TRUE ) const { return QSqlIndex(); }
65 QSqlIndex index( const QStringList& ) const { return QSqlIndex(); }
66 QSqlIndex index( const QString& ) const { return QSqlIndex(); }
67 QSqlIndex index( const char* ) const { return QSqlIndex(); }
68 void setPrimaryIndex( const QSqlIndex& ) {}
69 void append( const QSqlFieldInfo& ) {}
70 void insert( int, const QSqlFieldInfo& ) {}
71 void remove( int ) {}
72 void clear() {}
73 void setGenerated( const QString&, bool ) {}
74 void setGenerated( int, bool ) {}
75 QSqlRecord* editBuffer( bool = FALSE ) { return 0; }
76 QSqlRecord* primeInsert() { return 0; }
77 QSqlRecord* primeUpdate() { return 0; }
78 QSqlRecord* primeDelete() { return 0; }
79 int insert( bool = TRUE ) { return 0; }
80 int update( bool = TRUE ) { return 0; }
81 int del( bool = TRUE ) { return 0; }
82 void setMode( int ) {}
83
84 void setSort( const QSqlIndex& ) {}
85 QSqlIndex sort() const { return QSqlIndex(); }
86 void setFilter( const QString& ) {}
87 QString filter() const { return QString::null; }
88 void setName( const QString&, bool = TRUE ) {}
89 QString name() const { return QString::null; }
90 QString toString( const QString& = QString::null, const QString& = "," ) const { return QString::null; }
91 bool select( const QString &, const QSqlIndex& = QSqlIndex() );
92
93private:
94 void populateCursor();
95
96 QSqlSelectCursorPrivate * d;
97};
98
99#endif // QT_NO_SQL
100#endif // QSQLSELECTCURSOR_H
Note: See TracBrowser for help on using the repository browser.