GuiPrintNomencl.{cpp,h}:
[lyx.git] / src / frontends / qt4 / Menus.h
blob1ab407a5e100c077f7193f1c28b98f777cabc3bb
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.
7 * \author Lars Gullik Bjønnes
8 * \author John Levon
10 * Full author contact details are available in file CREDITS.
13 #ifndef MENUS_H
14 #define MENUS_H
16 #include <QMenu>
18 #include <vector>
20 class QString;
21 class QMenuBar;
23 namespace lyx {
25 class docstring_list;
26 class Lexer;
27 class FuncRequest;
29 namespace frontend {
31 class GuiView;
33 class Menu : public QMenu
35 Q_OBJECT
36 public:
37 ///
38 Menu(GuiView * gv, QString const & name, bool top_level);
40 ///
41 ~Menu();
43 private Q_SLOTS:
44 ///
45 void updateView();
47 private:
48 friend class Menus;
50 /// Use the Pimpl idiom to hide the internals.
51 struct Impl;
52 /// The pointer never changes although *d's contents may.
53 Impl * const d;
57 class Menus
59 public:
60 Menus();
61 ~Menus();
63 ///
64 void reset();
66 ///
67 bool searchMenu(FuncRequest const & func,
68 docstring_list & names) const;
69 ///
70 void fillMenuBar(QMenuBar * qmb, GuiView * view, bool initial = false);
72 /// \return a top-level submenu given its name.
73 Menu * menu(QString const & name, GuiView & view);
75 ///
76 void read(Lexer &);
78 ///
79 void updateMenu(Menu * qmenu);
81 private:
82 /// Use the Pimpl idiom to hide the internals.
83 struct Impl;
84 ///
85 Impl * d;
88 } // namespace frontend
89 } // namespace lyx
91 #endif // MENUS_H