// Copyright (c) Microsoft Corporation. // Licensed under the MIT license. import "IMouseWheelListener.idl"; namespace Microsoft.Terminal.TerminalControl { delegate void TitleChangedEventArgs(String newTitle); delegate void FontSizeChangedEventArgs(Int32 width, Int32 height, Boolean isInitialChange); delegate void ScrollPositionChangedEventArgs(Int32 viewTop, Int32 viewHeight, Int32 bufferLength); // C++/winrt makes it difficult to share this idl between two projects, // Instead, we just pin the uuid and include it in both TermControl and App // If you update this one, please update TerminalApp\IDirectKeyListener.idl. // If you change this interface, please update the guid. // If you press F7 or Alt and get a runtime error, go make sure both copies are the same. [uuid("339e1a87-5315-4da6-96f0-565549b6472b")] interface IDirectKeyListener { Boolean OnDirectKeyEvent(UInt32 vkey, Boolean down); } runtimeclass CopyToClipboardEventArgs { String Text { get; }; String Html { get; }; String Rtf { get; }; } runtimeclass PasteFromClipboardEventArgs { void HandleClipboardData(String data); } [default_interface] runtimeclass TermControl : Windows.UI.Xaml.Controls.UserControl, IDirectKeyListener, IMouseWheelListener { TermControl(Microsoft.Terminal.Settings.IControlSettings settings, Microsoft.Terminal.TerminalConnection.ITerminalConnection connection); static Windows.Foundation.Size GetProposedDimensions(Microsoft.Terminal.Settings.IControlSettings settings, UInt32 dpi); void UpdateSettings(Microsoft.Terminal.Settings.IControlSettings newSettings); event TitleChangedEventArgs TitleChanged; event FontSizeChangedEventArgs FontSizeChanged; event Windows.Foundation.TypedEventHandler CopyToClipboard; event Windows.Foundation.TypedEventHandler PasteFromClipboard; event Windows.Foundation.TypedEventHandler Initialized; // This is an event handler forwarder for the underlying connection. // We expose this and ConnectionState here so that it might eventually be data bound. event Windows.Foundation.TypedEventHandler ConnectionStateChanged; Microsoft.Terminal.TerminalConnection.ConnectionState ConnectionState { get; }; String Title { get; }; Boolean CopySelectionToClipboard(Boolean collapseText); void PasteTextFromClipboard(); void Close(); Windows.Foundation.Size CharacterDimensions { get; }; Windows.Foundation.Size MinimumSize { get; }; Single SnapDimensionToGrid(Boolean widthOrHeight, Single dimension); void ScrollViewport(Int32 viewTop); Int32 GetScrollOffset(); Int32 GetViewHeight(); event ScrollPositionChangedEventArgs ScrollPositionChanged; void CreateSearchBoxControl(); void AdjustFontSize(Int32 fontSizeDelta); void ResetFontSize(); void ToggleRetroEffect(); } }