X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FFuncStatus.h;h=4a632dc870fa2345717a5deeac67d5807a4d77c1;hb=a4d9315bc49445e4419b3b59fd238a13c5f7be31;hp=80613c26478479fb97e232b07ea26a6ffe0a0011;hpb=5c3d9a254640468e40b2d30467a26222c91d856d;p=lyx.git diff --git a/src/FuncStatus.h b/src/FuncStatus.h index 80613c2647..4a632dc870 100644 --- a/src/FuncStatus.h +++ b/src/FuncStatus.h @@ -12,6 +12,11 @@ #ifndef FUNC_STATUS_H #define FUNC_STATUS_H +#include "support/docstring.h" + + +namespace lyx { + /// The status of a function. class FuncStatus @@ -19,41 +24,56 @@ 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_; + docstring message_; + public: /// FuncStatus(); - // - void clear(); /// - void operator|=(FuncStatus const & f); + void clear(); /// - void unknown(bool b); + void setUnknown(bool b); /// bool unknown() const; /// - void disabled(bool b); - /// - bool disabled() const; + 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(docstring const & m); /// - bool onoff(bool b) const; + docstring const & message() const; }; + +} // namespace lyx + #endif