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

import "IAppearanceConfig.idl";
import "ISettingsModelObject.idl";
import "FontConfig.idl";
#include "IInheritable.idl.h"

#define INHERITABLE_PROFILE_SETTING(Type, Name) \
    _BASE_INHERITABLE_SETTING(Type, Name);      \
    Microsoft.Terminal.Settings.Model.Profile Name##OverrideSource { get; }

#define COMMA ,

namespace Microsoft.Terminal.Settings.Model
{
    enum CloseOnExitMode
    {
        Never = 0,
        Graceful,
        Always,
        Automatic
    };

    [flags]
    enum BellStyle
    {
        // !! If you update this, you must update the values in TerminalSettingsEditor/Profiles.xaml
        Audible = 0x1,
        Window = 0x2,
        Taskbar = 0x4,
        All = 0xffffffff
    };

    runtimeclass Profile : Windows.Foundation.IStringable, ISettingsModelObject {
        Profile();
        Profile(Guid guid);

        void CreateUnfocusedAppearance();
        void DeleteUnfocusedAppearance();

        // True if the user explicitly removed this Profile from settings.json.
        Boolean Deleted { get; };
        // True if the user *kept* this Profile, but it disappeared from the system.
        Boolean Orphaned { get; };

        INHERITABLE_PROFILE_SETTING(Guid, Guid);
        INHERITABLE_PROFILE_SETTING(String, Name);
        INHERITABLE_PROFILE_SETTING(String, Source);
        INHERITABLE_PROFILE_SETTING(Boolean, Hidden);
        INHERITABLE_PROFILE_SETTING(Guid, ConnectionType);
        INHERITABLE_PROFILE_SETTING(IMediaResource, Icon);
        INHERITABLE_PROFILE_SETTING(CloseOnExitMode, CloseOnExit);
        INHERITABLE_PROFILE_SETTING(String, TabTitle);
        INHERITABLE_PROFILE_SETTING(Windows.Foundation.IReference<Microsoft.Terminal.Core.Color>, TabColor);
        INHERITABLE_PROFILE_SETTING(Boolean, SuppressApplicationTitle);
        INHERITABLE_PROFILE_SETTING(Microsoft.Terminal.Control.ScrollbarState, ScrollState);
        INHERITABLE_PROFILE_SETTING(String, Padding);
        INHERITABLE_PROFILE_SETTING(String, Commandline);

        INHERITABLE_PROFILE_SETTING(String, StartingDirectory);
        String EvaluatedStartingDirectory { get; };

        FontConfig FontInfo { get; };

        IAppearanceConfig DefaultAppearance { get; };
        INHERITABLE_PROFILE_SETTING(IAppearanceConfig, UnfocusedAppearance);

        INHERITABLE_PROFILE_SETTING(Microsoft.Terminal.Control.TextAntialiasingMode, AntialiasingMode);

        INHERITABLE_PROFILE_SETTING(Int32, HistorySize);
        INHERITABLE_PROFILE_SETTING(Boolean, SnapOnInput);
        INHERITABLE_PROFILE_SETTING(Boolean, AltGrAliasing);
        INHERITABLE_PROFILE_SETTING(String, AnswerbackMessage);
        INHERITABLE_PROFILE_SETTING(BellStyle, BellStyle);

        INHERITABLE_PROFILE_SETTING(Windows.Foundation.Collections.IMap<String COMMA String>, EnvironmentVariables);

        INHERITABLE_PROFILE_SETTING(Windows.Foundation.Collections.IVector<IMediaResource>, BellSound);

        INHERITABLE_PROFILE_SETTING(Boolean, Elevate);
        INHERITABLE_PROFILE_SETTING(Boolean, AutoMarkPrompts);
        INHERITABLE_PROFILE_SETTING(Boolean, ShowMarks);

        INHERITABLE_PROFILE_SETTING(Boolean, RightClickContextMenu);
        INHERITABLE_PROFILE_SETTING(Boolean, RepositionCursorWithMouse);

        INHERITABLE_PROFILE_SETTING(Boolean, ReloadEnvironmentVariables);
        INHERITABLE_PROFILE_SETTING(Boolean, RainbowSuggestions);
        INHERITABLE_PROFILE_SETTING(Boolean, ForceVTInput);
        INHERITABLE_PROFILE_SETTING(Boolean, AllowVtChecksumReport);
        INHERITABLE_PROFILE_SETTING(Boolean, AllowKeypadMode);
        INHERITABLE_PROFILE_SETTING(Boolean, AllowVtClipboardWrite);

        INHERITABLE_PROFILE_SETTING(Microsoft.Terminal.Control.PathTranslationStyle, PathTranslationStyle);
    }
}
