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

import "EnumEntry.idl";

namespace Microsoft.Terminal.Settings.Editor
{
    runtimeclass ModifyKeyBindingEventArgs
    {
        Microsoft.Terminal.Control.KeyChord OldKeys { get; };
        Microsoft.Terminal.Control.KeyChord NewKeys { get; };
        String OldActionName { get; };
        String NewActionName { get; };
    }

    runtimeclass KeyBindingViewModel : Windows.UI.Xaml.Data.INotifyPropertyChanged
    {
        // Settings Model side
        String Name { get; };
        String KeyChordText { get; };

        // UI side
        Boolean ShowEditButton { get; };
        Boolean IsInEditMode { get; };
        Boolean IsNewlyAdded { get; };
        Microsoft.Terminal.Control.KeyChord ProposedKeys;
        Object ProposedAction;
        Windows.UI.Xaml.Controls.Flyout AcceptChangesFlyout;
        String EditButtonName { get; };
        String CancelButtonName { get; };
        String AcceptButtonName { get; };
        String DeleteButtonName { get; };
        Windows.UI.Xaml.Media.Brush ContainerBackground { get; };

        void EnterHoverMode();
        void ExitHoverMode();
        void ActionGotFocus();
        void ActionLostFocus();
        void EditButtonGettingFocus();
        void EditButtonLosingFocus();
        IObservableVector<String> AvailableActions { get; };
        void ToggleEditMode();
        void AttemptAcceptChanges();
        void CancelChanges();
        void DeleteKeyBinding();

        event Windows.Foundation.TypedEventHandler<KeyBindingViewModel, ModifyKeyBindingEventArgs> ModifyKeyBindingRequested;
        event Windows.Foundation.TypedEventHandler<KeyBindingViewModel, Microsoft.Terminal.Control.KeyChord> DeleteKeyBindingRequested;
    }

    runtimeclass ActionsPageNavigationState
    {
        Microsoft.Terminal.Settings.Model.CascadiaSettings Settings;
    };

    [default_interface] runtimeclass Actions : Windows.UI.Xaml.Controls.Page
    {
        Actions();
        ActionsPageNavigationState State { get; };

        IObservableVector<KeyBindingViewModel> KeyBindingList { get; };
    }
}
