2019-11-27 22:51:38 +01:00
|
|
|
// Copyright (c) Microsoft Corporation.
|
|
|
|
// Licensed under the MIT license.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "ShortcutActionDispatch.g.h"
|
2020-11-25 22:02:10 +01:00
|
|
|
#include "../inc/cppwinrt_utils.h"
|
2021-03-31 18:38:25 +02:00
|
|
|
#include "../TerminalSettingsModel/AllShortcutActions.h"
|
2019-11-27 22:51:38 +01:00
|
|
|
|
|
|
|
// fwdecl unittest classes
|
|
|
|
namespace TerminalAppLocalTests
|
|
|
|
{
|
|
|
|
class SettingsTests;
|
|
|
|
class KeyBindingsTests;
|
|
|
|
}
|
|
|
|
|
2021-03-30 18:08:03 +02:00
|
|
|
#define DECLARE_ACTION(action) TYPED_EVENT(action, TerminalApp::ShortcutActionDispatch, Microsoft::Terminal::Settings::Model::ActionEventArgs);
|
|
|
|
|
2019-11-27 22:51:38 +01:00
|
|
|
namespace winrt::TerminalApp::implementation
|
|
|
|
{
|
|
|
|
struct ShortcutActionDispatch : ShortcutActionDispatchT<ShortcutActionDispatch>
|
|
|
|
{
|
|
|
|
ShortcutActionDispatch() = default;
|
|
|
|
|
2020-10-06 18:56:59 +02:00
|
|
|
bool DoAction(const Microsoft::Terminal::Settings::Model::ActionAndArgs& actionAndArgs);
|
2019-11-27 22:51:38 +01:00
|
|
|
|
2021-03-31 18:38:25 +02:00
|
|
|
#define ON_ALL_ACTIONS(action) DECLARE_ACTION(action);
|
|
|
|
ALL_SHORTCUT_ACTIONS
|
|
|
|
#undef ON_ALL_ACTIONS
|
2019-11-27 22:51:38 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
friend class TerminalAppLocalTests::SettingsTests;
|
|
|
|
friend class TerminalAppLocalTests::KeyBindingsTests;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace winrt::TerminalApp::factory_implementation
|
|
|
|
{
|
|
|
|
BASIC_FACTORY(ShortcutActionDispatch);
|
|
|
|
}
|