]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/Menus.h
Encapsulate all menu related stuff inside Menu.cpp and simplify a few things.
[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 <vector>
19
20 class QMenu;
21 class QString;
22
23 namespace lyx {
24
25 class Lexer;
26 class Buffer;
27 class FuncRequest;
28 class Toc;
29
30 namespace frontend {
31
32 class GuiView;
33
34 class Menus
35 {
36 public:
37         Menus();
38         
39         ///
40         bool searchMenu(FuncRequest const & func,
41                 std::vector<docstring> & names) const;
42         ///
43         void fillMenuBar(GuiView * view);
44
45         /// \return a top-level submenu given its name.
46         QMenu * menu(QString const & name);
47
48         ///
49         void read(Lexer &);
50
51         ///
52         void updateMenu(QString const & name);
53
54 private:
55         /// Use the Pimpl idiom to hide the internals.
56         struct Impl;
57         /// The pointer never changes although *d's contents may.
58         Impl * const d;
59 };
60
61 } // namespace frontend
62 } // namespace lyx
63
64 #endif // MENUS_H