OpenLexocad  27.1
PropertyEnumDescriptor.h
Go to the documentation of this file.
1 #pragma once
2 
4 
5 #include <utility>
6 
7 namespace Core
8 {
9 /* @brief Saves and restores the characteristics of a PropertyEnum
10  */
11 class LX_CORE_EXPORT PropertyEnumDescriptor : public Core::PropertyDescriptor
12 {
15 public:
16  friend class PropertyEnumDescriptor_Factory;
17 
18  size_t addEntry(const Base::String& aValue, int aTranslationId);
19  bool getEntry(size_t aIndex, std::pair<Base::String, int>& aEntry) const;
20  bool removeEntry(size_t aIndex);
21  std::vector<std::pair<Base::String, int>> getEntries() const;
22  void setEmpty();
23 
25  virtual ~PropertyEnumDescriptor();
26 
27  Type getType() const override;
28  size_t getSize() const;
29 
30 protected:
31  Core::DocObject* copy(Core::CoreDocument* toDoc, DocObjectMap& copyMap) override;
32 
33 private:
34  PropertyTextList enums;
35  PropertyIndexList translationIds;
36 };
37 
39 DECLARE_OBJECT_FACTORY_NOIFC(PropertyEnumDescriptor_Factory, PropertyEnumDescriptor);
40 } // namespace Core
Definition: PropertyInteger.h:169
DECLARE_PROPERTY_TEMPLATES(Core::PropertyDescriptor, LX_CORE_EXPORT)
Definition: PropertyText.h:22
Definition: PropertyEnumDescriptor.h:11
Type
Definition: PropertyDescriptor.h:22
A Utf-16 (windows) or ucs4 (unix) encoded string class.
Definition: String.h:23
Definition: CoreDocument.h:210
Definition: Base.h:12
DECLARE_OBJECT_FACTORY_NOIFC(PropertyBoolDescriptor_Factory, PropertyBoolDescriptor)
Definition: PropertyDescriptor.h:15
LX_NODE_HEADER()
std::map< Core::DocObject *, Core::DocObject * > DocObjectMap
Definition: DocObject.h:10
TYPESYSTEM_HEADER()
Definition: DocObject.h:51