]> git.lyx.org Git - lyx.git/blob - src/FuncStatus.cpp
Fixed some lines that were too long. It compiled afterwards.
[lyx.git] / src / FuncStatus.cpp
1 /**
2  * \file FuncStatus.cpp
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Jean-Marc Lasgouttes
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "FuncStatus.h"
14
15
16 namespace lyx {
17
18 FuncStatus::FuncStatus()
19         : v_(OK)
20 {
21 }
22
23
24 void FuncStatus::clear()
25 {
26         v_ = OK;
27         message_.erase();
28 }
29
30
31 void FuncStatus::operator|=(FuncStatus const & f)
32 {
33         v_ |= f.v_;
34         if (!f.message_.empty())
35                 message_ = f.message_;
36 }
37
38
39 void FuncStatus::unknown(bool b)
40 {
41         if (b)
42                 v_ |= UNKNOWN;
43         else
44                 v_ &= !UNKNOWN;
45 }
46
47
48
49 bool FuncStatus::unknown() const
50 {
51         return (v_ & UNKNOWN);
52 }
53
54
55 void FuncStatus::enabled(bool b)
56 {
57         if (b)
58                 v_ &= !DISABLED;
59         else
60                 v_ |= DISABLED;
61 }
62
63
64 bool FuncStatus::enabled() const
65 {
66         return !(v_ & DISABLED);
67 }
68
69
70 void FuncStatus::setOnOff(bool b)
71 {
72         v_ |= (b ? ON : OFF);
73 }
74
75
76 bool FuncStatus::onoff(bool b) const
77 {
78         if (b)
79                 return (v_ & ON);
80         else
81                 return (v_ & OFF);
82 }
83
84
85 void FuncStatus::message(docstring const & m)
86 {
87         message_ = m;
88 }
89
90
91 docstring const & FuncStatus::message() const
92 {
93         return message_;
94 }
95
96
97 } // namespace lyx