| 1 |
/* |
| 2 |
* Copyright (C) 2023 Mohamad Al-Jaf |
| 3 |
* |
| 4 |
* This library is free software; you can redistribute it and/or |
| 5 |
* modify it under the terms of the GNU Lesser General Public |
| 6 |
* License as published by the Free Software Foundation; either |
| 7 |
* version 2.1 of the License, or (at your option) any later version. |
| 8 |
* |
| 9 |
* This library is distributed in the hope that it will be useful, |
| 10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 |
* Lesser General Public License for more details. |
| 13 |
* |
| 14 |
* You should have received a copy of the GNU Lesser General Public |
| 15 |
* License along with this library; if not, write to the Free Software |
| 16 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA |
| 17 |
*/ |
| 18 |
|
| 19 |
#ifdef __WIDL__ |
| 20 |
#pragma winrt ns_prefix |
| 21 |
#endif |
| 22 |
|
| 23 |
import "inspectable.idl"; |
| 24 |
import "asyncinfo.idl"; |
| 25 |
import "eventtoken.idl"; |
| 26 |
import "windowscontracts.idl"; |
| 27 |
import "windows.foundation.idl"; |
| 28 |
|
| 29 |
namespace Windows.Devices.Radios { |
| 30 |
typedef enum RadioAccessStatus RadioAccessStatus; |
| 31 |
typedef enum RadioKind RadioKind; |
| 32 |
typedef enum RadioState RadioState; |
| 33 |
|
| 34 |
interface IRadio; |
| 35 |
interface IRadioStatics; |
| 36 |
|
| 37 |
runtimeclass Radio; |
| 38 |
|
| 39 |
declare { |
| 40 |
interface Windows.Foundation.Collections.IIterable<Windows.Devices.Radios.Radio *>; |
| 41 |
interface Windows.Foundation.Collections.IIterator<Windows.Devices.Radios.Radio *>; |
| 42 |
interface Windows.Foundation.Collections.IVectorView<Windows.Devices.Radios.Radio *>; |
| 43 |
interface Windows.Foundation.AsyncOperationCompletedHandler<Windows.Devices.Radios.Radio *>; |
| 44 |
interface Windows.Foundation.AsyncOperationCompletedHandler<Windows.Devices.Radios.RadioAccessStatus>; |
| 45 |
interface Windows.Foundation.AsyncOperationCompletedHandler<Windows.Foundation.Collections.IVectorView<Windows.Devices.Radios.Radio *> *>; |
| 46 |
interface Windows.Foundation.IAsyncOperation<Windows.Devices.Radios.Radio *>; |
| 47 |
interface Windows.Foundation.IAsyncOperation<Windows.Devices.Radios.RadioAccessStatus>; |
| 48 |
interface Windows.Foundation.IAsyncOperation<Windows.Foundation.Collections.IVectorView<Windows.Devices.Radios.Radio *> *>; |
| 49 |
interface Windows.Foundation.TypedEventHandler<Windows.Devices.Radios.Radio *, IInspectable *>; |
| 50 |
} |
| 51 |
|
| 52 |
[ |
| 53 |
contract(Windows.Foundation.UniversalApiContract, 1.0) |
| 54 |
] |
| 55 |
enum RadioAccessStatus |
| 56 |
{ |
| 57 |
Unspecified = 0, |
| 58 |
Allowed = 1, |
| 59 |
DeniedByUser = 2, |
| 60 |
DeniedBySystem = 3, |
| 61 |
}; |
| 62 |
|
| 63 |
[ |
| 64 |
contract(Windows.Foundation.UniversalApiContract, 1.0) |
| 65 |
] |
| 66 |
enum RadioKind |
| 67 |
{ |
| 68 |
Other = 0, |
| 69 |
WiFi = 1, |
| 70 |
MobileBroadband = 2, |
| 71 |
Bluetooth = 3, |
| 72 |
FM = 4, |
| 73 |
}; |
| 74 |
|
| 75 |
[ |
| 76 |
contract(Windows.Foundation.UniversalApiContract, 1.0) |
| 77 |
] |
| 78 |
enum RadioState |
| 79 |
{ |
| 80 |
Unknown = 0, |
| 81 |
On = 1, |
| 82 |
Off = 2, |
| 83 |
Disabled = 3, |
| 84 |
}; |
| 85 |
|
| 86 |
[ |
| 87 |
contract(Windows.Foundation.UniversalApiContract, 1.0), |
| 88 |
exclusiveto(Windows.Devices.Radios.Radio), |
| 89 |
uuid(252118df-b33e-416a-875f-1cf38ae2d83e) |
| 90 |
] |
| 91 |
interface IRadio : IInspectable |
| 92 |
{ |
| 93 |
HRESULT SetStateAsync([in] Windows.Devices.Radios.RadioState value, |
| 94 |
[out, retval] Windows.Foundation.IAsyncOperation<Windows.Devices.Radios.RadioAccessStatus> **retval); |
| 95 |
[eventadd] HRESULT StateChanged([in] Windows.Foundation.TypedEventHandler<Windows.Devices.Radios.Radio *, IInspectable *> *handler, |
| 96 |
[out, retval] EventRegistrationToken *cookie); |
| 97 |
[eventremove] HRESULT StateChanged([in] EventRegistrationToken cookie); |
| 98 |
[propget] HRESULT State([out, retval] Windows.Devices.Radios.RadioState **value); |
| 99 |
[propget] HRESULT Name([out, retval] HSTRING *value); |
| 100 |
[propget] HRESULT Kind([out, retval] Windows.Devices.Radios.RadioKind *value); |
| 101 |
} |
| 102 |
|
| 103 |
[ |
| 104 |
contract(Windows.Foundation.UniversalApiContract, 1.0), |
| 105 |
exclusiveto(Windows.Devices.Radios.Radio), |
| 106 |
uuid(5fb6a12e-67cb-46ae-aae9-65919f86eff4) |
| 107 |
] |
| 108 |
interface IRadioStatics : IInspectable |
| 109 |
{ |
| 110 |
HRESULT GetRadiosAsync([out, retval] Windows.Foundation.IAsyncOperation<Windows.Foundation.Collections.IVectorView<Windows.Devices.Radios.Radio *> *> **value); |
| 111 |
HRESULT GetDeviceSelector([out, retval] HSTRING *selector); |
| 112 |
[overload("FromIdAsync")] HRESULT FromIdAsync([in] HSTRING id, [out, retval] Windows.Foundation.IAsyncOperation<Windows.Devices.Radios.Radio *> **value); |
| 113 |
HRESULT RequestAccessAsync([out, retval] Windows.Foundation.IAsyncOperation<Windows.Devices.Radios.RadioAccessStatus> **value); |
| 114 |
} |
| 115 |
|
| 116 |
[ |
| 117 |
contract(Windows.Foundation.UniversalApiContract, 1.0), |
| 118 |
marshaling_behavior(agile), |
| 119 |
static(Windows.Devices.Radios.IRadioStatics, Windows.Foundation.UniversalApiContract, 1.0) |
| 120 |
] |
| 121 |
runtimeclass Radio |
| 122 |
{ |
| 123 |
[default] interface Windows.Devices.Radios.IRadio; |
| 124 |
} |
| 125 |
} |