X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FFuncStatus.h;h=4a632dc870fa2345717a5deeac67d5807a4d77c1;hb=e52a38549328a58b6fe8efeecef21a71fb9c8d65;hp=f6b1c7b95cd82a525fd1c1aef123b1dc5bb105b2;hpb=8283e978f8d621041c432b9b88a476bfd567385c;p=lyx.git diff --git a/src/FuncStatus.h b/src/FuncStatus.h index f6b1c7b95c..4a632dc870 100644 --- a/src/FuncStatus.h +++ b/src/FuncStatus.h @@ -1,7 +1,22 @@ // -*- C++ -*- +/** + * \file FuncStatus.h + * This file is part of LyX, the document processor. + * Licence details can be found in the file COPYING. + * + * \author Jean-Marc Lasgouttes + * + * Full author contact details are available in file CREDITS. + */ + #ifndef FUNC_STATUS_H #define FUNC_STATUS_H +#include "support/docstring.h" + + +namespace lyx { + /// The status of a function. class FuncStatus @@ -9,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(); - // - FuncStatus & clear (); /// - void operator |= (FuncStatus const & f); + void clear(); /// - FuncStatus & unknown(bool b); + void setUnknown(bool b); /// bool unknown() const; /// - FuncStatus & disabled (bool b); + void setEnabled(bool b); + /// tells whether it can be invoked (otherwise it will be grayed-out). + bool enabled() const; + /// - bool disabled () 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 setOnOff (bool b); + void message(docstring const & m); /// - bool onoff (bool b) const; + docstring const & message() const; }; + +} // namespace lyx + #endif