[DllImport(Libraries.Location, EntryPoint = "location_manager_is_enabled_method")]
internal static extern int IsEnabled(int locationMethod, out bool status);
+ [DllImport(Libraries.Location, EntryPoint = "location_manager_enable_method")]
+ internal static extern int EnableType(int locationMethod, bool status);
+
[DllImport(Libraries.Location, EntryPoint = "location_manager_is_supported_method")]
internal static extern bool IsSupported(int locationMethod);
}
}
/// <summary>
- /// This class contains the functionality for obtaining the geographical infomation and setting the boundary condition.
+ /// This class contains the functionality for obtaining the geographical information and setting the boundary condition.
/// Notifications on events like service becoming enabled or disabled, new position data being available,
/// and others can also be acquired.
/// </summary>
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <param name="locationType"> The back-end positioning method to be used for LBS.</param>
- /// <feature>http://tizen.org/feature/location</feature>
+ /// <feature>http://tizen.org/feature/location.gps</feature>
+ /// <feature>http://tizen.org/feature/location.wps</feature>
/// <exception cref="InvalidOperationException">Thrown when the operation is invalid for the current state.</exception>
/// <exception cref="ArgumentException">Thrown when an invalid argument is used.</exception>
/// <exception cref="NotSupportedException">Thrown when the location is not supported.</exception>
int ret = Interop.Locator.GetLocation(_handle, out altitude, out latitude, out longitude, out climb, out direction, out speed, out level, out accuracy, out vertical, out timestamp);
if (((LocationError)ret != LocationError.None))
{
- Log.Error(Globals.LogTag, "Error in get current location infomation," + (LocationError)ret);
+ Log.Error(Globals.LogTag, "Error in get current location information," + (LocationError)ret);
throw LocationErrorFactory.ThrowLocationException(ret);
}
}
namespace Tizen.Location
{
+ /// <summary>
+ /// This class contains the functionality for obtaining the geographical positioning type.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
public static class LocatorHelper
{
/// <summary>
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <param name="locationType">The back-end positioning method to be used for LBS.</param>
+ /// <feature>http://tizen.org/feature/location.gps</feature>
+ /// <feature>http://tizen.org/feature/location.wps</feature>
/// <returns>Returns a boolean value indicating whether or not the specified method is supported.</returns>
+ /// <exception cref="ArgumentException">Thrown when an invalid argument is used.</exception>
+ /// <exception cref="NotSupportedException">Thrown when the location is not supported.</exception>
public static bool IsSupportedType(LocationType locationType)
{
bool status = Interop.LocatorHelper.IsSupported((int)locationType);
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <param name="locationType">The back-end positioning method to be used for LBS.</param>
+ /// <feature>http://tizen.org/feature/location.gps</feature>
+ /// <feature>http://tizen.org/feature/location.wps</feature>
/// <returns>Returns a boolean value indicating whether or not the specified method is supported.</returns>
/// <exception cref="InvalidOperationException">Thrown when the operation is invalid for the current state.</exception>
/// <exception cref="ArgumentException">Thrown when an invalid argument is used.</exception>
}
return status;
}
+
+ /// <summary>
+ /// Sets the specified geographical positioning type.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ /// <privilege>http://tizen.org/privilege/location.enable</privilege>
+ /// <privlevel>platform</privlevel>
+ /// <param name="locationType">The back-end positioning method to be used for LBS.</param>
+ /// <param name="status">The location setting value.</param>
+ /// <feature>http://tizen.org/feature/location.gps</feature>
+ /// <feature>http://tizen.org/feature/location.wps</feature>
+ /// <exception cref="InvalidOperationException">Thrown when the operation is invalid for the current state.</exception>
+ /// <exception cref="ArgumentException">Thrown when an invalid argument is used.</exception>
+ /// <exception cref="NotSupportedException">Thrown when the location is not supported.</exception>
+ public static void EnableType(LocationType locationType, bool status)
+ {
+ Log.Info(Globals.LogTag, "Sets the location setting status");
+ int ret = Interop.LocatorHelper.EnableType((int)locationType, status);
+ if (((LocationError)ret != LocationError.None))
+ {
+ Log.Error(Globals.LogTag, "Error Sets the Location type," + (LocationError)ret);
+ throw LocationErrorFactory.ThrowLocationException(ret);
+ }
+ }
}
}
/// The class constructor for the ServiceStateChangedEventArgs class.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <param name="state"> An enumeration of type LocationServiceState.</param>
+ /// <param name="state">An enumeration of type LocationServiceState.</param>
public ServiceStateChangedEventArgs(ServiceState state)
{
ServiceState = state;
/// <param name="state"> An enumeration of type BoundaryState.</param>
/// <param name="latitude">The latitude value [-90.0 ~ 90.0] (degrees).</param>
/// <param name="longitude">The longitude value [-180.0 ~ 180.0] (degrees).</param>
- /// <param name="altitude"> The altitude value.</param>
- /// <param name="timestamp"> The timestamp value.</param>
+ /// <param name="altitude">The altitude value.</param>
+ /// <param name="timestamp">The timestamp value.</param>
public ZoneChangedEventArgs(BoundaryState state, double latitude, double longitude, double altitude, DateTime timestamp)
{
BoundState = state;