1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 * ParametersPlugin_EvalListener.h
5 * Created on: Apr 28, 2015
9 #ifndef SRC_PARAMETERSPLUGIN_EVALLISTENER_H_
10 #define SRC_PARAMETERSPLUGIN_EVALLISTENER_H_
12 #include <ParametersPlugin.h>
13 #include <Events_Loop.h>
15 class ModelAPI_Attribute;
16 class ModelAPI_Document;
17 class ModelAPI_Feature;
18 class ModelAPI_ResultParameter;
19 class ParametersPlugin_Parameter;
22 * \class ParametersPlugin_EvalListener
24 * \brief Class which process the events from the event loop.
26 class ParametersPlugin_EvalListener : public Events_Listener
29 PARAMETERSPLUGIN_EXPORT ParametersPlugin_EvalListener();
30 PARAMETERSPLUGIN_EXPORT virtual ~ParametersPlugin_EvalListener();
32 /// Reimplemented from Events_Listener::processEvent().
33 PARAMETERSPLUGIN_EXPORT
34 virtual void processEvent(const std::shared_ptr<Events_Message>& theMessage);
37 /// Processes ObjectRenamed event.
38 void processObjectRenamedEvent(const std::shared_ptr<Events_Message>& theMessage);
39 /// Processes ReplaceParameter event.
40 void processReplaceParameterEvent(const std::shared_ptr<Events_Message>& theMessage);
42 /// Renames theOldName in theExpression by theNewName.
43 std::string renameInPythonExpression(const std::string& theExpression,
44 const std::string& theOldName,
45 const std::string& theNewName);
46 /// Renames theOldName in the expression attribute of theParameter by theNewName.
47 void renameInParameter(std::shared_ptr<ParametersPlugin_Parameter> theParameter,
48 const std::string& theOldName,
49 const std::string& theNewName);
50 /// Renames theOldName in the text fields of theAttribute by theNewName.
51 void renameInAttribute(std::shared_ptr<ModelAPI_Attribute> theAttribute,
52 const std::string& theOldName,
53 const std::string& theNewName);
54 /// Renames theOldName in all dependents of theResultParameter by theNewName.
55 void renameInDependents(std::shared_ptr<ModelAPI_ResultParameter> theResultParameter,
56 const std::string& theOldName,
57 const std::string& theNewName);
60 #endif /* SRC_PARAMETERSPLUGIN_PARAMETERSPLUGIN_EVALLISTENER_H_ */