Consider the case where there is not any layout name.
[lyx.git] / src / FuncStatus.C
blob2f0cf8e064bd3792cc37e6bdd91fd2c595f7f247
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  */
11 #include <config.h>
13 #include "FuncStatus.h"
15 using std::string;
17 FuncStatus::FuncStatus() : v_(OK)
22 void FuncStatus::clear()
24         v_ = OK;
25         message_.erase();
29 void FuncStatus::operator|=(FuncStatus const & f)
31         v_ |= f.v_;
32         if (!f.message_.empty())
33                 message_ = f.message_;
37 void FuncStatus::unknown(bool b)
39         if (b)
40                 v_ |= UNKNOWN;
41         else
42                 v_ &= !UNKNOWN;
47 bool FuncStatus::unknown() const
49         return (v_ & UNKNOWN);
53 void FuncStatus::enabled(bool b)
55         if (b)
56                 v_ &= !DISABLED;
57         else
58                 v_ |= DISABLED;
62 bool FuncStatus::enabled() const
64         return !(v_ & DISABLED);
68 void FuncStatus::setOnOff(bool b)
70         v_ |= (b ? ON : OFF);
74 bool FuncStatus::onoff(bool b) const
76         if (b)
77                 return (v_ & ON);
78         else
79                 return (v_ & OFF);
83 void FuncStatus::message(string const & m)
85         message_ = m;
89 string const & FuncStatus::message() const
91         return message_;