OpenLexocad  28.0
PropertyGUID.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <Core/Property.h>
4 
5 class QUuid;
6 
7 namespace Core
8 {
20 class LX_CORE_EXPORT PropertyGUID : public Core::Property
21 {
23 
24 public:
25  void setValue(const Base::GlobalId& id); // throws Base::GuidInUseException if GUID is already in use.
26  void setValue(const QUuid& id);
28  void setValue(const Base::String& base64);
30  void setValue(const char* aGuid);
31  bool setValueFromVariant(const Core::Variant& value) override;
32 
33  void copyValue(Core::Property* p) override;
34 
37 
38  const Base::GlobalId& getValue() const;
39  Core::Variant getVariant(void) const override;
40 
41  unsigned int getData1() const;
42  unsigned short getData2() const;
43  unsigned short getData3() const;
44  void getData4(unsigned char value[8]) const;
45 
46  virtual bool createSQL(Base::AbstractWriter& writer, Base::PersistenceVersion& save_version, bool data) override;
47  virtual void save(Base::AbstractWriter& writer, Base::PersistenceVersion& save_version) override;
49  virtual bool isEqual(const Property*) const override;
50  virtual Core::Property* copy(void) const override;
51  virtual void paste(const Core::Property& from) override;
52 
53  void toUuid(QUuid& uuid) const;
56 
57  virtual std::shared_ptr<Core::DbgInfo> getDbgInfo() const override;
58 
59 protected:
62 };
63 
64 
65 
67 
68 } // namespace Core
69 
Core::PropertyGUID::getData2
unsigned short getData2() const
Property.h
Core::PropertyGUID::toUuid
void toUuid(QUuid &uuid) const
Core::PropertyGUID::save
virtual void save(Base::AbstractWriter &writer, Base::PersistenceVersion &save_version) override
This method is used to save properties or very small amounts of data to an XML document.
Core::PropertyGUID::setValueFromVariant
bool setValueFromVariant(const Core::Variant &value) override
Core::PropertyGUID::isEqual
virtual bool isEqual(const Property *) const override
compare properties
Core::PropertyGUID::createSQL
virtual bool createSQL(Base::AbstractWriter &writer, Base::PersistenceVersion &save_version, bool data) override
This method is used to save properties or very small amounts of data to an XML document.
Core::PropertyGUID::getValue
const Base::GlobalId & getValue() const
Base::GlobalId
Definition: GlobalId.h:28
Core::PropertyGUID::paste
virtual void paste(const Core::Property &from) override
Paste the value from the property (mainly for Undo/Redo and transactions)
Core::PropertyGUID::_value
Base::GlobalId _value
Definition: PropertyGUID.h:61
Core::PropertyGUID::getVariant
Core::Variant getVariant(void) const override
Core::PropertyGUID::setValue
void setValue(const char *aGuid)
Set value from const char*. Expected format is '{A921A948-076F-4EAA-8203-DF69585D9491}'.
Core::PropertyGUID::getData4
void getData4(unsigned char value[8]) const
Base::PersistenceVersion
Definition: Persistence.h:13
Core
Definition: Base.h:5
Core::PropertyGUID::toString
Base::String toString() const
Core::PropertyGUID::toBase64String
Base::String toBase64String() const
Core::PropertyGUID::copyValue
void copyValue(Core::Property *p) override
Core::Variant
Definition: Variant.h:78
Core::PropertyGUID::getDbgInfo
virtual std::shared_ptr< Core::DbgInfo > getDbgInfo() const override
Returns the debug information for this property.
Base::AbstractWriter
Definition: Writer.h:13
Core::PropertyGUID::check_and_save_or_throw
void check_and_save_or_throw(const Base::GlobalId &id)
Core::PropertyGUID::setValue
void setValue(const QUuid &id)
Base::AbstractXMLReader
Definition: AbstractXMLReader.h:7
Core::PropertyGUID::getData1
unsigned int getData1() const
Core::PropertyGUID::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...
Core::PropertyGUID::getData3
unsigned short getData3() const
Core::PropertyGUID::setValue
void setValue(const Base::String &base64)
Set value from Base64 String.
Core::version
LX_CORE_EXPORT Version & version
Core::PropertyGUID::createAndSetGUID
Base::GlobalId createAndSetGUID()
Creates and a new GUID and sets the value. No notification or checking is done.
Core::Property
Definition: Property.h:72
Base::String
A Utf-16 (windows) or ucs4 (unix) encoded string class.
Definition: String.h:18
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)
Core::PropertyGUID
The PropertyGUID class saves and restores GUIDs. It also handles the management of GUIDs in the Docum...
Definition: PropertyGUID.h:21
Core::PropertyGUID::restore
virtual void restore(Base::AbstractXMLReader &reader, Base::PersistenceVersion &version) override
This method is used to restore properties from an XML document.
Core::PropertyGUID::setValue
void setValue(const Base::GlobalId &id)