From 83cb93ee6d0bf0000062b9a34ba8a0af93c9c857 Mon Sep 17 00:00:00 2001 From: Mohamad Al-Jaf Date: Thu, 23 Mar 2023 02:48:58 -0400 Subject: [PATCH] include: Add windows.devices.radios.idl file. Needed by IBluetoothAdapter in windows.devices.bluetooth.idl. --- include/Makefile.in | 1 + include/windows.devices.radios.idl | 125 +++++++++++++++++++++++++++++ 2 files changed, 126 insertions(+) create mode 100644 include/windows.devices.radios.idl diff --git a/include/Makefile.in b/include/Makefile.in index e9f0aa8d5fb..9c135d0a6c7 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -810,6 +810,7 @@ SOURCES = \ windows.devices.enumeration.idl \ windows.devices.haptics.idl \ windows.devices.power.idl \ + windows.devices.radios.idl \ windows.foundation.collections.idl \ windows.foundation.idl \ windows.foundation.metadata.idl \ diff --git a/include/windows.devices.radios.idl b/include/windows.devices.radios.idl new file mode 100644 index 00000000000..ff710d86ae9 --- /dev/null +++ b/include/windows.devices.radios.idl @@ -0,0 +1,125 @@ +/* + * Copyright (C) 2023 Mohamad Al-Jaf + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifdef __WIDL__ +#pragma winrt ns_prefix +#endif + +import "inspectable.idl"; +import "asyncinfo.idl"; +import "eventtoken.idl"; +import "windowscontracts.idl"; +import "windows.foundation.idl"; + +namespace Windows.Devices.Radios { + typedef enum RadioAccessStatus RadioAccessStatus; + typedef enum RadioKind RadioKind; + typedef enum RadioState RadioState; + + interface IRadio; + interface IRadioStatics; + + runtimeclass Radio; + + declare { + interface Windows.Foundation.Collections.IIterable; + interface Windows.Foundation.Collections.IIterator; + interface Windows.Foundation.Collections.IVectorView; + interface Windows.Foundation.AsyncOperationCompletedHandler; + interface Windows.Foundation.AsyncOperationCompletedHandler; + interface Windows.Foundation.AsyncOperationCompletedHandler *>; + interface Windows.Foundation.IAsyncOperation; + interface Windows.Foundation.IAsyncOperation; + interface Windows.Foundation.IAsyncOperation *>; + interface Windows.Foundation.TypedEventHandler; + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0) + ] + enum RadioAccessStatus + { + Unspecified = 0, + Allowed = 1, + DeniedByUser = 2, + DeniedBySystem = 3, + }; + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0) + ] + enum RadioKind + { + Other = 0, + WiFi = 1, + MobileBroadband = 2, + Bluetooth = 3, + FM = 4, + }; + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0) + ] + enum RadioState + { + Unknown = 0, + On = 1, + Off = 2, + Disabled = 3, + }; + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.Devices.Radios.Radio), + uuid(252118df-b33e-416a-875f-1cf38ae2d83e) + ] + interface IRadio : IInspectable + { + HRESULT SetStateAsync([in] Windows.Devices.Radios.RadioState value, + [out, retval] Windows.Foundation.IAsyncOperation **retval); + [eventadd] HRESULT StateChanged([in] Windows.Foundation.TypedEventHandler *handler, + [out, retval] EventRegistrationToken *cookie); + [eventremove] HRESULT StateChanged([in] EventRegistrationToken cookie); + [propget] HRESULT State([out, retval] Windows.Devices.Radios.RadioState **value); + [propget] HRESULT Name([out, retval] HSTRING *value); + [propget] HRESULT Kind([out, retval] Windows.Devices.Radios.RadioKind *value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.Devices.Radios.Radio), + uuid(5fb6a12e-67cb-46ae-aae9-65919f86eff4) + ] + interface IRadioStatics : IInspectable + { + HRESULT GetRadiosAsync([out, retval] Windows.Foundation.IAsyncOperation *> **value); + HRESULT GetDeviceSelector([out, retval] HSTRING *selector); + [overload("FromIdAsync")] HRESULT FromIdAsync([in] HSTRING id, [out, retval] Windows.Foundation.IAsyncOperation **value); + HRESULT RequestAccessAsync([out, retval] Windows.Foundation.IAsyncOperation **value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + marshaling_behavior(agile), + static(Windows.Devices.Radios.IRadioStatics, Windows.Foundation.UniversalApiContract, 1.0) + ] + runtimeclass Radio + { + [default] interface Windows.Devices.Radios.IRadio; + } +}