3 * \file Menubar_pimpl.h
4 * Copyright 1995 Matthias Ettrich
5 * Copyright 1995-2002 the LyX Team
6 * Copyright 1996-2001 Lars Gullik Bjønnes
7 * Read the file COPYING
9 * \author Lars Gullik Bjønnes, larsbj@lyx.org
12 #ifndef MENUBAR_PIMPL_H
13 #define MENUBAR_PIMPL_H
20 #include "frontends/Menubar.h"
21 #include "commandtags.h"
22 #include "MenuBackend.h"
24 #include <boost/shared_ptr.hpp>
26 #include FORMS_H_LOCATION
33 /** The LyX GUI independent menubar class
34 The GUI interface is implemented in the corresponding Menubar_pimpl class.
36 struct Menubar::Pimpl {
39 Pimpl(LyXView *, MenuBackend const &);
41 void set(string const &);
42 /// Opens a top-level submenu given its name
43 void openByName(string const &);
46 static void MenuCallback(FL_OBJECT *, long);
49 void add_toc(int menu, string const & extra_label,
50 std::vector<int> & smn, Window win);
52 void add_references(int menu, string const & extra_label,
53 std::vector<int> & smn, Window win);
55 int create_submenu(Window win, LyXView * view,
56 string const & menuname,
57 std::vector<int> & smn);
59 /// update the state of the menuitems
63 void makeMenubar(Menu const &menu);
68 MenuBackend const * menubackend_;
72 ItemInfo(Menubar::Pimpl * p, MenuItem const * i,
75 : pimpl_(p), obj_(o) { item_.reset(i); }
77 Menubar::Pimpl * pimpl_;
79 boost::shared_ptr<MenuItem const> item_;
85 typedef std::vector<boost::shared_ptr<ItemInfo> > ButtonList;
87 ButtonList buttonlist_;
90 typedef std::map<string, FL_OBJECT *> MenubarMap;
92 MenubarMap menubarmap_;
94 string current_menu_name_;
96 FL_OBJECT * current_group_;