lyx_mirror/src/FuncStatus.cpp
Vincent van Ravesteijn 5a77a063c1 Remove the unclear FuncStatus::operator|=. Without knowing the internals of FuncStatus it is unsafe to use this operator, so let's not use it.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34161 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-16 12:15:27 +00:00

90 lines
1.0 KiB
C++

/**
* \file FuncStatus.cpp
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author Jean-Marc Lasgouttes
*
* Full author contact details are available in file CREDITS.
*/
#include <config.h>
#include "FuncStatus.h"
namespace lyx {
FuncStatus::FuncStatus()
: v_(OK)
{
}
void FuncStatus::clear()
{
v_ = OK;
message_.erase();
}
void FuncStatus::setUnknown(bool b)
{
if (b)
v_ |= UNKNOWN;
else
v_ &= ~UNKNOWN;
}
bool FuncStatus::unknown() const
{
return (v_ & UNKNOWN);
}
void FuncStatus::setEnabled(bool b)
{
if (b)
v_ &= ~DISABLED;
else
v_ |= DISABLED;
}
bool FuncStatus::enabled() const
{
return !(v_ & DISABLED);
}
void FuncStatus::setOnOff(bool b)
{
v_ |= (b ? ON : OFF);
}
bool FuncStatus::onOff(bool b) const
{
if (b)
return (v_ & ON);
else
return (v_ & OFF);
}
void FuncStatus::message(docstring const & m)
{
message_ = m;
}
docstring const & FuncStatus::message() const
{
return message_;
}
} // namespace lyx