extern const wchar_t* IDB_ICON_PHONE_CALENDAR;
//etc
+extern const wchar_t* FILE_URL_HEADER;
+
extern const wchar_t* ID_OPERATION_ADD;
-extern const wchar_t* ID_OPERATION_CONFIG;
extern const wchar_t* ID_OPERATION_MAIN;
-extern const wchar_t* ID_OPERATION_PICK;
extern const wchar_t* ID_OPERATION_VIEW;
extern const wchar_t* ID_OPERATION_SOCIAL_EDIT;
enum OperationType
{
OPERATION_TYPE_MAIN,
- OPERATION_TYPE_2_0_APPCONTROL,
OPERATION_TYPE_VIEW,
OPERATION_TYPE_PICK,
OPERATION_TYPE_EDIT,
if (pMimeType != null)
{
__mimeType = *pMimeType;
+ AppLogDebug("MimeType : %ls", __mimeType.GetPointer());
}
if (pUriData != null)
{
__uriScheme = *pUriData;
+ AppLogDebug("Uri : %ls", __uriScheme.GetPointer());
}
__requestId = reqId;
{
requestFailed = false;
}
- else if (operationId == ID_OPERATION_PICK)
- {
- const String* pItemType = GetArgument(KEY_CALENDAR_ITEM_TYPE);
- if (pItemType != null)
- {
- if (pItemType->Equals(VALUE_CALENDAR_EVENT_TYPE, false) == true)
- {
- __initialScene = IDSCN_EVENT_SELECTOR;
- __type = OPERATION_TYPE_2_0_APPCONTROL;
- requestFailed = false;
- }
- else if (pItemType->Equals(VALUE_CALENDAR_TODO_TYPE, false) == true)
- {
- __initialScene = IDSCN_TASK_SELECTOR;
- __type = OPERATION_TYPE_2_0_APPCONTROL;
- requestFailed = false;
- }
- }
- }
else if (operationId == ID_OPERATION_VIEW)
{
- const String* pViewType = GetArgument(KEY_CALENDAR_VIEW_TYPE);
- if (pViewType != null)
+ if (__mimeType == MIME_TYPE_VCALENDAR && __uriScheme.StartsWith(FILE_URL_HEADER, 0) == true)
{
- if (pViewType->Equals(VALUE_CALENDAR_EVENT_TYPE, false) == true)
- {
- __initialScene = IDSCN_EVENT_DETAILS;
- __type = OPERATION_TYPE_2_0_APPCONTROL;
- requestFailed = false;
- }
- else if (pViewType->Equals(VALUE_CALENDAR_TODO_TYPE, false) == true)
- {
- __initialScene = IDSCN_TASK_DETAILS;
- __type = OPERATION_TYPE_2_0_APPCONTROL;
- requestFailed = false;
- }
- else if (pViewType->Equals(VALUE_CALENDAR_VCS_TYPE, false) == true)
- {
- String* pPath = const_cast<String*>(GetArgument(KEY_CALENDAR_PATH));
- if (pPath != null)
- {
- VcsType vcsType = CheckVcsFileValidation(*pPath);
- if (vcsType != VCS_TYPE_NOT_VCS_FILE)
- {
- __initialScene = (vcsType == VCS_TYPE_VEVENT) ? IDSCN_EVENT_DETAILS : IDSCN_TASK_DETAILS;
- __type = OPERATION_TYPE_2_0_APPCONTROL;
- requestFailed = false;
- }
- }
- }
- }
- else if (__mimeType == MIME_TYPE_VCALENDAR)
- {
- VcsType vcsType = CheckVcsFileValidation(__uriScheme);
+ String path = __uriScheme;
+ path.Replace(FILE_URL_HEADER, L"");
+ VcsType vcsType = CheckVcsFileValidation(path);
if (vcsType != VCS_TYPE_NOT_VCS_FILE)
{
__initialScene = (vcsType == VCS_TYPE_VEVENT) ? IDSCN_EVENT_DETAILS : IDSCN_TASK_DETAILS;
__type = OPERATION_TYPE_ADD;
requestFailed = false;
}
- else if (operationId == ID_OPERATION_CONFIG)
- {
- __initialScene = IDSCN_SETTING;
- __type = OPERATION_TYPE_2_0_APPCONTROL;
- requestFailed = false;
- }
if (requestFailed == true)
{
//AppControl
result r = E_SUCCESS;
- const String* pViewType = null;
- const String* pItemType = null;
- const String* pParseId = null;
- const String* pPath = null;
RecordId eventId = INVALID_RECORD_ID;
- if (pApp->GetOperationType() == OPERATION_TYPE_2_0_APPCONTROL)
+ const String* pParseId = null;
+ const String* pItemType = pApp->GetArgument(KEY_SOCIAL_ITEM_TYPE);
+ if (pItemType != null)
{
- pViewType = pApp->GetArgument(KEY_CALENDAR_VIEW_TYPE);
- TryCatch(pViewType != null, , "[E_FAILURE] Unable to get view type.");
+ pParseId = pApp->GetArgument(KEY_SOCIAL_ITEM_ID);
+ TryCatch(pParseId != null, , "[E_FAILURE] Unable to get eventid.");
- if (pViewType->Equals(VALUE_CALENDAR_VCS_TYPE, false) == true)
- {
- pPath = pApp->GetArgument(KEY_CALENDAR_PATH);
- TryCatch(pPath != null, , "[E_FAILURE] Unable to get path.");
+ r = Integer::Parse(*pParseId, eventId);
+ TryCatch(r == E_SUCCESS, , "[%s] Unable to get eventid.", GetErrorMessage(r));
- r = __pPm->SetVcsFile(*pPath);
- TryCatch(r == E_SUCCESS, , "[E_FAILURE] Unable to parse events from vcs file.");
+ r = __pPm->SetEventId(eventId);
+ TryCatch(r == E_SUCCESS, , "[%s] Unable to get event.", GetErrorMessage(r));
- if (__pCalendarSelectorPopup == null)
- {
- __pCalendarSelectorPopup = new (std::nothrow) CalendarSelectorPopup();
- __pCalendarSelectorPopup->Initialize();
- }
-
- if (GetFooter() != null)
- {
- Footer* pFooter = GetFooter();
- pFooter->RemoveAllItems();
- pFooter->RemoveAllButtons();
- pFooter->SetStyle(FOOTER_STYLE_BUTTON_TEXT);
- pFooter->SetBackButtonEnabled(true);
- pFooter->SetBackButton();
-
- FooterItem item;
- item.Construct(IDA_EVENT_DETAILS_FORM_ADD_TO_CALENDAR);
- item.SetText(ResourceManager::GetString(IDS_EMAIL_OPT_ADD_TO_CALENDAR));
- pFooter->AddItem(item);
- }
- return;
- }
- else if (pViewType->Equals(VALUE_CALENDAR_EVENT_TYPE, false) == true)
+ if (GetFooter() != null)
{
- pParseId = pApp->GetArgument(KEY_CALENDAR_EVENT_ID);
- TryCatch(pParseId != null, , "[E_FAILURE] Unable to get eventid.");
-
- r = Integer::Parse(*pParseId, eventId);
- TryCatch(r == E_SUCCESS, , "[%s] Unable to get eventid.", GetErrorMessage(r));
-
- r = __pPm->SetEventId(eventId);
- TryCatch(r == E_SUCCESS, , "[%s] Unable to get event.", GetErrorMessage(r));
-
- if (GetFooter() != null)
- {
- GetFooter()->RemoveButtonAt(BUTTON_POSITION_LEFT);
- GetFooter()->RemoveAllItems();
- }
- return;
+ GetFooter()->RemoveButtonAt(BUTTON_POSITION_LEFT);
+ GetFooter()->RemoveAllItems();
}
+ return;
}
- else
+ else if (pApp->GetMimeType() == MIME_TYPE_VCALENDAR)
{
- pItemType = pApp->GetArgument(KEY_SOCIAL_ITEM_TYPE);
- if (pItemType != null)
- {
- pParseId = pApp->GetArgument(KEY_SOCIAL_ITEM_ID);
- TryCatch(pParseId != null, , "[E_FAILURE] Unable to get eventid.");
-
- r = Integer::Parse(*pParseId, eventId);
- TryCatch(r == E_SUCCESS, , "[%s] Unable to get eventid.", GetErrorMessage(r));
+ String path = pApp->GetUri();
+ path.Replace(FILE_URL_HEADER, L"");
+ r = __pPm->SetVcsFile(path);
+ TryCatch(r == E_SUCCESS, , "[E_FAILURE] Unable to parse events from vcs file.");
- r = __pPm->SetEventId(eventId);
- TryCatch(r == E_SUCCESS, , "[%s] Unable to get event.", GetErrorMessage(r));
-
- if (GetFooter() != null)
- {
- GetFooter()->RemoveButtonAt(BUTTON_POSITION_LEFT);
- GetFooter()->RemoveAllItems();
- }
- return;
- }
- else if (pApp->GetMimeType() == MIME_TYPE_VCALENDAR)
+ if (__pCalendarSelectorPopup == null)
{
- r = __pPm->SetVcsFile(pApp->GetUri());
- TryCatch(r == E_SUCCESS, , "[E_FAILURE] Unable to parse events from vcs file.");
-
- if (__pCalendarSelectorPopup == null)
- {
- __pCalendarSelectorPopup = new (std::nothrow) CalendarSelectorPopup();
- __pCalendarSelectorPopup->Initialize();
- }
+ __pCalendarSelectorPopup = new (std::nothrow) CalendarSelectorPopup();
+ __pCalendarSelectorPopup->Initialize();
+ }
- if (GetFooter() != null)
- {
- Footer* pFooter = GetFooter();
- pFooter->RemoveAllItems();
- pFooter->RemoveAllButtons();
- pFooter->SetStyle(FOOTER_STYLE_BUTTON_TEXT);
- pFooter->SetBackButtonEnabled(true);
- pFooter->SetBackButton();
-
- FooterItem item;
- item.Construct(IDA_EVENT_DETAILS_FORM_ADD_TO_CALENDAR);
- item.SetText(ResourceManager::GetString(IDS_EMAIL_OPT_ADD_TO_CALENDAR));
- pFooter->AddItem(item);
- }
- return;
+ if (GetFooter() != null)
+ {
+ Footer* pFooter = GetFooter();
+ pFooter->RemoveAllItems();
+ pFooter->RemoveAllButtons();
+ pFooter->SetStyle(FOOTER_STYLE_BUTTON_TEXT);
+ pFooter->SetBackButtonEnabled(true);
+ pFooter->SetBackButton();
+
+ FooterItem item;
+ item.Construct(IDA_EVENT_DETAILS_FORM_ADD_TO_CALENDAR);
+ item.SetText(ResourceManager::GetString(IDS_EMAIL_OPT_ADD_TO_CALENDAR));
+ pFooter->AddItem(item);
}
+ return;
}
AppLogDebug("[E_FAILURE] Invalid arguments.");
break;
case ADDITIONAL_CONTENT_ITEM_REPEAT:
__pLabelRepeat->SetText(__pPm->GetRecurrenceString());
- __pLabelRepeat->Invalidate(false);
+ pItem->SetEnabled(__pPm->IsAllEventEditing() == true);
+ pItem->Invalidate(true);
break;
}
break;
if (itemIndex == SAVE_TO_ITEM_SAVE_TO)
{
__pLabelSaveTo->SetText(__pPm->GetCalendarName());
- __pLabelSaveTo->Invalidate(false);
+ pItem->SetEnabled(__pPm->IsAllEventEditing() == true);
+ pItem->Invalidate(true);
}
break;
}
__pLabelRepeat = pContentLabel;
+ if (__pPm->IsAllEventEditing() == false)
+ {
+ pItem->SetEnabled(false);
+ }
+
return pItem;
}
__pLabelSaveTo = pContentLabel;
+ if (__pPm->IsAllEventEditing() == false)
+ {
+ pItem->SetEnabled(false);
+ }
+
return pItem;
}
}
CalendarApp* pApp = static_cast<CalendarApp*>(UiApp::GetInstance());
- const String* pSelectionMode = null;
const String* pItemType = null;
- if (pApp->GetOperationType() == OPERATION_TYPE_2_0_APPCONTROL)
+ const String* pSelectionMode = pApp->GetArgument(KEY_DATA_SELECTION_MODE);
+ if (pSelectionMode != null && pSelectionMode->Equals(VALUE_CALENDAR_MULTIPLE_SELECTION_MODE, false) == true)
{
- pSelectionMode = pApp->GetArgument(KEY_CALENDAR_SELECTION_MODE);
- TryCatch(pSelectionMode != null, , "[E_FAILURE] Unable to get selection mode.");
-
- pItemType = pApp->GetArgument(KEY_CALENDAR_ITEM_TYPE);
- TryCatch(pItemType != null, , "[E_FAILURE] Unable to get item type.");
- TryCatch(pItemType->Equals(VALUE_CALENDAR_EVENT_TYPE, false) == true, , "[E_FAILURE] Invalid item type.");
-
- if (pSelectionMode->Equals(VALUE_CALENDAR_MULTIPLE_SELECTION_MODE, false) == true)
- {
- __selectionType = EVENT_SELECTOR_FORM_SELECTION_TYPE_MULTIPLE;
-
- LoadAllEvents();
- __pListViewContents->UpdateList();
- return;
- }
- else if (pSelectionMode->Equals(VALUE_CALENDAR_SINGLE_SELECTION_MODE, false) == true)
- {
- __selectionType = EVENT_SELECTOR_FORM_SELECTION_TYPE_SINGLE;
- GetFooter()->RemoveAllItems();
-
- LoadAllEvents();
- __pListViewContents->UpdateList();
- return;
- }
+ __selectionType = EVENT_SELECTOR_FORM_SELECTION_TYPE_MULTIPLE;
}
- else
- {
- pSelectionMode = pApp->GetArgument(KEY_DATA_SELECTION_MODE);
- if (pSelectionMode != null && pSelectionMode->Equals(VALUE_CALENDAR_MULTIPLE_SELECTION_MODE, false) == true)
- {
- __selectionType = EVENT_SELECTOR_FORM_SELECTION_TYPE_MULTIPLE;
- }
-
- TryCatch(pApp->GetArgument(KEY_SOCIAL_RESULT_TYPE) != null, , "[E_FAILURE] Unable to get result type.");
- pItemType = pApp->GetArgument(KEY_SOCIAL_ITEM_TYPE);
- TryCatch(pItemType != null, , "[E_FAILURE] Unable to get item type.");
- TryCatch(pItemType->Equals(VALUE_CALENDAR_EVENT_TYPE, false) == true, , "[E_FAILURE] Invalid item type.");
+ TryCatch(pApp->GetArgument(KEY_SOCIAL_RESULT_TYPE) != null, , "[E_FAILURE] Unable to get result type.");
- if (__selectionType == EVENT_SELECTOR_FORM_SELECTION_TYPE_SINGLE)
- {
- GetFooter()->RemoveAllItems();
- }
+ pItemType = pApp->GetArgument(KEY_SOCIAL_ITEM_TYPE);
+ TryCatch(pItemType != null, , "[E_FAILURE] Unable to get item type.");
+ TryCatch(pItemType->Equals(VALUE_CALENDAR_EVENT_TYPE, false) == true, , "[E_FAILURE] Invalid item type.");
- LoadAllEvents();
- __pListViewContents->UpdateList();
- return;
+ if (__selectionType == EVENT_SELECTOR_FORM_SELECTION_TYPE_SINGLE)
+ {
+ GetFooter()->RemoveAllItems();
}
+ LoadAllEvents();
+ __pListViewContents->UpdateList();
+ return;
+
CATCH:
SendAppControlResult(APP_CTRL_RESULT_FAILED);
UiApp::GetInstance()->Terminate();
HashMap* pArgs = null;
if (pResultList != null && pResultList->GetCount() > 0)
{
- pArgs = new (std::nothrow) HashMap();
+ pArgs = new (std::nothrow) HashMap(SingleObjectDeleter);
pArgs->Construct(2);
- if (pApp->GetOperationType() == OPERATION_TYPE_2_0_APPCONTROL)
- {
- pArgs->Add(new (std::nothrow) String(KEY_CALENDAR_ITEM_TYPE), new (std::nothrow) String(VALUE_CALENDAR_EVENT_TYPE));
- String* pPath = new (std::nothrow) String(CalendarApp::GetExportVcsFilePath());
- __pCalendarbook->ExportEventsToVcalendar(*pResultList, *pPath);
- pArgs->Add(new (std::nothrow) String(KEY_CALENDAR_PATH), pPath);
- }
- else
+ const String* pResultType = pApp->GetArgument(KEY_SOCIAL_RESULT_TYPE);
+ if (pResultType != null && *pResultType == VALUE_SOCIAL_ITEM_ID)
{
- const String* pResultType = pApp->GetArgument(KEY_SOCIAL_RESULT_TYPE);
- if (pResultType != null && *pResultType == VALUE_SOCIAL_ITEM_ID)
+ int itemCount = pResultList->GetCount();
+ ArrayList* pEvents = new (std::nothrow) ArrayList(SingleObjectDeleter);
+ pEvents->Construct(itemCount);
+ for (int i = 0; i < itemCount; ++i)
{
- const String* pSelectionMode = pApp->GetArgument(KEY_DATA_SELECTION_MODE);
- if (pSelectionMode != null && pSelectionMode->Equals(VALUE_CALENDAR_MULTIPLE_SELECTION_MODE, false) == true)
- {
- int itemCount = pResultList->GetCount();
- ArrayList* pEvents = new (std::nothrow) ArrayList();
- pEvents->Construct(itemCount);
- for (int i = 0; i < itemCount; ++i)
- {
- pEvents->Add(new (std::nothrow) String(Integer::ToString(static_cast<const CalEvent*>(pResultList->GetAt(i))->GetRecordId())));
- }
- pArgs->Add(new (std::nothrow) String(KEY_SOCIAL_ITEM_ID), pEvents);
- }
- else
- {
- RecordId eventId = static_cast<const CalEvent*>(pResultList->GetAt(0))->GetRecordId();
- pArgs->Add(new (std::nothrow) String(KEY_SOCIAL_ITEM_ID), new (std::nothrow) String(Integer::ToString(eventId)));
- }
- }
- else
- {
- String* pPath = new (std::nothrow) String(CalendarApp::GetExportVcsFilePath());
- __pCalendarbook->ExportEventsToVcalendar(*pResultList, *pPath);
- pArgs->Add(new (std::nothrow) String(KEY_DATA_PATH), pPath);
+ pEvents->Add(new (std::nothrow) String(Integer::ToString(static_cast<const CalEvent*>(pResultList->GetAt(i))->GetRecordId())));
}
+ pArgs->Add(new (std::nothrow) String(KEY_SOCIAL_ITEM_ID), pEvents);
+ }
+ else
+ {
+ String* pPath = new (std::nothrow) String(CalendarApp::GetExportVcsFilePath());
+ __pCalendarbook->ExportEventsToVcalendar(*pResultList, *pPath);
+
+ ArrayList* pPaths = new (std::nothrow) ArrayList(SingleObjectDeleter);
+ pPaths->Construct(1);
+ pPaths->Add(pPath);
+ pArgs->Add(new (std::nothrow) String(KEY_DATA_PATH), pPaths);
}
}
result r = AppControlProviderManager::GetInstance()->SendAppControlResult(pApp->GetRequestId(), appControlResult, pArgs);
- if (pArgs != null)
- {
- pArgs->RemoveAll(true);
- delete pArgs;
- }
+ delete pArgs;
AppLogDebugIf(r != E_SUCCESS, "[%s] Unable to return result.", GetErrorMessage(r));
return r;
enum{
SHARE_EMAIL = 0,
-// SHARE_MESSAGE,
-// SHARE_BLUETOOTH,
-// SHARE_NFC,
-// SHARE_WI_FI,
+ SHARE_MESSAGE,
SHARE_COUNT
};
case SHARE_EMAIL:
pItem->SetElement(ResourceManager::GetString(IDS_CLD_OPT_SENDVIA_EMAIL));
break;
-// case SHARE_MESSAGE:
-// pItem->SetElement(ResourceManager::GetString(IDS_POPUP_SHARE_MESSAGE));
-// break;
-// case SHARE_BLUETOOTH:
-// pItem->SetElement(ResourceManager::GetString(IDS_POPUP_SHARE_BLUETOOTH));
-// break;
-// case SHARE_NFC:
-// pItem->SetElement(ResourceManager::GetString(IDS_POPUP_SHARE_NFC));
-// break;
-// case SHARE_WI_FI:
-// pItem->SetElement(ResourceManager::GetString(IDS_POPUP_SHARE_WI_FI));
-// break;
+ case SHARE_MESSAGE:
+ pItem->SetElement(ResourceManager::GetString(IDS_CLD_OPT_MESSAGE_SEND_VIA));
+ break;
}
return pItem;
{
if (status == LIST_ITEM_STATUS_SELECTED)
{
- String* pPath = new (std::nothrow) String(CalendarApp::GetExportVcsFilePath());
- Calendarbook calendarbook;
- calendarbook.Construct();
- LinkedList events;
- events.Add(calendarbook.GetEventN(__eventId));
- calendarbook.ExportEventsToVcalendar(events, *pPath);
- events.RemoveAll(true);
-
- HashMap* pArgs = new (std::nothrow) HashMap();
- pArgs->Construct();
-
- AppId appId;
String operationId;
+ String uri;
switch (index)
{
case SHARE_EMAIL:
- appId = L"tizen.email";
operationId = L"http://tizen.org/appcontrol/operation/compose";
- pArgs->Add(new (std::nothrow) String(L"attachments"), pPath);
+ uri = L"mailto:";
+ break;
+ case SHARE_MESSAGE:
+ operationId = L"http://tizen.org/appcontrol/operation/compose";
+ uri = L"mmsto:";
break;
-// case SHARE_MESSAGE:
-// appId = L"tizen.message";
-// operationId = L"http://tizen.org/appcontrol/operation/compose";
-// pArgs->Add(new (std::nothrow) String(L"type"), new (std::nothrow) String(L"MMS"));
-// pArgs->Add(new (std::nothrow) String(L"attachVcalendar"), pPath);
-// break;
-// case SHARE_BLUETOOTH:
-// appId = L"tizen.bluetooth";
-// operationId = L"http://tizen.org/appcontrol/operation/compose";
-// break;
-// case SHARE_NFC:
-// appId = L"tizen.nfc";
-// operationId = L"http://tizen.org/appcontrol/operation/compose";
-// break;
-// case SHARE_WI_FI:
-// appId = L"tizen.wifi";
-// operationId = L"http://tizen.org/appcontrol/operation/compose";
-// break;
default:
- File::Remove(*pPath);
- pArgs->RemoveAll(true);
- delete pArgs;
- delete pPath;
+ AppLogDebug("[E_FAILURE] Invalid condition.");
return;
}
- AppControl* pAc = AppManager::FindAppControlN(appId, operationId);
- if (pAc != null)
- {
- pAc->Start(null, null, pArgs, null);
- delete pAc;
- }
- pArgs->RemoveAll(true);
+ Calendarbook calendarbook;
+ calendarbook.Construct();
+ CalEvent* pEvent = calendarbook.GetEventN(__eventId);
+ TryReturnVoid(pEvent != null, "[E_FAILURE] Unable to get event.(ID=%d)", __eventId);
+
+ HashMap* pArgs = new (std::nothrow) HashMap(SingleObjectDeleter);
+ pArgs->Construct(1);
+
+ String* pPath = new (std::nothrow) String(CalendarApp::GetExportVcsFilePath());
+ LinkedList events(SingleObjectDeleter);
+ events.Add(calendarbook.GetEventN(__eventId));
+ calendarbook.ExportEventsToVcalendar(events, *pPath);
+
+ ArrayList* pPaths = new (std::nothrow) ArrayList(SingleObjectDeleter);
+ pPaths->Construct(1);
+ pPaths->Add(pPath);
+ pArgs->Add(new (std::nothrow) String(KEY_CALENDAR_PATH), pPaths);
+
+ AppControl::FindAndStart(operationId, &uri, null, null, pArgs, null);
delete pArgs;
SetShowState(false);
-// delete this;
}
}
static const int IDA_TASK_DETAILS_FORM_ADD_TO_CALENDAR = 80001;
-static const unsigned int COLOR_ITEM_BACKGROUND = Color32<232, 232, 232>::Value;
static const int H_ITEM = 140;
static const int H_MAIN_ITEM = 313;
static const int Y_MAIN_ITEM_SUBJECT = 18;
bool
TaskDetailsForm::HasSectionHeader(int sectionIndex)
{
- if (sectionIndex == GROUP_MAIN_CONTENT)
- {
- return false;
- }
- else if (sectionIndex == GROUP_INFORMATION_CONTENT)
+ if (sectionIndex == GROUP_INFORMATION_CONTENT)
{
if ((__pTask->GetLocation().IsEmpty() == true) && (__pTask->GetDescription().IsEmpty() == true))
{
CalendarApp* pApp = static_cast<CalendarApp*>(UiApp::GetInstance());
result r = E_SUCCESS;
IList* pTodos = null;
- const String* pViewType = null;
- const String* pItemType = null;
- const String* pParseId = null;
- const String* pPath = null;
+ String path;
RecordId todoId = INVALID_RECORD_ID;
-
- if (pApp->GetOperationType() == OPERATION_TYPE_2_0_APPCONTROL)
+ const String* pParseId = null;
+ const String* pItemType = pApp->GetArgument(KEY_SOCIAL_ITEM_TYPE);
+ if (pItemType != null)
{
- pViewType = pApp->GetArgument(KEY_CALENDAR_VIEW_TYPE);
- TryCatch(pViewType != null, , "[E_FAILURE] Unable to get viewtype.");
-
- if (pViewType->Equals(VALUE_CALENDAR_VCS_TYPE, false) == true)
- {
- pPath = pApp->GetArgument(KEY_CALENDAR_PATH);
- TryCatch(pPath != null, , "[E_FAILURE] Unable to get vcs file path.");
- pTodos = Calendarbook::ParseTodosFromVcalendarN(*pPath);
- TryCatch(pTodos != null, , "[E_FAILURE] Unable to parse todos from vcs file.");
- TryCatch(pTodos->GetCount() > 0, delete pTodos, "[E_FAILURE] Unable to parse todos from vcs file.");
-
- if (__pCalendarSelectorPopup == null)
- {
- __pCalendarSelectorPopup = new (std::nothrow) CalendarSelectorPopup();
- __pCalendarSelectorPopup->Initialize();
- }
-
- __pTask = static_cast<CalTodo*>(pTodos->GetAt(0));
- pTodos->RemoveAt(0, false);
- pTodos->RemoveAll(true);
- delete pTodos;
- return;
- }
- else if (pViewType->Equals(VALUE_CALENDAR_TODO_TYPE, false) == true)
- {
- pParseId = pApp->GetArgument(KEY_CALENDAR_TODO_ID);
- TryCatch(pParseId != null, , "[E_FAILURE] Unable to get eventid.");
+ pParseId = pApp->GetArgument(KEY_SOCIAL_ITEM_ID);
+ TryCatch(pParseId != null, , "[E_FAILURE] Unable to get eventid.");
- r = Integer::Parse(*pParseId, todoId);
- TryCatch(r == E_SUCCESS, , "[%s] Unable to get eventid.", GetErrorMessage(r));
+ r = Integer::Parse(*pParseId, todoId);
+ TryCatch(r == E_SUCCESS, , "[%s] Unable to get eventid.", GetErrorMessage(r));
- Calendarbook calendarbook;
- calendarbook.Construct();
- __pTask = calendarbook.GetTodoN(todoId);
- TryCatch(__pTask != null, , "[E_FAILURE] Unable to get todo.");
+ Calendarbook calendarbook;
+ calendarbook.Construct();
+ __pTask = calendarbook.GetTodoN(todoId);
+ TryCatch(__pTask != null, , "[E_FAILURE] Unable to get todo.");
- GetFooter()->RemoveAllItems();
- return;
- }
+ GetFooter()->RemoveAllItems();
}
- else
+ else if (pApp->GetMimeType() == MIME_TYPE_VCALENDAR)
{
- pItemType = pApp->GetArgument(KEY_SOCIAL_ITEM_TYPE);
- if (pItemType != null)
- {
- pParseId = pApp->GetArgument(KEY_SOCIAL_ITEM_ID);
- TryCatch(pParseId != null, , "[E_FAILURE] Unable to get eventid.");
-
- r = Integer::Parse(*pParseId, todoId);
- TryCatch(r == E_SUCCESS, , "[%s] Unable to get eventid.", GetErrorMessage(r));
-
- Calendarbook calendarbook;
- calendarbook.Construct();
- __pTask = calendarbook.GetTodoN(todoId);
- TryCatch(__pTask != null, , "[E_FAILURE] Unable to get todo.");
+ path = pApp->GetUri();
+ path.Replace(FILE_URL_HEADER, L"");
+ pTodos = Calendarbook::ParseTodosFromVcalendarN(path);
+ TryCatch(pTodos != null, , "[E_FAILURE] Unable to parse todos from vcs file.");
+ TryCatch(pTodos->GetCount() > 0, delete pTodos, "[E_FAILURE] Unable to parse todos from vcs file.");
- GetFooter()->RemoveAllItems();
- return;
- }
- else if (pApp->GetMimeType() == MIME_TYPE_VCALENDAR)
+ if (__pCalendarSelectorPopup == null)
{
- pTodos = Calendarbook::ParseTodosFromVcalendarN(pApp->GetUri());
- TryCatch(pTodos != null, , "[E_FAILURE] Unable to parse todos from vcs file.");
- TryCatch(pTodos->GetCount() > 0, delete pTodos, "[E_FAILURE] Unable to parse todos from vcs file.");
-
- if (__pCalendarSelectorPopup == null)
- {
- __pCalendarSelectorPopup = new (std::nothrow) CalendarSelectorPopup();
- __pCalendarSelectorPopup->Initialize();
- }
-
- __pTask = static_cast<CalTodo*>(pTodos->GetAt(0));
- pTodos->RemoveAt(0, false);
- pTodos->RemoveAll(true);
- delete pTodos;
- return;
+ __pCalendarSelectorPopup = new (std::nothrow) CalendarSelectorPopup();
+ __pCalendarSelectorPopup->Initialize();
}
+
+ __pTask = static_cast<CalTodo*>(pTodos->GetAt(0));
+ pTodos->RemoveAt(0, false);
+ pTodos->RemoveAll(true);
+ delete pTodos;
}
+ return;
CATCH:
SendAppControlResult(APP_CTRL_RESULT_FAILED);
{
TableViewItem* pItem = new (std::nothrow) TableViewItem();
pItem->Construct(Dimension(itemWidth, H_MAIN_ITEM));
- pItem->SetBackgroundColor(Color(COLOR_ITEM_BACKGROUND));
pItem->SetEnabled(false);
int y = Y_MAIN_ITEM_SUBJECT;
}
pItem->Construct(Dimension(itemWidth, itemHeight));
- pItem->SetBackgroundColor(Color(COLOR_ITEM_BACKGROUND));
pItem->SetEnabled(false);
Label* pLabelDescription = new (std::nothrow) Label();
if (location.IsEmpty() == false)
{
pItem->Construct(Dimension(itemWidth, H_ITEM));
- pItem->SetBackgroundColor(Color(COLOR_ITEM_BACKGROUND));
pItem->SetEnabled(false);
Label* pLabelLocation = new (std::nothrow) Label();
TableViewItem* pItem = new (std::nothrow) TableViewItem();
pItem->Construct(Dimension(itemWidth, height));
- pItem->SetBackgroundColor(Color(COLOR_ITEM_BACKGROUND));
pItem->SetEnabled(false);
Label* pLabelReminder = new (std::nothrow) Label();
{
TableViewItem* pItem = new (std::nothrow) TableViewItem();
pItem->Construct(Dimension(itemWidth, H_PRIORITY_ITEM));
- pItem->SetBackgroundColor(Color(COLOR_ITEM_BACKGROUND));
pItem->SetEnabled(false);
Label* pLabelPriority = new (std::nothrow) Label();
{
TableViewItem* pItem = new (std::nothrow) TableViewItem();
pItem->Construct(Dimension(itemWidth, H_SAVE_TO_ITEM));
- pItem->SetBackgroundColor(Color(COLOR_ITEM_BACKGROUND));
pItem->SetEnabled(false);
int x = 0;
}
CalendarApp* pApp = static_cast<CalendarApp*>(UiApp::GetInstance());
- const String* pSelectionMode = null;
const String* pItemType = null;
- if (pApp->GetOperationType() == OPERATION_TYPE_2_0_APPCONTROL)
+ const String* pSelectionMode = pApp->GetArgument(KEY_DATA_SELECTION_MODE);
+ if (pSelectionMode != null && pSelectionMode->Equals(VALUE_CALENDAR_MULTIPLE_SELECTION_MODE, false) == true)
{
- pSelectionMode = pApp->GetArgument(KEY_CALENDAR_SELECTION_MODE);
- TryCatch(pSelectionMode != null, , "[E_FAILURE] Unable to get selection mode.");
-
- pItemType = pApp->GetArgument(KEY_CALENDAR_ITEM_TYPE);
- TryCatch(pItemType != null, , "[E_FAILURE] Unable to get item type.");
- TryCatch(pItemType->Equals(VALUE_CALENDAR_TODO_TYPE, false) == true, , "[E_FAILURE] Invalid item type.");
-
- if (pSelectionMode->Equals(VALUE_CALENDAR_MULTIPLE_SELECTION_MODE, false) == true)
- {
- __selectionType = TASK_SELECTOR_FORM_SELECTION_TYPE_MULTIPLE;
-
- LoadAllTodos();
- __pListViewContents->UpdateList();
- return;
- }
- else if (pSelectionMode->Equals(VALUE_CALENDAR_SINGLE_SELECTION_MODE, false) == true)
- {
- __selectionType = TASK_SELECTOR_FORM_SELECTION_TYPE_SINGLE;
- GetFooter()->RemoveAllItems();
-
- LoadAllTodos();
- __pListViewContents->UpdateList();
- return;
- }
+ __selectionType = TASK_SELECTOR_FORM_SELECTION_TYPE_MULTIPLE;
}
- else
- {
- pSelectionMode = pApp->GetArgument(KEY_DATA_SELECTION_MODE);
- if (pSelectionMode != null && pSelectionMode->Equals(VALUE_CALENDAR_MULTIPLE_SELECTION_MODE, false) == true)
- {
- __selectionType = TASK_SELECTOR_FORM_SELECTION_TYPE_MULTIPLE;
- }
-
- TryCatch(pApp->GetArgument(KEY_SOCIAL_RESULT_TYPE) != null, , "[E_FAILURE] Unable to get result type.");
- pItemType = pApp->GetArgument(KEY_SOCIAL_ITEM_TYPE);
- TryCatch(pItemType != null, , "[E_FAILURE] Unable to get item type.");
- TryCatch(pItemType->Equals(VALUE_CALENDAR_TODO_TYPE, false) == true, , "[E_FAILURE] Invalid item type.");
+ TryCatch(pApp->GetArgument(KEY_SOCIAL_RESULT_TYPE) != null, , "[E_FAILURE] Unable to get result type.");
- if (__selectionType == TASK_SELECTOR_FORM_SELECTION_TYPE_SINGLE)
- {
- GetFooter()->RemoveAllItems();
- }
+ pItemType = pApp->GetArgument(KEY_SOCIAL_ITEM_TYPE);
+ TryCatch(pItemType != null, , "[E_FAILURE] Unable to get item type.");
+ TryCatch(pItemType->Equals(VALUE_CALENDAR_TODO_TYPE, false) == true, , "[E_FAILURE] Invalid item type.");
- LoadAllTodos();
- __pListViewContents->UpdateList();
- return;
+ if (__selectionType == TASK_SELECTOR_FORM_SELECTION_TYPE_SINGLE)
+ {
+ GetFooter()->RemoveAllItems();
}
+ LoadAllTodos();
+ __pListViewContents->UpdateList();
+ return;
+
CATCH:
SendAppControlResult(APP_CTRL_RESULT_FAILED);
UiApp::GetInstance()->Terminate();
HashMap* pArgs = null;
if (pResultList != null && pResultList->GetCount() > 0)
{
- pArgs = new (std::nothrow) HashMap();
+ pArgs = new (std::nothrow) HashMap(SingleObjectDeleter);
pArgs->Construct(2);
- if (pApp->GetOperationType() == OPERATION_TYPE_2_0_APPCONTROL)
- {
- pArgs->Add(new (std::nothrow) String(KEY_CALENDAR_ITEM_TYPE), new (std::nothrow) String(VALUE_CALENDAR_TODO_TYPE));
- String* pPath = new (std::nothrow) String(CalendarApp::GetExportVcsFilePath());
- __pCalendarbook->ExportTodosToVcalendar(*pResultList, *pPath);
- pArgs->Add(new (std::nothrow) String(KEY_CALENDAR_PATH), pPath);
- }
- else
+ const String* pResultType = pApp->GetArgument(KEY_SOCIAL_RESULT_TYPE);
+ if (pResultType != null && *pResultType == VALUE_SOCIAL_ITEM_ID)
{
- const String* pResultType = pApp->GetArgument(KEY_SOCIAL_RESULT_TYPE);
- if (pResultType != null && *pResultType == VALUE_SOCIAL_ITEM_ID)
+ int itemCount = pResultList->GetCount();
+ ArrayList* pTodos = new (std::nothrow) ArrayList(SingleObjectDeleter);
+ pTodos->Construct(itemCount);
+ for (int i = 0; i < itemCount; ++i)
{
- const String* pSelectionMode = pApp->GetArgument(KEY_DATA_SELECTION_MODE);
- if (pSelectionMode != null && pSelectionMode->Equals(VALUE_CALENDAR_MULTIPLE_SELECTION_MODE, false) == true)
- {
- int itemCount = pResultList->GetCount();
- ArrayList* pTodos = new (std::nothrow) ArrayList();
- pTodos->Construct(itemCount);
- for (int i = 0; i < itemCount; ++i)
- {
- pTodos->Add(new (std::nothrow) String(Integer::ToString(static_cast<const CalTodo*>(pResultList->GetAt(i))->GetRecordId())));
- }
- pArgs->Add(new (std::nothrow) String(KEY_SOCIAL_ITEM_ID), pTodos);
- }
- else
- {
- RecordId todoId = static_cast<const CalTodo*>(pResultList->GetAt(0))->GetRecordId();
- pArgs->Add(new (std::nothrow) String(KEY_SOCIAL_ITEM_ID), new (std::nothrow) String(Integer::ToString(todoId)));
- }
- }
- else
- {
- String* pPath = new (std::nothrow) String(CalendarApp::GetExportVcsFilePath());
- __pCalendarbook->ExportTodosToVcalendar(*pResultList, *pPath);
- pArgs->Add(new (std::nothrow) String(KEY_DATA_PATH), pPath);
+ pTodos->Add(new (std::nothrow) String(Integer::ToString(static_cast<const CalTodo*>(pResultList->GetAt(i))->GetRecordId())));
}
+ pArgs->Add(new (std::nothrow) String(KEY_SOCIAL_ITEM_ID), pTodos);
+ }
+ else
+ {
+ String* pPath = new (std::nothrow) String(CalendarApp::GetExportVcsFilePath());
+ __pCalendarbook->ExportTodosToVcalendar(*pResultList, *pPath);
+
+ ArrayList* pPaths = new (std::nothrow) ArrayList(SingleObjectDeleter);
+ pPaths->Construct(1);
+ pPaths->Add(pPath);
+ pArgs->Add(new (std::nothrow) String(KEY_DATA_PATH), pPaths);
}
}
result r = AppControlProviderManager::GetInstance()->SendAppControlResult(pApp->GetRequestId(), appControlResult, pArgs);
- if (pArgs != null)
- {
- pArgs->RemoveAll(true);
- delete pArgs;
- }
+ delete pArgs;
+
AppLogDebugIf(r != E_SUCCESS, "[%s] Unable to return result.", GetErrorMessage(r));
return r;
}
const wchar_t* IDB_ICON_PHONE_CALENDAR = L"P01_icon_phoneCalendar.png";
//etc
+const wchar_t* FILE_URL_HEADER = L"file://";
+
const wchar_t* ID_OPERATION_ADD = L"http://tizen.org/appcontrol/operation/add";
-const wchar_t* ID_OPERATION_CONFIG = L"http://tizen.org/appcontrol/operation/configure";
const wchar_t* ID_OPERATION_MAIN = L"http://tizen.org/appcontrol/operation/main";
-const wchar_t* ID_OPERATION_PICK = L"http://tizen.org/appcontrol/operation/pick";
const wchar_t* ID_OPERATION_VIEW = L"http://tizen.org/appcontrol/operation/view";
const wchar_t* ID_OPERATION_SOCIAL_EDIT = L"http://tizen.org/appcontrol/operation/social/edit";