// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import "TerminalWindow.idl";

namespace TerminalApp
{
    [default_interface] runtimeclass FindTargetWindowResult
    {
        Int32 WindowId { get; };
        String WindowName { get; };
    };

    struct ParseCommandlineResult
    {
        String Message;
        Int32 ExitCode;
    };

    // See IDialogPresenter and TerminalPage's DialogPresenter for more
    // information.
    [default_interface] runtimeclass AppLogic
    {
        AppLogic();

        // For your own sanity, it's better to do setup outside the ctor.
        // If you do any setup in the ctor that ends up throwing an exception,
        // then it might look like TermApp just failed to activate, which will
        // cause you to chase down the rabbit hole of "why is TermApp not
        // registered?" when it definitely is.
        void Create();

        Boolean IsRunningElevated();
        Boolean CanDragDrop();

        ContentManager ContentManager { get; };

        Boolean HasSettingsStartupActions();

        Boolean ShouldUsePersistedLayout();
        void SaveWindowLayoutJsons(Windows.Foundation.Collections.IVector<String> layouts);

        void ReloadSettings();

        // Selected settings to expose
        Microsoft.Terminal.Settings.Model.Theme Theme { get; };
        Boolean IsolatedMode { get; };
        Boolean AllowHeadless { get; };
        Boolean RequestsTrayIcon { get; };

        FindTargetWindowResult FindTargetWindow(String[] args);

        TerminalWindow CreateNewWindow();

        ParseCommandlineResult GetParseCommandlineMessage(String[] args);

        IMapView<Microsoft.Terminal.Control.KeyChord, Microsoft.Terminal.Settings.Model.Command> GlobalHotkeys();

        event Windows.Foundation.TypedEventHandler<Object, SettingsLoadEventArgs> SettingsChanged;

    }
}
