]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QLPopupMenu.h
some tabular fixes for the problems reported by Helge
[lyx.git] / src / frontends / qt2 / QLPopupMenu.h
1 // -*- C++ -*-
2 /**
3  * \file QLPopupMenu.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author John Levon
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef QLPOPUPMENU_H
13 #define QLPOPUPMENU_H
14
15 #include <qpopupmenu.h>
16
17 #include "funcrequest.h"
18
19 #include <vector>
20 #include <utility>
21
22 class MenuBackend;
23 class MenuItem;
24 class Menu;
25 class QMenuData;
26
27 namespace lyx {
28 namespace frontend {
29
30 class QLMenubar;
31 class QLPopupMenu;
32
33 /// create a sub-menu
34 std::pair<int, QLPopupMenu *>
35 createMenu(QMenuData * parent, MenuItem const * item,
36            QLMenubar * owner, bool is_toplevel = false);
37
38 /// a submenu
39 class QLPopupMenu : public QPopupMenu {
40         Q_OBJECT
41 public:
42         QLPopupMenu(QLMenubar * owner,
43                     std::string const & name, bool toplevel);
44
45         /// populate the menu
46         void populate(Menu * menu);
47 public slots:
48         /// populate the toplevel menu and all children
49         void showing();
50         ///
51         void fire(int);
52 private:
53         /// our owning menubar
54         QLMenubar * owner_;
55
56         /// the name of this menu
57         std::string name_;
58
59         ///
60         typedef std::vector<FuncRequest> Funcs;
61         ///
62         Funcs funcs_;
63 };
64
65 } // namespace frontend
66 } // namespace lyx
67
68 #endif // QLPOPUPMENU_H