2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 2000 The LyX Team.
9 * ====================================================== */
11 #ifndef MENUBAR_PIMPL_H
12 #define MENUBAR_PIMPL_H
20 #include <gnome--/app.h>
21 #include "frontends/Menubar.h"
22 #include "commandtags.h"
30 #ifdef SIGC_CXX_NAMESPACES
31 using SigC::Connection;
37 Structure containing Gtk widget and corresponding LyX action
39 struct GtkWidgetToAction
42 GtkWidgetToAction(GtkWidget * w, int a) { widget_=w; action_=a; }
49 /** The LyX GUI independent menubar class
50 The GUI interface is implemented in the corresponding Menubar_pimpl class.
52 class Menubar::Pimpl: public SigC::Object {
55 Pimpl(LyXView *, MenuBackend const &);
59 void set(string const &);
60 /// Opens a top-level submenu given its name
61 void openByName(string const &);
62 /// update the state of menuitems
64 /// update TOC, LOF, ... on user' request
65 void updateAllLists();
69 void callback(int action);
70 /// callback function used by lists
71 void callbackToc(Buffer::TocItem tg);
72 /// compose Gnome::UI::Array object describing the menu
73 void composeUIInfo(string const & menu_name, vector<Gnome::UI::Info> & Menus, string path);
74 /// compose Gnome::UI::Array object describing the TOClist
75 vector<Buffer::TocItem>::const_iterator
76 composeTocUIInfo(vector<Gnome::UI::Info> & menu,
77 vector<Buffer::TocItem> const & toclist,
78 vector<Buffer::TocItem>::const_iterator begin,
80 /// populate wid_act_ vector with all widgets and corresponding actions
81 void connectWidgetToAction(GnomeUIInfo * guinfo);
83 /// lists (toc, lof, lot, loa)
89 ListsHolder (const ListsHolder & a) { path = a.path; lst = a.lst; }
92 void updateList(vector<Buffer::TocItem> *, vector<ListsHolder> *);
93 /// Add to "Menus" the list of exportable/viewable formats
94 void add_formats(vector<Gnome::UI::Info> & Menus, kb_action action, bool viewable);
100 MenuBackend const * menubackend_;
102 string current_menu_name_;
103 Gnome::UI::Array Menu_;
108 vector<GtkWidgetToAction> wid_act_;
112 vector<ListsHolder> toc_;