terminal/src/cascadia/TerminalApp/ActionArgs.idl
Mike Griese 2e26c3e0c9 Add support for "Automatic" splits (#4025)
## Summary of the Pull Request

Adds support for `auto` as a potential value for a `splitPane` keybinding's `split` argument. For example:

```json
        { "keys": [ "ctrl+shift+z" ], "command": { "action": "splitPane", "profile": "matrix", "commandline": "cmd.exe", "split":"auto" } },
```

When set to `auto`, Panes will decide which direction to split based on the available space within the terminal. If the pane is wider than it is tall, the pane will introduce a new vertical split (and vice-versa).

## References

## PR Checklist
* [x] Closes #3960
* [x] I work here
* [x] Tests added/passed
* [n/a] Requires documentation to be updated

## Validation Steps Performed
Ran tests, played with it.
2019-12-19 21:47:19 +00:00

87 lines
2.1 KiB
Plaintext

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
namespace TerminalApp
{
interface IActionArgs
{
Boolean Equals(IActionArgs other);
};
interface IActionEventArgs
{
Boolean Handled;
IActionArgs ActionArgs { get; };
};
enum Direction
{
None = 0,
Left,
Right,
Up,
Down
};
enum SplitState
{
Automatic = -1,
None = 0,
Vertical = 1,
Horizontal = 2
};
[default_interface] runtimeclass NewTerminalArgs {
NewTerminalArgs();
String Commandline;
String StartingDirectory;
String TabTitle;
String Profile; // Either a GUID or a profile's name if the GUID isn't a match
// ProfileIndex can be null (for "use the default"), so this needs to be
// a IReference, so it's nullable
Windows.Foundation.IReference<Int32> ProfileIndex { get; };
Boolean Equals(NewTerminalArgs other);
};
[default_interface] runtimeclass ActionEventArgs : IActionEventArgs
{
ActionEventArgs(IActionArgs args);
};
[default_interface] runtimeclass CopyTextArgs : IActionArgs
{
Boolean TrimWhitespace { get; };
};
[default_interface] runtimeclass NewTabArgs : IActionArgs
{
NewTerminalArgs TerminalArgs { get; };
};
[default_interface] runtimeclass SwitchToTabArgs : IActionArgs
{
Int32 TabIndex { get; };
};
[default_interface] runtimeclass ResizePaneArgs : IActionArgs
{
Direction Direction { get; };
};
[default_interface] runtimeclass MoveFocusArgs : IActionArgs
{
Direction Direction { get; };
};
[default_interface] runtimeclass AdjustFontSizeArgs : IActionArgs
{
Int32 Delta { get; };
};
[default_interface] runtimeclass SplitPaneArgs : IActionArgs
{
SplitState SplitStyle { get; };
NewTerminalArgs TerminalArgs { get; };
};
}