]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QLMenubar.h
some tabular fixes for the problems reported by Helge
[lyx.git] / src / frontends / qt2 / QLMenubar.h
1 // -*- C++ -*-
2 /**
3  * \file qt2/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
20 class LyXView;
21 class MenuBackend;
22 class QMenuBar;
23
24 namespace lyx {
25 namespace frontend {
26
27 class QLPopupMenu;
28 class QtView;
29
30 class QLMenubar : public Menubar {
31 public:
32         QLMenubar(LyXView *, MenuBackend &);
33
34         /// opens a top-level submenu given its name
35         void openByName(std::string const &);
36
37         /// update the state of the menuitems - not needed
38         void update();
39
40         /// return the owning view
41         QtView * view();
42
43         /// return the menu controller
44         MenuBackend const & backend();
45 private:
46         /// owning view
47         QtView * owner_;
48
49         /// menu controller
50         MenuBackend & menubackend_;
51
52         typedef std::map<std::string, QLPopupMenu *> NameMap;
53
54         /// name to menu for openByName
55         NameMap name_map_;
56
57         /// The QMenuBar used by LyX
58         QMenuBar * menuBar() const;
59
60 #ifdef Q_WS_MACX
61         boost::scoped_ptr<QMenuBar> menubar_;
62 #endif
63 };
64
65 } // namespace frontend
66 } // namespace lyx
67
68 #endif // QLMENUBAR_H