]> git.lyx.org Git - lyx.git/blobdiff - src/FuncStatus.h
Avoid full metrics computation with Update:FitCursor
[lyx.git] / src / FuncStatus.h
index 6db5832d96a0232a6be152870f43d2212863ff2e..4a632dc870fa2345717a5deeac67d5807a4d77c1 100644 (file)
 #ifndef FUNC_STATUS_H
 #define FUNC_STATUS_H
 
-#include <string>
+#include "support/docstring.h"
+
+
+namespace lyx {
 
 /// The status of a function.
 
@@ -23,7 +26,9 @@ private:
        enum StatusCodes {
                /// Command can be executed
                OK = 0,
-               /// It is unknown wether the command can be executed or not
+               /// This command does not exist, possibly because it is not
+               /// compiled in (e.g. LFUN_THESAURUS) or the user mistyped
+               /// it in the minibuffer. UNKNOWN commands have no menu entry.
                UNKNOWN = 1,
                /// Command cannot be executed
                DISABLED = 2,
@@ -39,7 +44,7 @@ private:
 
        unsigned int v_;
 
-       std::string message_;
+       docstring message_;
 
 public:
        ///
@@ -47,14 +52,12 @@ public:
        ///
        void clear();
        ///
-       void operator|=(FuncStatus const & f);
-       ///
-       void unknown(bool b);
+       void setUnknown(bool b);
        ///
        bool unknown() const;
 
        ///
-       void enabled(bool b);
+       void setEnabled(bool b);
        /// tells whether it can be invoked (otherwise it will be grayed-out).
        bool enabled() const;
 
@@ -62,12 +65,15 @@ public:
        void setOnOff(bool b);
        /// tells whether the menu item should have a check mark
        /// (or the toolbar icon should be pushed).
-       bool onoff(bool b) const;
+       bool onOff(bool b) const;
 
        ///
-       void message(std::string const & m);
+       void message(docstring const & m);
        ///
-       std::string const & message() const;
+       docstring const & message() const;
 };
 
+
+} // namespace lyx
+
 #endif