]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/Menus.h
Complete the removal of the embedding stuff. Maybe. It's hard to be sure we got every...
[lyx.git] / src / frontends / qt4 / Menus.h
1 // -*- C++ -*-
2 /**
3  * \file Menus.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Lars Gullik Bjønnes
8  * \author John Levon
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef MENUS_H
14 #define MENUS_H
15
16 #include "support/docstring.h"
17
18 #include <QMenu>
19
20 #include <vector>
21
22 class QString;
23 class QMenuBar;
24
25 namespace lyx {
26
27 class Lexer;
28 class FuncRequest;
29
30 namespace frontend {
31
32 class GuiView;
33
34 class Menu : public QMenu
35 {
36         Q_OBJECT
37 public:
38         ///
39         Menu(GuiView * gv, QString const & name, bool top_level);
40
41         ///
42         ~Menu();
43         
44 private Q_SLOTS:
45         ///
46         void updateView();
47
48 private:
49         friend class Menus;
50
51         /// Use the Pimpl idiom to hide the internals.
52         struct Impl;
53         /// The pointer never changes although *d's contents may.
54         Impl * const d;
55 };
56
57
58 class Menus
59 {
60 public:
61         Menus();
62         ~Menus();
63         
64         ///
65         bool searchMenu(FuncRequest const & func,
66                 std::vector<docstring> & names) const;
67         ///
68         void fillMenuBar(QMenuBar * qmb, GuiView * view, bool initial = false);
69
70         /// \return a top-level submenu given its name.
71         Menu * menu(QString const & name, GuiView & view);
72
73         ///
74         void read(Lexer &);
75
76         ///
77         void updateMenu(Menu * qmenu);
78
79 private:
80         /// Use the Pimpl idiom to hide the internals.
81         struct Impl;
82         /// The pointer never changes although *d's contents may.
83         Impl * const d;
84 };
85
86 } // namespace frontend
87 } // namespace lyx
88
89 #endif // MENUS_H