Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 23 additions & 34 deletions apis/ResourceManager/IResourceManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,55 +27,44 @@ namespace WPEFramework
namespace Exchange
{
/* @json 1.0.0 @text:keep */
struct EXTERNAL IResourceManager : virtual public Core::IUnknown
struct EXTERNAL IResourceManager : virtual public Core::IUnknown
{
enum { ID = ID_RESOURCEMANAGER };

// Define string iterator for ResourceManager
using IStringIterator = RPC::IIteratorType<string, RPC::ID_STRINGITERATOR>;

// Result struct for SetAVBlocked operation
struct EXTERNAL SetAVBlockedResult {
struct EXTERNAL Success {
bool success;
};

// Result struct for TTS operations
struct EXTERNAL TTSResult {
bool success;
};

/**********************setAVBlocked() - start****************************/
/** Sets AV blocking status for an application */
// @text setAVBlocked
// @brief Sets AV blocking status for an application
// @param appId - in - string
// @param blocked - in - bool
// @param result - out - SetAVBlockedResult
virtual Core::hresult SetAVBlocked(const string& appId, const bool blocked, SetAVBlockedResult& result /* @out */) = 0;
/**********************setAVBlocked() - end******************************/
// @brief Adds/removes the application with the given callsign to/from the AV blacklist
// @param appId The application identifier (callsign)
// @param blocked Whether to block (true) or unblock (false) AV access for the application
// @param result The result of the operation
virtual Core::hresult SetAVBlocked(const string& appId, const bool blocked, Success& result /* @out */) = 0;

/**********************getBlockedAVApplications() - start***************/
// @text getBlockedAVApplications
// @brief Gets list of applications with blocked AV access
// @param clients: list of blocked applications
// @param success: success status
/** Gets a list of blacklisted clients */
// @text getBlockedAVApplications
// @brief Gets a list of blacklisted clients
// @param clients Iterator containing the list of blocked applications
// @param success Indicates whether the operation succeeded
virtual Core::hresult GetBlockedAVApplications(IStringIterator*& clients /* @out */, bool& success /* @out */) const = 0;
/**********************getBlockedAVApplications() - end*****************/

/**********************reserveTTSResource() - start*********************/
/** Reserves the Text To Speech resource for a specified client */
// @text reserveTTSResource
// @brief Reserves TTS resource for a single application
// @param appId - in - string
// @param ttsResult - out - TTSResult
virtual Core::hresult ReserveTTSResource(const string& appId, TTSResult& ttsResult /* @out */) = 0;
/**********************reserveTTSResource() - end***********************/
// @brief Reserves the Text To Speech resource for a specified client
// @param appId The application identifier (callsign)
// @param result The result of the reservation operation
virtual Core::hresult ReserveTTSResource(const string& appId, Success& result /* @out */) = 0;

/**********************reserveTTSResourceForApps() - start***************/
/** Reserves the Text To Speech resource for specified clients */
// @text reserveTTSResourceForApps
// @brief Reserves TTS resource for multiple applications
// @param appids: list of application IDs
// @param ttsResult: result of the TTS reservation
virtual Core::hresult ReserveTTSResourceForApps(IStringIterator* const appids, TTSResult& ttsResult /* @out */) = 0;
/**********************reserveTTSResourceForApps() - end*****************/
// @brief Reserves the Text To Speech resource for specified clients
// @param appids Iterator containing the list of application identifiers (callsigns)
// @param result The result of the reservation operation
virtual Core::hresult ReserveTTSResourceForApps(IStringIterator* const appids, Success& result /* @out */) = 0;
};
} // namespace Exchange
} // namespace WPEFramework
34 changes: 17 additions & 17 deletions docs/apis/ResourceManager.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ ResourceManager interface methods:

| Method | Description |
| :-------- | :-------- |
| [getBlockedAVApplications](#getBlockedAVApplications) | Gets list of applications with blocked AV access |
| [reserveTTSResource](#reserveTTSResource) | Reserves TTS resource for a single application |
| [reserveTTSResourceForApps](#reserveTTSResourceForApps) | Reserves TTS resource for multiple applications |
| [setAVBlocked](#setAVBlocked) | Sets AV blocking status for an application |
| [getBlockedAVApplications](#getBlockedAVApplications) | Gets a list of blacklisted clients |
| [reserveTTSResource](#reserveTTSResource) | Reserves the Text To Speech resource for a specified client |
| [reserveTTSResourceForApps](#reserveTTSResourceForApps) | Reserves the Text To Speech resource for specified clients |
| [setAVBlocked](#setAVBlocked) | Adds/removes the application with the given callsign to/from the AV blacklist |

<a id="getBlockedAVApplications"></a>
## *getBlockedAVApplications*

Gets list of applications with blocked AV access
Gets a list of blacklisted clients

### Events
Event details will be updated soon.
Expand All @@ -64,9 +64,9 @@ This method takes no parameters.
| Name | Type | Description |
| :-------- | :-------- | :-------- |
| result | object | |
| result.clients | IStringIterator | list of blocked applications |
| result.clients | IStringIterator | Iterator containing the list of blocked applications |
| result.clients[#] | string | |
| result.success | bool | success status |
| result.success | bool | Indicates whether the operation succeeded |

### Examples

Expand Down Expand Up @@ -107,20 +107,20 @@ curl -H 'content-type:text/plain;' --data-binary '{"jsonrpc": 2.0, "id": 0, "met
<a id="reserveTTSResource"></a>
## *reserveTTSResource*

Reserves TTS resource for a single application
Reserves the Text To Speech resource for a specified client

### Events
Event details will be updated soon.
### Parameters
| Name | Type | Description |
| :-------- | :-------- | :-------- |
| params | object | |
| params.appId | string | string |
| params.appId | string | The application identifier (callsign) |
### Results
| Name | Type | Description |
| :-------- | :-------- | :-------- |
| result | object | |
| result.success | bool | success status |
| result.success | bool | Indicates whether the operation succeeded |

### Examples

Expand Down Expand Up @@ -161,21 +161,21 @@ curl -H 'content-type:text/plain;' --data-binary '{"jsonrpc": 2.0, "id": 1, "met
<a id="reserveTTSResourceForApps"></a>
## *reserveTTSResourceForApps*

Reserves TTS resource for multiple applications
Reserves the Text To Speech resource for specified clients

### Events
Event details will be updated soon.
### Parameters
| Name | Type | Description |
| :-------- | :-------- | :-------- |
| params | object | |
| params.appids | IStringIterator | list of application IDs |
| params.appids | IStringIterator | Iterator containing the list of application identifiers (callsigns) |
| params.appids[#] | string | |
### Results
| Name | Type | Description |
| :-------- | :-------- | :-------- |
| result | object | |
| result.success | bool | success status |
| result.success | bool | Indicates whether the operation succeeded |

### Examples

Expand Down Expand Up @@ -216,21 +216,21 @@ curl -H 'content-type:text/plain;' --data-binary '{"jsonrpc": 2.0, "id": 2, "met
<a id="setAVBlocked"></a>
## *setAVBlocked*

Sets AV blocking status for an application
Adds/removes the application with the given callsign to/from the AV blacklist

### Events
Event details will be updated soon.
### Parameters
| Name | Type | Description |
| :-------- | :-------- | :-------- |
| params | object | |
| params.appId | string | string |
| params.blocked | bool | bool |
| params.appId | string | The application identifier (callsign) |
| params.blocked | bool | Whether to block (true) or unblock (false) AV access for the application |
### Results
| Name | Type | Description |
| :-------- | :-------- | :-------- |
| result | object | |
| result.success | bool | success status |
| result.success | bool | Indicates whether the operation succeeded |

### Examples

Expand Down
Loading