Release 4.0.0-preview1-00051
[platform/core/csapi/tizenfx.git] / src / Tizen.Applications.Common / Interop / Interop.AppCommon.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 using Tizen.Internals.Errors;
21 using Tizen.Applications;
22
23 internal static partial class Interop
24 {
25     internal static partial class AppCommon
26     {
27         internal enum ResourceCategory : int
28         {
29             Image = 0,
30             Layout,
31             Sound,
32             Binary
33         }
34
35         [DllImport(Libraries.AppCommon, EntryPoint = "app_get_id")]
36         internal static extern ErrorCode AppGetId(out string appId);
37
38         [DllImport(Libraries.AppCommon, EntryPoint = "app_get_name")]
39         internal static extern ErrorCode AppGetName(out string name);
40
41         [DllImport(Libraries.AppCommon, EntryPoint = "app_get_resource_path")]
42         internal static extern string AppGetResourcePath();
43
44         [DllImport(Libraries.AppCommon, EntryPoint = "app_get_data_path")]
45         internal static extern string AppGetDataPath();
46
47         [DllImport(Libraries.AppCommon, EntryPoint = "app_get_cache_path")]
48         internal static extern string AppGetCachePath();
49
50         [DllImport(Libraries.AppCommon, EntryPoint = "app_get_shared_data_path")]
51         internal static extern string AppGetSharedDataPath();
52
53         [DllImport(Libraries.AppCommon, EntryPoint = "app_get_shared_resource_path")]
54         internal static extern string AppGetSharedResourcePath();
55
56         [DllImport(Libraries.AppCommon, EntryPoint = "app_get_shared_trusted_path")]
57         internal static extern string AppGetSharedTrustedPath();
58
59         [DllImport(Libraries.AppCommon, EntryPoint = "app_get_tep_resource_path")]
60         internal static extern string AppGetTepResourcePath();
61
62         [DllImport(Libraries.AppCommon, EntryPoint = "app_get_external_cache_path")]
63         internal static extern string AppGetExternalCachePath();
64
65         [DllImport(Libraries.AppCommon, EntryPoint = "app_get_external_data_path")]
66         internal static extern string AppGetExternalDataPath();
67
68         [DllImport(Libraries.AppCommon, EntryPoint = "app_get_external_shared_data_path")]
69         internal static extern string AppGetExternalSharedDataPath();
70
71         [DllImport(Libraries.AppCommon, EntryPoint = "app_get_version")]
72         internal static extern ErrorCode AppGetVersion(out string version);
73
74         [DllImport(Libraries.AppCommon, EntryPoint = "app_event_get_low_memory_status")]
75         internal static extern ErrorCode AppEventGetLowMemoryStatus(IntPtr handle, out LowMemoryStatus status);
76
77         [DllImport(Libraries.AppCommon, EntryPoint = "app_event_get_low_battery_status")]
78         internal static extern ErrorCode AppEventGetLowBatteryStatus(IntPtr handle, out LowBatteryStatus status);
79
80         [DllImport(Libraries.AppCommon, EntryPoint = "app_event_get_language")]
81         internal static extern ErrorCode AppEventGetLanguage(IntPtr handle, out string lang);
82
83         [DllImport(Libraries.AppCommon, EntryPoint = "app_event_get_region_format")]
84         internal static extern ErrorCode AppEventGetRegionFormat(IntPtr handle, out string region);
85
86         [DllImport(Libraries.AppCommon, EntryPoint = "app_resource_manager_get")]
87         internal static extern ErrorCode AppResourceManagerGet(ResourceCategory category, string id, out string path);
88
89         [DllImport(Libraries.Application, EntryPoint = "app_resource_manager_get")]
90         internal static extern ErrorCode LegacyAppResourceManagerGet(ResourceCategory category, string id, out string path);
91
92         [DllImport(Libraries.AppCommon, EntryPoint = "app_event_get_device_orientation")]
93         internal static extern ErrorCode AppEventGetDeviceOrientation(IntPtr handle, out DeviceOrientation orientation);
94     }
95 }
96