OpenLexocad  28.0
PropertyBoolean.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <Core/Property.h>
4 
5 
6 namespace Core
7 {
8 /* @brief A defined type of simple type logical.
9  * Logical datatype can have values TRUE, FALSE or UNKNOWN.
10  */
11 
12 // TODO: add 'UNKNOWN' value
13 class LX_CORE_EXPORT PropertyBoolean : public Core::Property
14 {
16 
17 public:
18 
19  inline void setValue(bool b);
20  bool setValueFromVariant(const Core::Variant& value);
22 
23  bool getValue() const;
25 
26  virtual void save(Base::AbstractWriter& writer, Base::PersistenceVersion& save_version);
28  virtual bool isEqual(const Property*) const;
29  virtual Core::Property* copy(void) const override;
30  virtual void paste(const Core::Property& from) override;
31 
32 protected:
33  bool _nValue = false;
34 };
35 
37 
38 } // namespace Core
Property.h
Core::PropertyBoolean
Definition: PropertyBoolean.h:14
Core::PropertyBoolean::copyValue
void copyValue(Core::Property *p)
Core::PropertyBoolean::setValue
void setValue(bool b)
Base::PersistenceVersion
Definition: Persistence.h:13
Core::PropertyBoolean::isEqual
virtual bool isEqual(const Property *) const
compare properties
Core
Definition: Base.h:5
Core::Variant
Definition: Variant.h:78
Core::PropertyBoolean::copy
virtual Core::Property * copy(void) const override
Returns a new copy of the property (mainly for Undo/Redo and transactions). The copy has no container...
Base::AbstractWriter
Definition: Writer.h:13
Core::PropertyBoolean::paste
virtual void paste(const Core::Property &from) override
Paste the value from the property (mainly for Undo/Redo and transactions)
Base::AbstractXMLReader
Definition: AbstractXMLReader.h:7
Core::PropertyBoolean::getValue
bool getValue() const
Core::version
LX_CORE_EXPORT Version & version
Core::PropertyBoolean::save
virtual void save(Base::AbstractWriter &writer, Base::PersistenceVersion &save_version)
This method is used to save properties or very small amounts of data to an XML document.
Core::PropertyBoolean::getVariant
Core::Variant getVariant(void) const
Core::PropertyBoolean::restore
virtual void restore(Base::AbstractXMLReader &reader, Base::PersistenceVersion &version)
This method is used to restore properties from an XML document.
Core::Property
Definition: Property.h:72
Core::PropertyBoolean::setValueFromVariant
bool setValueFromVariant(const Core::Variant &value)
TYPESYSTEM_HEADER
#define TYPESYSTEM_HEADER()
define for subclassing Base::BaseClass
Definition: Base.h:12
Core::DECLARE_PROPERTY_FACTORY
DECLARE_PROPERTY_FACTORY(PropertyAxis1_Factory, Core::PropertyAxis1)