kexi

kexidataprovider.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2005 Jaroslaw Staniek <js@iidea.pl>
00003 
00004    This library 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 library 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 library; see the file COPYING.LIB.  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 KEXIFORMDATAPROVIDER_H
00021 #define KEXIFORMDATAPROVIDER_H
00022 
00023 #include "kexiformdataiteminterface.h"
00024 #include <qptrdict.h>
00025 
00026 class KexiTableItem;
00027 namespace KexiDB {
00028     class QuerySchema;
00029 }
00030 
00032 
00042 class KEXIFORMUTILS_EXPORT KexiFormDataProvider : public KexiDataItemChangesListener
00043 {
00044     public:
00045         KexiFormDataProvider();
00046         virtual ~KexiFormDataProvider();
00047 
00052         void setMainDataSourceWidget(QWidget* mainWidget);
00053 
00054         QStringList usedDataSources() const { return m_usedDataSources; }
00055 
00056         //unused QPtrList<KexiFormDataItemInterface>& dataItems() { return m_dataItems; }
00057 
00059         void fillDataItems(KexiTableItem& row);// KexiDB::Cursor& cursor);
00060 
00063         virtual void valueChanged(KexiDataItemInterface* item);
00064 
00069         virtual bool cursorAtNewRow();
00070 
00075         void invalidateDataSources( const QValueList<uint>& invalidSources, 
00076             KexiDB::QuerySchema* query = 0 );
00077 
00081         void fillDuplicatedDataItems(KexiFormDataItemInterface* item, const QVariant& value);
00082 
00083     protected:
00084         QWidget *m_mainWidget;
00085         QPtrDict<char> *m_duplicatedItems;
00086         typedef QMap<KexiFormDataItemInterface*,uint> KexiFormDataItemInterfaceToIntMap;
00087         QPtrList<KexiFormDataItemInterface> m_dataItems;
00088         QStringList m_usedDataSources;
00089         KexiFormDataItemInterfaceToIntMap m_fieldNumbersForDataItems;
00090         bool m_disableFillDuplicatedDataItems;
00091 };
00092 
00093 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys