]> git.lyx.org Git - lyx.git/blob - src/FuncStatus.C
Point fix, earlier forgotten
[lyx.git] / src / FuncStatus.C
1 /**
2  * \file FuncStatus.C
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 FuncStatus::FuncStatus() : v_(OK)
16 {
17 }
18
19
20 FuncStatus & FuncStatus::clear ()
21 {
22         v_ = OK;
23         return *this;
24 }
25
26 void FuncStatus::operator |= (FuncStatus const & f)
27 {
28         v_ |= f.v_;
29 }
30
31 FuncStatus & FuncStatus::unknown (bool b)
32 {
33         if (b)
34                 v_ |= UNKNOWN;
35         else
36                 v_ &= !UNKNOWN;
37         return *this;
38 }
39
40
41 bool FuncStatus::unknown () const
42 {
43         return (v_ & UNKNOWN);
44 }
45
46
47 FuncStatus & FuncStatus::disabled (bool b)
48 {
49         if (b)
50                 v_ |= DISABLED;
51         else
52                 v_ &= !DISABLED;
53         return *this;
54 }
55
56
57 bool FuncStatus::disabled () const
58 {
59         return (v_ & DISABLED);
60 }
61
62
63 void FuncStatus::setOnOff (bool b)
64 {
65         v_ |= (b ? ON : OFF);
66 }
67
68
69 bool FuncStatus::onoff (bool b) const
70 {
71         if (b)
72                 return (v_ & ON);
73         else
74                 return (v_ & OFF);
75 }