]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/gnome/Menubar_pimpl.h
Clean-up of the button controller.
[lyx.git] / src / frontends / gnome / Menubar_pimpl.h
index 14f4512b73b87a022f8621611f6678c4336b1b00..694ce50c5207bf7c3f8a29787cb125144f91957d 100644 (file)
 #endif
 
 #include <vector>
+#include "gettext.h"
 #include "LString.h"
 #include <gnome--/app.h>
 #include "frontends/Menubar.h"
+#include "commandtags.h"
+#include "buffer.h"
 
 class LyXView;
 class MenuBackend;
@@ -55,14 +58,35 @@ public:
   void openByName(string const &);
   /// update the state of menuitems
   void update();
+  /// update TOC, LOF, ... on user' request
+  void updateAllLists();
   
 protected:
   /// callback function
   void callback(int action);
+  /// callback function used by lists
+  void callbackToc(Buffer::TocItem tg);
   /// compose Gnome::UI::Array object describing the menu
-  void composeUIInfo(string const & menu_name, vector<Gnome::UI::Info> & Menus);
+  void composeUIInfo(string const & menu_name, vector<Gnome::UI::Info> & Menus, string path);
+  /// compose Gnome::UI::Array object describing the TOClist
+  vector<Buffer::TocItem>::const_iterator
+  composeTocUIInfo(vector<Gnome::UI::Info> & menu,
+                  vector<Buffer::TocItem> const & toclist,
+                  vector<Buffer::TocItem>::const_iterator begin,
+                  int mylevel);
   /// populate wid_act_ vector with all widgets and corresponding actions
   void connectWidgetToAction(GnomeUIInfo * guinfo);
+
+  /// lists (toc, lof, lot, loa)
+  struct ListsHolder {
+    string path;
+    Gnome::UI::Array lst;
+
+    ListsHolder () { }
+    ListsHolder (const ListsHolder & a) { path = a.path; lst = a.lst; }
+  };
+  /// populate lists
+  void updateList(vector<Buffer::TocItem> *, vector<ListsHolder> *);
   
 private:
   /// 
@@ -77,5 +101,9 @@ private:
   bool ignore_action_;
   int  action_;
   vector<GtkWidgetToAction> wid_act_;
+
+  /// toc
+  SigC::Connection utoc_;
+  vector<ListsHolder> toc_;
 };
 #endif