]> git.lyx.org Git - features.git/blob - src/frontends/qt4/GuiMenubar.h
Don't pretend we have multiple menu backends: transfer the singleton to GuiApplication.
[features.git] / src / frontends / qt4 / GuiMenubar.h
1 // -*- C++ -*-
2 /**
3  * \file GuiMenubar.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 GUIMENUBAR_H
14 #define GUIMENUBAR_H
15
16 #include <QObject>
17 #include <QHash>
18
19 class QMenuBar;
20
21 namespace lyx {
22 namespace frontend {
23
24 class GuiView;
25 class GuiPopupMenu;
26 class GuiView;
27
28 class GuiMenubar : public QObject
29 {
30         Q_OBJECT
31 public:
32         GuiMenubar(GuiView *);
33
34         ~GuiMenubar();
35
36         ///
37         void init();
38
39         /// opens a top-level submenu given its name
40         void openByName(QString const & name);
41
42         /// return the owning view
43         GuiView * view() { return owner_; }
44
45         /// update the state of the menuitems - not needed
46         void updateView();
47
48 private:
49         /// Initialize specific MACOS X menubar
50         void macxMenuBarInit();
51
52         /// owning view
53         GuiView * owner_;
54
55         typedef QHash<QString, GuiPopupMenu *> NameMap;
56
57         /// name to menu for openByName
58         NameMap name_map_;
59
60         /// MACOS X special menubar.
61         QMenuBar * mac_menubar_;
62 };
63
64 } // namespace frontend
65 } // namespace lyx
66
67 #endif // GUIMENUBAR_H