Eneboo - Documentación para desarrolladores
|
00001 /**************************************************************************** 00002 ** 00003 ** Definition of QSqlManager 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 QSQLMANAGER_P_H 00038 #define QSQLMANAGER_P_H 00039 00040 // 00041 // W A R N I N G 00042 // ------------- 00043 // 00044 // This file is not part of the Qt API. It exists for the convenience 00045 // of other Qt classes. This header file may change from version to 00046 // version without notice, or even be removed. 00047 // 00048 // We mean it. 00049 // 00050 // 00051 00052 #ifndef QT_H 00053 #include "qglobal.h" 00054 #include "qstring.h" 00055 #include "qstringlist.h" 00056 #include "qsql.h" 00057 #include "qsqlerror.h" 00058 #include "qsqlindex.h" 00059 #include "qsqlcursor.h" 00060 #endif // QT_H 00061 00062 #if !defined( QT_MODULE_SQL ) || defined( QT_LICENSE_PROFESSIONAL ) 00063 #define QM_EXPORT_SQL 00064 #else 00065 #define QM_EXPORT_SQL Q_EXPORT 00066 #endif 00067 00068 #ifndef QT_NO_SQL 00069 00070 class QSqlCursor; 00071 class QSqlForm; 00072 class QSqlCursorManagerPrivate; 00073 00074 class QM_EXPORT_SQL QSqlCursorManager 00075 { 00076 public: 00077 QSqlCursorManager(); 00078 virtual ~QSqlCursorManager(); 00079 00080 virtual void setSort( const QSqlIndex& sort ); 00081 virtual void setSort( const QStringList& sort ); 00082 QStringList sort() const; 00083 virtual void setFilter( const QString& filter ); 00084 QString filter() const; 00085 virtual void setCursor( QSqlCursor* cursor, bool autoDelete = FALSE ); 00086 QSqlCursor* cursor() const; 00087 00088 virtual void setAutoDelete( bool enable ); 00089 bool autoDelete() const; 00090 00091 virtual bool refresh(); 00092 virtual bool findBuffer( const QSqlIndex& idx, int atHint = 0 ); 00093 00094 private: 00095 QSqlCursorManagerPrivate* d; 00096 }; 00097 00098 #ifndef QT_NO_SQL_FORM 00099 00100 class QSqlFormManagerPrivate; 00101 00102 class QM_EXPORT_SQL QSqlFormManager 00103 { 00104 public: 00105 QSqlFormManager(); 00106 virtual ~QSqlFormManager(); 00107 00108 virtual void setForm( QSqlForm* form ); 00109 QSqlForm* form(); 00110 virtual void setRecord( QSqlRecord* record ); 00111 QSqlRecord* record(); 00112 00113 virtual void clearValues(); 00114 virtual void readFields(); 00115 virtual void writeFields(); 00116 00117 private: 00118 QSqlFormManagerPrivate* d; 00119 }; 00120 00121 #endif 00122 00123 class QWidget; 00124 class QDataManagerPrivate; 00125 00126 class QM_EXPORT_SQL QDataManager 00127 { 00128 public: 00129 QDataManager(); 00130 virtual ~QDataManager(); 00131 00132 virtual void setMode( QSql::Op m ); 00133 QSql::Op mode() const; 00134 virtual void setAutoEdit( bool autoEdit ); 00135 bool autoEdit() const; 00136 00137 virtual void handleError( QWidget* parent, const QSqlError& error ); 00138 virtual QSql::Confirm confirmEdit( QWidget* parent, QSql::Op m ); 00139 virtual QSql::Confirm confirmCancel( QWidget* parent, QSql::Op m ); 00140 00141 virtual void setConfirmEdits( bool confirm ); 00142 virtual void setConfirmInsert( bool confirm ); 00143 virtual void setConfirmUpdate( bool confirm ); 00144 virtual void setConfirmDelete( bool confirm ); 00145 virtual void setConfirmCancels( bool confirm ); 00146 00147 bool confirmEdits() const; 00148 bool confirmInsert() const; 00149 bool confirmUpdate() const; 00150 bool confirmDelete() const; 00151 bool confirmCancels() const; 00152 00153 private: 00154 QDataManagerPrivate* d; 00155 }; 00156 00157 00158 #endif 00159 #endif