CommandManager.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. namespace MCore
  9. {
  10. class CommandManager
  11. {
  12. public:
  13. virtual ~CommandManager() = default;
  14. //bool ExecuteCommand(const char* command, AZStd::string& outCommandResult, bool addToHistory = true, Command** outExecutedCommand = nullptr, CommandLine* outExecutedParamters = nullptr, bool callFromCommandGroup = false, bool clearErrors = true, bool handleErrors = true);
  15. //bool ExecuteCommand(const AZStd::string& command, AZStd::string& outCommandResult, bool addToHistory = true, Command** outExecutedCommand = nullptr, CommandLine* outExecutedParamters = nullptr, bool callFromCommandGroup = false, bool clearErrors = true, bool handleErrors = true);
  16. //bool ExecuteCommand(Command* command, AZStd::string& outCommandResult, bool addToHistory = true, bool clearErrors = true, bool handleErrors = true);
  17. MOCK_METHOD2(ExecuteCommandInsideCommand, bool(const char* command, AZStd::string& outCommandResult));
  18. MOCK_METHOD2(ExecuteCommandInsideCommand, bool(const AZStd::string& command, AZStd::string& outCommandResult));
  19. //bool ExecuteCommandOrAddToGroup(const AZStd::string& command, MCore::CommandGroup* commandGroup = nullptr, bool executeInsideCommand = false);
  20. MOCK_METHOD5(ExecuteCommandGroupImpl, bool(CommandGroup& commandGroup, AZStd::string& outCommandResult, bool addToHistory, bool clearErrors, bool handleErrors));
  21. virtual bool ExecuteCommandGroup(CommandGroup& commandGroup, AZStd::string& outCommandResult, bool addToHistory = true, bool clearErrors = true, bool handleErrors = true) { return ExecuteCommandGroupImpl(commandGroup, outCommandResult, addToHistory, clearErrors, handleErrors); }
  22. //bool ExecuteCommandGroupInsideCommand(CommandGroup& commandGroup, AZStd::string& outCommandResult);
  23. //bool Undo(AZStd::string& outCommandResult);
  24. //bool Redo(AZStd::string& outCommandResult);
  25. //bool RegisterCommand(Command* command);
  26. //void LogCommandHistory();
  27. //Command* FindCommand(const AZStd::string& commandName);
  28. //void RemoveCallbacks();
  29. //void RegisterCallback(CommandManagerCallback* callback);
  30. //void RemoveCallback(CommandManagerCallback* callback, bool delFromMem = true);
  31. //uint32 GetNumCallbacks() const;
  32. //CommandManagerCallback* GetCallback(uint32 index);
  33. //void SetMaxHistoryItems(uint32 maxItems);
  34. //uint32 GetMaxHistoryItems() const;
  35. //int32 GetHistoryIndex() const;
  36. //uint32 GetNumHistoryItems() const;
  37. //const CommandHistoryEntry& GetHistoryItem(uint32 index) const;
  38. //Command* GetHistoryCommand(uint32 historyIndex);
  39. //void ClearHistory();
  40. //const CommandLine& GetHistoryCommandLine(uint32 historyIndex) const;
  41. //uint32 GetNumRegisteredCommands() const;
  42. //Command* GetCommand(uint32 index);
  43. //void RemoveCommandCallback(const char* commandName, Command::Callback* callback, bool delFromMem);
  44. //bool RegisterCommandCallback(const char* commandName, Command::Callback* callback);
  45. //template<typename T, typename... Args>
  46. //bool RegisterCommandCallback(const char* commandName, AZStd::vector<Command::Callback*>& callbacks, Args... args)
  47. //void AddError(const char* errorLine);
  48. //void AddError(const AZStd::string& errorLine);
  49. //bool ShowErrorReport();
  50. //bool IsExecuting() const;
  51. };
  52. } // namespace MCore