OpenLexocad  27.1
CmdModifyPropertySetValue.h
Go to the documentation of this file.
1  #pragma once
2 #include <Core/Command.h>
3 
4 #include <App/ComponentType.h>
5 #include <App/Properties/PropertySetInfo.h>
6 #include <OpenLxApp/Element.h>
7 
8 #include "Gui/CA_Command_5.h"
9 
10 
11  namespace OpenLxCmd
12 {
16 class LX_OPENLXCMD_EXPORT CmdModifyPropertySetValue : public Core::Command
17 {
18 public:
19  CmdModifyPropertySetValue() = default;
20  CmdModifyPropertySetValue(const std::string& propertySetName, const std::string& propertyName, const Core::Variant& propertyValue);
21  CmdModifyPropertySetValue(const std::string& propertySetName, const std::string& propertyName, const Core::Variant& propertyValue, std::shared_ptr<OpenLxApp::Element> aElement);
22  CmdModifyPropertySetValue(const std::string& propertySetName, const std::string& propertyName, const Core::Variant& propertyValue, std::vector<std::shared_ptr<OpenLxApp::Element>>& aElements);
23  ~CmdModifyPropertySetValue() = default;
24 
25  bool redo() override;
26  bool undo() override;
27 
28 private:
29  void execute(const std::string& propertySetName, const std::string& propertyName, const Core::Variant& propertyValue, const std::vector<App::Element*> &elements);
30  App::PropertySetDefinition* getPropertySetDefinition(const Base::String& propertySetName, App::Element* element) const;
31 
32  std::unique_ptr<CmdRunCommands> _commands;
33 };
34 }
A Utf-16 (windows) or ucs4 (unix) encoded string class.
Definition: String.h:23
Definition: Variant.h:87
"CmdModifyPropertySetValue" is used to assign a value to ane EXISTING Property in a PropertySet.
Definition: CmdModifyPropertySetValue.h:16
bool undo(int id=0)
Will UNDO one step, returns False if no undo was done (Undos == 0).
bool redo(int id=0)
Will REDO one step, returns False if no redo was done (Redos == 0).
Definition: CmdAddBolt.h:7
Definition: Command.h:34