]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/Toolbars.h
Session: restore toolbars in the right order and location
[lyx.git] / src / frontends / Toolbars.h
index 7fe1c57e2476edd9a3dd5df77b5a3774d2cf8ffe..c04e9e3ed94995c7269773e7176431e70b6d7964 100644 (file)
@@ -26,6 +26,7 @@
 #include "ToolbarBackend.h"
 #include <boost/shared_ptr.hpp>
 #include <map>
+#include "session.h"
 
 
 namespace lyx {
@@ -64,6 +65,10 @@ public:
         *  metrics should be updated.
         */
        virtual void show(bool update_metrics) = 0;
+       /** update toolbar information
+       * ToolbarInfo will then be saved by session
+       */
+       virtual void saveInfo(ToolbarSection::ToolbarInfo & info) = 0;
 
        /// Refresh the contents of the bar.
        virtual void update() = 0;
@@ -83,8 +88,17 @@ public:
        /// Show/hide the named toolbar.
        void display(std::string const & name, bool show);
 
+       /// get toolbar state (on/off/auto)
+       ToolbarBackend::Flags getToolbarState(std::string const & name);
+       
+       /// toggle the state of toolbars (on/off/auto)
+       void toggleToolbarState(std::string const & name);
+
        /// Update the state of the toolbars.
-       void update(bool in_math, bool in_table, bool change_tracking);
+       void update(bool in_math, bool in_table, bool review);
+
+       /// save toolbar information
+       void saveToolbarInfo();
 
        /// Select the right layout in the combox.
        void setLayout(std::string const & layout);
@@ -103,8 +117,8 @@ public:
        typedef boost::shared_ptr<Toolbar> ToolbarPtr;
 
 private:
-       /// Add a new toolbar.
-       void add(ToolbarBackend::Toolbar const & tb);
+       /// Add a new toolbar. if newline==true, start from a new line
+       void add(ToolbarBackend::Toolbar const & tb, bool newline);
        /// Show or hide a toolbar.
        void displayToolbar(ToolbarBackend::Toolbar const & tb, bool show);
        /// Update the state of the icons
@@ -128,6 +142,9 @@ private:
 
        /// The last textclass layout list in the layout choice selector
        int last_textclass_;
+
+       // load flags with saved values
+       void initFlags(ToolbarBackend::Toolbar & tbb);
 };
 
 /// Set the layout in the kernel when an entry has been selected