~ubuntu-branches/ubuntu/maverick/freecad/maverick

« back to all changes in this revision

Viewing changes to src/Gui/DlgActionsImp.h

  • Committer: Bazaar Package Importer
  • Author(s): Teemu Ikonen
  • Date: 2009-07-16 18:37:41 UTC
  • Revision ID: james.westby@ubuntu.com-20090716183741-oww9kcxqrk991i1n
Tags: upstream-0.8.2237
ImportĀ upstreamĀ versionĀ 0.8.2237

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
 *   Copyright (c) 2004 Werner Mayer <werner.wm.mayer@gmx.de>              *
 
3
 *                                                                         *
 
4
 *   This file is part of the FreeCAD CAx development system.              *
 
5
 *                                                                         *
 
6
 *   This library is free software; you can redistribute it and/or         *
 
7
 *   modify it under the terms of the GNU Library General Public           *
 
8
 *   License as published by the Free Software Foundation; either          *
 
9
 *   version 2 of the License, or (at your option) any later version.      *
 
10
 *                                                                         *
 
11
 *   This library  is distributed in the hope that it will be useful,      *
 
12
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 
13
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 
14
 *   GNU Library General Public License for more details.                  *
 
15
 *                                                                         *
 
16
 *   You should have received a copy of the GNU Library General Public     *
 
17
 *   License along with this library; see the file COPYING.LIB. If not,    *
 
18
 *   write to the Free Software Foundation, Inc., 59 Temple Place,         *
 
19
 *   Suite 330, Boston, MA  02111-1307, USA                                *
 
20
 *                                                                         *
 
21
 ***************************************************************************/
 
22
 
 
23
 
 
24
#ifndef GUI_DIALOG_DLGACTIONS_IMP_H
 
25
#define GUI_DIALOG_DLGACTIONS_IMP_H
 
26
 
 
27
#include "ui_DlgActions.h"
 
28
#include "PropertyPage.h"
 
29
 
 
30
 
 
31
namespace Gui {
 
32
namespace Dialog {
 
33
 
 
34
/** This class implements the creation of user defined actions executing a recorded macro.
 
35
 * It is possible to use these actions in own toolbars or commandbars.
 
36
 * @see Gui::Action
 
37
 * @see MacroCommand
 
38
 * @see Command
 
39
 * \author Werner Mayer
 
40
 */
 
41
class DlgCustomActionsImp : public CustomizeActionPage, public Ui_DlgCustomActions
 
42
 
43
    Q_OBJECT
 
44
 
 
45
public:
 
46
    DlgCustomActionsImp( QWidget* parent = 0 );
 
47
    ~DlgCustomActionsImp();
 
48
 
 
49
Q_SIGNALS:
 
50
    void addMacroAction( const QByteArray& );
 
51
    void removeMacroAction( const QByteArray& );
 
52
    void modifyMacroAction( const QByteArray& );
 
53
 
 
54
protected:
 
55
    /** Trigger for reparent event. */
 
56
    bool event(QEvent* e);
 
57
    void showEvent(QShowEvent* e);
 
58
 
 
59
protected Q_SLOTS:
 
60
    /** Enables/disables buttons for deletion */
 
61
    void on_actionListWidget_itemActivated( QTreeWidgetItem *i );
 
62
    /** Opens a iconview to select a pixmap */
 
63
    void on_buttonChoosePixmap_clicked();
 
64
    /** Adds a custom action */
 
65
    void on_buttonAddAction_clicked();
 
66
    /** Deletes a custom action */
 
67
    void on_buttonRemoveAction_clicked();
 
68
    /** Shows the setup of the action */
 
69
    void on_buttonReplaceAction_clicked();
 
70
    void onAddMacroAction(const QByteArray&);
 
71
    void onRemoveMacroAction(const QByteArray&);
 
72
    void onModifyMacroAction(const QByteArray&);
 
73
 
 
74
private:
 
75
    /** Shows all actions and their pixmaps if available  */
 
76
    void showActions();
 
77
    /** Name for the new created action */
 
78
    QString newActionName();
 
79
 
 
80
private:
 
81
    bool bShown; /**< For internal use only*/
 
82
    QString m_sPixmap; /**< Name of the specified pixmap */
 
83
};
 
84
 
 
85
} // namespace Dialog
 
86
} // namespace Gui
 
87
 
 
88
#endif // GUI_DIALOG_DLGACTIONS_IMP_H