X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FFuncStatus.h;h=af2801389e8e2ca4cbf3b8b3644cf3b7cc9eec49;hb=4b7f1b3c3918cd32070c72b6d8e95a888981c7a2;hp=3f5d7b14c1293de2ae12af30751c849c96783568;hpb=f1efb4a92833fe816d08699d46261ed4804a3995;p=lyx.git diff --git a/src/FuncStatus.h b/src/FuncStatus.h index 3f5d7b14c1..af2801389e 100644 --- a/src/FuncStatus.h +++ b/src/FuncStatus.h @@ -12,7 +12,10 @@ #ifndef FUNC_STATUS_H #define FUNC_STATUS_H -#include +#include "support/docstring.h" + + +namespace lyx { /// The status of a function. @@ -21,21 +24,27 @@ class FuncStatus private: enum StatusCodes { - /// + /// Command can be executed OK = 0, - /// + /// 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, - /// - DISABLED = 2, // Command cannot be executed - /// + /// Command cannot be executed + DISABLED = 2, + /// Command is on (i. e. the menu item has a checkmark + /// and the toolbar icon is pushed). + /// Not all commands use this ON = 4, - /// + /// Command is off (i. e. the menu item has no checkmark + /// and the toolbar icon is not pushed). + /// Not all commands use this OFF = 8 }; unsigned int v_; - std::string message_; + docstring message_; public: /// @@ -50,19 +59,23 @@ public: 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; /// 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; /// - void message(std::string const & m); + void message(docstring const & m); /// - std::string const & message() const; + docstring const & message() const; }; + +} // namespace lyx + #endif