This commit also transitions our keybinding events and event handlers to a TypedEventHandler model with an "event args" class, as specified in the keybinding arguments specification (#1349). In short, every event can be marked Handled independently, and a Handled event will stop bubbling out to the terminal. An unhandled event will be passed off to the terminal as a standard keypress. This unifies our keybinding event model and provides a convenient place for binding arguments to live. Fixes #2285. Related to #1349, #1142.
46 lines
1.8 KiB
Plaintext
46 lines
1.8 KiB
Plaintext
// Copyright (c) Microsoft Corporation.
|
|
// Licensed under the MIT license.
|
|
|
|
namespace Microsoft.Terminal.TerminalControl
|
|
{
|
|
delegate void TitleChangedEventArgs(String newTitle);
|
|
delegate void ConnectionClosedEventArgs();
|
|
delegate void ScrollPositionChangedEventArgs(Int32 viewTop, Int32 viewHeight, Int32 bufferLength);
|
|
delegate void CopyToClipboardEventArgs(String copiedData);
|
|
|
|
runtimeclass PasteFromClipboardEventArgs
|
|
{
|
|
void HandleClipboardData(String data);
|
|
}
|
|
|
|
[default_interface] runtimeclass TermControl : Windows.UI.Xaml.Controls.UserControl
|
|
{
|
|
TermControl();
|
|
TermControl(Microsoft.Terminal.Settings.IControlSettings settings, Microsoft.Terminal.TerminalConnection.ITerminalConnection connection);
|
|
|
|
static Windows.Foundation.Point GetProposedDimensions(Microsoft.Terminal.Settings.IControlSettings settings, UInt32 dpi);
|
|
|
|
void UpdateSettings(Microsoft.Terminal.Settings.IControlSettings newSettings);
|
|
|
|
event TitleChangedEventArgs TitleChanged;
|
|
event ConnectionClosedEventArgs ConnectionClosed;
|
|
event CopyToClipboardEventArgs CopyToClipboard;
|
|
event Windows.Foundation.TypedEventHandler<TermControl, PasteFromClipboardEventArgs> PasteFromClipboard;
|
|
|
|
String Title { get; };
|
|
|
|
Boolean CopySelectionToClipboard(Boolean trimTrailingWhitespace);
|
|
void PasteTextFromClipboard();
|
|
void Close();
|
|
Boolean ShouldCloseOnExit { get; };
|
|
Windows.Foundation.Size CharacterDimensions { get; };
|
|
Windows.Foundation.Size MinimumSize { get; };
|
|
|
|
void ScrollViewport(Int32 viewTop);
|
|
void KeyboardScrollViewport(Int32 viewTop);
|
|
Int32 GetScrollOffset();
|
|
Int32 GetViewHeight();
|
|
event ScrollPositionChangedEventArgs ScrollPositionChanged;
|
|
}
|
|
}
|