From 5e755d91d8b859a71c012556f497f1b4a9d7b08b Mon Sep 17 00:00:00 2001 From: Jinkun Jang Date: Sat, 16 Mar 2013 01:17:14 +0900 Subject: [PATCH] merge with master --- AUTHORS | 1 + CMakeLists.txt | 22 + inc/FSclAccount.h | 181 ++ inc/FSclAccountAccessor.h | 256 +++ inc/FSclAccountManager.h | 197 ++ inc/FSclAccountProvider.h | 172 ++ inc/FSclAddressbook.h | 199 +- inc/FSclAddressbookManager.h | 331 ++- inc/FSclCalEvent.h | 18 +- inc/FSclCalendarbook.h | 91 +- inc/FSclCategory.h | 2 - inc/FSclCategoryChangeInfo.h | 2 +- inc/FSclContact.h | 35 +- inc/FSclContactChangeInfo.h | 10 + inc/FSclIAccountEventListener.h | 135 ++ inc/FSclImAddress.h | 20 +- inc/FSclOrganization.h | 115 + inc/FSclPerson.h | 70 +- inc/FSclReminder.h | 54 +- inc/FSclTypes.h | 107 +- inc/FSclUserProfile.h | 474 ++++ inc/FSocial.h | 6 + packaging/osp-social.spec | 8 +- pkgmgr_account/CMakeLists.txt | 52 + pkgmgr_account/src/account.cpp | 266 +++ src/FSclAccount.cpp | 129 ++ src/FSclAccountAccessor.cpp | 225 ++ src/FSclAccountManager.cpp | 162 ++ src/FSclAccountProvider.cpp | 127 ++ src/FSclAddressbook.cpp | 88 + src/FSclAddressbookManager.cpp | 99 + src/FSclCalendar.cpp | 2 +- src/FSclContact.cpp | 21 + src/FSclContactChangeInfo.cpp | 6 + src/FSclOrganization.cpp | 73 + src/FSclReminder.cpp | 49 +- src/FSclUserProfile.cpp | 325 +++ src/FScl_AccountAccessorImpl.cpp | 361 +++ src/FScl_AccountAccessorImpl.h | 92 + src/FScl_AccountDbChangeEvent.cpp | 94 + src/FScl_AccountDbChangeEvent.h | 68 + src/FScl_AccountDbChangeEventArg.cpp | 52 + src/FScl_AccountDbChangeEventArg.h | 88 + src/FScl_AccountDbConnector.cpp | 136 ++ src/FScl_AccountDbConnector.h | 61 + src/FScl_AccountDbMonitor.cpp | 243 +++ src/FScl_AccountDbMonitor.h | 112 + src/FScl_AccountImpl.cpp | 305 +++ src/FScl_AccountImpl.h | 93 + src/FScl_AccountManagerImpl.cpp | 177 ++ src/FScl_AccountManagerImpl.h | 64 + src/FScl_AccountManagerUtil.cpp | 372 ++++ src/FScl_AccountManagerUtil.h | 57 + src/FScl_AccountProviderImpl.cpp | 328 +++ src/FScl_AccountProviderImpl.h | 107 + src/FScl_AddressbookImpl.cpp | 243 ++- src/FScl_AddressbookManagerImpl.cpp | 516 ++++- src/FScl_AddressbookUtil.cpp | 206 +- src/FScl_AddressbookUtil.h | 77 +- src/FScl_CalEventImpl.cpp | 43 +- src/FScl_CalTodoImpl.cpp | 13 +- src/FScl_CalendarbookDbConnector.cpp | 4 +- src/FScl_CalendarbookImpl.cpp | 28 +- src/FScl_CalendarbookUtil.cpp | 16 + src/FScl_CalendarbookUtil.h | 4 + src/FScl_ContactChangeInfoImpl.cpp | 23 +- src/FScl_ContactChangeInfoImpl.h | 5 + src/FScl_ContactDbConnector.cpp | 3 +- src/FScl_ContactImpl.cpp | 546 ++++- src/FScl_IAccountDbChangeEventListener.h | 55 + src/FScl_OrganizationImpl.cpp | 172 +- src/FScl_OrganizationImpl.h | 35 + src/FScl_PersonImpl.cpp | 50 +- src/FScl_ReminderImpl.cpp | 125 ++ src/FScl_UserProfileImpl.cpp | 3515 ++++++++++++++++++++++++++++++ src/inc/FScl_AddressbookImpl.h | 13 + src/inc/FScl_AddressbookManagerImpl.h | 24 +- src/inc/FScl_ContactImpl.h | 4 + src/inc/FScl_ReminderImpl.h | 92 + src/inc/FScl_UserProfileImpl.h | 497 +++++ 80 files changed, 12901 insertions(+), 348 deletions(-) mode change 100644 => 100755 CMakeLists.txt create mode 100644 inc/FSclAccount.h create mode 100644 inc/FSclAccountAccessor.h create mode 100644 inc/FSclAccountManager.h create mode 100644 inc/FSclAccountProvider.h mode change 100755 => 100644 inc/FSclAddressbook.h mode change 100755 => 100644 inc/FSclAddressbookManager.h mode change 100755 => 100644 inc/FSclCalendarbook.h create mode 100644 inc/FSclIAccountEventListener.h mode change 100755 => 100644 inc/FSclPerson.h create mode 100644 inc/FSclUserProfile.h mode change 100755 => 100644 inc/FSocial.h mode change 100644 => 100755 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/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_IAccountDbChangeEventListener.h create mode 100644 src/FScl_ReminderImpl.cpp create mode 100644 src/FScl_UserProfileImpl.cpp create mode 100644 src/inc/FScl_ReminderImpl.h create mode 100644 src/inc/FScl_UserProfileImpl.h diff --git a/AUTHORS b/AUTHORS index 141e221..f32c2d5 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,2 +1,3 @@ Jaehwa Shin Hosang Kim +Yoonchan Choi diff --git a/CMakeLists.txt b/CMakeLists.txt old mode 100644 new mode 100755 index 7c0e79d..c170b78 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,6 +6,7 @@ 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 @@ -16,6 +17,7 @@ INCLUDE_DIRECTORIES( /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 @@ -58,6 +60,7 @@ SET (${this_target}_SOURCE_FILES src/FSclCalendarbook.cpp src/FScl_CalendarbookImpl.cpp src/FSclReminder.cpp + src/FScl_ReminderImpl.cpp src/FSclCalTodo.cpp src/FScl_CalTodoImpl.cpp src/FSclCalEvent.cpp @@ -97,6 +100,21 @@ SET (${this_target}_SOURCE_FILES 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" ) @@ -120,6 +138,7 @@ 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} @@ -154,3 +173,6 @@ INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/src/inc/ DESTINATION include/osp/social FI # 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/inc/FSclAccount.h b/inc/FSclAccount.h new file mode 100644 index 0000000..f1363e0 --- /dev/null +++ b/inc/FSclAccount.h @@ -0,0 +1,181 @@ +// +// Open Service Platform +// 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. + */ +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] rhs 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 + */ + 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 Object is equal to the value of the current instance, @n + * else @c false + * @param[in] rhs An instance to compare + */ + virtual bool Equals(const Tizen::Base::Object& rhs) const; + + /** + * Gets the hash value of the current instance. + * + * @since 2.1 + * + * @return An integer value indicating the hash value of the current instance + */ + virtual int GetHashCode(void) const; + + /** + * Gets the ID of this account. @n + * + * @since 2.1 + * + * @return The account ID + */ + AccountId GetId(void) const; + + /** + * Gets the account provider. @n + * + * @since 2.1 + * + * @return The account provider + */ + AccountProvider GetAccountProvider(void) const; + + /** + * Gets the user name. @n + * + * @since 2.1 + * + * @return The user name + */ + Tizen::Base::String GetUserName(void) const; + + /** + * Gets the extended data. @n + * + * @since 2.1 + * + * @return The key-value lists of the extended data + * else an empty list if there is no extended data, or @c null if an exception occurs (@ref String, @ref 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. @n + * + * @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 as 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 + */ + 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..dde5399 --- /dev/null +++ b/inc/FSclAccountAccessor.h @@ -0,0 +1,256 @@ +// +// Open Service Platform +// 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 the method for the account management. + * @since 2.1 + * + * @final This class is not intended for extension. + */ +class _OSP_EXPORT_ AccountAccessor + : public Tizen::Base::Object +{ +public: + /** + * Sets an account change event listener. @n + * The listener is called when an account is changed. + * 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. + * @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. @n + * + * @since 2.1 + * @privlevel public + * @privilege http://tizen.org/privilege/account.read + * + * @return An 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_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 which has the specified application ID. @n + * + * @since 2.1 + * @privlevel public + * @privilege http://tizen.org/privilege/account.read + * + * @return A 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_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 accounts. @n + * + * @since 2.1 + * @privlevel public + * @privilege http://tizen.org/privilege/account.read + * + * @return A 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_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. @n + * + * @since 2.1 + * @privlevel public + * @privilege http://tizen.org/privilege/account.read + * + * @return An account provider with the specified @c accountProviderAppId + * @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_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 which has the specified capability. @n + * + * @since 2.1 + * @privlevel public + * @privilege http://tizen.org/privilege/account.read + * + * @return A 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_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 currently registered account providers. @n + * + * @since 2.1 + * @privlevel public + * @privilege http://tizen.org/privilege/account.read + * + * @return A 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_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 the account accessor 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 the instance of this class. + // + // @since 2.1 + // + // @return An error code + // @exception E_SUCCESS The method is successful. + // @exception E_SYSTEM A system error has occurred. + // + result Construct(void); + + // + // Initializes the instance of this class. + // + // @since 2.1 + // + static void InitAccountAccessor(void); + + // + // Destroys the 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..7801c48 --- /dev/null +++ b/inc/FSclAccountManager.h @@ -0,0 +1,197 @@ +// +// Open Service Platform +// 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 the method for the account management. + * @since 2.1 + * + * @final This class is not intended for extension. + */ +class _OSP_EXPORT_ AccountManager + : public Tizen::Base::Object +{ +public: + /** + * Adds an account. @n + * The user name must have been set in the account. + * If the account is added successfully, an account ID is newly assigned to it. + * This method can be used only by the application belonging to the package of the application which 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 + * @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: @n + * - The user name is an empty string in the specified @c account. @n + * - The account ID is not #INVALID_ACCOUNT_ID. @n + * @exception E_INVALID_OPERATION Either of the following conditions has occurred: @n + * - The caller application does not belong to the package of the application which registers its own account provider. @n + * - The multiple accounts support is set to false and the account is already added. @n + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + */ + result AddAccount(Account& account); + + /** + * Removes an account. @n + * This method can be used only by the application belonging to the package of the application which registers its own account provider. + * + * @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 This operation is not allowed if the caller application does not belong to the package of the application which registers its own account provider. + * @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 have been set in the account. + * This method can be used only by the application belonging to the package of the application which registers its own account provider. + * + * @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: @n + * - The user name is an empty string in the specified @c account. @n + * - The account ID is invalid. @n + * @exception E_OBJ_NOT_FOUND The specified @c account does not exist. + * @exception E_INVALID_OPERATION This operation is not allowed if the caller application does not belong to the package of the application which registers its own account provider. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + */ + result UpdateAccount(const Account& account); + + /** + * Gets the account manager 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 the instance of this class. + // + // @since 2.1 + // + // @return An error code + // @exception E_SUCCESS The method is successful. + // @exception E_SYSTEM A system error has occurred. + // + result Construct(void); + + // + // Initializes the instance of this class. + // + // @since 2.1 + // + static void InitAccountManager(void); + + // + // Destroys the 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..4d7597c --- /dev/null +++ b/inc/FSclAccountProvider.h @@ -0,0 +1,172 @@ +// +// Open Service Platform +// 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. + */ +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 + */ + 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 Object is equal to the value of the current instance, @n + * else @c false + * @param[in] rhs An instance to compare + */ + virtual bool Equals(const Tizen::Base::Object& rhs) const; + + /** + * Gets the hash value of the current instance. + * + * @since 2.1 + * + * @return An integer value indicating the hash value of the current instance + */ + virtual int GetHashCode(void) const; + + /** + * Gets the app ID of the application which has registered this account provider. @n + * + * @since 2.1 + * + * @return The app ID + */ + Tizen::App::AppId GetAppId(void) const; + + /** + * Gets the capabilities which the account provider owns. + * + * @since 2.1 + * + * @return A 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 (@ref 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 the account provider. @n + * + * @since 2.1 + * + * @return The display name + */ + Tizen::Base::String GetDisplayName(void) const; + + /** + * Gets the icon path. @n + * + * @since 2.1 + * + * @return The icon path + */ + Tizen::Base::String GetIconPath(void) const; + + /** + * Gets the small icon path. @n + * + * @since 2.1 + * + * @return The small icon path + */ + Tizen::Base::String GetSmallIconPath(void) const; + + /** + * Checks whether the account provider supports the multiple accounts. @n + * + * @since 2.1 + * + * @return @c true if the account provider supports the 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 + */ + AccountProvider& operator =(const AccountProvider& rhs); + +private: + friend class _AccountProviderImpl; + class _AccountProviderImpl* __pAccountProviderImpl; + +}; // AccountProvider + +}} // Tizen::Social + +#endif //_FSCL_ACCOUNT_PROVIDER_H_ diff --git a/inc/FSclAddressbook.h b/inc/FSclAddressbook.h old mode 100755 new mode 100644 index a56e431..3e7a9bf --- a/inc/FSclAddressbook.h +++ b/inc/FSclAddressbook.h @@ -35,6 +35,7 @@ class String; namespace Collection { class IList; +template class IListT; } }} @@ -42,6 +43,7 @@ namespace Tizen { namespace Social { class Category; class Contact; +class UserProfile; class IRecordEventListener; class IAddressbookEventListener; class IRecordEventListener; @@ -315,7 +317,8 @@ public: * To reset the event listener, @c null must be passed. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.read + * @privlevel public + * @privilege http://tizen.org/privilege/contact.read * * @return An error code * @param[in] pListener The event listener @@ -332,7 +335,8 @@ public: * If the contact has been added successfully, a contact ID is assigned to it. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.write + * @privlevel public + * @privilege http://tizen.org/privilege/contact.write * * @return An error code * @param[in,out] contact The contact to add @@ -353,7 +357,8 @@ public: * After this operation is done successfully, the ID of the Contact instance is #INVALID_RECORD_ID. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.write + * @privlevel public + * @privilege http://tizen.org/privilege/contact.write * * @return An error code * @param[in,out] contact The contact to remove @@ -369,7 +374,8 @@ public: * Removes a contact from the address book. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.write + * @privlevel public + * @privilege http://tizen.org/privilege/contact.write * * @return An error code * @param[in] contactId The contact ID @@ -386,7 +392,8 @@ public: * At least one property of the contact must have been set. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.write + * @privlevel public + * @privilege http://tizen.org/privilege/contact.write * * @return An error code * @param[in] contact The contact to update @@ -411,7 +418,8 @@ public: * @compatibility This method has compatibility issues with OSP compatible applications. @n * For more information, see @ref CompAddressbookAddCategoryPage "here". * @endif - * @privilege %http://tizen.org/privilege/contact.write + * @privlevel public + * @privilege http://tizen.org/privilege/contact.write * * @return An error code * @param[in,out] category The category to add @@ -444,7 +452,8 @@ public: * If the category has been deleted successfully, the record ID of this instance is #INVALID_RECORD_ID. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.write + * @privlevel public + * @privilege http://tizen.org/privilege/contact.write * * @return An error code * @param[in,out] category The category to remove @@ -461,7 +470,8 @@ public: * Removes a category from the address book. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.write + * @privlevel public + * @privilege http://tizen.org/privilege/contact.write * * @return An error code * @param[in] categoryId The category ID @@ -485,7 +495,8 @@ public: * @compatibility This method has compatibility issues with OSP compatible applications. @n * For more information, see @ref CompAddressbookUpdateCategoryPage "here". * @endif - * @privilege %http://tizen.org/privilege/contact.write + * @privlevel public + * @privilege http://tizen.org/privilege/contact.write * * @return An error code * @param[in] category The category to update @@ -516,7 +527,8 @@ public: * The contacts are ordered by display name. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.read + * @privlevel public + * @privilege http://tizen.org/privilege/contact.read * * @return A list of all contacts in the addressbook, @n * else an empty list if there is no contact or @c null if an exception occurs (@ref Contact list) @@ -538,7 +550,8 @@ public: * The contacts are ordered by display name. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.read + * @privlevel public + * @privilege http://tizen.org/privilege/contact.read * * @return A 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) @@ -561,7 +574,8 @@ public: * The contacts are ordered by display name. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.read + * @privlevel public + * @privilege http://tizen.org/privilege/contact.read * * @return A 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) @@ -588,7 +602,8 @@ public: * The contacts are ordered by display name. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.read + * @privlevel public + * @privilege http://tizen.org/privilege/contact.read * * @return A 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) @@ -614,7 +629,8 @@ public: * Gets the contact with the specified contact ID. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.read + * @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 @@ -632,7 +648,8 @@ public: * Gets the number of contacts in the address book. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.read + * @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 @@ -647,7 +664,8 @@ public: * Adds the specified contact to the specified category. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.write + * @privlevel public + * @privilege http://tizen.org/privilege/contact.write * * @return An error code * @param [in] categoryId The category ID @@ -664,7 +682,8 @@ public: * Removes the specified contact from the specified category. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.write + * @privlevel public + * @privilege http://tizen.org/privilege/contact.write * * @return An error code * @param [in] categoryId The category ID @@ -682,7 +701,8 @@ public: * The categories are ordered by name. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.read + * @privlevel public + * @privilege http://tizen.org/privilege/contact.read * * @return A 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) @@ -698,7 +718,8 @@ public: * The categories are ordered by name. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.read + * @privlevel public + * @privilege http://tizen.org/privilege/contact.read * * @return A 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) @@ -715,7 +736,8 @@ public: * Gets the number of categories in the address book. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.read + * @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 @@ -730,7 +752,8 @@ public: * Gets the category with the specified category ID. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.read + * @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 @@ -750,7 +773,8 @@ public: * The contacts are ordered by display name. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.read + * @privlevel public + * @privilege http://tizen.org/privilege/contact.read * * @return A 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) @@ -773,7 +797,8 @@ public: * The contacts are ordered by display name. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.read + * @privlevel public + * @privilege http://tizen.org/privilege/contact.read * * @return A 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) @@ -797,7 +822,8 @@ public: * The contacts are ordered by display name. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.read + * @privlevel public + * @privilege http://tizen.org/privilege/contact.read * * @return A 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) @@ -818,7 +844,8 @@ public: * Gets the latest change version of the address book. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.read + * @privlevel public + * @privilege http://tizen.org/privilege/contact.read * * @return The latest change version, @c * else @c -1 if an exception occurs @@ -835,7 +862,8 @@ public: * Gets the change information of the contacts that have been changed after the specified change version. @n * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.read + * @privlevel public + * @privilege http://tizen.org/privilege/contact.read * * @return A 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) @@ -874,7 +902,8 @@ public: * Gets the change information of the categories that have been changed after the specified version. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.read + * @privlevel public + * @privilege http://tizen.org/privilege/contact.read * * @return A 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) @@ -911,6 +940,57 @@ public: Tizen::Base::Collection::IList* GetChangedCategoriesAfterN(int version, int& latestVersion) const; /** + * Sets the user profile of this addressbook. 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_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 an exception has occurred. + * @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. + * @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 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 change 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_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 @@ -937,6 +1017,71 @@ public: */ 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. The list should contain Contact instances. + * @param[out] pContactIdList A pointer to the list of the IDs of the contacts that have been added successfully. Pass 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_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 an exception occurs. + * It is recommended to call this method, on a thread other than 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. The list should contain 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_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 There is a contact which 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 an exception occurrs.@n + * It is recommended to call this method, on a thread other than main thread. + */ + result UpdateContacts(const Tizen::Base::Collection::IList& contactList); + + /** + * Removes the contacts. 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_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 an exception occurs.@n + * It is recommended to call this method, on a thread other than 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. diff --git a/inc/FSclAddressbookManager.h b/inc/FSclAddressbookManager.h old mode 100755 new mode 100644 index 26fe8f6..a78280d --- a/inc/FSclAddressbookManager.h +++ b/inc/FSclAddressbookManager.h @@ -27,6 +27,7 @@ #include #include #include +#include #include namespace Tizen { namespace Base @@ -43,6 +44,7 @@ namespace Tizen { namespace Social class Category; class Contact; class Person; +class UserProfile; class Addressbook; class AddressbookFilter; class IAddressbookEventListener; @@ -65,15 +67,16 @@ public: * Creates an addressbook with the specified account ID and name. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.write + * @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_INVALID_ARG The specified @c accountId is invalid or specified @ name is an empty string. - * @exception E_OBJ_ALREADY_EXIST The addressbook with the specified name already exists. + * @exception E_INVALID_ARG The specified @c accountId is invalid. + * @exception E_OBJ_ALREADY_EXIST The addressbook with the specified account ID and name already exists. * @exception E_SYSTEM A system error has occurred. * @remarks The specific error code can be accessed using the GetLastResult() method. */ @@ -85,7 +88,8 @@ public: * the contacts and categories that belong to the addressbook are also deleted. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.write + * @privlevel public + * @privilege http://tizen.org/privilege/contact.write * * @return An error code * @param[in] addressbookId The addressbook ID @@ -101,7 +105,8 @@ public: * Gets the addressbooks associated with the specified account ID. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.read + * @privlevel public + * @privilege http://tizen.org/privilege/contact.read * * @return A list of addressbooks, @n * else an empty list if there is no addressbook, or @c null if an exception occurs (@ref Addressbook list) @@ -118,7 +123,8 @@ public: * Gets a list of all addressbooks. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.read + * @privlevel public + * @privilege http://tizen.org/privilege/contact.read * * @return A list of addressbooks, @n * else an empty list if there is no addressbook, or @c null if an exception occurs (@ref Addressbook list) @@ -133,7 +139,8 @@ public: * Gets an instance of an addressbook specified by the addressbook ID. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.read + * @privlevel public + * @privilege http://tizen.org/privilege/contact.read * * @return An addressbook instance * @param[in] addressbookId The addressbook ID @@ -152,7 +159,8 @@ public: * To reset the event listener, @c null must be passed. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.read + * @privlevel public + * @privilege http://tizen.org/privilege/contact.read * * @return An error code * @param[in] pListener The event listener @@ -168,7 +176,8 @@ public: * If the contact has been added successfully, a contact ID is assigned to it. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.write + * @privlevel public + * @privilege http://tizen.org/privilege/contact.write * * @return An error code * @param[in,out] contact The contact to add @@ -191,7 +200,8 @@ public: * Removes a contact. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.write + * @privlevel public + * @privilege http://tizen.org/privilege/contact.write * * @return An error code * @param[in] contactId The contact ID @@ -208,7 +218,8 @@ public: * At least one property of the contact must have been set. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.write + * @privlevel public + * @privilege http://tizen.org/privilege/contact.write * * @return An error code * @param[in] contact The contact to update @@ -227,7 +238,8 @@ public: * If the category has been added successfully, a category ID is assigned to it. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.write + * @privlevel public + * @privilege http://tizen.org/privilege/contact.write * * @return An error code * @param[in,out] category The category to add @@ -248,7 +260,8 @@ public: * Removes a category. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.write + * @privlevel public + * @privilege http://tizen.org/privilege/contact.write * * @return An error code * @param[in] categoryId The category ID @@ -265,7 +278,8 @@ public: * Updates a category. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.write + * @privlevel public + * @privilege http://tizen.org/privilege/contact.write * * @return An error code * @param[in] category The category to update @@ -283,7 +297,8 @@ public: * The contacts are ordered by display name. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.read + * @privlevel public + * @privilege http://tizen.org/privilege/contact.read * * @return A list of all contacts on the device, @n * else an empty list if there is no contact, or @c null if an exception occurs (@ref Contact list) @@ -305,7 +320,8 @@ public: * The contacts are ordered by display name. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.read + * @privlevel public + * @privilege http://tizen.org/privilege/contact.read * * @return A 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) @@ -327,7 +343,8 @@ public: * Gets the contacts linked to the person specified by the person ID. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.read + * @privlevel public + * @privilege http://tizen.org/privilege/contact.read * * @return A list of contacts that are linked to this person, @n * else @c null if an exception occurs (@ref Contact list) @@ -346,7 +363,8 @@ public: * The categories are ordered by name. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.read + * @privlevel public + * @privilege http://tizen.org/privilege/contact.read * * @return A 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) @@ -363,7 +381,8 @@ public: * Gets the contact with the specified contact ID. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.read + * @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 @@ -381,7 +400,8 @@ public: * Gets the number of contacts in all addressbooks. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.read + * @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 @@ -396,7 +416,8 @@ public: * Adds the specified contact to the specified category. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.write + * @privlevel public + * @privilege http://tizen.org/privilege/contact.write * * @return An error code * @param [in] categoryId The category ID @@ -414,7 +435,8 @@ public: * Removes the specified contact from the specified category. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.write + * @privlevel public + * @privilege http://tizen.org/privilege/contact.write * * @return An error code * @param [in] categoryId The category ID @@ -432,7 +454,8 @@ public: * The categories are ordered by name. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.read + * @privlevel public + * @privilege http://tizen.org/privilege/contact.read * * @return A 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) @@ -448,7 +471,8 @@ public: * The categories are ordered by name. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.read + * @privlevel public + * @privilege http://tizen.org/privilege/contact.read * * @return A 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) @@ -465,7 +489,8 @@ public: * Gets the number of categories on the device. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.read + * @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 @@ -480,7 +505,8 @@ public: * Gets the category with the specified category ID. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.read + * @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 @@ -500,7 +526,8 @@ public: * The contacts are ordered by display name. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.read + * @privlevel public + * @privilege http://tizen.org/privilege/contact.read * * @return A 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) @@ -525,7 +552,8 @@ public: * The contacts are ordered by display name. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.read + * @privlevel public + * @privilege http://tizen.org/privilege/contact.read * * @return A 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) @@ -550,7 +578,8 @@ public: * The contacts are ordered by display name. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.read + * @privlevel public + * @privilege http://tizen.org/privilege/contact.read * * @return A 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) @@ -572,7 +601,8 @@ public: * Gets the latest change version. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.read + * @privlevel public + * @privilege http://tizen.org/privilege/contact.read * * @return The latest change version, @n * else @c -1 if an exception occurs @@ -589,7 +619,8 @@ public: * Gets the change information of the contacts that have been changed after the specified change version. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.read + * @privlevel public + * @privilege http://tizen.org/privilege/contact.read * * @return A 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) @@ -629,7 +660,8 @@ public: * Gets the change information of the categories that have been changed after the specified change version. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.read + * @privlevel public + * @privilege http://tizen.org/privilege/contact.read * * @return A 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) @@ -669,7 +701,8 @@ public: * Gets the person with the specified person ID. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.read + * @privlevel public + * @privilege http://tizen.org/privilege/contact.read * * @return The matched person, @n * else @c null if an exception occurs @@ -688,7 +721,8 @@ public: * All contacts linked to the person will be removed, too. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.write + * @privlevel public + * @privilege http://tizen.org/privilege/contact.write * * @return An error code * @param[in] personId The person ID @@ -705,7 +739,8 @@ public: * The persons are ordered by display name. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.read + * @privlevel public + * @privilege http://tizen.org/privilege/contact.read * * @return A 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) @@ -727,7 +762,8 @@ public: * The persons are ordered by display name. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.read + * @privlevel public + * @privilege http://tizen.org/privilege/contact.read * * @return A 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) @@ -751,7 +787,8 @@ public: * The persons are ordered by display name. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.read + * @privlevel public + * @privilege http://tizen.org/privilege/contact.read * * @return A list of the favorite persons, @n * else an empty list if there is no favorite person, or @c null if an exception occurs (@ref Person list) @@ -774,7 +811,8 @@ public: * The persons are ordered by display name. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.read + * @privlevel public + * @privilege http://tizen.org/privilege/contact.read * * @return A 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) @@ -796,7 +834,8 @@ public: * Sets whether the specified person is a favorite or not. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.write + * @privlevel public + * @privilege http://tizen.org/privilege/contact.write * * @return An error code * @param[in] personId The person ID @@ -823,7 +862,8 @@ public: * This method does nothing if the source or target person does not exist. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.write + * @privlevel public + * @privilege http://tizen.org/privilege/contact.write * * @return An error code * @param[in] sourcePersonId The source person ID @@ -847,7 +887,8 @@ public: * This method does nothing if the contact has not been linked to the person or does not exist. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.write + * @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 @@ -867,7 +908,8 @@ public: * 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 - * @privilege %http://tizen.org/privilege/contact.read + * @privlevel public + * @privilege http://tizen.org/privilege/contact.read * * @return A 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 @@ -902,7 +944,8 @@ public: * The filter specifies the item type and condition for searching. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.read + * @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 will be searched. @@ -941,7 +984,8 @@ public: * Exports a person to the specified vCard 3.0 file. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.read + * @privlevel public + * @privilege http://tizen.org/privilege/contact.read * * @return An error code * @param[in] person The person to export @@ -960,7 +1004,8 @@ public: * Exports a person list to the specified vCard 3.0 file. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.read + * @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 Person instances. @@ -1012,14 +1057,202 @@ public: 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 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_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 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_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 + * This method supports vCard formation 2.1 and 3.0. + * + * @since 2.1 + * + * @return A 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. The list should contain UserProfile instance + * @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 Access is denied due to insufficient permission. + * @exception E_FILE_ALREADY_EXIST The specified 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. + */ + 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 UserProfile instances. + * @param[in] vcardPath The file path of a vCard file + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG Either the specified @c userProfileList is invalid or + * the specified @c vcardPath is invalid. + * @exception E_ILLEGAL_ACCESS Access is denied due to insufficient permission. + * @exception E_FILE_ALREADY_EXIST The specified 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. + */ + result ExportUserProfilesToVcard(const Tizen::Base::Collection::IList& userProfileList, const Tizen::Base::String& vcardPath); + + /** + * Gets all user profiles on the device. @n + * + * @since 2.1 + * @privlevel public + * @privilege http://tizen.org/privilege/userprofile.read + * + * @return A list of all 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_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 the 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_INVALID_ARG The specified @c addressbookId is invalid. + * @exception E_OBJ_NOT_FOUND The specified @c 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 the addressbook manager 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. + * @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); diff --git a/inc/FSclCalEvent.h b/inc/FSclCalEvent.h index dc48ef6..5c84992 100644 --- a/inc/FSclCalEvent.h +++ b/inc/FSclCalEvent.h @@ -340,18 +340,32 @@ public: /** * 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. - * @remarks The attendee values may be lost if an anniversary event including the attendee is modified in the base application. */ 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, the E_OBJ_ALREADY_EXIST is returned. + * + * @section CompCalEventAddAttendeePageSolutionSection Resolutions + * The issue mentioned above is resolved in Tizen API version 2.1. + * -# The E_INVALID_ARG will be returned, if the email of @c attendee is empty. + */ + + /** * Removes an attendee. * * @since 2.0 @@ -644,7 +658,7 @@ public: /** * @if OSPDEPREC - * @{ + * @{ * Sets the category of the calendar event. @n * If the category is not set, the default category (#EVENT_CATEGORY_APPOINTMENT) is set. * diff --git a/inc/FSclCalendarbook.h b/inc/FSclCalendarbook.h old mode 100755 new mode 100644 index 7ea71a2..a195dc3 --- a/inc/FSclCalendarbook.h +++ b/inc/FSclCalendarbook.h @@ -376,7 +376,8 @@ public: * After adding the event successfully, the event has a valid record ID. * * @since 2.0 - * @privilege %http://tizen.org/privilege/calendar.write + * @privlevel public + * @privilege http://tizen.org/privilege/calendar.write * * @return An error code * @param[in,out] event The event to add @@ -393,7 +394,8 @@ public: * After adding the event successfully, the event has a valid record ID. * * @since 2.0 - * @privilege %http://tizen.org/privilege/calendar.write + * @privlevel public + * @privilege http://tizen.org/privilege/calendar.write * * @return An error code * @param[in,out] event The event to add @@ -415,7 +417,8 @@ public: * After adding the to-do item successfully, the item has a valid record ID. * * @since 2.0 - * @privilege %http://tizen.org/privilege/calendar.write + * @privlevel public + * @privilege http://tizen.org/privilege/calendar.write * * @return An error code * @param[in,out] todo The to-do to add @@ -432,7 +435,8 @@ public: * After adding the to-do item successfully, the item has a valid record ID. * * @since 2.0 - * @privilege %http://tizen.org/privilege/calendar.write + * @privlevel public + * @privilege http://tizen.org/privilege/calendar.write * * @return An error code * @param[in,out] todo The to-do to add @@ -454,7 +458,8 @@ public: * After removing the event successfully, the event has #INVALID_RECORD_ID. * * @since 2.0 - * @privilege %http://tizen.org/privilege/calendar.write + * @privlevel public + * @privilege http://tizen.org/privilege/calendar.write * * @return An error code * @param[in] event The calendar event to remove @@ -470,7 +475,8 @@ public: * Removes the specified calendar event from this calendar book. * * @since 2.0 - * @privilege %http://tizen.org/privilege/calendar.write + * @privlevel public + * @privilege http://tizen.org/privilege/calendar.write * * @return An error code * @param[in] eventId The calendar event ID to remove @@ -487,7 +493,8 @@ public: * After removing the to-do item successfully, the item has #INVALID_RECORD_ID. * * @since 2.0 - * @privilege %http://tizen.org/privilege/calendar.write + * @privlevel public + * @privilege http://tizen.org/privilege/calendar.write * * @return An error code * @param[in] todo The CalTodo ID to remove @@ -503,7 +510,8 @@ public: * Removes the specified CalTodo instance from the calendar book. * * @since 2.0 - * @privilege %http://tizen.org/privilege/calendar.write + * @privlevel public + * @privilege http://tizen.org/privilege/calendar.write * * @return An error code * @param[in] todoId The CalTodo ID to remove @@ -519,7 +527,8 @@ public: * Updates the specified calendar event to the internal data storage. * * @since 2.0 - * @privilege %http://tizen.org/privilege/calendar.write + * @privlevel public + * @privilege http://tizen.org/privilege/calendar.write * * @return An error code * @param[in] event The CalEvent instance to update @@ -540,7 +549,8 @@ public: * Updates the specified CalTodo instance on the internal data storage. * * @since 2.0 - * @privilege %http://tizen.org/privilege/calendar.write + * @privlevel public + * @privilege http://tizen.org/privilege/calendar.write * * @return An error code * @param[in] todo The CalTodo instance to update @@ -557,7 +567,8 @@ public: * Gets the specified event ID that is matched with the RecordId. * * @since 2.0 - * @privilege %http://tizen.org/privilege/calendar.read + * @privlevel public + * @privilege http://tizen.org/privilege/calendar.read * * @return The matched event * @param[in] eventId The event ID to find @@ -574,7 +585,8 @@ public: * Gets the specified to-do after matching it with the specified record ID. * * @since 2.0 - * @privilege %http://tizen.org/privilege/calendar.read + * @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 @@ -600,7 +612,8 @@ public: * @compatibility This method has compatibility issues with OSP compatible applications. @n * For more information, see @ref CompCalendarbookGetTodosNPage "here". * @endif - * @privilege %http://tizen.org/privilege/calendar.read + * @privlevel public + * @privilege http://tizen.org/privilege/calendar.read * * @return A list of all the matched CalTodo instances, @n * else an empty list if there is no matched to-do item @n @@ -655,7 +668,8 @@ public: * @compatibility This method has compatibility issues with OSP compatible applications. @n * For more information, see @ref CompCalendarbookGetTodoCountPage "here". * @endif - * @privilege %http://tizen.org/privilege/calendar.read + * @privlevel public + * @privilege http://tizen.org/privilege/calendar.read * * @return The total number of to-dos, @n * else @c -1 if an exception occurs @@ -701,7 +715,8 @@ public: * @brief [Deprecated] * @deprecated This method is deprecated. Instead of using this method, it is recommended to use GetInstancesOfAllDayEventsN() or GetInstancesOfNonAllDayEventsN(). * @since 2.0 - * @privilege %http://tizen.org/privilege/calendar.read + * @privlevel public + * @privilege http://tizen.org/privilege/calendar.read * * @return A list containing 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 @@ -745,7 +760,8 @@ public: * @brief [Deprecated] * @deprecated This method is deprecated. Instead of using this method, it is recommended to use GetInstancesOfAllDayEventsN() or GetInstancesOfNonAllDayEventsN(). * @since 2.0 - * @privilege %http://tizen.org/privilege/calendar.read + * @privlevel public + * @privilege http://tizen.org/privilege/calendar.read * * @return An error code * @param[in] start The start of the time range @@ -780,7 +796,8 @@ public: * Gets all events. * * @since 2.0 - * @privilege %http://tizen.org/privilege/calendar.read + * @privlevel public + * @privilege http://tizen.org/privilege/calendar.read * * @return A list containing all the CalEvent instances, @n * else an empty list if there are no events or @c null if an exception occurs @n @@ -799,7 +816,8 @@ public: * Gets all to-dos. * * @since 2.0 - * @privilege %http://tizen.org/privilege/calendar.read + * @privlevel public + * @privilege http://tizen.org/privilege/calendar.read * * @return A list containing all the CalTodo instances, @n * else an empty list if there are no to-dos or @c null if an exception occurs @n @@ -818,7 +836,8 @@ public: * Gets all calendars. * * @since 2.0 - * @privilege %http://tizen.org/privilege/calendar.read + * @privlevel public + * @privilege http://tizen.org/privilege/calendar.read * * @return A list containing all the Calendar instances, @n * else an empty list if there are no calendars or @c null if an exception occurs @n @@ -837,7 +856,8 @@ public: * Gets information of all the changed events since the version. * * @since 2.0 - * @privilege %http://tizen.org/privilege/calendar.read + * @privlevel public + * @privilege http://tizen.org/privilege/calendar.read * * @return A list containing the CalEventChangeInfo instances, @n * else an empty list if there are no events or @c null if an exception occurs @n @@ -859,7 +879,8 @@ public: * Gets information of all the changed to-dos since the version. * * @since 2.0 - * @privilege %http://tizen.org/privilege/calendar.read + * @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 @@ -882,7 +903,8 @@ public: * After adding the calendar to the database successfully, the calendar has a valid calendar ID. * * @since 2.0 - * @privilege %http://tizen.org/privilege/calendar.write + * @privlevel public + * @privilege http://tizen.org/privilege/calendar.write * * @return An error code * @param[in,out] calendar The calendar to add @@ -899,8 +921,8 @@ public: * After adding the calendar to the database successfully, the calendar has a valid calendar ID. * * @since 2.0 - * - * @privilege %http://tizen.org/privilege/calendar.write + * @privlevel public + * @privilege http://tizen.org/privilege/calendar.write * * @return An error code * @param[in,out] calendar The calendar to add @@ -920,7 +942,8 @@ public: * Removes the specified calendar. * * @since 2.0 - * @privilege %http://tizen.org/privilege/calendar.write + * @privlevel public + * @privilege http://tizen.org/privilege/calendar.write * * @return An error code * @param[in] calendarId The calendar ID to remove @@ -937,7 +960,8 @@ public: * Updates the specified calendar. * * @since 2.0 - * @privilege %http://tizen.org/privilege/calendar.write + * @privlevel public + * @privilege http://tizen.org/privilege/calendar.write * * @return An error code * @param[in] calendar The Calendar instance to update @@ -954,7 +978,8 @@ public: * Gets the calendar with the specified calendar ID. * * @since 2.0 - * @privilege %http://tizen.org/privilege/calendar.read + * @privlevel public + * @privilege http://tizen.org/privilege/calendar.read * * @return The matched calendar, @n * else @c null if an exception occurs @@ -973,7 +998,8 @@ public: * 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 - * @privilege %http://tizen.org/privilege/calendar.write + * @privlevel public + * @privilege http://tizen.org/privilege/calendar.write * * @return An error code * @param[in] eventInstance The event instance to remove @n @@ -991,7 +1017,8 @@ public: * Gets the latest version of calendarbook. * * @since 2.0 - * @privilege %http://tizen.org/privilege/calendar.read + * @privlevel public + * @privilege http://tizen.org/privilege/calendar.read * * @return The latest version * @exception E_SUCCESS The method is successful. @@ -1008,7 +1035,8 @@ public: * 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 - * @privilege %http://tizen.org/privilege/calendar.read + * @privlevel public + * @privilege http://tizen.org/privilege/calendar.read * * @return A 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 @@ -1038,7 +1066,8 @@ public: * The filter specifies the item type and condition for searching. * * @since 2.0 - * @privilege %http://tizen.org/privilege/calendar.read + * @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. diff --git a/inc/FSclCategory.h b/inc/FSclCategory.h index 2288605..8a3dd05 100644 --- a/inc/FSclCategory.h +++ b/inc/FSclCategory.h @@ -261,8 +261,6 @@ public: * @exception E_FILE_NOT_FOUND The specified file cannot be found or accessed. * @exception E_SYSTEM A system error has occurred. * @see GetThumbnailPath() - * @remarks The thumbnail is copied to the specific directory for thumbnails by the system when the category is added or updated.@n - * Therefore, GetThumbnailPath() returns the file path to which the thumbnail copied. */ result SetThumbnail(const Tizen::Base::String& filePath); diff --git a/inc/FSclCategoryChangeInfo.h b/inc/FSclCategoryChangeInfo.h index 46308c6..a61eca3 100644 --- a/inc/FSclCategoryChangeInfo.h +++ b/inc/FSclCategoryChangeInfo.h @@ -62,7 +62,7 @@ public: CategoryChangeInfo(const CategoryChangeInfo& rhs); /** - * This destructor overrides Osp::Base::Object::~Object(). + * This destructor overrides Tizen::Base::Object::~Object(). * * @since 2.0 */ diff --git a/inc/FSclContact.h b/inc/FSclContact.h index cff05ad..4dcdc29 100644 --- a/inc/FSclContact.h +++ b/inc/FSclContact.h @@ -203,8 +203,6 @@ public: * @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 A system error has occurred. - * @remarks The thumbnail is copied to the specific directory for thumbnails by the system when the contact is added or updated.@n - * Therefore, GetThumbnailPath() returns the file path to which the thumbnail copied. * @see GetThumbnailPath() */ result SetThumbnail(const Tizen::Base::String& filePath); @@ -446,6 +444,20 @@ public: result SetOrganizationAt(int index, const Organization& organization); /** + * Sets the specified relationship corresponding to the specified index. + * + * @since 2.1 + * + * @return An error code + * @param[in] index An index 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); + + /** * Gets the addressbook ID. * * @since 2.0 @@ -610,6 +622,25 @@ public: result RemoveAt(ContactMultiPropertyId id, int index); /** + * Checks whether this contact is a favorite or not. + * + * @since 2.1 + * + * @return @c true if this contact is a favorite, @n + * else @c false + * @see SetAsFavorite() + */ + bool IsFavorite(void) const; + + /** + * Sets whether this contact is a favorite or not. + * + * @since 2.1 + * @see IsFavorite() + */ + void SetAsFavorite(bool isFavorite = true); + + /** * Copying of objects using this copy assignment operator is allowed. * * @since 2.0 diff --git a/inc/FSclContactChangeInfo.h b/inc/FSclContactChangeInfo.h index 9149f55..803869d 100644 --- a/inc/FSclContactChangeInfo.h +++ b/inc/FSclContactChangeInfo.h @@ -124,6 +124,16 @@ public: RecordChangeType GetChangeType(void) const; /** + * Checks whether the thumbnail has been changed or not. + * + * @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 diff --git a/inc/FSclIAccountEventListener.h b/inc/FSclIAccountEventListener.h new file mode 100644 index 0000000..f051e22 --- /dev/null +++ b/inc/FSclIAccountEventListener.h @@ -0,0 +1,135 @@ +// +// Open Service Platform +// 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. This way, the destructors of the derived classes @n + * 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/FSclImAddress.h b/inc/FSclImAddress.h index 774a58e..22720c4 100644 --- a/inc/FSclImAddress.h +++ b/inc/FSclImAddress.h @@ -36,7 +36,7 @@ namespace Tizen { namespace Social * @brief [Deprecated] * @deprecated This constant is deprecated because there is no limitation any more. * @since 2.0 - @ endif + * @endif */ static const int MAX_IM_ADDRESS_LENGTH = 100; @@ -48,8 +48,8 @@ static const int MAX_IM_ADDRESS_LENGTH = 100; * @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 -*/ + * @endif + */ _OSP_EXPORT_ extern const Tizen::Base::String IM_MSN; /** @@ -60,7 +60,7 @@ _OSP_EXPORT_ extern const Tizen::Base::String IM_MSN; * @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 + * @endif */ _OSP_EXPORT_ extern const Tizen::Base::String IM_ICQ; @@ -72,7 +72,7 @@ _OSP_EXPORT_ extern const Tizen::Base::String IM_ICQ; * @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 + * @endif */ _OSP_EXPORT_ extern const Tizen::Base::String IM_AIM; @@ -84,7 +84,7 @@ _OSP_EXPORT_ extern const Tizen::Base::String IM_AIM; * @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 + * @endif */ _OSP_EXPORT_ extern const Tizen::Base::String IM_YAHOO; @@ -96,7 +96,7 @@ _OSP_EXPORT_ extern const Tizen::Base::String IM_YAHOO; * @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 + * @endif */ _OSP_EXPORT_ extern const Tizen::Base::String IM_JABBER; @@ -108,7 +108,7 @@ _OSP_EXPORT_ extern const Tizen::Base::String IM_JABBER; * @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 + * @endif */ _OSP_EXPORT_ extern const Tizen::Base::String IM_GTALK; @@ -120,7 +120,7 @@ _OSP_EXPORT_ extern const Tizen::Base::String IM_GTALK; * @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 + * @endif */ _OSP_EXPORT_ extern const Tizen::Base::String IM_SKYPE; @@ -132,7 +132,7 @@ _OSP_EXPORT_ extern const Tizen::Base::String IM_SKYPE; * @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 + * @endif */ _OSP_EXPORT_ extern const Tizen::Base::String IM_QQ; diff --git a/inc/FSclOrganization.h b/inc/FSclOrganization.h index 0603503..1f5088e 100644 --- a/inc/FSclOrganization.h +++ b/inc/FSclOrganization.h @@ -139,6 +139,60 @@ public: Tizen::Base::String GetAgent(void) const; /** + * Gets the organization type. + * + * @since 2.1 + * + * @return The type of the organization + */ + 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 file path of the logo image + */ + Tizen::Base::String GetLogoPath(void) const; + + /** * Sets the name of the organization. * * @since 2.0 @@ -184,6 +238,67 @@ public: void SetAgent(const Tizen::Base::String& agent); /** + * Sets the organization type. + * + * @since 2.1 + * + * @param[in] type The type of the organization + */ + 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. + * If the specified 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 copied. + */ + result SetLogo(const Tizen::Base::String& filePath); + + /** * Copying of objects using this copy assignment operator is allowed. * * @since 2.0 diff --git a/inc/FSclPerson.h b/inc/FSclPerson.h old mode 100755 new mode 100644 index 2d7ef92..ca113cd --- a/inc/FSclPerson.h +++ b/inc/FSclPerson.h @@ -166,10 +166,11 @@ public: * * @since 2.0 * - * @return The account ID list - * @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. + * @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; @@ -186,7 +187,8 @@ public: * Sets whether this person is a favorite or not. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.write + * @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 @@ -202,10 +204,10 @@ public: /** * Sets the specified phone number as the primary phone number of this person. - * The phone number must be one of the instances returned by calling Contact::GetValuesN(CONTACT_MPROPERTY_ID_PHONE_NUMBERS) on the instance of the contacts of this person.@n * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.write + * @privlevel public + * @privilege http://tizen.org/privilege/contact.write * * @return An error code * @param[in] phoneNumber The phone number @@ -214,37 +216,15 @@ public: * @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() - * - * The following example demonstractes how to use %SetAsPrimaryPhoneNumber() method - * @code - * void - * MyApplication::SetPrimaryPhoneNumber(void) - * { - * IList* pContacts = pAddressbookManager->GetContactsByPersonN(pPerson->GetId()); - * Contact* pContact = static_cast(pContacts->GetAt(0)); - * IList* pPhoneNumbers = pContact->GetValuesN(CONTACT_MPROPERTY_ID_PHONE_NUMBERS); - * - * PhoneNumber* pPhoneNumber = static_cast(pPhoneNumbers->GetAt(0)); - * - * // Set the first phone number of the first contact of the person as the primary phone number - * pPerson->SetAsPrimaryPhoneNumber(*pPhoneNumber); - * - * pPhoneNumbers->RemoveAll(true); - * delete pPhoneNumbers; - * - * pContacts->RemoveAll(true); - * delete pContacts; - * } - * @endcode */ result SetAsPrimaryPhoneNumber(const PhoneNumber& phoneNumber); /** * Sets the specified email as the primary email of this person. - * The email must be one of the instances returned by calling Contact::GetValuesN(CONTACT_MPROPERTY_ID_EMAILS) on the instance of the contacts of this person.@n * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.write + * @privlevel public + * @privilege http://tizen.org/privilege/contact.write * * @return An error code * @param[in] email The email @@ -253,28 +233,6 @@ public: * @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() - * The following example demonstractes how to use %SetAsPrimaryEmail() method - * @code - * void - * MyApplication::SetPrimaryEmail(void) - * { - * IList* pContacts = pAddressbookManager->GetContactsByPersonN(pPerson->GetId()); - * Contact* pContact = static_cast(pContacts->GetAt(0)); - * IList* pEmails = pContact->GetValuesN(CONTACT_MPROPERTY_ID_EMAILS); - * - * Email* pEmail = static_cast(pEmails->GetAt(0)); - * - * // Set the first email of the first contact of the person as the primary email - * pPerson->SetAsPrimaryEmail(*pEmail); - * - * pEmails->RemoveAll(true); - * delete pEmails; - * - * pContacts->RemoveAll(true); - * delete pContacts; - * } - * @endcode - */ result SetAsPrimaryEmail(const Email& email); @@ -282,7 +240,8 @@ public: * Gets the primary phone number of this person. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.read + * @privlevel public + * @privilege http://tizen.org/privilege/contact.read * * @return The primary phone number @n If this instance does not have the primary email, an empty PhoneNumber instance is returned. * @exception E_SUCCESS The method is successful. @@ -297,7 +256,8 @@ public: * Gets the primary email of this person. * * @since 2.0 - * @privilege %http://tizen.org/privilege/contact.read + * @privlevel public + * @privilege http://tizen.org/privilege/contact.read * * @return The primary email @n If this instance does not have the primary email, an empty Email instance is returned. * @exception E_SUCCESS The method is successful. diff --git a/inc/FSclReminder.h b/inc/FSclReminder.h index 156bbf2..494aa9f 100644 --- a/inc/FSclReminder.h +++ b/inc/FSclReminder.h @@ -28,6 +28,11 @@ #include #include +namespace Tizen { namespace Base +{ +class DateTime; +}} + namespace Tizen { namespace Social { @@ -169,7 +174,12 @@ public: * @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 The specified @c timeOffset is less than @c 0. + * @exception E_INVALID_ARG Either of the following conditions has occurred: @n + * - The specified @c timeUnit is 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 and offset will be REMINDER_TIME_UNIT_NONE and @c 0. @n + * When the time offset is set, the absolute time will be reset. */ result SetTimeOffset(ReminderTimeUnit timeUnit, int timeOffset); @@ -179,6 +189,7 @@ public: * @since 2.0 * * @return The reminder time unit + * @c REMINDER_TIME_UNIT_NONE, if the absolute time has been set */ ReminderTimeUnit GetTimeUnit(void) const; @@ -188,10 +199,51 @@ public: * @since 2.0 * * @return The reminder time offset + * else @c 0 if the absolute time has been set */ int GetTimeOffset(void) const; /** + * Sets the reminder absolute time. + * The time is Coordinated Universal Time (UTC). + * + * @since 2.1 + * + * @return An error code + * @param[in] time The reminder absolute time + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The @c time is not in a valid range. @n + * The valid range of the time can be referenced from GetMaxDateTime() and GetMinDateTime(). + * @remarks The time offset and absolute time are mutually exclusive. @n + * When the absolute time is set, the time unit and offset will be REMINDER_TIME_UNIT_NONE and @c 0. @n + * When the time offset is set, the absolute time will be reset. + */ + result SetAbsoluteTime(const Tizen::Base::DateTime& time); + + /** + * Gets the reminder absolute time. + * + * @since 2.1 + * + * @return The reminder absolute time + * else the minimum value of DateTime if the absolute time has not been set + */ + Tizen::Base::DateTime GetAbsoluteTime(void) const; + + /** + * Checks whether the absolute time is set. @n + * + * @since 2.1 + * + * @return @c true if the absolute time has been 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 and offset will be REMINDER_TIME_UNIT_NONE and @c 0. @n + * When the time offset is set, the absolute time will be reset. + */ + bool IsAbsolute(void) const; + + /** * Copying of objects using this copy assignment operator is allowed. * * @since 2.0 diff --git a/inc/FSclTypes.h b/inc/FSclTypes.h index 68c0aa6..f50f0e7 100644 --- a/inc/FSclTypes.h +++ b/inc/FSclTypes.h @@ -51,33 +51,28 @@ typedef int RecordId; const RecordId INVALID_RECORD_ID = -1; /** - * @typedef RecurrenceId - * Defines the recurrence ID which is used to identify a specific instance of a recurring calendar component (CalEvent). @n - * The value type is @c Tizen::Base::DateTime. The property value is the effective value of the start time ("DTSTART" property) of the Recurrence instance. + * A unique ID for an account. @n + * If an account is added successfully, an @c AccountId is automatically assigned to the account. * - * @since 2.0 + * @since 2.1 */ -typedef Tizen::Base::DateTime RecurrenceId; +typedef int AccountId; /** - * @if VISPARTNER - * The maximum length of a service provider. + * An invalid account ID. @n * - * @since 2.0 - * @visibility partner - * @endif + * @since 2.1 */ -static const int MAX_SERVICE_PROVIDER_LENGTH = 30; +const AccountId INVALID_ACCOUNT_ID = -1; /** - * @if VISPARTNER - * The maximum length of an account. + * @typedef RecurrenceId + * Defines the recurrence ID which is used to identify a specific instance of a recurring calendar component (CalEvent). @n + * The value type is @c Tizen::Base::DateTime. The property value is the effective value of the start time ("DTSTART" property) of the Recurrence instance. * * @since 2.0 - * @visibility partner - * @endif */ -static const int MAX_ACCOUNT_LENGTH = 320; +typedef Tizen::Base::DateTime RecurrenceId; /** * @if OSPDEPREC @@ -319,6 +314,10 @@ enum ContactPropertyId CONTACT_PROPERTY_ID_LAST_REVISION, /**< An ID for the calendar date and time for 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 */ }; /** @@ -380,7 +379,7 @@ enum RecordSensitivity /** * @enum AttendeeRole - * @brief Defines the role of the attendee. + * Defines the role of the attendee. * @since 2.0 */ enum AttendeeRole @@ -392,7 +391,6 @@ enum AttendeeRole /** * @enum AttendeeStatus - * * Defines the possible status of the attendee. * @since 2.0 */ @@ -433,7 +431,7 @@ static const unsigned long EVENT_CATEGORY_ALL = EVENT_CATEGORY_APPOINTMENT | EVE /** * @enum EventPriority - * @brief Defines the possible priority levels of the event. + * Defines the possible priority levels of the event. * * @since 2.0 */ @@ -446,7 +444,7 @@ enum EventPriority /** * @enum EventStatus - * @brief Defines the possible statuses of the event. + * Defines the possible statuses of the event. * * @since 2.0 */ @@ -460,7 +458,7 @@ enum EventStatus /** * @enum BusyStatus - * @brief Defines the busy statuses of the event. + * Defines the busy statuses of the event. * * @since 2.0 */ @@ -535,7 +533,7 @@ enum RecordEventType * @deprecated This enum value is deprecated because it's not used any more. * @endif */ - MULTI_RECORDS_ADDED, /**< @if OSPDEPREC The adding of multiple records @endif */ + MULTI_RECORDS_ADDED, /**< @if OSPDEPREC The adding of multiple records @endif */ MULTI_RECORDS_UPDATED, /**< @if OSPDEPREC The adding, updating, and/or removal of multiple records @endif */ MULTI_RECORDS_REMOVED /**< @if OSPDEPREC The removal of multiple records @endif */ }; @@ -612,7 +610,8 @@ enum PhoneNumberType PHONENUMBER_TYPE_WORK_FAX, /**< The phone number type for work fax */ PHONENUMBER_TYPE_PAGER, /**< The phone number type for 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_CUSTOM, /**< The custom type @n The actual type can be set in the label. */ + PHONENUMBER_TYPE_ASSISTANT /**< The phone number type for assistant. @b Since: @b 2.1 */ }; /** @@ -626,7 +625,8 @@ 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_WEEK, /**< The unit of time offset is week */ + REMINDER_TIME_UNIT_NONE, /**< The time offset is not using @b Since @b 2.1 */ }; /** @@ -641,7 +641,8 @@ 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_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 */ }; /** @@ -714,6 +715,22 @@ enum RelationshipType CONTACT_RELATIONSHIP_TYPE_SPOUSE, /**< The relation type for spouse */ CONTACT_RELATIONSHIP_TYPE_CUSTOM /**< The custom event @n The actual type can be set in the label. */ }; + +/** + * @enum OrganizationType + * + * Defines the types of organization + * + * @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. @@ -921,6 +938,46 @@ enum EmailContactFilterProperty }; /** + * @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 a %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. * diff --git a/inc/FSclUserProfile.h b/inc/FSclUserProfile.h new file mode 100644 index 0000000..34e53b9 --- /dev/null +++ b/inc/FSclUserProfile.h @@ -0,0 +1,474 @@ +// +// Open Service Platform +// 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 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 the owner of the 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 + */ + 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 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 A system error has occurred. + * @see GetThumbnailPath() + */ + result SetThumbnail(const Tizen::Base::String& filePath); + + /** + * Sets the value of the property having the specified ID to the specified value. + * + * + * @return An error code + * @param[in] id The ID of the property whose value is to set + * @param[in] value A 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 index. + * + * @since 2.1 + * + * @return An error code + * @param[in] index An index to set the value + * @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 email corresponding to the specified index. + * + * @since 2.1 + * + * @return An error code + * @param[in] index An index 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.1 + * + * @return An error code + * @param[in] index An index 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.1 + * + * @return An error code + * @param[in] index An index 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.1 + * + * @return An error code + * @param[in] index An index 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.1 + * + * @return An error code + * @param[in] index An index 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.1 + * + * @return An error code + * @param[in] index An index to set the value + * @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 event corresponding to the specified index. + * + * @since 2.1 + * + * @return An error code + * @param[in] index An index to set the value + * @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 index. + * + * @since 2.1 + * + * @return An error code + * @param[in] index An index 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 relationship corresponding to the specified index. + * + * @since 2.1 + * + * @return An error code + * @param[in] index An index to set the value + * @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 a list of the values belonging to the specific multi value property. + * + * @since 2.1 + * + * @return A list of the values belonging to the specific multi value property + * @param[in] id A 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 email to the user profile.. + * + * @since 2.1 + * + * @return An error code + * @param[in] email The mail 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 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 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 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 organization to the 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 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 specific value at the specified index of the multi value property. + * + * @since 2.1 + * + * @return An error code + * @param[in] id A 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(UserProfileMultiPropertyId id, int index); + + /** + * Copying of objects using this copy assignment operator is allowed. + * + * @since 2.1 + * + * @param[in] rhs An instance of %Contact + */ + 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 old mode 100755 new mode 100644 index 3c8e557..353f418 --- a/inc/FSocial.h +++ b/inc/FSocial.h @@ -59,7 +59,13 @@ #include #include #include +#include +#include +#include +#include +#include #include +#include /** * @namespace Tizen::Social diff --git a/packaging/osp-social.spec b/packaging/osp-social.spec old mode 100644 new mode 100755 index 3512d4b..a71cefd --- a/packaging/osp-social.spec +++ b/packaging/osp-social.spec @@ -3,14 +3,16 @@ Name: osp-social Summary: osp social library -Version: 1.2.0.0 -Release: 18 +Version: 1.2.1.7 +Release: 2 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) @@ -18,6 +20,7 @@ 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 @@ -81,6 +84,7 @@ cp %{_builddir}/%{name}-%{version}/LICENSE.APLv2 %{buildroot}/usr/share/license %manifest osp-social.manifest /usr/share/license/%{name} %{_libdir}/osp/*.so* +/usr/etc/package-manager/parserlib/libaccount.so %files devel %{_includedir}/osp/*.h 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..f915c7d --- /dev/null +++ b/pkgmgr_account/src/account.cpp @@ -0,0 +1,266 @@ +// +// Open Service Platform +// 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 + +#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 {;} + + +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"; + + +extern "C" +__attribute__ ((visibility("default"))) +int PKGMGR_PARSER_PLUGIN_INSTALL(xmlDocPtr docPtr, const char* packageId) +{ + SysLog(NID_SCL, "Registering the Account Provider."); + + int ret = account_connect(); + _SysTryReturn(NID_SCL, ret == ACCOUNT_ERROR_NONE, -1, "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."); + account_disconnect(); + + return -ENOMEM; + } + + // Node: + xmlNodePtr curPtr = xmlFirstElementChild(xmlDocGetRootElement(docPtr)); + _SysTryCatch(NID_SCL, curPtr != null, ret = -EINVAL, "Failed to get the element."); + + SysLog(NID_SCL, "Node: %s", curPtr->name); + + // Get the children nodes + curPtr = curPtr->xmlChildrenNode; + _SysTryCatch(NID_SCL, curPtr != null, ret = -EINVAL, "Failed to get the child element."); + + while(curPtr != null) + { + SysLog(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, ret = -EINVAL, "Failed to get the attribute."); + + SysLog(NID_SCL, "Attribute: appid - %s", pAppIdId); + ret = account_type_set_app_id(accountTypeHandle, reinterpret_cast (pAppIdId)); + _SysTryCatch(NID_SCL, ret == ACCOUNT_ERROR_NONE, ret = -1, "Failed to set the app ID."); + + // Attribute: multiple-accounts-support + xmlChar* pMultipleAccountsSupport = xmlGetProp(curPtr, _ATTRIBUTE_MULTIPLE_ACCOUNTS_SUPPORT); + _SysTryCatch(NID_SCL, pMultipleAccountsSupport != null, ret = -EINVAL, "Failed to get the attribute."); + + SysLog(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, ret = -1, "Failed to set the multiple accounts support."); + } + else + { + ret = account_type_set_multiple_account_support(accountTypeHandle, false); + _SysTryCatch(NID_SCL, ret == ACCOUNT_ERROR_NONE, ret = -1, "Failed to set the multiple accounts support."); + } + + // Get the children nodes + curPtr = curPtr->xmlChildrenNode; + _SysTryCatch(NID_SCL, curPtr != null, ret = -EINVAL, "Failed to get the child element."); + + while (curPtr != NULL) + { + SysLog(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, ret = -EINVAL, "Failed to get the attribute."); + + SysLog(NID_SCL, "Attribute: section - %s", pSection); + + if ((!xmlStrcmp(pSection, _VALUE_ACCOUNT))) + { + xmlChar* pAccountIcon = xmlNodeListGetString(docPtr, curPtr->xmlChildrenNode, 1); + _SysTryCatch(NID_SCL, pAccountIcon != null, ret = -EINVAL, "Failed to get the value."); + + SysLog(NID_SCL, "Node: icon - %s", pAccountIcon); + ret = account_type_set_icon_path(accountTypeHandle, reinterpret_cast (pAccountIcon)); + _SysTryCatch(NID_SCL, ret == ACCOUNT_ERROR_NONE, ret = -1, "Failed to set the icon path."); + } + else if ((!xmlStrcmp(pSection, _VALUE_ACCOUNT_SMALL))) + { + xmlChar* pAccountSmallIcon = xmlNodeListGetString(docPtr, curPtr->xmlChildrenNode, 1); + _SysTryCatch(NID_SCL, pAccountSmallIcon != null, ret = -EINVAL, "Failed to get the value."); + + SysLog(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, ret = -1, "Failed to set the small icon path."); + } + } + // Node: