kexi

kexidataprovider.h
1/* This file is part of the KDE project
2 Copyright (C) 2005 Jaroslaw Staniek <js@iidea.pl>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#ifndef KEXIFORMDATAPROVIDER_H
21#define KEXIFORMDATAPROVIDER_H
22
23#include "kexiformdataiteminterface.h"
24#include <tqptrdict.h>
25#include <tqdict.h>
26
27class KexiTableItem;
28namespace KexiDB {
29 class QuerySchema;
30}
31
33
43class KEXIFORMUTILS_EXPORT KexiFormDataProvider : public KexiDataItemChangesListener
44{
45 public:
46 KexiFormDataProvider();
47 virtual ~KexiFormDataProvider();
48
53 void setMainDataSourceWidget(TQWidget* mainWidget);
54
55 TQStringList usedDataSources() const { return m_usedDataSources; }
56
57 //unused TQPtrList<KexiFormDataItemInterface>& dataItems() { return m_dataItems; }
58
61 void fillDataItems(KexiTableItem& row, bool cursorAtNewRow);
62
65 virtual void valueChanged(KexiDataItemInterface* item);
66
71 virtual bool cursorAtNewRow() const;
72
77 void invalidateDataSources( const TQDict<char>& invalidSources,
78 KexiDB::QuerySchema* query = 0 );
79
83 void fillDuplicatedDataItems(KexiFormDataItemInterface* item, const TQVariant& value);
84
85 protected:
86 TQWidget *m_mainWidget;
87 TQPtrDict<char> *m_duplicatedItems;
88 typedef TQMap<KexiFormDataItemInterface*,uint> KexiFormDataItemInterfaceToIntMap;
89 TQPtrList<KexiFormDataItemInterface> m_dataItems;
90 TQStringList m_usedDataSources;
91 KexiFormDataItemInterfaceToIntMap m_fieldNumbersForDataItems;
92 bool m_disableFillDuplicatedDataItems : 1;
93};
94
95#endif
KexiDB::QuerySchema provides information about database query.
virtual void valueChanged(KexiDataItemInterface *item)=0
virtual bool cursorAtNewRow() const =0
An interface for declaring widgets to be data-aware.
An interface for declaring form widgets to be data-aware.
void setMainDataSourceWidget(TQWidget *mainWidget)
void fillDuplicatedDataItems(KexiFormDataItemInterface *item, const TQVariant &value)
void invalidateDataSources(const TQDict< char > &invalidSources, KexiDB::QuerySchema *query=0)
virtual bool cursorAtNewRow() const
void fillDataItems(KexiTableItem &row, bool cursorAtNewRow)
High-level database connectivity library with database backend drivers.