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 #include <qdict.h>
00026 
00027 class KexiTableItem;
00028 namespace KexiDB {
00029     class QuerySchema;
00030 }
00031 
00033 
00043 class KEXIFORMUTILS_EXPORT KexiFormDataProvider : public KexiDataItemChangesListener
00044 {
00045     public:
00046         KexiFormDataProvider();
00047         virtual ~KexiFormDataProvider();
00048 
00053         void setMainDataSourceWidget(QWidget* mainWidget);
00054 
00055         QStringList usedDataSources() const { return m_usedDataSources; }
00056 
00057         //unused QPtrList<KexiFormDataItemInterface>& dataItems() { return m_dataItems; }
00058 
00061         void fillDataItems(KexiTableItem& row, bool cursorAtNewRow);
00062 
00065         virtual void valueChanged(KexiDataItemInterface* item);
00066 
00071         virtual bool cursorAtNewRow() const;
00072 
00077         void invalidateDataSources( const QDict<char>& invalidSources, 
00078             KexiDB::QuerySchema* query = 0 );
00079 
00083         void fillDuplicatedDataItems(KexiFormDataItemInterface* item, const QVariant& value);
00084 
00085     protected:
00086         QWidget *m_mainWidget;
00087         QPtrDict<char> *m_duplicatedItems;
00088         typedef QMap<KexiFormDataItemInterface*,uint> KexiFormDataItemInterfaceToIntMap;
00089         QPtrList<KexiFormDataItemInterface> m_dataItems;
00090         QStringList m_usedDataSources;
00091         KexiFormDataItemInterfaceToIntMap m_fieldNumbersForDataItems;
00092         bool m_disableFillDuplicatedDataItems : 1;
00093 };
00094 
00095 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys