2003-08-23 00:17:00 +00:00
|
|
|
/**
|
2007-04-26 04:41:58 +00:00
|
|
|
* \file FuncStatus.cpp
|
2003-08-23 00:17:00 +00:00
|
|
|
* 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"
|
|
|
|
|
2004-11-25 09:15:26 +00:00
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
namespace lyx {
|
|
|
|
|
|
|
|
FuncStatus::FuncStatus()
|
|
|
|
: v_(OK)
|
2012-10-27 13:45:27 +00:00
|
|
|
{}
|
2002-01-09 09:36:35 +00:00
|
|
|
|
|
|
|
|
2003-10-21 16:15:14 +00:00
|
|
|
void FuncStatus::clear()
|
2002-01-09 09:36:35 +00:00
|
|
|
{
|
|
|
|
v_ = OK;
|
2004-11-25 09:15:26 +00:00
|
|
|
message_.erase();
|
2002-01-09 09:36:35 +00:00
|
|
|
}
|
|
|
|
|
2003-10-21 16:15:14 +00:00
|
|
|
|
2010-04-16 10:51:20 +00:00
|
|
|
void FuncStatus::setUnknown(bool b)
|
2002-01-09 09:36:35 +00:00
|
|
|
{
|
|
|
|
if (b)
|
|
|
|
v_ |= UNKNOWN;
|
|
|
|
else
|
2008-05-25 21:01:27 +00:00
|
|
|
v_ &= ~UNKNOWN;
|
2002-01-09 09:36:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-10-21 16:15:14 +00:00
|
|
|
|
|
|
|
bool FuncStatus::unknown() const
|
2002-01-09 09:36:35 +00:00
|
|
|
{
|
|
|
|
return (v_ & UNKNOWN);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-05-29 15:14:00 +00:00
|
|
|
void FuncStatus::setEnabled(bool b)
|
2002-01-09 09:36:35 +00:00
|
|
|
{
|
|
|
|
if (b)
|
2008-05-25 21:01:27 +00:00
|
|
|
v_ &= ~DISABLED;
|
2004-03-18 13:57:20 +00:00
|
|
|
else
|
|
|
|
v_ |= DISABLED;
|
2002-01-09 09:36:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-03-18 13:57:20 +00:00
|
|
|
bool FuncStatus::enabled() const
|
2002-01-09 09:36:35 +00:00
|
|
|
{
|
2004-03-18 13:57:20 +00:00
|
|
|
return !(v_ & DISABLED);
|
2002-01-09 09:36:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-04-16 10:51:20 +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);
|
|
|
|
}
|
2004-11-25 09:15:26 +00:00
|
|
|
|
|
|
|
|
2006-09-11 08:54:10 +00:00
|
|
|
void FuncStatus::message(docstring const & m)
|
2004-11-25 09:15:26 +00:00
|
|
|
{
|
|
|
|
message_ = m;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-09-11 08:54:10 +00:00
|
|
|
docstring const & FuncStatus::message() const
|
2004-11-25 09:15:26 +00:00
|
|
|
{
|
|
|
|
return message_;
|
|
|
|
}
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
} // namespace lyx
|