2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
6 * Copyright 1995 Matthias Ettrich
7 * Copyright 1995-2000 The LyX Team.
9 * This file is Copyright 1996-2000
12 * ====================================================== */
14 #ifndef MENUBAR_PIMPL_H
15 #define MENUBAR_PIMPL_H
24 #include "frontends/Menubar.h"
25 #include "commandtags.h"
26 #include FORMS_H_LOCATION
34 /** The LyX GUI independent menubar class
35 The GUI interface is implemented in the corresponding Menubar_pimpl class.
37 struct Menubar::Pimpl {
40 Pimpl(LyXView *, MenuBackend const &);
44 void set(string const &);
45 /// Opens a top-level submenu given its name
46 void openByName(string const &);
49 static void MenuCallback(FL_OBJECT *, long);
51 /** Add to "menu" the list of last opened files
52 (add "extra_label" to the last entry)
54 void add_lastfiles(int menu, string const & extra_label);
55 /** Add to "menu" the list of opened documents
56 (add "extra_label" to the last entry)
58 void add_documents(int menu, string const & extra_label);
59 /// Add to "menu" the list of exportable/viewable formats
60 /// (add "extra_label" to the last entry)
61 void add_formats(int menu, string const & extra_label,
62 kb_action action, bool viewable);
64 void add_toc(int menu, string const & extra_label,
65 std::vector<int> & smn, Window win);
67 void add_references(int menu, string const & extra_label,
68 std::vector<int> & smn, Window win);
70 int create_submenu(Window win, LyXView * view,
71 string const & menuname,
72 std::vector<int> & smn);
74 /// update the state of the menuitems
78 void makeMenubar(Menu const &menu);
83 MenuBackend const * menubackend_;
87 ItemInfo(Menubar::Pimpl * p, MenuItem const * i,
89 : pimpl_(p), item_(i), obj_(o) {}
91 Menubar::Pimpl * pimpl_;
93 MenuItem const * item_;
99 typedef std::vector<ItemInfo *> ButtonList;
101 ButtonList buttonlist_;
104 typedef std::map<string, FL_OBJECT *> MenubarMap;
106 MenubarMap menubarmap_;
108 string current_menu_name_;
110 FL_OBJECT * current_group_;