]> git.lyx.org Git - lyx.git/blob - src/FuncStatus.h
ws changes mostly
[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 <string>
16
17 /// The status of a function.
18
19 class FuncStatus
20 {
21 private:
22
23         enum StatusCodes {
24                 ///
25                 OK = 0,
26                 ///
27                 UNKNOWN = 1,
28                 ///
29                 DISABLED = 2,  // Command cannot be executed
30                 ///
31                 ON = 4,
32                 ///
33                 OFF = 8
34         };
35
36         unsigned int v_;
37
38         std::string message_;
39
40 public:
41         ///
42         FuncStatus();
43         ///
44         void clear();
45         ///
46         void operator|=(FuncStatus const & f);
47         ///
48         void unknown(bool b);
49         ///
50         bool unknown() const;
51
52         ///
53         void enabled(bool b);
54         ///
55         bool enabled() const;
56
57         ///
58         void setOnOff(bool b);
59         ///
60         bool onoff(bool b) const;
61
62         ///
63         void message(std::string const & m);
64         ///
65         std::string const & message() const;
66 };
67
68 #endif