]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QLPopupMenu.h
Minipage is no more (long live the box inset)
[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
16 #include <qpopupmenu.h>
17
18 #include "funcrequest.h"
19
20 #include <vector>
21 #include <utility>
22
23 class MenuBackend;
24 class MenuItem;
25 class Menu;
26 class QMenuData;
27 class QLMenubar;
28 class QLPopupMenu;
29
30 /// create a sub-menu
31 std::pair<int, QLPopupMenu *>
32 createMenu(QMenuData * parent, MenuItem const * item,
33            QLMenubar * owner, bool is_toplevel = false);
34
35 /// a submenu
36 class QLPopupMenu : public QPopupMenu {
37         Q_OBJECT
38 public:
39         QLPopupMenu(QLMenubar * owner,
40                     std::string const & name, bool toplevel);
41
42         /// populate the menu
43         void populate(Menu * menu);
44 public slots:
45         /// populate the toplevel menu and all children
46         void showing();
47         ///
48         void fire(int);
49 private:
50         /// our owning menubar
51         QLMenubar * owner_;
52
53         /// the name of this menu
54         std::string name_;
55
56         ///
57         typedef std::vector<FuncRequest> Funcs;
58         ///
59         Funcs funcs_;
60 };
61
62 #endif // QLPOPUPMENU_H