kexi

connectiondialog.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2004 Cedric Pasteur <cedric.pasteur@free.fr>
00003    Copyright (C) 2004 Jaroslaw Staniek <js@iidea.pl>
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License as published by the Free Software Foundation; either
00008    version 2 of the License, or (at your option) any later version.
00009 
00010    This library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018  * Boston, MA 02110-1301, USA.
00019 */
00020 
00021 #ifndef FORMCONNECTIONDIALOG_H
00022 #define FORMCONNECTIONDIALOG_H
00023 
00024 #include <qintdict.h>
00025 #include <kdialogbase.h>
00026 
00027 namespace KexiDB {
00028     class ResultInfo;
00029 }
00030 
00031 class QLabel;
00032 class QButton;
00033 class KexiTableView;
00034 class KexiTableViewData;
00035 class KexiTableItem;
00036 
00037 namespace KFormDesigner {
00038 
00039 class Form;
00040 class ConnectionBuffer;
00041 class Connection;
00042 
00043 
00046 class KFORMEDITOR_EXPORT ConnectionDialog : public KDialogBase
00047 {
00048     Q_OBJECT
00049 
00050     public:
00051         ConnectionDialog(QWidget *parent);
00052         ~ConnectionDialog() {;}
00053 
00055         void exec(Form *form);
00056 
00057     protected:
00059         void setStatusOk(KexiTableItem *item = 0);
00062         void setStatusError(const QString &msg, KexiTableItem *item = 0);
00064         void initTable();
00066         void updateTableData();
00068         void updateSlotList(KexiTableItem *item);
00070         void updateSignalList(KexiTableItem *item);
00071 
00072     protected slots:
00074         void slotCellChanged(KexiTableItem*, int, QVariant&, KexiDB::ResultInfo*);
00078         void checkConnection(KexiTableItem *item);
00079 
00082         void newItemByDragnDrop();
00084         void newItem();
00085         void removeItem();
00086 
00089         void slotConnectionCreated(KFormDesigner::Form *form, KFormDesigner::Connection &connection);
00092         void slotConnectionAborted(KFormDesigner::Form *form);
00093 
00094         void slotCellSelected(int col, int row);
00095         void slotRowInserted(KexiTableItem*,bool);
00096 
00099         virtual void slotOk();
00100 
00101     protected:
00102         enum {BAdd = 10, BRemove};
00103         Form    *m_form;
00104         ConnectionBuffer *m_buffer;
00105         KexiTableView  *m_table;
00106         KexiTableViewData  *m_data;
00107         KexiTableViewData *m_widgetsColumnData, *m_slotsColumnData, *m_signalsColumnData;
00108         QLabel  *m_pixmapLabel, *m_textLabel;
00109         QIntDict<QButton>  m_buttons;  
00110 };
00111 
00112 }
00113 
00114 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys