2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 using System.Runtime.InteropServices;
20 using Tizen.Internals.Errors;
21 using Tizen.Applications;
23 internal static partial class Interop
25 internal static partial class AppCommon
27 internal enum ResourceCategory : int
35 internal enum AppCommonErrorCode
37 None = Tizen.Internals.Errors.ErrorCode.None,
38 InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter,
39 OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory,
40 InvalidContext = -0x01100000 | 0x01,
41 NoSuchFile = Tizen.Internals.Errors.ErrorCode.NoSuchFile,
42 PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied,
45 [DllImport(Libraries.AppCommon, EntryPoint = "app_get_id")]
46 internal static extern ErrorCode AppGetId(out string appId);
48 [DllImport(Libraries.AppCommon, EntryPoint = "app_get_name")]
49 internal static extern ErrorCode AppGetName(out string name);
51 [DllImport(Libraries.AppCommon, EntryPoint = "app_get_resource_path")]
52 internal static extern string AppGetResourcePath();
54 [DllImport(Libraries.AppCommon, EntryPoint = "app_get_data_path")]
55 internal static extern string AppGetDataPath();
57 [DllImport(Libraries.AppCommon, EntryPoint = "app_get_cache_path")]
58 internal static extern string AppGetCachePath();
60 [DllImport(Libraries.AppCommon, EntryPoint = "app_get_shared_data_path")]
61 internal static extern string AppGetSharedDataPath();
63 [DllImport(Libraries.AppCommon, EntryPoint = "app_get_shared_resource_path")]
64 internal static extern string AppGetSharedResourcePath();
66 [DllImport(Libraries.AppCommon, EntryPoint = "app_get_shared_trusted_path")]
67 internal static extern string AppGetSharedTrustedPath();
69 [DllImport(Libraries.AppCommon, EntryPoint = "app_get_tep_resource_path")]
70 internal static extern string AppGetTepResourcePath();
72 [DllImport(Libraries.AppCommon, EntryPoint = "app_get_external_cache_path")]
73 internal static extern string AppGetExternalCachePath();
75 [DllImport(Libraries.AppCommon, EntryPoint = "app_get_external_data_path")]
76 internal static extern string AppGetExternalDataPath();
78 [DllImport(Libraries.AppCommon, EntryPoint = "app_get_external_shared_data_path")]
79 internal static extern string AppGetExternalSharedDataPath();
81 [DllImport(Libraries.AppCommon, EntryPoint = "app_get_version")]
82 internal static extern ErrorCode AppGetVersion(out string version);
84 [DllImport(Libraries.AppCommon, EntryPoint = "app_event_get_low_memory_status")]
85 internal static extern ErrorCode AppEventGetLowMemoryStatus(IntPtr handle, out LowMemoryStatus status);
87 [DllImport(Libraries.AppCommon, EntryPoint = "app_event_get_low_battery_status")]
88 internal static extern ErrorCode AppEventGetLowBatteryStatus(IntPtr handle, out LowBatteryStatus status);
90 [DllImport(Libraries.AppCommon, EntryPoint = "app_event_get_language")]
91 internal static extern ErrorCode AppEventGetLanguage(IntPtr handle, out string lang);
93 [DllImport(Libraries.AppCommon, EntryPoint = "app_event_get_region_format")]
94 internal static extern ErrorCode AppEventGetRegionFormat(IntPtr handle, out string region);
96 [DllImport(Libraries.AppCommon, EntryPoint = "app_resource_manager_get")]
97 internal static extern ErrorCode AppResourceManagerGet(ResourceCategory category, string id, out string path);
99 [DllImport(Libraries.Application, EntryPoint = "app_resource_manager_get")]
100 internal static extern ErrorCode LegacyAppResourceManagerGet(ResourceCategory category, string id, out string path);
102 [DllImport(Libraries.AppCommon, EntryPoint = "app_event_get_device_orientation")]
103 internal static extern ErrorCode AppEventGetDeviceOrientation(IntPtr handle, out DeviceOrientation orientation);
105 [DllImport(Libraries.AppCommon, EntryPoint = "app_event_get_suspended_state")]
106 internal static extern ErrorCode AppEventGetSuspendedState(IntPtr handle, out SuspendedState state);
108 [DllImport(Libraries.AppCommon, EntryPoint = "app_get_res_control_allowed_resource_path")]
109 internal static extern AppCommonErrorCode AppGetResControlAllowedResourcePath(string applicationId, out string path);
111 [DllImport(Libraries.AppCommon, EntryPoint = "app_get_res_control_global_resource_path")]
112 internal static extern AppCommonErrorCode AppGetResControlGlobalResourcePath(string applicationId, out string path);