]> git.lyx.org Git - lyx.git/blob - src/FuncStatus.C
Fix the missing "Figure #:" label from the caption of a figure float.
[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 void FuncStatus::clear()
21 {
22         v_ = OK;
23 }
24
25
26 void FuncStatus::operator|=(FuncStatus const & f)
27 {
28         v_ |= f.v_;
29 }
30
31
32 void FuncStatus::unknown(bool b)
33 {
34         if (b)
35                 v_ |= UNKNOWN;
36         else
37                 v_ &= !UNKNOWN;
38 }
39
40
41
42 bool FuncStatus::unknown() const
43 {
44         return (v_ & UNKNOWN);
45 }
46
47
48 void FuncStatus::enabled(bool b)
49 {
50         if (b)
51                 v_ &= !DISABLED;
52         else
53                 v_ |= DISABLED;
54 }
55
56
57 bool FuncStatus::enabled() 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 }