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"
31 #ifdef SIGC_CXX_NAMESPACES
32 using SigC::Connection;
38 Structure containing Gtk widget and corresponding LyX action
40 struct GtkWidgetToAction
43 GtkWidgetToAction(GtkWidget * w, int a) { widget_=w; action_=a; }
50 /** The LyX GUI independent menubar class
51 The GUI interface is implemented in the corresponding Menubar_pimpl class.
53 class Menubar::Pimpl: public SigC::Object {
56 Pimpl(LyXView *, MenuBackend const &);
60 void set(string const &);
61 /// Opens a top-level submenu given its name
62 void openByName(string const &);
63 /// update the state of menuitems
65 /// update TOC, LOF, ... on user' request
66 void updateAllLists();
70 void callback(int action);
71 /// callback function used by lists
72 void callbackToc(Buffer::TocItem tg);
73 /// compose Gnome::UI::Array object describing the menu
74 void composeUIInfo(string const & menu_name, vector<Gnome::UI::Info> & Menus, string path);
75 /// compose Gnome::UI::Array object describing the TOClist
76 vector<Buffer::TocItem>::const_iterator
77 composeTocUIInfo(vector<Gnome::UI::Info> & menu,
78 vector<Buffer::TocItem> const & toclist,
79 vector<Buffer::TocItem>::const_iterator begin,
81 /// populate wid_act_ vector with all widgets and corresponding actions
82 void connectWidgetToAction(GnomeUIInfo * guinfo);
84 /// lists (toc, lof, lot, loa)
90 ListsHolder (const ListsHolder & a) { path = a.path; lst = a.lst; }
93 void updateList(vector<Buffer::TocItem> *, vector<ListsHolder> *);
99 MenuBackend const * menubackend_;
101 string current_menu_name_;
102 Gnome::UI::Array Menu_;
107 vector<GtkWidgetToAction> wid_act_;
111 vector<ListsHolder> toc_;