2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 namespace Tizen.Applications.CoreBackend
19 /// This class represents the type of event for backends. This class can be converted from the string type.
21 /// <since_tizen> 3 </since_tizen>
22 public class EventType
25 /// Pre-defined event type "PreCreated".
27 /// <since_tizen> 3 </since_tizen>
28 public static readonly EventType PreCreated = "PreCreated";
31 /// Pre-defined event type "Created".
33 /// <since_tizen> 3 </since_tizen>
34 public static readonly EventType Created = "Created";
37 /// Pre-defined event type "Terminated".
39 /// <since_tizen> 3 </since_tizen>
40 public static readonly EventType Terminated = "Terminated";
43 /// Pre-defined event type "AppControlReceived".
45 /// <since_tizen> 3 </since_tizen>
46 public static readonly EventType AppControlReceived = "AppControlReceived";
49 /// Pre-defined event type "Resumed".
51 /// <since_tizen> 3 </since_tizen>
52 public static readonly EventType Resumed = "Resumed";
55 /// Pre-defined event type "Paused".
57 /// <since_tizen> 3 </since_tizen>
58 public static readonly EventType Paused = "Paused";
61 /// Pre-defined event type "LowMemory".
63 /// <since_tizen> 3 </since_tizen>
64 public static readonly EventType LowMemory = "LowMemory";
67 /// Pre-defined event type "LowBattery".
69 /// <since_tizen> 3 </since_tizen>
70 public static readonly EventType LowBattery = "LowBattery";
73 /// Pre-defined event type "LocaleChanged".
75 /// <since_tizen> 3 </since_tizen>
76 public static readonly EventType LocaleChanged = "LocaleChanged";
79 /// Pre-defined event type "RegionFormatChanged".
81 /// <since_tizen> 3 </since_tizen>
82 public static readonly EventType RegionFormatChanged = "RegionFormatChanged";
85 /// Pre-defined event type "DeviceOrientationChanged".
87 /// <since_tizen> 3 </since_tizen>
88 public static readonly EventType DeviceOrientationChanged = "DeviceOrientationChanged";
90 private string _typeName;
93 /// Initializes the EventType class.
95 /// <param name="name">The name of event type.</param>
96 /// <since_tizen> 3 </since_tizen>
97 public EventType(string name)
103 /// Returns the name of event type.
105 /// <since_tizen> 3 </since_tizen>
106 public override string ToString()
112 /// Returns the hash code for event type string.
114 /// <since_tizen> 3 </since_tizen>
115 public override int GetHashCode()
117 if (_typeName == null) return 0;
118 return _typeName.GetHashCode();
122 /// Determines whether this instance and a specified object.
124 /// <since_tizen> 3 </since_tizen>
125 public override bool Equals(object obj)
127 EventType other = obj as EventType;
128 return other != null && other._typeName == this._typeName;
132 /// Converts a string to EventType instance.
134 /// <since_tizen> 3 </since_tizen>
135 public static implicit operator EventType(string value)
137 return new EventType(value);