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

import "GlobalAppSettings.idl";
import "Profile.idl";
import "TerminalWarnings.idl";
import "DefaultTerminal.idl";

namespace Microsoft.Terminal.Settings.Model
{
    [default_interface] runtimeclass CascadiaSettings {
        CascadiaSettings(String json);
        CascadiaSettings Copy();

        void WriteSettingsToDisk();

        static CascadiaSettings LoadDefaults();
        static CascadiaSettings LoadAll();
        static CascadiaSettings LoadUniversal();

        static String SettingsPath { get; };
        static String DefaultSettingsPath { get; };

        static String ApplicationDisplayName { get; };
        static String ApplicationVersion { get; };

        GlobalAppSettings GlobalSettings { get; };

        Profile ProfileDefaults { get; };

        Windows.Foundation.Collections.IObservableVector<Profile> AllProfiles { get; };
        Windows.Foundation.Collections.IObservableVector<Profile> ActiveProfiles { get; };

        Profile DuplicateProfile(Profile sourceProfile);

        ActionMap ActionMap { get; };

        Windows.Foundation.Collections.IVectorView<SettingsLoadWarnings> Warnings { get; };
        Windows.Foundation.IReference<SettingsLoadErrors> GetLoadingError { get; };
        String GetSerializationErrorMessage { get; };

        Profile CreateNewProfile();
        Profile FindProfile(Guid profileGuid);
        ColorScheme GetColorSchemeForProfile(Guid profileGuid);
        void UpdateColorSchemeReferences(String oldName, String newName);

        Guid GetProfileForArgs(NewTerminalArgs newTerminalArgs);

        void RefreshDefaultTerminals();
        static Boolean IsDefaultTerminalAvailable { get; };
        Windows.Foundation.Collections.IObservableVector<DefaultTerminal> DefaultTerminals { get; };
        DefaultTerminal CurrentDefaultTerminal;
    }
}
