]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/Menus.h
Substack support for XHTML.
[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 #include <vector>
19
20 class QString;
21 class QMenuBar;
22
23 namespace lyx {
24
25 class docstring_list;
26 class Lexer;
27 class FuncRequest;
28
29 namespace frontend {
30
31 class GuiView;
32
33 class Menu : public QMenu
34 {
35         Q_OBJECT
36 public:
37         ///
38         Menu(GuiView * gv, QString const & name, bool top_level,
39                 bool keyboard = false);
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         void reset();
66         
67         ///
68         bool searchMenu(FuncRequest const & func,
69                 docstring_list & names) const;
70         ///
71         void fillMenuBar(QMenuBar * qmb, GuiView * view, bool initial = false);
72
73         /// \return a top-level submenu given its name.
74         Menu * menu(QString const & name, GuiView & view, bool keyboard = false);
75
76         ///
77         void read(Lexer &);
78
79         ///
80         void updateMenu(Menu * qmenu);
81
82 private:
83         /// Use the Pimpl idiom to hide the internals.
84         struct Impl;
85         ///
86         Impl * d;
87 };
88
89 } // namespace frontend
90 } // namespace lyx
91
92 #endif // MENUS_H