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