]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiMenubar.h
cosmetics
[lyx.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
23 class MenuBackend;
24
25 namespace frontend {
26
27 class GuiViewBase;
28 class GuiPopupMenu;
29 class LyXView;
30
31 class GuiMenubar : public QObject
32 {
33         Q_OBJECT
34 public:
35         GuiMenubar(LyXView *, MenuBackend &);
36
37         /// opens a top-level submenu given its name
38         void openByName(QString const & name);
39
40         /// return the owning view
41         GuiViewBase * view() { return owner_; }
42
43         /// return the menu controller
44         MenuBackend const & backend() { return menubackend_; }
45
46         /// The QMenuBar used by LyX
47         QMenuBar * menuBar() const;
48
49         /// update the state of the menuitems - not needed
50         void updateView();
51
52 private:
53         /// Initialize specific MACOS X menubar
54         void macxMenuBarInit();
55
56         /// owning view
57         GuiViewBase * owner_;
58
59         /// menu controller
60         MenuBackend & menubackend_;
61
62         typedef QHash<QString, GuiPopupMenu *> NameMap;
63
64         /// name to menu for openByName
65         NameMap name_map_;
66
67         /// MACOS X special menubar.
68         QMenuBar * mac_menubar_;
69 };
70
71 } // namespace frontend
72 } // namespace lyx
73
74 #endif // GUIMENUBAR_H