8483f1d909003322c7338f1fffb19413223c872e
[platform/core/csapi/tizenfx.git] / src / Tizen.Location / Tizen.Location / LocatorHelper.cs
1 // Copyright 2016 by Samsung Electronics, Inc.,
2 //
3 // This software is the confidential and proprietary information
4 // of Samsung Electronics, Inc. ("Confidential Information"). You
5 // shall not disclose such Confidential Information and shall use
6 // it only in accordance with the terms of the license agreement
7 // you entered into with Samsung.
8
9 using System;
10
11 namespace Tizen.Location
12 {
13     public static class LocatorHelper
14     {
15         /// <summary>
16         /// Checks if the specified geographical positioning type is supported or not.
17         /// </summary>
18         /// <param name="locationType"> The back-end positioning method to be used for LBS.</param>
19         /// <returns>Returns a boolean value indicating whether or not the specified method is supported.</returns>
20         public static bool IsSupportedType(LocationType locationType)
21         {
22             bool initStatus = Interop.LocatorHelper.IsSupported((int)locationType);
23             Log.Info(Globals.LogTag, "Checking if the Location Manager type is supported ," + initStatus);
24             return initStatus;
25         }
26
27         /// <summary>
28         /// Checks if the specified geographical positioning type is enabled or not.
29         /// </summary>
30         /// <param name="locationType"> The back-end positioning method to be used for LBS.</param>
31         /// <returns>Returns a boolean value indicating whether or not the specified method is supported.</returns>
32         public static bool IsEnabledType(LocationType locationType)
33         {
34             Log.Info(Globals.LogTag, "Checking if the Location Manager type is Enabled");
35             bool initStatus;
36             int ret = Interop.LocatorHelper.IsEnabled((int)locationType, out initStatus);
37             if (((LocationError)ret != LocationError.None))\r
38             {\r
39                 Log.Error(Globals.LogTag, "Error Checking the Location Manager type is Enabled," + (LocationError)ret);\r
40                 LocationErrorFactory.ThrowLocationException(ret);\r
41             }
42             return initStatus;
43         }
44     }
45 }