]> git.lyx.org Git - lyx.git/blobdiff - src/ToolbarBackend.h
Fix 3188, update the labels at each Caption insertion.
[lyx.git] / src / ToolbarBackend.h
index f5651db88199188d62936c00d196ea4d8890c300..7d9fc9f6b914729081bd8c95f033a996287efb0a 100644 (file)
 #ifndef TOOLBAR_BACKEND_H
 #define TOOLBAR_BACKEND_H
 
+#include "funcrequest.h"
+
 #include <vector>
 
-#include "support/std_string.h"
+
+namespace lyx {
+
 
 class LyXLex;
 
+
 ///
 class ToolbarBackend {
 public:
@@ -33,10 +38,10 @@ public:
        };
 
        /// action, tooltip
-       typedef std::pair<int, string> Item;
+       typedef std::pair<FuncRequest, docstring> Item;
 
        /// the toolbar items
-       typedef std::vector<std::pair<int, string> > Items;
+       typedef std::vector<Item> Items;
 
        /// toolbar flags
        enum Flags {
@@ -47,13 +52,17 @@ public:
                TOP = 16, //< show at top
                BOTTOM = 32, //< show at bottom
                LEFT = 64, //< show at left
-               RIGHT = 128 //< show at right
+               RIGHT = 128, //< show at right
+               REVIEW = 256, //< shown when change tracking is enabled
+               AUTO = 512  //< only if AUTO is set, will MATH, TABLE and REIVEW is used
        };
 
        /// a toolbar
        struct Toolbar {
-               /// toolbar UI name
-               string name;
+               /// toolbar name
+               std::string name;
+               /// toolbar GUI name
+               std::string gui_name;
                /// toolbar contents
                Items items;
                /// flags
@@ -67,13 +76,13 @@ public:
        ToolbarBackend();
 
        /// iterator for all toolbars
-       Toolbars::const_iterator begin() const {
-               return usedtoolbars.begin();
-       }
+       Toolbars::const_iterator begin() const { return usedtoolbars.begin(); }
+
+       Toolbars::const_iterator end() const { return usedtoolbars.end(); }
 
-       Toolbars::const_iterator end() const {
-               return usedtoolbars.end();
-       }
+       Toolbars::iterator begin() { return usedtoolbars.begin(); }
+
+       Toolbars::iterator end() { return usedtoolbars.end(); }
 
        /// read a toolbar from the file
        void read(LyXLex &);
@@ -82,14 +91,12 @@ public:
        void readToolbars(LyXLex &);
 
        /// return a full path of an XPM for the given action
-       static string const getIcon(int action);
+       static std::string const getIcon(FuncRequest const &);
 
 private:
        /// add the given lfun with tooltip if relevant
-       void add(Toolbar & tb, int, string const & tooltip = string());
-
-       /// add the given lfun with tooltip if relevant
-       void add(Toolbar & tb, string const &, string const & tooltip);
+       void add(Toolbar & tb, FuncRequest const &,
+                docstring const & tooltip = docstring());
 
        /// all the toolbars
        Toolbars toolbars;
@@ -102,4 +109,7 @@ private:
 extern ToolbarBackend toolbarbackend;
 
 
+
+} // namespace lyx
+
 #endif // TOOLBAR_BACKEND_H