]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/Menus.h
compile fix (missing forward declaration)
[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         
63         ///
64         bool searchMenu(FuncRequest const & func,
65                 std::vector<docstring> & names) const;
66         ///
67         void fillMenuBar(QMenuBar * qmb, GuiView * view);
68
69         /// \return a top-level submenu given its name.
70         Menu * menu(QString const & name, GuiView & view);
71
72         ///
73         void read(Lexer &);
74
75         ///
76         void updateMenu(Menu * qmenu);
77
78 private:
79         /// Use the Pimpl idiom to hide the internals.
80         struct Impl;
81         /// The pointer never changes although *d's contents may.
82         Impl * const d;
83 };
84
85 } // namespace frontend
86 } // namespace lyx
87
88 #endif // MENUS_H