kexi

kexiformdataiteminterface.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2005 Jaroslaw Staniek <js@iidea.pl>
00003 
00004    This program is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License as published by the Free Software Foundation; either
00007    version 2 of the License, or (at your option) any later version.
00008 
00009    This program is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this program; see the file COPYING.  If not, write to
00016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
00018  */
00019 
00020 #ifndef KEXIFORMDATAITEMINTERFACE_H
00021 #define KEXIFORMDATAITEMINTERFACE_H
00022 
00023 #include <kexidataiteminterface.h>
00024 #include <qwidget.h>
00025 
00026 namespace KexiDB {
00027     class Field;
00028 }
00029 
00031 class KEXIFORMUTILS_EXPORT KexiFormDataItemInterface : public KexiDataItemInterface
00032 {
00033     public:
00034         KexiFormDataItemInterface();
00035         virtual ~KexiFormDataItemInterface();
00036 
00039         inline QString dataSource() const { return m_dataSource; }
00040 
00043         inline void setDataSource(const QString &ds) { m_dataSource = ds; }
00044 
00049         inline QCString dataSourceMimeType() const { return m_dataSourceMimeType; }
00050 
00054         inline void setDataSourceMimeType(const QCString &ds) { m_dataSourceMimeType = ds; }
00055 
00058         virtual QWidget* widget() { return dynamic_cast<QWidget*>(this); }
00059 
00067         virtual void setInvalidState( const QString& displayText ) = 0;
00068 
00070         virtual KexiDB::Field* field() const;
00071 
00073         virtual KexiDB::QueryColumnInfo* columnInfo() const { return m_columnInfo; }
00074 
00079         virtual void setColumnInfo(KexiDB::QueryColumnInfo* cinfo) { m_columnInfo = cinfo; }
00080 
00082         virtual void hideWidget() { }
00083 
00085         virtual void showWidget() { }
00086 
00088         void undoChanges();
00089 
00090     protected:
00091         QString m_dataSource;
00092         QCString m_dataSourceMimeType;
00093         KexiDB::QueryColumnInfo* m_columnInfo;
00094 
00095     friend class KexiDBAutoField;
00096 };
00097 
00098 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys