// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

import "Command.idl";

namespace Microsoft.Terminal.Settings.Model
{
    // This interface ensures that no changes are made to ActionMap
    interface IActionMapView
    {
        Boolean IsKeyChordExplicitlyUnbound(Microsoft.Terminal.Control.KeyChord keys);

        Command GetActionByKeyChord(Microsoft.Terminal.Control.KeyChord keys);

        Microsoft.Terminal.Control.KeyChord GetKeyBindingForAction(ShortcutAction action);
        [method_name("GetKeyBindingForActionWithArgs")] Microsoft.Terminal.Control.KeyChord GetKeyBindingForAction(ShortcutAction action, IActionArgs actionArgs);

        Windows.Foundation.Collections.IMapView<String, ActionAndArgs> AvailableActions { get; };

        Windows.Foundation.Collections.IMapView<String, Command> NameMap { get; };
        Windows.Foundation.Collections.IMapView<Microsoft.Terminal.Control.KeyChord, Command> KeyBindings { get; };
        Windows.Foundation.Collections.IMapView<Microsoft.Terminal.Control.KeyChord, Command> GlobalHotkeys { get; };

        IVector<Command> ExpandedCommands { get; };
    };

    [default_interface] runtimeclass ActionMap : IActionMapView
    {
        void RebindKeys(Microsoft.Terminal.Control.KeyChord oldKeys, Microsoft.Terminal.Control.KeyChord newKeys);
        void DeleteKeyBinding(Microsoft.Terminal.Control.KeyChord keys);

        void RegisterKeyBinding(Microsoft.Terminal.Control.KeyChord keys, ActionAndArgs action);
    }
}
