]> git.lyx.org Git - lyx.git/blob - src/FuncStatus.C
ws change
[lyx.git] / src / FuncStatus.C
1 /* This file is part of
2  * ======================================================
3  *
4  *           LyX, The Document Processor
5  *
6  *          Copyright 2001 The LyX Team.
7  *
8  * ====================================================== */
9
10 #include <config.h>
11
12 #ifdef __GNUG__
13 #pragma implementation
14 #endif
15
16 #include "FuncStatus.h"
17
18 FuncStatus::FuncStatus() : v_(OK)
19 {
20 }
21
22
23 FuncStatus & FuncStatus::clear ()
24 {
25         v_ = OK;
26         return *this;
27 }
28
29 void FuncStatus::operator |= (FuncStatus const & f)
30 {
31         v_ |= f.v_;
32 }
33
34 FuncStatus & FuncStatus::unknown (bool b)
35 {
36         if (b)
37                 v_ |= UNKNOWN;
38         else
39                 v_ &= !UNKNOWN;
40         return *this;
41 }
42
43
44 bool FuncStatus::unknown () const
45 {
46         return (v_ & UNKNOWN);
47 }
48
49
50 FuncStatus & FuncStatus::disabled (bool b)
51 {
52         if (b)
53                 v_ |= DISABLED;
54         else
55                 v_ &= !DISABLED;
56         return *this;
57 }
58
59
60 bool FuncStatus::disabled () const
61 {
62         return (v_ & DISABLED);
63 }
64
65
66 void FuncStatus::setOnOff (bool b)
67 {
68         v_ |= (b ? ON : OFF);
69 }
70
71
72 bool FuncStatus::onoff (bool b) const
73 {
74         if (b)
75                 return (v_ & ON);
76         else
77                 return (v_ & OFF);
78 }