Class ComplicationProvider
Definition
- Namespace:
- Tizen.Applications.WatchfaceComplication
- Assembly:
- Tizen.Applications.WatchfaceComplication.dll
- API Level:
- 6
Represents the complication provider for a service application.
public abstract class ComplicationProvider : IDisposable
- Inheritance
-
ComplicationProvider
- Implements
Constructors
View SourceComplicationProvider(String)
Initializes a new instance of the ComplicationProvider class.
Declaration
protected ComplicationProvider(string providerId)
Parameters
Type | Name | Description |
---|---|---|
String | providerId | The id of the complication provider. |
Examples
public class MyComplicationProvider : ComplicationProvider
{
public MyComplicationProvider(string providerId)
: base(providerId)
{
}
protected override void OnDataUpdateRequested(string reqestAppId, ComplicationTypes type, Bundle contextData)
{
}
}
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown when providerId is invalid. |
InvalidOperationException | Thrown when the method failed due to invalid operation. |
NotSupportedException | Thrown when the watchface complication is not supported. |
UnauthorizedAccessException | Thrown when the application does not have privilege to access this method. |
API Level: 6
Privilege Level: public
Privilege: http://tizen.org/privilege/datasharing
Properties
View SourceId
Gets the provider ID.
Declaration
public string Id { get; }
Property Value
Type | Description |
---|---|
String |
API Level: 6
Methods
View SourceDispose()
Releases all resources used by the ComplicationProvider class.
Declaration
public void Dispose()
API Level: 3
View SourceDispose(Boolean)
Releases the unmanaged resources used by the ComplicationProvider instance specifying whether to perform a normal dispose operation.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
Boolean | disposing | true for a normal dispose operation; false to finalize the handle. |
API Level: 3
View SourceFinalize()
Destructor of the provider class.
Declaration
protected void Finalize()
GetEventComplicationType(ReceivedAppControl)
Gets the complication type of the received appcontrol.
Declaration
public static ComplicationTypes GetEventComplicationType(ReceivedAppControl recvAppCtrl)
Parameters
Type | Name | Description |
---|---|---|
ReceivedAppControl | recvAppCtrl | The received appcontrol. |
Returns
Type | Description |
---|---|
ComplicationTypes | The target complication type of received event |
Examples
protected override void OnAppControlReceived(AppControlReceivedEventArgs e)
{
ComplicationTypes type = ComplicationProvider.GetEventComplicationType(e.ReceivedAppControl);
base.OnAppControlReceived(e);
}
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown when e is invalid. |
InvalidOperationException | Thrown when the method failed due to invalid operation. |
NotSupportedException | Thrown when the watchface complication is not supported. |
API Level: 6
View SourceGetEventContext(ReceivedAppControl)
Gets the complication context of appcontrol that raises the event.
Declaration
public static Bundle GetEventContext(ReceivedAppControl recvAppCtrl)
Parameters
Type | Name | Description |
---|---|---|
ReceivedAppControl | recvAppCtrl | The received appcontrol. |
Returns
Type | Description |
---|---|
Bundle | The context of received event |
Examples
protected override void OnAppControlReceived(AppControlReceivedEventArgs e)
{
Bundle context = ComplicationProvider.GetEventContext(e.ReceivedAppControl);
base.OnAppControlReceived(e);
}
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown when e is invalid. |
InvalidOperationException | Thrown when the method failed due to invalid operation. |
NotSupportedException | Thrown when the watchface complication is not supported. |
API Level: 6
View SourceGetEventProviderId(ReceivedAppControl)
Gets the provider ID of appcontrol that raises the event.
Declaration
public static string GetEventProviderId(ReceivedAppControl recvAppCtrl)
Parameters
Type | Name | Description |
---|---|---|
ReceivedAppControl | recvAppCtrl | The received appcontrol. |
Returns
Type | Description |
---|---|
String | The target provider ID of received event |
Examples
protected override void OnAppControlReceived(AppControlReceivedEventArgs e)
{
string providerId = ComplicationProvider.GetEventProviderId(e.ReceivedAppControl);
base.OnAppControlReceived(e);
}
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown when e is invalid. |
InvalidOperationException | Thrown when the method failed due to invalid operation. |
NotSupportedException | Thrown when the watchface complication is not supported. |
API Level: 6
View SourceGetEventType(ReceivedAppControl)
Gets the received event type.
Declaration
public static EventTypes GetEventType(ReceivedAppControl recvAppCtrl)
Parameters
Type | Name | Description |
---|---|---|
ReceivedAppControl | recvAppCtrl | The received appcontrol. |
Returns
Type | Description |
---|---|
EventTypes | The type of received event |
Examples
protected override void OnAppControlReceived(AppControlReceivedEventArgs e)
{
EventTypes type = ComplicationProvider.GetEventType(e.ReceivedAppControl);
if (type == EventTypes.EventDoubleTap)
{
// do something
}
base.OnAppControlReceived(e);
}
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown when the invalid parameter is passed. |
InvalidOperationException | Thrown when the method failed due to invalid operation. |
NotSupportedException | Thrown when the watchface complication is not supported. |
API Level: 6
View SourceNotifyUpdate()
Emits the update event for complications.
Declaration
public void NotifyUpdate()
Exceptions
Type | Condition |
---|---|
UnauthorizedAccessException | Thrown when the application does not have privilege to access this method. |
NotSupportedException | Thrown when the watchface complication is not supported. |
API Level: 6
Privilege Level: public
Privilege: http://tizen.org/privilege/datasharing
View SourceOnDataUpdateRequested(String, ComplicationTypes, Bundle)
Overrides this method to handle the behavior when the event for requesting the update of complication data comes from watchface complication.
Declaration
protected abstract ComplicationData OnDataUpdateRequested(string reqestAppId, ComplicationTypes type, Bundle contextData)
Parameters
Type | Name | Description |
---|---|---|
String | reqestAppId | The ID of application which sent update request. |
ComplicationTypes | type | The requested type. |
Bundle | contextData | The complication's context which is set by complication setup application. |
Returns
Type | Description |
---|---|
ComplicationData | The requested ComplicationData |