mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-10 20:04:46 +00:00
0be0fcfd59
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7598 a592a061-630c-0410-9148-cb99ea01b6c8
76 lines
975 B
C
76 lines
975 B
C
/**
|
|
* \file FuncStatus.C
|
|
* 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"
|
|
|
|
FuncStatus::FuncStatus() : v_(OK)
|
|
{
|
|
}
|
|
|
|
|
|
FuncStatus & FuncStatus::clear ()
|
|
{
|
|
v_ = OK;
|
|
return *this;
|
|
}
|
|
|
|
void FuncStatus::operator |= (FuncStatus const & f)
|
|
{
|
|
v_ |= f.v_;
|
|
}
|
|
|
|
FuncStatus & FuncStatus::unknown (bool b)
|
|
{
|
|
if (b)
|
|
v_ |= UNKNOWN;
|
|
else
|
|
v_ &= !UNKNOWN;
|
|
return *this;
|
|
}
|
|
|
|
|
|
bool FuncStatus::unknown () const
|
|
{
|
|
return (v_ & UNKNOWN);
|
|
}
|
|
|
|
|
|
FuncStatus & FuncStatus::disabled (bool b)
|
|
{
|
|
if (b)
|
|
v_ |= DISABLED;
|
|
else
|
|
v_ &= !DISABLED;
|
|
return *this;
|
|
}
|
|
|
|
|
|
bool FuncStatus::disabled () 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);
|
|
}
|