2003-08-23 00:17:00 +00:00
|
|
|
/**
|
|
|
|
* \file FuncStatus.C
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-03-21 17:27:08 +00:00
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* \author Jean-Marc Lasgouttes
|
2002-03-21 17:27:08 +00:00
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
2002-01-09 09:36:35 +00:00
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
#include "FuncStatus.h"
|
|
|
|
|
|
|
|
FuncStatus::FuncStatus() : v_(OK)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-10-21 16:15:14 +00:00
|
|
|
void FuncStatus::clear()
|
2002-01-09 09:36:35 +00:00
|
|
|
{
|
|
|
|
v_ = OK;
|
|
|
|
}
|
|
|
|
|
2003-10-21 16:15:14 +00:00
|
|
|
|
|
|
|
void FuncStatus::operator|=(FuncStatus const & f)
|
2002-01-09 09:36:35 +00:00
|
|
|
{
|
|
|
|
v_ |= f.v_;
|
|
|
|
}
|
|
|
|
|
2003-10-21 16:15:14 +00:00
|
|
|
|
|
|
|
void FuncStatus::unknown(bool b)
|
2002-01-09 09:36:35 +00:00
|
|
|
{
|
|
|
|
if (b)
|
|
|
|
v_ |= UNKNOWN;
|
|
|
|
else
|
|
|
|
v_ &= !UNKNOWN;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-10-21 16:15:14 +00:00
|
|
|
|
|
|
|
bool FuncStatus::unknown() const
|
2002-01-09 09:36:35 +00:00
|
|
|
{
|
|
|
|
return (v_ & UNKNOWN);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-10-21 16:15:14 +00:00
|
|
|
void FuncStatus::disabled(bool b)
|
2002-01-09 09:36:35 +00:00
|
|
|
{
|
|
|
|
if (b)
|
2002-03-21 17:27:08 +00:00
|
|
|
v_ |= DISABLED;
|
2002-01-09 09:36:35 +00:00
|
|
|
else
|
|
|
|
v_ &= !DISABLED;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-10-21 16:15:14 +00:00
|
|
|
bool FuncStatus::disabled() const
|
2002-01-09 09:36:35 +00:00
|
|
|
{
|
|
|
|
return (v_ & DISABLED);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-10-21 16:15:14 +00:00
|
|
|
void FuncStatus::setOnOff(bool b)
|
2002-01-09 09:36:35 +00:00
|
|
|
{
|
|
|
|
v_ |= (b ? ON : OFF);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-10-21 16:15:14 +00:00
|
|
|
bool FuncStatus::onoff(bool b) const
|
2002-01-09 09:36:35 +00:00
|
|
|
{
|
2002-03-21 17:27:08 +00:00
|
|
|
if (b)
|
2002-01-09 09:36:35 +00:00
|
|
|
return (v_ & ON);
|
|
|
|
else
|
|
|
|
return (v_ & OFF);
|
|
|
|
}
|