kexidatasourcepage.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#ifndef KEXIDATASOURCEPAGE_H
20#define KEXIDATASOURCEPAGE_H
21
22#include <tqwidget.h>
23#include <kexidb/field.h>
24#include <kexidb/utils.h>
25#include <koproperty/set.h>
26
27class KCommand;
32class KexiProject;
33class TQToolButton;
34class TQLabel;
35class TQFrame;
36
38class KEXIFORMUTILS_EXPORT KexiDataSourcePage : public TQWidget
39{
40 TQ_OBJECT
41
42
43 public:
44 KexiDataSourcePage(TQWidget *parent, const char *name = 0);
45 virtual ~KexiDataSourcePage();
46
47 KexiDataSourceComboBox* dataSourceCombo() const { return m_dataSourceCombo; }
48 KexiObjectInfoLabel* objectInfoLabel() const { return m_objectInfoLabel; }
49
50 public slots:
51 void setProject(KexiProject *prj);
52 void clearDataSourceSelection(bool alsoClearComboBox = true);
53 void clearWidgetDataSourceSelection();
54
57 void setDataSource(const TQCString& mimeType, const TQCString& name);
58
60 void assignPropertySet(KoProperty::Set* propertySet);
61
62 signals:
64 void jumpToObjectRequested(const TQCString& mime, const TQCString& name);
65
67 void formDataSourceChanged(const TQCString& mime, const TQCString& name);
68
72 void dataSourceFieldOrExpressionChanged(const TQString& string, const TQString& caption,
74
76 void insertAutoFields(const TQString& sourceMimeType, const TQString& sourceName,
77 const TQStringList& fields);
78
79 protected slots:
80 void slotDataSourceTextChanged(const TQString & string);
81 void slotDataSourceChanged();
82 void slotFieldSelected();
83 void slotGotoSelected();
84 void slotInsertSelectedFields();
85 void slotFieldListViewSelectionChanged();
86 void slotFieldDoubleClicked(const TQString& sourceMimeType, const TQString& sourceName,
87 const TQString& fieldName);
88
89 protected:
90 void updateSourceFieldWidgetsAvailability();
91
92 KexiFieldComboBox *m_sourceFieldCombo;
93 KexiObjectInfoLabel *m_objectInfoLabel;
94 KexiDataSourceComboBox* m_dataSourceCombo;
95 TQLabel *m_dataSourceLabel, *m_noDataSourceAvailableLabel,
96 *m_widgetDSLabel, *m_availableFieldsLabel,
97 *m_mousePointerLabel, *m_availableFieldsDescriptionLabel;
98 TQToolButton *m_clearWidgetDSButton, *m_clearDSButton, *m_gotoButton, *m_addField;
99 TQFrame *m_dataSourceSeparator;
100 TQString m_noDataSourceAvailableSingleText, m_noDataSourceAvailableMultiText;
101 bool m_insideClearDataSourceSelection : 1;
102#ifdef KEXI_NO_AUTOFIELD_WIDGET
103 KexiDB::TableOrQuerySchema *m_tableOrQuerySchema;
104#else
105 KexiFieldListView* m_fieldListView;
106#endif
107
110 //TQGuardedPtr<KoProperty::Set> m_propertySet;
111};
112
113#endif
A combo box listing availabe data sources (tables and queries) with icons.
A page within form designer's property tabbed pane, providing data source editor.
void formDataSourceChanged(const TQCString &mime, const TQCString &name)
Signal emitted when form's data source has been changed. It's connected to the Form Manager.
void dataSourceFieldOrExpressionChanged(const TQString &string, const TQString &caption, KexiDB::Field::Type type)
TQCString m_currentObjectName
Used only in assignPropertySet() to check whether we already have the set assigned.
void jumpToObjectRequested(const TQCString &mime, const TQCString &name)
Signal emitted when helper button 'go to selected data source' is clicked.
void insertAutoFields(const TQString &sourceMimeType, const TQString &sourceName, const TQStringList &fields)
Helper class displaying small icon with class name and object name.
A project's main controller.
Definition kexiproject.h:68