]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/Action.h
code cosmetics whitespace, unneeded lyx:: qualification, indentation, unneeded destru...
[lyx.git] / src / frontends / qt4 / Action.h
1 // -*- C++ -*-
2 /**
3  * \file Action.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Abdelrazak Younes
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef ACTION_H
13 #define ACTION_H
14
15 #include "frontends/LyXView.h"
16 #include "funcrequest.h"
17
18 #include "support/docstring.h"
19
20 #include <QAction>
21
22 namespace lyx {
23 namespace frontend {
24
25 class GuiView;
26
27 /**
28  * Action - Qt interface with LyX' FuncRequest.
29  *
30  * Action can be used in LyX menubar and/or toolbars.
31  */
32 class Action : public QAction {
33         Q_OBJECT
34 public:
35
36         Action(GuiView & lyxView, docstring const & text,
37                 FuncRequest const & func, docstring const & tooltip = docstring());
38
39         Action(GuiView & lyxView, std::string const & icon, docstring const & text,
40                 FuncRequest const & func, docstring const & tooltip = docstring());
41
42         void update();
43
44 //      void setAction(FuncRequest const & func);
45
46 Q_SIGNALS:
47         /// the current action is triggered
48         void triggered(QAction *);
49
50 private Q_SLOTS:
51         void action();
52
53 private:
54         FuncRequest const & func_ ;
55         GuiView & lyxView_;
56 };
57
58
59 } // namespace frontend
60 } // namespace lyx
61
62 #endif // ACTION_H