summaryrefslogtreecommitdiffstats
path: root/kexi/formeditor/connectiondialog.h
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-01-20 01:29:50 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-01-20 01:29:50 +0000
commit8362bf63dea22bbf6736609b0f49c152f975eb63 (patch)
tree0eea3928e39e50fae91d4e68b21b1e6cbae25604 /kexi/formeditor/connectiondialog.h
downloadkoffice-8362bf63dea22bbf6736609b0f49c152f975eb63.tar.gz
koffice-8362bf63dea22bbf6736609b0f49c152f975eb63.zip
Added old abandoned KDE3 version of koffice
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1077364 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kexi/formeditor/connectiondialog.h')
-rw-r--r--kexi/formeditor/connectiondialog.h114
1 files changed, 114 insertions, 0 deletions
diff --git a/kexi/formeditor/connectiondialog.h b/kexi/formeditor/connectiondialog.h
new file mode 100644
index 00000000..3e6ac07b
--- /dev/null
+++ b/kexi/formeditor/connectiondialog.h
@@ -0,0 +1,114 @@
+/* This file is part of the KDE project
+ Copyright (C) 2004 Cedric Pasteur <cedric.pasteur@free.fr>
+ Copyright (C) 2004 Jaroslaw Staniek <js@iidea.pl>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef FORMCONNECTIONDIALOG_H
+#define FORMCONNECTIONDIALOG_H
+
+#include <qintdict.h>
+#include <kdialogbase.h>
+
+namespace KexiDB {
+ class ResultInfo;
+}
+
+class QLabel;
+class QButton;
+class KexiTableView;
+class KexiTableViewData;
+class KexiTableItem;
+
+namespace KFormDesigner {
+
+class Form;
+class ConnectionBuffer;
+class Connection;
+
+
+/*! This dialog is used to edit the connections of a form. It uses KexiTableView for this. There is also a details widget (icon + text)) that shows correctness
+ of current connection. */
+class KFORMEDITOR_EXPORT ConnectionDialog : public KDialogBase
+{
+ Q_OBJECT
+
+ public:
+ ConnectionDialog(QWidget *parent);
+ ~ConnectionDialog() {;}
+
+ /*! Displays as modal dialog, to edit connections in Form::connectionBuffer(). */
+ void exec(Form *form);
+
+ protected:
+ /*! Used when connection is ok. Displays a message in details widget and changes icon in 'OK?' column. */
+ void setStatusOk(KexiTableItem *item = 0);
+ /*! Used when connection is wrong. Displays a message in details widget and changes icon in 'OK?' column. \a msg is
+ the message explaining what's wrong. */
+ void setStatusError(const QString &msg, KexiTableItem *item = 0);
+ //! Inits table data, columns, etc.
+ void initTable();
+ /*! Updates the widget list (shown in receiver and sender columns). Then fill in the table with the connections in m_buffer. */
+ void updateTableData();
+ /*! Updates the slot list, according to the receiver name, and only shows those who are compatible with signal args. */
+ void updateSlotList(KexiTableItem *item);
+ //! Updates the signal list, according to the sender name.
+ void updateSignalList(KexiTableItem *item);
+
+ protected slots:
+ /*! Slot called when the user modifies a cell. Signal and/or slot cells are cleared if necessary (not valid anymore). */
+ void slotCellChanged(KexiTableItem*, int, QVariant&, KexiDB::ResultInfo*);
+ /*! This function checks if the connection represented by KexiTableItem \a item is valid. It checks if all args (sender, receiver, signal and slot)
+ are given, and then if signal/slot args are compatible (should be always true, as we don't show non-compatible slots). It calls \ref setStatusOk()
+ or \ref setStatusError() following the result of checks. */
+ void checkConnection(KexiTableItem *item);
+
+ /*! Hides the dialog and allow the user to create the Connection by drag-and-drop in the Form itself. Currently disabled in the GUI.
+ \sa FormManager::startCreatingConnection() */
+ void newItemByDragnDrop();
+ /*! Creates a new item. It just moves the cursor to the last empty row. */
+ void newItem();
+ void removeItem();
+
+ /*! This slot is called when the user ends connection creation (when in drag-and-drop mode). The dialog is restored,
+ and the created connection is added to the list. */
+ void slotConnectionCreated(KFormDesigner::Form *form, KFormDesigner::Connection &connection);
+ /*! This slot is called when the user aborts connection creation (when in drag-and-drop mode). The dialog is restored,
+ and an empty connection is created. */
+ void slotConnectionAborted(KFormDesigner::Form *form);
+
+ void slotCellSelected(int col, int row);
+ void slotRowInserted(KexiTableItem*,bool);
+
+ /*! Slot called when the user presses 'Ok' button. The Form::connectionBuffer() is deleted, created again and filled with Connection.
+ If the user presses 'Cancel', nothing happens. */
+ virtual void slotOk();
+
+ protected:
+ enum {BAdd = 10, BRemove};
+ Form *m_form;
+ ConnectionBuffer *m_buffer;
+ KexiTableView *m_table;
+ KexiTableViewData *m_data;
+ KexiTableViewData *m_widgetsColumnData, *m_slotsColumnData, *m_signalsColumnData;
+ QLabel *m_pixmapLabel, *m_textLabel;
+ QIntDict<QButton> m_buttons; //! dict of button (for disabling them)
+};
+
+}
+
+#endif