OpenLexocad  27.1
PropertyText.h
Go to the documentation of this file.
1 #pragma once
2 #pragma warning(disable : 4251)
3 #include <Core/PropertyString.h>
4 #include <Core/Variant.h>
5 
6 #include <QRegExp>
7 #include <string>
8 
9 namespace Core
10 {
11 class LX_CORE_EXPORT PropertyText : public Core::PropertyString
12 {
14 
15 public:
16  PropertyText(void);
17  virtual ~PropertyText(void);
18 };
19 
21 
22 class LX_CORE_EXPORT PropertyTextList : public Core::Property
23 {
25 
26 public:
28  virtual ~PropertyTextList();
29 
30  void setValue(const std::list<Base::String>& textList);
31  bool setValueFromVariant(const Core::Variant& value);
32  void copyValue(Core::Property* p);
33 
34  void addText(const Base::String& text);
35  void removeText(const Base::String& text);
36 
37  bool contains(const Base::String& text) const;
38 
39  void setEmpty();
40  bool isEmpty() const;
41  size_t getSize() const;
42 
43  const std::list<Base::String>& getValue() const;
44 
45  Core::Variant getVariant(void) const { return Core::Variant(_textList); }
46 
47  virtual void save(Base::AbstractWriter& writer, Base::PersistenceVersion& save_version);
48 
49  inline virtual void restore(Base::AbstractXMLReader& reader, Base::PersistenceVersion& version);
50  virtual bool isEqual(const Property*) const;
51  virtual Core::Property* copy(void) const override;
52  virtual void paste(const Core::Property& from) override;
53 
54 protected:
56 };
57 
59 
60 class LX_CORE_EXPORT PropertyMultiLineText : public Core::Property
61 {
63 
64 public:
66  virtual ~PropertyMultiLineText(void);
67 
68  void setValue(const Base::String& text);
69  bool setValueFromVariant(const Core::Variant& value);
70  void copyValue(Core::Property* p);
71 
72  const Base::String& getValue() const;
73  Core::Variant getVariant(void) const;
74 
75  virtual void save(Base::AbstractWriter& writer, Base::PersistenceVersion& save_version);
76  inline virtual void restore(Base::AbstractXMLReader& reader, Base::PersistenceVersion& version);
77  virtual bool isEqual(const Property*) const;
78  virtual Core::Property* copy(void) const override;
79  virtual void paste(const Core::Property& from) override;
80 
81 protected:
83 };
84 
85 DECLARE_PROPERTY_FACTORY(PropertyText_Factory, Core::PropertyText);
86 DECLARE_PROPERTY_FACTORY(PropertyTextList_Factory, Core::PropertyTextList);
87 DECLARE_PROPERTY_FACTORY(PropertyMultiLineText_Factory, Core::PropertyMultiLineText);
88 
89 
90 
91 } // namespace Core
DECLARE_OPTIONAL_PROPERTY_HEADER(PropertyColorOpt, Core::PropertyColor)
Definition: PropertyText.h:60
Definition: Persistence.h:14
Base::String _text
Definition: PropertyText.h:82
Definition: PropertyText.h:22
Definition: PropertyText.h:11
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
std::list< Base::String > _textList
Definition: PropertyText.h:55
Definition: Base.h:12
Definition: Writer.h:16
Definition: Property.h:77
Core::Variant getVariant(void) const
Definition: PropertyText.h:45
TYPESYSTEM_HEADER()
Definition: PropertyString.h:19
DECLARE_PROPERTY_FACTORY(PropertyAxis1_Factory, Core::PropertyAxis1)