]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/Menus.h
Add missing initialization
[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 <QMenu>
17
18 class QString;
19 class QMenuBar;
20
21 namespace lyx {
22
23 class docstring_list;
24 class Lexer;
25 class FuncRequest;
26
27 namespace frontend {
28
29 class GuiView;
30
31 class Menu : public QMenu
32 {
33         Q_OBJECT
34 public:
35         ///
36         Menu(GuiView * gv, QString const & name, bool top_level,
37                 bool keyboard = false);
38
39         ///
40         ~Menu();
41
42         /// QMenu::clear() reimplementation to handle the deletion of submenus.
43         void clear();
44
45 private Q_SLOTS:
46         ///
47         void updateView();
48
49 private:
50         friend class Menus;
51
52         /// Use the Pimpl idiom to hide the internals.
53         struct Impl;
54         /// The pointer never changes although *d's contents may.
55         Impl * const d;
56 };
57
58
59 class Menus
60 {
61         /// noncopyable
62         Menus(Menus const &);
63         void operator=(Menus const &);
64 public:
65         Menus();
66         ~Menus();
67
68         ///
69         void reset();
70
71         ///
72         bool searchMenu(FuncRequest const & func,
73                 docstring_list & names) const;
74         ///
75         void fillMenuBar(QMenuBar * qmb, GuiView * view, bool initial = false);
76
77         /// \return a top-level submenu given its name.
78         Menu * menu(QString const & name, GuiView & view, bool keyboard = false);
79
80         ///
81         void read(Lexer &);
82
83         ///
84         void updateMenu(Menu * qmenu);
85
86 private:
87         /// Use the Pimpl idiom to hide the internals.
88         struct Impl;
89         ///
90         Impl * d;
91 };
92
93 } // namespace frontend
94 } // namespace lyx
95
96 #endif // MENUS_H