From: kilig Date: Thu, 28 Mar 2019 01:29:12 +0000 (+0900) Subject: [Tizen.Applications.EventManager] Add new apis for event system (#761) X-Git-Tag: 5.5_M2~270 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b3e9d84e0887f9d0ff33e454cc482733aa592e6c;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [Tizen.Applications.EventManager] Add new apis for event system (#761) Signed-off-by: Inkyun Kil --- diff --git a/src/Tizen.Applications.EventManager/Interop/Interop.AppEvent.cs b/src/Tizen.Applications.EventManager/Interop/Interop.AppEvent.cs new file mode 100755 index 0000000..5921f53 --- /dev/null +++ b/src/Tizen.Applications.EventManager/Interop/Interop.AppEvent.cs @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +using System; +using System.Runtime.InteropServices; + +using Tizen.Applications; + +internal static partial class Interop +{ + internal static partial class AppEvent + { + internal enum ErrorCode + { + None = Tizen.Internals.Errors.ErrorCode.None, + InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter, + OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory, + PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied, + IoError = Tizen.Internals.Errors.ErrorCode.IoError, + TimeOut = Tizen.Internals.Errors.ErrorCode.TimedOut, + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void EventCallback(string eventName, IntPtr eventData, IntPtr userData); + + [DllImport(Libraries.AppEvent, EntryPoint = "event_add_event_handler")] + internal static extern ErrorCode EventAddHandler(string eventName, EventCallback cb, IntPtr userData, out IntPtr handle); + + [DllImport(Libraries.AppEvent, EntryPoint = "event_remove_event_handler")] + internal static extern ErrorCode EventRemoveHandler(IntPtr handle); + + [DllImport(Libraries.AppEvent, EntryPoint = "event_publish_app_event")] + internal static extern ErrorCode EventPublishAppEvent(string eventName, SafeBundleHandle eventData); + + [DllImport(Libraries.AppEvent, EntryPoint = "event_publish_trusted_app_event")] + internal static extern ErrorCode EventPublishTrustedAppEvent(string eventName, SafeBundleHandle eventData); + + [DllImport(Libraries.AppEvent, EntryPoint = "event_keep_last_event_data")] + internal static extern ErrorCode EventKeepLastEventData(string eventName); + } +} diff --git a/src/Tizen.Applications.EventManager/Interop/Interop.Libraries.cs b/src/Tizen.Applications.EventManager/Interop/Interop.Libraries.cs new file mode 100755 index 0000000..98ea422 --- /dev/null +++ b/src/Tizen.Applications.EventManager/Interop/Interop.Libraries.cs @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +internal static partial class Interop +{ + internal static partial class Libraries + { + public const string AppEvent = "libcapi-appfw-event.so.0"; + } +} diff --git a/src/Tizen.Applications.EventManager/Tizen.Applications.EventManager.csproj b/src/Tizen.Applications.EventManager/Tizen.Applications.EventManager.csproj new file mode 100755 index 0000000..1c0b931 --- /dev/null +++ b/src/Tizen.Applications.EventManager/Tizen.Applications.EventManager.csproj @@ -0,0 +1,10 @@ + + + + netstandard2.0 + + + + + + \ No newline at end of file diff --git a/src/Tizen.Applications.EventManager/Tizen.Applications.EventManager.sln b/src/Tizen.Applications.EventManager/Tizen.Applications.EventManager.sln new file mode 100755 index 0000000..655fe6a --- /dev/null +++ b/src/Tizen.Applications.EventManager/Tizen.Applications.EventManager.sln @@ -0,0 +1,46 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.27130.2036 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.EventManager", "Tizen.Applications.EventManager.csproj", "{463DEFEA-012A-4CC8-9321-0F0789B028B7}" + ProjectSection(ProjectDependencies) = postProject + {662BB8B3-379E-48E7-B6C6-08D1ADAFB5B8} = {662BB8B3-379E-48E7-B6C6-08D1ADAFB5B8} + EndProjectSection +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{4F2489AC-A247-47C8-B481-EA2E593163AB}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.Common", "..\Tizen.Applications.Common\Tizen.Applications.Common.csproj", "{662BB8B3-379E-48E7-B6C6-08D1ADAFB5B8}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{BE5AA891-FB94-4592-9B6B-796F8EA35A30}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {463DEFEA-012A-4CC8-9321-0F0789B028B7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {463DEFEA-012A-4CC8-9321-0F0789B028B7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {463DEFEA-012A-4CC8-9321-0F0789B028B7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {463DEFEA-012A-4CC8-9321-0F0789B028B7}.Release|Any CPU.Build.0 = Release|Any CPU + {4F2489AC-A247-47C8-B481-EA2E593163AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4F2489AC-A247-47C8-B481-EA2E593163AB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4F2489AC-A247-47C8-B481-EA2E593163AB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4F2489AC-A247-47C8-B481-EA2E593163AB}.Release|Any CPU.Build.0 = Release|Any CPU + {662BB8B3-379E-48E7-B6C6-08D1ADAFB5B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {662BB8B3-379E-48E7-B6C6-08D1ADAFB5B8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {662BB8B3-379E-48E7-B6C6-08D1ADAFB5B8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {662BB8B3-379E-48E7-B6C6-08D1ADAFB5B8}.Release|Any CPU.Build.0 = Release|Any CPU + {BE5AA891-FB94-4592-9B6B-796F8EA35A30}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BE5AA891-FB94-4592-9B6B-796F8EA35A30}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BE5AA891-FB94-4592-9B6B-796F8EA35A30}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BE5AA891-FB94-4592-9B6B-796F8EA35A30}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {50A7F582-5B1C-42FA-B85E-488D6EC877A3} + EndGlobalSection +EndGlobal diff --git a/src/Tizen.Applications.EventManager/Tizen.Applications/ApplicationEventManager.cs b/src/Tizen.Applications.EventManager/Tizen.Applications/ApplicationEventManager.cs new file mode 100755 index 0000000..bef1959 --- /dev/null +++ b/src/Tizen.Applications.EventManager/Tizen.Applications/ApplicationEventManager.cs @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +using System; + +namespace Tizen.Applications.EventManager +{ + /// + /// The EventManager Class provides functions to broadcast user-defined event. + /// + /// + /// + /// + /// 6 + public static class ApplicationEventManager + { + /// + /// Sends the User-Event to receiver applications. + /// + /// The event's name to send. + /// The event's data to send. + /// The format of User-Event's name MUST be "event.{sender's appid}.{user-defined name}", refer to 'The name-format of User-Event' section, + /// If the event_name is invalid, throw InvalidOperationException + /// Thrown in case of an invalid parameter. + /// Thrown in case of any internal error. + /// 6 + public static void Publish(string eventName, Bundle eventData) + { + Interop.AppEvent.ErrorCode err = Interop.AppEvent.EventPublishAppEvent(eventName, eventData.SafeBundleHandle); + if (err != Interop.AppEvent.ErrorCode.None) + { + ErrorFactory.ThrowException(err, "Publish event"); + } + } + + /// + /// Sends the User-Event to trusted receiver-applications. + /// + /// The event's name to send. + /// The event's data to send. + /// Whether the event is trusted or not. + /// The application which has same certification with sender can receive the event. + /// The format of User-Event's name MUST be "event.{sender's appid}.{user-defined name}", refer to 'The name-format of User-Event' section, + /// If the event_name is invalid, throw InvalidOperationException + /// Thrown in case of an invalid parameter. + /// Thrown in case of any internal error. + /// 6 + public static void Publish(string eventName, Bundle eventData, bool isTrusted) + { + if (isTrusted) + { + Interop.AppEvent.ErrorCode err = Interop.AppEvent.EventPublishTrustedAppEvent(eventName, eventData.SafeBundleHandle); + if (err != Interop.AppEvent.ErrorCode.None) + { + ErrorFactory.ThrowException(err, "Publish trusted event"); + } + } + else + { + Publish(eventName, eventData); + } + } + + /// + /// Keeps last User-Event data for receiver applications. + /// + /// The event's name to send. + /// The receiver applications will receive this last event data after adding their new handlers via ApplicationEventReceiver since the sender application called this method. + /// If a sender application sends same event via trusted method and non-trusted method, then a trusted receiver will get latest data regardless of trusted or non-trusted, + /// but non-trusted receiver will get the last data only from non-trusted method. The effect of this API continues during runtime. + /// That means when the sender application process restarts, the sender application needs to call this api again to make the event to keep the last event. + /// Thrown in case of an invalid parameter. + /// Thrown in case of any internal error. + /// 6 + public static void KeepLastEvent(string eventName) + { + Interop.AppEvent.ErrorCode err = Interop.AppEvent.EventKeepLastEventData(eventName); + if (err != Interop.AppEvent.ErrorCode.None) + { + ErrorFactory.ThrowException(err, "Keep last event"); + } + } + } +} diff --git a/src/Tizen.Applications.EventManager/Tizen.Applications/ErrorFactory.cs b/src/Tizen.Applications.EventManager/Tizen.Applications/ErrorFactory.cs new file mode 100755 index 0000000..cfd59b5 --- /dev/null +++ b/src/Tizen.Applications.EventManager/Tizen.Applications/ErrorFactory.cs @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +using System; +using System.Runtime.CompilerServices; + +namespace Tizen.Applications.EventManager +{ + internal static class ErrorFactory + { + private const string LogTag = "Tizen.Applications.EventManager"; + + internal static void ThrowException(Interop.AppEvent.ErrorCode errorCode, string errorMessage = null, + [CallerMemberName] string memberName = "", [CallerFilePath] string filePath = "", [CallerLineNumber] int lineNumber = 0) + { + Log.Error(LogTag, $"{memberName}({lineNumber.ToString()}) : {filePath}"); + + switch (errorCode) + { + case Interop.AppEvent.ErrorCode.None: + return; + case Interop.AppEvent.ErrorCode.OutOfMemory: + case Interop.AppEvent.ErrorCode.IoError: + throw new InvalidOperationException(string.IsNullOrEmpty(errorMessage) ? "error code : " + errorCode.ToString() : + $"{errorMessage} - {errorCode}"); + case Interop.AppEvent.ErrorCode.InvalidParameter: + Log.Error(LogTag, "Invalid parameter : " + errorMessage); + throw new ArgumentException(string.IsNullOrEmpty(errorMessage) ? "Invalid parameter" : "Invalid parameter : " + errorMessage); + case Interop.AppEvent.ErrorCode.PermissionDenied: + Log.Error(LogTag, "Permission denied : " + errorMessage); + throw new UnauthorizedAccessException(string.IsNullOrEmpty(errorMessage) ? "Permission denied" : "Permission denied : " + errorMessage); + case Interop.AppEvent.ErrorCode.TimeOut: + Log.Error(LogTag, "Timeout : " + errorMessage); + throw new TimeoutException(string.IsNullOrEmpty(errorMessage) ? "Timeout" : "Timeout : " + errorMessage); + default: + Log.Error(LogTag, $"Unknown error : {errorMessage} - {errorCode}"); + throw new InvalidOperationException(string.IsNullOrEmpty(errorMessage) ? "Unknown error : " + errorCode.ToString() : + $"Unknown error : {errorMessage} - {errorCode}"); + } + } + } +} diff --git a/src/Tizen.Applications.EventManager/Tizen.Applications/EventManagerEventArgs.cs b/src/Tizen.Applications.EventManager/Tizen.Applications/EventManagerEventArgs.cs new file mode 100755 index 0000000..53cc3a4 --- /dev/null +++ b/src/Tizen.Applications.EventManager/Tizen.Applications/EventManagerEventArgs.cs @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +using System; + +namespace Tizen.Applications.EventManager +{ + /// + /// Arguments for the event raised when the application event is received + /// + /// 6 + public class EventManagerEventArgs : EventArgs + { + private readonly Bundle _eventData; + private readonly string _eventName; + + internal EventManagerEventArgs(string eventName, Bundle eventData) + { + _eventName = eventName; + _eventData = eventData; + } + + /// + /// The Name of the event. + /// + /// 6 + public string Name + { + get + { + return _eventName; + } + } + + /// + /// The event data of the application event. + /// + /// 6 + public Bundle Data + { + get + { + return _eventData; + } + } + } +} \ No newline at end of file diff --git a/src/Tizen.Applications.EventManager/Tizen.Applications/EventReceiver.cs b/src/Tizen.Applications.EventManager/Tizen.Applications/EventReceiver.cs new file mode 100755 index 0000000..cf82817 --- /dev/null +++ b/src/Tizen.Applications.EventManager/Tizen.Applications/EventReceiver.cs @@ -0,0 +1,176 @@ +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +using System; + +namespace Tizen.Applications.EventManager +{ + /// + /// The ApplicationEventReceiver Class provides functions to add event handler. + /// + /// + /// (EarjackStatus.StatusKey)) + /// { + /// string statusValue = (string)aValue; + /// LogUtils.Write(LogUtils.DEBUG, LOG_TAG, "EarjackStatus : " + statusValue); + /// } + /// } + /// } + /// public class EventManagerSample + /// { + /// ... + /// EventReceiver receiver = new EventReceiver("event.org.tizen.example.helloworld.AppEvent"); + /// receiver.Received += OnReceived; + /// } + /// ]]> + /// + /// 6 + public class EventReceiver : IDisposable + { + private bool disposedValue = false; + private string _eventName; + private IntPtr _eventHandle; + + private EventHandler eventHandler; + private Interop.AppEvent.EventCallback callback; + + /// + /// Initializer of class. + /// + /// The interested event name. + /// 6 + public EventReceiver(string eventName) + { + _eventName = eventName; + } + + /// + /// Finalizer of class. + /// + /// 6 + ~EventReceiver() + { + Dispose(false); + } + + /// + /// Gets the eventname. + /// + /// 6 + public string EventName + { + get + { + return _eventName; + } + } + + private void OnEvent(string eventName, IntPtr eventData, IntPtr userData) + { + SafeBundleHandle sbh = new SafeBundleHandle(eventData, false); + eventHandler?.Invoke(null, new EventManagerEventArgs(eventName, new Bundle(sbh))); + } + + /// + /// Occurs when events are received. + /// + /// If you want to add the privileged event, you MUST declare right privilege first. + /// Unless that, throw UnauthorizedAccessException. + /// The privileged events are commented on remarks of it's definitions. + /// 6 + public event EventHandler Received + { + add + { + if (eventHandler == null) + { + if (callback == null) + { + callback = new Interop.AppEvent.EventCallback(OnEvent); + } + + Interop.AppEvent.ErrorCode err = Interop.AppEvent.EventAddHandler(_eventName, callback, IntPtr.Zero, out _eventHandle); + + if (err != Interop.AppEvent.ErrorCode.None) + { + ErrorFactory.ThrowException(err, "Add event handler"); + } + } + + eventHandler += value; + } + + remove + { + eventHandler -= value; + if (eventHandler == null) + { + Interop.AppEvent.ErrorCode err = Interop.AppEvent.EventRemoveHandler(_eventHandle); + + if (err != Interop.AppEvent.ErrorCode.None) + { + ErrorFactory.ThrowException(err, "Remove event handler"); + } + + callback = null; + } + } + } + + /// + /// Releases any unmanaged resources used by this object. Can also dispose any other disposable objects. + /// + /// If true, disposes any disposable objects. If false, does not dispose disposable objects. + /// 6 + protected virtual void Dispose(bool disposing) + { + if (!disposedValue) + { + if (disposing) + { + } + + if (eventHandler != null) + { + Interop.AppEvent.ErrorCode err = Interop.AppEvent.EventRemoveHandler(_eventHandle); + } + + disposedValue = true; + } + } + + /// + /// Release all the resources used by the class. + /// + /// 5 + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + } +} diff --git a/src/Tizen.Applications.EventManager/Tizen.Applications/SystemEvents.cs b/src/Tizen.Applications.EventManager/Tizen.Applications/SystemEvents.cs new file mode 100755 index 0000000..b87bbfd --- /dev/null +++ b/src/Tizen.Applications.EventManager/Tizen.Applications/SystemEvents.cs @@ -0,0 +1,1242 @@ +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +namespace Tizen.Applications.EventManager.SystemEvents +{ + /// + /// Class for system-event of battery charger status + /// + /// 6 + public static class BatteryChargerStatus + { + /// + /// Eventname for system-event of battery charger status + /// + /// 6 + public static string EventName + { + get { return "tizen.system.event.battery_charger_status"; } + } + + /// + /// Key for system-event of battery charger status + /// + /// 6 + public static string StatusKey + { + get { return "battery_charger_status"; } + } + + /// + /// Value of connected battery charger + /// + /// 6 + public static string StatusValueConnected + { + get { return "connected"; } + } + + /// + /// Value of disconnected battery charger + /// + /// 6 + public static string StatusValueDisconnected + { + get { return "disconnected"; } + } + + /// + /// Value of charing battery charger + /// + /// 6 + public static string StatusValueCharging + { + get { return "charging"; } + } + + /// + /// Value of discharging battery charger + /// + /// 6 + public static string StatusValueDischarging + { + get { return "discharging"; } + } + } + + /// + /// Class for system-event of battery level status + /// + /// 6 + public static class BatteryLevelStatus + { + /// + /// Eventname for system-event of battery level status + /// + /// 6 + public static string EventName + { + get { return "tizen.system.event.battery_level_status"; } + } + + /// + /// Key for system-event of battery level status + /// + /// 6 + public static string StatusKey + { + get { return "battery_level_status"; } + } + + /// + /// Value of empty battery level status + /// + /// 6 + public static string StatusValueEmpty + { + get { return "empty"; } + } + + /// + /// Value of critical battery level status + /// + /// 6 + public static string StatusValueCritical + { + get { return "critical"; } + } + + /// + /// Value of low battery level status + /// + /// 6 + public static string StatusValueLow + { + get { return "low"; } + } + + /// + /// Value of high battery level status + /// + /// 6 + public static string StatusValueHigh + { + get { return "high"; } + } + + /// + /// Value of full battery level status + /// + /// 6 + public static string StatusValueFull + { + get { return "full"; } + } + } + + /// + /// Class for system-event of usb status + /// + /// 6 + public static class UsbStatus + { + /// + /// Eventname for system-event of usb status + /// + /// 6 + public static string EventName + { + get { return "tizen.system.event.usb_status"; } + } + + /// + /// Key for system-event of usb status + /// + /// 6 + public static string StatusKey + { + get { return "usb_status"; } + } + + /// + /// Value of disconnected usb status + /// + /// 6 + public static string StatusValueDisconnected + { + get { return "disconnected"; } + } + + /// + /// Value of connected usb status + /// + /// 6 + public static string StatusValueConnected + { + get { return "connected"; } + } + + /// + /// Value of available usb status + /// + /// 6 + public static string StatusValueAvailable + { + get { return "available"; } + } + } + + /// + /// Class for system-event of earjack status + /// + /// 6 + public static class EarjackStatus + { + /// + /// Eventname for system-event of earjack status + /// + /// 6 + public static string EventName + { + get { return "tizen.system.event.earjack_status"; } + } + + /// + /// Key for system-event of earjack status + /// + /// 6 + public static string StatusKey + { + get { return "earjack_status"; } + } + + /// + /// Value of disconnected earjack status + /// + /// 6 + public static string StatusValueDisconnected + { + get { return "disconnected"; } + } + + /// + /// Value of connected earjack status + /// + /// 6 + public static string StatusValueConnected + { + get { return "connected"; } + } + } + + /// + /// Class for system-event of display state + /// + /// http://tizen.org/privilege/display + /// If you want to receive this event, you must declare this privilege. + /// 6 + public static class DisplayState + { + /// + /// Eventname for system-event of display state + /// + /// 6 + public static string EventName + { + get { return "tizen.system.event.display_state"; } + } + + /// + /// Key for system-event of display state + /// + /// 6 + public static string StateKey + { + get { return "display_state"; } + } + + /// + /// Value of normal display state + /// + /// 6 + public static string StateValueNormal + { + get { return "normal"; } + } + + /// + /// Value of dim display state + /// + /// 6 + public static string StateValueDim + { + get { return "dim"; } + } + + /// + /// Value of off display state + /// + /// 6 + public static string StateValueOff + { + get { return "off"; } + } + } + + /// + /// Class for system-event of boot completed + /// + /// 6 + public static class BootCompleted + { + /// + /// Eventname for system-event of boot completed + /// + /// 6 + public static string EventName + { + get { return "tizen.system.event.boot_completed"; } + } + } + + /// + /// Class for system-event of system shutdown + /// + /// 6 + public static class SystemShutdown + { + /// + /// Eventname for system-event of system shutdown + /// + /// 6 + public static string EventName + { + get { return "tizen.system.event.system_shutdown"; } + } + } + + /// + /// Class for system-event of low memory + /// + /// 6 + public static class LowMemory + { + /// + /// Eventname for system-event of low memory + /// + /// 6 + public static string EventName + { + get { return "tizen.system.event.low_memory"; } + } + + /// + /// Key for system-event of low memory + /// + /// 6 + public static string Key + { + get { return "low_memory"; } + } + + /// + /// Value of normal low memory + /// + /// 6 + public static string ValueNormal + { + get { return "normal"; } + } + + /// + /// Value of soft warning low memory + /// + /// 6 + public static string ValueSoftWarning + { + get { return "soft_warning"; } + } + + /// + /// Value of hard warning low memory + /// + /// 6 + public static string ValueHardWarning + { + get { return "hard_warning"; } + } + } + + /// + /// Class for system-event of wifi state + /// + /// http://tizen.org/privilege/network.get + /// If you want to receive this event, you must declare this privilege. + /// 6 + public static class WifiState + { + /// + /// Eventname for system-event of wifi state + /// + /// 6 + public static string EventName + { + get { return "tizen.system.event.wifi_state"; } + } + + /// + /// Key for system-event of wifi state + /// + /// 6 + public static string StateKey + { + get { return "wifi_state"; } + } + + /// + /// Value of off wifi state + /// + /// 6 + public static string StateValueOff + { + get { return "off"; } + } + + /// + /// Value of on wifi state + /// + /// 6 + public static string StateValueOn + { + get { return "on"; } + } + + /// + /// Value of connected wifi state + /// + /// 6 + public static string StateValueConnected + { + get { return "connected"; } + } + } + + /// + /// Class for system-event of bluetooth state + /// + /// 6 + public static class Btstate + { + /// + /// Eventname for system-event of bluetooth state + /// + /// 6 + public static string EventName + { + get { return "tizen.system.event.bt_state"; } + } + + /// + /// Key for system-event of bluetooth state + /// + /// 6 + public static string StateKey + { + get { return "bt_state"; } + } + + /// + /// Value of off bluetooth state + /// + /// 6 + public static string StateValueOff + { + get { return "off"; } + } + + /// + /// Value of on bluetooth state + /// + /// 6 + public static string StateValueOn + { + get { return "on"; } + } + + /// + /// Key for system-event of low energy bluetooth state + /// + /// 6 + public static string LeStateKey + { + get { return "bt_le_state"; } + } + + /// + /// Value of off low energy bluetooth state + /// + /// 6 + public static string LeStateValueOff + { + get { return "off"; } + } + + /// + /// Value of on low energy bluetooth state + /// + /// 6 + public static string LeStateValueOn + { + get { return "on"; } + } + + /// + /// Key for system-event of transfering bluetooth state + /// + /// 6 + public static string TransferStateKey + { + get { return "bt_transfering_state"; } + } + + /// + /// Value of non transfering bluetooth state + /// + /// 6 + public static string TransferStateValueNontransfering + { + get { return "non_transfering"; } + } + + /// + /// Value of transfering bluetooth state + /// + /// 6 + public static string TransferStateValueTransfering + { + get { return "transfering"; } + } + } + + /// + /// Class for system-event of location enable state + /// + /// 6 + public static class LocatingEnableState + { + /// + /// Eventname for system-event of location enable state + /// + /// 6 + public static string EventName + { + get { return "tizen.system.event.location_enable_state"; } + } + + /// + /// Key for system-event of location enable state + /// + /// 6 + public static string StateKey + { + get { return "location_enable_state"; } + } + + /// + /// Value of disabled location enable state + /// + /// 6 + public static string StateValueDisabled + { + get { return "disabled"; } + } + + /// + /// Value of enabled location enable state + /// + /// 6 + public static string StateValueEnabled + { + get { return "enabled"; } + } + } + + /// + /// Class for system-event of gps enable state + /// + /// 6 + public static class GpsEnableState + { + /// + /// Eventname for system-event of gps enable state + /// + /// 6 + public static string EventName + { + get { return "tizen.system.event.gps_enable_state"; } + } + + /// + /// Key for system-event of gps enable state + /// + /// 6 + public static string StateKey + { + get { return "gps_enable_state"; } + } + + /// + /// Value of disabled gps enable state + /// + /// 6 + public static string StateValueDisabled + { + get { return "disabled"; } + } + + /// + /// Value of enabled gps enable state + /// + /// 6 + public static string StateValueEnabled + { + get { return "enabled"; } + } + } + + /// + /// Class for system-event of nps enable state + /// + /// 6 + public static class NpsEnableState + { + /// + /// Eventname for system-event of nps enable state + /// + /// 6 + public static string EventName + { + get { return "tizen.system.event.nps_enable_state"; } + } + + /// + /// Key for system-event of nps enable state + /// + /// 6 + public static string StateKey + { + get { return "nps_enable_state"; } + } + + /// + /// Value of diabled nps enable state + /// + /// 6 + public static string StateValueDisabled + { + get { return "disabled"; } + } + + /// + /// Value of enabled nps enable state + /// + /// 6 + public static string StateValueEnabled + { + get { return "enabled"; } + } + } + + /// + /// Class for system-event of incoming message + /// + /// http://tizen.org/privilege/message.read + /// If you want to receive this event, you must declare this privilege. + /// 6 + public static class IncomingMsg + { + /// + /// Event for system-event of incoming message + /// + /// 6 + public static string EventName + { + get { return "tizen.system.event.incoming_msg"; } + } + + /// + /// Key for system-event of incoming message type + /// + /// 6 + public static string TypeKey + { + get { return "msg_type"; } + } + + /// + /// Value of sms incoming message type + /// + /// 6 + public static string TypeValueSms + { + get { return "sms"; } + } + + /// + /// Value of mms incoming message type + /// + /// 6 + public static string TypeValueMms + { + get { return "mms"; } + } + + /// + /// Value of push incoming message type + /// + /// 6 + public static string TypeValuePush + { + get { return "push"; } + } + + /// + /// Value of cb incoming message type + /// + /// 6 + public static string TypeValueCb + { + get { return "cb"; } + } + + /// + /// Key for system-event of incoming message id + /// + /// 6 + public static string IdKey + { + get { return "msg_id"; } + } + } + + /// + /// Class for system-event of outgoing message + /// + /// http://tizen.org/privilege/message.read + /// If you want to receive this event, you must declare this privilege. + /// 6 + public static class OutgoingMsg + { + /// + /// Eventname for system-event of outgoing message + /// + /// 6 + public static string EventName + { + get { return "tizen.system.event.outgoing_msg"; } + } + + /// + /// Key for system-event of outgoing message type + /// + /// 6 + public static string TypeKey + { + get { return "msg_type"; } + } + + /// + /// Value of sms outgoing message type + /// + /// 6 + public static string TypeValueSms + { + get { return "sms"; } + } + + /// + /// Value of mms outgoing message type + /// + /// 6 + public static string TypeValueMms + { + get { return "mms"; } + } + + /// + /// Key for system-event of outgoing message id + /// + /// 6 + public static string IdKey + { + get { return "msg_id"; } + } + } + + /// + /// Class for system-event of time changed + /// + /// 6 + public static class TimeChanged + { + /// + /// Eventname for system-event of time changed + /// + /// 6 + public static string EventName + { + get { return "tizen.system.event.time_changed"; } + } + } + + /// + /// Class for system-event of time zone + /// + /// 6 + public static class TimeZone + { + /// + /// Eventname for system-event of time zone + /// + /// 6 + public static string EventName + { + get { return "tizen.system.event.time_zone"; } + } + + /// + /// Key for system-event of time zone + /// + /// 6 + public static string Key + { + get { return "time_zone"; } + } + } + + /// + /// Class for system-event of hour format + /// + /// 6 + public static class HourFormat + { + /// + /// Eventname for system-event of hour format + /// + /// 6 + public static string EventName + { + get { return "tizen.system.event.hour_format"; } + } + + /// + /// Key for system-event of hour format + /// + /// 6 + public static string Key + { + get { return "hour_format"; } + } + + /// + /// Value of 12 hour format + /// + /// 6 + public static string Value12 + { + get { return "12"; } + } + + /// + /// Value of 24 hour format + /// + /// 6 + public static string Value24 + { + get { return "24"; } + } + } + + /// + /// Class for system-event of language set + /// + /// 6 + public static class LanguageSet + { + /// + /// Eventname for system-event of language set + /// + /// 6 + public static string EventName + { + get { return "tizen.system.event.language_set"; } + } + + /// + /// Key for system-event of language set + /// + /// 6 + public static string Key + { + get { return "language_set"; } + } + } + + /// + /// Class for system-event of region format + /// + /// 6 + public static class RegionFormat + { + /// + /// Eventname for system-event of region format + /// + /// 6 + public static string EventName + { + get { return "tizen.system.event.region_format"; } + } + + /// + /// Key for system-event of region format + /// + /// 6 + public static string Key + { + get { return "region_format"; } + } + } + + /// + /// Class for system-event of silent mode + /// + /// 6 + public static class SilentMode + { + /// + /// Event for system-event of silent mode + /// + /// 6 + public static string EventName + { + get { return "tizen.system.event.silent_mode"; } + } + + /// + /// Key for system-event of silent mode + /// + /// 6 + public static string Key + { + get { return "silent_mode"; } + } + + /// + /// Value of silent mode on + /// + /// 6 + public static string ValueOn + { + get { return "on"; } + } + + /// + /// Value of silent mode off + /// + /// 6 + public static string ValueOff + { + get { return "off"; } + } + } + + /// + /// Class for system-event of vibration state + /// + /// 6 + public static class VibrationState + { + /// + /// Eventname for system-event of vibration state + /// + /// 6 + public static string EventName + { + get { return "tizen.system.event.vibration_state"; } + } + + /// + /// Key for system-event of vibration state + /// + /// 6 + public static string StateKey + { + get { return "vibration_state"; } + } + + /// + /// Value vibration state on + /// + /// 6 + public static string StateValueOn + { + get { return "on"; } + } + + /// + /// Value vibration state off + /// + /// 6 + public static string StateValueOff + { + get { return "off"; } + } + } + + /// + /// Class for system-event of auto rotate state + /// + /// 6 + public static class AutoRotateState + { + /// + /// Eventname for system-event of auto rotate state + /// + /// 6 + public static string EventName + { + get { return "tizen.system.event.autorotate_state"; } + } + + /// + /// Key for system-event of auto rotate state + /// + /// 6 + public static string StateKey + { + get { return "autorotate_state"; } + } + + /// + /// Value of auto rotate state on + /// + /// 6 + public static string StateOn + { + get { return "on"; } + } + + /// + /// Value of auto rotate state off + /// + /// 6 + public static string StateOff + { + get { return "off"; } + } + } + + /// + /// Class for system-event of mobile data state + /// + /// 6 + public static class MobileDataState + { + /// + /// Eventname for system-event of mobile data state + /// + /// 6 + public static string EventName + { + get { return "tizen.system.event.mobile_data_state"; } + } + + /// + /// Key for system-event of mobile data state + /// + /// 6 + public static string StateKey + { + get { return "mobile_data_state"; } + } + + /// + /// Value of mobile data state on + /// + /// 6 + public static string StateValueOn + { + get { return "on"; } + } + + /// + /// Value of mobile data state off + /// + /// 6 + public static string StateValueOff + { + get { return "off"; } + } + } + + /// + /// Class for system-event of data roaming state + /// + /// 6 + public static class DataRoamingState + { + /// + /// Eventname for system-event of data roaming state + /// + /// 6 + public static string EventName + { + get { return "tizen.system.event.data_roaming_state"; } + } + + /// + /// Key for system-event of data roaming state + /// + /// 6 + public static string StateKey + { + get { return "data_roaming_state"; } + } + + /// + /// Value of data roaming state on + /// + /// 6 + public static string StateValueOn + { + get { return "on"; } + } + + /// + /// Value of data roaming state off + /// + /// 6 + public static string StateValueOff + { + get { return "off"; } + } + } + + /// + /// Class for system-event of data font set + /// + /// 6 + public static class FontSet + { + /// + /// Eventname for system-event of data font set + /// + /// 6 + public static string EventName + { + get { return "tizen.system.event.font_set"; } + } + + /// + /// Key for system-event of data font set + /// + /// 6 + public static string Key + { + get { return "font_set"; } + } + } + + /// + /// Class for system-event of network status + /// + /// 6 + public static class NetworkStatus + { + /// + /// Eventname for system-event of network status + /// + /// 6 + public static string EventName + { + get { return "tizen.system.event.network_status"; } + } + + /// + /// Key for system-event of network status + /// + /// 6 + public static string StatusKey + { + get { return "network_status"; } + } + + /// + /// Value of disconnected network status + /// + /// 6 + public static string StatusValueDisconnected + { + get { return "disconnected"; } + } + + /// + /// Value of wifi network status + /// + /// 6 + public static string StatusValueWifi + { + get { return "wifi"; } + } + + /// + /// Value of cellular network status + /// + /// 6 + public static string StatusValueCellular + { + get { return "cellular"; } + } + + /// + /// Value of ethernet network status + /// + /// 6 + public static string StatusValueEthernet + { + get { return "ethernet"; } + } + + /// + /// Value of bt network status + /// + /// 6 + public static string StatusValueBt + { + get { return "bt"; } + } + + /// + /// Value of net proxy network status + /// + /// 6 + public static string StatusValueNetProxy + { + get { return "net_proxy"; } + } + } +}