// C++/WinRT v2.0.220110.5 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. #pragma once #ifndef WINRT_Windows_Phone_UI_Core_H #define WINRT_Windows_Phone_UI_Core_H #include "winrt/base.h" static_assert(winrt::check_version(CPPWINRT_VERSION, "2.0.220110.5"), "Mismatched C++/WinRT headers."); #define CPPWINRT_VERSION "2.0.220110.5" #include "winrt/impl/Windows.Foundation.2.h" #include "winrt/impl/Windows.Phone.UI.Core.2.h" namespace winrt::impl { template WINRT_IMPL_AUTO(uint32_t) consume_Windows_Phone_UI_Core_ICoreSelectionChangedEventArgs::Start() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Phone::UI::Core::ICoreSelectionChangedEventArgs)->get_Start(&value)); return value; } template WINRT_IMPL_AUTO(uint32_t) consume_Windows_Phone_UI_Core_ICoreSelectionChangedEventArgs::Length() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Phone::UI::Core::ICoreSelectionChangedEventArgs)->get_Length(&value)); return value; } template WINRT_IMPL_AUTO(uint32_t) consume_Windows_Phone_UI_Core_ICoreTextChangedEventArgs::Start() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Phone::UI::Core::ICoreTextChangedEventArgs)->get_Start(&value)); return value; } template WINRT_IMPL_AUTO(uint32_t) consume_Windows_Phone_UI_Core_ICoreTextChangedEventArgs::OldLength() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Phone::UI::Core::ICoreTextChangedEventArgs)->get_OldLength(&value)); return value; } template WINRT_IMPL_AUTO(hstring) consume_Windows_Phone_UI_Core_ICoreTextChangedEventArgs::NewText() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Phone::UI::Core::ICoreTextChangedEventArgs)->get_NewText(&value)); return hstring{ value, take_ownership_from_abi }; } template WINRT_IMPL_AUTO(bool) consume_Windows_Phone_UI_Core_ICoreWindowKeyboardInput::IsKeyboardInputEnabled() const { bool value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Phone::UI::Core::ICoreWindowKeyboardInput)->get_IsKeyboardInputEnabled(&value)); return value; } template WINRT_IMPL_AUTO(void) consume_Windows_Phone_UI_Core_ICoreWindowKeyboardInput::IsKeyboardInputEnabled(bool value) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Phone::UI::Core::ICoreWindowKeyboardInput)->put_IsKeyboardInputEnabled(value)); } template WINRT_IMPL_AUTO(winrt::Windows::Phone::UI::Core::KeyboardInputBuffer) consume_Windows_Phone_UI_Core_ICoreWindowKeyboardInput::KeyboardInputBuffer() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Phone::UI::Core::ICoreWindowKeyboardInput)->get_KeyboardInputBuffer(&value)); return winrt::Windows::Phone::UI::Core::KeyboardInputBuffer{ value, take_ownership_from_abi }; } template WINRT_IMPL_AUTO(void) consume_Windows_Phone_UI_Core_ICoreWindowKeyboardInput::KeyboardInputBuffer(winrt::Windows::Phone::UI::Core::KeyboardInputBuffer const& value) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Phone::UI::Core::ICoreWindowKeyboardInput)->put_KeyboardInputBuffer(*(void**)(&value))); } template WINRT_IMPL_AUTO(hstring) consume_Windows_Phone_UI_Core_IKeyboardInputBuffer::Text() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Phone::UI::Core::IKeyboardInputBuffer)->get_Text(&value)); return hstring{ value, take_ownership_from_abi }; } template WINRT_IMPL_AUTO(void) consume_Windows_Phone_UI_Core_IKeyboardInputBuffer::Text(param::hstring const& value) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Phone::UI::Core::IKeyboardInputBuffer)->put_Text(*(void**)(&value))); } template WINRT_IMPL_AUTO(uint32_t) consume_Windows_Phone_UI_Core_IKeyboardInputBuffer::SelectionStart() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Phone::UI::Core::IKeyboardInputBuffer)->get_SelectionStart(&value)); return value; } template WINRT_IMPL_AUTO(uint32_t) consume_Windows_Phone_UI_Core_IKeyboardInputBuffer::SelectionLength() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Phone::UI::Core::IKeyboardInputBuffer)->get_SelectionLength(&value)); return value; } template WINRT_IMPL_AUTO(void) consume_Windows_Phone_UI_Core_IKeyboardInputBuffer::Select(uint32_t start, uint32_t length) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Phone::UI::Core::IKeyboardInputBuffer)->Select(start, length)); } template WINRT_IMPL_AUTO(void) consume_Windows_Phone_UI_Core_IKeyboardInputBuffer::SelectFromTap(uint32_t characterIndex) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Phone::UI::Core::IKeyboardInputBuffer)->SelectFromTap(characterIndex)); } template WINRT_IMPL_AUTO(winrt::Windows::Phone::UI::Core::CoreInputScope) consume_Windows_Phone_UI_Core_IKeyboardInputBuffer::InputScope() const { winrt::Windows::Phone::UI::Core::CoreInputScope value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Phone::UI::Core::IKeyboardInputBuffer)->get_InputScope(reinterpret_cast(&value))); return value; } template WINRT_IMPL_AUTO(void) consume_Windows_Phone_UI_Core_IKeyboardInputBuffer::InputScope(winrt::Windows::Phone::UI::Core::CoreInputScope const& value) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Phone::UI::Core::IKeyboardInputBuffer)->put_InputScope(static_cast(value))); } template WINRT_IMPL_AUTO(winrt::event_token) consume_Windows_Phone_UI_Core_IKeyboardInputBuffer::TextChanged(winrt::Windows::Foundation::TypedEventHandler const& handler) const { winrt::event_token cookie{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Phone::UI::Core::IKeyboardInputBuffer)->add_TextChanged(*(void**)(&handler), put_abi(cookie))); return cookie; } template typename consume_Windows_Phone_UI_Core_IKeyboardInputBuffer::TextChanged_revoker consume_Windows_Phone_UI_Core_IKeyboardInputBuffer::TextChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const { return impl::make_event_revoker(this, TextChanged(handler)); } template WINRT_IMPL_AUTO(void) consume_Windows_Phone_UI_Core_IKeyboardInputBuffer::TextChanged(winrt::event_token const& cookie) const noexcept { WINRT_IMPL_SHIM(winrt::Windows::Phone::UI::Core::IKeyboardInputBuffer)->remove_TextChanged(impl::bind_in(cookie)); } template WINRT_IMPL_AUTO(winrt::event_token) consume_Windows_Phone_UI_Core_IKeyboardInputBuffer::SelectionChanged(winrt::Windows::Foundation::TypedEventHandler const& handler) const { winrt::event_token cookie{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Phone::UI::Core::IKeyboardInputBuffer)->add_SelectionChanged(*(void**)(&handler), put_abi(cookie))); return cookie; } template typename consume_Windows_Phone_UI_Core_IKeyboardInputBuffer::SelectionChanged_revoker consume_Windows_Phone_UI_Core_IKeyboardInputBuffer::SelectionChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const { return impl::make_event_revoker(this, SelectionChanged(handler)); } template WINRT_IMPL_AUTO(void) consume_Windows_Phone_UI_Core_IKeyboardInputBuffer::SelectionChanged(winrt::event_token const& cookie) const noexcept { WINRT_IMPL_SHIM(winrt::Windows::Phone::UI::Core::IKeyboardInputBuffer)->remove_SelectionChanged(impl::bind_in(cookie)); } #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_Start(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Start()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Length(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Length()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_Start(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Start()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_OldLength(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().OldLength()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_NewText(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().NewText()); return 0; } catch (...) { return to_hresult(); } }; #endif template struct produce : produce_base { int32_t __stdcall get_IsKeyboardInputEnabled(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().IsKeyboardInputEnabled()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_IsKeyboardInputEnabled(bool value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().IsKeyboardInputEnabled(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_KeyboardInputBuffer(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().KeyboardInputBuffer()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_KeyboardInputBuffer(void* value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().KeyboardInputBuffer(*reinterpret_cast(&value)); return 0; } catch (...) { return to_hresult(); } }; #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_Text(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Text()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_Text(void* value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().Text(*reinterpret_cast(&value)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_SelectionStart(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().SelectionStart()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_SelectionLength(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().SelectionLength()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall Select(uint32_t start, uint32_t length) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().Select(start, length); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall SelectFromTap(uint32_t characterIndex) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().SelectFromTap(characterIndex); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_InputScope(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().InputScope()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_InputScope(int32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().InputScope(*reinterpret_cast(&value)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_TextChanged(void* handler, winrt::event_token* cookie) noexcept final try { zero_abi(cookie); typename D::abi_guard guard(this->shim()); *cookie = detach_from(this->shim().TextChanged(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_TextChanged(winrt::event_token cookie) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().TextChanged(*reinterpret_cast(&cookie)); return 0; } int32_t __stdcall add_SelectionChanged(void* handler, winrt::event_token* cookie) noexcept final try { zero_abi(cookie); typename D::abi_guard guard(this->shim()); *cookie = detach_from(this->shim().SelectionChanged(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_SelectionChanged(winrt::event_token cookie) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().SelectionChanged(*reinterpret_cast(&cookie)); return 0; } }; #endif } WINRT_EXPORT namespace winrt::Windows::Phone::UI::Core { inline KeyboardInputBuffer::KeyboardInputBuffer() : KeyboardInputBuffer(impl::call_factory_cast([](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance(); })) { } } namespace std { #ifndef WINRT_LEAN_AND_MEAN template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; #endif #ifdef __cpp_lib_format #endif } #endif