using System.Collections.Generic;
using Tizen.Applications;
using System.Runtime.InteropServices;
+using System.ComponentModel;
namespace Tizen.Applications
{
/// <summary>
/// The class for receiving widget events and sending data to the widget.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public class WidgetControl : IDisposable
{
private const string LogTag = "Tizen.Applications.WidgetControl";
+ private static Interop.WidgetService.LifecycleCallback _onLifecycleCallback;
/// <summary>
/// Class for the widget instance.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public class Instance
{
private string _widgetId;
/// <summary>
/// Gets the widget content.
/// </summary>
+ /// <returns>The bundle containing widget content.</returns>
/// <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 required features are 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="UnauthorizedAccessException">Thrown when an application does not have the required privileges to access this method.</exception>
+ /// <exception cref="NotSupportedException">Thrown when the required features are 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>
+ /// <param name="period">The period to be changed.</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="UnauthorizedAccessException">Thrown when an application does not have the required privileges to access this method.</exception>
+ /// <exception cref="NotSupportedException">Thrown when the required features are 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");
}
}
}
/// <summary>
/// The class for the widget size information.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public class Scale
{
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <param name="pkgId">Package ID.</param>
+ /// <returns>The widget control array.</returns>
/// <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="UnauthorizedAccessException">Thrown when an application does not have the required privileges to access this method.</exception>
+ /// <exception cref="NotSupportedException">Thrown when the required features are not supported.</exception>
public static WidgetControl[] CreateAll(string pkgId)
{
List<WidgetControl> list = new List<WidgetControl>();
Interop.WidgetService.ErrorCode err = Interop.WidgetService.GetWidgetListByPkgId(pkgId, (widgetId, isPrime, userData) =>
{
list.Add(new WidgetControl(widgetId));
+
+ return (int)Interop.WidgetService.ErrorCode.None;
}, IntPtr.Zero);
switch (err)
case Interop.WidgetService.ErrorCode.PermissionDenied:
throw new UnauthorizedAccessException();
+
+ case Interop.WidgetService.ErrorCode.NotSupported:
+ throw new NotSupportedException("Not supported");
}
return list.ToArray();
/// Gets all the widget IDs by the package ID.
/// </summary>
/// <since_tizen> 3 </since_tizen>
+ /// <param name="pkgId">Package ID.</param>
+ /// <returns>The widget id array.</returns>
/// <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="UnauthorizedAccessException">Thrown when an application does not have the required privileges to access this method.</exception>
+ /// <exception cref="NotSupportedException">Thrown when the required features are not supported.</exception>
public static string[] GetWidgetIds(string pkgId)
{
List<string> list = new List<string>();
Interop.WidgetService.ErrorCode err = Interop.WidgetService.GetWidgetListByPkgId(pkgId, (widgetId, isPrime, userData) =>
{
list.Add(widgetId);
+
+ return (int)Interop.WidgetService.ErrorCode.None;
}, IntPtr.Zero);
switch (err)
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 required privileges to access this method.</exception>
+ /// <exception cref="NotSupportedException">Thrown when the required features are 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 required privileges to access this method.</exception>
+ /// <exception cref="NotSupportedException">Thrown when the required features are 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 required privileges to access this method.</exception>
+ /// <exception cref="NotSupportedException">Thrown when the required features are 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;
}
/// <summary>
+ /// Gets setup app ID of the widget.
+ /// </summary>
+ /// <since_tizen> 8 </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 required privileges to access this method.</exception>
+ /// <exception cref="NotSupportedException">Thrown when the required features are not supported.</exception>
+ /// <exception cref="InvalidOperationException">Thrown in case of failed conditions.</exception>
+ public string SetupAppId
+ {
+ get
+ {
+ string str = Interop.WidgetService.GetSetupAppId(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");
+
+ 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.Fault:
+ throw new InvalidOperationException("Failed to access DB");
+
+ case Interop.WidgetService.ErrorCode.NotExist:
+ throw new InvalidOperationException("Not exist in DB");
+ }
+
+ return str;
+ }
+ }
+
+ /// <summary>
+ /// Gets widget max count
+ /// </summary>
+ /// <since_tizen> 8 </since_tizen>
+ /// <privilege>http://tizen.org/privilege/widget.viewer</privilege>
+ /// <feature>http://tizen.org/feature/shell.appwidget</feature>
+ /// <exception cref="NotSupportedException">Thrown when the required features are not supported.</exception>
+ /// <exception cref="UnauthorizedAccessException">Thrown when an application does not have the required privileges to access this method.</exception>
+ /// <exception cref="InvalidOperationException">Thrown in case of failed conditions.</exception>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public int MaxCount
+ {
+ get
+ {
+ int ret = Interop.WidgetService.GetWidgetMaxCount(Id);
+
+ switch ((Interop.WidgetService.ErrorCode)ret)
+ {
+ case Interop.WidgetService.ErrorCode.NotSupported:
+ throw new NotSupportedException();
+
+ case Interop.WidgetService.ErrorCode.PermissionDenied:
+ throw new UnauthorizedAccessException();
+
+ case Interop.WidgetService.ErrorCode.InvalidParameter:
+ throw new InvalidOperationException("Invalid parameter");
+
+ case Interop.WidgetService.ErrorCode.IoError:
+ throw new InvalidOperationException("Failed to access DB");
+
+ case Interop.WidgetService.ErrorCode.Fault:
+ throw new InvalidOperationException("Failed to get information from DB");
+
+ case Interop.WidgetService.ErrorCode.NotExist:
+ throw new InvalidOperationException("The data does not exist");
+ }
+
+ return ret;
+ }
+ }
+
+ /// <summary>
/// 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="UnauthorizedAccessException">Thrown when an application does not have the required privileges to access this method.</exception>
+ /// <exception cref="NotSupportedException">Thrown when the required features are 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="UnauthorizedAccessException">Thrown when an application does not have the required privileges to access this method.</exception>
+ /// <exception cref="NotSupportedException">Thrown when the required features are 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="UnauthorizedAccessException">Thrown when an application does not have the required privileges to access this method.</exception>
+ /// <exception cref="NotSupportedException">Thrown when the required features are 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="UnauthorizedAccessException">Thrown when an application does not have the required privileges to access this method.</exception>
+ /// <exception cref="NotSupportedException">Thrown when the required features are not supported.</exception>
public event EventHandler<WidgetLifecycleEventArgs> Destroyed
{
add
/// <summary>
/// Gets the objects for widget instance information.
/// </summary>
+ /// <returns>The instances list.</returns>
/// <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>
+ /// <exception cref="UnauthorizedAccessException">Thrown when an application does not have the required privileges to access this method.</exception>
public IEnumerable<Instance> GetInstances()
{
IList<Instance> instances = new List<Instance>();
Interop.WidgetService.ErrorCode err = Interop.WidgetService.GetInstances(Id, (widgetId, instanceId, userData) =>
{
instances.Add(new Instance(widgetId) { Id = instanceId });
+
+ return (int)Interop.WidgetService.ErrorCode.None;
}, IntPtr.Zero);
switch (err)
/// <summary>
/// Gets the objects for widget scale information.
/// </summary>
+ /// <returns>The scales list.</returns>
/// <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="UnauthorizedAccessException">Thrown when an application does not have the required privileges to access this method.</exception>
+ /// <exception cref="NotSupportedException">Thrown when the required features are 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);
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <param name="lang">Language.</param>
+ /// <returns>The widget name.</returns>
/// <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 required privileges to access this method.</exception>
+ /// <exception cref="NotSupportedException">Thrown when the required features are 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>
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <param name="lang">Language.</param>
+ /// <returns>The widget icon path.</returns>
/// <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 required privileges to access this method.</exception>
+ /// <exception cref="NotSupportedException">Thrown when the required features are 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();
+
+ switch (err)
+ {
+ case Interop.WidgetService.ErrorCode.PermissionDenied:
+ throw new UnauthorizedAccessException();
- return Interop.WidgetService.GetIcon(pkgId, lang);
+ case Interop.WidgetService.ErrorCode.NotSupported:
+ throw new NotSupportedException();
+ }
+
+ return str;
+ }
+
+ /// <summary>
+ /// Gets widget instance count
+ /// </summary>
+ /// <since_tizen> 8 </since_tizen>
+ /// <returns>The widget instance count.</returns>
+ /// <privilege>http://tizen.org/privilege/widget.viewer</privilege>
+ /// <feature>http://tizen.org/feature/shell.appwidget</feature>
+ /// <exception cref="NotSupportedException">Thrown when the required features are not supported.</exception>
+ /// <exception cref="UnauthorizedAccessException">Thrown when an application does not have the required privileges to access this method.</exception>
+ /// <exception cref="InvalidOperationException">Thrown in case of failed conditions.</exception>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public int GetInstanceCount()
+ {
+ int ret = Interop.WidgetService.GetWidgetInstanceCount(Id, null, null);
+
+ switch ((Interop.WidgetService.ErrorCode)ret)
+ {
+ case Interop.WidgetService.ErrorCode.NotSupported:
+ throw new NotSupportedException();
+
+ case Interop.WidgetService.ErrorCode.InvalidParameter:
+ throw new InvalidOperationException("Invalid parameter");
+
+ case Interop.WidgetService.ErrorCode.PermissionDenied:
+ throw new UnauthorizedAccessException();
+ }
+
+ return ret;
}
/// <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 required privileges to access this method.</exception>
+ /// <exception cref="NotSupportedException">Thrown when the required features are not supported.</exception>
public void Dispose()
{
Dispose(true);
if (s_lifecycleEventRefCnt[Id] == 0)
{
- Interop.WidgetService.ErrorCode err = Interop.WidgetService.SetLifecycleEvent(Id, OnLifecycleEvent, IntPtr.Zero);
+ if (_onLifecycleCallback == null)
+ _onLifecycleCallback = new Interop.WidgetService.LifecycleCallback(OnLifecycleEvent);
+ Interop.WidgetService.ErrorCode err = Interop.WidgetService.SetLifecycleEvent(Id, _onLifecycleCallback, IntPtr.Zero);
switch (err)
{
case Interop.WidgetService.ErrorCode.InvalidParameter:
case Interop.WidgetService.ErrorCode.PermissionDenied:
throw new UnauthorizedAccessException();
+
+ case Interop.WidgetService.ErrorCode.NotSupported:
+ throw new NotSupportedException();
}
}
s_lifecycleEventRefCnt[Id]++;
s_eventObjects.Add(this);
+ Log.Debug(LogTag, "register lifecycle cb " + Id + " [" + s_lifecycleEventRefCnt[Id] + "]");
}
private void UnregisterLifecycleEvent()
case Interop.WidgetService.ErrorCode.NotExist:
throw new InvalidOperationException("Event handler is not exist");
+
+ case Interop.WidgetService.ErrorCode.NotSupported:
+ throw new NotSupportedException();
}
+ _onLifecycleCallback = null;
}
s_eventObjects.Remove(this);
s_lifecycleEventRefCnt[Id]--;
+ Log.Debug(LogTag, "unregister lifecycle cb " + Id + " [" + s_lifecycleEventRefCnt[Id] + "]");
}
- private static void OnLifecycleEvent(string widgetId, Interop.WidgetService.LifecycleEvent e, string instanceId, IntPtr userData)
+ private static int OnLifecycleEvent(string widgetId, Interop.WidgetService.LifecycleEvent e, string instanceId, IntPtr userData)
{
+ Log.Debug(LogTag, "Lifecycle event : " + instanceId + " [" + e + "]");
switch (e)
{
case Interop.WidgetService.LifecycleEvent.Created:
}
}
break;
+
+ default:
+ break;
}
+ return 0;
}
}