OpenLexocad  27.1
PropertyUser.h
Go to the documentation of this file.
1 #pragma once
2 #include "Core/Property.h"
3 #include "Core/Variant.h"
4 
5 
6 
7 namespace Core
8 {
15 class LX_CORE_EXPORT PropertyUser : public Core::Property
16 {
18 
19 public:
20  PropertyUser(void);
21  virtual ~PropertyUser(void);
22 
23 
24  bool setValue(const Core::Variant& value);
25  bool setValueFromVariant(const Core::Variant& value) { return setValue(value); }
26  bool setTextValue(const Base::String& text);
27  Base::String getTextValue(bool* ok = 0);
28  virtual void copyValue(Core::Property* p) override;
29 
30  const Core::Variant& getValue() const;
31  Core::Variant getVariant(void) const override;
32 
33  virtual void save(Base::AbstractWriter& writer, Base::PersistenceVersion& save_version);
34  virtual void restore(Base::AbstractXMLReader& reader, Base::PersistenceVersion& version);
35  virtual bool isEqual(const Property*) const;
36  virtual Core::Property* copy(void) const override;
37  virtual void paste(const Core::Property& from) override;
38 
39 protected:
41 };
42 
43 DECLARE_PROPERTY_FACTORY(PropertyUser_Factory, Core::PropertyUser);
44 
45 class LX_CORE_EXPORT PropertyIfc : public Core::PropertyUser
46 {
48 
49 public:
50  PropertyIfc(void);
51  virtual ~PropertyIfc(void);
52 };
53 
54 DECLARE_PROPERTY_FACTORY(PropertyIfc_Factory, Core::PropertyIfc);
55 
56 } // namespace Core
Definition: Persistence.h:14
A Utf-16 (windows) or ucs4 (unix) encoded string class.
Definition: String.h:23
LX_CORE_EXPORT Version & version
Definition: PropertyUser.h:45
Definition: Variant.h:87
Definition: AbstractXMLReader.h:7
Definition: Base.h:12
Definition: Writer.h:16
Core::Variant _value
Definition: PropertyUser.h:40
Definition: Property.h:77
Core::PropertyUser is a class that can hold properties defined by the user. Its value member is a Cor...
Definition: PropertyUser.h:15
bool setValueFromVariant(const Core::Variant &value)
Definition: PropertyUser.h:25
TYPESYSTEM_HEADER()
DECLARE_PROPERTY_FACTORY(PropertyAxis1_Factory, Core::PropertyAxis1)