Fix for N_SE-49811,N_SE-50411
authorGaurav Bhatt <gaurav.bhatt@samsung.com>
Thu, 29 Aug 2013 17:44:05 +0000 (23:14 +0530)
committerGaurav Bhatt <gaurav.bhatt@samsung.com>
Thu, 29 Aug 2013 17:44:05 +0000 (23:14 +0530)
Change-Id: Ie091dfc46200a8539f14d309a2da373e13557c97
Signed-off-by: Gaurav Bhatt <gaurav.bhatt@samsung.com>
inc/ClTypes.h
inc/ClYearPanel.h
res/screen-density-xhigh/P01_year_month_press.png [new file with mode: 0644]
src/ClImportForm.cpp
src/ClTypes.cpp
src/ClVcsSelectorForm.cpp
src/ClYearPanel.cpp

index b069529..9160433 100644 (file)
@@ -220,6 +220,7 @@ extern const wchar_t* IDB_MONTH_VIEW_BUBBLE_TODAY;
 
 extern const wchar_t* IDB_YEAR_DAY_FOCUS;
 extern const wchar_t* IDB_YEAR_MONTH_FOCUS;
+extern const wchar_t* IDB_YEAR_MONTH_PRESS;
 
 extern const wchar_t* IDB_BUTTON_MINUS;
 extern const wchar_t* IDB_BUTTON_MINUS_PRESS;
index c396abc..1ef6597 100644 (file)
@@ -90,6 +90,8 @@ private:
        Tizen::Graphics::Bitmap* __pBitmapHolidayText[YEAR_PANEL_COUNT_OF_DAY];
        Tizen::Graphics::Bitmap* __pBitmapTodayText[YEAR_PANEL_COUNT_OF_DAY];
        Tizen::Graphics::Bitmap* __pBitmapFocus;
+       Tizen::Graphics::Bitmap* __pBitmapPress;
+
        GoToDatePopup* __pGoToDatePopup;
 }; // YearPanel
 
diff --git a/res/screen-density-xhigh/P01_year_month_press.png b/res/screen-density-xhigh/P01_year_month_press.png
new file mode 100644 (file)
index 0000000..444707a
Binary files /dev/null and b/res/screen-density-xhigh/P01_year_month_press.png differ
index 43d03e7..09df513 100644 (file)
@@ -455,6 +455,22 @@ ImportForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& cur
        {
                if (pArgs->GetCount() == 0 || dynamic_cast<CalEvent*>(pArgs->GetAt(0)) != null || dynamic_cast<CalTodo*>(pArgs->GetAt(0)) != null)
                {
+                       IEnumerator* pEnum = pArgs->GetEnumeratorN();
+                       while (pEnum->MoveNext() == E_SUCCESS)
+                       {
+                               CalEvent *pEvent = dynamic_cast<CalEvent*>(pEnum->GetCurrent());
+                               CalTodo *pTodo = dynamic_cast<CalTodo*>(pEnum->GetCurrent());
+                               if (pEvent && ((pEvent->GetStartTime()).CompareTo(Calendarbook::GetMinDateTime()) < 0 ||
+                                               (pEvent->GetEndTime()).CompareTo(Calendarbook::GetMaxDateTime()) > 0))
+                               {
+                                       pArgs->Remove(*pEvent);
+                               }
+                               else if (pTodo && (pTodo->GetStartDate()).CompareTo(Calendarbook::GetMinDateTime()) < 0)
+                               {
+                                       pArgs->Remove(*pTodo);
+                               }
+                       }
+                       delete pEnum;
                        __pList = pArgs;
                        pArgs = null;
                }
index 2fb183a..af5dd80 100644 (file)
@@ -214,6 +214,7 @@ const wchar_t* IDB_MONTH_VIEW_BUBBLE_TODAY = L"P01_month-view_event_bubble_bg_to
 
 const wchar_t* IDB_YEAR_DAY_FOCUS = L"P01_year_day_focus.png";
 const wchar_t* IDB_YEAR_MONTH_FOCUS = L"P01_year_month_focus.png";
+const wchar_t* IDB_YEAR_MONTH_PRESS = L"P01_year_month_press.png";
 
 const wchar_t* IDB_BUTTON_MINUS = L"00_button_expand_minus_web.png";
 const wchar_t* IDB_BUTTON_MINUS_PRESS = L"00_button_expand_minus_press_web.png";
index 6425510..6354389 100644 (file)
@@ -317,7 +317,8 @@ VcsSelectorForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId
                        if (pItemType->Equals(VALUE_CALENDAR_EVENT_TYPE, false) == true)
                        {
                                CalEvent* pEvent = __pCalendarbook->GetEventN(pItemId->value);
-                               if (pEvent != null)
+                               if (pEvent != null && ((pEvent->GetStartTime()).CompareTo(Calendarbook::GetMinDateTime()) > 0 &&
+                                               (pEvent->GetEndTime()).CompareTo(Calendarbook::GetMaxDateTime()) < 0))
                                {
                                        __pList->SetAt(pEvent, __selectedIndex);
                                }
@@ -325,7 +326,7 @@ VcsSelectorForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId
                        else if (pItemType->Equals(VALUE_CALENDAR_TODO_TYPE, false) == true)
                        {
                                CalTodo* pTodo = __pCalendarbook->GetTodoN(pItemId->value);
-                               if (pTodo != null)
+                               if (pTodo != null && (pTodo->GetStartDate()).CompareTo(Calendarbook::GetMinDateTime()) > 0)
                                {
                                        __pList->SetAt(pTodo, __selectedIndex);
                                }
@@ -334,6 +335,21 @@ VcsSelectorForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId
                else if (dynamic_cast<CalEvent*>(pArgs->GetAt(0)) != null || dynamic_cast<CalTodo*>(pArgs->GetAt(0)) != null)
                {
                        delete __pList;
+                       IEnumerator* pEnum = pArgs->GetEnumeratorN();
+                       while (pEnum->MoveNext() == E_SUCCESS)
+                       {
+                               CalEvent *pEvent = dynamic_cast<CalEvent*>(pEnum->GetCurrent());
+                               CalTodo *pTodo = dynamic_cast<CalTodo*>(pEnum->GetCurrent());
+                               if (pEvent && ((pEvent->GetStartTime()).CompareTo(Calendarbook::GetMinDateTime()) < 0 ||
+                                               (pEvent->GetEndTime()).CompareTo(Calendarbook::GetMaxDateTime()) > 0))
+                               {
+                                       pArgs->Remove(*pEvent);
+                               }
+                               else if (pTodo && (pTodo->GetStartDate()).CompareTo(Calendarbook::GetMinDateTime()) < 0)
+                               {
+                                       pArgs->Remove(*pTodo);
+                               }
+                       }
                        __pList = pArgs;
                        pArgs = null;
                }
index de57a30..9ed97fe 100644 (file)
@@ -87,7 +87,7 @@ class CalendarPanel
 public:
        const DateTime& GetDate(void) const;
        result Initialize(const Rectangle& bounds, const DateTime& date,
-                                               Bitmap** pWeekText, Bitmap** pWeekdayText, Bitmap** pHolidayText, Bitmap** pTodayText, Bitmap* pFocus);
+                                               Bitmap** pWeekText, Bitmap** pWeekdayText, Bitmap** pHolidayText, Bitmap** pTodayText, Bitmap* pFocus, Bitmap* pPress);
        void SetDate(const DateTime& date);
        void SetDateFocusEventListener(IDateFocusEventListener& listener);
 
@@ -109,6 +109,7 @@ private:
        Bitmap** __pBitmapHolidayText;
        Bitmap** __pBitmapTodayText;
        Bitmap* __pBitmapFocus;
+       Bitmap* __pBitmapPress;
 };
 
 CalendarPanel::CalendarPanel(void)
@@ -118,6 +119,7 @@ CalendarPanel::CalendarPanel(void)
        , __pBitmapHolidayText(null)
        , __pBitmapTodayText(null)
        , __pBitmapFocus(null)
+       , __pBitmapPress(null)
 {
 }
 
@@ -133,7 +135,7 @@ CalendarPanel::GetDate(void) const
 
 result
 CalendarPanel::Initialize(const Rectangle& bounds, const DateTime& date,
-                                                       Bitmap** pWeekText, Bitmap** pWeekdayText, Bitmap** pHolidayText, Bitmap** pTodayText, Bitmap* pFocus)
+                                                       Bitmap** pWeekText, Bitmap** pWeekdayText, Bitmap** pHolidayText, Bitmap** pTodayText, Bitmap* pFocus, Bitmap* pPress)
 {
        __date = date;
        __pBitmapWeekText = pWeekText;
@@ -141,6 +143,7 @@ CalendarPanel::Initialize(const Rectangle& bounds, const DateTime& date,
        __pBitmapHolidayText = pHolidayText;
        __pBitmapTodayText = pTodayText;
        __pBitmapFocus = pFocus;
+       __pBitmapPress = pPress;
 
        return Construct(bounds);
 }
@@ -306,7 +309,7 @@ CalendarPanel::OnInitializing(void)
                                  W_MONTH_CALENDAR, H_MONTH_CALENDAR), L"");
 
                __pMonthCalendars[month]->SetNormalBackgroundBitmap(*ResourceManager::GetBlankBitmap());
-               __pMonthCalendars[month]->SetPressedBackgroundBitmap(*ResourceManager::GetBlankBitmap());
+               __pMonthCalendars[month]->SetPressedBackgroundBitmap(*__pBitmapPress);
                __pMonthCalendars[month]->SetActionId(month + 1);
                __pMonthCalendars[month]->AddActionEventListener(*this);
                AddControl(__pMonthCalendars[month]);
@@ -336,6 +339,7 @@ YearPanel::YearPanel(void)
        : __pPm(null)
        , __pPanningAnimationManager(null)
        , __pBitmapFocus(null)
+       , __pBitmapPress(null)
        , __pGoToDatePopup(null)
 {
        memset((void *)__pPanelYearCalendar, 0, sizeof(Panel*) * VIEW_SCROLL_EFFECT_COUNT);
@@ -381,7 +385,7 @@ YearPanel::OnInitializing(void)
        // Create month calendars.
        CalendarPanel* pCalendarPanel = new (std::nothrow) CalendarPanel();
        pCalendarPanel->Initialize(bounds, __pPm->GetCurrentDate(),
-                                                               __pBitmapWeekText, __pBitmapWeekdayText, __pBitmapHolidayText, __pBitmapTodayText, __pBitmapFocus);
+                                                               __pBitmapWeekText, __pBitmapWeekdayText, __pBitmapHolidayText, __pBitmapTodayText, __pBitmapFocus, __pBitmapPress);
        __pPanningAnimationManager->AddView(*pCalendarPanel, VIEW_SCROLL_EFFECT_CURRENT);
        pCalendarPanel->SetDateFocusEventListener(*this);
        __pPanelYearCalendar[VIEW_SCROLL_EFFECT_CURRENT] = pCalendarPanel;
@@ -408,6 +412,7 @@ YearPanel::OnTerminating(void)
                delete __pBitmapTodayText[i];
        }
        delete __pBitmapFocus;
+       delete __pBitmapPress;
 
        if (__pGoToDatePopup)
        {
@@ -519,7 +524,7 @@ YearPanel::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& curr
                                        date.SetValue(minDate.GetYear(), date.GetMonth(), date.GetDay(), date.GetHour(), date.GetMinute());
                                }
                                pCalendarPanel->Initialize(Rectangle(0, 0, GetWidth(), GetHeight()), date,
-                                                                                       __pBitmapWeekText, __pBitmapWeekdayText, __pBitmapHolidayText, __pBitmapTodayText, __pBitmapFocus);
+                                                                                       __pBitmapWeekText, __pBitmapWeekdayText, __pBitmapHolidayText, __pBitmapTodayText, __pBitmapFocus, __pBitmapPress);
                                break;
                        case VIEW_SCROLL_EFFECT_PREVIEW:
                                date.AddYears(-1);
@@ -529,7 +534,7 @@ YearPanel::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& curr
                                        date.SetValue(maxDate.GetYear(), date.GetMonth(), date.GetDay(), date.GetHour(), date.GetMinute());
                                }
                                pCalendarPanel->Initialize(Rectangle(0, 0, GetWidth(), GetHeight()), date,
-                                                                                       __pBitmapWeekText, __pBitmapWeekdayText, __pBitmapHolidayText, __pBitmapTodayText, __pBitmapFocus);
+                                                                                       __pBitmapWeekText, __pBitmapWeekdayText, __pBitmapHolidayText, __pBitmapTodayText, __pBitmapFocus, __pBitmapPress);
                                break;
                        }
                        __pPanningAnimationManager->AddView(*pCalendarPanel, (ViewScrollEffect)i);
@@ -808,6 +813,7 @@ YearPanel::CreateBitmapElements(void)
        }
 
        __pBitmapFocus = ResourceManager::GetBitmapN(IDB_YEAR_MONTH_FOCUS);
+       __pBitmapPress = ResourceManager::GetBitmapN(IDB_YEAR_MONTH_PRESS);
 
        return E_SUCCESS;
 }