Merge "Merging master changes to tizen_2.1 branch" into tizen_2.1
authorAyush Srivastava <ayush.sriv@tizendev.org>
Tue, 21 May 2013 14:26:33 +0000 (23:26 +0900)
committerGerrit Code Review <gerrit2@kim11>
Tue, 21 May 2013 14:26:33 +0000 (23:26 +0900)
59 files changed:
res/common/usr/share/osp/bitmaps/480x800/00_contacts_button_focus.#.png [new file with mode: 0644]
res/common/usr/share/osp/bitmaps/480x800/00_slider_handle_focus.png [new file with mode: 0644]
res/common/usr/share/osp/bitmaps/480x800/TTS_focus.#.png [changed mode: 0644->0755]
res/common/usr/share/osp/bitmaps/480x800/black/00_contacts_button_focus_ef.#.png [new file with mode: 0644]
res/common/usr/share/osp/bitmaps/480x800/default/00_contacts_button_focus_ef.#.png [new file with mode: 0644]
res/common/usr/share/osp/bitmaps/480x800/white/00_contacts_button_focus_ef.#.png [new file with mode: 0644]
res/common/usr/share/osp/bitmaps/720x1280/00_contacts_button_focus.#.png [new file with mode: 0644]
res/common/usr/share/osp/bitmaps/720x1280/TTS_focus.#.png [changed mode: 0644->0755]
res/common/usr/share/osp/bitmaps/720x1280/black/00_contacts_button_focus_ef.#.png [new file with mode: 0644]
res/common/usr/share/osp/bitmaps/720x1280/default/00_contacts_button_focus_ef.#.png [new file with mode: 0644]
res/common/usr/share/osp/bitmaps/720x1280/white/00_contacts_button_focus_ef.#.png [new file with mode: 0644]
src/graphics/FGrp_Canvas.cpp
src/ui/FUi_AccessibilityElement.cpp
src/ui/FUi_AccessibilityElementImpl.cpp
src/ui/FUi_AccessibilityManager.cpp
src/ui/FUi_AccessibilitySystemSettingLoader.cpp
src/ui/controls/FUiCtrl_DateTimeBar.cpp
src/ui/controls/FUiCtrl_DateTimeBarPresenter.cpp
src/ui/controls/FUiCtrl_DateTimeDisplayBox.cpp
src/ui/controls/FUiCtrl_DateTimePicker.cpp
src/ui/controls/FUiCtrl_DateTimePresenter.cpp
src/ui/controls/FUiCtrl_DateTimeUtils.cpp
src/ui/controls/FUiCtrl_EditDate.cpp
src/ui/controls/FUiCtrl_EditDatePresenter.cpp
src/ui/controls/FUiCtrl_EditPresenter.cpp
src/ui/controls/FUiCtrl_EditTime.cpp
src/ui/controls/FUiCtrl_EditTimePresenter.cpp
src/ui/controls/FUiCtrl_InputPadPresenter.cpp
src/ui/controls/FUiCtrl_SearchBar.cpp
src/ui/controls/FUiCtrl_Slider.cpp
src/ui/controls/FUiCtrl_SliderPresenter.cpp
src/ui/controls/FUiCtrl_SplitPanel.cpp
src/ui/controls/FUiCtrl_SplitPanelPresenter.cpp
src/ui/controls/FUiCtrl_TableViewPresenter.cpp
src/ui/controls/FUiCtrl_TokenEditPresenter.cpp
src/ui/controls/FUiCtrl_Toolbar.cpp
src/ui/inc/FUiCtrl_DateTimeBar.h
src/ui/inc/FUiCtrl_DateTimeBarPresenter.h
src/ui/inc/FUiCtrl_DateTimeDefine.h
src/ui/inc/FUiCtrl_DateTimePicker.h
src/ui/inc/FUiCtrl_DateTimePresenter.h
src/ui/inc/FUiCtrl_DateTimeUtils.h
src/ui/inc/FUiCtrl_EditDate.h
src/ui/inc/FUiCtrl_EditDatePresenter.h
src/ui/inc/FUiCtrl_EditTime.h
src/ui/inc/FUiCtrl_EditTimePresenter.h
src/ui/inc/FUiCtrl_Slider.h
src/ui/inc/FUiCtrl_SliderPresenter.h
src/ui/inc/FUiCtrl_SplitPanel.h
src/ui/inc/FUiCtrl_SplitPanelPresenter.h
src/ui/inc/FUiCtrl_TokenEditPresenter.h
src/ui/inc/FUiCtrl_Toolbar.h
src/ui/inc/FUi_AccessibilityElement.h
src/ui/inc/FUi_AccessibilityElementImpl.h
src/ui/inc/FUi_ResourceConfigMacro.h
src/ui/inc/FUi_ResourceSliderConfig.h
src/ui/inc/FUi_ResourceTokenEditConfig.h
src/ui/resource/FUi_ResourceSliderConfig.cpp
src/ui/resource/FUi_ResourceTokenEditConfig.cpp

diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_contacts_button_focus.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_contacts_button_focus.#.png
new file mode 100644 (file)
index 0000000..4563178
Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_contacts_button_focus.#.png differ
diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_slider_handle_focus.png b/res/common/usr/share/osp/bitmaps/480x800/00_slider_handle_focus.png
new file mode 100644 (file)
index 0000000..95bd5fd
Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_slider_handle_focus.png differ
old mode 100644 (file)
new mode 100755 (executable)
index 575f34c..fbc2569
Binary files a/res/common/usr/share/osp/bitmaps/480x800/TTS_focus.#.png and b/res/common/usr/share/osp/bitmaps/480x800/TTS_focus.#.png differ
diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_contacts_button_focus_ef.#.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_contacts_button_focus_ef.#.png
new file mode 100644 (file)
index 0000000..b3daa2b
Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/black/00_contacts_button_focus_ef.#.png differ
diff --git a/res/common/usr/share/osp/bitmaps/480x800/default/00_contacts_button_focus_ef.#.png b/res/common/usr/share/osp/bitmaps/480x800/default/00_contacts_button_focus_ef.#.png
new file mode 100644 (file)
index 0000000..b3daa2b
Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/default/00_contacts_button_focus_ef.#.png differ
diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_contacts_button_focus_ef.#.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_contacts_button_focus_ef.#.png
new file mode 100644 (file)
index 0000000..b3daa2b
Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/white/00_contacts_button_focus_ef.#.png differ
diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_contacts_button_focus.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_contacts_button_focus.#.png
new file mode 100644 (file)
index 0000000..8d6cd8a
Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_contacts_button_focus.#.png differ
old mode 100644 (file)
new mode 100755 (executable)
index 575f34c..fbc2569
Binary files a/res/common/usr/share/osp/bitmaps/720x1280/TTS_focus.#.png and b/res/common/usr/share/osp/bitmaps/720x1280/TTS_focus.#.png differ
diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_contacts_button_focus_ef.#.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_contacts_button_focus_ef.#.png
new file mode 100644 (file)
index 0000000..a9b0f7c
Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/black/00_contacts_button_focus_ef.#.png differ
diff --git a/res/common/usr/share/osp/bitmaps/720x1280/default/00_contacts_button_focus_ef.#.png b/res/common/usr/share/osp/bitmaps/720x1280/default/00_contacts_button_focus_ef.#.png
new file mode 100644 (file)
index 0000000..a9b0f7c
Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/default/00_contacts_button_focus_ef.#.png differ
diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_contacts_button_focus_ef.#.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_contacts_button_focus_ef.#.png
new file mode 100644 (file)
index 0000000..a9b0f7c
Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/white/00_contacts_button_focus_ef.#.png differ
index e6e49e2..86f8c17 100644 (file)
@@ -1615,16 +1615,8 @@ _Canvas::DrawBitmap(const _Util::Rectangle<double>& destRectD, const _Bitmap& sr
                {
                        if (!this->__useStableRenderer && srcBufferInfo.bitsPerPixel == 32 && (GetCompositeMode() != COMPOSITE_MODE_SRC_OVER || srcBitmap.__isPremultiplied))
                        {
-                               _Util::Rectangle<int> srcBounds =
-                               {
-                                       int(Math::Floor(srcRectD.x)),
-                                       int(Math::Floor(srcRectD.y)),
-                                       int(Math::Ceiling(srcRectD.x + srcRectD.w) - Math::Floor(srcRectD.x)),
-                                       int(Math::Ceiling(srcRectD.y + srcRectD.h) - Math::Floor(srcRectD.y))
-                               };
-
                                _Util::Pixmap srcImageUnclipped(srcBufferInfo.width, srcBufferInfo.height, srcBufferInfo.bitsPerPixel, srcBufferInfo.pPixels, srcBufferInfo.pitch);
-                               _Util::Pixmap srcImage = srcImageUnclipped.GetSubBitmap(srcBounds.x, srcBounds.y, srcBounds.w, srcBounds.h);
+                               _Util::Pixmap srcImage = srcImageUnclipped.GetSubBitmap(srcRect.x, srcRect.y, srcRect.w, srcRect.h);
                                _ApplySrcBitmapAttrib(srcImage, srcBitmap, srcBitmap.__isOpaqueAllOver);
 
                                _Util::Pixmap dstImageUnclipped(dstBufferInfo.width, dstBufferInfo.height, dstBufferInfo.bitsPerPixel, dstBufferInfo.pPixels, dstBufferInfo.pitch);
@@ -3794,7 +3786,6 @@ _Canvas::Show()
                evas_object_image_pixels_dirty_set((Evas_Object*) this->__windowHandle, true);
 #else
                Evas_Object* pSourceObject = _GetWindowSourceObject(this->__windowHandle);
-               evas_object_image_data_set(pSourceObject, evas_object_image_data_get(pSourceObject, EINA_TRUE));
                evas_object_image_data_update_add(pSourceObject, 0, 0, bufferWidth, bufferHeight);
 #endif
 
@@ -3853,7 +3844,6 @@ _Canvas::Show(const Rectangle& rect)
                evas_object_image_data_update_add((Evas_Object*) this->__windowHandle, x1, y1, x2 - x1, y2 - y1);
 #else
                Evas_Object* pSourceObject = _GetWindowSourceObject(this->__windowHandle);
-               evas_object_image_data_set(pSourceObject, evas_object_image_data_get(pSourceObject, EINA_TRUE));
                evas_object_image_data_update_add(pSourceObject, x1, y1, x2 - x1, y2 - y1);
 #endif
 
index 17e9469..e378062 100644 (file)
@@ -146,13 +146,6 @@ _AccessibilityElement::SetStatus(const String& status)
        __updateContents = true;
 }
 void
-_AccessibilityElement::SetTrait(AccessibilityTraits trait)
-{
-       __trait = trait;
-       __traitString = (_traitString[__trait]);
-       __updateContents = true;
-}
-void
 _AccessibilityElement::SetTrait(const Tizen::Base::String& trait)
 {
        __traitString = trait;
@@ -199,11 +192,6 @@ _AccessibilityElement::GetStatus(void) const
 {
        return __status;
 }
-AccessibilityTraits
-_AccessibilityElement::GetTrait(void) const
-{
-       return __trait;
-}
 String
 _AccessibilityElement::GetTraitString(void) const
 {
index 8033b39..f642822 100644 (file)
@@ -106,12 +106,6 @@ _AccessibilityElementImpl::SetStatus(const Tizen::Base::String& status)
        return __pCore->SetStatus(status);
 }
 void
-_AccessibilityElementImpl::SetTrait(AccessibilityTraits trait)
-{
-       SysTryReturn(NID_UI, __pCore, , E_SYSTEM, "[E_SYSTEM] System Error.");
-       return __pCore->SetTrait(trait);
-}
-void
 _AccessibilityElementImpl::SetTrait(const Tizen::Base::String& trait)
 {
        SysTryReturn(NID_UI, __pCore, , E_SYSTEM, "[E_SYSTEM] System Error.");
@@ -178,12 +172,6 @@ _AccessibilityElementImpl::GetStatus(void) const
        SysTryReturn(NID_UI, __pCore, L"", E_SYSTEM, "[E_SYSTEM] System Error.");
        return __pCore->GetStatus();
 }
-AccessibilityTraits
-_AccessibilityElementImpl::GetTrait(void) const
-{
-       SysTryReturn(NID_UI, __pCore, ACCESSIBILITY_TRAITS_NONE, E_SYSTEM, "[E_SYSTEM] System Error.");
-       return __pCore->GetTrait();
-}
 Tizen::Base::String
 _AccessibilityElementImpl::GetTraitString(void) const
 {
index f7fb09b..86973e8 100644 (file)
@@ -521,6 +521,7 @@ _AccessibilityManager::ShowPopup(const String& content)
        }
 
        pFrame = UiApp::GetInstance()->GetAppFrame()->GetFrame();
+
        if (pFrame != null)
        {
                int accesibilityVisualElementLevel = 3000;
@@ -1861,20 +1862,15 @@ _AccessibilityManager::ProcessGesture(_AccessibilityGestureType type, const Floa
                        }
                        _Control* pControl = null;
                        Point pt((int)point.x, (int)point.y);
-                       _TouchManager* pTouchManager = _TouchManager::GetInstance();
-                       _Control* pCapturedControl = pTouchManager->GetCapturedControl();
-                       if (pCapturedControl)
+                       _Window* pWindow = _ControlManager::GetInstance()->GetTopVisibleWindow();
+                       if (!(pWindow->IsLayoutChangable()))
                        {
-                               if(pCapturedControl->GetAbsoluteBounds().Contains(pt))
-                               {
-                                       pControl = pCapturedControl;
-                               }
+                               Rectangle topWindowAbsBounds = pWindow->GetAbsoluteBounds();
+                               pt.x = pt.x + topWindowAbsBounds.x;
+                               pt.y = pt.y + topWindowAbsBounds.y;
                        }
-                       else
-                       {
-                               pControl = _ControlManager::GetInstance()->GetTopmostTouchedControl(pt);
-                       }
-                       if (pControl == null)
+                       pControl = _ControlManager::GetInstance()->GetTopmostTouchedControl(pt);
+                       if (!(pControl->GetAbsoluteBounds().Contains(pt)))
                        {
                                return false;
                        }
index b9d89bc..29ededf 100644 (file)
@@ -66,7 +66,10 @@ _AccessibilitySystemSettingLoader::IsAccessibilityActivated(void)
 bool
 _AccessibilitySystemSettingLoader::IsScreenReaderActivated(void)
 {
-       return GetEcoreEvasMgr()->GetEcoreEvas()->IsAccessibilityScreenReaderActivated();
+//     return GetEcoreEvasMgr()->GetEcoreEvas()->IsAccessibilityScreenReaderActivated();
+       bool enable = false;
+       _SettingInfoImpl::GetValue(L"http://tizen.org/setting/speech.tts.screen", enable);
+       return enable;
 }
 
 float
index 2f9e913..95da538 100644 (file)
@@ -651,6 +651,33 @@ _DateTimeBar::RefreshItems(void)
 }
 
 bool
+_DateTimeBar::OnFocusGained(const _Control& control)
+{
+       return true;
+}
+
+bool
+_DateTimeBar::OnFocusLost(const _Control& control)
+{
+       __pDateTimeBarPresenter->SetItemFocused(false);
+       return true;
+}
+
+void
+_DateTimeBar::OnDrawFocus(void)
+{
+       __pDateTimeBarPresenter->SetItemFocused(true);
+       __pDateTimeBarPresenter->DrawFocus();
+       return;
+}
+
+bool
+_DateTimeBar::OnKeyPressed(const _Control &source, const _KeyInfo &keyInfo)
+{
+       return __pDateTimeBarPresenter->OnKeyPressed(source,keyInfo);
+}
+
+bool
 _DateTimeBar::OnAccessibilityFocusMovedNext(const _AccessibilityContainer& control, const _AccessibilityElement& element)
 {
        return __pDateTimeBarPresenter->OnAccessibilityFocusMovedNext(control, element);
@@ -714,7 +741,7 @@ _DateTimeBar::OnAccessibilityFocusIn(const _AccessibilityContainer& control, con
        }
        else if (__accessibilityFocusOutIndex > focusInIndex)
        {
-               if(pFocusInAccessibilityElement != null && pFocusInAccessibilityElement->GetBounds().x < 0)
+               if (pFocusInAccessibilityElement != null && pFocusInAccessibilityElement->GetBounds().x < 0)
                {
                        __pDateTimeBarPresenter->MovePrevious();
                }
index c417e11..dea9773 100644 (file)
@@ -35,8 +35,6 @@ using namespace Tizen::Base;
 using namespace Tizen::Base::Runtime;
 using namespace Tizen::Graphics::_Text;
 
-const int UPDATE_ITEM_COUNT = 3;
-
 namespace Tizen { namespace Ui { namespace Controls
 {
 
@@ -56,10 +54,14 @@ _DateTimeBarPresenter::_DateTimeBarPresenter(_DateTimeBar* pDateTimeBar)
        , __arrowAreaBounds(FloatRectangle())
        , __windowAreaBounds(FloatRectangle())
        , __pBgColorReplacementBitmap(null)
+       , __pFocusBitmap(null)
        , __pArrowColorReplacementBitmap(null)
        , __isInitialAnimation(false)
        , __initialAnimationValue(0.0f)
        , __pFont(null)
+       , __isFocused(false)
+       , __focusedIndex(-1)
+       , __focusBounds(FloatRectangle())
 {
 }
 
@@ -71,6 +73,9 @@ _DateTimeBarPresenter::~_DateTimeBarPresenter(void)
        delete __pBgColorReplacementBitmap;
        __pBgColorReplacementBitmap = null;
 
+       delete __pFocusBitmap;
+       __pFocusBitmap = null;
+
        delete __pArrowColorReplacementBitmap;
        __pArrowColorReplacementBitmap = null;
 
@@ -135,6 +140,9 @@ _DateTimeBarPresenter::LoadResource(void)
        SysTryCatch(NID_UI_CTRL, __pBgColorReplacementBitmap != null, r = GetLastResult(), GetLastResult(), "[%s] Propagating.",
                    GetErrorMessage(GetLastResult()));
 
+       r = GET_BITMAP_CONFIG_N(FOCUSUI::FOCUS, BITMAP_PIXEL_FORMAT_ARGB8888, __pFocusBitmap);
+       SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
+
        r = LoadArrowBitmap();
        SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to load resources.", GetErrorMessage(r));
 
@@ -153,6 +161,9 @@ CATCH:
        delete __pBgColorReplacementBitmap;
        __pBgColorReplacementBitmap = null;
 
+       delete __pFocusBitmap;
+       __pFocusBitmap = null;
+
        return r;
 }
 
@@ -225,14 +236,55 @@ _DateTimeBarPresenter::Draw(void)
        r = DrawArrow(*pCanvas);
        SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
 
+       if (__isFocused)
+       {
+               DrawFocus();
+       }
+
+CATCH:
        delete pCanvas;
        return r;
+}
 
+result
+_DateTimeBarPresenter::DrawFocus()
+{
+       Canvas* pCanvas = __pDateTimeBar->GetCanvasN();
+       SysTryReturnResult(NID_UI_CTRL, (pCanvas != null), E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Unable to create canvas.");
+
+       result r = E_SUCCESS;
+
+       if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*__pFocusBitmap))
+       {
+               r = pCanvas->DrawNinePatchedBitmap(__focusBounds, *__pFocusBitmap);
+               SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+       }
+       else
+       {
+               r = pCanvas->DrawBitmap(__focusBounds, *__pFocusBitmap);
+               SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+       }
 CATCH:
+
        delete pCanvas;
        return r;
 }
 
+void
+_DateTimeBarPresenter::SetItemFocused(bool isFocused)
+{
+       if (!__isFocused)
+       {
+               __focusedIndex = (GetSelectedItemIndex() - 1);
+               _DateTimeBarItem* pItem = null;
+               pItem = GetItemAt(__focusedIndex);
+
+               __focusBounds = pItem->GetBounds();
+       }
+       __isFocused = isFocused;
+       return;
+}
+
 result
 _DateTimeBarPresenter::DrawItem(Canvas& canvas)
 {
@@ -961,6 +1013,92 @@ _DateTimeBarPresenter::GetWindowBounds(void) const
 }
 
 bool
+_DateTimeBarPresenter::OnKeyPressed(const _Control &source, const _KeyInfo &keyInfo)
+{
+       if (!__isFocused)
+       {
+               return false;
+       }
+
+       _KeyCode keyCode = keyInfo.GetKeyCode();
+
+       switch (keyCode)
+       {
+               case KEY_RIGHT:
+               {
+                       if ((__focusBounds.x + __focusBounds.width) > (GetWindowBounds().width - __focusBounds.width))
+                       {
+                               MoveNext();
+                       }
+                       else
+                       {
+                               __focusBounds.x = __focusBounds.x + __focusBounds.width + GetItemMargin();
+                               __pDateTimeBar->Invalidate();
+
+                       }
+                       __focusedIndex = GetItemIndexFromPosition(FloatPoint(__focusBounds.x, __focusBounds.y));
+
+                       break;
+               }
+
+               case KEY_LEFT:
+               {
+                       if ((__focusBounds.x - __focusBounds.width) < 0)
+                       {
+                               MovePrevious();
+                       }
+                       else
+                       {
+                               __focusBounds.x = __focusBounds.x - __focusBounds.width - GetItemMargin();
+                               __pDateTimeBar->Invalidate();
+                       }
+                       __focusedIndex = GetItemIndexFromPosition(FloatPoint(__focusBounds.x, __focusBounds.y));
+
+                       break;
+               }
+
+               case KEY_ENTER:
+               {
+                       _DateTimeBarItem* pItem = null;
+
+                       SetItemSelected(__focusedIndex);
+                       __pDateTimeBarModel->SetFirstDrawnItemIndex((__focusedIndex));
+
+                       if (__focusedIndex >= 0)
+                       {
+                               pItem = GetItemAt(__focusedIndex);
+                       }
+
+                       if (pItem != null)
+                       {
+                               __pDateTimeBar->SetVisibleState(false);
+                               __pDateTimeBar->Close();
+
+                               __pDateTimeBar->FireActionEvent(pItem->GetActionId());
+
+                               if (__pDateTimeBar->GetSelectedBoxId() >= DATETIME_ID_YEAR && __pDateTimeBar->GetSelectedBoxId() <= DATETIME_ID_DAY)
+                               {
+                                       __pDateTimeBar->FireDateTimeChangeEvent(DATE_INTERNAL_CHANGE_SAVED);
+                               }
+                               else if (__pDateTimeBar->GetSelectedBoxId() >= DATETIME_ID_HOUR && __pDateTimeBar->GetSelectedBoxId() <= DATETIME_ID_MINUTE)
+                               {
+                                       __pDateTimeBar->FireDateTimeChangeEvent(TIME_INTERNAL_CHANGE_SAVED);
+                               }
+                       }
+                       __isFocused = false;
+                       break;
+               }
+
+               default:
+               {
+                       return false;
+               }
+       }
+
+       return true;
+}
+
+bool
 _DateTimeBarPresenter::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo)
 {
        if (&source != __pDateTimeBar)
index 8dfcfa0..98c30a6 100644 (file)
@@ -56,7 +56,7 @@ _DateTimeDisplayBox::_DateTimeDisplayBox(const FloatRectangle& bounds, int boxId
 
        GET_COLOR_CONFIG(DATETIMEPICKER::TEXT_NORMAL, __textColor[DATETIME_STATUS_NORMAL]);
        GET_COLOR_CONFIG(DATETIMEPICKER::TEXT_HIGHLIGHTED, __textColor[DATETIME_STATUS_HIGHLIGHTED]);
-       GET_COLOR_CONFIG(DATETIMEPICKER::TEXT_PRESSED, __textColor[DATETIME_STATUS_PRESSED]);
+       GET_COLOR_CONFIG(DATETIMEPICKER::TEXT_PRESSED, __textColor[DATETIME_STATUS_SELECTED]);
        GET_COLOR_CONFIG(DATETIMEPICKER::TEXT_DISABLED, __textColor[DATETIME_STATUS_DISABLED]);
 }
 
@@ -190,14 +190,14 @@ _DateTimeDisplayBox::DrawBackground(Canvas& canvas, DateTimePickerStatus status)
        if (__boxId == DATETIME_ID_AMPM)
        {
                isCustomBitmap[DATETIME_STATUS_NORMAL] = IS_CUSTOM_BITMAP(DATETIMEPICKER::AMPM_BG_NORMAL);
-               isCustomBitmap[DATETIME_STATUS_PRESSED] = IS_CUSTOM_BITMAP(DATETIMEPICKER::AMPM_BG_PRESSED);
+               isCustomBitmap[DATETIME_STATUS_SELECTED] = IS_CUSTOM_BITMAP(DATETIMEPICKER::AMPM_BG_PRESSED);
                isCustomBitmap[DATETIME_STATUS_HIGHLIGHTED] = IS_CUSTOM_BITMAP(DATETIMEPICKER::AMPM_BG_HIGHLIGHTED);
                isCustomBitmap[DATETIME_STATUS_DISABLED] = IS_CUSTOM_BITMAP(DATETIMEPICKER::AMPM_BG_DISABLED);
        }
        else
        {
                isCustomBitmap[DATETIME_STATUS_NORMAL] = IS_CUSTOM_BITMAP(DATETIMEPICKER::CONTENT_BG_NORMAL);
-               isCustomBitmap[DATETIME_STATUS_PRESSED] = IS_CUSTOM_BITMAP(DATETIMEPICKER::CONTENT_BG_PRESSED);
+               isCustomBitmap[DATETIME_STATUS_SELECTED] = IS_CUSTOM_BITMAP(DATETIMEPICKER::CONTENT_BG_PRESSED);
                isCustomBitmap[DATETIME_STATUS_HIGHLIGHTED] = IS_CUSTOM_BITMAP(DATETIMEPICKER::CONTENT_BG_HIGHLIGHTED);
                isCustomBitmap[DATETIME_STATUS_DISABLED] = IS_CUSTOM_BITMAP(DATETIMEPICKER::CONTENT_BG_DISABLED);
        }
@@ -251,7 +251,7 @@ void
 _DateTimeDisplayBox::SetBackgroundBitmap(Bitmap **pBackgroundNormalBitmap, Bitmap **pBackgroundEffectBitmap)
 {
        GET_COLOR_CONFIG(DATETIMEPICKER::AMPM_TEXT_NORMAL, __textColor[DATETIME_STATUS_NORMAL]);
-       GET_COLOR_CONFIG(DATETIMEPICKER::AMPM_TEXT_PRESSED, __textColor[DATETIME_STATUS_PRESSED]);
+       GET_COLOR_CONFIG(DATETIMEPICKER::AMPM_TEXT_PRESSED, __textColor[DATETIME_STATUS_SELECTED]);
        GET_COLOR_CONFIG(DATETIMEPICKER::AMPM_TEXT_HIGHLIGHTED, __textColor[DATETIME_STATUS_HIGHLIGHTED]);
        GET_COLOR_CONFIG(DATETIMEPICKER::AMPM_TEXT_DISABLED, __textColor[DATETIME_STATUS_DISABLED]);
 
index 0889d37..6ff4c4f 100644 (file)
@@ -24,6 +24,7 @@
 #include <FBaseColIEnumeratorT.h>
 #include <FBaseSysLog.h>
 #include <FGrp_BitmapImpl.h>
+#include <FSysSettingInfo.h>
 
 #include "FUiCtrl_DateTimePicker.h"
 #include "FUiAnim_VisualElement.h"
@@ -49,6 +50,7 @@ using namespace Tizen::Base::Collection;
 using namespace Tizen::Graphics;
 using namespace Tizen::Ui;
 using namespace Tizen::Ui::Animations;
+using namespace Tizen::System;
 
 namespace Tizen { namespace Ui { namespace Controls
 {
@@ -67,6 +69,8 @@ _DateTimePicker::_DateTimePicker(_DateTimePresenter* pPresenter, const String& t
 
 _DateTimePicker::~_DateTimePicker(void)
 {
+       SettingInfo::RemoveSettingEventListener(*this);
+
        if (__pDateTimeChangeEvent != null)
        {
                delete __pDateTimeChangeEvent;
@@ -151,6 +155,9 @@ _DateTimePicker::CreateDateTimePickerN(int style, const String& title)
                pView->GetAccessibilityContainer()->Activate(true);
        }
 
+       r = SettingInfo::AddSettingEventListener(*pView);
+       SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+
        return pView;
 
 CATCH:
@@ -1090,6 +1097,64 @@ _DateTimePicker::OnFontInfoRequested(unsigned long& style, float& size)
        return;
 }
 
+bool
+_DateTimePicker::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo)
+{
+       if (&source != this)
+       {
+               return false;
+       }
+
+       return __pPresenter->OnKeyPressed(source, keyInfo);
+}
+
+bool
+_DateTimePicker::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo)
+{
+       if (&source != this)
+       {
+               return false;
+       }
+
+       return __pPresenter->OnKeyReleased(source, keyInfo);
+}
+
+void
+_DateTimePicker::OnDrawFocus(void)
+{
+       __pPresenter->DrawFocus();
+       return;
+}
+
+bool
+_DateTimePicker::OnFocusGained(const _Control& source)
+{
+       return _Control::OnFocusGained(source);
+}
+
+bool
+_DateTimePicker::OnFocusLost(const _Control& source)
+{
+       result r = __pPresenter->ReleaseFocus();
+       SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, false, r, "[%s] Propagating.", GetErrorMessage(r));
+
+       _Control::OnFocusLost(source);
+       return true;
+}
+
+void
+_DateTimePicker::OnSettingChanged(Tizen::Base::String& key)
+{
+        if (key.Equals(L"http://tizen.org/setting/locale.date.format", false)
+                        || key.Equals(L"http://tizen.org/setting/locale.time.format.24hour", false))
+        {
+                __pPresenter->UpdateLocaleDateTimeFormat();
+                Invalidate();
+        }
+
+        return;
+}
+
 Font*
 _DateTimePicker::GetDateTimeFont(void)
 {
index 0f57b3a..f96fd7d 100644 (file)
@@ -20,7 +20,7 @@
  * @brief              This is the implementation file for the _DateTimePresenter class.
  */
 
-#include <vconf.h>
+#include <FSysSettingInfo.h>
 #include <FBaseErrorDefine.h>
 #include <FBaseSysLog.h>
 #include <FGrp_TextTextObject.h>
@@ -43,6 +43,7 @@ using namespace Tizen::Base;
 using namespace Tizen::Graphics;
 using namespace Tizen::Graphics::_Text;
 using namespace Tizen::Ui::Animations;
+using namespace Tizen::System;
 
 namespace Tizen { namespace Ui { namespace Controls
 {
@@ -51,7 +52,7 @@ const int DATETIME_DISPLAY_STRING_MAX_LENGTH = 10;
 _DateTimePresenter::_DateTimePresenter(int pickerStyle, const String& title)
        : __pView(null)
        , __pModel(null)
-       , __selectedBoxIndex(-1)
+       , __selectedBoxIndex(0)
        , __focusedBoxIndex(0)
        , __pInputPad(null)
        , __inputPadType(INPUTPAD_STYLE_NORMAL)
@@ -64,6 +65,7 @@ _DateTimePresenter::_DateTimePresenter(int pickerStyle, const String& title)
        , __hour(0)
        , __minute(0)
        , __is24HourNotation(false)
+       , __dtp24HourSet(false)
        , __isPm(false)
        , __isPmButtonPressed(false)
        , __isFocusBoxChanged(false)
@@ -76,6 +78,7 @@ _DateTimePresenter::_DateTimePresenter(int pickerStyle, const String& title)
        , __pBgEffectBitmap(null)
        , __pFont(null)
        , __pPmBox(null)
+       , __keypadEnabled(false)
 {
        for (int i = 0; i < DATETIME_ID_MAX; i++)
        {
@@ -180,6 +183,7 @@ _DateTimePresenter::Construct(_DateTimePicker& view)
        SysTryReturnResult(NID_UI_CTRL, (__pModel != null), E_OUT_OF_MEMORY, "Memory allocation failed.");
 
        // Load display data for sync with model data
+       UpdateTimeFormat();
        LoadPickerData();
 
        if (__inputPadEnabled == true)
@@ -205,7 +209,12 @@ _DateTimePresenter::Construct(_DateTimePicker& view)
 
                __pInputPad->SetFont(__pFont);
 
-               _DateTimeDisplayBox* pDisplayBox = __pDisplayBox[__focusedBoxIndex];
+               if (__pInputPad->IsFocusable() == true)
+               {
+                       __pInputPad->SetFocusable(false);
+               }
+
+               _DateTimeDisplayBox* pDisplayBox = __pDisplayBox[__selectedBoxIndex];
                SysTryCatch(NID_UI_CTRL, (pDisplayBox != null), , E_SYSTEM,
                                        "[E_SYSTEM] A system error has occurred. Failed to get Display box.");
 
@@ -349,6 +358,7 @@ void
 _DateTimePresenter::Set24HourNotationEnabled(bool enable)
 {
        __is24HourNotation = enable;
+       __dtp24HourSet = true;
 
        UpdateDateTimeOutputConfig();
 }
@@ -399,7 +409,6 @@ _DateTimePresenter::SetFocusBoxId(int boxId)
                if (boxId == displayBoxId)
                {
                        SetFocusBox(i);
-                       ChangeInputPadStyle(boxId);
                        return;
                }
        }
@@ -516,6 +525,35 @@ _DateTimePresenter::SetFont(Font* pFont)
 }
 
 void
+_DateTimePresenter::UpdateLocaleDateTimeFormat(void)
+{
+       UpdateTimeFormat();
+
+       UpdateDateTimeOutputConfig();
+
+       LoadPickerData();
+
+       for (int i = 0; i < __outputBoxMaxCount; i++)
+       {
+               AdjustDisplayValue(i);
+       }
+
+       return;
+}
+
+void
+_DateTimePresenter::UpdateTimeFormat(void)
+{
+       if (!__dtp24HourSet)
+       {
+               String key(L"http://tizen.org/setting/locale.time.format.24hour");
+               SettingInfo::GetValue(key , __is24HourNotation);
+       }
+
+       return;
+}
+
+void
 _DateTimePresenter::OnChangeLayout(_ControlOrientation orientation)
 {
        result r = E_SUCCESS;
@@ -550,15 +588,18 @@ _DateTimePresenter::OnTouchPressed(const _Control& source, const _TouchInfo& tou
 
        int touchedAreaId = CalculateTouchArea(touchinfo.GetCurrentPosition().x, touchinfo.GetCurrentPosition().y);
 
+       if (touchedAreaId != DATETIME_AREA_INPUT)
+       {
+               __keypadEnabled = false;
+       }
+
        if (touchedAreaId == DATETIME_AREA_OUTPUT_AMPM)
        {
                __isPmButtonPressed = true;
-               __pView->Draw();
+               __pView->Invalidate(true);
                return true;
        }
 
-       __selectedBoxIndex = CalculateTouchOutputArea(touchinfo.GetCurrentPosition().x, touchinfo.GetCurrentPosition().y);
-
        return true;
 }
 
@@ -585,6 +626,11 @@ _DateTimePresenter::OnTouchReleased(const _Control& source, const _TouchInfo& to
 
        int touchedAreaId = CalculateTouchArea(touchinfo.GetCurrentPosition().x, touchinfo.GetCurrentPosition().y);
 
+       if (touchedAreaId != DATETIME_AREA_INPUT)
+       {
+               __keypadEnabled = false;
+       }
+
        if (__isPmButtonPressed == true)
        {
                if (touchedAreaId == DATETIME_AREA_OUTPUT_AMPM)
@@ -596,7 +642,7 @@ _DateTimePresenter::OnTouchReleased(const _Control& source, const _TouchInfo& to
                __inputComposing = DATETIME_INPUT_END;
                __changeFocusCounter = DATE_TIME_CHANGE_FOCUS_COUNTER_MIN;
                __isPmButtonPressed = false;
-               __pView->Draw();
+               __pView->Invalidate(true);
 
                return true;
        }
@@ -604,9 +650,8 @@ _DateTimePresenter::OnTouchReleased(const _Control& source, const _TouchInfo& to
        if ((touchedAreaId == DATETIME_AREA_NONE) || (touchedAreaId == DATETIME_AREA_INPUT) ||
                (touchedAreaId == DATETIME_AREA_OUTPUT_AMPM))
        {
-               __selectedBoxIndex = -1;
                __isPmButtonPressed = false;
-               __pView->Draw();
+               __pView->Invalidate(true);
 
                return true;
        }
@@ -616,11 +661,9 @@ _DateTimePresenter::OnTouchReleased(const _Control& source, const _TouchInfo& to
        if (touchedAreaId == DATETIME_AREA_OUTPUT)
        {
                newOutputFocusedIndex = CalculateTouchOutputArea(touchinfo.GetCurrentPosition().x, touchinfo.GetCurrentPosition().y);
-               if ((newOutputFocusedIndex == (-1)) || (newOutputFocusedIndex == __focusedBoxIndex))
-               {
-                       __selectedBoxIndex = -1;
-                       __pView->Draw();
 
+               if (newOutputFocusedIndex == (-1))
+               {
                        return true;
                }
 
@@ -630,8 +673,10 @@ _DateTimePresenter::OnTouchReleased(const _Control& source, const _TouchInfo& to
                        {
                                AdjustDisplayValue(i);
                        }
-
-                       SetFocusBox(newOutputFocusedIndex);
+               }
+               else
+               {
+                       __selectedBoxIndex = newOutputFocusedIndex;
                }
 
                _VisualElement* pVisualElement = null;
@@ -645,18 +690,17 @@ _DateTimePresenter::OnTouchReleased(const _Control& source, const _TouchInfo& to
                r = GetLastResult();
                SysTryReturn(NID_UI_CTRL, (pCanvas != null), false, r, "[%s] Propagating.", GetErrorMessage(r));
 
-               DrawDateTimeDisplayBox(*pCanvas, __focusedBoxIndex);
+               DrawDateTimeDisplayBox(*pCanvas, __selectedBoxIndex);
 
                delete pCanvas;
 
-               __selectedBoxIndex = -1;
                __inputComposing = DATETIME_INPUT_END;
                __changeFocusCounter = DATE_TIME_CHANGE_FOCUS_COUNTER_MIN;
 
-               int boxId = __pDisplayBox[__focusedBoxIndex]->GetDisplayBoxId();
+               int boxId = __pDisplayBox[__selectedBoxIndex]->GetDisplayBoxId();
                ChangeInputPadStyle(boxId);
 
-               __pView->Draw();
+               __pView->Invalidate(true);
 
                return true;
        }
@@ -672,12 +716,11 @@ _DateTimePresenter::OnTouchCanceled(const _Control& source, const _TouchInfo& to
                return false;
        }
 
-       __selectedBoxIndex = -1;
        __isPmButtonPressed = false;
        __inputComposing = DATETIME_INPUT_END;
        __changeFocusCounter = DATE_TIME_CHANGE_FOCUS_COUNTER_MIN;
 
-       __pView->Draw();
+       __pView->Invalidate(true);
 
        return true;
 }
@@ -685,12 +728,175 @@ _DateTimePresenter::OnTouchCanceled(const _Control& source, const _TouchInfo& to
 void
 _DateTimePresenter::OnInputPadValueChanged(const _Control& source, int inputPadReturnValue)
 {
+       HandleInputPadValueChange(inputPadReturnValue);
+}
+
+void
+_DateTimePresenter::OnActionPerformed(const _Control& source, int actionId)
+{
+       HandleSaveCancelAction(actionId);
+}
+
+bool
+_DateTimePresenter::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo)
+{
+       int boxId = 0;
+       __keypadEnabled = true;
+
+       _KeyCode keyCode = keyInfo.GetKeyCode();
+
+       if (__focusedBoxIndex < __outputBoxMaxCount)
+       {
+               boxId = __pDisplayBox[__focusedBoxIndex]->GetDisplayBoxId();
+
+               if ((keyCode != _KEY_RIGHT) && (keyCode != _KEY_LEFT) && (boxId == DATETIME_ID_MONTH))
+               {
+                       //month can be changed only with touch on input pad
+                       return true;
+               }
+       }
+
+       switch (keyCode)
+       {
+               case _KEY_RIGHT:
+               {
+                       if (__pickerStyle != DATETIME_OUTPUT_STYLE_DATE && __focusedBoxIndex < __outputBoxMaxCount)
+                       {
+                               __focusedBoxIndex++;
+                               SetFocusBox(__focusedBoxIndex);
+                       }
+                       else if (__pickerStyle == DATETIME_OUTPUT_STYLE_DATE && __focusedBoxIndex < __outputBoxMaxCount-1)
+                       {
+                               __focusedBoxIndex++;
+                               SetFocusBox(__focusedBoxIndex);
+                       }
+                       else
+                       {
+                               return false;
+                       }
+               }
+               break;
+               case _KEY_LEFT:
+               {
+                       if (__focusedBoxIndex  > 0)
+                       {
+                               __focusedBoxIndex--;
+                               SetFocusBox(__focusedBoxIndex);
+                       }
+                       else
+                       {
+                               return false;
+                       }
+               }
+               break;
+               case _KEY_ENTER:
+               {
+                       if (__focusedBoxIndex == __outputBoxMaxCount)
+                       {
+                               __isPmButtonPressed = true;
+                       }
+               }
+               break;
+               case _KEY_0:
+               case _KEY_NUMPAD_0:
+                       HandleInputPadValueChange(0);
+                       break;
+               case _KEY_1:
+               case _KEY_NUMPAD_1:
+                       HandleInputPadValueChange(1);
+                       break;
+               case _KEY_2:
+               case _KEY_NUMPAD_2:
+                       HandleInputPadValueChange(2);
+                       break;
+               case _KEY_3:
+               case _KEY_NUMPAD_3:
+                       HandleInputPadValueChange(3);
+                       break;
+               case _KEY_4:
+               case _KEY_NUMPAD_4:
+                       HandleInputPadValueChange(4);
+                       break;
+               case _KEY_5:
+               case _KEY_NUMPAD_5:
+                       HandleInputPadValueChange(5);
+                       break;
+               case _KEY_6:
+               case _KEY_NUMPAD_6:
+                       HandleInputPadValueChange(6);
+                       break;
+               case _KEY_7:
+               case _KEY_NUMPAD_7:
+                       HandleInputPadValueChange(7);
+                       break;
+               case _KEY_8:
+               case _KEY_NUMPAD_8:
+                       HandleInputPadValueChange(8);
+                       break;
+               case _KEY_9:
+               case _KEY_NUMPAD_9:
+                       HandleInputPadValueChange(9);
+                       break;
+               default:
+                       return false;
+       }
+
+       __pView->Invalidate(true);
+       return true;
+}
+
+bool
+_DateTimePresenter::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo)
+{
+       _KeyCode keyCode = keyInfo.GetKeyCode();
+       if (__isPmButtonPressed == true && keyCode == _KEY_ENTER)
+       {
+               __isPm = (!__isPm);
+               __isPmButtonPressed = false;
+               __pView->Invalidate(true);
+       }
+
+       return true;
+}
+
+result
+_DateTimePresenter::DrawFocus(void)
+{
+       result r = E_SUCCESS;
+       __keypadEnabled = true;
+       __focusedBoxIndex = __selectedBoxIndex;
+
+       __pView->Invalidate(true);
+       return r;
+}
+
+result
+_DateTimePresenter::ReleaseFocus(void)
+{
+       result r = E_SUCCESS;
+       __keypadEnabled = false;
+       __focusedBoxIndex = 0;
+       __selectedBoxIndex = 0;
+
+       __pView->Invalidate(true);
+       return r;
+}
+
+void
+_DateTimePresenter::HandleInputPadValueChange(int inputPadReturnValue)
+{
        if ((__inputPadEnabled == false) || (inputPadReturnValue == -1))
        {
                return;
        }
 
-       int boxId = __pDisplayBox[__focusedBoxIndex]->GetDisplayBoxId();
+       if ((__keypadEnabled == true) && (__pickerStyle != DATETIME_OUTPUT_STYLE_DATE) && (__focusedBoxIndex == __outputBoxMaxCount))
+       {
+               //in case of Am/Pm if keypad enabled, inputpad values need not be handled though in focus
+               return;
+       }
+
+       int boxId = __pDisplayBox[__selectedBoxIndex]->GetDisplayBoxId();
        int currentNumber = GetNumberInBox(boxId);
        int newNumber = 0;
 
@@ -756,11 +962,11 @@ _DateTimePresenter::OnInputPadValueChanged(const _Control& source, int inputPadR
                }
        }
 
-       __pView->Draw();
+       __pView->Invalidate(true);
 }
 
 void
-_DateTimePresenter::OnActionPerformed(const _Control& source, int actionId)
+_DateTimePresenter::HandleSaveCancelAction(int actionId)
 {
        result r = E_SUCCESS;
 
@@ -779,8 +985,9 @@ _DateTimePresenter::OnActionPerformed(const _Control& source, int actionId)
        __inputComposing = DATETIME_INPUT_END;
        __changeFocusCounter = DATE_TIME_CHANGE_FOCUS_COUNTER_MIN;
        __focusedBoxIndex = 0;
+       __selectedBoxIndex = 0;
 
-       int boxId = __pDisplayBox[__focusedBoxIndex]->GetDisplayBoxId();
+       int boxId = __pDisplayBox[__selectedBoxIndex]->GetDisplayBoxId();
 
        SetFocusBoxId(boxId);
        __pView->Close();
@@ -956,7 +1163,10 @@ _DateTimePresenter::UpdateDateTimeOutputConfig(void)
                float leftMargin = 0.0f;
                GET_SHAPE_CONFIG(DATETIMEPICKER::DATETIME_OUTPUT_LEFT_MARGIN, orientation, leftMargin);
 
-               switch (GetLocaleDateFormat())
+               _DateTimeUtils dateTimeUtils;
+               int localeDateFormat = dateTimeUtils.GetLocaleDateFormat();
+
+               switch (localeDateFormat)
                {
                case DATE_FORMAT_DDMMYYYY:
                        {
@@ -1157,7 +1367,7 @@ _DateTimePresenter::LoadResource(void)
        }
 
        GET_COLOR_CONFIG(DATETIMEPICKER::AMPM_BG_NORMAL, backgroundColor[DATETIME_STATUS_NORMAL]);
-       GET_COLOR_CONFIG(DATETIMEPICKER::AMPM_BG_PRESSED, backgroundColor[DATETIME_STATUS_PRESSED]);
+       GET_COLOR_CONFIG(DATETIMEPICKER::AMPM_BG_PRESSED, backgroundColor[DATETIME_STATUS_SELECTED]);
        GET_COLOR_CONFIG(DATETIMEPICKER::AMPM_BG_HIGHLIGHTED, backgroundColor[DATETIME_STATUS_HIGHLIGHTED]);
        GET_COLOR_CONFIG(DATETIMEPICKER::AMPM_BG_DISABLED, backgroundColor[DATETIME_STATUS_DISABLED]);
 
@@ -1189,7 +1399,7 @@ _DateTimePresenter::LoadResource(void)
        r = GET_BITMAP_CONFIG_N(DATETIMEPICKER::CONTENT_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pDisplayBoxNormalBitmap[DATETIME_STATUS_NORMAL]);
        SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
 
-       r = GET_BITMAP_CONFIG_N(DATETIMEPICKER::CONTENT_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pDisplayBoxNormalBitmap[DATETIME_STATUS_PRESSED]);
+       r = GET_BITMAP_CONFIG_N(DATETIMEPICKER::CONTENT_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pDisplayBoxNormalBitmap[DATETIME_STATUS_SELECTED]);
        SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
 
        r = GET_BITMAP_CONFIG_N(DATETIMEPICKER::CONTENT_BG_HIGHLIGHTED, BITMAP_PIXEL_FORMAT_ARGB8888, pDisplayBoxNormalBitmap[DATETIME_STATUS_HIGHLIGHTED]);
@@ -1202,7 +1412,7 @@ _DateTimePresenter::LoadResource(void)
        r = GET_BITMAP_CONFIG_N(DATETIMEPICKER::AMPM_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pAmPmNormalBitmap[DATETIME_STATUS_NORMAL]);
        SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
 
-       r = GET_BITMAP_CONFIG_N(DATETIMEPICKER::AMPM_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pAmPmNormalBitmap[DATETIME_STATUS_PRESSED]);
+       r = GET_BITMAP_CONFIG_N(DATETIMEPICKER::AMPM_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pAmPmNormalBitmap[DATETIME_STATUS_SELECTED]);
        SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
 
        r = GET_BITMAP_CONFIG_N(DATETIMEPICKER::AMPM_BG_HIGHLIGHTED, BITMAP_PIXEL_FORMAT_ARGB8888, pAmPmNormalBitmap[DATETIME_STATUS_HIGHLIGHTED]);
@@ -1212,12 +1422,12 @@ _DateTimePresenter::LoadResource(void)
        SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
 
        isDisplayBoxCustomBitmap[DATETIME_STATUS_NORMAL] = IS_CUSTOM_BITMAP(DATETIMEPICKER::CONTENT_BG_NORMAL);
-       isDisplayBoxCustomBitmap[DATETIME_STATUS_PRESSED] = IS_CUSTOM_BITMAP(DATETIMEPICKER::CONTENT_BG_PRESSED);
+       isDisplayBoxCustomBitmap[DATETIME_STATUS_SELECTED] = IS_CUSTOM_BITMAP(DATETIMEPICKER::CONTENT_BG_PRESSED);
        isDisplayBoxCustomBitmap[DATETIME_STATUS_HIGHLIGHTED] = IS_CUSTOM_BITMAP(DATETIMEPICKER::CONTENT_BG_HIGHLIGHTED);
        isDisplayBoxCustomBitmap[DATETIME_STATUS_DISABLED] = IS_CUSTOM_BITMAP(DATETIMEPICKER::CONTENT_BG_DISABLED);
 
        isAmPmCustomBitmap[DATETIME_STATUS_NORMAL] = IS_CUSTOM_BITMAP(DATETIMEPICKER::AMPM_BG_NORMAL);
-       isAmPmCustomBitmap[DATETIME_STATUS_PRESSED] = IS_CUSTOM_BITMAP(DATETIMEPICKER::AMPM_BG_PRESSED);
+       isAmPmCustomBitmap[DATETIME_STATUS_SELECTED] = IS_CUSTOM_BITMAP(DATETIMEPICKER::AMPM_BG_PRESSED);
        isAmPmCustomBitmap[DATETIME_STATUS_HIGHLIGHTED] = IS_CUSTOM_BITMAP(DATETIMEPICKER::AMPM_BG_HIGHLIGHTED);
        isAmPmCustomBitmap[DATETIME_STATUS_DISABLED] = IS_CUSTOM_BITMAP(DATETIMEPICKER::AMPM_BG_DISABLED);
 
@@ -1241,15 +1451,15 @@ _DateTimePresenter::LoadResource(void)
                SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
        }
 
-       if (!isDisplayBoxCustomBitmap[DATETIME_STATUS_PRESSED])
+       if (!isDisplayBoxCustomBitmap[DATETIME_STATUS_SELECTED])
        {
-               r = GET_BITMAP_CONFIG_N(DATETIMEPICKER::CONTENT_BG_EFFECT_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pDisplayBoxEffectBitmap[DATETIME_STATUS_PRESSED]);
+               r = GET_BITMAP_CONFIG_N(DATETIMEPICKER::CONTENT_BG_EFFECT_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pDisplayBoxEffectBitmap[DATETIME_STATUS_SELECTED]);
                SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
        }
 
        if (!isDisplayBoxCustomBitmap[DATETIME_STATUS_HIGHLIGHTED])
        {
-               r = GET_BITMAP_CONFIG_N(DATETIMEPICKER::CONTENT_BG_EFFECT_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pDisplayBoxEffectBitmap[DATETIME_STATUS_HIGHLIGHTED]);
+               r = GET_BITMAP_CONFIG_N(DATETIMEPICKER::CONTENT_BG_EFFECT_HIGHLIGHTED, BITMAP_PIXEL_FORMAT_ARGB8888, __pDisplayBoxEffectBitmap[DATETIME_STATUS_HIGHLIGHTED]);
                SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
        }
 
@@ -1280,9 +1490,9 @@ _DateTimePresenter::LoadResource(void)
                SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
        }
 
-       if (!isAmPmCustomBitmap[DATETIME_STATUS_PRESSED])
+       if (!isAmPmCustomBitmap[DATETIME_STATUS_SELECTED])
        {
-               r = GET_BITMAP_CONFIG_N(DATETIMEPICKER::AMPM_BG_EFFECT_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pAmPmEffectBitmap[DATETIME_STATUS_PRESSED]);
+               r = GET_BITMAP_CONFIG_N(DATETIMEPICKER::AMPM_BG_EFFECT_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pAmPmEffectBitmap[DATETIME_STATUS_SELECTED]);
                SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
        }
 
@@ -1408,18 +1618,28 @@ _DateTimePresenter::DrawDateTimeDisplayBox(Canvas& canvas, int index)
        {
                status = DATETIME_STATUS_DISABLED;
        }
-       else if (index == __selectedBoxIndex)
-       {
-               status = DATETIME_STATUS_PRESSED;
-       }
-       else if (index == __focusedBoxIndex)
+       else
        {
-               status = DATETIME_STATUS_HIGHLIGHTED;
+               if (__keypadEnabled)
+               {
+                       if (index == __focusedBoxIndex)
+                       {
+                               status = DATETIME_STATUS_HIGHLIGHTED;
+                       }
+               }
+               else
+               {
+                       if (index == __selectedBoxIndex)
+                       {
+                               status = DATETIME_STATUS_SELECTED;
+                       }
+               }
        }
 
        if (boxId == DATETIME_ID_YEAR)
        {
-               if ((__inputComposing == DATETIME_INPUT_BEGIN) && (status == DATETIME_STATUS_HIGHLIGHTED))
+               if ((__inputComposing == DATETIME_INPUT_BEGIN) && ((__keypadEnabled && status == DATETIME_STATUS_HIGHLIGHTED)
+                               || (!__keypadEnabled && status == DATETIME_STATUS_SELECTED)))
                {
                        String length = L"%0d";
 
@@ -1451,7 +1671,8 @@ _DateTimePresenter::DrawDateTimeDisplayBox(Canvas& canvas, int index)
        }
        else
        {
-               if ((__inputComposing == DATETIME_INPUT_BEGIN) && (status == DATETIME_STATUS_HIGHLIGHTED))
+               if ((__inputComposing == DATETIME_INPUT_BEGIN) && ((__keypadEnabled && status == DATETIME_STATUS_HIGHLIGHTED)
+                               || (!__keypadEnabled && status == DATETIME_STATUS_SELECTED)))
                {
                        r = text.Format(DATETIME_DISPLAY_STRING_MAX_LENGTH, L"%d", number);
                        SysTryReturnVoidResult(NID_UI_CTRL, (r == E_SUCCESS), r, "[%s] Propagating.", GetErrorMessage(r));
@@ -1481,8 +1702,6 @@ _DateTimePresenter::DrawPm(Canvas& canvas)
 
        _DateTimeUtils dateTimeUtils;
 
-
-
        if (__isPm == false)
        {
                dateTimeUtils.GetAmPm(text, AM_TYPE);
@@ -1500,11 +1719,18 @@ _DateTimePresenter::DrawPm(Canvas& canvas)
        }
        else if (__isPmButtonPressed == true)
        {
-               __pPmBox->DrawDisplayBox(canvas, DATETIME_STATUS_PRESSED);
+               __pPmBox->DrawDisplayBox(canvas, DATETIME_STATUS_SELECTED);
        }
        else
        {
-               __pPmBox->DrawDisplayBox(canvas, DATETIME_STATUS_NORMAL);
+               if (__keypadEnabled && __focusedBoxIndex == __outputBoxMaxCount)
+               {
+                       __pPmBox->DrawDisplayBox(canvas, DATETIME_STATUS_HIGHLIGHTED);
+               }
+               else
+               {
+                       __pPmBox->DrawDisplayBox(canvas, DATETIME_STATUS_NORMAL);
+               }
        }
 }
 
@@ -1977,13 +2203,30 @@ _DateTimePresenter::GetNumberInBox(int boxId) const
 void
 _DateTimePresenter::SetFocusBox(int index)
 {
-       __focusedBoxIndex = index;
+       if (__keypadEnabled)
+       {
+               __focusedBoxIndex = index;
+
+               if (__focusedBoxIndex < __outputBoxMaxCount)
+               {
+                       __selectedBoxIndex = __focusedBoxIndex;
+               }
+       }
+
        __isFocusBoxChanged = true;
+       __inputComposing = DATETIME_INPUT_END;
+       __changeFocusCounter = DATE_TIME_CHANGE_FOCUS_COUNTER_MIN;
+
+       int boxId = __pDisplayBox[__selectedBoxIndex]->GetDisplayBoxId();
+
+       ChangeInputPadStyle(boxId);
 }
 
 void
 _DateTimePresenter::LoadPickerData(void)
 {
+       _DateTimeUtils dateTimeUtils;
+
        __year = GetYear();
        __month = GetMonth();
        __day = GetDay();
@@ -2017,6 +2260,7 @@ _DateTimePresenter::LoadPickerData(void)
                        __isPm = false;
                }
        }
+
        __minute = GetMinute();
 }
 
@@ -2170,7 +2414,7 @@ _DateTimePresenter::AdjustDisplayValue(int index)
                {
                        maxValue = DATETIME_HOUR_MAX_FOR_24NOTATION;
 
-                       if(__hour == DATETIME_HOUR_MIN)
+                       if (__hour == DATETIME_HOUR_MIN)
                        {
                                minValue = DATETIME_HOUR_MAX_FOR_24NOTATION;
                        }
@@ -2192,12 +2436,27 @@ _DateTimePresenter::AdjustDisplayValue(int index)
 void
 _DateTimePresenter::ChangeFocusBox(void)
 {
-       if (__focusedBoxIndex < (__outputBoxMaxCount - 1))
+       if (__keypadEnabled)
        {
-               __focusedBoxIndex++;
-               int boxId = __pDisplayBox[__focusedBoxIndex]->GetDisplayBoxId();
-               ChangeInputPadStyle(boxId);
-               __isFocusBoxChanged = true;
+               if (__focusedBoxIndex < __outputBoxMaxCount - 1)
+               {
+                       __focusedBoxIndex++;
+                       __selectedBoxIndex = __focusedBoxIndex;
+                       int boxId = __pDisplayBox[__focusedBoxIndex]->GetDisplayBoxId();
+                       ChangeInputPadStyle(boxId);
+                       __isFocusBoxChanged = true;
+               }
+       }
+       else
+       {
+               if (__selectedBoxIndex < (__outputBoxMaxCount - 1))
+               {
+                       __selectedBoxIndex++;
+                       __focusedBoxIndex = __selectedBoxIndex;
+                       int boxId = __pDisplayBox[__selectedBoxIndex]->GetDisplayBoxId();
+                       ChangeInputPadStyle(boxId);
+                       __isFocusBoxChanged = true;
+               }
        }
 
        for (int i = 0; i < __outputBoxMaxCount; i++)
@@ -2209,19 +2468,6 @@ _DateTimePresenter::ChangeFocusBox(void)
        __changeFocusCounter = DATE_TIME_CHANGE_FOCUS_COUNTER_MIN;
 }
 
-int
-_DateTimePresenter::GetLocaleDateFormat(void) const
-{
-       int localeDateFormat = -1;
-       int error = vconf_get_int(VCONFKEY_SETAPPL_DATE_FORMAT_INT, &localeDateFormat);
-       if (error == -1)
-       {
-               localeDateFormat = SETTING_DATE_FORMAT_DD_MM_YYYY;
-       }
-
-       return localeDateFormat;
-}
-
 void
 _DateTimePresenter::SetAccessibilityElementText(void)
 {
index 912de49..66dfd09 100644 (file)
 
 #include <FBaseDateTime.h>
 #include <FLclDateTimeSymbols.h>
+#include <FLclLocaleManager.h>
+#include <FLclDateTimeFormatter.h>
+#include <FSysSettingInfo.h>
 #include "FUiCtrl_DateTimeUtils.h"
+#include "FUiCtrl_DateTimeDefine.h"
 #include "FUi_ResourceManager.h"
 
 using namespace Tizen::Base;
 using namespace Tizen::Locales;
 using namespace Tizen::Base::Collection;
+using namespace Tizen::System;
 
 namespace Tizen { namespace Ui { namespace Controls
 {
@@ -50,7 +55,7 @@ _DateTimeUtils::GetMonthString(int month) const
        dateSymbols.Construct(CALENDAR_GREGORIAN);
 
        const IList* pListOfShortMonths = dateSymbols.GetShortMonths();
-       SysTryReturn(NID_LCL, (pListOfShortMonths != null), text, E_SYSTEM, "[E_SYSTEM] A system error has occurred. pListOfShortMonths is null.");
+       SysTryReturn(NID_UI_CTRL, (pListOfShortMonths != null), text, E_SYSTEM, "[E_SYSTEM] A system error has occurred. pListOfShortMonths is null.");
 
        String* pObj = null;
        pObj = static_cast<String*>(const_cast<Object*>(pListOfShortMonths->GetAt(month - 1)));
@@ -116,7 +121,7 @@ _DateTimeUtils::GetAmPm(String& timeFormat, _AmPmType amPmType) const
        dateSymbols.Construct(CALENDAR_GREGORIAN);
 
        const IList* pListOfAmPm = dateSymbols.GetAmPm();
-       SysTryReturnVoidResult(NID_LCL, (pListOfAmPm != null), E_SYSTEM, "[E_SYSTEM] A system error has occurred. pListOfAmPm is null.");
+       SysTryReturnVoidResult(NID_UI_CTRL, (pListOfAmPm != null), E_SYSTEM, "[E_SYSTEM] A system error has occurred. pListOfAmPm is null.");
 
        String* pObj = null;
        pObj = static_cast<String*>(const_cast<Object*>(pListOfAmPm->GetAt(amPmType)));
@@ -151,4 +156,76 @@ _DateTimeUtils::GetFullMonthString(int month) const
 
        return text;
 }
+
+int
+_DateTimeUtils::GetLocaleDateFormat(void) const
+{
+       result r = E_SUCCESS;
+
+       LocaleManager localeManager;
+       int localeDateFormat = 0;
+
+       r = localeManager.Construct();
+       SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, localeDateFormat, E_SYSTEM, "[E_SYSTEM] A system error has occurred.");
+
+       Locale systemLocale = localeManager.GetSystemLocale();
+
+       DateTimeFormatter* pDateFormatter = DateTimeFormatter::CreateDateFormatterN(systemLocale, DATE_TIME_STYLE_LONG);
+       r = GetLastResult();
+       SysTryReturn(NID_UI_CTRL, pDateFormatter != null, localeDateFormat, r, "[%s] Propagating.", GetErrorMessage(r));
+
+       String formatString = pDateFormatter->GetPattern();
+       formatString.ToLowerCase();
+
+       delete pDateFormatter;
+       pDateFormatter = null;
+
+       int stringLength = formatString.GetLength();
+       String parsedString = L"";
+
+       for (int i = 0; i < stringLength; i++)
+       {
+               wchar_t ch = '\0';
+               r = formatString.GetCharAt(i, ch);
+               SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, localeDateFormat, r, "[%s] Propagating.", GetErrorMessage(r));
+
+               if (ch == 'd' && !parsedString.Contains(L"DD"))
+               {
+                       parsedString.Append(L"DD");
+               }
+               else if (ch == 'm' && !parsedString.Contains(L"MM"))
+               {
+                       parsedString.Append(L"MM");
+               }
+               else if (ch == 'y' && !parsedString.Contains(L"YYYY"))
+               {
+                       parsedString.Append(L"YYYY");
+               }
+
+               if (parsedString.GetLength() == LOCALE_DATE_FORMAT_STRING_LENGTH)
+               {
+                       break;
+               }
+       }
+
+       if (parsedString.Equals(L"DDMMYYYY", false))
+       {
+               localeDateFormat = DATE_FORMAT_DDMMYYYY;
+       }
+       else if (parsedString.Equals(L"MMDDYYYY", false))
+       {
+               localeDateFormat = DATE_FORMAT_MMDDYYYY;
+       }
+       else if (parsedString.Equals(L"YYYYMMDD", false))
+       {
+               localeDateFormat = DATE_FORMAT_YYYYMMDD;
+       }
+       else if (parsedString.Equals(L"YYYYDDMM", false))
+       {
+               localeDateFormat = DATE_FORMAT_YYYYDDMM;
+       }
+
+       return localeDateFormat;
+}
+
 }}} // Tizen::Ui::Controls
index ac5fe30..e447c6c 100644 (file)
@@ -20,7 +20,6 @@
  * @brief              This is the implementation file for the _EditDate class.
  */
 
-#include <vconf.h>
 #include <FSysSettingInfo.h>
 #include "FUi_AccessibilityContainer.h"
 #include "FUi_AccessibilityElement.h"
@@ -716,24 +715,27 @@ _EditDate::CreateAccessibilityElement(void)
                __pAccessibilityDayElement->SetTrait(ACCESSIBILITY_TRAITS_DAY);
                __pAccessibilityDayElement->SetHint(hintText);
 
-               switch (__pEditDatePresenter->GetLocaleDateFormat())
+               _DateTimeUtils dateTimeUtils;
+               int localeDateFormat =  dateTimeUtils.GetLocaleDateFormat();
+
+               switch (localeDateFormat)
                {
-               case SETTING_DATE_FORMAT_DD_MM_YYYY:
+               case DATE_FORMAT_DDMMYYYY:
                        pContainer->AddElement(*__pAccessibilityDayElement);
                        pContainer->AddElement(*__pAccessibilityMonthElement);
                        pContainer->AddElement(*__pAccessibilityYearElement);
                        break;
-               case SETTING_DATE_FORMAT_MM_DD_YYYY:
+               case DATE_FORMAT_MMDDYYYY:
                        pContainer->AddElement(*__pAccessibilityMonthElement);
                        pContainer->AddElement(*__pAccessibilityDayElement);
                        pContainer->AddElement(*__pAccessibilityYearElement);
                        break;
-               case SETTING_DATE_FORMAT_YYYY_MM_DD:
+               case DATE_FORMAT_YYYYMMDD:
                        pContainer->AddElement(*__pAccessibilityYearElement);
                        pContainer->AddElement(*__pAccessibilityMonthElement);
                        pContainer->AddElement(*__pAccessibilityDayElement);
                        break;
-               case SETTING_DATE_FORMAT_YYYY_DD_MM:
+               case DATE_FORMAT_YYYYDDMM:
                        pContainer->AddElement(*__pAccessibilityYearElement);
                        pContainer->AddElement(*__pAccessibilityDayElement);
                        pContainer->AddElement(*__pAccessibilityMonthElement);
@@ -805,8 +807,6 @@ _EditDate::OnChangeLayout(_ControlOrientation orientation)
 bool
 _EditDate::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo)
 {
-       SetFocused(true);
-
        FloatRectangle absoluteBounds = GetAbsoluteBoundsF();
 
        if (absoluteBounds.y != __absoluteBounds.y || absoluteBounds.height != __absoluteBounds.height)
@@ -958,6 +958,54 @@ _EditDate::OnSettingChanged(String& key)
        return;
 }
 
+bool
+_EditDate::OnKeyPressed(const _Control &source, const _KeyInfo &keyInfo)
+{
+       _KeyCode keyCode = keyInfo.GetKeyCode();
+
+       switch (keyCode)
+       {
+               case _KEY_ENTER:
+               {
+
+                       FloatRectangle absoluteBounds = GetAbsoluteBoundsF();
+
+                       if (absoluteBounds.y != __absoluteBounds.y || absoluteBounds.height != __absoluteBounds.height)
+                       {
+                               CalculateDateTimeBarPosition();
+                       }
+                       break;
+               }
+               default:
+                       break;
+
+       }
+
+       return __pEditDatePresenter->OnKeyPressed(source, keyInfo);
+}
+
+bool
+_EditDate::OnFocusGained(const _Control &source)
+{
+       __pEditDatePresenter->SetFocusedElement();
+       return true;
+}
+
+bool
+_EditDate::OnFocusLost(const _Control &source)
+{
+       __pEditDatePresenter->OnFocusLost(source);
+       return true;
+}
+
+void
+_EditDate::OnDrawFocus(void)
+{
+       __pEditDatePresenter->SetFocusState(true);
+       __pEditDatePresenter->DrawFocus();
+       return;
+}
+
 FloatRectangle
 _EditDate::GetParentWindowBounds(void) const
 {
@@ -1023,30 +1071,33 @@ _EditDate::UpdateAccessibilityElement(void)
        dayString.Append(GetDay());
        String monthString = GetDateTimeBar()->GetMonthValue(GetMonth()).GetPointer();
 
-       switch (__pEditDatePresenter->GetLocaleDateFormat())
+       _DateTimeUtils dateTimeUtils;
+       int localeDateFormat =  dateTimeUtils.GetLocaleDateFormat();
+
+       switch (localeDateFormat)
        {
-       case SETTING_DATE_FORMAT_DD_MM_YYYY:
+       case DATE_FORMAT_DDMMYYYY:
                string.Append(dayString.GetPointer());
                string.Append(space.GetPointer());
                string.Append(monthString.GetPointer());
                string.Append(space.GetPointer());
                string.Append(yearString.GetPointer());
                break;
-       case SETTING_DATE_FORMAT_MM_DD_YYYY:
+       case DATE_FORMAT_MMDDYYYY:
                string.Append(monthString.GetPointer());
                string.Append(space.GetPointer());
                string.Append(dayString.GetPointer());
                string.Append(space.GetPointer());
                string.Append(yearString.GetPointer());
                break;
-       case SETTING_DATE_FORMAT_YYYY_MM_DD:
+       case DATE_FORMAT_YYYYMMDD:
                string.Append(yearString.GetPointer());
                string.Append(space.GetPointer());
                string.Append(monthString.GetPointer());
                string.Append(space.GetPointer());
                string.Append(dayString.GetPointer());
                break;
-       case SETTING_DATE_FORMAT_YYYY_DD_MM:
+       case DATE_FORMAT_YYYYDDMM:
                string.Append(yearString.GetPointer());
                string.Append(space.GetPointer());
                string.Append(dayString.GetPointer());
index e5dc76f..bb5f55f 100644 (file)
@@ -77,6 +77,9 @@ _EditDatePresenter::_EditDatePresenter(void)
        , __isAnimating(false)
        , __isEditDateInitialized(false)
        , __elementWidth(0.0f)
+       , __focusStatus(FOCUS_NONE)
+       , __isEnterKeyPressed(false)
+       , __isFocused(false)
 {
 }
 
@@ -412,19 +415,6 @@ CATCH:
        return r;
 }
 
-int
-_EditDatePresenter::GetLocaleDateFormat(void) const
-{
-       int localeDateFormat = -1;
-       int error = vconf_get_int(VCONFKEY_SETAPPL_DATE_FORMAT_INT, &localeDateFormat);
-       if (error == -1)
-       {
-               localeDateFormat = SETTING_DATE_FORMAT_DD_MM_YYYY;
-       }
-
-       return localeDateFormat;
-}
-
 DateTime
 _EditDatePresenter::GetDate(void) const
 {
@@ -553,7 +543,6 @@ result
 _EditDatePresenter::Draw(void)
 {
        result r = E_SUCCESS;
-
        if (__isAnimating)
        {
                return E_SUCCESS;
@@ -588,36 +577,123 @@ _EditDatePresenter::Draw(void)
        r = DrawText(*pCanvas, GetDateAreaBounds(DATETIME_ID_YEAR), yearString, DATETIME_ID_YEAR);
        SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
 
+       if (__pEditDate->IsFocused())
+       {
+               DrawFocus();
+       }
+
+CATCH:
        delete pCanvas;
+       return r;
+}
+
+result
+_EditDatePresenter::DrawFocus(void)
+{
+       FloatRectangle bounds(0.0f, 0.0f, 0.0f, 0.0f);
+
+       Canvas* pCanvas = __pEditDate->GetCanvasN();
+       SysTryReturnResult(NID_UI_CTRL, (pCanvas != null), E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Unable to create canvas.");
+
+       if (__focusStatus == FOCUS_DAY)
+       {
+               bounds = GetDateAreaBounds(DATETIME_ID_DAY);
+       }
+       else if (__focusStatus == FOCUS_MONTH)
+       {
+               bounds = GetDateAreaBounds(DATETIME_ID_MONTH);
+       }
+       else if (__focusStatus == FOCUS_YEAR)
+       {
+               bounds = GetDateAreaBounds(DATETIME_ID_YEAR);
+       }
+
+       bounds.y = bounds.y - (__adjustFocusHeight / 2.0f);
+       bounds.height = bounds.height + __adjustFocusHeight;
+
+       result r = E_SUCCESS;
+
+       if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*__pContentBgHighlightedColorReplacementBitmap))
+       {
+               r = pCanvas->DrawNinePatchedBitmap(bounds, *__pContentBgHighlightedColorReplacementBitmap);
+               SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
+       }
+       else
+       {
+               r = pCanvas->DrawBitmap(bounds, *__pContentBgHighlightedColorReplacementBitmap);
+               SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
+
+       }
 
+       delete pCanvas;
        return r;
 
-       CATCH:
+CATCH:
        delete pCanvas;
        return r;
 }
 
+void
+_EditDatePresenter::UpdateLastSelectedValue(_DateTimeId id, bool isTouchPressed)
+{
+       __selectedId = id;
+       SetLastSelectedId(id);
+       __lastSelectedValue = "";
+       _DateTimeUtils dateTimeUtils;
+
+       if (GetLastSelectedId() == DATETIME_ID_YEAR)
+       {
+               __lastSelectedValue.Format(10, L"%04d", GetYear());
+               if (isTouchPressed)
+               {
+                       PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP);
+               }
+       }
+       else if (GetLastSelectedId() == DATETIME_ID_MONTH)
+       {
+               __lastSelectedValue = dateTimeUtils.GetMonthString(GetMonth());
+               if (isTouchPressed)
+               {
+                       PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP);
+               }
+       }
+       else if (GetLastSelectedId() == DATETIME_ID_DAY)
+       {
+               __lastSelectedValue.Format(10, L"%02d", GetDay());
+               if (isTouchPressed)
+               {
+                       PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP);
+               }
+       }
+
+       __pEditDate->Invalidate();
+       return;
+}
+
 result
 _EditDatePresenter::CalculateAreaBounds(void)
 {
        result r = E_SUCCESS;
 
-       if (GetLocaleDateFormat() == DATE_FORMAT_DDMMYYYY)
+        _DateTimeUtils dateTimeUtils;
+       int localeDateFormat =  dateTimeUtils.GetLocaleDateFormat();
+
+       if (localeDateFormat == DATE_FORMAT_DDMMYYYY)
        {
                __monthBounds.x = __dayBounds.x + __dayBounds.width + __elementMargin;
                __yearBounds.x = __monthBounds.x + __monthBounds.width + __elementMargin;
        }
-       else if (GetLocaleDateFormat() == DATE_FORMAT_MMDDYYYY)
+       else if (localeDateFormat == DATE_FORMAT_MMDDYYYY)
        {
                __dayBounds.x = __monthBounds.x + __monthBounds.width + __elementMargin;
                __yearBounds.x = __dayBounds.x + __dayBounds.width + __elementMargin;
        }
-       else if (GetLocaleDateFormat() == DATE_FORMAT_YYYYMMDD)
+       else if (localeDateFormat == DATE_FORMAT_YYYYMMDD)
        {
                __monthBounds.x = __yearBounds.x + __yearBounds.width + __elementMargin;
                __dayBounds.x = __monthBounds.x + __monthBounds.width + __elementMargin;
        }
-       else if (GetLocaleDateFormat() == DATE_FORMAT_YYYYDDMM)
+       else if (localeDateFormat == DATE_FORMAT_YYYYDDMM)
        {
                __dayBounds.x = __yearBounds.x + __yearBounds.width + __elementMargin;
                __monthBounds.x = __dayBounds.x + __dayBounds.width + __elementMargin;
@@ -840,6 +916,213 @@ _EditDatePresenter::OnFontInfoRequested(unsigned long& style, float& size)
        return;
 }
 
+void
+_EditDatePresenter::SetFocusState(bool isFocused)
+{
+       __isFocused = isFocused;
+}
+
+void
+_EditDatePresenter::SetFocusedElement()
+{
+       _DateTimeUtils dateTimeUtils;
+       int localeDateFormat =  dateTimeUtils.GetLocaleDateFormat();
+       if (__focusStatus == FOCUS_NONE)
+       {
+               if (localeDateFormat == DATE_FORMAT_DDMMYYYY)
+               {
+                       __focusStatus = FOCUS_DAY;
+               }
+               else if (localeDateFormat == DATE_FORMAT_MMDDYYYY)
+               {
+                       __focusStatus = FOCUS_MONTH;
+               }
+               else if (localeDateFormat == DATE_FORMAT_YYYYMMDD)
+               {
+                       __focusStatus = FOCUS_YEAR;
+               }
+               else if (localeDateFormat == DATE_FORMAT_YYYYDDMM)
+               {
+                       __focusStatus = FOCUS_YEAR;
+               }
+       }
+       return;
+}
+
+bool
+_EditDatePresenter::OnFocusLost(const _Control &source)
+{
+       if (!__isEnterKeyPressed)
+       {
+               __focusStatus = FOCUS_NONE;
+       }
+       else
+       {
+               __isEnterKeyPressed = false;
+       }
+       __pEditDate->Invalidate();
+       return true;
+}
+
+bool
+_EditDatePresenter::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo)
+{
+       if (!__isFocused)
+       {
+               return false;
+       }
+       _KeyCode keyCode = keyInfo.GetKeyCode();
+
+       int minValue = -1;
+       int maxValue = -1;
+       int displayValue = -1;
+
+       _DateTimeId boxId = DATETIME_ID_NONE;
+       _DateTimeUtils dateTimeUtils;
+       int localeDateFormat =  dateTimeUtils.GetLocaleDateFormat();
+
+       switch (keyCode)
+       {
+               case _KEY_RIGHT:
+               {
+                       if (__focusStatus == FOCUS_DAY)
+                       {
+                               if (localeDateFormat == DATE_FORMAT_DDMMYYYY || localeDateFormat == DATE_FORMAT_YYYYDDMM)
+                               {
+                                       __focusStatus = FOCUS_MONTH;
+                               }
+                               else if (localeDateFormat == DATE_FORMAT_MMDDYYYY)
+                               {
+                                       __focusStatus = FOCUS_YEAR;
+                               }
+                       }
+                       else if (__focusStatus == FOCUS_MONTH)
+                       {
+                               if (localeDateFormat == DATE_FORMAT_DDMMYYYY)
+                               {
+                                       __focusStatus = FOCUS_YEAR;
+                               }
+                               else if (localeDateFormat == DATE_FORMAT_MMDDYYYY || localeDateFormat == DATE_FORMAT_YYYYMMDD)
+                               {
+                                       __focusStatus = FOCUS_DAY;
+                               }
+                       }
+                       else if (__focusStatus == FOCUS_YEAR)
+                       {
+                               if (localeDateFormat == DATE_FORMAT_YYYYMMDD)
+                               {
+                                       __focusStatus = FOCUS_MONTH;
+                               }
+                               else if (localeDateFormat == DATE_FORMAT_YYYYDDMM)
+                               {
+                                       __focusStatus = FOCUS_DAY;
+                               }
+                       }
+                       __pEditDate->Invalidate();
+                       break;
+               }
+
+               case _KEY_LEFT:
+               {
+                       if (__focusStatus == FOCUS_DAY)
+                       {
+                               if (localeDateFormat == DATE_FORMAT_YYYYDDMM)
+                               {
+                                       __focusStatus = FOCUS_YEAR;
+                               }
+                               else if (localeDateFormat == DATE_FORMAT_MMDDYYYY || localeDateFormat == DATE_FORMAT_YYYYMMDD)
+                               {
+                                       __focusStatus = FOCUS_MONTH;
+                               }
+                       }
+                       else if (__focusStatus == FOCUS_MONTH)
+                       {
+                               if (localeDateFormat == DATE_FORMAT_YYYYMMDD)
+                               {
+                                       __focusStatus = FOCUS_YEAR;
+                               }
+                               else if (localeDateFormat == DATE_FORMAT_DDMMYYYY || localeDateFormat == DATE_FORMAT_YYYYDDMM)
+                               {
+                                       __focusStatus = FOCUS_DAY;
+                               }
+                       }
+                       else if (__focusStatus == FOCUS_YEAR)
+                       {
+                               if (localeDateFormat == DATE_FORMAT_DDMMYYYY)
+                               {
+                                       __focusStatus = FOCUS_MONTH;
+                               }
+                               else if (localeDateFormat == DATE_FORMAT_MMDDYYYY)
+                               {
+                                       __focusStatus = FOCUS_DAY;
+                               }
+                       }
+                       __pEditDate->Invalidate();
+                       break;
+               }
+
+               case _KEY_ENTER:
+               {
+                       __isEnterKeyPressed = true;
+                       if (__focusStatus == FOCUS_DAY)
+                       {
+                               _DateTimeUtils dateTimeUtils;
+                               maxValue = dateTimeUtils.CalculateMaxDay(GetYear(), GetMonth());
+                               minValue = DATETIME_DAY_MIN;
+                               displayValue = GetDay();
+                               boxId = DATETIME_ID_DAY;
+
+                               if (__pEditDate->GetDateTimeBar()->GetItemCount() > 0)
+                               {
+                                       __pEditDate->GetDateTimeBar()->RemoveAllItems();
+                               }
+                       }
+
+                       else if (__focusStatus == FOCUS_MONTH)
+                       {
+                               minValue = DATETIME_MONTH_MIN;
+                               maxValue = DATETIME_MONTH_MAX;
+                               displayValue = GetMonth();
+                               boxId = DATETIME_ID_MONTH;
+
+                               if (__pEditDate->GetDateTimeBar()->GetItemCount() > 0)
+                               {
+                                       __pEditDate->GetDateTimeBar()->RemoveAllItems();
+                               }
+                       }
+                       else if (__focusStatus == FOCUS_YEAR)
+                       {
+                               minValue = GetMinYear();
+                               maxValue = GetMaxYear();
+                               displayValue = GetYear();
+                               boxId = DATETIME_ID_YEAR;
+
+                               if (__pEditDate->GetDateTimeBar()->GetItemCount() > 0)
+                               {
+                                       __pEditDate->GetDateTimeBar()->RemoveAllItems();
+                               }
+                       }
+                       FloatRectangle absoluteBounds = __pEditDate->GetAbsoluteBoundsF();
+
+                       FloatRectangle bounds(0.0f, 0.0f, 0.0f, 0.0f);
+                       bounds = GetDateAreaBounds(boxId);
+                       bounds.x += absoluteBounds.x;
+                       __pEditDate->GetDateTimeBar()->CalculateArrowBounds(bounds);
+                       __pEditDate->GetDateTimeBar()->SetInitialValue(minValue, maxValue, displayValue, boxId);
+                       __pEditDate->GetDateTimeBar()->SetVisibleState(true);
+                       __pEditDate->GetDateTimeBar()->Open();
+
+                       UpdateLastSelectedValue(boxId, false);
+                       break;
+               }
+               default:
+               {
+                       return false;
+               }
+       }
+       return true;
+}
+
 bool
 _EditDatePresenter::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo)
 {
@@ -943,27 +1226,7 @@ _EditDatePresenter::OnTouchReleased(const _Control& source, const _TouchInfo& to
                return true;
        }
 
-       SetLastSelectedId(__selectedId);
-
-       __lastSelectedValue = "";
-       _DateTimeUtils dateTimeUtils;
-       if (GetLastSelectedId() == DATETIME_ID_YEAR)
-       {
-               __lastSelectedValue.Format(10, L"%04d", GetYear());
-               PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP);
-       }
-       else if (GetLastSelectedId() == DATETIME_ID_MONTH)
-       {
-               __lastSelectedValue = dateTimeUtils.GetMonthString(GetMonth());
-               PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP);
-       }
-       else if (GetLastSelectedId() == DATETIME_ID_DAY)
-       {
-               __lastSelectedValue.Format(10, L"%02d", GetDay());
-               PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP);
-       }
-
-       Draw();
+       UpdateLastSelectedValue(__selectedId, true);
 
        if ((__pEditDate->GetDateTimeBar() != null) && (GetLastSelectedId() != DATETIME_ID_NONE))
        {
index b10d7f0..eec5ab6 100644 (file)
@@ -816,8 +816,25 @@ _EditPresenter::GetPreviousText(InputConnection& source, String& text, int& curs
                }
                else
                {
-                       text = GetText(__cursorPos-SURRONDING_TEXT_SIZE, __cursorPos - 1);
+                       int previousTextSize = 0;
+
+                       for( int index = 0; index < __cursorPos; index++)
+                       {
+                               previousTextSize++;
+                               if ( __pTextBuffer[__cursorPos-index-1] != 0x20)
+                               {
+                                       break;
+                               }
+                       }
+
+                       if (previousTextSize < SURRONDING_TEXT_SIZE)
+                       {
+                               previousTextSize = SURRONDING_TEXT_SIZE;
+                       }
+
+                       text = GetText(__cursorPos - previousTextSize, __cursorPos - 1);
                }
+
                stringLength = text.GetLength();
                cursorPosition = stringLength;
        }
@@ -2868,7 +2885,7 @@ _EditPresenter::OnTouchPressed(const _Control& source, const _TouchInfo& touchIn
                }
        }
 
-       if (__pEdit->GetEditStyle() & EDIT_STYLE_CLEAR)
+       if (__pEdit->GetEditStyle() & EDIT_STYLE_CLEAR && __pTextString->GetLength() > 0)
        {
                if ((__pressedPoint.x >= __clearIconBounds.x) && (__pressedPoint.x <= __clearIconBounds.x + __clearIconBounds.width)) // Clear Icon Pressed
                {
@@ -5706,6 +5723,13 @@ _EditPresenter::UpdateComponentInformation(void)
                                ScrollText(-textGapFromBottom);
                        }
                }
+               else
+               {
+                       if (firstDisplayY > 0)
+                       {
+                               ScrollText(-firstDisplayY);
+                       }
+               }
 
                FloatRectangle absCursorBounds(0.0f, 0.0f, 0.0f, 0.0f);
                CalculateAbsoluteCursorBounds(__cursorPos, absCursorBounds);
index 9709d62..991f6c9 100644 (file)
@@ -490,7 +490,7 @@ _EditTime::OnDraw(void)
 
        __pEditTimePresenter->Draw();
 
-       if(unlikely((_AccessibilityManager::IsActivated())))
+       if (unlikely((_AccessibilityManager::IsActivated())))
        {
                UpdateAccessibilityElement();
        }
@@ -608,8 +608,6 @@ _EditTime::OnChangeLayout(_ControlOrientation orientation)
 bool
 _EditTime::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo)
 {
-       SetFocused(true);
-
        FloatRectangle absoluteBounds = GetAbsoluteBoundsF();
        if (absoluteBounds.y != __absoluteBounds.y || absoluteBounds.height != __absoluteBounds.height)
        {
@@ -759,6 +757,52 @@ _EditTime::OnSettingChanged(String& key)
        return;
 }
 
+void
+_EditTime::OnDrawFocus(void)
+{
+       __pEditTimePresenter->SetFocusState(true);
+       __pEditTimePresenter->DrawFocus();
+       return;
+}
+
+bool
+_EditTime::OnKeyPressed(const _Control &source, const _KeyInfo &keyInfo)
+{
+       _KeyCode keyCode = keyInfo.GetKeyCode();
+
+       switch (keyCode)
+       {
+               case _KEY_ENTER:
+               {
+                       FloatRectangle absoluteBounds = GetAbsoluteBoundsF();
+
+                       if (absoluteBounds.y != __absoluteBounds.y || absoluteBounds.height != __absoluteBounds.height)
+                       {
+                               CalculateDateTimeBarPosition();
+                       }
+                       break;
+               }
+               default:
+               break;
+
+       }
+
+       return __pEditTimePresenter->OnKeyPressed(source, keyInfo);
+}
+
+bool
+_EditTime::OnFocusGained(const _Control &source)
+{
+       __pEditTimePresenter->SetFocusedElement();
+       return true;
+}
+
+bool
+_EditTime::OnFocusLost(const _Control &source)
+{
+       return __pEditTimePresenter->OnFocusLost(source);
+}
+
 FloatRectangle
 _EditTime::GetParentWindowBounds(void) const
 {
index c59ae76..5c43b9a 100644 (file)
@@ -84,6 +84,9 @@ _EditTimePresenter::_EditTimePresenter(const String& title)
        , __timeFontSize(0.0f)
        , __isAnimating(false)
        , __isEditTimeInitialized(false)
+       , __focusStatus(FOCUS_NONE)
+       , __isEnterKeyPressed(false)
+       , __isFocused(false)
 {
 }
 
@@ -858,9 +861,57 @@ _EditTimePresenter::Draw(void)
                SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
        }
 
+       if (__pEditTime->IsFocused())
+       {
+               DrawFocus();
+       }
+
 CATCH:
        delete pCanvas;
+       return r;
+}
+
+result
+_EditTimePresenter::DrawFocus(void)
+{
+       FloatRectangle bounds(0.0f, 0.0f, 0.0f, 0.0f);
 
+       Canvas* pCanvas = __pEditTime->GetCanvasN();
+       SysTryReturnResult(NID_UI_CTRL, (pCanvas != null), E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Unable to create canvas.");
+
+       if (__focusStatus == FOCUS_HOUR)
+       {
+               bounds = GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_HOUR);
+       }
+       else if (__focusStatus == FOCUS_MINUTE)
+       {
+               bounds = GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_MINUTE);
+       }
+       else if (__focusStatus == FOCUS_AMPM)
+       {
+               bounds = GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_AMPM);
+       }
+       result r = E_SUCCESS;
+
+       bounds.y = bounds.y - (__adjustFocusHeight / 2.0f);
+       bounds.height = bounds.height + __adjustFocusHeight;
+
+       if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*__pContentBgHighlightedColorReplacementBitmap))
+       {
+               r = pCanvas->DrawNinePatchedBitmap(bounds, *__pContentBgHighlightedColorReplacementBitmap);
+               SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
+       }
+       else
+       {
+               r = pCanvas->DrawBitmap(bounds, *__pContentBgHighlightedColorReplacementBitmap);
+               SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
+       }
+
+       delete pCanvas;
+       return r;
+
+CATCH:
+       delete pCanvas;
        return r;
 }
 
@@ -1081,6 +1132,181 @@ _EditTimePresenter::GetLastSelectedId(void) const
        return __lastSelectedId;
 }
 
+void
+_EditTimePresenter::SetFocusedElement()
+{
+       if (__focusStatus == FOCUS_NONE || __focusStatus == FOCUS_AMPM)
+       {
+               __focusStatus = FOCUS_HOUR;
+       }
+
+       return;
+}
+
+void
+_EditTimePresenter::SetFocusState(bool isFocused)
+{
+       __isFocused = isFocused;
+       return;
+}
+
+bool
+_EditTimePresenter::OnFocusLost(const _Control &source)
+{
+       if (!__isEnterKeyPressed || __focusStatus == FOCUS_AMPM)
+       {
+               __focusStatus = FOCUS_NONE;
+       }
+       else
+       {
+               __isEnterKeyPressed = false;
+       }
+       __pEditTime->Invalidate();
+       return true;
+}
+
+bool
+_EditTimePresenter::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo)
+{
+       if (!__isFocused)
+       {
+               return false;
+       }
+       _KeyCode keyCode = keyInfo.GetKeyCode();
+
+       int minValue = -1;
+       int maxValue = -1;
+       int displayValue = -1;
+
+       _DateTimeId boxId = DATETIME_ID_HOUR;
+
+       switch (keyCode)
+       {
+               case _KEY_RIGHT:
+               {
+                       __isEnterKeyPressed = false;
+                       if (__focusStatus == FOCUS_HOUR)
+                       {
+                               __focusStatus = FOCUS_MINUTE;
+                       }
+                       else if (__focusStatus == FOCUS_MINUTE)
+                       {
+                               if (!Is24HourNotationEnabled())
+                               {
+                                       __focusStatus = FOCUS_AMPM;
+                               }
+                       }
+
+                       __pEditTime->Invalidate();
+                       break;
+               }
+
+               case _KEY_LEFT:
+               {
+                       __isEnterKeyPressed = false;
+                       if (__focusStatus == FOCUS_MINUTE)
+                       {
+                               __focusStatus = FOCUS_HOUR;
+                       }
+                       else if (__focusStatus == FOCUS_AMPM)
+                       {
+                               __focusStatus = FOCUS_MINUTE;
+                       }
+                       __pEditTime->Invalidate();
+                       break;
+               }
+
+               case _KEY_ENTER:
+               {
+                       __isEnterKeyPressed = true;
+                       if (__focusStatus == FOCUS_HOUR)
+                       {
+                               boxId = DATETIME_ID_HOUR;
+                               if (__pEditTime->GetDateTimeBar() != null)
+                               {
+                                       if (!Is24HourNotationEnabled())
+                                       {
+                                               if (GetHour() == 0)
+                                               {
+                                                       minValue = DATETIME_HOUR_MIN + 1;
+                                                       maxValue = DATETIME_HOUR_MAX_FOR_24NOTATION;
+                                                       displayValue = DATETIME_HOUR_MAX_FOR_24NOTATION;
+                                               }
+                                               else if (GetHour() > DATETIME_HOUR_MAX_FOR_24NOTATION)
+                                               {
+                                                       minValue = DATETIME_HOUR_MIN + 1;
+                                                       maxValue = DATETIME_HOUR_MAX_FOR_24NOTATION;
+                                                       displayValue = __pEditTime->GetHour() - DATETIME_HOUR_MAX_FOR_24NOTATION;
+                                               }
+                                               else
+                                               {
+                                                       minValue = DATETIME_HOUR_MIN + 1;
+                                                       maxValue = DATETIME_HOUR_MAX_FOR_24NOTATION;
+                                                       displayValue = __pEditTime->GetHour();
+                                               }
+                                       }
+                                       else
+                                       {
+                                               minValue = DATETIME_HOUR_MIN;
+                                               maxValue = DATETIME_HOUR_MAX;
+                                               displayValue = __pEditTime->GetHour();
+                                       }
+
+                                       if (__pEditTime->GetDateTimeBar()->GetItemCount() > 0)
+                                       {
+                                               __pEditTime->GetDateTimeBar()->RemoveAllItems();
+                                       }
+                               }
+                       }
+                       else if (__focusStatus == FOCUS_MINUTE)
+                       {
+                               if (__pEditTime->GetDateTimeBar() != null)
+                               {
+                                       minValue = DATETIME_MINUTE_MIN;
+                                       maxValue = DATETIME_MINUTE_MAX;
+                                       displayValue = __pEditTime->GetMinute();
+
+                                       if (__pEditTime->GetDateTimeBar()->GetItemCount() > 0)
+                                       {
+                                               __pEditTime->GetDateTimeBar()->RemoveAllItems();
+                                       }
+                               }
+                               boxId = DATETIME_ID_MINUTE;
+                       }
+                       else if (__focusStatus == FOCUS_AMPM)
+                       {
+                               SetAmEnabled(!GetAmEnabled());
+                               __pEditTime->FireTimeChangeEvent(TIME_INTERNAL_CHANGE_SAVED);
+                               boxId = DATETIME_ID_AMPM;
+
+                               DrawFocus();
+                       }
+
+                       if ((__pEditTime->GetDateTimeBar() != null) && (boxId != DATETIME_ID_AMPM))
+                       {
+                               FloatRectangle absoluteBounds = __pEditTime->GetAbsoluteBoundsF();
+
+                               FloatRectangle bounds(0.0f, 0.0f, 0.0f, 0.0f);
+                               bounds = GetDisplayAreaBoundsFromHoursStyle(boxId);
+                               bounds.x += absoluteBounds.x;
+
+                               __pEditTime->GetDateTimeBar()->SetInitialValue(minValue, maxValue, displayValue, boxId);
+                               __pEditTime->GetDateTimeBar()->CalculateArrowBounds(bounds);
+                               __pEditTime->GetDateTimeBar()->SetVisibleState(true);
+                               __pEditTime->GetDateTimeBar()->Open();
+                               UpdateLastSelectedValue(boxId, false);
+                       }
+                       break;
+               }
+
+               default:
+               {
+                       return false;
+               }
+       }
+       return true;
+}
+
 bool
 _EditTimePresenter::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo)
 {
@@ -1228,11 +1454,46 @@ _EditTimePresenter::OnTouchReleased(const _Control& source, const _TouchInfo& to
 
                return true;
        }
+       UpdateLastSelectedValue(__selectedId, true);
+       if (GetLastSelectedId() == DATETIME_ID_AMPM)
+       {
+               return true;
+       }
+
+       Draw();
+
+       if ((__pEditTime->GetDateTimeBar() != null) && (boxId != DATETIME_ID_AMPM) && (GetLastSelectedId() != DATETIME_ID_NONE))
+       {
+               FloatRectangle bounds(0.0f, 0.0f, 0.0f, 0.0f);
+               bounds = GetDisplayAreaBoundsFromHoursStyle(GetLastSelectedId());
+               FloatRectangle absoluteBounds(0.0f, 0.0f, 0.0f, 0.0f);
+               absoluteBounds = __pEditTime->GetAbsoluteBoundsF();
+               bounds.x += absoluteBounds.x;
+
+               __pEditTime->GetDateTimeBar()->CalculateArrowBounds(bounds);
+
+               if (__pEditTime->GetDateTimeBar()->IsActivated())
+               {
+                       __pEditTime->GetDateTimeBar()->RefreshItems();
+               }
+               else
+               {
+                       __pEditTime->GetDateTimeBar()->SetVisibleState(true);
+                       __pEditTime->GetDateTimeBar()->Open();
+               }
+       }
+
+       __selectedId = DATETIME_ID_NONE;
+       return true;
+}
 
-       SetLastSelectedId(__selectedId);
+void
+_EditTimePresenter::UpdateLastSelectedValue(_DateTimeId boxId, bool isTouchPressed)
+{
+       __selectedId = boxId;
+       SetLastSelectedId(boxId);
 
        __lastSelectedValue = "";
-       _DateTimeUtils dateTimeUtils;
 
        if (GetLastSelectedId() == DATETIME_ID_HOUR)
        {
@@ -1244,24 +1505,32 @@ _EditTimePresenter::OnTouchReleased(const _Control& source, const _TouchInfo& to
 
                        if (hours == DATETIME_HOUR_MIN)
                        {
-                               hours = hours + DATETIME_HOUR_MAX_FOR_24NOTATION;
+                               hours = hours + DATETIME_HOUR_MAX_FOR_24NOTATION;
                        }
                }
                __lastSelectedValue.Format(10, L"%02d", hours);
-               PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP);
+               if (isTouchPressed)
+               {
+                       PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP);
+               }
        }
        else if (GetLastSelectedId() == DATETIME_ID_MINUTE)
        {
                __lastSelectedValue.Format(10, L"%02d", GetMinute());
-               PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP);
+               if (isTouchPressed)
+               {
+                       PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP);
+               }
        }
        else if (GetLastSelectedId() == DATETIME_ID_AMPM)
        {
                SetAmEnabled(!GetAmEnabled());
                __pEditTime->FireTimeChangeEvent(TIME_INTERNAL_CHANGE_SAVED);
-               __pEditTime->UpdateAccessibilityElement();
-               PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP);
-
+               if (isTouchPressed)
+               {
+                       __pEditTime->UpdateAccessibilityElement();
+                       PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP);
+               }
                __selectedId = DATETIME_ID_NONE;
 
                if (__pEditTime->GetDateTimeBar() != null && __pEditTime->GetDateTimeBar()->IsActivated())
@@ -1269,37 +1538,11 @@ _EditTimePresenter::OnTouchReleased(const _Control& source, const _TouchInfo& to
                        __pEditTime->GetDateTimeBar()->SetVisibleState(false);
                        __pEditTime->GetDateTimeBar()->Close();
                }
-
-               Draw();
-
-               return true;
-       }
-
-       Draw();
-
-       if ((__pEditTime->GetDateTimeBar() != null) && (boxId != DATETIME_ID_AMPM) && (GetLastSelectedId() != DATETIME_ID_NONE))
-       {
-               FloatRectangle bounds(0.0f, 0.0f, 0.0f, 0.0f);
-               bounds = GetDisplayAreaBoundsFromHoursStyle(GetLastSelectedId());
-               FloatRectangle absoluteBounds(0.0f, 0.0f, 0.0f, 0.0f);
-               absoluteBounds = __pEditTime->GetAbsoluteBoundsF();
-               bounds.x += absoluteBounds.x;
-
-               __pEditTime->GetDateTimeBar()->CalculateArrowBounds(bounds);
-
-               if (__pEditTime->GetDateTimeBar()->IsActivated())
-               {
-                       __pEditTime->GetDateTimeBar()->RefreshItems();
-               }
-               else
-               {
-                       __pEditTime->GetDateTimeBar()->SetVisibleState(true);
-                       __pEditTime->GetDateTimeBar()->Open();
-               }
        }
 
        __selectedId = DATETIME_ID_NONE;
-       return true;
+       __pEditTime->Invalidate();
+       return;
 }
 
 bool
index 4a0c8ee..afd7460 100644 (file)
@@ -135,7 +135,7 @@ _InputPadPresenter::LoadResource(void)
        }
 
        GET_COLOR_CONFIG(INPUTPAD::BUTTON_BG_NORMAL, buttonColor[DATETIME_STATUS_NORMAL]);
-       GET_COLOR_CONFIG(INPUTPAD::BUTTON_BG_PRESSED, buttonColor[DATETIME_STATUS_PRESSED]);
+       GET_COLOR_CONFIG(INPUTPAD::BUTTON_BG_PRESSED, buttonColor[DATETIME_STATUS_SELECTED]);
        GET_COLOR_CONFIG(INPUTPAD::BUTTON_BG_HIGHLIGHTED, buttonColor[DATETIME_STATUS_HIGHLIGHTED]);
        GET_COLOR_CONFIG(INPUTPAD::BUTTON_BG_DISABLED, buttonColor[DATETIME_STATUS_DISABLED]);
 
@@ -145,7 +145,7 @@ _InputPadPresenter::LoadResource(void)
        r = GET_BITMAP_CONFIG_N(INPUTPAD::BUTTON_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pButtonBgNormalBitmap[DATETIME_STATUS_NORMAL]);
        SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
 
-       r = GET_BITMAP_CONFIG_N(INPUTPAD::BUTTON_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pButtonBgNormalBitmap[DATETIME_STATUS_PRESSED]);
+       r = GET_BITMAP_CONFIG_N(INPUTPAD::BUTTON_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pButtonBgNormalBitmap[DATETIME_STATUS_SELECTED]);
        SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
 
        r = GET_BITMAP_CONFIG_N(INPUTPAD::BUTTON_BG_HIGHLIGHTED, BITMAP_PIXEL_FORMAT_ARGB8888, pButtonBgNormalBitmap[DATETIME_STATUS_HIGHLIGHTED]);
@@ -155,7 +155,7 @@ _InputPadPresenter::LoadResource(void)
        SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
 
        isCustomBitmap[DATETIME_STATUS_NORMAL] = IS_CUSTOM_BITMAP(INPUTPAD::BUTTON_BG_NORMAL);
-       isCustomBitmap[DATETIME_STATUS_PRESSED] = IS_CUSTOM_BITMAP(INPUTPAD::BUTTON_BG_PRESSED);
+       isCustomBitmap[DATETIME_STATUS_SELECTED] = IS_CUSTOM_BITMAP(INPUTPAD::BUTTON_BG_PRESSED);
        isCustomBitmap[DATETIME_STATUS_HIGHLIGHTED] = IS_CUSTOM_BITMAP(INPUTPAD::BUTTON_BG_HIGHLIGHTED);
        isCustomBitmap[DATETIME_STATUS_DISABLED] = IS_CUSTOM_BITMAP(INPUTPAD::BUTTON_BG_DISABLED);
 
@@ -178,9 +178,9 @@ _InputPadPresenter::LoadResource(void)
                SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
        }
 
-       if (!isCustomBitmap[DATETIME_STATUS_PRESSED])
+       if (!isCustomBitmap[DATETIME_STATUS_SELECTED])
        {
-               r = GET_BITMAP_CONFIG_N(INPUTPAD::BUTTON_BG_EFFECT_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pKeypadButtonEffectBitmap[DATETIME_STATUS_PRESSED]);
+               r = GET_BITMAP_CONFIG_N(INPUTPAD::BUTTON_BG_EFFECT_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pKeypadButtonEffectBitmap[DATETIME_STATUS_SELECTED]);
                SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
        }
 
@@ -382,7 +382,7 @@ _InputPadPresenter::DrawButton(Canvas& canvas, int index)
        }
        else if (__pressedIndex == index)
        {
-               status = DATETIME_STATUS_PRESSED;
+               status = DATETIME_STATUS_SELECTED;
                GET_COLOR_CONFIG(INPUTPAD::TEXT_PRESSED, textColor);
        }
        else
@@ -392,7 +392,7 @@ _InputPadPresenter::DrawButton(Canvas& canvas, int index)
        }
 
        isCustomBitmap[DATETIME_STATUS_NORMAL] = IS_CUSTOM_BITMAP(INPUTPAD::BUTTON_BG_NORMAL);
-       isCustomBitmap[DATETIME_STATUS_PRESSED] = IS_CUSTOM_BITMAP(INPUTPAD::BUTTON_BG_PRESSED);
+       isCustomBitmap[DATETIME_STATUS_SELECTED] = IS_CUSTOM_BITMAP(INPUTPAD::BUTTON_BG_PRESSED);
        isCustomBitmap[DATETIME_STATUS_HIGHLIGHTED] = IS_CUSTOM_BITMAP(INPUTPAD::BUTTON_BG_HIGHLIGHTED);
        isCustomBitmap[DATETIME_STATUS_DISABLED] = IS_CUSTOM_BITMAP(INPUTPAD::BUTTON_BG_DISABLED);
 
@@ -631,11 +631,6 @@ _InputPadPresenter::OnTouchPressed(const _Control& source, const _TouchInfo& tou
        if (__pressedIndex >= 0)
        {
                RefreshButton(__pressedIndex);
-               if (__pInputPadEventListener != null)
-               {
-                       __pInputPadEventListener->OnInputPadValueChanged(source, GetReturnValue(__pressedIndex));
-               }
-
                return true;
        }
 
@@ -650,16 +645,26 @@ _InputPadPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& to
                return false;
        }
 
-       if (__pressedIndex >= 0)
+       SysTryReturn(NID_UI_CTRL, __pressedIndex >= 0, true, E_SUCCESS, "Touch pressed Index is invalid, ignoring touch release");
+
+       int refreshIndex = __pressedIndex;
+       int currentReleasedIndex = GetIndexFromTouchedPosition(touchinfo.GetCurrentPosition());
+
+       if (currentReleasedIndex >= 0)
        {
-               int refreshIndex = __pressedIndex;
-               __pressedIndex = -1;
-               RefreshButton(refreshIndex);
+               if (__pInputPadEventListener != null)
+               {
+                       __pInputPadEventListener->OnInputPadValueChanged(source, GetReturnValue(currentReleasedIndex));
+               }
+       }
 
-               return true;
+       __pressedIndex = -1;
+       if (refreshIndex >= 0)
+       {
+               RefreshButton(refreshIndex);
        }
 
-       return false;
+       return true;
 }
 
 bool
index 5be2354..ae45a68 100644 (file)
@@ -580,6 +580,16 @@ _SearchBar::SetMode(SearchBarMode mode)
 result
 _SearchBar::SetModeLocked(bool modeLocked)
 {
+       if (modeLocked == true && GetMode() == SEARCH_BAR_MODE_NORMAL)
+       {
+               __pEdit->SetViewModeEnabled(true);
+       }
+
+       if (modeLocked == false && __pEdit->IsViewModeEnabled())
+       {
+               __pEdit->SetViewModeEnabled(false);
+       }
+
        return __pSearchBarPresenter->SetModeLocked(modeLocked);
 }
 
@@ -1763,8 +1773,12 @@ _SearchBar::OnFontInfoRequested(unsigned long& style, int& size)
 bool
 _SearchBar::OnFocusGained(const _Control& source)
 {
-       SetMode(SEARCH_BAR_MODE_INPUT);
-       __pEdit->SetFocused();
+       if (GetVisibleState() == true)
+       {
+               SetMode(SEARCH_BAR_MODE_INPUT);
+               __pEdit->SetFocused();
+       }
+
        return false;
 }
 
index 6174e24..90c5dcf 100644 (file)
@@ -306,6 +306,68 @@ _Slider::OnTouchCanceled(const _Control& source, const _TouchInfo& touchinfo)
 }
 
 void
+_Slider::OnDrawFocus(void)
+{
+       __pSliderPresenter->SetFocusMode(true);
+       Invalidate();
+       return;
+}
+
+bool
+_Slider::OnFocusGained(const _Control& source)
+{
+       __pSliderPresenter->SetFocusMode(true);
+       Invalidate();
+
+       return true;
+}
+
+
+bool
+_Slider::OnFocusLost(const _Control& source)
+{
+       __pSliderPresenter->SetFocusMode(false);
+       Invalidate();
+
+       return true;
+}
+
+void
+_Slider::OnFocusModeStateChanged()
+{
+       __pSliderPresenter->SetFocusMode(false);
+       Invalidate();
+}
+
+bool
+_Slider::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo)
+{
+
+       if(__pSliderPresenter->GetFocusMode() == false)
+       {
+               return false;
+       }
+
+       _KeyCode keyCode = keyInfo.GetKeyCode();
+
+       if (keyCode == _KEY_RIGHT)
+       {
+               SetValue(GetValue() + 1);
+               Invalidate();
+               return true;
+       }
+
+       if (keyCode == _KEY_LEFT)
+       {
+               SetValue(GetValue() - 1);
+               Invalidate();
+               return true;
+       }
+
+       return false;
+}
+
+void
 _Slider::OnBoundsChanged(void)
 {
        __pSliderPresenter->OnBoundsChanged();
index 5cc11be..63d7f12 100644 (file)
@@ -86,6 +86,7 @@ _SliderPresenter::_SliderPresenter(void)
        , __handleX(0)
        , __prevSliderValue(0)
        , __isSliderPressed(false)
+       , __isFocusModeStateChanged(false)
        , __isNeedToBeUpdated(true)
        , __isResourceLoaded(false)
        , __isCustomHandle(false)
@@ -250,7 +251,6 @@ _SliderPresenter::Resize(void)
        float offset = 0.0f;
        float minimumHeight = 0.0f;
        float minimumWidth = 0.0f;
-       float topMargin = 0.0f;
        float iconRightMargin = 0.0f;
        float titleHeight = 0.0f;
        FloatRectangle titleTextBounds;
@@ -303,9 +303,6 @@ _SliderPresenter::Resize(void)
        }
        __rect = FloatRectangle(0.0f, 0.0f, __pSlider->GetBoundsF().width, __pSlider->GetBoundsF().height);
 
-       r = GET_SHAPE_CONFIG(SLIDER::BAR_TOP_MARGIN, orientation, topMargin);
-       SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
        r = GET_SHAPE_CONFIG(SLIDER::ICON_RIGHT_MARGIN, orientation, iconRightMargin);
        SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
@@ -344,7 +341,7 @@ _SliderPresenter::Resize(void)
                minimumHeight = minimumHeight + titleHeight;
        }
 
-       if (__rect.height < minimumHeight )
+       if (__rect.height < minimumHeight)
        {
                __rect.height = minimumHeight;
        }
@@ -1058,18 +1055,12 @@ _SliderPresenter::DrawSliderBar(Canvas& canvas)
                        }
                }
        }
-       else if (__isSliderPressed == true)   // pressed
+       else if (__isSliderPressed == true)     // pressed
        {
                pHandleBitmap = __pHandlePressedBitmap;
                pHandleEffectBitmap = __pHandlePressedEffectBitmap;
                isCustomHandleBitmap = IS_CUSTOM_BITMAP(SLIDER::HANDLE_BG_PRESSED);
        }
-       else if (__pSlider->IsFocused() == true)
-       {
-               pHandleBitmap = __pHandleHighlightedBitmap;
-               pHandleEffectBitmap = __pHandleHighlightedEffectBitmap;
-               isCustomHandleBitmap = IS_CUSTOM_BITMAP(SLIDER::HANDLE_BG_HIGHLIGHTED);
-       }
        else //(__isSliderPressed == false)     // normal state
        {
                pHandleBitmap = __pHandleNormalBitmap;
@@ -1134,14 +1125,14 @@ _SliderPresenter::DrawSliderBar(Canvas& canvas)
        DrawBitmap(canvas, __barBgRect, __pBarBgColorReplacementBitmap);
        if (isCustomBarBitmap == false)
        {
-           DrawBitmap(canvas, __barBgRect, __pBarBgResourceEffectBitmap);
+               DrawBitmap(canvas, __barBgRect, __pBarBgResourceEffectBitmap);
        }
 
        isCustomBarBitmap = IS_CUSTOM_BITMAP(SLIDER::BAR_NORMAL);
        DrawBitmap(canvas, FloatRectangle(__barRect.x, __barRect.y, (__barRect.width + __handleRect.width / 2), __barRect.height), __pBarColorReplacementBitmap);
        if (isCustomBarBitmap == false)
        {
-           DrawBitmap(canvas, FloatRectangle(__barRect.x, __barRect.y, (__barRect.width + __handleRect.width / 2), __barRect.height), __pBarResourceEffectBitmap);
+               DrawBitmap(canvas, FloatRectangle(__barRect.x, __barRect.y, (__barRect.width + __handleRect.width / 2), __barRect.height), __pBarResourceEffectBitmap);
        }
 
        __handleRect.x = __touchRect.x + __handleX;
@@ -1170,8 +1161,8 @@ _SliderPresenter::DrawSliderBar(Canvas& canvas)
                SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
                if (isCustomHandleBitmap == false)
                {
-                   r = DrawBitmap(*pHandleCanvas, FloatRectangle(0.0f, 0.0f, __handleRect.width, __handleRect.height), pHandleEffectBitmap);
-                   SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+                       r = DrawBitmap(*pHandleCanvas, FloatRectangle(0.0f, 0.0f, __handleRect.width, __handleRect.height), pHandleEffectBitmap);
+                       SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
                }
        }
        else
@@ -1203,6 +1194,22 @@ _SliderPresenter::DrawSliderBar(Canvas& canvas)
                SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
        }
 
+       if ((__pSlider->IsFocused()) &&  (__isFocusModeStateChanged == true))
+       {
+               if (__pHandleHighlightedBitmap)
+               {
+                       if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*__pHandleHighlightedBitmap))
+                       {
+                               r = pHandleCanvas->DrawNinePatchedBitmap(FloatRectangle(0.0f, 0.0f, __handleRect.width, __handleRect.height), *__pHandleHighlightedBitmap);
+                       }
+                       else
+                       {
+                               r = pHandleCanvas->DrawBitmap(FloatRectangle(0.0f, 0.0f, __handleRect.width, __handleRect.height), *__pHandleHighlightedBitmap);
+                       }
+                       SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+               }
+       }
+
        r = __pSlider->UpdateHandle(__handleRect);
        if (r != E_SUCCESS)
        {
@@ -1319,7 +1326,7 @@ _SliderPresenter::DrawTitleText(Canvas& canvas)
        if (__pTitleTextObject == null)
        {
                __pTitleTextObject = new (std::nothrow) TextObject();
-                SysTryReturn(NID_UI_CTRL, __pTitleTextObject != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+               SysTryReturn(NID_UI_CTRL, __pTitleTextObject != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
                __pTitleTextObject->Construct();
        }
 
@@ -1408,7 +1415,7 @@ _SliderPresenter::GetTitleTextBounds(void) const
        r = GET_SHAPE_CONFIG(SLIDER::TITLE_TEXT_POSITION_X, orientation, titleTextBounds.x);
        SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, FloatRectangle(), r, "[%s] Propagating.", GetErrorMessage(r));
 
-       r = GET_SHAPE_CONFIG(SLIDER::BAR_TOP_MARGIN, orientation, topMargin);
+       r = GET_SHAPE_CONFIG(SLIDER::TITLE_TEXT_POSITION_Y, orientation, topMargin);
        SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, FloatRectangle(), r, "[%s] Propagating.", GetErrorMessage(r));
 
        titleTextBounds.y = topMargin;
@@ -1778,6 +1785,18 @@ _SliderPresenter::SetGroupStyle(GroupStyle groupStyle)
        return;
 }
 
+void
+_SliderPresenter::SetFocusMode(bool focusmode)
+{
+       __isFocusModeStateChanged = focusmode;
+}
+
+bool
+_SliderPresenter::GetFocusMode(void)
+{
+       return __isFocusModeStateChanged;
+}
+
 result
 _SliderPresenter::SetThumbBitmap(SliderThumbStatus status, const Bitmap& bitmap)
 {
index a1e8503..c1a62e2 100644 (file)
@@ -114,7 +114,10 @@ _SplitPanel::CreateSplitPanelN(const FloatRectangle& rect, SplitPanelDividerStyl
 
        pSplitPanel->SetBackgroundColor(Color(0,0,0,0));
 
-       pSplitPanel->GetAccessibilityContainer()->Activate(true);
+       if (pSplitPanel->GetAccessibilityContainer())
+       {
+               pSplitPanel->GetAccessibilityContainer()->Activate(true);
+       }
 
        return pSplitPanel;
 
@@ -387,6 +390,41 @@ _SplitPanel::OnTapGestureCanceled(_TouchTapGestureDetector& gesture)
        return __pSplitPanelPresenter->OnTapGestureCanceled(gesture);
 }
 
+bool
+_SplitPanel::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo)
+{
+       return __pSplitPanelPresenter->OnKeyPressed(source, keyInfo);
+}
+
+bool
+_SplitPanel::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo)
+{
+       return __pSplitPanelPresenter->OnKeyReleased(source, keyInfo);
+}
+
+void
+_SplitPanel::OnDrawFocus(void)
+{
+       __pSplitPanelPresenter->DrawFocus();
+       return;
+}
+
+bool
+_SplitPanel::OnFocusGained(const _Control& source)
+{
+       return _Control::OnFocusGained(source);
+}
+
+bool
+_SplitPanel::OnFocusLost(const _Control& source)
+{
+       result r = __pSplitPanelPresenter->ReleaseFocus();
+       SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+       _Control::OnFocusLost(source);
+       return true;
+}
+
 result
 _SplitPanel::SetPane(_Control* pControl, SplitPanelPaneOrder paneOrder)
 {
@@ -830,23 +868,22 @@ _SplitPanel::OnAttachedToMainTree(void)
        {
                if (__pDividerVisualElement)
                {
-                       __pAccessibilityElement = new (std::nothrow) _AccessibilityElement(true);
-                       SysTryReturn(NID_UI_CTRL, __pAccessibilityElement, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
-
                        dividerRect = __pSplitPanelPresenter->GetDividerRectangle();
 
                        if (GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_FIXED)
                        {
-                               hintText = String(L"double tap to open/close the split area");
-                               __pAccessibilityElement->SetTrait(L"Split view button");
+                               hintText = String(L"Drag scroll Fixed");
                        }
                        else
                        {
-                               hintText = String(L"double tap and move to adjust split area");
-                               __pAccessibilityElement->SetTrait(L"Drag scroll");
+                               hintText = String(L"Drag scroll, double tap and move to adjust split area");
                        }
 
-                       __pAccessibilityElement->SetBounds(dividerRect);
+                       __pAccessibilityElement = new (std::nothrow) _AccessibilityElement(true);
+                       SysTryReturn(NID_UI_CTRL, __pAccessibilityElement, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+
+                       __pAccessibilityElement->SetBounds(_CoordinateSystemUtils::ConvertToInteger(dividerRect));
+                       __pAccessibilityElement->SetTrait(ACCESSIBILITY_TRAITS_NONE);
                        __pAccessibilityElement->SetHint(hintText);
                        __pAccessibilityElement->SetLabel(L"");
                        __pAccessibilityElement->SetName(L"SplitPanelDivider");
index 535fce5..b6329f3 100644 (file)
@@ -56,8 +56,10 @@ _SplitPanelPresenter::_SplitPanelPresenter(void)
        , __pDividerBackgroundBitmap(null)
        , __pDividerBackgroundEffectBitmap(null)
        , __pDividerThumbBitmap(null)
+       , __pFocusBitmap(null)
        , __transactionIdMaximize(0)
        , __transactionIdRestore(0)
+       , __currentFocusedPane(SPLIT_PANEL_PANE_ORDER_FIRST)
        , __controlAnimatorInterpolator(ANIMATION_INTERPOLATOR_LINEAR)
        , __visualElementInterpolator(L"Linear")
 {
@@ -81,6 +83,9 @@ _SplitPanelPresenter::~_SplitPanelPresenter(void)
 
        delete __pDividerBackgroundEffectBitmap;
        __pDividerBackgroundEffectBitmap = null;
+
+       delete __pFocusBitmap;
+       __pFocusBitmap = null;
 }
 
 result
@@ -154,34 +159,40 @@ _SplitPanelPresenter::OnTouchPressed(const _Control& source, const _TouchInfo& t
 {
        FloatPoint point(0.0f, 0.0f);
 
+       ReleaseFocus();
+
        point = touchinfo.GetCurrentPosition();
 
        if (CheckDividerTouchRegion(point.x, point.y) == true)
        {
                __splitPanelDividerPressed = true;
+               Draw();
+               return true;
        }
 
-       Draw();
-
-       return E_SUCCESS;
+       return false;
 }
 
 bool
 _SplitPanelPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo)
 {
+       ReleaseFocus();
+
        if (__splitPanelDividerPressed == true)
        {
                PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP);
                __splitPanelDividerPressed = false;
                Draw();
+               return true;
        }
-
-       if (__isChangeBounds == true)
+       else
        {
-               __isChangeBounds = false;
+               if (__isChangeBounds == true)
+               {
+                       __isChangeBounds = false;
+               }
+               return false;
        }
-
-       return E_SUCCESS;
 }
 
 bool
@@ -190,6 +201,8 @@ _SplitPanelPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& tou
        FloatPoint point(0.0f, 0.0f);
        Bitmap* pThumbBitmap = null;
 
+       ReleaseFocus();
+
        if (__pSplitPanel != &source || __splitPanelDividerPressed == false )
        {
                return false;
@@ -281,6 +294,138 @@ _SplitPanelPresenter::OnTapGestureCanceled(_TouchTapGestureDetector& gesture)
        return false;
 }
 
+bool
+_SplitPanelPresenter::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo)
+{
+        _KeyCode keyCode = keyInfo.GetKeyCode();
+
+        if (keyCode == _KEY_RIGHT)
+        {
+                if (__currentFocusedPane == SPLIT_PANEL_PANE_ORDER_FIRST)
+                {
+                        ReleaseFocus();
+                        __currentFocusedPane = SPLIT_PANEL_PANE_ORDER_SECOND;
+                        DrawFocus(__currentFocusedPane);
+                }
+        }
+        else if (keyCode == _KEY_LEFT)
+        {
+                if (__currentFocusedPane == SPLIT_PANEL_PANE_ORDER_SECOND)
+                {
+                        ReleaseFocus();
+                        __currentFocusedPane = SPLIT_PANEL_PANE_ORDER_FIRST;
+                        DrawFocus(__currentFocusedPane);
+                }
+        }
+        else
+        {
+                return false;
+        }
+
+        return true;
+}
+
+bool
+_SplitPanelPresenter::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo)
+{
+        _KeyCode keyCode = keyInfo.GetKeyCode();
+
+       if (keyCode == _KEY_RIGHT || keyCode == _KEY_LEFT)
+       {
+               return true;
+       }
+
+       return false;
+}
+
+result
+_SplitPanelPresenter::DrawFocus(SplitPanelPaneOrder focusedPane)
+{
+       result r = E_SUCCESS;
+       Canvas* pSplitPanelCanvas = null;
+       FloatRectangle  currentFocusBounds(0.0f, 0.0f, 0.0f, 0.0f);
+
+       _Control* pControl = null;
+
+       if (focusedPane == SPLIT_PANEL_PANE_ORDER_FIRST)
+       {
+               pControl = __pSplitPanel->GetPane(SPLIT_PANEL_PANE_ORDER_FIRST);
+               __currentFocusedPane = SPLIT_PANEL_PANE_ORDER_FIRST;
+               currentFocusBounds = GetPaneBounds(SPLIT_PANEL_PANE_ORDER_FIRST);
+       }
+       else
+       {
+               pControl = __pSplitPanel->GetPane(SPLIT_PANEL_PANE_ORDER_SECOND);
+               __currentFocusedPane = SPLIT_PANEL_PANE_ORDER_SECOND;
+               currentFocusBounds = GetPaneBounds(SPLIT_PANEL_PANE_ORDER_SECOND);
+       }
+
+       if (pControl != null)
+       {
+               pControl->SetFocused();
+               pControl->DrawFocus();
+       }
+       else
+       {
+               pSplitPanelCanvas = __pSplitPanel->GetCanvasN();
+               SysTryReturnResult(NID_UI_CTRL, (pSplitPanelCanvas != null), E_SYSTEM, "A system error has occurred. Failed to get the canvas of SplitPanel.");
+
+               //give focus
+               if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*__pFocusBitmap))
+               {
+                       r = pSplitPanelCanvas->DrawNinePatchedBitmap(currentFocusBounds, *__pFocusBitmap);
+                       SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
+               }
+               else
+               {
+                       r = pSplitPanelCanvas->DrawBitmap(currentFocusBounds, *__pFocusBitmap);
+                       SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
+               }
+
+               delete pSplitPanelCanvas;
+       }
+
+       return r;
+
+CATCH:
+       delete pSplitPanelCanvas;
+       return r;
+}
+
+result
+_SplitPanelPresenter::ReleaseFocus(void)
+{
+       result r = E_SUCCESS;
+       Canvas* pSplitPanelCanvas = null;
+       FloatRectangle panebounds(0.0f, 0.0f, 0.0f, 0.0f);
+
+       if (__currentFocusedPane == SPLIT_PANEL_PANE_ORDER_FIRST &&
+                       __pSplitPanel->GetPane(SPLIT_PANEL_PANE_ORDER_FIRST) == null)
+       {
+               panebounds = GetPaneBounds(SPLIT_PANEL_PANE_ORDER_FIRST);
+       }
+       else if (__currentFocusedPane == SPLIT_PANEL_PANE_ORDER_SECOND &&
+                       __pSplitPanel->GetPane(SPLIT_PANEL_PANE_ORDER_SECOND) == null)
+       {
+               panebounds = GetPaneBounds(SPLIT_PANEL_PANE_ORDER_SECOND);
+       }
+       else
+       {
+               return r;
+       }
+
+       pSplitPanelCanvas = __pSplitPanel->GetCanvasN();
+       SysTryReturnResult(NID_UI_CTRL, (pSplitPanelCanvas != null), E_SYSTEM, "A system error has occurred. Failed to get the canvas of SplitPanel.");
+
+       //reset
+       pSplitPanelCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
+       pSplitPanelCanvas->Clear(panebounds);
+
+       delete pSplitPanelCanvas;
+
+       return r;
+}
+
 result
 _SplitPanelPresenter::SetDividerStyle(SplitPanelDividerStyle splitPanelDividerStyle)
 {
@@ -549,6 +694,9 @@ _SplitPanelPresenter::LoadBitmap(SplitPanelDividerDirection splitPanelDividerDir
        __pDividerBackgroundBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pDividerBackgroundBitmap, Color::GetColor(COLOR_ID_MAGENTA), __dividerBackgroundColor);
        SysTryCatch(NID_UI_CTRL, (__pDividerBackgroundBitmap != null), , r, "[%s] Failed to get replacement color bitmap.", GetErrorMessage(GetLastResult()));
 
+       r = GET_BITMAP_CONFIG_N(FOCUSUI::FOCUS, BITMAP_PIXEL_FORMAT_ARGB8888, __pFocusBitmap);
+       SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
+
        delete pDividerBackgroundBitmap;
 
        return r;
@@ -611,6 +759,7 @@ _SplitPanelPresenter::SetPaneBounds(void)
        FloatRectangle clientBounds(0.0f, 0.0f, 0.0f, 0.0f);
        FloatRectangle firstPaneBounds(0.0f, 0.0f, 0.0f, 0.0f);
        FloatRectangle secondPaneBounds(0.0f, 0.0f, 0.0f, 0.0f);
+       FloatRectangle dividerBounds(0.0f, 0.0f, 0.0f, 0.0f);
        FloatPoint panePostion(0.0f, 0.0f);
        _Control* pFirstPane = null;
        _Control* pSecondPane = null;
@@ -639,6 +788,11 @@ _SplitPanelPresenter::SetPaneBounds(void)
                {
                        secondPaneBounds = FloatRectangle(0.0f, clientBounds.height + __dividerRectangle.height, clientBounds.width, clientBounds.height - __dividerRectangle.y - __dividerRectangle.height);
                }
+
+               dividerBounds = __dividerRectangle;
+               dividerBounds.x = clientBounds.width;
+
+               __pSplitPanel->SetDividerVisualElementBounds(dividerBounds);
        }
        else if (IsPaneMaximized(SPLIT_PANEL_PANE_ORDER_SECOND))
        {
@@ -652,6 +806,11 @@ _SplitPanelPresenter::SetPaneBounds(void)
                {
                        firstPaneBounds = FloatRectangle(0.0f, clientBounds.y -__dividerRectangle.y - __dividerRectangle.height, clientBounds.width, __dividerRectangle.y);
                }
+
+               dividerBounds = __dividerRectangle;
+               dividerBounds.x = -__dividerRectangle.width;
+
+               __pSplitPanel->SetDividerVisualElementBounds(dividerBounds);
        }
        else
        {
@@ -684,7 +843,11 @@ _SplitPanelPresenter::SetPaneBounds(void)
        {
                if (pFirstPane->IsResizable())
                {
-                       pFirstPane->SetBounds(firstPaneBounds);
+                       r = pFirstPane->SetBounds(firstPaneBounds);
+                       if (IsFailed(r))
+                       {
+                               SysLog(NID_UI_CTRL, "[%s] SetBounds failed.", GetErrorMessage(r));
+                       }
                }
 
                r = pFirstPane->SetPosition(Point(0.0f, 0.0f));
@@ -695,7 +858,11 @@ _SplitPanelPresenter::SetPaneBounds(void)
        {
                if (pSecondPane->IsResizable())
                {
-                       pSecondPane->SetBounds(secondPaneBounds);
+                       r = pSecondPane->SetBounds(secondPaneBounds);
+                       if (IsFailed(r))
+                       {
+                               SysLog(NID_UI_CTRL, "[%s] SetBounds failed.", GetErrorMessage(r));
+                       }
                }
 
                r = pSecondPane->SetPosition(Point(0.0f, 0.0f));
@@ -724,7 +891,6 @@ _SplitPanelPresenter::AdjustDividerRectangle(void)
        float width = 0.0f;
        float height = 0.0f;
        FloatRectangle clientBounds(0.0f, 0.0f, 0.0f, 0.0f);
-       FloatRectangle dividerBounds(0.0f, 0.0f, 0.0f, 0.0f);
        _ControlOrientation orientation = _CONTROL_ORIENTATION_PORTRAIT;
        Bitmap* pThumbBitmap = null;
 
@@ -754,17 +920,6 @@ _SplitPanelPresenter::AdjustDividerRectangle(void)
                {
                        __dividerRectangle = FloatRectangle(dividerPosition, 0.0f, width, height);
                        __dividerThumbRectangle = FloatRectangle(dividerPosition, ((height - pThumbBitmap->GetHeightF()) / 2.0f), pThumbBitmap->GetWidthF(), pThumbBitmap->GetHeightF());
-
-                       dividerBounds = __dividerRectangle;
-
-                       if (IsPaneMaximized(SPLIT_PANEL_PANE_ORDER_FIRST))
-                       {
-                               dividerBounds.x = clientBounds.width;
-                       }
-                       else if (IsPaneMaximized(SPLIT_PANEL_PANE_ORDER_SECOND))
-                       {
-                               dividerBounds.x = -__dividerRectangle.width;
-                       }
                }
        }
        else
@@ -775,21 +930,10 @@ _SplitPanelPresenter::AdjustDividerRectangle(void)
                {
                        __dividerRectangle = FloatRectangle(0.0f, dividerPosition, width, height);
                        __dividerThumbRectangle = FloatRectangle(((width - pThumbBitmap->GetWidth()) / 2.0f), dividerPosition, pThumbBitmap->GetWidthF(), pThumbBitmap->GetHeightF());
-
-                       dividerBounds = __dividerRectangle;
-
-                       if (IsPaneMaximized(SPLIT_PANEL_PANE_ORDER_FIRST))
-                       {
-                               dividerBounds.y = clientBounds.height;
-                       }
-                       else if (IsPaneMaximized(SPLIT_PANEL_PANE_ORDER_SECOND))
-                       {
-                               dividerBounds.y = -__dividerRectangle.height;
-                       }
                }
        }
 
-       __pSplitPanel->SetDividerVisualElementBounds(dividerBounds);
+       __pSplitPanel->SetDividerVisualElementBounds(__dividerRectangle);
 }
 
 result
@@ -1354,6 +1498,33 @@ _SplitPanelPresenter::GetRestorePaneBounds(SplitPanelPaneOrder paneOrder)
        return secondPaneBounds;
 }
 
+FloatRectangle
+_SplitPanelPresenter::GetPaneBounds(SplitPanelPaneOrder paneOrder)
+{
+       FloatRectangle firstPaneBounds;
+       FloatRectangle secondPaneBounds;
+
+       FloatRectangle clientBounds = __pSplitPanel->GetBoundsF();
+
+       if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
+       {
+               firstPaneBounds = FloatRectangle(0.0f, 0.0f, __dividerRectangle.x, clientBounds.height);
+               secondPaneBounds = FloatRectangle(__dividerRectangle.x + __dividerRectangle.width, 0.0f, clientBounds.width - __dividerRectangle.x - __dividerRectangle.width, clientBounds.height);
+       }
+       else
+       {
+               firstPaneBounds  = FloatRectangle(0.0f, 0.0f, clientBounds.width, __dividerRectangle.y);
+               secondPaneBounds = FloatRectangle(0.0f, __dividerRectangle.y + __dividerRectangle.height, clientBounds.width, clientBounds.height - __dividerRectangle.y - __dividerRectangle.height);
+       }
+
+       if (paneOrder == SPLIT_PANEL_PANE_ORDER_FIRST)
+       {
+               return firstPaneBounds;
+       }
+
+       return secondPaneBounds;
+}
+
 VisualElementPropertyAnimation*
 _SplitPanelPresenter::GetVisualElementAnimation(Tizen::Base::String propertyName)
 {
index dcea623..ead14fc 100644 (file)
@@ -1889,7 +1889,7 @@ _TableViewPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touc
 
                if ((pItem->GetContextItem() != null && abs(moveDistanceX) > abs(moveDistanceY * 2)) || pItem->IsContextItem())
                {
-                       if (!pItem->IsContextItem())
+                       if (!pItem->IsContextItem() && !pItem->IsAnimationPlaying())
                        {
                                pItem->GetItemIndex(__sweptItemTag.groupIndex, __sweptItemTag.itemIndex);
                                __sweptItemPosition = pItem->GetPositionF();
@@ -2605,6 +2605,12 @@ _TableViewPresenter::CollapseGroup(int groupIndex, bool withAnimation)
                        firstLoadedItemTag.itemIndex = -1;
                }
 
+               for (int i = 0; i < itemCount; i++)
+               {
+                       UnloadItem(groupIndex, i);
+               }
+
+               __pListModel->GetFirstLoadedItemIndex(firstLoadedItemTag.groupIndex, firstLoadedItemTag.itemIndex);
                _TableViewItem* pItem = FindItem(firstLoadedItemTag);
                if (pItem != null)
                {
@@ -2618,10 +2624,6 @@ _TableViewPresenter::CollapseGroup(int groupIndex, bool withAnimation)
                        }
                }
 
-               for (int i = 0; i < itemCount; i++)
-               {
-                       UnloadItem(groupIndex, i);
-               }
                AdjustClientAreaBounds(false, -groupTotalHeight);
 
                return E_SUCCESS;
@@ -4920,6 +4922,14 @@ _TableViewPresenter::CollapseGroupAnimationFinished(bool completedNormally)
 {
        int itemCountInGroup = __pListModel->GetItemCountInGroup(__expandableItemTag.groupIndex);
 
+       float groupTotalHeight = 0;
+       _TableViewItem* pItem = null;
+       for (int i = 0; i < itemCountInGroup; i++)
+       {
+               pItem = static_cast<_TableViewItem*>(__pListModel->GetItemFromTemporaryBuffer(__expandableItemTag.groupIndex, i));
+               groupTotalHeight += pItem->GetItemHeight();
+       }
+
        if (completedNormally == false)
        {
                TableViewItemTag current;
@@ -4933,13 +4943,11 @@ _TableViewPresenter::CollapseGroupAnimationFinished(bool completedNormally)
                        UnloadItem(__expandableItemTag.groupIndex, i);
                }
 
-               _TableViewItem* pCurrentItem = FindItem(current);
-               if (pCurrentItem == null)
-               {
-                       SysTryReturnVoidResult(NID_UI_CTRL, pCurrentItem != null, E_SYSTEM, "[E_SYSTEM] A system error has been occurred.")
-               }
+               _TableViewItem* pCurrentItem = LoadItem(current.groupIndex, current.itemIndex);
+               FloatRectangle itemBounds = pCurrentItem->GetBoundsF();
+               itemBounds.y = CalculateItemPositionY(current.groupIndex, current.itemIndex);
+               pCurrentItem->SetBounds(itemBounds);
 
-               FloatRectangle itemBounds;
                float nextItemPositionY = pCurrentItem->GetBoundsF().y + pCurrentItem->GetBoundsF().height;
 
                FloatRectangle screenBounds = __pTableView->GetBoundsF();
@@ -4967,6 +4975,14 @@ _TableViewPresenter::CollapseGroupAnimationFinished(bool completedNormally)
                                UnloadItem(current.groupIndex, current.itemIndex);
                        }
                }
+
+               int currentGroupIndex = -1;
+               int currentItemIndex = -1;
+               GetTopDrawnItemIndex(currentGroupIndex, currentItemIndex);
+               if (__expandableItemTag.groupIndex < currentGroupIndex)
+               {
+                       SetScrollPosition(GetScrollPosition() - groupTotalHeight, false);
+               }
        }
        else
        {
@@ -5017,14 +5033,6 @@ _TableViewPresenter::CollapseGroupAnimationFinished(bool completedNormally)
                }
        }
 
-       float groupTotalHeight = 0;
-       _TableViewItem* pItem = null;
-       for (int i = 0; i < itemCountInGroup; i++)
-       {
-               pItem = static_cast<_TableViewItem*>(__pListModel->GetItemFromTemporaryBuffer(__expandableItemTag.groupIndex, i));
-               groupTotalHeight += pItem->GetItemHeight();
-       }
-
        AdjustClientAreaBounds(false, -groupTotalHeight);
 }
 
index cc5d17a..ed603de 100644 (file)
@@ -275,6 +275,8 @@ _TokenEditPresenter::_TokenEditPresenter(void)
        , __pTokenBgBitmap(null)
        , __pTokenBgNormalEffectBitmap(null)
        , __pTokenBgPressedEffectBitmap(null)
+       , __pTokenBgReplacementFocusBitmap(null)
+       , __pTokenBgFocusEffectBitmap(null)
        , __pressedTokenIndex(-1)
        , __isEditingToken(false)
        , __edittingTokenIndex(-1)
@@ -310,6 +312,8 @@ _TokenEditPresenter::_TokenEditPresenter(void)
        , __touchPressInfo(FloatPoint(-1.0f, -1.0f))
        , __editContentFontSize(0.0f)
        , __trackTokenIndex(-1)
+       , __focusedTokenIndex(-1)
+       , __focusedEditingTokenIndex(-1)
        , __isAnimationInProgress(false)
 {
 }
@@ -398,6 +402,12 @@ _TokenEditPresenter::DisposeTokenEditPresenter(void)
        delete __pTokenBgPressedEffectBitmap;
        __pTokenBgPressedEffectBitmap = null;
 
+       delete __pTokenBgReplacementFocusBitmap;
+       __pTokenBgReplacementFocusBitmap = null;
+
+       delete __pTokenBgFocusEffectBitmap;
+       __pTokenBgFocusEffectBitmap = null;
+
        if (__pDescriptionTextVisualElement)
        {
                __pDescriptionTextVisualElement->Destroy();
@@ -461,12 +471,15 @@ _TokenEditPresenter::Initialize(const _Control& control)
        float tokenBottomMargin = 0.0f;
        float tokenHeight = 0.0f;
        _ControlOrientation orientation = __pTokenEdit->GetOrientation();
+       Color focusTokenColor;
+       Bitmap* pTokenBgFocusBitmap = null;
 
        GET_SHAPE_CONFIG(TOKENEDIT::LEFT_MARGIN, orientation, tokenLeftMargin);
        GET_SHAPE_CONFIG(TOKENEDIT::RIGHT_MARGIN, orientation, tokenRightMargin);
        GET_SHAPE_CONFIG(TOKENEDIT::TOP_MARGIN, orientation, tokenTopMargin);
        GET_SHAPE_CONFIG(TOKENEDIT::BOTTOM_MARGIN, orientation, tokenBottomMargin);
        GET_SHAPE_CONFIG(TOKENEDIT::TOKEN_HEIGHT, orientation, tokenHeight);
+       GET_COLOR_CONFIG(TOKENEDIT::BG_FOCUS, focusTokenColor);
 
        // For drawing token in specific area
        __clientRect.x = tokenLeftMargin;
@@ -500,6 +513,20 @@ _TokenEditPresenter::Initialize(const _Control& control)
        r = GET_BITMAP_CONFIG_N(TOKENEDIT::BG_PRESSED_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pTokenBgPressedEffectBitmap);
        SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
 
+       r = GET_BITMAP_CONFIG_N(TOKENEDIT::BG_FOCUS, BITMAP_PIXEL_FORMAT_ARGB8888, pTokenBgFocusBitmap);
+       SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+
+       __pTokenBgReplacementFocusBitmap = _BitmapImpl::GetColorReplacedBitmapN(
+                   *pTokenBgFocusBitmap,Color::GetColor(COLOR_ID_MAGENTA), focusTokenColor);
+       SysTryCatch(NID_UI_CTRL, __pTokenBgReplacementFocusBitmap != null, , r, "[%s] Propagating.", GetErrorMessage(r));
+
+       r = GET_BITMAP_CONFIG_N(TOKENEDIT::BG_FOCUS_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pTokenBgFocusEffectBitmap);
+       SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+
+       delete pTokenBgFocusBitmap;
+       pTokenBgFocusBitmap = null;
+
+
        __isTokenEditPresenterInitialized = true;
 
        __previousCursorPosition = GetCursorPosition();
@@ -517,6 +544,15 @@ CATCH:
        delete __pTokenBgNormalEffectBitmap;
        __pTokenBgNormalEffectBitmap = null;
 
+       delete __pTokenBgPressedEffectBitmap;
+       __pTokenBgPressedEffectBitmap = null;
+
+       delete pTokenBgFocusBitmap;
+       pTokenBgFocusBitmap = null;
+
+       delete __pTokenBgReplacementFocusBitmap;
+       __pTokenBgReplacementFocusBitmap = null;
+
        return r;
 }
 
@@ -812,6 +848,34 @@ _TokenEditPresenter::DrawToken(int count)
                        }
                }
 
+               if (__focusedTokenIndex == i && IsFocused() && (!__isEditingToken))
+               {
+                       if (__pTokenBgReplacementFocusBitmap)
+                       {
+                               if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*__pTokenBgReplacementFocusBitmap))
+                               {
+                                       pTokenCanvas->DrawNinePatchedBitmap(tokenRect, *__pTokenBgReplacementFocusBitmap);
+                               }
+                               else
+                               {
+                                       pTokenCanvas->DrawBitmap(tokenRect, *__pTokenBgReplacementFocusBitmap);
+                               }
+                       }
+
+                       if (__pTokenBgFocusEffectBitmap)
+                       {
+                               if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*__pTokenBgFocusEffectBitmap))
+                               {
+                                       pTokenCanvas->DrawNinePatchedBitmap(tokenRect, *__pTokenBgFocusEffectBitmap);
+                               }
+                               else
+                               {
+                                       pTokenCanvas->DrawBitmap(tokenRect, *__pTokenBgFocusEffectBitmap);
+                               }
+                       }
+
+               }
+
                pTokenElement->SetAnimationProvider(null);
                if (pToken->isImplicitAnimation)
                {
@@ -1057,6 +1121,10 @@ _TokenEditPresenter::InsertTokenAt(int index, const String& token, bool isUser)
                {
                        __pressedTokenIndex++;
                }
+               else if (__focusedTokenIndex >= index)
+               {
+                       __focusedTokenIndex++;
+               }
        }
 
        return r;
@@ -1204,6 +1272,15 @@ _TokenEditPresenter::RemoveTokenAt(int index, bool isClearText)
                {
                        __pressedTokenIndex--;
                }
+
+               if (index == __focusedTokenIndex)
+               {
+                       __focusedTokenIndex = -1;
+               }
+               else if(index >= 0 && index < __focusedTokenIndex)
+               {
+                       __focusedTokenIndex--;
+               }
        }
        else if (index == __pressedTokenIndex)
        {
@@ -1212,6 +1289,10 @@ _TokenEditPresenter::RemoveTokenAt(int index, bool isClearText)
                SetCursorDisabled(false);
                StartCursorTimer();
        }
+       else if (index == __focusedTokenIndex)
+       {
+               __focusedTokenIndex = -1;
+       }
 
        return r;
 }
@@ -2193,34 +2274,8 @@ _TokenEditPresenter::ProcessTokeningByTouchEvent(const _Control& source, const _
 
                        if ((__isEditingToken == true) && (__pressedTokenIndex != -1))
                        {
-                               _VisualElement* pEditVisualElement = __pTokenEdit->GetVisualElement();
-                               SysTryReturnResult(NID_UI_CTRL, pEditVisualElement, E_SYSTEM, "A system error has occurred. Failed to get root visual element.");
-
-                               _VisualElement* pCursorVisualElement = GetCursorVisualElement();
-                               SysTryReturnResult(NID_UI_CTRL, pCursorVisualElement, E_SYSTEM, "A system error has occurred. Failed to get cursor visual element.");
-
-                               _Token* pToken = null;
-                               _VisualElement* pTokenVisualElement = null;
-
-                               pToken = static_cast <_Token*>(__pTokenList->GetAt(__pressedTokenIndex));
-
-                               bool isParentChanged = false;
-                               if (pToken)
-                               {
-                                       pTokenVisualElement = pToken->GetVisualElement();
-                                       SysTryReturnResult(NID_UI_CTRL, pTokenVisualElement, E_SYSTEM, "A system error has occurred. Failed to get token visual element.");
-
-                                       if (pCursorVisualElement->GetParent() != pTokenVisualElement)
-                                       {
-                                               isParentChanged = true;
-                                               result r = E_SUCCESS;
-                                               r = (pCursorVisualElement->GetParent())->DetachChild(*pCursorVisualElement);
-                                               SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
-
-                                               r = pTokenVisualElement->AttachChild(*pCursorVisualElement);
-                                               SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
-                                       }
-                               }
+                               r = AttachCursorToPressedToken();
+                               SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
                        }
 
                        if (__isEditingToken == false)
@@ -2655,11 +2710,12 @@ bool
 _TokenEditPresenter::OnFocusLost(void)
 {
        result r = E_SUCCESS;
+       __isFocus = false;
 
        //Remove pressed state on focus lost
        __pressedTokenIndex = -1;
-
-       __isFocus = false;
+       __focusedTokenIndex = -1;
+       __focusedEditingTokenIndex = -1;
 
        _EditPresenter::StopTitleSlidingTimer();
        __isTitleSliding = false;
@@ -2814,6 +2870,9 @@ _TokenEditPresenter::SetTextSize(const float size)
 bool
 _TokenEditPresenter::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo)
 {
+       //Remove token focus on touch press
+       __focusedTokenIndex = -1;
+       __focusedEditingTokenIndex = -1;
        int tokenIndex = GetTokenIndexFromCoordinate(_CoordinateSystemUtils::ConvertToInteger(touchinfo.GetCurrentPosition()));
        __trackTokenIndex = tokenIndex;
 
@@ -2983,7 +3042,18 @@ _TokenEditPresenter::OnTextCommitted(const String& commitText)
                        __edittingTokenIndex = -1;
                        __isEditingToken = false;
 
-                       CheckTokenScrolling();
+                       if ((__focusedTokenIndex == -1) && (__focusedEditingTokenIndex != -1)
+                               && (inputTokenString.GetLength() > 0))
+                       {
+                               //1. Tokenedit is focussed
+                               //2. The valid Editing token is focussed
+                               __focusedTokenIndex = __focusedEditingTokenIndex;
+                               ScrollToFocussedToken();
+                       }
+                       else
+                       {
+                               CheckTokenScrolling();
+                       }
                        SetCursorDisabled(false);
 
                        if (inputTokenString.GetLength() <= 0)
@@ -2997,6 +3067,28 @@ _TokenEditPresenter::OnTextCommitted(const String& commitText)
                {
                        MakeToken();
                }
+               else if ((__focusedEditingTokenIndex == -1) && (__focusedTokenIndex != -1) && (!__isEditingToken))
+               {
+                       if (__isEditModeEnabled)
+                       {
+                               __edittingTokenIndex = __focusedTokenIndex;
+                               __pressedTokenIndex = __edittingTokenIndex;
+                               __isEditingToken = true;
+                               __focusedEditingTokenIndex = __focusedTokenIndex;
+                               __focusedTokenIndex = -1;
+                               __isTokenEditingFinished = false;
+
+                               SetEditingTokenTextBounds(__edittingTokenIndex);
+
+                               r = AttachCursorToPressedToken();
+                               SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+                       }
+               }
+               else
+               {
+                       //Focussed token is ready to be edited again.
+                       __focusedEditingTokenIndex = -1;
+               }
 
                for (int i = 0; i < __pTokenList->GetCount(); i++)
                {
@@ -3004,7 +3096,7 @@ _TokenEditPresenter::OnTextCommitted(const String& commitText)
                        InitializeTokenVisibilityAt(i);
                }
 
-               if (__pressedTokenIndex < 0)
+               if ((__pressedTokenIndex < 0) || (__focusedEditingTokenIndex > -1))
                {
                        SetCursorDisabled(true);
                        __pTokenEdit->Draw();
@@ -3251,6 +3343,13 @@ _TokenEditPresenter::OnSurroundingTextDeleted(int offset, int charCount)
                __pTokenEdit->Invalidate();
                return;
        }
+       else if (__focusedTokenIndex >= 0 && __edittingTokenIndex < 0 && !__isEditingToken)
+       {
+               RemoveTokenAt(__focusedTokenIndex);
+               __pTokenEdit->Invalidate();
+               return;
+       }
+
 
        //Backspace on Blocked text, delete full block
        if (IsBlocked() == true)
@@ -3724,10 +3823,45 @@ _TokenEditPresenter::OnBoundsChanged(void)
        return;
 }
 
+result
+_TokenEditPresenter::AttachCursorToPressedToken(void)
+{
+       result r = E_SUCCESS;
+
+       _VisualElement* pEditVisualElement = __pTokenEdit->GetVisualElement();
+       SysTryReturnResult(NID_UI_CTRL, pEditVisualElement, E_SYSTEM, "A system error has occurred. Failed to get root visual element.");
+
+       _VisualElement* pCursorVisualElement = GetCursorVisualElement();
+       SysTryReturnResult(NID_UI_CTRL, pCursorVisualElement, E_SYSTEM, "A system error has occurred. Failed to get cursor visual element.");
+
+       _Token* pToken = null;
+       _VisualElement* pTokenVisualElement = null;
+
+       pToken = static_cast <_Token*>(__pTokenList->GetAt(__pressedTokenIndex));
+       if (pToken)
+       {
+               pTokenVisualElement = pToken->GetVisualElement();
+               SysTryReturnResult(NID_UI_CTRL, pTokenVisualElement, E_SYSTEM, "A system error has occurred. Failed to get token visual element.");
+
+               if (pCursorVisualElement->GetParent() != pTokenVisualElement)
+               {
+                       r = (pCursorVisualElement->GetParent())->DetachChild(*pCursorVisualElement);
+                       SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+
+                       r = pTokenVisualElement->AttachChild(*pCursorVisualElement);
+                       SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+               }
+       }
+
+       return r;
+}
+
 bool
 _TokenEditPresenter::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo)
 {
        _KeyCode keyCode = keyInfo.GetKeyCode();
+       bool focusChanged = false;
+       int tokenCount = GetTokenCount();
 
        if (IsUsbKeyboardConnected() && (keyInfo.GetKeyModifier() & _KEY_MODIFIER_CTRL))
        {
@@ -3748,6 +3882,95 @@ _TokenEditPresenter::OnKeyPressed(const _Control& source, const _KeyInfo& keyInf
                }
        }
 
+       if ((keyCode == _KEY_NUM_LEFT) || (keyCode == _KEY_LEFT))
+       {
+               if (!__isEditingToken)
+               {
+                       if ((__focusedTokenIndex > 0) && (__focusedTokenIndex < tokenCount))
+                       {
+                               __focusedTokenIndex--;
+                               focusChanged = true;
+                       }
+               }
+       }
+
+       if ((keyCode == _KEY_NUM_RIGHT) || (keyCode == _KEY_RIGHT))
+       {
+               int lastTokenIndex = tokenCount - 1;
+               if (!__isEditingToken)
+               {
+                       if (__pressedTokenIndex != -1)
+                       {
+                               __pressedTokenIndex = -1;
+                               __focusedTokenIndex = 0;
+                               focusChanged = true;
+                       }
+                       else if (__focusedTokenIndex < lastTokenIndex)
+                       {
+                               __focusedTokenIndex++;
+                               focusChanged = true;
+                       }
+               }
+       }
+
+       if (focusChanged)
+       {
+               ScrollToFocussedToken();
+       }
+
        return _EditPresenter::OnKeyPressed(source, keyInfo);
 }
+
+result
+_TokenEditPresenter::ScrollToFocussedToken(void)
+{
+       result r = E_SUCCESS;
+       int tokenCount = GetTokenCount();
+       FloatRectangle focussedTokenRectangle;
+       float newScrollValue = 0.0f;
+       float tokenTopMargin = 0.0f;
+       float tokenBottomMargin = 0.0f;
+       _ControlOrientation orientation = __pTokenEdit->GetOrientation();
+
+
+       GET_SHAPE_CONFIG(TOKENEDIT::TOP_MARGIN, orientation, tokenTopMargin);
+       GET_SHAPE_CONFIG(TOKENEDIT::BOTTOM_MARGIN, orientation, tokenBottomMargin);
+
+       FloatRectangle tokenEditRect = __pTokenEdit->GetBoundsF();
+
+       if ((__focusedTokenIndex > -1) && (__focusedTokenIndex < tokenCount))
+       {
+               _Token* pToken = null;
+               pToken = static_cast <_Token*>(__pTokenList->GetAt(__focusedTokenIndex));
+
+               focussedTokenRectangle = pToken->displayRect;
+
+               float focussedTokenPosition= focussedTokenRectangle.y + focussedTokenRectangle.height ;
+
+               if ((focussedTokenRectangle.y > 0) && (focussedTokenPosition < tokenEditRect.height))
+               {
+                       //Focused token is within the tokenEdit boundary
+                       DrawToken();
+               }
+               else
+               {
+                       if (focussedTokenRectangle.y < 0)
+                       {
+                               //Focused token is above the upper boundary
+                               newScrollValue = focussedTokenRectangle.y - tokenTopMargin - __scrollValue;
+                       }
+                       else
+                       {
+                               //Focused token is below the lower boundary
+                               newScrollValue = focussedTokenPosition - tokenEditRect.height + tokenBottomMargin - __scrollValue;
+                       }
+
+                       r = RecalculateTokenBounds(newScrollValue);
+                       SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+               }
+       }
+
+       return r;
+}
+
 }}} //Tizen::Ui::Controls
index 83ae6be..3657650 100644 (file)
@@ -46,13 +46,42 @@ class FooterItemAccessibilityListener
        : public _IAccessibilityListener
 {
 public:
-       FooterItemAccessibilityListener(void){}
+       FooterItemAccessibilityListener(const Tizen::Ui::Controls::_Toolbar* toolbar)
+       :__pToolbar(null)
+       {
+               __pToolbar = const_cast<Tizen::Ui::Controls::_Toolbar*>(toolbar);
+       }
        virtual ~FooterItemAccessibilityListener(void){}
        virtual bool OnAccessibilityFocusMovedNext(const _AccessibilityContainer& control, const _AccessibilityElement& element){return true;}
        virtual bool OnAccessibilityFocusMovedPrevious(const _AccessibilityContainer& control, const _AccessibilityElement& element){return true;}
        virtual bool OnAccessibilityReadingElement(const _AccessibilityContainer& control, const _AccessibilityElement& element){return true;}
        virtual bool OnAccessibilityReadElement(const _AccessibilityContainer& control, const _AccessibilityElement& element){return true;}
-       virtual bool OnAccessibilityFocusIn(const _AccessibilityContainer& control, const _AccessibilityElement& element){return true;}
+       virtual bool OnAccessibilityFocusIn(const _AccessibilityContainer& control, const _AccessibilityElement& element)
+       {
+               FloatRectangle rect = element.GetAbsoluteBounds();
+               Dimension screen = _ResourceManager::GetInstance()->GetLogicalScreenSizen();
+               int screenW = _ControlManager::GetInstance()->GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT ? screen.width : screen.height;
+               if(rect.x < 0.0f)
+               {
+                       __pToolbar->GetPresenter()->AdjustItemPositionX(-(rect.x));
+                       __pToolbar->Invalidate(true);
+               }
+               else if(rect.x + rect.width > screenW)
+               {
+                       float adjustX = 0.0f;
+                       if(rect.x + rect.width > screenW)
+                       {
+                               adjustX = -(rect.x + rect.width - screenW);
+                       }
+                       else
+                       {
+                               adjustX = -rect.x;
+                       }
+                       __pToolbar->GetPresenter()->AdjustItemPositionX(adjustX);
+                       __pToolbar->Invalidate(true);
+               }
+               return true;
+       }
        virtual bool OnAccessibilityFocusOut(const _AccessibilityContainer& control, const _AccessibilityElement& element){return true;}
        virtual bool OnAccessibilityValueIncreased(const _AccessibilityContainer& control, const _AccessibilityElement& element){return true;}
        virtual bool OnAccessibilityValueDecreased(const _AccessibilityContainer& control, const _AccessibilityElement& element){return true;}
@@ -61,8 +90,9 @@ public:
                _AccessibilityManager::GetInstance()->RequestAutoReading(_ACCESSIBILITY_AUTO_READING_MODE_FIRST_ITEM_OF_CONTENTS);
                return true;
        }
+private:
+       Tizen::Ui::Controls::_Toolbar* __pToolbar;
 };
-FooterItemAccessibilityListener footerItemAccessibilityListener;
 }
 
 namespace Tizen { namespace Ui { namespace Controls
@@ -92,6 +122,7 @@ _Toolbar::_Toolbar(void)
        , __titleTextArea(FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f))
        , __itemArea(FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f))
        , __pTitleTextElement(null)
+       , __pAccessibilityListener(null)
 {
        _AccessibilityContainer* pContainer = null;
 
@@ -149,6 +180,7 @@ _Toolbar::_Toolbar(void)
                __isButtonBgColorSetByUser[i] = false;
                __isButtonTextColorSetByUser[i] = false;
        }
+       __pAccessibilityListener = new (std::nothrow) FooterItemAccessibilityListener(this);
 }
 
 _Toolbar::~_Toolbar(void)
@@ -234,6 +266,11 @@ _Toolbar::~_Toolbar(void)
                __pTitleTextElement = null;
        }
 
+       if(__pAccessibilityListener)
+       {
+               delete __pAccessibilityListener;
+               __pAccessibilityListener = null;
+       }
        ClearLastResult();
 }
 
@@ -2892,7 +2929,7 @@ _Toolbar::AddAccessibilityElement(_Button* pButton)
                                || style == TOOLBAR_TAB)
                        {
                                pElement->SetHint(L"Double tap to move to contents");
-                               pButton->GetAccessibilityContainer()->AddListener(footerItemAccessibilityListener);
+                               pButton->GetAccessibilityContainer()->AddListener(*__pAccessibilityListener);
                        }
                }
        }
@@ -3106,6 +3143,12 @@ _Toolbar::SetPresenter(const _ToolbarPresenter& toolbarPresenter)
        return E_SUCCESS;
 }
 
+_ToolbarPresenter*
+_Toolbar::GetPresenter(void) const
+{
+       return __pToolbarPresenter;
+}
+
 result
 _Toolbar::ApplyUserGUI(ButtonType buttonType, _Button* pButton)
 {
index 93ed06e..e3d8a05 100644 (file)
@@ -105,6 +105,11 @@ public:
        Tizen::Graphics::FloatRectangle GetParentWindowBounds() const;
        void RefreshItems(void);
 
+       virtual bool OnFocusGained(const _Control &source);
+       virtual bool OnFocusLost(const _Control &source);
+       void OnDrawFocus(void);
+       bool OnKeyPressed(const _Control &source, const _KeyInfo &keyInfo);
+
        // accessibility listener
        virtual bool OnAccessibilityFocusMovedNext(const _AccessibilityContainer& control, const _AccessibilityElement& element);
        virtual bool OnAccessibilityFocusMovedPrevious(const _AccessibilityContainer& control, const _AccessibilityElement& element);
index c468ee2..0bbca5e 100644 (file)
@@ -69,11 +69,15 @@ public:
        int GetMaximumValue(void) const;
        void SetMaximumValue(int maxValue);
 
+       result DrawFocus();
+       void SetItemFocused(bool isFocused);
+
        float GetItemWidth(void) const;
        float GetItemMargin(void) const;
        float GetFontSize(void) const;
        float GetLeftRightMargin(void) const;
 
+       bool OnKeyPressed(const _Control &source, const _KeyInfo &keyInfo);
        virtual bool OnTouchPressed(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
        virtual bool OnTouchReleased(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
        virtual bool OnTouchMoved(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
@@ -153,10 +157,16 @@ private:
        Tizen::Graphics::FloatRectangle __arrowAreaBounds;
        Tizen::Graphics::FloatRectangle __windowAreaBounds;
        Tizen::Graphics::Bitmap* __pBgColorReplacementBitmap;
+       Tizen::Graphics::Bitmap*  __pFocusBitmap;
        Tizen::Graphics::Bitmap* __pArrowColorReplacementBitmap;
        bool __isInitialAnimation;
        int __initialAnimationValue;
        Tizen::Graphics::Font* __pFont;
+       bool __isFocused;
+       int __focusedIndex;
+       Tizen::Graphics::FloatRectangle __focusBounds;
+       static const int UPDATE_ITEM_COUNT = 3;
+
 }; // _DateTimeBarPresenter
 
 }}} // Tizen::Ui::Controls
index 6e26929..fb13036 100644 (file)
@@ -120,7 +120,7 @@ enum _DateTimeId
 enum DateTimePickerStatus
 {
        DATETIME_STATUS_NORMAL = 0,
-       DATETIME_STATUS_PRESSED,
+       DATETIME_STATUS_SELECTED,
        DATETIME_STATUS_HIGHLIGHTED,
        DATETIME_STATUS_DISABLED,
        DATETIME_STATUS_MAX
@@ -161,6 +161,24 @@ enum _DateFormat
        DATE_FORMAT_YYYYMMDD,
        DATE_FORMAT_YYYYDDMM
 };
+
+enum _TimeFormat
+{
+        TIME_FORMAT_12HOUR = 0,
+        TIME_FORMAT_24HOUR
+};
+
+enum _FocusType
+{
+       FOCUS_DAY = 0,
+       FOCUS_MONTH,
+       FOCUS_YEAR,
+       FOCUS_HOUR,
+       FOCUS_MINUTE,
+       FOCUS_AMPM,
+       FOCUS_NONE
+};
+
 }}} // Tizen::Ui::Controls
 
 #endif  // _FUI_CTRL_INTERNAL_DATETIME_DEFINE_H_
index 68fe433..76b003d 100644 (file)
@@ -26,6 +26,7 @@
 #include <FBaseDateTime.h>
 #include <FBaseString.h>
 #include <FBaseColLinkedListT.h>
+#include <FSysISettingEventListener.h>
 
 #include "FUi_Window.h"
 #include "FUiCtrl_IActionEventListener.h"
@@ -54,6 +55,7 @@ class _DateTimePicker
        , virtual public Tizen::Ui::_IUiEventListener
        , virtual public Tizen::Ui::_IUiEventPreviewer
        , virtual public Tizen::Ui::_IAccessibilityListener
+       , virtual public Tizen::System::ISettingEventListener
 {
        DECLARE_CLASS_BEGIN(_DateTimePicker, _Control);
        DECLARE_PROPERTY("year", GetPropertyYear, SetPropertyYear);
@@ -158,6 +160,15 @@ public:
 
        virtual void OnFontChanged(Tizen::Graphics::Font* pFont);
        virtual void OnFontInfoRequested(unsigned long& style, float& size);
+
+       virtual bool OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo);
+       virtual bool OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo);
+       virtual void OnDrawFocus(void);
+       bool OnFocusGained(const _Control& source);
+       bool OnFocusLost(const _Control& source);
+
+       virtual void OnSettingChanged(Tizen::Base::String& key);
+
        Tizen::Graphics::Font* GetDateTimeFont(void);
        result InitializeFont(void);
 
@@ -188,6 +199,7 @@ private:
        Tizen::Ui::Animations::_VisualElement* __pDisplayVisualElement;
 
        Tizen::Base::Collection::LinkedListT<Tizen::Ui::_AccessibilityElement*> __accessibilityElements;
+
 }; // _DateTimePicker
 
 }}} // Tizen::Ui::Controls
index 9891044..e5f749e 100644 (file)
@@ -94,6 +94,10 @@ public:
 
        result SetFont(Tizen::Graphics::Font* pFont);
 
+       void UpdateLocaleDateTimeFormat(void);
+
+       void UpdateTimeFormat(void);
+
        virtual void OnChangeLayout(Tizen::Ui::_ControlOrientation orientation);
 
        virtual bool OnTouchPressed(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
@@ -105,6 +109,11 @@ public:
 
        virtual void OnActionPerformed(const Tizen::Ui::_Control& source, int actionId);
 
+       virtual bool OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo);
+       virtual bool OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo);
+       result DrawFocus(void);
+       result ReleaseFocus(void);
+
 private:
        void UpdateDateTimeOutputConfig(void);
 
@@ -156,10 +165,12 @@ private:
 
        void ChangeFocusBox(void);
 
-       int GetLocaleDateFormat(void) const;
-
        void SetAccessibilityElementText(void);
 
+       void HandleInputPadValueChange(int inputPadReturnValue);
+
+       void HandleSaveCancelAction(int actionId);
+
 private:
        _DateTimePresenter(const _DateTimePresenter&);
 
@@ -198,6 +209,8 @@ private:
 
        bool __is24HourNotation;
 
+       bool __dtp24HourSet;
+
        bool __isPm;
 
        bool __isPmButtonPressed;
@@ -226,6 +239,8 @@ private:
        _DateTimeDisplayBox* __pDisplayBox[DATETIME_ID_MAX];
 
        _DateTimeDisplayBox* __pPmBox;
+
+       bool __keypadEnabled;
 }; // _DateTimePresenter
 
 }}} // Tizen::Ui::Controls
index a04e351..ac2eb1f 100644 (file)
@@ -50,12 +50,15 @@ public:
        int CalculateMaxDay(int displayYear, int month) const ;
        bool IsLeapYear(int year) const;
        void GetAmPm(Tizen::Base::String& timeFormat, _AmPmType amPmType) const;
+       int GetLocaleDateFormat(void) const;
 
 private:
        _DateTimeUtils(const _DateTimeUtils&);
 
        _DateTimeUtils& operator =(const _DateTimeUtils&);
 
+       static const int LOCALE_DATE_FORMAT_STRING_LENGTH = 8;
+
 };
 
 }}} // Tizen::Ui::Controls
index e481b36..37af9d3 100644 (file)
@@ -131,6 +131,13 @@ public:
        virtual void OnFontChanged(Tizen::Graphics::Font* pFont);
        virtual void OnFontInfoRequested(unsigned long& style, float& size);
        virtual void OnSettingChanged(Tizen::Base::String& key);
+
+       virtual bool OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo);
+
+       virtual bool OnFocusGained(const _Control& source);
+       virtual bool OnFocusLost(const _Control& source);
+       virtual void OnDrawFocus(void);
+
        Tizen::Graphics::FloatRectangle GetParentWindowBounds(void) const;
        void SetXmlBoundsExist(bool isXmlBoundsExist);
 
index b90a11a..ba97812 100644 (file)
@@ -64,13 +64,14 @@ public:
        result Initialize(void);
 
        result Draw(void);
+       result DrawFocus(void);
+       void UpdateLastSelectedValue(_DateTimeId id, bool isTouchPressed);
 
        _DateTimeId GetLastSelectedId(void) const;
        void SetLastSelectedId(_DateTimeId boxId);
        Tizen::Graphics::FloatRectangle GetDateAreaBounds(_DateTimeId id) const;
        Tizen::Graphics::FloatRectangle GetTitleBounds(void) const;
-       int GetLocaleDateFormat(void) const;
-    void Animate(void);
+       void Animate(void);
 
        virtual bool OnTouchPressed(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
        virtual bool OnTouchReleased(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
@@ -79,6 +80,11 @@ public:
        virtual void OnTouchMoveHandled(const Tizen::Ui::_Control& control);
        void OnFontChanged(Tizen::Graphics::Font* pFont);
        void OnFontInfoRequested(unsigned long& style, float& size);
+       void SetFocusState(bool isFocused);
+       void SetFocusedElement(void);
+       virtual bool OnFocusLost(const _Control& source);
+       virtual bool OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo);
+
 
        virtual void OnVisualElementAnimationFinished (const Tizen::Ui::Animations::VisualElementAnimation &animation, const Tizen::Base::String &keyName, Tizen::Ui::Animations::VisualElement &target, bool completedNormally);
        virtual void OnVisualElementAnimationRepeated (const Tizen::Ui::Animations::VisualElementAnimation &animation, const Tizen::Base::String &keyName, Tizen::Ui::Animations::VisualElement &target, long currentRepeatCount){}
@@ -139,6 +145,10 @@ private:
        bool __isEditDateInitialized;
        float __elementWidth;
        static const int __dividerCount = 2;
+       static const float __adjustFocusHeight = 8.0f;
+       _FocusType __focusStatus;
+       bool __isEnterKeyPressed;
+       bool __isFocused;
 }; // _EditDatePresenter
 
 }}} // Tizen::Ui::Controls
index beddc06..21db20e 100644 (file)
@@ -116,6 +116,12 @@ public:
        void OnFontChanged(Tizen::Graphics::Font* pFont);
        void OnFontInfoRequested(unsigned long& style, float& size);
        virtual void OnSettingChanged(Tizen::Base::String& key);
+
+       virtual bool OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo);
+       bool OnFocusGained(const _Control& source);
+       bool OnFocusLost(const _Control& source);
+       virtual void OnDrawFocus(void);
+
        Tizen::Graphics::FloatRectangle GetParentWindowBounds(void) const;
        void SetXmlBoundsExist(bool isXmlBoundsExist);
 
index 9f2f6dd..effdf8f 100644 (file)
@@ -71,6 +71,11 @@ public:
        result Draw(void);
     void Animate(void);
 
+       void SetFocusedElement(void);
+       void SetFocusState(bool isFocused);
+       bool OnFocusLost(const _Control& source);
+       bool OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo);
+
        virtual bool OnTouchPressed(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
        virtual bool OnTouchReleased(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
        virtual bool OnTouchCanceled(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
@@ -80,10 +85,13 @@ public:
        void OnFontInfoRequested(unsigned long& style, float& size);
        result Initialize(void);
        void UpdateTimeFormat(void);
+       void UpdateLastSelectedValue(_DateTimeId boxId, bool __isTouchPressed);
 
        virtual void OnVisualElementAnimationFinished (const Tizen::Ui::Animations::VisualElementAnimation &animation, const Tizen::Base::String &keyName, Tizen::Ui::Animations::VisualElement &target, bool completedNormally);
        virtual void OnVisualElementAnimationRepeated (const Tizen::Ui::Animations::VisualElementAnimation &animation, const Tizen::Base::String &keyName, Tizen::Ui::Animations::VisualElement &target, long currentRepeatCount){}
        virtual void OnVisualElementAnimationStarted (const Tizen::Ui::Animations::VisualElementAnimation &animation, const Tizen::Base::String &keyName, Tizen::Ui::Animations::VisualElement &target){}
+       result DrawFocus(void);
+
 
 private:
        _EditTimePresenter(const _EditTimePresenter&);
@@ -141,6 +149,7 @@ private:
        Tizen::Graphics::Bitmap* __pContentBgEffectNormalBitmap;
        Tizen::Graphics::Bitmap* __pContentBgEffectPressedBitmap;
        Tizen::Graphics::Bitmap* __pContentBgEffectDisabledBitmap;
+       Tizen::Graphics::Bitmap* __pfocusBitmap;
        Tizen::Ui::Animations::VisualElement* __pContentProvider;
 
        Tizen::Graphics::_Text::TextObject __textObject;
@@ -152,6 +161,10 @@ private:
        float __timeFontSize;
        bool __isAnimating;
        bool __isEditTimeInitialized;
+       _FocusType __focusStatus;
+       bool __isEnterKeyPressed;
+       bool __isFocused;
+       static const float __adjustFocusHeight = 8.0f;
 }; // _EditTimePresenter
 
 }}} // Tizen::Ui::Controls
index 8a406c4..793e806 100644 (file)
@@ -128,10 +128,15 @@ public:
        virtual bool OnTouchReleased(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
        virtual bool OnTouchMoved(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
        virtual bool OnTouchCanceled(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
+       virtual void OnDrawFocus(void);
+       virtual bool OnFocusGained(const _Control& source);
+       virtual bool OnFocusLost(const _Control &source);
+       virtual bool OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo);
        virtual void OnBoundsChanged(void);
        virtual void OnChangeLayout(Tizen::Ui::_ControlOrientation orientation);
        virtual void OnDraw(void);
        virtual result OnAttachedToMainTree(void);
+       virtual void OnFocusModeStateChanged(void);
 
        virtual void OnFontChanged(Tizen::Graphics::Font* pFont);
        virtual void OnFontInfoRequested(unsigned long& style, float& size);
index 9518758..0143d2e 100644 (file)
@@ -70,7 +70,8 @@ public:
        static _SliderPresenter* CreateInstanceN(const _Slider& slider);
        result SetThumbBitmap(SliderThumbStatus status, const Tizen::Graphics::Bitmap& bitmap);
        void SetThumbTextColor(SliderThumbStatus status, const Tizen::Graphics::Color& color);
-
+       void SetFocusMode(bool focusmode);
+       bool GetFocusMode(void);
        virtual void OnTimerExpired(Tizen::Base::Runtime::Timer& timer);
 
 private:
@@ -157,6 +158,7 @@ private:
        int __handleX;
        int __prevSliderValue;
        bool __isSliderPressed;
+       bool __isFocusModeStateChanged;
 
        bool __isNeedToBeUpdated;
        bool __isResourceLoaded;
index 7b801ff..24285f9 100644 (file)
@@ -105,6 +105,13 @@ public:
        virtual bool OnAccessibilityValueIncreased(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element);
        virtual bool OnAccessibilityValueDecreased(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element);
 
+       //key listners
+       virtual bool OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo);
+       virtual bool OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo);
+       virtual void OnDrawFocus(void);
+       bool OnFocusGained(const _Control& source);
+       bool OnFocusLost(const _Control& source);
+
 public:
        result AddSplitPanelEventListener(const _ISplitPanelEventListener& listener);
        result RemoveSplitPanelEventListener(const _ISplitPanelEventListener& listener);
index f05098c..8b19189 100644 (file)
@@ -71,6 +71,11 @@ public:
        virtual bool OnTapGestureDetected(_TouchTapGestureDetector& gesture);
        virtual bool OnTapGestureCanceled(_TouchTapGestureDetector& gesture);
 
+       virtual bool OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo);
+       virtual bool OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo);
+       result DrawFocus(SplitPanelPaneOrder focusedPane = SPLIT_PANEL_PANE_ORDER_FIRST);
+       result ReleaseFocus(void);
+
        result SetDividerStyle(SplitPanelDividerStyle splitPanelDividerStyle);
        SplitPanelDividerStyle GetDividerStyle(void) const;
 
@@ -105,6 +110,7 @@ private:
        Tizen::Ui::Control* GetPaneControl(SplitPanelPaneOrder paneOrder);
        Tizen::Ui::Animations::AnimationTransactionStatus GetTransactionStatus(void);
        Tizen::Graphics::FloatRectangle GetRestorePaneBounds(SplitPanelPaneOrder paneOrder);
+       Tizen::Graphics::FloatRectangle GetPaneBounds(SplitPanelPaneOrder paneOrder);
        Tizen::Ui::Animations::VisualElementPropertyAnimation* GetVisualElementAnimation(Tizen::Base::String propertyName);
 
 private:
@@ -127,6 +133,7 @@ private:
        Tizen::Graphics::Bitmap* __pDividerBackgroundBitmap;
        Tizen::Graphics::Bitmap* __pDividerBackgroundEffectBitmap;
        Tizen::Graphics::Bitmap* __pDividerThumbBitmap;
+       Tizen::Graphics::Bitmap* __pFocusBitmap;
        Tizen::Graphics::Color __dividerBackgroundColor;
        Tizen::Graphics::Color __dividerPressedBackgroundColor;
 
@@ -134,6 +141,9 @@ private:
        int __transactionIdMaximize;
        int __transactionIdRestore;
 
+       //Focus UI
+       SplitPanelPaneOrder __currentFocusedPane;
+
        Tizen::Ui::Animations::AnimationInterpolatorType __controlAnimatorInterpolator;
        Tizen::Base::String __visualElementInterpolator;
 
index 6c7a815..8f1f76c 100644 (file)
@@ -152,7 +152,8 @@ public:
        virtual result ChangeLayout(_ControlOrientation orientation);
        virtual void ResetTextBounds(void);
        virtual bool OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo);
-
+       result ScrollToFocussedToken(void);
+       result AttachCursorToPressedToken(void);
 private:
        bool DrawToken(int count = -1);
        Tizen::Graphics::Color GetTokenEditColor(const ExpandableEditAreaTokenStatus status) const;
@@ -185,6 +186,8 @@ private:
        Tizen::Graphics::Bitmap* __pTokenBgBitmap;
        Tizen::Graphics::Bitmap* __pTokenBgNormalEffectBitmap;
        Tizen::Graphics::Bitmap* __pTokenBgPressedEffectBitmap;
+       Tizen::Graphics::Bitmap* __pTokenBgReplacementFocusBitmap;
+       Tizen::Graphics::Bitmap* __pTokenBgFocusEffectBitmap;
 
        int __pressedTokenIndex;
 
@@ -257,6 +260,10 @@ private:
 
        int __trackTokenIndex;
 
+       int __focusedTokenIndex;
+
+       int __focusedEditingTokenIndex;
+
        bool __isAnimationInProgress;
 
        static const int ANIMATION_DURATION_BOUNDS = 167;
index 3dee846..5920fc4 100644 (file)
@@ -43,6 +43,7 @@ class _TouchLongPressGestureDetector;
 namespace Tizen { namespace Ui
 {
 class _AccessibilityElement;
+class _IAccessibilityListener;
 }} // Tizen::Ui
 
 namespace Tizen { namespace Ui { namespace Controls
@@ -384,6 +385,8 @@ public:
 
        result SetTransBackButton(bool transparent);
 
+       _ToolbarPresenter* GetPresenter(void) const;
+
 protected:
        result SetPresenter(const _ToolbarPresenter& toolbarPresenter);
 
@@ -505,6 +508,8 @@ private:
 
        Tizen::Ui::_AccessibilityElement* __pTitleTextElement;
 
+       _IAccessibilityListener* __pAccessibilityListener;
+
        static const float SENSITIVE = 0.08f;
 };
 
index fe14fd0..8b02e59 100644 (file)
@@ -55,8 +55,6 @@ public:
        Tizen::Base::String GetHint(void) const;
        void SetStatus(const Tizen::Base::String& guide);
        Tizen::Base::String GetStatus(void) const;
-       void SetTrait(AccessibilityTraits trait);
-       AccessibilityTraits GetTrait(void) const;
        void SetTrait(const Tizen::Base::String& trait);
        Tizen::Base::String GetTraitString(void) const;
        void SetValue(const Tizen::Base::String& value);
index 16ab5fe..b1332e8 100644 (file)
@@ -55,7 +55,6 @@ public:
        void SetLabel(const Tizen::Base::String& label);
        void SetHint(const Tizen::Base::String& hint);
        void SetStatus(const Tizen::Base::String& status);
-       void SetTrait(AccessibilityTraits trait);
        void SetTrait(const Tizen::Base::String& trait);
        void SetValue(const Tizen::Base::String& value);  //variant gogogo
 
@@ -69,7 +68,6 @@ public:
        Tizen::Base::String GetLabel(void) const;
        Tizen::Base::String GetHint(void) const;
        Tizen::Base::String GetStatus(void) const;
-       AccessibilityTraits GetTrait(void) const;
        Tizen::Base::String GetTraitString(void) const;
        Tizen::Base::String GetValue(void) const;  //variant gogogo
 
index 2b8e9d3..1e9b594 100644 (file)
 
 namespace
 {
-const int __BASIC__ = 1;
-const int __ACCESSIBILITY__ = 2;
-const int __BUTTON__ = 3;
-const int __CHECKBUTTON__ = 4;
-const int __COLORPICKER__ = 5;
-const int __CONTEXTMENU__ = 6;
-const int __DATETIMEBAR__ = 7;
-const int __DATETIMEPICKER__ = 8;
-const int __EDIT__ = 9;
-const int __EDITDATE__ = 10;
-const int __EDITTIME__ = 11;
-const int __FASTSCROLL__ = 12;
-const int __FOOTER__ = 13;
-const int __FORM__ = 14;
-const int __GALLERY__ = 15;
-const int __GROUPCONTAINER__ = 16;
-const int __HEADER__ = 17;
-const int __ICONLIST__ = 18;
-const int __INPUTPAD__ = 19;
-const int __LABEL__ = 20;
-const int __LIST__ = 21;
-const int __LISTVIEW__ = 22;
-const int __APPWIDGET__ = 23;
-const int __MESSAGEBOX__ = 24;
-const int __OPTIONMENU__ = 25;
-const int __OVERLAYPANEL__ = 26;
-const int __PANEL__ = 27;
-const int __POPUP__ = 28;
-const int __PROGRESS__ = 29;
-const int __RADIOGROUP__ = 30;
-const int __SCROLL__ = 31;
-const int __SEARCHBAR__ = 32;
-const int __SLIDER__ =33;
-const int __SPLITPANEL__ = 34;
-const int __TABBAR__ = 35;
-const int __TAB__ = 36;
-const int __TABLEVIEW__ = 37;
-const int __TOKENEDIT__ = 38;
-const int __FOCUSUI__ = 39;
+struct TypeDefined
+{
+static const int __BASIC__ = 1;
+static const int __ACCESSIBILITY__ = 2;
+static const int __BUTTON__ = 3;
+static const int __CHECKBUTTON__ = 4;
+static const int __COLORPICKER__ = 5;
+static const int __CONTEXTMENU__ = 6;
+static const int __DATETIMEBAR__ = 7;
+static const int __DATETIMEPICKER__ = 8;
+static const int __EDIT__ = 9;
+static const int __EDITDATE__ = 10;
+static const int __EDITTIME__ = 11;
+static const int __FASTSCROLL__ = 12;
+static const int __FOOTER__ = 13;
+static const int __FORM__ = 14;
+static const int __GALLERY__ = 15;
+static const int __GROUPCONTAINER__ = 16;
+static const int __HEADER__ = 17;
+static const int __ICONLIST__ = 18;
+static const int __INPUTPAD__ = 19;
+static const int __LABEL__ = 20;
+static const int __LIST__ = 21;
+static const int __LISTVIEW__ = 22;
+static const int __APPWIDGET__ = 23;
+static const int __MESSAGEBOX__ = 24;
+static const int __OPTIONMENU__ = 25;
+static const int __OVERLAYPANEL__ = 26;
+static const int __PANEL__ = 27;
+static const int __POPUP__ = 28;
+static const int __PROGRESS__ = 29;
+static const int __RADIOGROUP__ = 30;
+static const int __SCROLL__ = 31;
+static const int __SEARCHBAR__ = 32;
+static const int __SLIDER__ =33;
+static const int __SPLITPANEL__ = 34;
+static const int __TABBAR__ = 35;
+static const int __TAB__ = 36;
+static const int __TABLEVIEW__ = 37;
+static const int __TOKENEDIT__ = 38;
+static const int __FOCUSUI__ = 39;
 
-       struct _TYPE_RESOURCE
+       struct TypeResource
        {
                static const int _COLOR_ = 0x00010000;
                static const int _IMAGE_ = 0x00020000;
@@ -88,6 +90,7 @@ const int __FOCUSUI__ = 39;
                static const int _FIXED_VALUE_ = 0x00050000;
                static const int _ANIMATION_ = 0x00060000;
        };
+};
 }
 
 #define DECLARE_UI_CONFIG(x) \
@@ -275,16 +278,16 @@ const int __FOCUSUI__ = 39;
                                AddConfig(table, mode, GetAPIVersion());\
                                return true;\
                        };\
-                       static const int _VALUE_ = __##x##__ << 24;
+                       static const int _VALUE_ = TypeDefined::__##x##__ << 24;
 
 #define DECLARE_END_UI_CONFIG(X) };}}}
 
-#define DECLARE_COLOR_CONFIG(id,value) static const int id##_COLOR = _VALUE_ + _TYPE_RESOURCE::_COLOR_ + value;
-#define DECLARE_IMAGE_CONFIG(id,value) static const int id##_IMAGE = _VALUE_ + _TYPE_RESOURCE::_IMAGE_ + value;
-#define DECLARE_SHAPE_CONFIG(id,value) static const int id##_SHAPE = _VALUE_ + _TYPE_RESOURCE::_SHAPE_ + value;
-#define DECLARE_DIMENSION_CONFIG(id,value) static const int id##_DIMENSION = _VALUE_ + _TYPE_RESOURCE::_DIMENSION_ + value;
-#define DECLARE_FIXED_VALUE_CONFIG(id,value) static const int id##_FIXED_VALUE = _VALUE_ + _TYPE_RESOURCE::_FIXED_VALUE_ + value;
-#define DECLARE_ANIMATION_CONFIG(id,value) static const int id##_ANIMATION = _VALUE_ + _TYPE_RESOURCE::_ANIMATION_ + value;
+#define DECLARE_COLOR_CONFIG(id,value) static const int id##_COLOR = _VALUE_ + TypeDefined::TypeResource::_COLOR_ + value;
+#define DECLARE_IMAGE_CONFIG(id,value) static const int id##_IMAGE = _VALUE_ + TypeDefined::TypeResource::_IMAGE_ + value;
+#define DECLARE_SHAPE_CONFIG(id,value) static const int id##_SHAPE = _VALUE_ + TypeDefined::TypeResource::_SHAPE_ + value;
+#define DECLARE_DIMENSION_CONFIG(id,value) static const int id##_DIMENSION = _VALUE_ + TypeDefined::TypeResource::_DIMENSION_ + value;
+#define DECLARE_FIXED_VALUE_CONFIG(id,value) static const int id##_FIXED_VALUE = _VALUE_ + TypeDefined::TypeResource::_FIXED_VALUE_ + value;
+#define DECLARE_ANIMATION_CONFIG(id,value) static const int id##_ANIMATION = _VALUE_ + TypeDefined::TypeResource::_ANIMATION_ + value;
 
 
 #define START_UI_CONFIG(control)\
index 319ab5e..7616397 100644 (file)
@@ -67,7 +67,7 @@ DECLARE_UI_CONFIG(SLIDER);
        DECLARE_SHAPE_CONFIG(HANDLE_THREE_DIGIT_TEXT_SIZE, 6);
        DECLARE_SHAPE_CONFIG(BAR_HEIGHT, 7);
        DECLARE_SHAPE_CONFIG(BAR_LEFT_MARGIN, 8);
-       DECLARE_SHAPE_CONFIG(BAR_TOP_MARGIN, 9);
+       DECLARE_SHAPE_CONFIG(TITLE_TEXT_POSITION_Y, 9);
        DECLARE_SHAPE_CONFIG(BAR_OFFSET, 10);
        DECLARE_SHAPE_CONFIG(ICON_WIDTH, 11);
        DECLARE_SHAPE_CONFIG(ICON_HEIGHT, 12);
index f0737bf..e99ba4c 100644 (file)
@@ -29,9 +29,12 @@ DECLARE_UI_CONFIG(TOKENEDIT);
        DECLARE_COLOR_CONFIG(BG_SELECTED, 2);
        DECLARE_COLOR_CONFIG(TEXT_NORMAL, 3);
        DECLARE_COLOR_CONFIG(TEXT_SELECTED, 4);
+       DECLARE_COLOR_CONFIG(BG_FOCUS, 5);
        DECLARE_IMAGE_CONFIG(BG_NORMAL, 1);
        DECLARE_IMAGE_CONFIG(BG_NORMAL_EFFECT, 2);
        DECLARE_IMAGE_CONFIG(BG_PRESSED_EFFECT, 3);
+       DECLARE_IMAGE_CONFIG(BG_FOCUS, 4);
+       DECLARE_IMAGE_CONFIG(BG_FOCUS_EFFECT, 5);
        DECLARE_SHAPE_CONFIG(LEFT_MARGIN, 1);
        DECLARE_SHAPE_CONFIG(RIGHT_MARGIN, 2);
        DECLARE_SHAPE_CONFIG(TOP_MARGIN, 3);
index f46fb61..ecc2dfb 100644 (file)
@@ -34,7 +34,7 @@ START_UI_CONFIG(SLIDER);
        ADD_COLOR_CONFIG(HANDLE_BG_NORMAL, $W0641);
        ADD_COLOR_CONFIG(HANDLE_BG_PRESSED, $W0641P);
        ADD_COLOR_CONFIG(HANDLE_BG_DISABLED, $W0641D);
-       ADD_COLOR_CONFIG(HANDLE_BG_HIGHLIGHTED, $W0641);
+       ADD_COLOR_CONFIG(HANDLE_BG_HIGHLIGHTED, $W161);
        ADD_COLOR_CONFIG(HANDLE_NUMBER_TEXT_DISABLED, $W0611D);
        ADD_COLOR_CONFIG(HANDLE_NUMBER_TEXT_NORMAL, $W0611);
 
@@ -50,7 +50,7 @@ START_UI_CONFIG(SLIDER);
        ADD_IMAGE_CONFIG(HANDLE_BG_NORMAL, #00_slider_handle.png);
        ADD_IMAGE_CONFIG(HANDLE_BG_PRESSED, #00_slider_handle.png);
        ADD_IMAGE_CONFIG(HANDLE_BG_DISABLED, #00_slider_handle.png);
-       ADD_IMAGE_CONFIG(HANDLE_BG_HIGHLIGHTED, #00_slider_handle.png);
+       ADD_IMAGE_CONFIG(HANDLE_BG_HIGHLIGHTED, #00_slider_handle_focus.png);
 
        ADD_IMAGE_CONFIG(HANDLE_BG_EFFECT_NORMAL, #00_slider_handle_ef.png);
        ADD_IMAGE_CONFIG(HANDLE_BG_EFFECT_PRESSED, #00_slider_handle_ef_press.png);
@@ -82,7 +82,6 @@ START_UI_CONFIG(SLIDER);
                ADD_SHAPE_CONFIG(BAR_HEIGHT, 36);
                ADD_SHAPE_CONFIG(BAR_LEFT_MARGIN_WITH_ICON, 26);
                ADD_SHAPE_CONFIG(BAR_LEFT_MARGIN, 36);
-               ADD_SHAPE_CONFIG(BAR_TOP_MARGIN, 16);
                ADD_SHAPE_CONFIG(BAR_OFFSET, 9);
 
                ADD_SHAPE_CONFIG(ICON_WIDTH, 72);
@@ -91,6 +90,7 @@ START_UI_CONFIG(SLIDER);
                ADD_SHAPE_CONFIG(ICON_RIGHT_MARGIN, 16);
 
                ADD_SHAPE_CONFIG(TITLE_TEXT_POSITION_X, 12);
+               ADD_SHAPE_CONFIG(TITLE_TEXT_POSITION_Y, 16);
                ADD_SHAPE_CONFIG(TITLE_TEXT_SIZE, 32);
                ADD_SHAPE_CONFIG(TITLE_TEXT_HEIGHT, 49);
 
index 744af8d..f6170c0 100644 (file)
@@ -28,10 +28,13 @@ START_UI_CONFIG(TOKENEDIT);
        ADD_COLOR_CONFIG(BG_SELECTED, $W0713);
        ADD_COLOR_CONFIG(TEXT_NORMAL, $F011L10);
        ADD_COLOR_CONFIG(TEXT_SELECTED, $F011L10);
+       ADD_COLOR_CONFIG(BG_FOCUS, $W0715);
 
        ADD_IMAGE_CONFIG(BG_NORMAL, #00_contacts_button_bg.#.png);
        ADD_IMAGE_CONFIG(BG_NORMAL_EFFECT, #00_contacts_button_bg_ef.#.png);
        ADD_IMAGE_CONFIG(BG_PRESSED_EFFECT, #00_contacts_button_bg_press_ef.#.png);
+       ADD_IMAGE_CONFIG(BG_FOCUS, #00_contacts_button_focus.#.png);
+       ADD_IMAGE_CONFIG(BG_FOCUS_EFFECT, #00_contacts_button_focus_ef.#.png);
 
        START_UI_CONFIG_MODE(720x1280);
        {