/*
* Copyright (c) 2016 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.CoreBackend
{
///
/// Class that represents the type of event for backends. This class can be converted from string type.
///
public class EventType
{
///
/// Pre-defined event type. "PreCreated"
///
public static readonly EventType PreCreated = "PreCreated";
///
/// Pre-defined event type. "Created"
///
public static readonly EventType Created = "Created";
///
/// Pre-defined event type. "Terminated"
///
public static readonly EventType Terminated = "Terminated";
///
/// Pre-defined event type. "AppControlReceived"
///
public static readonly EventType AppControlReceived = "AppControlReceived";
///
/// Pre-defined event type. "Resumed"
///
public static readonly EventType Resumed = "Resumed";
///
/// Pre-defined event type. "Paused"
///
public static readonly EventType Paused = "Paused";
///
/// Pre-defined event type. "LowMemory"
///
public static readonly EventType LowMemory = "LowMemory";
///
/// Pre-defined event type. "LowBattery"
///
public static readonly EventType LowBattery = "LowBattery";
///
/// Pre-defined event type. "LocaleChanged"
///
public static readonly EventType LocaleChanged = "LocaleChanged";
///
/// Pre-defined event type. "RegionFormatChanged"
///
public static readonly EventType RegionFormatChanged = "RegionFormatChanged";
///
/// Pre-defined event type. "DeviceOrientationChanged"
///
public static readonly EventType DeviceOrientationChanged = "DeviceOrientationChanged";
private string _typeName;
///
/// Initializes the EventType class.
///
/// The name of event type.
public EventType(string name)
{
_typeName = name;
}
///
/// Returns the name of event type.
///
public override string ToString()
{
return _typeName;
}
///
/// Returns the hash code for event type string.
///
public override int GetHashCode()
{
if (_typeName == null) return 0;
return _typeName.GetHashCode();
}
///
/// Determines whether this instance and a specified object.
///
public override bool Equals(object obj)
{
EventType other = obj as EventType;
return other != null && other._typeName == this._typeName;
}
///
/// Converts a string to EventType instance.
///
public static implicit operator EventType(string value)
{
return new EventType(value);
}
}
}