kexi

kexidatasourcepage.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 #ifndef KEXIDATASOURCEPAGE_H
00020 #define KEXIDATASOURCEPAGE_H
00021 
00022 #include <qwidget.h>
00023 #include <kexidb/field.h>
00024 #include <kexidb/utils.h>
00025 #include <koproperty/set.h>
00026 
00027 class KCommand;
00028 class KexiObjectInfoLabel;
00029 class KexiDataSourceComboBox;
00030 class KexiFieldComboBox;
00031 class KexiFieldListView;
00032 class KexiProject;
00033 class QToolButton;
00034 class QLabel;
00035 class QFrame;
00036 
00038 class KEXIFORMUTILS_EXPORT KexiDataSourcePage : public QWidget
00039 {
00040     Q_OBJECT
00041 
00042     public:
00043         KexiDataSourcePage(QWidget *parent, const char *name = 0);
00044         virtual ~KexiDataSourcePage();
00045 
00046         KexiDataSourceComboBox* dataSourceCombo() const { return m_dataSourceCombo; }
00047         KexiObjectInfoLabel* objectInfoLabel() const { return m_objectInfoLabel; }
00048 
00049     public slots:
00050         void setProject(KexiProject *prj);
00051         void clearDataSourceSelection(bool alsoClearComboBox = true);
00052         void clearWidgetDataSourceSelection();
00053 
00056         void setDataSource(const QCString& mimeType, const QCString& name);
00057 
00059         void assignPropertySet(KoProperty::Set* propertySet);
00060 
00061     signals:
00063         void jumpToObjectRequested(const QCString& mime, const QCString& name);
00064 
00066         void formDataSourceChanged(const QCString& mime, const QCString& name);
00067 
00071         void dataSourceFieldOrExpressionChanged(const QString& string, const QString& caption,
00072             KexiDB::Field::Type type);
00073 
00075         void insertAutoFields(const QString& sourceMimeType, const QString& sourceName,
00076             const QStringList& fields);
00077 
00078     protected slots:
00079         void slotDataSourceTextChanged(const QString & string);
00080         void slotDataSourceChanged();
00081         void slotFieldSelected();
00082         void slotGotoSelected();
00083         void slotInsertSelectedFields();
00084         void slotFieldListViewSelectionChanged();
00085         void slotFieldDoubleClicked(const QString& sourceMimeType, const QString& sourceName,
00086             const QString& fieldName);
00087 
00088     protected:
00089         void updateSourceFieldWidgetsAvailability();
00090 
00091         KexiFieldComboBox *m_sourceFieldCombo;
00092         KexiObjectInfoLabel *m_objectInfoLabel;
00093         KexiDataSourceComboBox* m_dataSourceCombo;
00094         QLabel *m_dataSourceLabel, *m_noDataSourceAvailableLabel, 
00095             *m_widgetDSLabel, *m_availableFieldsLabel,
00096             *m_mousePointerLabel, *m_availableFieldsDescriptionLabel;
00097         QToolButton *m_clearWidgetDSButton, *m_clearDSButton, *m_gotoButton, *m_addField;
00098         QFrame *m_dataSourceSeparator;
00099         QString m_noDataSourceAvailableSingleText, m_noDataSourceAvailableMultiText;
00100         bool m_insideClearDataSourceSelection : 1;
00101 #ifdef KEXI_NO_AUTOFIELD_WIDGET
00102         KexiDB::TableOrQuerySchema *m_tableOrQuerySchema; 
00103 #else
00104         KexiFieldListView* m_fieldListView;
00105 #endif
00106 
00108         QCString m_currentObjectName;
00109         //QGuardedPtr<KoProperty::Set> m_propertySet;
00110 };
00111 
00112 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys