]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/QLMenubar.h
* src/frontends/qt4/ui/TextLayoutUi.ui:
[lyx.git] / src / frontends / qt4 / QLMenubar.h
1 // -*- C++ -*-
2 /**
3  * \file qt4/QLMenubar.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 QLMENUBAR_H
14 #define QLMENUBAR_H
15
16 #include "frontends/Menubar.h"
17
18 #include <map>
19 #include <boost/scoped_ptr.hpp>
20
21 #include <QObject>
22 #include <QMenuBar>
23
24 #include "QLPopupMenu.h"
25
26 class LyXView;
27 class MenuBackend;
28 class Menu;
29 class MenuItem;
30
31 namespace lyx {
32 namespace frontend {
33
34 class GuiView;
35
36 class QLMenubar : public QObject, public Menubar {
37         Q_OBJECT
38 public:
39         QLMenubar(LyXView *, MenuBackend &);
40
41         /// opens a top-level submenu given its name
42         void openByName(docstring const &);
43
44         /// return the owning view
45         GuiView * view();
46
47         /// return the menu controller
48         MenuBackend const & backend();
49
50         /// The QMenuBar used by LyX
51         QMenuBar * menuBar() const;
52
53         /// update the state of the menuitems - not needed
54         void update();
55
56 public Q_SLOTS:
57         /// populate a toplevel menu and all its children on demand
58 //      void updateMenu();
59
60 private:
61         /// Initialize specific MACOS X menubar
62         void macxMenuBarInit();
63
64         /// owning view
65         GuiView * owner_;
66
67         /// menu controller
68         MenuBackend & menubackend_;
69
70         typedef std::map<docstring, QLPopupMenu *> NameMap;
71
72         /// name to menu for openByName
73         NameMap name_map_;
74
75         /// MACOS X special menubar.
76         boost::scoped_ptr<QMenuBar> mac_menubar_;
77 };
78
79 } // namespace frontend
80 } // namespace lyx
81
82 #endif // QLMENUBAR_H