1 | /****************************************************************************
|
---|
2 | **
|
---|
3 | ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
---|
4 | ** Contact: Qt Software Information ([email protected])
|
---|
5 | **
|
---|
6 | ** This file is part of the Qt3Support module of the Qt Toolkit.
|
---|
7 | **
|
---|
8 | ** $QT_BEGIN_LICENSE:LGPL$
|
---|
9 | ** Commercial Usage
|
---|
10 | ** Licensees holding valid Qt Commercial licenses may use this file in
|
---|
11 | ** accordance with the Qt Commercial License Agreement provided with the
|
---|
12 | ** Software or, alternatively, in accordance with the terms contained in
|
---|
13 | ** a written agreement between you and Nokia.
|
---|
14 | **
|
---|
15 | ** GNU Lesser General Public License Usage
|
---|
16 | ** Alternatively, this file may be used under the terms of the GNU Lesser
|
---|
17 | ** General Public License version 2.1 as published by the Free Software
|
---|
18 | ** Foundation and appearing in the file LICENSE.LGPL included in the
|
---|
19 | ** packaging of this file. Please review the following information to
|
---|
20 | ** ensure the GNU Lesser General Public License version 2.1 requirements
|
---|
21 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
---|
22 | **
|
---|
23 | ** In addition, as a special exception, Nokia gives you certain
|
---|
24 | ** additional rights. These rights are described in the Nokia Qt LGPL
|
---|
25 | ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
|
---|
26 | ** package.
|
---|
27 | **
|
---|
28 | ** GNU General Public License Usage
|
---|
29 | ** Alternatively, this file may be used under the terms of the GNU
|
---|
30 | ** General Public License version 3.0 as published by the Free Software
|
---|
31 | ** Foundation and appearing in the file LICENSE.GPL included in the
|
---|
32 | ** packaging of this file. Please review the following information to
|
---|
33 | ** ensure the GNU General Public License version 3.0 requirements will be
|
---|
34 | ** met: http://www.gnu.org/copyleft/gpl.html.
|
---|
35 | **
|
---|
36 | ** If you are unsure which license is appropriate for your use, please
|
---|
37 | ** contact the sales department at [email protected].
|
---|
38 | ** $QT_END_LICENSE$
|
---|
39 | **
|
---|
40 | ****************************************************************************/
|
---|
41 |
|
---|
42 | #ifndef Q3SQLMANAGER_P_H
|
---|
43 | #define Q3SQLMANAGER_P_H
|
---|
44 |
|
---|
45 | //
|
---|
46 | // W A R N I N G
|
---|
47 | // -------------
|
---|
48 | //
|
---|
49 | // This file is not part of the Qt API. It exists for the convenience
|
---|
50 | // of other Qt classes. This header file may change from version to
|
---|
51 | // version without notice, or even be removed.
|
---|
52 | //
|
---|
53 | // We mean it.
|
---|
54 | //
|
---|
55 |
|
---|
56 | #include "QtCore/qvariant.h"
|
---|
57 | #include "QtCore/qglobal.h"
|
---|
58 | #include "QtCore/qstring.h"
|
---|
59 | #include "QtCore/qstringlist.h"
|
---|
60 | #include "QtSql/qsql.h"
|
---|
61 | #include "QtSql/qsqlerror.h"
|
---|
62 | #include "QtSql/qsqlindex.h"
|
---|
63 | #include "Qt3Support/q3sqlcursor.h"
|
---|
64 |
|
---|
65 | QT_BEGIN_NAMESPACE
|
---|
66 |
|
---|
67 | #ifndef QT_NO_SQL
|
---|
68 |
|
---|
69 | class Q3SqlCursor;
|
---|
70 | class Q3SqlForm;
|
---|
71 | class Q3SqlCursorManagerPrivate;
|
---|
72 |
|
---|
73 | class Q_COMPAT_EXPORT Q3SqlCursorManager
|
---|
74 | {
|
---|
75 | public:
|
---|
76 | Q3SqlCursorManager();
|
---|
77 | virtual ~Q3SqlCursorManager();
|
---|
78 |
|
---|
79 | virtual void setSort(const QSqlIndex& sort);
|
---|
80 | virtual void setSort(const QStringList& sort);
|
---|
81 | QStringList sort() const;
|
---|
82 | virtual void setFilter(const QString& filter);
|
---|
83 | QString filter() const;
|
---|
84 | virtual void setCursor(Q3SqlCursor* cursor, bool autoDelete = false);
|
---|
85 | Q3SqlCursor* cursor() const;
|
---|
86 |
|
---|
87 | virtual void setAutoDelete(bool enable);
|
---|
88 | bool autoDelete() const;
|
---|
89 |
|
---|
90 | virtual bool refresh();
|
---|
91 | virtual bool findBuffer(const QSqlIndex& idx, int atHint = 0);
|
---|
92 |
|
---|
93 | private:
|
---|
94 | Q3SqlCursorManagerPrivate* d;
|
---|
95 | };
|
---|
96 |
|
---|
97 | #ifndef QT_NO_SQL_FORM
|
---|
98 |
|
---|
99 | class Q3SqlFormManagerPrivate;
|
---|
100 |
|
---|
101 | class Q_COMPAT_EXPORT Q3SqlFormManager
|
---|
102 | {
|
---|
103 | public:
|
---|
104 | Q3SqlFormManager();
|
---|
105 | virtual ~Q3SqlFormManager();
|
---|
106 |
|
---|
107 | virtual void setForm(Q3SqlForm* form);
|
---|
108 | Q3SqlForm* form();
|
---|
109 | virtual void setRecord(QSqlRecord* record);
|
---|
110 | QSqlRecord* record();
|
---|
111 |
|
---|
112 | virtual void clearValues();
|
---|
113 | virtual void readFields();
|
---|
114 | virtual void writeFields();
|
---|
115 |
|
---|
116 | private:
|
---|
117 | Q3SqlFormManagerPrivate* d;
|
---|
118 | };
|
---|
119 |
|
---|
120 | #endif
|
---|
121 |
|
---|
122 | class QWidget;
|
---|
123 | class Q3DataManagerPrivate;
|
---|
124 |
|
---|
125 | class Q_COMPAT_EXPORT Q3DataManager
|
---|
126 | {
|
---|
127 | public:
|
---|
128 | Q3DataManager();
|
---|
129 | virtual ~Q3DataManager();
|
---|
130 |
|
---|
131 | virtual void setMode(QSql::Op m);
|
---|
132 | QSql::Op mode() const;
|
---|
133 | virtual void setAutoEdit(bool autoEdit);
|
---|
134 | bool autoEdit() const;
|
---|
135 |
|
---|
136 | virtual void handleError(QWidget* parent, const QSqlError& error);
|
---|
137 | virtual QSql::Confirm confirmEdit(QWidget* parent, QSql::Op m);
|
---|
138 | virtual QSql::Confirm confirmCancel(QWidget* parent, QSql::Op m);
|
---|
139 |
|
---|
140 | virtual void setConfirmEdits(bool confirm);
|
---|
141 | virtual void setConfirmInsert(bool confirm);
|
---|
142 | virtual void setConfirmUpdate(bool confirm);
|
---|
143 | virtual void setConfirmDelete(bool confirm);
|
---|
144 | virtual void setConfirmCancels(bool confirm);
|
---|
145 |
|
---|
146 | bool confirmEdits() const;
|
---|
147 | bool confirmInsert() const;
|
---|
148 | bool confirmUpdate() const;
|
---|
149 | bool confirmDelete() const;
|
---|
150 | bool confirmCancels() const;
|
---|
151 |
|
---|
152 | private:
|
---|
153 | Q3DataManagerPrivate* d;
|
---|
154 | };
|
---|
155 |
|
---|
156 | #endif // QT_NO_SQL
|
---|
157 |
|
---|
158 | QT_END_NAMESPACE
|
---|
159 |
|
---|
160 | #endif // Q3SQLMANAGER_P_H
|
---|