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
23 #include "frontends/Menubar.h"
24 #include "commandtags.h"
25 #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 &);
43 void set(string const &);
44 /// Opens a top-level submenu given its name
45 void openByName(string const &);
48 static void MenuCallback(FL_OBJECT *, long);
50 /** Add to "menu" the list of last opened files
51 (add "extra_label" to the last entry)
53 void add_lastfiles(int menu, string const & extra_label,
54 std::vector<int> & smn, StrPool & strpool);
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 std::vector<int> & smn, StrPool & strpool);
60 /// Add to "menu" the list of exportable/viewable formats
61 /// (add "extra_label" to the last entry)
62 void add_formats(int menu, string const & extra_label,
63 std::vector<int> & smn, StrPool & strpool,
64 kb_action action, bool viewable);
66 int create_submenu(Window win, LyXView * view,
67 string const & menuname,
68 std::vector<int> & smn, StrPool & strpool);
70 /// update the state of the menuitems
79 MenuBackend const * menubackend_;
85 ItemInfo(Menubar::Pimpl * p, MenuItem const * i,
87 : pimpl_(p), item_(i), obj_(o) {}
89 Menubar::Pimpl * pimpl_;
91 MenuItem const * item_;
97 typedef std::vector<ItemInfo *> ButtonList;
99 ButtonList buttonlist_;