// Copyright (c) Microsoft Corporation. // Licensed under the MIT license. #pragma once #include "winrt/Microsoft.UI.Xaml.Controls.h" #include "HighlightedTextSegment.g.h" #include "HighlightedText.g.h" #include "../../cascadia/inc/cppwinrt_utils.h" namespace winrt::TerminalApp::implementation { struct HighlightedTextSegment : HighlightedTextSegmentT { HighlightedTextSegment() = default; HighlightedTextSegment(winrt::hstring const& text, bool isHighlighted); WINRT_CALLBACK(PropertyChanged, Windows::UI::Xaml::Data::PropertyChangedEventHandler); OBSERVABLE_GETSET_PROPERTY(winrt::hstring, TextSegment, _PropertyChangedHandlers); OBSERVABLE_GETSET_PROPERTY(bool, IsHighlighted, _PropertyChangedHandlers); }; struct HighlightedText : HighlightedTextT { HighlightedText() = default; HighlightedText(Windows::Foundation::Collections::IObservableVector const& segments); WINRT_CALLBACK(PropertyChanged, Windows::UI::Xaml::Data::PropertyChangedEventHandler); OBSERVABLE_GETSET_PROPERTY(Windows::Foundation::Collections::IObservableVector, Segments, _PropertyChangedHandlers); }; } namespace winrt::TerminalApp::factory_implementation { BASIC_FACTORY(HighlightedTextSegment); BASIC_FACTORY(HighlightedText); }