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