OpenLexocad  28.0
PropertySearchSettings.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <Core/Property.h>
4 
5 namespace Core
6 {
7 struct SearchValue
8 {
9  QString name;
10  QString value;
11 };
12 
13 class LX_CORE_EXPORT PropertySearchSettings : public Core::Property
14 {
16 
17 public:
18  void setValue(const std::vector<std::vector<SearchValue>>& setting);
19  bool setValueFromVariant(const Core::Variant& value);
21 
22  const std::vector<std::vector<SearchValue>>& getValue() const;
24 
25  virtual void save(Base::AbstractWriter& writer, Base::PersistenceVersion& save_version);
27  virtual bool isEqual(const Property*) const;
28  virtual Core::Property* copy(void) const override;
29  virtual void paste(const Core::Property& from) override;
30 
31 protected:
32  std::vector<std::vector<SearchValue>> _settings;
33 };
34 
35 class LX_CORE_EXPORT PropertySearchSettingsVector : public Core::Property
36 {
38 
39 public:
40  void setValue(const std::vector<std::vector<std::vector<SearchValue>>>& setting);
41  bool setValueFromVariant(const Core::Variant& value);
43 
44  const std::vector<std::vector<std::vector<SearchValue>>>& getValue() const;
46 
47  virtual void save(Base::AbstractWriter& writer, Base::PersistenceVersion& save_version);
49  virtual bool isEqual(const Property*) const;
50  virtual Core::Property* copy(void) const override;
51  virtual void paste(const Core::Property& from) override;
52 
53 protected:
54  std::vector<std::vector<std::vector<SearchValue>>> _settings;
55 };
56 
57 DECLARE_PROPERTY_FACTORY(PropertySearchSettings_Factory, Core::PropertySearchSettings);
58 DECLARE_PROPERTY_FACTORY(PropertySearchSettingsVector_Factory, Core::PropertySearchSettingsVector);
59 
60 
61 
62 } // namespace Core
Core::PropertySearchSettingsVector::getVariant
Core::Variant getVariant(void) const
Property.h
Core::PropertySearchSettings::setValueFromVariant
bool setValueFromVariant(const Core::Variant &value)
Core::PropertySearchSettings::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::PropertySearchSettingsVector::setValue
void setValue(const std::vector< std::vector< std::vector< SearchValue >>> &setting)
Core::PropertySearchSettings::paste
virtual void paste(const Core::Property &from) override
Paste the value from the property (mainly for Undo/Redo and transactions)
Core::PropertySearchSettings::getValue
const std::vector< std::vector< SearchValue > > & getValue() const
Core::PropertySearchSettings::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::PropertySearchSettings::getVariant
Core::Variant getVariant(void) const
Core::PropertySearchSettings
Definition: PropertySearchSettings.h:14
Core::PropertySearchSettingsVector::_settings
std::vector< std::vector< std::vector< SearchValue > > > _settings
Definition: PropertySearchSettings.h:54
Core::SearchValue
Definition: PropertySearchSettings.h:8
Core::SearchValue::value
QString value
Definition: PropertySearchSettings.h:10
Core::PropertySearchSettings::restore
virtual void restore(Base::AbstractXMLReader &reader, Base::PersistenceVersion &version)
This method is used to restore properties from an XML document.
Core::PropertySearchSettingsVector::isEqual
virtual bool isEqual(const Property *) const
compare properties
Base::PersistenceVersion
Definition: Persistence.h:13
Core::SearchValue::name
QString name
Definition: PropertySearchSettings.h:9
Core
Definition: Base.h:5
Core::Variant
Definition: Variant.h:78
Base::AbstractWriter
Definition: Writer.h:13
Core::PropertySearchSettings::_settings
std::vector< std::vector< SearchValue > > _settings
Definition: PropertySearchSettings.h:32
Core::PropertySearchSettingsVector::copyValue
void copyValue(Core::Property *p)
Base::AbstractXMLReader
Definition: AbstractXMLReader.h:7
Core::PropertySearchSettingsVector::setValueFromVariant
bool setValueFromVariant(const Core::Variant &value)
Core::PropertySearchSettingsVector::paste
virtual void paste(const Core::Property &from) override
Paste the value from the property (mainly for Undo/Redo and transactions)
Core::PropertySearchSettings::setValue
void setValue(const std::vector< std::vector< SearchValue >> &setting)
Core::PropertySearchSettingsVector::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::version
LX_CORE_EXPORT Version & version
Core::PropertySearchSettingsVector::getValue
const std::vector< std::vector< std::vector< SearchValue > > > & getValue() const
Core::Property
Definition: Property.h:72
Core::PropertySearchSettingsVector
Definition: PropertySearchSettings.h:36
Core::PropertySearchSettingsVector::restore
virtual void restore(Base::AbstractXMLReader &reader, Base::PersistenceVersion &version)
This method is used to restore properties from an XML document.
Core::PropertySearchSettings::copyValue
void copyValue(Core::Property *p)
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::PropertySearchSettingsVector::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::PropertySearchSettings::isEqual
virtual bool isEqual(const Property *) const
compare properties