/// Gets the widget content.
/// </summary>
/// <since_tizen> 3 </since_tizen>
+ /// <feature>http://tizen.org/feature/shell.appwidget</feature>
/// <exception cref="InvalidOperationException">Thrown in case of failed conditions.</exception>
+ /// <exception cref="NotSupportedException">Thrown in case of feature not supported.</exception>
public Bundle GetContent()
{
IntPtr h;
{
case Interop.WidgetService.ErrorCode.InvalidParameter:
throw new InvalidOperationException("Invalid parameter at unmanaged code");
-
case Interop.WidgetService.ErrorCode.IoError:
throw new InvalidOperationException("Failed to access DB");
+ case Interop.WidgetService.ErrorCode.NotSupported:
+ throw new NotSupportedException("Not supported");
}
return new Bundle(new SafeBundleHandle(h, true));
/// <since_tizen> 3 </since_tizen>
/// <param name="content">Content to be changed.</param>
/// <param name="force"> True if you want to update your widget even if the provider is paused, otherwise false.</param>
+ /// <feature>http://tizen.org/feature/shell.appwidget</feature>
/// <exception cref="ArgumentException">Thrown when failed because of an invalid argument.</exception>
/// <exception cref="InvalidOperationException">Thrown in case of failed conditions.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when an application does not have the privilege to access this method.</exception>
+ /// <exception cref="NotSupportedException">Thrown in case of feature not supported.</exception>
public void ChangeContent(Bundle content, bool force)
{
Interop.WidgetService.ErrorCode err = Interop.WidgetService.UpdateContent(_widgetId, Id, content.SafeBundleHandle, force ? 1 : 0);
case Interop.WidgetService.ErrorCode.PermissionDenied:
throw new UnauthorizedAccessException();
+
+ case Interop.WidgetService.ErrorCode.NotSupported:
+ throw new NotSupportedException("Not supported");
}
}
/// Changes the update period for the widget instance.
/// </summary>
/// <since_tizen> 3 </since_tizen>
+ /// <feature>http://tizen.org/feature/shell.appwidget</feature>
/// <exception cref="ArgumentException">Thrown when failed because of an invalid argument.</exception>
/// <exception cref="InvalidOperationException">Thrown in case of failed conditions.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when an application does not have the privilege to access this method.</exception>
+ /// <exception cref="NotSupportedException">Thrown in case of feature not supported.</exception>
public void ChangePeriod(double period)
{
Interop.WidgetService.ErrorCode err = Interop.WidgetService.ChangePeriod(_widgetId, Id, period);
case Interop.WidgetService.ErrorCode.PermissionDenied:
throw new UnauthorizedAccessException();
+
+ case Interop.WidgetService.ErrorCode.NotSupported:
+ throw new NotSupportedException("Not supported");
}
}
}
/// <since_tizen> 3 </since_tizen>
/// <param name="pkgId">Package ID.</param>
/// <privilege>http://tizen.org/privilege/widget.viewer</privilege>
+ /// <feature>http://tizen.org/feature/shell.appwidget</feature>
/// <exception cref="ArgumentException">Thrown when failed because of an invalid argument.</exception>
/// <exception cref="InvalidOperationException">Thrown in case of failed conditions.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when an application does not have the privilege to access this method.</exception>
+ /// <exception cref="NotSupportedException">Thrown in case of feature not supported.</exception>
public static WidgetControl[] CreateAll(string pkgId)
{
List<WidgetControl> list = new List<WidgetControl>();
case Interop.WidgetService.ErrorCode.PermissionDenied:
throw new UnauthorizedAccessException();
+
+ case Interop.WidgetService.ErrorCode.NotSupported:
+ throw new NotSupportedException("Not supported");
}
return list.ToArray();
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <privilege>http://tizen.org/privilege/widget.viewer</privilege>
+ /// <feature>http://tizen.org/feature/shell.appwidget</feature>
/// <exception cref="ArgumentException">Thrown when failed because of an invalid argument.</exception>
/// <exception cref="InvalidOperationException">Thrown in case of failed conditions.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when an application does not have the privilege to access this method.</exception>
+ /// <exception cref="NotSupportedException">Thrown in case of feature not supported.</exception>
public static string[] GetWidgetIds(string pkgId)
{
List<string> list = new List<string>();
case Interop.WidgetService.ErrorCode.PermissionDenied:
throw new UnauthorizedAccessException();
+
+ case Interop.WidgetService.ErrorCode.NotSupported:
+ throw new NotSupportedException("Not supported");
}
return list.ToArray();
}
/// <summary>
+ /// Gets main appid of the widget.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ /// <privilege>http://tizen.org/privilege/widget.viewer</privilege>
+ /// <feature>http://tizen.org/feature/shell.appwidget</feature>
+ /// <exception cref="UnauthorizedAccessException">Thrown when an application does not have the privilege to access this method.</exception>
+ /// <exception cref="NotSupportedException">Thrown in case of feature not supported.</exception>
+ public string MainAppId
+ {
+ get
+ {
+ string str = Interop.WidgetService.GetWidgetMainAppId(Id);
+ Interop.WidgetService.ErrorCode err =
+ (Interop.WidgetService.ErrorCode)Internals.Errors.ErrorFacts.GetLastResult();
+ switch (err)
+ {
+ case Interop.WidgetService.ErrorCode.PermissionDenied:
+ throw new UnauthorizedAccessException();
+
+ case Interop.WidgetService.ErrorCode.NotSupported:
+ throw new NotSupportedException("Not supported");
+ }
+
+ return str;
+ }
+ }
+
+ /// <summary>
+ /// Gets package ID of the widget.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ /// <privilege>http://tizen.org/privilege/widget.viewer</privilege>
+ /// <feature>http://tizen.org/feature/shell.appwidget</feature>
+ /// <exception cref="UnauthorizedAccessException">Thrown when an application does not have the privilege to access this method.</exception>
+ /// <exception cref="NotSupportedException">Thrown in case of feature not supported.</exception>
+ public string PackageId
+ {
+ get
+ {
+ string str = Interop.WidgetService.GetWidgetPackageId(Id);
+ Interop.WidgetService.ErrorCode err =
+ (Interop.WidgetService.ErrorCode)Internals.Errors.ErrorFacts.GetLastResult();
+ switch (err)
+ {
+ case Interop.WidgetService.ErrorCode.PermissionDenied:
+ throw new UnauthorizedAccessException();
+
+ case Interop.WidgetService.ErrorCode.NotSupported:
+ throw new NotSupportedException("Not supported");
+ }
+
+ return str;
+ }
+ }
+
+ /// <summary>
/// The widget ID.
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <privilege>http://tizen.org/privilege/widget.viewer</privilege>
+ /// <feature>http://tizen.org/feature/shell.appwidget</feature>
+ /// <exception cref="UnauthorizedAccessException">Thrown when an application does not have the privilege to access this method.</exception>
+ /// <exception cref="NotSupportedException">Thrown in case of feature not supported.</exception>
public bool IsNoDisplay
{
get
{
- if (Interop.WidgetService.GetNoDisplay(Id) != 0)
+ int ret = Interop.WidgetService.GetNoDisplay(Id);
+ Interop.WidgetService.ErrorCode err =
+ (Interop.WidgetService.ErrorCode)Internals.Errors.ErrorFacts.GetLastResult();
+ switch (err)
+ {
+ case Interop.WidgetService.ErrorCode.PermissionDenied:
+ throw new UnauthorizedAccessException();
+
+ case Interop.WidgetService.ErrorCode.NotSupported:
+ throw new NotSupportedException("Not supported");
+ }
+
+ if (ret != 0)
return true;
return false;
/// The event handler for a created widget instance.
/// </summary>
/// <since_tizen> 3 </since_tizen>
+ /// <feature>http://tizen.org/feature/shell.appwidget</feature>
/// <exception cref="InvalidOperationException">Thrown in case of failed conditions.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when an application does not have the privilege to access this method.</exception>
+ /// <exception cref="NotSupportedException">Thrown in case of feature not supported.</exception>
public event EventHandler<WidgetLifecycleEventArgs> Created
{
add
/// The event handler for a resumed widget instance.
/// </summary>
/// <since_tizen> 3 </since_tizen>
+ /// <feature>http://tizen.org/feature/shell.appwidget</feature>
/// <exception cref="InvalidOperationException">Thrown in case of failed conditions.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when an application does not have the privilege to access this method.</exception>
+ /// <exception cref="NotSupportedException">Thrown in case of feature not supported.</exception>
public event EventHandler<WidgetLifecycleEventArgs> Resumed
{
add
/// The event handler for a paused widget instance.
/// </summary>
/// <since_tizen> 3 </since_tizen>
+ /// <feature>http://tizen.org/feature/shell.appwidget</feature>
/// <exception cref="InvalidOperationException">Thrown in case of failed conditions.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when an application does not have the privilege to access this method.</exception>
+ /// <exception cref="NotSupportedException">Thrown in case of feature not supported.</exception>
public event EventHandler<WidgetLifecycleEventArgs> Paused
{
add
/// The event handler for a destroyed widget instance.
/// </summary>
/// <since_tizen> 3 </since_tizen>
+ /// <feature>http://tizen.org/feature/shell.appwidget</feature>
/// <exception cref="InvalidOperationException">Thrown in case of failed conditions.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when an application does not have the privilege to access this method.</exception>
+ /// <exception cref="NotSupportedException">Thrown in case of feature not supported.</exception>
public event EventHandler<WidgetLifecycleEventArgs> Destroyed
{
add
/// Gets the objects for widget instance information.
/// </summary>
/// <since_tizen> 3 </since_tizen>
+ /// <feature>http://tizen.org/feature/shell.appwidget</feature>
/// <exception cref="InvalidOperationException">Thrown in case of failed conditions.</exception>
/// <exception cref="NotSupportedException">Thrown when the API is not supported in this device.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when an application does not have the privilege to access this method.</exception>
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <privilege>http://tizen.org/privilege/widget.viewer</privilege>
+ /// <feature>http://tizen.org/feature/shell.appwidget</feature>
/// <exception cref="InvalidOperationException">Thrown in case of failed conditions.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when an application does not have the privilege to access this method.</exception>
+ /// <exception cref="NotSupportedException">Thrown in case of feature not supported.</exception>
public IEnumerable<Scale> GetScales()
{
IntPtr wPtr;
case Interop.WidgetService.ErrorCode.PermissionDenied:
throw new UnauthorizedAccessException();
+
+ case Interop.WidgetService.ErrorCode.NotSupported:
+ throw new NotSupportedException();
}
w = new int[cnt1];
Marshal.Copy(wPtr, w, 0, cnt1);
/// <since_tizen> 3 </since_tizen>
/// <param name="lang">Language.</param>
/// <privilege>http://tizen.org/privilege/widget.viewer</privilege>
+ /// <feature>http://tizen.org/feature/shell.appwidget</feature>
/// <exception cref="ArgumentNullException">Thrown when the argument is null.</exception>
+ /// <exception cref="UnauthorizedAccessException">Thrown when an application does not have the privilege to access this method.</exception>
+ /// <exception cref="NotSupportedException">Thrown in case of feature not supported.</exception>
public string GetName(string lang)
{
if (lang == null)
throw new ArgumentNullException();
- return Interop.WidgetService.GetName(Id, lang);
+ string str = Interop.WidgetService.GetName(Id, lang);
+ Interop.WidgetService.ErrorCode err =
+ (Interop.WidgetService.ErrorCode)Internals.Errors.ErrorFacts.GetLastResult();
+
+ switch (err)
+ {
+ case Interop.WidgetService.ErrorCode.PermissionDenied:
+ throw new UnauthorizedAccessException();
+
+ case Interop.WidgetService.ErrorCode.NotSupported:
+ throw new NotSupportedException();
+ }
+
+ return str;
}
/// <summary>
/// <since_tizen> 3 </since_tizen>
/// <param name="lang">Language.</param>
/// <privilege>http://tizen.org/privilege/widget.viewer</privilege>
+ /// <feature>http://tizen.org/feature/shell.appwidget</feature>
/// <exception cref="ArgumentNullException">Thrown when the argument is null.</exception>
+ /// <exception cref="UnauthorizedAccessException">Thrown when an application does not have the privilege to access this method.</exception>
+ /// <exception cref="NotSupportedException">Thrown in case of feature not supported.</exception>
public string GetIconPath(string lang)
{
if (lang == null)
throw new ArgumentNullException();
string pkgId = Interop.WidgetService.GetPkgId(Id);
+ string str = Interop.WidgetService.GetIcon(pkgId, lang);
+ Interop.WidgetService.ErrorCode err =
+ (Interop.WidgetService.ErrorCode)Internals.Errors.ErrorFacts.GetLastResult();
- return Interop.WidgetService.GetIcon(pkgId, lang);
+ switch (err)
+ {
+ case Interop.WidgetService.ErrorCode.PermissionDenied:
+ throw new UnauthorizedAccessException();
+
+ case Interop.WidgetService.ErrorCode.NotSupported:
+ throw new NotSupportedException();
+ }
+
+ return str;
}
/// <summary>
/// Releases all the resources used by the WidgetControl class.
/// </summary>
/// <since_tizen> 3 </since_tizen>
+ /// <feature>http://tizen.org/feature/shell.appwidget</feature>
+ /// <exception cref="InvalidOperationException">Thrown in case of failed conditions.</exception>
+ /// <exception cref="UnauthorizedAccessException">Thrown when an application does not have the privilege to access this method.</exception>
+ /// <exception cref="NotSupportedException">Thrown in case of feature not supported.</exception>
public void Dispose()
{
Dispose(true);
case Interop.WidgetService.ErrorCode.PermissionDenied:
throw new UnauthorizedAccessException();
+
+ case Interop.WidgetService.ErrorCode.NotSupported:
+ throw new NotSupportedException();
}
}
case Interop.WidgetService.ErrorCode.NotExist:
throw new InvalidOperationException("Event handler is not exist");
+
+ case Interop.WidgetService.ErrorCode.NotSupported:
+ throw new NotSupportedException();
}
_onLifecycleCallback = null;
}