Eneboo - Documentación para desarrolladores
|
00001 /**************************************************************************** 00002 ** 00003 ** Definition of QSqlForm 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 QSQLFORM_H 00038 #define QSQLFORM_H 00039 00040 #ifndef QT_H 00041 #include "qobject.h" 00042 #include "qmap.h" 00043 #endif // QT_H 00044 00045 #if !defined( QT_MODULE_SQL ) || defined( QT_LICENSE_PROFESSIONAL ) 00046 #define QM_EXPORT_SQL 00047 #else 00048 #define QM_EXPORT_SQL Q_EXPORT 00049 #endif 00050 00051 #ifndef QT_NO_SQL_FORM 00052 00053 class QSqlField; 00054 class QSqlRecord; 00055 class QSqlEditorFactory; 00056 class QSqlPropertyMap; 00057 class QWidget; 00058 class QSqlFormPrivate; 00059 00060 class QM_EXPORT_SQL QSqlForm : public QObject 00061 { 00062 Q_OBJECT 00063 public: 00064 QSqlForm( QObject * parent = 0, const char * name = 0 ); 00065 ~QSqlForm(); 00066 00067 virtual void insert( QWidget * widget, const QString& field ); 00068 virtual void remove( const QString& field ); 00069 uint count() const; 00070 00071 QWidget * widget( uint i ) const; 00072 QSqlField * widgetToField( QWidget * widget ) const; 00073 QWidget * fieldToWidget( QSqlField * field ) const; 00074 00075 void installPropertyMap( QSqlPropertyMap * map ); 00076 00077 virtual void setRecord( QSqlRecord* buf ); 00078 00079 public slots: 00080 virtual void readField( QWidget * widget ); 00081 virtual void writeField( QWidget * widget ); 00082 virtual void readFields(); 00083 virtual void writeFields(); 00084 00085 virtual void clear(); 00086 virtual void clearValues( bool nullify = FALSE ); 00087 00088 protected: 00089 virtual void insert( QWidget * widget, QSqlField * field ); 00090 virtual void remove( QWidget * widget ); 00091 void clearMap(); 00092 00093 private: 00094 virtual void sync(); 00095 QSqlFormPrivate* d; 00096 00097 #if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator= 00098 QSqlForm( const QSqlForm & ); 00099 QSqlForm &operator=( const QSqlForm & ); 00100 #endif 00101 }; 00102 00103 #endif // QT_NO_SQL 00104 #endif // QSQLFORM_H