OpenLexocad  27.1
PropertyEmbeddedFile.h
Go to the documentation of this file.
1 #pragma once
2 #include <Base/String.h>
3 #include <Base/md5.h>
4 
5 #include <QByteArray>
6 #include <string>
7 
8 #include "Core/Property.h"
9 #include "Core/Variant.h"
10 
11 namespace Core
12 {
13 class LX_CORE_EXPORT PropertyEmbeddedFile : public Core::Property
14 {
16 
17 public:
19  virtual ~PropertyEmbeddedFile(void);
20 
21  void setValue(const QByteArray& content);
22  void setFilename(const Base::String& filepath);
23  bool setValueFromVariant(const Core::Variant& value);
24  void copyValue(Core::Property* p);
25 
26  Base::String getValue() const;
27  Core::Variant getVariant(void) const;
28 
29  virtual void save(Base::AbstractWriter& writer, Base::PersistenceVersion& save_version);
30  virtual void restore(Base::AbstractXMLReader& reader, Base::PersistenceVersion& version);
31  virtual bool isEqual(const Property*) const;
32  virtual Core::Property* copy(void) const override;
33  virtual void paste(const Core::Property& from) override;
34  bool hasContent();
35  Base::String getFileName();
36  QByteArray getContent();
37  bool isSaveInLine();
38 
39 protected:
41  QByteArray _content;
44 };
45 
46 
47 
48 DECLARE_PROPERTY_FACTORY(PropertyEmbeddedFile_Factory, Core::PropertyEmbeddedFile);
49 
50 } // namespace Core
Definition: PropertyEmbeddedFile.h:13
Definition: Persistence.h:14
Definition: md5.h:69
A Utf-16 (windows) or ucs4 (unix) encoded string class.
Definition: String.h:23
LX_CORE_EXPORT Version & version
Definition: Variant.h:87
Definition: AbstractXMLReader.h:7
Definition: Base.h:12
Definition: Writer.h:16
Base::String _filepath
Definition: PropertyEmbeddedFile.h:40
QByteArray _content
Definition: PropertyEmbeddedFile.h:41
bool _saveInline
Definition: PropertyEmbeddedFile.h:43
Definition: Property.h:77
MD5 _md5
Definition: PropertyEmbeddedFile.h:42
TYPESYSTEM_HEADER()
DECLARE_PROPERTY_FACTORY(PropertyAxis1_Factory, Core::PropertyAxis1)