]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/Action.h
* Action.[Ch]
[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 //class FuncRequest;
23
24 //class string;
25
26 namespace lyx {
27 namespace frontend {
28
29 class GuiView;
30
31 /**
32  * Action - Qt interface with LyX' FuncRequest.
33  *
34  * Action can be used in LyX menubar and/or toolbars.
35  */
36 class Action: public QAction {
37         Q_OBJECT
38 public:
39
40         Action(GuiView & lyxView, lyx::docstring const & text,
41                 FuncRequest const & func, lyx::docstring const & tooltip = lyx::docstring());
42
43         Action(GuiView & lyxView, std::string const & icon, lyx::docstring const & text,
44                 FuncRequest const & func, lyx::docstring const & tooltip = lyx::docstring());
45
46         void update();
47
48 //      void setAction(FuncRequest const & func);
49
50 Q_SIGNALS:
51         /// the current action is triggered
52         void triggered(QAction *);
53
54 private Q_SLOTS:
55         void action();
56
57 private:
58         FuncRequest const & func_ ;
59         GuiView & lyxView_;
60 };
61
62
63 } // namespace frontend
64 } // namespace lyx
65
66 #endif // ACTION_H