* @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_INVALID_ARG The date of the specified @c event has not been set.
* @exception E_OUT_OF_RANGE The specified @c index is outside the bounds of the properties.
*/
result SetEventAt(int index, const ContactEvent& event);
* @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.
+ * @exception E_INVALID_ARG The date of the specified @c event has not been set.
*/
result AddEvent(const ContactEvent& event);
_ContactEventImpl::_ContactEventImpl(void)
: __type(CONTACT_EVENT_TYPE_BIRTHDAY)
+, __isDateChanged(false)
{
}
__date = rhs.__date;
__type = rhs.__type;
__label = rhs.__label;
+ __isDateChanged = rhs.__isDateChanged;
}
_ContactEventImpl::~_ContactEventImpl(void)
__date = rhs.__date;
__type = rhs.__type;
__label = rhs.__label;
+ __isDateChanged = rhs.__isDateChanged;
return *this;
}
_ContactEventImpl::SetDate(const DateTime& date)
{
__date = date;
+ __isDateChanged = true;
}
void
__label = label;
}
+bool
+_ContactEventImpl::IsDateChanged(void) const
+{
+ return __isDateChanged;
+}
+
const _ContactEventImpl*
_ContactEventImpl::GetInstance(const ContactEvent& contactEvent)
{
bool operator !=(const _ContactEventImpl& rhs) const;
+ bool IsDateChanged(void) const;
+
static const _ContactEventImpl* GetInstance(const ContactEvent& contactEvent);
static _ContactEventImpl* GetInstance(ContactEvent& contactEvent);
ContactEventType __type;
Tizen::Base::DateTime __date;
Tizen::Base::String __label;
+ bool __isDateChanged;
}; // _ContactEventImpl
}} // Tizen::Social
#include "FScl_AddressImpl.h"
#include "FScl_ImAddressImpl.h"
#include "FScl_OrganizationImpl.h"
+#include "FScl_ContactEventImpl.h"
using namespace Tizen::App;
using namespace Tizen::Base;
_ContactImpl::AddEvent(const ContactEvent& event)
{
SysTryReturn(NID_SCL, !__isRemoved || !IsFailed(Invalidate()), E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+ SysTryReturn(NID_SCL, _ContactEventImpl::GetInstance(event)->IsDateChanged(), E_INVALID_ARG, E_INVALID_ARG, "[%s] Invalid argument is used. The datetime of the event has not been set.", GetErrorMessage(E_INVALID_ARG));
int type = 0;
int intValue = 0;
{
SysTryReturn(NID_SCL, index >= 0, E_OUT_OF_RANGE, E_OUT_OF_RANGE, "[%s] index %d must be greater than or equal to 0.", GetErrorMessage(E_OUT_OF_RANGE), index);
SysTryReturn(NID_SCL, !__isRemoved || Invalidate() == E_SUCCESS, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+ SysTryReturn(NID_SCL, _ContactEventImpl::GetInstance(event)->IsDateChanged(), E_INVALID_ARG, E_INVALID_ARG, "[%s] Invalid argument is used. The datetime of the event has not been set.", GetErrorMessage(E_INVALID_ARG));
int type = 0;
int intValue = 0;