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"
35 /// stored state for menu items
37 // I REALLY hate this stupid requirement of std::map
38 MenuItemInfo::MenuItemInfo()
39 : parent_(0), id_(0), item_(0) {};
41 MenuItemInfo::MenuItemInfo(QMenuData * p, int id, MenuItem const * item)
42 : parent_(p), id_(id), item_(item) {};
44 /// menu containing item
47 /// id in containing menu
51 MenuItem const * item_;
55 struct Menubar::Pimpl {
57 Pimpl(LyXView *, MenuBackend const &);
59 /// opens a top-level submenu given its name
60 void openByName(string const &);
62 /// update the state of the menuitems
67 void makeMenu(QMenuData * parent, MenuItem const & menu);
69 /// special handling updating a submenu label
70 void updateSubmenu(MenuItemInfo const & i);
72 /// update an individual item, returns true if enabled
73 void updateItem(MenuItemInfo const & i);
79 MenuBackend const & menubackend_;
81 typedef std::map<string, MenuItemInfo> ItemMap;
87 #endif // MENUBAR_PIMPL_H