1- /*
1+ /*
22 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
33 *
44 * Licensed under the Apache License, Version 2.0 (the License);
1616
1717using System ;
1818using System . Runtime . InteropServices ;
19+ using System . Runtime . InteropServices . Marshalling ;
1920using Tizen . Account . AccountManager ;
2021
2122/// <summary>
@@ -30,68 +31,68 @@ internal static partial class Interop
3031 /// <since_tizen> 3 </since_tizen>
3132 internal static partial class AccountService
3233 {
33- [ DllImport ( Libraries . AccountSvc , EntryPoint = "account_update_to_db_by_id" , CallingConvention = CallingConvention . Cdecl ) ]
34- internal static extern int UpdateAccountToDBById ( SafeAccountHandle handle , int id ) ;
34+ [ LibraryImport ( Libraries . AccountSvc , EntryPoint = "account_update_to_db_by_id" , StringMarshalling = StringMarshalling . Utf8 ) ]
35+ internal static partial int UpdateAccountToDBById ( SafeAccountHandle handle , int id ) ;
3536
36- [ DllImport ( Libraries . AccountSvc , EntryPoint = "account_update_to_db_by_user_name" , CallingConvention = CallingConvention . Cdecl ) ]
37- internal static extern int UpdateAccountToDBByUserName ( IntPtr handle , string userName , string packageName ) ;
37+ [ LibraryImport ( Libraries . AccountSvc , EntryPoint = "account_update_to_db_by_user_name" , StringMarshalling = StringMarshalling . Utf8 ) ]
38+ internal static partial int UpdateAccountToDBByUserName ( IntPtr handle , string userName , string packageName ) ;
3839
39- [ DllImport ( Libraries . AccountSvc , EntryPoint = "account_query_account_by_account_id" , CallingConvention = CallingConvention . Cdecl ) ]
40- internal static extern int QueryAccountById ( int accountId , ref SafeAccountHandle handle ) ;
40+ [ LibraryImport ( Libraries . AccountSvc , EntryPoint = "account_query_account_by_account_id" , StringMarshalling = StringMarshalling . Utf8 ) ]
41+ internal static partial int QueryAccountById ( int accountId , ref SafeAccountHandle handle ) ;
4142
42- [ DllImport ( Libraries . AccountSvc , EntryPoint = "account_query_account_by_user_name" , CallingConvention = CallingConvention . Cdecl ) ]
43- internal static extern int QueryAccountByUserName ( Interop . Account . AccountCallback callback , string userName , IntPtr userData ) ;
43+ [ LibraryImport ( Libraries . AccountSvc , EntryPoint = "account_query_account_by_user_name" , StringMarshalling = StringMarshalling . Utf8 ) ]
44+ internal static partial int QueryAccountByUserName ( Interop . Account . AccountCallback callback , string userName , IntPtr userData ) ;
4445
45- [ DllImport ( Libraries . AccountSvc , EntryPoint = "account_query_account_by_package_name" , CallingConvention = CallingConvention . Cdecl ) ]
46- internal static extern int QueryAccountByPackageName ( Interop . Account . AccountCallback callback , string packageName , IntPtr userData ) ;
46+ [ LibraryImport ( Libraries . AccountSvc , EntryPoint = "account_query_account_by_package_name" , StringMarshalling = StringMarshalling . Utf8 ) ]
47+ internal static partial int QueryAccountByPackageName ( Interop . Account . AccountCallback callback , string packageName , IntPtr userData ) ;
4748
48- [ DllImport ( Libraries . AccountSvc , EntryPoint = "account_query_capability_by_account_id" , CallingConvention = CallingConvention . Cdecl ) ]
49- internal static extern int QueryAccountCapabilityById ( Interop . Account . AccountCapabilityCallback callback , int accoutId , IntPtr data ) ;
49+ [ LibraryImport ( Libraries . AccountSvc , EntryPoint = "account_query_capability_by_account_id" , StringMarshalling = StringMarshalling . Utf8 ) ]
50+ internal static partial int QueryAccountCapabilityById ( Interop . Account . AccountCapabilityCallback callback , int accoutId , IntPtr data ) ;
5051
51- [ DllImport ( Libraries . AccountSvc , EntryPoint = "account_update_sync_status_by_id" , CallingConvention = CallingConvention . Cdecl ) ]
52- internal static extern int UpdateAccountSyncStatusById ( int accoutId , int status ) ;
52+ [ LibraryImport ( Libraries . AccountSvc , EntryPoint = "account_update_sync_status_by_id" , StringMarshalling = StringMarshalling . Utf8 ) ]
53+ internal static partial int UpdateAccountSyncStatusById ( int accoutId , int status ) ;
5354
54- [ DllImport ( Libraries . AccountSvc , EntryPoint = "account_insert_to_db" , CallingConvention = CallingConvention . Cdecl ) ]
55- internal static extern int AddAccount ( SafeAccountHandle handle , out int accountId ) ;
55+ [ LibraryImport ( Libraries . AccountSvc , EntryPoint = "account_insert_to_db" , StringMarshalling = StringMarshalling . Utf8 ) ]
56+ internal static partial int AddAccount ( SafeAccountHandle handle , out int accountId ) ;
5657
57- [ DllImport ( Libraries . AccountSvc , EntryPoint = "account_delete_from_db_by_id" , CallingConvention = CallingConvention . Cdecl ) ]
58- internal static extern int DeleteAccountById ( int accountId ) ;
58+ [ LibraryImport ( Libraries . AccountSvc , EntryPoint = "account_delete_from_db_by_id" , StringMarshalling = StringMarshalling . Utf8 ) ]
59+ internal static partial int DeleteAccountById ( int accountId ) ;
5960
60- [ DllImport ( Libraries . AccountSvc , EntryPoint = "account_delete_from_db_by_user_name" , CallingConvention = CallingConvention . Cdecl ) ]
61- internal static extern int DeleteAccountByUser ( string userName , string packageName ) ;
61+ [ LibraryImport ( Libraries . AccountSvc , EntryPoint = "account_delete_from_db_by_user_name" , StringMarshalling = StringMarshalling . Utf8 ) ]
62+ internal static partial int DeleteAccountByUser ( string userName , string packageName ) ;
6263
63- [ DllImport ( Libraries . AccountSvc , EntryPoint = "account_delete_from_db_by_package_name" , CallingConvention = CallingConvention . Cdecl ) ]
64- internal static extern int DeleteAccountByPackage ( string packageName ) ;
64+ [ LibraryImport ( Libraries . AccountSvc , EntryPoint = "account_delete_from_db_by_package_name" , StringMarshalling = StringMarshalling . Utf8 ) ]
65+ internal static partial int DeleteAccountByPackage ( string packageName ) ;
6566
66- [ DllImport ( Libraries . AccountSvc , EntryPoint = "account_get_total_count_from_db" , CallingConvention = CallingConvention . Cdecl ) ]
67- internal static extern int GetAccountCount ( out int count ) ;
67+ [ LibraryImport ( Libraries . AccountSvc , EntryPoint = "account_get_total_count_from_db" , StringMarshalling = StringMarshalling . Utf8 ) ]
68+ internal static partial int GetAccountCount ( out int count ) ;
6869
69- [ DllImport ( Libraries . AccountSvc , EntryPoint = "account_foreach_account_from_db" ) ]
70- internal static extern int AccountForeachAccountFromDb ( Interop . Account . AccountCallback callback , IntPtr userData ) ;
70+ [ LibraryImport ( Libraries . AccountSvc , EntryPoint = "account_foreach_account_from_db" , StringMarshalling = StringMarshalling . Utf8 ) ]
71+ internal static partial int AccountForeachAccountFromDb ( Interop . Account . AccountCallback callback , IntPtr userData ) ;
7172
72- [ DllImport ( Libraries . AccountSvc , EntryPoint = "account_query_account_by_capability" ) ]
73- internal static extern int GetAccountByCapability ( Interop . Account . AccountCallback callback , string capabilityType , int value , IntPtr userData ) ;
73+ [ LibraryImport ( Libraries . AccountSvc , EntryPoint = "account_query_account_by_capability" , StringMarshalling = StringMarshalling . Utf8 ) ]
74+ internal static partial int GetAccountByCapability ( Interop . Account . AccountCallback callback , string capabilityType , int value , IntPtr userData ) ;
7475
75- [ DllImport ( Libraries . AccountSvc , EntryPoint = "account_query_account_by_capability_type" ) ]
76- internal static extern int GetAccountByCapabilityType ( Interop . Account . AccountCallback callback , string capabilityType , IntPtr userData ) ;
76+ [ LibraryImport ( Libraries . AccountSvc , EntryPoint = "account_query_account_by_capability_type" , StringMarshalling = StringMarshalling . Utf8 ) ]
77+ internal static partial int GetAccountByCapabilityType ( Interop . Account . AccountCallback callback , string capabilityType , IntPtr userData ) ;
7778
78- [ DllImport ( Libraries . AccountSvc , EntryPoint = "account_type_foreach_account_type_from_db" ) ]
79- internal static extern int GetAllAccountproviders ( Interop . AccountProvider . AccountProviderCallback callback , IntPtr userData ) ;
79+ [ LibraryImport ( Libraries . AccountSvc , EntryPoint = "account_type_foreach_account_type_from_db" , StringMarshalling = StringMarshalling . Utf8 ) ]
80+ internal static partial int GetAllAccountproviders ( Interop . AccountProvider . AccountProviderCallback callback , IntPtr userData ) ;
8081
81- [ DllImport ( Libraries . AccountSvc , EntryPoint = "account_type_query_by_provider_feature" ) ]
82- internal static extern int GetAccountProviderByFeature ( Interop . AccountProvider . AccountProviderCallback callback , string key , IntPtr userData ) ;
82+ [ LibraryImport ( Libraries . AccountSvc , EntryPoint = "account_type_query_by_provider_feature" , StringMarshalling = StringMarshalling . Utf8 ) ]
83+ internal static partial int GetAccountProviderByFeature ( Interop . AccountProvider . AccountProviderCallback callback , string key , IntPtr userData ) ;
8384
84- [ DllImport ( Libraries . AccountSvc , EntryPoint = "account_type_query_by_app_id" ) ]
85- internal static extern int GetAccountProviderByAppId ( string appId , out IntPtr handle ) ;
85+ [ LibraryImport ( Libraries . AccountSvc , EntryPoint = "account_type_query_by_app_id" , StringMarshalling = StringMarshalling . Utf8 ) ]
86+ internal static partial int GetAccountProviderByAppId ( string appId , out IntPtr handle ) ;
8687
87- [ DllImport ( Libraries . AccountSvc , EntryPoint = "account_subscribe_create" ) ]
88- internal static extern int CreateAccountSubscriber ( out Interop . AccountService . SafeAccountSubscriberHandle handle ) ;
88+ [ LibraryImport ( Libraries . AccountSvc , EntryPoint = "account_subscribe_create" , StringMarshalling = StringMarshalling . Utf8 ) ]
89+ internal static partial int CreateAccountSubscriber ( out Interop . AccountService . SafeAccountSubscriberHandle handle ) ;
8990
90- [ DllImport ( Libraries . AccountSvc , EntryPoint = "account_subscribe_notification" ) ]
91- internal static extern int RegisterSubscriber ( Interop . AccountService . SafeAccountSubscriberHandle handle , Interop . AccountService . SubscribeCallback callback , IntPtr userData ) ;
91+ [ LibraryImport ( Libraries . AccountSvc , EntryPoint = "account_subscribe_notification" , StringMarshalling = StringMarshalling . Utf8 ) ]
92+ internal static partial int RegisterSubscriber ( Interop . AccountService . SafeAccountSubscriberHandle handle , Interop . AccountService . SubscribeCallback callback , IntPtr userData ) ;
9293
93- [ DllImport ( Libraries . AccountSvc , EntryPoint = "account_unsubscribe_notification" ) ]
94- internal static extern int UnregisterSubscriber ( Interop . AccountService . SafeAccountSubscriberHandle handle ) ;
94+ [ LibraryImport ( Libraries . AccountSvc , EntryPoint = "account_unsubscribe_notification" , StringMarshalling = StringMarshalling . Utf8 ) ]
95+ internal static partial int UnregisterSubscriber ( Interop . AccountService . SafeAccountSubscriberHandle handle ) ;
9596
9697 //Callbacks
9798 [ UnmanagedFunctionPointer ( CallingConvention . Cdecl ) ]
0 commit comments