#include <new>
#include <string.h>
+#include <FApp_AppInfo.h>
#include <FBaseColArrayList.h>
-#include <FSysSystemTime.h>
-#include <FLclTimeZone.h>
-#include <FLclGregorianCalendar.h>
+#include <FBaseSysLog.h>
+#include <FBase_StringConverter.h>
#include <FLclCalendar.h>
+#include <FLclGregorianCalendar.h>
+#include <FLclTimeZone.h>
#include <FSclAttendee.h>
-#include <FSclRecord.h>
#include <FSclCalEvent.h>
-#include <FBaseSysLog.h>
-#include <FApp_AppInfo.h>
-#include <FBase_StringConverter.h>
+#include <FSclRecord.h>
+#include <FSysSystemTime.h>
#include "FScl_RecordImpl.h"
#include "FScl_CalEventImpl.h"
#include "FScl_RecurrenceImpl.h"
#include "FScl_CalendarbookImpl.h"
#include "FScl_CalendarbookDbConnector.h"
+using namespace Tizen::App;
using namespace Tizen::Base;
using namespace Tizen::Base::Collection;
using namespace Tizen::Base::Utility;
-using namespace Tizen::App;
-using namespace Tizen::System;
using namespace Tizen::Locales;
+using namespace Tizen::System;
namespace Tizen { namespace Social
{
, __reminderListUpdated(false)
{
// Set default start and end time
- result r = E_SUCCESS;
DateTime startTime;
SystemTime::GetCurrentTime(startTime);
if (IsFailed(GetLastResult()))
}
DateTime endTime(startTime);
- r = endTime.AddHours(_DEFAULT_ADDED_HOUR);
+ result r = endTime.AddHours(_DEFAULT_ADDED_HOUR);
SysTryReturnVoidResult(NID_SCL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
calendar_time_s startCalendarTime;
startCalendarTime.time.utime = _CalendarbookUtil::ConvertDateTimeToEpochTime(startTime);
endCalendarTime.time.utime = _CalendarbookUtil::ConvertDateTimeToEpochTime(endTime);
- int errorCode = CALENDAR_ERROR_NONE;
- calendar_record_h eventHandle = null;
-
r = _CalendarbookDbConnector::Connect();
- SysTryReturnVoidResult(NID_SCL, r == E_SUCCESS, E_SYSTEM, "[E_SYSTEM] A system error has been occurred.");
+ SysTryReturnVoidResult(NID_SCL, r == E_SUCCESS, E_SYSTEM, "[%s] A system error has been occurred.", GetErrorMessage(E_SYSTEM));
- errorCode = calendar_record_create(_calendar_event._uri, &eventHandle);
- SysTryReturnVoidResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ calendar_record_h eventHandle = null;
+ int errorCode = calendar_record_create(_calendar_event._uri, &eventHandle);
+ SysTryReturnVoidResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
__eventRecord.ResetHandle(eventHandle);
calendar_record_set_int(eventHandle, _calendar_event.calendar_book_id, INVALID_RECORD_ID);
r = __reminderList.Construct();
- SysTryReturnVoidResult(NID_SCL, r == E_SUCCESS, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturnVoidResult(NID_SCL, r == E_SUCCESS, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
}
_CalEventImpl::_CalEventImpl(const _CalEventImpl& rhs)
, __isInstance(rhs.__isInstance)
, __reminderListUpdated(false)
{
- int errorCode = CALENDAR_ERROR_NONE;
- calendar_record_h eventHandle = null;
-
result r = _CalendarbookDbConnector::Connect();
- SysTryReturnVoidResult(NID_SCL, r == E_SUCCESS, E_SYSTEM, "[E_SYSTEM] A system error has been occurred.");
+ SysTryReturnVoidResult(NID_SCL, r == E_SUCCESS, E_SYSTEM, "[%s] A system error has been occurred.", GetErrorMessage(E_SYSTEM));
- errorCode = calendar_record_clone(rhs.__eventRecord.GetHandle(), &eventHandle);
- SysTryReturnVoidResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ calendar_record_h eventHandle = null;
+ int errorCode = calendar_record_clone(rhs.__eventRecord.GetHandle(), &eventHandle);
+ SysTryReturnVoidResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
__eventRecord.ResetHandle(eventHandle);
r = __reminderList.Construct();
- SysTryReturnVoidResult(NID_SCL, r == E_SUCCESS, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturnVoidResult(NID_SCL, r == E_SUCCESS, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
}
_CalEventImpl::~_CalEventImpl(void)
__reminderList.RemoveAll(true);
result r = _CalendarbookDbConnector::Disconnect();
- SysTryReturnVoidResult(NID_SCL, r == E_SUCCESS, E_SYSTEM, "[E_SYSTEM] A system error has been occurred.");
+ SysTryReturnVoidResult(NID_SCL, r == E_SUCCESS, E_SYSTEM, "[%s] A system error has been occurred.", GetErrorMessage(E_SYSTEM));
}
_CalEventImpl&
calendar_record_h eventHandle = null;
errorCode = calendar_record_clone(rhs.__eventRecord.GetHandle(), &eventHandle);
- SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, *this, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, *this, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
__eventRecord.ResetHandle(eventHandle);
return;
}
- int errorCode = CALENDAR_ERROR_NONE;
calendar_time_s startCalendarTime;
calendar_time_s tmpStartCalendarTime;
calendar_time_s endCalendarTime;
}
std::unique_ptr<char[]> pExDates(_StringConverter::CopyToCharArrayN(ConvertRecurrenceToRRuleExDateString(*__pRecurrence.get(), isAllDayEvent)));
- errorCode = calendar_record_set_str(__eventRecord.GetHandle(), _calendar_event.exdate, pExDates.get());
- SysTryReturnVoidResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ int errorCode = calendar_record_set_str(__eventRecord.GetHandle(), _calendar_event.exdate, pExDates.get());
+ SysTryReturnVoidResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
}
}
}
}
ByteBuffer* pConvertedUidBuffer = _CalendarbookUtil::ConvertCharArrayToByteBufferN(pStrUid);
- SysTryReturn(NID_SCL, pConvertedUidBuffer != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturn(NID_SCL, pConvertedUidBuffer != null, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
return pConvertedUidBuffer;
}
if (pUid != null)
{
std::unique_ptr<char[]> pConvertedUidArray(_CalendarbookUtil::ConvertByteBufferToCharArrayN(*pUid));
- SysTryReturn(NID_SCL, pConvertedUidArray != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturn(NID_SCL, pConvertedUidArray != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
errorCode = calendar_record_set_str(__eventRecord.GetHandle(), _calendar_event.uid, pConvertedUidArray.get());
SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
return E_SUCCESS;
}
-Tizen::Base::String
+String
_CalEventImpl::GetUid(void) const
{
char* pStrUid = null;
}
void
-_CalEventImpl::SetUid(const Tizen::Base::String& uid)
+_CalEventImpl::SetUid(const String& uid)
{
- int errorCode = CALENDAR_ERROR_NONE;
-
std::unique_ptr<char[]> pStrUid(_StringConverter::CopyToCharArrayN(uid));
- SysTryReturnVoidResult(NID_SCL, pStrUid != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturnVoidResult(NID_SCL, pStrUid != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
- errorCode = calendar_record_set_str(__eventRecord.GetHandle(), _calendar_event.uid, pStrUid.get());
- SysTryReturnVoidResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ int errorCode = calendar_record_set_str(__eventRecord.GetHandle(), _calendar_event.uid, pStrUid.get());
+ SysTryReturnVoidResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
}
EventStatus
SysTryReturnResult(NID_SCL, GetAttendeeIndex(pConvertedEmail.get()) == _INVALID_ATTENDEE_INDEX, E_OBJ_ALREADY_EXIST
, "The specified attendee already exists as this email is already registered.");
- int errorCode = CALENDAR_ERROR_NONE;
-
std::unique_ptr<char[]> pConvertedName(_StringConverter::CopyToCharArrayN(attendee.GetName()));
SysTryReturnResult(NID_SCL, pConvertedName != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
}
calendar_record_h attendeeHandle = null;
- errorCode = calendar_record_create(_calendar_attendee._uri, &attendeeHandle);
+ int errorCode = calendar_record_create(_calendar_attendee._uri, &attendeeHandle);
SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
errorCode = calendar_record_set_str(attendeeHandle, _calendar_attendee.name, pConvertedName.get());
result
_CalEventImpl::RemoveAttendee(const Attendee& attendee)
{
- int index = _INVALID_ATTENDEE_INDEX;
-
std::unique_ptr<char[]> pConvertedEmail(_StringConverter::CopyToCharArrayN(attendee.GetEmail()));
SysTryReturnResult(NID_SCL, pConvertedEmail != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
- index = GetAttendeeIndex(pConvertedEmail.get());
- SysTryReturnResult(NID_SCL, index != _INVALID_ATTENDEE_INDEX, E_OBJ_NOT_FOUND, "The specified attendee does not exist.")
+ int index = GetAttendeeIndex(pConvertedEmail.get());
+ SysTryReturnResult(NID_SCL, index != _INVALID_ATTENDEE_INDEX, E_OBJ_NOT_FOUND, "The specified attendee does not exist.");
calendar_record_h tmpAttendeeHandle = null;
calendar_record_get_child_record_at_p(__eventRecord.GetHandle(), _calendar_event.calendar_attendee, index, &tmpAttendeeHandle);
ClearLastResult();
std::unique_ptr<ArrayList, AllElementsDeleter> pList(new (std::nothrow) ArrayList());
- SysTryReturn(NID_SCL, pList != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturn(NID_SCL, pList != null, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
result r = pList->Construct();
SysTryReturn(NID_SCL, !IsFailed(r), null, r, "[%s] Propagating.", GetErrorMessage(r));
break;
}
- Attendee* pTmpAttendee = new (std::nothrow) Attendee(pTmpEmail);
- SysTryReturn(NID_SCL, pTmpAttendee != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ std::unique_ptr<Attendee> pTmpAttendee(new (std::nothrow) Attendee(pTmpEmail));
+ SysTryReturn(NID_SCL, pTmpAttendee != null, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
if (pTmpName != null && strlen(pTmpName) > 0)
{
pTmpAttendee->SetRole(attendeeRole);
pTmpAttendee->SetPersonId(tmpPersonId);
- pList->Add(*pTmpAttendee);
+ r = pList->Add(pTmpAttendee.get());
+ SysTryReturn(NID_SCL, !IsFailed(r), null, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ pTmpAttendee.release();
}
return pList.release();
}
-Tizen::Locales::TimeZone
+TimeZone
_CalEventImpl::GetTimeZone(void) const
{
char* pTimeZoneId = null;
}
result
-_CalEventImpl::SetTimeZone(const Tizen::Locales::TimeZone& timeZone)
+_CalEventImpl::SetTimeZone(const TimeZone& timeZone)
{
- int errorCode = CALENDAR_ERROR_NONE;
-
std::unique_ptr<char[]> pConvertedTimeZoneId(_StringConverter::CopyToCharArrayN(timeZone.GetId()));
SysTryReturnResult(NID_SCL, pConvertedTimeZoneId != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
- errorCode = calendar_record_set_str(__eventRecord.GetHandle(), _calendar_event.start_tzid, pConvertedTimeZoneId.get());
+ int errorCode = calendar_record_set_str(__eventRecord.GetHandle(), _calendar_event.start_tzid, pConvertedTimeZoneId.get());
SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
errorCode = calendar_record_set_str(__eventRecord.GetHandle(), _calendar_event.end_tzid, pConvertedTimeZoneId.get());
SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
{
ClearLastResult();
SysTryReturn(NID_SCL, __isInstance, DateTime(), E_INVALID_STATE,
- "[E_INVALID_STATE] The instance does not have a recurrence or is not a CalEvent instance which doesn't have a RecurrenceId.");
+ "[%s] The instance does not have a recurrence or is not a CalEvent instance which doesn't have a RecurrenceId.", GetErrorMessage(E_INVALID_STATE));
return GetStartTime();
}
sensitivity = SENSITIVITY_CONFIDENTIAL;
break;
default :
- SysLogException(NID_SCL, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used. sensitivity = %d", srcSensitivity);
+ SysLogException(NID_SCL, E_INVALID_ARG, "[%s] Invalid argument is used. sensitivity = %d", GetErrorMessage(E_INVALID_ARG), srcSensitivity);
sensitivity = SENSITIVITY_PUBLIC;
}
if (__reminderListUpdated == false)
{
result r = _CalendarbookUtil::ConvertEventAlarmsToReminderList(__eventRecord.GetHandle(), __reminderList);
- SysTryReturn(NID_SCL, r == E_SUCCESS, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturn(NID_SCL, r == E_SUCCESS, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
__reminderListUpdated = true;
}
case CALENDAR_RECURRENCE_DAILY:
pRecurrence->SetFrequency(FREQ_DAILY);
break;
+
case CALENDAR_RECURRENCE_WEEKLY:
pRecurrence->SetFrequency(FREQ_WEEKLY);
dayOfWeek = ConvertRRuleByDayStringToDayOfWeek(pByDay);
- SysTryReturn(NID_SCL, GetLastResult() == E_SUCCESS, null, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used. byday = %s", pByDay);
+ SysTryReturn(NID_SCL, GetLastResult() == E_SUCCESS, null, E_INVALID_ARG, "[%s] Invalid argument is used. byday = %s", GetErrorMessage(E_INVALID_ARG), pByDay);
pRecurrence->SetDayOfWeek(dayOfWeek);
-
break;
+
case CALENDAR_RECURRENCE_MONTHLY:
pRecurrence->SetFrequency(FREQ_MONTHLY);
else
{
r = ConvertRRuleByDayStringToDayOfWeekAndWeekOfMonth(pByDay, weekOfMonth, dayOfWeek);
- SysTryReturn(NID_SCL, r == E_SUCCESS, null, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used. byday = %s", pByDay);
+ SysTryReturn(NID_SCL, r == E_SUCCESS, null, E_INVALID_ARG, "[%s] Invalid argument is used. byday = %s", GetErrorMessage(E_INVALID_ARG), pByDay);
pRecurrence->SetWeekOfMonth(weekOfMonth);
pRecurrence->SetDayOfWeek(dayOfWeek);
}
break;
+
case CALENDAR_RECURRENCE_YEARLY:
pRecurrence->SetFrequency(FREQ_YEARLY);
else
{
r = ConvertRRuleByDayStringToDayOfWeekAndWeekOfMonth(pByDay, weekOfMonth, dayOfWeek);
- SysTryReturn(NID_SCL, r == E_SUCCESS, null, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used. byday = %s", pByDay);
+ SysTryReturn(NID_SCL, r == E_SUCCESS, null, E_INVALID_ARG, "[%s] Invalid argument is used. byday = %s", GetErrorMessage(E_INVALID_ARG), pByDay);
pRecurrence->SetWeekOfMonth(weekOfMonth);
pRecurrence->SetDayOfWeek(dayOfWeek);
pRecurrence->SetMonthOfYear(monthOfYear);
break;
+
default :
SysLogException(NID_SCL, E_INVALID_ARG, "Invalid argument is passed. frequency = %d", srcFrequency);
return null;
case CALENDAR_SUNDAY:
convertedWeekStart = CAL_SUNDAY;
break;
+
case CALENDAR_MONDAY:
convertedWeekStart = CAL_MONDAY;
break;
+
default:
SysLogException(NID_SCL, E_INVALID_ARG, "Invalid argument is passed. week start = %d", weekStart);
return null;
if (pExDates != null && strlen(pExDates) != 0)
{
r = ConvertRRuleExDateStringToRecurrence(pExDates, *pRecurrence.get());
- SysTryReturn(NID_SCL, r == E_SUCCESS, null, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used. exdate = %s", pExDates);
+ SysTryReturn(NID_SCL, r == E_SUCCESS, null, E_INVALID_ARG, "[%s] Invalid argument is used. exdate = %s", GetErrorMessage(E_INVALID_ARG), pExDates);
}
return pRecurrence.release();
std::unique_ptr<char[]> pConvertedSubject(_StringConverter::CopyToCharArrayN(subject));
SysTryReturnResult(NID_SCL, pConvertedSubject != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
- int errorCode = CALENDAR_ERROR_NONE;
- errorCode = calendar_record_set_str(__eventRecord.GetHandle(), _calendar_event.summary, pConvertedSubject.get());
+ int errorCode = calendar_record_set_str(__eventRecord.GetHandle(), _calendar_event.summary, pConvertedSubject.get());
SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
return E_SUCCESS;
std::unique_ptr<char[]> pConvertedDescription(_StringConverter::CopyToCharArrayN(description));
SysTryReturnResult(NID_SCL, pConvertedDescription != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
- int errorCode = CALENDAR_ERROR_NONE;
- errorCode = calendar_record_set_str(__eventRecord.GetHandle(), _calendar_event.description, pConvertedDescription.get());
+ int errorCode = calendar_record_set_str(__eventRecord.GetHandle(), _calendar_event.description, pConvertedDescription.get());
SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
return E_SUCCESS;
std::unique_ptr<char[]> pConvertedLocation(_StringConverter::CopyToCharArrayN(location));
SysTryReturnResult(NID_SCL, pConvertedLocation != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
- int errorCode = CALENDAR_ERROR_NONE;
- errorCode = calendar_record_set_str(__eventRecord.GetHandle(), _calendar_event.location, pConvertedLocation.get());
+ int errorCode = calendar_record_set_str(__eventRecord.GetHandle(), _calendar_event.location, pConvertedLocation.get());
SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
return E_SUCCESS;
void
_CalEventImpl::SetCategory(EventCategory category)
{
- int errorCode = CALENDAR_ERROR_NONE;
std::unique_ptr<char[]> pConvertedCategory;
if (category == EVENT_CATEGORY_ANNIVERSARY)
SetAllDayEvent(true);
pConvertedCategory.reset(_StringConverter::CopyToCharArrayN(_EVENT_CATEGORY_ANNIVERSARY_STRING));
- SysTryReturnVoidResult(NID_SCL, pConvertedCategory != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturnVoidResult(NID_SCL, pConvertedCategory != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
}
else
{
pConvertedCategory.reset(_StringConverter::CopyToCharArrayN(_EVENT_CATEGORY_APPOINTMENT_STRING));
- SysTryReturnVoidResult(NID_SCL, pConvertedCategory != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturnVoidResult(NID_SCL, pConvertedCategory != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
}
- errorCode = calendar_record_set_str(__eventRecord.GetHandle(), _calendar_event.categories, pConvertedCategory.get());
- SysTryReturnVoidResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ int errorCode = calendar_record_set_str(__eventRecord.GetHandle(), _calendar_event.categories, pConvertedCategory.get());
+ SysTryReturnVoidResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
}
void
result
_CalEventImpl::SetReminder(const Reminder* pReminder)
{
- int errorCode = CALENDAR_ERROR_NONE;
-
unsigned int reminderCount = 0;
calendar_record_h tmpAlarmHandle = null;
}
calendar_record_h tmpAlarmHandle = null;
+ int errorCode = CALENDAR_ERROR_NONE;
if (reminderCount > 0)
{
result
_CalEventImpl::SetRecurrence(const Recurrence* pRecurrence)
{
- result r = E_SUCCESS;
- int errorCode = CALENDAR_ERROR_NONE;
-
if (pRecurrence != null)
{
- r = VerifyRecurrence(*pRecurrence);
+ result r = VerifyRecurrence(*pRecurrence);
SysTryReturn(NID_SCL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
r = ResetStartAndEndTimeByRecurrence(*pRecurrence);
SysTryReturn(NID_SCL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
std::unique_ptr<char[]> pExDates(_StringConverter::CopyToCharArrayN(ConvertRecurrenceToRRuleExDateString(*pRecurrence, IsAllDayEvent())));
- errorCode = calendar_record_set_str(__eventRecord.GetHandle(), _calendar_event.exdate, pExDates.get());
+ int errorCode = calendar_record_set_str(__eventRecord.GetHandle(), _calendar_event.exdate, pExDates.get());
SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
__pRecurrence.reset(new (std::nothrow) Recurrence(*pRecurrence));
result
_CalEventImpl::AddReminder(const Reminder& reminder)
{
- int errorCode = CALENDAR_ERROR_NONE;
calendar_record_h tmpAlarmHandle = null;
std::unique_ptr<char[]> pTmpAlarmTone(_StringConverter::CopyToCharArrayN(reminder.GetSoundFile()));
SysTryReturnResult(NID_SCL, pTmpAlarmTone != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
- errorCode = calendar_record_create(_calendar_alarm._uri, &tmpAlarmHandle);
+ int errorCode = calendar_record_create(_calendar_alarm._uri, &tmpAlarmHandle);
SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
int convertedTimeUnit = 0;
case REMINDER_TIME_UNIT_MINUTE:
convertedTimeUnit = CALENDAR_ALARM_TIME_UNIT_MINUTE;
break;
+
case REMINDER_TIME_UNIT_HOUR:
convertedTimeUnit = CALENDAR_ALARM_TIME_UNIT_HOUR;
break;
+
case REMINDER_TIME_UNIT_DAY:
convertedTimeUnit = CALENDAR_ALARM_TIME_UNIT_DAY;
break;
+
case REMINDER_TIME_UNIT_WEEK:
convertedTimeUnit = CALENDAR_ALARM_TIME_UNIT_WEEK;
break;
+
case REMINDER_TIME_UNIT_NONE:
convertedTimeUnit = CALENDAR_ALARM_TIME_UNIT_SPECIFIC;
break;
+
default:
break;
}
result
_CalEventImpl::RemoveReminderAt(int index)
{
- int errorCode = CALENDAR_ERROR_NONE;
calendar_record_h tmpAlarmHandle = null;
- errorCode = calendar_record_get_child_record_at_p(__eventRecord.GetHandle(), _calendar_event.calendar_alarm, index, &tmpAlarmHandle);
+ calendar_record_get_child_record_at_p(__eventRecord.GetHandle(), _calendar_event.calendar_alarm, index, &tmpAlarmHandle);
SysTryReturnResult(NID_SCL, tmpAlarmHandle != null, E_OUT_OF_RANGE, "The index is out of range. index = %d", index);
calendar_record_remove_child_record(__eventRecord.GetHandle(), _calendar_event.calendar_alarm, tmpAlarmHandle);
if (__reminderListUpdated == false)
{
result r = _CalendarbookUtil::ConvertEventAlarmsToReminderList(__eventRecord.GetHandle(), __reminderList);
- SysTryReturn(NID_SCL, r == E_SUCCESS, __reminderList, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturn(NID_SCL, r == E_SUCCESS, __reminderList, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
__reminderListUpdated = true;
}
{
result r = E_SUCCESS;
- int errorCode = CALENDAR_ERROR_NONE;
int weekStart = CALENDAR_SUNDAY;
std::unique_ptr<char[]> pByDay;
std::unique_ptr<char[]> pByMonth;
case CAL_SUNDAY:
weekStart = CALENDAR_SUNDAY;
break;
+
case CAL_MONDAY:
weekStart = CALENDAR_MONDAY;
break;
+
default:
SysLogException(NID_SCL, E_INVALID_ARG, "Invalid argument is passed. week start = %d", recurrence.GetWeekStart());
return E_INVALID_ARG;
}
- errorCode = calendar_record_set_int(eventHandle, _calendar_event.wkst, weekStart);
+
+ int errorCode = calendar_record_set_int(eventHandle, _calendar_event.wkst, weekStart);
SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_INVALID_ARG, "Invalid argument is passed. week start = %d", weekStart);
if (recurrence.GetUntil() != null)
case FREQ_DAILY:
calendar_record_set_int(eventHandle, _calendar_event.freq, CALENDAR_RECURRENCE_DAILY);
break;
+
case FREQ_WEEKLY:
calendar_record_set_int(eventHandle, _calendar_event.freq, CALENDAR_RECURRENCE_WEEKLY);
pByDay.reset(_StringConverter::CopyToCharArrayN(dayOfWeekString));
break;
+
case FREQ_MONTHLY:
calendar_record_set_int(eventHandle, _calendar_event.freq, CALENDAR_RECURRENCE_MONTHLY);
}
break;
+
case FREQ_YEARLY:
calendar_record_set_int(eventHandle, _calendar_event.freq, CALENDAR_RECURRENCE_YEARLY);
}
break;
+
default:
- SysLogException(NID_SCL, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used. frequency = %d", recurrence.GetFrequency());
+ SysLogException(NID_SCL, E_INVALID_ARG, "[%s] Invalid argument is used. frequency = %d", GetErrorMessage(E_INVALID_ARG), recurrence.GetFrequency());
return E_INVALID_ARG;
}
result
_CalEventImpl::ResetStartAndEndTimeByRecurrence(const Recurrence& recurrence)
{
- result r = E_SUCCESS;
DateTime startTime;
DateTime endTime;
count++;
}
- r = calculatedStartTime.AddDays(count);
+ result r = calculatedStartTime.AddDays(count);
SysTryReturnResult(NID_SCL, !IsFailed(r), r, "[%s][Propagating]", GetErrorMessage(r));
r = calculatedEndTime.AddDays(count);
SysTryReturnResult(NID_SCL, !IsFailed(r), r, "[%s][Propagating]", GetErrorMessage(r));
int
_CalEventImpl::ConvertRRuleByDayStringToDayOfWeek(const String& byDay) const
{
- result r = E_SUCCESS;
int dayOfWeek = 0;
ClearLastResult();
- SysTryReturn(NID_SCL, !byDay.IsEmpty(), 0, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used. The byDay is empty.");
+ SysTryReturn(NID_SCL, !byDay.IsEmpty(), 0, E_INVALID_ARG, "[%s] Invalid argument is used. The byDay is empty.", GetErrorMessage(E_INVALID_ARG));
String delim(_RECURRENCE_DELIMITER);
String token;
StringTokenizer strTok(byDay, delim);
while (strTok.HasMoreTokens())
{
- r = strTok.GetNextToken(token);
- SysTryReturn(NID_SCL, r == E_SUCCESS, 0, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ result r = strTok.GetNextToken(token);
+ SysTryReturn(NID_SCL, r == E_SUCCESS, 0, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
if (token == String(_RECURRENCE_KEYWORD_SUNDAY))
{
}
else
{
- SysLogException(NID_SCL, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used. byday = %S", byDay.GetPointer());
+ SysLogException(NID_SCL, E_INVALID_ARG, "[%s] Invalid argument is used. byday = %S", GetErrorMessage(E_INVALID_ARG), byDay.GetPointer());
return 0;
}
}
result
_CalEventImpl::ConvertRRuleByDayStringToDayOfWeekAndWeekOfMonth(const String& byDay, int& weekOfMonth, int& dayOfWeek) const
{
- result r = E_SUCCESS;
String delim(_RECURRENCE_DELIMITER);
String token;
wchar_t tmpChar = 0;
while (strTok.HasMoreTokens())
{
- r = strTok.GetNextToken(token);
+ result r = strTok.GetNextToken(token);
SysTryReturnResult(NID_SCL, r == E_SUCCESS, E_OUT_OF_MEMORY, "Memory allocation failed.");
r = token.GetCharAt(_RECURRENCE_BY_DAY_FIRST_INDEX, tmpChar);
}
else
{
- SysLogException(NID_SCL, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used. byday = %S", byDay.GetPointer());
+ SysLogException(NID_SCL, E_INVALID_ARG, "[%s] Invalid argument is used. byday = %S", GetErrorMessage(E_INVALID_ARG), byDay.GetPointer());
}
}
result
_CalEventImpl::ConvertRRuleExDateStringToRecurrence(const String& exdate, Recurrence& recurrence) const
{
- result r = E_SUCCESS;
-
String delim(_RECURRENCE_DELIMITER);
String token;
DateTime tmpDateTime;
StringTokenizer strTok(exdate, delim);
while (strTok.HasMoreTokens())
{
- r = strTok.GetNextToken(token);
+ result r = strTok.GetNextToken(token);
SysTryReturnResult(NID_SCL, r == E_SUCCESS, E_OUT_OF_MEMORY, "Memory allocation failed.");
r = _CalendarbookUtil::ConvertRRuleDateTimeStringToDateTime(token, tmpDateTime, tmpTimeZone, isDate);
std::unique_ptr<IList, AllElementsDeleter> pExDateList(recurrence.GetExceptionDatesN());
- IEnumerator* pEnum = pExDateList->GetEnumeratorN();
+ std::unique_ptr<IEnumerator> pEnum(pExDateList->GetEnumeratorN());
while (pEnum->MoveNext() == E_SUCCESS)
{
DateTime* pDateTime = static_cast<DateTime*>(pEnum->GetCurrent());
isNotFirst = true;
}
- delete pEnum;
return exdateString;
}
}
DateTime
-_CalEventImpl::GetDate(int year, int month, int weekOfMonth, CalDayOfWeek dayOfWeek, const DateTime& time, const Locales::TimeZone& timeZone)
+_CalEventImpl::GetDate(int year, int month, int weekOfMonth, CalDayOfWeek dayOfWeek, const DateTime& time, const TimeZone& timeZone)
{
+ ClearLastResult();
+
Tizen::Locales::DayOfWeek dayOfWeekByGregorianCalendar = Tizen::Locales::DAY_OF_WEEK_UNDEFINED;
switch (dayOfWeek)
case CAL_SUNDAY:
dayOfWeekByGregorianCalendar = Tizen::Locales::SUNDAY;
break;
+
case CAL_MONDAY:
dayOfWeekByGregorianCalendar = Tizen::Locales::MONDAY;
break;
+
case CAL_TUESDAY:
dayOfWeekByGregorianCalendar = Tizen::Locales::TUESDAY;
break;
+
case CAL_WEDNESDAY:
dayOfWeekByGregorianCalendar = Tizen::Locales::WEDNESDAY;
break;
+
case CAL_THURSDAY:
dayOfWeekByGregorianCalendar = Tizen::Locales::THURSDAY;
break;
+
case CAL_FRIDAY:
dayOfWeekByGregorianCalendar = Tizen::Locales::FRIDAY;
break;
+
case CAL_SATURDAY:
dayOfWeekByGregorianCalendar = Tizen::Locales::SATURDAY;
break;
+
default:
break;
}
- Tizen::Locales::Calendar* pGregorianCalendar = Tizen::Locales::Calendar::CreateInstanceN(timeZone, Tizen::Locales::CALENDAR_GREGORIAN);
+ std::unique_ptr<Tizen::Locales::Calendar> pGregorianCalendar(Tizen::Locales::Calendar::CreateInstanceN(timeZone, Tizen::Locales::CALENDAR_GREGORIAN));
+ SysTryReturn(NID_SCL, pGregorianCalendar != null, DateTime(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
pGregorianCalendar->SetTimeField(Tizen::Locales::TIME_FIELD_YEAR, year);
pGregorianCalendar->SetTimeField(Tizen::Locales::TIME_FIELD_MONTH, month);
DateTime resultTime;
resultTime.SetValue(year, month, tmpDayOfMonth, time.GetHour(), time.GetMinute(), time.GetSecond());
- delete pGregorianCalendar;
-
return resultTime;
}
CalDayOfWeek
_CalEventImpl::GetDayOfWeek(const DateTime& date, const Locales::TimeZone& timeZone)
{
+ ClearLastResult();
+
CalDayOfWeek dayOfWeek = CAL_SUNDAY;
std::unique_ptr<Tizen::Locales::Calendar> pGregorianCalendar(Tizen::Locales::Calendar::CreateInstanceN(timeZone, Tizen::Locales::CALENDAR_GREGORIAN));
+ SysTryReturn(NID_SCL, pGregorianCalendar != null, dayOfWeek, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
pGregorianCalendar->SetTime(date);
int dayOfWeekByGregorianCalendar = pGregorianCalendar->GetTimeField(Tizen::Locales::TIME_FIELD_DAY_OF_WEEK);
case Tizen::Locales::SUNDAY:
dayOfWeek = CAL_SUNDAY;
break;
+
case Tizen::Locales::MONDAY:
dayOfWeek = CAL_MONDAY;
break;
+
case Tizen::Locales::TUESDAY:
dayOfWeek = CAL_TUESDAY;
break;
+
case Tizen::Locales::WEDNESDAY:
dayOfWeek = CAL_WEDNESDAY;
break;
+
case Tizen::Locales::THURSDAY:
dayOfWeek = CAL_THURSDAY;
break;
+
case Tizen::Locales::FRIDAY:
dayOfWeek = CAL_FRIDAY;
break;
+
case Tizen::Locales::SATURDAY:
dayOfWeek = CAL_SATURDAY;
break;
+
default:
break;
}
* This file contains definitions of @e _CalEventInstanceImpl class.
*/
-#include <FBaseString.h>
#include <FBaseDateTime.h>
+#include <FBaseString.h>
#include <FSclCalEventInstance.h>
-#include "FScl_RecordImpl.h"
#include "FScl_CalEventInstanceImpl.h"
+#include "FScl_RecordImpl.h"
using namespace Tizen::Base;
* This file contains definitions of @e CalTodoImpl class.
*/
-#include <FBaseDateTime.h>
+#include <FApp_AppInfo.h>
#include <FBaseColArrayList.h>
-#include <FSysSystemTime.h>
-#include <FSclTypes.h>
-#include <FSclRecord.h>
+#include <FBaseDateTime.h>
+#include <FBaseSysLog.h>
+#include <FBase_StringConverter.h>
#include <FSclCalTodo.h>
+#include <FSclRecord.h>
#include <FSclReminder.h>
#include <FSclRecurrence.h>
-#include <FBaseSysLog.h>
-#include <FApp_AppInfo.h>
-#include <FBase_StringConverter.h>
+#include <FSysSystemTime.h>
+#include <FSclTypes.h>
+#include "FScl_CalendarbookDbConnector.h"
+#include "FScl_CalendarbookImpl.h"
#include "FScl_CalTodoImpl.h"
#include "FScl_RecordImpl.h"
-#include "FScl_CalendarbookImpl.h"
-#include "FScl_CalendarbookDbConnector.h"
+using namespace Tizen::App;
using namespace Tizen::Base;
using namespace Tizen::Base::Collection;
-using namespace Tizen::App;
namespace Tizen { namespace Social
{
_CalTodoImpl::_CalTodoImpl(void)
: __reminderListUpdated(false)
{
- int errorCode = CALENDAR_ERROR_NONE;
calendar_record_h todoHandle = null;
result r = _CalendarbookDbConnector::Connect();
- SysTryReturnVoidResult(NID_SCL, r == E_SUCCESS, E_SYSTEM, "[E_SYSTEM] A system error has been occurred.");
+ SysTryReturnVoidResult(NID_SCL, r == E_SUCCESS, E_SYSTEM, "[%s] A system error has been occurred.", GetErrorMessage(E_SYSTEM));
- errorCode = calendar_record_create(_calendar_todo._uri, &todoHandle);
- SysTryReturnVoidResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ int errorCode = calendar_record_create(_calendar_todo._uri, &todoHandle);
+ SysTryReturnVoidResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
if (_AppInfo::GetApiVersion() == _API_VERSION_2_0 && _AppInfo::IsOspCompat())
{
__todoRecord.ResetHandle(todoHandle);
r = __reminderList.Construct();
- SysTryReturnVoidResult(NID_SCL, r == E_SUCCESS, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturnVoidResult(NID_SCL, r == E_SUCCESS, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
}
_CalTodoImpl::_CalTodoImpl(const _CalTodoImpl& rhs)
: __reminderListUpdated(false)
{
- int errorCode = CALENDAR_ERROR_NONE;
calendar_record_h todoHandle = null;
result r = _CalendarbookDbConnector::Connect();
- SysTryReturnVoidResult(NID_SCL, r == E_SUCCESS, E_SYSTEM, "[E_SYSTEM] A system error has been occurred.");
+ SysTryReturnVoidResult(NID_SCL, r == E_SUCCESS, E_SYSTEM, "[%s] A system error has been occurred.", GetErrorMessage(E_SYSTEM));
- errorCode = calendar_record_clone(rhs.__todoRecord.GetHandle(), &todoHandle);
- SysTryReturnVoidResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ int errorCode = calendar_record_clone(rhs.__todoRecord.GetHandle(), &todoHandle);
+ SysTryReturnVoidResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
__todoRecord.ResetHandle(todoHandle);
r = __reminderList.Construct();
- SysTryReturnVoidResult(NID_SCL, r == E_SUCCESS, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturnVoidResult(NID_SCL, r == E_SUCCESS, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
}
_CalTodoImpl::~_CalTodoImpl(void)
__reminderList.RemoveAll(true);
result r = _CalendarbookDbConnector::Disconnect();
- SysTryReturnVoidResult(NID_SCL, r == E_SUCCESS, E_SYSTEM, "[E_SYSTEM] A system error has been occurred.");
+ SysTryReturnVoidResult(NID_SCL, r == E_SUCCESS, E_SYSTEM, "[%s] A system error has been occurred.", GetErrorMessage(E_SYSTEM));
}
_CalTodoImpl&
__reminderList.RemoveAll(true);
__reminderListUpdated = false;
- int errorCode = CALENDAR_ERROR_NONE;
calendar_record_h todoHandle = null;
- errorCode = calendar_record_clone(rhs.__todoRecord.GetHandle(), &todoHandle);
- SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, *this, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ int errorCode = calendar_record_clone(rhs.__todoRecord.GetHandle(), &todoHandle);
+ SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, *this, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
__todoRecord.ResetHandle(todoHandle);
case CALENDAR_TODO_PRIORITY_LOW:
priority = TODO_PRIORITY_LOW;
break;
+
case CALENDAR_TODO_PRIORITY_NONE:
// fall through
case CALENDAR_TODO_PRIORITY_NORMAL:
priority = TODO_PRIORITY_NORMAL;
break;
+
case CALENDAR_TODO_PRIORITY_HIGH:
priority = TODO_PRIORITY_HIGH;
break;
+
default:
SysLog(NID_SCL, "The priority value is invalid. priority = %d", srcPriority);
priority = TODO_PRIORITY_NORMAL;
case CALENDAR_TODO_STATUS_NONE:
status = TODO_STATUS_NONE;
break;
+
case CALENDAR_TODO_STATUS_NEEDS_ACTION:
status = TODO_STATUS_NEEDS_ACTION;
break;
+
case CALENDAR_TODO_STATUS_COMPLETED:
status = TODO_STATUS_COMPLETED;
break;
+
case CALENDAR_TODO_STATUS_IN_PROCESS:
status = TODO_STATUS_IN_PROCESS;
break;
+
case CALENDAR_TODO_STATUS_CANCELED:
status = TODO_STATUS_CANCELLED;
break;
+
default:
SysLog(NID_SCL, "The status value is invalid. status = %d", srcStatus);
status = TODO_STATUS_NONE;
case CALENDAR_SENSITIVITY_PUBLIC:
sensitivity = SENSITIVITY_PUBLIC;
break;
+
case CALENDAR_SENSITIVITY_PRIVATE:
sensitivity = SENSITIVITY_PRIVATE;
break;
+
case CALENDAR_SENSITIVITY_CONFIDENTIAL:
sensitivity = SENSITIVITY_CONFIDENTIAL;
break;
+
default:
SysLog(NID_SCL, "The sensitivity value is invalid. sensitivity = %d", srcSensitivity);
sensitivity = SENSITIVITY_PUBLIC;
_CalTodoImpl::GetLastRevisedTime(void) const
{
long long lastModifiedTime = 0;
- DateTime tmpLastRevisedTime;
calendar_record_get_lli(__todoRecord.GetHandle(), _calendar_todo.last_modified_time, &lastModifiedTime);
- tmpLastRevisedTime = _CalendarbookUtil::ConvertEpochTimeToDateTime(lastModifiedTime);
-
- return tmpLastRevisedTime;
+ return _CalendarbookUtil::ConvertEpochTimeToDateTime(lastModifiedTime);
}
result
std::unique_ptr<char[]> pConvertedSubject(_StringConverter::CopyToCharArrayN(subject));
SysTryReturnResult(NID_SCL, pConvertedSubject != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
- int errorCode = CALENDAR_ERROR_NONE;
- errorCode = calendar_record_set_str(__todoRecord.GetHandle(), _calendar_todo.summary, pConvertedSubject.get());
+ int errorCode = calendar_record_set_str(__todoRecord.GetHandle(), _calendar_todo.summary, pConvertedSubject.get());
SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
return E_SUCCESS;
std::unique_ptr<char[]> pConvertedDescription(_StringConverter::CopyToCharArrayN(description));
SysTryReturnResult(NID_SCL, pConvertedDescription != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
- int errorCode = CALENDAR_ERROR_NONE;
- errorCode = calendar_record_set_str(__todoRecord.GetHandle(), _calendar_todo.description, pConvertedDescription.get());
+ int errorCode = calendar_record_set_str(__todoRecord.GetHandle(), _calendar_todo.description, pConvertedDescription.get());
SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
return E_SUCCESS;
}
else if (startDate < _CalendarbookImpl::GetMinDateTime() || startDate > _CalendarbookImpl::GetMaxDateTime())
{
- SysLogException(NID_SCL, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used. The startDate is invalid.");
+ SysLogException(NID_SCL, E_INVALID_ARG, "[%s] Invalid argument is used. The startDate is invalid.", GetErrorMessage(E_INVALID_ARG));
return E_INVALID_ARG;
}
else
}
else if (dueDate < _CalendarbookImpl::GetMinDateTime() || dueDate > _CalendarbookImpl::GetMaxDateTime())
{
- SysLogException(NID_SCL, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used. The dueDate is invalid.");
+ SysLogException(NID_SCL, E_INVALID_ARG, "[%s] Invalid argument is used. The dueDate is invalid.", GetErrorMessage(E_INVALID_ARG));
return E_INVALID_ARG;
}
else
_CalTodoImpl::SetLocation(const String& location)
{
std::unique_ptr<char[]> pConvertedLocation(_StringConverter::CopyToCharArrayN(location));
- SysTryReturnVoidResult(NID_SCL, pConvertedLocation != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturnVoidResult(NID_SCL, pConvertedLocation != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
- int errorCode = CALENDAR_ERROR_NONE;
- errorCode = calendar_record_set_str(__todoRecord.GetHandle(), _calendar_todo.location, pConvertedLocation.get());
- SysTryReturnVoidResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ int errorCode = calendar_record_set_str(__todoRecord.GetHandle(), _calendar_todo.location, pConvertedLocation.get());
+ SysTryReturnVoidResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
}
String
result
_CalTodoImpl::AddReminder(const Reminder& reminder)
{
- int errorCode = CALENDAR_ERROR_NONE;
calendar_record_h tmpAlarmHandle = null;
std::unique_ptr<char[]> pTmpAlarmTone(_StringConverter::CopyToCharArrayN(reminder.GetSoundFile()));
SysTryReturnResult(NID_SCL, pTmpAlarmTone != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
- errorCode = calendar_record_create(_calendar_alarm._uri, &tmpAlarmHandle);
+ int errorCode = calendar_record_create(_calendar_alarm._uri, &tmpAlarmHandle);
SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
int convertedTimeUnit = 0;
case REMINDER_TIME_UNIT_MINUTE:
convertedTimeUnit = CALENDAR_ALARM_TIME_UNIT_MINUTE;
break;
+
case REMINDER_TIME_UNIT_HOUR:
convertedTimeUnit = CALENDAR_ALARM_TIME_UNIT_HOUR;
break;
+
case REMINDER_TIME_UNIT_DAY:
convertedTimeUnit = CALENDAR_ALARM_TIME_UNIT_DAY;
break;
+
case REMINDER_TIME_UNIT_WEEK:
convertedTimeUnit = CALENDAR_ALARM_TIME_UNIT_WEEK;
break;
+
case REMINDER_TIME_UNIT_NONE:
convertedTimeUnit = CALENDAR_ALARM_TIME_UNIT_SPECIFIC;
break;
+
default:
break;
}
result
_CalTodoImpl::RemoveReminderAt(int index)
{
- int errorCode = CALENDAR_ERROR_NONE;
calendar_record_h tmpAlarmHandle = null;
- errorCode = calendar_record_get_child_record_at_p(__todoRecord.GetHandle(), _calendar_todo.calendar_alarm, index, &tmpAlarmHandle);
+ calendar_record_get_child_record_at_p(__todoRecord.GetHandle(), _calendar_todo.calendar_alarm, index, &tmpAlarmHandle);
SysTryReturnResult(NID_SCL, tmpAlarmHandle != null, E_OUT_OF_RANGE, "The index is either equal to or greater than the number of reminders or less than 0.");
calendar_record_remove_child_record(__todoRecord.GetHandle(), _calendar_todo.calendar_alarm, tmpAlarmHandle);
if (__reminderListUpdated == false)
{
result r = _CalendarbookUtil::ConvertTodoAlarmsToReminderList(__todoRecord.GetHandle(), __reminderList);
- SysTryReturn(NID_SCL, r == E_SUCCESS, __reminderList, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturn(NID_SCL, r == E_SUCCESS, __reminderList, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
__reminderListUpdated = true;
}
return todo.__pCalTodoImpl;
}
-}} //OSP::Social
+}} // Tizen::Social
*
*/
-#include <FBaseRtIEventListener.h>
#include <FBaseRtIEventArg.h>
+#include <FBaseRtIEventListener.h>
#include <FBaseSysLog.h>
-#include "FScl_ICalendarbookDbChangeEventListener.h"
-#include "FScl_CalendarbookDbChangeEventArg.h"
#include "FScl_CalendarbookDbChangeEvent.h"
+#include "FScl_CalendarbookDbChangeEventArg.h"
+#include "FScl_ICalendarbookDbChangeEventListener.h"
using namespace Tizen::Base;
using namespace Tizen::Base::Runtime;
#ifndef _FSCL_INTERNAL_CALENDARBOOK_DB_CHANGE_EVENT_H_
#define _FSCL_INTERNAL_CALENDARBOOK_DB_CHANGE_EVENT_H_
-#include <FBaseTypes.h>
#include <FBaseResult.h>
+#include <FBaseTypes.h>
#include <FBaseRt_Event.h>
namespace Tizen { namespace Base { namespace Runtime
#define _FSCL_INTERNAL_CALENDARBOOK_DB_CHANGE_EVENT_ARG_H_
#include <FBaseObject.h>
-#include <FSclRecord.h>
#include <FBaseRtIEventArg.h>
+#include <FSclRecord.h>
namespace Tizen { namespace Social
{
if (GetLastResult() != E_SUCCESS)
{
onceBlock = PTHREAD_ONCE_INIT;
- SysLogException(NID_SCL, E_SYSTEM, "[E_SYSTEM] A system error has been occurred.");
+ SysLogException(NID_SCL, E_SYSTEM, "[%s] A system error has been occurred.", GetErrorMessage(E_SYSTEM));
return E_SYSTEM;
}
System::SystemTime::GetTicks(endTicks);
- SysTryCatch(NID_SCL, errorCode == CALENDAR_ERROR_NONE, , E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Elapsed time : %lld (milliseconds)", endTicks - startTicks);
+ SysTryCatch(NID_SCL, errorCode == CALENDAR_ERROR_NONE, , E_SYSTEM, "[%s] A system error has been occurred. Elapsed time : %lld (milliseconds)", GetErrorMessage(E_SYSTEM), endTicks - startTicks);
__connectingCount = 0;
}
if (__connectingCount == 0)
{
int errorCode = calendar_disconnect();
- SysTryCatch(NID_SCL, errorCode == CALENDAR_ERROR_NONE, , E_SYSTEM, "[E_SYSTEM] A system error has been occurred.");
+ SysTryCatch(NID_SCL, errorCode == CALENDAR_ERROR_NONE, , E_SYSTEM, "[%s] A system error has been occurred.", GetErrorMessage(E_SYSTEM));
}
r = __mutex.Release();
_CalendarbookDbConnector::InitCalendarbookDbConnector(void)
{
result r = __mutex.Create();
- SysTryReturnVoidResult(NID_SCL, r == E_SUCCESS, E_SYSTEM, "[E_SYSTEM] A system error has been occurred.");
+ SysTryReturnVoidResult(NID_SCL, r == E_SUCCESS, E_SYSTEM, "[%s] A system error has been occurred.", GetErrorMessage(E_SYSTEM));
}
}} // Tizen::Social
_CalendarbookDbMonitor::~_CalendarbookDbMonitor(void)
{
result r = _CalendarbookDbConnector::Disconnect();
- SysTryReturnVoidResult(NID_SCL, r == E_SUCCESS, E_SYSTEM, "[E_SYSTEM] A system error has been occurred.");
+ SysTryReturnVoidResult(NID_SCL, r == E_SUCCESS, E_SYSTEM, "[%s] A system error has been occurred.", GetErrorMessage(E_SYSTEM));
}
result
SysTryReturnResult(NID_SCL, r == E_SUCCESS, E_SYSTEM, "A system error has been occurred.");
std::unique_ptr<_CalendarbookDbChangeEvent> pEvent(new (std::nothrow) _CalendarbookDbChangeEvent());
- SysTryReturn(NID_SCL, pEvent != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturn(NID_SCL, pEvent != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
r = pEvent->Construct();
SysTryReturn(NID_SCL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
if (GetLastResult() != E_SUCCESS)
{
onceBlock = PTHREAD_ONCE_INIT;
- SysLogException(NID_SCL, E_SYSTEM, "[E_SYSTEM] A system error has been occurred.");
+ SysLogException(NID_SCL, E_SYSTEM, "[%s] A system error has been occurred.", GetErrorMessage(E_SYSTEM));
return null;
}
pCalendarbookDbMonitor.reset(new (std::nothrow) _CalendarbookDbMonitor());
- SysTryReturn(NID_SCL, pCalendarbookDbMonitor != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturn(NID_SCL, pCalendarbookDbMonitor != null, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
r = pCalendarbookDbMonitor->Construct();
SysTryReturn(NID_SCL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
}
r = __mutex.Acquire();
- SysTryReturn(NID_SCL, r == E_SUCCESS, null, E_SYSTEM, "[E_SYSTEM] A system error has been occurred.");
+ SysTryReturn(NID_SCL, r == E_SUCCESS, null, E_SYSTEM, "[%s] A system error has been occurred.", GetErrorMessage(E_SYSTEM));
if (pCalendarbookDbMonitor != null)
{
__refCnt++;
r = __mutex.Release();
- SysTryReturn(NID_SCL, r == E_SUCCESS, null, E_SYSTEM, "[E_SYSTEM] A system error has been occurred.");
+ SysTryReturn(NID_SCL, r == E_SUCCESS, null, E_SYSTEM, "[%s] A system error has been occurred.", GetErrorMessage(E_SYSTEM));
return __pCalendarbookDbMonitor;
}
_CalendarbookDbMonitor::Release(void)
{
result r = __mutex.Acquire();
- SysTryReturnVoidResult(NID_SCL, r == E_SUCCESS, E_SYSTEM, "[E_SYSTEM] A system error has been occurred.");
+ SysTryReturnVoidResult(NID_SCL, r == E_SUCCESS, E_SYSTEM, "[%s] A system error has been occurred.", GetErrorMessage(E_SYSTEM));
__refCnt--;
}
r = __mutex.Release();
- SysTryReturnVoidResult(NID_SCL, r == E_SUCCESS, E_SYSTEM, "[E_SYSTEM] A system error has been occurred.");
+ SysTryReturnVoidResult(NID_SCL, r == E_SUCCESS, E_SYSTEM, "[%s] A system error has been occurred.", GetErrorMessage(E_SYSTEM));
}
void
}
std::unique_ptr<_CalendarbookDbChangeEventArg> pArg(new (std::nothrow) _CalendarbookDbChangeEventArg(changeType));
- SysTryReturnVoidResult(NID_SCL, pArg != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturnVoidResult(NID_SCL, pArg != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
result r = pEvent->Fire(*pArg.get());
SysTryReturnVoidResult(NID_SCL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
_CalendarbookDbMonitor::InitCalendarbookDbMonitor(void)
{
result r = __mutex.Create();
- SysTryReturnVoidResult(NID_SCL, r == E_SUCCESS, E_SYSTEM, "[E_SYSTEM] A system error has been occurred.");
+ SysTryReturnVoidResult(NID_SCL, r == E_SUCCESS, E_SYSTEM, "[%s] A system error has been occurred.", GetErrorMessage(E_SYSTEM));
}
}} // Tizen::Social
#define _FSCL_INTERNAL_CALENDARBOOK_DB_MONITOR_H_
#include <unique_ptr.h>
-#include <FBaseTypes.h>
-#include <FBaseResult.h>
#include <FBaseObject.h>
+#include <FBaseResult.h>
+#include <FBaseTypes.h>
namespace Tizen { namespace Base { namespace Runtime
{
case FI_CMP_OP_EQUAL:
match = CALENDAR_MATCH_EQUAL;
break;
+
case FI_CMP_OP_LESS_THAN:
match = CALENDAR_MATCH_LESS_THAN;
break;
+
case FI_CMP_OP_LESS_THAN_OR_EQUAL:
match = CALENDAR_MATCH_LESS_THAN_OR_EQUAL;
break;
+
case FI_CMP_OP_GREATER_THAN:
match = CALENDAR_MATCH_GREATER_THAN;
break;
+
case FI_CMP_OP_GREATER_THAN_OR_EQUAL:
match = CALENDAR_MATCH_GREATER_THAN_OR_EQUAL;
break;
+
case FI_CMP_OP_IS_NULL:
match = CALENDAR_MATCH_NONE;
break;
+
default:
match = CALENDAR_MATCH_NONE;
break;
case FI_STR_OP_EQUAL:
match = CALENDAR_MATCH_EXACTLY;
break;
+
case FI_STR_OP_FULL_STRING:
match = CALENDAR_MATCH_FULLSTRING;
break;
+
case FI_STR_OP_START_WITH:
match = CALENDAR_MATCH_STARTSWITH;
break;
+
case FI_STR_OP_END_WITH:
match = CALENDAR_MATCH_ENDSWITH;
break;
+
case FI_STR_OP_CONTAIN:
match = CALENDAR_MATCH_CONTAINS;
break;
+
case FI_STR_OP_IS_NOT_NULL:
match = CALENDAR_MATCH_EXISTS;
break;
+
default:
match = CALENDAR_MATCH_EXISTS;
break;
case EVENT_FI_PR_BUSY_STATUS:
convertedValue = _CalendarbookUtil::ConvertBusyStatusToCSEventBusyStatus(value);
break;
+
case EVENT_FI_PR_PRIORITY:
convertedValue = _CalendarbookUtil::ConvertEventPriorityToCSEventPriority(value);
break;
+
case EVENT_FI_PR_SENSITIVITY:
convertedValue = _CalendarbookUtil::ConvertSensitivityToCSSensitivity(value);
break;
+
case EVENT_FI_PR_STATUS:
convertedValue = _CalendarbookUtil::ConvertEventStatusToCSEventStatus(value);
break;
+
case TODO_FI_PR_PRIORITY:
convertedValue = _CalendarbookUtil::ConvertTodoPriorityToCSTodoPriority(value);
break;
+
case TODO_FI_PR_SENSITIVITY:
convertedValue = _CalendarbookUtil::ConvertSensitivityToCSSensitivity(value);
break;
+
case TODO_FI_PR_STATUS:
convertedValue = _CalendarbookUtil::ConvertTodoStatusToCSTodoStatus(value);
break;
+
case CALENDAR_FI_PR_ITEM_TYPE:
convertedValue = _CalendarbookUtil::ConvertCalendarItemTypeToCSCalendarbookType(value);
break;
+
case EVENT_INST_FI_PR_BUSY_STATUS:
convertedValue = _CalendarbookUtil::ConvertBusyStatusToCSEventBusyStatus(value);
break;
+
case EVENT_INST_FI_PR_PRIORITY:
convertedValue = _CalendarbookUtil::ConvertEventPriorityToCSEventPriority(value);
break;
+
case EVENT_INST_FI_PR_SENSITIVITY:
convertedValue = _CalendarbookUtil::ConvertSensitivityToCSSensitivity(value);
break;
+
case EVENT_INST_FI_PR_STATUS:
convertedValue = _CalendarbookUtil::ConvertEventStatusToCSEventStatus(value);
break;
+
default:
convertedValue = value;
break;
#define _FSCL_CALENDARBOOK_FILTER_IMPL_H_
#include <calendar2.h>
+#include <FBaseObject.h>
#include <FBaseTypes.h>
#include <FSclTypes.h>
-#include <FBaseObject.h>
namespace Tizen { namespace Base
{
* This file contains definitions of @e _CalendarbookRecordRetrivalEvent class.
*/
-#include <FSclIRecordListener.h>
#include <FBaseSysLog.h>
-#include "FScl_CalendarbookRecordRetrivalEventArg.h"
+#include <FSclIRecordListener.h>
#include "FScl_CalendarbookRecordRetrivalEvent.h"
+#include "FScl_CalendarbookRecordRetrivalEventArg.h"
using namespace Tizen::Base;
using namespace Tizen::Base::Runtime;
#ifndef _FSCL_INTERNAL_CALENDARBOOK_RECORD_RETRIVAL_EVENT_H_
#define _FSCL_INTERNAL_CALENDARBOOK_RECORD_RETRIVAL_EVENT_H_
-#include <FBaseTypes.h>
#include <FBaseResult.h>
+#include <FBaseTypes.h>
#include <FBaseRt_Event.h>
namespace Tizen { namespace Base { namespace Runtime
#ifndef _FSCL_INTERNAL_CALENDARBOOK_RECORD_RETRIVAL_EVENT_ARG_H_
#define _FSCL_INTERNAL_CALENDARBOOK_RECORD_RETRIVAL_EVENT_ARG_H_
-#include <FBaseObject.h>
#include <FBaseDataType.h>
+#include <FBaseObject.h>
#include <FBaseRtIEventArg.h>
namespace Tizen { namespace Base { namespace Collection
*
*/
+#include <FBaseColAllElementsDeleter.h>
#include <FBaseColIList.h>
#include <FBaseSysLog.h>
-#include <FBaseColAllElementsDeleter.h>
#include "FScl_CalendarbookImpl.h"
#include "FScl_CalendarbookRecordRetrivalEvent.h"
#include "FScl_CalendarbookRecordRetrivalEventArg.h"
SysTryReturn(NID_SCL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
r = _CalendarbookDbConnector::Connect();
- SysTryReturn(NID_SCL, r == E_SUCCESS, null, E_SYSTEM, "[E_SYSTEM] A system error has been occurred.");
+ SysTryReturn(NID_SCL, r == E_SUCCESS, null, E_SYSTEM, "[%s] A system error has been occurred.", GetErrorMessage(E_SYSTEM));
pList.reset(calendarbookImpl.GetEventInstancesCommonN(__start, __end, __timeZone, __pageNo, __countPerPage, __category));
r = GetLastResult();
SysTryCatch(NID_SCL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
pEventArg.reset(new (std::nothrow) _CalendarbookRecordRetrivalEventArg(__requestId, pList.get(), r));
- SysTryCatch(NID_SCL, pEventArg != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryCatch(NID_SCL, pEventArg != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
pList.release();
r = _CalendarbookDbConnector::Disconnect();
- SysTryCatch(NID_SCL, r == E_SUCCESS, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred.");
+ SysTryCatch(NID_SCL, r == E_SUCCESS, r = E_SYSTEM, E_SYSTEM, "[%s] A system error has been occurred.", GetErrorMessage(E_SYSTEM));
r = __pEvent->Fire(*pEventArg.get());
SysTryCatch(NID_SCL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
#define _FSCL_INTERNAL_CALENDARBOOK_RECORD_RETRIVAL_THREAD_H_
#include <unique_ptr.h>
-#include <FBaseTypes.h>
+#include <FBaseDateTime.h>
#include <FBaseDataType.h>
#include <FBaseObject.h>
-#include <FBaseDateTime.h>
#include <FBaseRtThread.h>
+#include <FBaseTypes.h>
#include <FLclTimeZone.h>
namespace Tizen { namespace Social
#include <new>
#include <string.h>
#include <unique_ptr.h>
-#include <FBaseResult.h>
-#include <FBaseDateTime.h>
#include <FBaseColIList.h>
+#include <FBaseDateTime.h>
+#include <FBaseResult.h>
+#include <FBaseSysLog.h>
#include <FBaseUtilStringUtil.h>
-#include <FLclTimeZone.h>
#include <FLclGregorianCalendar.h>
+#include <FLclTimeZone.h>
#include <FSclReminder.h>
-#include <FBaseSysLog.h>
-#include <FBase_StringConverter.h>
#include <FApp_AppInfo.h>
+#include <FBase_StringConverter.h>
#include "FScl_CalendarbookImpl.h"
#include "FScl_CalendarbookUtil.h"
using namespace Tizen::Base;
-using namespace Tizen::Base::Utility;
using namespace Tizen::Base::Collection;
+using namespace Tizen::Base::Utility;
namespace Tizen { namespace Social
{
static const byte _CALENDARBOOK_BYTE_VALUE_9 = 0x09;
-static const int CALENDARBOOK_DEC_ASCII_MASK = 0x30;
-static const int CALENDARBOOK_CHAR_ASCII_DIFF = 55;
+static const int _CALENDARBOOK_DEC_ASCII_MASK = 0x30;
+static const int _CALENDARBOOK_CHAR_ASCII_DIFF = 55;
static const int _CALENDARBOOK_MSEC_UNIT = 1000;
static const long long _CALENDARBOOK_EPOCH_YEAR_INTERVAL_SECONDS = 62135596800;
static const int _CALENDARBOOK_TIME_SECOND_STRING_LENGTH = 2;
static const wchar_t* _CALENDARBOOK_ZERO_STRING = L"0";
+static const int _INVALID_MAX_DAYS_OF_MONTH = 0;
+
long long int
_CalendarbookUtil::ConvertDateTimeToEpochTime(const DateTime& dateTime)
{
{
int byteBufferLength = byteBuffer.GetCapacity();
char* pCharArray = new (std::nothrow) char[byteBufferLength * 2 + 1];
- SysTryReturn(NID_SCL, pCharArray != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturn(NID_SCL, pCharArray != null, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
const byte* pByteBufferPtr = byteBuffer.GetPointer();
if (tmpByte <= _CALENDARBOOK_BYTE_VALUE_9)
{
- pCharArray[i * 2] = tmpByte | CALENDARBOOK_DEC_ASCII_MASK;
+ pCharArray[i * 2] = tmpByte | _CALENDARBOOK_DEC_ASCII_MASK;
}
else
{
- pCharArray[i * 2] = tmpByte + CALENDARBOOK_CHAR_ASCII_DIFF;
+ pCharArray[i * 2] = tmpByte + _CALENDARBOOK_CHAR_ASCII_DIFF;
}
tmpByte = pByteBufferPtr[i] & 0x0F;
if (tmpByte <= _CALENDARBOOK_BYTE_VALUE_9)
{
- pCharArray[i * 2 + 1] = tmpByte | CALENDARBOOK_DEC_ASCII_MASK;
+ pCharArray[i * 2 + 1] = tmpByte | _CALENDARBOOK_DEC_ASCII_MASK;
}
else
{
- pCharArray[i * 2 + 1] = tmpByte + CALENDARBOOK_CHAR_ASCII_DIFF;
+ pCharArray[i * 2 + 1] = tmpByte + _CALENDARBOOK_CHAR_ASCII_DIFF;
}
}
_CalendarbookUtil::ConvertCharArrayToByteBufferN(const char* pCharArray)
{
int charArrayLength = strlen(pCharArray);
- SysTryReturn(NID_SCL, charArrayLength > 0, null, E_SYSTEM, "[E_SYSTEM] A system error has been occurred.");
+ SysTryReturn(NID_SCL, charArrayLength > 0, null, E_SYSTEM, "[%s] A system error has been occurred.", GetErrorMessage(E_SYSTEM));
int byteBufferLength = 0;
std::unique_ptr<byte[]> pByteArray(new (std::nothrow) byte[charArrayLength/2]);
- SysTryReturn(NID_SCL, pByteArray != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturn(NID_SCL, pByteArray != null, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
bool inProgress = false;
char tmpChar = 0;
}
else if (tmpChar >= 'A' && tmpChar <= 'F')
{
- tmpChar -= CALENDARBOOK_CHAR_ASCII_DIFF;
+ tmpChar -= _CALENDARBOOK_CHAR_ASCII_DIFF;
}
else
{
result r = E_SUCCESS;
std::unique_ptr<ByteBuffer> pByteBuffer(new (std::nothrow) ByteBuffer());
- SysTryReturn(NID_SCL, pByteBuffer != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturn(NID_SCL, pByteBuffer != null, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
r = pByteBuffer->Construct(byteBufferLength);
- SysTryReturn(NID_SCL, r == E_SUCCESS, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturn(NID_SCL, r == E_SUCCESS, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
r = pByteBuffer->SetArray(pByteArray.get(), 0, byteBufferLength);
pByteBuffer->Rewind();
case CALENDAR_ALARM_TIME_UNIT_MINUTE:
pReminder->SetTimeOffset(REMINDER_TIME_UNIT_MINUTE, tmpAlarmTick);
break;
+
case CALENDAR_ALARM_TIME_UNIT_HOUR:
pReminder->SetTimeOffset(REMINDER_TIME_UNIT_HOUR, tmpAlarmTick);
break;
+
case CALENDAR_ALARM_TIME_UNIT_DAY:
pReminder->SetTimeOffset(REMINDER_TIME_UNIT_DAY, tmpAlarmTick);
break;
+
case CALENDAR_ALARM_TIME_UNIT_WEEK:
pReminder->SetTimeOffset(REMINDER_TIME_UNIT_WEEK, tmpAlarmTick);
break;
+
case CALENDAR_ALARM_TIME_UNIT_MONTH:
{
calendar_time_s startCalendarTime;
pReminder->SetTimeOffset(REMINDER_TIME_UNIT_DAY, tmpAlarmTick * maxDays);
}
break;
+
case CALENDAR_ALARM_TIME_UNIT_SPECIFIC:
if (Tizen::App::_AppInfo::GetApiVersion() > _API_VERSION_2_0)
{
pReminder->SetAbsoluteTime(_CalendarbookUtil::ConvertEpochTimeToDateTime(tmpAlarmTime));
}
break;
+
default :
break;
}
- reminderList.Add(*pReminder.release());
+ result r = reminderList.Add(pReminder.get());
+ SysTryReturnResult(NID_SCL, !IsFailed(r), r, "Propagating.");
+
+ pReminder.release();
}
return E_SUCCESS;
case CALENDAR_ALARM_TIME_UNIT_MINUTE:
pReminder->SetTimeOffset(REMINDER_TIME_UNIT_MINUTE, tmpAlarmTick);
break;
+
case CALENDAR_ALARM_TIME_UNIT_HOUR:
pReminder->SetTimeOffset(REMINDER_TIME_UNIT_HOUR, tmpAlarmTick);
break;
+
case CALENDAR_ALARM_TIME_UNIT_DAY:
pReminder->SetTimeOffset(REMINDER_TIME_UNIT_DAY, tmpAlarmTick);
break;
+
case CALENDAR_ALARM_TIME_UNIT_WEEK:
pReminder->SetTimeOffset(REMINDER_TIME_UNIT_WEEK, tmpAlarmTick);
break;
+
case CALENDAR_ALARM_TIME_UNIT_MONTH:
{
calendar_time_s startCalendarTime;
pReminder->SetTimeOffset(REMINDER_TIME_UNIT_DAY, tmpAlarmTick * maxDays);
}
break;
+
case CALENDAR_ALARM_TIME_UNIT_SPECIFIC:
if (Tizen::App::_AppInfo::GetApiVersion() > _API_VERSION_2_0)
{
pReminder->SetAbsoluteTime(_CalendarbookUtil::ConvertEpochTimeToDateTime(tmpAlarmTime));
}
break;
+
default :
break;
}
- reminderList.Add(*pReminder.release());
+ result r = reminderList.Add(pReminder.get());
+ SysTryReturnResult(NID_SCL, !IsFailed(r), r, "Propagating.");
+
+ pReminder.release();
}
return E_SUCCESS;
}
else
{
- SysLogException(NID_SCL, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used. date time string = %S", dateTimeString.GetPointer());
+ SysLogException(NID_SCL, E_INVALID_ARG, "[%s] Invalid argument is used. date time string = %S", GetErrorMessage(E_INVALID_ARG), dateTimeString.GetPointer());
return E_INVALID_ARG;
}
case EVENT_STATUS_NONE:
convertedEventStatus = CALENDAR_EVENT_STATUS_NONE;
break;
+
case EVENT_STATUS_TENTATIVE:
convertedEventStatus = CALENDAR_EVENT_STATUS_TENTATIVE;
break;
+
case EVENT_STATUS_CONFIRMED:
convertedEventStatus = CALENDAR_EVENT_STATUS_CONFIRMED;
break;
+
case EVENT_STATUS_CANCELLED:
convertedEventStatus = CALENDAR_EVENT_STATUS_CANCELLED;
break;
+
default :
- SysLogException(NID_SCL, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used. status = %d", status);
+ SysLogException(NID_SCL, E_INVALID_ARG, "[%s] Invalid argument is used. status = %d", GetErrorMessage(E_INVALID_ARG), status);
convertedEventStatus = CALENDAR_EVENT_STATUS_NONE;
break;
}
case BUSY_STATUS_FREE:
convertedBusyStatus = CALENDAR_EVENT_BUSY_STATUS_FREE;
break;
+
case BUSY_STATUS_BUSY:
convertedBusyStatus = CALENDAR_EVENT_BUSY_STATUS_BUSY;
break;
+
case BUSY_STATUS_UNAVAILABLE:
convertedBusyStatus = CALENDAR_EVENT_BUSY_STATUS_UNAVAILABLE;
break;
+
case BUSY_STATUS_TENTATIVE:
convertedBusyStatus = CALENDAR_EVENT_BUSY_STATUS_TENTATIVE;
break;
+
default :
- SysLogException(NID_SCL, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used. busyStatus = %d", busyStatus);
+ SysLogException(NID_SCL, E_INVALID_ARG, "[%s] Invalid argument is used. busyStatus = %d", GetErrorMessage(E_INVALID_ARG), busyStatus);
convertedBusyStatus = CALENDAR_EVENT_BUSY_STATUS_FREE;
break;
}
case EVENT_PRIORITY_LOW:
convertedPriority = CALENDAR_EVENT_PRIORITY_LOW;
break;
+
case EVENT_PRIORITY_NORMAL:
convertedPriority = CALENDAR_EVENT_PRIORITY_NORMAL;
break;
+
case EVENT_PRIORITY_HIGH:
convertedPriority = CALENDAR_EVENT_PRIORITY_HIGH;
break;
+
default :
- SysLogException(NID_SCL, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used. priority = %d", priority);
+ SysLogException(NID_SCL, E_INVALID_ARG, "[%s] Invalid argument is used. priority = %d", GetErrorMessage(E_INVALID_ARG), priority);
convertedPriority = CALENDAR_EVENT_PRIORITY_NORMAL;
break;
}
case SENSITIVITY_PUBLIC:
convertedSensitivity = CALENDAR_SENSITIVITY_PUBLIC;
break;
+
case SENSITIVITY_PRIVATE:
convertedSensitivity = CALENDAR_SENSITIVITY_PRIVATE;
break;
+
case SENSITIVITY_CONFIDENTIAL:
convertedSensitivity = CALENDAR_SENSITIVITY_CONFIDENTIAL;
break;
+
default :
- SysLogException(NID_SCL, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used. sensitivity = %d", sensitivity);
+ SysLogException(NID_SCL, E_INVALID_ARG, "[%s] Invalid argument is used. sensitivity = %d", GetErrorMessage(E_INVALID_ARG), sensitivity);
convertedSensitivity = CALENDAR_SENSITIVITY_PUBLIC;
break;
}
case TODO_STATUS_NONE:
convertedTodoStatus = CALENDAR_TODO_STATUS_NONE;
break;
+
case TODO_STATUS_NEEDS_ACTION:
convertedTodoStatus = CALENDAR_TODO_STATUS_NEEDS_ACTION;
break;
+
case TODO_STATUS_COMPLETED:
convertedTodoStatus = CALENDAR_TODO_STATUS_COMPLETED;
break;
+
case TODO_STATUS_IN_PROCESS:
convertedTodoStatus = CALENDAR_TODO_STATUS_IN_PROCESS;
break;
+
case TODO_STATUS_CANCELLED:
convertedTodoStatus = CALENDAR_TODO_STATUS_CANCELED;
break;
+
default :
- SysLogException(NID_SCL, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used. status = %d", status);
+ SysLogException(NID_SCL, E_INVALID_ARG, "[%s] Invalid argument is used. status = %d", GetErrorMessage(E_INVALID_ARG), status);
convertedTodoStatus = CALENDAR_TODO_STATUS_NONE;
break;
}
case TODO_PRIORITY_LOW:
convertedPriority = CALENDAR_TODO_PRIORITY_LOW;
break;
+
case TODO_PRIORITY_NORMAL:
convertedPriority = CALENDAR_TODO_PRIORITY_NORMAL;
break;
+
case TODO_PRIORITY_HIGH:
convertedPriority = CALENDAR_TODO_PRIORITY_HIGH;
break;
+
default :
- SysLogException(NID_SCL, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used. priority = %d", priority);
+ SysLogException(NID_SCL, E_INVALID_ARG, "[%s] Invalid argument is used. priority = %d", GetErrorMessage(E_INVALID_ARG), priority);
convertedPriority = CALENDAR_TODO_PRIORITY_NONE;
break;
}
case CALENDAR_ITEM_TYPE_EVENT_ONLY:
storeType = CALENDAR_BOOK_TYPE_EVENT;
break;
+
case CALENDAR_ITEM_TYPE_TODO_ONLY:
storeType = CALENDAR_BOOK_TYPE_TODO;
break;
+
case CALENDAR_ITEM_TYPE_EVENT_AND_TODO:
storeType = CALENDAR_BOOK_TYPE_EVENT | CALENDAR_BOOK_TYPE_TODO;
break;
+
default :
storeType = CALENDAR_BOOK_TYPE_EVENT | CALENDAR_BOOK_TYPE_TODO;
break;
while (strTok.HasMoreTokens())
{
r = strTok.GetNextToken(token);
- SysTryReturn(NID_SCL, r == E_SUCCESS, EVENT_CATEGORY_APPOINTMENT, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturn(NID_SCL, r == E_SUCCESS, EVENT_CATEGORY_APPOINTMENT, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
if (token == _EVENT_CATEGORY_APPOINTMENT_STRING)
{
eventCategory = EVENT_CATEGORY_APPOINTMENT;
int
_CalendarbookUtil::GetMaxDaysOfMonth(int year, int month)
{
+ ClearLastResult();
+
int maxDaysOfMonth = 0;
- Tizen::Locales::Calendar* pGregorianCalendar = Tizen::Locales::Calendar::CreateInstanceN(Tizen::Locales::CALENDAR_GREGORIAN);
+
+ std::unique_ptr<Tizen::Locales::Calendar> pGregorianCalendar(Tizen::Locales::Calendar::CreateInstanceN(Tizen::Locales::CALENDAR_GREGORIAN));
+ SysTryReturn(NID_SCL, pGregorianCalendar != null, _INVALID_MAX_DAYS_OF_MONTH, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
pGregorianCalendar->SetTimeField(Tizen::Locales::TIME_FIELD_YEAR, year);
pGregorianCalendar->SetTimeField(Tizen::Locales::TIME_FIELD_MONTH, month);
maxDaysOfMonth = pGregorianCalendar->GetActualMaxTimeField(Tizen::Locales::TIME_FIELD_DAY_OF_MONTH);
- delete pGregorianCalendar;
-
return maxDaysOfMonth;
}
*/
#include <new>
-#include <FBaseColIList.h>
+#include <FApp_AppInfo.h>
#include <FBaseColArrayList.h>
+#include <FBaseColIList.h>
#include <FBaseDateTime.h>
-#include <FSclRecurrence.h>
#include <FBaseSysLog.h>
-#include <FApp_AppInfo.h>
-#include "FScl_RecurrenceImpl.h"
+#include <FSclRecurrence.h>
#include "FScl_CalendarbookImpl.h"
#include "FScl_CalendarbookUtil.h"
+#include "FScl_RecurrenceImpl.h"
+using namespace Tizen::App;
using namespace Tizen::Base;
using namespace Tizen::Base::Collection;
-using namespace Tizen::App;
namespace Tizen { namespace Social
{
, __monthOfYear(0)
{
std::unique_ptr<ArrayList, AllElementsDeleter> pExceptionDates(new (std::nothrow) ArrayList());
- SysTryReturnVoidResult(NID_SCL, pExceptionDates, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturnVoidResult(NID_SCL, pExceptionDates, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
result r = pExceptionDates->Construct();
SysTryReturnVoidResult(NID_SCL, !IsFailed(r), r, "[%s] Propagating.", GetErrorMessage(r));
, __monthOfYear(rhs.__monthOfYear)
, __pExceptionDates(null)
{
- std::unique_ptr<Tizen::Base::DateTime> pUntil;
+ std::unique_ptr<DateTime> pUntil;
if (rhs.__pUntil != null)
{
- pUntil = std::unique_ptr<Tizen::Base::DateTime>(new (std::nothrow) DateTime(*rhs.__pUntil));
- SysTryReturnVoidResult(NID_SCL, pUntil != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ pUntil = std::unique_ptr<DateTime>(new (std::nothrow) DateTime(*rhs.__pUntil));
+ SysTryReturnVoidResult(NID_SCL, pUntil != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
}
std::unique_ptr<ArrayList, AllElementsDeleter> pExceptionDates(new (std::nothrow) ArrayList());
- SysTryReturnVoidResult(NID_SCL, pExceptionDates, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturnVoidResult(NID_SCL, pExceptionDates, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
result r = pExceptionDates->Construct();
SysTryReturnVoidResult(NID_SCL, !IsFailed(r), r, "[%s] Propagating.", GetErrorMessage(r));
return *this;
}
- std::unique_ptr<Tizen::Base::DateTime> pUntil;
+ std::unique_ptr<DateTime> pUntil;
__type = rhs.__type;
__interval = rhs.__interval;
if (rhs.__pUntil != null)
{
pUntil.reset(new (std::nothrow) DateTime(*(rhs.__pUntil)));
- SysTryReturn(NID_SCL, pUntil != null, *this, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturn(NID_SCL, pUntil != null, *this, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
}
if (__pExceptionDates != null && rhs.__pExceptionDates != null)
while (pEnum->MoveNext() == E_SUCCESS)
{
pTmpExDate = static_cast<DateTime*>(pEnum->GetCurrent());
- __pExceptionDates->Add(*(new (std::nothrow) DateTime(*pTmpExDate)));
+
+ if (pTmpExDate != null)
+ {
+ __pExceptionDates->Add(new (std::nothrow) DateTime(*pTmpExDate));
+ }
}
}
SysTryReturnResult(NID_SCL, !alreadyExist, E_OBJ_ALREADY_EXIST, "The exceptionDate already exists");
- DateTime* pExDate = new (std::nothrow) DateTime(exceptionDate);
+ std::unique_ptr<DateTime> pExDate(new (std::nothrow) DateTime(exceptionDate));
SysTryReturnResult(NID_SCL, pExDate != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
- __pExceptionDates->Add(*pExDate);
+ result r = __pExceptionDates->Add(pExDate.get());
+ SysTryReturnResult(NID_SCL, !IsFailed(r), E_INVALID_ARG, "Propagating.");
+
+ pExDate.release();
return E_SUCCESS;
}
ClearLastResult();
result r = E_SUCCESS;
- std::unique_ptr<Tizen::Base::Collection::ArrayList, Tizen::Base::Collection::AllElementsDeleter> pList(new (std::nothrow) ArrayList());
- SysTryReturn(NID_SCL, pList != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ std::unique_ptr<ArrayList, AllElementsDeleter> pList(new (std::nothrow) ArrayList());
+ SysTryReturn(NID_SCL, pList != null, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
r = pList->Construct();
- SysTryReturn(NID_SCL, r == E_SUCCESS, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturn(NID_SCL, r == E_SUCCESS, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
DateTime* pExDate = null;
DateTime* pTmpExDate = null;
if (pExDate)
{
pTmpExDate = new (std::nothrow) DateTime(*pExDate);
- SysTryReturn(NID_SCL, pTmpExDate != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
- pList->Add(*pTmpExDate);
+ SysTryReturn(NID_SCL, pTmpExDate != null, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+ pList->Add(pTmpExDate);
}
}
#include <FBaseSysLog.h>
#include <FBaseDateTime.h>
#include <FSclReminder.h>
-#include "FScl_ReminderImpl.h"
#include "FScl_CalendarbookUtil.h"
+#include "FScl_ReminderImpl.h"
-using namespace Tizen::Base;
using namespace Tizen::App;
+using namespace Tizen::Base;
namespace Tizen { namespace Social
{
_ReminderImpl::_ReminderImpl(void)
{
-
}
_ReminderImpl::_ReminderImpl(const _ReminderImpl& rhs)
: __absoluteTime(rhs.__absoluteTime)
, __isAbsolute(false)
{
-
}
_ReminderImpl::~_ReminderImpl(void)
#include <unique_ptr.h>
#include <calendar2.h>
-#include <FBaseDateTime.h>
#include <FBaseColAllElementsDeleter.h>
+#include <FBaseDateTime.h>
#include <FSclTypes.h>
#include "FScl_CalendarbookUtil.h"
#include <unique_ptr.h>
#include <calendar2.h>
-#include <FBaseObject.h>
#include <FBaseColAllElementsDeleter.h>
+#include <FBaseObject.h>
#include "FScl_CalendarbookUtil.h"
namespace Tizen { namespace Base
#define _FSCL_INTERNAL_RECURRENCE_IMPL_H_
#include <unique_ptr.h>
+#include <FBaseColAllElementsDeleter.h>
#include <FBaseObject.h>
#include <FSclTypes.h>
-#include <FBaseColAllElementsDeleter.h>
//#include <FScl_CalendarbookUtil.h>
namespace Tizen { namespace Base