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

import "ColorSchemesPageViewModel.idl";

namespace Microsoft.Terminal.Settings.Editor
{
    [default_interface] runtimeclass Extensions : Windows.UI.Xaml.Controls.Page
    {
        Extensions();
        ExtensionsViewModel ViewModel { get; };

        Windows.UI.Xaml.Thickness CalculateMargin(Boolean hidden);
    }

    [default_interface] runtimeclass ExtensionsViewModel : Windows.UI.Xaml.Data.INotifyPropertyChanged
    {
        // Properties
        ExtensionPackageViewModel CurrentExtensionPackage;
        Windows.UI.Xaml.DataTemplate CurrentExtensionPackageIdentifierTemplate { get; };
        Boolean IsExtensionView { get; };
        Boolean NoExtensionPackages { get; };
        Boolean NoProfilesModified { get; };
        Boolean NoProfilesAdded { get; };
        Boolean NoSchemesAdded { get; };

        // Views
        IVector<ExtensionPackageViewModel> ExtensionPackages { get; };
        IObservableVector<FragmentProfileViewModel> ProfilesModified { get; };
        IObservableVector<FragmentProfileViewModel> ProfilesAdded { get; };
        IObservableVector<FragmentColorSchemeViewModel> ColorSchemesAdded { get; };

        // Methods
        void UpdateSettings(Microsoft.Terminal.Settings.Model.CascadiaSettings settings, ColorSchemesPageViewModel colorSchemesPageVM);

        event Windows.Foundation.TypedEventHandler<Object, Guid> NavigateToProfileRequested;
        event Windows.Foundation.TypedEventHandler<Object, ColorSchemeViewModel> NavigateToColorSchemeRequested;
    }

    [default_interface] runtimeclass ExtensionPackageViewModel : Windows.UI.Xaml.Data.INotifyPropertyChanged
    {
        Microsoft.Terminal.Settings.Model.ExtensionPackage Package { get; };
        String DisplayName { get; };
        String Icon { get; };
        Boolean Enabled;
        String Scope { get; };
        String AccessibleName { get; };
        IVector<FragmentExtensionViewModel> FragmentExtensions { get; };
    }

    [default_interface] runtimeclass FragmentExtensionViewModel : Windows.UI.Xaml.Data.INotifyPropertyChanged
    {
        Microsoft.Terminal.Settings.Model.FragmentSettings Fragment { get; };
        IVectorView<FragmentProfileViewModel> ProfilesModified { get; };
        IVectorView<FragmentProfileViewModel> ProfilesAdded { get; };
        IVectorView<FragmentColorSchemeViewModel> ColorSchemesAdded { get; };
    }

    [default_interface] runtimeclass FragmentProfileViewModel : Windows.UI.Xaml.Data.INotifyPropertyChanged
    {
        Microsoft.Terminal.Settings.Model.Profile Profile { get; };
        String SourceName { get; };
        String Json { get; };
        String AccessibleName { get; };
    }

    [default_interface] runtimeclass FragmentColorSchemeViewModel : Windows.UI.Xaml.Data.INotifyPropertyChanged
    {
        ColorSchemeViewModel ColorSchemeVM { get; };
        String SourceName { get; };
        String Json { get; };
        String AccessibleName { get; };
    }

    [default_interface] runtimeclass ExtensionPackageTemplateSelector : Windows.UI.Xaml.Controls.DataTemplateSelector
    {
        ExtensionPackageTemplateSelector();

        Windows.UI.Xaml.DataTemplate DefaultTemplate;
        Windows.UI.Xaml.DataTemplate ComplexTemplate;
        Windows.UI.Xaml.DataTemplate ComplexTemplateWithFontIcon;
    }
}
