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;
21 /// Interop for Account class APIs
23 /// <since_tizen> 3 </since_tizen>
24 internal static partial class Interop
27 /// Interop for Account class APIs
29 /// <since_tizen> 3 </since_tizen>
30 internal static partial class Account
32 [DllImport(Libraries.AccountSvc, EntryPoint = "account_create", CallingConvention = CallingConvention.Cdecl)]
33 internal static extern int Create(out IntPtr handle);
35 [DllImport(Libraries.AccountSvc, EntryPoint = "account_destroy", CallingConvention = CallingConvention.Cdecl)]
36 internal static extern int Destroy(IntPtr handle);
38 [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_account_id", CallingConvention = CallingConvention.Cdecl)]
39 internal static extern int GetAccountId(IntPtr data, out int accountId);
41 [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_user_name", CallingConvention = CallingConvention.Cdecl)]
42 internal static extern int GetAccountUserName(IntPtr data, out string userName);
44 [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_user_name", CallingConvention = CallingConvention.Cdecl)]
45 internal static extern int SetAccountUserName(IntPtr handle, string userName);
47 [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_display_name", CallingConvention = CallingConvention.Cdecl)]
48 internal static extern int GetAccountDisplayName(IntPtr handle, out string displayName);
50 [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_display_name", CallingConvention = CallingConvention.Cdecl)]
51 internal static extern int SetAccountDisplayName(IntPtr handle, string displayName);
53 [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_capability", CallingConvention = CallingConvention.Cdecl)]
54 internal static extern int GetAccountCapability(IntPtr handle, string capabilityType, out int capabilityValue);
56 [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_capability", CallingConvention = CallingConvention.Cdecl)]
57 internal static extern int SetAccountCapability(IntPtr handle, string capabilityType, int capabilityValue);
59 [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_icon_path", CallingConvention = CallingConvention.Cdecl)]
60 internal static extern int GetAccountIconPath(IntPtr handle, out string iconPath);
62 [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_icon_path", CallingConvention = CallingConvention.Cdecl)]
63 internal static extern int SetAccountIconPath(IntPtr handle, string iconPath);
65 [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_domain_name", CallingConvention = CallingConvention.Cdecl)]
66 internal static extern int GetAccountDomainName(IntPtr handle, out string domainName);
68 [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_domain_name", CallingConvention = CallingConvention.Cdecl)]
69 internal static extern int SetAccountDomainName(IntPtr handle, string domainName);
71 [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_email_address", CallingConvention = CallingConvention.Cdecl)]
72 internal static extern int GetAccountEmail(IntPtr handle, out string email);
74 [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_email_address", CallingConvention = CallingConvention.Cdecl)]
75 internal static extern int SetAccountEmail(IntPtr handle, string email);
77 [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_package_name", CallingConvention = CallingConvention.Cdecl)]
78 internal static extern int GetAccountPackageName(IntPtr handle, out string name);
80 [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_package_name", CallingConvention = CallingConvention.Cdecl)]
81 internal static extern int SetAccountPackageName(IntPtr handle, string name);
83 [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_access_token", CallingConvention = CallingConvention.Cdecl)]
84 internal static extern int GetAccountAccessToken(IntPtr handle, out string accessToken);
86 [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_access_token", CallingConvention = CallingConvention.Cdecl)]
87 internal static extern int SetAccountAccessToken(IntPtr handle, string accessToken);
89 [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_user_text", CallingConvention = CallingConvention.Cdecl)]
90 internal static extern int GetAccountUserText(IntPtr handle, int index, out string userText);
92 [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_user_text", CallingConvention = CallingConvention.Cdecl)]
93 internal static extern int SetAccountUserText(IntPtr handle, int index, string userText);
95 [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_user_int", CallingConvention = CallingConvention.Cdecl)]
96 internal static extern int GetAccountUserInt(IntPtr handle, int index, out int value);
98 [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_user_int", CallingConvention = CallingConvention.Cdecl)]
99 internal static extern int SetAccountUserInt(IntPtr handle, int index, int value);
101 [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_auth_type", CallingConvention = CallingConvention.Cdecl)]
102 internal static extern int GetAccountAuthType(IntPtr handle, out int authType);
104 [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_auth_type", CallingConvention = CallingConvention.Cdecl)]
105 internal static extern int SetAccountAuthType(IntPtr handle, int authType);
107 [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_secret", CallingConvention = CallingConvention.Cdecl)]
108 internal static extern int GetAccountSercet(IntPtr handle, out int secretType);
110 [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_secret", CallingConvention = CallingConvention.Cdecl)]
111 internal static extern int SetAccountSecret(IntPtr handle, int secretType);
113 [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_sync_support", CallingConvention = CallingConvention.Cdecl)]
114 internal static extern int GetAccountSyncSupport(IntPtr handle, out int syncType);
116 [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_sync_support", CallingConvention = CallingConvention.Cdecl)]
117 internal static extern int SetAccountSyncSupport(IntPtr handle, int syncType);
119 [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_source", CallingConvention = CallingConvention.Cdecl)]
120 internal static extern int GetAccountSource(IntPtr handle, out string source);
122 [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_source", CallingConvention = CallingConvention.Cdecl)]
123 internal static extern int SetAccountSource(IntPtr handle, string source);
125 [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_custom", CallingConvention = CallingConvention.Cdecl)]
126 internal static extern int GetAccountCustomValue(IntPtr handle, string key, out string value);
128 [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_custom", CallingConvention = CallingConvention.Cdecl)]
129 internal static extern int SetAccountCustomValue(IntPtr handle, string key, string value);
131 [DllImport(Libraries.AccountSvc, EntryPoint = "account_update_sync_status_by_id", CallingConvention = CallingConvention.Cdecl)]
132 internal static extern int UpdateAccountSyncStatusById(int accountId, int status);
134 [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_capability_all")]
135 internal static extern int GetAllAccountCapabilities(IntPtr handle, AccountCapabilityCallback callback, IntPtr userData);
137 [DllImport(Libraries.AccountSvc, EntryPoint = "account_query_capability_by_account_id")]
138 internal static extern int QueryAccountCapabilityById(AccountCapabilityCallback callback, int accountId, IntPtr userData);
140 [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_custom_all")]
141 internal static extern int GetAllAccountCustomValues(IntPtr handle, AccountCustomCallback callback, IntPtr userData);
144 [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
145 internal delegate bool AccountCapabilityCallback(string capabilityType, int capabilityState, IntPtr userData);
147 [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
148 internal delegate bool AccountCustomCallback(string key, string value, IntPtr userData);
150 [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
151 internal delegate bool AccountCallback(IntPtr data, IntPtr userData);