From 74fdf2aead43b04d40ca1196761cfb723bd43899 Mon Sep 17 00:00:00 2001 From: Sehong Na Date: Sat, 31 May 2014 12:56:53 +0900 Subject: [PATCH] Initialize Tizen 2.3 --- AUTHORS | 3 + CMakeLists.txt | 188 + LICENSE.APLv2 | 202 + NOTICE | 3 + inc/FSclAccount.h | 182 + inc/FSclAccountAccessor.h | 265 ++ inc/FSclAccountManager.h | 204 + inc/FSclAccountProvider.h | 173 + inc/FSclAddress.h | 545 +++ inc/FSclAddressbook.h | 1265 ++++++ inc/FSclAddressbookFilter.h | 266 ++ inc/FSclAddressbookManager.h | 1404 +++++++ inc/FSclAttendee.h | 301 ++ inc/FSclCalEvent.h | 926 +++++ inc/FSclCalEventChangeInfo.h | 143 + inc/FSclCalEventInstance.h | 242 ++ inc/FSclCalTodo.h | 467 +++ inc/FSclCalTodoChangeInfo.h | 143 + inc/FSclCalendar.h | 184 + inc/FSclCalendarbook.h | 1310 ++++++ inc/FSclCalendarbookFilter.h | 307 ++ inc/FSclCategory.h | 318 ++ inc/FSclCategoryChangeInfo.h | 143 + inc/FSclContact.h | 692 ++++ inc/FSclContactAppLaunchData.h | 256 ++ inc/FSclContactChangeInfo.h | 152 + inc/FSclContactEvent.h | 188 + inc/FSclEmail.h | 266 ++ inc/FSclEmailContact.h | 174 + inc/FSclIAccountEventListener.h | 134 + inc/FSclIAddressbookChangeEventListener.h | 148 + inc/FSclIAddressbookEventListener.h | 158 + inc/FSclICalendarbookEventListener.h | 107 + inc/FSclIRecordEventListener.h | 124 + inc/FSclIRecordListener.h | 112 + inc/FSclImAddress.h | 376 ++ inc/FSclOrganization.h | 338 ++ inc/FSclPerson.h | 311 ++ inc/FSclPhoneNumber.h | 264 ++ inc/FSclPhoneNumberContact.h | 174 + inc/FSclRecord.h | 128 + inc/FSclRecurrence.h | 557 +++ inc/FSclRelationship.h | 189 + inc/FSclReminder.h | 267 ++ inc/FSclTypes.h | 1087 +++++ inc/FSclUrl.h | 275 ++ inc/FSclUserProfile.h | 473 +++ inc/FSocial.h | 100 + osp-social.manifest | 5 + osp-social.pc.in | 14 + packaging/osp-social.spec | 113 + pkgmgr_account/CMakeLists.txt | 52 + pkgmgr_account/src/account.cpp | 447 ++ src/FSclAccount.cpp | 128 + src/FSclAccountAccessor.cpp | 238 ++ src/FSclAccountManager.cpp | 167 + src/FSclAccountProvider.cpp | 126 + src/FSclAddress.cpp | 341 ++ src/FSclAddressbook.cpp | 652 +++ src/FSclAddressbookFilter.cpp | 87 + src/FSclAddressbookManager.cpp | 873 ++++ src/FSclAttendee.cpp | 249 ++ src/FSclCalEvent.cpp | 421 ++ src/FSclCalEventChangeInfo.cpp | 107 + src/FSclCalEventInstance.cpp | 168 + src/FSclCalTodo.cpp | 269 ++ src/FSclCalTodoChangeInfo.cpp | 107 + src/FSclCalendar.cpp | 137 + src/FSclCalendarbook.cpp | 656 +++ src/FSclCalendarbookFilter.cpp | 99 + src/FSclCategory.cpp | 199 + src/FSclCategoryChangeInfo.cpp | 107 + src/FSclContact.cpp | 405 ++ src/FSclContactAppLaunchData.cpp | 165 + src/FSclContactChangeInfo.cpp | 113 + src/FSclContactEvent.cpp | 128 + src/FSclEmail.cpp | 159 + src/FSclEmailContact.cpp | 123 + src/FSclImAddress.cpp | 140 + src/FSclOrganization.cpp | 226 + src/FSclPerson.cpp | 166 + src/FSclPhoneNumber.cpp | 159 + src/FSclPhoneNumberContact.cpp | 123 + src/FSclRecord.cpp | 72 + src/FSclRecurrence.cpp | 237 ++ src/FSclRelationship.cpp | 133 + src/FSclReminder.cpp | 248 ++ src/FSclUrl.cpp | 159 + src/FSclUserProfile.cpp | 324 ++ src/FScl_AccountAccessorImpl.cpp | 353 ++ src/FScl_AccountAccessorImpl.h | 91 + src/FScl_AccountDbChangeEvent.cpp | 93 + src/FScl_AccountDbChangeEvent.h | 67 + src/FScl_AccountDbChangeEventArg.cpp | 51 + src/FScl_AccountDbChangeEventArg.h | 87 + src/FScl_AccountDbConnector.cpp | 117 + src/FScl_AccountDbConnector.h | 59 + src/FScl_AccountDbMonitor.cpp | 242 ++ src/FScl_AccountDbMonitor.h | 111 + src/FScl_AccountImpl.cpp | 304 ++ src/FScl_AccountImpl.h | 92 + src/FScl_AccountManagerImpl.cpp | 179 + src/FScl_AccountManagerImpl.h | 63 + src/FScl_AccountManagerUtil.cpp | 383 ++ src/FScl_AccountManagerUtil.h | 56 + src/FScl_AccountProviderImpl.cpp | 327 ++ src/FScl_AccountProviderImpl.h | 106 + src/FScl_AddressImpl.cpp | 275 ++ src/FScl_AddressImpl.h | 112 + src/FScl_AddressbookFilterImpl.cpp | 444 ++ src/FScl_AddressbookFilterImpl.h | 123 + src/FScl_AddressbookImpl.cpp | 2492 +++++++++++ src/FScl_AddressbookManagerImpl.cpp | 3306 +++++++++++++++ src/FScl_AddressbookUtil.cpp | 939 +++++ src/FScl_AddressbookUtil.h | 974 +++++ src/FScl_CalEventChangeInfoImpl.cpp | 158 + src/FScl_CalEventImpl.cpp | 2390 +++++++++++ src/FScl_CalEventInstanceImpl.cpp | 301 ++ src/FScl_CalTodoChangeInfoImpl.cpp | 158 + src/FScl_CalTodoImpl.cpp | 645 +++ src/FScl_CalendarImpl.cpp | 253 ++ src/FScl_CalendarbookDbChangeEvent.cpp | 75 + src/FScl_CalendarbookDbChangeEvent.h | 66 + src/FScl_CalendarbookDbChangeEventArg.cpp | 44 + src/FScl_CalendarbookDbChangeEventArg.h | 75 + src/FScl_CalendarbookDbConnector.cpp | 136 + src/FScl_CalendarbookDbConnector.h | 54 + src/FScl_CalendarbookDbMonitor.cpp | 253 ++ src/FScl_CalendarbookDbMonitor.h | 110 + src/FScl_CalendarbookFilterImpl.cpp | 647 +++ src/FScl_CalendarbookFilterImpl.h | 129 + src/FScl_CalendarbookImpl.cpp | 3128 ++++++++++++++ src/FScl_CalendarbookRecordRetrivalEvent.cpp | 67 + src/FScl_CalendarbookRecordRetrivalEvent.h | 66 + src/FScl_CalendarbookRecordRetrivalEventArg.cpp | 59 + src/FScl_CalendarbookRecordRetrivalEventArg.h | 79 + src/FScl_CalendarbookRecordRetrivalThread.cpp | 125 + src/FScl_CalendarbookRecordRetrivalThread.h | 76 + src/FScl_CalendarbookUtil.cpp | 826 ++++ src/FScl_CalendarbookUtil.h | 143 + src/FScl_CategoryChangeInfoImpl.cpp | 188 + src/FScl_CategoryChangeInfoImpl.h | 109 + src/FScl_CategoryImpl.cpp | 698 ++++ src/FScl_ContactAppLaunchDataImpl.cpp | 439 ++ src/FScl_ContactAppLaunchDataImpl.h | 109 + src/FScl_ContactChangeInfoImpl.cpp | 209 + src/FScl_ContactChangeInfoImpl.h | 114 + src/FScl_ContactDbChangeEvent.cpp | 82 + src/FScl_ContactDbChangeEvent.h | 67 + src/FScl_ContactDbChangeEventArg.cpp | 44 + src/FScl_ContactDbChangeEventArg.h | 85 + src/FScl_ContactDbConnector.cpp | 129 + src/FScl_ContactDbMonitor.cpp | 343 ++ src/FScl_ContactDbMonitor.h | 176 + src/FScl_ContactEventImpl.cpp | 169 + src/FScl_ContactEventImpl.h | 83 + src/FScl_ContactImpl.cpp | 5015 +++++++++++++++++++++++ src/FScl_EmailContactImpl.cpp | 251 ++ src/FScl_EmailContactImpl.h | 119 + src/FScl_EmailImpl.cpp | 205 + src/FScl_IAccountDbChangeEventListener.h | 54 + src/FScl_ICalendarbookDbChangeEventListener.h | 51 + src/FScl_ImAddressImpl.cpp | 163 + src/FScl_ImAddressImpl.h | 78 + src/FScl_OrganizationImpl.cpp | 403 ++ src/FScl_OrganizationImpl.h | 126 + src/FScl_PersonImpl.cpp | 474 +++ src/FScl_PersonImpl.h | 140 + src/FScl_PhoneNumberContactImpl.cpp | 255 ++ src/FScl_PhoneNumberContactImpl.h | 104 + src/FScl_PhoneNumberImpl.cpp | 199 + src/FScl_PhoneNumberImpl.h | 107 + src/FScl_RecordImpl.cpp | 92 + src/FScl_RecurrenceImpl.cpp | 513 +++ src/FScl_RelationshipImpl.cpp | 160 + src/FScl_RelationshipImpl.h | 77 + src/FScl_ReminderImpl.cpp | 122 + src/FScl_UrlImpl.cpp | 169 + src/FScl_UrlImpl.h | 81 + src/FScl_UserProfileImpl.cpp | 3559 ++++++++++++++++ src/inc/FScl_AddressbookImpl.h | 211 + src/inc/FScl_AddressbookManagerImpl.h | 236 ++ src/inc/FScl_CalEventChangeInfoImpl.h | 163 + src/inc/FScl_CalEventImpl.h | 609 +++ src/inc/FScl_CalEventInstanceImpl.h | 324 ++ src/inc/FScl_CalTodoChangeInfoImpl.h | 164 + src/inc/FScl_CalTodoImpl.h | 350 ++ src/inc/FScl_CalendarImpl.h | 173 + src/inc/FScl_CalendarbookImpl.h | 852 ++++ src/inc/FScl_CategoryImpl.h | 154 + src/inc/FScl_ContactDbConnector.h | 59 + src/inc/FScl_ContactImpl.h | 214 + src/inc/FScl_EmailImpl.h | 89 + src/inc/FScl_IContactDbChangeEventListener.h | 52 + src/inc/FScl_RecordImpl.h | 123 + src/inc/FScl_RecurrenceImpl.h | 428 ++ src/inc/FScl_ReminderImpl.h | 91 + src/inc/FScl_UserProfileImpl.h | 496 +++ 198 files changed, 66934 insertions(+) create mode 100644 AUTHORS create mode 100755 CMakeLists.txt create mode 100644 LICENSE.APLv2 create mode 100644 NOTICE create mode 100644 inc/FSclAccount.h create mode 100644 inc/FSclAccountAccessor.h create mode 100644 inc/FSclAccountManager.h create mode 100644 inc/FSclAccountProvider.h create mode 100644 inc/FSclAddress.h create mode 100644 inc/FSclAddressbook.h create mode 100644 inc/FSclAddressbookFilter.h create mode 100644 inc/FSclAddressbookManager.h create mode 100644 inc/FSclAttendee.h create mode 100644 inc/FSclCalEvent.h create mode 100644 inc/FSclCalEventChangeInfo.h create mode 100644 inc/FSclCalEventInstance.h create mode 100644 inc/FSclCalTodo.h create mode 100644 inc/FSclCalTodoChangeInfo.h create mode 100644 inc/FSclCalendar.h create mode 100644 inc/FSclCalendarbook.h create mode 100644 inc/FSclCalendarbookFilter.h create mode 100644 inc/FSclCategory.h create mode 100644 inc/FSclCategoryChangeInfo.h create mode 100644 inc/FSclContact.h create mode 100644 inc/FSclContactAppLaunchData.h create mode 100644 inc/FSclContactChangeInfo.h create mode 100644 inc/FSclContactEvent.h create mode 100644 inc/FSclEmail.h create mode 100644 inc/FSclEmailContact.h create mode 100644 inc/FSclIAccountEventListener.h create mode 100644 inc/FSclIAddressbookChangeEventListener.h create mode 100644 inc/FSclIAddressbookEventListener.h create mode 100644 inc/FSclICalendarbookEventListener.h create mode 100644 inc/FSclIRecordEventListener.h create mode 100644 inc/FSclIRecordListener.h create mode 100644 inc/FSclImAddress.h create mode 100644 inc/FSclOrganization.h create mode 100644 inc/FSclPerson.h create mode 100644 inc/FSclPhoneNumber.h create mode 100644 inc/FSclPhoneNumberContact.h create mode 100644 inc/FSclRecord.h create mode 100644 inc/FSclRecurrence.h create mode 100644 inc/FSclRelationship.h create mode 100644 inc/FSclReminder.h create mode 100644 inc/FSclTypes.h create mode 100644 inc/FSclUrl.h create mode 100644 inc/FSclUserProfile.h create mode 100644 inc/FSocial.h create mode 100644 osp-social.manifest create mode 100755 osp-social.pc.in create mode 100644 packaging/osp-social.spec create mode 100755 pkgmgr_account/CMakeLists.txt create mode 100644 pkgmgr_account/src/account.cpp create mode 100644 src/FSclAccount.cpp create mode 100644 src/FSclAccountAccessor.cpp create mode 100644 src/FSclAccountManager.cpp create mode 100644 src/FSclAccountProvider.cpp create mode 100644 src/FSclAddress.cpp create mode 100644 src/FSclAddressbook.cpp create mode 100644 src/FSclAddressbookFilter.cpp create mode 100644 src/FSclAddressbookManager.cpp create mode 100644 src/FSclAttendee.cpp create mode 100644 src/FSclCalEvent.cpp create mode 100644 src/FSclCalEventChangeInfo.cpp create mode 100644 src/FSclCalEventInstance.cpp create mode 100644 src/FSclCalTodo.cpp create mode 100644 src/FSclCalTodoChangeInfo.cpp create mode 100644 src/FSclCalendar.cpp create mode 100644 src/FSclCalendarbook.cpp create mode 100644 src/FSclCalendarbookFilter.cpp create mode 100644 src/FSclCategory.cpp create mode 100644 src/FSclCategoryChangeInfo.cpp create mode 100644 src/FSclContact.cpp create mode 100644 src/FSclContactAppLaunchData.cpp create mode 100644 src/FSclContactChangeInfo.cpp create mode 100644 src/FSclContactEvent.cpp create mode 100644 src/FSclEmail.cpp create mode 100644 src/FSclEmailContact.cpp create mode 100644 src/FSclImAddress.cpp create mode 100644 src/FSclOrganization.cpp create mode 100644 src/FSclPerson.cpp create mode 100644 src/FSclPhoneNumber.cpp create mode 100644 src/FSclPhoneNumberContact.cpp create mode 100644 src/FSclRecord.cpp create mode 100644 src/FSclRecurrence.cpp create mode 100644 src/FSclRelationship.cpp create mode 100644 src/FSclReminder.cpp create mode 100644 src/FSclUrl.cpp create mode 100644 src/FSclUserProfile.cpp create mode 100644 src/FScl_AccountAccessorImpl.cpp create mode 100644 src/FScl_AccountAccessorImpl.h create mode 100644 src/FScl_AccountDbChangeEvent.cpp create mode 100644 src/FScl_AccountDbChangeEvent.h create mode 100644 src/FScl_AccountDbChangeEventArg.cpp create mode 100644 src/FScl_AccountDbChangeEventArg.h create mode 100644 src/FScl_AccountDbConnector.cpp create mode 100644 src/FScl_AccountDbConnector.h create mode 100644 src/FScl_AccountDbMonitor.cpp create mode 100644 src/FScl_AccountDbMonitor.h create mode 100644 src/FScl_AccountImpl.cpp create mode 100644 src/FScl_AccountImpl.h create mode 100644 src/FScl_AccountManagerImpl.cpp create mode 100644 src/FScl_AccountManagerImpl.h create mode 100644 src/FScl_AccountManagerUtil.cpp create mode 100644 src/FScl_AccountManagerUtil.h create mode 100644 src/FScl_AccountProviderImpl.cpp create mode 100644 src/FScl_AccountProviderImpl.h create mode 100644 src/FScl_AddressImpl.cpp create mode 100644 src/FScl_AddressImpl.h create mode 100644 src/FScl_AddressbookFilterImpl.cpp create mode 100644 src/FScl_AddressbookFilterImpl.h create mode 100644 src/FScl_AddressbookImpl.cpp create mode 100644 src/FScl_AddressbookManagerImpl.cpp create mode 100644 src/FScl_AddressbookUtil.cpp create mode 100644 src/FScl_AddressbookUtil.h create mode 100644 src/FScl_CalEventChangeInfoImpl.cpp create mode 100644 src/FScl_CalEventImpl.cpp create mode 100644 src/FScl_CalEventInstanceImpl.cpp create mode 100644 src/FScl_CalTodoChangeInfoImpl.cpp create mode 100644 src/FScl_CalTodoImpl.cpp create mode 100644 src/FScl_CalendarImpl.cpp create mode 100644 src/FScl_CalendarbookDbChangeEvent.cpp create mode 100644 src/FScl_CalendarbookDbChangeEvent.h create mode 100644 src/FScl_CalendarbookDbChangeEventArg.cpp create mode 100644 src/FScl_CalendarbookDbChangeEventArg.h create mode 100644 src/FScl_CalendarbookDbConnector.cpp create mode 100644 src/FScl_CalendarbookDbConnector.h create mode 100644 src/FScl_CalendarbookDbMonitor.cpp create mode 100644 src/FScl_CalendarbookDbMonitor.h create mode 100644 src/FScl_CalendarbookFilterImpl.cpp create mode 100644 src/FScl_CalendarbookFilterImpl.h create mode 100644 src/FScl_CalendarbookImpl.cpp create mode 100644 src/FScl_CalendarbookRecordRetrivalEvent.cpp create mode 100644 src/FScl_CalendarbookRecordRetrivalEvent.h create mode 100644 src/FScl_CalendarbookRecordRetrivalEventArg.cpp create mode 100644 src/FScl_CalendarbookRecordRetrivalEventArg.h create mode 100644 src/FScl_CalendarbookRecordRetrivalThread.cpp create mode 100644 src/FScl_CalendarbookRecordRetrivalThread.h create mode 100644 src/FScl_CalendarbookUtil.cpp create mode 100644 src/FScl_CalendarbookUtil.h create mode 100644 src/FScl_CategoryChangeInfoImpl.cpp create mode 100644 src/FScl_CategoryChangeInfoImpl.h create mode 100644 src/FScl_CategoryImpl.cpp create mode 100644 src/FScl_ContactAppLaunchDataImpl.cpp create mode 100644 src/FScl_ContactAppLaunchDataImpl.h create mode 100644 src/FScl_ContactChangeInfoImpl.cpp create mode 100644 src/FScl_ContactChangeInfoImpl.h create mode 100644 src/FScl_ContactDbChangeEvent.cpp create mode 100644 src/FScl_ContactDbChangeEvent.h create mode 100644 src/FScl_ContactDbChangeEventArg.cpp create mode 100644 src/FScl_ContactDbChangeEventArg.h create mode 100644 src/FScl_ContactDbConnector.cpp create mode 100644 src/FScl_ContactDbMonitor.cpp create mode 100644 src/FScl_ContactDbMonitor.h create mode 100644 src/FScl_ContactEventImpl.cpp create mode 100644 src/FScl_ContactEventImpl.h create mode 100644 src/FScl_ContactImpl.cpp create mode 100644 src/FScl_EmailContactImpl.cpp create mode 100644 src/FScl_EmailContactImpl.h create mode 100644 src/FScl_EmailImpl.cpp create mode 100644 src/FScl_IAccountDbChangeEventListener.h create mode 100644 src/FScl_ICalendarbookDbChangeEventListener.h create mode 100644 src/FScl_ImAddressImpl.cpp create mode 100644 src/FScl_ImAddressImpl.h create mode 100644 src/FScl_OrganizationImpl.cpp create mode 100644 src/FScl_OrganizationImpl.h create mode 100644 src/FScl_PersonImpl.cpp create mode 100644 src/FScl_PersonImpl.h create mode 100644 src/FScl_PhoneNumberContactImpl.cpp create mode 100644 src/FScl_PhoneNumberContactImpl.h create mode 100644 src/FScl_PhoneNumberImpl.cpp create mode 100644 src/FScl_PhoneNumberImpl.h create mode 100644 src/FScl_RecordImpl.cpp create mode 100644 src/FScl_RecurrenceImpl.cpp create mode 100644 src/FScl_RelationshipImpl.cpp create mode 100644 src/FScl_RelationshipImpl.h create mode 100644 src/FScl_ReminderImpl.cpp create mode 100644 src/FScl_UrlImpl.cpp create mode 100644 src/FScl_UrlImpl.h create mode 100644 src/FScl_UserProfileImpl.cpp create mode 100644 src/inc/FScl_AddressbookImpl.h create mode 100644 src/inc/FScl_AddressbookManagerImpl.h create mode 100644 src/inc/FScl_CalEventChangeInfoImpl.h create mode 100644 src/inc/FScl_CalEventImpl.h create mode 100644 src/inc/FScl_CalEventInstanceImpl.h create mode 100644 src/inc/FScl_CalTodoChangeInfoImpl.h create mode 100644 src/inc/FScl_CalTodoImpl.h create mode 100644 src/inc/FScl_CalendarImpl.h create mode 100644 src/inc/FScl_CalendarbookImpl.h create mode 100644 src/inc/FScl_CategoryImpl.h create mode 100644 src/inc/FScl_ContactDbConnector.h create mode 100644 src/inc/FScl_ContactImpl.h create mode 100644 src/inc/FScl_EmailImpl.h create mode 100644 src/inc/FScl_IContactDbChangeEventListener.h create mode 100644 src/inc/FScl_RecordImpl.h create mode 100644 src/inc/FScl_RecurrenceImpl.h create mode 100644 src/inc/FScl_ReminderImpl.h create mode 100644 src/inc/FScl_UserProfileImpl.h diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..f32c2d5 --- /dev/null +++ b/AUTHORS @@ -0,0 +1,3 @@ +Jaehwa Shin +Hosang Kim +Yoonchan Choi diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100755 index 0000000..a8593f6 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,188 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) + +SET(CMAKE_INSTALL_PREFIX /usr) +SET(PREFIX ${CMAKE_INSTALL_PREFIX}) + +SET (this_target osp-social) + +SET(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/cmake_build_tmp/output) + +#INCLUDE(FindPkgConfig) +#pkg_check_modules(pkgs REQUIRED calendar-service2) +#pkg_check_modules(pkgs REQUIRED accounts-svc) + +INCLUDE_DIRECTORIES( + inc + src + src/inc + /usr/include + /usr/include/glib-2.0 + /usr/lib/glib-2.0/include + /usr/include/db-util + /usr/include/social + /usr/include/accounts-svc + /usr/include/contacts-svc + /usr/include/osp + /usr/include/osp/app + /usr/include/osp/base + /usr/include/osp/media + /usr/include/osp/io + /usr/include/osp/security + /usr/include/calendar-service2 + ) + +SET (${this_target}_SOURCE_FILES + src/FSclAddress.cpp + src/FScl_AddressImpl.cpp + src/FSclAddressbook.cpp + src/FScl_AddressbookImpl.cpp + src/FSclAddressbookFilter.cpp + src/FScl_AddressbookFilterImpl.cpp + src/FScl_AddressbookUtil.cpp + src/FSclAddressbookManager.cpp + src/FScl_AddressbookManagerImpl.cpp + src/FSclCategory.cpp + src/FScl_CategoryImpl.cpp + src/FSclContact.cpp + src/FScl_ContactImpl.cpp + src/FSclContactAppLaunchData.cpp + src/FScl_ContactAppLaunchDataImpl.cpp + src/FSclContactEvent.cpp + src/FScl_ContactEventImpl.cpp + src/FSclEmail.cpp + src/FScl_EmailImpl.cpp + src/FSclEmailContact.cpp + src/FScl_EmailContactImpl.cpp + src/FSclImAddress.cpp + src/FScl_ImAddressImpl.cpp + src/FSclPhoneNumber.cpp + src/FScl_PhoneNumberImpl.cpp + src/FSclPhoneNumberContact.cpp + src/FScl_PhoneNumberContactImpl.cpp + src/FSclRecord.cpp + src/FScl_RecordImpl.cpp + src/FSclUrl.cpp + src/FScl_UrlImpl.cpp + src/FSclCalendarbook.cpp + src/FScl_CalendarbookImpl.cpp + src/FSclReminder.cpp + src/FScl_ReminderImpl.cpp + src/FSclCalTodo.cpp + src/FScl_CalTodoImpl.cpp + src/FSclCalEvent.cpp + src/FScl_CalEventImpl.cpp + src/FSclAttendee.cpp + src/FSclRecurrence.cpp + src/FScl_RecurrenceImpl.cpp + src/FSclCalendar.cpp + src/FScl_CalendarImpl.cpp + src/FSclCalEventInstance.cpp + src/FScl_CalEventInstanceImpl.cpp + src/FSclCalEventChangeInfo.cpp + src/FScl_CalEventChangeInfoImpl.cpp + src/FSclCalTodoChangeInfo.cpp + src/FScl_CalTodoChangeInfoImpl.cpp + src/FSclCalendarbookFilter.cpp + src/FScl_CalendarbookFilterImpl.cpp + src/FScl_CalendarbookUtil.cpp + src/FScl_CalendarbookDbConnector.cpp + src/FScl_CalendarbookDbMonitor.cpp + src/FScl_CalendarbookDbChangeEvent.cpp + src/FScl_CalendarbookDbChangeEventArg.cpp + src/FScl_CalendarbookRecordRetrivalEvent.cpp + src/FScl_CalendarbookRecordRetrivalEventArg.cpp + src/FScl_CalendarbookRecordRetrivalThread.cpp + src/FSclContactChangeInfo.cpp + src/FScl_ContactChangeInfoImpl.cpp + src/FSclCategoryChangeInfo.cpp + src/FScl_CategoryChangeInfoImpl.cpp + src/FSclOrganization.cpp + src/FScl_OrganizationImpl.cpp + src/FSclPerson.cpp + src/FScl_PersonImpl.cpp + src/FSclRelationship.cpp + src/FScl_RelationshipImpl.cpp + src/FScl_ContactDbConnector.cpp + src/FScl_ContactDbMonitor.cpp + src/FScl_ContactDbChangeEvent.cpp + src/FScl_ContactDbChangeEventArg.cpp + src/FSclAccount.cpp + src/FScl_AccountImpl.cpp + src/FSclAccountAccessor.cpp + src/FScl_AccountAccessorImpl.cpp + src/FSclAccountManager.cpp + src/FScl_AccountManagerImpl.cpp + src/FSclAccountProvider.cpp + src/FScl_AccountProviderImpl.cpp + src/FScl_AccountManagerUtil.cpp + src/FScl_AccountDbChangeEvent.cpp + src/FScl_AccountDbChangeEventArg.cpp + src/FScl_AccountDbConnector.cpp + src/FScl_AccountDbMonitor.cpp + src/FSclUserProfile.cpp + src/FScl_UserProfileImpl.cpp +) + +SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -Wall" ) + +## SET C COMPILER FLAGS +SET(CMAKE_C_FLAGS "${OSP_DEBUG_FLAGS} ${OSP_OPT_FLAGS} ${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} ${OSP_COMPILER_FLAGS}") + +## SET CPP COMPILER FLAGS +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden") +SET(CMAKE_CXX_FLAGS "${OSP_DEBUG_FLAGS} ${OSP_OPT_FLAGS} ${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS} ${OSP_COMPILER_FLAGS}") + +## Create Library +ADD_LIBRARY (${this_target} SHARED ${${this_target}_SOURCE_FILES}) + +## SET LINKER FLAGS +SET(CMAKE_SHARED_LINKER_FLAGS -Wl,--no-undefined) + +TARGET_LINK_LIBRARIES(${this_target} "-L/usr/lib/osp -losp-appfw" ) +TARGET_LINK_LIBRARIES(${this_target} "-losp-image" ) +TARGET_LINK_LIBRARIES(${this_target} "-losp-uifw" ) +TARGET_LINK_LIBRARIES(${this_target} "-lglib-2.0" ) +TARGET_LINK_LIBRARIES(${this_target} "-lcalendar-service2" ) +TARGET_LINK_LIBRARIES(${this_target} "-lcontacts-service2" ) +TARGET_LINK_LIBRARIES(${this_target} "-laccounts-svc" ) +TARGET_LINK_LIBRARIES(${this_target} "-lpthread" ) + +SET_TARGET_PROPERTIES(${this_target} + PROPERTIES + VERSION ${FULLVER} + SOVERSION ${MAJORVER} + CLEAN_DIRECT_OUTPUT 1 + ) + +ADD_CUSTOM_COMMAND(TARGET ${this_target} + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy ${LIBRARY_OUTPUT_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX} ${LIBRARY_OUTPUT_PATH}/debug/${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX}.${FULLVER} + COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX}.${FULLVER} ${LIBRARY_OUTPUT_PATH}/debug/${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX}.${MAJORVER} + COMMAND ${CMAKE_STRIP} --strip-unneeded ${LIBRARY_OUTPUT_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX} + COMMENT "strip ${this_target}" + ) + +INSTALL(DIRECTORY ${LIBRARY_OUTPUT_PATH}/ DESTINATION lib/osp + FILES_MATCHING PATTERN "*.so*" + PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ + GROUP_EXECUTE GROUP_READ + WORLD_EXECUTE WORLD_READ) +INSTALL(DIRECTORY ${LIBRARY_OUTPUT_PATH}/debug/ DESTINATION lib/osp/debug + FILES_MATCHING PATTERN "*.so*" + PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ + GROUP_EXECUTE GROUP_READ + WORLD_EXECUTE WORLD_READ) + +INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/inc/ DESTINATION include/osp FILES_MATCHING PATTERN "*.h") +INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/src/inc/ DESTINATION include/osp/social FILES_MATCHING PATTERN "*.h") + +SET(PC_NAME ${this_target}) +SET(PC_REQUIRED ${pc_requires}) +SET(PC_LDFLAGS -l${this_target}) + +# pkgconfig file +CONFIGURE_FILE(${this_target}.pc.in ${CMAKE_SOURCE_DIR}/${this_target}.pc @ONLY) +INSTALL(FILES ${CMAKE_SOURCE_DIR}/${this_target}.pc DESTINATION lib/pkgconfig) + +# INCLUDE FOR BUILD & INSTALL PACKAGE MANAGER .SO +ADD_SUBDIRECTORY(pkgmgr_account) diff --git a/LICENSE.APLv2 b/LICENSE.APLv2 new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/LICENSE.APLv2 @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/NOTICE b/NOTICE new file mode 100644 index 0000000..b616854 --- /dev/null +++ b/NOTICE @@ -0,0 +1,3 @@ +Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. +Except as noted, this software is licensed under Apache License, Version 2. +Please, see the LICENSE.APLv2 file for Apache License terms and conditions. diff --git a/inc/FSclAccount.h b/inc/FSclAccount.h new file mode 100644 index 0000000..06d4f7d --- /dev/null +++ b/inc/FSclAccount.h @@ -0,0 +1,182 @@ +// +// Copyright (c) 2013 Samsung Electronics Co., Ltd. +// +// 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. +// +/** + * @file FSclAccount.h + * @brief This is the header file for the %Account class. + * + * This header file contains the declarations of the %Account class. + */ +#ifndef _FSCL_ACCOUNT_H_ +#define _FSCL_ACCOUNT_H_ + +#include +#include +#include + +namespace Tizen { namespace Base +{ +class String; +namespace Collection +{ +class IMap; +} +}} + +namespace Tizen { namespace Social +{ +class AccountProvider; + +/** + * @class Account + * @brief This class represents the account information. + * @since 2.1 + * + * @final This class is not intended for extension. + * + * This %Account class represents the account information. + */ +class _OSP_EXPORT_ Account + : public Tizen::Base::Object +{ +public: + /** + * This is the default constructor for this class. @n + * It creates a fully initialized instance of the %Account class. + * + * @since 2.1 + * + * @param[in] userName The user name + */ + Account(const Tizen::Base::String& userName); + + /** + * Copying of objects using this copy constructor is allowed. + * + * @since 2.1 + * + * @param[in] rhs An instance of %Account to copy + */ + Account(const Account& rhs); + + /** + * This destructor overrides Tizen::Base::Object::~Object(). + * + * @since 2.1 + */ + virtual ~Account(void); + + /** + * Checks whether the value of the specified instance is equal to the value of the current instance. + * + * @since 2.1 + * + * @return @c true if the value of the specified instance of Tizen::Base::Object is equal to the value of the current instance, @n + * else @c false + * @param[in] rhs An instance of Tizen::Base::Object to compare + */ + virtual bool Equals(const Tizen::Base::Object& rhs) const; + + /** + * Gets the hash value of the current instance. + * + * @since 2.1 + * + * @return The integer value that indicates the hash value of the current instance + */ + virtual int GetHashCode(void) const; + + /** + * Gets the ID of an account. + * + * @since 2.1 + * + * @return The account ID + */ + AccountId GetId(void) const; + + /** + * Gets the account provider. + * + * @since 2.1 + * + * @return The account provider + */ + AccountProvider GetAccountProvider(void) const; + + /** + * Gets the user name. + * + * @since 2.1 + * + * @return The user name + */ + Tizen::Base::String GetUserName(void) const; + + /** + * Gets the extended data. + * + * @since 2.1 + * + * @return The key-value lists of the extended data, @n + * else an empty list if there is no extended data, or @c null if an exception occurs (String, String list) + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + Tizen::Base::Collection::IMap* GetExtendedDataN(void) const; + + /** + * Sets the user name. + * + * @since 2.1 + * + * @return An error code + * @param[in] userName The user name + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c userName is an empty string. + */ + result SetUserName(const Tizen::Base::String& userName); + + /** + * Sets the extended data with the specified @c key and @c value. @n + * If the specified @c key already exists, the corresponding value is overwritten with the specified @c value. + * + * @since 2.1 + * + * @return An error code + * @param[in] key The key of the extended data + * @param[in] value The value of the extended data + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c key is an empty string. + */ + result SetExtendedData(const Tizen::Base::String& key, const Tizen::Base::String& value); + + /** + * Copying of objects using this copy assignment operator is allowed. + * + * @since 2.1 + * + * @param[in] rhs An instance of %Account to copy + */ + Account& operator =(const Account& rhs); + +private: + friend class _AccountImpl; + class _AccountImpl* __pAccountImpl; + +}; // Account + +}} // Tizen::Social + +#endif //_FSCL_ACCOUNT_H_ diff --git a/inc/FSclAccountAccessor.h b/inc/FSclAccountAccessor.h new file mode 100644 index 0000000..e5f9f7e --- /dev/null +++ b/inc/FSclAccountAccessor.h @@ -0,0 +1,265 @@ +// +// Copyright (c) 2013 Samsung Electronics Co., Ltd. +// +// 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. +// +/** +* @file FSclAccountAccessor.h +* @brief This is the header file for the %AccountAccessor class. +* +* This header file contains the declarations of the %AccountAccessor class. +*/ +#ifndef _FSCL_ACCOUNT_ACCESSOR_H_ +#define _FSCL_ACCOUNT_ACCESSOR_H_ + +#include +#include +#include +#include +#include + +namespace Tizen { namespace Base +{ +class String; + +namespace Collection +{ +class IList; +} +}} + +namespace Tizen { namespace Social +{ +class Account; +class IAccountEventListener; + +/** + * @class AccountAccessor + * @brief This class provides methods for accessing accounts and account providers. + * @since 2.1 + * + * @final This class is not intended for extension. + * + * This %AccountAccessor class provides methods for accessing accounts and account providers. + * + * For more information on the class features, see Account Management. + */ +class _OSP_EXPORT_ AccountAccessor + : public Tizen::Base::Object +{ +public: + /** + * Sets an account change event listener that is called when an account is changed. @n + * To reset the event listener, @c null must be passed. + * + * @since 2.1 + * @privlevel public + * @privilege %http://tizen.org/privilege/account.read + * + * @return An error code + * @param[in] pListener The event listener + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. + * @remarks The platform will not take the ownership of @c pListener after this call. + */ + result SetEventListener(IAccountEventListener* pListener); + + /** + * Gets an account with the specified account ID. + * + * @since 2.1 + * @privlevel public + * @privilege %http://tizen.org/privilege/account.read + * + * @return The account with the specified @c accountId + * @param[in] accountId The account ID + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_INVALID_ARG The specified @c accountId is invalid. + * @exception E_OBJ_NOT_FOUND The specified @c accountId is not found. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + Account GetAccount(AccountId accountId) const; + + /** + * Gets accounts associated with the account provider that has the specified application ID. + * + * @since 2.1 + * @privlevel public + * @privilege %http://tizen.org/privilege/account.read + * + * @return The list of accounts, @n + * else an empty list if there is no account, or @c null if an exception occurs (@ref Account list) + * @param[in] accountProviderAppId The application ID of the account provider + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_INVALID_ARG The specified @c accountProviderAppId is empty. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + Tizen::Base::Collection::IList* GetAccountsByAccountProviderN(const Tizen::App::AppId& accountProviderAppId) const; + + /** + * Gets all the accounts. + * + * @since 2.1 + * @privlevel public + * @privilege %http://tizen.org/privilege/account.read + * + * @return The list of accounts, @n + * else an empty list if there is no account, or @c null if an exception occurs (@ref Account list) + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + Tizen::Base::Collection::IList* GetAllAccountsN(void) const; + + /** + * Gets an account provider with the specified application ID. + * + * @since 2.1 + * @privlevel public + * @privilege %http://tizen.org/privilege/account.read + * + * @return The account provider with the specified @c accountProviderAppId ID + * @param[in] accountProviderAppId The application ID of the account provider + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_INVALID_ARG The specified @c accountProviderAppId is empty. + * @exception E_OBJ_NOT_FOUND The specified @c accountProviderAppId is not found. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + AccountProvider GetAccountProvider(const Tizen::App::AppId& accountProviderAppId) const; + + /** + * Gets account providers that have the specified @c capability. + * + * @since 2.1 + * @privlevel public + * @privilege %http://tizen.org/privilege/account.read + * + * @return The list of account providers, @n + * else an empty list if there is no account provider, or @c null if an exception occurs (@ref AccountProvider list) + * @param[in] capability The predefined capability or the vendor-specific capability defined as the IRI format + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_INVALID_ARG The specified @c capability is empty. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + Tizen::Base::Collection::IList* GetAccountProvidersByCapabilityN(const Tizen::Base::String& capability) const; + + /** + * Gets all the currently registered account providers. + * + * @since 2.1 + * @privlevel public + * @privilege %http://tizen.org/privilege/account.read + * + * @return The list of account providers, @n + * else an empty list if there is no account provider, or @c null if an exception occurs (@ref AccountProvider list) + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + Tizen::Base::Collection::IList* GetAllAccountProvidersN(void) const; + + /** + * Gets an %AccountAccessor instance. + * + * @since 2.1 + * + * @return A pointer to the %AccountAccessor instance, @n + * else @c null if it fails + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + static AccountAccessor* GetInstance(void); + +private: + // + // This default constructor is intentionally declared as private to implement the Singleton semantic. + // + // @since 2.1 + // + AccountAccessor(void); + + // + // This destructor is intentionally declared as private to implement the Singleton semantic. + // + // @since 2.1 + // + virtual ~AccountAccessor(void); + + // + // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects. + // + // @since 2.1 + // + AccountAccessor(const AccountAccessor& rhs); + + // + // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects. + // + // @since 2.1 + // + AccountAccessor& operator =(const AccountAccessor& rhs); + + // + // Constructs an instance of this class. + // + // @since 2.1 + // + // @return An error code + // @exception E_SUCCESS The method is successful. + // @exception E_SYSTEM The method cannot proceed due to a severe system error. + // + result Construct(void); + + // + // Initializes an instance of this class. + // + // @since 2.1 + // + static void InitAccountAccessor(void); + + // + // Destroys an instance of this class. + // + // @since 2.1 + // + static void DestroyAccountAccessor(void); + +private: + static AccountAccessor* __pInstance; + friend struct std::default_delete; + + friend class _AccountAccessorImpl; + class _AccountAccessorImpl* __pAccountAccessorImpl; + +}; // AccountAccessor + +}} // Tizen::Social + +#endif //_FSCL_ACCOUNT_ACCESSOR_H_ diff --git a/inc/FSclAccountManager.h b/inc/FSclAccountManager.h new file mode 100644 index 0000000..e849e2f --- /dev/null +++ b/inc/FSclAccountManager.h @@ -0,0 +1,204 @@ +// +// Copyright (c) 2013 Samsung Electronics Co., Ltd. +// +// 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. +// +/** +* @file FSclAccountManager.h +* @brief This is the header file for the %AccountManager class. +* +* This header file contains the declarations of the %AccountManager class. +*/ +#ifndef _FSCL_ACCOUNT_MANAGER_H_ +#define _FSCL_ACCOUNT_MANAGER_H_ + +#include +#include +#include +#include + +namespace Tizen { namespace Base +{ +class String; +namespace Collection +{ +class IList; +} +}} + +namespace Tizen { namespace Social +{ +class Account; +class AccountProvider; + +/** + * @class AccountManager + * @brief This class provides methods for managing accounts. + * @since 2.1 + * + * @final This class is not intended for extension. + * + * The %AccountManager class provides methods for managing accounts. + * + * For more information on the class features, see Account Management. + */ +class _OSP_EXPORT_ AccountManager + : public Tizen::Base::Object +{ +public: + /** + * Adds an account. @n + * The user name must be set in the account. + * If the account is added successfully, an account ID is newly assigned to it. @n + * The %AddAccount() method can be used only by an application belonging to a package of an application that registers its own account provider. + * + * @since 2.1 + * @privlevel public + * @privilege %http://tizen.org/privilege/account.write + * + * @return An error code + * @param[in,out] account The account to add @n + * If this method is successful, the account ID for the added account is assigned. + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The user name is an empty string in the specified @c account. + * - The account ID is not #INVALID_ACCOUNT_ID. + * @exception E_INVALID_OPERATION Either of the following conditions has occurred: + * - The caller application does not belong to a package of an application that registers its own account provider. + * - The account has already been added with the multiple accounts support set to @c false. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + */ + result AddAccount(Account& account); + + /** + * Removes an account. @n + * The %RemoveAccount() method can be used only by the applications belonging to the package of the application that has registered the account provider of the specified account. + * + * @since 2.1 + * @privlevel public + * @privilege %http://tizen.org/privilege/account.write + * + * @return An error code + * @param[in] accountId The account ID + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_INVALID_ARG The specified @c accountId is invalid. + * @exception E_OBJ_NOT_FOUND The specified @c accountId does not exist. + * @exception E_INVALID_OPERATION The caller application does not belong to the package of the application that has registered the account provider of the specified account. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + */ + result RemoveAccount(AccountId accountId); + + /** + * Updates an account. @n + * The user name must be set in the account. + * The %UpdateAccount() method can be used only by the applications belonging to the package of the application that has registered the account provider of the specified account. + * + * @since 2.1 + * @privlevel public + * @privilege %http://tizen.org/privilege/account.write + * + * @return An error code + * @param[in] account The account to update + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The user name is an empty string in the specified @c account. + * - The account ID is invalid. + * @exception E_OBJ_NOT_FOUND The specified @c account does not exist. + * @exception E_INVALID_OPERATION The caller application does not belong to the package of the application that has registered the account provider of the specified account. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + */ + result UpdateAccount(const Account& account); + + /** + * Gets an %AccountManager instance. + * + * @since 2.1 + * + * @return A pointer to the %AccountManager instance, @n + * else @c null if it fails + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + static AccountManager* GetInstance(void); + +private: + // + // This default constructor is intentionally declared as private to implement the Singleton semantic. + // + // @since 2.1 + // + AccountManager(void); + + // + // This destructor is intentionally declared as private to implement the Singleton semantic. + // + // @since 2.1 + // + virtual ~AccountManager(void); + + // + // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects. + // + // @since 2.1 + // + AccountManager(const AccountManager& rhs); + + // + // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects. + // + // @since 2.1 + // + AccountManager& operator =(const AccountManager& rhs); + + // + // Constructs an instance of this class. + // + // @since 2.1 + // + // @return An error code + // @exception E_SUCCESS The method is successful. + // @exception E_SYSTEM The method cannot proceed due to a severe system error. + // + result Construct(void); + + // + // Initializes an instance of this class. + // + // @since 2.1 + // + static void InitAccountManager(void); + + // + // Destroys an instance of this class. + // + // @since 2.1 + // + static void DestroyAccountManager(void); + +private: + static AccountManager* __pInstance; + friend struct std::default_delete; + + friend class _AccountManagerImpl; + class _AccountManagerImpl* __pAccountManagerImpl; + +}; // AccountManager + +}} // Tizen::Social + +#endif //_FSCL_ACCOUNT_MANAGER_H_ diff --git a/inc/FSclAccountProvider.h b/inc/FSclAccountProvider.h new file mode 100644 index 0000000..963616a --- /dev/null +++ b/inc/FSclAccountProvider.h @@ -0,0 +1,173 @@ +// +// Copyright (c) 2013 Samsung Electronics Co., Ltd. +// +// 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. +// +/** + * @file FSclAccountProvider.h + * @brief This is the header file for the %AccountProvider class. + * + * This header file contains the declarations of the %AccountProvider class. + */ +#ifndef _FSCL_ACCOUNT_PROVIDER_H_ +#define _FSCL_ACCOUNT_PROVIDER_H_ + +#include +#include +#include +#include + +namespace Tizen { namespace Base +{ +class String; +namespace Collection +{ +class IList; +} +}} + +namespace Tizen { namespace Social +{ + +/** + * @class AccountProvider + * @brief This class represents the account provider information. + * @since 2.1 + * + * @final This class is not intended for extension. + * + * The %AccountProvider class represents the account provider information. + */ +class _OSP_EXPORT_ AccountProvider + : public Tizen::Base::Object +{ +public: + /** + * This is the default constructor for this class. @n + * It creates a fully initialized instance of the %AccountProvider class. + * + * @since 2.1 + */ + AccountProvider(void); + + /** + * Copying of objects using this copy constructor is allowed. + * + * @since 2.1 + * + * @param[in] rhs An instance of %AccountProvider to copy + */ + AccountProvider(const AccountProvider& rhs); + + /** + * This destructor overrides Tizen::Base::Object::~Object(). + * + * @since 2.1 + */ + virtual ~AccountProvider(void); + + /** + * Checks whether the value of the specified instance is equal to the value of the current instance. + * + * @since 2.1 + * + * @return @c true if the value of the specified instance of Tizen::Base::Object is equal to the value of the current instance, @n + * else @c false + * @param[in] rhs An instance of Tizen::Base::Object to compare + */ + virtual bool Equals(const Tizen::Base::Object& rhs) const; + + /** + * Gets the hash value of the current instance. + * + * @since 2.1 + * + * @return The integer value that indicates the hash value of the current instance + */ + virtual int GetHashCode(void) const; + + /** + * Gets the ID of the application that has registered this account provider. + * + * @since 2.1 + * + * @return The application ID + */ + Tizen::App::AppId GetAppId(void) const; + + /** + * Gets the list of capabilities that an account provider owns. + * + * @since 2.1 + * + * @return The list of capabilities which are predefined or the vendor-specific String defined as the IRI format, @n + * else an empty list if there is no capability, or @c null if an exception occurs (String list) + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + Tizen::Base::Collection::IList* GetCapabilitiesN(void) const; + + /** + * Gets the display name of an account provider. + * + * @since 2.1 + * + * @return The display name + */ + Tizen::Base::String GetDisplayName(void) const; + + /** + * Gets the icon path. + * + * @since 2.1 + * + * @return The icon path + */ + Tizen::Base::String GetIconPath(void) const; + + /** + * Gets the small icon path. + * + * @since 2.1 + * + * @return The small icon path + */ + Tizen::Base::String GetSmallIconPath(void) const; + + /** + * Checks whether an account provider supports multiple accounts. + * + * @since 2.1 + * + * @return @c true if the account provider supports multiple accounts, @n + * else @c false + */ + bool IsMultipleAccountSupported(void) const; + + /** + * Copying of objects using this copy assignment operator is allowed. + * + * @since 2.1 + * + * @param[in] rhs An instance of %AccountProvider to copy + */ + AccountProvider& operator =(const AccountProvider& rhs); + +private: + friend class _AccountProviderImpl; + class _AccountProviderImpl* __pAccountProviderImpl; + +}; // AccountProvider + +}} // Tizen::Social + +#endif //_FSCL_ACCOUNT_PROVIDER_H_ diff --git a/inc/FSclAddress.h b/inc/FSclAddress.h new file mode 100644 index 0000000..436c197 --- /dev/null +++ b/inc/FSclAddress.h @@ -0,0 +1,545 @@ +// +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// 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. +// +/** + * @file FSclAddress.h + * @brief This is the header file for the %Address class. + * + * This header file contains the declarations of the %Address class. + */ +#ifndef _FSCL_ADDRESS_H_ +#define _FSCL_ADDRESS_H_ + +#include +#include +#include +#include + +namespace Tizen { namespace Social +{ + +/** + * @if OSPDEPREC + * The maximum length of the extended field. + * + * @brief [Deprecated] + * @deprecated This constant is deprecated because there is no limitation any more. + * @since 2.0 + * @endif + */ +static const int MAX_ADDR_EXTENDED_LENGTH = 50; + +/** + * @if OSPDEPREC + * The maximum length of the street field. + * + * @brief [Deprecated] + * @deprecated This constant is deprecated because there is no limitation any more. + * @since 2.0 + * @endif + */ +static const int MAX_ADDR_STREET_LENGTH = 50; + +/** + * @if OSPDEPREC + * The maximum length of the city field. + * + * @brief [Deprecated] + * @deprecated This constant is deprecated because there is no limitation any more. + * @since 2.0 + * @endif + */ +static const int MAX_ADDR_CITY_LENGTH = 50; + +/** + * @if OSPDEPREC + * The maximum length of the state field. + * + * @brief [Deprecated] + * @deprecated This constant is deprecated because there is no limitation any more. + * @since 2.0 + * @endif + */ +static const int MAX_ADDR_STATE_LENGTH = 50; + +/** + * @if OSPDEPREC + * The maximum length of the postal code field. + * + * @brief [Deprecated] + * @deprecated This constant is deprecated because there is no limitation any more. + * @since 2.0 + * @endif + */ +static const int MAX_ADDR_POSTAL_CODE_LENGTH = 20; + +/** + * @if OSPDEPREC + * The maximum length of the country field. + * + * @brief [Deprecated] + * @deprecated This constant is deprecated because the maximum length of the country name has been changed. +* @since 2.0 + * @endif + */ +static const int MAX_ADDR_COUNTRY_LENGTH = 20; + +/** + * @if OSPDEPREC + * The maximum length of the post office box number field. + * + * @brief [Deprecated] + * @deprecated This constant is deprecated because there is no limitation any more. +* @since 2.0 + * @endif + */ +static const int MAX_ADDR_POBOXNUM_LENGTH = 20; + +/** + * @class Address + * @brief This class represents the structured address type representing the ADR type definition of a vCard. + * + * @since 2.0 + * + * @final This class is not intended for extension. + * + * The %Address class represents the structured address type representing the ADR type definition of a vCard. + * It is based on the MIME directory profile specification (RFC 2426). + * The address information consists of the country, city, state, street, post office box number, postal code, and address type. + * This class represents the structured address type representing the ADR type definition of a vCard. + * It is based on the MIME directory profile specification (RFC 2426). + * + * For more information on the class features, see Addressbook. + */ +class _OSP_EXPORT_ Address + : public Tizen::Base::Object +{ +public: + /** + * This is the default constructor for this class. @n + * It creates a fully initialized instance of the %Address class. + * + * @since 2.0 + */ + Address(void); + + /** + * Copying of objects using this copy constructor is allowed. + * + * @since 2.0 + * + * @param[in] rhs An instance of %Address to copy + */ + Address(const Address& rhs); + + /** + * This destructor overrides Tizen::Base::Object::~Object(). + * + * @since 2.0 + */ + virtual ~Address(void); + + /** + * Checks whether the value of the specified instance is equal to the value of the current instance of Tizen::Base::Object. + * + * @since 2.0 + * + * @return @c true if the value of the specified instance of Tizen::Base::Object is equal to the value of the current instance of %Tizen::Base::Object, @n + * else @c false + * @param[in] rhs An instance of Tizen::Base::Object to compare + */ + virtual bool Equals(const Tizen::Base::Object& rhs) const; + + /** + * Gets the hash value of the current instance of Tizen::Base::Object. + * + * @since 2.0 + * + * @return The integer value that indicates the hash value of the current instance of Tizen::Base::Object + */ + virtual int GetHashCode(void) const; + + /** + * Gets the type of the address. + * + * @if OSPCOMPAT + * @brief [Compatibility] + * @endif + * @since 2.0 + * @if OSPCOMPAT + * @compatibility This method has compatibility issues with OSP compatible applications. @n + * For more information, see @ref CompAddressGetTypePage "here". + * @endif + * + * @return The type of the address + */ + AddressType GetType(void) const; + + /** + * @if OSPCOMPAT + * @page CompAddressGetTypePage Compatibility for GetType() + * @section CompAddressGetTypePageIssueSection Issues + * Implementing this method in OSP compatible applications has the following issue: @n + * -# @c ADDRESS_TYPE_CUSTOM is not supported. If the type of the address is @c ADDRESS_TYPE_CUSTOM, @c ADDRESS_TYPE_OTHER is returned instead. + * + * @section CompAddressGetTypePageSolutionSection Resolutions + * The issue mentioned above has been resolved in Tizen. + * @endif + */ + + /** + * Gets the extended field of the address. + * + * @since 2.0 + * + * @return The extended field of the address + */ + Tizen::Base::String GetExtended(void) const; + + /** + * Gets the street of the address. + * + * @since 2.0 + * + * @return The street of the address + */ + Tizen::Base::String GetStreet(void) const; + + /** + * Gets the city of the address. + * + * @since 2.0 + * + * @return The city of the address + */ + Tizen::Base::String GetCity(void) const; + + /** + * Gets the state of the address. + * + * @since 2.0 + * + * @return The state of the address + */ + Tizen::Base::String GetState(void) const; + + /** + * Gets the postal code of the address. + * + * @since 2.0 + * + * @return The postal code of the address + */ + Tizen::Base::String GetPostalCode(void) const; + + /** + * Gets the country of the address. + * + * @since 2.0 + * + * @return The country of the address + */ + Tizen::Base::String GetCountry(void) const; + + /** + * Gets the post office box number of the address. + * + * @since 2.0 + * + * @return The post office box number of the address + */ + Tizen::Base::String GetPostOfficeBoxNumber(void) const; + + /** + * Sets the type of the address. + * + * @since 2.0 + * + * @param[in] type The address type to set + * @see AddressType() + */ + void SetType(AddressType type); + + /** + * Sets the extended field of the address. + * + * @if OSPCOMPAT + * @brief [Compatibility] + * @endif + * @since 2.0 + * @if OSPCOMPAT + * @compatibility This method has compatibility issues with OSP compatible applications. @n + * For more information, see @ref CompAddressSetExtendedPage "here". + * @endif + * + * @return An error code + * @param[in] extended The new extended value to set + * @exception E_SUCCESS The method is successful. + */ + result SetExtended(const Tizen::Base::String& extended); + + /** + * @if OSPCOMPAT + * @page CompAddressSetExtendedPage Compatibility for SetExtended() + * @section CompAddressSetExtendedPageIssueSection Issues + * Implementing this method in OSP compatible applications has the following issue: @n + * -# If the length of the extended address to be set is greater than @c 50 characters, @c E_INVALID_ARG is returned. + * + * @section CompAddressSetExtendedPageSolutionSection Resolutions + * The issue mentioned above has been resolved in Tizen. + * @endif + */ + + /** + * Sets the street of the address. + * + * @if OSPCOMPAT + * @brief [Compatibility] + * @endif + * @since 2.0 + * @if OSPCOMPAT + * @compatibility This method has compatibility issues with OSP compatible applications. @n + * For more information, see @ref CompAddressSetStreetPage "here". + * @endif + * + * @return An error code + * @param[in] street The new street value to set + * @exception E_SUCCESS The method is successful. + */ + result SetStreet(const Tizen::Base::String& street); + + /** + * @if OSPCOMPAT + * @page CompAddressSetStreetPage Compatibility for SetStreet() + * @section CompAddressSetStreetPageIssueSection Issues + * Implementing this method in OSP compatible applications has the following issue: @n + * -# If the length of the street to be set is greater than @c 50 characters, @c E_INVALID_ARG is returned. + * + * @section CompAddressSetStreetPageSolutionSection Resolutions + * The issue mentioned above has been resolved in Tizen. + * @endif + */ + + /** + * Sets the city of the address. + * + * @if OSPCOMPAT + * @brief [Compatibility] + * @endif + * @since 2.0 + * @if OSPCOMPAT + * @compatibility This method has compatibility issues with OSP compatible applications. @n + * For more information, see @ref CompAddressSetCityPage "here". + * @endif + * + * @return An error code + * @param[in] city The new city value to set + * @exception E_SUCCESS The method is successful. + */ + result SetCity(const Tizen::Base::String& city); + + /** + * @if OSPCOMPAT + * @page CompAddressSetCityPage Compatibility for SetCity() + * @section CompAddressSetCityPageIssueSection Issues + * Implementing this method in OSP compatible applications has the following issue: @n + * -# If the length of the city to be set is greater than @c 50 characters, @c E_INVALID_ARG is returned. + * + * @section CompAddressSetCityPageSolutionSection Resolutions + * The issue mentioned above has been resolved in Tizen. + * @endif + */ + + /** + * Sets the state of the address. + * + * @if OSPCOMPAT + * @brief [Compatibility] + * @endif + * @since 2.0 + * @if OSPCOMPAT + * @compatibility This method has compatibility issues with OSP compatible applications. @n + * For more information, see @ref CompAddressSetStatePage "here". + * @endif + * + * @return An error code + * @param[in] state The new state value to set + * @exception E_SUCCESS The method is successful. + */ + result SetState(const Tizen::Base::String& state); + + /** + * @if OSPCOMPAT + * @page CompAddressSetStatePage Compatibility for SetState() + * @section CompAddressSetStatePageIssueSection Issues + * Implementing this method in OSP compatible applications has the following issue: @n + * -# If the length of the state to be set is greater than @c 50 characters, @c E_INVALID_ARG is returned. + * + * @section CompAddressSetStatePageSolutionSection Resolutions + * The issue mentioned above has been resolved in Tizen. + * @endif + */ + + /** + * Sets the postal code of the address. + * + * @if OSPCOMPAT + * @brief [Compatibility] + * @endif + * @since 2.0 + * + * @if OSPCOMPAT + * @compatibility This method has compatibility issues with OSP compatible applications. @n + * For more information, see @ref CompAddressSetPostalCodePage "here". + * @endif + * + * @return An error code + * @param[in] postalCode The new postal code value to set + * @exception E_SUCCESS The method is successful. + */ + result SetPostalCode(const Tizen::Base::String& postalCode); + + /** + * @if OSPCOMPAT + * @page CompAddressSetPostalCodePage Compatibility for SetPostalCode() + * @section CompAddressSetPostalCodePageIssueSection Issues + * Implementing this method in OSP compatible applications has the following issue: @n + * -# If the length of the postal code to be set is greater than @c 20 characters, @c E_INVALID_ARG is returned. + * + * @section CompAddressSetPostalCodePageSolutionSection Resolutions + * The issue mentioned above has been resolved in Tizen. + * @endif + */ + + /** + * Sets the country of the address. + * + * @if OSPCOMPAT + * @brief [Compatibility] + * @endif + * @since 2.0 + * + * @if OSPCOMPAT + * @compatibility This method has compatibility issues with OSP compatible applications. @n + * For more information, see @ref CompAddressSetCountryCodePage "here". + * @endif + * + * @return An error code + * @param[in] country The new country value to set + * @exception E_SUCCESS The method is successful. + */ + result SetCountry(const Tizen::Base::String& country); + + /** + * @if OSPCOMPAT + * @page CompAddressSetCountryCodePage Compatibility for SetCountry() + * @section CompAddressSetCountryCodePageIssueSection Issues + * Implementing this method in OSP compatible applications has the following issue: @n + * -# If the length of the country to be set is greater than @c 20 characters, @c E_INVALID_ARG is returned. + * + * @section CompAddressSetCountryCodePageSolutionSection Resolutions + * The issue mentioned above has been resolved in Tizen. + * @endif + */ + + /** + * Sets the post office box number of the address. + * + * @if OSPCOMPAT + * @brief [Compatibility] + * @endif + * @since 2.0 + * @if OSPCOMPAT + * @compatibility This method has compatibility issues with OSP compatible applications. @n + * For more information, see @ref CompAddressSetPostOfficeBoxNumberPage "here". + * @endif + * + * @return An error code + * @param[in] postOfficeBoxNumber The new post office box number value to set + * @exception E_SUCCESS The method is successful. + */ + result SetPostOfficeBoxNumber(const Tizen::Base::String& postOfficeBoxNumber); + + /** + * @if OSPCOMPAT + * @page CompAddressSetPostOfficeBoxNumberPage Compatibility for SetPostOfficeBoxNumber() + * @section CompAddressSetPostOfficeBoxNumberPageIssueSection Issues + * Implementing this method in OSP compatible applications has the following issue: @n + * -# If the length of the post office box number to be set is greater than @c 20 characters, @c E_INVALID_ARG is returned. + * + * @section CompAddressSetPostOfficeBoxNumberPageSolutionSection Resolutions + * The issue mentioned above has been resolved in Tizen. + * @endif + */ + + /** + * Gets the label of the address. + * + * @since 2.0 + * + * @return The address label + * @see SetLabel() + */ + Tizen::Base::String GetLabel(void) const; + + /** + * Sets the label of the address. + * + * @since 2.0 + * + * @param[in] label The address label + * @see GetLabel() + */ + void SetLabel(const Tizen::Base::String& label); + + /** + * Copying of objects using this copy assignment operator is allowed. + * + * @since 2.0 + * + * @param[in] rhs An instance of %Address to copy + */ + Address& operator =(const Address& rhs); + + /** + * Compares the specified instance of %Address with the current instance. + * + * @since 2.0 + * + * @return @c true if the data of the specified instance is equal to the data of the current instance, @n + * else @c false + * @param[in] rhs The source data + */ + bool operator ==(const Address& rhs) const; + + /** + * Compares the specified instance to the current instance for inequality. + * + * @since 2.0 + * + * @return @c true if the data of the specified instance is not equal to the data of the current instance, @n + * else @c false + * @param[in] rhs The source data + */ + bool operator !=(const Address& rhs) const; + +private: + friend class _AddressImpl; + class _AddressImpl* __pAddressImpl; +}; // Address + +}} // Tizen::Social + +#endif //_FSCL_ADDRESS_H_ diff --git a/inc/FSclAddressbook.h b/inc/FSclAddressbook.h new file mode 100644 index 0000000..18cba0c --- /dev/null +++ b/inc/FSclAddressbook.h @@ -0,0 +1,1265 @@ +// +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// 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. +// +/** +* @file FSclAddressbook.h +* @brief This is the header file for the %Addressbook class. +* +* This header file contains the declarations of the %Addressbook class. +*/ + +#ifndef _FSCL_ADDRESSBOOK_H_ +#define _FSCL_ADDRESSBOOK_H_ + +#include +#include +#include +#include + +namespace Tizen { namespace Base +{ +class String; +namespace Collection +{ +class IList; +template class IListT; +} +}} + +namespace Tizen { namespace Social +{ +class Category; +class Contact; +class UserProfile; +class IRecordEventListener; +class IAddressbookEventListener; +class IAddressbookChangeEventListener; +class IRecordEventListener; + +/** + * @class Addressbook + * @brief This class handles the address book database. + * + * @since 2.0 + * + * @final This class is not intended for extension. + * + * The %Addressbook class handles the %Addressbook database, which is a centralized database used by multiple applications to store a subset of the contact information. + * It also supports the categorizing of the contacts. + * + * For more information on the class features, see Address Book. + * + * The following example demonstrates how to use the %Addressbook class to create categories and add contacts to them. + * + * @code + * + #include + + using namespace Tizen::Social; + using namespace Tizen::Base; + + void + AddressbookExample::CreateExample(void) + { + result r = E_SUCCESS; + + // Get default addressbook instance + Addressbook* pAddressbook = AddressbookManager::GetInstance()->GetAddressbookN(); + + // Creates and constructs a contact + Contact contact; + + // Sets the contact's properties: first name and last name + contact.SetValue(CONTACT_PROPERTY_ID_FIRST_NAME , L"Thomas"); + contact.SetValue(CONTACT_PROPERTY_ID_LAST_NAME , L"Anderson"); + + // Sets the contact's properties: add a phone number + PhoneNumber phoneNumber(PHONENUMBER_TYPE_MOBILE, L"820223459876"); + contact.AddPhoneNumber(phoneNumber); + + // Sets the contact's properties: add an address + Address address; + address.SetCountry(L"KOR"); + address.SetCity(L"Seoul"); + contact.AddAddress(address); + + // Adds the contact to the address book (when it is added, the recordId is created) + r = pAddressbook->AddContact(contact); + if (IsFailed(r)) + { + AppLogException( "Fails to add a contact"); + + delete pAddressbook; + return; + } + + // Creates and constructs a category ("Friends") + Category category; + category.SetName(L"Friends"); + + + // Adds the category to the address book + r = pAddressbook->AddCategory(category); + if (IsFailed(r)) + { + delete pAddressbook; + return; + } + + // Adds the contact to the category + r = pAddressbook->AddMemberToCategory(category.GetRecordId(), contact.GetRecordId()); + if (IsFailed(r)) + { + delete pAddressbook; + return; + } + + delete pAddressbook; + } + * + * @endcode + * + * The following example demonstrates how to use the %Addressbook class to retrieve the contacts associated with each category. + * @code + * + #include + + using namespace Tizen::Base; + using namespace Tizen::Base::Collection; + using namespace Tizen::Social; + + void + AddressbookExample::GetContactsExample(void) + { + result r = E_SUCCESS; + + // Get default addressbook instance + Addressbook* pAddressbook = AddressbookManager::GetInstance()->GetAddressbookN(); + + // Gets all the categories. + IList* pCategoryList = pAddressbook->GetAllCategoriesN(); + if (pCategoryList == null) + { + delete pAddressbook; + return; + } + + Category* pCategory = null; + Contact* pContact = null; + IList* pContactList = null; + IEnumerator* pContactEnum = null; + String firstName; + String lastName; + IEnumerator* pCategoryEnum = pCategoryList->GetEnumeratorN(); + while (pCategoryEnum->MoveNext() == E_SUCCESS) + { + pCategory = static_cast(pCategoryEnum->GetCurrent()); + + // Gets all the contacts of each category. + pContactList = pAddressbook->GetContactsByCategoryN(pCategory->GetRecordId()); + if (pContactList == null) + { + continue; + } + + pContactEnum = pContactList->GetEnumeratorN(); + while (pContactEnum->MoveNext() == E_SUCCESS) + { + pContact = static_cast(pContactEnum->GetCurrent()); + + //Gets the name. + pContact->GetValue(CONTACT_PROPERTY_ID_FIRST_NAME, firstName); + pContact->GetValue(CONTACT_PROPERTY_ID_LAST_NAME, lastName); + + // Displays the first name and last name. + // ... + } + delete pContactEnum; + pContactList->RemoveAll(true); + delete pContactList; + } + + delete pCategoryEnum; + pCategoryList->RemoveAll(true); + delete pCategoryList; + + delete pAddressbook; + } + + * + * @endcode + * + * The following example demonstrates how to use the %Addressbook class to search for a contact. + * + * @code + * + #include + + using namespace Tizen::Base; + using namespace Tizen::Base::Collection; + using namespace Tizen::Social; + + void + AddressbookExample::SearchExample(void) + { + result r = E_SUCCESS; + + // Get default addressbook instance + Addressbook* pAddressbook = AddressbookManager::GetInstance()->GetAddressbookN(); + + //Searches contacts by name ("Anderson"). + IList* pContactList = pAddressbook->SearchContactsByNameN(L"Anderson"); + if (pContactList == null) + { + delete pAddressbook; + + return; + } + + Contact* pContact = null; + String firstName; + String lastName; + IEnumerator* pContactEnum = pContactList->GetEnumeratorN(); + while (pContactEnum->MoveNext() == E_SUCCESS) + { + pContact = static_cast(pContactEnum->GetCurrent()); + + //Gets the contact's name. + pContact->GetValue(CONTACT_PROPERTY_ID_FIRST_NAME, firstName); + pContact->GetValue(CONTACT_PROPERTY_ID_LAST_NAME, lastName); + + // Displays the first name and last name. + // ... + } + + delete pContactEnum; + pContactList->RemoveAll(true); + delete pContactList; + + delete pAddressbook; + } + * + * @endcode + */ +class _OSP_EXPORT_ Addressbook + : public Tizen::Base::Object +{ +public: + /** + * + * The object is not fully constructed after this constructor is called. @n + * An application must use AddressbookManager::GetAddressbookN() to get a fully constructed %Addressbook instance. + * + * @since 2.0 + * + * @see AddressbookManager::GetAddressbookN() + * + * The following example demonstrates how to create an %Addressbook instance. + * @code + * result + * MyApplication::UpdateContact(Contact* pContact) + * { + * Addressbook* pAddressbook = AddressbookManager::GetInstance()->GetAddressbookN(); + * + * result r = pAddressbook->UpdateContact(*pContact); + * + * delete pAddressbook; + * + * return r; + * } + * @endcode + */ + Addressbook(void); + + /** + * This destructor overrides Tizen::Base::Object::~Object(). + * + * @since 2.0 + */ + virtual ~Addressbook(void); + + /** + * @if OSPDEPREC + * Initializes this instance of %Addressbook with a specified listener. + * + * @brief [Deprecated] + * @deprecated This method and IRecordEventListener are deprecated. Instead of using this method, use AddressbookManager::GetAddressbookN() and SetEventListener(). + * + * @since 2.0 + * + * @return An error code + * @param[in] pListener The event listener to register + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @endif + */ + result Construct(IRecordEventListener* pListener = null); + + /** + * Sets the addressbook change event listener. @n + * The listener is called when a contact or a category has been changed. + * To reset the event listener, @c null must be passed. + * + * @brief [Deprecated] + * @deprecated This method and IAddressbookEventListener are deprecated. Instead of using this method, use SetAddressbookChangeEventListener() + * and IAddressbookChangeEventListener. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return An error code + * @param[in] pListener The event listener + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + */ + result SetEventListener(IAddressbookEventListener* pListener); + + /** + * Sets the addressbook change event listener. @n + * The listener is called when a contact or a category has been changed. + * To reset the event listener, @c null must be passed. + * + * @since 2.1 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return An error code + * @param[in] pListener The event listener + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. + * @exception E_SYSTEM The method cannot proceed due to a severe system error + */ + result SetAddressbookChangeEventListener(IAddressbookChangeEventListener* pListener); + + /** + * Adds a contact to the address book. @n + * At least one property of the contact must be set. @n + * If the contact has been added successfully, a contact ID is assigned to it. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.write + * + * @return An error code + * @param[in,out] contact The contact to add + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTEDThe user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The contact ID is not #INVALID_RECORD_ID. + * - The properties of the specified @c contact have not been set. + * @exception E_STORAGE_FULL The storage is insufficient. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The #CONTACT_PROPERTY_ID_DISPLAY_NAME and #CONTACT_PROPERTY_ID_LAST_REVISION properties cannot be set. + * @n @c CONTACT_PROPERTY_ID_DISPLAY_NAME is automatically generated from the first name and last name. + * And @c CONTACT_PROPERTY_ID_LAST_REVISION is automatically updated with the last update time. + */ + result AddContact(Contact& contact); + + /** + * Removes a contact from the address book. @n + * After this operation is done successfully, the ID of the Contact instance is #INVALID_RECORD_ID. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.write + * + * @return An error code + * @param[in,out] contact The contact to remove + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG The specified @c contact is invalid. + * @exception E_OBJ_NOT_FOUND The specified @c contact does not exist. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + */ + result RemoveContact(Contact& contact); + + /** + * Removes a contact from the address book. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.write + * + * @return An error code + * @param[in] contactId The contact ID + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG The specified @c contactId is invalid. + * @exception E_OBJ_NOT_FOUND The specified @c contactId does not exist. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + */ + result RemoveContact(RecordId contactId); + + /** + * Updates a specified contact. @n + * At least one property of the contact must be set. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.write + * + * @return An error code + * @param[in] contact The contact to update + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_OBJ_NOT_FOUND The specified @c contact does not exist in this address book. + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The specified @c contact is invalid. + * - The properties of the specified @c contact have not been set. + * @exception E_STORAGE_FULL The storage is insufficient. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + */ + result UpdateContact(const Contact& contact); + + /** + * Adds a category to the address book. @n + * If the category has been added successfully, a category ID is assigned to it. + * + * @if OSPCOMPAT + * @brief [Compatibility] + * @endif + * @since 2.0 + * @if OSPCOMPAT + * @compatibility This method has compatibility issues with OSP compatible applications. @n + * For more information, see @ref CompAddressbookAddCategoryPage "here". + * @endif + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.write + * + * @return An error code + * @param[in,out] category The category to add + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The name of the specified @c category has not been set. + * - The category ID of the specified @c category is not #INVALID_RECORD_ID. + * - One of the contact members is invalid. + * @exception E_STORAGE_FULL The storage is insufficient. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + */ + result AddCategory(Category& category); + + /** + * @if OSPCOMPAT + * @page CompAddressbookAddCategoryPage Compatibility for AddCategory() + * @section CompAddressbookAddCategoryPageIssueSection Issues + * Implementing this method in OSP compatible applications has the following issue: @n + * -# If there already exists a category which has the same name, @c E_OBJ_ALREADY_EXIST is returned. + * + * @section CompAddressbookAddCategoryPageSolutionSection Resolutions + * The issue mentioned above has been resolved in Tizen. + * @endif + */ + + + /** + * Removes a category from the address book. @n + * If the category has been deleted successfully, the record ID of this instance is #INVALID_RECORD_ID. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.write + * + * @return An error code + * @param[in,out] category The category to remove + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTEDThe user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG The specified @c category is invalid or a default category. + * @exception E_OBJ_NOT_FOUND The specified @c category does not exist in this address book. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @see Category::IsDefault() + */ + result RemoveCategory(Category& category); + + /** + * Removes a category from the address book. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.write + * + * @return An error code + * @param[in] categoryId The category ID + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The specified @c categoryId is invalid. + * - The category specified by the @c categoryId is a default category. + * @exception E_OBJ_NOT_FOUND The specified @c categoryId does not exist in this address book. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @see Category::IsDefault() + */ + result RemoveCategory(RecordId categoryId); + + /** + * Updates a category in the address book. + * + * @if OSPCOMPAT + * @brief [Compatibility] + * @endif + * @since 2.0 + * @if OSPCOMPAT + * @compatibility This method has compatibility issues with OSP compatible applications. @n + * For more information, see @ref CompAddressbookUpdateCategoryPage "here". + * @endif + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.write + * + * @return An error code + * @param[in] category The category to update + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_OBJ_NOT_FOUND The specified @c category does not exist in this address book. + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The specified @c category is invalid. + * - One of the contact members is invalid. + * @exception E_STORAGE_FULL The storage is insufficient. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + */ + result UpdateCategory(const Category& category); + + /** + * @if OSPCOMPAT + * @page CompAddressbookUpdateCategoryPage Compatibility for UpdateCategory() + * @section CompAddressbookUpdateCategoryPageIssueSection Issues + * Implementing this method in OSP compatible applications has the following issue: @n + * -# If there already exists a category which has the same name, @c E_OBJ_ALREADY_EXIST is returned. + * + * @section CompAddressbookAddCategoryPageSolutionSection Resolutions + * The issue mentioned above has been resolved in Tizen. + * @endif + */ + + + /** + * Gets all contacts in the addressbook. @n + * The contacts are ordered by display name. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return The list of contacts in the addressbook, @n + * else an empty list if there is no contact, or @c null if an exception occurs (@ref Contact list) + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks + * - The specific error code can be accessed using the GetLastResult() method. + * - There is a high probability for an occurrence of an out-of-memory exception. + * If possible, check whether the exception is @c E_OUT_OF_MEMORY or not. @n + * For more information on how to handle the out-of-memory exception, refer + * here. + */ + Tizen::Base::Collection::IList* GetAllContactsN(void) const; + + /** + * Gets the member contacts of the specified category. @n + * If the specified @c category is ::INVALID_RECORD_ID, this method returns the list of contacts that are not members of any category. + * The contacts are ordered by display name. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return The list of contacts that are members of the specified category, @n + * else an empty list if there is no contact, or @c null if an exception occurs (@ref Contact list) + * @param[in] categoryId The category ID + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTEDThe user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG The specified @c categoryId is less than ::INVALID_RECORD_ID. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks + * - The specific error code can be accessed using the GetLastResult() method. + * - There is a high probability for an occurrence of an out-of-memory exception. + * If possible, check whether the exception is @c E_OUT_OF_MEMORY or not. @n + * For more information on how to handle the out-of-memory exception, refer + * here. + */ + Tizen::Base::Collection::IList* GetContactsByCategoryN(RecordId categoryId) const; + + /** + * Gets contacts in the specified range in the address book. @n + * The contacts are ordered by display name. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return The list of contacts in the specified range, @n + * else an empty list if there is no contact, or @c null if an exception occurs (@ref Contact list) + * @param[in] pageNo The page number of the result list @n + * It starts from @c 1. + * @param[in] countPerPage The maximum count of the result items on a page + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_OUT_OF_RANGE The specified @c pageNo or @c countPerPage is less than @c 1. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks + * - The specific error code can be accessed using the GetLastResult() method. + * - There is a high probability for an occurrence of an out-of-memory exception. + * If possible, check whether the exception is @c E_OUT_OF_MEMORY or not. @n + * For more information on how to handle the out-of-memory exception, refer + * here. + + */ + Tizen::Base::Collection::IList* GetContactsN(int pageNo, int countPerPage) const; + + /** + * Gets contacts that are in the specified range of the specified category. @n + * The contacts are ordered by display name. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return The list of contacts in the specified range of the specified category, @n + * else an empty list if there is no contact, or @c null if an exception occurs (@ref Contact list) + * @param[in] category The category + * @param[in] pageNo The page number of the result list, which starts from @c 1 + * @param[in] countPerPage The maximum count of the result items on a page + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_OUT_OF_RANGE The specified @c pageNo or @c countPerPage is less than @c 1. + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The specified @c category is invalid. + * - One of the contact members is invalid. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks + * - The specific error code can be accessed using the GetLastResult() method. + * - There is a high probability for an occurrence of an out-of-memory exception. + * If possible, check whether the exception is @c E_OUT_OF_MEMORY or not. @n + * For more information on how to handle the out-of-memory exception, refer + * here. + */ + Tizen::Base::Collection::IList* GetContactsInN(const Category& category, int pageNo, int countPerPage) const; + + /** + * Gets the contact with the specified contact ID. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return The matched contact, @n + * else @c null if no contact matches the specified contact ID + * @param[in] contactId The contact ID + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG The specified @c contactId is invalid. + * @exception E_OBJ_NOT_FOUND The specified @c contactId is not found. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + Contact* GetContactN(RecordId contactId) const; + + /** + * Gets the number of contacts in the address book. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return The number of contacts in the address book, @n + * else @c -1 if an error occurs + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + int GetContactCount(void) const; + + /** + * Adds the specified contact to the specified category. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.write + * + * @return An error code + * @param [in] categoryId The category ID + * @param [in] contactId The contact ID + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The specified contact or category does not exist. + * - The specified contact and category are not in this addressbook. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks If the contact is already a member of the category, this method does nothing. + */ + result AddMemberToCategory(RecordId categoryId, RecordId contactId); + + /** + * Removes the specified contact from the specified category. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.write + * + * @return An error code + * @param [in] categoryId The category ID + * @param [in] contactId The contact ID + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The specified contact or category does not exist. + * - The specified contact and category are not in this addressbook. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks If the contact is not a member of the category, this method does nothing. + */ + result RemoveMemberFromCategory(RecordId categoryId, RecordId contactId); + + /** + * Gets all the categories in the address book. @n + * The categories are ordered by name. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return The list of categories in the address book, @n + * else an empty list if there is no category, or @c null if an exception occurs (@ref Category list) + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + Tizen::Base::Collection::IList* GetAllCategoriesN(void) const; + + /** + * Gets all the categories whose member is the specified contact. @n + * The categories are ordered by name. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return The list of categories that have the specified contact as a member, @n + * else an empty list if there is no category, or @c null if an exception occurs (@ref Category list) + * @param[in] contactId The contact ID + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG The specified @c contactId is invalid. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + Tizen::Base::Collection::IList* GetCategoriesByContactN(RecordId contactId) const; + + /** + * Gets the number of categories in the address book. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return The number of categories in the address book, @n + * else @c -1 if an error occurs + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + int GetCategoryCount(void) const; + + /** + * Gets the category with the specified category ID. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return The matched category, @n + * else @c null if no category matches the specified category ID + * @param[in] categoryId The category ID + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG The specified @c categoryId is invalid. + * @exception E_OBJ_NOT_FOUND The specified record is not found. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + Category* GetCategoryN(RecordId categoryId) const; + + /** + * Searches the contacts whose email address contains the specified @c email string. @n + * The search operation is performed with a case insensitive key (param: @c email). @n + * The contacts are ordered by display name. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return The list of all the matched contacts, @n + * else an empty list if there is no matched contact, or @c null if an exception occurs (@ref Contact list) + * @param[in] email The substring of the email to search + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG The specified @c email is an empty string. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks + * - The specific error code can be accessed using the GetLastResult() method. + * - There is a high probability for an occurrence of an out-of-memory exception. @n + * If possible, check whether the exception is @c E_OUT_OF_MEMORY or not. @n + * For more information on how to handle the out-of-memory exception, refer + * here. + */ + Tizen::Base::Collection::IList* SearchContactsByEmailN(const Tizen::Base::String& email) const; + + /** + * Searches the contacts that have the specified @c name as a substring of their display name. @n + * The search operation is performed with a case insensitive key (param: @c name). @n + * The contacts are ordered by display name. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return The list of all the matched contacts, @n + * else an empty list if there is no matched contact, or @c null if an exception occurs (@ref Contact list) + * @param[in] name The substring of the name to search + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG The specified @c name is an empty string. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks + * - The specific error code can be accessed using the GetLastResult() method. + * - There is a high probability for an occurrence of an out-of-memory exception.@n If possible, check whether the exception is @c E_OUT_OF_MEMORY or not.@n + * For more information on how to handle the out-of-memory exception, refer + * here. + */ + Tizen::Base::Collection::IList* SearchContactsByNameN(const Tizen::Base::String& name) const; + + /** + * Searches the contacts that have the specified @c phoneNumber string as a substring of one of their phone numbers. @n + * The %SearchContactsByPhoneNumberN() method returns the contacts whose phone number matches the value of the specified @c phoneNumber. @n + * The search operation is performed with a case insensitive key (param: @c phoneNumber). @n + * The contacts are ordered by display name. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return The list of all the matched contacts, @n + * else an empty list if there is no contact, or @c null if an exception occurs (@ref Contact list) + * @param[in] phoneNumber The substring of the phone number to search + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG The specified @c phoneNumber is an empty string. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks + * - The specific error code can be accessed using the GetLastResult() method. + * - There is a high probability for an occurrence of an out-of-memory exception. @n If possible, check whether the exception is @c E_OUT_OF_MEMORY or not. @n + * For more information on how to handle the out-of-memory exception, refer + * here. + */ + Tizen::Base::Collection::IList* SearchContactsByPhoneNumberN(const Tizen::Base::String& phoneNumber) const; + + /** + * Gets the latest change version of the address book. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return The latest change version, @n + * else @c -1 if an exception occurs + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @see GetChangedContactsAfterN() + * @see GetChangedCategoriesAfterN() + */ + int GetLatestVersion(void) const; + + /** + * Gets the change information of the contacts that have been changed after the specified change version. @n + * + * @brief [Deprecated] + * @deprecated This method is deprecated. Instead of using this method, use GetChangedContactInfoListN(). + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return The list of contact change information, @n + * else an empty list if there is no changed contact, or @c null if an exception occurs (@ref ContactChangeInfo list) + * @param[in] version The change version + * @param[out] latestVersion The latest change version among the changed contacts + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG The specified @c version is invalid. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @see GetLatestVersion() + * + * The following example demonstrates how to use the %GetChangedContactsAfterN() method. + * @code + * void + * MyApplication::GetChangedContacts(void) + * { + * IList* pChangedContacts = __pAddressbook->GetChangedContactsAfterN(__version, __version); + * + * IEnumerator* pEnum = pChangedContacts->GetEnumeratorN(); + * while (pEnum->MoveNext() == E_SUCCESS) + * { + * ContactChangeInfo* pInfo = (ContactChangeInfo*) pEnum->GetCurrent(); + * + * AppLog("Contact changed: type(%d), id(%d), version(%d)", pInfo->GetChangeType(), pInfo->GetContctId(), pInfo->GetVersion()); + * } + * delete pEnum; + * pChangedContacts->RemoveAll(true); + * delete pChangedContacts; + * } + * @endcode + */ + Tizen::Base::Collection::IList* GetChangedContactsAfterN(int version, int& latestVersion) const; + + /** + * Gets the change information of the contacts that have been changed after the specified change version. + * + * @since 2.1 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return The list of contact change information, @n + * else an empty list if there is no changed contact or @c null if an exception occurs (@ref ContactChangeInfo list) + * @param[in] version The change version + * @param[out] latestVersion The latest change version among the changed contacts + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. + * @exception E_INVALID_ARG The specified @c version is invalid. + * @exception E_SYSTEM The method cannot proceed due to a severe system error + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @see GetLatestVersion() + * + * The following example demonstrates how to use the %GetChangedContactInfoListN() method. + * @code + * void + * MyApplication::GetChangedContacts(void) + * { + * IList* pChangedContacts = __pAddressbook->GetChangedContactInfoListN (__version, __version); + * + * IEnumerator* pEnum = pChangedContacts->GetEnumeratorN(); + * while (pEnum->MoveNext() == E_SUCCESS) + * { + * ContactChangeInfo* pInfo = (ContactChangeInfo*) pEnum->GetCurrent(); + * + * AppLog("Contact changed: type(%d), id(%d), version(%d)", pInfo->GetChangeType(), pInfo->GetContctId(), pInfo->GetVersion()); + * } + * delete pEnum; + * pChangedContacts->RemoveAll(true); + * delete pChangedContacts; + * } + * @endcode + */ + Tizen::Base::Collection::IList* GetChangedContactInfoListN(int version, int& latestVersion) const; + + /** + * Gets the change information of the categories that have been changed after the specified version. + * + * @brief [Deprecated] + * @deprecated This method is deprecated. Instead of using this method, use GetChangedCategoryInfoListN(). + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return The list of category change information, @n + * else an empty list if there is no changed category, or @c null if an exception occurs (@ref CategoryChangeInfo list) + * + * @param[in] version The change version + * @param[out] latestVersion The latest change version among the changed categories + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG The specified @c version is invalid. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @see GetLatestVersion() + * + * The following example demonstrates how to use the %GetChangedCategoriesAfterN() method. + * @code + * void + * MyApplication::GetChangedCategories(void) + * { + * IList* pChangedCategories = __pAddressbook->GetChangedCategoriesAfterN(__version, __version); + * + * IEnumerator* pEnum = pChangedCategories->GetEnumeratorN(); + * while (pEnum->MoveNext() == E_SUCCESS) + * { + * CategoryChangeInfo* pInfo = (CategoryChangeInfo*) pEnum->GetCurrent(); + * + * AppLog("Category changed: type(%d), id(%d), version(%d)", pInfo->GetChangeType(), pInfo->GetCategoryId(), pInfo->GetVersion()); + * } + * delete pEnum; + * pChangedCategories->RemoveAll(true); + * delete pChangedCategories; + * } + * @endcode + */ + Tizen::Base::Collection::IList* GetChangedCategoriesAfterN(int version, int& latestVersion) const; + + /** + * Gets the change information of the categories that have been changed after the specified version. + * + * @since 2.1 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return The list of category change information, @n + * else an empty list if there is no changed category or @c null if an exception occurs (@ref CategoryChangeInfo list) + * + * @param[in] version The change version + * @param[out] latestVersion The latest change version among the changed categories + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. + * @exception E_INVALID_ARG The specified @c version is invalid. + * @exception E_SYSTEM The method cannot proceed due to a severe system error + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @see GetLatestVersion() + * + * The following example demonstrates how to use the %GetChangedCategoryInfoListN() method. + * @code + * void + * MyApplication::GetChangedCategories(void) + * { + * IList* pChangedCategories = __pAddressbook->GetChangedCategoryInfoN(__version, __version); + * + * IEnumerator* pEnum = pChangedCategories->GetEnumeratorN(); + * while (pEnum->MoveNext() == E_SUCCESS) + * { + * CategoryChangeInfo* pInfo = (CategoryChangeInfo*) pEnum->GetCurrent(); + * + * AppLog("Category changed: type(%d), id(%d), version(%d)", pInfo->GetChangeType(), pInfo->GetCategoryId(), pInfo->GetVersion()); + * } + * delete pEnum; + * pChangedCategories->RemoveAll(true); + * delete pChangedCategories; + * } + * @endcode + */ + Tizen::Base::Collection::IList* GetChangedCategoryInfoListN(int version, int& latestVersion) const; + + /** + * Sets the user profile of this addressbook. @n + * If the user profile exists, remove the existing user profile and add a new user profile. @n + * To update the user profile, get the existing user profile and modify the user profile and set the modified user profile. @n + * To remove the user profile, @c null must be passed. + * + * @since 2.1 + * @privlevel public + * @privilege %http://tizen.org/privilege/userprofile.write + * + * @return An error code + * @param[in] pUserProfile The user profile to set + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + */ + result SetUserProfile(const UserProfile* pUserProfile); + + /** + * Gets the user profile of this addressbook. + * + * @since 2.1 + * @privlevel public + * @privilege %http://tizen.org/privilege/userprofile.read + * + * @return The user profile, @n + * else @c null if the user profile does not exist, or if an exception occurs + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + UserProfile* GetUserProfileN(void) const; + + /** + * Checks whether the user profile of this address book has been changed after the specified version or not. + * If the user profile does not exist, this method returns @c false. + * + * @since 2.1 + * @privlevel public + * @privilege %http://tizen.org/privilege/userprofile.read + * + * @return @c true if the user profile has been changed, @n + * else @c false + * @param[in] version The changed version + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. + * @exception E_INVALID_ARG The specified @c version is invalid. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @see SetUserProfile() + */ + bool IsUserProfileChangedAfter(int version) const; + + /** + * Gets the addressbook name. + * + * @since 2.0 + * + * @return The addressbook name + */ + Tizen::Base::String GetName(void) const; + + /** + * Gets the addressbook ID. + * + * @since 2.0 + * + * @return The addressbook ID + */ + AddressbookId GetId(void) const; + + /** + * Gets the account ID associated with the addressbook. + * + * @since 2.0 + * + * @return The account ID + */ + AccountId GetAccountId(void) const; + + /** + * Adds the contacts to the addressbook. + * + * @since 2.1 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.write + * + * @return An error code + * @param[in] contactList The contacts to add @n The list should contain the Contact instances. + * @param[out] pContactIdList A pointer to the list of contact IDs that have been added successfully @n Pass @c null if the contact IDs are not necessary. + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The specified @c contactList is empty. + * - The specified @c contactList contains an empty contact. + * - The specified @c contactList contains a contact whose ID is not ::INVALID_RECORD_ID. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks + * - If an exception occurs during adding contacts, the changes are getting rollbacked. @n + * This method blocks the execution of the calling thread until all contacts in the list has been added to the addressbook or if an exception occurs. + * - It is recommended to call this method on any thread other than the main thread. + */ + result AddContacts(const Tizen::Base::Collection::IList& contactList, Tizen::Base::Collection::IListT* pContactIdList = null); + + /** + * Updates the contacts. + * + * @since 2.1 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.write + * + * @return An error code + * @param[in] contactList The contacts to update @n The list should contain the Contact instances. + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The specified @c contactList is empty. + * - The specified @c contactList contains an empty contact. + * - The specified @c contactList contains a contact whose ID is invalid. + * @exception E_OBJ_NOT_FOUND The specified @c contact does not exist. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks + * - If an exception occurs during updating contacts, the changes are getting rollbacked. @n + * This method blocks the execution of the calling thread until all contacts in the list has been updated or if an exception occurs. + * - It is recommended to call this method on any thread other than the main thread. + */ + result UpdateContacts(const Tizen::Base::Collection::IList& contactList); + + /** + * Removes the contacts. @n If the contact specified by a contact ID in the list does not exist, the contact ID is ignored. + * + * @since 2.1 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.write + * + * @return An error code + * @param[in] contactIdList The list of contact IDs to delete + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. + * @exception E_INVALID_ARG The specified @c contactIdList is empty or contains an invalid ID. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks + * - If an exception occurs during removing contacts, the changes are getting rollbacked. @n + * This method blocks the execution of the calling thread until all contacts in the list has been removed or if an exception occurs. + * - It is recommended to call this method on any thread other than the main thread. + */ + result RemoveContacts(const Tizen::Base::Collection::IListT& contactIdList); + +private: + /** + * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects. + * + * @since 2.0 + */ + Addressbook(const Addressbook& rhs); + + /** + * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects. + * + * @since 2.0 + */ + Addressbook& operator =(const Addressbook& rhs); + +private: + friend class _AddressbookImpl; + class _AddressbookImpl* __pAddressbookImpl; +}; // Addressbook + +}} // Tizen::Social + +#endif //_FSCL_ADDRESSBOOK_H_ diff --git a/inc/FSclAddressbookFilter.h b/inc/FSclAddressbookFilter.h new file mode 100644 index 0000000..4601ddc --- /dev/null +++ b/inc/FSclAddressbookFilter.h @@ -0,0 +1,266 @@ +// +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// 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. +// +/** + * @file FSclAddressbookFilter.h + * @brief This is the header file for the %AddressbookFilter class. + * + * This header file contains the declarations of the %AddressbookFilter class. + */ +#ifndef _FSCL_ADDRESSBOOK_FILTER_H_ +#define _FSCL_ADDRESSBOOK_FILTER_H_ + +#include +#include +#include + +namespace Tizen { namespace Base +{ +class String; +class DateTime; +}} + +namespace Tizen { namespace Social +{ + +/** + * @class AddressbookFilter + * @brief This class represents the condition for searching a specific item on an addressbook. + * + * @since 2.0 + * + * @final This class is not intended for extension. + * + * The %AddressbookFilter class represents the condition for searching a specific item on an addressbook. + * The type of the filter decides which item is searched (such as addressbook, contacts, persons, categories). @n + * The filter can consist of multiple filtering expressions and conjunctive operators. + * A filtering expression consists of a filter property, comparison operator and value. + * The filter property must be an element of the enumerator that corresponds to the type of the filter. @n + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Filter type Filter Property Search result
AB_FI_TYPE_ADDRESSBOOK AddressbookFilterProperty A list of Addressbook
AB_FI_TYPE_PERSON PersonFilterProperty A list of Person
AB_FI_TYPE_CONTACT ContactFilterProperty A list of Contact
AB_FI_TYPE_CATEGORY CategoryFilterProperty A list of Category
AB_FI_TYPE_PHONE_CONTACT PhoneContactFilterProperty A list of PhoneNumberContact
AB_FI_TYPE_EMAIL_CONTACT EmailContactFilterProperty A list of EmailContact
+ * + * The following example demonstrates how to use the %AddressbookFilter class. + * @code + // Search condition: (addressbookId=0 OR addressbookId=1) AND (display name LIKE '%John%') + AddressbookFilter subFilter(AB_FI_TYPE_CONTACT); + subFilter.AppendInt(FI_CONJ_OP_NONE, CONTACT_FI_PR_ADDRESSBOOK_ID, FI_CMP_OP_EQUAL, 0); + subFilter.AppendInt(FI_CONJ_OP_OR, CONTACT_FI_PR_ADDRESSBOOK_ID, FI_CMP_OP_EQUAL, 1); + + AddressbookFilter mainFilter(AB_FI_TYPE_CONTACT); + mainFilter.AppendFilter(FI_CONJ_OP_NONE, subFilter); + mainFilter.AppendString(FI_CONJ_OP_AND, CONTACT_FI_PR_DISPLAY_NAME, FI_STR_OP_CONTAIN, L"John"); + + AddressbookManager* pAddressbookManager = AddressbookManager::GetInstance(); + + IList* pEventList = pAddressbookManager->SearchN(mainFilter, CONTACT_FI_PR_DISPLAY_NAME, SORT_ORDER_ASCENDING); + + * @endcode + */ +class _OSP_EXPORT_ AddressbookFilter + : public Tizen::Base::Object +{ +public: + /** + * Initializes an instance of %AddressbookFilter with the specified @c type. + * + * @since 2.0 + * + * @param[in] type The type of the filter @n It decides the type of the item to search. + */ + AddressbookFilter(AddressbookFilterType type); + + /** + * This destructor overrides Tizen::Base::Object::~Object(). + * + * @since 2.0 + */ + virtual ~AddressbookFilter(void); + + /** + * Checks whether the value of the specified instance is equal to the value of the current instance of Tizen::Base::Object. + * + * @since 2.0 + * + * @return @c true if the value of the specified instance of Tizen::Base::Object is equal to the value of the current instance of %Tizen::Base::Object, @n + * else @c false + * @param[in] rhs An instance of Tizen::Base::Object to compare + */ + virtual bool Equals(const Tizen::Base::Object& rhs) const; + + /** + * Gets the hash value of the current instance. + * + * @since 2.0 + * + * @return The hash value of the current instance + */ + virtual int GetHashCode(void) const; + + /** + * Appends the filtering expression for an integer value. @n + * Firstly, this method appends the conjunctive operator. + * Then, this method puts the filtering expression in parentheses and appends it. @n + * The filtering expression consists of the filter property, comparison operator, and value. + * The specified @c filterProperty must be an element of the enumerator that corresponds to the type of this filter. + * + * @since 2.0 + * + * @return The error code + * @param[in] conjunctiveOperator The conjunctive operator to append the filtering expression @n + * If there is no filtering expression or the filter has been appended before, #FI_CONJ_OP_NONE must be used. Otherwise #FI_CONJ_OP_AND or #FI_CONJ_OP_OR can be used. + * @param[in] filterProperty The filter property + * @param[in] comparisonOperator The comparison operator + * @param[in] value The integer value for comparison + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The specified @c filterProperty is not an element of the enumerator that corresponds to the type of this filter. + * - The type of the specified @c filterProperty is not @c int. + * - The specified @c conjuctiveOperator is invalid. + */ + result AppendInt(FilterConjunctiveOperator conjunctiveOperator, unsigned long filterProperty, FilterComparisonOperator comparisonOperator, int value); + + /** + * Appends the filtering expression for a @c bool value. @n + * Firstly, this method appends the conjunctive operator. + * Then, this method puts the filtering expression in parentheses and appends it. @n + * The filtering expression consists of the filter property, comparison operator, and value. + * The specified @c filterProperty must be an element of the enumerator that corresponds to the type of this filter. + * + * @since 2.0 + * + * @return The error code + * @param[in] conjunctiveOperator The conjunctive operator to append the filtering expression @n + * If there is no filtering expression or the filter has been appended before, #FI_CONJ_OP_NONE must be used. Otherwise #FI_CONJ_OP_AND or #FI_CONJ_OP_OR can be used. + * @param[in] filterProperty The filter property + * @param[in] comparisonOperator The comparison operator #FI_CMP_OP_EQUAL is only permitted + * @param[in] value The @c bool value for comparison + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The specified @c filterProperty is not an element of the enumerator that corresponds to the type of this filter. + * - The type of the specified @c filterProperty is not @c bool. + * - The specified @c comparisonOperator is not #FI_CMP_OP_EQUAL. + * - The specified @c conjuctiveOperator is invalid. + * @remarks If the filtering expression is appended firstly, the @c conjunctiveOperator is ignored. + */ + result AppendBool(FilterConjunctiveOperator conjunctiveOperator, unsigned long filterProperty, FilterComparisonOperator comparisonOperator, bool value); + + /** + * Appends the filtering expression for a Tizen::Base::String value. @n + * Firstly, this method appends the conjunctive operator. + * Then, this method puts the filtering expression in parentheses and appends it. @n + * The filtering expression consists of the filter property, comparison operator, and value. + * The specified @c filterProperty must be an element of the enumerator that corresponds to the type of this filter. + * + * @since 2.0 + * + * @return The error code + * @param[in] conjunctiveOperator The conjunctive operator to append the filtering expression @n + * If there is no filtering expression or the filter has been appended before, #FI_CONJ_OP_NONE must be used. Otherwise #FI_CONJ_OP_AND or #FI_CONJ_OP_OR can be used. + * @param[in] filterProperty The filter property + * @param[in] comparisonOperator The comparison operator + * @param[in] value The Tizen::Base::String value for matching + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The specified @c filterProperty is not an element of the enumerator that corresponds to the type of this filter. + * - The type of the specified @c filterProperty is not Tizen::Base::String. + * - The specified @c conjuctiveOperator is invalid. + */ + result AppendString(FilterConjunctiveOperator conjunctiveOperator, unsigned long filterProperty, FilterStringOperator comparisonOperator, const Tizen::Base::String& value); + + /** + * Appends the filter. @n + * Firstly, this method appends the conjunctive operator. + * Then, this method puts the filtering expressions of the specified filter in parentheses and appends it. @n + * The type of the specified @c filter must be same as the type of this filter. + * + * @since 2.0 + * + * @return The error code + * @param[in] conjunctiveOperator The conjunctive operator to append the filtering expression @n + * If there is no filtering expression or the filter has been appended before, #FI_CONJ_OP_NONE must be used. Otherwise #FI_CONJ_OP_AND or #FI_CONJ_OP_OR can be used. + * @param[in] filter The filter to append + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The type of the specified @c filter is not same as the type of this filter. + * - The specified @c filter is empty. + * - The specified @c conjuctiveOperator is invalid. + */ + result AppendFilter(FilterConjunctiveOperator conjunctiveOperator, const AddressbookFilter& filter); + +private: + /* + * This default constructor is intentionally declared as private so that only the platform can create an instance. + * + * @since 2.0 + */ + AddressbookFilter(void); + + /** + * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects. + * + * @since 2.0 + */ + AddressbookFilter(const AddressbookFilter& rhs); + + /** + * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects. + * + * @since 2.0 + */ + AddressbookFilter & operator =(const AddressbookFilter & rhs); + +private: + friend class _AddressbookFilterImpl; + class _AddressbookFilterImpl* __pAddressbookFilterImpl; +}; // AddressbookFilter + +}} // Tizen::Social + +#endif // _FSCL_ADDRESSBOOK_FILTER_H_ diff --git a/inc/FSclAddressbookManager.h b/inc/FSclAddressbookManager.h new file mode 100644 index 0000000..7c4cbc9 --- /dev/null +++ b/inc/FSclAddressbookManager.h @@ -0,0 +1,1404 @@ +// +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// 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. +// +/** + * @file FSclAddressbookManager.h + * @brief This is the header file for the %AddressbookManager class. + * + * This header file contains the declarations of the %AddressbookManager class. + */ +#ifndef _FSCL_ADDRESSBOOK_MANAGER_H_ +#define _FSCL_ADDRESSBOOK_MANAGER_H_ + +#include +#include +#include +#include +#include +#include + +namespace Tizen { namespace Base +{ +namespace Collection +{ +class IList; +template class IListT; +} +}} + +namespace Tizen { namespace Social +{ +class Category; +class Contact; +class Person; +class UserProfile; +class Addressbook; +class AddressbookFilter; +class IAddressbookEventListener; +class IAddressbookChangeEventListener; + +/** + * @class AddressbookManager + * @brief This class manages addressbooks and contacts in the device storage. + * + * @since 2.0 + * + * @final This class is not intended for extension. + * + * The %AddressbookManager class provides methods for managing addressbooks and contacts in the device storage. + */ +class _OSP_EXPORT_ AddressbookManager + : public Tizen::Base::Object +{ +public: + /** + * Creates an addressbook with the specified account ID and name. @n + * The accountId must specify a valid account and only one addressbook can be created per account. @n + * The name of the addressbook must be specified and the name must be unique among existing addressbooks on the device. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.write + * + * @return An addressbook instance + * @param[in] accountId The account ID + * @param[in] name The addressbook name + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The specified @c accountId is invalid. + * - The specified @c name is an empty string. + * @exception E_OBJ_ALREADY_EXIST The addressbook with the specified @c accountId or @c name already exists. + * @exception E_STORAGE_FULL The storage is insufficient. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + Addressbook* CreateAddressbookN(AccountId accountId, const Tizen::Base::String& name); + + /** + * Deletes an addressbook. @n + * If the addressbook has been deleted successfully, + * the contacts and categories that belong to the addressbook are also deleted. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.write + * + * @return An error code + * @param[in] addressbookId The addressbook ID + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The specified @c addressbookId is invalid. + * - The addressbook specified by the @c addressbookId is a default addressbook. + * @exception E_OBJ_NOT_FOUND The specified @c addressbookId does not exist. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + */ + result DeleteAddressbook(AddressbookId addressbookId); + + /** + * Gets the addressbooks associated with the specified account ID. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return The list of addressbooks, @n + * else an empty list if there is no addressbook, or @c null if an exception occurs (@ref Addressbook list) + * @param[in] accountId The account ID + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG The specified @c accountId is invalid. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + Tizen::Base::Collection::IList* GetAddressbooksByAccountN(AccountId accountId) const; + + /** + * Gets the list of addressbooks. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return The list of addressbooks, @n + * else an empty list if there is no addressbook, or @c null if an exception occurs (@ref Addressbook list) + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + Tizen::Base::Collection::IList* GetAllAddressbooksN(void) const; + + /** + * Gets an instance of the addressbook specified by the addressbook ID. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return An addressbook instance + * @param[in] addressbookId The addressbook ID + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG The specified @c addressbookId is invalid. + * @exception E_OBJ_NOT_FOUND The specified @c addressbookId does not exist. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + Addressbook* GetAddressbookN(AddressbookId addressbookId = DEFAULT_ADDRESSBOOK_ID) const; + + /** + * Sets an addressbook change event listener. @n + * The listener is called when a contact or a category has been changed. + * To reset the event listener, @c null must be passed. + * + * @brief [Deprecated] + * @deprecated This method and IAddressbookEventListener are deprecated. Instead of using this method, use SetAddressbookChangeEventListener() + * and IAddressbookChangeEventListener. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return An error code + * @param[in] pListener The event listener + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + */ + result SetEventListener(IAddressbookEventListener* pListener); + + /** + * Sets an addressbook change event listener. @n + * The listener is called when a contact or a category has been changed. + * To reset the event listener, @c null must be passed. + * + * @since 2.1 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return An error code + * @param[in] pListener The event listener + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. + * @exception E_SYSTEM The method cannot proceed due to a severe system error + */ + result SetAddressbookChangeEventListener(IAddressbookChangeEventListener* pListener); + + /** + * Adds a contact to the specified addressbook. @n + * At least one property of the contact must have been set. @n + * If the contact has been added successfully, a contact ID is assigned to it. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.write + * + * @return An error code + * @param[in,out] contact The contact to add + * @param[in] addressbookId The addressbook ID + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The contact ID is not #INVALID_RECORD_ID. + * - The properties of the specified @c contact have not been set. + * - The specified @c addressbookId is invalid. + * @exception E_OBJ_NOT_FOUND The specified addressbook is not found. + * @exception E_STORAGE_FULL The storage is insufficient. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The #CONTACT_PROPERTY_ID_DISPLAY_NAME and #CONTACT_PROPERTY_ID_LAST_REVISION + * properties cannot be set. @n #CONTACT_PROPERTY_ID_DISPLAY_NAME is automatically generated from the first name and + * the last name. And #CONTACT_PROPERTY_ID_LAST_REVISION is automatically updated with the last update time. + */ + result AddContact(Contact& contact, AddressbookId addressbookId); + + /** + * Removes a contact. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.write + * + * @return An error code + * @param[in] contactId The contact ID + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG The specified @c contactId is invalid. + * @exception E_OBJ_NOT_FOUND The specified @c contactId does not exist. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + */ + result RemoveContact(RecordId contactId); + + /** + * Updates the specified contact. @n + * At least one property of the contact must have been set. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.write + * + * @return An error code + * @param[in] contact The contact to update + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_OBJ_NOT_FOUND The specified @c contact does not exist in this address book. + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The specified @c contact is invalid. + * - The properties of the specified @c contact have not been set. + * @exception E_STORAGE_FULL The storage is insufficient. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + */ + result UpdateContact(const Contact& contact); + + /** + * Adds a category to the specified addressbook. @n + * The name of the category must have been set. @n + * If the category has been added successfully, a category ID is assigned to it. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.write + * + * @return An error code + * @param[in,out] category The category to add + * @param[in] addressbookId The addressbook ID + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The name of the category has not been set. + * - One of the member contacts is invalid. + * - The category ID of the specified @c category is not #INVALID_RECORD_ID. + * - The specified @c addressbookId is invalid. + * @exception E_STORAGE_FULL The storage is insufficient. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + */ + result AddCategory(Category& category, AddressbookId addressbookId); + + /** + * Removes a category. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.write + * + * @return An error code + * @param[in] categoryId The category ID + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The specified @c categoryId is invalid. + * - The category specified by the @c categoryId is a default category. + * @exception E_OBJ_NOT_FOUND The specified @c categoryId does not exist in this address book. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @see Category::IsDefault() + */ + result RemoveCategory(RecordId categoryId); + + /** + * Updates a category. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.write + * + * @return An error code + * @param[in] category The category to update + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_OBJ_NOT_FOUND The specified @c category does not exist in this address book. + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The specified @c category is invalid. + * - One of the contact members is invalid. + * @exception E_STORAGE_FULL The storage is insufficient. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + */ + result UpdateCategory(const Category& category); + + /** + * Gets all the contacts on the device. @n + * The contacts are ordered by display name. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return The list of contacts on the device, @n + * else an empty list if there is no contact, or @c null if an exception occurs (@ref Contact list) + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks + * - The specific error code can be accessed using the GetLastResult() method. + * - There is a high probability for an occurrence of an out-of-memory exception. + * If possible, check whether the exception is @c E_OUT_OF_MEMORY or not. @n + * For more information on how to handle the out-of-memory exception, refer + * here. + */ + Tizen::Base::Collection::IList* GetAllContactsN(void) const; + + /** + * Gets the member contacts of the specified category. @n + * If the specified @c categoryId is ::INVALID_RECORD_ID, this method returns the list of contacts that are not a member of any category. + * The contacts are ordered by display name. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return The list of contacts that are members of the specified category, @n + * else an empty list if there is no contact, or @c null if an exception occurs (@ref Contact list) + * @param[in] categoryId The category ID + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG The specified @c categoryId is less than ::INVALID_RECORD_ID. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks + * - The specific error code can be accessed using the GetLastResult() method. + * - There is a high probability for an occurrence of an out-of-memory exception. + * If possible, check whether the exception is @c E_OUT_OF_MEMORY or not. @n + * For more information on how to handle the out-of-memory exception, refer + * here. + */ + Tizen::Base::Collection::IList* GetContactsByCategoryN(RecordId categoryId) const; + + /** + * Gets the contacts linked to the person specified by the person ID. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return The list of contacts that are linked to this person, @n + * else @c null if an exception occurs (@ref Contact list) + * @param[in] personId The person ID + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG The specified @c personId is invalid. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + Tizen::Base::Collection::IList* GetContactsByPersonN(PersonId personId) const; + + /** + * Gets the categories whose member is the person specified by the person ID. @n + * A person is a member of a category if a contact linked to it is a member of the category. + * The categories are ordered by name. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return The list of categories that has the specified person as a member, @n + * else an empty list if there is no category, or @c null if an exception occurs (@ref Category list) + * @param[in] personId The person ID + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG The specified @c personId is invalid. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + Tizen::Base::Collection::IList* GetCategoriesByPersonN(PersonId personId) const; + + /** + * Gets the contact with the specified contact ID. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return The matched contact, @n + * else @c null if no contact matches the specified contact ID + * @param[in] contactId The contact ID + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG The specified @c contactId is invalid. + * @exception E_OBJ_NOT_FOUND The specified @c contactId is not found. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + Contact* GetContactN(RecordId contactId) const; + + /** + * Gets the number of contacts in all the addressbooks. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return The number of contacts in the address book, @n + * else @c -1 if an error occurs + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + int GetContactCount(void) const; + + /** + * Adds the specified contact to the specified category. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.write + * + * @return An error code + * @param [in] categoryId The category ID + * @param [in] contactId The contact ID + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The specified contact or category does not exist. + * - The specified contact and category are not in the same addressbook. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks If the contact is already a member of the category, this method does nothing. + */ + result AddMemberToCategory(RecordId categoryId, RecordId contactId); + + /** + * Removes the specified contact from the specified category. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.write + * + * @return An error code + * @param [in] categoryId The category ID + * @param [in] contactId The contact ID + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG The specified contact or category does not exist. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks If the contact is not a member of the category, this method does nothing. + */ + result RemoveMemberFromCategory(RecordId categoryId, RecordId contactId); + + /** + * Gets all the categories on the device. @n + * The categories are ordered by name. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return The list of categories on the device, @n + * else an empty list if there is no category, or @c null if an exception occurs (@ref Category list) + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + Tizen::Base::Collection::IList* GetAllCategoriesN(void) const; + + /** + * Gets all the categories whose member is the specified contact. @n + * The categories are ordered by name. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return The list of categories that has the specified contact as a member, @n + * else an empty list if there is no category, or @c null if an exception occurs (@ref Category list) + * @param[in] contactId The contact ID + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG The specified @c contactId is invalid. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + Tizen::Base::Collection::IList* GetCategoriesByContactN(RecordId contactId) const; + + /** + * Gets the number of categories on the device. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return The number of categories on the device, @n + * else @c -1 if an error occurs + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + int GetCategoryCount(void) const; + + /** + * Gets the category with the specified category ID. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return The matched category, @n + * else @c null if no category matches the specified category ID + * @param[in] categoryId The category ID + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG The specified @c categoryId is invalid. + * @exception E_OBJ_NOT_FOUND The specified record is not found. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + Category* GetCategoryN(RecordId categoryId) const; + + /** + * Searches the contacts whose email address contains the specified @c email string. @n + * The search operation is performed with a case insensitive key (param: @c email). @n + * The contacts are ordered by display name. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return The list of all matched contacts, @n + * else an empty list if there is no matched contact, or @c null if an exception occurs (@ref Contact list) + * @param[in] email The substring of the email to search + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG The specified @c email is an empty string. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks + * - The specific error code can be accessed using the GetLastResult() method. + * - There is a high probability for an occurrence of an out-of-memory exception. + * If possible, check whether the exception is @c E_OUT_OF_MEMORY or not. @n + * For more information on how to handle the out-of-memory exception, refer + * here. + */ + Tizen::Base::Collection::IList* SearchContactsByEmailN(const Tizen::Base::String& email) const; + + /** + * Searches the contacts that have the specified @c name as a substring of their display name. @n + * The display name is a concatenation of the first name, space, and the last name. @n + * The search operation is performed with a case insensitive key (param: @c name). @n + * The contacts are ordered by display name. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return The list of all matched contacts, @n + * else an empty list if there is no matched contact, or @c null if an exception occurs (@ref Contact list) + * @param[in] name The substring of the name to search + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG The specified @c name is an empty string. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks + * - The specific error code can be accessed using the GetLastResult() method. + * - There is a high probability for an occurrence of an out-of-memory exception. + * If possible, check whether the exception is @c E_OUT_OF_MEMORY or not. @n + * For more information on how to handle the out-of-memory exception, refer + * here. + */ + Tizen::Base::Collection::IList* SearchContactsByNameN(const Tizen::Base::String& name) const; + + /** + * Searches the contacts that have the specified @c phoneNumber string as a substring of one of their phone numbers. @n + * This method returns the contacts whose phone number match the value of the specified @c phoneNumber. @n + * The search operation is performed with a case insensitive key (param: @c phoneNumber). @n + * The contacts are ordered by display name. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return The list of all matched contacts, @n + * else an empty list if there is no contact, or @c null if an exception occurs (@ref Contact list) + * @param[in] phoneNumber The substring of the phone number to search + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG The specified @c phoneNumber is an empty string. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks + * - The specific error code can be accessed using the GetLastResult() method. + * - There is a high probability for an occurrence of an out-of-memory exception. + * If possible, check whether the exception is @c E_OUT_OF_MEMORY or not. @n + * For more information on how to handle the out-of-memory exception, refer + * here. + */ + Tizen::Base::Collection::IList* SearchContactsByPhoneNumberN(const Tizen::Base::String& phoneNumber) const; + + /** + * Gets the latest change version. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return The latest change version, @n + * else @c -1 if an exception occurs + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @see GetChangedContactsAfterN() + * @see GetChangedCategoriesAfterN() + */ + int GetLatestVersion(void) const; + + /** + * Gets the change information of the contacts that have been changed after the specified change version. + * + * @brief [Deprecated] + * @deprecated This method is deprecated. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return The list of contact change information, @n + * else an empty list if there is no changed contact, or @c null if an exception occurs (@ref ContactChangeInfo list) + * @param[in] version The change version + * @param[out] latestVersion The latest change version among the changed contacts + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG The specified @c version is invalid. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @see GetLatestVersion() + * @see ContactChangeInfo + * + * The following example demonstrates how to use the %GetChangedContactsAfterN() method. + * @code + * void + * MyApplication::PrintChangedContacts(void) + * { + * IList* pChangedContacts = __pAddressbookManager->GetChangedContactsAfterN(__version, __version); + * + * IEnumerator* pEnum = pChangedContacts->GetEnumeratorN(); + * while (pEnum->MoveNext() == E_SUCCESS) + * { + * ContactChangeInfo* pInfo = static_cast(pEnum->GetCurrent()); + * + * AppLog("Contact changed: type(%d), id(%d), version(%d)", pInfo->GetChangeType(), pInfo->GetContctId(), pInfo->GetVersion()); + * } + * delete pEnum; + * pChangedContacts->RemoveAll(true); + * delete pChangedContacts; + * } + * @endcode + */ + Tizen::Base::Collection::IList* GetChangedContactsAfterN(int version, int& latestVersion) const; + + /** + * Gets the change information of the categories that have been changed after the specified change version. + * + * @brief [Deprecated] + * @deprecated This method is deprecated. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return The list of category change information, @n + * else an empty list if there is no changed category, or @c null if an exception occurs (@ref CategoryChangeInfo list) + * @param[in] version The change version + * @param[out] latestVersion The latest change version among the changed categories + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG The specified @c version is invalid. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @see GetLatestVersion() + * @see CategoryChangeInfo + * + * The following example demonstrates how to use the %GetChangedCategoriesAfterN() method. + * @code + * void + * MyApplication::PrintChangedCategories(void) + * { + * IList* pChangedCategories = __pAddressbookManager->GetChangedCategoriesAfterN(__version, __version); + * + * IEnumerator* pEnum = pChangedCategories->GetEnumeratorN(); + * while (pEnum->MoveNext() == E_SUCCESS) + * { + * CategoryChangeInfo* pInfo = static_cast(pEnum->GetCurrent()); + * + * AppLog("Category changed: type(%d), id(%d), version(%d)", pInfo->GetChangeType(), pInfo->GetCategoryId(), pInfo->GetVersion()); + * } + * delete pEnum; + * pChangedCategories->RemoveAll(true); + * delete pChangedCategories; + * } + * @endcode + */ + Tizen::Base::Collection::IList* GetChangedCategoriesAfterN(int version, int& latestVersion) const; + + /** + * Gets the person with the specified person ID. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return The matched person, @n + * else @c null if an exception occurs + * @param[in] personId The person ID + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG The specified @c personId is invalid. + * @exception E_OBJ_NOT_FOUND The specified @c personId is not found. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + Person* GetPersonN(PersonId personId) const; + + /** + * Removes a person. @n + * All the contacts linked to the person are removed, too. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.write + * + * @return An error code + * @param[in] personId The person ID + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG The specified @c personId is invalid. + * @exception E_OBJ_NOT_FOUND The specified person does not exist. + * @exception E_SYSTEM The method cannot be proceed due to a severe system error. + */ + result RemovePerson(PersonId personId); + + /** + * Gets all persons on the device. @n + * The persons are ordered by display name. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return The list of all persons on the device, @n + * else an empty list if there is no person, or @c null if an exception occurs (@ref Person list) + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_SYSTEM The method cannot be proceed due to a severe system error. + * @remarks + * - The specific error code can be accessed using the GetLastResult() method. + * - There is a high probability for an occurrence of an out-of-memory exception. + * If possible, check whether the exception is @c E_OUT_OF_MEMORY or not. @n + * For more information on how to handle the out-of-memory exception, refer + * here. + */ + Tizen::Base::Collection::IList* GetAllPersonsN(void) const; + + /** + * Gets the persons that are members of the specified category where a person is a member of a category if a contact linked to it is a member of the category. @n + * If the specified @c categoryId is ::INVALID_RECORD_ID, this method returns the persons that are not members of any category. @n + * The persons are ordered by display name. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return The list of persons that are members of the specified category, @n + * else an empty list if there is no person, or @c null if an exception occurs (@ref Person list) + * @param[in] categoryId The category ID + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG The specified @c categoryId is invalid. + * @exception E_OBJ_NOT_FOUND The specified category does not exist. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks + * - The specific error code can be accessed using the GetLastResult() method. + * - There is a high probability for an occurrence of an out-of-memory exception. + * If possible, check whether the exception is @c E_OUT_OF_MEMORY or not. @n + * For more information on how to handle the out-of-memory exception, refer + * here. + */ + Tizen::Base::Collection::IList* GetPersonsByCategoryN(RecordId categoryId) const; + + /** + * Gets the list of favorite persons. @n + * The persons are ordered by display name. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return The list of favorite persons, @n + * else an empty list if there is no favorite person, or @c null if an exception occurs (@ref Person list) + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks + * - The specific error code can be accessed using the GetLastResult() method. + * - There is a high probability for an occurrence of an out-of-memory exception. + * If possible, check whether the exception is @c E_OUT_OF_MEMORY or not. @n + * For more information on how to handle the out-of-memory exception, refer + * here. + * @see SetPersonAsFavorite() + */ + Tizen::Base::Collection::IList* GetFavoritePersonsN(void) const; + + /** + * Searches the persons that contain the specified @c keyword string in its properties. @n + * The search operation is performed with a case insensitive key (param: @c keyword). @n + * The persons are ordered by display name. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return The list of all matched persons, @n + * else an empty list if there is no matched person, or @c null if an exception occurs (@ref Person list) + * @param[in] keyword The key to search + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG The specified @c keyword is an empty string. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks + * - The specific error code can be accessed using the GetLastResult() method. + * - There is a high probability for an occurrence of an out-of-memory exception. + * If possible, check whether the exception is @c E_OUT_OF_MEMORY or not. @n + * For more information on how to handle the out-of-memory exception, refer + * here. + */ + Tizen::Base::Collection::IList* SearchPersonsN(const Tizen::Base::String& keyword) const; + + /** + * Sets whether the specified person is a favorite or not. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.write + * + * @return An error code + * @param[in] personId The person ID + * @param[in] isFavorite Set to @c true to set the specified person as a favorite, @n + * else @c false to set the specified person as a non-favorite + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG The specified @c personId is invalid. + * @exception E_OBJ_NOT_FOUND The specified person does not exist. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @see GetFavoritePersonsN() + * @see Person::IsFavorite() + */ + result SetPersonAsFavorite(PersonId personId, bool isFavorite = true); + + /** + * Merges the source person with the target person. @n + * The following are done during merging: + * - Unlinks the contacts linked to the source person. + * - Links the unlinked contacts to the target person. + * - Removes the source person. + * - Updates information of the target person. + * + * The %MergePersons() method does nothing if the source or target person does not exist. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.write + * + * @return An error code + * @param[in] sourcePersonId The source person ID + * @param[in] targetPersonId The target person ID + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG The specified @c sourcePersonId or @c targetPersonId is invalid. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + */ + result MergePersons(PersonId sourcePersonId, PersonId targetPersonId); + + /** + * Unlinks the specified contact from the specified person. @n + * The following are done during unlinking: + * - Unlinks the contact specified by @c contactId. + * - Creates a new person. + * - Links the unlinked contact to the new person. + * - Updates information of a person. + * + * It is not allowed to unlink a contact if it is the only one contact linked to a person. + * The %UnlinkContact() method does nothing if the contact has not been linked to the person or does not exist. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.write + * + * @return An error code + * @param[in] personId The ID of the person that the contact is unlinked from + * @param[in] contactId The contact to unlink + * @param[out] newPersonId The ID of the new person + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG The specified @c personId or @c contactId is invalid. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + */ + result UnlinkContact(PersonId personId, RecordId contactId, PersonId& newPersonId); + + /** + * Searches items of the addressbook with the filter. @n + * The filter specifies the item type and condition for searching. + * The searched results are ordered by the @c propertyToSort and @c sortOrder. + * If the @c offset is M and the @c maxCount are N, then the first M items are omitted from the result set returned by the searching operation and the next N items are returned. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return The list of searched results (The list of Addressbook, Person, Contact, Category, PhoneNumberContact, EmailContact), @n + * else an empty list if there is no searched result, or @c null if an exception occurs + * @param[in] filter The filter that specifies the search condition @n If the filter is empty, all items that are specified by the type of this filter are searched. + * @param[in] propertyToSort The property for sorting @n The searched results are ordered by the values of this property. + * @param[in] sortOrder The order for sorting + * @param[in] offset The offset of the searched results @n If this value is @c 0, it is ignored. + * @param[in] maxCount The maximum count of the searched results @n If this value is @c 0, it is ignored. + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The specified @c offset or @c maxCount is less than @c 0. + * - The specified @c propertyToSort is not an element of the enumerator that corresponds to the type of the @c filter. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks + * - The specific error code can be accessed using the GetLastResult() method. + * - There is a high probability for an occurrence of an out-of-memory exception. + * If possible, check whether the exception is @c E_OUT_OF_MEMORY or not. @n + * For more information on how to handle the out-of-memory exception, refer + * here. + * @see AddressbookFilterProperty + * @see PersonFilterProperty + * @see ContactFilterProperty + * @see CategoryFilterProperty + * @see PhoneContactFilterProperty + * @see EmailContactFilterProperty + */ + Tizen::Base::Collection::IList* SearchN(const AddressbookFilter& filter, + unsigned long propertyToSort = 0, Tizen::Base::SortOrder sortOrder = Tizen::Base::SORT_ORDER_NONE, int offset = 0, int maxCount = 0); + + /** + * Gets the matched item count of the search results with the filter. @n + * The filter specifies the item type and condition for searching. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return The count of the searched results + * @param[in] filter The filter that specifies the search condition @n If the filter is empty, all items that are specified by the type of this filter are searched. + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @see AddressbookFilterProperty + * @see PersonFilterProperty + * @see ContactFilterProperty + * @see CategoryFilterProperty + * @see PhoneContactFilterProperty + * @see EmailContactFilterProperty + */ + int GetMatchedItemCount(const AddressbookFilter& filter); + + /** + * Parses contacts from the specified vCard file. @n + * The %ParseContactsFromVcardN() method supports vCard formation 2.1 and 3.0. + * + * @since 2.0 + * + * @return The list of contacts, @n + * else an empty list if there is no contact, or @c null if an exception occurs (@ref Contact list) + * @param[in] vcardPath The file path of a vCard file + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c vcardPath is invalid. + * @exception E_ILLEGAL_ACCESS The access is denied due to insufficient permission. + * @exception E_FILE_NOT_FOUND The specified file cannot be found. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + Tizen::Base::Collection::IList* ParseContactsFromVcardN(const Tizen::Base::String& vcardPath); + + /** + * Exports a person to the specified vCard 3.0 file. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return An error code + * @param[in] person The person to export + * @param[in] vcardPath The file path of a vCard file + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG The specified @c person is invalid. + * @exception E_ILLEGAL_ACCESS The access is denied due to insufficient permission. + * @exception E_FILE_ALREADY_EXIST The specified file already exists. + * @exception E_STORAGE_FULL The storage is insufficient. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + */ + result ExportPersonToVcard(const Person& person, const Tizen::Base::String& vcardPath); + + /** + * Exports a person list to the specified vCard 3.0 file. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return An error code + * @param[in] personList The person list to export @n The list should contain the Person instances. + * @param[in] vcardPath The file path of a vCard file + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The specified @c personList is invalid. + * - The specified @c vcardPath is invalid. + * @exception E_ILLEGAL_ACCESS The access is denied due to insufficient permission. + * @exception E_FILE_ALREADY_EXIST The specified file already exists. + * @exception E_STORAGE_FULL The storage is insufficient. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + */ + result ExportPersonsToVcard(const Tizen::Base::Collection::IList& personList, const Tizen::Base::String& vcardPath); + + /** + * Exports a contact to the specified vCard 3.0 file. + * + * @since 2.0 + * + * @return An error code + * @param[in] contact The contact to export + * @param[in] vcardPath The file path of a vCard file + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c contact is invalid. + * @exception E_ILLEGAL_ACCESS The access is denied due to insufficient permission. + * @exception E_FILE_ALREADY_EXIST The specified file already exists. + * @exception E_STORAGE_FULL The storage is insufficient. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + */ + result ExportContactToVcard(const Contact& contact, const Tizen::Base::String& vcardPath); + + /** + * Exports a contact list to the specified vCard 3.0 file. + * + * @since 2.0 + * + * @return An error code + * @param[in] contactList The contact list to export @n The list should contain Contact instances. + * @param[in] vcardPath The file path of a vCard file + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The specified @c contactList is invalid. + * - The specified @c vcardPath is invalid. + * @exception E_ILLEGAL_ACCESS The access is denied due to insufficient permission. + * @exception E_FILE_ALREADY_EXIST The specified file already exists. + * @exception E_STORAGE_FULL The storage is insufficient. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + */ + result ExportContactsToVcard(const Tizen::Base::Collection::IList& contactList, const Tizen::Base::String& vcardPath); + + /** + * Exports a contact to a vCard format stream. + * + * @since 2.1 + * + * @return The exported vcard stream, @n + * else @c null if an exception occurs + * @param[in] contact The contact to export + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c contact is invalid. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @see ExportContactToVcard() + */ + Tizen::Base::ByteBuffer* ExportContactToVcardStreamN(const Contact& contact); + + /** + * Exports a contact list to a vCard format stream. + * + * @since 2.1 + * + * @return The exported vcard stream, @n + * else @c null if an exception occurs + * @param[in] contactList The contact list to export @n The list should contain the Contact instances + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c contactList contains an invalid contact. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @see ExportContactsToVcard() + */ + Tizen::Base::ByteBuffer* ExportContactsToVcardStreamN(const Tizen::Base::Collection::IList& contactList); + + /** + * Exports a person to a vCard format stream. + * + * @since 2.1 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return The exported vcard stream, @n + * else @c null if an exception occurs + * @param[in] person The person to export + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. + * @exception E_INVALID_ARG The specified @c person is invalid. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @see ExportPersonToVcard() + */ + Tizen::Base::ByteBuffer* ExportPersonToVcardStreamN(const Person& person); + + /** + * Exports a person list to a vCard format stream. + * + * @since 2.1 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return The exported vcard stream, @n + * else @c null if an exception occurs + * @param[in] personList The person list to export @n The list should contain the Person instances. + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. + * @exception E_INVALID_ARG The specified @c personList contains invalid person. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @see ExportPersonsToVcard() + */ + Tizen::Base::ByteBuffer* ExportPersonsToVcardStreamN(const Tizen::Base::Collection::IList& personList); + + /** + * Parses contacts from the specified vCard stream. @n + * The %ParseVcardStreamN() method supports vCard formation 2.1 and 3.0. + * + * @since 2.1 + * + * @return The list of contacts, @n + * else an empty list if there is no contact, or @c null if an exception occurs (@ref Contact list) + * @param[in] vcardStream The vCard stream + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c vcardStream is invalid. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @see ParseContactsFromVcardN() + */ + Tizen::Base::Collection::IList* ParseVcardStreamN(const Tizen::Base::ByteBuffer& vcardStream); + + /** + * Exports a user profile to a vCard format stream. + * + * @since 2.1 + * + * @return The exported vCard stream, @n + * else @c null if an exception occurs + * @param[in] userProfile The user profile to export + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c userProfile is invalid. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + Tizen::Base::ByteBuffer* ExportUserProfileToVcardStreamN(const UserProfile& userProfile); + + /** + * Exports a user profile list to a vCard format stream. + * + * @since 2.1 + * + * @return The exported vCard stream, @n + * else @c null if an exception occurs + * @param[in] userProfileList The user profile list to export @n The list should contain the UserProfile instances + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c userProfile is invalid. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + Tizen::Base::ByteBuffer* ExportUserProfilesToVcardStreamN(const Tizen::Base::Collection::IList& userProfileList); + + /** + * Exports a user profile to the specified vCard 3.0 file. + * + * @since 2.1 + * + * @return An error code + * @param[in] userProfile The user profile to export + * @param[in] vcardPath The file path of a vCard file + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c userProfile is invalid. + * @exception E_ILLEGAL_ACCESS The access is denied due to insufficient permission. + * @exception E_FILE_ALREADY_EXIST The specified file already exists. + * @exception E_STORAGE_FULL The storage is insufficient. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + */ + result ExportUserProfileToVcard(const UserProfile& userProfile, const Tizen::Base::String& vcardPath); + + /** + * Exports a user profile list to the specified vCard 3.0 file. + * + * @since 2.1 + * + * @return An error code + * @param[in] userProfileList The user profile list to export @n The list should contain the UserProfile instances + * @param[in] vcardPath The file path of a vCard file + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The specified @c userProfileList is invalid. + * - The specified @c vcardPath is invalid. + * @exception E_ILLEGAL_ACCESS The access is denied due to insufficient permission. + * @exception E_FILE_ALREADY_EXIST The specified file already exists. + * @exception E_STORAGE_FULL The storage is insufficient. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + */ + result ExportUserProfilesToVcard(const Tizen::Base::Collection::IList& userProfileList, const Tizen::Base::String& vcardPath); + + /** + * Gets all the user profiles on the device. + * + * @since 2.1 + * @privlevel public + * @privilege %http://tizen.org/privilege/userprofile.read + * + * @return The list of all the user profiles on the device, @n + * else an empty list if there is no user profile, or @c null if an exception occurs (@ref UserProfile list) + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. + * @exception E_SYSTEM The method cannot be proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + Tizen::Base::Collection::IList* GetAllUserProfilesN(void) const; + + /** + * Gets a user profile of the address book specified by the address book ID. + * + * @since 2.1 + * @privlevel public + * @privilege %http://tizen.org/privilege/userprofile.read + * + * @return The matched user profile, @n + * else @c null if an exception occurs + * @param[in] addressbookId The addressbook ID + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. + * @exception E_INVALID_ARG The specified @c addressbookId is invalid. + * @exception E_OBJ_NOT_FOUND The specified addressbook is not found. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + UserProfile* GetUserProfileN(AddressbookId addressbookId) const; + + /** + * Gets an %AddressbookManager instance. + * + * @since 2.0 + * + * @return A pointer to the %AddressbookManager instance, @n + * else @c null if it fails + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_MEMORY The memory is insufficient. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + static AddressbookManager* GetInstance(void); + +private: + // + // This default constructor is intentionally declared as private to implement the Singleton semantic. + // + // @since 2.0 + // + AddressbookManager(void); + + // + // This destructor is intentionally declared as private to implement the Singleton semantic. + // + // @since 2.0 + // + virtual ~AddressbookManager(void); + + // + // This function is only for internal usage. + // + // @since 2.0 + // + // @return An error code + // + result Construct(void); + + // + // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects. + // + // @since 2.0 + // + AddressbookManager(const AddressbookManager& rhs); + + // + // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects. + // + // @since 2.0 + // + AddressbookManager& operator =(const AddressbookManager& rhs); + + static void InitAddressbookManager(void); + static void DestroyAddressbookManager(void); + +private: + static AddressbookManager* __pInstance; + friend struct std::default_delete< AddressbookManager >; + + friend class _AddressbookManagerImpl; + class _AddressbookManagerImpl* __pAddressbookManagerImpl; +}; // AddressbookManager + +}} // Tizen::Social + +#endif //_FSCL_ADDRESSBOOK_MANAGER_H_ diff --git a/inc/FSclAttendee.h b/inc/FSclAttendee.h new file mode 100644 index 0000000..d1fa6fa --- /dev/null +++ b/inc/FSclAttendee.h @@ -0,0 +1,301 @@ +// +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// 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. +// +/** + * @file FSclAttendee.h + * @brief This is the header file for the %Attendee class. + * + * This header file contains the declarations of the %Attendee class. + */ +#ifndef _FSCL_ATTENDEE_H_ +#define _FSCL_ATTENDEE_H_ + +#include +#include +#include +#include + +namespace Tizen { namespace Social +{ + +/** + * @class Attendee + * @brief This class represents the information of an attendee. + * + * @since 2.0 + * + * @final This class is not intended for extension. + * + * The %Attendee class represents the information of an attendee. The attendee details include a mandatory + * email and an optional name. In addition, the attendee has a role and status information. + */ +class _OSP_EXPORT_ Attendee + : public Tizen::Base::Object +{ +public: + /** + * Initializes this instance of %Attendee with the specified email address. + * + * @since 2.0 + * + * @param[in] email The email address + */ + Attendee(const Tizen::Base::String& email); + + /** + * Copying of objects using this copy constructor is allowed. + * + * @since 2.0 + * + * @param[in] rhs An instance of %Attendee to copy + */ + Attendee(const Attendee& rhs); + + /** + * This destructor overrides Tizen::Base::Object::~Object(). + * + * @since 2.0 + */ + virtual ~Attendee(void); + + /** + * Compares the specified Tizen::Base::Object with the current %Attendee instance. + * + * @since 2.0 + * + * @return @c true if the specified object equals the current %Attendee instance, @n + * else @c false + * @param[in] rhs The object instance to compare with the current object + * @see GetHashCode() + */ + virtual bool Equals(const Tizen::Base::Object& rhs) const; + + /** + * Gets the hash value of the current instance. + * + * @since 2.0 + * + * @return The hash value of the current instance + */ + virtual int GetHashCode(void) const; + + /** + * Gets the name of the attendee. + * + * @since 2.0 + * + * @return The name + */ + Tizen::Base::String GetName(void) const; + + /** + * Gets the email address of the attendee. + * + * @since 2.0 + * + * @return The email address + */ + Tizen::Base::String GetEmail(void) const; + + /** + * Gets the role of the attendee. @n + * The default value is @c #ATTENDEE_ROLE_ATTENDEE. + * + * @since 2.0 + * + * @return The role of the attendee + */ + AttendeeRole GetRole(void) const; + + /** + * Gets the status of the attendee. @n + * The default value is @c #ATTENDEE_STATUS_NONE. + * + * @since 2.0 + * + * @return The attendee status + */ + AttendeeStatus GetStatus(void) const; + + /** + * Sets the name. + * + * @if OSPCOMPAT + * @brief [Compatibility] + * @endif + * @since 2.0 + * @if OSPCOMPAT + * @compatibility This method has compatibility issues with OSP compatible applications. @n + * For more information, see @ref CompAttendeeSetNamePage "here". + * @endif + * + * @return An error code + * @param[in] name The common name of the attendee + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c name is an empty string. + */ + result SetName(const Tizen::Base::String& name); + + /** + * @if OSPCOMPAT + * @page CompAttendeeSetNamePage Compatibility for SetName() + * @section CompAttendeeSetNamePageIssueSection Issues + * Implementing this method in OSP compatible applications has the following issues: @n + * -# If the length of the name to be set is greater than @c 100 characters, @c E_INVALID_ARG is returned. + * + * @section CompAttendeeSetNamePageSolutionSection Resolutions + * This issue has been resolved in Tizen. @n + * -# There is no limit for the length of the name. + * + * @endif + */ + + /** + * Sets the email address of the attendee. @n + * This is the identifier of the attendee. + * + * @if OSPCOMPAT + * @brief [Compatibility] + * @endif + * @since 2.0 + * @if OSPCOMPAT + * @compatibility This method has compatibility issues with OSP compatible applications. @n + * For more information, see @ref CompAttendeeSetEmailPage "here". + * @endif + * + * @return An error code + * @param[in] email The email address + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c email is an empty string. + */ + result SetEmail(const Tizen::Base::String& email); + + /** + * @if OSPCOMPAT + * @page CompAttendeeSetEmailPage Compatibility for SetEmail() + * @section CompAttendeeSetEmailPageIssueSection Issues + * Implementing this method in OSP compatible applications has the following issues: @n + * -# If the length of the email to be set is greater than @c 320 characters, @c E_INVALID_ARG is returned. + * + * @section CompAttendeeSetEmailPageSolutionSection Resolutions + * This issue has been resolved in Tizen. @n + * -# There is no limit for the length of the email. + * @endif + */ + + /** + * Sets the role of the attendee. @n + * The default value is @c #ATTENDEE_ROLE_ATTENDEE. + * + * @since 2.0 + * + * @param[in] role The role of the attendee @n + * The default value is @c #ATTENDEE_ROLE_ATTENDEE. + */ + void SetRole(AttendeeRole role); + + /** + * Sets the status of the attendee. @n + * The default value is @c #ATTENDEE_STATUS_NONE. + * + * @since 2.0 + * + * @param[in] status The status of the attendee @n + * The default value is @c #ATTENDEE_STATUS_NONE. + */ + void SetStatus(AttendeeStatus status); + + /** + * Sets the phone number. + * + * @since 2.0 + * + * @param[in] phoneNumber The phone number + */ + void SetPhoneNumber(const Tizen::Base::String& phoneNumber); + + /** + * Gets the phone number. + * + * @since 2.0 + * + * @return The phone number + */ + Tizen::Base::String GetPhoneNumber(void) const; + + /** + * Sets the person ID that is an identifier used for Addressbook APIs. + * + * @since 2.0 + * + * @param[in] personId The person ID + */ + void SetPersonId(PersonId personId); + + /** + * Gets the person ID that is an identifier used for Addressbook APIs. + * + * @since 2.0 + * + * @return The person ID + */ + PersonId GetPersonId(void) const; + + /** + * Copying of objects using this copy assignment operator is allowed. + * + * @since 2.0 + * + * @param[in] rhs An instance of %Attendee to copy + */ + Attendee& operator =(const Attendee& rhs); + + /** + * Checks whether the data in the specified instance of %Attendee is equal to the data in the current instance. + * + * @since 2.0 + * + * @return @c true if the data in the specified instance equals the data in the current instance, @n + * else @c false + * @param[in] rhs An instance of %Attendee + */ + bool operator ==(const Attendee& rhs) const; + + /** + * Compares the specified instance of %Attendee with the current instance for inequality. + * + * @since 2.0 + * + * @return @c true if the data in the specified instance is not equal to the data in the current instance, @n + * else @c false + * @param[in] rhs An instance of %Attendee + */ + bool operator !=(const Attendee& rhs) const; + +private: + Tizen::Base::String __name; + Tizen::Base::String __email; + Tizen::Base::String __phoneNumber; + AttendeeRole __attendeeRole; + AttendeeStatus __attendeeStatus; + PersonId __personId; + + friend class _AttendeeImpl; + class _AttendeeImpl* __pAttendeeImpl; +}; // Attendee + +}} // Tizen::Social + +#endif //_FSCL_ATTENDEE_H_ diff --git a/inc/FSclCalEvent.h b/inc/FSclCalEvent.h new file mode 100644 index 0000000..e436b0d --- /dev/null +++ b/inc/FSclCalEvent.h @@ -0,0 +1,926 @@ +// +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// 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. +// +/** + * @file FSclCalEvent.h + * @brief This is the header file for the %CalEvent class. + * + * This header file contains the declarations of the %CalEvent class. + */ +#ifndef _FSCL_CAL_EVENT_H_ +#define _FSCL_CAL_EVENT_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace Tizen { namespace Locales +{ +class TimeZone; +}} + +namespace Tizen { namespace Social +{ + +/** + * @class CalEvent + * @brief This class provides methods to manage the information of a calendar book event. + * + * @since 2.0 + * + * @final This class is not intended for extension. + * + * The %CalEvent class describes an occasion planned in a particular situation. @n + * An event is a subset of vEvent. A %CalEvent instance includes the category, subject, description, start time, end time, location, and sensitivity. + * %CalEvent also includes the recurring and reminder data. For more information, see the Recurrence, and Reminder classes. + * + * For more information on the class features, see Calendar Events. + * + * The following example demonstrates how to use the %CalEvent class. + + * @code + * + #include + #include + + using namespace Tizen::Base; + using namespace Tizen::Social; + using namespace Tizen::Locales; + + void + CreateCalEventWithTimeZone(void) + { + DateTime startWallTime; + DateTime endWallTime; + DateTime startUtcTime; + DateTime endUtcTime; + + // Suppose a user set 2010/2/17 12:00:00 ~ 2010/2/17 14:00:00 in wall time for start/end time + startWallTime.SetValue(2010, 2, 17, 12, 0, 0); + endWallTime.SetValue(2010, 2, 17, 14, 0, 0); + + // Gets the system time zone + LocaleManager localeManager; + localeManager.Construct(); + + TimeZone timeZone = localeManager.GetSystemTimeZone(); + + // Converts the wall time to UTC time before set start and end time of the event + startUtcTime = timeZone.WallTimeToUtcTime(startWallTime); + endUtcTime = timeZone.WallTimeToUtcTime(endWallTime); + + // Creates an event + CalEvent event; + + // Sets the values + event.SetTimeZone(timeZone); + event.SetStartAndEndTime(startUtcTime, endUtcTime); + } + * + * @endcode + * + * The following example demonstrates how to use the %CalEvent class to add calendarbook all day event. + * @code + * + #include + #include + + using namespace Tizen::Base; + using namespace Tizen::Social; + + void + CreateAlldayEvent(void) + { + + DateTime startWallTime; + DateTime endWallTime; + + // Sets the start/end time for an all day event on 2013/7/17 + // The end time for all day event must be later than the start date(RFC 5545) + startWallTime.SetValue(2013, 7, 17, 0, 0, 0); + endWallTime.SetValue(2013, 7, 18, 0, 0, 0); + + // Creates an all day event + CalEvent event; + event.SetSubject(L"All day event"); + + event.SetAllDayEvent(true); + event.SetStartAndEndTime(startWallTime, endWallTime); + } + * + * @endcode + */ +class _OSP_EXPORT_ CalEvent + : public Record +{ + +public: + /** + * This is the default constructor for this class. + * + * @since 2.0 + */ + CalEvent(void); + + /** + * Copying of objects using this copy constructor is allowed. + * + * @since 2.0 + * + * @param[in] rhs An instance of %CalEvent to copy + */ + CalEvent(const CalEvent& rhs); + + /** + * This destructor overrides Tizen::Social::Record::~Record(). + * + * @since 2.0 + */ + virtual ~CalEvent(void); + + /** + * Compares the specified Tizen::Base::Object with the current %CalEvent instance. + * + * @since 2.0 + * + * @return @c true if the specified object equals the current %CalEvent instance, @n + * else @c false + * @param[in] rhs The object instance to compare with the current object + * @see GetHashCode() + */ + virtual bool Equals(const Tizen::Base::Object& rhs) const; + + /** + * Gets the hash value of the current instance. + * + * @since 2.0 + * + * @return The hash value of the current instance + */ + virtual int GetHashCode(void) const; + + /** + * @if OSPDEPREC + * Checks whether this instance is a %CalEvent instance. @n + * A one-time calendar event has only one instance and a recurring calendar event has more than one instance. @n + * Each instance of %CalEvent has its own recurrence ID. + * + * @brief [Deprecated] + * @deprecated This method is deprecated because %CalEvent class is not used for an event instance any more. @n + * Instead of using the %CalEvent class, it is recommended to use the CalEventInstance class for an event instance. + * @since 2.0 + * + * @return @c true if this instance is a %CalEvent instance, @n + * else @c false + * @endif + */ + bool IsInstance(void) const; + + /** + * @if OSPDEPREC + * Checks whether the calendar event has a recurring pattern. + * + * @brief [Deprecated] + * @deprecated This method is deprecated because %CalEvent class is not used for an event instance any more. @n + * Instead of using the %CalEvent class, it is recommended to use the CalEventInstance class for an event instance. + * @since 2.0 + * + * @return @c true if the calendar event has a recurring pattern, @n + * else @c false + * @endif + */ + bool IsRecurring(void) const; + + /** + * @if OSPDEPREC + * Gets the original calendar event ID. @n + * The %CalEvent instance has an original @c CalEventId, that is a record ID of its entry. + * + * @brief [Deprecated] + * @deprecated This method is deprecated because %CalEvent class is not used for an event instance any more. @n + * Instead of using the %CalEvent class, it is recommended to use the CalEventInstance class for an event instance. + * @since 2.0 + * + * @return The original calendar event ID, @n + * else #INVALID_RECORD_ID if the record ID is invalid + * @endif + */ + RecordId GetOriginalCalEventId(void) const; + + /** + * Checks whether the calendar event is an all day event. + * + * @since 2.0 + * + * @return @c true if the calendar event is an all day event, @n + * else @c false + */ + bool IsAllDayEvent(void) const; + + /** + * Sets the calendar event as an all day event. + * + * @since 2.0 + * + * @param[in] isAllDayEvent Set to @c true to make the calendar event an all day event, @n + * else @c false + */ + void SetAllDayEvent(bool isAllDayEvent); + + /** + * @if OSPDEPREC + * Gets the globally unique ID. @n + * UID: globally Unique Identifier (vCalendar 1.0) + * + * @brief [Deprecated] + * @deprecated This method is deprecated because a string value cannot be handled. @n + * Instead of using this method, it is recommended to use GetUid(). + * @since 2.0 + * + * @return The globally unique ID + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_MEMORY The memory is insufficient. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @endif + */ + Tizen::Base::ByteBuffer* GetUIDN(void) const; + + /** + * @if OSPDEPREC + * Sets the globally unique ID. @n + * UID: globally Unique Identifier (vCalendar 1.0) + * + * @brief [Deprecated] + * @deprecated This method is deprecated because a string value cannot be handled. @n + * Instead of using this method, it is recommended to use SetUid(). + * @since 2.0 + * + * @return An error code + * @param[in] pUid The globally unique ID + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_MEMORY The memory is insufficient. + * @endif + */ + result SetUID(const Tizen::Base::ByteBuffer* pUid); + + /** + * Gets the globally unique ID. @n + * UID: globally Unique Identifier (vCalendar 1.0) + * + * @since 2.0 + * + * @return The globally unique ID + */ + Tizen::Base::String GetUid(void) const; + + /** + * Sets the globally unique ID. @n + * UID: globally Unique Identifier (vCalendar 1.0) + * + * @since 2.0 + * + * @param[in] uid The globally unique ID + */ + void SetUid(const Tizen::Base::String& uid); + + /** + * Gets the calendar event status. @n + * The default status is #EVENT_STATUS_NONE. + * + * @since 2.0 + * + * @return The calendar event status + * @see EventStatus + */ + EventStatus GetStatus(void) const; + + /** + * Sets the calendar event status. + * + * @since 2.0 + * + * @param[in] status The status + * @see EventStatus + */ + void SetStatus(EventStatus status); + + /** + * Gets the busy status. @n + * The default busy status is #BUSY_STATUS_BUSY. + * + * @since 2.0 + * + * @return The busy status + * @see BusyStatus + */ + BusyStatus GetBusyStatus(void) const; + + /** + * Sets the busy status. + * + * @since 2.0 + * + * @param[in] busyStatus The busy status + * @see BusyStatus + */ + void SetBusyStatus(BusyStatus busyStatus); + + /** + * Gets the priority level of the calendar event. @n + * The default priority level is #EVENT_PRIORITY_LOW. + * + * @since 2.0 + * + * @return The priority level + * + */ + EventPriority GetPriority(void) const; + + /** + * Sets the priority level of the calendar event. + * + * @since 2.0 + * + * @param[in] priority The priority level to set + * + */ + void SetPriority(EventPriority priority); + + /** + * Adds an attendee. + * + * @brief [Compatibility] + * @since 2.0 + * @compatibility This method has compatibility issues with %Tizen API versions @b prior @b to @b 2.1. @n + * For more information, see @ref CompCalEventAddAttendeePage "here". + * + * @return An error code + * @param[in] attendee The attendee to add @n + * The specified @c attendee must have an email address. + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c attendee is invalid. @b Since @b 2.1 + * @exception E_OBJ_ALREADY_EXIST An attendee with the same email address already exists. + */ + result AddAttendee(const Attendee& attendee); + + /** + * @page CompCalEventAddAttendeePage Compatibility for AddAttendee() + * @section CompCalEventAddAttendeePageIssueSection Issues + * Implementation of this method in %Tizen API versions prior to 2.1 has the following issue: @n + * - If the email of @c attendee is empty, @c E_OBJ_ALREADY_EXIST is returned. + * + * @section CompCalEventAddAttendeePageSolutionSection Resolutions + * The issue mentioned above is resolved in %Tizen API version 2.1. + * - If the email of @c attendee is empty, @c E_INVALID_ARG is returned. + */ + + /** + * Removes an attendee. + * + * @since 2.0 + * + * @return An error code + * @param[in] attendee The attendee to remove @n + * The specified @c attendee must have an email address. + * @exception E_SUCCESS The method is successful. + * @exception E_OBJ_NOT_FOUND An attendee with the same email address is not found. + */ + result RemoveAttendee(const Attendee& attendee); + + /** + * Gets the list of attendees. + * + * @since 2.0 + * + * @return The list of attendees + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @see Attendee + */ + Tizen::Base::Collection::IList* GetAllAttendeesN(void) const; + + /** + * Gets the time zone. + * + * @since 2.0 + * + * @return The time zone based on the time zone ID and the start time of the %CalEvent instance + * @see Tizen::Locales::TimeZone::GetTimeZone(const Tizen::Base::String&, const Tizen::Base::DateTime&, Tizen::Locales::TimeZone&) + */ + Tizen::Locales::TimeZone GetTimeZone(void) const; + + /** + * Sets the time zone. @n + * Recurrence is calculated based on the time zone, thus the time zone must be set before setting a recurrence. + * If the time zone is not set, it is considered as Greenwich Mean Time (GMT). + * + * @since 2.0 + * + * @return An error code + * @param[in] timeZone The time zone to set + * @exception E_SUCCESS The method is successful. + * @exception E_FAILURE The method has failed. + * @remarks + * - As all day events are not affected by a time zone, it is recommended not to set the time zone. + * - Only the time zone ID of the @c timeZone is set to the %CalEvent instance, and the other properties are ignored. + */ + result SetTimeZone(const Tizen::Locales::TimeZone& timeZone); + + /** + * @if OSPDEPREC + * Gets the recurrence ID. @n + * The %GetRecurrenceId() method works only for the %CalEvent instances. + * + * @brief [Deprecated] + * @deprecated This method is deprecated because the %CalEvent class is not used for an event instance any more. @n + * Instead of using the %CalEvent class, it is recommended to use the CalEventInstance class for an event instance. + * @since 2.0 + * + * @return The recurrence ID + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_STATE The instance is a %CalEvent instance that does not have a recurrence ID. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @endif + */ + RecurrenceId GetRecurrenceId(void) const; + + /** + * Gets the subject of the calendar event. + * + * @since 2.0 + * + * @return The subject, @n + * else @c null if there is no subject value + */ + Tizen::Base::String GetSubject(void) const; + + /** + * Gets the description of the calendar event. + * + * @since 2.0 + * + * @return The description + */ + Tizen::Base::String GetDescription(void) const; + + /** + * Gets the start date and time of the calendar event. + * + * @since 2.0 + * + * @return An instance of Tizen::Base::DateTime that represents the start date and time + */ + Tizen::Base::DateTime GetStartTime(void) const; + + /** + * Gets the end date and time of the calendar event. + * + * @since 2.0 + * + * @return An instance of Tizen::Base::DateTime that represents the end date and time + */ + Tizen::Base::DateTime GetEndTime(void) const; + + /** + * Gets the location of the calendar event. + * + * @since 2.0 + * + * @return The location + */ + Tizen::Base::String GetLocation(void) const; + + /** + * @if OSPDEPREC + * Gets the category of the calendar event. + * + * @brief [Deprecated] + * @deprecated This method is deprecated because the category of the event is not used any more. + * @since 2.0 + * + * @return The category of the calendar event + * @endif + */ + EventCategory GetCategory(void) const; + + /** + * Gets the sensitivity of the calendar event. @n + * The default value is #SENSITIVITY_PUBLIC. + * + * @since 2.0 + * + * @return The sensitivity of the calendar event + */ + RecordSensitivity GetSensitivity(void) const; + + + /** + * @if OSPDEPREC + * Gets the reminder for the calendar event. + * + * @brief [Deprecated] + * @deprecated This method is deprecated. Instead of using this method, it is recommended to use GetAllReminders(). + * @since 2.0 + * + * @return A pointer to an instance of Reminder, @n + * else @c null if the reminder is not set + * @endif + */ + const Reminder* GetReminder(void) const; + + /** + * Gets the recurrence of the calendar event. + * + * @since 2.0 + * + * @return A pointer to an instance of Recurrence, @n + * else @c null if the event is not a recurring event + */ + const Recurrence* GetRecurrence(void) const; + + /** + * Gets the last updated date and time of the calendar event. + * + * @since 2.0 + * + * @return The last updated date and time + */ + Tizen::Base::DateTime GetLastRevisedTime(void) const; + + /** + * Sets the subject of the calendar event. + * + * @if OSPCOMPAT + * @brief [Compatibility] + * @endif + * @since 2.0 + * @if OSPCOMPAT + * @compatibility This method has compatibility issues with OSP compatible applications. @n + * For more information, see @ref CompCalEventSetSubjectPage "here". + * @endif + * + * @return An error code + * @param[in] subject The subject of the calendar event + * @exception E_SUCCESS The method is successful. + */ + result SetSubject(const Tizen::Base::String& subject); + + /** + * @if OSPCOMPAT + * @page CompCalEventSetSubjectPage Compatibility for SetSubject() + * @section CompCalEventSetSubjectPageIssueSection Issues + * Implementing this method in OSP compatible applications has the following issues: @n + * -# If the length of the subject to be set is greater than @c 100 characters, @c E_INVALID_ARG is returned. + * + * @section CompCalEventSetSubjectPageSolutionSection Resolutions + * This issue has been resolved in Tizen. @n + * -# There is no limit for the length of the subject. + * @endif + */ + + /** + * Sets the description of the current calendar event. + * + * @if OSPCOMPAT + * @brief [Compatibility] + * @endif + * @since 2.0 + * @if OSPCOMPAT + * @compatibility This method has compatibility issues with OSP compatible applications. @n + * For more information, see @ref CompCalEventSetDescriptionPage "here". + * @endif + * + * @return An error code + * @param[in] description The description of the event + * @exception E_SUCCESS The method is successful. + */ + result SetDescription(const Tizen::Base::String& description); + + /** + * @if OSPCOMPAT + * @page CompCalEventSetDescriptionPage Compatibility for SetDescription() + * @section CompCalEventSetDescriptionPageIssueSection Issues + * Implementing this method in OSP compatible applications has the following issues: @n + * -# If the length of the description to be set is greater than @c 1000 characters, @c E_INVALID_ARG is returned. + * + * @section CompCalEventSetDescriptionPageSolutionSection Resolutions + * This issue has been resolved in Tizen. @n + * -# There is no limit for the length of the description. + * @endif + */ + + /** + * Sets the start and end date and time of the calendar event. @n + * If the start date and time is not fixed, the default date and time are set. @n + * The default start date and time is the current date and time. @n + * The start date and time must be earlier than or equal to the end date and time. @n + * If the recurrence date is already set, this method returns an exception. + * + * @since 2.0 + * + * @return An error code + * @param[in] startDateTime The start date and time @n Any value with a unit that is less than a second is ignored. + * @param[in] endDateTime The end date and time @n Any value with a unit that is less than a second is ignored. + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The specified @c endDateTime value is earlier than the specified @c startDateTime value. + * - The specified @c startDateTime or @c endDateTime is out of the valid range. @n + * The valid range of the date can be referenced from GetMaxDateTime() and GetMinDateTime(). + * @exception E_INVALID_CONDITION The recurrence date is already set. + * @remarks + * - The start and end time of all day events created from the base applications is the local time of the location where + * they are added. @n + * All the other events are in Coordinated Universal Time (UTC). @n + * In order to integrate it with the base applications, set the start and end time properly according to the above guidelines. @n + * If the seconds value of the start time is set, the alarm will not be fired. + * - There is no automatic time conversion based on the time zone property of the calendar event. + */ + result SetStartAndEndTime(const Tizen::Base::DateTime& startDateTime, const Tizen::Base::DateTime& endDateTime); + + /** + * Sets the location of the current calendar event. + * + * @if OSPCOMPAT + * @brief [Compatibility] + * @endif + * @since 2.0 + * @if OSPCOMPAT + * @compatibility This method has compatibility issues with OSP compatible applications. @n + * For more information, see @ref CompCalEventSetLocationPage "here". + * @endif + * + * @return An error code + * @param[in] location The location of the event + * @exception E_SUCCESS The method is successful. + */ + result SetLocation(const Tizen::Base::String& location); + + /** + * @if OSPCOMPAT + * @page CompCalEventSetLocationPage Compatibility for SetLocation() + * @section CompCalEventSetLocationPageIssueSection Issues + * Implementing this method in OSP compatible applications has the following issues: @n + * -# If the length of the location to be set is greater than @c 100 characters, @c E_INVALID_ARG is returned. + * + * @section CompCalEventSetLocationPageSolutionSection Resolutions + * This issue has been resolved in Tizen. @n + * -# There is no limit for the length of the location. + * @endif + */ + + /** + * @cond OSPDEPREC + * Sets the category of the calendar event. @n + * If the category is not set, the default category (#EVENT_CATEGORY_APPOINTMENT) is set. + * + * @if OSPCOMPAT + * @brief [Deprecated] [Compatibility] + * @endif + * @deprecated This method is deprecated because the category of the event is not used any more. + * @since 2.0 + * @if OSPCOMPAT + * @compatibility This method has compatibility issues with OSP compatible applications. @n + * For more information, see @ref CompCalEventSetCategoryPage "here". + * @endif + * + * @param[in] category The category of the event + * @remarks The start and end time of the anniversary and all day events created from the base applications, is the local time of the location where + * they are added. + * All the other events are Coordinated Universal Time (UTC). + * In order to integrate it with the base applications, set the start and end time properly according to the above guidelines. + * @endcond + */ + void SetCategory(EventCategory category); + + /** + * @if OSPCOMPAT + * @page CompCalEventSetCategoryPage Compatibility for SetCategory() + * @section CompCalEventSetCategoryPageIssueSection Issues + * Implementing this method in OSP compatible applications has the following issues: @n + * + * -# When the anniversary category is set to the event, it is handled as an all day event even though the all day event property is not set. + * + * @section CompCalEventSetCategoryPageSolutionSection Resolutions + * + * This issue has been resolved in Tizen. @n + * -# The category property is deprecated and it is not used any more. + * In Tizen, the all day event property is set simultaneously when the anniversary category is set to the event. + * If an application tries to change the all day event property of the anniversary event to @c false, it is not changed. + * @endif + */ + + /** + * Sets the sensitivity of the calendar event. + * + * @since 2.0 + * + * @param[in] sensitivity The sensitivity of the calendar event + */ + void SetSensitivity(RecordSensitivity sensitivity); + + /** + * Sets the coordinates. + * + * @since 2.0 + * + * @return An error code + * @param[in] latitude The latitude within the range @n The valid range is [-90.0, 90.0]. + * @param[in] longitude The longitude within the range @n The valid range is [-180.0, 180.0]. + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c latitude or @c longitude is outside the valid range. + */ + result SetCoordinates(double latitude, double longitude); + + /** + * Gets the coordinates. + * + * @since 2.0 + * + * @return An error code + * @param[out] latitude The latitude + * @param[out] longitude The longitude + */ + void GetCoordinates(double& latitude, double& longitude) const; + + /** + * @if OSPDEPREC + * Sets the reminder of the calendar event. + * + * @brief [Deprecated] + * @deprecated This method is deprecated. Instead of using this method, it is recommended to use AddReminder() and RemoveReminderAt(). + * @since 2.0 + * + * @return An error code + * @param[in] pReminder The reminder to set, @n + * else @c null to remove the previous reminder + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_MEMORY The memory is insufficient. + * @endif + */ + result SetReminder(const Reminder* pReminder); + + /** + * Sets the recurrence of the calendar event. @n + * The recurrence rule date must be equal to the start date of the event. @n + * If the event start date is different than the recurrence rule date, the event start date is set to match the recurrence rule date. @n + * For example, if an event start date is 17/02/2010, that is Wednesday and the recurrence rule date is Thursday of every week, + * the event start date changes to 18/02/2010, after this method is called. @n + * Note that the start/end date and the time zone must be set before setting a recurrence. + * + * @if OSPCOMPAT + * @brief [Compatibility] + * @endif + * @since 2.0 + * @if OSPCOMPAT + * @compatibility This method has compatibility issues with OSP compatible applications. @n + * For more information, see @ref CompCalEventSetRecurrencePage "here". + * @endif + * + * @return An error code + * @param[in] pRecurrence The recurrence to set, @n + * else @c null to remove the previous recurrence + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_STATE The current event is a %CalEvent instance that has a recurrence ID. + * @exception E_INVALID_CONDITION Either of the following conditions has occurred: + * - The recurrence rule date is earlier than the start date and time of the event. + * - The recurrence rule is invalid. + * - The duration of the event is too long. @n + * It must be shorter than the (interval x frequency) days set for the recurrence rule. + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - When the frequency is #FREQ_WEEKLY, DayOfWeek is not set. + * - When the frequency is #FREQ_MONTHLY, neither DayOfMonth nor DayOfWeek and WeekOfMonth are set. + * - When the frequency is #FREQ_YEARLY, neither DayOfMonth and MonthOfYear nor DayOfWeek, + * WeekOfMonth and MonthOfYear are set. + * - When the frequency is #FREQ_YEARLY and MonthOfYear is @c 2, DayOfMonth is greater than @c 29 (> 29). + * - When the frequency is #FREQ_YEARLY and MonthOfYear is @c 4, @c 6, @c 9 or @c 11, + * DayOfMonth is greater than @c 30 (> 30). + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks If the until property of the recurrence is set too far from the event's start date, @n + * too many recurring events are generated. It is the same when the value of the recurrence count is large. @n + * The system limits the count of the recurring events that are generated by the recurrence rule of an event. @n + * In this case, some recurring events that exceed the system limitation cannot be retrieved. + * + * The following example demonstrates how to use the %SetRecurrence() method. + * @code + MyClass::SetEventRecurrence(void) + { + result r = E_SUCCESS; + Recurrence* pRecurrence = new Recurrence(); + + pRecurrence->SetFrequency(FREQ_WEEKLY); + pRecurrence->SetDayOfWeek(CAL_MONDAY); + + r = __pCalEvent->SetRecurrence(pRecurrence); + + delete pRecurrence; + } + * @endcode + */ + result SetRecurrence(const Recurrence* pRecurrence); + + /** + * @if OSPCOMPAT + * @page CompCalEventSetRecurrencePage Compatibility for SetRecurrence() + * @section CompCalEventSetRecurrencePageIssueSection Issues + * Implementing this method in OSP compatible applications has the following issues: @n + * - If the category is anniversary and the frequency of recurrence is not yearly, @c E_TYPE_MISMATCH exception is returned. @n + * Yearly frequency is only accepted for the anniversary category. + * + * @section CompCalEventSetRecurrencePageSolutionSection Resolutions + * This issue has been resolved in Tizen. @n + * -# All recurrence frequencies are accepted because the category of the event is not used any more. + * @endif + */ + + /** + * Adds a reminder. + * + * @since 2.0 + * + * @return An error code + * @param[in] reminder The reminder to add + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_MEMORY The memory is insufficient. + */ + result AddReminder(const Reminder& reminder); + + /** + * Removes a reminder at the index. + * + * @since 2.0 + * + * @return An error code + * @param[in] index The index of the reminder to remove + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE Either of the following conditions has occurred: + * - The specified @c index is either greater than or equal to the number of reminders. + * - The specified @c index is less than @c 0. + */ + result RemoveReminderAt(int index); + + /** + * Gets the list of reminders. + * + * @since 2.0 + * + * @return The list that contains Reminder instances, @n + * else an empty list if there are no reminders + */ + const Tizen::Base::Collection::IList& GetAllReminders(void) const; + + /** + * Gets the ID of the calendar to which this event belongs. + * + * @since 2.0 + * + * @return The calendar Id + */ + RecordId GetCalendarId(void) const; + + /** + * Gets the base event ID. + * This method returns the ID of the base recurring event for which this event is a recurrence exception. + * + * @since 2.1 + * + * @return The base event ID, if this event is an exception + * else #INVALID_RECORD_ID + */ + RecordId GetBaseEventId(void) const; + + /** + * Copying of objects using this copy assignment operator is allowed. + * + * @since 2.0 + * + * @param[in] rhs An instance of %CalEvent to copy + */ + CalEvent& operator =(const CalEvent& rhs); + +private: + friend class _CalEventImpl; + class _CalEventImpl* __pCalEventImpl; +}; // CalEvent + +}} // Tizen::Social + +#endif // _FSCL_CAL_EVENT_H_ diff --git a/inc/FSclCalEventChangeInfo.h b/inc/FSclCalEventChangeInfo.h new file mode 100644 index 0000000..13ad34c --- /dev/null +++ b/inc/FSclCalEventChangeInfo.h @@ -0,0 +1,143 @@ +// +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// 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. +// +/** + * @file FSclCalEventChangeInfo.h + * @brief This is the header file for the %CalEventChangeInfo class. + * + * This header file contains the declarations of the %CalEventChangeInfo class. + */ +#ifndef _FSCL_CAL_EVENT_CHANGE_INFO_H_ +#define _FSCL_CAL_EVENT_CHANGE_INFO_H_ + +#include +#include + +namespace Tizen { namespace Social +{ + +/** + * @class CalEventChangeInfo + * @brief This class represents the calendar event change information. + * + * @since 2.0 + * + * @final This class is not intended for extension. + * + * The %CalEventChangeInfo class represents the change information of an event that is managed in the calendarbook. + */ +class _OSP_EXPORT_ CalEventChangeInfo + : public Tizen::Base::Object +{ +public: + /** + * This is the default constructor for this class. + * + * @since 2.0 + */ + CalEventChangeInfo(void); + + /** + * Copying of objects using this copy constructor is allowed. + * + * @since 2.0 + * + * @param[in] rhs An instance of %CalEventChangeInfo to copy + */ + CalEventChangeInfo(const CalEventChangeInfo& rhs); + + /** + * This destructor overrides Tizen::Base::Object::~Object(). + * + * @since 2.0 + */ + virtual ~CalEventChangeInfo(void); + + /** + * Compares the specified Tizen::Base::Object with the current %CalEventChangeInfo instance. + * + * @since 2.0 + * + * @return @c true if the specified object equals the current %CalEventChangeInfo instance, @n + * else @c false + * @param[in] rhs The object instance to compare with the current object + * @see GetHashCode() + */ + virtual bool Equals(const Tizen::Base::Object& rhs) const; + + /** + * Gets the hash value of the current instance. + * + * @since 2.0 + * + * @return The hash value of the current instance + */ + virtual int GetHashCode(void) const; + + /** + * Gets the change type. + * + * @since 2.0 + * + * @return The change type + */ + RecordChangeType GetChangeType(void) const; + + /** + * Gets the changed event ID. + * + * @since 2.0 + * + * @return The changed event ID + */ + RecordId GetEventId(void) const; + + /** + * Gets the calendar ID to which the changed event belongs. + * + * @since 2.0 + * + * @return The calendar ID to which the changed event belongs + */ + RecordId GetCalendarId(void) const; + + /** + * Gets the version of the change. + * + * @since 2.0 + * + * @return The version of the change + */ + int GetVersion(void) const; + + /** + * Copying of objects using this copy assignment operator is allowed. + * + * @since 2.0 + * + * @param[in] rhs An instance of %CalEventChangeInfo to copy + */ + CalEventChangeInfo& operator =(const CalEventChangeInfo& rhs); + +private: + friend class _CalEventChangeInfoImpl; + class _CalEventChangeInfoImpl* __pCalEventChangeInfoImpl; + +}; // CalEventChangeInfo + +}} // Tizen::Social + +#endif // _FSCL_CAL_EVENT_CHANGE_INFO_H_ + diff --git a/inc/FSclCalEventInstance.h b/inc/FSclCalEventInstance.h new file mode 100644 index 0000000..a439128 --- /dev/null +++ b/inc/FSclCalEventInstance.h @@ -0,0 +1,242 @@ +// +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// 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. +// +/** + * @file FSclCalEventInstance.h + * @brief This is the header file for the %CalEventInstance class. + * + * This header file contains the declarations of the %CalEventInstance class. + */ +#ifndef _FSCL_CAL_EVENT_INSTANCE_H_ +#define _FSCL_CAL_EVENT_INSTANCE_H_ + +#include +#include + +namespace Tizen { namespace Base +{ +class String; +class DateTime; +}} + +namespace Tizen { namespace Social +{ + +/** + * @class CalEventInstance + * @brief This class represents the instance of a calendar book event. + * + * @since 2.0 + * + * @final This class is not intended for extension. + * + * The %CalEventInstance class represents the instance of a calendar book event. + */ +class _OSP_EXPORT_ CalEventInstance + : public Tizen::Base::Object +{ + +public: + /** + * This is the default constructor for this class. + * + * @since 2.0 + */ + CalEventInstance(void); + + /** + * Copying of objects using this copy constructor is allowed. + * + * @since 2.0 + * + * @param[in] rhs An instance of %CalEventInstance to copy + */ + CalEventInstance(const CalEventInstance& rhs); + + /** + * This destructor overrides Tizen::Base::Object::~Object(). + * + * @since 2.0 + */ + virtual ~CalEventInstance(void); + + /** + * Compares the specified Tizen::Base::Object with the current %CalEventInstance instance. + * + * @since 2.0 + * + * @return @c true if the specified object equals the current %CalEventInstance instance, @n + * else @c false + * @param[in] rhs The object instance to compare with the current object + * @see GetHashCode() + */ + virtual bool Equals(const Tizen::Base::Object& rhs) const; + + /** + * Gets the hash value of the current instance. + * + * @since 2.0 + * + * @return The hash value of the current instance + */ + virtual int GetHashCode(void) const; + + /** + * Gets the original event ID. + * + * @since 2.0 + * + * @return The original event ID + */ + RecordId GetOriginalEventId(void) const; + + /** + * Gets the calendar ID. + * + * @since 2.0 + * + * @return The calendar ID + */ + RecordId GetCalendarId(void) const; + + /** + * Gets the start time. + * + * @since 2.0 + * + * @return The start time + */ + Tizen::Base::DateTime GetStartTime(void) const; + + /** + * Gets the end time. + * + * @since 2.0 + * + * @return The end time + */ + Tizen::Base::DateTime GetEndTime(void) const; + + /** + * Gets the subject. + * + * @since 2.0 + * + * @return The subject + */ + Tizen::Base::String GetSubject(void) const; + + /** + * Gets the description. + * + * @since 2.0 + * + * @return The description + */ + Tizen::Base::String GetDescription(void) const; + + /** + * Gets the location. + * + * @since 2.0 + * + * @return The location + */ + Tizen::Base::String GetLocation(void) const; + + /** + * Checks whether the original event of this instance is an all day event. + * + * @since 2.0 + * + * @return @c true if the original event of this instance is an all day event, @n + * else @c false + */ + bool IsAllDayEvent(void) const; + + /** + * Gets the busy status. + * + * @since 2.0 + * + * @return The busy status + */ + BusyStatus GetBusyStatus(void) const; + + /** + * Gets the event status. + * + * @since 2.0 + * + * @return The event status + */ + EventStatus GetStatus(void) const; + + /** + * Gets the priority. + * + * @since 2.0 + * + * @return The priority + */ + EventPriority GetPriority(void) const; + + /** + * Gets the sensitivity. + * + * @since 2.0 + * + * @return The sensitivity + */ + RecordSensitivity GetSensitivity(void) const; + + /** + * Checks whether the event instance has a recurring pattern. + * + * @since 2.0 + * + * @return @c true if the event instance has a recurring pattern, @n + * else @c false + */ + bool IsRecurring(void) const; + + /** + * Checks whether the event instance has reminders. + * + * @since 2.0 + * + * @return @c true if the event instance has reminders, @n + * else @c false + */ + bool HasReminder(void) const; + + /** + * Copying of objects using this copy assignment operator is allowed. + * + * @since 2.0 + * + * @param[in] rhs An instance of %CalEventInstance to copy + */ + CalEventInstance& operator =(const CalEventInstance& rhs); + +private: + friend class _CalEventInstanceImpl; + class _CalEventInstanceImpl* __pCalEventInstanceImpl; +}; // CalEventInstance + +}} // Tizen::Social + +#endif // _FSCL_CAL_EVENT_INSTANCE_H_ + diff --git a/inc/FSclCalTodo.h b/inc/FSclCalTodo.h new file mode 100644 index 0000000..fcd7653 --- /dev/null +++ b/inc/FSclCalTodo.h @@ -0,0 +1,467 @@ +// +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// 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. +// +/** + * @file FSclCalTodo.h + * @brief This is the header file for the %CalTodo class. + * + * This header file contains the declarations of the %CalTodo class. + */ +#ifndef _FSCL_CAL_TODO_H_ +#define _FSCL_CAL_TODO_H_ + +#include +#include +#include +#include + +namespace Tizen { namespace Base +{ +class String; +class DateTime; + +namespace Collection +{ +class IList; +} +}} + +namespace Tizen { namespace Social +{ + +class Reminder; + +/** + * @class CalTodo + * @brief This class represents the calendar book to-do information. + * + * @since 2.0 + * + * @final This class is not intended for extension. + * + * The %CalTodo class is a subset of vTodo. An instance of %CalTodo includes the subject, description, start date, due date, location, sensitivity, + * priority, and status. + * This class represents the information of a calendar book to-do. + * + * For more information on the class features, see Calendar Tasks. + * + */ +class _OSP_EXPORT_ CalTodo + : public Record +{ +public: + /** + * This is the default constructor for this class. + * + * @since 2.0 + */ + CalTodo(void); + + /** + * Copying of objects using this copy constructor is allowed. + * + * @since 2.0 + * + * @param[in] rhs An instance of %CalTodo to copy + */ + CalTodo(const CalTodo& rhs); + + /** + * This destructor overrides Tizen::Social::Record::~Record(). + * + * @since 2.0 + */ + virtual ~CalTodo(void); + + /** + * Compares the specified Tizen::Base::Object with the current %CalTodo instance. + * + * @since 2.0 + * + * @return @c true if the specified object equals the current %CalTodo instance, @n + * else @c false + * @param[in] rhs The object instance to compare with the current object + * @see GetHashCode() + */ + virtual bool Equals(const Tizen::Base::Object& rhs) const; + + /** + * Gets the hash value of the current instance. + * + * @since 2.0 + * + * @return The hash value of the current instance + */ + virtual int GetHashCode(void) const; + + /** + * Gets the subject of the current instance of %CalTodo. + * + * @since 2.0 + * + * @return The subject + */ + Tizen::Base::String GetSubject(void) const; + + /** + * Gets the description of the current instance of %CalTodo. + * + * @since 2.0 + * + * @return The description + */ + Tizen::Base::String GetDescription(void) const; + + /** + * Gets the start date of the current instance of %CalTodo. + * + * @since 2.0 + * + * @return The start date, @n + * the minimum value of Tizen::Base::DateTime, if the start date has been not set + * @exception E_SUCCESS The method is successful. + * @exception E_DATA_NOT_FOUND The start date has been not set. + * @remarks + * - The specific error code can be accessed using the GetLastResult() method. + * - The minimum value can be acquired using Tizen::Base::DateTime::GetMinValue(). + */ + Tizen::Base::DateTime GetStartDate(void) const; + + /** + * Gets the due date of the current instance of %CalTodo. + * + * @since 2.0 + * + * @return The due date, @n + * the minimum value of Tizen::Base::DateTime, if the due date has been not set + * @exception E_SUCCESS The method is successful. + * @exception E_DATA_NOT_FOUND The due date has been not set. + * @remarks + * - The specific error code can be accessed using the GetLastResult() method. + * - The minimum value can be acquired using Tizen::Base::DateTime::GetMinValue(). + */ + Tizen::Base::DateTime GetDueDate(void) const; + + /** + * Gets the priority level of the current instance of %CalTodo. @n + * The default priority level is #TODO_PRIORITY_LOW. + * + * @since 2.0 + * + * @return The priority level + */ + TodoPriority GetPriority(void) const; + + /** + * Gets the status of the current instance of %CalTodo. @n + * The default status is #TODO_STATUS_NONE. + * + * @since 2.0 + * + * @return The to-do status + */ + TodoStatus GetStatus(void) const; + + /** + * Gets the sensitivity of the current instance of %CalTodo. @n + * The default value is #SENSITIVITY_PUBLIC. + * + * @since 2.0 + * + * @return The to-do sensitivity + */ + RecordSensitivity GetSensitivity(void) const; + + /** + * Gets the last updated date and time of the current instance of %CalTodo. + * + * @since 2.0 + * + * @return The last updated date and time + */ + Tizen::Base::DateTime GetLastRevisedTime(void) const; + + /** + * Sets the subject of the current instance of %CalTodo. + * + * @if OSPCOMPAT + * @brief [Compatibility] + * @endif + * @since 2.0 + * @if OSPCOMPAT + * @compatibility This method has compatibility issues with OSP compatible applications. @n + * For more information, see @ref CompCalTodoSetSubjectPage "here". + * @endif + * + * @return An error code + * @param[in] subject The to-do subject + * @exception E_SUCCESS The method is successful. + */ + result SetSubject(const Tizen::Base::String& subject); + + /** + * @if OSPCOMPAT + * @page CompCalTodoSetSubjectPage Compatibility for SetSubject() + * @section CompCalTodoSetSubjectPageIssueSection Issues + * Implementing this method in OSP compatible applications has the following issues: @n + * -# If the length of the subject to be set is greater than @c 100 characters, @c E_INVALID_ARG is returned. + * + * @section CompCalTodoSetSubjectPageSolutionSection Resolutions + * This issue has been resolved in Tizen. @n + * -# There is no limit for the length of the subject. + * @endif + */ + + /** + * Sets the description of the current instance of %CalTodo. + * + * @if OSPCOMPAT + * @brief [Compatibility] + * @endif + * @since 2.0 + * @if OSPCOMPAT + * @compatibility This method has compatibility issues with OSP compatible applications. @n + * For more information, see @ref CompCalTodoSetDescriptionPage "here". + * @endif + * + * @return An error code + * @param[in] description The to-do description, @n + * else @c null to remove the existing value + * @exception E_SUCCESS The method is successful. + */ + result SetDescription(const Tizen::Base::String& description); + + /** + * @if OSPCOMPAT + * @page CompCalTodoSetDescriptionPage Compatibility for SetDescription() + * @section CompCalTodoSetDescriptionPageIssueSection Issues + * Implementing this method in OSP compatible applications has the following issues: @n + * -# If the length of the description to be set is greater than @c 1000 characters, @c E_INVALID_ARG is returned. + * + * @section CompCalTodoSetDescriptionPageSolutionSection Resolutions + * This issue has been resolved in Tizen. @n + * -# There is no limit for the length of the description. + * @endif + */ + + /** + * @cond OSPDEPREC + * Sets the start date and due date for the current instance of %CalTodo. @n + * The due date must be later than or equal to the start date. + * + * @if OSPCOMPAT + * @brief [Deprecated] [Compatibility] + * @endif + * @deprecated This method is deprecated. Instead of using this method, it is recommended to use SetStartDate() and SetDueDate(). + * @since 2.0 + * @if OSPCOMPAT + * @compatibility This method has compatibility issues with OSP compatible applications. @n + * For more information, see @ref CompCalTodoSetStartAndDueDatePage "here". + * @endif + * + * @return An error code + * @param[in] startDate The start date. @n Any value with a unit that is less than a second is ignored. + * @param[in] dueDate The due date. @n Any value with a unit that is less than a second is ignored. + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The specified @c dueDate is earlier than the specified @c startDate. + * - The specified @c startDate or @c dueDate is not a valid range. @n + * The valid range of the date can be referenced from GetMaxDateTime() and GetMinDateTime(). + * @endcond + */ + result SetStartAndDueDate(const Tizen::Base::DateTime& startDate, const Tizen::Base::DateTime& dueDate); + + /** + * @if OSPCOMPAT + * @page CompCalTodoSetStartAndDueDatePage Compatibility for SetStartAndDueDate() + * @section CompCalTodoSetStartAndDueDatePageIssueSection Issues + * Implementing this method in OSP compatible applications has the following issues: @n + * -# The start and due date cannot be unset. And if the SetStartAndDueDate() is not called, the default start and due date @n + * are set to the system time when the to-do is constructed. + * + * @section CompCalTodoSetStartAndDueDatePageSolutionSection Resolutions + * This issue has been resolved in Tizen. @n + * -# The default start and due date of the to-do is unset. + * @endif + */ + + /** + * Sets the start date for the current instance of %CalTodo. @n + * If the @c startDate is the minimum value of Tizen::Base::DateTime, the start date is changed to unset. @n + * And if the start date is later than the due date, the due date is changed to unset. + * + * @since 2.0 + * + * @return An error code + * @param[in] startDate The start date. @n Any value with a unit that is less than a second is ignored. + * @exception E_SUCCESS The method is successful. @n + * The specified @c startDate is between Calendarbook::GetMaxDateTime() and Calendarbook::GetMinDateTime(). @n + * @c startDate is the minimum value of Tizen::Base::DateTime to unset the start date. + * @exception E_INVALID_ARG The specified @c startDate is invalid. + * @remarks The minimum value can be acquired using Tizen::Base::DateTime::GetMinValue(). + */ + result SetStartDate(const Tizen::Base::DateTime& startDate); + + /** + * Sets the end date for the current instance of %CalTodo. @n + * If the @c dueDate is the minimum value of Tizen::Base::DateTime, the due date is changed to unset. @n + * And if the due date is earlier than the start date, the start date is changed to unset. + * + * @since 2.0 + * + * @return An error code + * @param[in] dueDate The due date. @n Any value with a unit that is less than a second is ignored. + * @exception E_SUCCESS The method is successful. @n + * The specified @c dueDate is between Calendarbook::GetMaxDateTime() and Calendarbook::GetMinDateTime(). @n + * @c dueDate is the minimum value of Tizen::Base::DateTime to unset the due date. + * @exception E_INVALID_ARG The specified @c dueDate is invalid. + * @remarks The minimum value can be acquired using Tizen::Base::DateTime::GetMinValue(). + */ + result SetDueDate(const Tizen::Base::DateTime& dueDate); + + + /** + * Sets the priority level of the current instance of %CalTodo. + * + * @since 2.0 + * + * @param[in] priority The priority level to set + */ + void SetPriority(TodoPriority priority); + + /** + * Sets the status of the current instance of %CalTodo. + * + * @since 2.0 + * + * @param[in] status The status to set + */ + void SetStatus(TodoStatus status); + + /** + * Sets the sensitivity of the current instance of %CalTodo. + * + * @since 2.0 + * + * @param[in] sensitivity The sensitivity to set + */ + void SetSensitivity(RecordSensitivity sensitivity); + + /** + * Sets the location of the current calendar event. + * + * @since 2.0 + * + * @return An error code + * @param[in] location The location of the event + */ + void SetLocation(const Tizen::Base::String& location); + + /** + * Gets the location of the calendar event. + * + * @since 2.0 + * + * @return The location + */ + Tizen::Base::String GetLocation(void) const; + + /** + * Sets the coordinates. + * + * @since 2.0 + * + * @return An error code + * @param[in] latitude The latitude within the range @n The valid range is [-90.0, 90.0]. + * @param[in] longitude The longitude within the range @n The valid range is [-180.0, 180.0]. + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c latitude or @c longitude is out of the valid range. + */ + result SetCoordinates(double latitude, double longitude); + + /** + * Gets the coordinates. + * + * @since 2.0 + * + * @return An error code + * @param[out] latitude The latitude + * @param[out] longitude The longitude + */ + + void GetCoordinates(double& latitude, double& longitude) const; + + /** + * Adds a reminder. + * + * @since 2.0 + * + * @return An error code + * @param[in] reminder The reminder to add + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_MEMORY The memory is insufficient. + */ + result AddReminder(const Reminder& reminder); + + /** + * Removes the reminder at the specified index. + * + * @since 2.0 + * + * @return An error code + * @param[in] index The index of the reminder to remove + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE Either of the following conditions has occurred: + * - The specified @c index is either greater than or equal to the number of reminders. + * - The specified @c index is less than @c 0. + */ + result RemoveReminderAt(int index); + + /** + * Gets a list of reminders. + * + * @since 2.0 + * + * @return The list that contains the Reminder instances, @n + * else an empty list if there are no reminders + */ + const Tizen::Base::Collection::IList& GetAllReminders(void) const; + + /** + * Gets the ID of the calendar to which this to-do belongs. + * + * @since 2.0 + * + * @return The calendar ID + */ + RecordId GetCalendarId(void) const; + + /** + * Copying of objects using this copy assignment operator is allowed. + * + * @since 2.0 + * + * @param[in] rhs An instance of %CalTodo to copy + */ + CalTodo& operator =(const CalTodo& rhs); + +private: + friend class _CalTodoImpl; + class _CalTodoImpl* __pCalTodoImpl; +}; // CalTodo + +}} // Tizen::Social + +#endif // _FSCL_CAL_TODO_H_ diff --git a/inc/FSclCalTodoChangeInfo.h b/inc/FSclCalTodoChangeInfo.h new file mode 100644 index 0000000..8d445a6 --- /dev/null +++ b/inc/FSclCalTodoChangeInfo.h @@ -0,0 +1,143 @@ +// +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// 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. +// +/** + * @file FSclCalTodoChangeInfo.h + * @brief This is the header file for the %CalTodoChangeInfo class. + * + * This header file contains the declarations of the %CalTodoChangeInfo class. + */ +#ifndef _FSCL_CAL_TODO_CHANGE_INFO_H_ +#define _FSCL_CAL_TODO_CHANGE_INFO_H_ + +#include +#include + +namespace Tizen { namespace Social +{ + +/** + * @class CalTodoChangeInfo + * @brief This class represents the calendar to-do change information. + * + * @since 2.0 + * + * @final This class is not intended for extension. + * + * The %CalTodoChangeInfo class represents the change information of a to-do that is managed in a calendarbook. + */ +class _OSP_EXPORT_ CalTodoChangeInfo + : public Tizen::Base::Object +{ +public: + /** + * This is the default constructor for this class. + * + * @since 2.0 + */ + CalTodoChangeInfo(void); + + /** + * Copying of objects using this copy constructor is allowed. + * + * @since 2.0 + * + * @param[in] rhs An instance of %CalTodoChangeInfo to copy + */ + CalTodoChangeInfo(const CalTodoChangeInfo& rhs); + + /** + * This destructor overrides Tizen::Base::Object::~Object(). + * + * @since 2.0 + */ + virtual ~CalTodoChangeInfo(void); + + /** + * Compares the specified Tizen::Base::Object with the current %CalTodoChangeInfo instance. + * + * @since 2.0 + * + * @return @c true if the specified object equals the current %CalTodoChangeInfo instance, @n + * else @c false + * @param[in] rhs The object instance to compare with the current object + * @see GetHashCode() + */ + virtual bool Equals(const Tizen::Base::Object& rhs) const; + + /** + * Gets the hash value of the current instance. + * + * @since 2.0 + * + * @return The hash value of the current instance + */ + virtual int GetHashCode(void) const; + + /** + * Gets the change type. + * + * @since 2.0 + * + * @return The change type + */ + RecordChangeType GetChangeType(void) const; + + /** + * Gets the changed to-do ID. + * + * @since 2.0 + * + * @return The changed to-do ID + */ + RecordId GetTodoId(void) const; + + /** + * Gets the calendar ID to which the changed to-do belongs. + * + * @since 2.0 + * + * @return The calendar ID to which the changed to-do belongs + */ + RecordId GetCalendarId(void) const; + + /** + * Gets the version of the change. + * + * @since 2.0 + * + * @return The version of the change + */ + int GetVersion(void) const; + + /** + * Copying of objects using this copy assignment operator is allowed. + * + * @since 2.0 + * + * @param[in] rhs An instance of %CalTodoChangeInfo to copy + */ + CalTodoChangeInfo& operator =(const CalTodoChangeInfo& rhs); + +private: + friend class _CalTodoChangeInfoImpl; + class _CalTodoChangeInfoImpl* __pCalTodoChangeInfoImpl; + +}; // CalTodoChangeInfo + +}} // Tizen::Social + +#endif // _FSCL_CAL_TODO_CHANGE_INFO_H_ + diff --git a/inc/FSclCalendar.h b/inc/FSclCalendar.h new file mode 100644 index 0000000..237142e --- /dev/null +++ b/inc/FSclCalendar.h @@ -0,0 +1,184 @@ +// +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// 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. +// +/** + * @file FSclCalendar.h + * @brief This is the header file for the %Calendar class. + * + * This header file contains the declarations of the %Calendar class. + */ +#ifndef _FSCL_CALENDAR_H_ +#define _FSCL_CALENDAR_H_ + +#include +#include +#include + +namespace Tizen { namespace Base +{ +class Object; +class String; +}} + +namespace Tizen { namespace Social +{ + +/** + * @class Calendar + * @brief This class represents calendar information. + * + * @since 2.0 + * + * @final This class is not intended for extension. + * + * The %Calendar class represents calendar information. @n + * Multiple calendars can be created, each of which can have their own events and to-dos. An event or to-do can be retrieved using the respective calendar ID. + */ +class _OSP_EXPORT_ Calendar + : public Record +{ +public: + /** + * This is the default constructor for this class. + * + * @since 2.0 + * + * @param[in] itemType The calendar item type to specify which kind of item the calendar can contain + */ + explicit Calendar(CalendarItemType itemType); + + /** + * Copying of objects using this copy constructor is allowed. + * + * @since 2.0 + * + * @param[in] rhs An instance of %Calendar to copy + */ + Calendar(const Calendar& rhs); + + /** + * This destructor overrides Tizen::Social::Record::~Record(). + * + * @since 2.0 + */ + virtual ~Calendar(void); + + /** + * Compares the specified Tizen::Base::Object with the current %Calendar instance. + * + * @since 2.0 + * + * @return @c true if the specified object equals the current %Calendar instance, @n + * else @c false + * @param[in] rhs The object instance to compare with the current object + * @see GetHashCode() + */ + virtual bool Equals(const Tizen::Base::Object& rhs) const; + + /** + * Gets the hash value of the current instance. + * + * @since 2.0 + * + * @return The hash value of the current instance + */ + virtual int GetHashCode(void) const; + + /** + * Gets the calendar name. + * + * @since 2.0 + * + * @return The calendar name + */ + Tizen::Base::String GetName(void) const; + + /** + * Gets the calendar item type. + * + * @since 2.0 + * + * @return The calendar item type + */ + CalendarItemType GetItemType(void) const; + + /** + * Gets the account ID. + * + * @since 2.0 + * + * @return The account ID + */ + AccountId GetAccountId(void) const; + + /** + * Gets the calendar color. @n + * If the color has not been set, all color components are set with 0x0 and @c E_DATE_NOT_FOUND exception is returned. + * + * @since 2.0 + * + * @param[out] r The red component + * @param[out] g The green component + * @param[out] b The blue component + * @exception E_SUCCESS The method is successful. + * @exception E_DATA_NOT_FOUND The color has not been set. + */ + result GetColor(byte& r, byte& g, byte& b) const; + + /** + * Sets the calendar name. + * + * @since 2.0 + * + * @param[in] name The calendar name + */ + void SetName(const Tizen::Base::String& name); + + /** + * Sets the calendar color. + * + * @since 2.0 + * + * @param[in] r The red component + * @param[in] g The green component + * @param[in] b The blue component + */ + void SetColor(byte r, byte g, byte b); + + /** + * Clears the calendar color. + * + * @since 2.0 + */ + void ClearColor(void); + + /** + * Copying of objects using this copy assignment operator is allowed. + * + * @since 2.0 + * + * @param[in] rhs An instance of %Calendar to copy + */ + Calendar& operator =(const Calendar& rhs); + +private: + friend class _CalendarImpl; + class _CalendarImpl* __pCalendarImpl; + +}; // Calendar + +}} // Tizen::Social + +#endif // _FSCL_CALENDAR_H_ diff --git a/inc/FSclCalendarbook.h b/inc/FSclCalendarbook.h new file mode 100644 index 0000000..552872f --- /dev/null +++ b/inc/FSclCalendarbook.h @@ -0,0 +1,1310 @@ +// +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// 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. +// +/** + * @file FSclCalendarbook.h + * @brief This is the header file for the %Calendarbook class. + * + * This header file contains the declarations of the %Calendarbook class. + */ +#ifndef _FSCL_CALENDARBOOK_H_ +#define _FSCL_CALENDARBOOK_H_ + +#include +#include +#include +#include +#include +#include +#include + +namespace Tizen { namespace Base +{ +class String; +class DateTime; +namespace Collection +{ +class IList; +} +}} + +namespace Tizen { namespace Locales +{ +class TimeZone; +}} + + +namespace Tizen { namespace Social +{ + +class ICalendarbookEventListener; +class Calendar; +class CalEventInstance; +class CalendarbookFilter; + +/** + * @class Calendarbook + * @brief This class manages calendar data such as events, to-dos, and calendars. + * + * @since 2.0 + * + * @final This class is not intended for extension. + * + * The %Calendarbook class manages calendar data such as events, to-dos, and calendars. + * The calendar book is a centralized database that is used by multiple applications to store events and to-do information. + * A calendar book represents the methods to read, add, remove, and update the events, to-do lists, and calendars stored in the device. + * The users must be notified of changes in the calendar book as multiple applications can share, change, or remove the data. + * + * For more information on the class features, see Calendar book. + * + * The following example demonstrates how to use the %Calendarbook class to add calendarbook event. + * @code + + #include + #include + + using namespace Tizen::Social; + using namespace Tizen::Base; + using namespace Tizen::Locales; + + void + MyCalendarbook::AddEventExample(void) + { + result r = E_SUCCESS; + + DateTime startWallTime; + DateTime endWallTime; + DateTime startUtcTime; + DateTime endUtcTime; + + // Suppose a user set 2012/7/17 12:00:00 ~ 2012/7/17 14:00:00 in wall time for start/end time + startWallTime.SetValue(2012, 7, 17, 12, 0, 0); + endWallTime.SetValue(2012, 7, 17, 14, 0, 0); + + // Gets the system time zone + LocaleManager localeManager; + localeManager.Construct(); + + TimeZone timeZone = localeManager.GetSystemTimeZone(); + + // Converts the wall time to UTC time before set start and end time of the event + startUtcTime = timeZone.WallTimeToUtcTime(startWallTime); + endUtcTime = timeZone.WallTimeToUtcTime(endWallTime); + + // Creates a CalEvent instance + CalEvent newEvent; + newEvent.SetSubject(L"Daily event"); + newEvent.SetStartAndEndTime(startUtcTime, endUtcTime); + + Recurrence dailyRecurrence; + dailyRecurrence.SetFrequency(FREQ_DAILY); + dailyRecurrence.SetCounts(10); + + newEvent.SetRecurrence(&dailyRecurrence); + + // Creates a Calendarbook instance + Calendarbook* pCalendarbook = new Calendarbook(); + r = pCalendarbook->Construct(); + if (IsFailed(r)) + { + AppLogException("initializing the calendar book has failed"); + delete pCalendarbook; + return; + } + + // Adds the event + r = pCalendarbook->AddEvent(newEvent); + if (IsFailed(r)) + { + AppLogException("AddEvent() has failed"); + delete pCalendarbook; + return; + } + + delete pCalendarbook; + } + + * @endcode + * + * The following example demonstrates how to use the %Calendarbook class to update calendarbook event. + * @code + + #include + #include + + using namespace Tizen::Social; + using namespace Tizen::Base; + using namespace Tizen::Locales; + + void + MyCalendarbook::UpdateEventExample(void) + { + result r = E_SUCCESS; + + // This specificEventId should have been set as already added event record ID. + RecordId specificEventId = 0; + + DateTime changedStartWallTime; + DateTime changedEndWallTime; + DateTime changedStartUtcTime; + DateTime changedEndUtcTime; + + // Suppose a user set 2012/7/18 12:00:00 ~ 2012/7/18 14:00:00 in wall time for start/end time. + changedStartWallTime.SetValue(2012, 7, 18, 12, 0, 0); + changedEndWallTime.SetValue(2012, 7, 18, 14, 0, 0); + + // Gets the system time zone. + LocaleManager localeManager; + localeManager.Construct(); + + TimeZone timeZone = localeManager.GetSystemTimeZone(); + + // Converts the wall time to UTC time before set start and end time of the event. + changedStartUtcTime = timeZone.WallTimeToUtcTime(changedStartWallTime); + changedEndUtcTime = timeZone.WallTimeToUtcTime(changedEndWallTime); + + // Creates Calendarbook instance. + Calendarbook* pCalendarbook = new Calendarbook(); + r = pCalendarbook->Construct(); + if (IsFailed(r)) + { + AppLogException("initializing the calendar book has failed"); + delete pCalendarbook; + return; + } + + // Retrieves CalEvent instance. + CalEvent* pEvent = pCalendarbook->GetEventN(specificEventId); + if (pEvent == null) + { + AppLogException("Getting the event has failed"); + delete pCalendarbook; + return; + } + + Recurrence recurrence(*pEvent->GetRecurrence()); + pEvent->SetRecurrence(null); + pEvent->SetStartAndEndTime(changedStartUtcTime, changedEndUtcTime); + pEvent->SetRecurrence(&recurrence); + + // Updates the event. + r = pCalendarbook->UpdateEvent(*pEvent); + if (IsFailed(r)) + { + AppLogException("UpdateEvent() has failed"); + delete pEvent; + delete pCalendarbook; + return; + } + + delete pEvent; + delete pCalendarbook; + } + + * @endcode + * + * The following example demonstrates how to use the %Calendarbook class to retrieve event instance list. + * @code + + #include + #include + + using namespace Tizen::Social; + using namespace Tizen::Base; + using namespace Tizen::Locales; + using namespace Tizen::Base::Collection; + + void + MyCalendarbook::RetrieveEventInstanceExample(void) + { + result r = E_SUCCESS; + + DateTime startRange; + DateTime endRange; + IList* pEventInstanceList = null; + + DateTime startRangeWallTime; + DateTime endRangeWallTime; + DateTime startRangeUtcTime; + DateTime endRangeUtcTime; + + // Suppose a user set 2012/7/1 00:00:00 ~ 2012/7/31 23:59:59 in wall time for start/end time. + startRangeWallTime.SetValue(2012, 7, 1, 0, 0, 0); + endRangeWallTime.SetValue(2012, 7, 31, 23, 59, 59); + + // Gets the system time zone. + LocaleManager localeManager; + localeManager.Construct(); + + TimeZone timeZone = localeManager.GetSystemTimeZone(); + + // Converts the wall time to UTC time before set start and end time of the event. + startRangeUtcTime = timeZone.WallTimeToUtcTime(startRangeWallTime); + endRangeUtcTime = timeZone.WallTimeToUtcTime(endRangeWallTime); + + // Creates Calendarbook instance. + Calendarbook* pCalendarbook = new Calendarbook(); + r = pCalendarbook->Construct(); + if (IsFailed(r)) + { + AppLogException("initializing the calendar book has failed"); + delete pCalendarbook; + return; + } + + // Gets the event instances. + CalendarbookFilter filter(CB_FI_TYPE_NON_ALL_DAY_EVENT_INSTANCE); + filter.AppendDateTime(FI_CONJ_OP_NONE, EVENT_INST_FI_PR_END_TIME, FI_CMP_OP_GREATER_THAN, startRangeUtcTime); + filter.AppendDateTime(FI_CONJ_OP_AND, EVENT_INST_FI_PR_START_TIME, FI_CMP_OP_LESS_THAN, endRangeUtcTime); + + pEventInstanceList = pCalendarbook->SearchN(filter, EVENT_INST_FI_PR_START_TIME, SORT_ORDER_ASCENDING); + if (pEventInstanceList == null) + { + AppLogException("SearchN() is failed"); + delete pCalendarbook; + return; + } + + IEnumerator* pEnum = pEventInstanceList->GetEnumeratorN(); + while (pEnum->MoveNext() == E_SUCCESS) + { + CalEventInstance* pEventInstance = static_cast(pEnum->GetCurrent()); + + // Reads the properties of pEventInstance. + // ... + } + delete pEnum; + + // Removes the first event instance of the list. + CalEventInstance* pExcludingEventInstance = static_cast(pEventInstanceList->GetAt(0)); + r = pCalendarbook->RemoveEventInstance(*pExcludingEventInstance); + if (IsFailed(r)) + { + AppLogException("RemoveEventInstance() has failed"); + pEventInstanceList->RemoveAll(true); + delete pEventInstanceList; + delete pCalendarbook; + return; + } + + pEventInstanceList->RemoveAll(true); + delete pEventInstanceList; + delete pCalendarbook; + } + + * @endcode + */ + +class _OSP_EXPORT_ Calendarbook + : public Tizen::Base::Object +{ +public: + + /** + * The object is not fully constructed after this constructor is called. @n + * For full construction, the Construct() method must be called right after calling this constructor. + * + * @since 2.0 + */ + Calendarbook(void); + + /** + * This destructor overrides Tizen::Base::Object::~Object(). + * + * @since 2.0 + */ + virtual ~Calendarbook(void); + + /** + * @if OSPDEPREC + * Initializes this instance of %Calendarbook with the specified event listener. + * + * @brief [Deprecated] + * @deprecated This method is deprecated. Instead of using this method, it is recommended to use Construct(ICalendarbookEventListener*). + * @since 2.0 + * + * @return An error code + * @param[in] pListener The event listener to register, @n + * else @c null if an event listener need not be registered + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @endif + */ + result Construct(IRecordEventListener* pListener); + + /** + * Initializes this instance of %Calendarbook. + * + * @since 2.0 + * + * @return An error code + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + */ + result Construct(void); + + /** + * Initializes this instance of %Calendarbook with the specified event listener. + * + * @since 2.0 + * + * @return An error code + * @param[in] listener The event listener to register + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + */ + result Construct(ICalendarbookEventListener& listener); + + /** + * Adds an event of the default calendar to the calendar book. @n + * After adding the event successfully, the event has a valid record ID. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/calendar.write + * + * @return An error code + * @param[in,out] event The event to add + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG The specified @c event is invalid. + * @exception E_STORAGE_FULL The storage is insufficient. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + */ + result AddEvent(CalEvent& event); + + /** + * Adds an event of the specific calendar to the calendar book. @n + * After adding the event successfully, the event has a valid record ID. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/calendar.write + * + * @return An error code + * @param[in,out] event The event to add + * @param[in] calendarId The calendar ID + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The specified @c event is invalid. + * - The specified @c calendarId is invalid. + * - The specified calendar does not support a to-do item. + * @exception E_OBJ_NOT_FOUND The specified calendar is not found. + * @exception E_STORAGE_FULL The storage is insufficient. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + */ + result AddEvent(CalEvent& event, RecordId calendarId); + + /** + * Adds a to-do of the default calendar to the calendar book. @n + * After adding the to-do item successfully, the item has a valid record ID. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/calendar.write + * + * @return An error code + * @param[in,out] todo The to-do to add + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG The specified @c todo is invalid. + * @exception E_STORAGE_FULL The storage is insufficient. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + */ + result AddTodo(CalTodo& todo); + + /** + * Adds a to-do of the specific calendar to the calendar book. @n + * After adding the to-do item successfully, the item has a valid record ID. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/calendar.write + * + * @return An error code + * @param[in,out] todo The to-do to add + * @param[in] calendarId The calendar ID + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The specified @c todo is invalid. + * - The specified @c calendarId is invalid. + * - The specified calendar does not support an event item. + * @exception E_OBJ_NOT_FOUND The specified calendar is not found. + * @exception E_STORAGE_FULL The storage is insufficient. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + */ + result AddTodo(CalTodo& todo, RecordId calendarId); + + /** + * Removes the specified calendar event from this calendar book. @n + * After removing the event successfully, the event has #INVALID_RECORD_ID. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/calendar.write + * + * @return An error code + * @param[in] event The calendar event to remove + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG The specified recordId is #INVALID_RECORD_ID. + * @exception E_OBJ_NOT_FOUND The specified record is not found. + * @exception E_INVALID_OPERATION This method cannot be used for the recurrence exception of the recurring event. @n + * RemoveEventInstance() should be used instead of this method. @b Since: @b 2.1 + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + */ + result RemoveEvent(CalEvent& event); + + /** + * Removes the specified calendar event from this calendar book. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/calendar.write + * + * @return An error code + * @param[in] eventId The calendar event ID to remove + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG The specified @c eventId is #INVALID_RECORD_ID. + * @exception E_OBJ_NOT_FOUND The specified record is not found. + * @exception E_INVALID_OPERATION This method cannot be used for the recurrence exception of the recurring event. @n + * RemoveEventInstance() should be used instead of this method. @b Since: @b 2.1 + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + */ + result RemoveEvent(RecordId eventId); + + /** + * Removes the specified CalTodo instance from the calendar book. @n + * After removing the to-do item successfully, the item has #INVALID_RECORD_ID. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/calendar.write + * + * @return An error code + * @param[in] todo The CalTodo ID to remove + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG The specified recordId is #INVALID_RECORD_ID. + * @exception E_OBJ_NOT_FOUND The specified record is not found. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + */ + result RemoveTodo(CalTodo& todo); + + /** + * Removes the specified CalTodo instance from the calendar book. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/calendar.write + * + * @return An error code + * @param[in] todoId The CalTodo ID to remove + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG The specified input parameter is invalid. + * @exception E_OBJ_NOT_FOUND The specified record is not found. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + */ + result RemoveTodo(RecordId todoId); + + /** + * Updates the specified calendar event to the internal data storage. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/calendar.write + * + * @return An error code + * @param[in] event The CalEvent instance to update + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The specified recordId is #INVALID_RECORD_ID. + * - The specified @c event is not #RECORD_TYPE_EVENT. + * - The specified @c event is not an entry type instance. + * - The date of the event is invalid. @n + * The valid range of the date can be referenced from GetMaxDateTime() and GetMinDateTime(). + * @exception E_OBJ_NOT_FOUND The specified record is not found. + * @exception E_INVALID_OPERATION This method cannot be used for the recurrence exception of the recurring event. @n + * UpdateEventInstance() should be used instead of this method. @b Since: @b 2.1 + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + */ + result UpdateEvent(const CalEvent& event); + + /** + * Updates the specified CalTodo instance on the internal data storage. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/calendar.write + * + * @return An error code + * @param[in] todo The CalTodo instance to update + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The specified recordId is #INVALID_RECORD_ID. + * - The date of the to-do item is invalid. @n + * The valid range of the date can be referenced from GetMaxDateTime() and GetMinDateTime(). + * @exception E_OBJ_NOT_FOUND The specified record is not found. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + */ + result UpdateTodo(const CalTodo& todo); + + /** + * Gets the specified event ID that is matched with the RecordId. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/calendar.read + * + * @return The matched event + * @param[in] eventId The event ID to find + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG The specified @c eventId is invalid. + * @exception E_OBJ_NOT_FOUND The specified record is not found. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + CalEvent* GetEventN(RecordId eventId) const; + + /** + * Gets the specified to-do after matching it with the specified record ID. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/calendar.read + * + * @return The matched to-do + * @param[in] todoId The ID of the to-do to find + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG The specified @c todoId is invalid. + * @exception E_OBJ_NOT_FOUND The specified record is not found. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * + */ + CalTodo* GetTodoN(RecordId todoId) const; + + /** + * Gets all the to-do items in the specified time range. @n + * To-do items, whose due date is within the retrieving range, is retrieved. + * + * @if OSPCOMPAT + * @brief [Compatibility] + * @endif + * @since 2.0 + * @if OSPCOMPAT + * @compatibility This method has compatibility issues with OSP compatible applications. @n + * For more information, see @ref CompCalendarbookGetTodosNPage "here". + * @endif + * @privlevel public + * @privilege %http://tizen.org/privilege/calendar.read + * + * @return The list of all the matched CalTodo instances, @n + * else an empty list if there is no matched to-do item @n + * The items are sorted by due date. + * @param[in] start The start of the time range. @n Any value with a unit that is less than a second is ignored. + * @param[in] end The end of the time range. @n Any value with a unit that is less than a second is ignored. + * @param[in] pageNo The page number of the result list @n + * It starts from @c 1. + * @param[in] countPerPage The desired maximum count of the result items per page + * @param[in] status The to-do status @n + * If a specific status is set, the to-dos that have the specified status are returned. @n + * The default status value is #TODO_STATUS_ALL, which means all the statuses are returned. + * @param[in] priority The to-do priority @n + * If a specific priority is set, the to-dos that have the specified priority are returned. @n + * The default priority value is #TODO_PRIORITY_ALL that means all the priorities are returned. + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The specified @c pageNo or @c countPerPage is less than @c 1. + * - The start time is later than the end date. + * - The start or end time is out of the valid range. @n + * The valid range of the date can be referenced from GetMaxDateTime() and GetMinDateTime(). + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + Tizen::Base::Collection::IList* GetTodosN(const Tizen::Base::DateTime& start, const Tizen::Base::DateTime& end, int pageNo, int countPerPage, unsigned long status = TODO_STATUS_ALL, + unsigned long priority = TODO_PRIORITY_ALL) const; + + /** + * @if OSPCOMPAT + * @page CompCalendarbookGetTodosNPage Compatibility for GetTodosN() + * @section CompCalendarbookGetTodosNPageIssueSection Issues + * Implementing this method in OSP compatible applications has the following issues: @n + * -# If the start date of a to-do is not in the time range of the start/end parameters, @n + * the to-do is not retrieved even though the due date is in the time range. + * + * @section CompCalendarbookGetTodosNPageSolutionSection Resolutions + * This issue has been resolved in Tizen. @n + * -# The to-do is retrieved if the due date is in the range of the start/end parameters. + * @endif + */ + + /** + * Gets the total number of to-do items in the specified time range. @n + * To-do items, whose due date is within the retrieving range, is counted. + * + * @if OSPCOMPAT + * @brief [Compatibility] + * @endif + * @since 2.0 + * @if OSPCOMPAT + * @compatibility This method has compatibility issues with OSP compatible applications. @n + * For more information, see @ref CompCalendarbookGetTodoCountPage "here". + * @endif + * @privlevel public + * @privilege %http://tizen.org/privilege/calendar.read + * + * @return The total number of to-dos, @n + * else @c -1 if an exception occurs + * @param[in] start The start of the time range. @n Any value with a unit that is less than a second is ignored. + * @param[in] end The end of the time range. @n Any value with a unit that is less than a second is ignored. + * @param[in] status The to-do status @n + * If a specific status is set, the to-dos that have the specified status are returned. @n + * The default status value is #TODO_STATUS_ALL, which means all the statuses are returned. + * @param[in] priority The to-do priority @n + * If a specific priority is set, the to-dos that have the specified priority are returned. @n + * The default priority value is #TODO_PRIORITY_ALL that means all the priorities are returned. + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The start time is later than the end date. + * - The start or end time is out of the valid range. @n + * The valid range of the date can be referenced from GetMaxDateTime() and GetMinDateTime(). + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + int GetTodoCount(const Tizen::Base::DateTime& start, const Tizen::Base::DateTime& end, unsigned long status = TODO_STATUS_ALL, unsigned long priority = TODO_PRIORITY_ALL) const; + + /** + * @if OSPCOMPAT + * @page CompCalendarbookGetTodoCountPage Compatibility for GetTodoCount() + * @section CompCalendarbookGetTodoCountPageIssueSection Issues + * Implementing this method in OSP compatible applications has the following issues: @n + * -# If the start date of a to-do is not in the time range of the start/end parameters, @n + * the to-do is not counted even though the due date is in the time range. + * + * @section CompCalendarbookGetTodoCountPageSolutionSection Resolutions + * This issue has been resolved in Tizen. @n + * -# The to-do is counted if the due date is in the range of the start/end parameters. + * @endif + */ + + /** + * @if OSPDEPREC + * Gets the CalEvent instances that are within the specified time range. @n + * The all day events are retrieved by their start and end dates in the local time zone, while all other events are retrieved by their + * start and end times in Coordinated Universal Time (UTC). + * + * @brief [Deprecated] + * @deprecated This method is deprecated. Instead of using this method, it is recommended to use GetInstancesOfAllDayEventsN() or GetInstancesOfNonAllDayEventsN(). + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/calendar.read + * + * @return The list that contains all of the matched CalEvent instances, @n + * else an empty list if there are no matched instances, or @c null if an exception occurs @n + * The results are listed in the following order: all day events, and other events. @n + * The results with the same property of all day event are ordered by their start time. + * @param[in] start The start of the time range. @n Any value with a unit that is less than a second is ignored. + * @param[in] end The end of the time range. @n Any value with a unit that is less than a second is ignored. + * @param[in] timeZone The time zone of the specified start and end times + * @param[in] pageNo The page number of the result list @n + * It starts from @c 1. + * @param[in] countPerPage The desired maximum count of the result items per page + * @param[in] category The event category @n + * If a specific category is set, the events that have the specified category are returned. @n + * The default category value is #EVENT_CATEGORY_ALL, which means all the categories are returned. + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The specified @c pageNo or @c countPerPage is less than @c 1. + * - The specified @c category is invalid. + * - The start time is later than the end date. + * - The start or end time is out of the valid range. @n + * The valid range of the date can be referenced from GetMaxDateTime() and GetMinDateTime(). + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @endif + */ + Tizen::Base::Collection::IList* GetEventInstancesN(const Tizen::Base::DateTime& start, const Tizen::Base::DateTime& end, + const Tizen::Locales::TimeZone& timeZone, int pageNo, int countPerPage, + unsigned long category = EVENT_CATEGORY_ALL) const; + + /** + * @if OSPDEPREC + * Gets the CalEvent instances that are within the specified time range. @n + * The all day events are retrieved by their start and end dates in the local time zone, while all other events are retrieved by their + * start and end times in Coordinated Universal Time (UTC). + * + * Although GetEventInstancesN() retrieves the data synchronously, this method returns data asynchronously using + * RecordListener::OnEventInstancesReceivedN(). @n + * It is highly recommended to use the asynchronous method because getting the event instances may take a long time. + * + * @brief [Deprecated] + * @deprecated This method is deprecated. Instead of using this method, it is recommended to use GetInstancesOfAllDayEventsN() or GetInstancesOfNonAllDayEventsN(). + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/calendar.read + * + * @return An error code + * @param[in] start The start of the time range. @n Any value with a unit that is less than a second is ignored. + * @param[in] end The end of the time range. @n Any value with a unit that is less than a second is ignored. + * @param[in] timeZone The time zone of the specified start and end times + * @param[in] pageNo The page number of the result list @n + * It starts from @c 1. + * @param[in] countPerPage The desired maximum count of the result items per page + * @param[in] category The event category @n + * If a specific category is set, the events that have the specified @c category are returned. @n + * The default category value is #EVENT_CATEGORY_ALL, which means all the categories are returned. + * @param[out] reqId The ID of the request + * @param[in] listener The listener for receiving the responses of the request + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The specified @c pageNo or @c countPerPage is less than @c 1. + * - The specified @c category is invalid. + * - The start time is later than the end date. + * - The start or end time is out of the valid range. @n + * The valid range of the date can be referenced from GetMaxDateTime() and GetMinDateTime(). + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks IRecordListener::OnRecordsReceivedN(), Calendarbook::GetEventInstancesN() + * @endif + */ + result GetEventInstances(const Tizen::Base::DateTime& start, const Tizen::Base::DateTime& end, + const Tizen::Locales::TimeZone& timeZone, int pageNo, int countPerPage, unsigned long category, + RequestId& reqId, + const IRecordListener& listener) const; + + /** + * Gets all the events. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/calendar.read + * + * @return The list that contains all the CalEvent instances, @n + * else an empty list if there are no events, or @c null if an exception occurs @n + * The results are listed in the order of their event ID. + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks + * - The specific error code can be accessed using the GetLastResult() method. + * - There is a high probability for an occurrence of an out-of-memory exception. If possible, check whether the exception is + * @c E_OUT_OF_MEMORY or not. For more information on how to handle the out-of-memory exception, refer + * here. + */ + Tizen::Base::Collection::IList* GetAllEventsN(void) const; + + /** + * Gets all the to-dos. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/calendar.read + * + * @return The list that contains all the CalTodo instances, @n + * else an empty list if there are no to-dos, or @c null if an exception occurs @n + * The results are listed in the order of their to-do ID. + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks + * - The specific error code can be accessed using the GetLastResult() method. + * - There is a high probability for an occurrence of an out-of-memory exception. If possible, check whether the exception is + * @c E_OUT_OF_MEMORY or not. For more information on how to handle the out-of-memory exception, refer + * here. + */ + Tizen::Base::Collection::IList* GetAllTodosN(void) const; + + /** + * Gets all the calendars. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/calendar.read + * + * @return The list that contains all the Calendar instances, @n + * else an empty list if there are no calendars, or @c null if an exception occurs @n + * The results are listed in the order of their calendar ID. + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks + * - The specific error code can be accessed using the GetLastResult() method. + * - There is a high probability for an occurrence of an out-of-memory exception. If possible, check whether the exception is + * @c E_OUT_OF_MEMORY or not. For more information on how to handle the out-of-memory exception, refer + * here. + */ + Tizen::Base::Collection::IList* GetAllCalendarsN(void) const; + + /** + * Gets information of all the changed events since the version. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/calendar.read + * + * @return The list that contains the CalEventChangeInfo instances, @n + * else an empty list if there are no events, or @c null if an exception occurs @n + * The results are listed in the order of their version. + * @param[in] version The version + * @param[out] latestVersion The latest change version among the changed events + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG The specified @c version is invalid. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks + * - The specific error code can be accessed using the GetLastResult() method. + * - There is a high probability for an occurrence of an out-of-memory exception. If possible, check whether the exception is + * @c E_OUT_OF_MEMORY or not. For more information on how to handle the out-of-memory exception, refer + * here. + */ + Tizen::Base::Collection::IList* GetChangedEventsAfterN(int version, int& latestVersion) const; + + /** + * Gets information of all the changed to-dos since the version. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/calendar.read + * + * @return A list containing the CalTodoChangeInfo instances, @n + * else an empty list if there are no to-dos, or @c null if an exception occurs @n + * The results are listed in the order of their version. + * @param[in] version The version + * @param[out] latestVersion The latest change version among the changed to-dos + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG The specified @c version is invalid. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks + * - The specific error code can be accessed using the GetLastResult() method. + * - There is a high probability for an occurrence of an out-of-memory exception. If possible, check whether the exception is + * @c E_OUT_OF_MEMORY or not. For more information on how to handle the out-of-memory exception, refer + * here. + */ + Tizen::Base::Collection::IList* GetChangedTodosAfterN(int version, int& latestVersion) const; + + /** + * Adds a calendar. @n + * After adding the calendar to the database successfully, the calendar has a valid calendar ID. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/calendar.write + * + * @return An error code + * @param[in,out] calendar The calendar to add + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG The calendar's recordId is not #INVALID_RECORD_ID. + * @exception E_STORAGE_FULL The storage is insufficient. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + */ + result AddCalendar(Calendar& calendar); + + /** + * Adds a calendar that is associated with the specified account. @n + * After adding the calendar to the database successfully, the calendar has a valid calendar ID. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/calendar.write + * + * @return An error code + * @param[in,out] calendar The calendar to add + * @param[in] accountId The account Id + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The calendar's recordId is not #INVALID_RECORD_ID. + * - The specified @c accountId is invalid. + * @exception E_OBJ_NOT_FOUND The specified account is not found. + * @exception E_STORAGE_FULL The storage is insufficient. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + */ + result AddCalendar(Calendar& calendar, AccountId accountId); + + /** + * Removes the specified calendar. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/calendar.write + * + * @return An error code + * @param[in] calendarId The calendar ID to remove + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The specified @c calendarId is invalid. + * - The calendar represents default calendar. + * @exception E_OBJ_NOT_FOUND The specified calendar is not found. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + */ + result RemoveCalendar(RecordId calendarId); + + /** + * Updates the specified calendar. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/calendar.write + * + * @return An error code + * @param[in] calendar The Calendar instance to update + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The calendar's recordId is #INVALID_RECORD_ID. + * - The calendar represents default calendar. + * @exception E_OBJ_NOT_FOUND The specified calendar is not found. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + */ + result UpdateCalendar(const Calendar& calendar); + + /** + * Gets the calendar with the specified calendar ID. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/calendar.read + * + * @return The matched calendar, @n + * else @c null if an exception occurs + * @param[in] calendarId The calendar ID + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG The specified @c calendarId is invalid. + * @exception E_OBJ_NOT_FOUND The specified calendar is not found. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + Calendar* GetCalendarN(RecordId calendarId) const; + + /** + * Removes an instance of the recurring event. @n + * If the event instance has been removed successfully, its start date is added as an exception date to the recurrence of its original event. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/calendar.write + * + * @return An error code + * @param[in] eventInstance The event instance to remove @n + * The @c eventInstance must be an instance of the recurring event. + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG The instance is invalid. + * @exception E_OBJ_NOT_FOUND The original event of the specified @c eventInstance is not found. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The instance's start time is added to the recurrence of original event as exception date. + */ + result RemoveEventInstance(const CalEventInstance& eventInstance); + + /** + * Update the specified recurring event instance(@ref CalEventInstance). This method can be used for defining exception of the recurring event. @n + * In order to update an event instance, you should use copy of its original event(@ref CalEventInstance::GetOriginalEventId()). @n + * You can modify the properties of copy of the original event and use it as the second parameter of this method. @n + * (The start/end time of the original event should be set with the start/end time of the event instance.) @n + * This method adds the modified copy of the original event as a new event. Therefore the new event ID will be assigned to it through event's record ID @n + * and its existing event ID inside the modified copy of the original event will become the base event ID of the new event. @n + * However this method only updates the properties of the event, does not add a new event that is already added. + * + * @since 2.1 + * @privlevel public + * @privilege %http://tizen.org/privilege/calendar.write + * + * @return An error code + * @param[in] eventInstance The event instance to update @n + * The @c eventInstance must be an instance of the recurring event. + * @param[in,out] event The modified copy of the original event @n + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The instance is invalid. + * - The specified @c event is not referring to the original event. + * @exception E_OBJ_NOT_FOUND The original event of the specified @c eventInstance is not found. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * + * @code + + void UpdateRecurringEventInstance(const CalEventInstance& eventInstance) + { + CalEvent* pEvent = pCalendarbook->GetEventN(eventInstance.GetOriginalEventId()); + if (pEvent == null) + { + AppLogException("GetEventN() has failed"); + return; + } + + // Sets the start time and end time + pEvent->SetRecurrence(null); + pEvent->SetStartAndEndTime(eventInstance.GetStartTime(), eventInstance.GetEndTime()); + + // Modifies the properties + pEvent->SetLocation(L"Meeting room on 11th floor"); + + // Updates the instance + result r = pCalendarbook->UpdateEventInstance(eventInstance, *pEvent); + if (IsFailed(r)) + { + AppLogException("UpdateEventInstance() has failed"); + delete pEvent; + return; + } + + delete pEvent; + } + + * @endcode + */ + result UpdateEventInstance(const CalEventInstance& eventInstance, CalEvent& event); + + /** + * Gets the latest version of calendarbook. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/calendar.read + * + * @return The latest version + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + int GetLatestVersion(void) const; + + /** + * Searches items of the calendarbook with the filter. @n + * The filter specifies the item type and condition for searching. + * The searched results are ordered by the @c propertySortedBy and @c sortOrder. + * If the @c offset is M and the @c maxCount are N, then the first M items are omitted from the result set returned by the searching operation and the next N items are returned. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/calendar.read + * + * @return The list of searched results (the list of CalEvent, CalTodo, Calendar, or CalEventInstance), @n + * else an empty list if there is no searched result, or @c null if an exception occurs + * @param[in] filter The filter that specifies the search condition @n If the filter is empty, all items that are specified by the type of this filter are searched. + * @param[in] propertySortedBy The property for sorting @n The searched results are ordered by the values of this property. + * @param[in] sortOrder The order for sorting + * @param[in] offset The offset of the searched results @n If this value is @c 0, it is ignored. + * @param[in] maxCount The maximum count of the searched results @n If this value is @c 0, it is ignored. + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The specified @c offset or @c maxCount is less than 0. + * - The specified @c propertySortedBy is not an element of the enumerator that corresponds to the type of the specified @c filter. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks + * - The specific error code can be accessed using the GetLastResult() method. + * - There is a high probability for an occurrence of an out-of-memory exception. If possible, check whether the exception is + * @c E_OUT_OF_MEMORY or not. For more information on how to handle the out-of-memory exception, refer + * here. + * @see EventFilterProperty + * @see TodoFilterProperty + * @see CalendarFilterProperty + * @see EventInstanceFilterProperty + */ + Tizen::Base::Collection::IList* SearchN(const CalendarbookFilter& filter, unsigned long propertySortedBy = 0, Tizen::Base::SortOrder sortOrder = Tizen::Base::SORT_ORDER_NONE, + int offset = 0, int maxCount = 0) const; + + /** + * Gets the matched item count of the search results with the filter. @n + * The filter specifies the item type and condition for searching. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/calendar.read + * + * @return The count of the searched results + * @param[in] filter The filter that specifies the search condition @n If the filter is empty, all items that are specified by the type of this filter will be searched. + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + int GetMatchedItemCount(const CalendarbookFilter& filter) const; + + /** + * Parses the events from specific vCalendar file. @n + * The %ParseEventsFromVcalendarN() method supports to parse for vCalendar version 1.0 and 2.0 (iCalendar). + * + * @since 2.0 + * + * @return The list that contains the CalEvent instances, @n + * else an empty list if there are no events, or @c null if an exception occurs + * @param[in] vCalFilePath The path of the vCalendar file + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c vCalFilePath is invalid. + * @exception E_ILLEGAL_ACCESS The access is denied due to insufficient permission. + * @exception E_FILE_NOT_FOUND The specified vCalendar file is not found. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks + * - The specific error code can be accessed using the GetLastResult() method. + * - There is a high probability for an occurrence of an out-of-memory exception. If possible, check whether the exception is + * @c E_OUT_OF_MEMORY or not. For more information on how to handle the out-of-memory exception, refer + * here. + */ + static Tizen::Base::Collection::IList* ParseEventsFromVcalendarN(const Tizen::Base::String& vCalFilePath); + + /** + * Parses the to-dos from specific vCalendar file. @n + * The %ParseTodosFromVcalendarN() method supports to parse for vCalendar version 1.0 and 2.0 (iCalendar). + * + * @since 2.0 + * + * @return The list that contains the CalTodo instances, @n + * else an empty list if there are no to-dos, or @c null if an exception occurs + * @param[in] vCalFilePath The path of the vCalendar file + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c vCalFilePath is invalid. + * @exception E_ILLEGAL_ACCESS The access is denied due to insufficient permission. + * @exception E_FILE_NOT_FOUND The specified vCalendar file is not found. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks + * - The specific error code can be accessed using the GetLastResult() method. + * - There is a high probability for an occurrence of an out-of-memory exception. If possible, check whether the exception is + * @c E_OUT_OF_MEMORY or not. For more information on how to handle the out-of-memory exception, refer + * here. + */ + static Tizen::Base::Collection::IList* ParseTodosFromVcalendarN(const Tizen::Base::String& vCalFilePath); + + /** + * Exports the events to vCalendar 2.0 (iCalendar) file. + * + * @since 2.0 + * + * @return An error code + * @param[in] eventList The event list to export @n The list should contain CalEvent instances. + * @param[in] vCalFilePath The vCalendar file path + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The specified @c eventList is invalid. + * - The specified @c vCalFilePath is invalid. + * @exception E_ILLEGAL_ACCESS The access of the specified @c vCalFilePath is denied due to insufficient permission. + * @exception E_FILE_ALREADY_EXIST The vCalendar file already exists. + * @exception E_STORAGE_FULL The disk space is full. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + */ + static result ExportEventsToVcalendar(const Tizen::Base::Collection::IList& eventList, const Tizen::Base::String& vCalFilePath); + + /** + * Exports the to-dos to vCalendar 2.0 (iCalendar) file. + * + * @since 2.0 + * + * @return An error code + * @param[in] todoList The to-do list to export @n The list should contain CalTodo instances. + * @param[in] vCalFilePath The vCalendar file path + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The specified @c todoList is invalid. + * - The specified @c vCalFilePath is invalid. + * @exception E_ILLEGAL_ACCESS The access of the specified @c vCalFilePath is denied due to insufficient permission. + * @exception E_FILE_ALREADY_EXIST The vCalendar file already exists. + * @exception E_STORAGE_FULL The disk space is full. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + */ + static result ExportTodosToVcalendar(const Tizen::Base::Collection::IList& todoList, const Tizen::Base::String& vCalFilePath); + + /** + * Gets the maximum allowable date and time in the calendarbook (that is, "December 31 2100 23:59:59"). + * + * @since 2.0 + * + * @return An instance of Tizen::Base::DateTime + */ + static Tizen::Base::DateTime GetMaxDateTime(void); + + /** + * Gets the minimum allowable date and time in the calendarbook (that is, "January 1 1900 00:00:00"). + * + * @since 2.0 + * + * @return An instance of Tizen::Base::DateTime + */ + static Tizen::Base::DateTime GetMinDateTime(void); + +private: + /** + * The implementation of this copy constructor is intentionally blank and declared as private @n + * to prohibit copying of objects. + * + * @since 2.0 + */ + Calendarbook(const Calendarbook& rhs); + + /** + * The implementation of this copy assignment operator is intentionally blank and declared as private @n + * to prohibit copying of objects. + * + * @since 2.0 + */ + Calendarbook& operator =(const Calendarbook& rhs); + +private: + friend class _CalendarbookImpl; + class _CalendarbookImpl* __pCalendarbookImpl; +}; // Calendarbook + +}} // Tizen::Social + + +#endif // _FSCL_CALENDARBOOK_H_ diff --git a/inc/FSclCalendarbookFilter.h b/inc/FSclCalendarbookFilter.h new file mode 100644 index 0000000..bff719a --- /dev/null +++ b/inc/FSclCalendarbookFilter.h @@ -0,0 +1,307 @@ +// +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// 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. +// +/** + * @file FSclCalendarbookFilter.h + * @brief This is the header file for the %CalendarbookFilter class. + * + * This header file contains the declarations of the %CalendarbookFilter class. + */ +#ifndef _FSCL_CALENDARBOOK_FILTER_H_ +#define _FSCL_CALENDARBOOK_FILTER_H_ + +#include +#include +#include + +namespace Tizen { namespace Base +{ +class String; +class DateTime; +}} + +namespace Tizen { namespace Social +{ + +/** + * @class CalendarbookFilter + * @brief This class represents the condition for searching a specific item on a calendarbook. + * + * @since 2.0 + * + * @final This class is not intended for extension. + * + * The %CalendarbookFilter class represents the condition for searching a specific item on a calendarbook. + * The type of the filter decides which item will be searched (such as events, to-dos, calendars, all day event instances, or non-all day event instances). @n + * The filter can consist of multiple filtering expressions and conjunctive operators. + * A filtering expression consists of a filter property, comparison operator and value. + * The filter property must be an element of the enumerator that corresponds to the type of the filter. @n + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Filter type Filter Property Search result
CB_FI_TYPE_EVENT EventFilterProperty A list of CalEvent
CB_FI_TYPE_TODO TodoFilterProperty A list of CalTodo
CB_FI_TYPE_CALENDAR CalendarFilterProperty A list of Calendar
CB_FI_TYPE_ALL_DAY_EVENT_INSTANCE EventInstanceFilterProperty A list of CalEventInstance
CB_FI_TYPE_NON_ALL_DAY_EVENT_INSTANCE EventInstanceFilterProperty A list of CalEventInstance
+ * + * The following example demonstrates how to use the %CalendarbookFilter class. + * @code + * + //search condition: (calendarId=3 OR calendarId=4) AND (subject LIKE '%meeting%') + CalendarbookFilter subFilter(CB_FILTER_TYPE_EVENT); + subFilter.AppendInt(FI_CONJ_OP_NONE, EVENT_FI_PR_CALENDAR_ID, FI_CMP_O_EQUAL, 3); + subFilter.AppendInt(FI_CONJ_OP_OR, EVENT_FI_PR_CALENDAR_ID, FI_CMP_OP_EQUAL, 4); + + CalendarbookFilter mainFilter(CB_FI_TYPE_EVENT); + mainFilter.AppendFilter(FI_CONJ_OP_NONE, subFilter); + mainFilter.AppendString(FI_CONJ_OP_AND, EVENT_FI_PR_SUBJECT, FI_STR_OP_CONTAIN, L"meeting"); + + Calendarbook calendarbook; + calendarbook.Construct(); + IList* pEventList = calendarbook.SearchN(mainFilter, EVENT_FI_PR_SUBJECT, SORT_ORDER_ASCENDING); + + * @endcode + */ +class _OSP_EXPORT_ CalendarbookFilter + : public Tizen::Base::Object +{ +public: + /** + * Initializes an instance of %CalendarbookFilter with the specified @c type. + * + * @since 2.0 + * + * @param[in] type The type of the filter @n It decides the type of item to search. + */ + explicit CalendarbookFilter(CalendarbookFilterType type); + + /** + * This destructor overrides Tizen::Base::Object::~Object(). + * + * @since 2.0 + */ + virtual ~CalendarbookFilter(void); + + /** + * Checks whether the value of the specified instance is equal to the value of the current instance of Tizen::Base::Object. + * + * @since 2.0 + * + * @return @c true if the value of the specified instance of Tizen::Base::Object is equal to the value of the current instance of %Tizen::Base::Object, @n + * else @c false + * @param[in] rhs An instance of Tizen::Base::Object to compare + */ + virtual bool Equals(const Tizen::Base::Object& rhs) const; + + /** + * Gets the hash value of the current instance. + * + * @since 2.0 + * + * @return The hash value of the current instance + */ + virtual int GetHashCode(void) const; + + /** + * Appends the filtering expression for an integer value. @n + * Firstly, this method appends the conjunctive operator. + * Then, this method puts the filtering expression in parentheses and appends it. @n + * The filtering expression consists of the filter property, comparison operator, and value. + * The specified @c filterProperty must be an element of the enumerator that corresponds to the type of this filter. + * + * @since 2.0 + * + * @return The error code + * @param[in] conjunctiveOperator The conjunctive operator to append the filtering expression @n + * If there is no filtering expression or the filter has been appended before, FI_CONJ_OP_NON must be used. Otherwise FI_CONJ_OP_AND or FI_CONJ_OP_OR can be used. + * @param[in] filterProperty The filter property + * @param[in] comparisonOperator The comparison operator + * @param[in] value The integer value for comparison + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The specified @c filterProperty is not an element of the enumerator that corresponds to the type of this filter. + * - The specified @c filterProperty is not an integer value. + * - The specified @c conjunctiveOperator is invalid. + */ + result AppendInt(FilterConjunctiveOperator conjunctiveOperator, unsigned long filterProperty, FilterComparisonOperator comparisonOperator, int value); + + /** + * Appends the filtering expression for a double value. @n + * Firstly, this method appends the conjunctive operator. + * Then, this method puts the filtering expression in parentheses and appends it. @n + * The filtering expression consists of the filter property, comparison operator, and value. + * The specified @c filterProperty must be an element of the enumerator that corresponds to the type of this filter. + * + * @since 2.0 + * + * @return The error code + * @param[in] conjunctiveOperator The conjunctive operator to append the filtering expression @n + * If there is no filtering expression or the filter has been appended before, FI_CONJ_OP_NON must be used. Otherwise FI_CONJ_OP_AND or FI_CONJ_OP_OR can be used. + * @param[in] filterProperty The filter property + * @param[in] comparisonOperator The comparison operator + * @param[in] value The double value for comparison + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The specified @c filterProperty is not an element of the enumerator that corresponds to the type of this filter. + * - The specified @c filterProperty is not a double value. + * - The specified @c conjunctiveOperator is invalid. + */ + result AppendDouble(FilterConjunctiveOperator conjunctiveOperator, unsigned long filterProperty, FilterComparisonOperator comparisonOperator, double value); + + /** + * Appends the filtering expression for a @c bool value. @n + * Firstly, this method appends the conjunctive operator. + * Then, this method puts the filtering expression in parentheses and appends it. @n + * The filtering expression consists of the filter property, comparison operator, and value. + * The specified @c filterProperty must be an element of the enumerator that corresponds to the type of this filter. + * + * @since 2.0 + * + * @return The error code + * @param[in] conjunctiveOperator The conjunctive operator to append the filtering expression @n + * If there is no filtering expression or the filter has been appended before, FI_CONJ_OP_NON must be used. Otherwise FI_CONJ_OP_AND or FI_CONJ_OP_OR can be used. + * @param[in] filterProperty The filter property + * @param[in] comparisonOperator The comparison operator FILTER_COMPARISON_OPERATOR_EQUAL is only permitted + * @param[in] value The @c bool value for comparison + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The specified @c filterProperty is not an element of the enumerator that corresponds to the type of this filter. + * - The specified @c filterProperty is not a @c bool value. + * - The specified @c conjunctiveOperator is invalid. + */ + result AppendBool(FilterConjunctiveOperator conjunctiveOperator, unsigned long filterProperty, FilterComparisonOperator comparisonOperator, bool value); + + /** + * Appends the filtering expression for a Tizen::Base::DateTime value. @n + * Firstly, this method appends the conjunctive operator. + * Then, this method puts the filtering expression in parentheses and appends it. @n + * The filtering expression consists of the filter property, comparison operator, and value. + * The specified @c filterProperty must be an element of the enumerator that corresponds to the type of this filter. + * + * @since 2.0 + * + * @return The error code + * @param[in] conjunctiveOperator The conjunctive operator to append the filtering expression @n + * If there is no filtering expression or the filter has been appended before, FI_CONJ_OP_NON must be used. Otherwise FI_CONJ_OP_AND or FI_CONJ_OP_OR can be used. + * @param[in] filterProperty The filter property + * @param[in] comparisonOperator The comparison operator + * @param[in] value The Tizen::Base::DateTime value for comparison. @n Any value with a unit that is less than a second is ignored. + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The specified @c filterProperty is not an element of the enumerator that corresponds to the type of this filter. + * - The specified @c filterProperty is not a Tizen::Base::DateTime value. + * - The specified @c conjunctiveOperator is invalid. + * - The specified @c value is out of the valid range. + */ + result AppendDateTime(FilterConjunctiveOperator conjunctiveOperator, unsigned long filterProperty, FilterComparisonOperator comparisonOperator, const Tizen::Base::DateTime& value); + + /** + * Appends the filtering expression for a Tizen::Base::String value. @n + * Firstly, this method appends the conjunctive operator. + * Then, this method puts the filtering expression in parentheses and appends it. @n + * The filtering expression consists of the filter property, comparison operator, and value. + * The specified @c filterProperty must be an element of the enumerator that corresponds to the type of this filter. + * + * @since 2.0 + * + * @return The error code + * @param[in] conjunctiveOperator The conjunctive operator to append the filtering expression @n + * If there is no filtering expression or the filter has been appended before, FI_CONJ_OP_NON must be used. Otherwise FI_CONJ_OP_AND or FI_CONJ_OP_OR can be used. + * @param[in] filterProperty The filter property + * @param[in] comparisonOperator The comparison operator + * @param[in] value The Tizen::Base::String value for matching + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The specified @c filterProperty is not an element of the enumerator that corresponds to the type of this filter. + * - The specified @c filterProperty is not a Tizen::Base::String value. + * - The specified @c conjunctiveOperator is invalid. + */ + result AppendString(FilterConjunctiveOperator conjunctiveOperator, unsigned long filterProperty, FilterStringOperator comparisonOperator, const Tizen::Base::String& value); + + /** + * Appends the filter. @n + * Firstly, this method appends the conjunctive operator. + * Then, this method puts the filtering expressions of the specified filter in parentheses and appends it. @n + * The type of the specified @c filter must be same as the type of this filter. + * + * @since 2.0 + * + * @return The error code + * @param[in] conjunctiveOperator The conjunctive operator to append the filtering expression @n + * If there is no filtering expression or the filter has been appended before, FI_CONJ_OP_NON must be used. Otherwise FI_CONJ_OP_AND or FI_CONJ_OP_OR can be used. + * @param[in] filter The filter to append + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The type of the specified @c filter is not same as the type of this filter. + * - The specified @c filter is empty. + * - The specified @c conjunctiveOperator is invalid. + */ + result AppendFilter(FilterConjunctiveOperator conjunctiveOperator, const CalendarbookFilter& filter); + +private: + /* + * This default constructor is intentionally declared as private so that only the platform can create an instance. + * + * @since 2.0 + */ + CalendarbookFilter(void); + + /* + * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects. + * + * @since 2.0 + */ + CalendarbookFilter(const CalendarbookFilter& rhs); + + /* + * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects. + * + * @since 2.0 + */ + CalendarbookFilter & operator =(const CalendarbookFilter & rhs); + +private: + friend class _CalendarbookFilterImpl; + class _CalendarbookFilterImpl* __pCalendarbookFilterImpl; +}; // CalendarbookFilter + +}} // Tizen::Social + +#endif // _FSCL_CALENDARBOOK_FILTER_H_ diff --git a/inc/FSclCategory.h b/inc/FSclCategory.h new file mode 100644 index 0000000..11670a9 --- /dev/null +++ b/inc/FSclCategory.h @@ -0,0 +1,318 @@ +// +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// 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. +// +/** + * @file FSclCategory.h + * @brief This is the header file for the %Category class. + * + * This header file contains the declarations of the %Category class. + */ +#ifndef _FSCL_CATEGORY_H_ +#define _FSCL_CATEGORY_H_ + +#include +#include +#include +#include + +namespace Tizen { namespace Base { namespace Collection +{ +class IMap; +}}}; + +namespace Tizen { namespace Social +{ + +/** + * @class Category + * @brief This class represents a category in the contact database. + * + * @since 2.0 + * + * @final This class is not intended for extension. + * + * The %Category class represents a category in the contact database. Each contact can belong to multiple categories. + * + * For more information on the class features, see Category. + */ +class _OSP_EXPORT_ Category + : public Record +{ +public: + /** + * This is the default constructor for this class. + * + * @since 2.0 + * + * @remarks In order to add a new category to Addressbook, the category name needs to be set using SetName(). + * @see Addressbook::AddCategory() + */ + Category(void); + + /** + * Copying of objects using this copy constructor is allowed. + * + * @since 2.0 + * + * @param [in] rhs An instance of %Category to copy + */ + Category(const Category& rhs); + + /** + * This destructor overrides Tizen::Social::Record::~Record(). + * + * @since 2.0 + */ + virtual ~Category(void); + + /** + * Checks whether the value of the specified instance is equal to the value of the current instance of Tizen::Base::Object. + * + * @since 2.0 + * + * @return @c true if the value of the specified instance of Tizen::Base::Object is equal to the value of the current instance of %Tizen::Base::Object, @n + * else @c false + * @param[in] rhs An instance of Tizen::Base::Object to compare + */ + virtual bool Equals(const Tizen::Base::Object& rhs) const; + + /** + * Gets the hash value of the current instance. + * + * @since 2.0 + * + * @return The hash value of the current instance + */ + virtual int GetHashCode(void) const; + + /** + * Gets the addressbook ID. + * + * @since 2.0 + * + * @return The addressbook ID + */ + AddressbookId GetAddressbookId(void) const; + + + /** + * @if OSPDEPREC + * Adds the specified contact to the category. + * + * @brief [Deprecated] + * @deprecated This method is deprecated. Instead of using this method, use Addressbook::AddMemberToCategory(). + * @since 2.0 + * + * @return An error code + * @param [in] contactId The contact ID + * @exception E_SUCCESS The method is successful. + * @exception E_OBJ_ALREADY_EXIST The specified @c contactId is already a member of this category. + * @exception E_INVALID_ARG The specified @c contactId is invalid. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @endif + */ + result AddMember(RecordId contactId); + + /** + * Gets the total number of members in the category. + * + * @since 2.0 + * + * @return The number of members in the category + */ + int GetMemberCount(void) const; + + /** + * Gets the name of the category. + * + * @since 2.0 + * + * @return The name of the category + * @see SetName() + */ + Tizen::Base::String GetName(void) const; + + /** + * @if OSPDEPREC + * Checks whether the category contains the specified contact. + * + * @brief [Deprecated] + * @deprecated This method is deprecated. Instead of using this method, use Addressbook::GetCategoriesByContactN(). + * @since 2.0 + * + * @return @c true if the category contains the specified contact, @n + * else @c false + * @param [in] contactId The contact ID + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c contactId is invalid. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @endif + */ + bool HasMember(RecordId contactId) const; + + /** + * @if OSPDEPREC + * Removes the specified contact from the category. + * + * @brief [Deprecated] + * @deprecated This method is deprecated. Instead of using this method, use Addressbook::RemoveMemberFromCategory(). + * @since 2.0 + * + * @return An error code + * @param [in] contactId The contact ID + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c contactId is invalid. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @endif + */ + result RemoveMember(RecordId contactId); + + /** + * Sets the specified @c name for the category. + * + * @if OSPCOMPAT + * @brief [Compatibility] + * @endif + * @since 2.0 + * @if OSPCOMPAT + * @compatibility This method has compatibility issues with OSP compatible applications. @n + * For more information, see @ref CompCategorySetNamePage "here". + * @endif + * + * @return An error code + * @param [in] name The category name + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c name is an empty string. + * @exception E_INVALID_OPERATION This category is a read-only category. + * @remarks It is not allowed to change the name of a read-only category. + * @see GetName() + * @see IsReadOnly() + */ + result SetName(const Tizen::Base::String& name); + + /** + * @if OSPCOMPAT + * @page CompCategorySetNamePage Compatibility for SetName() + * @section CompCategorySetNamePageIssueSection Issues + * Implementing this method in OSP compatible applications has the following issue: @n + * -# If the length of the category name to be set is greater than 100 characters, @c E_INVALID_ARG is returned. + * -# if the category is a default category, @c E_INVALID_ARG is returned. + * + * @section CompCategorySetNamePageSolutionSection Resolutions + * The issue mentioned above has been resolved in Tizen. + * @endif + */ + + /** + * Sets the specified ringtone for the category. + * + * @since 2.0 + * + * @return An error code + * @param [in] filePath The file path of the ringtone + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The length of the specified @c filePath exceeds system limitations. + * @exception E_FILE_NOT_FOUND The specified file cannot be found or accessed. + * @see GetRingtonePath() + */ + result SetRingtonePath(const Tizen::Base::String& filePath); + + /** + * Gets the ringtone for the category. + * + * @since 2.0 + * + * @return The file path of the ringtone + * @see SetRingtonePath() + */ + Tizen::Base::String GetRingtonePath(void) const; + + /** + * Checks whether this category is a default category . @n + * + * @since 2.0 + * + * @return @c true if this is a default category, @n + * else @c false + */ + bool IsDefault(void) const; + + /** + * Checks whether this category is read-only. @n + * If a category is default, it is not possible to update the category name and delete the category. + * However it is possible to add or remove contacts and change the thumbnail and ringtone. + * + * @since 2.1 + * + * @return @c true if this is a default category, @n + * else @c false + */ + bool IsReadOnly(void) const; + + /** + * Gets the extra data. + * + * @since 2.2 + * + * @return The key-value map of the extended data where the key and value are of type Tizen::Base::String, @n + * else an empty map if there is no extra data, or @c null if an exception occurs + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + Tizen::Base::Collection::IMap* GetExtraDataN(void) const; + + /** + * Sets the thumbnail image. @n + * If the specified @c filePath is an empty string, the thumbnail of this category is reset. + * + * @since 2.0 + * + * @return An error code + * @param[in] filePath The file path of the thumbnail image + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The length of the specified @c filePath exceeds system limitations. + * @exception E_FILE_NOT_FOUND The specified file cannot be found or accessed. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @see GetThumbnailPath() + */ + result SetThumbnail(const Tizen::Base::String& filePath); + + /** + * Gets the thumbnail path. + * + * @since 2.0 + * + * @return The file path of the thumbnail + * @remarks If the thumbnail has not been set, an empty string is returned. + */ + Tizen::Base::String GetThumbnailPath(void) const; + + /** + * Copying of objects using this copy assignment operator is allowed. + * + * @since 2.0 + * + * @param [in] rhs An instance of %Category to copy + */ + Category& operator =(const Category& rhs); + +private: + friend class _CategoryImpl; + class _CategoryImpl* __pCategoryImpl; +}; // Category + +}} // Tizen::Social + +#endif // _FSCL_CATEGORY_H_ diff --git a/inc/FSclCategoryChangeInfo.h b/inc/FSclCategoryChangeInfo.h new file mode 100644 index 0000000..9a22c13 --- /dev/null +++ b/inc/FSclCategoryChangeInfo.h @@ -0,0 +1,143 @@ +// +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// 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. +// +/** + * @file FSclCategoryChangeInfo.h + * @brief This is the header file for the %CategoryChangeInfo class. + * + * This header file contains the declarations of the %CategoryChangeInfo class. + */ +#ifndef _FSCL_CATEGORY_CHANGE_INFO_H_ +#define _FSCL_CATEGORY_CHANGE_INFO_H_ + +#include +#include +#include + +namespace Tizen { namespace Social +{ + +/** + * @class CategoryChangeInfo + * @brief This class provides the category change information. + * + * @since 2.0 + * + * @final This class is not intended for extension. + * + * The %CategoryChangeInfo class provides the category change information. + * + */ +class _OSP_EXPORT_ CategoryChangeInfo + : public Tizen::Base::Object +{ +public: + /** + * This is the default constructor for this class. + * + * @since 2.0 + */ + CategoryChangeInfo(void); + + /** + * Copying of objects using this copy constructor is allowed. + * + * @since 2.0 + * + * @param[in] rhs An instance of %CategoryChangeInfo to copy + */ + CategoryChangeInfo(const CategoryChangeInfo& rhs); + + /** + * This destructor overrides Tizen::Base::Object::~Object(). + * + * @since 2.0 + */ + virtual ~CategoryChangeInfo(void); + + /** + * Checks whether the value of the specified instance is equal to the value of the current instance of Tizen::Base::Object. + * + * @since 2.0 + * + * @return @c true if the value of the specified instance of Tizen::Base::Object is equal to the value of the current instance of %Tizen::Base::Object, @n + * else @c false + * @param[in] rhs An instance of Tizen::Base::Object to compare + */ + virtual bool Equals(const Tizen::Base::Object& rhs) const; + + /** + * Gets the hash value of the current instance. + * + * @since 2.0 + * + * @return The hash value of the current instance + */ + virtual int GetHashCode(void) const; + + /** + * Gets the addressbook ID of the changed category. + * + * @since 2.0 + * + * @return The addressbook ID + */ + AddressbookId GetAddressbookId(void) const; + + /** + * Gets the ID of the changed category. + * + * @since 2.0 + * + * @return The category ID + */ + RecordId GetCategoryId(void) const; + + /** + * Gets the version. + * + * @since 2.0 + * + * @return The version of the category + */ + int GetVersion(void) const; + + /** + * Gets the change type. + * + * @since 2.0 + * + * @return The change type + */ + RecordChangeType GetChangeType(void) const; + + /** + * Copying of objects using this copy assignment operator is allowed. + * + * @since 2.0 + * + * @param[in] rhs An instance of %CategoryChangeInfo to copy + */ + CategoryChangeInfo& operator =(const CategoryChangeInfo& rhs); + +private: + friend class _CategoryChangeInfoImpl; + class _CategoryChangeInfoImpl* __pCategoryChangeInfoImpl; + +}; // CategoryChangeInfo + +}} // Tizen::Social + +#endif // _FSCL_CATEGORY_CHANGE_INFO_H_ diff --git a/inc/FSclContact.h b/inc/FSclContact.h new file mode 100644 index 0000000..0d6006a --- /dev/null +++ b/inc/FSclContact.h @@ -0,0 +1,692 @@ +// +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// 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. +// +/** + * @file FSclContact.h + * @brief This is the header file for the %Contact class. + * + * This header file contains the declarations of the %Contact class. + */ +#ifndef _FSCL_CONTACT_H_ +#define _FSCL_CONTACT_H_ + +#include +#include +#include +#include +#include +#include +#include + +namespace Tizen { namespace Social +{ + +class Address; +class PhoneNumber; +class Email; +class Url; +class ImAddress; +class Organization; +class ContactEvent; +class Relationship; +class ContactAppLaunchData; + +/** + * @class Contact + * @brief This class provides a contact. + * + * @since 2.0 + * + * @final This class is not intended for extension. + * + * The %Contact class provides a contact, a record that represents the contact information of a person. It provides the properties declared in + * the #ContactPropertyId and #ContactMultiPropertyId enumerators. Check the descriptions for each property ID carefully to know the exact type + * of the property and its value. @n + * + * For more information on the class features, see Contact. + * + * The following example demonstrates how to use the %Contact class. + * + * @code + * + #include + + using namespace Tizen::Base; + using namespace Tizen::Base::Collection; + using namespace Tizen::Social; + + void + ContactExample(void) + { + // Creates a contact + Contact contact; + + // Sets the contact's properties + contact.SetValue(CONTACT_PROPERTY_ID_FIRST_NAME, L"Thomas"); + contact.SetValue(CONTACT_PROPERTY_ID_LAST_NAME, L"A Anderson"); + + PhoneNumber phoneNumber(PHONENUMBER_TYPE_MOBILE, L"820223459876"); + contact.AddPhoneNumber(phoneNumber); + + // Gets the contact's properties + String firstName, lastName; + contact.GetValue(CONTACT_PROPERTY_ID_FIRST_NAME, firstName); + contact.GetValue(CONTACT_PROPERTY_ID_LAST_NAME, lastName); + + IList* pPhoneNumberList = contact.GetValuesN(CONTACT_MPROPERTY_ID_PHONE_NUMBERS); + if (pPhoneNumberList != null) + { + PhoneNumber* pPhoneNumber = null; + String number; + IEnumerator* pEnum = pPhoneNumberList->GetEnumeratorN(); + while (pEnum->MoveNext() == E_SUCCESS) + { + pPhoneNumber = (PhoneNumber*) pEnum->GetCurrent(); + number = pPhoneNumber->GetPhoneNumber(); + // Uses the phone number + // .. + } + + delete pEnum; + pPhoneNumberList->RemoveAll(true); + delete pPhoneNumberList; + } + } + * + * @endcode + * + */ +class _OSP_EXPORT_ Contact + : public Record +{ +public: + /** + * This is the default constructor for this class. + * + * @since 2.0 + */ + Contact(void); + + /** + * Copying of objects using this copy constructor is allowed. + * + * @since 2.0 + * + * @param[in] rhs An instance of %Contact to copy + */ + Contact(const Contact& rhs); + + /** + * This destructor overrides Tizen::Social::Record::~Record(). + * + * @since 2.0 + * + */ + virtual ~Contact(void); + + /** + * Checks whether the value of the specified instance is equal to the value of the current instance of Tizen::Base::Object. + * + * @since 2.0 + * + * @return @c true if the value of the specified instance of Tizen::Base::Object is equal to the value of the current instance of %Tizen::Base::Object, @n + * else @c false + * @param[in] rhs An instance of Tizen::Base::Object to compare + */ + virtual bool Equals(const Tizen::Base::Object& rhs) const; + + /** + * Gets the hash value of the current instance. + * + * @since 2.0 + * + * @return The hash value of the current instance + */ + virtual int GetHashCode(void) const; + + /** + * @if OSPDEPREC + * Gets the Tizen::Graphics::Bitmap object of the thumbnail image. @n + * If the thumbnail is not set, @c null is returned. + * + * @brief [Deprecated] + * @deprecated This method is deprecated. Instead of using this method, use GetThumbnailPath() + * @since 2.0 + * + * @return The Tizen::Graphics::Bitmap object of the thumbnail image + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @see SetThumbnail() + * @endif + */ + Tizen::Graphics::Bitmap* GetThumbnailN(void) const; + + /** + * Gets the thumbnail path. + * + * @since 2.0 + * + * @return The file path of the thumbnail + * @remarks If the thumbnail has not been set, an empty string is returned. + */ + Tizen::Base::String GetThumbnailPath(void) const; + + /** + * Sets the thumbnail image. @n + * If the specified @c filePath is an empty string, the current thumbnail image is removed. + * + * @if OSPCOMPAT + * @brief [Compatibility] + * @endif + * @since 2.0 + * @if OSPCOMPAT + * @compatibility This method has compatibility issues with OSP compatible applications. @n + * For more information, see @ref CompIoPathPage "here". + * @endif + * + * @return An error code + * @param[in] filePath The file path of the thumbnail image + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The length of the specified @c filePath exceeds system limitations. + * @exception E_FILE_NOT_FOUND The specified file cannot be found or accessed. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @see GetThumbnailPath() + */ + result SetThumbnail(const Tizen::Base::String& filePath); + + /** + * Sets the value of the property having the specified ID, to the specified value. + * + * @if OSPCOMPAT + * @brief [Compatibility] + * @endif + * @since 2.0 + * @if OSPCOMPAT + * @compatibility This method has compatibility issues with OSP compatible applications. @n + * For more information, see @ref CompContactSetValuePage "here". + * @endif + * + * @return An error code + * @param[in] id The ID of the property whose value is set + * @param[in] value The new string value to set + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c id is #CONTACT_PROPERTY_ID_DISPLAY_NAME, @if OSPDEPREC #CONTACT_PROPERTY_ID_THUMBNAIL, or @endif + * the ringtone file path (value) is invalid if @c id is #CONTACT_PROPERTY_ID_RINGTONE. + * @remarks + * - The #CONTACT_PROPERTY_ID_DISPLAY_NAME property cannot be set. @n + * - The #CONTACT_PROPERTY_ID_RINGTONE can be set to the path string of the ringtone file. @n + * @if OSPDEPREC + * - The #CONTACT_PROPERTY_ID_THUMBNAIL property cannot be set. @n + * - In case @c id is set to #CONTACT_PROPERTY_ID_NICK_NAME, @n + * - If this contact has nicknames, the first nickname among them is set to the @c value. @n + * - If not, a new nickname is added to this contact. @n + * - In case @c id is set to #CONTACT_PROPERTY_ID_NOTE, @n + * - If this contact has notes, the first note among them is set to the @c value. @n + * - If not, a new note is added to this contact. @n + * - In case @c id is set to #CONTACT_PROPERTY_ID_COMPANY, @n + * - If this contact has organizations, the name value of the first organization among them is set to the @c value. @n + * - If not, a new organization is added to this contact. @n + * - In case @c id is set to #CONTACT_PROPERTY_ID_JOB_TITLE, @n + * - If this contact has organizations, the job title value of the first organization among them is set to the @c value. @n + * - If not, a new organization is added to this contact. @n + * @endif + */ + result SetValue(ContactPropertyId id, const Tizen::Base::String& value); + + /** + * @if OSPCOMPAT + * @page CompContactSetValuePage Compatibility for SetValue() + * @section CompContactSetValuePageIssueSection Issues + * Implementing this method in OSP compatible applications has the following issues: @n + * -# If the length of the value is greater than the maximum length of the specified property, @c E_INVALID_ARG is returned. + * -# The path should begin with an allowed path prefix such as @b '/Home', @b '/Home/Share', @b '/Res', @b '/Share/[@e appid]', + * @b '/Media', and @b '/Storagecard/Media'. + * + * @section CompContactSetValuePageSolutionSection Resolutions + * -# The first issue mentioned above has been resolved in Tizen. + * -# There are no specific allowed path prefixes. Applications can obtain an accessible directory path using the following methods. @n + * - For accessing its own data directory, use Tizen::App::App::GetInstance()->GetAppRootPath() + L"data" @n + * or Tizen::App::App::GetInstance()->GetAppDataPath(). + * - For accessing its own resource directory, use Tizen::App::App::GetInstance()->GetAppRootPath() + L"res". @n + * or Tizen::App::App::GetInstance()->GetAppResourcePath(). + * - For accessing its own share directory, use Tizen::App::App::GetInstance()->GetAppRootPath() + L"share". + * - For accessing the media directory, use Tizen::System::Environment::GetMediaPath(). + * - For accessing the external storage, use Tizen::System::Environment::GetExternalStoragePath(). + * + * For more information on the path, + * see I/O Overview. + * @endif + */ + + /** + * Sets the specified value for the property having the specified ID. + * + * @since 2.0 + * + * @return An error code + * @param[in] id The ID of the property whose value is set + * @param[in] value An instance of Tizen::Base::DateTime value to set + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The property with the specified contact property ID is not of Tizen::Base::DateTime type. + * - The property is read-only. + * @if OSPDEPREC + * @remarks + * - In case @c id is set to #CONTACT_PROPERTY_ID_BIRTHDAY, + * - If this contact has events whose types are #CONTACT_EVENT_TYPE_BIRTHDAY, the date value of the first event among them is set to the @c value. + * - If not, a new event whose type is #CONTACT_EVENT_TYPE_BIRTHDAY is added to this contact. + * - In case @c id is set to #CONTACT_PROPERTY_ID_ANNIVERSARY, + * - If this contact has events whose types are #CONTACT_EVENT_TYPE_ANNIVERSARY, the date value of the first event among them is set to the @c value. + * - If not, a new event whose type is #CONTACT_EVENT_TYPE_ANNIVERSARY is added to this contact. + * @endif + */ + result SetValue(ContactPropertyId id, const Tizen::Base::DateTime& value); + + /** + * Gets the value of the specified property. + * + * @since 2.0 + * + * @return An error code + * @param[in] id The property ID + * @param[out] value The property value + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified contact property ID is not supported. + */ + result GetValue(ContactPropertyId id, Tizen::Base::String& value) const; + + /** + * Gets the value of the specified Tizen::Base::DateTime property such as birthday. @n + * If the %Tizen::Base::DateTime value has not been set for the specified property, the property has a value, '1899, 12, 31, 00:00:00'. + * + * @since 2.0 + * + * @return An error code + * @param[in] id The property ID + * @param[out] value The property value + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified contact property ID is not supported. + */ + result GetValue(ContactPropertyId id, Tizen::Base::DateTime& value) const; + + /** + * Sets the specified phone number at the specified index. + * + * @since 2.0 + * + * @return An error code + * @param[in] index The index at which to set the value + * @param[in] phoneNumber An instance of PhoneNumber to set, @n + * else @c false + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c phoneNumber is empty. + * @exception E_OUT_OF_RANGE The specified @c index is outside the bounds of the properties. + */ + result SetPhoneNumberAt(int index, const PhoneNumber& phoneNumber); + + /** + * Sets the specified email corresponding to the specified index. + * + * @since 2.0 + * + * @return An error code + * @param[in] index The index at which to set the value + * @param[in] email An instance of Email + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c email is empty. + * @exception E_OUT_OF_RANGE The specified @c index is outside the bounds of the properties. + */ + result SetEmailAt(int index, const Email& email); + + /** + * Sets the specified URL corresponding to the specified index. + * + * @since 2.0 + * + * @return An error code + * @param[in] index The index at which to set the value + * @param[in] url An instance of Url + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c url is empty. + * @exception E_OUT_OF_RANGE The specified @c index is outside the bounds of the properties. + */ + result SetUrlAt(int index, const Url& url); + + /** + * Sets the specified address corresponding to the specified index. + * + * @since 2.0 + * + * @return An error code + * @param[in] index The index at which to set the value + * @param[in] address An instance of Address + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c address is empty. + * @exception E_OUT_OF_RANGE The specified @c index is outside the bounds of the properties. + */ + result SetAddressAt(int index, const Address& address); + + /** + * Sets the specified ImAddress corresponding to the specified index. + * + * @since 2.0 + * + * @return An error code + * @param[in] index The index at which to set the value + * @param[in] imAddress An instance of ImAddress + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c imAddress is empty. + * @exception E_OUT_OF_RANGE The specified @c index is outside the bounds of the properties. + */ + result SetImAddressAt(int index, const ImAddress& imAddress); + + /** + * Sets the specified note corresponding to the specified index. + * + * @since 2.0 + * + * @return An error code + * @param[in] index The index at which to set the value + * @param[in] note The note to set + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c note is empty. + * @exception E_OUT_OF_RANGE The specified @c index is outside the bounds of the properties. + */ + result SetNoteAt(int index, const Tizen::Base::String& note); + + /** + * Sets the specified nick name corresponding to the specified index. + * + * @since 2.0 + * + * @return An error code + * @param[in] index The index at which to set the value + * @param[in] nickname The nick name to set + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c nickname is empty. + * @exception E_OUT_OF_RANGE The specified @c index is outside the bounds of the properties. + */ + result SetNicknameAt(int index, const Tizen::Base::String& nickname); + + /** + * Sets the specified event corresponding to the specified index. + * + * @since 2.0 + * + * @return An error code + * @param[in] index The index at which to set the value + * @param[in] event The event to set + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The date of the specified @c event has not been set. + * @exception E_OUT_OF_RANGE The specified @c index is outside the bounds of the properties. + */ + result SetEventAt(int index, const ContactEvent& event); + + /** + * Sets the specified organization corresponding to the specified index. + * + * @since 2.0 + * + * @return An error code + * @param[in] index The index at which to set the value + * @param[in] organization The organization to set + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c organization is empty. + * @exception E_OUT_OF_RANGE The specified @c index is outside the bounds of the properties. + */ + result SetOrganizationAt(int index, const Organization& organization); + + /** + * Sets the specified @c relationship corresponding to the specified @c index. + * + * @since 2.1 + * + * @return An error code + * @param[in] index The index at which to set the value + * @param[in] relationship The relationship to set + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c relationship is empty. + * @exception E_OUT_OF_RANGE The specified @c index is outside the bounds of the properties. + */ + result SetRelationshipAt(int index, const Relationship& relationship); + + /** + * Sets the app launch data at the specified index. + * + * @since 2.2 + * + * + * @return An error code + * @param[in] index The index at which to set the contact app launch data + * @param[in] appLaunchData The app launch data to set + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c appLaunchData has no relevant information. + * @exception E_OUT_OF_RANGE The specified @c index is outside the bounds of the app launch data. + */ + result SetContactAppLaunchDataAt(int index, const ContactAppLaunchData& appLaunchData); + + /** + * Gets the addressbook ID. + * + * @since 2.0 + * + * @return The addressbook ID + */ + AddressbookId GetAddressbookId(void) const; + + /** + * Gets the person ID to which this contact is linked. + * + * @since 2.0 + * + * @return The person ID + */ + PersonId GetPersonId(void) const; + + /** + * Gets the list of values belonging to the specific multi value property. + * + * @since 2.0 + * + * @return The list of values belonging to the specific multi value property + * @param[in] id The property ID + * @exception E_SUCCESS The method is successful. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + Tizen::Base::Collection::IList* GetValuesN(ContactMultiPropertyId id) const; + + /** + * Adds the specified phone number to the contact. + * + * @since 2.0 + * + * @return An error code + * @param[in] phoneNumber The phone number to add + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c phoneNumber is empty. + */ + result AddPhoneNumber(const PhoneNumber& phoneNumber); + + /** + * Adds the specified email to the contact. + * + * @since 2.0 + * + * @return An error code + * @param[in] email The email address to add + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c email is empty. + */ + result AddEmail(const Email& email); + + /** + * Adds the specified URL to the contact. + * + * @since 2.0 + * + * @return An error code + * @param[in] url The URL to add + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c url is empty. + */ + result AddUrl(const Url& url); + + /** + * Adds the specified address to the contact. + * + * @since 2.0 + * + * @return An error code + * @param[in] address The address to add + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c address is empty. + */ + result AddAddress(const Address& address); + + /** + * Adds the specified instant message information to the contact. + * + * @since 2.0 + * + * @return An error code + * @param[in] imAddress The IM address to add + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c imAddress is empty. + */ + result AddImAddress(const ImAddress& imAddress); + + /** + * Adds the specified note to the contact. + * + * @since 2.0 + * + * @return An error code + * @param[in] note The note to add + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c note is empty. + */ + result AddNote(const Tizen::Base::String& note); + + /** + * Adds the specified nick name to the contact. + * + * @since 2.0 + * + * @return An error code + * @param[in] nickname The nick name to add + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c nickname is empty. + */ + result AddNickname(const Tizen::Base::String& nickname); + + /** + * Adds the specified event to the contact. + * + * @since 2.0 + * + * @return An error code + * @param[in] event The event to add + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The date of the specified @c event has not been set. + */ + result AddEvent(const ContactEvent& event); + + /** + * Adds the specified organization to the contact. + * + * @since 2.0 + * + * @return An error code + * @param[in] organization The organization to add + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c organization is empty. + */ + result AddOrganization(const Organization& organization); + + /** + * Adds the specified relationship to the contact. + * + * @since 2.0 + * + * @return An error code + * @param[in] relationship The relationship to add + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c organization is empty. + */ + result AddRelationship(const Relationship& relationship); + + /** + * Adds the specified app launch data to the contact. + * + * @since 2.2 + * + * @return An error code + * @param[in] appLaunchData The app launch data to add + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c appLaunchData has no relevant information. + */ + result AddContactAppLaunchData(const ContactAppLaunchData& appLaunchData); + + /** + * Removes the value at the specified index of the multi value property. + * + * @since 2.0 + * + * @return An error code + * @param[in] id The property ID + * @param[in] index The index of the value to remove + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The specified @c index is outside the bounds of the properties. + */ + result RemoveAt(ContactMultiPropertyId id, int index); + + /** + * Checks whether this contact is a favorite. + * + * @since 2.1 + * + * @return @c true if this contact is a favorite, @n + * else @c false + * @see SetAsFavorite() + */ + bool IsFavorite(void) const; + + /** + * Sets or unsets a contact as a favorite. + * + * @since 2.1 + * @see IsFavorite() + */ + void SetAsFavorite(bool isFavorite = true); + + /** + * Copying of objects using this copy assignment operator is allowed. + * + * @since 2.0 + * + * @param[in] rhs An instance of %Contact to copy + */ + Contact& operator =(const Contact& rhs); + +private: + friend class _ContactImpl; + class _ContactImpl* __pContactImpl; + +}; // Contact + +}} // Tizen::Social + +#endif // _FSCL_CONTACT_H_ diff --git a/inc/FSclContactAppLaunchData.h b/inc/FSclContactAppLaunchData.h new file mode 100644 index 0000000..8829ebe --- /dev/null +++ b/inc/FSclContactAppLaunchData.h @@ -0,0 +1,256 @@ +// +// Copyright (c) 2013 Samsung Electronics Co., Ltd. +// +// 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. +// + +/** + * @file FSclContactAppLaunchData.h + * @brief This is the header file for the %ContactAppLaunchData class. + * + * This header file contains the declarations of the %ContactAppLaunchData class. + */ + +#ifndef _FSCL_CONTACT_APP_LAUNCH_DATA_H_ +#define _FSCL_CONTACT_APP_LAUNCH_DATA_H_ + +#include +#include +#include + +namespace Tizen { namespace Base +{ +namespace Collection +{ +class IMap; +} +}} + +namespace Tizen { namespace Social +{ + +/** + * @class ContactAppLaunchData + * @brief This class provides the information required to launch an application from a contact. + * + * @since 2.1 + * + * @final This class is not intended for extension. + * + * The %ContactAppLaunchData class provides the information required to launch an application from a contact. + * This information consists of the application ID, operation ID, MIME type, URI, display text, and extra data. + */ + +class _OSP_EXPORT_ ContactAppLaunchData + :public Tizen::Base::Object +{ +public: + /** + * This is the default constructor for this class. + * + * @since 2.1 + */ + ContactAppLaunchData(void); + + /** + * Copying of objects using this copy constructor is allowed. + * + * @since 2.1 + * + * @param[in] rhs An instance of %ContactAppLaunchData to copy + */ + ContactAppLaunchData(const ContactAppLaunchData& rhs); + + /** + * This destructor overrides Tizen::Base::Object::~Object(). + * + * @since 2.1 + * + */ + virtual ~ContactAppLaunchData(void); + + /** + * Checks whether the value of the specified instance is equal to the value of the current instance of Tizen::Base::Object. + * + * @since 2.1 + * + * @return @c true if the value of the specified instance of Tizen::Base::Object is equal to the value of the current instance of %Tizen::Base::Object, @n + * else @c false + * @param[in] rhs An instance of Tizen::Base::Object to compare + */ + virtual bool Equals(const Tizen::Base::Object& rhs) const; + + /** + * Gets the hash value of the current instance. + * + * @since 2.1 + * + * @return The hash value of the current instance + */ + virtual int GetHashCode(void) const; + + /** + * Gets the display text that describes the data of the contact app launch. + * + * @since 2.1 + * + * @return The text that describes the data of the contact app launch + */ + Tizen::Base::String GetDisplayText(void) const; + + /** + * Gets the application ID. + * + * @since 2.1 + * + * @return The application ID + */ + Tizen::Base::String GetAppId(void) const; + + /** + * Gets the operation ID. + * + * @since 2.1 + * + * @return The operation ID + */ + Tizen::Base::String GetOperationId(void) const; + + /** + * Gets the URI of an application. + * + * @since 2.1 + * + * @return The URI of the application + */ + Tizen::Base::String GetUri(void) const; + + /** + * Gets the MIME type of an application. + * + * @since 2.1 + * + * @return The MIME type of the application + */ + Tizen::Base::String GetMime(void) const; + + /** + * Gets the extra data for a map. + * + * @since 2.1 + * + * @return The key-value map of the extended data where the key and value are of type Tizen::Base::String, @n + * else an empty map if there is no extra data, or @c null if an exception occurs + * @remarks The specific error code can be accessed using the GetlastResult() method. + */ + Tizen::Base::Collection::IMap* GetExtraDataN(void) const; + + /** + * Sets the display text that describes the data of the contact app launch. + * + * @since 2.1 + * + * @param[in] displayText The text that describes the data of the contact app launch + */ + void SetDisplayText(const Tizen::Base::String& displayText); + + /** + * Sets the application ID. + * + * @since 2.1 + * + * @param[in] appId The application ID to set + */ + void SetAppId(const Tizen::Base::String& appId); + + /** + * Sets the operation ID. + * + * @since 2.1 + * + * @param[in] operationId The operation ID to set + */ + void SetOperationId(const Tizen::Base::String& operationId); + + /** + * Sets the URI of an application. + * + * @since 2.1 + * + * @param[in] uri The URI of the application to set + */ + void SetUri(const Tizen::Base::String& uri); + + /** + * Sets the MIME type of an application. + * + * @since 2.1 + * + * @param[in] mime The MIME type of the application to set + */ + void SetMime(const Tizen::Base::String& mime); + + /** + * Sets the extra data to be delivered to an application. + * + * @since 2.1 + * + * @param[in] pExtraData A pointer to the argument map of the key and value pair where the key and value are of type Tizen::Base::String @n + * If @c null is passed, the current extra data is removed. + */ + result SetExtraData(const Tizen::Base::Collection::IMap* pExtraData); + + /** + * Copying of objects using this copy assignment operator is allowed. + * + * @since 2.1 + * + * @param[in] rhs An instance of %ContactAppLaunchData to copy + */ + ContactAppLaunchData& operator =(const ContactAppLaunchData& rhs); + + friend bool operator ==(const ContactAppLaunchData& lhs, const ContactAppLaunchData& rhs); + +private: + friend class _ContactAppLaunchDataImpl; + class _ContactAppLaunchDataImpl* __pContactAppLaunchDataImpl; + +}; // ContactAppLaunchData + +/** + * Compares the two specified instances of %ContactAppLaunchData for equality. + * + * @since 2.1 + * + * @return @c true if the data of the two specified instances are equal, @n + * else @c false + * @param[in] lhs An instance of %ContactAppLaunchData + * @param[in] rhs An instance of %ContactAppLaunchData + */ +_OSP_EXPORT_ bool operator ==(const ContactAppLaunchData& lhs, const ContactAppLaunchData& rhs); + +/** + * Compares the two specified instances of %ContactAppLaunchData for inequality. + * + * @since 2.1 + * + * @return @c true if the data of the two specified instances are not equal, @n + * else @c false + * @param[in] lhs An instance of %ContactAppLaunchData + * @param[in] rhs An instance of %ContactAppLaunchData + */ +_OSP_EXPORT_ bool operator !=(const ContactAppLaunchData& lhs, const ContactAppLaunchData& rhs); + +}} // Tizen::Social + +#endif // _FSCL_CONTACT_APP_LAUNCH_DATA_H_ diff --git a/inc/FSclContactChangeInfo.h b/inc/FSclContactChangeInfo.h new file mode 100644 index 0000000..43749ae --- /dev/null +++ b/inc/FSclContactChangeInfo.h @@ -0,0 +1,152 @@ +// +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// 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. +// +/** + * @file FSclContactChangeInfo.h + * @brief This is the header file for the %ContactChangeInfo class. + * + * This header file contains the declarations of the %ContactChangeInfo class. + */ +#ifndef _FSCL_CONTACT_CHANGE_INFO_H_ +#define _FSCL_CONTACT_CHANGE_INFO_H_ + +#include +#include + +namespace Tizen { namespace Social +{ + +/** + * @class ContactChangeInfo + * @brief This class provides the contact change information. + * + * @since 2.0 + * + * @final This class is not intended for extension. + * + * The %ContactChangeInfo class provides the contact change information. + * + */ +class _OSP_EXPORT_ ContactChangeInfo + : public Tizen::Base::Object +{ +public: + /** + * This is the default constructor for this class. + * + * @since 2.0 + */ + ContactChangeInfo(void); + + /** + * Copying of objects using this copy constructor is allowed. + * + * @since 2.0 + * + * @param[in] rhs An instance of %ContactChangeInfo to copy + */ + ContactChangeInfo(const ContactChangeInfo& rhs); + + /** + * This destructor overrides Tizen::Base::Object::~Object(). + * + * @since 2.0 + */ + virtual ~ContactChangeInfo(void); + + /** + * Checks whether the value of the specified instance is equal to the value of the current instance of Tizen::Base::Object. + * + * @since 2.0 + * + * @return @c true if the value of the specified instance of Tizen::Base::Object is equal to the value of the current instance of %Tizen::Base::Object, @n + * else @c false + * @param[in] rhs An instance of Tizen::Base::Object to compare + */ + virtual bool Equals(const Tizen::Base::Object& rhs) const; + + /** + * Gets the hash value of the current instance. + * + * @since 2.0 + * + * @return The hash value of the current instance + */ + virtual int GetHashCode(void) const; + + /** + * Gets the addressbook ID of the changed contact. + * + * @since 2.0 + * + * @return The addressbook ID + */ + AddressbookId GetAddressbookId(void) const; + + /** + * Gets the ID of the changed contact. + * + * @since 2.0 + * + * @return The contact ID + */ + RecordId GetContactId(void) const; + + /** + * Gets the version. + * + * @since 2.0 + * + * @return The version of the contact + */ + int GetVersion(void) const; + + /** + * Gets the change type. + * + * @since 2.0 + * + * @return The change type + */ + RecordChangeType GetChangeType(void) const; + + /** + * Checks whether the thumbnail has been changed. + * + * @since 2.1 + * + * @return @c true if the thumbnail has been changed, @n + * else @c false + */ + bool IsThumbnailChanged(void) const; + + /** + * Copying of objects using this copy assignment operator is allowed. + * + * @since 2.0 + * + * @param[in] rhs An instance of %ContactChangeInfo to copy + */ + ContactChangeInfo& operator =(const ContactChangeInfo& rhs); + +private: + friend class _ContactChangeInfoImpl; + class _ContactChangeInfoImpl* __pContactChangeInfoImpl; + +}; // ContactChangeInfo + +}} // Tizen::Social + +#endif // _FSCL_CONTACT_CHANGE_INFO_H_ diff --git a/inc/FSclContactEvent.h b/inc/FSclContactEvent.h new file mode 100644 index 0000000..04c74bd --- /dev/null +++ b/inc/FSclContactEvent.h @@ -0,0 +1,188 @@ +// +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// 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. +// +/** +* @file FSclContactEvent.h +* @brief This is the header file for the %ContactEvent class. +* +* This header file contains the declarations of the %ContactEvent class. +*/ +#ifndef _FSCL_CONTACT_EVENT_H_ +#define _FSCL_CONTACT_EVENT_H_ + +#include +#include +#include +#include +#include + +namespace Tizen { namespace Social +{ + +/** +* @class ContactEvent +* @brief This class represents an event. +* +* @since 2.0 +* +* @final This class is not intended for extension. +* +* The %ContactEvent class represents an event. An event consists of the event date, type, and label. +* +*/ +class _OSP_EXPORT_ ContactEvent + : public Tizen::Base::Object +{ +public: + /** + * This is the default constructor for this class. + * + * @since 2.0 + */ + ContactEvent(void); + + /** + * Copying of objects using this copy constructor is allowed. + * + * @since 2.0 + * + * @param[in] rhs An instance of %ContactEvent to copy + */ + ContactEvent(const ContactEvent& rhs); + + /** + * This destructor overrides Tizen::Base::Object::~Object(). + * + * @since 2.0 + */ + virtual ~ContactEvent(void); + + /** + * Checks whether the value of the specified instance is equal to the value of the current instance of Tizen::Base::Object. + * + * @since 2.0 + * + * @return @c true if the value of the specified instance of Tizen::Base::Object is equal to the value of the current instance of %Tizen::Base::Object, @n + * else @c false + * @param[in] rhs An instance of Tizen::Base::Object to compare + */ + virtual bool Equals(const Tizen::Base::Object& rhs) const; + + /** + * Gets the hash value of the current instance of Tizen::Base::Object. + * + * @since 2.0 + * + * @return The integer value that indicates the hash value of the current instance of Tizen::Base::Object + */ + virtual int GetHashCode(void) const; + + /** + * Gets the event type. + * + * @since 2.0 + * + * @return The event type + */ + ContactEventType GetType(void) const; + + /** + * Gets the event date. + * + * @since 2.0 + * + * @return The event date + */ + Tizen::Base::DateTime GetDate(void) const; + + /** + * Gets the label of an event. + * + * @since 2.0 + * + * @return The event label + * @see SetLabel() + */ + Tizen::Base::String GetLabel(void) const; + + /** + * Sets the event type. + * + * @since 2.0 + * + * @param[in] type The event type + */ + void SetType(ContactEventType type); + + /** + * Sets the label of an event. + * + * @since 2.0 + * + * @param[in] label The event label + * @see GetLabel() + */ + void SetLabel(const Tizen::Base::String& label); + + /** + * Sets the event date. @n + * The time portion of Tizen::Base::DateTime is ignored. The default time is 00:00:00. + * + * @since 2.0 + * + * @param[in] date The event date + */ + void SetDate(const Tizen::Base::DateTime& date); + + /** + * Copying of objects using this copy assignment operator is allowed. + * + * @since 2.0 + * + * @param[in] rhs An instance of %ContactEvent to copy + */ + ContactEvent& operator =(const ContactEvent& rhs); + + /** + * Checks whether the data in the specified instance of %ContactEvent is equal to the data in the current instance. + * + * @since 2.0 + * + * @return @c true if the data in the specified instance equals the data in the current instance, @n + * else @c false + * @param[in] rhs An instance of %ContactEvent + */ + bool operator ==(const ContactEvent& rhs) const; + + /** + * Checks whether the data in the specified instance of %ContactEvent is not equal to the data in the current instance. + * + * @since 2.0 + * + * @return @c true if the data in the specified instance is not equal to the data in the current instance, @n + * else @c false + * @param[in] rhs An instance of %ContactEvent + */ + bool operator !=(const ContactEvent& rhs) const; + +private: + friend class _ContactEventImpl; + class _ContactEventImpl* __pContactEventImpl; + +}; // ContactEvent + +}} // Tizen::Social + +#endif // _FSCL_CONTACT_EVENT_H_ diff --git a/inc/FSclEmail.h b/inc/FSclEmail.h new file mode 100644 index 0000000..0cccec8 --- /dev/null +++ b/inc/FSclEmail.h @@ -0,0 +1,266 @@ +// +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// 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. +// +/** +* @file FSclEmail.h +* @brief This is the header file for the %Email class. +* +* This header file contains the declarations of the %Email class. +*/ +#ifndef _FSCL_EMAIL_H_ +#define _FSCL_EMAIL_H_ + +#include +#include +#include +#include + +namespace Tizen { namespace Social +{ + +/** +* @class Email +* @brief This class represents an email. +* +* @since 2.0 +* +* @final This class is not intended for extension. +* +* The %Email class represents an email. +* An email consists of the email address and email type. +* +* The following example demonstrates how to use the %Email class. +* +* @code +using namespace Tizen::Base; +using namespace Tizen::Social; + +result +MyClass::SomeMethod(void) +{ + result r = E_SUCCESS; + + // Creates an instance of %Email + Email email = Email(); + + // Sets the email address + r = email.SetEmail(L"hello@Tizen.com"); + if (IsFailed(r)) + { + return r; + } + + // Sets the email type + email.SetType(EMAIL_TYPE_PERSONAL); + + return E_SUCCESS; +} +* @endcode +*/ +class _OSP_EXPORT_ Email + : public Tizen::Base::Object +{ +public: + /** + * This is the default constructor for this class. + * + * @since 2.0 + */ + Email(void); + + /** + * Initializes this instance of %Email with the specified @c type and @c email. @n + * This constructs an instance of %Email with the specified @c type. + * + * @since 2.0 + * + * @param[in] type The type of email + * @param[in] email The email address + */ + Email(EmailType type, const Tizen::Base::String& email); + + /** + * Copying of objects using this copy constructor is allowed. + * + * @since 2.0 + * + * @param[in] rhs An instance of %Email to copy + */ + Email(const Email& rhs); + + /** + * This destructor overrides Tizen::Base::Object::~Object(). + * + * @since 2.0 + */ + virtual ~Email(void); + + /** + * Checks whether the value of the specified instance is equal to the value of the current instance of Tizen::Base::Object. + * + * @since 2.0 + * + * @return @c true if the value of the specified instance of Tizen::Base::Object is equal to the value of the current instance of %Tizen::Base::Object, @n + * else @c false + * @param[in] rhs An instance of Tizen::Base::Object to compare + */ + virtual bool Equals(const Tizen::Base::Object& rhs) const; + + /** + * Gets the hash value of the current instance of Tizen::Base::Object. + * + * @since 2.0 + * + * @return The integer value that indicates the hash value of the current instance of Tizen::Base::Object + */ + virtual int GetHashCode(void) const; + + /** + * Gets the type of the email. + * + * @if OSPCOMPAT + * @brief [Compatibility] + * @endif + * @since 2.0 + * @if OSPCOMPAT + * @compatibility This method has compatibility issues with OSP compatible applications. @n + * For more information, see @ref CompEmailGetTypePage "here". + * @endif + * + * @return The type of the email + */ + EmailType GetType(void) const; + + /** + * @if OSPCOMPAT + * @page CompEmailGetTypePage Compatibility for GetType() + * @section CompEmailGetTypePageIssueSection Issues + * Implementing this method in OSP compatible applications has the following issue: @n + * -# EMAIL_TYPE_CUSTOM is not supported. If the type of the email is EMAIL_TYPE_CUSTOM, EMAIL_TYPE_OTHER is returned instead. + * + * @section CompEmailGetTypePageSolutionSection Resolutions + * The issue mentioned above has been resolved in Tizen. + * @endif + */ + + /** + * Gets the email address. + * + * @since 2.0 + * + * @return The email address + */ + Tizen::Base::String GetEmail(void) const; + + /** + * Sets the type of the email. + * + * @since 2.0 + * + * @param[in] type The type of the email to set + */ + void SetType(EmailType type); + + /** + * Sets the email address. + * + * @if OSPCOMPAT + * @brief [Compatibility] + * @endif + * @since 2.0 + * @if OSPCOMPAT + * @compatibility This method has compatibility issues with OSP compatible applications. @n + * For more information, see @ref CompEmailSetEmailPage "here". + * @endif + * + * @return An error code + * @param[in] email The email address + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c email address is an empty string. + */ + result SetEmail(const Tizen::Base::String& email); + + /** + * @if OSPCOMPAT + * @page CompEmailSetEmailPage Compatibility for SetEmail() + * @section CompEmailSetEmailPageIssueSection Issues + * Implementing this method in OSP compatible applications has the following issue: @n + * -# If the length of an email address to be set is greater than 100 characters, E_INVALID_ARG is returned. + * + * @section CompEmailSetEmailPageSolutionSection Resolutions + * The issue mentioned above has been resolved in Tizen. + * @endif + */ + + /** + * Gets the label of an email. + * + * @since 2.0 + * + * @return The email label + * @see SetLabel() + */ + Tizen::Base::String GetLabel(void) const; + + /** + * Sets the label of an email. + * + * @since 2.0 + * + * @param[in] label The email label + * @see GetLabel() + */ + void SetLabel(const Tizen::Base::String& label); + + /** + * Copying of objects using this copy assignment operator is allowed. + * + * @since 2.0 + * + * @param[in] rhs An instance of %Email to copy + */ + Email& operator =(const Email& rhs); + + /** + * Checks whether the value of the specified instance of %Email is equal to the value of the current instance. + * + * @since 2.0 + * + * @return @c true if the value of the specified instance of %Email equals the value of the current instance, @n + * else @c false + * @param[in] rhs An instance of %Email + */ + bool operator ==(const Email& rhs) const; + + /** + * Checks whether the value of the specified instance of %Email is not equal to the value of the current instance. + * + * @since 2.0 + * + * @return @c true if the value of the specified instance of %Email is not equal to the value of the current instance, @n + * else @c false + * @param[in] rhs An instance of %Email + */ + bool operator !=(const Email& rhs) const; + +private: + friend class _EmailImpl; + class _EmailImpl* __pEmailImpl; + +}; // Email + +}} // Tizen::Social + +#endif // _FSCL_EMAIL_H_ diff --git a/inc/FSclEmailContact.h b/inc/FSclEmailContact.h new file mode 100644 index 0000000..3307869 --- /dev/null +++ b/inc/FSclEmailContact.h @@ -0,0 +1,174 @@ +// +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// 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. +// +/** + * @file FSclEmailContact.h + * @brief This is the header file for the %EmailContact class. + * + * This header file contains the declarations of the %EmailContact class. + */ +#ifndef _FSCL_EMAIL_CONTACT_H_ +#define _FSCL_EMAIL_CONTACT_H_ + +#include +#include +#include +#include +#include + +namespace Tizen { namespace Social +{ + /** + * @class EmailContact + * @brief This class provides the summarized contact information with the email. + * + * @since 2.0 + * + * @final This class is not intended for extension. + * + * The %EmailContact class provides the summarized contact information. @n + * This provides part of the contact information such as the ID, person ID, addressbook ID, display name, ringtone, thumbnail, and email. + */ +class _OSP_EXPORT_ EmailContact + : public Tizen::Base::Object +{ + +public: + /** + * This is the default constructor for this class. + * + * @since 2.0 + */ + EmailContact(void); + + /** + * Copying of objects using this copy constructor is allowed. + * + * @since 2.0 + * + * @param[in] rhs An instance of %EmailContact to copy + */ + EmailContact(const EmailContact& rhs); + + /** + * This destructor overrides Tizen::Base::Object::~Object(). + * + * @since 2.0 + */ + virtual ~EmailContact(void); + + /** + * Checks whether the value of the specified instance is equal to the value of the current instance of Tizen::Base::Object. + * + * @since 2.0 + * + * @return @c true if the value of the specified instance of Tizen::Base::Object is equal to the value of the current instance of %Tizen::Base::Object, @n + * else @c false + * @param[in] rhs An instance of Tizen::Base::Object to compare + */ + virtual bool Equals(const Tizen::Base::Object& rhs) const; + + /** + * Gets the hash value of the current instance. + * + * @since 2.0 + * + * @return The hash value of the current instance + */ + virtual int GetHashCode(void) const; + + /** + * Gets the addressbook ID. + * + * @since 2.0 + * + * @return The addressbook ID + */ + AddressbookId GetAddressbookId(void) const; + + /** + * Gets the person ID. + * + * @since 2.0 + * + * @return The person ID + */ + PersonId GetPersonId(void) const; + + /** + * Gets the contact ID. + * + * @since 2.0 + * + * @return The contact ID + */ + RecordId GetContactId(void) const; + + /** + * Gets the display name. + * + * @since 2.0 + * + * @return The display name + */ + Tizen::Base::String GetDisplayName(void) const; + + /** + * Gets the ringtone path. + * + * @since 2.0 + * + * @return The ringtone path, @n + * else an empty string if the ringtone path has not been set for this contact + */ + Tizen::Base::String GetRingtonePath(void) const; + + /** + * Gets the thumbnail path. + * + * @since 2.0 + * + * @return The thumbnail path, @n + * else an empty string if the thumbnail path has not been set for this contact + */ + Tizen::Base::String GetThumbnailPath(void) const; + + /** + * Gets the email. + * + * @since 2.0 + * + * @return An Email instance + */ + Email GetEmail(void) const; + + /** + * Copying of objects using this copy assignment operator is allowed. + * + * @since 2.0 + * + * @param[in] rhs An instance of %EmailContact to copy + */ + EmailContact& operator =(const EmailContact& rhs); + +private: + friend class _EmailContactImpl; + class _EmailContactImpl* __pEmailContactImpl; + +}; // EmailContact + +}} // Tizen::Social + +#endif // _FSCL_EMAIL_CONTACT_H_ diff --git a/inc/FSclIAccountEventListener.h b/inc/FSclIAccountEventListener.h new file mode 100644 index 0000000..465540d --- /dev/null +++ b/inc/FSclIAccountEventListener.h @@ -0,0 +1,134 @@ +// +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// 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. +// +/** + * @file FSclIAccountEventListener.h + * @brief This is the header file for the %IAccountEventListener interface. + * + * This header file contains the declarations of the %IAccountEventListener interface. + */ +#ifndef _FSCL_IACCOUNT_EVENT_LISTENER_H_ +#define _FSCL_IACCOUNT_EVENT_LISTENER_H_ + +#include +#include + +namespace Tizen { namespace Base { namespace Collection { +class IList; +} } } + +namespace Tizen { namespace Social +{ + +/** + * @interface IAccountEventListener + * @brief This interface provides a listener that receives the events associated with account changes. + * + * @since 2.1 + * + * The %IAccountEventListener interface provides a listener that receives the events associated with account changes. + * + */ +class _OSP_EXPORT_ IAccountEventListener + : virtual public Tizen::Base::Runtime::IEventListener +{ +public: + + /** + * This polymorphic destructor should be overridden if required. @n + * This way, the destructors of the derived classes are called when the destructor of this interface is called. + * + * @since 2.1 + */ + virtual ~IAccountEventListener(void) {} + + /** + * Called to notify when an account is added. + * + * @since 2.1 + * + * @param[in] accountId The account ID of the added account + */ + virtual void OnAccountAdded(AccountId accountId) = 0; + + /** + * Called to notify when an account is updated. + * + * @since 2.1 + * + * @param[in] accountId The account ID of the updated account + */ + virtual void OnAccountUpdated(AccountId accountId) = 0; + + /** + * Called to notify when an account is removed. + * + * @since 2.1 + * + * @param[in] accountId The account ID of the removed account + */ + virtual void OnAccountRemoved(AccountId accountId) = 0; + +protected: + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // This method is reserved and may change its name at any time without prior notice. + // + // @since 2.1 + // + virtual void IAccountEventListener_Reserved1(void){ } + + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // This method is reserved and may change its name at any time without prior notice. + // + // @since 2.1 + // + virtual void IAccountEventListener_Reserved2(void){ } + + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // This method is reserved and may change its name at any time without prior notice. + // + // @since 2.1 + // + virtual void IAccountEventListener_Reserved3(void){ } + + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // This method is reserved and may change its name at any time without prior notice. + // + // @since 2.1 + // + virtual void IAccountEventListener_Reserved4(void){ } + + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // This method is reserved and may change its name at any time without prior notice. + // + // @since 2.1 + // + virtual void IAccountEventListener_Reserved5(void){ } + +}; // IAccountEventListener + +}} // Tizen::Social + +#endif // _FSCL_IACCOUNT_EVENT_LISTENER_H_ diff --git a/inc/FSclIAddressbookChangeEventListener.h b/inc/FSclIAddressbookChangeEventListener.h new file mode 100644 index 0000000..99c3e2c --- /dev/null +++ b/inc/FSclIAddressbookChangeEventListener.h @@ -0,0 +1,148 @@ +// +// Copyright (c) 2013 Samsung Electronics Co., Ltd. +// +// 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. +// +/** +* @file FSclIAddressbookChangeEventListener.h +* @brief This is the header file for the %IAddressbookChangeEventListener interface. +* +* This header file contains the declarations of the %IAddressbookChangeEventListener interface. +*/ + +#ifndef _FSCL_IADDRESSBOOK_CHANGE_EVENT_LISTENER_H_ +#define _FSCL_IADDRESSBOOK_CHANGE_EVENT_LISTENER_H_ + +#include + +namespace Tizen { namespace Base { namespace Collection { +class IList; +}}} + +namespace Tizen { namespace Social +{ + +/** + * @interface IAddressbookChangeEventListener + * @brief This interface provides a listener that receives the events associated with contact and category changes. + * + * @since 2.1 + * + * The %IAddressbookChangeEventListener interface provides a listener that receives the events associated with contact and category changes. + * + */ + +class _OSP_EXPORT_ IAddressbookChangeEventListener + : virtual public Tizen::Base::Runtime::IEventListener +{ +public: + /** + * This polymorphic destructor should be overridden if required. @n + * This way, the destructors of the derived classes are called when the destructor of this interface is called. + * + * @since 2.1 + */ + virtual ~IAddressbookChangeEventListener(void) {} + + /** + * Called to notify when changes have been made to contacts. @n + * A list of ContactChangeInfo instances is passed. + * + * @since 2.1 + * + * @param[in] contactChangeInfoList The list of contact change information (@ref ContactChangeInfo list) + * @remarks This listener method is called when the following changes have occurred: @n + + * - Contacts are added, updated, or removed + * - Contacts are added/removed to/from categories + * + * The following example demonstrates how to use the %OnContactsChanged() method. + * @code + * void + * MyApplication::OnContactsChangedN(const IList& contactChangeInfoList) + * { + * IEnumerator* pEnum = contactChangeInfoList.GetEnumeratorN(); + * while (pEnum->MoveNext() == E_SUCCESS) + * { + * ContactChangeInfo* pInfo = (ContactChangeInfo*) pEnum->GetCurrent(); + * + * AppLog("Contact changed: type(%d), id(%d), version(%d)", pInfo->GetChangeType(), pInfo->GetContctId(), pInfo->GetVersion()); + * } + * delete pEnum; + * } + * @endcode + * + */ + virtual void OnContactsChanged(const Tizen::Base::Collection::IList& contactChangeInfoList) = 0; + + /** + * Called to notify when changes have been made to categories. @n + * A list of CategoryChangeInfo instances are passed. + * + * @since 2.1 + * + * @param[in] categoryChangeInfoList The list of category change information (@ref CategoryChangeInfo list) + * @remarks This listener method is called when the following changes have occurred: + * - Categories are added, updated, or removed + * + * The following example demonstrates how to use the %OnCategoriesChanged() method. + * @code + * void + * MyApplication::OnCategoriesChangedN(const IList& categoryChangeInfoList) + * { + * IEnumerator* pEnum = categoryChangeInfoList.GetEnumeratorN(); + * while (pEnum->MoveNext() == E_SUCCESS) + * { + * CategoryChangeInfo* pInfo = (CategoryChangeInfo*) pEnum->GetCurrent(); + * + * AppLog("Category changed: type(%d), id(%d), version(%d)", pInfo->GetChangeType(), pInfo->GetCategoryId(), pInfo->GetVersion()); + * } + * delete pEnum; + * } + * @endcode + * + */ + virtual void OnCategoriesChanged(const Tizen::Base::Collection::IList& categoryChangeInfoList) = 0; + +protected: + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // This method is reserved and may change its name at any time without prior notice. + // + // @since 2.1 + // + virtual void IAddressbookChangeEventListener_Reserved1(void){ } + + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // This method is reserved and may change its name at any time without prior notice. + // + // @since 2.1 + // + virtual void IAddressbookChangeEventListener_Reserved2(void){ } + + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // This method is reserved and may change its name at any time without prior notice. + // + // @since 2.1 + // + virtual void IAddressbookChangeEventListener_Reserved3(void){ } +}; // IAddressbookChangeEventListener + +}} // Tizen::Social + +#endif // _FSCL_IADDRESSBOOK_CHANGE_EVENT_LISTENER_H_ diff --git a/inc/FSclIAddressbookEventListener.h b/inc/FSclIAddressbookEventListener.h new file mode 100644 index 0000000..b154a41 --- /dev/null +++ b/inc/FSclIAddressbookEventListener.h @@ -0,0 +1,158 @@ +// +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// 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. +// +/** + * @file FSclIAddressbookEventListener.h + * @brief This is the header file for the %IAddressbookEventListener interface. + * + * This header file contains the declarations of the %IAddressbookEventListener interface. + */ +#ifndef _FSCL_IADDRESSBOOK_EVENT_LISTENER_H_ +#define _FSCL_IADDRESSBOOK_EVENT_LISTENER_H_ + +#include + +namespace Tizen { namespace Base { namespace Collection { +class IList; +} } } + +namespace Tizen { namespace Social +{ + +/** + * @interface IAddressbookEventListener + * @brief [Deprecated] This interface provides a listener that receives the events associated with contact and category changes. + * + * @deprecated This interface is deprecated. Instead of using this listener, use IAddressbookChangeEventListener. + * @since 2.0 + * + * The %IAddressbookEventListener interface provides a listener that receives the events associated with contact and category changes. + * + */ +class _OSP_EXPORT_ IAddressbookEventListener + : virtual public Tizen::Base::Runtime::IEventListener +{ +public: + + /** + * This polymorphic destructor should be overridden if required. @n + * This way, the destructors of the derived classes are called when the destructor of this interface is called. + * + * @brief [Deprecated] + * @deprecated This method is deprecated because the %IAddressbookEventListener interface is deprecated. + * + * @since 2.0 + */ + virtual ~IAddressbookEventListener(void) {} + + /** + * Called to notify when contacts are changed. @n + * A list of ContactChangeInfo instances is passed. + * + * @brief [Deprecated] + * @deprecated This method is deprecated because the %IAddressbookEventListener interface is deprecated. + * + * @since 2.0 + * + * @param[in] contactChangeInfoList The list of contact change information (@ref ContactChangeInfo list) + * @remarks This listener method is called when the following changes have occurred: + * - Contacts are added, updated, or removed + * - Contacts are added/removed to/from categories + * + * The following example demonstrates how to use the %OnContactsChanged() method. + * @code + * void + * MyApplication::OnContactsChangedN(const IList& contactChangeInfoList) + * { + * IEnumerator* pEnum = contactChangeInfoList.GetEnumeratorN(); + * while (pEnum->MoveNext() == E_SUCCESS) + * { + * ContactChangeInfo* pInfo = (ContactChangeInfo*) pEnum->GetCurrent(); + * + * AppLog("Contact changed: type(%d), id(%d), version(%d)", pInfo->GetChangeType(), pInfo->GetContctId(), pInfo->GetVersion()); + * } + * delete pEnum; + * } + * @endcode + * + */ + virtual void OnContactsChanged(const Tizen::Base::Collection::IList& contactChangeInfoList) = 0; + + /** + * Called to notify when categories are changed. @n + * A list of CategoryChangeInfo instances is passed. + * + * @brief [Deprecated] + * @deprecated This method is deprecated because the %IAddressbookEventListener interface is deprecated. + * + * @since 2.0 + * + * @param[in] categoryChangeInfoList The list of category change information (@ref CategoryChangeInfo list) + * @remarks This listener method is called when the following changes have occurred: + * - Categories are added, updated, or removed + * - Contacts are added/removed to/from categories + * + * The following example demonstrates how to use the %OnCategoriesChanged() method. + * @code + * void + * MyApplication::OnCategoriesChangedN(const IList& categoryChangeInfoList) + * { + * IEnumerator* pEnum = categoryChangeInfoList.GetEnumeratorN(); + * while (pEnum->MoveNext() == E_SUCCESS) + * { + * CategoryChangeInfo* pInfo = (CategoryChangeInfo*) pEnum->GetCurrent(); + * + * AppLog("Category changed: type(%d), id(%d), version(%d)", pInfo->GetChangeType(), pInfo->GetCategoryId(), pInfo->GetVersion()); + * } + * delete pEnum; + * } + * @endcode + * + */ + virtual void OnCategoriesChanged(const Tizen::Base::Collection::IList& categoryChangeInfoList) = 0; + +protected: + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // This method is reserved and may change its name at any time without prior notice. + // + // @since 2.0 + // + virtual void IAddressbookEventListener_Reserved1(void){ } + + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // This method is reserved and may change its name at any time without prior notice. + // + // @since 2.0 + // + virtual void IAddressbookEventListener_Reserved2(void){ } + + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // This method is reserved and may change its name at any time without prior notice. + // + // @since 2.0 + // + virtual void IAddressbookEventListener_Reserved3(void){ } + +}; // IAddressbookEventListener + +}} // Tizen::Social + +#endif // _FSCL_IADDRESSBOOK_EVENT_LISTENER_H_ diff --git a/inc/FSclICalendarbookEventListener.h b/inc/FSclICalendarbookEventListener.h new file mode 100644 index 0000000..c4e6653 --- /dev/null +++ b/inc/FSclICalendarbookEventListener.h @@ -0,0 +1,107 @@ +// +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// 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. +// +/** + * @file FSclICalendarbookEventListener.h + * @brief This is the header file for the %ICalendarbookEventListener interface. + * + * This header file contains the declarations of the %ICalendarbookEventListener interface. + */ +#ifndef _FSCL_ICALENDARBOOK_EVENT_LISTENER_H_ +#define _FSCL_ICALENDARBOOK_EVENT_LISTENER_H_ + +#include + +namespace Tizen { namespace Base { namespace Collection +{ +class IList; +}}} + +namespace Tizen { namespace Social +{ + +/** + * @interface ICalendarbookEventListener + * @brief This interface provides a listener that receives the events associated with the calendarbook. + * + * @since 2.0 + * + * The %ICalendarbookEventListener interface provides a listener that receives the events associated with the calendarbook. + */ +class _OSP_EXPORT_ ICalendarbookEventListener + : virtual public Tizen::Base::Runtime::IEventListener +{ +public: + + /** + * This polymorphic destructor should be overridden if required. @n + * This way, the destructors of the derived classes are called when the destructor of this interface is called. + * + * @since 2.0 + */ + virtual ~ICalendarbookEventListener(void) {} + + /** + * Called to notify when the calendar events are changed. + * + * @since 2.0 + * + * @param[in] eventChangeInfoList The list of changed event information represented by CalEventChangeInfo + */ + virtual void OnCalendarEventsChanged(const Tizen::Base::Collection::IList& eventChangeInfoList) = 0; + + /** + * Called to notify when the calendar to-dos are changed. + * + * @since 2.0 + * + * @param[in] todoChangeInfoList The list of changed to-do information represented by CalTodoChangeInfo + */ + virtual void OnCalendarTodosChanged(const Tizen::Base::Collection::IList& todoChangeInfoList) = 0; + +protected: + + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // This method is reserved and may change its name at any time without prior notice. + // + // @since 2.0 + // + virtual void ICalendarbookEventListener_Reserved1(void) { } + + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // This method is reserved and may change its name at any time without prior notice. + // + // @since 2.0 + // + virtual void ICalendarbookEventListener_Reserved2(void) { } + + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // This method is reserved and may change its name at any time without prior notice. + // + // @since 2.0 + // + virtual void ICalendarbookEventListener_Reserved3(void) { } + +}; // ICalendarbookEventListener + +}} // Tizen::Social + +#endif // _FSCL_ICALENDARBOOK_EVENT_LISTENER_H_ diff --git a/inc/FSclIRecordEventListener.h b/inc/FSclIRecordEventListener.h new file mode 100644 index 0000000..681a988 --- /dev/null +++ b/inc/FSclIRecordEventListener.h @@ -0,0 +1,124 @@ +// +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// 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. +// +/** + * @file FSclIRecordEventListener.h + * @brief This is the header file for the %IRecordEventListener interface. + * + * This header file contains the declarations of the %IRecordEventListener interface. + */ +#ifndef _FSCL_IRECORD_EVENT_LISTENER_H_ +#define _FSCL_IRECORD_EVENT_LISTENER_H_ + +#include +#include +#include + +namespace Tizen { namespace Base { namespace Collection +{ +class IList; +}}} + +namespace Tizen { namespace Social +{ + +/** + * @if OSPDEPREC + * @interface IRecordEventListener + * @brief [Deprecated] This interface provides a listener that receives the events associated with a record. + * + * @deprecated This interface is deprecated. Instead of using this listener, use IAddressbookEventListener or ICalendarbookEventListener. + * + * @since 2.0 + * + * The %IRecordEventListener interface provides a listener that receives the events associated with a record. + * @endif + */ +class _OSP_EXPORT_ IRecordEventListener + : virtual public Tizen::Base::Runtime::IEventListener +{ +public: + + /** + * @if OSPDEPREC + * This polymorphic destructor should be overridden if required. @n + * This way, the destructors of the derived classes are called when the destructor of this interface is called. + * + * @brief [Deprecated] + * @deprecated This method is deprecated because the %IRecordEventListener interface is deprecated. @n + * Instead of using this listener, use IAddressbookEventListener or ICalendarbookEventListener. + * + * @since 2.0 + * @endif + */ + virtual ~IRecordEventListener(void) {} + + /** + * @if OSPDEPREC + * Called to notify when a record in the data storage is changed externally. + * + * @if OSPCOMPAT + * @brief [Deprecated][Compatibility] + * @endif + * @deprecated This method is deprecated because the %IRecordEventListener interface is deprecated. @n + * Instead of using this listener, use IAddressbookEventListener or ICalendarbookEventListener. + * + * @since 2.0 + * @if OSPCOMPAT + * @compatibility This method has compatibility issues with OSP compatible applications. @n + * For more information, see @ref CompIRecordEventListenerOnRecordChangedNPage "here". + * @endif + * + * @param[in] eventType The operation type + * @param[in] recordType The record type of the changed record + * @param[in] record The Record instance that has changed @n + * If the eventType is #RECORD_REMOVED, the %Record instance only has @c recordId and @c recordType but no data. @n + * When multiple records have changed (#MULTI_RECORDS_ADDED, #MULTI_RECORDS_UPDATED, #MULTI_RECORDS_REMOVED), + * the %Record instance is an invalid record instance with ::INVALID_RECORD_ID. + * @param[in] pUpdatedProperties This parameter is not supported, do not use it. + * @param[in] pUpdatedMultiProperties This parameter is not supported, do not use it. + * @endif + */ + virtual void OnRecordChangedN(RecordEventType eventType, RecordType recordType, Record& record, Tizen::Base::Collection::IList* pUpdatedProperties, Tizen::Base::Collection::IList* pUpdatedMultiProperties) = 0; + + /** + * @if OSPCOMPAT + * @page CompIRecordEventListenerOnRecordChangedNPage Compatibility for OnRecordChangedN() + * @section CompIRecordEventListenerOnRecordChangedNPageIssueSection Issues + * Implementation of this method has the following issue: @n + * Even in OSP compatible applications, we cannot support the following operation. + * -# If an application "A" changes a record, all the applications except "A" receive the change notification. + * + * In Tizen (including OSP compatible applications), + * -# If an application "A" changes a record, all the applications including "A" receive the change notification. + * @endif + */ + +protected: + + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // This method is reserved and may change its name at any time without prior notice. + // + // @since 2.0 + // + virtual void IRecordEventListener_Reserved1(void) { } + +}; // IRecordEventListener + +}} // Tizen::Social + +#endif // _FSCL_IRECORD_EVENT_LISTENER_H_ diff --git a/inc/FSclIRecordListener.h b/inc/FSclIRecordListener.h new file mode 100644 index 0000000..28bc520 --- /dev/null +++ b/inc/FSclIRecordListener.h @@ -0,0 +1,112 @@ +// +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// 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. +// +/** + * @file FSclIRecordListener.h + * @brief This is the header file for the %IRecordListener interface. + * + * This header file contains the declarations of the %IRecordListener interface. + */ +#ifndef _FSCL_IRECORD_LISTENER_H_ +#define _FSCL_IRECORD_LISTENER_H_ + +#include +#include + +namespace Tizen { namespace Base { namespace Collection +{ +class IList; +}}} + +namespace Tizen { namespace Social +{ + +/** + * @if OSPDEPREC + * @interface IRecordListener + * @brief [Deprecated] This interface represents a listener to asynchronously retrieve records from the Calendarbook or Addressbook. + * + * @deprecated This interface is deprecated because the @ref Calendarbook::GetEventInstances method is deprecated. + * + * @since 2.0 + * + * The %IRecordListener interface represents a listener to asynchronously retrieve records from the Calendarbook or Addressbook. + * @endif + */ +class _OSP_EXPORT_ IRecordListener + : virtual public Tizen::Base::Runtime::IEventListener +{ +public: + + /** + * @if OSPDEPREC + * This polymorphic destructor should be overridden if required. @n + * This way, the destructors of the derived classes are called when the destructor of this interface is called. + * + * @brief [Deprecated] + * @deprecated This method is deprecated because the %IRecordListener interface is deprecated. + * + * @since 2.0 + * @endif + */ + virtual ~IRecordListener(void) {} + + /** + * @if OSPDEPREC + * Called when the requested records are retrieved. + * + * @brief [Deprecated] + * @deprecated This method is deprecated because the %IRecordListener interface is deprecated. + * + * @since 2.0 + * + * @param[in] reqId The request ID + * @param[in] pRecords The result of a specific asynchronous method @n + * The list that contains all the retrieved Record instances, @n + * else an empty list if there are no retrieved records, or @c null if an exception occurs + * @param[in] r The result of the request + * @exception E_SUCCESS The request is successful. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks After using @c pRecords, the application must delete it. + * @see Calendarbook::GetEventInstances() + * @endif + */ + virtual void OnRecordsReceivedN(RequestId reqId, Tizen::Base::Collection::IList* pRecords, result r) = 0; + +protected: + + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // This method is reserved and may change its name at any time without prior notice. + // + // @since 2.0 + // + virtual void IRecordListener_Reserved1(void) { } + + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // This method is reserved and may change its name at any time without prior notice. + // + // @since 2.0 + // + virtual void IRecordListener_Reserved2(void) { } + +}; // IRecordListener + +}} // Tizen::Social + +#endif // _FSCL_IRECORD_LISTENER_H_ diff --git a/inc/FSclImAddress.h b/inc/FSclImAddress.h new file mode 100644 index 0000000..3f4f755 --- /dev/null +++ b/inc/FSclImAddress.h @@ -0,0 +1,376 @@ +// +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// 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. +// +/** +* @file FSclImAddress.h +* @brief This is the header file for the %ImAddress class. +* +* This header file contains the declarations of the %ImAddress class. +*/ +#ifndef _FSCL_IM_ADDRESS_H_ +#define _FSCL_IM_ADDRESS_H_ + +#include +#include +#include + +namespace Tizen { namespace Social +{ +/** + * @if OSPDEPREC + * The maximum length of the IM address property. + * + * @brief [Deprecated] + * @deprecated This constant is deprecated because there is no limitation any more. + * @since 2.0 + * @endif + */ +static const int MAX_IM_ADDRESS_LENGTH = 100; + +/** + * @if OSPDEPREC + * The IM service provider name for MSN. + * + * @brief [Deprecated] + * @deprecated This object is provided only for backward compatibility and will be deleted in the near future. + * Use IM_ADDRESS_MSN instead of this object. + * @since 2.0 + * @endif + */ +_OSP_EXPORT_ extern const Tizen::Base::String IM_MSN; + +/** + * @if OSPDEPREC + * The IM service provider name for ICQ. + * + * @brief [Deprecated] + * @deprecated This object is provided only for backward compatibility and will be deleted in the near future. + * Use IM_ADDRESS_ICQ instead of this object. + * @since 2.0 + * @endif + */ +_OSP_EXPORT_ extern const Tizen::Base::String IM_ICQ; + +/** + * @if OSPDEPREC + * The IM service provider name for AIM. + * + * @brief [Deprecated] + * @deprecated This object is provided only for backward compatibility and will be deleted in the near future. + * Use IM_ADDRESS_AIM instead of this object. + * @since 2.0 + * @endif + */ +_OSP_EXPORT_ extern const Tizen::Base::String IM_AIM; + +/** + * @if OSPDEPREC + * The IM service provider name for Yahoo. + * + * @brief [Deprecated] + * @deprecated This object is provided only for backward compatibility and will be deleted in the near future. + * Use IM_ADDRESS_YAHOO instead of this object. + * @since 2.0 + * @endif + */ +_OSP_EXPORT_ extern const Tizen::Base::String IM_YAHOO; + +/** + * @if OSPDEPREC + * The IM service provider name for Jabber. + * + * @brief [Deprecated] + * @deprecated This object is provided only for backward compatibility and will be deleted in the near future. + * Use IM_ADDRESS_JABBER instead of this object. + * @since 2.0 + * @endif + */ +_OSP_EXPORT_ extern const Tizen::Base::String IM_JABBER; + +/** + * @if OSPDEPREC + * The IM service provider name for Google talk. + * + * @brief [Deprecated] + * @deprecated This object is provided only for backward compatibility and will be deleted in the near future. + * Use IM_ADDRESS_GTALK instead of this object. + * @since 2.0 + * @endif + */ +_OSP_EXPORT_ extern const Tizen::Base::String IM_GTALK; + +/** + * @if OSPDEPREC + * The IM service provider name for Skype. + * + * @brief [Deprecated] + * @deprecated This object is provided only for backward compatibility and will be deleted in the near future. + * Use IM_ADDRESS_SKYPE instead of this object. + * @since 2.0 + * @endif + */ +_OSP_EXPORT_ extern const Tizen::Base::String IM_SKYPE; + +/** + * @if OSPDEPREC + * The IM service provider name for QQ. + * + * @brief [Deprecated] + * @deprecated This object is provided only for backward compatibility and will be deleted in the near future. + * Use IM_ADDRESS_QQ instead of this object. + * @since 2.0 + * @endif + */ +_OSP_EXPORT_ extern const Tizen::Base::String IM_QQ; + +/** + * The IM service provider name for AIM. + * + * @since 2.0 + */ +_OSP_EXPORT_ extern const wchar_t IM_ADDRESS_AIM[]; + +/** + * The IM service provider name for Google talk. + * + * @since 2.0 + */ +_OSP_EXPORT_ extern const wchar_t IM_ADDRESS_GOOGLE_TALK[]; + +/** + * The IM service provider name for ICQ. + * + * @since 2.0 + */ +_OSP_EXPORT_ extern const wchar_t IM_ADDRESS_ICQ[]; + +/** + * The IM service provider name for Jabber. + * + * @since 2.0 + */ +_OSP_EXPORT_ extern const wchar_t IM_ADDRESS_JABBER[]; + +/** + * The IM service provider name for MSN. + * + * @since 2.0 +*/ +_OSP_EXPORT_ extern const wchar_t IM_ADDRESS_MSN[]; + +/** + * The IM service provider name for QQ. + * + * @since 2.0 + */ +_OSP_EXPORT_ extern const wchar_t IM_ADDRESS_QQ[]; + +/** + * The IM service provider name for Skype. + * + * @since 2.0 + */ +_OSP_EXPORT_ extern const wchar_t IM_ADDRESS_SKYPE[]; + +/** + * The IM service provider name for Yahoo. + * + * @since 2.0 + */ +_OSP_EXPORT_ extern const wchar_t IM_ADDRESS_YAHOO[]; + +/** + * @class ImAddress + * @brief This class represents the Instant Messenger (IM) addresses. + * + * @since 2.0 + * + * @final This class is not intended for extension. + * + * The %ImAddress class represents the Instant Messenger (IM) addresses. It consists of an IM service provider name and an account. + */ +class _OSP_EXPORT_ ImAddress + : public Tizen::Base::Object +{ +public: + /** + * This is the default constructor for this class. + * + * @since 2.0 + */ + ImAddress(void); + + /** + * Initializes this instance of %ImAddress with the specified parameters. @n + * This constructs an instance of %ImAddress with the specified service provider name. + * + * @since 2.0 + * + * @param[in] serviceProviderName The service provider name of the %ImAddress + * @param[in] imAddress The IM address + * @see #IM_ADDRESS_AIM + * @see #IM_ADDRESS_GOOGLE_TALK + * @see #IM_ADDRESS_ICQ + * @see #IM_ADDRESS_JABBER + * @see #IM_ADDRESS_MSN + * @see #IM_ADDRESS_QQ + * @see #IM_ADDRESS_SKYPE + * @see #IM_ADDRESS_YAHOO + */ + ImAddress(const Tizen::Base::String& serviceProviderName, const Tizen::Base::String& imAddress); + + /** + * Copying of objects using this copy constructor is allowed. + * + * @since 2.0 + * + * @param[in] rhs An instance of %ImAddress to copy + */ + ImAddress(const ImAddress& rhs); + + /** + * This destructor overrides Tizen::Base::Object::~Object(). + * + * @since 2.0 + */ + virtual ~ImAddress(void); + + /** + * Checks whether the value of the specified instance is equal to the value of the current instance of Tizen::Base::Object. + * + * @since 2.0 + * + * @return @c true if the value of the specified instance of Tizen::Base::Object is equal to the value of the current instance of %Tizen::Base::Object, @n + * else @c false + * @param[in] rhs An instance of Tizen::Base::Object to compare + */ + virtual bool Equals(const Tizen::Base::Object& rhs) const; + + /** + * Gets the hash value of the current instance of Tizen::Base::Object. + * + * @since 2.0 + * + * @return The integer value that indicates the hash value of the current instance of Tizen::Base::Object + */ + virtual int GetHashCode(void) const; + + /** + * Gets the service provider name of the IM address. + * + * @since 2.0 + * + * @return The service provider name of the IM address + */ + Tizen::Base::String GetServiceProviderName(void) const; + + /** + * Gets the IM address of the current instance of %ImAddress. + * + * @since 2.0 + * + * @return The IM address + */ + Tizen::Base::String GetImAddress(void) const; + + /** + * Sets the service provider name of the IM address. + * + * @since 2.0 + * + * @return An error code + * @param[in] serviceProviderName The service provider name of the IM address + * @see #IM_ADDRESS_AIM + * @see #IM_ADDRESS_GOOGLE_TALK + * @see #IM_ADDRESS_ICQ + * @see #IM_ADDRESS_JABBER + * @see #IM_ADDRESS_MSN + * @see #IM_ADDRESS_QQ + * @see #IM_ADDRESS_SKYPE + * @see #IM_ADDRESS_YAHOO + */ + void SetServiceProviderName(const Tizen::Base::String& serviceProviderName); + + /** + * Sets the IM address of the current instance of %ImAddress. + * + * @if OSPCOMPAT + * @brief [Compatibility] + * @endif + * @since 2.0 + * @if OSPCOMPAT + * @compatibility This method has compatibility issues with OSP compatible applications. @n + * For more information, see @ref CompImAddressSetImAddressPage "here". + * @endif + * + * @return An error code + * @param[in] imAddress The IM address + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c imAddress is an empty string. + */ + result SetImAddress(const Tizen::Base::String& imAddress); + + /** + * @if OSPCOMPAT + * @page CompImAddressSetImAddressPage Compatibility for SetImAddress() + * @section CompImAddressSetImAddressPageIssueSection Issues + * Implementing this method in OSP compatible applications has the following issue: @n + * -# If the length of an IM address to be set is greater than 100 characters, @c E_INVALID_ARG is returned. + * + * @section CompImAddressSetImAddressPageSolutionSection Resolutions + * The issue mentioned above has been resolved in Tizen. + * @endif + */ + + /** + * Copying of objects using this copy assignment operator is allowed. + * + * @since 2.0 + * + * @param[in] rhs An instance of %ImAddress to copy + */ + ImAddress& operator =(const ImAddress& rhs); + + /** + * Checks whether the value of the specified instance of %ImAddress is equal to the value of the current instance. + * + * @since 2.0 + * + * @return @c true if the value of the specified instance of %ImAddress is equal to the value of the current instance, @n + * else @c false + * @param[in] rhs An instance of %ImAddress + */ + bool operator ==(const ImAddress& rhs) const; + + /** + * Checks whether the value of the specified instance of %ImAddress is not equal to the value of the current instance. + * + * @since 2.0 + * + * @return @c true if the value of the specified instance of %ImAddress is not equal to the value of the current instance, @n + * else @c false + * @param[in] rhs An instance of %ImAddress + */ + bool operator !=(const ImAddress& rhs) const; + +private: + friend class _ImAddressImpl; + class _ImAddressImpl* __pImAddressImpl; + +}; // ImAddress + +}} // Tizen::Social + +#endif // _FSCL_IM_ADDRESS_H_ diff --git a/inc/FSclOrganization.h b/inc/FSclOrganization.h new file mode 100644 index 0000000..21e168b --- /dev/null +++ b/inc/FSclOrganization.h @@ -0,0 +1,338 @@ +// +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// 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. +// +/** + * @file FSclOrganization.h + * @brief This is the header file for the %Organization class. + * + * This header file contains the declarations of the %Organization class. + */ +#ifndef _FSCL_ORGANIZATION_H_ +#define _FSCL_ORGANIZATION_H_ + +#include +#include +#include + +namespace Tizen { namespace Base +{ +class String; +}} + +namespace Tizen { namespace Social +{ + +/** + * @class Organization + * @brief This class represents the organization information. + * + * @since 2.0 + * + * @final This class is not intended for extension. + * + * The %Organization class represents the organization information of a person. @n + * The organization information consists of the name, job title, role, agent, and department. + */ +class _OSP_EXPORT_ Organization + : public Tizen::Base::Object +{ +public: + /** + * This is the default constructor for this class. + * + * @since 2.0 + */ + Organization(void); + + /** + * Copying of objects using this copy constructor is allowed. + * + * @since 2.0 + * + * @param[in] rhs An instance of %Organization to copy + */ + Organization(const Organization& rhs); + + /** + * This destructor overrides Tizen::Base::Object::~Object(). + * + * @since 2.0 + */ + virtual ~Organization(void); + + /** + * Checks whether the value of the specified instance is equal to the value of the current instance of Tizen::Base::Object. + * + * @since 2.0 + * + * @return @c true if the value of the specified instance of Tizen::Base::Object is equal to the value of the current instance of %Tizen::Base::Object, @n + * else @c false + * @param[in] rhs An instance of Tizen::Base::Object to compare + */ + virtual bool Equals(const Tizen::Base::Object& rhs) const; + + /** + * Gets the hash value of the current instance of Tizen::Base::Object. + * + * @since 2.0 + * + * @return The integer value that indicates the hash value of the current instance of Tizen::Base::Object + */ + virtual int GetHashCode(void) const; + + /** + * Gets the organization name. + * + * @since 2.0 + * + * @return The organization name + */ + Tizen::Base::String GetName(void) const; + + /** + * Gets the job title. + * + * @since 2.0 + * + * @return The job title + */ + Tizen::Base::String GetJobTitle(void) const; + + /** + * Gets the department. + * + * @since 2.0 + * + * @return The department + */ + Tizen::Base::String GetDepartment(void) const; + + /** + * Gets the role. + * + * @since 2.0 + * + * @return The role + */ + Tizen::Base::String GetRole(void) const; + + /** + * Gets the agent. + * + * @since 2.0 + * + * @return The agent + */ + Tizen::Base::String GetAgent(void) const; + + /** + * Gets the organization type. + * + * @since 2.1 + * + * @return The organization type + */ + OrganizationType GetType(void) const; + + /** + * Gets the label of the organization. + * + * @since 2.1 + * + * @return The organization label + */ + Tizen::Base::String GetLabel(void) const; + + /** + * Gets the location. + * + * @since 2.1 + * + * @return The location + */ + Tizen::Base::String GetLocation(void) const; + + /** + * Gets the description. + * + * @since 2.1 + * + * @return The description + */ + Tizen::Base::String GetDescription(void) const; + + /** + * Gets the phonetic name. + * + * @since 2.1 + * + * @return The phonetic name + */ + Tizen::Base::String GetPhoneticName(void) const; + + /** + * Gets the logo image path. + * + * @since 2.1 + * + * @return The logo image file path + */ + Tizen::Base::String GetLogoPath(void) const; + + /** + * Sets the name of the organization. + * + * @since 2.0 + * + * @param[in] name The organization name + */ + void SetName(const Tizen::Base::String& name); + + /** + * Sets the job title. + * + * @since 2.0 + * + * @param[in] jobTitle The job title + */ + void SetJobTitle(const Tizen::Base::String& jobTitle); + + /** + * Sets the department. + * + * @since 2.0 + * + * @param[in] department The department + */ + void SetDepartment(const Tizen::Base::String& department); + + /** + * Sets the role. + * + * @since 2.0 + * + * @param[in] role The role + */ + void SetRole(const Tizen::Base::String& role); + + /** + * Sets the agent. + * + * @since 2.0 + * + * @param[in] agent The agent + */ + void SetAgent(const Tizen::Base::String& agent); + + /** + * Sets the organization type. + * + * @since 2.1 + * + * @param[in] type The organization type + */ + void SetType(OrganizationType type); + + /** + * Sets the label of the organization. + * + * @since 2.1 + * + * @param[in] label The organization label + */ + void SetLabel(const Tizen::Base::String& label); + + /** + * Sets the location. + * + * @since 2.1 + * + * @param[in] location The location + */ + void SetLocation(const Tizen::Base::String& location); + + /** + * Sets the description. + * + * @since 2.1 + * + * @param[in] description The description + */ + void SetDescription(const Tizen::Base::String& description); + + /** + * Sets the phonetic name. + * + * @since 2.1 + * + * @param[in] phoneticName The phonetic name + */ + void SetPhoneticName(const Tizen::Base::String& phoneticName); + + /** + * Sets the logo image. @n + * If the specified @c filePath is an empty string, the current logo image is removed. + * + * @since 2.1 + * + * @param[in] filePath The file path of the logo image + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The length of the specified @c filePath exceeds system limitations. + * @exception E_FILE_NOT_FOUND The specified file cannot be found or accessed. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The logo image is copied to the specific directory for logo images by the system, when the contact is added or updated. + * Therefore, GetLogoPath() returns the file path to which the logo image is copied. + */ + result SetLogo(const Tizen::Base::String& filePath); + + /** + * Copying of objects using this copy assignment operator is allowed. + * + * @since 2.0 + * + * @param[in] rhs An instance of %Organization to copy + */ + Organization& operator =(const Organization& rhs); + + /** + * Checks whether the data in the specified instance of %Organization is equal to the data in the current instance. + * + * @since 2.0 + * + * @return @c true if the data in the specified instance equals the data in the current instance, @n + * else @c false + * @param[in] rhs An instance of %Organization + */ + bool operator ==(const Organization& rhs) const; + + /** + * Checks whether the data in the specified instance of %Organization is not equal to the data in the current instance. + * + * @since 2.0 + * + * @return @c true if the data in the specified instance is not equal to the data in the current instance, @n + * else @c false + * @param[in] rhs An instance of %Organization + */ + bool operator !=(const Organization& rhs) const; + +private: + friend class _OrganizationImpl; + class _OrganizationImpl* __pOrganizationImpl; +}; // Organization + +}} // Tizen::Social + +#endif //_FSCL_ORGANIZATION_H_ diff --git a/inc/FSclPerson.h b/inc/FSclPerson.h new file mode 100644 index 0000000..faa30cf --- /dev/null +++ b/inc/FSclPerson.h @@ -0,0 +1,311 @@ +// +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// 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. +// +/** + * @file FSclPerson.h + * @brief This is the header file for the %Person class. + * + * This header file contains the declarations of the %Person class. + */ +#ifndef _FSCL_PERSON_H_ +#define _FSCL_PERSON_H_ + +#include +#include +#include +#include +#include +#include + +namespace Tizen { namespace Base +{ +namespace Collection +{ +template +class IListT; +} +} } + +namespace Tizen { namespace Graphics +{ +class Bitmap; +} } + +namespace Tizen { namespace Social +{ + +/** + * @class Person + * @brief This class provides an aggregated contact information. + * + * @since 2.0 + * + * @final This class is not intended for extension. + * + * The %Person class provides an aggregated contact information of a person. @n + * There can be more than one contact of the same person because contacts can be synchronized from multiple service providers. @n + * %Person has the following information of an individual. @n + * - Display name + * - Thumbnail + * - Ringtone + * - Primary phone number + * - Primary email + * + * Each information is collected from contacts linked to the person. @n + * + * There is no explicit way to create a person. When a contact is added, the system creates a new person and links the contact to the person. + * It is possible to merge two persons into one or unlink a contact from a person. + */ + +class _OSP_EXPORT_ Person + : public Tizen::Base::Object +{ +public: + /** + * This destructor overrides Tizen::Base::Object::~Object(). + * + * @since 2.0 + */ + virtual ~Person(void); + + /** + * Checks whether the value of the specified instance is equal to the value of the current instance of Tizen::Base::Object. + * + * @since 2.0 + * + * @return @c true if the value of the specified instance of Tizen::Base::Object is equal to the value of the current instance of %Tizen::Base::Object, @n + * else @c false + * @param[in] rhs An instance of Tizen::Base::Object to compare + */ + virtual bool Equals(const Tizen::Base::Object& rhs) const; + + /** + * Gets the hash value of the current instance. + * + * @since 2.0 + * + * @return The hash value of the current instance + */ + virtual int GetHashCode(void) const; + + /** + * Gets the display name. + * + * @since 2.0 + * + * @return The display name + */ + Tizen::Base::String GetDisplayName(void) const; + + /** + * Checks whether this is a favorite. + * + * @since 2.0 + * + * @return @c true if this is a favorite, @n + * else @c false + * @see SetAsFavorite() + */ + bool IsFavorite(void) const; + + /** + * Gets the thumbnail path. + * + * @since 2.0 + * + * @return The file path of the thumbnail + * @remarks If the thumbnail path has not been set, an empty string is returned. + */ + Tizen::Base::String GetThumbnailPath(void) const; + + /** + * Gets the ringtone path. + * + * @since 2.0 + * + * @return The file path of the ringtone + * @remarks If the ringtone path has not been set, an empty string is returned. + */ + Tizen::Base::String GetRingtonePath(void) const; + + /** + * Checks whether this has phone numbers. + * + * @since 2.0 + * + * @return @c true if this has phone numbers, @n + * else @c false + */ + bool HasPhoneNumber(void) const; + + /** + * Checks whether this has emails. + * + * @since 2.0 + * + * @return @c true if this has emails, @n + * else @c false + */ + bool HasEmail(void) const; + + /** + * Gets the list of account IDs, of contacts linked to the person. + * + * @since 2.0 + * + * @return The account ID list + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_MEMORY The memory is insufficient. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + Tizen::Base::Collection::IListT* GetAccountIdsN(void) const; + + /** + * Gets the ID of this person. + * + * @since 2.0 + * + * @return The person ID + */ + PersonId GetId(void) const; + + /** + * Sets whether this person is a favorite. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.write + * + * @return An error code + * @param[in] isFavorite Set to @c true to set this person as a favorite, @n + * else @c false to set this person as a non-favorite + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @see IsFavorite() + * @see AddressbookManager::GetFavoritePersonsN() + */ + result SetAsFavorite(bool isFavorite = true); + + + /** + * Sets the specified phone number as the primary phone number of this person. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.write + * + * @return An error code + * @param[in] phoneNumber The phone number + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG The specified @c phoneNumber is invalid. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @see GetPrimaryPhoneNumber() + */ + result SetAsPrimaryPhoneNumber(const PhoneNumber& phoneNumber); + + /** + * Sets the specified email as the primary email of this person. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.write + * + * @return An error code + * @param[in] email The email + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_INVALID_ARG The specified @c phoneNumber is invalid. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @see GetPrimaryEmail() + */ + result SetAsPrimaryEmail(const Email& email); + + /** + * Gets the primary phone number of this person. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return The primary phone number @n If this instance does not have a primary email, an empty PhoneNumber instance is returned. + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @see SetAsPrimaryPhoneNumber() + */ + PhoneNumber GetPrimaryPhoneNumber(void) const; + + /** + * Gets the primary email of this person. + * + * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/contact.read + * + * @return The primary email @n If this instance does not have a primary email, an empty Email instance is returned. + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @see SetAsPrimaryEmail() + */ + Email GetPrimaryEmail(void) const; + +private: + /** + * This constructor is intentionally declared as private so that only the platform can create an instance. + * + * @since 2.0 + */ + Person(void); + + /** + * This copy constructor is intentionally declared as private to prohibit copying of objects by users. + * + * @since 2.0 + * + * @param[in] rhs An instance of %Person + */ + Person(const Person& rhs); + + /** + * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects. + * + * @since 2.0 + * + * @param[in] rhs An instance of %Person + */ + Person& operator =(const Person& rhs); + +private: + friend class _PersonImpl; + class _PersonImpl* __pPersonImpl; + + friend class _AddressbookManagerImpl; + friend class _AddressbookUtil; +}; // Person + +}} // Tizen::Social + +#endif // _FSCL_PERSON_H_ diff --git a/inc/FSclPhoneNumber.h b/inc/FSclPhoneNumber.h new file mode 100644 index 0000000..65723e2 --- /dev/null +++ b/inc/FSclPhoneNumber.h @@ -0,0 +1,264 @@ +// +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// 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. +// +/** +* @file FSclPhoneNumber.h +* @brief This is the header file for the %PhoneNumber class. +* +* This header file contains the declarations of the %PhoneNumber class. +*/ +#ifndef _FSCL_PHONE_NUMBER_H_ +#define _FSCL_PHONE_NUMBER_H_ + +#include +#include +#include + +namespace Tizen { namespace Social +{ + +/** +* @class PhoneNumber +* @brief This class stores the information of a phone number. +* +* @since 2.0 +* +* @final This class is not intended for extension. +* +* The %PhoneNumber class consists of the phone number and phone number type. +* +* The following example demonstrates how to use the %PhoneNumber class. +* +* @code +using namespace Tizen::Base; +using namespace Tizen::Social::Services; + +result +MyClass::SomeMethod(void) +{ + result r = E_SUCCESS; + + // Creates an instance of PhoneNumber + PhoneNumber phoneNumber = PhoneNumber(); + + // Sets the number + r = phoneNumber.SetPhoneNumber(L"010-111-2222"); + if (IsFailed(r)) + { + return r; + } + + // Sets the type + phoneNumber.SetType(PHONENUMBER_TYPE_MOBILE); + + return E_SUCCESS; +} +* @endcode +*/ +class _OSP_EXPORT_ PhoneNumber + : public Tizen::Base::Object +{ +public: + /** + * This is the default constructor for this class. + * + * @since 2.0 + */ + PhoneNumber(void); + + /** + * Initializes this instance of %PhoneNumber with the specified type and phone number. + * + * @since 2.0 + * + * @param[in] type The type of the phone number + * @param[in] number The phone number + */ + PhoneNumber(PhoneNumberType type, const Tizen::Base::String& number); + + /** + * Copying of objects using this copy constructor is allowed. + * + * @since 2.0 + * + * @param[in] rhs An instance of %PhoneNumber to copy + */ + PhoneNumber(const PhoneNumber& rhs); + + /** + * This destructor overrides Tizen::Base::Object::~Object(). + * + * @since 2.0 + */ + virtual ~PhoneNumber(void); + + /** + * Checks whether the value of the specified instance is equal to the value of the current instance of Tizen::Base::Object. + * + * @since 2.0 + * + * @return @c true if the value of the specified instance of Tizen::Base::Object is equal to the value of the current instance of %Tizen::Base::Object, @n + * else @c false + * @param[in] rhs An instance of Tizen::Base::Object to compare + */ + virtual bool Equals(const Tizen::Base::Object& rhs) const; + + /** + * Gets the hash value of the current instance of Tizen::Base::Object. + * + * @since 2.0 + * + * @return The integer value that indicates the hash value of the current instance of Tizen::Base::Object + */ + virtual int GetHashCode(void) const; + + /** + * Gets the type of the phone number. + * + * @if OSPCOMPAT + * @brief [Compatibility] + * @endif + * @since 2.0 + * @if OSPCOMPAT + * @compatibility This method has compatibility issues with OSP compatible applications. @n + * For more information, see @ref CompPhoneNumberGetTypePage "here". + * @endif + * + * @return The type of the phone number + */ + PhoneNumberType GetType(void) const; + + /** + * @if OSPCOMPAT + * @page CompPhoneNumberGetTypePage Compatibility for GetType() + * @section CompPhoneNumberGetTypePageIssueSection Issues + * Implementing this method in OSP compatible applications has the following issue: @n + * -# PHONENUMBER_TYPE_CUSTOM is not supported. If the type of the phone number is PHONENUMBER_TYPE_CUSTOM, PHONENUMBER_TYPE_OTHER is returned instead. + * + * @section CompPhoneNumberGetTypePageSolutionSection Resolutions + * The issue mentioned above has been resolved in Tizen. + * @endif + */ + + /** + * Gets the phone number. + * + * @since 2.0 + * + * @return The phone number + */ + Tizen::Base::String GetPhoneNumber(void) const; + + /** + * Sets the type of the phone number. + * + * @since 2.0 + * + * @param[in] type The type of the phone number + */ + void SetType(PhoneNumberType type); + + /** + * Sets the specified phone number. + * + * @if OSPCOMPAT + * @brief [Compatibility] + * @endif + * @since 2.0 + * @if OSPCOMPAT + * @compatibility This method has compatibility issues with OSP compatible applications. @n + * For more information, see @ref CompPhoneNumberSetPhoneNumberPage "here". + * @endif + * + * @return An error code + * @param[in] number The phone number to set + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c number is an empty string. + */ + result SetPhoneNumber(const Tizen::Base::String& number); + + /** + * @if OSPCOMPAT + * @page CompPhoneNumberSetPhoneNumberPage Compatibility for SetPhoneNumber() + * @section CompPhoneNumberSetPhoneNumberPageIssueSection Issues + * Implementing this method in OSP compatible applications has the following issue: @n + * -# If the length of the phone number to be set is greater than 50 characters, @c E_INVALID_ARG is returned. + * -# Only alphabets (a~z, A~Z), numbers, plus (+), asterisk (*), pound (#), and comma (,) are allowed. + * + * @section CompPhoneNumberSetPhoneNumberPageSolutionSection Resolutions + * The issue mentioned above has been resolved in Tizen. + * @endif + */ + + /** + * Gets the label of a phone number. + * + * @since 2.0 + * + * @return The phone number label + * @see SetLabel() + */ + Tizen::Base::String GetLabel(void) const; + + /** + * Sets the label of an event. + * + * @since 2.0 + * + * @param[in] label The phone number label + * @see GetLabel() + */ + void SetLabel(const Tizen::Base::String& label); + + /** + * Copying of objects using this copy assignment operator is allowed. + * + * @since 2.0 + * + * @param[in] rhs An instance of %PhoneNumber to copy + */ + PhoneNumber& operator =(const PhoneNumber& rhs); + + /** + * Checks whether the data in the specified instance of %PhoneNumber is equal to the data in the current instance. + * + * @since 2.0 + * + * @return @c true if the data in the specified instance equals the data in the current instance, @n + * else @c false + * @param[in] rhs An instance of %PhoneNumber + */ + bool operator ==(const PhoneNumber& rhs) const; + + /** + * Checks whether the data in the specified instance of %PhoneNumber is not equal to the data in the current instance. + * + * @since 2.0 + * + * @return @c true if the data in the specified instance is not equal to the data in the current instance, @n + * else @c false + * @param[in] rhs An instance of %PhoneNumber + */ + bool operator !=(const PhoneNumber& rhs) const; + +private: + friend class _PhoneNumberImpl; + class _PhoneNumberImpl * __pPhoneNumberImpl; + +}; // PhoneNumber + +}} // Tizen::Social + +#endif // _FSCL_PHONE_NUMBER_H_ diff --git a/inc/FSclPhoneNumberContact.h b/inc/FSclPhoneNumberContact.h new file mode 100644 index 0000000..a43ccca --- /dev/null +++ b/inc/FSclPhoneNumberContact.h @@ -0,0 +1,174 @@ +// +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// 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. +// +/** + * @file FSclPhoneNumberContact.h + * @brief This is the header file for the %PhoneNumberContact class. + * + * This header file contains the declarations of the %PhoneNumberContact class. + */ +#ifndef _FSCL_PHONE_NUMBER_CONTACT_H_ +#define _FSCL_PHONE_NUMBER_CONTACT_H_ + +#include +#include +#include +#include +#include + +namespace Tizen { namespace Social +{ + /** + * @class PhoneNumberContact + * @brief This class provides the summarized contact information with the phone number. + * + * @since 2.0 + * + * @final This class is not intended for extension. + * + * The %PhoneNumberContact class provides the summarized contact information. @n + * This provides a part of the contact information such as the ID, person ID, addressbook ID, display name, ringtone, thumbnail, and phone number. + */ +class _OSP_EXPORT_ PhoneNumberContact + : public Tizen::Base::Object +{ + +public: + /** + * This is the default constructor for this class. + * + * @since 2.0 + */ + PhoneNumberContact(void); + + /** + * Copying of objects using this copy constructor is allowed. + * + * @since 2.0 + * + * @param[in] rhs An instance of %PhoneNumberContact to copy + */ + PhoneNumberContact(const PhoneNumberContact& rhs); + + /** + * This destructor overrides Tizen::Base::Object::~Object(). + * + * @since 2.0 + */ + virtual ~PhoneNumberContact(void); + + /** + * Checks whether the value of the specified instance is equal to the value of the current instance of Tizen::Base::Object. + * + * @since 2.0 + * + * @return @c true if the value of the specified instance of Tizen::Base::Object is equal to the value of the current instance of %Tizen::Base::Object, @n + * else @c false + * @param[in] rhs An instance of Tizen::Base::Object to compare + */ + virtual bool Equals(const Tizen::Base::Object& rhs) const; + + /** + * Gets the hash value of the current instance. + * + * @since 2.0 + * + * @return The hash value of the current instance + */ + virtual int GetHashCode(void) const; + + /** + * Gets the addressbook ID. + * + * @since 2.0 + * + * @return The addressbook ID + */ + AddressbookId GetAddressbookId(void) const; + + /** + * Gets the person ID. + * + * @since 2.0 + * + * @return The person ID + */ + PersonId GetPersonId(void) const; + + /** + * Gets the contact ID. + * + * @since 2.0 + * + * @return The contact ID + */ + RecordId GetContactId(void) const; + + /** + * Gets the display name. + * + * @since 2.0 + * + * @return The display name + */ + Tizen::Base::String GetDisplayName(void) const; + + /** + * Gets the ringtone path. + * + * @since 2.0 + * + * @return The ringtone path, @n + * else an empty string if the ringtone path has not been set for this contact + */ + Tizen::Base::String GetRingtonePath(void) const; + + /** + * Gets the thumbnail path. + * + * @since 2.0 + * + * @return The thumbnail path, @n + * else an empty string if the thumbnail path has not been set for this contact + */ + Tizen::Base::String GetThumbnailPath(void) const; + + /** + * Gets the phone number. + * + * @since 2.0 + * + * @return A PhoneNumber instance + */ + PhoneNumber GetPhoneNumber(void) const; + + /** + * Copying of objects using this copy assignment operator is allowed. + * + * @since 2.0 + * + * @param[in] rhs An instance of %PhoneNumberContact to copy + */ + PhoneNumberContact& operator =(const PhoneNumberContact& rhs); + +private: + friend class _PhoneNumberContactImpl; + class _PhoneNumberContactImpl* __pPhoneNumberContactImpl; + +}; // PhoneNumberContact + +}} // Tizen::Social + +#endif // _FSCL_PHONE_NUMBER_CONTACT_H_ diff --git a/inc/FSclRecord.h b/inc/FSclRecord.h new file mode 100644 index 0000000..586675d --- /dev/null +++ b/inc/FSclRecord.h @@ -0,0 +1,128 @@ +// +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// 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. +// +/** + * @file FSclRecord.h + * @brief This is the header file for the %Record class. + * + * This header file contains the declarations of the %Record class. + */ + +#ifndef _FSCL_RECORD_H_ +#define _FSCL_RECORD_H_ + +#include +#include +#include + +namespace Tizen { namespace Social +{ + +/** + * @enum RecordType + * + * Defines the possible types of a record. + * + * @since 2.0 + */ +enum RecordType +{ + RECORD_TYPE_CONTACT = 0x01, /**< The contact type */ + RECORD_TYPE_CATEGORY = 0x02, /**< The category type */ + RECORD_TYPE_EVENT = 0x04, /**< The event type */ + RECORD_TYPE_TODO = 0x08, /**< The to-do type */ + RECORD_TYPE_CALENDAR = 0x10 /**< The calendar type */ +}; + +/** + * @class Record + * @brief This class defines the general behavior of records used in the %Social namespace. + * + * @since 2.0 + * + * The %Record class defines the general behavior of records used in the Social namespace. Users cannot create an instance directly from this + * class. Instead, they have to instantiate the classes derived from %Record. + */ +class _OSP_EXPORT_ Record + : public Tizen::Base::Object +{ +public: + /** + * Gets the type of the record. + * + * @since 2.0 + * + * @return The type of the record + */ + RecordType GetRecordType(void) const; + + /** + * Gets the local-wide unique ID of the current instance of %Record. @n + * The @c RecordId is assigned by an address book when a record is added to it. @n + * A newly constructed record instance has ::INVALID_RECORD_ID. + * + * @since 2.0 + * + * @return The ID of the record + */ + RecordId GetRecordId(void) const; + +protected: + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // + // Initializes this instance of %Record with the specified @c type. + // + // @since 2.0 + // + // @param[in] type The record type + // + Record(RecordType type); + + // + // This copy constructor is intentionally declared as private to prohibit copying of objects by users. + // + // @since 2.0 + // + // @param[in] rhs The source instance of %Record + // + Record(const Record& rhs); + + // + // This destructor is intentionally declared as private so that only the platform can delete an instance. + // + // @since 2.0 + // + virtual ~Record(void); + + // + // This copy assignment operator is intentionally declared as private to prohibit copying of objects by users. + // + // @since 2.0 + // + // @param[in] rhs An instance of %Record + // + Record& operator =(const Record& rhs); + +private: + friend class _RecordImpl; + class _RecordImpl* __pRecordImpl; + +}; // Record + +}} // Tizen::Social + +#endif // _FSCL_RECORD_H_ diff --git a/inc/FSclRecurrence.h b/inc/FSclRecurrence.h new file mode 100644 index 0000000..196d2c0 --- /dev/null +++ b/inc/FSclRecurrence.h @@ -0,0 +1,557 @@ +// +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// 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. +// +/** + * @file FSclRecurrence.h + * @brief This is the header file for the %Recurrence class. + * + * This header file contains the declarations of the %Recurrence class. + */ +#ifndef _FSCL_RECURRENCE_H_ +#define _FSCL_RECURRENCE_H_ + +#include +#include +#include +#include +#include +#include + +namespace Tizen { namespace Base { namespace Collection +{ +class IList; +}}} + +namespace Tizen { namespace Social +{ + +/** + * @class Recurrence + * @brief This class provides methods to access the information of a %Recurrence. + * + * @since 2.0 + * + * @final This class is not intended for extension. + * + * The %Recurrence class provides methods to access the information of a %Recurrence. + * A CalEvent can be made a recurring event using this class. To set or get the information of a recurrence (such as the start time and recurrence + * pattern) use the methods of this class. The recurrence date is the start date of the %CalEvent, if they do not match. + * + * + * For more information on the class features, see Recurrence, Reminder, and Sensitivity Properties of Calendar Items. + * + * @see CalEvent::SetRecurrence() + * + * The following examples demonstrate how to use the %Recurrence class. + * + * 1. Repeat daily for 10 occurrences: + * + * @code + + void + MyRecurrence::RepeatDayily10(void) + { + result r; + Recurrence* pRecurrence = new Recurrence(); + if (IsFailed(GetLastResult()) || pRecurrence == null) + { + AppLogException("Create instance has failed"); + } + pRecurrence->SetFrequency(FREQ_DAILY); + r = pRecurrence->SetCounts(10); + if (IsFailed(r)) + { + AppLogException("Set counts has failed"); + } + } + + * @endcode + * 2. Repeat weekly until May 4, 2009: + * + * @code + + void + MyRecurrence::RepeatDayilyUntil(void) + { + result r; + Recurrence* pRecurrence = new Recurrence(); + if (IsFailed(GetLastResult()) || pRecurrence == null) + { + AppLogException("Create instance has failed"); + } + DateTime until; + r = until.SetValue(2009, 5, 4); + if (IsFailed(r)) + { + AppLogException("Set date/time has failed"); + } + + pRecurrence->SetFrequency(FREQ_WEEKLY); + r = pRecurrence->SetUntil(&until); + if (IsFailed(r)) + { + AppLogException("Set until has failed"); + } + } + + * @endcode + * + * 3. Repeat bi-weekly on Tuesday and Thursday until May 4, 2009: + * @code + + void + MyRecurrence::RepeatByWeeklyUntil(void) + { + result r; + Recurrence* pRecurrence = new Recurrence(); + if (IsFailed(GetLastResult()) || pRecurrence == null) + { + AppLogException("Create instance has failed"); + } + + DateTime until; + r = until.SetValue(2009, 5, 4); + if (IsFailed(r)) + { + AppLogException("Set date/time has failed"); + } + + pRecurrence->SetFrequency(FREQ_WEEKLY); + r = pRecurrence->SetInterval(2); + if (IsFailed(r)) + { + AppLogException("Set interval has failed"); + } + + r = pRecurrence->SetDayOfWeek(CAL_TUESDAY | CAL_THURSDAY); + if (IsFailed(r)) + { + AppLogException("Set day of week has failed"); + } + + r = pRecurrence->SetUntil(&until); + if (IsFailed(r)) + { + AppLogException("Set until has failed"); + } + } + * @endcode + * + * 4. Repeat monthly on the first Thursday for 10 occurrences. The week starts on Monday: + * @code + + void + MyRecurrence::RepeatMonthlyUntil(void) + { + result r; + Recurrence* pRecurrence = new Recurrence(); + if (IsFailed(GetLastResult()) || pRecurrence == null) + { + AppLogException("Create instance has failed"); + } + + pRecurrence->SetFrequency(FREQ_MONTHLY); + + r = pRecurrence->SetWeekStart(CAL_MONDAY); + if (IsFailed(r)) + { + AppLogException("Set week start has failed"); + } + + r = pRecurrence->SetDayOfWeek(CAL_THURSDAY); + if (IsFailed(r)) + { + AppLogException("Set day of the week has failed"); + } + + r = pRecurrence->SetWeekOfMonth(1); + if (IsFailed(r)) + { + AppLogException("Set week of month has failed"); + } + + r = pRecurrence->SetCounts(10); + if (IsFailed(r)) + { + AppLogException("Set counts has failed"); + } + } + + * @endcode + * + */ +class _OSP_EXPORT_ Recurrence + : public Tizen::Base::Object +{ +public: + /** + * This is the default constructor for this class. @n + * This constructor sets the default values. The recurrence type is daily and recurrence interval is @c 1. @n + * The week start day is #CAL_MONDAY. The recurrence count is @c 1. + * + * @since 2.0 + */ + Recurrence(void); + + /** + * Copying of objects using this copy constructor is allowed. + * + * @since 2.0 + * + * @param[in] rhs An instance of %Recurrence to copy + */ + Recurrence(const Recurrence& rhs); + + /** + * This destructor overrides Tizen::Base::Object::~Object(). + * + * @since 2.0 + */ + virtual ~Recurrence(void); + + /** + * Compares the specified Tizen::Base::Object with the current %Recurrence instance. + * + * @since 2.0 + * + * @return @c true if the specified object equals the current %Recurrence instance, @n + * else @c false + * @param[in] rhs The object instance to compare with the current object + * @see GetHashCode() + */ + virtual bool Equals(const Tizen::Base::Object& rhs) const; + + /** + * Gets the hash value of the current instance. + * + * @since 2.0 + * + * @return The hash value of the current instance + */ + virtual int GetHashCode(void) const; + + /** + * Gets the recurrence frequency type. + * + * @since 2.0 + * + * @return A reference to one of the @c RecurFrequency enumeration values, @n + * else #FREQ_DAILY if this property is not set + */ + RecurFrequency GetFrequency(void) const; + + /** + * Gets the recurrence interval. @n + * This represents the number of units between two recurrences. @n + * If the frequency is weekly and the recurrence interval is set to @c 2, the event occurs every two weeks. + * + * @since 2.0 + * + * @return The integer value that represents the recurrence interval, @n + * else @c 1 if this property is not set + */ + int GetInterval(void) const; + + /** + * Gets the end date and time of the recurrence. + * + * @since 2.0 + * + * @return An instance of Tizen::Base::DateTime that represents the end date and time + * @remarks If this method returns @c null, get the recurrence counts using the GetCounts() method. + * + */ + const Tizen::Base::DateTime* GetUntil(void) const; + + /** + * Gets the number of times the event recurs. + * + * @since 2.0 + * + * @return The integer value that represents the number of recurrences + * @remarks If this method returns @c 0, get the recurrence end date and time using the GetUntil() method. + * + */ + int GetCounts(void) const; + + /** + * Gets the first day of the week. @n + * The default value is #CAL_MONDAY. + * + * @since 2.0 + * + * @return The integer value that represents the first day of the week + * + */ + CalDayOfWeek GetWeekStart(void) const; + + /** + * Gets the day of the week when the event should recur. @n + * The default value is @c 0. + * + * @since 2.0 + * + * @return The integer value that represents the CalDayofWeek + * @remarks The Frequency property must be obtained. If the frequency is #FREQ_WEEKLY, the return value may be a combination of days, + * like #CAL_MONDAY| #CAL_THURSDAY. + * + */ + int GetDayOfWeek(void) const; + + /** + * Gets the day of the month. @n + * The default value is @c 0. + * + * @since 2.0 + * + * @return The integer value between @c 1 and @c 31 that represents the day of the month + * @remarks The Frequency property must be obtained. + */ + int GetDayOfMonth(void) const; + + /** + * Gets the week of the month. @n + * The default value is @c 0. + * + * @since 2.0 + * + * @return The integer value between @c 1 and @c 5 that represents the week of the month + * @remarks The Frequency property must be obtained. + * + */ + int GetWeekOfMonth(void) const; + + /** + * Gets the month of the year. @n + * The default value is @c 0. + * + * @since 2.0 + * + * @return The integer value between @c 1 and @c 12 that represents the month of the year + * @remarks The Frequency property must be obtained. + * + */ + int GetMonthOfYear(void) const; + + /** + * Sets a recurring frequency type among specific types (daily, weekly, monthly, and yearly). @n + * This property must be set before setting the day of the recurrence. After setting the frequency, other properties are reset to default values. @n + * For weekly, the day of the week must be set. @n + * For monthly, the day of the week and the week of the month must be set. @n + * For yearly, either the day of the month and the month of the year, or the day of the week, the week of the month, and the month of the year must be set. + * + * @since 2.0 + * + * @param[in] type The recurrence type + * + */ + void SetFrequency(RecurFrequency type); + + /** + * Sets the interval of recurrence. @n + * If the frequency is weekly and the recurrence interval is set to @c 2, the event occurs every two weeks. + * + * @if OSPCOMPAT + * @brief [Compatibility] + * @endif + * @since 2.0 + * @if OSPCOMPAT + * @compatibility This method has compatibility issues with OSP compatible applications. @n + * For more information, see @ref CompRecurrenceSetIntervalPage "here". + * @endif + * + * @return An error code + * @param[in] interval The interval of recurrence + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c interval is less than @c 1. + */ + result SetInterval(int interval); + + /** + * @if OSPCOMPAT + * @page CompRecurrenceSetIntervalPage Compatibility for SetInterval() + * @section CompRecurrenceSetIntervalPageIssueSection Issues + * Implementing this method in OSP compatible applications has the following issues: @n + * -# If the value of the interval to be set is greater than @c 255, @c E_INVALID_ARG is returned. + * + * @section CompRecurrenceSetIntervalPageSolutionSection Resolutions + * This issue has been resolved in Tizen. @n + * -# There is no limit for the value of the interval. + * @endif + */ + + /** + * Sets the end date of the recurrence. @n + * If you want to set the event to have no end date, set the maximum date and time using the Tizen::Base::DateTime::GetMaxValue() method. + * + * @since 2.0 + * + * @return An error code + * @param[in] pUntil The end date and time + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c pUntil is out of the valid range. @n + * The valid range of the date can be referenced from GetMaxDateTime() and GetMinDateTime(). + * @remarks Either the until or count properties may be set. @n + * When the until property is set, the count property becomes @c 0. @n + * When the count property is set, the until property becomes @c null. + */ + result SetUntil(const Tizen::Base::DateTime* pUntil); + + /** + * Sets the number of times the event recurs. + * + * @since 2.0 + * + * @return An error code + * @param[in] count The number of times the event recurs + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c count is less than @c 0. + * @remarks Either the until or count properties may be set. @n + * When the until property is set, the count property becomes @c 0. @n + * When the count property is set, the until property becomes @c null. @n + */ + result SetCounts(int count); + + /** + * Sets the first day of the week. @n + * The default value is set to #CAL_MONDAY. The valid values are #CAL_SUNDAY and #CAL_MONDAY. @n + * This value is very important when the recurrence type is weekly and the interval is greater than @c 1. @n + * The weekly recurrence rule is calculated based on the week's start value. + * + * @since 2.0 + * + * @return An error code + * @param[in] weekStart The day on which the week starts + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c weekStart is invalid. + */ + result SetWeekStart(CalDayOfWeek weekStart); + + /** + * Sets the day of the week that represents the days when the event should recur. @n + * The Frequency property must be set before setting this property. @n + * This property is valid for the following #RecurFrequency enumeration types: #FREQ_WEEKLY, #FREQ_MONTHLY, and #FREQ_YEARLY. @n + * The value of the @c day may be a combination of several days of a week. @n + * In other words, the @c day should be an item or a combination of #CalDayOfWeek, such as #CAL_SUNDAY or #CAL_MONDAY|#CAL_FRIDAY. + * + * @since 2.0 + * + * @return An error code + * @param[in] day The integer value that represents the day of the week + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c day is invalid. + * @exception E_TYPE_MISMATCH The #RecurFrequency is not #FREQ_WEEKLY, #FREQ_MONTHLY, or #FREQ_YEARLY. + * @remarks After this property is set, the DayOfMonth property value is reset automatically. + */ + result SetDayOfWeek(int day); + + /** + * Sets the day of the month which indicates when the event recurs. @n + * The Frequency property must be set before setting this property. @n + * This property is valid for the following #RecurFrequency enumeration types: #FREQ_MONTHLY and #FREQ_YEARLY. @n + * If the day of the month is @c 31 and the frequency is monthly, the months which have only @c 30 days are not included in the recurrence instance set. @c + * Accordingly, with the recurrence rule, 2/29 yearly, 2/29 every four years is included in the recurrence set. + * + * @since 2.0 + * + * @return An error code + * @param[in] day The integer value between @c 1 and @c 31 that indicates the day of the month + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c day is either less than @c 1 or greater than @c 31. + * @exception E_TYPE_MISMATCH The #RecurFrequency is not #FREQ_MONTHLY or #FREQ_YEARLY. + * @remarks After this property is set, the DayOfWeek and WeekOfMonth property value are reset automatically. + */ + result SetDayOfMonth(int day); + + /** + * Sets the week of the month. @n + * If the value of the week is @c 5, it is set as the last week of the month. @n + * This property is valid for the following #RecurFrequency enumeration types: #FREQ_MONTHLY and #FREQ_YEARLY. + * The Frequency property must be set before setting this property. @n + * When the week of the month is set, the day of the week must be set accordingly. + * + * @since 2.0 + * + * @return An error code + * @param[in] week The integer value between @c 1 and @c 5 that represents the week of the month + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c week is either less than @c 1 or greater than @c 5. + * @exception E_TYPE_MISMATCH The #RecurFrequency is not #FREQ_MONTHLY or #FREQ_YEARLY. + * @remarks After this property is set, the DayOfMonth property value is reset automatically. + */ + result SetWeekOfMonth(int week); + + /** + * Sets the month of the year. @n + * This property is valid for the following #RecurFrequency enumeration type: #FREQ_YEARLY. @n + * The Frequency property must be set before setting this property. @n + * When the month of the year is set, the day of the month or both the day of the week and the week of the month must be set accordingly. + * + * @since 2.0 + * + * @return An error code + * @param[in] month The integer value between @c 1 and @c 12 that represents the month of the year + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c month is either less than @c 1 or greater than @c 12. + * @exception E_TYPE_MISMATCH The #RecurFrequency is not #FREQ_YEARLY. + */ + result SetMonthOfYear(int month); + + /** + * Adds an exception date to this event. @n + * The instance whose start date and time matches the exception date is excluded from the recurrence instances. + * If there are any changes in this recurrence, the exception dates are cleared. + * + * @since 2.0 + * + * @return An error code + * @param[in] exceptionDate The exception date to exclude. @n Any value with a unit that is less than a second is ignored. + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c exceptionDate is invalid. + * @exception E_OBJ_ALREADY_EXIST The specified @c exceptionDate already exists. + */ + result AddExceptionDate(const Tizen::Base::DateTime& exceptionDate); + + /** + * Gets the exception dates. + * + * @since 2.0 + * + * @return The list that contains the exception dates, @n + * else an empty list if there are no exception dates, or @c null if an exception occurs @n + * The results are listed in the order of date and time. + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_MEMORY The memory is insufficient. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + Tizen::Base::Collection::IList* GetExceptionDatesN(void) const; + + /** + * Copying of objects using this copy assignment operator is allowed. + * + * @since 2.0 + * + * @param[in] rhs An instance of %Recurrence to copy + */ + Recurrence& operator =(const Recurrence& rhs); + +private: + friend class _RecurrenceImpl; + class _RecurrenceImpl* __pRecurrenceImpl; +}; // Recurrence + +}} // Tizen::Social + +#endif // _FSCL_RECURRENCE_H_ diff --git a/inc/FSclRelationship.h b/inc/FSclRelationship.h new file mode 100644 index 0000000..c3188aa --- /dev/null +++ b/inc/FSclRelationship.h @@ -0,0 +1,189 @@ +// +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// 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. +// +/** +* @file FSclRelationship.h +* @brief This is the header file for the %Relationship class. +* +* This header file contains the declarations of the %Relationship class. +*/ +#ifndef _FSCL_RELATIONSHIP_H_ +#define _FSCL_RELATIONSHIP_H_ + +#include +#include +#include +#include + +namespace Tizen { namespace Social +{ + +/** +* @class Relationship +* @brief This class represents a relation. +* +* @since 2.0 +* +* @final This class is not intended for extension. +* +* The %Relationship class represents a relation. A relation consists of the type, label, and name. +* +*/ +class _OSP_EXPORT_ Relationship + : public Tizen::Base::Object +{ +public: + /** + * This is the default constructor for this class. + * + * @since 2.0 + */ + Relationship(void); + + /** + * Copying of objects using this copy constructor is allowed. + * + * @since 2.0 + * + * @param[in] rhs An instance of %Relationship to copy + */ + Relationship(const Relationship& rhs); + + /** + * This destructor overrides Tizen::Base::Object::~Object(). + * + * @since 2.0 + */ + virtual ~Relationship(void); + + /** + * Checks whether the value of the specified instance is equal to the value of the current instance of Tizen::Base::Object. + * + * @since 2.0 + * + * @return @c true if the value of the specified instance of Tizen::Base::Object is equal to the value of the current instance of %Tizen::Base::Object, @n + * else @c false + * @param[in] rhs An instance of Tizen::Base::Object to compare + */ + virtual bool Equals(const Tizen::Base::Object& rhs) const; + + /** + * Gets the hash value of the current instance of Tizen::Base::Object. + * + * @since 2.0 + * + * @return The integer value indicates the hash value of the current instance of Tizen::Base::Object + */ + virtual int GetHashCode(void) const; + + /** + * Gets the relation type. + * + * @since 2.0 + * + * @return The type of the relation + */ + RelationshipType GetType(void) const; + + /** + * Gets the name of the relative. + * + * @since 2.0 + * + * @return The name of the relative + */ + Tizen::Base::String GetRelativeName(void) const; + + /** + * Gets the label of the relation. + * + * @since 2.0 + * + * @return The relation label + * @see SetLabel() + */ + Tizen::Base::String GetLabel(void) const; + + /** + * Sets the relation type. + * + * @since 2.0 + * + * @param[in] type The type of the relation + */ + void SetType(RelationshipType type); + + /** + * Sets the label of the relation. + * + * @since 2.0 + * + * @param[in] label The relation label + * @see GetLabel() + */ + void SetLabel(const Tizen::Base::String& label); + + /** + * Sets the name of the relative. + * + * @since 2.0 + * + * @param[in] relativeName The name of the relative + */ + void SetRelativeName(const Tizen::Base::String& relativeName); + + /** + * Copying of objects using this copy assignment operator is allowed. + * + * @since 2.0 + * + * @param[in] rhs An instance of %Relationship to copy + */ + Relationship& operator =(const Relationship& rhs); + + /** + * Checks whether the data in the specified instance of %Relationship is equal to the data in the current instance. + * + * @since 2.0 + * + * @return @c true if the data in the specified instance equals the data in the current instance, @n + * else @c false + * @param[in] rhs An instance of %Relationship + */ + bool operator ==(const Relationship& rhs) const; + + /** + * Checks whether the data in the specified instance of %Relationship is not equal to the data in the current instance. + * + * @since 2.0 + * + * @return @c true if the data in the specified instance is not equal to the data in the current instance, @n + * else @c false + * @param[in] rhs An instance of %Relationship + */ + bool operator !=(const Relationship& rhs) const; + +private: + RelationshipType __type; + Tizen::Base::String __label; + Tizen::Base::String __name; + + friend class _RelationshipImpl; + class _RelationshipImpl* __pRelationshipImpl; +}; // Relationship + +}} // Tizen::Social + +#endif // _FSCL_RELATIONSHIP_H_ diff --git a/inc/FSclReminder.h b/inc/FSclReminder.h new file mode 100644 index 0000000..d670832 --- /dev/null +++ b/inc/FSclReminder.h @@ -0,0 +1,267 @@ +// +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// 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. +// +/** + * @file FSclReminder.h + * @brief This is the header file for the %Reminder class. + * + * This header file contains the declarations of the %Reminder class. + */ +#ifndef _FSCL_REMINDER_H_ +#define _FSCL_REMINDER_H_ + +#include +#include +#include +#include + +namespace Tizen { namespace Base +{ +class DateTime; +}} + +namespace Tizen { namespace Social +{ + +/** + * @class Reminder + * @brief This class represents the information of a reminder. + * + * @since 2.0 + * + * @final This class is not intended for extension. + * + * The %Reminder class represents the information of a reminder. An application uses this class to get or set the information of a reminder, + * such as the reminder time or the media file to be played for a reminder. + * + * For more information on the class features, see Recurrence, Reminder, and Sensitivity Properties of Calendar Items. + * + */ +class _OSP_EXPORT_ Reminder + : public Tizen::Base::Object +{ +public: + /** + * This is the default constructor for this class. @n + * The default values are set. @n + * The time offset of @c 0 minutes for a reminder is set. @n + * The sound file name is @c null. + * + * @since 2.0 + */ + Reminder(void); + + /** + * Copying of objects using this copy constructor is allowed. + * + * @since 2.0 + * + * @param[in] rhs An instance of %Reminder to copy + */ + Reminder(const Reminder& rhs); + + /** + * This destructor overrides Tizen::Base::Object::~Object(). + * + * @since 2.0 + */ + virtual ~Reminder(void); + + /** + * Compares the specified Tizen::Base::Object with the current %Reminder instance. + * + * @since 2.0 + * + * @return @c true if the specified object equals the current %Reminder instance, @n + * else @c false + * @param[in] rhs The object instance to compare with the current object + * @see GetHashCode() + */ + virtual bool Equals(const Tizen::Base::Object& rhs) const; + + /** + * Gets the hash value of the current instance. + * + * @since 2.0 + * + * @return The hash value of the current instance + */ + virtual int GetHashCode(void) const; + + /** + * @if OSPDEPREC + * Gets the time offset of the reminder prior to an event time. @n + * For an event, the time offset is calculated as the number of minutes before the start DateTime. @n + * The default time offset is @c 0. + * + * @brief [Deprecated] + * @deprecated This method is deprecated. Instead of using this method, it is recommended to use GetTimeUnit() and GetTimeOffset(). + * + * @since 2.0 + * + * @return The number of minutes + * @endif + */ + int GetMinutesBefore(void) const; + + /** + * Gets the sound file for the reminder. @n + * There is no default file name. + * + * @since 2.0 + * + * @return The file path and name + */ + Tizen::Base::String GetSoundFile(void) const; + + /** + * @if OSPDEPREC + * Sets the time offset of the reminder prior to an event time. @n + * For an event, the time offset is calculated as the number of minutes before the start DateTime. + * + * @brief [Deprecated] + * @deprecated This method is deprecated. Instead of using this method, it is recommended to use SetTimeOffset(). + * @since 2.0 + * + * @return An error code + * @param[in] minutes The time offset in minutes + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified time offset is less than @c 0 or greater than @c 40320. + * @remarks The maximum value of the time offset is @c 40320. + * @endif + */ + result SetMinutesBefore(int minutes); + + /** + * Sets the sound file for the reminder. + * + * @if OSPCOMPAT + * @brief [Compatibility] + * @endif + * @since 2.0 + * @if OSPCOMPAT + * @compatibility This method has compatibility issues with OSP compatible applications. @n + * For more information, see @ref CompIoPathPage "here". + * @endif + * + * @return An error code + * @param[in] filePath The path and name of the new sound file, @n + * else @c null to remove the previously set sound file + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The specified @c filePath is invalid. + * - The specified file does not exist. + */ + result SetSoundFile(const Tizen::Base::String& filePath); + + /** + * Sets the reminder time unit and offset. + * + * @since 2.0 + * + * @return An error code + * @param[in] timeUnit The reminder time unit + * @param[in] timeOffset The reminder time offset + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The specified @c timeUnit is @c REMINDER_TIME_UNIT_NONE. + * - The specified @c timeOffset is less than @c 0. + * @remarks The time offset and absolute time are mutually exclusive. @n + * When the absolute time is set, the time unit is @c REMINDER_TIME_UNIT_NONE and offset is @c 0. @n + * When the time offset is set, the absolute time is reset. + */ + result SetTimeOffset(ReminderTimeUnit timeUnit, int timeOffset); + + /** + * Gets the reminder time unit. + * + * @since 2.0 + * + * @return The reminder time unit, @n + * else @c REMINDER_TIME_UNIT_NONE if the absolute time is set + */ + ReminderTimeUnit GetTimeUnit(void) const; + + /** + * Gets the reminder time offset in the time unit currently set to this instance. + * + * @since 2.0 + * + * @return The reminder time offset, @n + * else @c 0 if the absolute time is set + */ + int GetTimeOffset(void) const; + + /** + * Sets the reminder absolute time. @n + * The time is in Coordinated Universal Time (UTC). + * + * @since 2.1 + * + * @return An error code + * @param[in] time The reminder absolute time. @n Any value with a unit that is less than a second is ignored. + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c time is out of the valid range. @n + * The valid range of the time can be referenced from Calendarbook::GetMaxDateTime() and Calendarbook::GetMinDateTime(). + * @remarks The time offset and absolute time are mutually exclusive. @n + * When the absolute time is set, the time unit is ::REMINDER_TIME_UNIT_NONE and offset is @c 0. @n + * When the time offset is set, the absolute time is reset. + */ + result SetAbsoluteTime(const Tizen::Base::DateTime& time); + + /** + * Gets the reminder absolute time. + * + * @since 2.1 + * + * @return The reminder absolute time, @n + * else the minimum value of Tizen::Base::DateTime if the absolute time is not set + */ + Tizen::Base::DateTime GetAbsoluteTime(void) const; + + /** + * Checks whether the absolute time is set. + * + * @since 2.1 + * + * @return @c true if the absolute time is set, @n + * else @c false + * @remarks The time offset and absolute time are mutually exclusive. @n + * When the absolute time is set, the time unit is ::REMINDER_TIME_UNIT_NONE and offset is @c 0. @n + * When the time offset is set, the absolute time is reset. + */ + bool IsAbsolute(void) const; + + /** + * Copying of objects using this copy assignment operator is allowed. + * + * @since 2.0 + * + * @param[in] rhs An instance of %Reminder to copy + */ + Reminder& operator =(const Reminder& rhs); + +private: + Tizen::Base::String __soundFilePath; + ReminderTimeUnit __timeUnit; + int __timeOffset; + + friend class _ReminderImpl; + class _ReminderImpl* __pReminderImpl; +}; // Reminder + +}} // Tizen::Social + +#endif // _FSCL_REMINDER_H_ diff --git a/inc/FSclTypes.h b/inc/FSclTypes.h new file mode 100644 index 0000000..2274e69 --- /dev/null +++ b/inc/FSclTypes.h @@ -0,0 +1,1087 @@ +// +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// +// 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. +// + +/** + * @file FSclTypes.h + * @brief This is the header file for the types in the %Social namespace. + * + * This header file contains the declarations of the types in the Social namespace. + */ +#ifndef _FSCL_TYPES_H_ +#define _FSCL_TYPES_H_ + +namespace Tizen { namespace Base +{ +class DateTime; +}} + +namespace Tizen { namespace Social +{ + +/** + * A unique ID. This ID is unique within a local storage only. @n + * @c RecordId is assigned by the local storage (for example, Addressbook and Calendarbook) when a record is saved to the storage. @n + * A newly constructed record instance has ::INVALID_RECORD_ID. + * + * @since 2.0 + */ +typedef int RecordId; + +/** + * An invalid record ID. @n + * The record has not been properly recorded to Addressbook. + * + * @since 2.0 + */ +const RecordId INVALID_RECORD_ID = -1; + +/** + * A unique ID for an account. @n + * If an account is added successfully, an @c AccountId is automatically assigned to the account. + * + * @since 2.1 + */ +typedef int AccountId; + +/** + * An invalid account ID. + * + * @since 2.1 + */ +const AccountId INVALID_ACCOUNT_ID = -1; + +/** + * @typedef RecurrenceId + * Defines the recurrence ID that is used to identify a specific instance of a recurring calendar component (CalEvent). @n + * The value type is Tizen::Base::DateTime. The property value is the effective value of the start time ("DTSTART" property) of the Recurrence instance. + * + * @since 2.0 + */ +typedef Tizen::Base::DateTime RecurrenceId; + +/** + * @if OSPDEPREC + * The maximum length of the name property. + * + * @brief [Deprecated] + * @deprecated This constant is deprecated. + * @since 2.0 + * @endif + */ +static const int MAX_ATTENDEE_NAME_LENGTH = 100; + +/** + * @if OSPDEPREC + * The maximum length of the email property. + * + * @brief [Deprecated] + * @deprecated This constant is deprecated. + * @since 2.0 + * @endif + */ +static const int MAX_ATTENDEE_EMAIL_LENGTH = 320; + +/** + * @if OSPDEPREC + * The maximum length of the subject field. + * + * @brief [Deprecated] + * @deprecated This constant is deprecated. + * @since 2.0 + * @endif + */ +static const int MAX_EVENT_SUBJECT_LENGTH = 100; + +/** + * @if OSPDEPREC + * The maximum length of the description field. + * + * @brief [Deprecated] + * @deprecated This constant is deprecated. + * @since 2.0 + * @endif + */ +static const int MAX_EVENT_DESCRIPTION_LENGTH = 1000; + +/** + * @if OSPDEPREC + * The maximum length of the location field. + * + * @brief [Deprecated] + * @deprecated This constant is deprecated. + * @since 2.0 + * @endif + */ +static const int MAX_EVENT_LOCATION_LENGTH = 100; + +/** + * @if OSPDEPREC + * The maximum length of the subject field. + * + * @brief [Deprecated] + * @deprecated This constant is deprecated. + * @since 2.0 + * @endif + */ +static const int MAX_TODO_SUBJECT_LENGTH = 100; + +/** + * @if OSPDEPREC + * The maximum length of the description field. + * + * @brief [Deprecated] + * @deprecated This constant is deprecated. + * @since 2.0 + * @endif + */ +static const int MAX_TODO_DESCRIPTION_LENGTH = 1000; + +/** + * @if OSPDEPREC + * The maximum recurrence interval value. + * + * @brief [Deprecated] + * @deprecated This constant is deprecated. + * @since 2.0 + * @endif + */ +static const int MAX_RECURRENCE_INTERVAL_VALUE = 255; + +/** + * @if OSPDEPREC + * The maximum value of the reminder offset (in minutes). + * + * @brief [Deprecated] + * @deprecated This constant is deprecated. + * @since 2.0 + * @endif + */ +static const int MAX_REMINDER_OFFSET_VALUE = 40320; + +/** + * @if OSPDEPREC + * The maximum length of the name properties (first, last, nickname, and formatted names). + * + * @brief [Deprecated] + * @deprecated This constant is deprecated because there is no limitation any more. + * @since 2.0 + * @endif + */ +static const int MAX_CONTACT_NAME_LENGTH = 50; + +/** + * @if OSPDEPREC + * The maximum length of the job title property. + * + * @brief [Deprecated] + * @deprecated This constant is deprecated because there is no limitation any more. + * @since 2.0 + * @endif + */ +static const int MAX_CONTACT_JOB_TITLE_LENGTH = 50; + +/** + * @if OSPDEPREC + * The maximum length of the company property. + * + * @brief [Deprecated] + * @deprecated This constant is deprecated because there is no limitation any more. + * @since 2.0 + * @endif + */ +static const int MAX_CONTACT_COMPANY_LENGTH = 50; + +/** + * @if OSPDEPREC + * The maximum length of the note property. + * + * @brief [Deprecated] + * @deprecated This constant is deprecated because there is no limitation any more. + * @since 2.0 + * @endif + */ +static const int MAX_CONTACT_NOTE_LENGTH = 100; + +/** + * @if OSPDEPREC + * The maximum length of the category name. + * + * @brief [Deprecated] + * @deprecated This constant is deprecated because the maximum length of the category name has been changed. + * @since 2.0 + * @endif + */ +static const int MAX_CATEGORY_NAME_LENGTH = 20; + +/** + * @if OSPDEPREC + * The minimum length of the query string for searching the contacts by name. + * + * @brief [Deprecated] + * @deprecated This value is deprecated. + * @since 2.0 + * + * @see Addressbook::SearchContactsByNameN() + * @endif + */ +static const int MIN_NAME_QUERY_LENGTH = 1; + +/** + * @if OSPDEPREC + * The minimum length of the query string for searching the contacts by phone number. + * + * @brief [Deprecated] + * @deprecated This value is deprecated. + * @since 2.0 + * + * @see Addressbook::SearchContactsByPhoneNumberN() + * @endif + */ +static const int MIN_PHONENUMBER_QUERY_LENGTH = 4; + +/** + * @if OSPDEPREC + * The minimum length of the query string for searching the contacts by email. + * + * @brief [Deprecated] + * @deprecated This value is deprecated. + * @since 2.0 + * + * @see Addressbook::SearchContactsByEmailN() + * @endif + */ +static const int MIN_EMAIL_QUERY_LENGTH = 1; + +/** + * @if OSPDEPREC + * The maximum length of the email property. + * + * @brief [Deprecated] + * @deprecated This constant is deprecated because there is no limitation any more. + * @since 2.0 + * @endif + */ +static const int MAX_EMAIL_LENGTH = 100; + +/** + * @enum ContactPropertyId + * + * Defines the IDs for accessing the single value type properties of Contact. + * @since 2.0 + */ +enum ContactPropertyId +{ + CONTACT_PROPERTY_ID_FIRST_NAME = 1, /**< The first name property ID (String type) */ + CONTACT_PROPERTY_ID_LAST_NAME, /**< The last name property ID (String type) */ + CONTACT_PROPERTY_ID_DISPLAY_NAME, /**< The formatted name property ID (String type) */ + CONTACT_PROPERTY_ID_NICK_NAME, /**< @if OSPDEPREC The nick name property ID (String type) + @deprecated This enum value is deprecated because there can be multiple nicknames + in a contact. Instead of using this, use ContactMultiPropertyId::CONTACT_MPROPERTY_ID_NICKNAMES. @endif */ + CONTACT_PROPERTY_ID_THUMBNAIL, /**< @if OSPDEPREC The thumbnail property ID (Bitmap type) + @deprecated This enumeration value is deprecated because it is not used any longer. @endif */ + CONTACT_PROPERTY_ID_BIRTHDAY, /**< @if OSPDEPREC The birthday property ID (DateTime type) + @deprecated This enum value is deprecated because there can be multiple birthday events. + Instead of using this, use ContactMultiPropertyId::CONTACT_MPROPERTY_ID_EVENTS. @endif */ + CONTACT_PROPERTY_ID_JOB_TITLE, /**< @if OSPDEPREC The job title property ID (String type) + @deprecated This enum value is deprecated because there can be multiple organizational information. + Instead of using this, use ContactMultiPropertyId::CONTACT_MPROPERTY_ID_ORGANIZATIONS. @endif */ + CONTACT_PROPERTY_ID_COMPANY, /**< @if OSPDEPREC The company property ID (String type) + @deprecated This enum value is deprecated because there can be multiple organizational information. + Instead of using this, use ContactMultiPropertyId::CONTACT_MPROPERTY_ID_ORGANIZATIONS.@endif */ + CONTACT_PROPERTY_ID_NOTE, /**< @if OSPDEPREC The note property ID (String type) + @deprecated This enum value is deprecated because there can be multiple notes + in a contact. Instead of using this, use ContactMultiPropertyId::CONTACT_MPROPERTY_ID_NOTES.@endif */ + CONTACT_PROPERTY_ID_ANNIVERSARY, /**< @if OSPDEPREC The anniversary property ID (DateTime type) + @deprecated This enum value is deprecated because there can be multiple anniversary events. + Instead of using this, use ContactMultiPropertyId::CONTACT_MPROPERTY_ID_EVENTS.@endif */ + CONTACT_PROPERTY_ID_RINGTONE, /**< The ringtone property ID (String type) */ + CONTACT_PROPERTY_ID_MIDDLE_NAME, /**< The middle name property ID (String type) */ + CONTACT_PROPERTY_ID_LAST_REVISION, /**< An ID for the calendar date and time of the last update in Coordinated Universal Time (UTC) @n Read-only (DateTime type) */ + CONTACT_PROPERTY_ID_NAME_PREFIX, /**< The name honorific prefix property ID (String type) */ + CONTACT_PROPERTY_ID_NAME_SUFFIX, /**< The name honorific suffix property ID (String type) */ + CONTACT_PROPERTY_ID_PHONETIC_FIRST_NAME, /**< The phonetic first name property ID (String type) @b Since: @b 2.1 */ + CONTACT_PROPERTY_ID_PHONETIC_LAST_NAME, /**< The phonetic last name property ID (String type) @b Since: @b 2.1 */ + CONTACT_PROPERTY_ID_PHONETIC_MIDDLE_NAME, /**< The phonetic middle name property ID (String type) @b Since: @b 2.1 */ + CONTACT_PROPERTY_ID_UID, /**< The globally unique ID (String type) @b Since: @b 2.1 */ +}; + +/** + * @enum ContactMultiPropertyId + * + * Defines the IDs for accessing the multi-value type properties of Contact. @n + * The properties have several values and they are called multi-type properties. + * @since 2.0 + */ +enum ContactMultiPropertyId +{ + CONTACT_MPROPERTY_ID_PHONE_NUMBERS, /**< The phone number property ID (PhoneNumber class) */ + CONTACT_MPROPERTY_ID_EMAILS, /**< The email property ID (Email class) */ + CONTACT_MPROPERTY_ID_URLS, /**< The URL property ID (Url class) */ + CONTACT_MPROPERTY_ID_ADDRESSES, /**< The address property ID (Address class) */ + CONTACT_MPROPERTY_ID_IMADDRESSES, /**< The Instant Message property ID (ImAddress class) */ + CONTACT_MPROPERTY_ID_EVENTS, /**< The contact event property ID (ContactEvent type) */ + CONTACT_MPROPERTY_ID_ORGANIZATIONS, /**< The organization property ID (Organization type) */ + CONTACT_MPROPERTY_ID_NOTES, /**< The note property ID (String type) */ + CONTACT_MPROPERTY_ID_NICKNAMES, /**< The nickname property ID (String type) */ + CONTACT_MPROPERTY_ID_RELATIONSHIPS, /**< The relationship property ID (Relationship type) */ + CONTACT_MPROPERTY_ID_APP_LAUNCH_DATA, /**< The app launch data property ID (ContactAppLaunchData type) @b Since: @b 2.1 */ +}; + +/** + * @if OSPDEPREC + * The number of #ContactPropertyId factors. + * + * @brief [Deprecated] + * @deprecated This constant is deprecated because it is not used any more. + * @since 2.0 + * @endif + */ +static const int CONTACT_PROPERTY_ID_NUM = 14; + +/** + * @if OSPDEPREC + * The number of #ContactMultiPropertyId factors. + * + * @brief [Deprecated] + * @deprecated This constant is deprecated because it is not used any more. + * @since 2.0 + * @endif + */ +static const int CONTACT_MPROPERTY_ID_NUM = 5; + +/** + * @enum RecordSensitivity + * Defines the sensitivity type of the calendar book record. @n + * This value represents the access classification property of @c vCalendar and @c iCalendar. + * + * @since 2.0 + */ +enum RecordSensitivity +{ + SENSITIVITY_PUBLIC, /**< The public sensitivity */ + SENSITIVITY_PRIVATE, /**< The private sensitivity */ + SENSITIVITY_CONFIDENTIAL /**< The confidential sensitivity */ +}; + +/** + * @enum AttendeeRole + * Defines the role of the attendee. + * @since 2.0 + */ +enum AttendeeRole +{ + ATTENDEE_ROLE_ATTENDEE, /**< The attendee */ + ATTENDEE_ROLE_REQUIRED_ATTENDEE, /**< The required attendee */ + ATTENDEE_ROLE_ORGANIZER /**< The organizer */ +}; + +/** + * @enum AttendeeStatus + * Defines the possible status of the attendee. + * @since 2.0 + */ +enum AttendeeStatus +{ + ATTENDEE_STATUS_NONE, /**< No status */ + ATTENDEE_STATUS_NOT_RESPONDED, /**< The not-responded status */ + ATTENDEE_STATUS_ACCEPTED, /**< The accepted status */ + ATTENDEE_STATUS_DECLINED, /**< The declined status */ + ATTENDEE_STATUS_TENTATIVE, /**< The tentative status */ +}; + +/** + * @if OSPDEPREC + * @enum EventCategory + * @brief [Deprecated] Defines the categories to classify the event. + * + * @deprecated This enum type is deprecated because the category of the event is not used any more. + * @since 2.0 + * @endif + */ +enum EventCategory +{ + EVENT_CATEGORY_APPOINTMENT = 0x00000001, /**< @if OSPDEPREC The appointment category @endif */ + EVENT_CATEGORY_ANNIVERSARY = 0x00000002, /**< @if OSPDEPREC The anniversary category @endif */ +}; + +/** + * @if OSPDEPREC + * All the event categories. + * + * @brief [Deprecated] + * @deprecated This constant is deprecated because the category of the event is not used any more. + * @since 2.0 + * @endif + */ +static const unsigned long EVENT_CATEGORY_ALL = EVENT_CATEGORY_APPOINTMENT | EVENT_CATEGORY_ANNIVERSARY; + +/** + * @enum EventPriority + * Defines the possible priority levels of the event. + * + * @since 2.0 + */ +enum EventPriority +{ + EVENT_PRIORITY_LOW, /**< The low priority */ + EVENT_PRIORITY_NORMAL, /**< The normal priority */ + EVENT_PRIORITY_HIGH /**< The high priority */ +}; + +/** + * @enum EventStatus + * Defines the possible statuses of the event. + * + * @since 2.0 + */ +enum EventStatus +{ + EVENT_STATUS_NONE, /**< No status */ + EVENT_STATUS_CONFIRMED, /**< The confirmed status */ + EVENT_STATUS_CANCELLED, /**< The cancelled status */ + EVENT_STATUS_TENTATIVE /**< The tentative status */ +}; + +/** + * @enum BusyStatus + * Defines the busy statuses of the event. + * + * @since 2.0 + */ +enum BusyStatus +{ + BUSY_STATUS_FREE, /**< The free status */ + BUSY_STATUS_BUSY, /**< The busy status */ + BUSY_STATUS_UNAVAILABLE, /**< The unavailable status */ + BUSY_STATUS_TENTATIVE /**< The tentative status */ +}; + +/** + * @enum TodoStatus + * Defines the possible to-do status types. + * + * @since 2.0 + */ +enum TodoStatus +{ + TODO_STATUS_NONE = 0x00000001, /**< No status */ + TODO_STATUS_NEEDS_ACTION = 0x00000002, /**< The needs action status */ + TODO_STATUS_COMPLETED = 0x00000004, /**< The completed status */ + TODO_STATUS_IN_PROCESS = 0x00000008, /**< The in process status */ + TODO_STATUS_CANCELLED = 0x00000010, /**< The cancelled status */ +}; + +/** All the to-do statuses. + * + * @since 2.0 + */ +static const unsigned long TODO_STATUS_ALL = TODO_STATUS_NONE | TODO_STATUS_NEEDS_ACTION | TODO_STATUS_COMPLETED | + TODO_STATUS_IN_PROCESS | TODO_STATUS_CANCELLED; + +/** + * @enum TodoPriority + * Defines the possible to-do priority levels. + * + * @since 2.0 + */ +enum TodoPriority +{ + TODO_PRIORITY_LOW = 0x00000001, /**< The low priority */ + TODO_PRIORITY_NORMAL = 0x00000002, /**< The normal priority */ + TODO_PRIORITY_HIGH = 0x00000004, /**< The high priority */ +}; + +/** All the to-do priorities. + * + * @since 2.0 + */ +static const unsigned long TODO_PRIORITY_ALL = TODO_PRIORITY_LOW | TODO_PRIORITY_NORMAL | TODO_PRIORITY_HIGH; + +/** + * @if OSPDEPREC + * @enum RecordEventType + * Defines the record event types. + * + * @brief [Deprecated] + * @deprecated This enum is deprecated because IRecordEventListener interface is deprecated. + * + * @since 2.0 + * @endif + */ +enum RecordEventType +{ + RECORD_ADDED, /**< @if OSPDEPREC Adding a new record @endif */ + RECORD_UPDATED, /**< @if OSPDEPREC Updating a record @endif */ + RECORD_REMOVED, /**< @if OSPDEPREC The removal of a record @endif */ + ALL_RECORDS_REMOVED, /**< + * @if OSPDEPREC + * The removal of all the records @n + * @deprecated This enum value is deprecated because it is not used any more. + * @endif + */ + MULTI_RECORDS_ADDED, /**< @if OSPDEPREC Adding multiple records @endif */ + MULTI_RECORDS_UPDATED, /**< @if OSPDEPREC Adding, updating, and/or removal of multiple records @endif */ + MULTI_RECORDS_REMOVED /**< @if OSPDEPREC The removal of multiple records @endif */ +}; + +/** + * @enum RecurFrequency + * Defines the recurrence frequency type. + * + * @since 2.0 + */ +enum RecurFrequency +{ + FREQ_DAILY, /**< The daily recurrence */ + FREQ_WEEKLY, /**< The weekly recurrence */ + FREQ_MONTHLY, /**< The monthly recurrence */ + FREQ_YEARLY /**< The yearly recurrence */ +}; + +/** + * @enum CalDayOfWeek + * Defines the day of week type. + * + * @since 2.0 + */ +enum CalDayOfWeek +{ + CAL_SUNDAY = 0x0001, /**< The day of the week is Sunday */ + CAL_MONDAY = 0x0002, /**< The day of the week is Monday */ + CAL_TUESDAY = 0x0004, /**< The day of the week is Tuesday */ + CAL_WEDNESDAY = 0x0008, /**< The day of the week is Wednesday */ + CAL_THURSDAY = 0x0010, /**< The day of the week is Thursday */ + CAL_FRIDAY = 0x0020, /**< The day of the week is Friday */ + CAL_SATURDAY = 0x0040 /**< The day of the week is Saturday */ +}; + +/** + * @enum RecordChangeType + * Defines the change type of a Record. + * + * @since 2.0 + */ +enum RecordChangeType +{ + RECORD_CHANGE_TYPE_ADDED, /**< A record is added */ + RECORD_CHANGE_TYPE_REMOVED, /**< A record is removed */ + RECORD_CHANGE_TYPE_UPDATED, /**< A record is updated */ +}; + +/** + * @enum CalendarItemType + * Defines the item types to specify which kind of item the calendar can contain. + * + * @since 2.0 + */ +enum CalendarItemType +{ + CALENDAR_ITEM_TYPE_EVENT_ONLY = 0x1, /**< The item type for an event */ + CALENDAR_ITEM_TYPE_TODO_ONLY = 0x2, /**< The item type for a to-do item */ + CALENDAR_ITEM_TYPE_EVENT_AND_TODO = 0x3 /**< The item type for an event and a to-do item */ +}; + +/** + * @enum PhoneNumberType + * + * Defines the types of phone numbers. + * @since 2.0 + */ +enum PhoneNumberType +{ + PHONENUMBER_TYPE_HOME, /**< The phone number type for a home telephone */ + PHONENUMBER_TYPE_WORK, /**< The phone number type for a work telephone */ + PHONENUMBER_TYPE_MOBILE, /**< The phone number type for a mobile */ + PHONENUMBER_TYPE_HOME_FAX, /**< The phone number type for home fax */ + PHONENUMBER_TYPE_WORK_FAX, /**< The phone number type for work fax */ + PHONENUMBER_TYPE_PAGER, /**< The phone number type for a pager */ + PHONENUMBER_TYPE_OTHER, /**< The phone number type for other */ + PHONENUMBER_TYPE_CUSTOM, /**< The custom type @n The actual type can be set in the label */ + PHONENUMBER_TYPE_ASSISTANT /**< The phone number type for an assistant @b Since: @b 2.1 */ +}; + +/** + * @enum ReminderTimeUnit + * Defines the reminder time unit. + * + * @since 2.0 + */ +enum ReminderTimeUnit +{ + REMINDER_TIME_UNIT_MINUTE, /**< The unit of time offset is minute */ + REMINDER_TIME_UNIT_HOUR, /**< The unit of time offset is hour */ + REMINDER_TIME_UNIT_DAY, /**< The unit of time offset is day */ + REMINDER_TIME_UNIT_WEEK, /**< The unit of time offset is week */ + REMINDER_TIME_UNIT_NONE, /**< The unit of time offset is none @b Since @b 2.1 */ +}; + +/** + * @enum EmailType + * + * Defines the types of emails. + * +* @since 2.0 + */ +enum EmailType +{ + EMAIL_TYPE_PERSONAL, /**< The email type for personal*/ + EMAIL_TYPE_WORK, /**< The email type for work */ + EMAIL_TYPE_OTHER, /**< The email type for other */ + EMAIL_TYPE_CUSTOM, /**< The custom type @n The actual type can be set in the label */ + EMAIL_TYPE_MOBILE /**< The email type for mobile @b Since: @b 2.1 */ +}; + +/** + * Defines the types of addresses. + * + * @since 2.0 + */ +enum AddressType +{ + ADDRESS_TYPE_HOME, /**< The address type for a home address */ + ADDRESS_TYPE_WORK, /**< The address type for a work address */ + ADDRESS_TYPE_OTHER, /**< The address type for other */ + ADDRESS_TYPE_CUSTOM /**< The custom type @n The actual type can be set in the label */ +}; + +/** + * @enum ContactEventType + * + * Defines the types of events. + * + * @since 2.0 + */ +enum ContactEventType +{ + CONTACT_EVENT_TYPE_BIRTHDAY, /**< The event type for a birthday */ + CONTACT_EVENT_TYPE_ANNIVERSARY, /**< The event type for an anniversary */ + CONTACT_EVENT_TYPE_OTHER, /**< The event type for other */ + CONTACT_EVENT_TYPE_CUSTOM /**< The custom event @n The actual type can be set in the label */ +}; + +/** + * @enum UrlType + * + * Defines the types of URLs. + * + * @since 2.0 + */ +enum UrlType +{ + URL_TYPE_PERSONAL, /**< The URL type is personal */ + URL_TYPE_WORK, /**< The URL type is work */ + URL_TYPE_OTHER, /**< The URL type is other */ + URL_TYPE_CUSTOM /**< The custom type @n The actual type can be set in the label */ +}; + +/** + * @enum RelationshipType + * + * Defines the types of relationships. + * + * @since 2.0 + */ +enum RelationshipType +{ + CONTACT_RELATIONSHIP_TYPE_ASSISTANT, /**< The relation type for an assistant */ + CONTACT_RELATIONSHIP_TYPE_BROTHER, /**< The relation type for a brother */ + CONTACT_RELATIONSHIP_TYPE_CHILD, /**< The relation type for a child */ + CONTACT_RELATIONSHIP_TYPE_DOMESTIC_PARTNER, /**< The relation type for a domestic partner */ + CONTACT_RELATIONSHIP_TYPE_FATHER, /**< The relation type for a father */ + CONTACT_RELATIONSHIP_TYPE_FRIEND, /**< The relation type for a friend */ + CONTACT_RELATIONSHIP_TYPE_MANAGER, /**< The relation type for a manager */ + CONTACT_RELATIONSHIP_TYPE_MOTHER, /**< The relation type for a mother */ + CONTACT_RELATIONSHIP_TYPE_PARENT, /**< The relation type for a parent */ + CONTACT_RELATIONSHIP_TYPE_PARTNER, /**< The relation type for a partner */ + CONTACT_RELATIONSHIP_TYPE_REFERRED_BY, /**< The relation type for referred-by */ + CONTACT_RELATIONSHIP_TYPE_RELATIVE, /**< The relation type for a relative */ + CONTACT_RELATIONSHIP_TYPE_SISTER, /**< The relation type for a sister */ + CONTACT_RELATIONSHIP_TYPE_SPOUSE, /**< The relation type for a spouse */ + CONTACT_RELATIONSHIP_TYPE_CUSTOM /**< The custom event @n The actual type can be set in the label */ +}; + +/** + * @enum OrganizationType + * + * Defines the types of organizations. + * + * @since 2.1 + */ + +enum OrganizationType +{ + ORGANIZATION_TYPE_WORK, /**< The organization type for work */ + ORGANIZATION_TYPE_OTHER, /**< The organization type for other */ + ORGANIZATION_TYPE_CUSTOM /**< The custom type @n The actual type can be set in the label */ +}; + +/** + * @if OSPDEPREC + * The maximum length of the phone number property. + * + * @brief [Deprecated] + * @deprecated This constant is deprecated because there is no limitation any more. + * @since 2.0 + * @endif + */ +static const int MAX_PHONE_NUMBER_LENGTH = 50; + +//This value is for internal use only. Using this value can cause behavioral, +//security-related, and consistency-related issues in the application. +typedef int AccountId; + +/** + * The person ID. + * + * @since 2.0 + */ +typedef int PersonId; + + +/** + * The addressbook ID. + * + * @since 2.0 + */ +typedef int AddressbookId; + +/** +* An invalid address book ID indicates that the address book has not been properly stored in the address book database. +* +* @since 2.0 +*/ +static const AddressbookId INVALID_ADDRESSBOOK_ID = -2; + +/** +* The default addressbook ID. +* +* @since 2.0 +*/ +static const AddressbookId DEFAULT_ADDRESSBOOK_ID = 0; + +/** + * @enum FilterConjunctiveOperator + * Defines the conjunctive operators to compound the filtering expressions. + * + * @since 2.0 + */ +enum FilterConjunctiveOperator +{ + FI_CONJ_OP_NONE, /**< None */ + FI_CONJ_OP_AND, /**< AND operator */ + FI_CONJ_OP_OR, /**< OR operator */ +}; + +/** + * @enum FilterComparisonOperator + * Defines the comparison operators. + * + * @since 2.0 + */ +enum FilterComparisonOperator +{ + FI_CMP_OP_EQUAL, /**< = operator */ + FI_CMP_OP_LESS_THAN, /**< < operator */ + FI_CMP_OP_LESS_THAN_OR_EQUAL, /**< <= operator */ + FI_CMP_OP_GREATER_THAN, /**< > operator */ + FI_CMP_OP_GREATER_THAN_OR_EQUAL, /**< >= operator */ + FI_CMP_OP_IS_NULL, /**< NULL operator */ +}; + +/** + * @enum FilterStringOperator + * Defines the matching criteria for Strings. + * + * @since 2.0 + */ +enum FilterStringOperator +{ + FI_STR_OP_EQUAL, /**< The operator for matching the string exactly */ + FI_STR_OP_FULL_STRING, /**< The operator for matching the full-string without case sensitive */ + FI_STR_OP_START_WITH, /**< The operator for matching the string starting with the specified keyword */ + FI_STR_OP_END_WITH, /**< The operator for matching the string ending with the specified keyword */ + FI_STR_OP_CONTAIN, /**< The operator for matching the string containing the specified keyword */ + FI_STR_OP_IS_NOT_NULL, /**< The operator for matching any string(except NULL) @n The specified is ignored */ +}; + +/** + * @enum AddressbookFilterType + * Defines the type of the filter for Addressbook. + * + * @since 2.0 + */ +enum AddressbookFilterType +{ + AB_FI_TYPE_ADDRESSBOOK, /**< The filter for the addressbooks @n AddressbookFilterProperty is only used in this type of filter @n + The search result with this filter is a list of Addressbook */ + AB_FI_TYPE_PERSON, /**< The filter for the persons @n PersonFilterProperty is only used in this type of filter @n + The search result with this filter is a list of Person */ + AB_FI_TYPE_CONTACT, /**< The filter for the contacts @n ContactFilterProperty is only used in this type of filter @n + The search result with this filter is a list of Contact */ + AB_FI_TYPE_CATEGORY, /**< The filter for the categories @n CategoryFilterProperty is only used in this type of filter @n + The search result with this filter is a list of Category */ + AB_FI_TYPE_PHONE_CONTACT, /**< The filter for the contacts with phone number @n PhoneContactFilterProperty is only used in this type of filter @n + The search result with this filter is a list of PhoneNumberContact */ + AB_FI_TYPE_EMAIL_CONTACT, /**< The filter for the contacts with email @n EmailContactFilterProperty is only used in this type of filter @n + The search result with this filter is a list of EmailContact */ +}; + +/** + * @enum AddressbookFilterProperty + * Defines the property for filtering the addressbooks. @n + * These properties can be used to create an AddressbookFilter of #AB_FI_TYPE_ADDRESSBOOK type. + * + * @since 2.0 + */ +enum AddressbookFilterProperty +{ + AB_FI_PR_ADDRESSBOOK_ID = 1, /**< The addressbook ID: int (AddressbookId) */ + AB_FI_PR_ACCOUNT_ID, /**< The account ID: int (AccountId) */ + AB_FI_PR_NAME, /**< The addressbook name: String */ +}; + +/** + * @enum PersonFilterProperty + * Defines the property for filtering a person. @n + * These properties can be used to create an AddressbookFilter of #AB_FI_TYPE_PERSON type. + * + * @since 2.0 + */ +enum PersonFilterProperty +{ + PERSON_FI_PR_PERSON_ID = 100, /**< The person ID: int (RecordId) */ + PERSON_FI_PR_DISPLAY_NAME, /**< The display name: String */ + PERSON_FI_PR_HAS_PHONE, /**< Whether the person has phone numbers or not: bool */ + PERSON_FI_PR_HAS_EMAIL, /**< Whether the person has emails or not: bool */ + PERSON_FI_PR_IS_FAVORITE, /**< Whether the person is a favorite or not: bool */ + PERSON_FI_PR_CATEGORY_ID, /**< The category ID: int (RecordId) */ + PERSON_FI_PR_ADDRESSBOOK_ID, /**< The addressbook ID: int (AddressbookId) */ +}; + +/** + * @enum ContactFilterProperty + * Defines the property for filtering the contacts. @n + * These properties can be used to create an AddressbookFilter of #AB_FI_TYPE_CONTACT type. + * + * @since 2.0 + */ +enum ContactFilterProperty +{ + CONTACT_FI_PR_CONTACT_ID = 200, /**< The contact ID: int (RecordId) */ + CONTACT_FI_PR_ADDRESSBOOK_ID, /**< The addressbook ID: int (AddressbookId) */ + CONTACT_FI_PR_PERSON_ID, /**< The person ID: int (PersonId) */ + CONTACT_FI_PR_DISPLAY_NAME, /**< The display name: String */ + CONTACT_FI_PR_HAS_PHONE, /**< Whether the contact has phone numbers or not: bool */ + CONTACT_FI_PR_HAS_EMAIL, /**< Whether the contact has emails or not: bool */ +}; + +/** + * @enum CategoryFilterProperty + * Defines the property for filtering the categories. + * These properties can be used to create an AddressbookFilter of #AB_FI_TYPE_CATEGORY type. + * + * @since 2.0 + */ +enum CategoryFilterProperty +{ + CATEGORY_FI_PR_CATEGORY_ID = 300, /**< The category ID: int (RecordId) */ + CATEGORY_FI_PR_ADDRESSBOOK_ID, /**< The addressbook ID: int (AddressbookId) */ + CATEGORY_FI_PR_NAME, /**< The category name: String */ +}; + +/** + * @enum PhoneContactFilterProperty + * Defines the property for filtering the contacts with phone number. + * These properties can be used to create an AddressbookFilter of #AB_FI_TYPE_PHONE_CONTACT type. + * + * @since 2.0 + */ +enum PhoneContactFilterProperty +{ + PHONE_CONTACT_FI_PR_CONTACT_ID = 400, /**< The contact ID: int (RecordId) */ + PHONE_CONTACT_FI_PR_ADDRESSBOOK_ID, /**< The addressbook ID: int (AddressbookId) */ + PHONE_CONTACT_FI_PR_PERSON_ID, /**< The person ID: int (PersonId) */ + PHONE_CONTACT_FI_PR_DISPLAY_NAME, /**< The display name: String */ + PHONE_CONTACT_FI_PR_PHONE, /**< The phone number: String */ +}; + +/** + * @enum EmailContactFilterProperty + * Defines the property for filtering the contacts with email. + * These properties can be used to create an AddressbookFilter of #AB_FI_TYPE_EMAIL_CONTACT type. + * + * @since 2.0 + */ +enum EmailContactFilterProperty +{ + EMAIL_CONTACT_FI_PR_CONTACT_ID = 500, /**< The contact ID: int (RecordId) */ + EMAIL_CONTACT_FI_PR_ADDRESSBOOK_ID, /**< The addressbook ID: int (AddressbookId) */ + EMAIL_CONTACT_FI_PR_PERSON_ID, /**< The person ID: int (PersonId) */ + EMAIL_CONTACT_FI_PR_DISPLAY_NAME, /**< The display name: String */ + EMAIL_CONTACT_FI_PR_EMAIL, /**< The email: String */ +}; + +/** + * @enum UserProfilePropertyId + * + * Defines the IDs for accessing the single value type properties of UserProfile. + * @since 2.1 + */ +enum UserProfilePropertyId +{ + USER_PROFILE_PROPERTY_ID_FIRST_NAME = 1, /**< The first name property ID (String type) */ + USER_PROFILE_PROPERTY_ID_LAST_NAME, /**< The last name property ID (String type) */ + USER_PROFILE_PROPERTY_ID_MIDDLE_NAME, /**< The middle name property ID (String type) */ + USER_PROFILE_PROPERTY_ID_NAME_PREFIX, /**< The name honorific prefix property ID (String type) */ + USER_PROFILE_PROPERTY_ID_NAME_SUFFIX, /**< The name honorific suffix property ID (String type) */ + USER_PROFILE_PROPERTY_ID_DISPLAY_NAME, /**< The formatted name property ID (String type) */ + USER_PROFILE_PROPERTY_ID_PHONETIC_FIRST_NAME, /**< The phonetic first name property ID (String type) */ + USER_PROFILE_PROPERTY_ID_PHONETIC_LAST_NAME, /**< The phonetic last name property ID (String type) */ + USER_PROFILE_PROPERTY_ID_PHONETIC_MIDDLE_NAME, /**< The phonetic middle name property ID (String type) */ +}; + +/** + * @enum UserProfileMultiPropertyId + * + * Defines the IDs for accessing the multi-value type properties of UserProfile. @n + * The properties have several values and they are called multi-type properties. + * @since 2.1 + */ +enum UserProfileMultiPropertyId +{ + USER_PROFILE_MPROPERTY_ID_PHONE_NUMBERS, /**< The phone number property ID (PhoneNumber class) */ + USER_PROFILE_MPROPERTY_ID_EMAILS, /**< The email property ID (Email class) */ + USER_PROFILE_MPROPERTY_ID_URLS, /**< The URL property ID (Url class) */ + USER_PROFILE_MPROPERTY_ID_ADDRESSES, /**< The address property ID (Address class) */ + USER_PROFILE_MPROPERTY_ID_IMADDRESSES, /**< The instant message property ID (ImAddress class) */ + USER_PROFILE_MPROPERTY_ID_EVENTS, /**< The contact event property ID (ContactEvent class) */ + USER_PROFILE_MPROPERTY_ID_ORGANIZATIONS, /**< The organization property ID (Organization class) */ + USER_PROFILE_MPROPERTY_ID_NOTES, /**< The note property ID (String type) */ + USER_PROFILE_MPROPERTY_ID_NICKNAMES, /**< The nickname property ID (String type) */ + USER_PROFILE_MPROPERTY_ID_RELATIONSHIPS, /**< The relationship property ID (Relationship type) */ +}; + +/** + * @enum CalendarbookFilterType + * Defines the type of the filter for Calendarbook. + * + * @since 2.0 + */ +enum CalendarbookFilterType +{ + CB_FI_TYPE_EVENT, /**< The filter for the event of Calendarbook @n EventFilterProperty is only used in this type of filter @n The search result with this filter is a list of CalEvent */ + CB_FI_TYPE_TODO, /**< The filter for the to-do of Calendarbook @n TodoFilterProperty is only used in this type of filter @n The search result with this filter is a list of CalTodo */ + CB_FI_TYPE_CALENDAR, /**< The filter for the calendar of Calendarbook @n CalendarFilterProperty is only used in this type of filter @n The search result with this filter is a list of Calendar */ + CB_FI_TYPE_ALL_DAY_EVENT_INSTANCE, /**< The filter for all day event instances of Calendarbook @n EventInstanceFilterProperty is only used in this type of filter @n The search result with this filter is a list of CalEventInstance */ + CB_FI_TYPE_NON_ALL_DAY_EVENT_INSTANCE /**< The filter for non-all day event instances of Calendarbook @n EventInstanceFilterProperty is only used in this type of filter @n The search result with this filter is a list of CalEventInstance */ +}; + +/** + * @enum EventFilterProperty + * Defines the property for filtering the events. @n + * These properties can be used to create a CalendarbookFilter of CB_FI_TYPE_EVENT type. + * + * @since 2.0 + */ +enum EventFilterProperty +{ + EVENT_FI_PR_EVENT_ID = 1, /**< The event ID: int (RecordId) */ + EVENT_FI_PR_CALENDAR_ID, /**< The calendar ID: long long (RecordId) */ + EVENT_FI_PR_SUBJECT, /**< The subject of the event: String */ + EVENT_FI_PR_DESCRIPTION, /**< The description of the event: String */ + EVENT_FI_PR_LOCATION, /**< The location of the event: String */ + EVENT_FI_PR_BUSY_STATUS, /**< The busy status of the event: int (BusyStatus) */ + EVENT_FI_PR_PRIORITY, /**< The priority of the event: int (EventPriority) */ + EVENT_FI_PR_SENSITIVITY, /**< The sensitivity of the event: int (RecordSensitivity) */ + EVENT_FI_PR_STATUS, /**< The status of the event: int (EventStatus) */ + EVENT_FI_PR_UID, /**< The uid of the event: String */ + EVENT_FI_PR_LATITUDE, /**< The latitude of the event: Double */ + EVENT_FI_PR_LONGITUDE, /**< The longitude of the event: Double */ + EVENT_FI_PR_LAST_REVISED_TIME, /**< The last revised time of the event: DateTime */ + EVENT_FI_PR_HAS_REMINDER, /**< Whether the event has a reminder or not: bool*/ + EVENT_FI_PR_HAS_ATTENDEE /**< Whether the event has an attendee or not: bool*/ +}; + +/** +* @enum TodoFilterProperty +* Defines the property for filtering the to-dos. @n +* These properties can be used to create a CalendarbookFilter of CB_FI_TYPE_TODO type. +* +* @since 2.0 +*/ +enum TodoFilterProperty +{ + TODO_FI_PR_TODO_ID = 100, /**< The todo ID: long long (RecordId) */ + TODO_FI_PR_CALENDAR_ID, /**< The calendar ID: long long (RecordId) */ + TODO_FI_PR_START_DATE, /**< The start date of the to-do: DateTime*/ + TODO_FI_PR_DUE_DATE, /**< The due date of the to-do: DateTime */ + TODO_FI_PR_SUBJECT, /**< The subject of the to-do: String */ + TODO_FI_PR_DESCRIPTION, /**< The description of the to-do: String */ + TODO_FI_PR_LOCATION, /**< The location of the to-do: String */ + TODO_FI_PR_PRIORITY, /**< The priority of the to-do: int (TodoPriority)*/ + TODO_FI_PR_SENSITIVITY, /**< The sensitivity of the to-do: int (RecordSensitivity) */ + TODO_FI_PR_STATUS, /**< The status of the to-do: int (TodoStatus) */ + TODO_FI_PR_LATITUDE, /**< The latitude of the to-do: double*/ + TODO_FI_PR_LONGITUDE, /**< The longitude of the to-do: double*/ + TODO_FI_PR_LAST_REVISED_TIME, /**< The last revised time of the to-do: DateTime */ + TODO_FI_PR_HAS_REMINDER /**< Whether the to-do has a reminder or not: bool*/ +}; + +/** +* @enum EventInstanceFilterProperty +* Defines the property for filtering the all day event instances or non-all day event instances. @n +* These properties can be used to create a CalendarbookFilter of CB_FI_TYPE_ALL_DAY_EVENT_INSTANCE or CB_FI_TYPE_NON_ALL_DAY_EVENT_INSTANCE type. +* +* @since 2.0 +*/ +enum EventInstanceFilterProperty +{ + EVENT_INST_FI_PR_ORIGINAL_EVENT_ID = 200, /**< The original event ID: int (RecordId) */ + EVENT_INST_FI_PR_CALENDAR_ID, /**< The calendar ID: int (RecordId) */ + EVENT_INST_FI_PR_START_TIME, /**< The start time of the event instance: DateTime */ + EVENT_INST_FI_PR_END_TIME, /**< The end time of the event instance: DateTime */ + EVENT_INST_FI_PR_SUBJECT, /**< The subject of the event instance: String */ + EVENT_INST_FI_PR_DESCRIPTION, /**< The description of the event instance: String */ + EVENT_INST_FI_PR_LOCATION, /**< The location of the event instance: String */ + EVENT_INST_FI_PR_BUSY_STATUS, /**< The busy status of the event instance: int (BusyStatus) */ + EVENT_INST_FI_PR_PRIORITY, /**< The priority of the event instance: int (EventPriority) */ + EVENT_INST_FI_PR_SENSITIVITY, /**< The sensitivity of the event instance: int (RecordSensitivity) */ + EVENT_INST_FI_PR_STATUS, /**< The status of the event instance: int (EventStatus) */ + EVENT_INST_FI_PR_LATITUDE, /**< The latitude of the event instance: Double */ + EVENT_INST_FI_PR_LONGITUDE, /**< The latitude of the event instance: Double */ + EVENT_INST_FI_PR_IS_RECURRING, /**< Whether the event instance is a recurring event or not: bool*/ + EVENT_INST_FI_PR_HAS_REMINDER /**< Whether the event instance has a reminder or not: bool*/ +}; + +/** +* @enum CalendarFilterProperty +* Defines the property for filtering the calendars. @n +* These properties can be used to create a CalendarbookFilter of CB_FI_TYPE_CALENDAR type. +* +* @since 2.0 +*/ +enum CalendarFilterProperty +{ + CALENDAR_FI_PR_CALENDAR_ID = 400, /**< The calendar ID: int (RecordId) */ + CALENDAR_FI_PR_ACCOUNT_ID, /**< The account ID of the calendar: int (AccountId) */ + CALENDAR_FI_PR_NAME, /**< The name of the calendar: String */ + CALENDAR_FI_PR_ITEM_TYPE /**< The type of the calendar: int (CalendarItemType) */ +}; + +}} // Tizen::Social + +#endif // _FSCL_TYPES_H_ diff --git a/inc/FSclUrl.h b/inc/FSclUrl.h new file mode 100644 index 0000000..ff5e280 --- /dev/null +++ b/inc/FSclUrl.h @@ -0,0 +1,275 @@ +// +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// 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. +// +/** +* @file FSclUrl.h +* @brief This is the header file for the %Url class. +* +* This header file contains the declarations of the %Url class. +*/ +#ifndef _FSCL_URL_H_ +#define _FSCL_URL_H_ + +#include +#include +#include +#include + +namespace Tizen { namespace Social +{ + +/** + * @if OSPDEPREC + * The maximum length of the URL property. + * + * @brief [Deprecated] + * @deprecated This constant is deprecated because there is no limitation any more. + * @since 2.0 + * @endif + */ +static const int MAX_URL_LENGTH = 100; + +/** +* @class Url +* @brief This class stores the information of a URL. +* +* @since 2.0 +* +* @final This class is not intended for extension. +* +* @remarks The %Url class consists of a URL string and a URL type. +* +* The %Url class stores the information of a URL. @n +* The following example demonstrates how to use the %Url class. +* +* @code +using namespace Tizen::Base; +using namespace Tizen::Social; + +result +MyClass::SomeMethod(void) +{ + result r = E_SUCCESS; + + // Creates an instance of Url + Url url = Url(); + + // Sets the URL + r = url.SetUrl(L"http://www.tizen.org"); + if (IsFailed(r)) + { + return r; + } + + // Sets the type + url.SetType(URL_TYPE_WORK); + + return E_SUCCESS; +} +* @endcode +*/ +class _OSP_EXPORT_ Url + : public Tizen::Base::Object +{ +public: + /** + * This is the default constructor for this class. + * + * @since 2.0 + */ + Url(void); + + /** + * Initializes this instance with the specified URL string and type. + * + * @since 2.0 + * + * @param[in] type The type of the URL + * @param[in] url The URL + */ + Url(UrlType type, const Tizen::Base::String& url); + + /** + * Copying of objects using this copy constructor is allowed. + * + * @since 2.0 + * + * @param[in] rhs An instance of %Url to copy + */ + Url(const Url& rhs); + + /** + * This destructor overrides Tizen::Base::Object::~Object(). + * + * @since 2.0 + */ + virtual ~Url(void); + + /** + * Checks whether the value of the specified instance is equal to the value of the current instance of Tizen::Base::Object. + * + * @since 2.0 + * + * @return @c true if the value of the specified instance of Tizen::Base::Object is equal to the value of the current instance of %Tizen::Base::Object, @n + * else @c false + * @param[in] rhs An instance of Tizen::Base::Object to compare + */ + virtual bool Equals(const Tizen::Base::Object& rhs) const; + + /** + * Gets the hash value of the current instance of Tizen::Base::Object. + * + * @since 2.0 + * + * @return The integer value that indicates the hash value of the current instance of Tizen::Base::Object + */ + virtual int GetHashCode(void) const; + + /** + * Gets the type of this %Url instance. + * + * @if OSPCOMPAT + * @brief [Compatibility] + * @endif + * @since 2.0 + * @if OSPCOMPAT + * @compatibility This method has compatibility issues with OSP compatible applications. @n + * For more information, see @ref CompUrlGetTypePage "here". + * @endif + * + * @return The type of %Url + */ + UrlType GetType(void) const; + + /** + * @if OSPCOMPAT + * @page CompUrlGetTypePage Compatibility for GetType() + * @section CompUrlGetTypePageIssueSection Issues + * Implementing this method in OSP compatible applications has the following issue: @n + * -# URL_TYPE_CUSTOM is not supported. If the type of the url is URL_TYPE_CUSTOM, URL_TYPE_OTHER is returned instead. + * + * @section CompUrlGetTypePageSolutionSection Resolutions + * The issue mentioned above has been resolved in Tizen. + * + * @endif + */ + + /** + * Gets the label of a URL. + * + * @since 2.0 + * + * @return The URL label + * @see SetLabel() + */ + Tizen::Base::String GetLabel(void) const; + + /** + * Sets the label of a URL. + * + * @since 2.0 + * + * @param[in] label The URL label + * @see GetLabel() + */ + void SetLabel(const Tizen::Base::String& label); + + /** + * Gets the URL of this %Url instance. + * + * @since 2.0 + * + * @return The URL as a string + */ + Tizen::Base::String GetUrl(void) const; + + /** + * Sets the type of this %Url instance. + * + * @since 2.0 + * + * @param[in] type The type of %Url + */ + void SetType(UrlType type); + + /** + * Sets the URL of this %Url instance. + * + * @if OSPCOMPAT + * @brief [Compatibility] + * @endif + * @since 2.0 + * @if OSPCOMPAT + * @compatibility This method has compatibility issues with OSP compatible applications. @n + * For more information, see @ref CompUrlSetUrlPage "here". + * @endif + * + * @return An error code + * @param[in] url The URL + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c url is an empty string. + */ + result SetUrl(const Tizen::Base::String& url); + + /** + * @if OSPCOMPAT + * @page CompUrlSetUrlPage Compatibility for SetUrl() + * @section CompUrlSetUrlPageIssueSection Issues + * Implementing this method in OSP compatible applications has the following issue: @n + * -# If the length of a URL to be set is greater than 100 characters, @c E_INVALID_ARG is returned. + * + * @section CompUrlSetUrlPageSolutionSection Resolutions + * The issue mentioned above has been resolved in Tizen. + * @endif + */ + /** + * Copying of objects using this copy assignment operator is allowed. + * + * @since 2.0 + * + * @param[in] rhs An instance of %Url to copy + */ + Url& operator =(const Url& rhs); + + /** + * Checks whether the specified instance is equal to the current instance. + * + * @since 2.0 + * + * @return @c true if the data of the specified instance is equal to the data of the current instance, @n + * else @c false + * @param[in] rhs The source instance of %Url + */ + bool operator ==(const Url& rhs) const; + + /** + * Compares the specified instance with the current instance for inequality. + * + * @since 2.0 + * + * @return @c true if the data of the specified instance is not equal to the data of the current instance, @n + * else @c false + * @param[in] rhs The source instance of %Url + */ + bool operator !=(const Url& rhs) const; + +private: + friend class _UrlImpl; + class _UrlImpl* __pUrlImpl; +}; // Url + +}} // Tizen::Social + +#endif // _FSCL_URL_H_ diff --git a/inc/FSclUserProfile.h b/inc/FSclUserProfile.h new file mode 100644 index 0000000..a8d6191 --- /dev/null +++ b/inc/FSclUserProfile.h @@ -0,0 +1,473 @@ +// +// Copyright (c) 2013 Samsung Electronics Co., Ltd. +// +// 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. +// +/** +* @file FSclUserProfile.h +* @brief This is the header file for the %UserProfile class. +* +* This header file contains the declarations of the %UserProfile class. +*/ +#ifndef _FSCL_USER_PROFILE_H_ +#define _FSCL_USER_PROFILE_H_ + +#include +#include +#include + +namespace Tizen { namespace Base +{ +class String; + +namespace Collection +{ +class IList; +} +}} + +namespace Tizen { namespace Social +{ + +class Address; +class PhoneNumber; +class Email; +class Url; +class ImAddress; +class Organization; +class ContactEvent; +class Relationship; + +/** + * @class UserProfile + * @brief This class represents the user's contact information. + * + * @since 2.1 + * + * @final This class is not intended for extension. + * + * The %UserProfile class provides the contact information of the owner of an addressbook. + * + * + */ +class _OSP_EXPORT_ UserProfile + : public Tizen::Base::Object +{ +public: + + /** + * This is the default constructor for this class. + * + * @since 2.1 + */ + UserProfile(void); + + /** + * Copying of objects using this copy constructor is allowed. + * + * @since 2.1 + * + * @param[in] rhs An instance of %UserProfile to copy + */ + UserProfile(const UserProfile& rhs); + + /** + * This destructor overrides Tizen::Social::Object::~Object(). + * + * @since 2.1 + * + */ + virtual ~UserProfile(void); + + /** + * Checks whether the value of the specified instance is equal to the value of the current instance of Tizen::Base::Object. + * + * @since 2.1 + * + * @return @c true if the value of the specified instance of Tizen::Base::Object is equal to the value of the current instance of %Tizen::Base::Object, @n + * else @c false + * @param[in] rhs An instance of Tizen::Base::Object to compare + */ + virtual bool Equals(const Tizen::Base::Object& rhs) const; + + /** + * Gets the hash value of the current instance. + * + * @since 2.1 + * + * @return The hash value of the current instance + */ + virtual int GetHashCode(void) const; + + /** + * Gets the thumbnail file path. + * + * @since 2.1 + * + * @return The file path of the thumbnail + * @remarks If the thumbnail has not been set, an empty string is returned. + */ + Tizen::Base::String GetThumbnailPath(void) const; + + /** + * Sets the thumbnail image. @n + * If the specified @c filePath is an empty string, the current thumbnail image is removed. + * + * @since 2.1 + * + * @return An error code + * @param[in] filePath The file path of the thumbnail image + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The length of the specified @c filePath exceeds system limitations. + * @exception E_FILE_NOT_FOUND The specified file cannot be found or accessed. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + * @see GetThumbnailPath() + */ + result SetThumbnail(const Tizen::Base::String& filePath); + + /** + * Sets the value of the property having a specified ID to the specified @c value. + * + * + * @return An error code + * @param[in] id The ID of the property whose value is set + * @param[in] value The new string value to set + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified property is read-only. + */ + + result SetValue(UserProfilePropertyId id, const Tizen::Base::String& value); + + /** + * Gets the value of the specified property. + * + * @since 2.1 + * + * @return The property value + * @param[in] id The property ID + */ + Tizen::Base::String GetValue(UserProfilePropertyId id) const; + + /** + * Sets the specified phone number at the specified @c index. + * + * @since 2.1 + * + * @return An error code + * @param[in] index The index at which the value is set + * @param[in] phoneNumber An instance of PhoneNumber to set + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c phoneNumber is empty. + * @exception E_OUT_OF_RANGE The specified @c index is outside the bounds of the properties. + */ + result SetPhoneNumberAt(int index, const PhoneNumber& phoneNumber); + + /** + * Sets the specified @c email corresponding to the specified @c index. + * + * @since 2.1 + * + * @return An error code + * @param[in] index The index at which the value is set + * @param[in] email An instance of Email + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c email is empty. + * @exception E_OUT_OF_RANGE The specified @c index is outside the bounds of the properties. + */ + result SetEmailAt(int index, const Email& email); + + /** + * Sets the specified URL corresponding to the specified @c index. + * + * @since 2.1 + * + * @return An error code + * @param[in] index The index at which the value is set + * @param[in] url An instance of Url + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c url is empty. + * @exception E_OUT_OF_RANGE The specified @c index is outside the bounds of the properties. + */ + result SetUrlAt(int index, const Url& url); + + /** + * Sets the specified @c address corresponding to the specified @c index. + * + * @since 2.1 + * + * @return An error code + * @param[in] index The index at which the value is set + * @param[in] address An instance of Address + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c address is empty. + * @exception E_OUT_OF_RANGE The specified @c index is outside the bounds of the properties. + */ + result SetAddressAt(int index, const Address& address); + + /** + * Sets the specified @c imAddress corresponding to the specified @c index. + * + * @since 2.1 + * + * @return An error code + * @param[in] index The index at which the value is set + * @param[in] imAddress An instance of ImAddress + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c imAddress is empty. + * @exception E_OUT_OF_RANGE The specified @c index is outside the bounds of the properties. + */ + result SetImAddressAt(int index, const ImAddress& imAddress); + + /** + * Sets the specified @c note corresponding to the specified @c index. + * + * @since 2.1 + * + * @return An error code + * @param[in] index The index at which the value is set + * @param[in] note The note to set + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c note is empty. + * @exception E_OUT_OF_RANGE The specified @c index is outside the bounds of the properties. + */ + result SetNoteAt(int index, const Tizen::Base::String& note); + + /** + * Sets the specified nick name corresponding to the specified @c index. + * + * @since 2.1 + * + * @return An error code + * @param[in] index The index at which the value is set + * @param[in] nickname The nick name to set + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The specified @c index is outside the bounds of the properties. + */ + result SetNicknameAt(int index, const Tizen::Base::String& nickname); + + /** + * Sets the specified @c event corresponding to the specified @c index. + * + * @since 2.1 + * + * @return An error code + * @param[in] index The index at which the value is set + * @param[in] event The event to set + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c event is empty. + * @exception E_OUT_OF_RANGE The specified @c index is outside the bounds of the properties. + */ + result SetEventAt(int index, const ContactEvent& event); + + /** + * Sets the specified organization corresponding to the specified @c index. + * + * @since 2.1 + * + * @return An error code + * @param[in] index The index at which the value is set + * @param[in] organization The organization to set + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c organization is empty. + * @exception E_OUT_OF_RANGE The specified @c index is outside the bounds of the properties. + */ + result SetOrganizationAt(int index, const Organization& organization); + + /** + * Sets the specified @c relationship corresponding to the specified @c index. + * + * @since 2.1 + * + * @return An error code + * @param[in] index The index at which the value is set + * @param[in] relationship An instance of Relationship to set + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c relationship is empty. + * @exception E_OUT_OF_RANGE The specified @c index is outside the bounds of the properties. + */ + result SetRelationshipAt(int index, const Relationship& relationship); + + /** + * Gets the addressbook ID. + * + * @since 2.1 + * + * @return The addressbook ID + */ + AddressbookId GetAddressbookId(void) const; + + /** + * Gets the list of values belonging to a specific multi value property. + * + * @since 2.1 + * + * @return The list of values belonging to the specific multi value property + * @param[in] id The property ID + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_MEMORY The memory is insufficient. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + Tizen::Base::Collection::IList* GetValuesN(UserProfileMultiPropertyId id) const; + + /** + * Adds the specified phone number to the user profile. + * + * @since 2.1 + * + * @return An error code + * @param[in] phoneNumber The phone number to add + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c phoneNumber is empty. + */ + result AddPhoneNumber(const PhoneNumber& phoneNumber); + + /** + * Adds the specified @c email to the user profile. + * + * @since 2.1 + * + * @return An error code + * @param[in] email The email address to add + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c email is empty. + */ + result AddEmail(const Email& email); + + /** + * Adds the specified URL to the user profile. + * + * @since 2.1 + * + * @return An error code + * @param[in] url The URL to add + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c url is empty. + */ + + result AddUrl(const Url& url); + + /** + * Adds the specified @c address to the user profile. + * + * @since 2.1 + * + * @return An error code + * @param[in] address The address to add + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c address is empty. + */ + result AddAddress(const Address& address); + + /** + * Adds the specified instant message information to the user profile. + * + * @since 2.1 + * + * @return An error code + * @param[in] imAddress The IM address to add + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c imAddress is empty. + */ + result AddImAddress(const ImAddress& imAddress); + + /** + * Adds the specified @c note to the user profile. + * + * @since 2.1 + * + * @return An error code + * @param[in] note The note to add + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c note is empty. + */ + result AddNote(const Tizen::Base::String& note); + + /** + * Adds the specified nick name to the user profile. + * + * @since 2.1 + * + * @return An error code + * @param[in] nickname The nick name to add + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c nickname is empty. + */ + result AddNickname(const Tizen::Base::String& nickname); + + /** + * Adds the specified @c event to the user profile. + * + * @since 2.1 + * + * @return An error code + * @param[in] event The event to add + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c event is empty. + */ + result AddEvent(const ContactEvent& event); + + /** + * Adds the specified @c organization to a contact. + * + * @since 2.1 + * + * @return An error code + * @param[in] organization The organization to add + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c organization is empty. + */ + result AddOrganization(const Organization& organization); + + /** + * Adds the specified @c relationship to the user profile. + * + * @since 2.1 + * + * @return An error code + * @param[in] relationship The relationship to add + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c relationship is empty. + */ + result AddRelationship(const Relationship& relationship); + + /** + * Removes the value at the specified @c index of a multi value property. + * + * @since 2.1 + * + * @return An error code + * @param[in] id The property ID + * @param[in] index The index at which the value is removed + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The specified @c index is outside the bounds of the properties. + */ + result RemoveAt(UserProfileMultiPropertyId id, int index); + + /** + * Copying of objects using this copy assignment operator is allowed. + * + * @since 2.1 + * + * @param[in] rhs An instance of %UserProfile to copy + */ + UserProfile& operator =(const UserProfile& rhs); + +private: + friend class _UserProfileImpl; + class _UserProfileImpl* __pUserProfileImpl; + +}; // UserProfile + +}} // Tizen::Social + +#endif // _FSCL_USER_PROFILE_H_ diff --git a/inc/FSocial.h b/inc/FSocial.h new file mode 100644 index 0000000..fa1c670 --- /dev/null +++ b/inc/FSocial.h @@ -0,0 +1,100 @@ +// +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// 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. +// +/** + * @file FSocial.h + * @brief This is the header file for the %Social namespace. + * + * This header file contains the declarations and descriptions of the %Social namespace. + */ + +#ifndef _FSOCIAL_H_ +#define _FSOCIAL_H_ + +// Includes +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/** + * @namespace Tizen::Social + * @brief This namespace contains classes and interfaces for managing the social information of a user. + * @since 2.0 + * + * @remarks @b Header @b %file: @b \#include @b @n + * @b Library: @b osp-social + * + * + * The %Social namespace provides various classes to manage personal data, such as contacts, schedules, and accounts on a device. + * + * For more information on the %Social namespace features, see Social Guide. + * + * The following diagrams illustrate the relationships between the classes belonging to the %Social namespace. + * + * [Account] + * @image html social_account_classdiagram.png + * + * [Addressbook] + * @image html social_addressbook_classdiagram.png + * + * [Calendarbook] + * @image html social_calendarbook_using_the_apis_classdiagram.png + * + */ +namespace Tizen { namespace Social +{ +}} // Tizen::Social + +#endif // _FSOCIAL_H_ diff --git a/osp-social.manifest b/osp-social.manifest new file mode 100644 index 0000000..ae3e6f7 --- /dev/null +++ b/osp-social.manifest @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/osp-social.pc.in b/osp-social.pc.in new file mode 100755 index 0000000..eb6c3b7 --- /dev/null +++ b/osp-social.pc.in @@ -0,0 +1,14 @@ +# Package Information for pkg-config + +prefix=@PREFIX@ +exec_prefix=/usr +libdir=/usr/lib/osp +includedir=/usr/include/osp + +Name: @PC_NAME@ +Description: @PACKAGE_DESCRIPTION@ +Version: @VERSION@ +Requires: @PC_REQUIRED@ +Libs: -L${libdir} @PC_LDFLAGS@ +Cflags: -I${includedir} + diff --git a/packaging/osp-social.spec b/packaging/osp-social.spec new file mode 100644 index 0000000..cbc5128 --- /dev/null +++ b/packaging/osp-social.spec @@ -0,0 +1,113 @@ +%define debug_package %{nil} +%define __strip /bin/true + +Name: osp-social +Summary: osp social library +Version: 1.2.2.0 +Release: 1 +Group: System/Libraries +License: Apache License, Version 2.0 +Source0: %{name}-%{version}.tar.gz +BuildRequires: cmake +BuildRequires: pkgconfig(contacts-service2) +BuildRequires: pkgconfig(calendar-service2) +BuildRequires: pkgconfig(accounts-svc) +BuildRequires: pkgconfig(libwbxml2) +BuildRequires: pkgconfig(glib-2.0) +BuildRequires: pkgconfig(db-util) +BuildRequires: pkgconfig(osp-appfw) +BuildRequires: osp-appfw-internal-devel +BuildRequires: pkgconfig(osp-uifw) +BuildRequires: osp-uifw-internal-devel +BuildRequires: pkgconfig(osp-image) +BuildRequires: osp-image-internal-devel +BuildRequires: pkgconfig(osp-image-core) +BuildRequires: osp-image-core-internal-devel +BuildRequires: pkgconfig(pkgmgr) +BuildRequires: pkgconfig(pkgmgr-info) + +# runtime requires +Requires: osp-appfw +Requires: osp-image +Requires: capi-appfw-application +Requires: capi-appfw-package-manager + +%description +osp social library + +%package devel +Summary: osp social library (Development) +Group: TO_BE/FILLED_IN +Requires: %{name} = %{version}-%{release} + +%description devel +osp social library (DEV) + +%package internal-devel +Summary: osp social library (Internal) +Group: TO_BE/FILLED_IN +Requires: %{name} = %{version}-%{release} + +%description internal-devel +osp social library (Internal-DEV) + +%package debug +Summary: osp social library (Development) +Group: TO_BE/FILLED_IN +Requires: %{name} = %{version}-%{release} + +%description debug +osp social library (DEV) + +%prep +%setup -q + +%build +MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'` + +%ifarch %{ix86} + ARCH=x86 + CXXFLAGS="$CXXFLAGS -D_OSP_DEBUG_ -D_OSP_X86_" + %if 0%{?simulator} + CXXFLAGS="$CXXFLAGS -D_OSP_EMUL_" + %endif +%else + ARCH=arm + CXXFLAGS="-O2 -g -pipe -Wall -fno-exceptions -Wformat -Wformat-security -Wl,--as-needed -fmessage-length=0 -march=armv7-a -mtune=cortex-a8 -mlittle-endian -mfpu=neon -mfloat-abi=softfp -D__SOFTFP__ -mthumb -Wa,-mimplicit-it=thumb -funwind-tables -D_OSP_DEBUG_ -D_OSP_ARMEL_" +%endif + +%if 0%{?tizen_build_binary_release_type_eng} + CXXFLAGS="$CXXFLAGS -D_SECURE_LOG" +%endif + +cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DOBS=1 -DFULLVER=%{version} -DMAJORVER=${MAJORVER} -DARCH=${ARCH} + +# Call make instruction with smp support +make %{?jobs:-j%jobs} + +%install +rm -rf %{buildroot} +mkdir -p %{buildroot}/usr/share/license +cp %{_builddir}/%{name}-%{version}/LICENSE.APLv2 %{buildroot}/usr/share/license/%{name} + +%make_install + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%files +%manifest osp-social.manifest +/usr/share/license/%{name} +%{_libdir}/osp/*.so* +/usr/etc/package-manager/parserlib/libaccount.so + +%files devel +%{_includedir}/osp/*.h +%{_libdir}/pkgconfig/osp-social.pc + +%files internal-devel +%{_includedir}/osp/social/*.h + +%files debug +%{_libdir}/osp/debug/*.so* diff --git a/pkgmgr_account/CMakeLists.txt b/pkgmgr_account/CMakeLists.txt new file mode 100755 index 0000000..ab7457b --- /dev/null +++ b/pkgmgr_account/CMakeLists.txt @@ -0,0 +1,52 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) + +SET (this_target account) + +SET(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/cmake_build_tmp/output) + +INCLUDE(FindPkgConfig) +pkg_check_modules(bin_pkgs REQUIRED libxml-2.0) + +INCLUDE_DIRECTORIES( + /usr/include + /usr/include/glib-2.0 + /usr/lib/glib-2.0/include + /usr/include/libxml2 + /usr/include/osp + /usr/include/osp/base + /usr/include/accounts-svc + ) + +SET (${this_target}_SOURCE_FILES + src/account.cpp + ) + +SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -Wall" ) + +## SET C COMPILER FLAGS +SET(CMAKE_C_FLAGS "${OSP_DEBUG_FLAGS} ${OSP_OPT_FLAGS} ${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} ${OSP_COMPILER_FLAGS}") + +## SET CPP COMPILER FLAGS +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden") +SET(CMAKE_CXX_FLAGS "${OSP_DEBUG_FLAGS} ${OSP_OPT_FLAGS} ${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS} ${OSP_COMPILER_FLAGS}") + +## Create Library +ADD_LIBRARY (${this_target} SHARED ${${this_target}_SOURCE_FILES}) + +## SET LINKER FLAGS +SET(CMAKE_SHARED_LINKER_FLAGS -Wl,--no-undefined) + +TARGET_LINK_LIBRARIES(${this_target} "-L/usr/lib/osp -losp-appfw" ) +TARGET_LINK_LIBRARIES(${this_target} "-lxml2" ) +TARGET_LINK_LIBRARIES(${this_target} "-lglib-2.0" ) +TARGET_LINK_LIBRARIES(${this_target} "-laccounts-svc" ) + +ADD_CUSTOM_COMMAND(TARGET ${this_target} + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy ${LIBRARY_OUTPUT_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX} ${LIBRARY_OUTPUT_PATH}/debug/${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX} + COMMAND ${CMAKE_STRIP} --strip-unneeded ${LIBRARY_OUTPUT_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX} + COMMENT "strip ${this_target}" + ) + +INSTALL(TARGETS ${this_target} DESTINATION "etc/package-manager/parserlib") + diff --git a/pkgmgr_account/src/account.cpp b/pkgmgr_account/src/account.cpp new file mode 100644 index 0000000..10cbaf9 --- /dev/null +++ b/pkgmgr_account/src/account.cpp @@ -0,0 +1,447 @@ +// +// Copyright (c) 2013 Samsung Electronics Co., Ltd. +// +// 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. +// + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define _SysTryReturn(NID, condition, returnValue, ...) \ + if (!(condition)) { \ + SysLog(NID, __VA_ARGS__); \ + return returnValue; \ + } \ + else {;} + +#define _SysTryCatch(NID, condition, expr, ...) \ + if (!(condition)) { \ + SysLog(NID, __VA_ARGS__); \ + expr; \ + goto CATCH; \ + } \ + else {;} + +using namespace Tizen::App; +using namespace Tizen::App::Package; +using namespace Tizen::Base; +using namespace Tizen::Base::Collection; +using namespace Tizen::Base::Utility; + +static const xmlChar _NODE_ACCOUNT_PROVIDER[] = "account-provider"; +static const xmlChar _NODE_ICON[] = "icon"; +static const xmlChar _NODE_LABEL[] = "label"; +static const xmlChar _NODE_CAPABILITY[] = "capability"; + +static const xmlChar _ATTRIBUTE_APP_ID[] = "appid"; +static const xmlChar _ATTRIBUTE_MULTIPLE_ACCOUNTS_SUPPORT[] = "multiple-accounts-support"; +static const xmlChar _ATTRIBUTE_SECTION[] = "section"; +static const xmlChar _ATTRIBUTE_TYPE[] = "type"; +static const xmlChar _ATTRIBUTE_XML_LANG[] = "xml:lang"; + +static const xmlChar _VALUE_TRUE[] = "true"; +static const xmlChar _VALUE_ACCOUNT[] = "account"; +static const xmlChar _VALUE_ACCOUNT_SMALL[] = "account-small"; +static const xmlChar _VALUE_XHIGH[] = "Xhigh"; + +static const char _DEFAULT_LOCALE[] = "default"; + +static String __oldAccountProviderAppId; + +bool +OnAccountReceived(account_h accountHandle, void* pUserData) +{ + SysTryReturn(NID_SCL, accountHandle != null && pUserData != null, false, E_SYSTEM, "[%s] A system error has occurred.", GetErrorMessage(E_SYSTEM)); + + String* pAccountProviderAppId = static_cast (pUserData); + SysTryReturn(NID_SCL, pAccountProviderAppId != null, false, E_SYSTEM, "[%s] A system error has occurred.", GetErrorMessage(E_SYSTEM)); + + // Get the account ID + int accountDbId = 0; + int ret = account_get_account_id(accountHandle, &accountDbId); + SysTryReturn(NID_SCL, ret == ACCOUNT_ERROR_NONE, null, E_SYSTEM, "[%s] The method cannot proceed due to a severe system error.", GetErrorMessage(E_SYSTEM)); + + // Set the new app ID + std::unique_ptr pCharArrayAppId(_StringConverter::CopyToCharArrayN(*pAccountProviderAppId)); + SysTryReturn(NID_SCL, pCharArrayAppId != null, false, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY)); + + ret = account_set_package_name(accountHandle, pCharArrayAppId.get()); + SysTryReturn(NID_SCL, ret == ACCOUNT_ERROR_NONE, false, E_SYSTEM, "[%s] A system error has occurred.", GetErrorMessage(E_SYSTEM)); + + // Update the account + ret = account_update_to_db_by_id_ex(accountHandle, accountDbId); + SysTryReturn(NID_SCL, ret != ACCOUNT_ERROR_NOT_REGISTERED_PROVIDER, false, E_INVALID_OPERATION, "[%s] The application does not register the account provider.", GetErrorMessage(E_INVALID_OPERATION)); + SysTryReturn(NID_SCL, ret != ACCOUNT_ERROR_PERMISSION_DENIED, false, E_INVALID_OPERATION, "[%s] The application has no permission to update this account.", GetErrorMessage(E_INVALID_OPERATION)); + SysTryReturn(NID_SCL, ret != ACCOUNT_ERROR_RECORD_NOT_FOUND, false, E_OBJ_NOT_FOUND, "[%s] The account does not exist.", GetErrorMessage(E_OBJ_NOT_FOUND)); + SysTryReturn(NID_SCL, ret == ACCOUNT_ERROR_NONE, false, E_SYSTEM, "[%s] A system error has occurred.", GetErrorMessage(E_SYSTEM)); + + return true; +} + +result +RegisterAccountProvider(xmlDocPtr docPtr, String& accountProviderAppId) +{ + SysLog(NID_SCL, "Registering the Account Provider."); + + int ret = account_connect(); + SysTryReturnResult(NID_SCL, ret == ACCOUNT_ERROR_NONE, E_SYSTEM, "A system error has occurred."); + + account_type_h accountTypeHandle = null; + ret = account_type_create(&accountTypeHandle); + if (ret != ACCOUNT_ERROR_NONE || accountTypeHandle == null) + { + SysLog(NID_SCL, "Memory allocation failed."); + return E_OUT_OF_MEMORY; + } + + result r = E_SUCCESS; + + // Node: + xmlNodePtr curPtr = xmlFirstElementChild(xmlDocGetRootElement(docPtr)); + SysTryCatch(NID_SCL, curPtr != null, r = E_INVALID_ARG, E_INVALID_ARG, "[%s] Failed to get the element.", GetErrorMessage(E_INVALID_ARG)); + + SysSecureLog(NID_SCL, "Node: %s", curPtr->name); + + // Get the children nodes + curPtr = curPtr->xmlChildrenNode; + SysTryCatch(NID_SCL, curPtr != null, r = E_INVALID_ARG, E_INVALID_ARG, "[%s] Failed to get the child element.", GetErrorMessage(E_INVALID_ARG)); + + while(curPtr != null) + { + SysSecureLog(NID_SCL, "Node: %s", curPtr->name); + + // Node: + if ((!xmlStrcmp(curPtr->name, _NODE_ACCOUNT_PROVIDER))) + { + // Attribute: appid + xmlChar* pAppIdId = xmlGetProp(curPtr, _ATTRIBUTE_APP_ID); + SysTryCatch(NID_SCL, pAppIdId != null, r = E_INVALID_ARG, E_INVALID_ARG, "[%s] Failed to get the attribute.", GetErrorMessage(E_INVALID_ARG)); + + SysSecureLog(NID_SCL, "Attribute: appid - %s", pAppIdId); + ret = account_type_set_app_id(accountTypeHandle, reinterpret_cast (pAppIdId)); + SysTryCatch(NID_SCL, ret == ACCOUNT_ERROR_NONE, r = E_SYSTEM, E_SYSTEM, "[%s] Failed to set the app ID.", GetErrorMessage(E_SYSTEM)); + + accountProviderAppId.Clear(); + accountProviderAppId.Append(String(reinterpret_cast (pAppIdId))); + + // Attribute: multiple-accounts-support + xmlChar* pMultipleAccountsSupport = xmlGetProp(curPtr, _ATTRIBUTE_MULTIPLE_ACCOUNTS_SUPPORT); + SysTryCatch(NID_SCL, pMultipleAccountsSupport != null, r = E_INVALID_ARG, E_INVALID_ARG, "[%s] Failed to get the attribute.", GetErrorMessage(E_INVALID_ARG)); + + SysSecureLog(NID_SCL, "Attribute: multiple-accounts-support - %s", pMultipleAccountsSupport); + if ((!xmlStrcmp(pMultipleAccountsSupport, _VALUE_TRUE))) + { + ret = account_type_set_multiple_account_support(accountTypeHandle, true); + SysTryCatch(NID_SCL, ret == ACCOUNT_ERROR_NONE, r = E_SYSTEM, E_SYSTEM, "[%s] Failed to set the multiple accounts support.", GetErrorMessage(E_SYSTEM)); + } + else + { + ret = account_type_set_multiple_account_support(accountTypeHandle, false); + SysTryCatch(NID_SCL, ret == ACCOUNT_ERROR_NONE, r = E_SYSTEM, E_SYSTEM, "[%s] Failed to set the multiple accounts support.", GetErrorMessage(E_SYSTEM)); + } + + // Get the children nodes + curPtr = curPtr->xmlChildrenNode; + SysTryCatch(NID_SCL, curPtr != null, r = E_INVALID_ARG, E_INVALID_ARG, "[%s] Failed to get the child element.", GetErrorMessage(E_INVALID_ARG)); + + while (curPtr != NULL) + { + SysSecureLog(NID_SCL, "Node: %s", curPtr->name); + + // Node: + if ((!xmlStrcmp(curPtr->name, _NODE_ICON))) + { + // Attribute: section + xmlChar* pSection = xmlGetProp(curPtr, _ATTRIBUTE_SECTION); + SysTryCatch(NID_SCL, pSection != null, r = E_INVALID_ARG, E_INVALID_ARG, "[%s] Failed to get the attribute.", GetErrorMessage(E_INVALID_ARG)); + + SysSecureLog(NID_SCL, "Attribute: section - %s", pSection); + + if ((!xmlStrcmp(pSection, _VALUE_ACCOUNT))) + { + xmlChar* pAccountIcon = xmlNodeListGetString(docPtr, curPtr->xmlChildrenNode, 1); + SysTryCatch(NID_SCL, pAccountIcon != null, r = E_INVALID_ARG, E_INVALID_ARG, "[%s] Failed to get the value.", GetErrorMessage(E_INVALID_ARG)); + + SysSecureLog(NID_SCL, "Node: icon - %s", pAccountIcon); + ret = account_type_set_icon_path(accountTypeHandle, reinterpret_cast (pAccountIcon)); + SysTryCatch(NID_SCL, ret == ACCOUNT_ERROR_NONE, r = E_SYSTEM, E_SYSTEM, "[%s] Failed to set the icon path.", GetErrorMessage(E_SYSTEM)); + } + else if ((!xmlStrcmp(pSection, _VALUE_ACCOUNT_SMALL))) + { + xmlChar* pAccountSmallIcon = xmlNodeListGetString(docPtr, curPtr->xmlChildrenNode, 1); + SysTryCatch(NID_SCL, pAccountSmallIcon != null, r = E_INVALID_ARG, E_INVALID_ARG, "[%s] Failed to get the value.", GetErrorMessage(E_INVALID_ARG)); + + SysSecureLog(NID_SCL, "Node: icon (small) - %s", pAccountSmallIcon); + ret = account_type_set_small_icon_path(accountTypeHandle, reinterpret_cast (pAccountSmallIcon)); + SysTryCatch(NID_SCL, ret == ACCOUNT_ERROR_NONE, r = E_SYSTEM, E_SYSTEM, "[%s] Failed to set the small icon path.", GetErrorMessage(E_SYSTEM)); + } + } + // Node: