]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QLPopupMenu.h
better selection and scrolling behaviour
[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 #ifdef __GNUG__
16 #pragma interface
17 #endif
18
19 #include "Menubar_pimpl.h"
20
21 #include <qpopupmenu.h>
22
23 #include "LString.h"
24
25 class MenuBackend;
26 class MenuItem;
27 class Menu;
28 class QMenuData;
29 class QLPopupMenu;
30
31 /// create a sub-menu
32 std::pair<int, QLPopupMenu *>
33 createMenu(QMenuData * parent, MenuItem const * item,
34            Menubar::Pimpl * owner, bool is_toplevel = false);
35
36 /// a submenu
37 class QLPopupMenu : public QPopupMenu {
38         Q_OBJECT
39 public:
40         QLPopupMenu(Menubar::Pimpl * owner,
41                     string const & name, bool toplevel);
42
43         /// populate the menu
44         void populate(Menu * menu);
45 public slots:
46         /// populate the toplevel menu and all children
47         void showing();
48 private:
49         /// return true if the given submenu is disabled
50         bool disabled(Menu * menu);
51
52         /// our owning menubar
53         Menubar::Pimpl * owner_;
54
55         /// the name of this menu
56         string name_;
57 };
58
59 #endif // QLPOPUPMENU_H