Release 4.0.0-preview1-00051
[platform/core/csapi/tizenfx.git] / src / Tizen.System.Information / Interop / Interop.SystemInfo.cs
1 /*
2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
3 *
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
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
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.
15 */
16
17 using System;
18 using System.Runtime.InteropServices;
19
20 internal static partial class Interop
21 {
22     internal static partial class SystemInfo
23     {
24         internal enum ErrorCode
25         {
26             None = Tizen.Internals.Errors.ErrorCode.None,
27             InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter,
28             OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory,
29             IoError = Tizen.Internals.Errors.ErrorCode.IoError,
30             PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied,
31             NotSupported = Tizen.Internals.Errors.ErrorCode.NoSuchDevice,
32         }
33
34         internal enum SystemInfoValueType
35         {
36             Bool = 0,
37             Int = 1,
38             Double = 2,
39             String = 3,
40         }
41
42         internal enum SystemInfoType
43         {
44             platform,
45             Custom,
46             None,
47         }
48
49         [DllImport(Libraries.SystemInfo, EntryPoint = "system_info_get_platform_type")]
50         internal static extern ErrorCode SystemInfoGetPlatformType(string key, out SystemInfoValueType type);
51
52         [DllImport(Libraries.SystemInfo, EntryPoint = "system_info_get_custom_type")]
53         internal static extern ErrorCode SystemInfoGetCustomType(string key, out SystemInfoValueType type);
54
55         [DllImport(Libraries.SystemInfo, EntryPoint = "system_info_get_platform_bool")]
56         internal static extern ErrorCode SystemInfoGetPlatformBool(string key, out bool value);
57
58         [DllImport(Libraries.SystemInfo, EntryPoint = "system_info_get_platform_int")]
59         internal static extern ErrorCode SystemInfoGetPlatformInt(string key, out int value);
60
61         [DllImport(Libraries.SystemInfo, EntryPoint = "system_info_get_platform_double")]
62         internal static extern ErrorCode SystemInfoGetPlatformDouble(string key, out double value);
63
64         [DllImport(Libraries.SystemInfo, EntryPoint = "system_info_get_platform_string")]
65         internal static extern ErrorCode SystemInfoGetPlatformString(string key, out string value);
66
67         [DllImport(Libraries.SystemInfo, EntryPoint = "system_info_get_custom_bool")]
68         internal static extern ErrorCode SystemInfoGetCustomBool(string key, out bool value);
69
70         [DllImport(Libraries.SystemInfo, EntryPoint = "system_info_get_custom_int")]
71         internal static extern ErrorCode SystemInfoGetCustomInt(string key, out int value);
72
73         [DllImport(Libraries.SystemInfo, EntryPoint = "system_info_get_custom_double")]
74         internal static extern ErrorCode SystemInfoGetCustomDouble(string key, out double value);
75
76         [DllImport(Libraries.SystemInfo, EntryPoint = "system_info_get_custom_string")]
77         internal static extern ErrorCode SystemInfoGetCustomString(string key, out string value);
78     }
79 }