Open 3D Engine EMotionFX Gem API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
MCore::CommandManagerCallback Class Referenceabstract

#include <CommandManagerCallback.h>

Inherited by EMStudio::ActionHistoryCallback.

Public Member Functions

 CommandManagerCallback ()
 
virtual ~CommandManagerCallback ()
 
virtual void OnPreExecuteCommand (CommandGroup *group, Command *command, const CommandLine &commandLine)=0
 
virtual void OnPostExecuteCommand (CommandGroup *group, Command *command, const CommandLine &commandLine, bool wasSuccess, const AZStd::string &outResult)=0
 
virtual void OnPreUndoCommand (MCore::Command *command, const MCore::CommandLine &commandLine)
 
virtual void OnPostUndoCommand (MCore::Command *command, const MCore::CommandLine &commandLine)
 
virtual void OnPreExecuteCommandGroup (CommandGroup *group, bool undo)=0
 
virtual void OnPostExecuteCommandGroup (CommandGroup *group, bool wasSuccess)=0
 
virtual void OnAddCommandToHistory (size_t historyIndex, CommandGroup *group, Command *command, const CommandLine &commandLine)=0
 
virtual void OnRemoveCommand (size_t historyIndex)=0
 
virtual void OnSetCurrentCommand (size_t index)=0
 
virtual void OnShowErrorReport (const AZStd::vector< AZStd::string > &errors)
 

Detailed Description

The command manager callback class. Specific events are triggered by the command manager through this callback class. For example you can get notified when a given command is being executed. This can be used to for example link the command manager to a graphical user interface. It could show the command history in which the user can step back and forth to undo and redo commands.

Constructor & Destructor Documentation

◆ CommandManagerCallback()

MCore::CommandManagerCallback::CommandManagerCallback ( )
inline

The constructor.

◆ ~CommandManagerCallback()

virtual MCore::CommandManagerCallback::~CommandManagerCallback ( )
inlinevirtual

The destructor.

Member Function Documentation

◆ OnAddCommandToHistory()

virtual void MCore::CommandManagerCallback::OnAddCommandToHistory ( size_t  historyIndex,
CommandGroup group,
Command command,
const CommandLine commandLine 
)
pure virtual

This callback is executed when a new item is added to the command history.

Parameters
historyIndexThe history index where the new item was added.
groupThe group that was added to the history list, or nullptr when it is not a group but a regular command.
commandThe command that is linked with this history item.
commandLineThe command line that is linked to this history item.

Implemented in EMStudio::ActionHistoryCallback.

◆ OnPostExecuteCommand()

virtual void MCore::CommandManagerCallback::OnPostExecuteCommand ( CommandGroup group,
Command command,
const CommandLine commandLine,
bool  wasSuccess,
const AZStd::string &  outResult 
)
pure virtual

This callback is executed after we have executed a given command.

Parameters
groupThe group that just executed, or nullptr when it is not a group but a regular command.
commandThe command that has just been executed.
commandLineThe command line that was used when executing the command.
wasSuccessThis is set to true when the command execution was successful, or false when it failed.
outResultThe string that contains the result of the execution, or the error when the execution failed.

Implemented in EMStudio::ActionHistoryCallback.

◆ OnPostExecuteCommandGroup()

virtual void MCore::CommandManagerCallback::OnPostExecuteCommandGroup ( CommandGroup group,
bool  wasSuccess 
)
pure virtual

This callback is executed after we have executed a given command group.

Parameters
groupThe group that just executed, or nullptr when it is not a group but a regular command.
wasSuccessThis is set to true when the command execution was successful, or false when it failed.

Implemented in EMStudio::ActionHistoryCallback.

◆ OnPreExecuteCommand()

virtual void MCore::CommandManagerCallback::OnPreExecuteCommand ( CommandGroup group,
Command command,
const CommandLine commandLine 
)
pure virtual

This callback is executed before we are going to execute a given command.

Parameters
groupThe group that is about to be executed, or nullptr when it is not a group but a regular command.
commandThe command that is about to be executed.
commandLineThe command line that is going to be used when executing the command.

Implemented in EMStudio::ActionHistoryCallback.

◆ OnPreExecuteCommandGroup()

virtual void MCore::CommandManagerCallback::OnPreExecuteCommandGroup ( CommandGroup group,
bool  undo 
)
pure virtual

This callback is executed before we are going to execute a given command group.

Parameters
groupThe group that is about to be executed, or nullptr when it is not a group but a regular command.
undoTrue in case the command group has been executed already and is now being undone, false in case the command group is normally executed.

Implemented in EMStudio::ActionHistoryCallback.

◆ OnRemoveCommand()

virtual void MCore::CommandManagerCallback::OnRemoveCommand ( size_t  historyIndex)
pure virtual

This callback is executed when a command is being removed from the command history.

Parameters
historyIndexThe history index of the command that is being removed.

Implemented in EMStudio::ActionHistoryCallback.

◆ OnSetCurrentCommand()

virtual void MCore::CommandManagerCallback::OnSetCurrentCommand ( size_t  index)
pure virtual

This callback is executed when we step back or forth in the command history.

Parameters
indexThe new history index which will be the current state the system will be in.

Implemented in EMStudio::ActionHistoryCallback.

◆ OnShowErrorReport()

virtual void MCore::CommandManagerCallback::OnShowErrorReport ( const AZStd::vector< AZStd::string > &  errors)
inlinevirtual

This callback is executed before the error array is getting cleared and the interfaces shall show some error reporting window or something similar. @errors[in] errors The errors that happened and shall be made visible to the user.


The documentation for this class was generated from the following file: