terminal/src/cascadia/TerminalApp/GlobalAppSettings.idl
Carlos Zamora 7803efa6fe
Make GlobalAppSettings a WinRT object (#7349)
GlobalAppSettings is now a WinRT object in the TerminalApp project.

## References
#7141 - GlobalAppSettings is a settings object
#885 - this new settings object will be moved to a new TerminalSettingsModel project

## PR Checklist
* [x] Tests passed

## Detailed Description of the Pull Request / Additional comments
This one was probably the easiest thus far.

The only weird thing is how we handle InitialPosition. Today, we lose a
little bit of fidelity when we convert from LaunchPosition (int) -->
Point (float) --> RECT (long). The current change converts
LaunchPosition (optional<long>) --> InitialPosition (long) --> RECT
(long).

NOTE: Though I could use LaunchPosition to go directly from TermApp to
AppHost, I decided to introduce InitialPosition because LaunchPosition
will be a part of TerminalSettingsModel soon.

## Validation Steps Performed
- [x] Tests passed
- [x] Deployment succeeded
2020-08-28 03:49:16 +00:00

60 lines
1.9 KiB
Plaintext

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import "AppLogic.idl";
import "ColorScheme.idl";
import "AppKeybindings.idl";
import "Command.idl";
import "TerminalSettings.idl";
namespace TerminalApp
{
// MIDL 3 allows for structs to hold nullable types
// Though IReference is a WinRT object, MIDL 3
// handles all of the ownership logic for us.
// Docs: https://docs.microsoft.com/en-us/uwp/midl-3/intro#types
struct LaunchPosition
{
Windows.Foundation.IReference<Int64> X;
Windows.Foundation.IReference<Int64> Y;
};
[default_interface] runtimeclass GlobalAppSettings {
Guid DefaultProfile;
String UnparsedDefaultProfile();
Int32 InitialRows;
Int32 InitialCols;
Boolean AlwaysShowTabs;
Boolean ShowTitleInTitlebar;
Boolean ConfirmCloseAllTabs;
Windows.UI.Xaml.ElementTheme Theme;
Microsoft.UI.Xaml.Controls.TabViewWidthMode TabWidthMode;
Boolean ShowTabsInTitlebar;
String WordDelimiters;
Boolean CopyOnSelect;
Microsoft.Terminal.TerminalControl.CopyFormat CopyFormatting;
Boolean WarnAboutLargePaste;
Boolean WarnAboutMultiLinePaste;
LaunchPosition InitialPosition;
LaunchMode LaunchMode;
Boolean SnapToGridOnResize;
Boolean ForceFullRepaintRendering;
Boolean SoftwareRendering;
Boolean ForceVTInput;
Boolean DebugFeaturesEnabled;
Boolean StartOnUserLogin;
Boolean AlwaysOnTop;
Boolean UseTabSwitcher;
Windows.Foundation.Collections.IMapView<String, ColorScheme> GetColorSchemes();
void AddColorScheme(ColorScheme scheme);
AppKeyBindings GetKeybindings();
Windows.Foundation.Collections.IMapView<String, Command> GetCommands();
void ApplyToSettings(TerminalSettings settings);
}
}