]> git.lyx.org Git - lyx.git/blob - src/FuncStatus.h
A bunch of conversion to docstring.
[lyx.git] / src / FuncStatus.h
1 // -*- C++ -*-
2 /**
3  * \file FuncStatus.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Jean-Marc Lasgouttes
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef FUNC_STATUS_H
13 #define FUNC_STATUS_H
14
15 #include "support/docstring.h"
16
17 /// The status of a function.
18
19 class FuncStatus
20 {
21 private:
22
23         enum StatusCodes {
24                 /// Command can be executed
25                 OK = 0,
26                 /// This command does not exist, possibly because it is not
27                 /// compiled in (e.g. LFUN_THESAURUS) or the user mistyped
28                 /// it in the minibuffer. UNKNOWN commands have no menu entry.
29                 UNKNOWN = 1,
30                 /// Command cannot be executed
31                 DISABLED = 2,
32                 /// Command is on (i. e. the menu item has a checkmark
33                 /// and the toolbar icon is pushed).
34                 /// Not all commands use this
35                 ON = 4,
36                 /// Command is off (i. e. the menu item has no checkmark
37                 /// and the toolbar icon is not pushed).
38                 /// Not all commands use this
39                 OFF = 8
40         };
41
42         unsigned int v_;
43
44         lyx::docstring message_;
45
46 public:
47         ///
48         FuncStatus();
49         ///
50         void clear();
51         ///
52         void operator|=(FuncStatus const & f);
53         ///
54         void unknown(bool b);
55         ///
56         bool unknown() const;
57
58         ///
59         void enabled(bool b);
60         /// tells whether it can be invoked (otherwise it will be grayed-out).
61         bool enabled() const;
62
63         ///
64         void setOnOff(bool b);
65         /// tells whether the menu item should have a check mark
66         /// (or the toolbar icon should be pushed).
67         bool onoff(bool b) const;
68
69         ///
70         void message(lyx::docstring const & m);
71         ///
72         lyx::docstring const & message() const;
73 };
74
75 #endif