]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiPopupMenu.h
* a configuration value for the mouse wheel scrolling speed:
[lyx.git] / src / frontends / qt4 / GuiPopupMenu.h
1 // -*- C++ -*-
2 /**
3  * \file GuiPopupMenu.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 GUIPOPUPMENU_H
13 #define GUIPOPUPMENU_H
14
15 #include <QMenu>
16
17 #include "FuncRequest.h"
18 #include "MenuBackend.h"
19
20 namespace lyx {
21 namespace frontend {
22
23 class GuiView;
24
25 /// a submenu
26 class GuiPopupMenu : public QMenu
27 {
28         Q_OBJECT
29 public:
30         ///
31         GuiPopupMenu(GuiView * owner, MenuItem const & mi,
32                 bool topLevelMenu = false);
33
34         /// populates the menu or one of its submenu
35         /// This is used as a recursive function
36         void populate(QMenu* qMenu, Menu * menu);
37
38 public Q_SLOTS:
39         /// populate the toplevel menu and all children
40         void updateView();
41
42 private:
43         /// Get a Menu item label from the menu backend
44         docstring const getLabel(MenuItem const & mi);
45
46         /// our owning view
47         GuiView * owner_;
48         /// the name of this menu
49         docstring name_;
50         /// Top Level Menu
51         Menu topLevelMenu_;
52 };
53
54 } // namespace frontend
55 } // namespace lyx
56
57 #endif // GUIPOPUPMENU_H