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;
19 using Tizen.Account.AccountManager;
22 /// Interop for AccountProvider class APIs.
24 /// <since_tizen> 3 </since_tizen>
25 internal static partial class Interop
28 /// Interop for AccountProvider class APIs.
30 /// <since_tizen> 3 </since_tizen>
31 internal static partial class AccountProvider
34 [DllImport(Libraries.AccountSvc, EntryPoint = "account_type_create", CallingConvention = CallingConvention.Cdecl)]
35 internal static extern int Create(out IntPtr handle);
37 [DllImport(Libraries.AccountSvc, EntryPoint = "account_type_destroy", CallingConvention = CallingConvention.Cdecl)]
38 internal static extern int Destroy(IntPtr handle);
40 [DllImport(Libraries.AccountSvc, EntryPoint = "account_type_get_app_id", CallingConvention = CallingConvention.Cdecl)]
41 internal static extern int GetAppId(IntPtr handle, out string appId);
43 [DllImport(Libraries.AccountSvc, EntryPoint = "account_type_query_supported_feature", CallingConvention = CallingConvention.Cdecl)]
44 [return: MarshalAs(UnmanagedType.I1)]
45 internal static extern bool IsFeatureSupported(string appId, string capability);
47 [DllImport(Libraries.AccountSvc, EntryPoint = "account_type_get_service_provider_id", CallingConvention = CallingConvention.Cdecl)]
48 internal static extern int GetServiceProviderId(IntPtr handle, out string providerId);
50 [DllImport(Libraries.AccountSvc, EntryPoint = "account_type_get_icon_path", CallingConvention = CallingConvention.Cdecl)]
51 internal static extern int GetAccountProviderIconPath(IntPtr handle, out string iconPath);
53 [DllImport(Libraries.AccountSvc, EntryPoint = "account_type_get_small_icon_path", CallingConvention = CallingConvention.Cdecl)]
54 internal static extern int GetAccountProviderSmallIconPath(IntPtr handle, out string iconPath);
56 [DllImport(Libraries.AccountSvc, EntryPoint = "account_type_get_multiple_account_support", CallingConvention = CallingConvention.Cdecl)]
57 internal static extern int GetMultipleAccountSupport(IntPtr handle, out int suppport);
59 [DllImport(Libraries.AccountSvc, EntryPoint = "account_type_get_label_by_locale", CallingConvention = CallingConvention.Cdecl)]
60 internal static extern int GetlabelbyLocale(IntPtr handle, string locale, out string label);
62 [DllImport(Libraries.AccountSvc, EntryPoint = "account_type_query_app_id_exist", CallingConvention = CallingConvention.Cdecl)]
63 internal static extern int GetAppIdExists(string appId);
65 [DllImport(Libraries.AccountSvc, EntryPoint = "account_type_foreach_account_type_from_db", CallingConvention = CallingConvention.Cdecl)]
66 internal static extern int GetAllAccountProviders(AccountProviderCallback callback, IntPtr data);
68 [DllImport(Libraries.AccountSvc, EntryPoint = "account_type_query_provider_feature_by_app_id")]
69 internal static extern int GetAccountProviderFeaturesByAppId(AccountProviderFeatureCallback callback, string appId, IntPtr userData);
71 [DllImport(Libraries.AccountSvc, EntryPoint = "account_type_get_provider_feature_all")]
72 internal static extern int GetAccountProviderFeatures(IntPtr handle, AccountProviderFeatureCallback callback, IntPtr userData);
74 [DllImport(Libraries.AccountSvc, EntryPoint = "account_type_get_label")]
75 internal static extern int GetAccountProviderLabels(IntPtr handle, LabelCallback callback, IntPtr userData);
77 [DllImport(Libraries.AccountSvc, EntryPoint = "account_type_query_label_by_app_id")]
78 internal static extern int GetLablesByAppId(LabelCallback callback, string appId, IntPtr userData);
82 [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
83 internal delegate bool AccountProviderFeatureCallback(string appId, string key, IntPtr userData);
85 [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
86 internal delegate bool AccountProviderCallback(IntPtr handle, IntPtr userData);
88 [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
89 internal delegate bool LabelCallback(string appId, string label, string locale, IntPtr user_data);