// WARNING: Please don't edit this file. It was generated by C++/WinRT v2.0.240405.15 #pragma once #ifndef WINRT_Windows_System_RemoteDesktop_Input_H #define WINRT_Windows_System_RemoteDesktop_Input_H #include "winrt/base.h" static_assert(winrt::check_version(CPPWINRT_VERSION, "2.0.240405.15"), "Mismatched C++/WinRT headers."); #define CPPWINRT_VERSION "2.0.240405.15" #include "winrt/Windows.System.RemoteDesktop.h" #include "winrt/impl/Windows.Foundation.2.h" #include "winrt/impl/Windows.System.RemoteDesktop.Input.2.h" namespace winrt::impl { template auto consume_Windows_System_RemoteDesktop_Input_IRemoteTextConnection::IsEnabled() const { bool value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::System::RemoteDesktop::Input::IRemoteTextConnection)->get_IsEnabled(&value)); return value; } template auto consume_Windows_System_RemoteDesktop_Input_IRemoteTextConnection::IsEnabled(bool value) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::System::RemoteDesktop::Input::IRemoteTextConnection)->put_IsEnabled(value)); } template auto consume_Windows_System_RemoteDesktop_Input_IRemoteTextConnection::RegisterThread(uint32_t threadId) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::System::RemoteDesktop::Input::IRemoteTextConnection)->RegisterThread(threadId)); } template auto consume_Windows_System_RemoteDesktop_Input_IRemoteTextConnection::UnregisterThread(uint32_t threadId) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::System::RemoteDesktop::Input::IRemoteTextConnection)->UnregisterThread(threadId)); } template auto consume_Windows_System_RemoteDesktop_Input_IRemoteTextConnection::ReportDataReceived(array_view pduData) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::System::RemoteDesktop::Input::IRemoteTextConnection)->ReportDataReceived(pduData.size(), get_abi(pduData))); } template auto consume_Windows_System_RemoteDesktop_Input_IRemoteTextConnection2::ReportPredictedKeyEvent(uint16_t scanCode, winrt::Windows::System::RemoteDesktop::Input::RemoteKeyEventAttributes const& attributes) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::System::RemoteDesktop::Input::IRemoteTextConnection2)->ReportPredictedKeyEvent(scanCode, static_cast(attributes))); } template auto consume_Windows_System_RemoteDesktop_Input_IRemoteTextConnectionFactory::CreateInstance(winrt::guid const& connectionId, winrt::Windows::System::RemoteDesktop::Input::RemoteTextConnectionDataHandler const& pduForwarder) const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::System::RemoteDesktop::Input::IRemoteTextConnectionFactory)->CreateInstance(impl::bind_in(connectionId), *(void**)(&pduForwarder), &value)); return winrt::Windows::System::RemoteDesktop::Input::RemoteTextConnection{ value, take_ownership_from_abi }; } template auto consume_Windows_System_RemoteDesktop_Input_IRemoteTextConnectionFactory2::CreateInstance(winrt::guid const& connectionId, winrt::Windows::System::RemoteDesktop::Input::RemoteTextConnectionDataHandler const& pduForwarder, winrt::Windows::System::RemoteDesktop::Input::RemoteTextConnectionOptions const& options) const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::System::RemoteDesktop::Input::IRemoteTextConnectionFactory2)->CreateInstance(impl::bind_in(connectionId), *(void**)(&pduForwarder), static_cast(options), &value)); return winrt::Windows::System::RemoteDesktop::Input::RemoteTextConnection{ value, take_ownership_from_abi }; } template struct delegate final : implements_delegate { delegate(H&& handler) : implements_delegate(std::forward(handler)) {} int32_t __stdcall Invoke(uint32_t __pduDataSize, uint8_t* pduData, bool* result) noexcept final try { *result = detach_from((*this)(array_view(reinterpret_cast(pduData), reinterpret_cast(pduData) + __pduDataSize))); return 0; } catch (...) { return to_hresult(); } }; #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_IsEnabled(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().IsEnabled()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_IsEnabled(bool value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().IsEnabled(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall RegisterThread(uint32_t threadId) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().RegisterThread(threadId); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall UnregisterThread(uint32_t threadId) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().UnregisterThread(threadId); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall ReportDataReceived(uint32_t __pduDataSize, uint8_t* pduData) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().ReportDataReceived(array_view(reinterpret_cast(pduData), reinterpret_cast(pduData) + __pduDataSize)); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall ReportPredictedKeyEvent(uint16_t scanCode, uint32_t attributes) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().ReportPredictedKeyEvent(scanCode, *reinterpret_cast(&attributes)); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall CreateInstance(winrt::guid connectionId, void* pduForwarder, void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().CreateInstance(*reinterpret_cast(&connectionId), *reinterpret_cast(&pduForwarder))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall CreateInstance(winrt::guid connectionId, void* pduForwarder, uint32_t options, void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().CreateInstance(*reinterpret_cast(&connectionId), *reinterpret_cast(&pduForwarder), *reinterpret_cast(&options))); return 0; } catch (...) { return to_hresult(); } }; #endif } WINRT_EXPORT namespace winrt::Windows::System::RemoteDesktop::Input { constexpr auto operator|(RemoteKeyEventAttributes const left, RemoteKeyEventAttributes const right) noexcept { return static_cast(impl::to_underlying_type(left) | impl::to_underlying_type(right)); } constexpr auto operator|=(RemoteKeyEventAttributes& left, RemoteKeyEventAttributes const right) noexcept { left = left | right; return left; } constexpr auto operator&(RemoteKeyEventAttributes const left, RemoteKeyEventAttributes const right) noexcept { return static_cast(impl::to_underlying_type(left) & impl::to_underlying_type(right)); } constexpr auto operator&=(RemoteKeyEventAttributes& left, RemoteKeyEventAttributes const right) noexcept { left = left & right; return left; } constexpr auto operator~(RemoteKeyEventAttributes const value) noexcept { return static_cast(~impl::to_underlying_type(value)); } constexpr auto operator^(RemoteKeyEventAttributes const left, RemoteKeyEventAttributes const right) noexcept { return static_cast(impl::to_underlying_type(left) ^ impl::to_underlying_type(right)); } constexpr auto operator^=(RemoteKeyEventAttributes& left, RemoteKeyEventAttributes const right) noexcept { left = left ^ right; return left; } constexpr auto operator|(RemoteTextConnectionOptions const left, RemoteTextConnectionOptions const right) noexcept { return static_cast(impl::to_underlying_type(left) | impl::to_underlying_type(right)); } constexpr auto operator|=(RemoteTextConnectionOptions& left, RemoteTextConnectionOptions const right) noexcept { left = left | right; return left; } constexpr auto operator&(RemoteTextConnectionOptions const left, RemoteTextConnectionOptions const right) noexcept { return static_cast(impl::to_underlying_type(left) & impl::to_underlying_type(right)); } constexpr auto operator&=(RemoteTextConnectionOptions& left, RemoteTextConnectionOptions const right) noexcept { left = left & right; return left; } constexpr auto operator~(RemoteTextConnectionOptions const value) noexcept { return static_cast(~impl::to_underlying_type(value)); } constexpr auto operator^(RemoteTextConnectionOptions const left, RemoteTextConnectionOptions const right) noexcept { return static_cast(impl::to_underlying_type(left) ^ impl::to_underlying_type(right)); } constexpr auto operator^=(RemoteTextConnectionOptions& left, RemoteTextConnectionOptions const right) noexcept { left = left ^ right; return left; } inline RemoteTextConnection::RemoteTextConnection(winrt::guid const& connectionId, winrt::Windows::System::RemoteDesktop::Input::RemoteTextConnectionDataHandler const& pduForwarder) : RemoteTextConnection(impl::call_factory([&](IRemoteTextConnectionFactory const& f) { return f.CreateInstance(connectionId, pduForwarder); })) { } inline RemoteTextConnection::RemoteTextConnection(winrt::guid const& connectionId, winrt::Windows::System::RemoteDesktop::Input::RemoteTextConnectionDataHandler const& pduForwarder, winrt::Windows::System::RemoteDesktop::Input::RemoteTextConnectionOptions const& options) : RemoteTextConnection(impl::call_factory([&](IRemoteTextConnectionFactory2 const& f) { return f.CreateInstance(connectionId, pduForwarder, options); })) { } template RemoteTextConnectionDataHandler::RemoteTextConnectionDataHandler(L handler) : RemoteTextConnectionDataHandler(impl::make_delegate(std::forward(handler))) { } template RemoteTextConnectionDataHandler::RemoteTextConnectionDataHandler(F* handler) : RemoteTextConnectionDataHandler([=](auto&&... args) { return handler(args...); }) { } template RemoteTextConnectionDataHandler::RemoteTextConnectionDataHandler(O* object, M method) : RemoteTextConnectionDataHandler([=](auto&&... args) { return ((*object).*(method))(args...); }) { } template RemoteTextConnectionDataHandler::RemoteTextConnectionDataHandler(com_ptr&& object, M method) : RemoteTextConnectionDataHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) { } template RemoteTextConnectionDataHandler::RemoteTextConnectionDataHandler(weak_ref&& object, LM&& lambda_or_method) : RemoteTextConnectionDataHandler([o = std::move(object), lm = std::forward(lambda_or_method)](auto&&... args) { if (auto s = o.get()) { if constexpr (std::is_member_function_pointer_v) ((*s).*(lm))(args...); else lm(args...); } }) { } template RemoteTextConnectionDataHandler::RemoteTextConnectionDataHandler(std::shared_ptr&& object, M method) : RemoteTextConnectionDataHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) { } template RemoteTextConnectionDataHandler::RemoteTextConnectionDataHandler(std::weak_ptr&& object, LM&& lambda_or_method) : RemoteTextConnectionDataHandler([o = std::move(object), lm = std::forward(lambda_or_method)](auto&&... args) { if (auto s = o.lock()) { if constexpr (std::is_member_function_pointer_v) ((*s).*(lm))(args...); else lm(args...); } }) { } inline auto RemoteTextConnectionDataHandler::operator()(array_view pduData) const { bool result{}; check_hresult((*(impl::abi_t**)this)->Invoke(pduData.size(), get_abi(pduData), &result)); return result; } } 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 {}; #endif #ifdef __cpp_lib_format #endif } #endif