3 * \file Menubar_pimpl.h
4 * Copyright 2002 the LyX Team
5 * Read the file COPYING
7 * \author Lars Gullik Bjønnes <larsbj@lyx.org>
8 * \author John Levon <moz@compsoc.man.ac.uk>
12 #ifndef MENUBAR_PIMPL_H
13 #define MENUBAR_PIMPL_H
25 #include "frontends/Menubar.h"
26 #include "commandtags.h"
36 /// stored state for menu items
38 // I REALLY hate this stupid requirement of std::map
40 : parent_(0), id_(0), item_(0) {};
42 MenuItemInfo(QMenuData * p, int id, MenuItem const * item)
43 : parent_(p), id_(id), item_(item) {};
45 /// menu containing item
48 /// id in containing menu
52 MenuItem const * item_;
56 struct Menubar::Pimpl {
58 Pimpl(LyXView *, MenuBackend const &);
60 /// opens a top-level submenu given its name
61 void openByName(string const &);
63 /// update the state of the menuitems
68 QPopupMenu * createMenu(QMenuData * parent, MenuItem const * item);
70 /// populate a menu (recursively)
71 void fillMenu(QMenuData * qmenu, Menu const & menu);
73 /// special handling updating a submenu label
74 void updateSubmenu(MenuItemInfo const & i);
76 /// update an individual item, returns true if enabled
77 void updateItem(MenuItemInfo const & i);
83 MenuBackend const & menubackend_;
85 typedef std::map<string, MenuItemInfo> ItemMap;
91 #endif // MENUBAR_PIMPL_H