]> git.lyx.org Git - lyx.git/blobdiff - src/FuncStatus.C
update Basque and Romanian l10n
[lyx.git] / src / FuncStatus.C
index b06ab524928bba6cc08f84d8926fe775a8b72bd1..530b8e893a04c0bd35710b699ca7e88d755890b9 100644 (file)
@@ -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 <config.h>
 
-#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