]> git.lyx.org Git - lyx.git/blobdiff - src/FuncStatus.h
FuncStatus documentation from Andre and me
[lyx.git] / src / FuncStatus.h
index c9629112de4b76f7cbc6671779190e5de40077e3..6db5832d96a0232a6be152870f43d2212863ff2e 100644 (file)
@@ -12,6 +12,8 @@
 #ifndef FUNC_STATUS_H
 #define FUNC_STATUS_H
 
+#include <string>
+
 /// The status of a function.
 
 class FuncStatus
@@ -19,24 +21,30 @@ class FuncStatus
 private:
 
        enum StatusCodes {
-               ///
+               /// Command can be executed
                OK = 0,
-               ///
+               /// It is unknown wether the command can be executed or not
                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_;
+
 public:
        ///
        FuncStatus();
-       //
+       ///
        void clear();
        ///
        void operator|=(FuncStatus const & f);
@@ -47,13 +55,19 @@ public:
 
        ///
        void enabled(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);
+       ///
+       std::string const & message() const;
 };
 
 #endif