File indexing completed on 2024-05-12 16:39:50

0001 /* This file is part of the KDE project
0002    Copyright (C) 2005-2006 Jarosław Staniek <staniek@kde.org>
0003    Copyright (C) 2012 Adam Pigg <adam@piggz.co.uk>
0004 
0005    This library is free software; you can redistribute it and/or
0006    modify it under the terms of the GNU Library General Public
0007    License as published by the Free Software Foundation; either
0008    version 2 of the License, or (at your option) any later version.
0009 
0010    This library is distributed in the hope that it will be useful,
0011    but WITHOUT ANY WARRANTY; without even the implied warranty of
0012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0013    Library General Public License for more details.
0014 
0015    You should have received a copy of the GNU Library General Public License
0016    along with this library; see the file COPYING.LIB.  If not, write to
0017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0018  * Boston, MA 02110-1301, USA.
0019 */
0020 
0021 #ifndef KEXIACTIONSELECTIONDIALOG_H
0022 #define KEXIACTIONSELECTIONDIALOG_H
0023 
0024 #include "kformdesigner_export.h"
0025 #include "kexiformeventhandler.h"
0026 
0027 #include <QDialog>
0028 
0029 class QTreeWidgetItem;
0030 
0031 namespace KexiPart
0032 {
0033 class Item;
0034 }
0035 
0036 //! @short A dialog for selecting an action to be executed for a form's button
0037 /*! Available actions are:
0038  - application's global actions like "edit->copy" (QAction-based)
0039  - opening/printing/executing of selected object (table/query/form/script/macrto, etc.)
0040 */
0041 class KFORMDESIGNER_EXPORT KexiActionSelectionDialog : public QDialog
0042 {
0043     Q_OBJECT
0044 public:
0045     KexiActionSelectionDialog(QWidget *parent,
0046                               const KexiFormEventAction::ActionData& action, const QString& actionWidgetName);
0047     ~KexiActionSelectionDialog();
0048 
0049     /*! \return selected action data or empty action if dialog has been rejected
0050      or "No action" has been selected. */
0051     KexiFormEventAction::ActionData currentAction() const;
0052 
0053 protected Q_SLOTS:
0054     void slotActionCategorySelected(QTreeWidgetItem* item);
0055     void slotKActionItemExecuted(QTreeWidgetItem*);
0056     void slotKActionItemSelected(QTreeWidgetItem*);
0057     void slotActionToExecuteItemExecuted(QTreeWidgetItem* item);
0058     void slotActionToExecuteItemSelected(QTreeWidgetItem*);
0059     void slotCurrentFormActionItemExecuted(QTreeWidgetItem*);
0060     void slotCurrentFormActionItemSelected(QTreeWidgetItem*);
0061     void slotItemForOpeningOrExecutingSelected(KexiPart::Item* item);
0062 
0063 protected:
0064     void updateOKButtonStatus();
0065 
0066     class Private;
0067     Private* const d;
0068 };
0069 
0070 #endif