2002-01-09 09:36:35 +00:00
|
|
|
/* This file is part of
|
2002-03-21 17:27:08 +00:00
|
|
|
* ======================================================
|
|
|
|
*
|
2002-01-09 09:36:35 +00:00
|
|
|
* LyX, The Document Processor
|
2002-03-21 17:27:08 +00:00
|
|
|
*
|
2002-01-09 09:36:35 +00:00
|
|
|
* Copyright 2001 The LyX Team.
|
|
|
|
*
|
|
|
|
* ====================================================== */
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
#include "FuncStatus.h"
|
|
|
|
|
|
|
|
FuncStatus::FuncStatus() : v_(OK)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-01-09 14:37:55 +00:00
|
|
|
FuncStatus & FuncStatus::clear ()
|
2002-01-09 09:36:35 +00:00
|
|
|
{
|
|
|
|
v_ = OK;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
void FuncStatus::operator |= (FuncStatus const & f)
|
|
|
|
{
|
|
|
|
v_ |= f.v_;
|
|
|
|
}
|
|
|
|
|
2002-01-09 14:37:55 +00:00
|
|
|
FuncStatus & FuncStatus::unknown (bool b)
|
2002-01-09 09:36:35 +00:00
|
|
|
{
|
|
|
|
if (b)
|
|
|
|
v_ |= UNKNOWN;
|
|
|
|
else
|
|
|
|
v_ &= !UNKNOWN;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool FuncStatus::unknown () const
|
|
|
|
{
|
|
|
|
return (v_ & UNKNOWN);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-01-09 14:37:55 +00:00
|
|
|
FuncStatus & 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;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool FuncStatus::disabled () const
|
|
|
|
{
|
|
|
|
return (v_ & DISABLED);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void FuncStatus::setOnOff (bool b)
|
|
|
|
{
|
|
|
|
v_ |= (b ? ON : OFF);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool FuncStatus::onoff (bool b) const
|
|
|
|
{
|
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);
|
|
|
|
}
|