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