X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FFuncStatus.C;h=530b8e893a04c0bd35710b699ca7e88d755890b9;hb=3ef684e752bb5afdbfdea51d4c3df4afe1461916;hp=b06ab524928bba6cc08f84d8926fe775a8b72bd1;hpb=d719688df38b73e915ea36c8357a3c57376c4ef7;p=lyx.git diff --git a/src/FuncStatus.C b/src/FuncStatus.C index b06ab52492..530b8e893a 100644 --- a/src/FuncStatus.C +++ b/src/FuncStatus.C @@ -1,78 +1,97 @@ -/* This file is part of - * ====================================================== - * - * LyX, The Document Processor - * - * Copyright 2001 The LyX Team. +/** + * \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 -#ifdef __GNUG__ -#pragma implementation -#endif - #include "FuncStatus.h" -FuncStatus::FuncStatus() : v_(OK) + +namespace lyx { + +FuncStatus::FuncStatus() + : v_(OK) { } -FuncStatus::FuncStatus & FuncStatus::clear () +void FuncStatus::clear() { v_ = OK; - return *this; + message_.erase(); } -void FuncStatus::operator |= (FuncStatus const & f) + +void FuncStatus::operator|=(FuncStatus const & f) { v_ |= f.v_; + if (!f.message_.empty()) + message_ = f.message_; } -FuncStatus::FuncStatus & FuncStatus::unknown (bool b) + +void FuncStatus::unknown(bool b) { if (b) v_ |= UNKNOWN; else v_ &= !UNKNOWN; - return *this; } -bool FuncStatus::unknown () const + +bool FuncStatus::unknown() const { return (v_ & UNKNOWN); } -FuncStatus::FuncStatus & FuncStatus::disabled (bool b) +void FuncStatus::enabled(bool b) { if (b) - v_ |= DISABLED; - else v_ &= !DISABLED; - return *this; + else + v_ |= DISABLED; } -bool FuncStatus::disabled () const +bool FuncStatus::enabled() const { - return (v_ & DISABLED); + return !(v_ & DISABLED); } -void FuncStatus::setOnOff (bool b) +void FuncStatus::setOnOff(bool b) { v_ |= (b ? ON : OFF); } -bool FuncStatus::onoff (bool b) const +bool FuncStatus::onoff(bool b) const { - if (b) + 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