]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/Action.h
Cleanup Action class: The mother should be the main window (GuiView). This will hopef...
[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 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