OpenLexocad  28.0
PropertyTextList.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <Core/Property.h>
4 
5 namespace Core
6 {
7 class LX_CORE_EXPORT PropertyTextList : public Core::Property
8 {
10 
11 public:
12  void setValue(const std::list<Base::String>& textList);
13  bool setValueFromVariant(const Core::Variant& value) override;
14  void copyValue(Core::Property* p) override;
15 
16  void addText(const Base::String& text);
17  void removeText(const Base::String& text);
18 
19  bool contains(const Base::String& text) const;
20 
21  void setEmpty();
22  bool isEmpty() const;
23  size_t getSize() const;
24 
25  const std::list<Base::String>& getValue() const;
26 
27  Core::Variant getVariant() const override { return Core::Variant(_textList); }
28 
29  void save(Base::AbstractWriter& writer, Base::PersistenceVersion& save_version) override;
30 
32  bool isEqual(const Property*) const override;
33  Core::Property* copy() const override;
34  void paste(const Core::Property& from) override;
35 
36 protected:
37  std::list<Base::String> _textList;
38 };
39 
41 
42 DECLARE_PROPERTY_FACTORY(PropertyTextList_Factory, Core::PropertyTextList);
43 
44 } // namespace Core
Property.h
Core::PropertyTextList::copyValue
void copyValue(Core::Property *p) override
Core::PropertyTextList::contains
bool contains(const Base::String &text) const
Core::PropertyTextList::_textList
std::list< Base::String > _textList
Definition: PropertyTextList.h:37
Core::PropertyTextList::copy
Core::Property * copy() const override
Returns a new copy of the property (mainly for Undo/Redo and transactions). The copy has no container...
Core::PropertyTextList::removeText
void removeText(const Base::String &text)
Core::PropertyTextList::restore
void restore(Base::AbstractXMLReader &reader, Base::PersistenceVersion &version) override
This method is used to restore properties from an XML document.
Core::PropertyTextList::isEmpty
bool isEmpty() const
Core::PropertyTextList::save
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::PropertyTextList::setEmpty
void setEmpty()
Base::PersistenceVersion
Definition: Persistence.h:13
Core::PropertyTextList::getVariant
Core::Variant getVariant() const override
Definition: PropertyTextList.h:27
Core
Definition: Base.h:5
Core::Variant
Definition: Variant.h:78
Core::PropertyTextList::getSize
size_t getSize() const
Core::PropertyTextList::isEqual
bool isEqual(const Property *) const override
compare properties
Base::AbstractWriter
Definition: Writer.h:13
Base::AbstractXMLReader
Definition: AbstractXMLReader.h:7
Core::PropertyTextList::setValueFromVariant
bool setValueFromVariant(const Core::Variant &value) override
Core::PropertyTextList::getValue
const std::list< Base::String > & getValue() const
Core::PropertyTextList
Definition: PropertyTextList.h:8
Core::PropertyTextList::addText
void addText(const Base::String &text)
Core::version
LX_CORE_EXPORT Version & version
Core::Property
Definition: Property.h:72
Base::String
A Utf-16 (windows) or ucs4 (unix) encoded string class.
Definition: String.h:18
Core::DECLARE_OPTIONAL_PROPERTY_HEADER
DECLARE_OPTIONAL_PROPERTY_HEADER(PropertyColorOpt, Core::PropertyColor)
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::PropertyTextList::paste
void paste(const Core::Property &from) override
Paste the value from the property (mainly for Undo/Redo and transactions)
Core::PropertyTextList::setValue
void setValue(const std::list< Base::String > &textList)