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
21 #include <gnome--/app.h>
22 #include "frontends/Menubar.h"
23 #include "commandtags.h"
34 Structure containing Gtk widget and corresponding LyX action
36 struct GtkWidgetToAction
39 GtkWidgetToAction(GtkWidget * w, int a) { widget_=w; action_=a; }
46 /** The LyX GUI independent menubar class
47 The GUI interface is implemented in the corresponding Menubar_pimpl class.
49 class Menubar::Pimpl: public SigC::Object {
52 Pimpl(LyXView *, MenuBackend const &);
56 void set(string const &);
57 /// Opens a top-level submenu given its name
58 void openByName(string const &);
59 /// update the state of menuitems
61 /// update TOC, LOF, ... on user' request
62 void updateAllLists();
66 void callback(int action);
67 /// callback function used by lists
68 void callbackToc(Buffer::TocItem tg);
69 /// compose Gnome::UI::Array object describing the menu
70 void composeUIInfo(string const & menu_name, vector<Gnome::UI::Info> & Menus, string path);
71 /// compose Gnome::UI::Array object describing the TOClist
72 vector<Buffer::TocItem>::const_iterator
73 composeTocUIInfo(vector<Gnome::UI::Info> & menu,
74 vector<Buffer::TocItem> const & toclist,
75 vector<Buffer::TocItem>::const_iterator begin,
77 /// populate wid_act_ vector with all widgets and corresponding actions
78 void connectWidgetToAction(GnomeUIInfo * guinfo);
80 /// lists (toc, lof, lot, loa)
86 ListsHolder (const ListsHolder & a) { path = a.path; lst = a.lst; }
89 void updateList(vector<Buffer::TocItem> *, vector<ListsHolder> *);
95 MenuBackend const * menubackend_;
97 string current_menu_name_;
98 Gnome::UI::Array Menu_;
103 vector<GtkWidgetToAction> wid_act_;
106 SigC::Connection utoc_;
107 vector<ListsHolder> toc_;