Apply new vcs view concept.
authorSungWan Kim <sw0726.kim@samsung.com>
Wed, 3 Apr 2013 10:56:47 +0000 (19:56 +0900)
committerSungWan Kim <sw0726.kim@samsung.com>
Wed, 3 Apr 2013 11:50:18 +0000 (20:50 +0900)
Change-Id: I9587712ffd7f199cb30ed65bd32d01d17639d200
Signed-off-by: SungWan Kim <sw0726.kim@samsung.com>
27 files changed:
inc/ClCalendarApp.h
inc/ClEventPresentationModel.h
inc/ClImportForm.h [new file with mode: 0644]
inc/ClTypes.h
inc/ClVcsSelectorForm.h [new file with mode: 0644]
res/screen-density-xhigh/00_icon_select_all_press_web.png [new file with mode: 0644]
res/screen-density-xhigh/00_icon_select_all_web.png [new file with mode: 0644]
res/screen-size-normal/IDL_EVENT_DELETER_FORM.xml
res/screen-size-normal/IDL_EVENT_SELECTOR_FORM.xml
res/screen-size-normal/IDL_IMPORT_FORM.xml [new file with mode: 0644]
res/screen-size-normal/IDL_TASK_DETAILS_FORM.xml
res/screen-size-normal/IDL_TASK_SELECTOR_FORM.xml
res/screen-size-normal/IDL_TWO_BUTTON_POPUP.xml
res/screen-size-normal/IDL_VCS_SELECTOR_FORM.xml [new file with mode: 0644]
src/ClCalendarApp.cpp
src/ClEventDeleterForm.cpp
src/ClEventDetailsForm.cpp
src/ClEventPresentationModel.cpp
src/ClEventSelectorForm.cpp
src/ClFormFactory.cpp
src/ClImportForm.cpp [new file with mode: 0644]
src/ClMainFrame.cpp
src/ClSceneRegister.cpp
src/ClTaskDetailsForm.cpp
src/ClTaskSelectorForm.cpp
src/ClTypes.cpp
src/ClVcsSelectorForm.cpp [new file with mode: 0644]

index 2bff3af..2a55ae4 100644 (file)
@@ -36,6 +36,7 @@ class CalendarApp
 public:
        const Tizen::Base::String* GetArgument(const Tizen::Base::String& key) const;
        const Tizen::Base::String& GetInitialScene(void) const;
+       const Tizen::Base::Collection::IList* GetInitialSceneArgument(void) const;
        const Tizen::Base::String& GetMimeType(void) const;
        OperationType GetOperationType(void) const;
        RequestId GetRequestId(void) const;
@@ -72,6 +73,7 @@ private:
        Tizen::Base::String __uriScheme;
        Tizen::Base::Collection::IMap* __pArgs;
        Tizen::Base::Collection::LinkedList __listeners;
+       Tizen::Base::Collection::IList* __pInitialSceneArgument;
 }; // CalendarApp
 
 #endif // _CL_CALENDAR_APP_H_
index 597dbf0..5843b39 100644 (file)
@@ -59,6 +59,7 @@ public:
 
        result RemoveEvent(bool deleteOriginal = true);
        result SetCalendar(const Tizen::Social::RecordId calendarId);
+       result SetEvent(const Tizen::Social::CalEvent& event);
        result SetEventId(const Tizen::Social::RecordId eventId = Tizen::Social::INVALID_RECORD_ID);
        result SetEventInstance(const Tizen::Social::CalEventInstance& event);
        result SetVcsFile(const Tizen::Base::String& vcsFilePath);
diff --git a/inc/ClImportForm.h b/inc/ClImportForm.h
new file mode 100644 (file)
index 0000000..fdf2822
--- /dev/null
@@ -0,0 +1,81 @@
+//
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://floralicense.org/license/
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an AS IS BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file       ClImportForm.h
+ * @brief      This is the header file for the ImportForm class.
+ */
+
+#ifndef _CL_IMPORT_FORM_H_
+#define _CL_IMPORT_FORM_H_
+
+#include <FBase.h>
+#include <FGraphics.h>
+#include <FLocales.h>
+#include <FSocial.h>
+#include <FUi.h>
+
+class CalendarSelectorPopup;
+
+class ImportForm
+       : public Tizen::Ui::Controls::Form
+       , public virtual Tizen::Ui::IActionEventListener
+       , public virtual Tizen::Ui::Controls::IFormBackEventListener
+       , public virtual Tizen::Ui::Controls::IListViewItemProvider
+       , public virtual Tizen::Ui::Scenes::ISceneEventListener
+{
+public:
+       result Initialize(void);
+
+       ImportForm(void);
+       virtual ~ImportForm(void);
+
+       virtual result OnInitializing(void);
+       virtual result OnTerminating(void);
+       virtual void OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs);
+
+       virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
+
+       virtual void OnFormBackRequested(Tizen::Ui::Controls::Form& source);
+
+       virtual int GetItemCount(void);
+       virtual Tizen::Ui::Controls::ListItemBase* CreateItem(int index, int itemWidth);
+       virtual bool DeleteItem(int index, Tizen::Ui::Controls::ListItemBase* pItem, int itemWidth);
+
+       virtual void OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId,
+                                                                          const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs);
+       virtual void OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId,
+                                                                               const Tizen::Ui::Scenes::SceneId& nextSceneId);
+
+private:
+       Tizen::Graphics::Color GetCalendarColor(const Tizen::Social::RecordId& calendarId) const;
+       Tizen::Base::String GetDateRangeText(const Tizen::Base::DateTime& start, const Tizen::Base::DateTime& end, bool isAllDayEvent) const;
+       bool IsAllItemAdded(void) const;
+       bool IsAllItemChecked(void) const;
+       bool IsEventItemChecked(void) const;
+       bool IsTodoItemChecked(void) const;
+
+private:
+       Tizen::Base::Collection::IList* __pList;
+       Tizen::Ui::Controls::ListView* __pListViewContents;
+       Tizen::Locales::DateTimeFormatter* __pDateTimeFormatter;
+       Tizen::Locales::DateTimeFormatter* __pDateFormatter;
+       Tizen::Locales::DateTimeFormatter* __pTimeFormatter;
+       Tizen::Social::Calendarbook* __pCalendarbook;
+       CalendarSelectorPopup* __pCalendarSelectorPopup;
+}; // ImportForm
+
+#endif // _CL_IMPORT_FORM_H_
index 0df1faf..5417130 100644 (file)
@@ -27,19 +27,21 @@ extern const wchar_t* IDSCN_YEAR;
 extern const wchar_t* IDSCN_MONTH;
 extern const wchar_t* IDSCN_DAY;
 extern const wchar_t* IDSCN_LIST;
-extern const wchar_t* IDSCN_CALENDAR_SETTINGS;
 extern const wchar_t* IDSCN_CALENDAR_LIST;
+extern const wchar_t* IDSCN_CALENDAR_SETTINGS;
 extern const wchar_t* IDSCN_DAY_EVENT_LIST;
 extern const wchar_t* IDSCN_EVENT_DETAILS;
 extern const wchar_t* IDSCN_EVENT_DELETER;
 extern const wchar_t* IDSCN_EVENT_EDITOR;
 extern const wchar_t* IDSCN_EVENT_SEARCHER;
 extern const wchar_t* IDSCN_EVENT_SELECTOR;
+extern const wchar_t* IDSCN_IMPORT;
 extern const wchar_t* IDSCN_REMINDER;
 extern const wchar_t* IDSCN_REPEAT;
+extern const wchar_t* IDSCN_SETTING;
 extern const wchar_t* IDSCN_TASK_SELECTOR;
 extern const wchar_t* IDSCN_TASK_DETAILS;
-extern const wchar_t* IDSCN_SETTING;
+extern const wchar_t* IDSCN_VCS_SELECTOR;
 
 //FormId IDC_FORM
 extern const wchar_t* IDC_MAIN_FORM;
@@ -51,11 +53,13 @@ extern const wchar_t* IDC_EVENT_DELETER_FORM;
 extern const wchar_t* IDC_EVENT_SELECTOR_FORM;
 extern const wchar_t* IDC_EVENT_EDITOR_FORM;
 extern const wchar_t* IDC_EVENT_SEARCHER_FORM;
+extern const wchar_t* IDC_IMPORT_FORM;
 extern const wchar_t* IDC_REMINDER_FORM;
 extern const wchar_t* IDC_REPEAT_FORM;
+extern const wchar_t* IDC_SETTING_FORM;
 extern const wchar_t* IDC_TASK_SELECTOR_FORM;
 extern const wchar_t* IDC_TASK_DETAILS_FORM;
-extern const wchar_t* IDC_SETTING_FORM;
+extern const wchar_t* IDC_VCS_SELECTOR_FORM;
 
 //PanelId IDC_PANEL
 extern const wchar_t* IDC_YEAR_PANEL;
@@ -231,6 +235,7 @@ extern const wchar_t* FILE_URL_HEADER;
 
 extern const wchar_t* ID_OPERATION_ADD;
 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;
diff --git a/inc/ClVcsSelectorForm.h b/inc/ClVcsSelectorForm.h
new file mode 100644 (file)
index 0000000..9d657ff
--- /dev/null
@@ -0,0 +1,82 @@
+//
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://floralicense.org/license/
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an AS IS BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file       ClVcsSelectorForm.h
+ * @brief      This is the header file for the VcsSelectorForm class.
+ */
+
+#ifndef _CL_VCS_SELECTOR_FORM_H_
+#define _CL_VCS_SELECTOR_FORM_H_
+
+#include <FBase.h>
+#include <FGraphics.h>
+#include <FLocales.h>
+#include <FSocial.h>
+#include <FUi.h>
+
+class VcsSelectorForm
+       : public Tizen::Ui::Controls::Form
+       , public virtual Tizen::Ui::IActionEventListener
+       , public virtual Tizen::Ui::Controls::IFormBackEventListener
+       , public virtual Tizen::Ui::Controls::IListViewItemEventListener
+       , public virtual Tizen::Ui::Controls::IListViewItemProvider
+       , public virtual Tizen::Ui::Scenes::ISceneEventListener
+{
+public:
+       result Initialize(void);
+
+       VcsSelectorForm(void);
+       virtual ~VcsSelectorForm(void);
+
+       virtual result OnInitializing(void);
+       virtual result OnTerminating(void);
+
+       virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
+
+       virtual void OnFormBackRequested(Tizen::Ui::Controls::Form& source);
+
+       virtual void OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status);
+       virtual void OnListViewItemSwept(Tizen::Ui::Controls::ListView& listView, int index, Tizen::Ui::Controls::SweepDirection direction);
+       virtual void OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus status);
+
+       virtual int GetItemCount(void);
+       virtual Tizen::Ui::Controls::ListItemBase* CreateItem(int index, int itemWidth);
+       virtual bool DeleteItem(int index, Tizen::Ui::Controls::ListItemBase* pItem, int itemWidth);
+
+       virtual void OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId,
+                                                                          const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs);
+       virtual void OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId,
+                                                                               const Tizen::Ui::Scenes::SceneId& nextSceneId);
+
+private:
+       Tizen::Graphics::Color GetCalendarColor(const Tizen::Social::RecordId& calendarId) const;
+       Tizen::Base::String GetDateRangeText(const Tizen::Base::DateTime& start, const Tizen::Base::DateTime& end, bool isAllDayEvent) const;
+       void InitializeSubMenu(void);
+       bool IsAllItemAdded(void) const;
+
+private:
+       Tizen::Base::Collection::IList* __pList;
+       Tizen::Ui::Controls::ListView* __pListViewContents;
+       Tizen::Ui::Controls::ContextMenu* __pContextMenuSub;
+       Tizen::Locales::DateTimeFormatter* __pDateTimeFormatter;
+       Tizen::Locales::DateTimeFormatter* __pDateFormatter;
+       Tizen::Locales::DateTimeFormatter* __pTimeFormatter;
+       Tizen::Social::Calendarbook* __pCalendarbook;
+       int __selectedIndex;
+}; // VcsSelectorForm
+
+#endif // _CL_VCS_SELECTOR_FORM_H_
diff --git a/res/screen-density-xhigh/00_icon_select_all_press_web.png b/res/screen-density-xhigh/00_icon_select_all_press_web.png
new file mode 100644 (file)
index 0000000..7ea5e20
Binary files /dev/null and b/res/screen-density-xhigh/00_icon_select_all_press_web.png differ
diff --git a/res/screen-density-xhigh/00_icon_select_all_web.png b/res/screen-density-xhigh/00_icon_select_all_web.png
new file mode 100644 (file)
index 0000000..9c6c3db
Binary files /dev/null and b/res/screen-density-xhigh/00_icon_select_all_web.png differ
index 3a9000d..2d7b82a 100644 (file)
@@ -13,7 +13,7 @@
     <Footer>
         <property backgroundBitmapPath="" color="#F8F6EF" colorOpacity="100" disabledButtonColor="" disabledButtonColorOpacity="100" disabledButtonTextColor="" disabledItemColor="" disabledItemColorOpacity="100" disabledItemTextColor="" footerStyle="FOOTER_STYLE_BUTTON_TEXT" highlightedButtonColor="" highlightedButtonColorOpacity="100" highlightedButtonTextColor="" highlightedItemColor="" highlightedItemColorOpacity="100" highlightedItemTextColor="" normalButtonColor="" normalButtonColorOpacity="100" normalButtonTextColor="" normalItemColor="" normalItemColorOpacity="100" normalItemTextColor="" pressedButtonColor="" pressedButtonColorOpacity="100" pressedButtonTextColor="" pressedItemColor="" pressedItemColorOpacity="100" pressedItemTextColor="" selectedItemColor="" selectedItemColorOpacity="100" selectedItemTextColor="" showBackButton="true"/>
         <itemSet>
-            <footerItem actionId="80001" disabledIconPath="" highlightedIconPath="" normalIconPath="" pressedIconPath="" selectedIconPath="" text="::IDS_CLD_BUTTON_DELETE"/>
+            <footerItem actionId="75001" disabledIconPath="" highlightedIconPath="" normalIconPath="" pressedIconPath="" selectedIconPath="" text="::IDS_CLD_BUTTON_DELETE"/>
         </itemSet>
     </Footer>
     <Header>
index 19cc4d8..dde8534 100644 (file)
@@ -14,7 +14,7 @@
     <Footer>
         <property backgroundBitmapPath="" color="#F8F6EF" colorOpacity="100" disabledButtonColor="" disabledButtonColorOpacity="100" disabledButtonTextColor="" disabledItemColor="" disabledItemColorOpacity="100" disabledItemTextColor="" footerStyle="FOOTER_STYLE_BUTTON_TEXT" highlightedButtonColor="" highlightedButtonColorOpacity="100" highlightedButtonTextColor="" highlightedItemColor="" highlightedItemColorOpacity="100" highlightedItemTextColor="" normalButtonColor="" normalButtonColorOpacity="100" normalButtonTextColor="" normalItemColor="" normalItemColorOpacity="100" normalItemTextColor="" pressedButtonColor="" pressedButtonColorOpacity="100" pressedButtonTextColor="" pressedItemColor="" pressedItemColorOpacity="100" pressedItemTextColor="" selectedItemColor="" selectedItemColorOpacity="100" selectedItemTextColor="" showBackButton="true"/>
         <itemSet>
-            <footerItem actionId="80001" disabledIconPath="" highlightedIconPath="" normalIconPath="" pressedIconPath="" selectedIconPath="" text="::IDS_CLD_SK3_DONE"/>
+            <footerItem actionId="70001" disabledIconPath="" highlightedIconPath="" normalIconPath="" pressedIconPath="" selectedIconPath="" text="::IDS_CLD_SK3_DONE"/>
         </itemSet>
     </Footer>
     <Header>
diff --git a/res/screen-size-normal/IDL_IMPORT_FORM.xml b/res/screen-size-normal/IDL_IMPORT_FORM.xml
new file mode 100644 (file)
index 0000000..efc4757
--- /dev/null
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+       This XML file was automatically generated by UiBuilder - do not modify by hand.
+-->
+<!DOCTYPE Scene SYSTEM "UIForm.dtd">
+
+<Scene Bversion="2.0.0.201304011930" Dversion="20120315">
+    <LogicalCoordinate>720</LogicalCoordinate>
+    <Form id="IDL_IMPORT_FORM">
+        <property backgroundColor="" backgroundColorOpacity="100" notificationTrayOpenEnabled="false" orientation="Portrait" softKey0NormalIcon="" softKey0PressedIcon="" softKey0Text="" softKey1NormalIcon="" softKey1PressedIcon="" softKey1Text="" title="" titleAlign="ALIGN_CENTER" titleIcon="" translucentFooter="false" translucentHeader="false" translucentIndicator="false"/>
+        <layout mode="Portrait" style="FORM_STYLE_INDICATOR|FORM_STYLE_HEADER|FORM_STYLE_FOOTER" type="LAYOUT_RELATIVE"/>
+        <layout mode="Landscape" style="FORM_STYLE_INDICATOR|FORM_STYLE_HEADER|FORM_STYLE_FOOTER" type="LAYOUT_RELATIVE"/>
+    </Form>
+    <Footer>
+        <property backgroundBitmapPath="" color="" colorOpacity="100" disabledButtonColor="" disabledButtonColorOpacity="100" disabledButtonTextColor="" disabledItemColor="" disabledItemColorOpacity="100" disabledItemTextColor="" footerStyle="FOOTER_STYLE_BUTTON_TEXT" highlightedButtonColor="" highlightedButtonColorOpacity="100" highlightedButtonTextColor="" highlightedItemColor="" highlightedItemColorOpacity="100" highlightedItemTextColor="" normalButtonColor="" normalButtonColorOpacity="100" normalButtonTextColor="" normalItemColor="" normalItemColorOpacity="100" normalItemTextColor="" pressedButtonColor="" pressedButtonColorOpacity="100" pressedButtonTextColor="" pressedItemColor="" pressedItemColorOpacity="100" pressedItemTextColor="" selectedItemColor="" selectedItemColorOpacity="100" selectedItemTextColor="" showBackButton="true"/>
+        <itemSet>
+            <footerItem accessibilityHint="" actionId="90010" disabledIconPath="" highlightedIconPath="" normalIconPath="" pressedIconPath="" selectedIconPath="" text="::IDS_EMAIL_OPT_ADD_TO_CALENDAR"/>
+        </itemSet>
+    </Footer>
+    <Header>
+        <property accessibilityHint="" backgroundBitmapPath="" color="" colorOpacity="100" descriptionText="" descriptionTextColor="" disabledButtonColor="" disabledButtonColorOpacity="100" disabledButtonTextColor="" disabledItemColor="" disabledItemColorOpacity="100" disabledItemTextColor="" headerStyle="HEADER_STYLE_TITLE" highlightedButtonColor="" highlightedButtonColorOpacity="100" highlightedButtonTextColor="" highlightedItemColor="" highlightedItemColorOpacity="100" highlightedItemTextColor="" normalButtonColor="" normalButtonColorOpacity="100" normalButtonTextColor="" normalItemColor="" normalItemColorOpacity="100" normalItemTextColor="" pressedButtonColor="" pressedButtonColorOpacity="100" pressedButtonTextColor="" pressedItemColor="" pressedItemColorOpacity="100" pressedItemTextColor="" selectedItemColor="" selectedItemColorOpacity="100" selectedItemTextColor="" titleIconPath="" titleText="::IDS_CLD_BODY_IMPORT_EVENTS_TASKS_ABB" titleTextColor=""/>
+        <itemSet>
+            <buttonItem accessibilityHint="" actionId="90001" disabledBGBitmapPath="" disabledIconPath="" highlightedBGBitmapPath="00_icon_select_all_press_web.png" highlightedIconPath="" normalBGBitmapPath="00_icon_select_all_web.png" normalIconPath="" position="BUTTON_POSITION_RIGHT" pressedBGBitmapPath="00_icon_select_all_press_web.png" pressedIconPath="" style="BUTTON_ITEM_STYLE_ICON" text="" type="right"/>
+        </itemSet>
+    </Header>
+    <ListView id="IDC_LISTVIEW" parent="IDL_IMPORT_FORM">
+        <property backgroundBitmapPath="" backgroundColor="" backgroundColorOpacity="0" bitmapPathOfEmptyList="" colorOfEmptyListText="" fastScroll="false" itemDivider="true" itemDividerColor="" scrollInputMode="SCROLL_INPUT_MODE_ALLOW_ANY_DIRECTION" sweepEnabled="false" textOfEmptyList=""/>
+        <layout bottomRelation="IDL_IMPORT_FORM" bottomRelationType="RECT_EDGE_RELATION_BOTTOM_TO_BOTTOM" centerHorizontal="false" centerVertical="false" height="1011.0" horizontalFitPolicy="FIT_POLICY_PARENT" leftRelation="IDL_IMPORT_FORM" leftRelationType="RECT_EDGE_RELATION_LEFT_TO_LEFT" marginBottom="0.0" marginLeft="0.0" marginRight="0.0" marginTop="0.0" mode="Portrait" rightRelation="IDL_IMPORT_FORM" rightRelationType="RECT_EDGE_RELATION_RIGHT_TO_RIGHT" topRelation="IDL_IMPORT_FORM" topRelationType="RECT_EDGE_RELATION_TOP_TO_TOP" verticalFitPolicy="FIT_POLICY_FIXED" width="720.0" x="0" y="0.0"/>
+        <layout bottomRelation="" bottomRelationType="" centerHorizontal="false" centerVertical="false" height="124.0" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="" leftRelationType="" marginBottom="0.0" marginLeft="0.0" marginRight="0.0" marginTop="0.0" mode="Landscape" rightRelation="" rightRelationType="" topRelation="" topRelationType="" verticalFitPolicy="FIT_POLICY_FIXED" width="561.0" x="718.0" y="105.0"/>
+    </ListView>
+</Scene>
index 7518c11..a7de4f6 100644 (file)
@@ -13,7 +13,7 @@
     <Footer>
         <property backgroundBitmapPath="" color="#F8F6EF" colorOpacity="100" disabledButtonColor="" disabledButtonColorOpacity="100" disabledButtonTextColor="" disabledItemColor="" disabledItemColorOpacity="100" disabledItemTextColor="" footerStyle="FOOTER_STYLE_BUTTON_TEXT" highlightedButtonColor="" highlightedButtonColorOpacity="100" highlightedButtonTextColor="" highlightedItemColor="" highlightedItemColorOpacity="100" highlightedItemTextColor="" normalButtonColor="" normalButtonColorOpacity="100" normalButtonTextColor="" normalItemColor="" normalItemColorOpacity="100" normalItemTextColor="" pressedButtonColor="" pressedButtonColorOpacity="100" pressedButtonTextColor="" pressedItemColor="" pressedItemColorOpacity="100" pressedItemTextColor="" selectedItemColor="" selectedItemColorOpacity="100" selectedItemTextColor="" showBackButton="true"/>
         <itemSet>
-            <footerItem actionId="80001" disabledIconPath="" highlightedIconPath="" normalIconPath="" pressedIconPath="" selectedIconPath="" text="::IDS_EMAIL_OPT_ADD_TO_CALENDAR"/>
+            <footerItem actionId="61001" disabledIconPath="" highlightedIconPath="" normalIconPath="" pressedIconPath="" selectedIconPath="" text="::IDS_EMAIL_OPT_ADD_TO_CALENDAR"/>
         </itemSet>
     </Footer>
     <SectionTableView id="IDC_SECTIONTABLEVIEW" parent="IDL_TASK_DETAILS_FORM">
index 66c8c93..9cafaa2 100644 (file)
@@ -14,7 +14,7 @@
     <Footer>
         <property backgroundBitmapPath="" color="#F8F6EF" colorOpacity="100" disabledButtonColor="" disabledButtonColorOpacity="100" disabledButtonTextColor="" disabledItemColor="" disabledItemColorOpacity="100" disabledItemTextColor="" footerStyle="FOOTER_STYLE_BUTTON_TEXT" highlightedButtonColor="" highlightedButtonColorOpacity="100" highlightedButtonTextColor="" highlightedItemColor="" highlightedItemColorOpacity="100" highlightedItemTextColor="" normalButtonColor="" normalButtonColorOpacity="100" normalButtonTextColor="" normalItemColor="" normalItemColorOpacity="100" normalItemTextColor="" pressedButtonColor="" pressedButtonColorOpacity="100" pressedButtonTextColor="" pressedItemColor="" pressedItemColorOpacity="100" pressedItemTextColor="" selectedItemColor="" selectedItemColorOpacity="100" selectedItemTextColor="" showBackButton="true"/>
         <itemSet>
-            <footerItem actionId="80001" disabledIconPath="" highlightedIconPath="" normalIconPath="" pressedIconPath="" selectedIconPath="" text="::IDS_CLD_SK3_DONE"/>
+            <footerItem actionId="71001" disabledIconPath="" highlightedIconPath="" normalIconPath="" pressedIconPath="" selectedIconPath="" text="::IDS_CLD_SK3_DONE"/>
         </itemSet>
     </Footer>
     <Header>
index 7fc1e68..3a138f5 100644 (file)
@@ -6,22 +6,22 @@
 <ScenePopup Bversion="3.0.0.201212201745" Dversion="20120315">
     <Popup id="IDL_TWO_BUTTON_POPUP">
         <property color="" titleText="" titleTextColor=""/>
-        <layout height="228" mode="Portrait" style="" type="LAYOUT_RELATIVE" width="688"/>
-        <layout height="228" mode="Landscape" style="" type="LAYOUT_RELATIVE" width="688"/>
+        <layout height="278" mode="Portrait" style="" type="LAYOUT_RELATIVE" width="688"/>
+        <layout height="278" mode="Landscape" style="" type="LAYOUT_RELATIVE" width="688"/>
     </Popup>
     <Label id="IDC_LABEL" parent="IDL_TWO_BUTTON_POPUP">
         <property backgroundBitmapPath="" backgroundColor="" backgroundColorOpacity="0" horizontalAlign="ALIGN_CENTER" text="::IDS_COM_POP_DELETE_Q" textColor="" textSize="38" textStyle="LABEL_TEXT_STYLE_BOLD" verticalAlign="ALIGN_MIDDLE"/>
-        <layout bottomRelation="IDL_TWO_BUTTON_POPUP" bottomRelationType="RECT_EDGE_RELATION_BOTTOM_TO_BOTTOM" centerHorizontal="true" centerVertical="false" height="110" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="IDL_TWO_BUTTON_POPUP" leftRelationType="RECT_EDGE_RELATION_LEFT_TO_LEFT" marginBottom="114" marginLeft="0" marginRight="0" marginTop="0" mode="Portrait" rightRelation="IDL_TWO_BUTTON_POPUP" rightRelationType="RECT_EDGE_RELATION_RIGHT_TO_RIGHT" topRelation="IDL_TWO_BUTTON_POPUP" topRelationType="RECT_EDGE_RELATION_TOP_TO_TOP" verticalFitPolicy="FIT_POLICY_FIXED" width="630" x="0" y="0"/>
-        <layout bottomRelation="IDL_TWO_BUTTON_POPUP" bottomRelationType="RECT_EDGE_RELATION_BOTTOM_TO_BOTTOM" centerHorizontal="true" centerVertical="false" height="110" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="IDL_TWO_BUTTON_POPUP" leftRelationType="RECT_EDGE_RELATION_LEFT_TO_LEFT" marginBottom="114" marginLeft="0" marginRight="0" marginTop="0" mode="Landscape" rightRelation="IDL_TWO_BUTTON_POPUP" rightRelationType="RECT_EDGE_RELATION_RIGHT_TO_RIGHT" topRelation="IDL_TWO_BUTTON_POPUP" topRelationType="RECT_EDGE_RELATION_TOP_TO_TOP" verticalFitPolicy="FIT_POLICY_FIXED" width="630" x="0" y="0"/>
+        <layout bottomRelation="IDL_TWO_BUTTON_POPUP" bottomRelationType="RECT_EDGE_RELATION_BOTTOM_TO_BOTTOM" centerHorizontal="true" centerVertical="false" height="160" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="IDL_TWO_BUTTON_POPUP" leftRelationType="RECT_EDGE_RELATION_LEFT_TO_LEFT" marginBottom="114" marginLeft="0" marginRight="0" marginTop="0" mode="Portrait" rightRelation="IDL_TWO_BUTTON_POPUP" rightRelationType="RECT_EDGE_RELATION_RIGHT_TO_RIGHT" topRelation="IDL_TWO_BUTTON_POPUP" topRelationType="RECT_EDGE_RELATION_TOP_TO_TOP" verticalFitPolicy="FIT_POLICY_FIXED" width="630" x="0" y="0"/>
+        <layout bottomRelation="IDL_TWO_BUTTON_POPUP" bottomRelationType="RECT_EDGE_RELATION_BOTTOM_TO_BOTTOM" centerHorizontal="true" centerVertical="false" height="160" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="IDL_TWO_BUTTON_POPUP" leftRelationType="RECT_EDGE_RELATION_LEFT_TO_LEFT" marginBottom="114" marginLeft="0" marginRight="0" marginTop="0" mode="Landscape" rightRelation="IDL_TWO_BUTTON_POPUP" rightRelationType="RECT_EDGE_RELATION_RIGHT_TO_RIGHT" topRelation="IDL_TWO_BUTTON_POPUP" topRelationType="RECT_EDGE_RELATION_TOP_TO_TOP" verticalFitPolicy="FIT_POLICY_FIXED" width="630" x="0" y="0"/>
     </Label>
     <Button id="IDC_BUTTON_DELETE" parent="IDL_TWO_BUTTON_POPUP">
         <property disableTextColor="" disabledBitmapPath="" disabledColor="" disabledColorOpacity="100" highlightedBGBitmapPath="" highlightedColor="#C24747" highlightedColorOpacity="100" highlightedTextColor="#FFFFFF" horizontalAlign="ALIGN_CENTER" normalBGBitmapPath="" normalBitmapPath="" normalColor="#D05252" normalColorOpacity="100" normalTextColor="#FFFFFF" pressedBGBitmapPath="" pressedBitmapPath="" pressedColor="#C24747" pressedColorOpacity="100" pressedTextColor="#FFFFFF" text="::IDS_CLD_SK3_DELETE" textSize="33" verticalAlign="ALIGN_MIDDLE"/>
-        <layout bottomRelation="IDL_TWO_BUTTON_POPUP" bottomRelationType="RECT_EDGE_RELATION_BOTTOM_TO_BOTTOM" centerHorizontal="false" centerVertical="false" height="74" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="IDL_TWO_BUTTON_POPUP" leftRelationType="RECT_EDGE_RELATION_LEFT_TO_LEFT" marginBottom="24" marginLeft="0" marginRight="0" marginTop="0" mode="Portrait" rightRelation="" rightRelationType="" topRelation="" topRelationType="" verticalFitPolicy="FIT_POLICY_FIXED" width="316" x="0" y="178"/>
-        <layout bottomRelation="IDL_TWO_BUTTON_POPUP" bottomRelationType="RECT_EDGE_RELATION_BOTTOM_TO_BOTTOM" centerHorizontal="false" centerVertical="false" height="74" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="IDL_TWO_BUTTON_POPUP" leftRelationType="RECT_EDGE_RELATION_LEFT_TO_LEFT" marginBottom="24" marginLeft="0" marginRight="0" marginTop="0" mode="Landscape" rightRelation="" rightRelationType="" topRelation="" topRelationType="" verticalFitPolicy="FIT_POLICY_FIXED" width="316" x="0" y="178"/>
+        <layout bottomRelation="IDL_TWO_BUTTON_POPUP" bottomRelationType="RECT_EDGE_RELATION_BOTTOM_TO_BOTTOM" centerHorizontal="false" centerVertical="false" height="74" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="IDL_TWO_BUTTON_POPUP" leftRelationType="RECT_EDGE_RELATION_LEFT_TO_LEFT" marginBottom="24" marginLeft="0" marginRight="0" marginTop="0" mode="Portrait" rightRelation="" rightRelationType="" topRelation="" topRelationType="" verticalFitPolicy="FIT_POLICY_FIXED" width="316" x="0" y="228"/>
+        <layout bottomRelation="IDL_TWO_BUTTON_POPUP" bottomRelationType="RECT_EDGE_RELATION_BOTTOM_TO_BOTTOM" centerHorizontal="false" centerVertical="false" height="74" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="IDL_TWO_BUTTON_POPUP" leftRelationType="RECT_EDGE_RELATION_LEFT_TO_LEFT" marginBottom="24" marginLeft="0" marginRight="0" marginTop="0" mode="Landscape" rightRelation="" rightRelationType="" topRelation="" topRelationType="" verticalFitPolicy="FIT_POLICY_FIXED" width="316" x="0" y="228"/>
     </Button>
     <Button id="IDC_BUTTON_CANCEL" parent="IDL_TWO_BUTTON_POPUP">
         <property disableTextColor="" disabledBitmapPath="" disabledColor="" disabledColorOpacity="100" highlightedBGBitmapPath="" highlightedColor="" highlightedColorOpacity="100" highlightedTextColor="" horizontalAlign="ALIGN_CENTER" normalBGBitmapPath="" normalBitmapPath="" normalColor="" normalColorOpacity="100" normalTextColor="" pressedBGBitmapPath="" pressedBitmapPath="" pressedColor="" pressedColorOpacity="100" pressedTextColor="" text="::IDS_CLD_SK_CANCEL" textSize="33" verticalAlign="ALIGN_MIDDLE"/>
-        <layout bottomRelation="IDL_TWO_BUTTON_POPUP" bottomRelationType="RECT_EDGE_RELATION_BOTTOM_TO_BOTTOM" centerHorizontal="false" centerVertical="false" height="74" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="" leftRelationType="" marginBottom="24" marginLeft="0" marginRight="0" marginTop="0" mode="Portrait" rightRelation="IDL_TWO_BUTTON_POPUP" rightRelationType="RECT_EDGE_RELATION_RIGHT_TO_RIGHT" topRelation="" topRelationType="" verticalFitPolicy="FIT_POLICY_FIXED" width="316" x="352" y="178"/>
-        <layout bottomRelation="IDL_TWO_BUTTON_POPUP" bottomRelationType="RECT_EDGE_RELATION_BOTTOM_TO_BOTTOM" centerHorizontal="false" centerVertical="false" height="74" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="" leftRelationType="" marginBottom="24" marginLeft="0" marginRight="0" marginTop="0" mode="Landscape" rightRelation="IDL_TWO_BUTTON_POPUP" rightRelationType="RECT_EDGE_RELATION_RIGHT_TO_RIGHT" topRelation="" topRelationType="" verticalFitPolicy="FIT_POLICY_FIXED" width="316" x="352" y="178"/>
+        <layout bottomRelation="IDL_TWO_BUTTON_POPUP" bottomRelationType="RECT_EDGE_RELATION_BOTTOM_TO_BOTTOM" centerHorizontal="false" centerVertical="false" height="74" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="" leftRelationType="" marginBottom="24" marginLeft="0" marginRight="0" marginTop="0" mode="Portrait" rightRelation="IDL_TWO_BUTTON_POPUP" rightRelationType="RECT_EDGE_RELATION_RIGHT_TO_RIGHT" topRelation="" topRelationType="" verticalFitPolicy="FIT_POLICY_FIXED" width="316" x="352" y="228"/>
+        <layout bottomRelation="IDL_TWO_BUTTON_POPUP" bottomRelationType="RECT_EDGE_RELATION_BOTTOM_TO_BOTTOM" centerHorizontal="false" centerVertical="false" height="74" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="" leftRelationType="" marginBottom="24" marginLeft="0" marginRight="0" marginTop="0" mode="Landscape" rightRelation="IDL_TWO_BUTTON_POPUP" rightRelationType="RECT_EDGE_RELATION_RIGHT_TO_RIGHT" topRelation="" topRelationType="" verticalFitPolicy="FIT_POLICY_FIXED" width="316" x="352" y="228"/>
     </Button>
 </ScenePopup>
diff --git a/res/screen-size-normal/IDL_VCS_SELECTOR_FORM.xml b/res/screen-size-normal/IDL_VCS_SELECTOR_FORM.xml
new file mode 100644 (file)
index 0000000..f010506
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+       This XML file was automatically generated by UiBuilder - do not modify by hand.
+-->
+<!DOCTYPE Scene SYSTEM "UIForm.dtd">
+
+<Scene Bversion="2.0.0.201304011930" Dversion="20120315">
+    <LogicalCoordinate>720</LogicalCoordinate>
+    <Form id="IDL_VCS_SELECTOR_FORM">
+        <property backgroundColor="" backgroundColorOpacity="100" notificationTrayOpenEnabled="false" orientation="Portrait" softKey0NormalIcon="" softKey0PressedIcon="" softKey0Text="" softKey1NormalIcon="" softKey1PressedIcon="" softKey1Text="" title="" titleAlign="ALIGN_CENTER" titleIcon="" translucentFooter="false" translucentHeader="false" translucentIndicator="false"/>
+        <layout mode="Portrait" style="FORM_STYLE_INDICATOR|FORM_STYLE_HEADER|FORM_STYLE_FOOTER" type="LAYOUT_RELATIVE"/>
+        <layout mode="Landscape" style="FORM_STYLE_INDICATOR|FORM_STYLE_HEADER|FORM_STYLE_FOOTER" type="LAYOUT_RELATIVE"/>
+    </Form>
+    <Footer>
+        <property backgroundBitmapPath="" color="" colorOpacity="100" disabledButtonColor="" disabledButtonColorOpacity="100" disabledButtonTextColor="" disabledItemColor="" disabledItemColorOpacity="100" disabledItemTextColor="" footerStyle="FOOTER_STYLE_BUTTON_TEXT" highlightedButtonColor="" highlightedButtonColorOpacity="100" highlightedButtonTextColor="" highlightedItemColor="" highlightedItemColorOpacity="100" highlightedItemTextColor="" normalButtonColor="" normalButtonColorOpacity="100" normalButtonTextColor="" normalItemColor="" normalItemColorOpacity="100" normalItemTextColor="" pressedButtonColor="" pressedButtonColorOpacity="100" pressedButtonTextColor="" pressedItemColor="" pressedItemColorOpacity="100" pressedItemTextColor="" selectedItemColor="" selectedItemColorOpacity="100" selectedItemTextColor="" showBackButton="true"/>
+        <buttonItem actionId="65001" disabledBGBitmapPath="" disabledIconPath="" highlightedBGBitmapPath="" highlightedIconPath="P01_icon_more_press.png" normalBGBitmapPath="" normalIconPath="P01_icon_more.png" position="BUTTON_POSITION_LEFT" pressedBGBitmapPath="" pressedIconPath="P01_icon_more_press.png" style="BUTTON_ITEM_STYLE_ICON" text="" type="left"/>
+        <itemSet/>
+    </Footer>
+    <Header>
+        <property accessibilityHint="" backgroundBitmapPath="" color="" colorOpacity="100" descriptionText="" descriptionTextColor="" disabledButtonColor="" disabledButtonColorOpacity="100" disabledButtonTextColor="" disabledItemColor="" disabledItemColorOpacity="100" disabledItemTextColor="" headerStyle="HEADER_STYLE_TITLE" highlightedButtonColor="" highlightedButtonColorOpacity="100" highlightedButtonTextColor="" highlightedItemColor="" highlightedItemColorOpacity="100" highlightedItemTextColor="" normalButtonColor="" normalButtonColorOpacity="100" normalButtonTextColor="" normalItemColor="" normalItemColorOpacity="100" normalItemTextColor="" pressedButtonColor="" pressedButtonColorOpacity="100" pressedButtonTextColor="" pressedItemColor="" pressedItemColorOpacity="100" pressedItemTextColor="" selectedItemColor="" selectedItemColorOpacity="100" selectedItemTextColor="" titleIconPath="" titleText="::IDS_COM_SK_SELECT" titleTextColor=""/>
+        <itemSet/>
+    </Header>
+    <ListView id="IDC_LISTVIEW" parent="IDL_VCS_SELECTOR_FORM">
+        <property backgroundBitmapPath="" backgroundColor="" backgroundColorOpacity="0" bitmapPathOfEmptyList="" colorOfEmptyListText="" fastScroll="false" itemDivider="true" itemDividerColor="" scrollInputMode="SCROLL_INPUT_MODE_ALLOW_ANY_DIRECTION" sweepEnabled="false" textOfEmptyList=""/>
+        <layout bottomRelation="IDL_VCS_SELECTOR_FORM" bottomRelationType="RECT_EDGE_RELATION_BOTTOM_TO_BOTTOM" centerHorizontal="false" centerVertical="false" height="1011.0" horizontalFitPolicy="FIT_POLICY_PARENT" leftRelation="IDL_VCS_SELECTOR_FORM" leftRelationType="RECT_EDGE_RELATION_LEFT_TO_LEFT" marginBottom="0.0" marginLeft="0.0" marginRight="0.0" marginTop="0.0" mode="Portrait" rightRelation="IDL_VCS_SELECTOR_FORM" rightRelationType="RECT_EDGE_RELATION_RIGHT_TO_RIGHT" topRelation="IDL_VCS_SELECTOR_FORM" topRelationType="RECT_EDGE_RELATION_TOP_TO_TOP" verticalFitPolicy="FIT_POLICY_PARENT" width="720.0" x="0" y="0"/>
+        <layout bottomRelation="" bottomRelationType="" centerHorizontal="false" centerVertical="false" height="124.0" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="" leftRelationType="" marginBottom="0.0" marginLeft="0.0" marginRight="0.0" marginTop="0.0" mode="Landscape" rightRelation="" rightRelationType="" topRelation="" topRelationType="" verticalFitPolicy="FIT_POLICY_FIXED" width="458.0" x="821.0" y="101.0"/>
+    </ListView>
+</Scene>
index b07c6d8..40bf7d7 100644 (file)
@@ -35,37 +35,49 @@ using namespace Tizen::Ui;
 using namespace Tizen::Ui::Controls;
 using namespace Tizen::Ui::Scenes;
 
-enum VcsType
-{
-       VCS_TYPE_NOT_VCS_FILE,
-       VCS_TYPE_VEVENT,
-       VCS_TYPE_VTODO
-};
 
-VcsType
-CheckVcsFileValidation(String& vcsFilePath)
+IList*
+ParseVcsFileN(String& vcsFilePath)
 {
-       File file;
-       if (file.Construct(vcsFilePath, L"r") != E_SUCCESS)
-       {
-               AppLogDebug("[E_FILE_NOT_FOUND] Unable to get vcs file from path.");
-               return VCS_TYPE_NOT_VCS_FILE;
-       }
+       ArrayList* pResultList = null;
+       IList* pEvents = Calendarbook::ParseEventsFromVcalendarN(vcsFilePath);
+       TryReturn(pEvents != null, null, "[%s] Unable to get event from vcs file.", GetErrorMessage(GetLastResult()));
+
+       IList* pTodos = Calendarbook::ParseTodosFromVcalendarN(vcsFilePath);
+       TryCatch(pTodos != null, , "[%s] Unable to get todo from vcs file.", GetErrorMessage(GetLastResult()));
 
-       String buffer;
-       while (file.Read(buffer) == E_SUCCESS)
+       pResultList = new (std::nothrow) ArrayList(SingleObjectDeleter);
+       pResultList->Construct(pEvents->GetCount() + pTodos->GetCount());
+
+       while (pEvents->GetCount() > 0 && pTodos->GetCount() > 0)
        {
-               if (buffer.StartsWith(L"BEGIN:VEVENT", 0) == true)
+               if (static_cast<CalEvent*>(pEvents->GetAt(0))->GetStartTime() > static_cast<CalTodo*>(pTodos->GetAt(0))->GetStartDate())
                {
-                       return VCS_TYPE_VEVENT;
+                       pResultList->Add(pTodos->GetAt(0));
+                       pTodos->RemoveAt(0, false);
                }
-               else if (buffer.StartsWith(L"BEGIN:VTODO", 0) == true)
+               else
                {
-                       return VCS_TYPE_VTODO;
+                       pResultList->Add(pEvents->GetAt(0));
+                       pEvents->RemoveAt(0, false);
                }
        }
+       while (pEvents->GetCount() > 0)
+       {
+               pResultList->Add(pEvents->GetAt(0));
+               pEvents->RemoveAt(0, false);
+       }
+       while (pTodos->GetCount() > 0)
+       {
+               pResultList->Add(pTodos->GetAt(0));
+               pTodos->RemoveAt(0, false);
+       }
+
+CATCH:
+       delete pEvents;
+       delete pTodos;
 
-       return VCS_TYPE_NOT_VCS_FILE;
+       return pResultList;
 }
 
 
@@ -74,16 +86,14 @@ CalendarApp::CalendarApp(void)
        , __requestId(INVALID_REQUEST_ID)
        , __initialScene(IDSCN_MONTH)
        , __pArgs(null)
+       , __pInitialSceneArgument(null)
 {
 }
 
 CalendarApp::~CalendarApp(void)
 {
-       if (__pArgs != null)
-       {
-               __pArgs->RemoveAll(true);
-               delete __pArgs;
-       }
+       delete __pArgs;
+       delete __pInitialSceneArgument;
 }
 
 UiApp*
@@ -133,6 +143,12 @@ CalendarApp::GetInitialScene(void) const
        return __initialScene;
 }
 
+const IList*
+CalendarApp::GetInitialSceneArgument(void) const
+{
+       return __pInitialSceneArgument;
+}
+
 const String&
 CalendarApp::GetMimeType(void) const
 {
@@ -248,7 +264,7 @@ CalendarApp::OnAppControlRequestReceived(RequestId reqId, const String& operatio
 
        if (pExtraData != null)
        {
-               HashMap* pArgs = new (std::nothrow) HashMap();
+               HashMap* pArgs = new (std::nothrow) HashMap(SingleObjectDeleter);
                pArgs->Construct(pExtraData->GetCount());
                IMapEnumerator* pEnum = pExtraData->GetMapEnumeratorN();
                while (pEnum->MoveNext() == E_SUCCESS)
@@ -271,14 +287,16 @@ CalendarApp::OnAppControlRequestReceived(RequestId reqId, const String& operatio
        }
        else if (operationId == ID_OPERATION_VIEW)
        {
-               if (__mimeType == MIME_TYPE_VCALENDAR && __uriScheme.StartsWith(FILE_URL_HEADER, 0) == true)
+               if (__uriScheme.StartsWith(FILE_URL_HEADER, 0) == true)
                {
                        String path = __uriScheme;
                        path.Replace(FILE_URL_HEADER, L"");
-                       VcsType vcsType = CheckVcsFileValidation(path);
-                       if (vcsType != VCS_TYPE_NOT_VCS_FILE)
+
+                       __pInitialSceneArgument = ParseVcsFileN(path);
+                       if (__pInitialSceneArgument != null)
                        {
-                               __initialScene = (vcsType == VCS_TYPE_VEVENT) ? IDSCN_EVENT_DETAILS : IDSCN_TASK_DETAILS;
+                               __initialScene = IDSCN_VCS_SELECTOR;
+                               __mimeType = MIME_TYPE_VCALENDAR;
                                __type = OPERATION_TYPE_VIEW;
                                requestFailed = false;
                        }
index 09eb79f..812f1e2 100755 (executable)
@@ -40,11 +40,11 @@ using namespace Tizen::Ui::Controls;
 using namespace Tizen::Ui::Scenes;
 using namespace Tizen::Locales;
 
-static const int IDA_EVENT_DELETER_FORM_FOOTER_DELETE = 80001;
-static const int IDA_SELECT_ALL_CHECKED = 10001;
-static const int IDA_SELECT_ALL_UNCHECKED = 10002;
-static const int IDA_BEFORE_TODAY_CHECKED = 11001;
-static const int IDA_BEFORE_TODAY_UNCHECKED = 11002;
+static const int IDA_EVENT_DELETER_FORM_FOOTER_DELETE = 75001;
+static const int IDA_SELECT_ALL_CHECKED = 75010;
+static const int IDA_SELECT_ALL_UNCHECKED = 75011;
+static const int IDA_BEFORE_TODAY_CHECKED = 75020;
+static const int IDA_BEFORE_TODAY_UNCHECKED = 75021;
 
 static const int ID_LIST_ITEM_BEFORE_AFTER = 100;
 
index f87aa6a..0c5a27c 100644 (file)
@@ -267,10 +267,24 @@ EventDetailsForm::OnFormBackRequested(Form& source)
        {
                if (pApp->GetOperationType() != OPERATION_TYPE_MAIN)
                {
-//                     result r = SendAppControlResult(APP_CTRL_RESULT_SUCCEEDED);
-//                     AppLogDebugIf(r != E_SUCCESS, "[%s] Unable to return result.", GetErrorMessage(r));
+                       if (pApp->GetMimeType() == MIME_TYPE_VCALENDAR)
+                       {
+                               LinkedList* pArgs = null;
+                               if (__pPm->IsSaved() == true)
+                               {
+                                       pArgs = new (std::nothrow) LinkedList(SingleObjectDeleter);
+                                       pArgs->Add(new (std::nothrow) String(VALUE_CALENDAR_EVENT_TYPE));
+                                       pArgs->Add(new (std::nothrow) Integer(__pPm->GetEventId()));
+                               }
+                               SceneManager::GetInstance()->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), pArgs);
+                       }
+                       else
+                       {
+//                             result r = SendAppControlResult(APP_CTRL_RESULT_SUCCEEDED);
+//                             AppLogDebugIf(r != E_SUCCESS, "[%s] Unable to return result.", GetErrorMessage(r));
 
-                       pApp->Terminate();
+                               pApp->Terminate();
+                       }
                        return;
                }
        }
@@ -480,12 +494,6 @@ EventDetailsForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneI
                return;
        }
 
-       if (pArgs != null)
-       {
-               pArgs->RemoveAll(true);
-               delete pArgs;
-       }
-
        //AppControl
        result r = E_SUCCESS;
        RecordId eventId = INVALID_RECORD_ID;
@@ -507,43 +515,56 @@ EventDetailsForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneI
                        GetFooter()->RemoveButtonAt(BUTTON_POSITION_LEFT);
                        GetFooter()->RemoveAllItems();
                }
-               return;
        }
        else if (pApp->GetMimeType() == MIME_TYPE_VCALENDAR)
        {
-               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.");
+               TryCatch(dynamic_cast<CalEvent*>(pArgs->GetAt(0)) != null, , "[E_FAILURE] Unable to get event.");
 
-               if (__pCalendarSelectorPopup == null)
-               {
-                       __pCalendarSelectorPopup = new (std::nothrow) CalendarSelectorPopup();
-                       __pCalendarSelectorPopup->Initialize();
-               }
+               r = __pPm->SetEvent(static_cast<CalEvent&>(*pArgs->GetAt(0)));
+               TryCatch(r == E_SUCCESS, , "[E_FAILURE] Unable to set event to EventPresentationModel.");
 
-               if (GetFooter() != null)
+               Footer* pFooter = GetFooter();
+               pFooter->RemoveAllItems();
+               pFooter->RemoveAllButtons();
+               pFooter->SetStyle(FOOTER_STYLE_BUTTON_TEXT);
+               pFooter->SetBackButtonEnabled(true);
+               pFooter->SetBackButton();
+
+               if (__pPm->IsSaved() == false)
                {
-                       Footer* pFooter = GetFooter();
-                       pFooter->RemoveAllItems();
-                       pFooter->RemoveAllButtons();
-                       pFooter->SetStyle(FOOTER_STYLE_BUTTON_TEXT);
-                       pFooter->SetBackButtonEnabled(true);
-                       pFooter->SetBackButton();
+                       if (__pCalendarSelectorPopup == null)
+                       {
+                               __pCalendarSelectorPopup = new (std::nothrow) CalendarSelectorPopup();
+                               __pCalendarSelectorPopup->Initialize();
+                       }
 
                        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.");
-
 CATCH:
-       SendAppControlResult(APP_CTRL_RESULT_FAILED);
-       UiApp::GetInstance()->Terminate();
+       if (pArgs != null)
+       {
+               pArgs->RemoveAll(true);
+               delete pArgs;
+       }
+
+       if (r != E_SUCCESS)
+       {
+               AppLogDebug("[E_FAILURE] Invalid arguments.");
+               if (pApp->GetMimeType() == MIME_TYPE_VCALENDAR)
+               {
+                       SceneManager::GetInstance()->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT));
+               }
+               else
+               {
+                       SendAppControlResult(APP_CTRL_RESULT_FAILED);
+                       UiApp::GetInstance()->Terminate();
+               }
+       }
 }
 
 void
index 339ecb9..cb1824a 100644 (file)
@@ -490,6 +490,25 @@ EventPresentationModel::SetCalendar(const RecordId calendarId)
 }
 
 result
+EventPresentationModel::SetEvent(const CalEvent& event)
+{
+       delete __pEvent;
+       __pEvent = new (std::nothrow) CalEvent(event);
+
+       delete __pCalendar;
+       if (__pEvent->GetCalendarId() != INVALID_RECORD_ID)
+       {
+               __pCalendar = __pCalendarbook->GetCalendarN(__pEvent->GetCalendarId());
+       }
+       else
+       {
+               __pCalendar = __pCalendarbook->GetCalendarN(ID_DEFAULT_EVENT_CALENDAR);
+       }
+
+       return E_SUCCESS;
+}
+
+result
 EventPresentationModel::SetEventId(const RecordId eventId)
 {
        CalEvent* pEvent = null;
index 1b89afb..37f39bc 100644 (file)
@@ -37,7 +37,7 @@ using namespace Tizen::Ui;
 using namespace Tizen::Ui::Controls;
 using namespace Tizen::Ui::Scenes;
 
-const int IDA_EVENT_SELECTOR_FORM_FOOTER_DONE = 80001;
+const int IDA_EVENT_SELECTOR_FORM_FOOTER_DONE = 70001;
 
 EventSelectorForm::EventSelectorForm(void)
        : __selectionType(EVENT_SELECTOR_FORM_SELECTION_TYPE_SINGLE)
index 62d6b58..27e2ba2 100644 (file)
@@ -29,6 +29,7 @@
 #include "ClEventSelectorForm.h"
 #include "ClEventDeleterForm.h"
 #include "ClFormFactory.h"
+#include "ClImportForm.h"
 #include "ClMainForm.h"
 #include "ClReminderForm.h"
 #include "ClRepeatForm.h"
@@ -36,6 +37,7 @@
 #include "ClTaskDetailsForm.h"
 #include "ClTaskSelectorForm.h"
 #include "ClTypes.h"
+#include "ClVcsSelectorForm.h"
 
 using namespace Tizen::Base;
 using namespace Tizen::Ui;
@@ -149,6 +151,20 @@ FormFactory::CreateFormN(const String& formId, const SceneId& sceneId)
                SceneManager::GetInstance()->AddSceneEventListener(sceneId, *pSettingForm);
                pForm = pSettingForm;
        }
+       else if (formId == IDC_VCS_SELECTOR_FORM)
+       {
+               VcsSelectorForm* pVcsSelectorForm = new (std::nothrow) VcsSelectorForm();
+               r = pVcsSelectorForm->Initialize();
+               SceneManager::GetInstance()->AddSceneEventListener(sceneId, *pVcsSelectorForm);
+               pForm = pVcsSelectorForm;
+       }
+       else if (formId == IDC_IMPORT_FORM)
+       {
+               ImportForm* pImportForm = new (std::nothrow) ImportForm();
+               r = pImportForm->Initialize();
+               SceneManager::GetInstance()->AddSceneEventListener(sceneId, *pImportForm);
+               pForm = pImportForm;
+       }
 
        TryCatch(r == E_SUCCESS, , "[%s] Unable to initialize %ls.", GetErrorMessage(r), formId.GetPointer());
        return pForm;
diff --git a/src/ClImportForm.cpp b/src/ClImportForm.cpp
new file mode 100644 (file)
index 0000000..e2c2463
--- /dev/null
@@ -0,0 +1,492 @@
+//
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://floralicense.org/license/
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an AS IS BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file       ClImportForm.cpp
+ * @brief      This is the implementation file for the ImportForm class.
+ */
+
+#include <new>
+#include "ClCalendarSelectorPopup.h"
+#include "ClEventItem.h"
+#include "ClImportForm.h"
+#include "ClResourceManager.h"
+#include "ClTaskItem.h"
+#include "ClTypes.h"
+
+using namespace Tizen;
+using namespace Tizen::Base;
+using namespace Tizen::Base::Collection;
+using namespace Tizen::Graphics;
+using namespace Tizen::Social;
+using namespace Tizen::Ui;
+using namespace Tizen::Ui::Controls;
+using namespace Tizen::Ui::Scenes;
+
+static const int IDA_IMPORT_FORM_SELECT_ALL = 90001;
+static const int IDA_IMPORT_FORM_ADD_TO_CALENDAR = 90010;
+
+
+ImportForm::ImportForm(void)
+       : __pList(null)
+       , __pListViewContents(null)
+       , __pDateTimeFormatter(null)
+       , __pDateFormatter(null)
+       , __pTimeFormatter(null)
+       , __pCalendarbook(null)
+       , __pCalendarSelectorPopup(null)
+{
+}
+
+ImportForm::~ImportForm(void)
+{
+}
+
+result
+ImportForm::Initialize(void)
+{
+       return Construct(L"IDL_IMPORT_FORM");
+}
+
+result
+ImportForm::OnInitializing(void)
+{
+       __pListViewContents = dynamic_cast<ListView*>(GetControl(L"IDC_LISTVIEW"));
+       TryReturn(__pListViewContents != null, E_FAILURE, "[E_FAILURE] Unable to get listview.");
+       __pListViewContents->SetItemProvider(*this);
+
+       SetFormBackEventListener(this);
+       GetHeader()->AddActionEventListener(*this);
+       GetFooter()->AddActionEventListener(*this);
+
+       __pDateTimeFormatter = ResourceManager::CreateDateTimeFormatterN(Locales::DATE_TIME_STYLE_SHORT);
+       TryReturn(__pDateTimeFormatter != null, E_FAILURE, "[E_FAILURE] Unable to create date time formatter.");
+
+       __pDateFormatter = ResourceManager::CreateDateFormatterN(Locales::DATE_TIME_STYLE_SHORT);
+       TryReturn(__pDateTimeFormatter != null, E_FAILURE, "[E_FAILURE] Unable to create date formatter.");
+
+       __pTimeFormatter = ResourceManager::CreateTimeFormatterN();
+       TryReturn(__pDateTimeFormatter != null, E_FAILURE, "[E_FAILURE] Unable to create time formatter.");
+
+       __pCalendarbook = new (std::nothrow) Calendarbook();
+       __pCalendarbook->Construct();
+
+       __pCalendarSelectorPopup = new (std::nothrow) CalendarSelectorPopup();
+       __pCalendarSelectorPopup->Initialize();
+
+       return E_SUCCESS;
+}
+
+result
+ImportForm::OnTerminating(void)
+{
+       delete __pDateTimeFormatter;
+       delete __pDateFormatter;
+       delete __pTimeFormatter;
+       delete __pCalendarbook;
+       delete __pCalendarSelectorPopup;
+       return E_SUCCESS;
+}
+
+void
+ImportForm::OnUserEventReceivedN(RequestId requestId, IList* pArgs)
+{
+       switch (requestId)
+       {
+       case IDA_CALENDAR_SELECTOR_POPUP_DONE:
+               if (pArgs != null)
+               {
+                       RecordId calendarId = static_cast<Integer*>(pArgs->GetAt(0))->value;
+                       Calendar* pCalendar = __pCalendarbook->GetCalendarN(calendarId);
+                       if (pCalendar != null)
+                       {
+                               IEnumerator* pEnum = __pList->GetEnumeratorN();
+                               int index = 0;
+                               if ((pCalendar->GetItemType() | CALENDAR_ITEM_TYPE_EVENT_ONLY) != 0)
+                               {
+                                       while (pEnum->MoveNext() == E_SUCCESS)
+                                       {
+                                               if (__pListViewContents->IsItemChecked(index) == true)
+                                               {
+                                                       CalEvent* pEvent = dynamic_cast<CalEvent*>(pEnum->GetCurrent());
+                                                       if (pEvent != null)
+                                                       {
+                                                               if (pEvent->GetRecordId() == INVALID_RECORD_ID)
+                                                               {
+                                                                       __pCalendarbook->AddEvent(*pEvent, calendarId);
+                                                               }
+                                                               __pListViewContents->SetItemChecked(index, false);
+                                                       }
+                                               }
+                                               ++index;
+                                       }
+                               }
+                               pEnum->Reset();
+                               index = 0;
+                               if ((pCalendar->GetItemType() | CALENDAR_ITEM_TYPE_TODO_ONLY) != 0)
+                               {
+                                       while (pEnum->MoveNext() == E_SUCCESS)
+                                       {
+                                               if (__pListViewContents->IsItemChecked(index) == true)
+                                               {
+                                                       CalTodo* pTodo = dynamic_cast<CalTodo*>(pEnum->GetCurrent());
+                                                       if (pTodo != null)
+                                                       {
+                                                               if (pTodo->GetRecordId() == INVALID_RECORD_ID)
+                                                               {
+                                                                       __pCalendarbook->AddTodo(*pTodo, calendarId);
+                                                               }
+                                                               __pListViewContents->SetItemChecked(index, false);
+                                                       }
+                                               }
+                                       }
+                               }
+                               delete pEnum;
+                       }
+
+                       if (IsTodoItemChecked() == true)
+                       {
+                               __pCalendarSelectorPopup->RequestCalendar(CALENDAR_SELECTOR_POPUP_STYLE_TODO, this);
+                       }
+
+                       __pListViewContents->UpdateList();
+
+                       if (IsAllItemAdded() == true)
+                       {
+                               GetHeader()->RemoveAllButtons();
+                               GetHeader()->Invalidate(true);
+                               GetFooter()->RemoveAllItems();
+                               GetFooter()->Invalidate(true);
+                       }
+               }
+               break;
+       }
+
+       if (pArgs != null)
+       {
+               pArgs->RemoveAll(true);
+               delete pArgs;
+       }
+}
+
+void
+ImportForm::OnActionPerformed(const Control& source, int actionId)
+{
+       bool checkFlag = false;
+       int count = __pList->GetCount();
+       switch (actionId)
+       {
+       case IDA_IMPORT_FORM_SELECT_ALL:
+               checkFlag = IsAllItemChecked() == false;
+               for (int i = 0; i < count; ++i)
+               {
+                       __pListViewContents->SetItemChecked(i, checkFlag);
+               }
+               __pListViewContents->Invalidate(true);
+               break;
+       case IDA_IMPORT_FORM_ADD_TO_CALENDAR:
+               if (IsEventItemChecked() == true)
+               {
+                       __pCalendarSelectorPopup->RequestCalendar(CALENDAR_SELECTOR_POPUP_STYLE_EVENT, this);
+               }
+               else if (IsTodoItemChecked() == true)
+               {
+                       __pCalendarSelectorPopup->RequestCalendar(CALENDAR_SELECTOR_POPUP_STYLE_TODO, this);
+               }
+               break;
+       }
+}
+
+void
+ImportForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source)
+{
+       SceneManager::GetInstance()->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT));
+}
+
+int
+ImportForm::GetItemCount(void)
+{
+       if (__pList == null)
+       {
+               return 0;
+       }
+       return __pList->GetCount();
+}
+
+ListItemBase*
+ImportForm::CreateItem(int index, int itemWidth)
+{
+       CalEvent* pEvent = dynamic_cast<CalEvent*>(__pList->GetAt(index));
+       if (pEvent != null)
+       {
+               EventItem* pItem = new (std::nothrow) EventItem();
+               pItem->Initialize(pEvent->GetRecordId() != INVALID_RECORD_ID ? EVENT_ITEM_STYLE_NORMAL : EVENT_ITEM_STYLE_SELECTION, itemWidth);
+               pItem->SetTitle(pEvent->GetSubject());
+               pItem->SetCalendarColor(pEvent->GetRecordId() != INVALID_RECORD_ID ? GetCalendarColor(pEvent->GetCalendarId()) : Color());
+               pItem->SetLocation(pEvent->GetLocation());
+               DateTime startTime = ResourceManager::ConvertUtcTimeToWallTime(pEvent->GetStartTime());
+               DateTime endTime = ResourceManager::ConvertUtcTimeToWallTime(pEvent->GetEndTime());
+               pItem->SetDateRangeText(GetDateRangeText(startTime, endTime, pEvent->IsAllDayEvent()));
+               pItem->SetReminder(pEvent->GetAllReminders().GetCount() > 0);
+               pItem->SetRepeat(pEvent->IsRecurring());
+               pItem->SetPriority(pEvent->GetPriority());
+       //      pItem->SetFacebookEvent(false);
+               pItem->UpdateElements();
+               return pItem;
+       }
+
+       CalTodo* pTodo = dynamic_cast<CalTodo*>(__pList->GetAt(index));
+       if (pTodo != null)
+       {
+               TaskItem* pItem = new (std::nothrow) TaskItem();
+               pItem->Initialize(pTodo->GetRecordId() != INVALID_RECORD_ID ? TASK_ITEM_STYLE_NORMAL : TASK_ITEM_STYLE_SELECTION, itemWidth);
+               pItem->SetTitle(pTodo->GetSubject());
+               pItem->SetCalendarColor(pTodo->GetRecordId() != INVALID_RECORD_ID ? GetCalendarColor(pTodo->GetCalendarId()) : Color());
+               pItem->SetLocation(pTodo->GetLocation());
+               pItem->SetDueDate(ResourceManager::ConvertUtcTimeToWallTime(pTodo->GetDueDate()), __pDateTimeFormatter);
+               pItem->SetReminder(pTodo->GetAllReminders().GetCount() > 0);
+       //      pItem->SetFacebookEvent(false);
+
+               switch (pTodo->GetPriority())
+               {
+               case TODO_PRIORITY_LOW:
+                       pItem->SetPriority(TASK_PRIORITY_LOW);
+                       break;
+               case TODO_PRIORITY_NORMAL:
+                       pItem->SetPriority(TASK_PRIORITY_NORMAL);
+                       break;
+               case TODO_PRIORITY_HIGH:
+                       pItem->SetPriority(TASK_PRIORITY_HIGH);
+                       break;
+               }
+
+               switch (pTodo->GetStatus())
+               {
+               case TODO_STATUS_COMPLETED:
+                       pItem->SetCompleted(true);
+                       break;
+               case TODO_STATUS_CANCELLED:
+                       pItem->SetCanceled(true);
+                       break;
+               default:
+                       break;
+               }
+
+               pItem->UpdateElements();
+               return pItem;
+       }
+
+       return null;
+}
+
+bool
+ImportForm::DeleteItem(int index, ListItemBase* pItem, int itemWidth)
+{
+       delete pItem;
+       return true;
+}
+
+void
+ImportForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& currentSceneId, IList* pArgs)
+{
+       if (pArgs != null)
+       {
+               if (dynamic_cast<CalEvent*>(pArgs->GetAt(0)) != null || dynamic_cast<CalTodo*>(pArgs->GetAt(0)) != null)
+               {
+                       __pList = pArgs;
+                       pArgs = null;
+               }
+               delete pArgs;
+       }
+
+       __pListViewContents->UpdateList();
+}
+
+void
+ImportForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& nextSceneId)
+{
+       __pList = null;
+}
+
+Color
+ImportForm::GetCalendarColor(const RecordId& calendarId) const
+{
+       Calendar* pCalendar = __pCalendarbook->GetCalendarN(calendarId);
+       TryReturn(pCalendar != null, Color(), "[E_FAILURE] Invalid calendar id.(ID=%d)", calendarId);
+
+       byte r;
+       byte g;
+       byte b;
+       pCalendar->GetColor(r, g, b);
+       delete pCalendar;
+       return Color(r, g, b);
+}
+
+String
+ImportForm::GetDateRangeText(const DateTime& start, const DateTime& end, bool isAllDayEvent) const
+{
+       if (start.GetYear() == end.GetYear() && start.GetMonth() == end.GetMonth() && start.GetDay() == end.GetDay())
+       {
+               String dateText;
+               __pDateFormatter->Format(start, dateText);
+               if (isAllDayEvent == true)
+               {
+                       return dateText;
+               }
+
+               String startText;
+               String endText;
+               __pTimeFormatter->Format(start, startText);
+               __pTimeFormatter->Format(end, endText);
+               return dateText + L" " + startText + L" ~ " + endText;
+       }
+
+       String startDateText;
+       String endDateText;
+       __pDateFormatter->Format(start, startDateText);
+       __pDateFormatter->Format(end, endDateText);
+       if (isAllDayEvent == true)
+       {
+               return startDateText + L" ~ " + endDateText;
+       }
+
+       String startTimeText;
+       String endTimeText;
+       __pTimeFormatter->Format(start, startTimeText);
+       __pTimeFormatter->Format(end, endTimeText);
+       return startDateText + L" " + startTimeText + L" ~ " + endDateText + L" " + endTimeText;
+}
+
+bool
+ImportForm::IsAllItemAdded(void) const
+{
+       if (__pList == null)
+       {
+               return true;
+       }
+
+       IEnumerator* pEnum = __pList->GetEnumeratorN();
+       while (pEnum->MoveNext() == E_SUCCESS)
+       {
+               CalEvent* pEvent = dynamic_cast<CalEvent*>(pEnum->GetCurrent());
+               if (pEvent != null)
+               {
+                       if (pEvent->GetRecordId() == INVALID_RECORD_ID)
+                       {
+                               delete pEnum;
+                               return false;
+                       }
+               }
+
+               CalTodo* pTodo = dynamic_cast<CalTodo*>(pEnum->GetCurrent());
+               if (pTodo != null)
+               {
+                       if (pTodo->GetRecordId() == INVALID_RECORD_ID)
+                       {
+                               delete pEnum;
+                               return false;
+                       }
+               }
+       }
+       delete pEnum;
+
+       return true;
+}
+
+bool
+ImportForm::IsAllItemChecked(void) const
+{
+       int index = 0;
+       IEnumerator* pEnum = __pList->GetEnumeratorN();
+       while (pEnum->MoveNext() == E_SUCCESS)
+       {
+               if (__pListViewContents->IsItemChecked(index) == false)
+               {
+                       CalEvent* pEvent = dynamic_cast<CalEvent*>(pEnum->GetCurrent());
+                       if (pEvent != null)
+                       {
+                               if (pEvent->GetRecordId() == INVALID_RECORD_ID)
+                               {
+                                       delete pEnum;
+                                       return false;
+                               }
+                       }
+
+                       CalTodo* pTodo = dynamic_cast<CalTodo*>(pEnum->GetCurrent());
+                       if (pTodo != null)
+                       {
+                               if (pTodo->GetRecordId() == INVALID_RECORD_ID)
+                               {
+                                       delete pEnum;
+                                       return false;
+                               }
+                       }
+               }
+               ++index;
+       }
+       delete pEnum;
+       return true;
+}
+
+bool
+ImportForm::IsEventItemChecked(void) const
+{
+       int index = 0;
+       IEnumerator* pEnum = __pList->GetEnumeratorN();
+       while (pEnum->MoveNext() == E_SUCCESS)
+       {
+               if (__pListViewContents->IsItemChecked(index) == true)
+               {
+                       CalEvent* pEvent = dynamic_cast<CalEvent*>(pEnum->GetCurrent());
+                       if (pEvent != null)
+                       {
+                               if (pEvent->GetRecordId() == INVALID_RECORD_ID)
+                               {
+                                       delete pEnum;
+                                       return true;
+                               }
+                       }
+               }
+               ++index;
+       }
+       delete pEnum;
+       return false;
+}
+
+bool
+ImportForm::IsTodoItemChecked(void) const
+{
+       int index = 0;
+       IEnumerator* pEnum = __pList->GetEnumeratorN();
+       while (pEnum->MoveNext() == E_SUCCESS)
+       {
+               if (__pListViewContents->IsItemChecked(index) == true)
+               {
+                       CalTodo* pTodo = dynamic_cast<CalTodo*>(pEnum->GetCurrent());
+                       if (pTodo != null)
+                       {
+                               if (pTodo->GetRecordId() == INVALID_RECORD_ID)
+                               {
+                                       delete pEnum;
+                                       return true;
+                               }
+                       }
+               }
+               ++index;
+       }
+       delete pEnum;
+       return false;
+}
index 64126df..5e58be6 100644 (file)
@@ -49,8 +49,7 @@ MainFrame::OnInitializing(void)
        CalendarApp* pApp = static_cast<CalendarApp*>(UiApp::GetInstance());
        AppAssertf(pApp != null, "[E_FAILURE] Unable to get calendarapp.");
 
-//     IList* pArgs = (pApp->GetArguments() != null) ? pApp->GetArguments()->GetItemsN(0, pApp->GetArguments()->GetCount()) : null;
-       SceneManager::GetInstance()->GoForward(ForwardSceneTransition(pApp->GetInitialScene()), null);
+       SceneManager::GetInstance()->GoForward(ForwardSceneTransition(pApp->GetInitialScene()), pApp->GetInitialSceneArgument());
 
        return E_SUCCESS;
 }
index 6e91396..d854f54 100644 (file)
@@ -82,6 +82,8 @@ SceneRegister::RegisterAllScene(void)
        r |= pManager->RegisterScene(IDSCN_TASK_SELECTOR, IDC_TASK_SELECTOR_FORM, L"");
        r |= pManager->RegisterScene(IDSCN_TASK_DETAILS, IDC_TASK_DETAILS_FORM, L"");
        r |= pManager->RegisterScene(IDSCN_SETTING, IDC_SETTING_FORM, L"");
+       r |= pManager->RegisterScene(IDSCN_VCS_SELECTOR, IDC_VCS_SELECTOR_FORM, L"");
+       r |= pManager->RegisterScene(IDSCN_IMPORT, IDC_IMPORT_FORM, L"");
        TryReturn(r == E_SUCCESS, E_FAILURE, "[E_FAILURE] Unable to register scene.");
 
        return E_SUCCESS;
index 2d19a6d..a8f8f74 100644 (file)
@@ -61,7 +61,7 @@ enum
        SAVE_TO_ITEM_COUNT
 };
 
-static const int IDA_TASK_DETAILS_FORM_ADD_TO_CALENDAR = 80001;
+static const int IDA_TASK_DETAILS_FORM_ADD_TO_CALENDAR = 61001;
 
 static const int H_ITEM = 140;
 static const int H_MAIN_ITEM = 313;
@@ -181,6 +181,20 @@ TaskDetailsForm::OnUserEventReceivedN(RequestId requestId, IList* pArgs)
 void
 TaskDetailsForm::OnFormBackRequested(Form& source)
 {
+       CalendarApp* pApp = static_cast<CalendarApp*>(UiApp::GetInstance());
+       if (pApp != null && pApp->GetMimeType() == MIME_TYPE_VCALENDAR)
+       {
+               LinkedList* pArgs = null;
+               if (__pTask->GetRecordId() != INVALID_RECORD_ID)
+               {
+                       pArgs = new (std::nothrow) LinkedList(SingleObjectDeleter);
+                       pArgs->Add(new (std::nothrow) String(VALUE_CALENDAR_TODO_TYPE));
+                       pArgs->Add(new (std::nothrow) Integer(__pTask->GetRecordId()));
+               }
+               SceneManager::GetInstance()->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), pArgs);
+               return;
+       }
+
 //     result r = SendAppControlResult(APP_CTRL_RESULT_SUCCEEDED);
 //     AppLogDebugIf(r != E_SUCCESS, "[%s] Unable to return result.", GetErrorMessage(r));
 
@@ -348,15 +362,8 @@ TaskDetailsForm::OnSectionTableViewContextItemActivationStateChanged(SectionTabl
 void
 TaskDetailsForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& currentSceneId, IList* pArgs)
 {
-       if (pArgs != null)
-       {
-               pArgs->RemoveAll(true);
-               delete pArgs;
-       }
-
        CalendarApp* pApp = static_cast<CalendarApp*>(UiApp::GetInstance());
        result r = E_SUCCESS;
-       IList* pTodos = null;
        String path;
        RecordId todoId = INVALID_RECORD_ID;
        const String* pParseId = null;
@@ -375,37 +382,55 @@ TaskDetailsForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId
                TryCatch(__pTask != null, , "[E_FAILURE] Unable to get todo.");
 
                GetFooter()->RemoveAllItems();
+               GetFooter()->Invalidate(true);
        }
        else if (pApp->GetMimeType() == MIME_TYPE_VCALENDAR)
        {
-               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.");
+               TryCatch(dynamic_cast<CalTodo*>(pArgs->GetAt(0)) != null, , "[E_FAILURE] Unable to get todo.");
 
-               if (__pCalendarSelectorPopup == null)
+               delete __pTask;
+               __pTask = new (std::nothrow) CalTodo(static_cast<CalTodo&>(*pArgs->GetAt(0)));
+
+               if (__pTask->GetRecordId() == INVALID_RECORD_ID)
                {
-                       __pCalendarSelectorPopup = new (std::nothrow) CalendarSelectorPopup();
-                       __pCalendarSelectorPopup->Initialize();
+                       if (__pCalendarSelectorPopup == null)
+                       {
+                               __pCalendarSelectorPopup = new (std::nothrow) CalendarSelectorPopup();
+                               __pCalendarSelectorPopup->Initialize();
+                       }
+               }
+               else
+               {
+                       GetFooter()->RemoveAllItems();
+                       GetFooter()->Invalidate(true);
                }
-
-               __pTask = static_cast<CalTodo*>(pTodos->GetAt(0));
-               pTodos->RemoveAt(0, false);
-               pTodos->RemoveAll(true);
-               delete pTodos;
        }
-       return;
 
 CATCH:
-       SendAppControlResult(APP_CTRL_RESULT_FAILED);
-       UiApp::GetInstance()->Terminate();
+       if (pArgs != null)
+       {
+               pArgs->RemoveAll(true);
+               delete pArgs;
+       }
+
+       if (r != E_SUCCESS)
+       {
+               AppLogDebug("[E_FAILURE] Invalid arguments.");
+               if (pApp->GetMimeType() == MIME_TYPE_VCALENDAR)
+               {
+                       SceneManager::GetInstance()->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT));
+               }
+               else
+               {
+                       SendAppControlResult(APP_CTRL_RESULT_FAILED);
+                       UiApp::GetInstance()->Terminate();
+               }
+       }
 }
 
 void
 TaskDetailsForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& nextSceneId)
 {
-
 }
 
 void
index 7461eee..60af3f8 100644 (file)
@@ -47,7 +47,7 @@ enum ItemElementId
        ID_ITEM_ELEMENT_LOCATION
 };
 
-const int IDA_TASK_SELECTOR_FORM_FOOTER_DONE = 80001;
+const int IDA_TASK_SELECTOR_FORM_FOOTER_DONE = 71001;
 
 TaskSelectorForm::TaskSelectorForm(void)
        : __selectionType(TASK_SELECTOR_FORM_SELECTION_TYPE_MULTIPLE)
index a4e80fd..0c4dda4 100644 (file)
@@ -26,6 +26,7 @@ const wchar_t* IDSCN_YEAR = L"IDSCN_YEAR";
 const wchar_t* IDSCN_MONTH = L"IDSCN_MONTH";
 const wchar_t* IDSCN_DAY = L"IDSCN_DAY";
 const wchar_t* IDSCN_LIST = L"IDSCN_LIST";
+const wchar_t* IDSCN_CALENDAR_LIST = L"IDSCN_CALENDAR_LIST";
 const wchar_t* IDSCN_CALENDAR_SETTINGS = L"IDSCN_CALENDAR_SETTINGS";
 const wchar_t* IDSCN_DAY_EVENT_LIST = L"IDSCN_DAY_EVENT_LIST";
 const wchar_t* IDSCN_EVENT_DETAILS = L"IDSCN_EVENT_DETAILS";
@@ -33,12 +34,13 @@ const wchar_t* IDSCN_EVENT_DELETER = L"IDSCN_EVENT_DELETER";
 const wchar_t* IDSCN_EVENT_EDITOR = L"IDSCN_EVENT_EDITOR";
 const wchar_t* IDSCN_EVENT_SEARCHER = L"IDSCN_EVENT_SEARCHER";
 const wchar_t* IDSCN_EVENT_SELECTOR = L"IDSCN_EVENT_SELECTOR";
+const wchar_t* IDSCN_IMPORT = L"IDSCN_IMPORT";
 const wchar_t* IDSCN_REMINDER = L"IDSCN_REMINDER";
 const wchar_t* IDSCN_REPEAT = L"IDSCN_REPEAT";
-const wchar_t* IDSCN_CALENDAR_LIST = L"IDSCN_CALENDAR_LIST";
+const wchar_t* IDSCN_SETTING = L"IDSCN_SETTING";
 const wchar_t* IDSCN_TASK_SELECTOR = L"IDSCN_TASK_SELECTOR";
 const wchar_t* IDSCN_TASK_DETAILS = L"IDSCN_TASK_DETAILS";
-const wchar_t* IDSCN_SETTING = L"IDSCN_SETTING";
+const wchar_t* IDSCN_VCS_SELECTOR = L"IDSCN_VCS_SELECTOR";
 
 //FormId IDC_FORM
 const wchar_t* IDC_MAIN_FORM = L"IDC_MAIN_FORM";
@@ -50,11 +52,13 @@ const wchar_t* IDC_EVENT_DELETER_FORM = L"IDC_EVENT_DELETER_FORM";
 const wchar_t* IDC_EVENT_SELECTOR_FORM = L"IDC_EVENT_SELECTOR_FORM";
 const wchar_t* IDC_EVENT_EDITOR_FORM = L"IDC_EVENT_EDITOR_FORM";
 const wchar_t* IDC_EVENT_SEARCHER_FORM = L"IDC_EVENT_SEARCHER_FORM";
+const wchar_t* IDC_IMPORT_FORM = L"IDC_IMPORT_FORM";
 const wchar_t* IDC_REMINDER_FORM = L"IDC_REMINDER_FORM";
 const wchar_t* IDC_REPEAT_FORM = L"IDC_REPEAT_FORM";
+const wchar_t* IDC_SETTING_FORM = L"IDC_SETTING_FORM";
 const wchar_t* IDC_TASK_SELECTOR_FORM = L"IDC_TASK_SELECTOR_FORM";
 const wchar_t* IDC_TASK_DETAILS_FORM = L"IDC_TASK_DETAILS_FORM";
-const wchar_t* IDC_SETTING_FORM = L"IDC_SETTING_FORM";
+const wchar_t* IDC_VCS_SELECTOR_FORM = L"IDC_VCS_SELECTOR_FORM";
 
 //PanelId IDC_PANEL
 const wchar_t* IDC_YEAR_PANEL = L"IDC_YEAR_PANEL";
@@ -225,6 +229,7 @@ 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_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";
diff --git a/src/ClVcsSelectorForm.cpp b/src/ClVcsSelectorForm.cpp
new file mode 100644 (file)
index 0000000..f992c21
--- /dev/null
@@ -0,0 +1,396 @@
+//
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://floralicense.org/license/
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an AS IS BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file       ClVcsSelectorForm.cpp
+ * @brief      This is the implementation file for the VcsSelectorForm class.
+ */
+
+#include <new>
+#include <FApp.h>
+#include "ClCalendarApp.h"
+#include "ClEventItem.h"
+#include "ClResourceManager.h"
+#include "ClTaskItem.h"
+#include "ClTypes.h"
+#include "ClVcsSelectorForm.h"
+
+using namespace Tizen;
+using namespace Tizen::App;
+using namespace Tizen::Base;
+using namespace Tizen::Base::Collection;
+using namespace Tizen::Graphics;
+using namespace Tizen::Social;
+using namespace Tizen::Ui;
+using namespace Tizen::Ui::Controls;
+using namespace Tizen::Ui::Scenes;
+
+static const int IDA_VCS_SELECTOR_FORM_SUB_MENU = 65001;
+static const int IDA_VCS_SELECTOR_FORM_SUB_MENU_ADD_TO_CALENDAR = 65010;
+
+static const int W_MENU_MARGIN = 64;
+static const int H_HALF_BUTTON = 36;
+
+
+VcsSelectorForm::VcsSelectorForm(void)
+       : __pList(null)
+       , __pListViewContents(null)
+       , __pContextMenuSub(null)
+       , __pDateTimeFormatter(null)
+       , __pDateFormatter(null)
+       , __pTimeFormatter(null)
+       , __pCalendarbook(null)
+       , __selectedIndex(-1)
+{
+}
+
+VcsSelectorForm::~VcsSelectorForm(void)
+{
+}
+
+result
+VcsSelectorForm::Initialize(void)
+{
+       return Construct(L"IDL_VCS_SELECTOR_FORM");
+}
+
+result
+VcsSelectorForm::OnInitializing(void)
+{
+       __pListViewContents = dynamic_cast<ListView*>(GetControl(L"IDC_LISTVIEW"));
+       TryReturn(__pListViewContents != null, E_FAILURE, "[E_FAILURE] Unable to get listview.");
+       __pListViewContents->SetItemProvider(*this);
+       __pListViewContents->AddListViewItemEventListener(*this);
+
+       InitializeSubMenu();
+
+       SetFormBackEventListener(this);
+       GetFooter()->AddActionEventListener(*this);
+
+       __pDateTimeFormatter = ResourceManager::CreateDateTimeFormatterN(Locales::DATE_TIME_STYLE_SHORT);
+       TryReturn(__pDateTimeFormatter != null, E_FAILURE, "[E_FAILURE] Unable to create date time formatter.");
+
+       __pDateFormatter = ResourceManager::CreateDateFormatterN(Locales::DATE_TIME_STYLE_SHORT);
+       TryReturn(__pDateTimeFormatter != null, E_FAILURE, "[E_FAILURE] Unable to create date formatter.");
+
+       __pTimeFormatter = ResourceManager::CreateTimeFormatterN();
+       TryReturn(__pDateTimeFormatter != null, E_FAILURE, "[E_FAILURE] Unable to create time formatter.");
+
+       __pCalendarbook = new (std::nothrow) Calendarbook();
+       __pCalendarbook->Construct();
+
+       return E_SUCCESS;
+}
+
+result
+VcsSelectorForm::OnTerminating(void)
+{
+       delete __pContextMenuSub;
+       delete __pDateTimeFormatter;
+       delete __pDateFormatter;
+       delete __pTimeFormatter;
+       delete __pCalendarbook;
+       return E_SUCCESS;
+}
+
+void
+VcsSelectorForm::OnActionPerformed(const Control& source, int actionId)
+{
+       switch (actionId)
+       {
+       case IDA_VCS_SELECTOR_FORM_SUB_MENU:
+               __pContextMenuSub->SetShowState(true);
+               __pContextMenuSub->Show();
+               break;
+       case IDA_VCS_SELECTOR_FORM_SUB_MENU_ADD_TO_CALENDAR:
+               SceneManager::GetInstance()->GoForward(ForwardSceneTransition(IDSCN_IMPORT, SCENE_TRANSITION_ANIMATION_TYPE_LEFT), __pList);
+               break;
+       }
+}
+
+void
+VcsSelectorForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source)
+{
+       CalendarApp* pApp = static_cast<CalendarApp*>(UiApp::GetInstance());
+       pApp->Terminate();
+}
+
+void
+VcsSelectorForm::OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status)
+{
+       if (status == LIST_ITEM_STATUS_SELECTED)
+       {
+               CalEvent* pEvent = dynamic_cast<CalEvent*>(__pList->GetAt(index));
+               if (pEvent != null)
+               {
+                       LinkedList* pArgs = new (std::nothrow) LinkedList();
+                       pArgs->Add(new (std::nothrow) CalEvent(*pEvent));
+                       SceneManager::GetInstance()->GoForward(ForwardSceneTransition(IDSCN_EVENT_DETAILS, SCENE_TRANSITION_ANIMATION_TYPE_LEFT), pArgs);
+                       __selectedIndex = index;
+               }
+
+               CalTodo* pTodo = dynamic_cast<CalTodo*>(__pList->GetAt(index));
+               if (pTodo != null)
+               {
+                       LinkedList* pArgs = new (std::nothrow) LinkedList();
+                       pArgs->Add(new (std::nothrow) CalTodo(*pTodo));
+                       SceneManager::GetInstance()->GoForward(ForwardSceneTransition(IDSCN_TASK_DETAILS, SCENE_TRANSITION_ANIMATION_TYPE_LEFT), pArgs);
+                       __selectedIndex = index;
+               }
+       }
+}
+
+void
+VcsSelectorForm::OnListViewItemSwept(ListView& listView, int index, SweepDirection direction)
+{
+}
+
+void
+VcsSelectorForm::OnListViewContextItemStateChanged(ListView& listView, int index, int elementId, ListContextItemStatus status)
+{
+}
+
+int
+VcsSelectorForm::GetItemCount(void)
+{
+       if (__pList == null)
+       {
+               return 0;
+       }
+       return __pList->GetCount();
+}
+
+ListItemBase*
+VcsSelectorForm::CreateItem(int index, int itemWidth)
+{
+       CalEvent* pEvent = dynamic_cast<CalEvent*>(__pList->GetAt(index));
+       if (pEvent != null)
+       {
+               EventItem* pItem = new (std::nothrow) EventItem();
+               pItem->Initialize(EVENT_ITEM_STYLE_NORMAL, itemWidth);
+               pItem->SetTitle(pEvent->GetSubject());
+               pItem->SetCalendarColor(pEvent->GetRecordId() != INVALID_RECORD_ID ? GetCalendarColor(pEvent->GetCalendarId()) : Color());
+               pItem->SetLocation(pEvent->GetLocation());
+               DateTime startTime = ResourceManager::ConvertUtcTimeToWallTime(pEvent->GetStartTime());
+               DateTime endTime = ResourceManager::ConvertUtcTimeToWallTime(pEvent->GetEndTime());
+               pItem->SetDateRangeText(GetDateRangeText(startTime, endTime, pEvent->IsAllDayEvent()));
+               pItem->SetReminder(pEvent->GetAllReminders().GetCount() > 0);
+               pItem->SetRepeat(pEvent->IsRecurring());
+               pItem->SetPriority(pEvent->GetPriority());
+       //      pItem->SetFacebookEvent(false);
+               pItem->UpdateElements();
+               return pItem;
+       }
+
+       CalTodo* pTodo = dynamic_cast<CalTodo*>(__pList->GetAt(index));
+       if (pTodo != null)
+       {
+               TaskItem* pItem = new (std::nothrow) TaskItem();
+               pItem->Initialize(TASK_ITEM_STYLE_NORMAL, itemWidth);
+               pItem->SetTitle(pTodo->GetSubject());
+               pItem->SetCalendarColor(pTodo->GetRecordId() != INVALID_RECORD_ID ? GetCalendarColor(pTodo->GetCalendarId()) : Color());
+               pItem->SetLocation(pTodo->GetLocation());
+               pItem->SetDueDate(ResourceManager::ConvertUtcTimeToWallTime(pTodo->GetDueDate()), __pDateTimeFormatter);
+               pItem->SetReminder(pTodo->GetAllReminders().GetCount() > 0);
+       //      pItem->SetFacebookEvent(false);
+
+               switch (pTodo->GetPriority())
+               {
+               case TODO_PRIORITY_LOW:
+                       pItem->SetPriority(TASK_PRIORITY_LOW);
+                       break;
+               case TODO_PRIORITY_NORMAL:
+                       pItem->SetPriority(TASK_PRIORITY_NORMAL);
+                       break;
+               case TODO_PRIORITY_HIGH:
+                       pItem->SetPriority(TASK_PRIORITY_HIGH);
+                       break;
+               }
+
+               switch (pTodo->GetStatus())
+               {
+               case TODO_STATUS_COMPLETED:
+                       pItem->SetCompleted(true);
+                       break;
+               case TODO_STATUS_CANCELLED:
+                       pItem->SetCanceled(true);
+                       break;
+               default:
+                       break;
+               }
+
+               pItem->UpdateElements();
+               return pItem;
+       }
+
+       return null;
+}
+
+bool
+VcsSelectorForm::DeleteItem(int index, ListItemBase* pItem, int itemWidth)
+{
+       delete pItem;
+       return true;
+}
+
+void
+VcsSelectorForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& currentSceneId, IList* pArgs)
+{
+       if (pArgs != null)
+       {
+               String* pItemType = dynamic_cast<String*>(pArgs->GetAt(0));
+               if (pItemType != null && __selectedIndex >= 0)
+               {
+                       Integer* pItemId = static_cast<Integer*>(pArgs->GetAt(1));
+                       if (pItemType->Equals(VALUE_CALENDAR_EVENT_TYPE, false) == true)
+                       {
+                               CalEvent* pEvent = __pCalendarbook->GetEventN(pItemId->value);
+                               if (pEvent != null)
+                               {
+                                       __pList->SetAt(pEvent, __selectedIndex);
+                               }
+                       }
+                       else if (pItemType->Equals(VALUE_CALENDAR_TODO_TYPE, false) == true)
+                       {
+                               CalTodo* pTodo = __pCalendarbook->GetTodoN(pItemId->value);
+                               if (pTodo != null)
+                               {
+                                       __pList->SetAt(pTodo, __selectedIndex);
+                               }
+                       }
+               }
+               else if (dynamic_cast<CalEvent*>(pArgs->GetAt(0)) != null || dynamic_cast<CalTodo*>(pArgs->GetAt(0)) != null)
+               {
+                       __pList = pArgs;
+                       pArgs = null;
+               }
+               delete pArgs;
+       }
+       __selectedIndex = -1;
+
+       Footer* pFooter = GetFooter();
+       if (IsAllItemAdded() == true && pFooter->IsButtonSet(BUTTON_POSITION_LEFT) == true)
+       {
+               pFooter->RemoveButtonAt(BUTTON_POSITION_LEFT);
+               pFooter->Invalidate(true);
+       }
+
+       __pListViewContents->UpdateList();
+}
+
+void
+VcsSelectorForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& nextSceneId)
+{
+}
+
+Color
+VcsSelectorForm::GetCalendarColor(const RecordId& calendarId) const
+{
+       Calendar* pCalendar = __pCalendarbook->GetCalendarN(calendarId);
+       TryReturn(pCalendar != null, Color(), "[E_FAILURE] Invalid calendar id.(ID=%d)", calendarId);
+
+       byte r;
+       byte g;
+       byte b;
+       pCalendar->GetColor(r, g, b);
+       delete pCalendar;
+       return Color(r, g, b);
+}
+
+String
+VcsSelectorForm::GetDateRangeText(const DateTime& start, const DateTime& end, bool isAllDayEvent) const
+{
+       if (start.GetYear() == end.GetYear() && start.GetMonth() == end.GetMonth() && start.GetDay() == end.GetDay())
+       {
+               String dateText;
+               __pDateFormatter->Format(start, dateText);
+               if (isAllDayEvent == true)
+               {
+                       return dateText;
+               }
+
+               String startText;
+               String endText;
+               __pTimeFormatter->Format(start, startText);
+               __pTimeFormatter->Format(end, endText);
+               return dateText + L" " + startText + L" ~ " + endText;
+       }
+
+       String startDateText;
+       String endDateText;
+       __pDateFormatter->Format(start, startDateText);
+       __pDateFormatter->Format(end, endDateText);
+       if (isAllDayEvent == true)
+       {
+               return startDateText + L" ~ " + endDateText;
+       }
+
+       String startTimeText;
+       String endTimeText;
+       __pTimeFormatter->Format(start, startTimeText);
+       __pTimeFormatter->Format(end, endTimeText);
+       return startDateText + L" " + startTimeText + L" ~ " + endDateText + L" " + endTimeText;
+}
+
+void
+VcsSelectorForm::InitializeSubMenu(void)
+{
+       __pContextMenuSub = new (std::nothrow) ContextMenu();
+       __pContextMenuSub->Construct(Point(0, 0), CONTEXT_MENU_STYLE_LIST);
+       __pContextMenuSub->AddActionEventListener(*this);
+
+       Rectangle bounds = GetFooter()->GetBounds();
+       __pContextMenuSub->SetAnchorPosition(Point(bounds.x + W_MENU_MARGIN, bounds.y + bounds.height / 2 - H_HALF_BUTTON));
+
+       __pContextMenuSub->AddItem(ResourceManager::GetString(IDS_EMAIL_OPT_ADD_TO_CALENDAR), IDA_VCS_SELECTOR_FORM_SUB_MENU_ADD_TO_CALENDAR);
+       __pContextMenuSub->SetShowState(false);
+}
+
+bool
+VcsSelectorForm::IsAllItemAdded(void) const
+{
+       if (__pList == null)
+       {
+               return true;
+       }
+
+       IEnumerator* pEnum = __pList->GetEnumeratorN();
+       while (pEnum->MoveNext() == E_SUCCESS)
+       {
+               CalEvent* pEvent = dynamic_cast<CalEvent*>(pEnum->GetCurrent());
+               if (pEvent != null)
+               {
+                       if (pEvent->GetRecordId() == INVALID_RECORD_ID)
+                       {
+                               delete pEnum;
+                               return false;
+                       }
+               }
+
+               CalTodo* pTodo = dynamic_cast<CalTodo*>(pEnum->GetCurrent());
+               if (pTodo != null)
+               {
+                       if (pTodo->GetRecordId() == INVALID_RECORD_ID)
+                       {
+                               delete pEnum;
+                               return false;
+                       }
+               }
+       }
+       delete pEnum;
+
+       return true;
+}