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