]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/Toolbars.h
* src/frontends/qt4/GuiSelection.C
[lyx.git] / src / frontends / Toolbars.h
index 83cd71807f75b78ee1552d63fb88d6ef47afd668..ad719b257b4764223982e73e3adf11e5f868c7bd 100644 (file)
 #include "ToolbarBackend.h"
 #include <boost/shared_ptr.hpp>
 #include <map>
+#include "session.h"
 
-class LyXView;
 
+namespace lyx {
+
+class LyXView;
 
 class LayoutBox {
 public:
@@ -50,8 +53,7 @@ class Toolbar {
 public:
        virtual ~Toolbar() {}
        /// Add a button to the bar.
-       virtual void add(FuncRequest const & func,
-                        std::string const & tooltip) = 0;
+       virtual void add(FuncRequest const & func, docstring const & tooltip) = 0;
 
        /** Hide the bar.
         *  \param update_metrics is a hint to the layout engine that the
@@ -63,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;
@@ -81,8 +87,18 @@ 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);
+       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);
@@ -126,13 +142,15 @@ 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
 void layoutSelected(LyXView & lv, std::string const & name);
 
-/** Each GUI frontend should provide its own version of this.
- */
-Toolbars::ToolbarPtr make_toolbar(ToolbarBackend::Toolbar const &, LyXView &);
+
+} // namespace lyx
 
 #endif // NOT TOOLBARS_H