]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/Menus.h
initial basic context menu support.
[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 "MenuBackend.h"
17
18 #include <QObject>
19 #include <QHash>
20
21 namespace lyx {
22 namespace frontend {
23
24 class GuiView;
25 class GuiPopupMenu;
26 class GuiView;
27
28 class Menus : public QObject, public MenuBackend
29 {
30         Q_OBJECT
31 public:
32         Menus() {}
33
34         ///
35         void fillMenuBar(GuiView * view);
36
37         /// \return a top-level submenu given its name.
38         QMenu * menu(QString const & name);
39
40         /// update the state of the menuitems - not needed
41         void updateView();
42
43 private:
44         /// Initialize specific MACOS X menubar
45         void macxMenuBarInit(GuiView * view);
46
47         typedef QHash<QString, GuiPopupMenu *> NameMap;
48
49         /// name to menu for \c menu() method.
50         NameMap name_map_;
51 };
52
53 } // namespace frontend
54 } // namespace lyx
55
56 #endif // MENUS_H