X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FFuncStatus.h;h=02949ed0bfd0f4839288ec32e370702adffc2d03;hb=7b06307cc66b3b956890b9c736ee8304d4206fea;hp=f6b1c7b95cd82a525fd1c1aef123b1dc5bb105b2;hpb=8283e978f8d621041c432b9b88a476bfd567385c;p=lyx.git diff --git a/src/FuncStatus.h b/src/FuncStatus.h index f6b1c7b95c..02949ed0bf 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,58 @@ 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 operator|=(FuncStatus const & f); + /// + void unknown(bool b); /// bool unknown() const; /// - FuncStatus & disabled (bool b); + void enabled(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