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

import "IAppearanceConfig.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
{
    // This tag is used to identify the context in which the Profile was created
    enum OriginTag
    {
        None = 0,
        User,
        InBox,
        Generated,
        Fragment,
        ProfilesDefaults
    };

    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
    };

    [default_interface] runtimeclass Profile : Windows.Foundation.IStringable {
        Profile();
        Profile(Guid guid);

        void CreateUnfocusedAppearance();
        void DeleteUnfocusedAppearance();

        // True if the user explicitly removed this Profile from settings.json.
        Boolean Deleted { get; };
        OriginTag Origin { 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(String, 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(Boolean, UseAcrylic);
        INHERITABLE_PROFILE_SETTING(Microsoft.Terminal.Control.ScrollbarState, ScrollState);
        INHERITABLE_PROFILE_SETTING(String, Padding);
        INHERITABLE_PROFILE_SETTING(String, Commandline);
        INHERITABLE_PROFILE_SETTING(Boolean, VtPassthrough);

        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(BellStyle, BellStyle);

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

        INHERITABLE_PROFILE_SETTING(Boolean, UseAtlasEngine);
        INHERITABLE_PROFILE_SETTING(Windows.Foundation.Collections.IVector<String>, 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, ReloadEnvironmentVariables);

    }
}
