2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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.
17 * @file FSclAddressbookManager.h
18 * @brief This is the header file for the %AddressbookManager class.
20 * This header file contains the declarations of the %AddressbookManager class.
22 #ifndef _FSCL_ADDRESSBOOK_MANAGER_H_
23 #define _FSCL_ADDRESSBOOK_MANAGER_H_
25 #include <unique_ptr.h>
26 #include <FBaseTypes.h>
27 #include <FBaseObject.h>
28 #include <FBaseString.h>
29 #include <FBaseByteBuffer.h>
30 #include <FSclTypes.h>
32 namespace Tizen { namespace Base
37 template<class Type1> class IListT;
41 namespace Tizen { namespace Social
48 class AddressbookFilter;
49 class IAddressbookEventListener;
50 class IAddressbookChangeEventListener;
53 * @class AddressbookManager
54 * @brief This class manages addressbooks and contacts in the device storage.
58 * @final This class is not intended for extension.
60 * The %AddressbookManager class provides methods for managing addressbooks and contacts in the device storage.
62 class _OSP_EXPORT_ AddressbookManager
63 : public Tizen::Base::Object
67 * Creates an addressbook with the specified account ID and name. @n
68 * The accountId must specify a valid account and only one addressbook can be created per account. @n
69 * The name of the addressbook must be specified and the name must be unique among existing addressbooks on the device.
73 * @privilege %http://tizen.org/privilege/contact.write
75 * @return An addressbook instance
76 * @param[in] accountId The account ID
77 * @param[in] name The addressbook name
78 * @exception E_SUCCESS The method is successful.
79 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
80 * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
81 * @exception E_INVALID_ARG Either of the following conditions has occurred:
82 * - The specified @c accountId is invalid.
83 * - The specified @c name is an empty string.
84 * @exception E_OBJ_ALREADY_EXIST The addressbook with the specified @c accountId or @c name already exists.
85 * @exception E_STORAGE_FULL The storage is insufficient.
86 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
87 * @remarks The specific error code can be accessed using the GetLastResult() method.
89 Addressbook* CreateAddressbookN(AccountId accountId, const Tizen::Base::String& name);
92 * Deletes an addressbook. @n
93 * If the addressbook has been deleted successfully,
94 * the contacts and categories that belong to the addressbook are also deleted.
98 * @privilege %http://tizen.org/privilege/contact.write
100 * @return An error code
101 * @param[in] addressbookId The addressbook ID
102 * @exception E_SUCCESS The method is successful.
103 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
104 * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
105 * @exception E_INVALID_ARG Either of the following conditions has occurred:
106 * - The specified @c addressbookId is invalid.
107 * - The addressbook specified by the @c addressbookId is a default addressbook.
108 * @exception E_OBJ_NOT_FOUND The specified @c addressbookId does not exist.
109 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
111 result DeleteAddressbook(AddressbookId addressbookId);
114 * Gets the addressbooks associated with the specified account ID.
118 * @privilege %http://tizen.org/privilege/contact.read
120 * @return The list of addressbooks, @n
121 * else an empty list if there is no addressbook, or @c null if an exception occurs (@ref Addressbook list)
122 * @param[in] accountId The account ID
123 * @exception E_SUCCESS The method is successful.
124 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
125 * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
126 * @exception E_INVALID_ARG The specified @c accountId is invalid.
127 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
128 * @remarks The specific error code can be accessed using the GetLastResult() method.
130 Tizen::Base::Collection::IList* GetAddressbooksByAccountN(AccountId accountId) const;
133 * Gets the list of addressbooks.
137 * @privilege %http://tizen.org/privilege/contact.read
139 * @return The list of addressbooks, @n
140 * else an empty list if there is no addressbook, or @c null if an exception occurs (@ref Addressbook list)
141 * @exception E_SUCCESS The method is successful.
142 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
143 * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
144 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
145 * @remarks The specific error code can be accessed using the GetLastResult() method.
147 Tizen::Base::Collection::IList* GetAllAddressbooksN(void) const;
150 * Gets an instance of the addressbook specified by the addressbook ID.
154 * @privilege %http://tizen.org/privilege/contact.read
156 * @return An addressbook instance
157 * @param[in] addressbookId The addressbook ID
158 * @exception E_SUCCESS The method is successful.
159 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
160 * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
161 * @exception E_INVALID_ARG The specified @c addressbookId is invalid.
162 * @exception E_OBJ_NOT_FOUND The specified @c addressbookId does not exist.
163 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
164 * @remarks The specific error code can be accessed using the GetLastResult() method.
166 Addressbook* GetAddressbookN(AddressbookId addressbookId = DEFAULT_ADDRESSBOOK_ID) const;
169 * Sets an addressbook change event listener. @n
170 * The listener is called when a contact or a category has been changed.
171 * To reset the event listener, @c null must be passed.
173 * @brief <i> [Deprecated] </i>
174 * @deprecated This method and IAddressbookEventListener are deprecated. Instead of using this method, use SetAddressbookChangeEventListener()
175 * and IAddressbookChangeEventListener.
179 * @privilege %http://tizen.org/privilege/contact.read
181 * @return An error code
182 * @param[in] pListener The event listener
183 * @exception E_SUCCESS The method is successful.
184 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
185 * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
186 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
188 result SetEventListener(IAddressbookEventListener* pListener);
191 * Sets an addressbook change event listener. @n
192 * The listener is called when a contact or a category has been changed.
193 * To reset the event listener, @c null must be passed.
197 * @privilege %http://tizen.org/privilege/contact.read
199 * @return An error code
200 * @param[in] pListener The event listener
201 * @exception E_SUCCESS The method is successful.
202 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
203 * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method.
204 * @exception E_SYSTEM The method cannot proceed due to a severe system error
206 result SetAddressbookChangeEventListener(IAddressbookChangeEventListener* pListener);
209 * Adds a contact to the specified addressbook. @n
210 * At least one property of the contact must have been set. @n
211 * If the contact has been added successfully, a contact ID is assigned to it.
215 * @privilege %http://tizen.org/privilege/contact.write
217 * @return An error code
218 * @param[in,out] contact The contact to add
219 * @param[in] addressbookId The addressbook ID
220 * @exception E_SUCCESS The method is successful.
221 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
222 * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
223 * @exception E_INVALID_ARG Either of the following conditions has occurred:
224 * - The contact ID is not #INVALID_RECORD_ID.
225 * - The properties of the specified @c contact have not been set.
226 * - The specified @c addressbookId is invalid.
227 * @exception E_OBJ_NOT_FOUND The specified addressbook is not found.
228 * @exception E_STORAGE_FULL The storage is insufficient.
229 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
230 * @remarks The #CONTACT_PROPERTY_ID_DISPLAY_NAME and #CONTACT_PROPERTY_ID_LAST_REVISION
231 * properties cannot be set. @n #CONTACT_PROPERTY_ID_DISPLAY_NAME is automatically generated from the first name and
232 * the last name. And #CONTACT_PROPERTY_ID_LAST_REVISION is automatically updated with the last update time.
234 result AddContact(Contact& contact, AddressbookId addressbookId);
241 * @privilege %http://tizen.org/privilege/contact.write
243 * @return An error code
244 * @param[in] contactId The contact ID
245 * @exception E_SUCCESS The method is successful.
246 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
247 * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
248 * @exception E_INVALID_ARG The specified @c contactId is invalid.
249 * @exception E_OBJ_NOT_FOUND The specified @c contactId does not exist.
250 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
252 result RemoveContact(RecordId contactId);
255 * Updates the specified contact. @n
256 * At least one property of the contact must have been set.
260 * @privilege %http://tizen.org/privilege/contact.write
262 * @return An error code
263 * @param[in] contact The contact to update
264 * @exception E_SUCCESS The method is successful.
265 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
266 * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
267 * @exception E_OBJ_NOT_FOUND The specified @c contact does not exist in this address book.
268 * @exception E_INVALID_ARG Either of the following conditions has occurred:
269 * - The specified @c contact is invalid.
270 * - The properties of the specified @c contact have not been set.
271 * @exception E_STORAGE_FULL The storage is insufficient.
272 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
274 result UpdateContact(const Contact& contact);
277 * Adds a category to the specified addressbook. @n
278 * The name of the category must have been set. @n
279 * If the category has been added successfully, a category ID is assigned to it.
283 * @privilege %http://tizen.org/privilege/contact.write
285 * @return An error code
286 * @param[in,out] category The category to add
287 * @param[in] addressbookId The addressbook ID
288 * @exception E_SUCCESS The method is successful.
289 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
290 * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
291 * @exception E_INVALID_ARG Either of the following conditions has occurred:
292 * - The name of the category has not been set.
293 * - One of the member contacts is invalid.
294 * - The category ID of the specified @c category is not #INVALID_RECORD_ID.
295 * - The specified @c addressbookId is invalid.
296 * @exception E_STORAGE_FULL The storage is insufficient.
297 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
299 result AddCategory(Category& category, AddressbookId addressbookId);
302 * Removes a category.
306 * @privilege %http://tizen.org/privilege/contact.write
308 * @return An error code
309 * @param[in] categoryId The category ID
310 * @exception E_SUCCESS The method is successful.
311 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
312 * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
313 * @exception E_INVALID_ARG Either of the following conditions has occurred:
314 * - The specified @c categoryId is invalid.
315 * - The category specified by the @c categoryId is a default category.
316 * @exception E_OBJ_NOT_FOUND The specified @c categoryId does not exist in this address book.
317 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
318 * @see Category::IsDefault()
320 result RemoveCategory(RecordId categoryId);
323 * Updates a category.
327 * @privilege %http://tizen.org/privilege/contact.write
329 * @return An error code
330 * @param[in] category The category to update
331 * @exception E_SUCCESS The method is successful.
332 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
333 * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
334 * @exception E_OBJ_NOT_FOUND The specified @c category does not exist in this address book.
335 * @exception E_INVALID_ARG Either of the following conditions has occurred:
336 * - The specified @c category is invalid.
337 * - One of the contact members is invalid.
338 * @exception E_STORAGE_FULL The storage is insufficient.
339 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
341 result UpdateCategory(const Category& category);
344 * Gets all the contacts on the device. @n
345 * The contacts are ordered by display name.
349 * @privilege %http://tizen.org/privilege/contact.read
351 * @return The list of contacts on the device, @n
352 * else an empty list if there is no contact, or @c null if an exception occurs (@ref Contact list)
353 * @exception E_SUCCESS The method is successful.
354 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
355 * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
356 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
358 * - The specific error code can be accessed using the GetLastResult() method.
359 * - There is a high probability for an occurrence of an out-of-memory exception.
360 * If possible, check whether the exception is @c E_OUT_OF_MEMORY or not. @n
361 * For more information on how to handle the out-of-memory exception, refer
362 * <a href="../org.tizen.native.appprogramming/html/basics_tizen_programming/exception_check.htm">here</a>.
364 Tizen::Base::Collection::IList* GetAllContactsN(void) const;
367 * Gets the member contacts of the specified category. @n
368 * If the specified @c categoryId is ::INVALID_RECORD_ID, this method returns the list of contacts that are not a member of any category.
369 * The contacts are ordered by display name.
373 * @privilege %http://tizen.org/privilege/contact.read
375 * @return The list of contacts that are members of the specified category, @n
376 * else an empty list if there is no contact, or @c null if an exception occurs (@ref Contact list)
377 * @param[in] categoryId The category ID
378 * @exception E_SUCCESS The method is successful.
379 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
380 * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
381 * @exception E_INVALID_ARG The specified @c categoryId is less than ::INVALID_RECORD_ID.
382 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
384 * - The specific error code can be accessed using the GetLastResult() method.
385 * - There is a high probability for an occurrence of an out-of-memory exception.
386 * If possible, check whether the exception is @c E_OUT_OF_MEMORY or not. @n
387 * For more information on how to handle the out-of-memory exception, refer
388 * <a href="../org.tizen.native.appprogramming/html/basics_tizen_programming/exception_check.htm">here</a>.
390 Tizen::Base::Collection::IList* GetContactsByCategoryN(RecordId categoryId) const;
393 * Gets the contacts linked to the person specified by the person ID.
397 * @privilege %http://tizen.org/privilege/contact.read
399 * @return The list of contacts that are linked to this person, @n
400 * else @c null if an exception occurs (@ref Contact list)
401 * @param[in] personId The person ID
402 * @exception E_SUCCESS The method is successful.
403 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
404 * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
405 * @exception E_INVALID_ARG The specified @c personId is invalid.
406 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
407 * @remarks The specific error code can be accessed using the GetLastResult() method.
409 Tizen::Base::Collection::IList* GetContactsByPersonN(PersonId personId) const;
412 * Gets the categories whose member is the person specified by the person ID. @n
413 * A person is a member of a category if a contact linked to it is a member of the category.
414 * The categories are ordered by name.
418 * @privilege %http://tizen.org/privilege/contact.read
420 * @return The list of categories that has the specified person as a member, @n
421 * else an empty list if there is no category, or @c null if an exception occurs (@ref Category list)
422 * @param[in] personId The person ID
423 * @exception E_SUCCESS The method is successful.
424 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
425 * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
426 * @exception E_INVALID_ARG The specified @c personId is invalid.
427 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
428 * @remarks The specific error code can be accessed using the GetLastResult() method.
430 Tizen::Base::Collection::IList* GetCategoriesByPersonN(PersonId personId) const;
433 * Gets the contact with the specified contact ID.
437 * @privilege %http://tizen.org/privilege/contact.read
439 * @return The matched contact, @n
440 * else @c null if no contact matches the specified contact ID
441 * @param[in] contactId The contact ID
442 * @exception E_SUCCESS The method is successful.
443 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
444 * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
445 * @exception E_INVALID_ARG The specified @c contactId is invalid.
446 * @exception E_OBJ_NOT_FOUND The specified @c contactId is not found.
447 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
448 * @remarks The specific error code can be accessed using the GetLastResult() method.
450 Contact* GetContactN(RecordId contactId) const;
453 * Gets the number of contacts in all the addressbooks.
457 * @privilege %http://tizen.org/privilege/contact.read
459 * @return The number of contacts in the address book, @n
460 * else @c -1 if an error occurs
461 * @exception E_SUCCESS The method is successful.
462 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
463 * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
464 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
465 * @remarks The specific error code can be accessed using the GetLastResult() method.
467 int GetContactCount(void) const;
470 * Adds the specified contact to the specified category.
474 * @privilege %http://tizen.org/privilege/contact.write
476 * @return An error code
477 * @param [in] categoryId The category ID
478 * @param [in] contactId The contact ID
479 * @exception E_SUCCESS The method is successful.
480 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
481 * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
482 * @exception E_INVALID_ARG Either of the following conditions has occurred:
483 * - The specified contact or category does not exist.
484 * - The specified contact and category are not in the same addressbook.
485 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
486 * @remarks If the contact is already a member of the category, this method does nothing.
488 result AddMemberToCategory(RecordId categoryId, RecordId contactId);
491 * Removes the specified contact from the specified category.
495 * @privilege %http://tizen.org/privilege/contact.write
497 * @return An error code
498 * @param [in] categoryId The category ID
499 * @param [in] contactId The contact ID
500 * @exception E_SUCCESS The method is successful.
501 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
502 * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
503 * @exception E_INVALID_ARG The specified contact or category does not exist.
504 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
505 * @remarks If the contact is not a member of the category, this method does nothing.
507 result RemoveMemberFromCategory(RecordId categoryId, RecordId contactId);
510 * Gets all the categories on the device. @n
511 * The categories are ordered by name.
515 * @privilege %http://tizen.org/privilege/contact.read
517 * @return The list of categories on the device, @n
518 * else an empty list if there is no category, or @c null if an exception occurs (@ref Category list)
519 * @exception E_SUCCESS The method is successful.
520 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
521 * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
522 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
523 * @remarks The specific error code can be accessed using the GetLastResult() method.
525 Tizen::Base::Collection::IList* GetAllCategoriesN(void) const;
528 * Gets all the categories whose member is the specified contact. @n
529 * The categories are ordered by name.
533 * @privilege %http://tizen.org/privilege/contact.read
535 * @return The list of categories that has the specified contact as a member, @n
536 * else an empty list if there is no category, or @c null if an exception occurs (@ref Category list)
537 * @param[in] contactId The contact ID
538 * @exception E_SUCCESS The method is successful.
539 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
540 * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
541 * @exception E_INVALID_ARG The specified @c contactId is invalid.
542 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
543 * @remarks The specific error code can be accessed using the GetLastResult() method.
545 Tizen::Base::Collection::IList* GetCategoriesByContactN(RecordId contactId) const;
548 * Gets the number of categories on the device.
552 * @privilege %http://tizen.org/privilege/contact.read
554 * @return The number of categories on the device, @n
555 * else @c -1 if an error occurs
556 * @exception E_SUCCESS The method is successful.
557 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
558 * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
559 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
560 * @remarks The specific error code can be accessed using the GetLastResult() method.
562 int GetCategoryCount(void) const;
565 * Gets the category with the specified category ID.
569 * @privilege %http://tizen.org/privilege/contact.read
571 * @return The matched category, @n
572 * else @c null if no category matches the specified category ID
573 * @param[in] categoryId The category ID
574 * @exception E_SUCCESS The method is successful.
575 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
576 * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
577 * @exception E_INVALID_ARG The specified @c categoryId is invalid.
578 * @exception E_OBJ_NOT_FOUND The specified record is not found.
579 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
580 * @remarks The specific error code can be accessed using the GetLastResult() method.
582 Category* GetCategoryN(RecordId categoryId) const;
585 * Searches the contacts whose email address contains the specified @c email string. @n
586 * The search operation is performed with a case insensitive key (param: @c email). @n
587 * The contacts are ordered by display name.
591 * @privilege %http://tizen.org/privilege/contact.read
593 * @return The list of all matched contacts, @n
594 * else an empty list if there is no matched contact, or @c null if an exception occurs (@ref Contact list)
595 * @param[in] email The substring of the email to search
596 * @exception E_SUCCESS The method is successful.
597 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
598 * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
599 * @exception E_INVALID_ARG The specified @c email is an empty string.
600 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
602 * - The specific error code can be accessed using the GetLastResult() method.
603 * - There is a high probability for an occurrence of an out-of-memory exception.
604 * If possible, check whether the exception is @c E_OUT_OF_MEMORY or not. @n
605 * For more information on how to handle the out-of-memory exception, refer
606 * <a href="../org.tizen.native.appprogramming/html/basics_tizen_programming/exception_check.htm">here</a>.
608 Tizen::Base::Collection::IList* SearchContactsByEmailN(const Tizen::Base::String& email) const;
611 * Searches the contacts that have the specified @c name as a substring of their display name. @n
612 * The display name is a concatenation of the first name, space, and the last name. @n
613 * The search operation is performed with a case insensitive key (param: @c name). @n
614 * The contacts are ordered by display name.
618 * @privilege %http://tizen.org/privilege/contact.read
620 * @return The list of all matched contacts, @n
621 * else an empty list if there is no matched contact, or @c null if an exception occurs (@ref Contact list)
622 * @param[in] name The substring of the name to search
623 * @exception E_SUCCESS The method is successful.
624 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
625 * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
626 * @exception E_INVALID_ARG The specified @c name is an empty string.
627 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
629 * - The specific error code can be accessed using the GetLastResult() method.
630 * - There is a high probability for an occurrence of an out-of-memory exception.
631 * If possible, check whether the exception is @c E_OUT_OF_MEMORY or not. @n
632 * For more information on how to handle the out-of-memory exception, refer
633 * <a href="../org.tizen.native.appprogramming/html/basics_tizen_programming/exception_check.htm">here</a>.
635 Tizen::Base::Collection::IList* SearchContactsByNameN(const Tizen::Base::String& name) const;
638 * Searches the contacts that have the specified @c phoneNumber string as a substring of one of their phone numbers. @n
639 * This method returns the contacts whose phone number match the value of the specified @c phoneNumber. @n
640 * The search operation is performed with a case insensitive key (param: @c phoneNumber). @n
641 * The contacts are ordered by display name.
645 * @privilege %http://tizen.org/privilege/contact.read
647 * @return The list of all matched contacts, @n
648 * else an empty list if there is no contact, or @c null if an exception occurs (@ref Contact list)
649 * @param[in] phoneNumber The substring of the phone number to search
650 * @exception E_SUCCESS The method is successful.
651 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
652 * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
653 * @exception E_INVALID_ARG The specified @c phoneNumber is an empty string.
654 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
656 * - The specific error code can be accessed using the GetLastResult() method.
657 * - There is a high probability for an occurrence of an out-of-memory exception.
658 * If possible, check whether the exception is @c E_OUT_OF_MEMORY or not. @n
659 * For more information on how to handle the out-of-memory exception, refer
660 * <a href="../org.tizen.native.appprogramming/html/basics_tizen_programming/exception_check.htm">here</a>.
662 Tizen::Base::Collection::IList* SearchContactsByPhoneNumberN(const Tizen::Base::String& phoneNumber) const;
665 * Gets the latest change version.
669 * @privilege %http://tizen.org/privilege/contact.read
671 * @return The latest change version, @n
672 * else @c -1 if an exception occurs
673 * @exception E_SUCCESS The method is successful.
674 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
675 * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
676 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
677 * @remarks The specific error code can be accessed using the GetLastResult() method.
678 * @see GetChangedContactsAfterN()
679 * @see GetChangedCategoriesAfterN()
681 int GetLatestVersion(void) const;
684 * Gets the change information of the contacts that have been changed after the specified change version.
686 * @brief <i> [Deprecated] </i>
687 * @deprecated This method is deprecated.
691 * @privilege %http://tizen.org/privilege/contact.read
693 * @return The list of contact change information, @n
694 * else an empty list if there is no changed contact, or @c null if an exception occurs (@ref ContactChangeInfo list)
695 * @param[in] version The change version
696 * @param[out] latestVersion The latest change version among the changed contacts
697 * @exception E_SUCCESS The method is successful.
698 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
699 * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
700 * @exception E_INVALID_ARG The specified @c version is invalid.
701 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
702 * @remarks The specific error code can be accessed using the GetLastResult() method.
703 * @see GetLatestVersion()
704 * @see ContactChangeInfo
706 * The following example demonstrates how to use the %GetChangedContactsAfterN() method.
709 * MyApplication::PrintChangedContacts(void)
711 * IList* pChangedContacts = __pAddressbookManager->GetChangedContactsAfterN(__version, __version);
713 * IEnumerator* pEnum = pChangedContacts->GetEnumeratorN();
714 * while (pEnum->MoveNext() == E_SUCCESS)
716 * ContactChangeInfo* pInfo = static_cast<ContactChangeInfo*>(pEnum->GetCurrent());
718 * AppLog("Contact changed: type(%d), id(%d), version(%d)", pInfo->GetChangeType(), pInfo->GetContctId(), pInfo->GetVersion());
721 * pChangedContacts->RemoveAll(true);
722 * delete pChangedContacts;
726 Tizen::Base::Collection::IList* GetChangedContactsAfterN(int version, int& latestVersion) const;
729 * Gets the change information of the categories that have been changed after the specified change version.
731 * @brief <i> [Deprecated] </i>
732 * @deprecated This method is deprecated.
736 * @privilege %http://tizen.org/privilege/contact.read
738 * @return The list of category change information, @n
739 * else an empty list if there is no changed category, or @c null if an exception occurs (@ref CategoryChangeInfo list)
740 * @param[in] version The change version
741 * @param[out] latestVersion The latest change version among the changed categories
742 * @exception E_SUCCESS The method is successful.
743 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
744 * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
745 * @exception E_INVALID_ARG The specified @c version is invalid.
746 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
747 * @remarks The specific error code can be accessed using the GetLastResult() method.
748 * @see GetLatestVersion()
749 * @see CategoryChangeInfo
751 * The following example demonstrates how to use the %GetChangedCategoriesAfterN() method.
754 * MyApplication::PrintChangedCategories(void)
756 * IList* pChangedCategories = __pAddressbookManager->GetChangedCategoriesAfterN(__version, __version);
758 * IEnumerator* pEnum = pChangedCategories->GetEnumeratorN();
759 * while (pEnum->MoveNext() == E_SUCCESS)
761 * CategoryChangeInfo* pInfo = static_cast<CategoryChangeInfo*>(pEnum->GetCurrent());
763 * AppLog("Category changed: type(%d), id(%d), version(%d)", pInfo->GetChangeType(), pInfo->GetCategoryId(), pInfo->GetVersion());
766 * pChangedCategories->RemoveAll(true);
767 * delete pChangedCategories;
771 Tizen::Base::Collection::IList* GetChangedCategoriesAfterN(int version, int& latestVersion) const;
774 * Gets the person with the specified person ID.
778 * @privilege %http://tizen.org/privilege/contact.read
780 * @return The matched person, @n
781 * else @c null if an exception occurs
782 * @param[in] personId The person ID
783 * @exception E_SUCCESS The method is successful.
784 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
785 * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
786 * @exception E_INVALID_ARG The specified @c personId is invalid.
787 * @exception E_OBJ_NOT_FOUND The specified @c personId is not found.
788 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
789 * @remarks The specific error code can be accessed using the GetLastResult() method.
791 Person* GetPersonN(PersonId personId) const;
794 * Removes a person. @n
795 * All the contacts linked to the person are removed, too.
799 * @privilege %http://tizen.org/privilege/contact.write
801 * @return An error code
802 * @param[in] personId The person ID
803 * @exception E_SUCCESS The method is successful.
804 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
805 * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
806 * @exception E_INVALID_ARG The specified @c personId is invalid.
807 * @exception E_OBJ_NOT_FOUND The specified person does not exist.
808 * @exception E_SYSTEM The method cannot be proceed due to a severe system error.
810 result RemovePerson(PersonId personId);
813 * Gets all persons on the device. @n
814 * The persons are ordered by display name.
818 * @privilege %http://tizen.org/privilege/contact.read
820 * @return The list of all persons on the device, @n
821 * else an empty list if there is no person, or @c null if an exception occurs (@ref Person list)
822 * @exception E_SUCCESS The method is successful.
823 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
824 * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
825 * @exception E_SYSTEM The method cannot be proceed due to a severe system error.
827 * - The specific error code can be accessed using the GetLastResult() method.
828 * - There is a high probability for an occurrence of an out-of-memory exception.
829 * If possible, check whether the exception is @c E_OUT_OF_MEMORY or not. @n
830 * For more information on how to handle the out-of-memory exception, refer
831 * <a href="../org.tizen.native.appprogramming/html/basics_tizen_programming/exception_check.htm">here</a>.
833 Tizen::Base::Collection::IList* GetAllPersonsN(void) const;
836 * Gets the persons that are members of the specified category where a person is a member of a category if a contact linked to it is a member of the category. @n
837 * If the specified @c categoryId is ::INVALID_RECORD_ID, this method returns the persons that are not members of any category. @n
838 * The persons are ordered by display name.
842 * @privilege %http://tizen.org/privilege/contact.read
844 * @return The list of persons that are members of the specified category, @n
845 * else an empty list if there is no person, or @c null if an exception occurs (@ref Person list)
846 * @param[in] categoryId The category ID
847 * @exception E_SUCCESS The method is successful.
848 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
849 * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
850 * @exception E_INVALID_ARG The specified @c categoryId is invalid.
851 * @exception E_OBJ_NOT_FOUND The specified category does not exist.
852 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
854 * - The specific error code can be accessed using the GetLastResult() method.
855 * - There is a high probability for an occurrence of an out-of-memory exception.
856 * If possible, check whether the exception is @c E_OUT_OF_MEMORY or not. @n
857 * For more information on how to handle the out-of-memory exception, refer
858 * <a href="../org.tizen.native.appprogramming/html/basics_tizen_programming/exception_check.htm">here</a>.
860 Tizen::Base::Collection::IList* GetPersonsByCategoryN(RecordId categoryId) const;
863 * Gets the list of favorite persons. @n
864 * The persons are ordered by display name.
868 * @privilege %http://tizen.org/privilege/contact.read
870 * @return The list of favorite persons, @n
871 * else an empty list if there is no favorite person, or @c null if an exception occurs (@ref Person list)
872 * @exception E_SUCCESS The method is successful.
873 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
874 * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
875 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
877 * - The specific error code can be accessed using the GetLastResult() method.
878 * - There is a high probability for an occurrence of an out-of-memory exception.
879 * If possible, check whether the exception is @c E_OUT_OF_MEMORY or not. @n
880 * For more information on how to handle the out-of-memory exception, refer
881 * <a href="../org.tizen.native.appprogramming/html/basics_tizen_programming/exception_check.htm">here</a>.
882 * @see SetPersonAsFavorite()
884 Tizen::Base::Collection::IList* GetFavoritePersonsN(void) const;
887 * Searches the persons that contain the specified @c keyword string in its properties. @n
888 * The search operation is performed with a case insensitive key (param: @c keyword). @n
889 * The persons are ordered by display name.
893 * @privilege %http://tizen.org/privilege/contact.read
895 * @return The list of all matched persons, @n
896 * else an empty list if there is no matched person, or @c null if an exception occurs (@ref Person list)
897 * @param[in] keyword The key to search
898 * @exception E_SUCCESS The method is successful.
899 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
900 * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
901 * @exception E_INVALID_ARG The specified @c keyword is an empty string.
902 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
904 * - The specific error code can be accessed using the GetLastResult() method.
905 * - There is a high probability for an occurrence of an out-of-memory exception.
906 * If possible, check whether the exception is @c E_OUT_OF_MEMORY or not. @n
907 * For more information on how to handle the out-of-memory exception, refer
908 * <a href="../org.tizen.native.appprogramming/html/basics_tizen_programming/exception_check.htm">here</a>.
910 Tizen::Base::Collection::IList* SearchPersonsN(const Tizen::Base::String& keyword) const;
913 * Sets whether the specified person is a favorite or not.
917 * @privilege %http://tizen.org/privilege/contact.write
919 * @return An error code
920 * @param[in] personId The person ID
921 * @param[in] isFavorite Set to @c true to set the specified person as a favorite, @n
922 * else @c false to set the specified person as a non-favorite
923 * @exception E_SUCCESS The method is successful.
924 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
925 * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
926 * @exception E_INVALID_ARG The specified @c personId is invalid.
927 * @exception E_OBJ_NOT_FOUND The specified person does not exist.
928 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
929 * @see GetFavoritePersonsN()
930 * @see Person::IsFavorite()
932 result SetPersonAsFavorite(PersonId personId, bool isFavorite = true);
935 * Merges the source person with the target person. @n
936 * The following are done during merging:
937 * - Unlinks the contacts linked to the source person.
938 * - Links the unlinked contacts to the target person.
939 * - Removes the source person.
940 * - Updates information of the target person.
942 * The %MergePersons() method does nothing if the source or target person does not exist.
946 * @privilege %http://tizen.org/privilege/contact.write
948 * @return An error code
949 * @param[in] sourcePersonId The source person ID
950 * @param[in] targetPersonId The target person ID
951 * @exception E_SUCCESS The method is successful.
952 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
953 * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
954 * @exception E_INVALID_ARG The specified @c sourcePersonId or @c targetPersonId is invalid.
955 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
957 result MergePersons(PersonId sourcePersonId, PersonId targetPersonId);
960 * Unlinks the specified contact from the specified person. @n
961 * The following are done during unlinking:
962 * - Unlinks the contact specified by @c contactId.
963 * - Creates a new person.
964 * - Links the unlinked contact to the new person.
965 * - Updates information of a person.
967 * It is not allowed to unlink a contact if it is the only one contact linked to a person.
968 * The %UnlinkContact() method does nothing if the contact has not been linked to the person or does not exist.
972 * @privilege %http://tizen.org/privilege/contact.write
974 * @return An error code
975 * @param[in] personId The ID of the person that the contact is unlinked from
976 * @param[in] contactId The contact to unlink
977 * @param[out] newPersonId The ID of the new person
978 * @exception E_SUCCESS The method is successful.
979 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
980 * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
981 * @exception E_INVALID_ARG The specified @c personId or @c contactId is invalid.
982 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
984 result UnlinkContact(PersonId personId, RecordId contactId, PersonId& newPersonId);
987 * Searches items of the addressbook with the filter. @n
988 * The filter specifies the item type and condition for searching.
989 * The searched results are ordered by the @c propertyToSort and @c sortOrder.
990 * If the @c offset is M and the @c maxCount are N, then the first M items are omitted from the result set returned by the searching operation and the next N items are returned.
994 * @privilege %http://tizen.org/privilege/contact.read
996 * @return The list of searched results (The list of Addressbook, Person, Contact, Category, PhoneNumberContact, EmailContact), @n
997 * else an empty list if there is no searched result, or @c null if an exception occurs
998 * @param[in] filter The filter that specifies the search condition @n If the filter is empty, all items that are specified by the type of this filter are searched.
999 * @param[in] propertyToSort The property for sorting @n The searched results are ordered by the values of this property.
1000 * @param[in] sortOrder The order for sorting
1001 * @param[in] offset The offset of the searched results @n If this value is @c 0, it is ignored.
1002 * @param[in] maxCount The maximum count of the searched results @n If this value is @c 0, it is ignored.
1003 * @exception E_SUCCESS The method is successful.
1004 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
1005 * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
1006 * @exception E_INVALID_ARG Either of the following conditions has occurred:
1007 * - The specified @c offset or @c maxCount is less than @c 0.
1008 * - The specified @c propertyToSort is not an element of the enumerator that corresponds to the type of the @c filter.
1009 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
1011 * - The specific error code can be accessed using the GetLastResult() method.
1012 * - There is a high probability for an occurrence of an out-of-memory exception.
1013 * If possible, check whether the exception is @c E_OUT_OF_MEMORY or not. @n
1014 * For more information on how to handle the out-of-memory exception, refer
1015 * <a href="../org.tizen.native.appprogramming/html/basics_tizen_programming/exception_check.htm">here</a>.
1016 * @see AddressbookFilterProperty
1017 * @see PersonFilterProperty
1018 * @see ContactFilterProperty
1019 * @see CategoryFilterProperty
1020 * @see PhoneContactFilterProperty
1021 * @see EmailContactFilterProperty
1023 Tizen::Base::Collection::IList* SearchN(const AddressbookFilter& filter,
1024 unsigned long propertyToSort = 0, Tizen::Base::SortOrder sortOrder = Tizen::Base::SORT_ORDER_NONE, int offset = 0, int maxCount = 0);
1027 * Gets the matched item count of the search results with the filter. @n
1028 * The filter specifies the item type and condition for searching.
1032 * @privilege %http://tizen.org/privilege/contact.read
1034 * @return The count of the searched results
1035 * @param[in] filter The filter that specifies the search condition @n If the filter is empty, all items that are specified by the type of this filter are searched.
1036 * @exception E_SUCCESS The method is successful.
1037 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
1038 * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
1039 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
1040 * @remarks The specific error code can be accessed using the GetLastResult() method.
1041 * @see AddressbookFilterProperty
1042 * @see PersonFilterProperty
1043 * @see ContactFilterProperty
1044 * @see CategoryFilterProperty
1045 * @see PhoneContactFilterProperty
1046 * @see EmailContactFilterProperty
1048 int GetMatchedItemCount(const AddressbookFilter& filter);
1051 * Parses contacts from the specified vCard file. @n
1052 * The %ParseContactsFromVcardN() method supports vCard formation 2.1 and 3.0.
1056 * @return The list of contacts, @n
1057 * else an empty list if there is no contact, or @c null if an exception occurs (@ref Contact list)
1058 * @param[in] vcardPath The file path of a vCard file
1059 * @exception E_SUCCESS The method is successful.
1060 * @exception E_INVALID_ARG The specified @c vcardPath is invalid.
1061 * @exception E_ILLEGAL_ACCESS The access is denied due to insufficient permission.
1062 * @exception E_FILE_NOT_FOUND The specified file cannot be found.
1063 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
1064 * @remarks The specific error code can be accessed using the GetLastResult() method.
1066 Tizen::Base::Collection::IList* ParseContactsFromVcardN(const Tizen::Base::String& vcardPath);
1069 * Exports a person to the specified vCard 3.0 file.
1073 * @privilege %http://tizen.org/privilege/contact.read
1075 * @return An error code
1076 * @param[in] person The person to export
1077 * @param[in] vcardPath The file path of a vCard file
1078 * @exception E_SUCCESS The method is successful.
1079 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
1080 * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
1081 * @exception E_INVALID_ARG The specified @c person is invalid.
1082 * @exception E_ILLEGAL_ACCESS The access is denied due to insufficient permission.
1083 * @exception E_FILE_ALREADY_EXIST The specified file already exists.
1084 * @exception E_STORAGE_FULL The storage is insufficient.
1085 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
1087 result ExportPersonToVcard(const Person& person, const Tizen::Base::String& vcardPath);
1090 * Exports a person list to the specified vCard 3.0 file.
1094 * @privilege %http://tizen.org/privilege/contact.read
1096 * @return An error code
1097 * @param[in] personList The person list to export @n The list should contain the Person instances.
1098 * @param[in] vcardPath The file path of a vCard file
1099 * @exception E_SUCCESS The method is successful.
1100 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
1101 * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
1102 * @exception E_INVALID_ARG Either of the following conditions has occurred:
1103 * - The specified @c personList is invalid.
1104 * - The specified @c vcardPath is invalid.
1105 * @exception E_ILLEGAL_ACCESS The access is denied due to insufficient permission.
1106 * @exception E_FILE_ALREADY_EXIST The specified file already exists.
1107 * @exception E_STORAGE_FULL The storage is insufficient.
1108 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
1110 result ExportPersonsToVcard(const Tizen::Base::Collection::IList& personList, const Tizen::Base::String& vcardPath);
1113 * Exports a contact to the specified vCard 3.0 file.
1117 * @return An error code
1118 * @param[in] contact The contact to export
1119 * @param[in] vcardPath The file path of a vCard file
1120 * @exception E_SUCCESS The method is successful.
1121 * @exception E_INVALID_ARG The specified @c contact is invalid.
1122 * @exception E_ILLEGAL_ACCESS The access is denied due to insufficient permission.
1123 * @exception E_FILE_ALREADY_EXIST The specified file already exists.
1124 * @exception E_STORAGE_FULL The storage is insufficient.
1125 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
1127 result ExportContactToVcard(const Contact& contact, const Tizen::Base::String& vcardPath);
1130 * Exports a contact list to the specified vCard 3.0 file.
1134 * @return An error code
1135 * @param[in] contactList The contact list to export @n The list should contain Contact instances.
1136 * @param[in] vcardPath The file path of a vCard file
1137 * @exception E_SUCCESS The method is successful.
1138 * @exception E_INVALID_ARG Either of the following conditions has occurred:
1139 * - The specified @c contactList is invalid.
1140 * - The specified @c vcardPath is invalid.
1141 * @exception E_ILLEGAL_ACCESS The access is denied due to insufficient permission.
1142 * @exception E_FILE_ALREADY_EXIST The specified file already exists.
1143 * @exception E_STORAGE_FULL The storage is insufficient.
1144 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
1146 result ExportContactsToVcard(const Tizen::Base::Collection::IList& contactList, const Tizen::Base::String& vcardPath);
1149 * Exports a contact to a vCard format stream.
1153 * @return The exported vcard stream, @n
1154 * else @c null if an exception occurs
1155 * @param[in] contact The contact to export
1156 * @exception E_SUCCESS The method is successful.
1157 * @exception E_INVALID_ARG The specified @c contact is invalid.
1158 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
1159 * @remarks The specific error code can be accessed using the GetLastResult() method.
1160 * @see ExportContactToVcard()
1162 Tizen::Base::ByteBuffer* ExportContactToVcardStreamN(const Contact& contact);
1165 * Exports a contact list to a vCard format stream.
1169 * @return The exported vcard stream, @n
1170 * else @c null if an exception occurs
1171 * @param[in] contactList The contact list to export @n The list should contain the Contact instances
1172 * @exception E_SUCCESS The method is successful.
1173 * @exception E_INVALID_ARG The specified @c contactList contains an invalid contact.
1174 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
1175 * @remarks The specific error code can be accessed using the GetLastResult() method.
1176 * @see ExportContactsToVcard()
1178 Tizen::Base::ByteBuffer* ExportContactsToVcardStreamN(const Tizen::Base::Collection::IList& contactList);
1181 * Exports a person to a vCard format stream.
1185 * @privilege %http://tizen.org/privilege/contact.read
1187 * @return The exported vcard stream, @n
1188 * else @c null if an exception occurs
1189 * @param[in] person The person to export
1190 * @exception E_SUCCESS The method is successful.
1191 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
1192 * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method.
1193 * @exception E_INVALID_ARG The specified @c person is invalid.
1194 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
1195 * @remarks The specific error code can be accessed using the GetLastResult() method.
1196 * @see ExportPersonToVcard()
1198 Tizen::Base::ByteBuffer* ExportPersonToVcardStreamN(const Person& person);
1201 * Exports a person list to a vCard format stream.
1205 * @privilege %http://tizen.org/privilege/contact.read
1207 * @return The exported vcard stream, @n
1208 * else @c null if an exception occurs
1209 * @param[in] personList The person list to export @n The list should contain the Person instances.
1210 * @exception E_SUCCESS The method is successful.
1211 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
1212 * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method.
1213 * @exception E_INVALID_ARG The specified @c personList contains invalid person.
1214 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
1215 * @remarks The specific error code can be accessed using the GetLastResult() method.
1216 * @see ExportPersonsToVcard()
1218 Tizen::Base::ByteBuffer* ExportPersonsToVcardStreamN(const Tizen::Base::Collection::IList& personList);
1221 * Parses contacts from the specified vCard stream. @n
1222 * The %ParseVcardStreamN() method supports vCard formation 2.1 and 3.0.
1226 * @return The list of contacts, @n
1227 * else an empty list if there is no contact, or @c null if an exception occurs (@ref Contact list)
1228 * @param[in] vcardStream The vCard stream
1229 * @exception E_SUCCESS The method is successful.
1230 * @exception E_INVALID_ARG The specified @c vcardStream is invalid.
1231 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
1232 * @remarks The specific error code can be accessed using the GetLastResult() method.
1233 * @see ParseContactsFromVcardN()
1235 Tizen::Base::Collection::IList* ParseVcardStreamN(const Tizen::Base::ByteBuffer& vcardStream);
1238 * Exports a user profile to a vCard format stream.
1242 * @return The exported vCard stream, @n
1243 * else @c null if an exception occurs
1244 * @param[in] userProfile The user profile to export
1245 * @exception E_SUCCESS The method is successful.
1246 * @exception E_INVALID_ARG The specified @c userProfile is invalid.
1247 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
1248 * @remarks The specific error code can be accessed using the GetLastResult() method.
1250 Tizen::Base::ByteBuffer* ExportUserProfileToVcardStreamN(const UserProfile& userProfile);
1253 * Exports a user profile list to a vCard format stream.
1257 * @return The exported vCard stream, @n
1258 * else @c null if an exception occurs
1259 * @param[in] userProfileList The user profile list to export @n The list should contain the UserProfile instances
1260 * @exception E_SUCCESS The method is successful.
1261 * @exception E_INVALID_ARG The specified @c userProfile is invalid.
1262 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
1263 * @remarks The specific error code can be accessed using the GetLastResult() method.
1265 Tizen::Base::ByteBuffer* ExportUserProfilesToVcardStreamN(const Tizen::Base::Collection::IList& userProfileList);
1268 * Exports a user profile to the specified vCard 3.0 file.
1272 * @return An error code
1273 * @param[in] userProfile The user profile to export
1274 * @param[in] vcardPath The file path of a vCard file
1275 * @exception E_SUCCESS The method is successful.
1276 * @exception E_INVALID_ARG The specified @c userProfile is invalid.
1277 * @exception E_ILLEGAL_ACCESS The access is denied due to insufficient permission.
1278 * @exception E_FILE_ALREADY_EXIST The specified file already exists.
1279 * @exception E_STORAGE_FULL The storage is insufficient.
1280 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
1282 result ExportUserProfileToVcard(const UserProfile& userProfile, const Tizen::Base::String& vcardPath);
1285 * Exports a user profile list to the specified vCard 3.0 file.
1289 * @return An error code
1290 * @param[in] userProfileList The user profile list to export @n The list should contain the UserProfile instances
1291 * @param[in] vcardPath The file path of a vCard file
1292 * @exception E_SUCCESS The method is successful.
1293 * @exception E_INVALID_ARG Either of the following conditions has occurred:
1294 * - The specified @c userProfileList is invalid.
1295 * - The specified @c vcardPath is invalid.
1296 * @exception E_ILLEGAL_ACCESS The access is denied due to insufficient permission.
1297 * @exception E_FILE_ALREADY_EXIST The specified file already exists.
1298 * @exception E_STORAGE_FULL The storage is insufficient.
1299 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
1301 result ExportUserProfilesToVcard(const Tizen::Base::Collection::IList& userProfileList, const Tizen::Base::String& vcardPath);
1304 * Gets all the user profiles on the device.
1308 * @privilege %http://tizen.org/privilege/userprofile.read
1310 * @return The list of all the user profiles on the device, @n
1311 * else an empty list if there is no user profile, or @c null if an exception occurs (@ref UserProfile list)
1312 * @exception E_SUCCESS The method is successful.
1313 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
1314 * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method.
1315 * @exception E_SYSTEM The method cannot be proceed due to a severe system error.
1316 * @remarks The specific error code can be accessed using the GetLastResult() method.
1318 Tizen::Base::Collection::IList* GetAllUserProfilesN(void) const;
1321 * Gets a user profile of the address book specified by the address book ID.
1325 * @privilege %http://tizen.org/privilege/userprofile.read
1327 * @return The matched user profile, @n
1328 * else @c null if an exception occurs
1329 * @param[in] addressbookId The addressbook ID
1330 * @exception E_SUCCESS The method is successful.
1331 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
1332 * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method.
1333 * @exception E_INVALID_ARG The specified @c addressbookId is invalid.
1334 * @exception E_OBJ_NOT_FOUND The specified addressbook is not found.
1335 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
1336 * @remarks The specific error code can be accessed using the GetLastResult() method.
1338 UserProfile* GetUserProfileN(AddressbookId addressbookId) const;
1341 * Gets an %AddressbookManager instance.
1345 * @return A pointer to the %AddressbookManager instance, @n
1346 * else @c null if it fails
1347 * @exception E_SUCCESS The method is successful.
1348 * @exception E_OUT_OF_MEMORY The memory is insufficient.
1349 * @remarks The specific error code can be accessed using the GetLastResult() method.
1351 static AddressbookManager* GetInstance(void);
1355 // This default constructor is intentionally declared as private to implement the Singleton semantic.
1359 AddressbookManager(void);
1362 // This destructor is intentionally declared as private to implement the Singleton semantic.
1366 virtual ~AddressbookManager(void);
1369 // This function is only for internal usage.
1373 // @return An error code
1375 result Construct(void);
1378 // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
1382 AddressbookManager(const AddressbookManager& rhs);
1385 // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
1389 AddressbookManager& operator =(const AddressbookManager& rhs);
1391 static void InitAddressbookManager(void);
1392 static void DestroyAddressbookManager(void);
1395 static AddressbookManager* __pInstance;
1396 friend struct std::default_delete< AddressbookManager >;
1398 friend class _AddressbookManagerImpl;
1399 class _AddressbookManagerImpl* __pAddressbookManagerImpl;
1400 }; // AddressbookManager
1404 #endif //_FSCL_ADDRESSBOOK_MANAGER_H_