diff options
author | HyungKyu Song <hk76.song@samsung.com> | 2013-02-16 19:06:08 +0900 |
---|---|---|
committer | HyungKyu Song <hk76.song@samsung.com> | 2013-02-16 19:06:08 +0900 |
commit | 2fe4ba6f7e660a945ed94559110c76852c5edd47 (patch) | |
tree | 1c3b126230f27c8e1451b5669a2e7f760be29fe1 /include | |
parent | a1311c9da85162a82223c73aa63e6c9b7d91c565 (diff) | |
download | contacts-service-tizen_2.0.tar.gz contacts-service-tizen_2.0.tar.bz2 contacts-service-tizen_2.0.zip |
Tizen 2.0 Releasesubmit/tizen_2.0/20130216.100704accepted/tizen_2.0/20130216.0940012.0_releasetizen_2.0
Diffstat (limited to 'include')
-rwxr-xr-x | include/ContactsService_PG.h | 333 | ||||
-rwxr-xr-x | include/contacts-svc-struct.head | 46 | ||||
-rwxr-xr-x | include/contacts-svc-struct.tail | 6 | ||||
-rwxr-xr-x | include/contacts-svc-sub.head | 23 | ||||
-rwxr-xr-x | include/contacts-svc-sub.tail | 2 | ||||
-rw-r--r-- | include/contacts-svc.tail | 9 | ||||
-rw-r--r-- | include/contacts.h | 1316 | ||||
-rw-r--r-- | include/contacts_activity.h | 78 | ||||
-rwxr-xr-x | include/contacts_db.h | 591 | ||||
-rwxr-xr-x | include/contacts_errors.h | 85 | ||||
-rwxr-xr-x | include/contacts_filter.h | 213 | ||||
-rw-r--r-- | include/contacts_group.h | 82 | ||||
-rw-r--r-- | include/contacts_list.h | 185 | ||||
-rw-r--r-- | include/contacts_person.h | 160 | ||||
-rw-r--r-- | include/contacts_phone_log.h | 85 | ||||
-rw-r--r-- | include/contacts_query.h | 128 | ||||
-rw-r--r-- | include/contacts_record.h | 349 | ||||
-rwxr-xr-x | include/contacts_service.h | 120 | ||||
-rwxr-xr-x | include/contacts_setting.h | 86 | ||||
-rw-r--r-- | include/contacts_sim.h | 72 | ||||
-rw-r--r-- | include/contacts_types.h | 231 | ||||
-rw-r--r--[-rwxr-xr-x] | include/contacts_utils.h (renamed from include/contacts-svc.head) | 110 | ||||
-rw-r--r-- | include/contacts_vcard.h | 127 | ||||
-rwxr-xr-x | include/contacts_views.h | 607 |
24 files changed, 4572 insertions, 472 deletions
diff --git a/include/ContactsService_PG.h b/include/ContactsService_PG.h deleted file mode 100755 index 49a344f..0000000 --- a/include/ContactsService_PG.h +++ /dev/null @@ -1,333 +0,0 @@ -/* - * Contacts Service - * - * Copyright (c) 2010 - 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Youngjae Shin <yj99.shin@samsung.com> - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -/** - * - * @ingroup SLP_PG - * @defgroup CONTACTS_SVC_PG Contacts Service - - -<h1 class="pg">Introduction</h1> - <h2 class="pg">Purpose of this document</h2> - -The purpose of this document is to describe how applications can use contacts-service APIs for handling contact's information. This document gives programming guidelines to application engineers and examples of using contact data. - - <h2 class="pg">Scope</h2> - -The scope of this document is limited to Contacts-service API usage. - - -<h1 class="pg">Contacts Service Architecture</h1> - <h2 class="pg"> Overview</h2> - -Contacts-service is responsible for inserting, deleting, and updating contact data in order to accommodate the needs for application's contact data. -Users can access contacts data without knowing DB schema, SQLite, relations of data - -@image html SLP_ContactsService_PG_image001.PNG - - - <h2 class="pg">Sub-Components</h2> - -Contacts-svc-helper is a process for contacts-servcie. The process wait requests of contacts-service library and respond immediately - - - -<h1 class="pg">Contacts Service Features</h1> - - Similar to Sqlite3 - - Handle information of Contact - - Handle information of Group - - Handle information of Phone log - - <h2 class="pg">Similar to Sqlite3</h2> -Contacts-service API is similar to Sqlite3. - - <h2 class="pg">Handle information of Contact</h2> -Contacts-service supports to insert/update/delete/get/search information of contact. -The Information of contact includes name, numbers, emails, addresses, company, messenger, events, group relation information, web sites and favorite information. - - <h2 class="pg">Handle information of Group</h2> -Contacts-service supports to insert/update/delete/get information of contact. - - <h2 class="pg">Handle information of Group</h2> -Contacts-service supports to insert/update/delete/get information of Phone log. - -<h1 class="pg">Contacts Service API Description</h1> - -you can refer @ref CONTACTS_SVC - - - -<h1 class="pg">Sample Code</h1> - - <h2 class="pg">Connect to Contact Database</h2> - -Before using contact information from contacts service API, caller module should connect to the contact database, and after finishing with the contact information, should disconnect from the contact database - -@code -int contacts_svc_connect(void); - -int contacts_svc_disconnect(void); -@endcode - - - <h2 class="pg">Insert information of contact</h2> - -@code - -void insert_test(void) -{ - CTSstruct *contact; - CTSvalue *name, *number1, *number2; - GSList *numbers=NULL; - contact = contacts_svc_struct_new(CTS_STRUCT_CONTACT); - - name = contacts_svc_value_new(CTS_VALUE_CONTACT_BASE_INFO); - if(name) { - contacts_svc_value_set_str(name, CTS_BASE_VAL_IMG_PATH_STR, "test.vcf"); - } - contacts_svc_struct_store_value(contact, CTS_CF_BASE_INFO_VALUE, name); - contacts_svc_value_free(name); - - - name = contacts_svc_value_new(CTS_VALUE_NAME); - if(name) { - contacts_svc_value_set_str(name, CTS_NAME_VAL_FIRST_STR, "Gil-Dong"); - contacts_svc_value_set_str(name, CTS_NAME_VAL_LAST_STR, "Hong"); - contacts_svc_value_set_str(name, CTS_NAME_VAL_SUFFIX_STR, "engineer"); - } - contacts_svc_struct_store_value(contact, CTS_CF_NAME_VALUE, name); - contacts_svc_value_free(name); - - number1 = contacts_svc_value_new(CTS_VALUE_NUMBER); - if(number1) { - contacts_svc_value_set_str(number1, CTS_NUM_VAL_NUMBER_STR, "0987654321"); - contacts_svc_value_set_int(number1, CTS_NUM_VAL_TYPE_INT, CTS_NUM_TYPE_CELL); - contacts_svc_value_set_bool(number1, CTS_NUM_VAL_DEFAULT_BOOL, true); - } - numbers = g_slist_append(numbers, number1); - - number2 = contacts_svc_value_new(CTS_VALUE_NUMBER); - if(number2) { - contacts_svc_value_set_str(number2, CTS_NUM_VAL_NUMBER_STR, "0123456789"); - contacts_svc_value_set_int(number2, CTS_NUM_VAL_TYPE_INT, - CTS_NUM_TYPE_WORK); - } - numbers = g_slist_append(numbers, number2); - - contacts_svc_struct_store_list(contact, CTS_CF_NUMBER_LIST, numbers); - contacts_svc_value_free(number1); - contacts_svc_value_free(number2); - g_slist_free(numbers); - - contacts_svc_insert_contact(0, contact); - contacts_svc_struct_free(contact); -} -@endcode - - - <h2 class="pg">Get contact</h2> - -@code -void get_contact(CTSstruct *contact) -{ - int index=0, ret=-1; - CTSvalue *value=NULL; - GSList *get_list, *cursor; - - if(!contact) { - index = contacts_svc_find_contact_by(CTS_FIND_BY_NUMBER, "0123456789"); - if(index > CTS_SUCCESS) - ret = contacts_svc_get_contact(index, &contact); - if(ret < 0) - { - printf("No found record\n"); - return; - } - } - contacts_svc_struct_get_value(contact, CTS_CF_NAME_VALUE, &value); - printf("First Name : %s\n", contacts_svc_value_get_str(value, CTS_NAME_VAL_FIRST_STR)); - printf("Last Name : %s\n", contacts_svc_value_get_str(value, CTS_NAME_VAL_LAST_STR)); - printf("Additional Name : %s\n", contacts_svc_value_get_str(value, CTS_NAME_VAL_ADDITION_STR)); - printf("Display Name : %s\n", contacts_svc_value_get_str(value, CTS_NAME_VAL_DISPLAY_STR)); - printf("Prefix Name : %s\n", contacts_svc_value_get_str(value, CTS_NAME_VAL_PREFIX_STR)); - printf("Suffix Name : %s\n", contacts_svc_value_get_str(value, CTS_NAME_VAL_SUFFIX_STR)); - - value = NULL; - contacts_svc_struct_get_value(contact, CTS_CF_COMPANY_VALUE, &value); - printf("Company Name : %s\n", contacts_svc_value_get_str(value, CTS_COMPANY_VAL_NAME_STR)); - printf("Company Department : %s\n", contacts_svc_value_get_str(value, CTS_COMPANY_VAL_DEPARTMENT_STR)); - - get_list = NULL; - contacts_svc_struct_get_list(contact, CTS_CF_NUMBER_LIST, &get_list); - - cursor = get_list; - for(;cursor;cursor=g_slist_next(cursor)) - { - printf("number Type = %d", - contacts_svc_value_get_int(cursor->data, CTS_NUM_VAL_TYPE_INT)); - if(contacts_svc_value_get_bool(cursor->data, CTS_NUM_VAL_FAVORITE_BOOL)) - printf("(favorite)"); - printf("Number = %s\n", - contacts_svc_value_get_str(cursor->data, CTS_NUM_VAL_NUMBER_STR)); - if(index) - contacts_svc_insert_favorite(contacts_svc_value_get_int(cursor->data, CTS_NUM_VAL_ID_INT)); - } - - get_list = NULL; - contacts_svc_struct_get_list(contact, CTS_CF_EMAIL_LIST, &get_list); - - cursor = get_list; - for(;cursor;cursor=g_slist_next(cursor)) - { - printf("email Type = %d", - contacts_svc_value_get_int(cursor->data, CTS_EMAIL_VAL_TYPE_INT)); - - printf("email = %s\n", - contacts_svc_value_get_str(cursor->data, CTS_EMAIL_VAL_ADDR_STR)); - } - - get_list = NULL; - contacts_svc_struct_get_list(contact, CTS_CF_GROUPREL_LIST, &get_list); - cursor = get_list; - for(;cursor;cursor=g_slist_next(cursor)) - { - printf("group = %s:", - contacts_svc_value_get_str(cursor->data, CTS_GROUPREL_VAL_NAME_STR)); - - printf("%d\n", - contacts_svc_value_get_int(cursor->data, CTS_GROUPREL_VAL_ID_INT)); - } - - - if(index) - contacts_svc_struct_free(contact); - -} -@endcode - - - <h2 class="pg">Get contact list</h2> - -@code -void get_contact_list(void) -{ - CTSiter *iter = NULL; - contacts_svc_get_list(CTS_LIST_ALL_CONTACT, &iter); - - while(CTS_SUCCESS == contacts_svc_iter_next(iter)) - { - CTSvalue *contact = NULL; - const char *first, *last, *display; - contact = contacts_svc_iter_get_info(iter); - - printf("(%8d)", contacts_svc_value_get_int(contact, CTS_LIST_CONTACT_ID_INT)); - display = contacts_svc_value_get_str(contact, CTS_LIST_CONTACT_DISPLAY_STR); - if(display) - printf("%s :", display); - else - { - first = contacts_svc_value_get_str(contact, CTS_LIST_CONTACT_FIRST_STR); - last = contacts_svc_value_get_str(contact, CTS_LIST_CONTACT_LAST_STR); - if(CTS_ORDER_NAME_FIRSTLAST == contacts_svc_get_order(CTS_ORDER_OF_DISPLAY)) - printf("%s %s :", first, last); - else - printf("%s %s :", last, first); - } - printf("%s", contacts_svc_value_get_str(contact, CTS_LIST_CONTACT_IMG_PATH_STR)); - printf("\n"); - contacts_svc_value_free(contact); - } - contacts_svc_iter_remove(iter); -} -@endcode - - - <h2 class="pg">Delete contact </h2> - -@code - -void delete_test(void) -{ - //get contact - int index=0, ret=-1; - CTSstruct *contact; - - if(!contact) { - index = contacts_svc_find_contact_by(CTS_FIND_BY_NUMBER, "0123456789"); - if(index > CTS_SUCCESS) - ret = contacts_svc_get_contact(index, &contact); - if(ret < 0) - { - printf("No found record\n"); - return; - } - } - - contacts_svc_delete_contact(index); - - contacts_svc_struct_free(contact); - -} - -@endcode - - <h2 class="pg">Search contacts by name </h2> - -@code -void search_contacts_by_name(void) -{ - int ret; - CTSiter *iter = NULL; - ret = contacts_svc_get_list_with_str(CTS_LIST_CONTACTS_WITH_NAME, - "Hong", &iter); - if(CTS_SUCCESS != ret) return; - - while(CTS_SUCCESS == contacts_svc_iter_next(iter)) - { - CTSvalue *row_info = NULL; - const char *first, *last, *display; - row_info = contacts_svc_iter_get_info(iter); - - printf("(%8d)", contacts_svc_value_get_int(row_info, CTS_LIST_CONTACT_ID_INT)); - - display = contacts_svc_value_get_str(row_info, CTS_LIST_CONTACT_DISPLAY_STR); - if(display) - printf("%s :", display); - else - { - first = contacts_svc_value_get_str(row_info, CTS_LIST_CONTACT_FIRST_STR); - last = contacts_svc_value_get_str(row_info, CTS_LIST_CONTACT_LAST_STR); - if(CTS_ORDER_NAME_FIRSTLAST == contacts_svc_get_order(CTS_ORDER_OF_DISPLAY)) - printf("%s %s :", first, last); - else - printf("%s %s :", last, first); - } - printf("%s", contacts_svc_value_get_str(row_info, CTS_LIST_CONTACT_IMG_PATH_STR)); - printf("\n"); - contacts_svc_value_free(row_info); - } - contacts_svc_iter_remove(iter); -} -@endcode - - * @} - */ - diff --git a/include/contacts-svc-struct.head b/include/contacts-svc-struct.head deleted file mode 100755 index a0242be..0000000 --- a/include/contacts-svc-struct.head +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Contacts Service - * - * Copyright (c) 2010 - 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Youngjae Shin <yj99.shin@samsung.com> - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -#ifndef __CONTACTS_SVC_STRUCT_H__ -#define __CONTACTS_SVC_STRUCT_H__ - -#include <stdbool.h> -#include <glib.h> - -/** - * @defgroup CONTACTS_SVC_STRUCT Structs & values - * @ingroup CONTACTS_SVC - * @addtogroup CONTACTS_SVC_STRUCT - * @{ - * - * This interface provides methods to handle Structs (= collection of values)
- * and values of contacts service (individual properties of a contact).
- * - * @section sec1 Properties and Policies - * - Memory always has to be freed by its creator, unless stated otherwise. - * \n contacts_svc_struct_store_XXX means "copy". - * But If list has a same start with contacts struct(#CTSstruct), it is not "copy"(just appendix) - * - Contacts structs(#CTSstruct) own data stored in them.(User cannot free each value in struct) - * - Contacts_svc_value_XXXX is called by reference. - * \n But Contacts_svc_value_set_str() is called by value for the data in contacts struct(#CTSstruct). - * - All "char *" strings use UTF-8 encoding. - * - */ - diff --git a/include/contacts-svc-struct.tail b/include/contacts-svc-struct.tail deleted file mode 100755 index 6ea9abc..0000000 --- a/include/contacts-svc-struct.tail +++ /dev/null @@ -1,6 +0,0 @@ - -/** - * @} - */ - -#endif //__CONTACTS_SVC_STRUCT_H__ diff --git a/include/contacts-svc-sub.head b/include/contacts-svc-sub.head deleted file mode 100755 index e891d16..0000000 --- a/include/contacts-svc-sub.head +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Contacts Service - * - * Copyright (c) 2010 - 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Youngjae Shin <yj99.shin@samsung.com> - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -#ifndef __CONTACTS_SVC_SUB_H__ -#define __CONTACTS_SVC_SUB_H__ - diff --git a/include/contacts-svc-sub.tail b/include/contacts-svc-sub.tail deleted file mode 100755 index d2263ff..0000000 --- a/include/contacts-svc-sub.tail +++ /dev/null @@ -1,2 +0,0 @@ - -#endif //__CONTACTS_SVC_SUB_H__ diff --git a/include/contacts-svc.tail b/include/contacts-svc.tail deleted file mode 100644 index cddb7e1..0000000 --- a/include/contacts-svc.tail +++ /dev/null @@ -1,9 +0,0 @@ - -/** - * @} - */ -#ifdef __cplusplus - } -#endif - -#endif //__CONTACTS_SVC_H__ diff --git a/include/contacts.h b/include/contacts.h new file mode 100644 index 0000000..89e4c03 --- /dev/null +++ b/include/contacts.h @@ -0,0 +1,1316 @@ +/* + * Contacts Service + * + * Copyright (c) 2010 - 2012 Samsung Electronics Co., Ltd. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +#ifndef __TIZEN_SOCIAL_CONTACTS_H__ +#define __TIZEN_SOCIAL_CONTACTS_H__ + +#include <contacts_errors.h> +#include <contacts_service.h> +#include <contacts_views.h> +#include <contacts_types.h> +#include <contacts_record.h> +#include <contacts_list.h> +#include <contacts_filter.h> +#include <contacts_query.h> +#include <contacts_db.h> +#include <contacts_setting.h> +#include <contacts_person.h> +#include <contacts_group.h> +#include <contacts_sim.h> +#include <contacts_vcard.h> +#include <contacts_activity.h> +#include <contacts_utils.h> +#include <contacts_phone_log.h> + +#endif //__TIZEN_SOCIAL_CONTACTS_H__ + +/** + * @ingroup CAPI_SOCIAL_FRAMEWORK + * @defgroup CAPI_SOCIAL_CONTACTS_SVC_MODULE Contacts(New) + * + * @brief The Contacts Service API provides functions for managing phone contacts (a.k.a. phonebook). + * This API allows you not only to store information about contacts but also to query contact information. + * + * @section CAPI_SOCIAL_CONTACTS_SVC_MODULE_HEADER Required Header + * \#include <contacts.h> + * + * @section CAPI_SOCIAL_CONTACTS_SVC_MODULE_OVERVIEW Overview + * + * The basic concept in Contacts APi is a record. It may be helpful to know that a record represents + * an actual record in the internal database, but in general, you can think of a record as a piece + * of information, like an address, phone number or group of contacts. A record can be a complex + * set of data, containing other data, e.g. an address record contains country, region, and street, + * among others. Also, the contained data can be a reference to another record. For example, + * a contact record contains the 'address' property, which is a reference to an address record. An address + * record belongs to a contact record - its 'contact_id' property is set to identifier of the corresponding contact + * (more on ids later). In this case, the address is the contact's child record and the contact is the parent record. + * + * Effectively, a record can be a node in a tree or graph of relations between records. + * + * Each record type has a special structure defined for it, called 'view', which contains identifiers of its properties. + * For example, the _contacts_contact view describes the properties of the contact record. + * Its properties include name, company, nickname of the contact and many more. The address record is described by + * the _contacts_address view. A special property in such structures is the URI, which is used to identify + * the record's type. Every view describing a record has this property. You can think of views + * as of classes in an object oriented language. Whenever you use a record, you refer to its view to know + * the record's properties. + * + * To operate on a record, you must obtain its handle. The handle is provided during creation of the record. + * It can also be obtained when referring to a child record of a record the handle of which you already have. + * + * When creating a record, you need to specify what type of record you want to create. This is where you should + * use the URI property. The code below creates a contact record and obtains its handle. + * + * @code + * contacts_record_h hcontact = NULL; + * contacts_record_create( _contacts_contact._uri, &hcontact ); + * @endcode + * + * A record can have basic properties of four types: integer, string, boolean, long integer, double. Each property + * of basic type has functions to operate on it: + * + * <table> + * <tr> + * <th>Property type</th> + * <th>Setter</th> + * <th>Getter</th> + * </tr> + * <tr> + * <td> string </td> + * <td> contacts_record_set_str </td> + * <td> contacts_record_get_str </td> + * </tr> + * <tr> + * <td> integer </td> + * <td> contacts_record_set_int </td> + * <td> contacts_record_get_int </td> + * </tr> + * <tr> + * <td> boolean </td> + * <td> contacts_record_set_bool </td> + * <td> contacts_record_get_bool </td> + * </tr> + * <tr> + * <td> long integer </td> + * <td> contacts_record_set_lli </td> + * <td> contacts_record_get_lli </td> + * </tr> + * <tr> + * <td> long integer </td> + * <td> contacts_record_set_double </td> + * <td> contacts_record_get_double </td> + * </tr> + * </table> + * + * For long integer functions, "lli" stands for long long int, ususally used to hold UTC time. + * + * These functions also require specifying which property you wish to get/set. The code below sets the "ringtone_path" + * property of a contact record. + * + * @code + * contacts_record_set_str( hcontact, _contacts_contact.ringtone_path , "My Documents/1.mp3" ); + * @endcode + * + * Note on returned values ownership: some functions have the "_p" postfix. It means that the returned + * value should not be freed by the application, as it is a pointer to data in an existing record. For example: + * + * @code + * API int contacts_record_get_str( contacts_record_h record, unsigned int property_id, char** out_str ); + * API int contacts_record_get_str_p( contacts_record_h record, unsigned int property_id, char** out_str ); + * @endcode + * + * In the first case, the returned string should be freed by the application, in the second one it should not. + * + * + * A record can also have properties of type 'record' - other records, called child records. + * A record can contain many child records of a given type. For example, a contact record + * can contain many address records, and is called the parent record of the address records. + * The code below inserts an address record into a contact record. + * Note that it is not necessary to insert all records - just the contact record needs to be + * inserted into the database, it is enough for all information to be stored. + * Both records are then destroyed. + * + * @code + * contacts_record_h haddress = NULL; + * contacts_record_h himage = NULL; + * contacts_record_create( _contacts_contact._uri, &hcontact ); + * contacts_record_create( _contacts_image._uri, &himage ); + * contacts_record_create( _contacts_address._uri, &haddress ); + * contacts_record_set_str( himage, _contacts_image.path, "My Documents/1.jpg" ); + * contacts_record_set_str( hcontact, _contacts_address.country, "Korea" ); + * contacts_record_add_child_record( hcontact, _contacts_contact.image, himage ); + * contacts_record_add_child_record( hcontact, _contacts_contact.address, haddress ); + * + * contacts_db_insert_record( hcontact ); + * contacts_record_destroy( hcontact, true ); + * @endcode + * + * Establishing parent/child relation between records is also possible + * through the use of identifiers, described in following paragraphs. + * + * One of record's properties is the identifier (id). If you know the id of a record existing in the database, + * you can directly access it. The id is available after the record has been inserted into the database + * and is a read-only property. + * + * @code + * contacts_record_h haddress = NULL; + * contacts_record_create( _contacts_contact._uri, &hcontact ); + * contacts_db_insert_record( hcontact ); + * int id = contacts_record_get_int( hcontact, _contacts_contact.id ); + * // use hcontact ... + * // ... + * contacts_record_destroy( hcontact, true); // hcontact is no longer usable + * + * contacts_db_get_record( _contacts_contact._uri, id, &hcontact ); + * // hcontact is now a handle to the same record as before + * @endcode + * + * Identifiers can also be used to establish a relation between two records. + * The following code sets an address record's 'contact_id' property to the id of the contact. + * contact_id acts as a foreign key here. After that is done, the address becomes one of the addresses + * connected to the contact. The address is now the contact's child record, the contact is the + * the parent record. + * + * @code + * contacts_record_create( _contacts_contact._uri, &hcontact ); + * int id = ... // acquire id of created contact + * + * contacts_record_create( _contacts_address._uri, &haddress ); + * contacts_record_set_int( haddress, _contacts_address.contact_id, id ); + * // set other address properties + * contacts_db_insert_record( haddress ); + * @endcode + * + * As mentioned above, a record can have many child records, just as more than one record in a database can have + * its foreign keys set to the id of another record. + * Having a record handle, you can access all records of a specific type related to the given record: + * + * @code + * contacts_db_get_record( _contacts_contact._uri, id, &hcontact ); + * int address_num = contacts_record_get_child_record_count( hcontact, _contacts_contact.address ); + * for( int i=0; i < address_num; i++ ) + * { + * haddress = contacts_record_get_child_record_at( hcontact, _contacts_contact.address, i ); + * contacts_record_set_str( haddress, _contacts_address.country, "Korea" ); + * } + * contacts_db_update_record( hcontact ); + * + * contacts_record_destroy( hcontact, true ); + * @endcode + * + * This code acquires the number of child records of type 'address' and iterates over them. Each address + * has its 'country' property set to 'Korea'. Only the parent record is saved to the database - all changes + * made to the child records are saved automatically. + * + * + * Another two important concepts in Contacts API are filters and queries, related to searching. + * Filters allow returning results that satisfy a given condition, e.g. an integer property + * value must be greater than a given value, or a string must contain a given substring. Many + * conditions can be added to a filter, creating a composite filter with the use of AND and OR logical operators. + * + * A query acts as a container for filters and as an interface to the stored data. It allows configuring + * sorting and grouping methods of returned results. + * + * Sample code: Create a filter which will accept addresses with their contact's id equal to a given id + * (integer filter), or their country property equal to "Korea" (string filter). Create a query and + * add the filter to it. Results are received in a list. + * + * @code + * contacts_filter_h filter = NULL; + * contacts_list_h list = NULL; + * contacts_query_h query = NULL; + * + * contacts_filter_create( _contacts_address._uri, &filter ); + * contacts_filter_add_int( filter, _contacts_address.contact_id, CONTACTS_MATCH_EQUAL, id ); + * contacts_filter_add_operator( filter, CONTACTS_FILTER_OPERATOR_OR); + * contacts_filter_add_str( filter, _contacts_address.country, CONTACTS_MATCH_EXACTLY, "Korea" ); + * contacts_query_create( _contacts_address._uri, &query ); + * contacts_query_set_filter(query, filter); + * + * contacts_db_get_records_with_query( query, 0, 0, &list ); + * + * contacts_filter_destroy( filter ); + * contacts_query_destroy( query); + * // use the list + * // ... + * contacts_list_destroy( list, true ); + * @endcode + * + * A query can contain more than one fiter. You can add logical operators between filters. Whole filters + * are operators' arguments, not just the conditions. Extending the example above, the following code creates two filters + * and connects them with the OR operator: + * + * @code + * contacts_filter_h filter1 = NULL; + * contacts_filter_h filter2 = NULL; + * contacts_query_h query = NULL; + * + * contacts_filter_create( _contacts_address._uri, &filter1 ); + * contacts_filter_add_int( filter1, _contacts_address.contact_id, CONTACTS_MATCH_EQUAL, id ); + * contacts_filter_add_operator( filter1, CONTACTS_FILTER_OPERATOR_OR); + * contacts_filter_add_str( filter1, _contacts_address.country, CONTACTS_MATCH_EXACTLY, "Korea" ); + * + * contacts_filter_create( _contacts_address._uri, &filter2 ); + * contacts_filter_add_str( filter2, _contacts_address.country, CONTACTS_MATCH_EXACTLY, "USA" ); + * contacts_filter_add_operator( filter2, CONTACTS_FILTER_OPERATOR_AND); + * contacts_filter_add_str( filter2, _contacts_address.region, CONTACTS_MATCH_CONTAINS, "California" ); + * + * contacts_filter_add_operator(filter1, CONTACTS_FILTER_OPERATOR_OR); + * contacts_filter_add_filter(filter1, filter2); + * + * contacts_query_create( _contacts_address._uri, &query ); + * contacts_query_set_filter(query, filter1); + * + * contacts_db_get_records_with_query( query, 0, 0, &list ); + * + * contacts_filter_destroy( filter1 ); + * contacts_filter_destroy( filter2 ); + * contacts_query_destroy( query ); + * // ... + * @endcode + * + * The first filter accepts addresses with country equal to "Korea" or contact id equal to 'id' variable. + * The second filter accepts addresses with "USA" as country and region containing the string "California". + * The query in the code above will return addresses accepted by either of the filters. + * + * Furthermore, the order in which filters and operators are added determines the placement of parentheses. + * For example, If the following are added, in given order: + * + * @code + * Filter F1 + * OR + * Filter F2 + * AND + * Filter F3 + * @endcode + * + * the result is: + * + * @code + * (F1 OR F2) AND F3 + * @endcode + * + * @section CAPI_SOCIAL_CONTACTS_SVC_VIEW_MODULE_View_properties View properties + * In \ref CAPI_SOCIAL_CONTACTS_SVC_VIEW_MODULE category, you can find tables with view properties. Record types which have *_id + * as their properties, hold identifiers of other records - e.g. name, number and email + * views hold id of their corresponding contacts in contact_id property + * (as children of the corresponding contacts record). + * + * Properties of type 'record' are other records. For example, a contact record has 'name', + * 'number' and 'email' properties, which means that records of those types can be children + * of contact type records. + * + */ + +/** + * @ingroup CAPI_SOCIAL_CONTACTS_SVC_MODULE + * @defgroup CAPI_SOCIAL_CONTACTS_SVC_DATABASE_MODULE Database + * + * @brief The contacts database API provides the set of the definitions and interfaces that enable you to handle contacts database. + * + * @section CAPI_SOCIAL_CONTACTS_SVC_DATABASE_MODULE_HEADER Required Header + * \#include <contacts.h> + * + * <BR> + */ + +/** + * @ingroup CAPI_SOCIAL_CONTACTS_SVC_MODULE + * @defgroup CAPI_SOCIAL_CONTACTS_SVC_RECORD_MODULE Record + * + * @brief The contacts record API provides the set of the definitions and interfaces that enable you to get/set data from/to contacts record handle. + * + * @section CAPI_SOCIAL_CONTACTS_SVC_RECORD_MODULE_HEADER Required Header + * \#include <contacts.h> + * + * <BR> + */ + +/** + * @ingroup CAPI_SOCIAL_CONTACTS_SVC_MODULE + * @defgroup CAPI_SOCIAL_CONTACTS_SVC_LIST_MODULE List + * + * @brief The contacts record API provides the set of the definitions and interfaces that enable you to get/set records list data. + * + * @section CAPI_SOCIAL_CONTACTS_SVC_LIST_MODULE_HEADER Required Header + * \#include <contacts.h> + * + * <BR> + */ + +/** + * @ingroup CAPI_SOCIAL_CONTACTS_SVC_MODULE + * @defgroup CAPI_SOCIAL_CONTACTS_SVC_PERSON_MODULE Person + * + * @brief The contacts person API provides the set of the definitions and interfaces that enable you to link/unlink person and contact. + * + * @section CAPI_SOCIAL_CONTACTS_SVC_PERSON_MODULE_HEADER Required Header + * \#include <contacts.h> + * + * <BR> + */ + +/** + * @ingroup CAPI_SOCIAL_CONTACTS_SVC_MODULE + * @defgroup CAPI_SOCIAL_CONTACTS_SVC_GROUP_MODULE Group + * + * @brief The contacts group API provides the set of the definitions and interfaces that enable you to add/remove contact as group member. + * + * @section CAPI_SOCIAL_CONTACTS_SVC_GROUP_MODULE_HEADER Required Header + * \#include <contacts.h> + * + * <BR> + */ + + +/** + * @ingroup CAPI_SOCIAL_CONTACTS_SVC_MODULE + * @defgroup CAPI_SOCIAL_CONTACTS_SVC_FILTER_MODULE Filter + * + * @brief The contacts Filter API provides the set of the definitions and interfaces that enable you to make filters to set query. + * + * @section CAPI_SOCIAL_CONTACTS_SVC_CONTACTS_FILTER_HEADER Required Header + * \#include <contacts.h> + * + * <BR> + */ + +/** + * @ingroup CAPI_SOCIAL_CONTACTS_SVC_MODULE + * @defgroup CAPI_SOCIAL_CONTACTS_SVC_QUERY_MODULE Query + * + * @brief The contacts Query API provides the set of the definitions and interfaces that enable you to make query to get list. + * + * @section CAPI_SOCIAL_CONTACTS_SVC_CONTACTS_QUERY_HEADER Required Header + * \#include <contacts.h> + * + * <BR> + */ + +/** + * @ingroup CAPI_SOCIAL_CONTACTS_SVC_MODULE + * @defgroup CAPI_SOCIAL_CONTACTS_SVC_VCARD_MODULE vCard + * + * @brief The contacts record API provides the set of the definitions and interfaces that enable you to get/set data from/to vCard. + * + * @section CAPI_SOCIAL_CONTACTS_SVC_VCARD_MODULE_HEADER Required Header + * \#include <contacts.h> + * + * <BR> + */ + +/** + * @ingroup CAPI_SOCIAL_CONTACTS_SVC_MODULE + * @defgroup CAPI_SOCIAL_CONTACTS_SVC_ACTIVITY_MODULE Activity + * + * @brief The contacts activity API provides the set of the definitions and interfaces that enable you to delete activities by contact_id and account_id. \n + * Please refer to \ref CAPI_SOCIAL_CONTACTS_SVC_VIEW_MODULE_contacts_activity for more details. + * + * @section CAPI_SOCIAL_CONTACTS_SVC_ACTIVITY_MODULE_HEADER Required Header + * \#include <contacts.h> + * + * <BR> + */ + +/** + * @ingroup CAPI_SOCIAL_CONTACTS_SVC_MODULE + * @defgroup CAPI_SOCIAL_CONTACTS_SVC_PHONELOG_MODULE Phone log + * + * @brief The contacts phone log API provides the set of the definitions and interfaces that enable you to reset phone log count. + * + * @section CAPI_SOCIAL_CONTACTS_SVC_PHONELOG_MODULE_HEADER Required Header + * \#include <contacts.h> + * + * <BR> + */ + +/** + * @ingroup CAPI_SOCIAL_CONTACTS_SVC_MODULE + * @defgroup CAPI_SOCIAL_CONTACTS_SVC_SETTING_MODULE Setting + * + * @brief The contacts setting API provides the set of the definitions and interfaces that enable you to set up contacts features. + * + * @section CAPI_SOCIAL_CONTACTS_SVC_SETTING_MODULE_HEADER Required Header + * \#include <contacts.h> + * + * <BR> + */ + +/** + * @ingroup CAPI_SOCIAL_CONTACTS_SVC_MODULE + * @defgroup CAPI_SOCIAL_CONTACTS_SVC_SIM_MODULE SIM + * + * @brief The contacts SIM API provides the set of the definitions and interfaces that enable you to get/set data from/to SIM card. + * + * @section CAPI_SOCIAL_CONTACTS_SVC_CONTACTS_SIM_HEADER Required Header + * \#include <contacts.h> + * + * <BR> + */ + +/** + * @ingroup CAPI_SOCIAL_CONTACTS_SVC_MODULE + * @defgroup CAPI_SOCIAL_CONTACTS_SVC_UTILS_MODULE Utils + * + * @brief The contacts Utils API provides the set of the definitions and interfaces that enable you to get index characters of language according to phone setting + * + * @section CAPI_SOCIAL_CONTACTS_SVC_CONTACTS_UTILS_HEADER Required Header + * \#include <contacts.h> + * + * <BR> + */ + +/** + * @ingroup CAPI_SOCIAL_CONTACTS_SVC_MODULE + * @defgroup CAPI_SOCIAL_CONTACTS_SVC_VIEW_MODULE View/Property + * + * @brief This page provides information about views with properties. + * + * @section CAPI_SOCIAL_CONTACTS_SVC_VIEW_MODULE_OVERVIEW Overview + * A view is a structure which describes properties of a record. + * A record can have basic properties of four types: integer, string, boolean, long integer, double. Each property + * of basic type has functions to operate on it: + * + * <table> + * <tr> + * <th>Property type</th> + * <th>Setter</th> + * <th>Getter</th> + * </tr> + * <tr> + * <td> string </td> + * <td> contacts_record_set_str </td> + * <td> contacts_record_get_str </td> + * </tr> + * <tr> + * <td> integer </td> + * <td> contacts_record_set_int </td> + * <td> contacts_record_get_int </td> + * </tr> + * <tr> + * <td> boolean </td> + * <td> contacts_record_set_bool </td> + * <td> contacts_record_get_bool </td> + * </tr> + * <tr> + * <td> long integer </td> + * <td> contacts_record_set_lli </td> + * <td> contacts_record_get_lli </td> + * </tr> + * <tr> + * <td> long integer </td> + * <td> contacts_record_set_double </td> + * <td> contacts_record_get_double </td> + * </tr> + * </table> + * + * For long integer functions, "lli" stands for long long int, ususally used to hold UTC time. + * + * Below you can find tables with view properties. + * + * Properties of type 'record' are other records. For example, the _contacts_contact view + * has a 'name' property of type 'record'. This means that records of type name (_contacts_name view) + * can be children of the contact record. If a name record holds the identifier + * of a contact record in its 'contact_id' property, it is the child record of the corresponding + * contact record. + * + * Records can have many children of a given type. + * + * Please refer to the main section of Contacts API for a more detailed explanation and examples. + * + * @section CAPI_SOCIAL_CONTACTS_SVC_VIEW_MODULE_HEADER Required Header + * \#include <contacts.h> + * + * @section CAPI_SOCIAL_CONTACTS_SVC_VIEW_MODULE_contacts_contact _contacts_contact view + * <table> + * <tr> + * <th>Type</th> + * <th>Property ID</th> + * <th>Read, Write</th> + * <th>Description</th> + * </tr> + * <tr><td>string</td><td>_uri</td><td>read only</td><td> View uri for contact </td></tr> + * <tr><td>integer</td><td>id</td><td>read only</td><td></td></tr> + * <tr><td>string</td><td>display_name</td><td>read only</td><td></td></tr> + * <tr><td>integer</td><td>display_source_id</td><td>read only</td><td>The source type of display name contacts_display_name_source_type_e</td></tr> + * <tr><td>integer</td><td>address_book_id</td><td>read, write once</td><td></td></tr> + * <tr><td>string</td><td>ringtone_path</td><td>read, write</td><td></td></tr> + * <tr><td>string</td><td>image_thumbnail_path</td><td>read only</td><td></td></tr> + * <tr><td>boolean</td><td>is_favorite</td><td>read, write</td><td></td></tr> + * <tr><td>boolean</td><td>has_phonenumber</td><td>read only</td><td></td></tr> + * <tr><td>boolean</td><td>has_email</td><td>read only</td><td></td></tr> + * <tr><td>integer</td><td>person_id</td><td>read only</td><td></td></tr> + * <tr><td>string</td><td>uid</td><td>read, write</td><td></td></tr> + * <tr><td>string</td><td>vibration</td><td>read, write</td><td></td></tr> + * <tr><td>integer</td><td>changed_time</td><td>read only</td><td></td></tr> + * <tr><td>record</td><td>name</td><td>read, write</td><td></td></tr> + * <tr><td>record</td><td>company</td><td>read, write</td><td></td></tr> + * <tr><td>record</td><td>note</td><td>read, write</td><td></td></tr> + * <tr><td>record</td><td>number</td><td>read, write</td><td></td></tr> + * <tr><td>record</td><td>email</td><td>read, write</td><td></td></tr> + * <tr><td>record</td><td>event</td><td>read, write</td><td></td></tr> + * <tr><td>record</td><td>messenger</td><td>read, write</td><td></td></tr> + * <tr><td>record</td><td>address</td><td>read, write</td><td></td></tr> + * <tr><td>record</td><td>url</td><td>read, write</td><td></td></tr> + * <tr><td>record</td><td>nickname</td><td>read, write</td><td></td></tr> + * <tr><td>record</td><td>profile</td><td>read, write</td><td></td></tr> + * <tr><td>record</td><td>relationship</td><td>read, write</td><td></td></tr> + * <tr><td>record</td><td>image</td><td>read, write</td><td></td></tr> + * <tr><td>record</td><td>group_relation</td><td>read, write</td><td></td></tr> + * </table> + * + * @section CAPI_SOCIAL_CONTACTS_SVC_VIEW_MODULE_contacts_my_profile _contacts_my_profile view + * <table> + * <tr> + * <th>Type</th> + * <th>Property ID</th> + * <th>Read, Write</th> + * <th>Description</th> + * </tr> + * <tr><td>string</td><td>_uri</td><td>read only</td><td> View uri for my profile </td></tr> + * <tr><td>integer</td><td>id</td><td>read only</td><td></td></tr> + * <tr><td>string</td><td>display_name</td><td>read only</td><td></td></tr> + * <tr><td>integer</td><td>address_book_id</td><td>read, write once</td><td></td></tr> + * <tr><td>string</td><td>image_thumbnail_path</td><td>read only</td><td></td></tr> + * <tr><td>string</td><td>uid</td><td>read, write</td><td></td></tr> + * <tr><td>integer</td><td>changed_time</td><td>read only</td><td></td></tr> + * <tr><td>record</td><td>name</td><td>read, write</td><td></td></tr> + * <tr><td>record</td><td>company</td><td>read, write</td><td></td></tr> + * <tr><td>record</td><td>note</td><td>read, write</td><td></td></tr> + * <tr><td>record</td><td>number</td><td>read, write</td><td></td></tr> + * <tr><td>record</td><td>email</td><td>read, write</td><td></td></tr> + * <tr><td>record</td><td>event</td><td>read, write</td><td></td></tr> + * <tr><td>record</td><td>messenger</td><td>read, write</td><td></td></tr> + * <tr><td>record</td><td>address</td><td>read, write</td><td></td></tr> + * <tr><td>record</td><td>url</td><td>read, write</td><td></td></tr> + * <tr><td>record</td><td>nickname</td><td>read, write</td><td></td></tr> + * <tr><td>record</td><td>profile</td><td>read, write</td><td></td></tr> + * <tr><td>record</td><td>relationship</td><td>read, write</td><td></td></tr> + * <tr><td>record</td><td>image</td><td>read, write</td><td></td></tr> + * </table> + * + * @section CAPI_SOCIAL_CONTACTS_SVC_VIEW_MODULE_contacts_simple_contact _contacts_simple_contact view + * <table> + * <tr> + * <th>Type</th> + * <th>Property ID</th> + * <th>Read, Write</th> + * <th>Description</th> + * </tr> + * <tr><td>string</td><td>_uri</td><td>read only</td><td> </td></tr> + * <tr><td>integer</td><td>id</td><td>read only</td><td> </td></tr> + * <tr><td>string</td><td>display_name</td><td>read only</td><td> </td></tr> + * <tr><td>integer</td><td>display_source_id</td><td>read only</td><td> </td></tr> + * <tr><td>integer</td><td>address_book_id</td><td>read, write once</td><td> </td></tr> + * <tr><td>string</td><td>ringtone_path</td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td>image_thumbnail_path</td><td>read only</td><td> </td></tr> + * <tr><td>boolean</td><td>is_favorite</td><td>read, write</td><td> </td></tr> + * <tr><td>boolean</td><td>has_phonenumber</td><td>read only</td><td> </td></tr> + * <tr><td>boolean</td><td>has_email</td><td>read only</td><td> </td></tr> + * <tr><td>integer</td><td>person_id</td><td>read only</td><td> </td></tr> + * <tr><td>string</td><td>uid</td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td>vibration</td><td>read, write</td><td> </td></tr> + * <tr><td>integer</td><td>changed_time</td><td>read only</td><td> </td></tr> + * </table> + * + * @section CAPI_SOCIAL_CONTACTS_SVC_VIEW_MODULE_contacts_person _contacts_person view + * <table> + * <tr> + * <th>Type</th> + * <th>Property ID</th> + * <th>Read, Write</th> + * <th>Description</th> + * </tr> + * <tr><td>string</td><td>_uri</td><td>read only</td><td> </td></tr> + * <tr><td>integer</td><td> id </td><td>read only</td><td> </td></tr> + * <tr><td>string</td><td> display_name </td><td>read only</td><td> </td></tr> + * <tr><td>string</td><td> display_name_index </td><td>read only</td><td> The first character of first string for grouping. This is normalized using icu. </td></tr> + * <tr><td>integer</td><td> display_contact_id </td><td>read only</td><td> </td></tr> + * <tr><td>string</td><td> ringtone_path </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> image_thumbnail_path </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> vibration </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> status </td><td>read only</td><td> </td></tr> + * <tr><td>boolean</td><td> is_favorite </td><td>read, write</td><td> </td></tr> + * <tr><td>double</td><td> favorite_priority </td><td> filter only </td><td> The priority of favorite contacts. You can not set the value but you can use it as sorting key. </td></tr> + * <tr><td>integer</td><td> link_count </td><td>read, write</td><td> </td></tr> + * <tr><td>integer</td><td> account_id1 </td><td>read, write</td><td> </td></tr> + * <tr><td>integer</td><td> account_id2 </td><td>read, write</td><td> </td></tr> + * <tr><td>integer</td><td> account_id3 </td><td>read, write</td><td> </td></tr> + * <tr><td>integer</td><td> addressbook_ids </td><td>read, write</td><td> </td></tr> + * <tr><td>boolean</td><td> has_phonenumber </td><td>read only</td><td> </td></tr> + * <tr><td>boolean</td><td> has_email </td><td>read only</td><td> </td></tr> + * </table> + * + * @section CAPI_SOCIAL_CONTACTS_SVC_VIEW_MODULE_contacts_address_book _contacts_address_book view + * <table> + * <tr> + * <th>Type</th> + * <th>Property ID</th> + * <th>Read, Write</th> + * <th>Description</th> + * </tr> + * <tr><td>string</td><td>_uri</td><td>read only</td><td> </td></tr> + * <tr><td>integer</td><td> id </td><td>read only</td><td> </td></tr> + * <tr><td>integer</td><td> account_id </td><td>read, write once</td><td> </td></tr> + * <tr><td>string</td><td> name </td><td>read, write</td><td> It can not be NULL. Duplicate names are not allowed. </td></tr> + * <tr><td>integer</td><td> mode </td><td>read, write</td><td> </td></tr> + * </table> + * + * @section CAPI_SOCIAL_CONTACTS_SVC_VIEW_MODULE_contacts_group _contacts_group view + * <table> + * <tr> + * <th>Type</th> + * <th>Property ID</th> + * <th>Read, Write</th> + * <th>Description</th> + * </tr> + * <tr><td>string</td><td>_uri</td><td>read only</td><td> </td></tr> + * <tr><td>integer</td><td> id </td><td>read only</td><td> </td></tr> + * <tr><td>integer</td><td> address_book_id </td><td>read, write once</td><td> </td></tr> + * <tr><td>string</td><td> name </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> ringtone_path </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> image_path </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> vibration </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> system_id </td><td>read, write</td><td> </td></tr> + * <tr><td>boolean</td><td> is_read_only </td><td>read only</td><td> </td></tr> + * </table> + * + * @section CAPI_SOCIAL_CONTACTS_SVC_VIEW_MODULE_contacts_name _contacts_name view + * <table> + * <tr> + * <th>Type</th> + * <th>Property ID</th> + * <th>Read, Write</th> + * <th>Description</th> + *</tr> + * <tr><td>string</td><td>_uri</td><td>read only</td><td> </td></tr> + * <tr><td>integer</td><td> id </td><td>read only</td><td> </td></tr> + * <tr><td>integer</td><td> contact_id </td><td>read, write once</td><td> </td></tr> + * <tr><td>string</td><td> first </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> last </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> addition </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> suffix </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> prefix </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> phonetic_first </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> phonetic_middle </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> phonetic_last </td><td>read, write</td><td> </td></tr> + * </table> + * + * @section CAPI_SOCIAL_CONTACTS_SVC_VIEW_MODULE_contacts_number _contacts_number view + * <table> + * <tr> + * <th>Type</th> + * <th>Property ID</th> + * <th>Read, Write</th> + * <th>Description</th> + * </tr> + * <tr><td>string</td><td>_uri</td><td>read only</td><td> </td></tr> + * <tr><td>integer</td><td> id </td><td>read only</td><td> </td></tr> + * <tr><td>integer</td><td> contact_id </td><td>read, write once</td><td> </td></tr> + * <tr><td>integer</td><td> type </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> label </td><td>read, write</td><td> </td></tr> + * <tr><td>boolean</td><td> is_default </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> number </td><td>read, write</td><td> </td></tr> + * </table> + * + * @section CAPI_SOCIAL_CONTACTS_SVC_VIEW_MODULE_contacts_email _contacts_email view + * <table> + * <tr> + * <th>Type</th> + * <th>Property ID</th> + * <th>Read, Write</th> + * <th>Description</th> + * </tr> + * <tr><td>string</td><td>_uri</td><td>read only</td><td> </td></tr> + * <tr><td>integer</td><td> id </td><td>read only</td><td> </td></tr> + * <tr><td>integer</td><td> contact_id </td><td>read, write once</td><td> </td></tr> + * <tr><td>integer</td><td> type </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> label </td><td>read, write</td><td> </td></tr> + * <tr><td>boolean</td><td> is_default </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> email </td><td>read, write</td><td> </td></tr> + * </table> + * + * @section CAPI_SOCIAL_CONTACTS_SVC_VIEW_MODULE_contacts_address _contacts_address view + * <table> + * <tr> + * <th>Type</th> + * <th>Property ID</th> + * <th>Read, Write</th> + * <th>Description</th> + * </tr> + * <tr><td>string</td><td>_uri</td><td>read only</td><td> </td></tr> + * <tr><td>integer</td><td> id </td><td>read only</td><td> </td></tr> + * <tr><td>integer</td><td> contact_id </td><td>read, write once</td><td> </td></tr> + * <tr><td>integer</td><td> type </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> label </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> postbox </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> postal_code </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> region </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> locality </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> street </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> country </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> extend </td><td>read, write</td><td> </td></tr> + * <tr><td>boolean</td><td> is_default </td><td>read, write</td><td> </td></tr> + * </table> + * + * @section CAPI_SOCIAL_CONTACTS_SVC_VIEW_MODULE_contacts_note _contacts_note view + * <table> + * <tr> + * <th>Type</th> + * <th>Property ID</th> + * <th>Read, Write</th> + * <th>Description</th> + * </tr> + * <tr><td>string</td><td>_uri</td><td>read only</td><td> </td></tr> + * <tr><td>integer</td><td> id </td><td>read only</td><td> </td></tr> + * <tr><td>integer</td><td> contact_id </td><td>read, write once</td><td> </td></tr> + * <tr><td>string</td><td> note </td><td>read, write</td><td> </td></tr> + * </table> + * + * @section CAPI_SOCIAL_CONTACTS_SVC_VIEW_MODULE_contacts_url _contacts_url view + * <table> + * <tr> + * <th>Type</th> + * <th>Property ID</th> + * <th>Read, Write</th> + * <th>Description</th> + * </tr> + * <tr><td>string</td><td>_uri</td><td>read only</td><td> </td></tr> + * <tr><td>integer</td><td> id </td><td>read only</td><td> </td></tr> + * <tr><td>integer</td><td> contact_id </td><td>read, write once</td><td> </td></tr> + * <tr><td>integer</td><td> type </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> label </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> url </td><td>read, write</td><td> </td></tr> + * </table> + * + * @section CAPI_SOCIAL_CONTACTS_SVC_VIEW_MODULE_contacts_event _contacts_event view + * <table> + * <tr> + * <th>Type</th> + * <th>Property ID</th> + * <th>Read, Write</th> + * <th>Description</th> + * </tr> + * <tr><td>string</td><td>_uri</td><td>read only</td><td> </td></tr> + * <tr><td>integer</td><td> id </td><td>read only</td><td> </td></tr> + * <tr><td>integer</td><td> contact_id </td><td>read, write once</td><td> </td></tr> + * <tr><td>integer</td><td> type </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> label </td><td>read, write</td><td> </td></tr> + * <tr><td>integer</td><td> date </td><td>read, write</td><td> </td></tr> + * <tr><td>integer</td><td> is_lunar </td><td>read, write</td><td> </td></tr> + * <tr><td>integer</td><td> lunar_date </td><td>read, write</td><td> </td></tr> + * </table> + * + * @section CAPI_SOCIAL_CONTACTS_SVC_VIEW_MODULE_contacts_relationship _contacts_relationship view + * <table> + * <tr> + * <th>Type</th> + * <th>Property ID</th> + * <th>Read, Write</th> + * <th>Description</th> + * </tr> + * <tr><td>string</td><td>_uri</td><td>read only</td><td> </td></tr> + * <tr><td>integer</td><td> id </td><td>read only</td><td> </td></tr> + * <tr><td>integer</td><td> contact_id </td><td>read, write once</td><td> </td></tr> + * <tr><td>integer</td><td> type </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> label </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> name </td><td>read, write</td><td> </td></tr> + * </table> + * + * @section CAPI_SOCIAL_CONTACTS_SVC_VIEW_MODULE_contacts_image _contacts_image view + * <table> + * <tr> + * <th>Type</th> + * <th>Property ID</th> + * <th>Read, Write</th> + * <th>Description</th> + * </tr> + * <tr><td>string</td><td>_uri</td><td>read only</td><td> </td></tr> + * <tr><td>integer</td><td> id </td><td>read only</td><td> </td></tr> + * <tr><td>integer</td><td> contact_id </td><td>read, write once</td><td> </td></tr> + * <tr><td>integer</td><td> type </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> label </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> path </td><td>read, write</td><td> </td></tr> + * </table> + * + * @section CAPI_SOCIAL_CONTACTS_SVC_VIEW_MODULE_contacts_company _contacts_company view + * <table> + * <tr> + * <th>Type</th> + * <th>Property ID</th> + * <th>Read, Write</th> + * <th>Description</th> + * </tr> + * <tr><td>string</td><td>_uri</td><td>read only</td><td> </td></tr> + * <tr><td>integer</td><td> id </td><td>read only</td><td> </td></tr> + * <tr><td>integer</td><td> contact_id </td><td>read, write once</td><td> </td></tr> + * <tr><td>integer</td><td> type </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> label </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> name </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> department </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> job_title </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> assistant_name </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> role </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> logo </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> location </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> description </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> phonetic_name </td><td>read, write</td><td> </td></tr> + * </table> + * + * @section CAPI_SOCIAL_CONTACTS_SVC_VIEW_MODULE_contacts_nickname _contacts_nickname view + * <table> + * <tr> + * <th>Type</th> + * <th>Property ID</th> + * <th>Read, Write</th> + * <th>Description</th> + * </tr> + * <tr><td>string</td><td>_uri</td><td>read only</td><td> </td></tr> + * <tr><td>integer</td><td> id </td><td>read only</td><td> </td></tr> + * <tr><td>integer</td><td> contact_id </td><td>read, write once</td><td> </td></tr> + * <tr><td>string</td><td> nickname </td><td>read, write</td><td> </td></tr> + * </table> + * + * @section CAPI_SOCIAL_CONTACTS_SVC_VIEW_MODULE_contacts_messenger _contacts_messenger view + * <table> + * <tr> + * <th>Type</th> + * <th>Property ID</th> + * <th>Read, Write</th> + * <th>Description</th> + * </tr> + * <tr><td>string</td><td>_uri</td><td>read only</td><td> </td></tr> + * <tr><td>integer</td><td> id </td><td>read only</td><td> </td></tr> + * <tr><td>integer</td><td> contact_id </td><td>read, write once</td><td> </td></tr> + * <tr><td>integer</td><td> type </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> label </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> im_id </td><td>read, write</td><td> </td></tr> + * </table> + * + * @section CAPI_SOCIAL_CONTACTS_SVC_VIEW_MODULE_contacts_extension _contacts_extension view + * <table> + * <tr> + * <th>Type</th> + * <th>Property ID</th> + * <th>Read, Write</th> + * <th>Description</th> + * </tr> + * <tr><td>string</td><td>_uri</td><td>read only</td><td> </td></tr> + * <tr><td>integer</td><td> id </td><td>read only</td><td> </td></tr> + * <tr><td>integer</td><td> contact_id </td><td>read, write once</td><td> </td></tr> + * <tr><td>integer</td><td> data1 </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> data2 </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> data3 </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> data4 </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> data5 </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> data6 </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> data7 </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> data8 </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> data9 </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> data10 </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> data11 </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> data12 </td><td>read, write</td><td> </td></tr> + * </table> + * + * @section CAPI_SOCIAL_CONTACTS_SVC_VIEW_MODULE_contacts_sdn _contacts_sdn view + * <table> + * <tr> + * <th>Type</th> + * <th>Property ID</th> + * <th>Read, Write</th> + * <th>Description</th> + * </tr> + * <tr><td>string</td><td>_uri</td><td>read only</td><td> </td></tr> + * <tr><td>integer</td><td> id </td><td>read only</td><td> </td></tr> + * <tr><td>string</td><td> name </td><td>read, write once</td><td> </td></tr> + * <tr><td>string</td><td> number </td><td>read, write</td><td> </td></tr> + * </table> + * + * @section CAPI_SOCIAL_CONTACTS_SVC_VIEW_MODULE_contacts_profile _contacts_profile view + * <table> + * <tr> + * <th>Type</th> + * <th>Property ID</th> + * <th>Read, Write</th> + * <th>Description</th> + * </tr> + * <tr><td>string</td><td>_uri</td><td>read only</td><td> </td></tr> + * <tr><td>integer</td><td> id </td><td>read only</td><td> </td></tr> + * <tr><td>integer</td><td> contact_id </td><td>read, write once</td><td> </td></tr> + * <tr><td>integer</td><td> type </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> label </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> uid </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> text </td><td>read, write</td><td> </td></tr> + * <tr><td>integer</td><td> order </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> appsvc_operation </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> data1 </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> data2 </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> data3 </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> data4 </td><td>read, write</td><td> </td></tr> + * </table> + * + * @section CAPI_SOCIAL_CONTACTS_SVC_VIEW_MODULE_contacts_activity _contacts_activity view + * <table> + * <tr> + * <th>Type</th> + * <th>Property ID</th> + * <th>Read, Write</th> + * <th>Description</th> + * </tr> + * <tr><td>string</td><td>_uri</td><td>read only</td><td> </td></tr> + * <tr><td>integer</td><td> id </td><td>read only</td><td> </td></tr> + * <tr><td>integer</td><td> contact_id </td><td>read, write once</td><td> </td></tr> + * <tr><td>string</td><td> source_name </td><td>read, write</td><td> </td></tr> + * <tr><td>int</td><td> timestamp </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> status </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> sync_data1 </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> sync_data2 </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> sync_data3 </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> sync_data4 </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> photo </td><td>read, write</td><td> </td></tr> + * </table> + * + * @section CAPI_SOCIAL_CONTACTS_SVC_VIEW_MODULE_contacts_activity_photo _contacts_activity_photo view + * <table> + * <tr> + * <th>Type</th> + * <th>Property ID</th> + * <th>Read, Write</th> + * <th>Description</th> + * </tr> + * <tr><td>string</td><td>_uri</td><td>read only</td><td> </td></tr> + * <tr><td>integer</td><td> id </td><td>read only</td><td> </td></tr> + * <tr><td>integer</td><td> activity_id </td><td>read, write once</td><td> </td></tr> + * <tr><td>string</td><td> photo_url </td><td>read, write</td><td> </td></tr> + * <tr><td>integer</td><td> sort_index </td><td>read, write</td><td> </td></tr> + * </table> + * + * @section CAPI_SOCIAL_CONTACTS_SVC_VIEW_MODULE_contacts_speeddial _contacts_speeddial view + * <table> + * <tr> + * <th>Type</th> + * <th>Property ID</th> + * <th>Read, Write</th> + * <th>Description</th> + * </tr> + * <tr><td>string</td><td>_uri</td><td>read only</td><td> </td></tr> + * <tr><td>integer</td><td> speeddial_number </td><td>read, write</td><td> </td></tr> + * <tr><td>integer</td><td> number_id </td><td>read, write</td><td> </td></tr> + * <tr><td>string</td><td> number </td><td>read only</td><td> </td></tr> + * <tr><td>string</td><td> number_label </td><td>read only</td><td> </td></tr> + * <tr><td>integer</td><td> number_type </td><td>read only</td><td> </td></tr> + * <tr><td>integer</td><td> person_id </td><td>read only</td><td> </td></tr> + * <tr><td>string</td><td> display_name </td><td>read only</td><td> </td></tr> + * <tr><td>string</td><td> image_thumbnail_path </td><td>read only</td><td> </td></tr> + * </table> + * + * @section CAPI_SOCIAL_CONTACTS_SVC_VIEW_MODULE_contacts_phone_log _contacts_phone_log view + * <table> + * <tr> + * <th>Type</th> + * <th>Property ID</th> + * <th>Read, Write</th> + * <th>Description</th> + * </tr> + * <tr><td>string</td><td>_uri</td><td>read only</td><td> </td></tr> + * <tr><td>integer</td><td> id </td><td>read only</td><td> </td></tr> + * <tr><td>integer</td><td> person_id </td><td>read, write once </td><td> </td></tr> + * <tr><td>string</td><td> address </td><td>read, write once </td><td> </td></tr> + * <tr><td>integer</td><td> log_time </td><td>read, write once</td><td> </td></tr> + * <tr><td>integer</td><td> log_type </td><td>read, write</td><td> </td></tr> + * <tr><td>integer</td><td> extra_data1 </td><td>read, write once</td><td> You can set the related integer data(e.g. message_id, email_id) or duration of call. </td></tr> + * <tr><td>string</td><td> extra_data2 </td><td>read, write once</td><td> You can set the related string data. e.g.) short message, subject</td></tr> + * </table> + * +* <br><br> +* Read-only View URIs +* <br> + * + * @section CAPI_SOCIAL_CONTACTS_SVC_VIEW_MODULE_contacts_contact_updated_info _contacts_contact_updated_info view + * <table> + * <tr> + * <th>Type</th> + * <th>Property ID</th> + * <th>Primay Key</th> + * <th>Description</th> + * </tr> + * <tr><td>string</td><td>_uri</td><td></td><td> </td></tr> + * <tr><td>integer</td><td> contact_id </td><td>*</td><td> </td></tr> + * <tr><td>integer</td><td> address_book_id </td><td></td><td> </td></tr> + * <tr><td>integer</td><td> type </td><td></td><td> </td></tr> + * </table> + * + * @section CAPI_SOCIAL_CONTACTS_SVC_VIEW_MODULE_contacts_group_updated_info _contacts_group_updated_info view + * <table> + * <tr> + * <th>Type</th> + * <th>Property ID</th> + * <th>Primary Key</th> + * <th>Description</th> + * </tr> + * <tr><td>string</td><td>_uri</td><td></td><td> </td></tr> + * <tr><td>integer</td><td> group_id </td><td>*</td><td> </td></tr> + * <tr><td>integer</td><td> address_book_id </td><td></td><td> </td></tr> + * <tr><td>integer</td><td> type </td><td></td><td> </td></tr> + * </table> + * + * @section CAPI_SOCIAL_CONTACTS_SVC_VIEW_MODULE_contacts_person_number _contacts_person_number view + * <table> + * <tr> + * <th>Type</th> + * <th>Property ID</th> + * <th>Primary Key</th> + * <th>Description</th> + * </tr> + * <tr><td>string</td><td>_uri</td><td></td><td> </td></tr> + * <tr><td>integer</td><td> person_id </td><td></td><td> </td></tr> + * <tr><td>string</td><td> display_name </td><td></td><td> </td></tr> + * <tr><td>string</td><td> display_name_index </td><td></td><td> </td></tr> + * <tr><td>integer</td><td> display_contact_id </td><td></td><td> </td></tr> + * <tr><td>string</td><td> ringtone_path </td><td></td><td> </td></tr> + * <tr><td>string</td><td> image_thumbnail_path </td><td></td><td> </td></tr> + * <tr><td>string</td><td> vibration </td><td></td><td> </td></tr> + * <tr><td>boolean</td><td> is_favorite </td><td></td><td> </td></tr> + * <tr><td>boolean</td><td> has_phonenumber </td><td></td><td> </td></tr> + * <tr><td>boolean</td><td> has_email </td><td></td><td> </td></tr> + * <tr><td>integer</td><td> number_id </td><td>*</td><td> </td></tr> + * <tr><td>integer</td><td> type </td><td></td><td> </td></tr> + * <tr><td>string</td><td> label </td><td></td><td> </td></tr> + * <tr><td>boolean</td><td> is_primary_default </td><td></td><td> </td></tr> + * <tr><td>string</td><td> number </td><td></td><td> </td></tr> + * <tr><td>string</td><td> number_filter </td><td></td><td> If you add filter with this property, the string will be normalized internally and the match rule will be applied CONTACTS_MATCH_EXACTLY </td></tr> + * </table> + * + * @section CAPI_SOCIAL_CONTACTS_SVC_VIEW_MODULE_contacts_person_email _contacts_person_email view + * <table> + * <tr> + * <th>Type</th> + * <th>Property ID</th> + * <th>Primary Key</th> + * <th>Description</th> + * </tr> + * <tr><td>string</td><td>_uri</td><td></td><td> </td></tr> + * <tr><td>integer</td><td> person_id </td><td></td><td> </td></tr> + * <tr><td>string</td><td> display_name </td><td></td><td> </td></tr> + * <tr><td>string</td><td> display_name_index </td><td></td><td> </td></tr> + * <tr><td>integer</td><td> display_contact_id </td><td></td><td> </td></tr> + * <tr><td>string</td><td> ringtone_path </td><td></td><td> </td></tr> + * <tr><td>string</td><td> image_thumbnail_path </td><td></td><td> </td></tr> + * <tr><td>string</td><td> vibration </td><td></td><td> </td></tr> + * <tr><td>boolean</td><td> is_favorite </td><td></td><td> </td></tr> + * <tr><td>boolean</td><td> has_phonenumber </td><td></td><td> </td></tr> + * <tr><td>boolean</td><td> has_email </td><td></td><td> </td></tr> + * <tr><td>integer</td><td> email_id </td><td>*</td><td> </td></tr> + * <tr><td>integer</td><td> type </td><td></td><td> </td></tr> + * <tr><td>string</td><td> label </td><td></td><td> </td></tr> + * <tr><td>boolean</td><td> is_primary_default </td><td></td><td> </td></tr> + * <tr><td>string</td><td> email </td><td></td><td> </td></tr> + * </table> + * + * @section CAPI_SOCIAL_CONTACTS_SVC_VIEW_MODULE_contacts_person_grouprel _contacts_person_grouprel view + * <table> + * <tr> + * <th>Type</th> + * <th>Property ID</th> + * <th>Primary Key</th> + * <th>Description</th> + * </tr> + * <tr><td>string</td><td>_uri</td><td></td><td> </td></tr> + * <tr><td>integer</td><td> person_id </td><td>*</td><td> </td></tr> + * <tr><td>string</td><td> display_name </td><td></td><td> </td></tr> + * <tr><td>string</td><td> display_name_index </td><td></td><td> </td></tr> + * <tr><td>integer</td><td> display_contact_id </td><td></td><td> </td></tr> + * <tr><td>string</td><td> ringtone_path </td><td></td><td> </td></tr> + * <tr><td>string</td><td> image_thumbnail_path </td><td></td><td> </td></tr> + * <tr><td>string</td><td> vibration </td><td></td><td> </td></tr> + * <tr><td>string</td><td> status </td><td></td><td> </td></tr> + * <tr><td>boolean</td><td> is_favorite </td><td></td><td> </td></tr> + * <tr><td>integer</td><td> link_count </td><td></td><td> </td></tr> + * <tr><td>integer</td><td> account_id1 </td><td></td><td> </td></tr> + * <tr><td>integer</td><td> account_id2 </td><td></td><td> </td></tr> + * <tr><td>integer</td><td> account_id3 </td><td></td><td> </td></tr> + * <tr><td>integer</td><td> addressbook_ids </td><td></td><td> </td></tr> + * <tr><td>boolean</td><td> has_phonenumber </td><td></td><td> </td></tr> + * <tr><td>boolean</td><td> has_email </td><td></td><td> </td></tr> + * <tr><td>integer</td><td> address_book_id </td><td></td><td> </td></tr> + * <tr><td>integer</td><td> group_id </td><td>*</td><td> </td></tr> + * <tr><td>string</td><td> group_name </td><td></td><td> </td></tr> + * </table> + * + * @section CAPI_SOCIAL_CONTACTS_SVC_VIEW_MODULE_contacts_person_phone_log _contacts_person_phone_log view + * <table> + * <tr> + * <th>Type</th> + * <th>Property ID</th> + * <th>Primary Key</th> + * <th>Description</th> + * </tr> + * <tr><td>string</td><td>_uri</td><td></td><td> </td></tr> + * <tr><td>integer</td><td> person_id </td><td> * </td><td> </td></tr> + * <tr><td>string</td><td> display_name </td><td></td><td> </td></tr> + * <tr><td>string</td><td> image_thumbnail_path </td><td></td><td> </td></tr> + * <tr><td>integer</td><td> log_id </td><td> * </td><td> </td></tr> + * <tr><td>string</td><td> address </td><td></td><td> </td></tr> + * <tr><td>integer</td><td> log_time </td><td></td><td> </td></tr> + * <tr><td>integer</td><td> log_type </td><td></td><td> </td></tr> + * <tr><td>integer</td><td> extra_data1 </td><td></td><td> </td></tr> + * <tr><td>string</td><td> extra_data2 </td><td></td><td> </td></tr> + * </table> + * + * @section CAPI_SOCIAL_CONTACTS_SVC_VIEW_MODULE_contacts_person_usage _contacts_person_usage view + * <table> + * <tr> + * <th>Type</th> + * <th>Property ID</th> + * <th>Primary Key</th> + * <th>Description</th> + * </tr> + * <tr><td>string</td><td>_uri</td><td></td><td> </td></tr> + * <tr><td>integer</td><td> person_id </td><td>*</td><td> </td></tr> + * <tr><td>string</td><td> display_name </td><td></td><td> </td></tr> + * <tr><td>string</td><td> display_name_index </td><td></td><td> </td></tr> + * <tr><td>integer</td><td> display_contact_id </td><td></td><td> </td></tr> + * <tr><td>string</td><td> ringtone_path </td><td></td><td> </td></tr> + * <tr><td>string</td><td> image_thumbnail_path </td><td></td><td> </td></tr> + * <tr><td>string</td><td> vibration </td><td></td><td> </td></tr> + * <tr><td>boolean</td><td> is_favorite </td><td></td><td> </td></tr> + * <tr><td>boolean</td><td> has_phonenumber </td><td></td>><td> </td></tr> + * <tr><td>boolean</td><td> has_email </td><td></td><td> </td></tr> + * <tr><td>integer</td><td> usage_type </td><td></td>*<td> </td></tr> + * <tr><td>integer</td><td> times_used </td><td></td><td> </td></tr> + * </table> + * + * @section CAPI_SOCIAL_CONTACTS_SVC_VIEW_MODULE_contacts_contact_number _contacts_contact_number view + * <table> + * <tr> + * <th>Type</th> + * <th>Property ID</th> + * <th>Primary Key</th> + * <th>Description</th> + * </tr> + * <tr><td>string</td><td>_uri</td><td></td><td> </td></tr> + * <tr><td>integer</td><td>contact_id</td><td></td><td> </td></tr> + * <tr><td>string</td><td>display_name</td><td></td><td> </td></tr> + * <tr><td>integer</td><td>display_source_type</td><td></td><td> </td></tr> + * <tr><td>integer</td><td>address_book_id</td><td></td><td> </td></tr> + * <tr><td>integer</td><td>person_id</td><td></td><td> </td></tr> + * <tr><td>string</td><td>ringtone_path</td><td></td><td> </td></tr> + * <tr><td>string</td><td>image_thumbnail_path</td><td></td><td> </td></tr> + * <tr><td>integer</td><td> number_id </td><td>*</td><td> </td></tr> + * <tr><td>integer</td><td> type </td><td></td><td> </td></tr> + * <tr><td>string</td><td> label </td><td></td><td> </td></tr> + * <tr><td>boolean</td><td> is_ default </td><td></td><td> </td></tr> + * <tr><td>string</td><td> number </td><td></td><td> </td></tr> + * <tr><td>string</td><td> number_filter </td><td></td><td> If you add filter with this property, the string will be normalized internally and the match rule will be applied CONTACTS_MATCH_EXACTLY </td></tr> + * </table> + * + * @section CAPI_SOCIAL_CONTACTS_SVC_VIEW_MODULE_contacts_contact_email _contacts_contact_email view + * <table> + * <tr> + * <th>Type</th> + * <th>Property ID</th> + * <th>Primary Key</th> + * <th>Description</th> + * </tr> + * <tr><td>string</td><td>_uri</td><td></td><td> </td></tr> + * <tr><td>integer</td><td>contact_id</td><td></td><td> </td></tr> + * <tr><td>string</td><td>display_name</td><td></td><td> </td></tr> + * <tr><td>integer</td><td>display_source_type</td><td></td><td> </td></tr> + * <tr><td>integer</td><td>address_book_id</td><td></td><td> </td></tr> + * <tr><td>integer</td><td>person_id</td><td></td><td> </td></tr> + * <tr><td>string</td><td>ringtone_path</td><td></td><td> </td></tr> + * <tr><td>string</td><td>image_thumbnail_path</td><td></td><td> </td></tr> + * <tr><td>integer</td><td> email_id </td><td>*</td><td> </td></tr> + * <tr><td>integer</td><td> type </td><td></td><td> </td></tr> + * <tr><td>string</td><td> label </td><td></td><td> </td></tr> + * <tr><td>boolean</td><td> is_ default </td><td></td><td> </td></tr> + * <tr><td>string</td><td> email </td><td></td><td> </td></tr> + * </table> + * + * @section CAPI_SOCIAL_CONTACTS_SVC_VIEW_MODULE_contacts_contact_grouprel _contacts_contact_grouprel view + * <table> + * <tr> + * <th>Type</th> + * <th>Property ID</th> + * <th>Primary Key</th> + * <th>Description</th> + * </tr> + * <tr><td>string</td><td>_uri</td><td></td><td> </td></tr> + * <tr><td>integer</td><td>contact_id</td><td>*</td><td> </td></tr> + * <tr><td>string</td><td>display_name</td><td></td><td> </td></tr> + * <tr><td>integer</td><td>display_source_type</td><td></td><td> </td></tr> + * <tr><td>integer</td><td>address_book_id</td><td></td><td> </td></tr> + * <tr><td>integer</td><td>person_id</td><td></td><td> </td></tr> + * <tr><td>string</td><td>ringtone_path</td><td></td><td> </td></tr> + * <tr><td>string</td><td>image_thumbnail_path</td><td></td><td> </td></tr> + * <tr><td>integer</td><td> group_id </td><td>*</td><td> </td></tr> + * <tr><td>string</td><td> group_name </td><td></td><td> </td></tr> + * </table> + * + * @section CAPI_SOCIAL_CONTACTS_SVC_VIEW_MODULE_contacts_contact_activity _contacts_contact_activity view + * <table> + * <tr> + * <th>Type</th> + * <th>Property ID</th> + * <th>Primary Key</th> + * <th>Description</th> + * </tr> + * <tr><td>string</td><td>_uri</td><td></td><td> </td></tr> + * <tr><td>integer</td><td>contact_id</td><td></td><td> </td></tr> + * <tr><td>string</td><td>display_name</td><td></td><td> </td></tr> + * <tr><td>integer</td><td>display_source_type</td><td></td><td> </td></tr> + * <tr><td>integer</td><td>address_book_id</td><td></td><td> </td></tr> + * <tr><td>integer</td><td>person_id</td><td></td><td> </td></tr> + * <tr><td>string</td><td>ringtone_path</td><td></td><td> </td></tr> + * <tr><td>string</td><td>image_thumbnail_path</td><td></td><td> </td></tr> + * <tr><td>integer</td><td> activity_id </td><td>*</td><td> </td></tr> + * <tr><td>string</td><td> source_name </td><td></td><td> </td></tr> + * <tr><td>string</td><td> status </td><td></td><td> </td></tr> + * <tr><td>integer</td><td> timestamp </td><td></td><td> </td></tr> + * <tr><td>string</td><td> sync_data1 </td><td></td><td> </td></tr> + * <tr><td>string</td><td> sync_data2 </td><td></td><td> </td></tr> + * <tr><td>string</td><td> sync_data3 </td><td></td><td> </td></tr> + * <tr><td>string</td><td> sync_data4 </td><td></td><td> </td></tr> + * </table> + * + * @section CAPI_SOCIAL_CONTACTS_SVC_VIEW_MODULE_contacts_phone_log_number _contacts_phone_log_number view + * <table> + * <tr> + * <th>Type</th> + * <th>Property ID</th> + * <th>Primary Key</th> + * <th>Description</th> + * </tr> + * <tr><td>string</td><td>_uri</td><td></td><td> </td></tr> + * <tr><td>string</td><td> number </td><td> * </td><td> </td></tr> + * </table> + * + * @section CAPI_SOCIAL_CONTACTS_SVC_VIEW_MODULE_contacts_phone_log_stat _contacts_phone_log_stat view + * <table> + * <tr> + * <th>Type</th> + * <th>Property ID</th> + * <th>Primary Key</th> + * <th>Description</th> + * </tr> + * <tr><td>string</td><td>_uri</td><td></td><td> </td></tr> + * <tr><td>integer</td><td> log_count </td><td> </td><td> </td></tr> + * <tr><td>integer</td><td> log_type </td><td> * </td><td> </td></tr> + * </table> + */ + diff --git a/include/contacts_activity.h b/include/contacts_activity.h new file mode 100644 index 0000000..815d6fa --- /dev/null +++ b/include/contacts_activity.h @@ -0,0 +1,78 @@ +/*
+ * Contacts Service
+ *
+ * Copyright (c) 2010 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#ifndef __TIZEN_SOCIAL_CONTACTS_ACTIVITY_H__
+#define __TIZEN_SOCIAL_CONTACTS_ACTIVITY_H__
+
+#ifndef API
+#define API __attribute__ ((visibility("default")))
+#endif
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/**
+ * @addtogroup CAPI_SOCIAL_CONTACTS_SVC_ACTIVITY_MODULE
+ * @{
+ */
+
+/**
+ * @brief Deletes activity record from the contacts database by contact id.
+ *
+ * @param[in] contact_id The contact ID to delete
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #CONTACTS_ERROR_NONE Successful
+ * @retval #CONTACTS_ERROR_DB Database operation failure
+ *
+ * @pre This function requires an open connection to contacts service by contacts_connect2().
+ *
+ * @see contacts_connect2()
+ */
+API int contacts_activity_delete_by_contact_id(int contact_id);
+
+/**
+ * @brief Deletes activity record from the contacts database by account id.
+ *
+ * @param[in] account_id The account ID to delete
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #CONTACTS_ERROR_NONE Successful
+ * @retval #CONTACTS_ERROR_DB Database operation failure
+ *
+ * @pre This function requires an open connection to contacts service by contacts_connect2().
+ *
+ * @see contacts_connect2()
+ */
+API int contacts_activity_delete_by_account_id(int account_id);
+
+
+/**
+ * @}
+ */
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif //__TIZEN_SOCIAL_CONTACTS_ACTIVITY_H__
+
diff --git a/include/contacts_db.h b/include/contacts_db.h new file mode 100755 index 0000000..73de2ca --- /dev/null +++ b/include/contacts_db.h @@ -0,0 +1,591 @@ +/* + * Contacts Service + * + * Copyright (c) 2010 - 2012 Samsung Electronics Co., Ltd. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +#ifndef __TIZEN_SOCIAL_CONTACTS_DB_H__ +#define __TIZEN_SOCIAL_CONTACTS_DB_H__ + +#ifndef API +#define API __attribute__ ((visibility("default"))) +#endif + +#ifdef __cplusplus +extern "C" +{ +#endif + +/** + * @addtogroup CAPI_SOCIAL_CONTACTS_SVC_DATABASE_MODULE + * @{ + */ + +typedef enum +{ + CONTACTS_CHANGE_INSERTED, /**< . */ + CONTACTS_CHANGE_UPDATED, /**< . */ + CONTACTS_CHANGE_DELETED, /**< . */ +// CONTACTS_CHANGE_BULK_INSERTED, +// CONTACTS_CHANGE_BULK_DELETED +} contacts_changed_e; + +/** + * @brief Called when designated view changes. + * + * @param[in] view_uri The view uri + * @param[in] user_data The user data passed from the callback registration function + * + * @see contacts_db_add_changed_cb() + */ +typedef void (*contacts_db_changed_cb)(const char* view_uri, void* user_data); + +/** + * @brief The callback function to get the result of insert batch operation. + * + * @param[in] error Error code for batch operation + * @param[in] ids IDs of inserted records + * @param[in] count The number of ids + * @param[in] user_data The user data passed from the batch operation + * + * @return @c true to continue with the next iteration of the loop or @c false to break out of the loop. + * + * @pre contacts_db_insert_records() will invoke this callback. + * + * @see contacts_db_insert_records() + */ +typedef void (*contacts_db_insert_result_cb)( int error, int *ids, unsigned int count, void *user_data); + +/** + * @brief The callback function to get the result of batch operation. + * + * @param[in] error Error code for batch operation + * @param[in] user_data The user data passed from the batch operation + * + * @return @c true to continue with the next iteration of the loop or @c false to break out of the loop. + * + * @pre contacts_db_update_records() will invoke this callback. + * + * @see contacts_db_update_records() + */ +typedef void (*contacts_db_result_cb)( int error, void *user_data); + +/** + * @brief Inserts a record to the contacts database. + * + * @param[in] record The record handle + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #CONTACTS_ERROR_DB Database operation failure + * + * @pre This function requires an open connection to contacts service by contacts_connect2(). + * + * @see contacts_connect2() + * @see contacts_db_update_record() + * @see contacts_db_delete_record() + * @see contacts_db_get_record() + */ +API int contacts_db_insert_record( contacts_record_h record, int *id ); + +/** + * @brief Gets a record from the contacts database. + * + * @details This function creates a new contact handle from the contacts database by the given @a record_id. \n + * @a contact will be created, which is filled with contact information. + * + * @remarks @a record must be released with contacts_record_destroy() by you. + * + * @param[in] view_uri The view URI of a record + * @param[in] record_id The record ID to get from database + * @param[out] record The record handle associated with the record ID + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #CONTACTS_ERROR_DB Database operation failure + * + * @pre This function requires an open connection to contacts service by contacts_connect2(). + * + * @see contacts_connect2() + * @see contacts_record_destroy() + */ +API int contacts_db_get_record( const char* view_uri, int record_id, contacts_record_h* record ); + +/** + * @brief Updates a record to the contacts database. + * + * @param[in] record The record handle + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #CONTACTS_ERROR_DB Database operation failure + * + * @pre This function requires an open connection to contacts service by contacts_connect2(). + * + * @see contacts_connect2() + * @see contacts_db_insert_record() + * @see contacts_db_delete_record() + * @see contacts_db_get_record() + */ +API int contacts_db_update_record( contacts_record_h record ); + +/** + * @brief Deletes a record from the contacts database. + * + * @param[in] view_uri The view URI of a record + * @param[in] record_id The record ID to delete + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #CONTACTS_ERROR_DB Database operation failure + * + * @pre This function requires an open connection to contacts service by contacts_connect2(). + * + * @see contacts_connect2() + * @see contacts_db_insert_record() + */ +API int contacts_db_delete_record( const char* view_uri, int record_id ); + +/** + * @brief Replace the record to the contacts database related to id. + * + * @remarks @the write once value of record is not replaced. + * + * @param[in] record The new record handle to replace + * @param[in] id The db record ID to replace + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #CONTACTS_ERROR_DB Database operation failure + * + * @pre This function requires an open connection to contacts service by contacts_connect2(). + * + * @see contacts_connect2() + * @see contacts_db_update_record() + * @see contacts_db_delete_record() + * @see contacts_db_get_record() + */ +API int contacts_db_replace_record( contacts_record_h record, int id ); + +/** + * @brief Retrieves all record as a list + * + * @remarks @a record_list must be released with contacts_list_destroy() by you. + * + * @param[in] view_uri The view URI to get records + * @param[in] offset The index to get results from which index + * @param[in] limit The number to limit results + * @param[out] record_list The record list + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_OUT_OF_MEMORY Out of memory + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #CONTACTS_ERROR_DB Database operation failure + * + * @pre This function requires an open connection to contacts service by contacts_connect2(). + * + * @see contacts_connect2() + * @see contacts_list_destroy() + */ +API int contacts_db_get_all_records( const char* view_uri, int offset, int limit, contacts_list_h* record_list ); + +/** + * @brief Retrieves records with a query handle + * + * @remarks @a record_list must be released with contacts_list_destroy() by you. + * + * @param[in] query The query handle to filter + * @param[in] offset The index to get results from which index + * @param[in] limit The number to limit results + * @param[out] record_list The record list + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_OUT_OF_MEMORY Out of memory + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #CONTACTS_ERROR_DB Database operation failure + * + * @pre This function requires an open connection to contacts service by contacts_connect2(). + * + * @see contacts_connect2() + * @see contacts_list_destroy() + */ +API int contacts_db_get_records_with_query( contacts_query_h query, int offset, int limit, contacts_list_h* record_list ); + +/** + * @brief Inserts multiple records as batch operation to the contacts database. + * + * @param[in] record_list The record list handle + * @param[out] ids IDs of inserted records + * @param[out] count The number of ids + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #CONTACTS_ERROR_DB Database operation failure + * + * @pre This function requires an open connection to contacts service by contacts_connect2(). + * + * @see contacts_connect2() + * @see contacts_db_update_records() + * @see contacts_db_delete_records() + * @see contacts_db_result_cb() + */ +API int contacts_db_insert_records( contacts_list_h record_list, int **ids, unsigned int *count); + +/** + * @brief Inserts multiple records as batch operation to the contacts database. + * + * @param[in] record_list The record list handle + * @param[in] callback The callback function to invoke which lets you know result of batch operation + * @param[in] user_data The user data to be passed to the callback function + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #CONTACTS_ERROR_DB Database operation failure + * + * @pre This function requires an open connection to contacts service by contacts_connect2(). + * + * @see contacts_connect2() + * @see contacts_db_insert_records() + * @see contacts_db_update_records_async() + * @see contacts_db_delete_records_async() + * @see contacts_db_insert_result_cb() + */ +API int contacts_db_insert_records_async( contacts_list_h record_list, contacts_db_insert_result_cb callback, void *user_data); + +/** + * @brief Updates multiple records as batch operation to the contacts database. + * + * @param[in] record_list The record list handle + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #CONTACTS_ERROR_DB Database operation failure + * + * @pre This function requires an open connection to contacts service by contacts_connect2(). + * + * @see contacts_connect2() + * @see contacts_db_insert_records() + * @see contacts_db_delete_records() + * @see contacts_db_result_cb() + */ +API int contacts_db_update_records( contacts_list_h record_list); + +/** + * @brief Updates multiple records as batch operation to the contacts database. + * + * @param[in] record_list The record list handle + * @param[in] callback The callback function to invoke which lets you know result of batch operation + * @param[in] user_data The user data to be passed to the callback function + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #CONTACTS_ERROR_DB Database operation failure + * + * @pre This function requires an open connection to contacts service by contacts_connect2(). + * + * @see contacts_connect2() + * @see contacts_db_update_records() + * @see contacts_db_insert_records_async() + * @see contacts_db_delete_records_async() + * @see contacts_db_result_cb() + */ +API int contacts_db_update_records_async( contacts_list_h record_list, contacts_db_result_cb callback, void *user_data); + +/** + * @brief Deletes multiple records as batch operation to the contacts database. + * + * @param[in] view_uri The view URI of records + * @param[in] record_id_array The record IDs to delete + * @param[in] count The number of record ID array + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #CONTACTS_ERROR_DB Database operation failure + * + * @pre This function requires an open connection to contacts service by contacts_connect2(). + * + * @see contacts_connect2() + * @see contacts_db_insert_records() + * @see contacts_db_update_records() + * @see contacts_db_result_cb() + */ +API int contacts_db_delete_records(const char* view_uri, int record_id_array[], int count); + +/** + * @brief Deletes multiple records as batch operation to the contacts database. + * + * @param[in] view_uri The view URI of records + * @param[in] record_id_array The record IDs to delete + * @param[in] count The number of record ID array + * @param[in] callback The callback function to invoke which lets you know result of batch operation + * @param[in] user_data The user data to be passed to the callback function + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #CONTACTS_ERROR_DB Database operation failure + * + * @pre This function requires an open connection to contacts service by contacts_connect2(). + * + * @see contacts_connect2() + * @see contacts_db_delete_records() + * @see contacts_db_insert_records_async() + * @see contacts_db_update_records_async() + * @see contacts_db_result_cb() + */ +API int contacts_db_delete_records_async(const char* view_uri, int record_id_array[], int count, contacts_db_result_cb callback, void *user_data); + +/** + * @brief Replace the record to the contacts database related to id. + * + * @param[in] record The new record list handle to replace + * @param[in] record_id_array The record IDs to replace + * @param[in] count The number of record ID array + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #CONTACTS_ERROR_DB Database operation failure + * + * @pre This function requires an open connection to contacts service by contacts_connect2(). + * + * @see contacts_connect2() + * @see contacts_db_update_record() + * @see contacts_db_delete_record() + * @see contacts_db_get_record() + */ +API int contacts_db_replace_records( contacts_list_h list, int record_id_array[], unsigned int count ); + +/** + * @brief Replace the record to the contacts database related to id. + * + * @param[in] record The new record list handle to replace + * @param[in] record_id_array The record IDs to replace + * @param[in] count The number of record ID array + * @param[in] callback The callback function to invoke which lets you know result of batch operation + * @param[in] user_data The user data to be passed to the callback function + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #CONTACTS_ERROR_DB Database operation failure + * + * @pre This function requires an open connection to contacts service by contacts_connect2(). + * + * @see contacts_connect2() + * @see contacts_db_replace_record() + * @see contacts_db_update_record_async() + * @see contacts_db_delete_records_async() + * @see contacts_db_get_record() + */ +API int contacts_db_replace_records_async( contacts_list_h list, int record_id_array[], unsigned int count, contacts_db_result_cb callback, void *user_data ); + +/** + * @brief Gets the current contacts database version. + * + * @param[out] contacts_db_version The contacts database version + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #CONTACTS_ERROR_DB Database operation failure + * + * @pre This function requires an open connection to the contacts service by contacts_connect2(). + * + * @see contacts_connect2() + * @see contacts_db_get_changes_by_version() + */ +API int contacts_db_get_current_version( int* contacts_db_version ); + +/** + * @brief Registers a callback function to be invoked when the record changes. + * + * @param[in] view_uri The view URI of record to subscribe to changing notifications + * @param[in] callback The callback function to register + * @param[in] user_data The user data to be passed to the callback function + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * + * @pre This function requires an open connection to the contacts service by contacts_connect2(). + * @post contacts_db_changed_cb() will be invoked when the designated view changes. + * + * @see contacts_connect2() + * @see contacts_db_changed_cb() + * @see contacts_db_remove_changed_cb() + */ +API int contacts_db_add_changed_cb( const char* view_uri, contacts_db_changed_cb callback, void* user_data ); + +/** + * @brief Unregisters a callback function. + * + * @param[in] view_uri The view URI of record to subscribe to changing notifications + * @param[in] callback The callback function to register + * @param[in] user_data The user data to be passed to the callback function + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * + * @pre This function requires an open connection to the contacts service by contacts_connect2(). + * + * @see contacts_connect2() + * @see contacts_db_changed_cb() + * @see contacts_db_add_changed_cb() + */ +API int contacts_db_remove_changed_cb( const char* view_uri, contacts_db_changed_cb callback, void* user_data ); + +#ifndef _CONTACTS_NATIVE + +typedef void (*contacts_db_change_cb_with_info)(const char* view_uri, char *changes, void* user_data); + +API int contacts_db_add_changed_cb_with_info(const char* view_uri, contacts_db_change_cb_with_info callback, void* user_data); +API int contacts_db_remove_changed_cb_with_info(const char* view_uri, contacts_db_change_cb_with_info callback, void* user_data); +#endif + +/** + * @brief Retrieves records with the contacts database version. + * + * @details This function will find all changed records since the given @a contacts_db_version + * + * @remarks @a change_record_list must be released with contacts_list_destroy() by you. + * + * @param[in] view_uri The view URI to get records + * @param[in] address_book_id The address book ID to filter + * @param[in] contacts_db_version The contacts database version + * @param[out] record_list The record list + * @param[out] current_contacts_db_version The current contacts database version + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_OUT_OF_MEMORY Out of memory + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #CONTACTS_ERROR_DB Database operation failure + * + * @pre This function requires an open connection to contacts service by contacts_connect2(). + * + * @see contacts_connect2() + * @see contacts_list_destroy() + */ +API int contacts_db_get_changes_by_version( const char* view_uri, int address_book_id, int contacts_db_version, + contacts_list_h* change_record_list, int* current_contacts_db_version ); + +/** + * @brief Retrieves records with a keyword + * + * @remarks @a record_list must be released with contacts_list_destroy() by you. \n + * This API works only for \ref CAPI_SOCIAL_CONTACTS_SVC_VIEW_MODULE_contacts_person and \ref CAPI_SOCIAL_CONTACTS_SVC_VIEW_MODULE_contacts_person_grouprel. + * + * @param[in] view_uri The view URI to get records + * @param[in] keyword Thekeyword + * @param[in] offset The index to get results from which index + * @param[in] limit The number to limit results + * @param[out] record_list The record list + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_OUT_OF_MEMORY Out of memory + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #CONTACTS_ERROR_DB Database operation failure + * + * @pre This function requires an open connection to contacts service by contacts_connect2(). + * + * @see contacts_connect2() + * @see contacts_list_destroy() + */ +API int contacts_db_search_records(const char* view_uri, const char *keyword, int offset, int limit, contacts_list_h* record_list); + +/** + * @brief Retrieves records with a query handle and a keyword + * + * @remarks @a record_list must be released with contacts_list_destroy() by you. \n + * This API works only for \ref CAPI_SOCIAL_CONTACTS_SVC_VIEW_MODULE_contacts_person and \ref CAPI_SOCIAL_CONTACTS_SVC_VIEW_MODULE_contacts_person_grouprel. + * + * @param[in] query The query handle to filter + * @param[in] keyword Thekeyword + * @param[in] offset The index to get results from which index + * @param[in] limit The number to limit results + * @param[out] record_list The record list + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_OUT_OF_MEMORY Out of memory + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #CONTACTS_ERROR_DB Database operation failure + * + * @pre This function requires an open connection to contacts service by contacts_connect2(). + * + * @see contacts_connect2() + * @see contacts_list_destroy() + */ +API int contacts_db_search_records_with_query(contacts_query_h query, const char *keyword, int offset, int limit, contacts_list_h* record_list); + +/** + * @brief Gets records count of a specific view + * + * @param[in] view_uri The view URI to get records + * @param[out] count The count of records + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #CONTACTS_ERROR_DB Database operation failure + * + * @pre This function requires an open connection to contacts service by contacts_connect2(). + * + * @see contacts_connect2() + */ +API int contacts_db_get_count( const char* view_uri, int *count); + +/** + * @brief Gets records count with a query handle + * + * @param[in] query The query handle to filter + * @param[out] count The count of records + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #CONTACTS_ERROR_DB Database operation failure + * + * @pre This function requires an open connection to contacts service by contacts_connect2(). + * + * @see contacts_connect2() + */ +API int contacts_db_get_count_with_query( contacts_query_h query, int *count); + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + + +#endif //__TIZEN_SOCIAL_CONTACTS_DB_H__ diff --git a/include/contacts_errors.h b/include/contacts_errors.h new file mode 100755 index 0000000..1ec24cd --- /dev/null +++ b/include/contacts_errors.h @@ -0,0 +1,85 @@ +/* + * Contacts Service + * + * Copyright (c) 2010 - 2012 Samsung Electronics Co., Ltd. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef __TIZEN_SOCIAL_CONTACTS_ERROR_H__ +#define __TIZEN_SOCIAL_CONTACTS_ERROR_H__ + +#include <tizen.h> + +#ifdef __cplusplus +extern "C" +{ +#endif +/** + * @addtogroup CAPI_SOCIAL_CONTACTS_SVC_DATABASE_MODULE + * @{ + */ + +typedef enum +{ + /* GENERAL */ + CONTACTS_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */ + CONTACTS_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */ + CONTACTS_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */ + CONTACTS_ERROR_FILE_NO_SPACE = TIZEN_ERROR_FILE_NO_SPACE_ON_DEVICE, /**< FS Full */ + /* LOGIC & DATA */ + CONTACTS_ERROR_NO_DATA = TIZEN_ERROR_SOCIAL_CLASS | TIZEN_ERROR_NO_DATA, /**< Requested data does not exist */ + + /* DB */ +// CONTACTS_ERROR_DB_NOT_OPENED = TIZEN_ERROR_SOCIAL_CLASS | 0x80, /**< Database didn't opened not yet */ +// CONTACTS_ERROR_DB_LOCKED = TIZEN_ERROR_SOCIAL_CLASS | 0x81, /**< Database table locked or file locked */ +// CONTACTS_ERROR_DB_FAILED = TIZEN_ERROR_SOCIAL_CLASS | 0x82, /**< Database operation failure */ +// CONTACTS_ERROR_DB_RECORD_NOT_FOUND = TIZEN_ERROR_SOCIAL_CLASS | 0x83, /**< Empty result set */ +// CONTACTS_ERROR_DB_FULL = TIZEN_ERROR_SOCIAL_CLASS | 0x84, /**< Database Full */ +// CONTACTS_ERROR_DB_IO_ERROR = TIZEN_ERROR_SOCIAL_CLASS | 0x85, /**< Database I/O error */ + + CONTACTS_ERROR_DB = TIZEN_ERROR_SOCIAL_CLASS | 0x9F, /**< Unknown DB error */ + + /* IPC */ +// CONTACTS_ERROR_IPC_BUSY = TIZEN_ERROR_SOCIAL_CLASS | 0xB0, /**< IPC bus locked */ + CONTACTS_ERROR_IPC_NOT_AVALIABLE = TIZEN_ERROR_SOCIAL_CLASS | 0xB1, /**< IPC server is not available */ + CONTACTS_ERROR_IPC = TIZEN_ERROR_SOCIAL_CLASS | 0xBF, /**< Unknown IPC error */ + + /* VCARD */ +// CONTACTS_ERROR_VCARD_UNKNOWN_ERROR = TIZEN_ERROR_SOCIAL_CLASS | 0xCF, /**< Unknown Vcard error */ + + /* ENVIRONMENT & OTEHR MODULE */ + CONTACTS_ERROR_SYSTEM = TIZEN_ERROR_SOCIAL_CLASS | 0xEF, /**< . */ +/* + CONTACTS_ERROR_SOCKET_FAILED = TIZEN_ERROR_SOCIAL_CLASS | 0xE0, + CONTACTS_ERROR_INOTIFY_FAILED = TIZEN_ERROR_SOCIAL_CLASS | 0xE1, + CONTACTS_ERROR_VCONF_FAILED = TIZEN_ERROR_SOCIAL_CLASS | 0xE2, + CONTACTS_ERROR_ICU_FAILED = TIZEN_ERROR_SOCIAL_CLASS | 0xE3, + CONTACTS_ERROR_TAPI_FAILED = TIZEN_ERROR_SOCIAL_CLASS | 0xE4, +*/ + + /* UNHANDLED EXCEPTION */ + CONTACTS_ERROR_INTERNAL = TIZEN_ERROR_SOCIAL_CLASS | 0xFF, /**< Implementation Error, Temporary Use */ +} contacts_error_e; + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __TIZEN_SOCIAL_CONTACTS_ERROR_H__ */ + diff --git a/include/contacts_filter.h b/include/contacts_filter.h new file mode 100755 index 0000000..e6310ce --- /dev/null +++ b/include/contacts_filter.h @@ -0,0 +1,213 @@ +/* + * Contacts Service + * + * Copyright (c) 2010 - 2012 Samsung Electronics Co., Ltd. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +#ifndef __TIZEN_SOCIAL_CONTACTS_FILTER_H__ +#define __TIZEN_SOCIAL_CONTACTS_FILTER_H__ + +#ifndef API +#define API __attribute__ ((visibility("default"))) +#endif + +#ifdef __cplusplus +extern "C" +{ +#endif + + +/** + * @addtogroup CAPI_SOCIAL_CONTACTS_SVC_FILTER_MODULE + * @{ + */ + +typedef enum +{ + CONTACTS_MATCH_EXACTLY, /**< . */ + CONTACTS_MATCH_FULLSTRING, /**< . */ + CONTACTS_MATCH_CONTAINS, /**< . */ + CONTACTS_MATCH_STARTSWITH, /**< . */ + CONTACTS_MATCH_ENDSWITH, /**< . */ + CONTACTS_MATCH_EXISTS /**< . */ +} contacts_match_str_flag_e; + +typedef enum +{ + CONTACTS_MATCH_EQUAL, /**< . */ + CONTACTS_MATCH_GREATER_THAN, /**< . */ + CONTACTS_MATCH_GREATER_THAN_OR_EQUAL, /**< . */ + CONTACTS_MATCH_LESS_THAN, /**< . */ + CONTACTS_MATCH_LESS_THAN_OR_EQUAL, /**< . */ + CONTACTS_MATCH_NOT_EQUAL, /**< this flag can yield poor performance */ + CONTACTS_MATCH_NONE, /**< . */ +} contacts_match_int_flag_e; + +typedef enum { + CONTACTS_FILTER_OPERATOR_AND, /**< . */ + CONTACTS_FILTER_OPERATOR_OR /**< . */ +} contacts_filter_operator_e; + + +/** + * @brief Creates a handle to filter. + * + * @remarks @a filter must be released with contacts_filter_destroy() by you. + * + * @param[in] view_uri The view URI of a filter + * @param[out] filter The filter handle + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #CONTACTS_ERROR_OUT_OF_MEMORY Out of memory + * + * @see contacts_filter_destroy() + */ +API int contacts_filter_create( const char* view_uri, contacts_filter_h* filter ); + +/** + * @brief Destroys a filter handle. + * + * @param[in] filter The filter handle + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * + * @see contacts_filter_create() + */ +API int contacts_filter_destroy( contacts_filter_h filter ); + +/** + * @brief Adds a condition for string type property + * + * @param[in] filter The filter handle + * @param[in] property_id The property ID to add a condition + * @param[in] match The match flag + * @param[in] match_value The match value + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * + * @see contacts_filter_add_operator() + */ +API int contacts_filter_add_str( contacts_filter_h filter, unsigned int property_id, contacts_match_str_flag_e match, const char* match_value ); + +/** + * @brief Adds a condition for integer type property + * + * @param[in] filter The filter handle + * @param[in] property_id The property ID to add a condition + * @param[in] match The match flag + * @param[in] match_value The match value + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * + * @see contacts_filter_add_operator() + */ +API int contacts_filter_add_int( contacts_filter_h filter, unsigned int property_id, contacts_match_int_flag_e match, int match_value ); + +/** + * @brief Adds a condition for long long int type property + * + * @param[in] filter The filter handle + * @param[in] property_id The property ID to add a condition + * @param[in] match The match flag + * @param[in] match_value The match value + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * + * @see contacts_filter_add_operator() + */ +API int contacts_filter_add_lli( contacts_filter_h filter, unsigned int property_id, contacts_match_int_flag_e match, long long int match_value ); + +/** + * @brief Adds a condition for double type property + * + * @param[in] filter The filter handle + * @param[in] property_id The property ID to add a condition + * @param[in] match The match flag + * @param[in] match_value The match value + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * + * @see contacts_filter_add_operator() + */ +API int contacts_filter_add_double( contacts_filter_h filter, unsigned int property_id, contacts_match_int_flag_e match, double match_value ); + +/** + * @brief Adds a condition for boolean type property + * + * @param[in] filter The filter handle + * @param[in] property_id The property ID to add a condition + * @param[in] match_value The match value + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * + * @see contacts_filter_add_operator() + */ +API int contacts_filter_add_bool( contacts_filter_h filter, unsigned int property_id, bool match_value ); + +/** + * @brief Adds a operator between conditions + * + * @param[in] filter The filter handle + * @param[in] operator_type The operator type + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * + * @see contacts_filter_add_str() + * @see contacts_filter_add_int() + * @see contacts_filter_add_bool() + */ +API int contacts_filter_add_operator( contacts_filter_h filter, contacts_filter_operator_e operator_type ); + +/** + * @brief Adds a filter handle to filter handle. + * + * @param[in] parent_filter The parent filter handle + * @param[in] child_filter The child filter handle + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * + * @see contacts_filter_add_operator() + */ +API int contacts_filter_add_filter(contacts_filter_h parent_filter, contacts_filter_h child_filter); + + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + + +#endif //__TIZEN_SOCIAL_CONTACTS_FILTER_H__ diff --git a/include/contacts_group.h b/include/contacts_group.h new file mode 100644 index 0000000..2e0fe73 --- /dev/null +++ b/include/contacts_group.h @@ -0,0 +1,82 @@ +/* + * Contacts Service + * + * Copyright (c) 2010 - 2012 Samsung Electronics Co., Ltd. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +#ifndef __TIZEN_SOCIAL_CONTACTS_GROUP_H__ +#define __TIZEN_SOCIAL_CONTACTS_GROUP_H__ + +#ifndef API +#define API __attribute__ ((visibility("default"))) +#endif + + +#ifdef __cplusplus +extern "C" +{ +#endif + +/** + * @addtogroup CAPI_SOCIAL_CONTACTS_SVC_GROUP_MODULE + * @{ + */ + +/** + * @brief Adds a contact and a group relationship to the contacts database. + * + * @param[in] group_id The group ID + * @param[in] contact_id The contact ID + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #CONTACTS_ERROR_DB Database operation failure + * + * @pre This function requires an open connection to contacts service by contacts_connect2(). + * + * @see contacts_connect2() + * @see contacts_group_remove_contact() + */ +API int contacts_group_add_contact(int group_id, int contact_id); + +/** + * @brief Removes a contact and a group relationship from the contacts database. + * + * @param[in] group_id The group ID + * @param[in] contact_id The contact ID + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #CONTACTS_ERROR_DB Database operation failure + * + * @pre This function requires an open connection to contacts service by contacts_connect2(). + * + * @see contacts_connect2() + * @see contacts_group_add_contact() + */ +API int contacts_group_remove_contact(int group_id, int contact_id); + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + + +#endif //__TIZEN_SOCIAL_CONTACTS_GROUP_H__ diff --git a/include/contacts_list.h b/include/contacts_list.h new file mode 100644 index 0000000..146bb9f --- /dev/null +++ b/include/contacts_list.h @@ -0,0 +1,185 @@ +/* + * Contacts Service + * + * Copyright (c) 2010 - 2012 Samsung Electronics Co., Ltd. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +#ifndef __TIZEN_SOCIAL_CONTACTS_LIST_H__ +#define __TIZEN_SOCIAL_CONTACTS_LIST_H__ + +#ifndef API +#define API __attribute__ ((visibility("default"))) +#endif + +#ifdef __cplusplus +extern "C" +{ +#endif + +/** + * @addtogroup CAPI_SOCIAL_CONTACTS_SVC_LIST_MODULE + * @{ + */ + +/** + * @brief Creates a handle to the contacts list. + * + * @remarks @a contacts_list must be released with contacts_list_destroy() by you. + * + * @param[out] contacts_list The contacts list handle + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_OUT_OF_MEMORY Out of memory + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * + * @see contacts_list_destroy() + */ +API int contacts_list_create( contacts_list_h* contacts_list ); + +/** + * @brief Destroys a contacts list handle and releases all its resources. + * + * @param[in] contacts_list The contacts list handle + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * + * @see contacts_list_create() + */ +API int contacts_list_destroy( contacts_list_h contacts_list, bool delete_child ); + +/** + * @brief Retrieves count of contact entity from a contacts list. + * + * @param[in] contacts_list The contacts list handle + * @param[out] count The count of contact entity + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * + * @see contacts_list_add() + */ +API int contacts_list_get_count( contacts_list_h contacts_list, unsigned int *count ); + +/** + * @brief Adds a record handle to contacts list handle. + * + * @param[in] contacts_list The contacts list handle + * @param[in] record The record handle + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * + * @see contacts_list_remove() + */ +API int contacts_list_add( contacts_list_h contacts_list, contacts_record_h record ); + +/** + * @brief Removes a record handle to contacts list handle. + * @details If the record is current record then current record is changed the next record.\n + * If the record is the last record then current record will be NULL. + * + * @param[in] contacts_list The contacts list handle + * @param[in] record The record handle + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * + * @see contacts_list_add() + */ +API int contacts_list_remove( contacts_list_h contacts_list, contacts_record_h record ); + +/** + * @brief Retrieves a record handle from contacts list handle. + * @details The default current record is the first record + * @remarks The @a record handle MUST NOT destroyed by you. + * It is destroyed automatically when the @a contacts_list is destroyed. + * + * @param[in] contacts_list The contacts list handle + * @param[out] record The record handle + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + */ +API int contacts_list_get_current_record_p( contacts_list_h contacts_list, contacts_record_h* record ); + +/** + * @brief Moves a contacts list to previous position. + * + * @param[in] contacts_list The contacts list handle + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * + * @see contacts_list_next() + */ +API int contacts_list_prev( contacts_list_h contacts_list ); + +/** + * @brief Moves a contacts list to next position. + * + * @param[in] contacts_list The contacts list handle + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * + * @see contacts_list_prev() + */ +API int contacts_list_next( contacts_list_h contacts_list ); + +/** + * @brief Moves a contacts list to the first position. + * + * @param[in] contacts_list The contacts list handle + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * + * @see contacts_list_last() + */ +API int contacts_list_first( contacts_list_h contacts_list ); + +/** + * @brief Moves a contacts lis tto the last position. + * + * @param[in] contacts_list The contacts list handle + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * + * @see contacts_list_first() + */ +API int contacts_list_last( contacts_list_h contacts_list ); + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + + +#endif //__TIZEN_SOCIAL_CONTACTS_LIST_H__ diff --git a/include/contacts_person.h b/include/contacts_person.h new file mode 100644 index 0000000..fbea293 --- /dev/null +++ b/include/contacts_person.h @@ -0,0 +1,160 @@ +/* + * Contacts Service + * + * Copyright (c) 2010 - 2012 Samsung Electronics Co., Ltd. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +#ifndef __TIZEN_SOCIAL_CONTACTS_PERSON_H__ +#define __TIZEN_SOCIAL_CONTACTS_PERSON_H__ + +#ifndef API +#define API __attribute__ ((visibility("default"))) +#endif + +#ifdef __cplusplus +extern "C" +{ +#endif + +/** + * @addtogroup CAPI_SOCIAL_CONTACTS_SVC_PERSON_MODULE + * @{ + */ + +/** + * @brief Links a person to a person. + * + * @param[in] base_person_id The base person ID + * @param[in] person_id The person ID to be linked + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_DB Database operation failure + * + * @pre This function requires an open connection to contacts service by contacts_connect2(). + * + * @see contacts_connect2() + */ +API int contacts_person_link_person(int base_person_id, int person_id); + +/** + * @brief Unlinks a contact from a person. + * + * @param[in] person_id The person ID + * @param[in] contact_id The contact ID to unlink + * @param[out] unliked_person_id The person ID generated + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_DB Database operation failure + * + * @pre This function requires an open connection to contacts service by contacts_connect2(). + * + * @see contacts_connect2() + */ +API int contacts_person_unlink_contact(int person_id, int contact_id, int* unlinked_person_id); + +/** + * @brief Resets a person's usage count. + * @details The person is no longer in the most frequent contacted person list. + * + * @param[in] person_id The person ID + * @param[in] type The type to reset + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_DB Database operation failure + * + * @pre This function requires an open connection to contacts service by contacts_connect2(). + * + * @see contacts_connect2() + */ +API int contacts_person_reset_usage(int person_id, contacts_usage_type_e type); + +/** + * @brief Sets a favorite person place between a previous person and a next person. + * + * @param[in] person_id The person ID to move + * @param[in] previous_person_id The previous person ID + * @param[in] next_person_id The back person ID + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_DB Database operation failure + * + * @pre This function requires an open connection to contacts service by contacts_connect2(). + * + * @see contacts_connect2() + */ +API int contacts_person_set_favorite_order(int person_id, int previous_person_id, int next_person_id); + +typedef enum { + CONTACTS_PERSON_PROPERTY_NAME_CONTACT, /**< . */ + CONTACTS_PERSON_PROPERTY_NUMBER, /**< . */ + CONTACTS_PERSON_PROPERTY_EMAIL, /**< . */ + CONTACTS_PERSON_PROPERTY_IMAGE, /**< . */ +} contacts_person_property_e; + +/** + * @brief Sets a default property for a record. + * + * @remarks @a id can be contact_id, number_id, email_id, image_id + * + * @param[in] property #contacts_person_property_e + * @param[in] person_id The person ID + * @param[in] id The record id + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_DB Database operation failure + * + * @pre This function requires an open connection to contacts service by contacts_connect2(). + * + * @see contacts_connect2() + */ +API int contacts_person_set_default_property(contacts_person_property_e property, int person_id, + int id); + +/** + * @brief Gets a default property for a record. + * + * @remarks @a id can be contact_id, number_id, email_id, image_id + * + * @param[in] property #contacts_person_property_e + * @param[in] person_id The person ID + * @param[out] id The record id of the property to be set as default + + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_DB Database operation failure + * + * @pre This function requires an open connection to contacts service by contacts_connect2(). + * + * @see contacts_connect2() + */ +API int contacts_person_get_default_property(contacts_person_property_e property, int person_id, + int *id); + +/** + * @} + */ + + +#ifdef __cplusplus +} +#endif + + +#endif //__TIZEN_SOCIAL_CONTACTS_PERSON_H__ diff --git a/include/contacts_phone_log.h b/include/contacts_phone_log.h new file mode 100644 index 0000000..f799307 --- /dev/null +++ b/include/contacts_phone_log.h @@ -0,0 +1,85 @@ +/* + * Contacts Service + * + * Copyright (c) 2010 - 2012 Samsung Electronics Co., Ltd. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +#ifndef __TIZEN_SOCIAL_CONTACTS_PHONELOG_H__ +#define __TIZEN_SOCIAL_CONTACTS_PHONELOG_H__ + +#ifndef API +#define API __attribute__ ((visibility("default"))) +#endif + +#ifdef __cplusplus +extern "C" +{ +#endif + +/** + * @addtogroup CAPI_SOCIAL_CONTACTS_SVC_PHONELOG_MODULE + * @{ + */ + +/** + * @brief Resets a phonelog's count. + * @details The count of all type of phonelog will be 0. + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_DB Database operation failure + * + * @pre This function requires an open connection to contacts service by contacts_connect2(). + * + * @see contacts_connect2() + */ +API int contacts_phone_log_reset_statistics(); + +typedef enum { + CONTACTS_PHONE_LOG_DELETE_BY_ADDRESS, /**< . */ + CONTACTS_PHONE_LOG_DELETE_BY_MESSAGE_EXTRA_DATA1, /**< . */ + CONTACTS_PHONE_LOG_DELETE_BY_EMAIL_EXTRA_DATA1, /**< . */ +} contacts_phone_log_delete_e; + +/** + * @brief Delete phone log with extra_data1 + * + * @param[in] op operation #contacts_phone_log_delete_e + * @param[in] address (optional) Address to delete (number, email, etc) + * @param[in] extra_data1 (optional) extra_data1 to delete + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * @par example + * @code + contacts_phone_log_delete(CONTACTS_PHONE_LOG_DELETE_BY_ADDRESS, "0123456789"); + contacts_phone_log_delete(CONTACTS_PHONE_LOG_DELETE_BY_MESSAGE_EXTRA_DATA1, 2); + contacts_phone_log_delete(CONTACTS_PHONE_LOG_DELETE_BY_EMAIL_EXTRA_DATA1, 1); + * @endcode + */ +API int contacts_phone_log_delete(contacts_phone_log_delete_e op, ...); + +/** + * @} + */ + + +#ifdef __cplusplus +} +#endif + + +#endif //__TIZEN_SOCIAL_CONTACTS_PHONELOG_H__ diff --git a/include/contacts_query.h b/include/contacts_query.h new file mode 100644 index 0000000..af9c799 --- /dev/null +++ b/include/contacts_query.h @@ -0,0 +1,128 @@ +/* + * Contacts Service + * + * Copyright (c) 2010 - 2012 Samsung Electronics Co., Ltd. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +#ifndef __TIZEN_SOCIAL_CONTACTS_QUERY_H__ +#define __TIZEN_SOCIAL_CONTACTS_QUERY_H__ + +#ifndef API +#define API __attribute__ ((visibility("default"))) +#endif + +#ifdef __cplusplus +extern "C" +{ +#endif + +/** + * @addtogroup CAPI_SOCIAL_CONTACTS_SVC_QUERY_MODULE + * @{ + */ + +/** + * @brief Creates a query handle. + * + * @remarks @a query must be released with contacts_query_destroy() by you. + * + * @param[in] view_uri The view URI of a query + * @param[out] query The filter handle + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #CONTACTS_ERROR_OUT_OF_MEMORY Out of memory + * + * @see contacts_query_destroy() + */ +API int contacts_query_create( const char* view_uri, contacts_query_h* query ); + +/** + * @brief Destroys a query handle. + * + * @param[in] query The query handle + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * + * @see contacts_query_create() + */ +API int contacts_query_destroy( contacts_query_h query ); + +/** + * @brief Adds property IDs for projection. + * + * @param[in] filter The filter handle + * @param[in] property_id_array The property ID array + * @param[in] count The number of property IDs + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + */ +API int contacts_query_set_projection(contacts_query_h query, unsigned int property_id_array[], int count); + +/** + * @brief Set distinct option for projection. + * + * @param[in] query The query handle + * @param[in] set Set or unset + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + */ +API int contacts_query_set_distinct(contacts_query_h query, bool set); + +/** + * @brief Set a filter handle to query handle. + * + * @param[in] query The query handle + * @param[in] filter The filter handle + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * + * @see contacts_filter_create() + */ +API int contacts_query_set_filter(contacts_query_h query, contacts_filter_h filter); + +/** + * @brief Sets sort mode. + * + * @param[in] query The query handle + * @param[in] property_id The property ID to sort + * @param[in] is_ascending Ascending or decending + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + */ +API int contacts_query_set_sort(contacts_query_h query, unsigned int property_id, bool is_ascending); + + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + + +#endif //__TIZEN_SOCIAL_CONTACTS_QUERY_H__ diff --git a/include/contacts_record.h b/include/contacts_record.h new file mode 100644 index 0000000..60ac4bf --- /dev/null +++ b/include/contacts_record.h @@ -0,0 +1,349 @@ +/* + * Contacts Service + * + * Copyright (c) 2010 - 2012 Samsung Electronics Co., Ltd. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +#ifndef __TIZEN_SOCIAL_CONTACTS_RECORD_H__ +#define __TIZEN_SOCIAL_CONTACTS_RECORD_H__ + +#ifndef API +#define API __attribute__ ((visibility("default"))) +#endif + +#ifdef __cplusplus +extern "C" +{ +#endif + + +/** + * @addtogroup CAPI_SOCIAL_CONTACTS_SVC_RECORD_MODULE + * @{ + */ + +/** + * @brief Creates a handle to the record. + * + * @remarks @a record must be released with contacts_record_destroy() by you. + * + * @param[in] view_uri The view uri + * @param[out] record The record handle + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_OUT_OF_MEMORY Out of memory + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * + * @see contacts_record_destroy() + */ +API int contacts_record_create( const char* view_uri, contacts_record_h* record ); + +/** + * @brief Destroys a record handle and releases all its resources. + * + * @param[in] record The record handle + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * + * @see contacts_list_create() + */ +API int contacts_record_destroy( contacts_record_h record, bool delete_child ); + +/** + * @brief Makes a clone of a record handle. + * + * @remarks @a cloned_record must be released with contacts_record_destroy() by you. + * + * @param[in] record The record handle + * @param[out] cloned_record The cloned record handle + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * + * @see contacts_record_destroy() + */ +API int contacts_record_clone( contacts_record_h record, contacts_record_h* cloned_record ); + +/** + * @brief Gets a string from a record handle. + * + * @remarks @a value must be released with free() by you. + * + * @param[in] record The record handle + * @param[in] property_id The property ID + * @param[out] value The value to be returned + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * + * @see contacts_record_get_str_p() + * @see contacts_record_set_str() + */ +API int contacts_record_get_str( contacts_record_h record, unsigned int property_id, char** value ); + +/** + * @brief Gets a string pointer from a record handle. + * + * @remarks @a value MUST NOT be released by you. + * + * @param[in] record The record handle + * @param[in] property_id The property ID + * @param[out] value The value to be returned + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * + * @see contacts_record_get_str() + * @see contacts_record_set_str() + */ +API int contacts_record_get_str_p( contacts_record_h record, unsigned int property_id, char** value ); + +/** + * @brief Sets a string to a record handle. + * + * @param[in] record The record handle + * @param[in] property_id The property ID + * @param[in] value The value to set + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * + * @see contacts_record_get_str() + * @see contacts_record_get_str_p() + */ +API int contacts_record_set_str( contacts_record_h record, unsigned int property_id, const char* value ); + +/** + * @brief Gets a integer from a record handle. + * + * @param[in] record The record handle + * @param[in] property_id The property ID + * @param[out] value The value to be returned + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * + * @see contacts_record_set_int() + */ +API int contacts_record_get_int( contacts_record_h record, unsigned int property_id, int* value ); + +/** + * @brief Sets a integer to a record handle. + * + * @param[in] record The record handle + * @param[in] property_id The property ID + * @param[in] value The value to set + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * + * @see contacts_record_get_int() + */ +API int contacts_record_set_int( contacts_record_h record, unsigned int property_id, int value ); + +/** + * @brief Gets a long integer from a record handle. + * + * @param[in] record The record handle + * @param[in] property_id The property ID + * @param[out] value The value to be returned + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * + * @see contacts_record_set_lli() + */ +API int contacts_record_get_lli( contacts_record_h record, unsigned int property_id, long long int *value ); + +/** + * @brief Sets a long integer to a record handle. + * + * @param[in] record The record handle + * @param[in] property_id The property ID + * @param[in] value The value to set + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * + * @see contacts_record_get_lli() + */ +API int contacts_record_set_lli( contacts_record_h record, unsigned int property_id, long long int value ); + +/** + * @brief Gets a boolean from a record handle. + * + * @param[in] record The record handle + * @param[in] property_id The property ID + * @param[out] value The value to be returned + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * + * @see contacts_record_set_bool() + */ +API int contacts_record_get_bool( contacts_record_h record, unsigned int property_id, bool *value ); + +/** + * @brief Sets a boolean to the record handle. + * + * @param[in] record The record handle + * @param[in] property_id The property ID + * @param[in] value The value to set + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * + * @see contacts_record_get_bool() + */ +API int contacts_record_set_bool( contacts_record_h record, unsigned int property_id, bool value ); + +/** + * @brief Gets a double from a record handle. + * + * @param[in] record The record handle + * @param[in] property_id The property ID + * @param[out] value The value to be returned + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * + * @see contacts_record_set_bool() + */ +API int contacts_record_get_double( contacts_record_h record, unsigned int property_id, double *value ); + +/** + * @brief Sets a double to the record handle. + * + * @param[in] record The record handle + * @param[in] property_id The property ID + * @param[in] value The value to set + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * + * @see contacts_record_get_bool() + */ +API int contacts_record_set_double( contacts_record_h record, unsigned int property_id, double value ); + +/** + * @brief Adds a child record handle to a parent record handle. + * + * @param[in] record The parent record handle + * @param[in] property_id The property ID + * @param[in] child_record The child record handle to be added to parent record handle + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * + * @see contacts_record_remove_child_record() + */ +API int contacts_record_add_child_record( contacts_record_h record, unsigned int property_id, contacts_record_h child_record ); + +/** + * @brief Removes a child record handle from a parent record handle. + * + * @param[in] record The parent record handle + * @param[in] property_id The property ID + * @param[in] child_record The child record handle to be removed from parent record handle + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * + * @see contacts_record_add_child_record() + */ +API int contacts_record_remove_child_record( contacts_record_h record, unsigned int property_id, contacts_record_h child_record ); + +//API int contacts_record_update_child_record( contacts_record_h record, contacts_record_h child_record ); + +/** + * @brief Gets a number of child record handle from a parent record handle. + * + * @param[in] record The parent record handle + * @param[in] property_id The property ID + * @param[out] count The child record count + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * + * @see contacts_record_add_child_record() + * @see contacts_record_remove_child_record() + */ +API int contacts_record_get_child_record_count( contacts_record_h record, unsigned int property_id, unsigned int *count ); + +/** + * @brief Gets a child record handle pointer from a parent record handle. + * + * @remarks @a child_record MUST NOT be released by you. \n It is released when the parent record handle destroyed. + * + * @param[in] record The record handle + * @param[in] property_id The property ID + * @param[in] index The index of child record + * @param[out] child_record The child record handle pointer to be returned + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * + * @see contacts_record_add_child_record() + * @see contacts_record_remove_child_record() + * @see contacts_record_get_child_record_count() + */ +API int contacts_record_get_child_record_at_p( contacts_record_h record, unsigned int property_id, int index, contacts_record_h* child_record ); + +/** + * @brief Makes a clone of a child record list handle from a parent record handle. + * + * @remarks @a cloned_list MUST be released with contacts_list_destroy() by you. + * + * @param[in] record The record handle + * @param[in] property_id The property ID + * @param[out] cloned_list The cloned list handle + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * + * @see contacts_list_destroy() + */ +API int contacts_record_clone_child_record_list( contacts_record_h record, unsigned int property_id, contacts_list_h* cloned_list ); + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + + +#endif //__TIZEN_SOCIAL_CONTACTS_RECORD_H__ diff --git a/include/contacts_service.h b/include/contacts_service.h new file mode 100755 index 0000000..a82b9bc --- /dev/null +++ b/include/contacts_service.h @@ -0,0 +1,120 @@ +/* + * Contacts Service + * + * Copyright (c) 2010 - 2012 Samsung Electronics Co., Ltd. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +#ifndef __TIZEN_SOCIAL_CONTACTS_SERVICE_H__ +#define __TIZEN_SOCIAL_CONTACTS_SERVICE_H__ + +#ifndef API +#define API __attribute__ ((visibility("default"))) +#endif + +#ifdef __cplusplus +extern "C" +{ +#endif + +/** + * @addtogroup CAPI_SOCIAL_CONTACTS_SVC_DATABASE_MODULE + * @{ + */ + +/** + * @brief Connects to the contacts service. + * + * @remarks Connection opening is necessary to access the contacts database such as fetching, inserting, or updating records.\n + * The execution of contacts_connect2() and contacts_disconnect2() could slow down your application so you are recommended not to call them frequently. + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_DB Database operation failure + * + * @see contacts_disconnect2() + */ +API int contacts_connect2(); + +/** + * @brief Disconnects from the contacts service. + * + * @remarks If there is no opened connection, this function returns #CONTACTS_ERROR_DB. + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_DB Database operation failure + * + * @see contacts_connect2() + */ +API int contacts_disconnect2(); + + + +/** + * @brief Connects to the contacts service with another connection for thread. + * + * @remarks + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_DB Database operation failure + * + * @see contacts_disconnect_on_thread() + */ +API int contacts_connect_on_thread(); + +/** + * @brief Disconnects from the contacts service. + * + * @remarks + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_DB Database operation failure + * + * @see contacts_connect_on_thread() + */ +API int contacts_disconnect_on_thread(); + + +#define CONTACTS_CONNECT_FLAG_RETRY 0x00000001 +#define CONTACTS_CONNECT_FLAG_NONE 0 + +/** + * @brief Connects to the contacts service. If connection is failed because contacts-service is not running, it will retry for several seconds + * + * @remarks Connection opening is necessary to access the contacts database such as fetching, inserting, or updating records.\n + * The execution of contacts_connect2() and contacts_disconnect2() could slow down your application so you are recommended not to call them frequently. + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_DB Database operation failure + * + * @see contacts_disconnect2() + */ +API int contacts_connect_with_flags(unsigned int flags); + + + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + + +#endif //__TIZEN_SOCIAL_CONTACTS_SERVICE_H__ diff --git a/include/contacts_setting.h b/include/contacts_setting.h new file mode 100755 index 0000000..410eebb --- /dev/null +++ b/include/contacts_setting.h @@ -0,0 +1,86 @@ +/* + * Contacts Service + * + * Copyright (c) 2010 - 2012 Samsung Electronics Co., Ltd. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +#ifndef __TIZEN_SOCIAL_CONTACTS_SETTING_H__ +#define __TIZEN_SOCIAL_CONTACTS_SETTING_H__ + +#ifndef API +#define API __attribute__ ((visibility("default"))) +#endif + +#ifdef __cplusplus +extern "C" +{ +#endif + +/** + * @addtogroup CAPI_SOCIAL_CONTACTS_SVC_SETTING_MODULE + * @{ + */ + +/** + * @brief Enumerations of name display order + */ +typedef enum +{ + CONTACTS_NAME_DISPLAY_ORDER_FIRSTLAST, /**< First name comes at the first */ + CONTACTS_NAME_DISPLAY_ORDER_LASTFIRST /**< First name comes at the last */ +} contacts_name_display_order_e; + +/** + * @brief Gets the contacts name display order. + * + * @param[out] name_display_order The name display order + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #CONTACTS_ERROR_DB Database operation failure + * + * @pre This function requires an open connection to the contacts service by contacts_connect2(). + * + * @see contacts_connect2() + */ +API int contacts_setting_get_name_display_order(contacts_name_display_order_e *name_display_order); + +/** + * @brief Sets the contacts name display order. + * + * @param[in] name_display_order The name display order + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #CONTACTS_ERROR_DB Database operation failure + * + * @pre This function requires an open connection to the contacts service by contacts_connect2(). + * + * @see contacts_connect2() + */ +API int contacts_setting_set_name_display_order(contacts_name_display_order_e name_display_order); + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + + +#endif //__TIZEN_SOCIAL_CONTACTS_SETTING_H__ diff --git a/include/contacts_sim.h b/include/contacts_sim.h new file mode 100644 index 0000000..3a7019c --- /dev/null +++ b/include/contacts_sim.h @@ -0,0 +1,72 @@ +/* + * Contacts Service + * + * Copyright (c) 2010 - 2012 Samsung Electronics Co., Ltd. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +#ifndef __TIZEN_SOCIAL_CONTACTS_SIM_H__ +#define __TIZEN_SOCIAL_CONTACTS_SIM_H__ + +#ifndef API +#define API __attribute__ ((visibility("default"))) +#endif + +#ifdef __cplusplus +extern "C" +{ +#endif + +/** + * @addtogroup CAPI_SOCIAL_CONTACTS_SVC_SIM_MODULE + * @{ + */ + +/** + * @brief Imports all contacts to Contacts Database from SIM. + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_DB Database operation failure + * + * @pre This function requires an open connection to contacts service by contacts_connect2(). + * + * @see contacts_connect2() + */ +API int contacts_sim_import_all_contacts(); + + +/** + * @brief check whether to complete sim initialize . + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_DB Database operation failure + * + * @pre This function requires an open connection to contacts service by contacts_connect2(). + * + * @see contacts_connect2() + */ +API int contacts_sim_get_initialization_status(bool *completed); + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + + +#endif //__TIZEN_SOCIAL_CONTACTS_SIM_H__ diff --git a/include/contacts_types.h b/include/contacts_types.h new file mode 100644 index 0000000..0112176 --- /dev/null +++ b/include/contacts_types.h @@ -0,0 +1,231 @@ +/* + * Contacts Service + * + * Copyright (c) 2010 - 2012 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Dohyung Jin <dh.jin@samsung.com> + * Jongwon Lee <gogosing.lee@samsung.com> + * Donghee Ye <donghee.ye@samsung.com> + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef __TIZEN_SOCIAL_CONTACTS_TYPES_H__ +#define __TIZEN_SOCIAL_CONTACTS_TYPES_H__ + +#ifndef API +#define API __attribute__ ((visibility("default"))) +#endif + +#ifdef __cplusplus +extern "C" +{ +#endif + +#define _CONTACTS_BEGIN_VIEW() \ + typedef struct{ \ + const char* const _uri; +#define _CONTACTS_BEGIN_READ_ONLY_VIEW() _CONTACTS_BEGIN_VIEW() +#define _CONTACTS_PROPERTY_INT(property_id_name) unsigned int property_id_name; +#define _CONTACTS_PROPERTY_STR(property_id_name) unsigned int property_id_name; +#define _CONTACTS_PROPERTY_BOOL(property_id_name) unsigned int property_id_name; +#define _CONTACTS_PROPERTY_DOUBLE(property_id_name) unsigned int property_id_name; +#define _CONTACTS_PROPERTY_LLI(property_id_name) unsigned int property_id_name; + +#define _CONTACTS_PROPERTY_CHILD_SINGLE(property_id_name) unsigned int property_id_name; +#define _CONTACTS_PROPERTY_CHILD_MULTIPLE(property_id_name) unsigned int property_id_name; +#define _CONTACTS_PROPERTY_FILTER_INT(property_id_name) unsigned int property_id_name; +#define _CONTACTS_PROPERTY_FILTER_STR(property_id_name) unsigned int property_id_name; +#define _CONTACTS_PROPERTY_FILTER_BOOL(property_id_name) unsigned int property_id_name; +#define _CONTACTS_PROPERTY_FILTER_DOUBLE(property_id_name) unsigned int property_id_name; +#define _CONTACTS_PROPERTY_FILTER_LLI(property_id_name) unsigned int property_id_name; + +#define _CONTACTS_PROPERTY_PROJECTION_INT(property_id_name) unsigned int property_id_name; +#define _CONTACTS_PROPERTY_PROJECTION_STR(property_id_name) unsigned int property_id_name; +#define _CONTACTS_PROPERTY_PROJECTION_BOOL(property_id_name) unsigned int property_id_name; +#define _CONTACTS_PROPERTY_PROJECTION_DOUBLE(property_id_name) unsigned int property_id_name; +#define _CONTACTS_PROPERTY_PROJECTION_LLI(property_id_name) unsigned int property_id_name; +#define _CONTACTS_END_VIEW(name) \ + } name##_property_ids; \ + extern API const name##_property_ids name; +#define _CONTACTS_END_READ_ONLY_VIEW(name) _CONTACTS_END_VIEW(name) + +#define _CONTACTS_HANDLE(A) typedef struct __##A{}* A; + +_CONTACTS_HANDLE( contacts_record_h ) +_CONTACTS_HANDLE( contacts_filter_h ) +_CONTACTS_HANDLE( contacts_list_h ) +_CONTACTS_HANDLE( contacts_query_h ) + +/** + * @addtogroup CAPI_SOCIAL_CONTACTS_SVC_RECORD_MODULE + * @{ + */ + +/** + * The Number can be made with a set of values by specifying one or more values. + * \n Example : CTS_NUM_TYPE_HOME|CTS_NUM_TYPE_VOICE + * \n Exceptionally, CTS_NUM_TYPE_CUSTOM is exclusive. + */ +typedef enum { + CONTACTS_NUMBER_TYPE_OTHER, /**< . */ + CONTACTS_NUMBER_TYPE_CUSTOM = 1<<0, /**< Custom number type */ + CONTACTS_NUMBER_TYPE_HOME = 1<<1, /**< A telephone number associated with a residence */ + CONTACTS_NUMBER_TYPE_WORK = 1<<2, /**< A telephone number associated with a place of work */ + CONTACTS_NUMBER_TYPE_VOICE = 1<<3, /**< A voice telephone number */ + CONTACTS_NUMBER_TYPE_FAX = 1<<4, /**< A facsimile telephone number */ + CONTACTS_NUMBER_TYPE_MSG = 1<<5, /**< The telephone number has voice messaging support */ + CONTACTS_NUMBER_TYPE_CELL = 1<<6, /**< A cellular telephone number */ + CONTACTS_NUMBER_TYPE_PAGER = 1<<7, /**< A paging device telephone number */ + CONTACTS_NUMBER_TYPE_BBS = 1<<8, /**< A bulletin board system telephone number */ + CONTACTS_NUMBER_TYPE_MODEM = 1<<9, /**< A MODEM connected telephone number */ + CONTACTS_NUMBER_TYPE_CAR = 1<<10, /**< A car-phone telephone number */ + CONTACTS_NUMBER_TYPE_ISDN = 1<<11, /**< An ISDN service telephone number */ + CONTACTS_NUMBER_TYPE_VIDEO = 1<<12, /**< A video conferencing telephone number */ + CONTACTS_NUMBER_TYPE_PCS = 1<<13, /**< A personal communication services telephone number */ + + CONTACTS_NUMBER_TYPE_ASSISTANT = 1<<30, /**< A additional type for assistant */ +}contacts_number_type_e; + +typedef enum { + CONTACTS_EMAIL_TYPE_OTHER, /**< . */ + CONTACTS_EMAIL_TYPE_CUSTOM = 1<<0, /**< . */ + CONTACTS_EMAIL_TYPE_HOME = 1<<1, /**< . */ + CONTACTS_EMAIL_TYPE_WORK = 1<<2, /**< . */ + CONTACTS_EMAIL_TYPE_MOBILE = 1<<3, /**< . */ +}contacts_email_type_e; + +typedef enum { + CONTACTS_COMPANY_TYPE_OTHER, /**< . */ + CONTACTS_COMPANY_TYPE_CUSTOM = 1<<0, /**< . */ + CONTACTS_COMPANY_TYPE_WORK = 1<<1, /**< . */ +}contacts_company_type_e; + +typedef enum { + CONTACTS_ADDRESS_TYPE_OTHER, /**< . */ + CONTACTS_ADDRESS_TYPE_CUSTOM = 1<<0, /**< a delivery address for a residence */ + CONTACTS_ADDRESS_TYPE_HOME = 1<<1, /**< a delivery address for a residence */ + CONTACTS_ADDRESS_TYPE_WORK = 1<<2, /**< a delivery address for a place of work */ + CONTACTS_ADDRESS_TYPE_DOM = 1<<3, /**< a domestic delivery address */ + CONTACTS_ADDRESS_TYPE_INTL = 1<<4, /**< an international delivery address */ + CONTACTS_ADDRESS_TYPE_POSTAL = 1<<5, /**< a postal delivery address */ + CONTACTS_ADDRESS_TYPE_PARCEL = 1<<6, /**< a parcel delivery address */ +}contacts_address_type_e; + +typedef enum { + CONTACTS_URL_TYPE_OTHER, /**< . */ + CONTACTS_URL_TYPE_CUSTOM, /**< . */ + CONTACTS_URL_TYPE_HOME, /**< . */ + CONTACTS_URL_TYPE_WORK, /**< . */ +}contacts_url_type_e; + +typedef enum{ + CONTACTS_MESSENGER_TYPE_OTHER, /**< . */ + CONTACTS_MESSENGER_TYPE_CUSTOM, /**< . */ + CONTACTS_MESSENGER_TYPE_GOOGLE, /**< . */ + CONTACTS_MESSENGER_TYPE_WLM, /**< . */ + CONTACTS_MESSENGER_TYPE_YAHOO, /**< . */ + CONTACTS_MESSENGER_TYPE_FACEBOOK, /**< . */ + CONTACTS_MESSENGER_TYPE_ICQ, /**< . */ + CONTACTS_MESSENGER_TYPE_AIM, /**< . */ + CONTACTS_MESSENGER_TYPE_QQ, /**< . */ + CONTACTS_MESSENGER_TYPE_JABBER, /**< . */ + CONTACTS_MESSENGER_TYPE_SKYPE, /**< . */ + CONTACTS_MESSENGER_TYPE_IRC, /**< . */ +}contacts_messenger_type_e; + +typedef enum { + CONTACTS_PLOG_TYPE_NONE, + CONTACTS_PLOG_TYPE_VOICE_INCOMMING = 1, /**< . */ + CONTACTS_PLOG_TYPE_VOICE_OUTGOING = 2, /**< . */ + CONTACTS_PLOG_TYPE_VIDEO_INCOMMING = 3, /**< . */ + CONTACTS_PLOG_TYPE_VIDEO_OUTGOING = 4, /**< . */ + CONTACTS_PLOG_TYPE_VOICE_INCOMMING_UNSEEN = 5, /**< Not confirmed missed call */ + CONTACTS_PLOG_TYPE_VOICE_INCOMMING_SEEN = 6, /**< Confirmed missed call */ + CONTACTS_PLOG_TYPE_VIDEO_INCOMMING_UNSEEN = 7, /**< Not confirmed missed video call */ + CONTACTS_PLOG_TYPE_VIDEO_INCOMMING_SEEN = 8, /**< Confirmed missed video call */ + CONTACTS_PLOG_TYPE_VOICE_REJECT = 9, /**< . */ + CONTACTS_PLOG_TYPE_VIDEO_REJECT = 10, /**< . */ + CONTACTS_PLOG_TYPE_VOICE_BLOCKED = 11, /**< . */ + CONTACTS_PLOG_TYPE_VIDEO_BLOCKED = 12, /**< . */ + + CONTACTS_PLOG_TYPE_MMS_INCOMMING = 101, /**< . */ + CONTACTS_PLOG_TYPE_MMS_OUTGOING = 102, /**< . */ + CONTACTS_PLOG_TYPE_SMS_INCOMMING = 103, /**< . */ + CONTACTS_PLOG_TYPE_SMS_OUTGOING = 104, /**< . */ + CONTACTS_PLOG_TYPE_SMS_BLOCKED = 105, /**< . */ + CONTACTS_PLOG_TYPE_MMS_BLOCKED = 106, /**< . */ + + CONTACTS_PLOG_TYPE_EMAIL_RECEIVED = 201, /**<.*/ + CONTACTS_PLOG_TYPE_EMAIL_SENT = 202, /**<.*/ + + CONTACTS_PLOG_TYPE_MAX +}contacts_phone_log_type_e; + +typedef enum { + CONTACTS_EVENT_TYPE_OTHER, /**< . */ + CONTACTS_EVENT_TYPE_CUSTOM, /**< . */ + CONTACTS_EVENT_TYPE_BIRTH, /**< . */ + CONTACTS_EVENT_TYPE_ANNIVERSARY /**< . */ +}contacts_event_type_e; + +typedef enum { + CONTACTS_USAGE_STAT_TYPE_NONE, /**< . */ + CONTACTS_USAGE_STAT_TYPE_OUTGOING_CALL, /**< . */ + CONTACTS_USAGE_STAT_TYPE_OUTGOING_MSG /**< . */ +}contacts_usage_type_e; + +typedef enum { + CONTACTS_DISPLAY_NAME_SOURCE_TYPE_INVALID, /**< . */ + CONTACTS_DISPLAY_NAME_SOURCE_TYPE_EMAIL, /**< . */ + CONTACTS_DISPLAY_NAME_SOURCE_TYPE_NUMBER, /**< . */ + CONTACTS_DISPLAY_NAME_SOURCE_TYPE_NICKNAME, /**< . */ + CONTACTS_DISPLAY_NAME_SOURCE_TYPE_COMPANY, /**< . */ + CONTACTS_DISPLAY_NAME_SOURCE_TYPE_NAME, /**< . */ +}contacts_display_name_source_type_e; + +typedef enum { + CONTACTS_ADDRESS_BOOK_MODE_NONE, /**< .*/ + CONTACTS_ADDRESS_BOOK_MODE_READONLY, /**< .*/ +}contacts_address_book_mode_e; + +typedef enum { + CONTACTS_RELATIONSHIP_TYPE_OTHER, /**< .*/ + CONTACTS_RELATIONSHIP_TYPE_ASSISTANT, /**< .*/ + CONTACTS_RELATIONSHIP_TYPE_BROTHER, /**< .*/ + CONTACTS_RELATIONSHIP_TYPE_CHILD, /**< .*/ + CONTACTS_RELATIONSHIP_TYPE_DOMESTIC_PARTNER, /**< .*/ + CONTACTS_RELATIONSHIP_TYPE_FATHER, /**< .*/ + CONTACTS_RELATIONSHIP_TYPE_FRIEND, /**< .*/ + CONTACTS_RELATIONSHIP_TYPE_MANAGER, /**< .*/ + CONTACTS_RELATIONSHIP_TYPE_MOTHER, /**< .*/ + CONTACTS_RELATIONSHIP_TYPE_PARENT, /**< .*/ + CONTACTS_RELATIONSHIP_TYPE_PARTNER, /**< .*/ + CONTACTS_RELATIONSHIP_TYPE_REFERRED_BY, /**< .*/ + CONTACTS_RELATIONSHIP_TYPE_RELATIVE, /**< .*/ + CONTACTS_RELATIONSHIP_TYPE_SISTER, /**< .*/ + CONTACTS_RELATIONSHIP_TYPE_SPOUSE, /**< .*/ + CONTACTS_RELATIONSHIP_TYPE_CUSTOM, /**< .*/ +}contacts_relationship_type_e; + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __TIZEN_SOCIAL_CONTACTS_TYPES_H__ */ + diff --git a/include/contacts-svc.head b/include/contacts_utils.h index fcb5cd5..9757b20 100755..100644 --- a/include/contacts-svc.head +++ b/include/contacts_utils.h @@ -1,53 +1,57 @@ -/* - * Contacts Service - * - * Copyright (c) 2010 - 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Youngjae Shin <yj99.shin@samsung.com> - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -#ifndef __CONTACTS_SVC_H__ -#define __CONTACTS_SVC_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - -#include <contacts-svc-struct.h> -#include <contacts-svc-sub.h> - -/** - * This header file contains the declaration & description of Contacts Service. - * - * @defgroup CONTACTS_SVC Contacts Service - * @ingroup PIMS_SVC - * @brief Contacts Service - * - * Contacts Service supports APIs that insert, delete, and update contact data - * in order to accommodate the needs for application's contact data processing. - * - * @section Header To use Them: - * @code - * #include <contacts-svc.h> - * @endcode - * - */ - -/** - * @addtogroup CONTACTS_SVC - * @{ - */ - +/*
+ * Contacts Service
+ *
+ * Copyright (c) 2010 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#ifndef __TIZEN_SOCIAL_CONTACTS_UTILS_H__
+#define __TIZEN_SOCIAL_CONTACTS_UTILS_H__
+
+#ifndef API
+#define API __attribute__ ((visibility("default")))
+#endif
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/**
+ * @addtogroup CAPI_SOCIAL_CONTACTS_SVC_UTILS_MODULE
+ * @{
+ */
+
+/**
+ * Gets normalized string.
+ *
+ * @param[out] index_string The pointer of language index (number, first language, second language(if differ from first), #).
+ *
+ * @return 0 on success, otherwise a negative error value.
+ *
+ * @retval #CONTACTS_ERROR_NONE Successful +*/
+API int contacts_utils_get_index_characters(char **index_string);
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif //__TIZEN_SOCIAL_CONTACTS_UTILS_H__
+
diff --git a/include/contacts_vcard.h b/include/contacts_vcard.h new file mode 100644 index 0000000..3f64535 --- /dev/null +++ b/include/contacts_vcard.h @@ -0,0 +1,127 @@ +/* + * Contacts Service + * + * Copyright (c) 2010 - 2012 Samsung Electronics Co., Ltd. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +#ifndef __TIZEN_SOCIAL_CONTACTS_VCARD_H__ +#define __TIZEN_SOCIAL_CONTACTS_VCARD_H__ + +#ifndef API +#define API __attribute__ ((visibility("default"))) +#endif + +#ifdef __cplusplus +extern "C" +{ +#endif + +/** + * @addtogroup CAPI_SOCIAL_CONTACTS_SVC_VCARD_MODULE + * @{ + */ +/** + * @brief The callback function to get record hadle of \ref CAPI_SOCIAL_CONTACTS_SVC_VIEW_MODULE_contacts_contact. + * + * @param[in] record The record handle + * @param[in] user_data The user data passed from the foreach function + * + * @return @c true to continue with the next iteration of the loop or @c false to break out of the loop. + * + * @pre contacts_vcard_parse_to_contact_foreach() will invoke this callback. + * + * @see contacts_vcard_parse_to_contact_foreach() + */ +typedef bool (*contacts_vcard_parse_cb)(contacts_record_h record, void *user_data); + +/** + * @brief Retrieves all contacts with record handle(_contacts_contact) from a vCard file. + * + * @param[in] vcard_file_path The file path of vCard stream file + * @param[in] callback The callback function to invoke + * @param[in] user_data The user data to be passed to the callback function + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_OUT_OF_MEMORY Out of memory + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + * + * @post This function invokes contacts_vcard_stream_cb(). + * + * @see contacts_vcard_parse_cb() + */ +API int contacts_vcard_parse_to_contact_foreach(const char *vcard_file_path, contacts_vcard_parse_cb callback, void *user_data); + +/** + * @brief Retrieves all contacts with contacts list from vCard stream. + * + * @param[in] vcard_stream The vCard stream + * @param[out] contacts_list The contacts list handle + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_OUT_OF_MEMORY Out of memory + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + */ +API int contacts_vcard_parse_to_contacts(const char *vcard_stream, contacts_list_h *contacts_list); + +/** + * @brief Retrieves vCard stream from a contact. + * + * @param[in] contact The contact record handle + * @param[out] vcard_stream The vCard stream + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_OUT_OF_MEMORY Out of memory + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + */ +API int contacts_vcard_make_from_contact(contacts_record_h contact, char **vcard_stream); + +/** + * @brief Retrieves vCard stream from a person. + * + * @param[in] person The person record handle + * @param[out] vcard_stream The vCard stream + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_OUT_OF_MEMORY Out of memory + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + */ +API int contacts_vcard_make_from_person(contacts_record_h person, char **vcard_stream); + +/** + * @brief Retrieves count of contact entity from a vCard file. + * + * @param[in] vcard_file_path The person record handle + * @param[out] count The count of contact entity + * + * @return 0 on success, otherwise a negative error value. + * @retval #CONTACTS_ERROR_NONE Successful + * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter + */ +API int contacts_vcard_get_entity_count(const char *vcard_file_path, int *count); + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + + +#endif //__TIZEN_SOCIAL_CONTACTS_VCARD_H__ diff --git a/include/contacts_views.h b/include/contacts_views.h new file mode 100755 index 0000000..358dbb7 --- /dev/null +++ b/include/contacts_views.h @@ -0,0 +1,607 @@ +/* + * Contacts Service + * + * Copyright (c) 2010 - 2012 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Dohyung Jin <dh.jin@samsung.com> + * Jongwon Lee <gogosing.lee@samsung.com> + * Donghee Ye <donghee.ye@samsung.com> + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef __TIZEN_SOCIAL_CONTACTS_VIEWS_H__ +#define __TIZEN_SOCIAL_CONTACTS_VIEWS_H__ + +#include "contacts_types.h" + +#ifdef __cplusplus +extern "C" +{ +#endif + +// address_book +_CONTACTS_BEGIN_VIEW() + _CONTACTS_PROPERTY_INT( id ) // read only + _CONTACTS_PROPERTY_INT( account_id ) // read, write-once + _CONTACTS_PROPERTY_STR( name ) // read, write + _CONTACTS_PROPERTY_INT( mode ) // read, write +_CONTACTS_END_VIEW( _contacts_address_book ) + +// group +_CONTACTS_BEGIN_VIEW() + _CONTACTS_PROPERTY_INT( id ) // read only + _CONTACTS_PROPERTY_INT( address_book_id ) // read, write-once + _CONTACTS_PROPERTY_STR( name ) // read, write + _CONTACTS_PROPERTY_STR( ringtone_path ) // read, write + _CONTACTS_PROPERTY_STR( image_path ) // read, write + _CONTACTS_PROPERTY_STR( vibration ) // read, write + _CONTACTS_PROPERTY_STR( system_id ) // read, write, string + _CONTACTS_PROPERTY_BOOL( is_read_only ) // read only +_CONTACTS_END_VIEW( _contacts_group ) + +// person +_CONTACTS_BEGIN_VIEW() + _CONTACTS_PROPERTY_INT( id ) // read only + _CONTACTS_PROPERTY_STR( display_name ) // read only + _CONTACTS_PROPERTY_STR( display_name_index) // read only + _CONTACTS_PROPERTY_INT( display_contact_id ) // read, write + _CONTACTS_PROPERTY_STR( ringtone_path ) // read, write + _CONTACTS_PROPERTY_STR( image_thumbnail_path ) // read, write + _CONTACTS_PROPERTY_STR( vibration ) // read, write + _CONTACTS_PROPERTY_STR( status ) // read only + _CONTACTS_PROPERTY_BOOL( is_favorite ) // read, write + _CONTACTS_PROPERTY_DOUBLE( favorite_priority ) // read only + _CONTACTS_PROPERTY_INT( link_count ) // read only + _CONTACTS_PROPERTY_INT( account_id1 ) // read only + _CONTACTS_PROPERTY_INT( account_id2 ) // read only + _CONTACTS_PROPERTY_INT( account_id3 ) // read only + _CONTACTS_PROPERTY_STR( addressbook_ids ) // read only + _CONTACTS_PROPERTY_BOOL( has_phonenumber ) // read only + _CONTACTS_PROPERTY_BOOL( has_email ) // read only +_CONTACTS_END_VIEW( _contacts_person ) + +// simple contact +_CONTACTS_BEGIN_VIEW() + _CONTACTS_PROPERTY_INT( id ) // read only + _CONTACTS_PROPERTY_STR( display_name ) // read only + _CONTACTS_PROPERTY_INT( display_source_type) // read only, internal field ? + _CONTACTS_PROPERTY_INT( address_book_id ) // read, write-once + _CONTACTS_PROPERTY_STR( ringtone_path ) // read, write + _CONTACTS_PROPERTY_STR( image_thumbnail_path ) // read, write + _CONTACTS_PROPERTY_BOOL( is_favorite ) // read only + _CONTACTS_PROPERTY_BOOL( has_phonenumber ) // read only + _CONTACTS_PROPERTY_BOOL( has_email ) // read only + _CONTACTS_PROPERTY_INT( person_id ) // read only + _CONTACTS_PROPERTY_STR( uid ) // read, write + _CONTACTS_PROPERTY_STR( vibration ) // read, write + _CONTACTS_PROPERTY_INT( changed_time ) // read only +_CONTACTS_END_VIEW( _contacts_simple_contact ) + +// contact +_CONTACTS_BEGIN_VIEW() + _CONTACTS_PROPERTY_INT( id ) // read only + _CONTACTS_PROPERTY_STR( display_name ) // read only + _CONTACTS_PROPERTY_INT( display_source_type ) // read only + _CONTACTS_PROPERTY_INT( address_book_id ) // read, write once + _CONTACTS_PROPERTY_STR( ringtone_path ) // read, write + _CONTACTS_PROPERTY_STR( image_thumbnail_path ) // read, write + _CONTACTS_PROPERTY_BOOL( is_favorite ) // read only + _CONTACTS_PROPERTY_BOOL( has_phonenumber ) // read only + _CONTACTS_PROPERTY_BOOL( has_email ) // read only + _CONTACTS_PROPERTY_INT( person_id ) // read only + _CONTACTS_PROPERTY_STR( uid ) // read, write + _CONTACTS_PROPERTY_STR( vibration ) // read, write + _CONTACTS_PROPERTY_INT( changed_time ) // read only + _CONTACTS_PROPERTY_CHILD_SINGLE( name ) // read, write + _CONTACTS_PROPERTY_CHILD_SINGLE( image ) // read, write + _CONTACTS_PROPERTY_CHILD_MULTIPLE( company ) // read, write + _CONTACTS_PROPERTY_CHILD_MULTIPLE( note ) // read, write + _CONTACTS_PROPERTY_CHILD_MULTIPLE( number ) // read, write + _CONTACTS_PROPERTY_CHILD_MULTIPLE( email ) // read, write + _CONTACTS_PROPERTY_CHILD_MULTIPLE( event ) // read, write + _CONTACTS_PROPERTY_CHILD_MULTIPLE( messenger ) // read, write + _CONTACTS_PROPERTY_CHILD_MULTIPLE( address ) // read, write + _CONTACTS_PROPERTY_CHILD_MULTIPLE( url ) // read, write + _CONTACTS_PROPERTY_CHILD_MULTIPLE( nickname ) // read, write + _CONTACTS_PROPERTY_CHILD_MULTIPLE( profile ) // read, write + _CONTACTS_PROPERTY_CHILD_MULTIPLE( relationship ) // read, write + _CONTACTS_PROPERTY_CHILD_MULTIPLE( group_relation ) // read, write + _CONTACTS_PROPERTY_CHILD_MULTIPLE( extension ) // read, write +_CONTACTS_END_VIEW( _contacts_contact ) + +// my_profile +_CONTACTS_BEGIN_VIEW() + _CONTACTS_PROPERTY_INT( id ) // read only + _CONTACTS_PROPERTY_STR( display_name ) // read only + _CONTACTS_PROPERTY_INT( address_book_id ) // read, write once + _CONTACTS_PROPERTY_STR( image_thumbnail_path ) // read, write + _CONTACTS_PROPERTY_STR( uid ) // read, write + _CONTACTS_PROPERTY_INT( changed_time ) // read only + _CONTACTS_PROPERTY_CHILD_SINGLE( name ) // read, write + _CONTACTS_PROPERTY_CHILD_SINGLE( image ) // read, write + _CONTACTS_PROPERTY_CHILD_MULTIPLE( company ) // read, write + _CONTACTS_PROPERTY_CHILD_MULTIPLE( note ) // read, write + _CONTACTS_PROPERTY_CHILD_MULTIPLE( number ) // read, write + _CONTACTS_PROPERTY_CHILD_MULTIPLE( email ) // read, write + _CONTACTS_PROPERTY_CHILD_MULTIPLE( event ) // read, write + _CONTACTS_PROPERTY_CHILD_MULTIPLE( messenger ) // read, write + _CONTACTS_PROPERTY_CHILD_MULTIPLE( address ) // read, write + _CONTACTS_PROPERTY_CHILD_MULTIPLE( url ) // read, write + _CONTACTS_PROPERTY_CHILD_MULTIPLE( nickname ) // read, write + _CONTACTS_PROPERTY_CHILD_MULTIPLE( profile ) // read, write + _CONTACTS_PROPERTY_CHILD_MULTIPLE( relationship ) // read, write + _CONTACTS_PROPERTY_CHILD_MULTIPLE( extension ) // read, write +_CONTACTS_END_VIEW( _contacts_my_profile ) + + +// contact_name +_CONTACTS_BEGIN_VIEW() + _CONTACTS_PROPERTY_INT( id ) // read only + _CONTACTS_PROPERTY_INT( contact_id ) // read, write once + _CONTACTS_PROPERTY_STR( first ) // read, write + _CONTACTS_PROPERTY_STR( last ) // read, write + _CONTACTS_PROPERTY_STR( addition ) // read, write + _CONTACTS_PROPERTY_STR( suffix ) // read, write + _CONTACTS_PROPERTY_STR( prefix ) // read, write + _CONTACTS_PROPERTY_STR( phonetic_first ) // read, write + _CONTACTS_PROPERTY_STR( phonetic_middle ) // read, write + _CONTACTS_PROPERTY_STR( phonetic_last ) // read, write +_CONTACTS_END_VIEW( _contacts_name ) + +// contact_number +_CONTACTS_BEGIN_VIEW() + _CONTACTS_PROPERTY_INT( id ) // read only + _CONTACTS_PROPERTY_INT( contact_id ) // read, write once + _CONTACTS_PROPERTY_INT( type ) // read, write + _CONTACTS_PROPERTY_STR( label ) // read, write + _CONTACTS_PROPERTY_BOOL( is_default ) // read, write + _CONTACTS_PROPERTY_STR( number ) // read, write +_CONTACTS_END_VIEW( _contacts_number ) + +// contact_email +_CONTACTS_BEGIN_VIEW() + _CONTACTS_PROPERTY_INT( id ) // read only + _CONTACTS_PROPERTY_INT( contact_id ) // read, write once + _CONTACTS_PROPERTY_INT( type ) // read, write + _CONTACTS_PROPERTY_STR( label ) // read, write + _CONTACTS_PROPERTY_BOOL( is_default ) // read, write + _CONTACTS_PROPERTY_STR( email ) // read, write +_CONTACTS_END_VIEW( _contacts_email ) + +// contact_address +_CONTACTS_BEGIN_VIEW() + _CONTACTS_PROPERTY_INT( id ) // read only + _CONTACTS_PROPERTY_INT( contact_id ) // read, write once + _CONTACTS_PROPERTY_INT( type ) // read, write + _CONTACTS_PROPERTY_STR( label ) // read, write + _CONTACTS_PROPERTY_STR( postbox ) // read, write + _CONTACTS_PROPERTY_STR( extended ) // read, write + _CONTACTS_PROPERTY_STR( street ) // read, write + _CONTACTS_PROPERTY_STR( locality ) // read, write + _CONTACTS_PROPERTY_STR( region ) // read, write + _CONTACTS_PROPERTY_STR( postal_code ) // read, write + _CONTACTS_PROPERTY_STR( country ) // read, write + _CONTACTS_PROPERTY_BOOL( is_default ) // read, write +_CONTACTS_END_VIEW( _contacts_address ) + +// contact_note +_CONTACTS_BEGIN_VIEW() + _CONTACTS_PROPERTY_INT( id ) // read only + _CONTACTS_PROPERTY_INT( contact_id ) // read, write once + _CONTACTS_PROPERTY_STR( note ) // read, write +_CONTACTS_END_VIEW( _contacts_note ) + +// contact_url +_CONTACTS_BEGIN_VIEW() + _CONTACTS_PROPERTY_INT( id ) // read only + _CONTACTS_PROPERTY_INT( contact_id ) // read, write once + _CONTACTS_PROPERTY_INT( type ) // read, write + _CONTACTS_PROPERTY_STR( label ) // read, write + _CONTACTS_PROPERTY_STR( url ) // read, write +_CONTACTS_END_VIEW( _contacts_url ) + +// contact_event +_CONTACTS_BEGIN_VIEW() + _CONTACTS_PROPERTY_INT( id ) // read only + _CONTACTS_PROPERTY_INT( contact_id ) // read, write once + _CONTACTS_PROPERTY_INT( type ) // read, write + _CONTACTS_PROPERTY_STR( label ) // read, write + _CONTACTS_PROPERTY_INT( date ) // read, write + _CONTACTS_PROPERTY_INT( is_lunar ) // read, write + _CONTACTS_PROPERTY_INT( lunar_date ) // read, write +_CONTACTS_END_VIEW( _contacts_event ) + +// contact_grouprelation +// refer to the contacts_group_add_contact, contacts_group_remove_contact +_CONTACTS_BEGIN_VIEW() + _CONTACTS_PROPERTY_INT( id ) // read only, can not used as filter + _CONTACTS_PROPERTY_INT( group_id ) // read, write + _CONTACTS_PROPERTY_INT( contact_id ) // read, write once + _CONTACTS_PROPERTY_STR( name ) // read only +_CONTACTS_END_VIEW( _contacts_group_relation ) + +// contact_relationship +_CONTACTS_BEGIN_VIEW() + _CONTACTS_PROPERTY_INT( id ) // read only + _CONTACTS_PROPERTY_INT( contact_id ) // read, write once + _CONTACTS_PROPERTY_INT( type ) // read, write + _CONTACTS_PROPERTY_STR( label ) // read, write + _CONTACTS_PROPERTY_STR( name ) // read, write +_CONTACTS_END_VIEW( _contacts_relationship ) + +// contact_image +_CONTACTS_BEGIN_VIEW() + _CONTACTS_PROPERTY_INT( id ) // read only + _CONTACTS_PROPERTY_INT( contact_id ) // read, write once + _CONTACTS_PROPERTY_INT( type ) // read, write + _CONTACTS_PROPERTY_STR( label ) // read, write + _CONTACTS_PROPERTY_STR( path ) // read, write + _CONTACTS_PROPERTY_BOOL( is_default ) +_CONTACTS_END_VIEW( _contacts_image ) + +// contact_company +_CONTACTS_BEGIN_VIEW() + _CONTACTS_PROPERTY_INT( id ) // read only + _CONTACTS_PROPERTY_INT( contact_id ) // read, write once + _CONTACTS_PROPERTY_INT( type ) // read, write + _CONTACTS_PROPERTY_STR( label ) // read, write + _CONTACTS_PROPERTY_STR( name ) // read, write + _CONTACTS_PROPERTY_STR( department ) // read, write + _CONTACTS_PROPERTY_STR( job_title ) // read, write + _CONTACTS_PROPERTY_STR( assistant_name ) // read, write + _CONTACTS_PROPERTY_STR( role ) // read, write + _CONTACTS_PROPERTY_STR( logo ) // read, write + _CONTACTS_PROPERTY_STR( location ) // read, write + _CONTACTS_PROPERTY_STR( description ) // read, write + _CONTACTS_PROPERTY_STR( phonetic_name ) // read, write +_CONTACTS_END_VIEW( _contacts_company ) + +// contact_nickname +_CONTACTS_BEGIN_VIEW() + _CONTACTS_PROPERTY_INT( id ) // read only + _CONTACTS_PROPERTY_INT( contact_id ) // read, write once + _CONTACTS_PROPERTY_STR( name ) // read, write +_CONTACTS_END_VIEW( _contacts_nickname ) + +// contact_messenger +_CONTACTS_BEGIN_VIEW() + _CONTACTS_PROPERTY_INT( id ) // read only + _CONTACTS_PROPERTY_INT( contact_id ) // read, write once + _CONTACTS_PROPERTY_INT( type ) // read, write + _CONTACTS_PROPERTY_STR( label ) // read, write + _CONTACTS_PROPERTY_STR( im_id ) // read, write +_CONTACTS_END_VIEW( _contacts_messenger ) + +// contact_extend +_CONTACTS_BEGIN_VIEW() + _CONTACTS_PROPERTY_INT( id ) // read only + _CONTACTS_PROPERTY_INT( contact_id ) // read, write once + _CONTACTS_PROPERTY_INT( data1 ) // read, write + _CONTACTS_PROPERTY_STR( data2 ) // read, write + _CONTACTS_PROPERTY_STR( data3 ) // read, write + _CONTACTS_PROPERTY_STR( data4 ) // read, write + _CONTACTS_PROPERTY_STR( data5 ) // read, write + _CONTACTS_PROPERTY_STR( data6 ) // read, write + _CONTACTS_PROPERTY_STR( data7 ) // read, write + _CONTACTS_PROPERTY_STR( data8 ) // read, write + _CONTACTS_PROPERTY_STR( data9 ) // read, write + _CONTACTS_PROPERTY_STR( data10 ) // read, write + _CONTACTS_PROPERTY_STR( data11 ) // read, write + _CONTACTS_PROPERTY_STR( data12 ) // read, write +_CONTACTS_END_VIEW( _contacts_extension ) + +// contact_sdn +_CONTACTS_BEGIN_VIEW() + _CONTACTS_PROPERTY_INT( id ) // read only + _CONTACTS_PROPERTY_STR( name ) // read, write + _CONTACTS_PROPERTY_STR( number ) // read, write +_CONTACTS_END_VIEW( _contacts_sdn ) + +// contact_profile +_CONTACTS_BEGIN_VIEW() + _CONTACTS_PROPERTY_INT( id ) // read only + _CONTACTS_PROPERTY_INT( type ) // read, write + _CONTACTS_PROPERTY_STR( label ) // read, write + _CONTACTS_PROPERTY_STR( uid ) // read, write + _CONTACTS_PROPERTY_STR( text ) // read, write + _CONTACTS_PROPERTY_INT( order ) // read, write + _CONTACTS_PROPERTY_STR( appsvc_operation ) // read, write + _CONTACTS_PROPERTY_STR( data1 ) // read, write + _CONTACTS_PROPERTY_STR( data2 ) // read, write + _CONTACTS_PROPERTY_STR( data3 ) // read, write + _CONTACTS_PROPERTY_STR( data4 ) // read, write + _CONTACTS_PROPERTY_INT( contact_id ) // read, write once +_CONTACTS_END_VIEW( _contacts_profile ) + +// activity photo +_CONTACTS_BEGIN_VIEW() + _CONTACTS_PROPERTY_INT( id ) // read only + _CONTACTS_PROPERTY_INT( activity_id ) // read, write once + _CONTACTS_PROPERTY_STR( photo_url ) // read, write + _CONTACTS_PROPERTY_INT( sort_index ) // read, write +_CONTACTS_END_VIEW( _contacts_activity_photo ) + +// activity +_CONTACTS_BEGIN_VIEW() + _CONTACTS_PROPERTY_INT( id ) // read only + _CONTACTS_PROPERTY_INT( contact_id ) // read, write once + _CONTACTS_PROPERTY_STR( source_name ) // read, write + _CONTACTS_PROPERTY_STR( status ) // read, write + _CONTACTS_PROPERTY_INT( timestamp ) // read, write + _CONTACTS_PROPERTY_STR( sync_data1 ) // read, write + _CONTACTS_PROPERTY_STR( sync_data2 ) // read, write + _CONTACTS_PROPERTY_STR( sync_data3 ) // read, write + _CONTACTS_PROPERTY_STR( sync_data4 ) // read, write + _CONTACTS_PROPERTY_CHILD_MULTIPLE(photo) // read, write +_CONTACTS_END_VIEW( _contacts_activity ) + +// speeddial +_CONTACTS_BEGIN_VIEW() + _CONTACTS_PROPERTY_INT( speeddial_number ) // read, write + _CONTACTS_PROPERTY_INT( number_id ) // read, write + _CONTACTS_PROPERTY_STR( number ) // read only + _CONTACTS_PROPERTY_STR( number_label ) // read only + _CONTACTS_PROPERTY_INT( number_type ) // read only + _CONTACTS_PROPERTY_INT( person_id ) // read only + _CONTACTS_PROPERTY_STR( display_name ) // read only + _CONTACTS_PROPERTY_STR( image_thumbnail_path ) // read only +_CONTACTS_END_VIEW( _contacts_speeddial ) + +// phone_log +_CONTACTS_BEGIN_VIEW() + _CONTACTS_PROPERTY_INT( id ) // read only + _CONTACTS_PROPERTY_INT( person_id ) // read, write once + _CONTACTS_PROPERTY_STR( address ) // read, write once, number or email + _CONTACTS_PROPERTY_INT( log_time ) // read, write once + _CONTACTS_PROPERTY_INT( log_type ) // read, write + _CONTACTS_PROPERTY_INT( extra_data1 ) // read, write once : message or email id, duration + _CONTACTS_PROPERTY_STR( extra_data2 ) // read, write once : shortmsg, subject +_CONTACTS_END_VIEW( _contacts_phone_log ) + +// contact_updated_info : read only +_CONTACTS_BEGIN_READ_ONLY_VIEW() + _CONTACTS_PROPERTY_INT( contact_id ) + _CONTACTS_PROPERTY_INT( address_book_id ) + _CONTACTS_PROPERTY_INT( type ) // insert/update/delete + _CONTACTS_PROPERTY_INT( version ) +_CONTACTS_END_READ_ONLY_VIEW( _contacts_contact_updated_info ) + +// group_updated_info : read only +_CONTACTS_BEGIN_READ_ONLY_VIEW() + _CONTACTS_PROPERTY_INT( group_id ) + _CONTACTS_PROPERTY_INT( address_book_id ) + _CONTACTS_PROPERTY_INT( type ) // insert/update/delete + _CONTACTS_PROPERTY_INT( version ) +_CONTACTS_END_READ_ONLY_VIEW( _contacts_group_updated_info ) + + +// group_updated_info : read only +_CONTACTS_BEGIN_READ_ONLY_VIEW() + _CONTACTS_PROPERTY_INT( group_id ) + _CONTACTS_PROPERTY_INT( address_book_id ) + _CONTACTS_PROPERTY_INT( version ) +_CONTACTS_END_READ_ONLY_VIEW( _contacts_group_member_updated_info ) + +// grouprel_updated_info : read only +_CONTACTS_BEGIN_READ_ONLY_VIEW() + _CONTACTS_PROPERTY_INT( group_id ) + _CONTACTS_PROPERTY_INT( contact_id ) + _CONTACTS_PROPERTY_INT( address_book_id ) + _CONTACTS_PROPERTY_INT( type ) // insert/delete + _CONTACTS_PROPERTY_INT( version ) +_CONTACTS_END_READ_ONLY_VIEW( _contacts_grouprel_updated_info ) + +// only for query (filter/projection) +// person_contact : read only +_CONTACTS_BEGIN_READ_ONLY_VIEW() + _CONTACTS_PROPERTY_INT( person_id ) + _CONTACTS_PROPERTY_STR( display_name ) + _CONTACTS_PROPERTY_PROJECTION_STR( display_name_index) + _CONTACTS_PROPERTY_PROJECTION_INT( display_contact_id ) + _CONTACTS_PROPERTY_PROJECTION_STR( ringtone_path ) + _CONTACTS_PROPERTY_PROJECTION_STR( image_thumbnail_path ) + _CONTACTS_PROPERTY_PROJECTION_STR( vibration ) + _CONTACTS_PROPERTY_PROJECTION_STR( status ) + _CONTACTS_PROPERTY_BOOL( is_favorite ) + _CONTACTS_PROPERTY_PROJECTION_INT( link_count ) + _CONTACTS_PROPERTY_PROJECTION_INT( account_id1 ) + _CONTACTS_PROPERTY_PROJECTION_INT( account_id2 ) + _CONTACTS_PROPERTY_PROJECTION_INT( account_id3 ) + _CONTACTS_PROPERTY_PROJECTION_STR( addressbook_ids ) + _CONTACTS_PROPERTY_BOOL( has_phonenumber ) + _CONTACTS_PROPERTY_BOOL( has_email ) + _CONTACTS_PROPERTY_INT( contact_id ) + _CONTACTS_PROPERTY_INT( address_book_id ) + _CONTACTS_PROPERTY_STR( address_book_name ) + _CONTACTS_PROPERTY_INT( address_book_mode ) +_CONTACTS_END_READ_ONLY_VIEW( _contacts_person_contact ) + +// person_number : read only +_CONTACTS_BEGIN_READ_ONLY_VIEW() + _CONTACTS_PROPERTY_INT( person_id ) + _CONTACTS_PROPERTY_STR( display_name ) + _CONTACTS_PROPERTY_PROJECTION_STR( display_name_index) + _CONTACTS_PROPERTY_PROJECTION_INT( display_contact_id ) + _CONTACTS_PROPERTY_PROJECTION_STR( ringtone_path ) + _CONTACTS_PROPERTY_PROJECTION_STR( image_thumbnail_path ) + _CONTACTS_PROPERTY_PROJECTION_STR( vibration ) + _CONTACTS_PROPERTY_BOOL( is_favorite ) + _CONTACTS_PROPERTY_BOOL( has_phonenumber ) + _CONTACTS_PROPERTY_BOOL( has_email ) + _CONTACTS_PROPERTY_INT( number_id ) + _CONTACTS_PROPERTY_PROJECTION_INT( type ) + _CONTACTS_PROPERTY_PROJECTION_STR( label ) + _CONTACTS_PROPERTY_BOOL( is_primary_default ) + _CONTACTS_PROPERTY_STR( number ) + _CONTACTS_PROPERTY_FILTER_STR( number_filter ) +_CONTACTS_END_READ_ONLY_VIEW( _contacts_person_number ) + +// person_email : read only +_CONTACTS_BEGIN_READ_ONLY_VIEW() + _CONTACTS_PROPERTY_INT( person_id ) + _CONTACTS_PROPERTY_STR( display_name ) + _CONTACTS_PROPERTY_PROJECTION_STR( display_name_index) + _CONTACTS_PROPERTY_PROJECTION_INT( display_contact_id ) + _CONTACTS_PROPERTY_PROJECTION_STR( ringtone_path ) + _CONTACTS_PROPERTY_PROJECTION_STR( image_thumbnail_path ) + _CONTACTS_PROPERTY_PROJECTION_STR( vibration ) + _CONTACTS_PROPERTY_BOOL( is_favorite ) + _CONTACTS_PROPERTY_BOOL( has_phonenumber ) + _CONTACTS_PROPERTY_BOOL( has_email ) + _CONTACTS_PROPERTY_INT( email_id ) + _CONTACTS_PROPERTY_PROJECTION_INT( type ) + _CONTACTS_PROPERTY_PROJECTION_STR( label ) + _CONTACTS_PROPERTY_BOOL( is_primary_default ) + _CONTACTS_PROPERTY_STR( email ) +_CONTACTS_END_READ_ONLY_VIEW( _contacts_person_email ) + +// person_group : read only +_CONTACTS_BEGIN_READ_ONLY_VIEW() + _CONTACTS_PROPERTY_INT( person_id ) + _CONTACTS_PROPERTY_STR( display_name ) + _CONTACTS_PROPERTY_PROJECTION_STR( display_name_index) + _CONTACTS_PROPERTY_PROJECTION_INT( display_contact_id ) + _CONTACTS_PROPERTY_PROJECTION_STR( ringtone_path ) + _CONTACTS_PROPERTY_PROJECTION_STR( image_thumbnail_path ) + _CONTACTS_PROPERTY_PROJECTION_STR( vibration ) + _CONTACTS_PROPERTY_PROJECTION_STR( status ) + _CONTACTS_PROPERTY_BOOL( is_favorite ) + _CONTACTS_PROPERTY_PROJECTION_INT( link_count ) + _CONTACTS_PROPERTY_PROJECTION_INT( account_id1 ) + _CONTACTS_PROPERTY_PROJECTION_INT( account_id2 ) + _CONTACTS_PROPERTY_PROJECTION_INT( account_id3 ) + _CONTACTS_PROPERTY_PROJECTION_STR( addressbook_ids ) + _CONTACTS_PROPERTY_BOOL( has_phonenumber ) + _CONTACTS_PROPERTY_BOOL( has_email ) + _CONTACTS_PROPERTY_INT( address_book_id ) + _CONTACTS_PROPERTY_INT( group_id ) + _CONTACTS_PROPERTY_STR( address_book_name ) + _CONTACTS_PROPERTY_INT( address_book_mode ) + _CONTACTS_PROPERTY_PROJECTION_INT( contact_id ) +_CONTACTS_END_READ_ONLY_VIEW( _contacts_person_grouprel ) + +//person phone_log : read only +_CONTACTS_BEGIN_READ_ONLY_VIEW() + _CONTACTS_PROPERTY_INT( person_id ) + _CONTACTS_PROPERTY_STR( display_name ) + _CONTACTS_PROPERTY_PROJECTION_STR( image_thumbnail_path ) + _CONTACTS_PROPERTY_INT( log_id ) + _CONTACTS_PROPERTY_STR( address ) + _CONTACTS_PROPERTY_PROJECTION_INT( address_type ) + _CONTACTS_PROPERTY_INT( log_time ) + _CONTACTS_PROPERTY_INT( log_type ) + _CONTACTS_PROPERTY_PROJECTION_INT( extra_data1 ) + _CONTACTS_PROPERTY_PROJECTION_STR( extra_data2 ) +_CONTACTS_END_READ_ONLY_VIEW( _contacts_person_phone_log ) + +// person, stat : read only +_CONTACTS_BEGIN_READ_ONLY_VIEW() + _CONTACTS_PROPERTY_INT( person_id ) + _CONTACTS_PROPERTY_STR( display_name ) + _CONTACTS_PROPERTY_PROJECTION_STR( display_name_index) + _CONTACTS_PROPERTY_PROJECTION_INT( display_contact_id ) + _CONTACTS_PROPERTY_PROJECTION_STR( ringtone_path ) + _CONTACTS_PROPERTY_PROJECTION_STR( image_thumbnail_path ) + _CONTACTS_PROPERTY_PROJECTION_STR( vibration ) + _CONTACTS_PROPERTY_BOOL( is_favorite ) + _CONTACTS_PROPERTY_BOOL( has_phonenumber ) + _CONTACTS_PROPERTY_BOOL( has_email ) + _CONTACTS_PROPERTY_INT( usage_type ) + _CONTACTS_PROPERTY_INT( times_used ) +_CONTACTS_END_READ_ONLY_VIEW( _contacts_person_usage ) + +// simple contact number : read only +_CONTACTS_BEGIN_READ_ONLY_VIEW() + _CONTACTS_PROPERTY_INT( contact_id ) + _CONTACTS_PROPERTY_STR( display_name ) + _CONTACTS_PROPERTY_PROJECTION_INT( display_source_type) + _CONTACTS_PROPERTY_INT( address_book_id ) + _CONTACTS_PROPERTY_INT( person_id ) + _CONTACTS_PROPERTY_PROJECTION_STR( ringtone_path ) + _CONTACTS_PROPERTY_PROJECTION_STR( image_thumbnail_path ) + _CONTACTS_PROPERTY_INT( number_id ) + _CONTACTS_PROPERTY_PROJECTION_INT( type ) + _CONTACTS_PROPERTY_PROJECTION_STR( label ) + _CONTACTS_PROPERTY_BOOL( is_default ) + _CONTACTS_PROPERTY_STR( number ) + _CONTACTS_PROPERTY_FILTER_STR( number_filter ) +_CONTACTS_END_READ_ONLY_VIEW( _contacts_contact_number ) + +// simple contact email : read only +_CONTACTS_BEGIN_READ_ONLY_VIEW() + _CONTACTS_PROPERTY_INT( contact_id ) + _CONTACTS_PROPERTY_STR( display_name ) + _CONTACTS_PROPERTY_PROJECTION_INT( display_source_type) + _CONTACTS_PROPERTY_INT( address_book_id ) + _CONTACTS_PROPERTY_INT( person_id ) + _CONTACTS_PROPERTY_PROJECTION_STR( ringtone_path ) + _CONTACTS_PROPERTY_PROJECTION_STR( image_thumbnail_path ) + _CONTACTS_PROPERTY_INT( email_id ) + _CONTACTS_PROPERTY_PROJECTION_INT( type ) + _CONTACTS_PROPERTY_PROJECTION_STR( label ) + _CONTACTS_PROPERTY_BOOL( is_default ) + _CONTACTS_PROPERTY_STR( email ) +_CONTACTS_END_READ_ONLY_VIEW( _contacts_contact_email ) + +// simple contact group : read only +_CONTACTS_BEGIN_READ_ONLY_VIEW() + _CONTACTS_PROPERTY_INT( contact_id ) + _CONTACTS_PROPERTY_STR( display_name ) + _CONTACTS_PROPERTY_PROJECTION_INT( display_source_type) + _CONTACTS_PROPERTY_INT( address_book_id ) + _CONTACTS_PROPERTY_INT( person_id ) + _CONTACTS_PROPERTY_PROJECTION_STR( ringtone_path ) + _CONTACTS_PROPERTY_PROJECTION_STR( image_thumbnail_path ) + _CONTACTS_PROPERTY_INT( group_id ) + _CONTACTS_PROPERTY_PROJECTION_STR( group_name ) +_CONTACTS_END_READ_ONLY_VIEW( _contacts_contact_grouprel ) + +// simple contact activity : read only +_CONTACTS_BEGIN_READ_ONLY_VIEW() + _CONTACTS_PROPERTY_INT( contact_id ) + _CONTACTS_PROPERTY_STR( display_name ) + _CONTACTS_PROPERTY_PROJECTION_INT( display_source_type) + _CONTACTS_PROPERTY_INT( address_book_id ) + _CONTACTS_PROPERTY_INT( account_id ) + _CONTACTS_PROPERTY_INT( person_id ) + _CONTACTS_PROPERTY_PROJECTION_STR( ringtone_path ) + _CONTACTS_PROPERTY_PROJECTION_STR( image_thumbnail_path ) + _CONTACTS_PROPERTY_INT( activity_id ) + _CONTACTS_PROPERTY_STR( source_name ) + _CONTACTS_PROPERTY_PROJECTION_STR( status ) + _CONTACTS_PROPERTY_INT( timestamp ) + _CONTACTS_PROPERTY_PROJECTION_STR( sync_data1 ) + _CONTACTS_PROPERTY_PROJECTION_STR( sync_data2 ) + _CONTACTS_PROPERTY_PROJECTION_STR( sync_data3 ) + _CONTACTS_PROPERTY_PROJECTION_STR( sync_data4 ) +_CONTACTS_END_READ_ONLY_VIEW( _contacts_contact_activity ) + +// phone_log number list : read only +_CONTACTS_BEGIN_READ_ONLY_VIEW() + _CONTACTS_PROPERTY_STR( number ) +_CONTACTS_END_READ_ONLY_VIEW( _contacts_phone_log_number ) + +// phone_log stat : read only +_CONTACTS_BEGIN_READ_ONLY_VIEW() + _CONTACTS_PROPERTY_PROJECTION_STR( log_count ) + _CONTACTS_PROPERTY_STR( log_type ) +_CONTACTS_END_READ_ONLY_VIEW( _contacts_phone_log_stat ) + +#ifdef __cplusplus +} +#endif + +#endif /* __TIZEN_SOCIAL_CONTACTS_VIEWS_H__ */ + |