OpenLexocad  28.0
PropertyEmbeddedFile.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <Core/Property.h>
4 
5 
6 namespace Core
7 {
8 class LX_CORE_EXPORT PropertyEmbeddedFile : public Core::Property
9 {
11 
12 public:
14  virtual ~PropertyEmbeddedFile(void);
15 
16  void setValue(const QByteArray& content);
17  void setFilename(const Base::String& filepath);
18  bool setValueFromVariant(const Core::Variant& value);
20 
23 
24  virtual void save(Base::AbstractWriter& writer, Base::PersistenceVersion& save_version);
26  virtual bool isEqual(const Property*) const;
27  virtual Core::Property* copy(void) const override;
28  virtual void paste(const Core::Property& from) override;
29  bool hasContent();
31  QByteArray getContent();
32  bool isSaveInLine();
33 
34 protected:
36  QByteArray _content;
39 };
40 
41 
42 
44 
45 } // namespace Core
Core::PropertyEmbeddedFile::PropertyEmbeddedFile
PropertyEmbeddedFile(void)
Property.h
Core::PropertyEmbeddedFile::~PropertyEmbeddedFile
virtual ~PropertyEmbeddedFile(void)
Core::PropertyEmbeddedFile::_filepath
Base::String _filepath
Definition: PropertyEmbeddedFile.h:35
Core::PropertyEmbeddedFile::setValue
void setValue(const QByteArray &content)
Core::PropertyEmbeddedFile::setValueFromVariant
bool setValueFromVariant(const Core::Variant &value)
Core::PropertyEmbeddedFile::isEqual
virtual bool isEqual(const Property *) const
compare properties
Core::PropertyEmbeddedFile::paste
virtual void paste(const Core::Property &from) override
Paste the value from the property (mainly for Undo/Redo and transactions)
Core::PropertyEmbeddedFile::isSaveInLine
bool isSaveInLine()
Core::PropertyEmbeddedFile::_md5
MD5 _md5
Definition: PropertyEmbeddedFile.h:37
Core::PropertyEmbeddedFile::copyValue
void copyValue(Core::Property *p)
Core::PropertyEmbeddedFile::_saveInline
bool _saveInline
Definition: PropertyEmbeddedFile.h:38
Base::PersistenceVersion
Definition: Persistence.h:13
Core
Definition: Base.h:5
Core::Variant
Definition: Variant.h:78
Core::PropertyEmbeddedFile::getValue
Base::String getValue() const
MD5
Definition: md5.h:70
Base::AbstractWriter
Definition: Writer.h:13
Core::PropertyEmbeddedFile::_content
QByteArray _content
Definition: PropertyEmbeddedFile.h:36
Core::PropertyEmbeddedFile::getContent
QByteArray getContent()
Base::AbstractXMLReader
Definition: AbstractXMLReader.h:7
Core::PropertyEmbeddedFile::restore
virtual void restore(Base::AbstractXMLReader &reader, Base::PersistenceVersion &version)
This method is used to restore properties from an XML document.
Core::PropertyEmbeddedFile::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::PropertyEmbeddedFile
Definition: PropertyEmbeddedFile.h:9
Core::PropertyEmbeddedFile::getVariant
Core::Variant getVariant(void) const
Core::version
LX_CORE_EXPORT Version & version
Core::Property
Definition: Property.h:72
Core::PropertyEmbeddedFile::hasContent
bool hasContent()
Core::PropertyEmbeddedFile::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::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::PropertyEmbeddedFile::getFileName
Base::String getFileName()
Core::PropertyEmbeddedFile::setFilename
void setFilename(const Base::String &filepath)