Merge "Modified item lazy deletion on ListView/GroupedListView(N-SE-38240)" into...
authorSuhwan_Park <suhwan0927.park@samsung.com>
Wed, 22 May 2013 01:57:32 +0000 (10:57 +0900)
committerGerrit Code Review <gerrit2@kim11>
Wed, 22 May 2013 01:57:32 +0000 (10:57 +0900)
157 files changed:
clipboard.service [new file with mode: 0644]
inc/FUiCtrlDatePicker.h
inc/FUiCtrlForm.h
inc/FUiCtrlTableView.h
inc/FUiCtrlTimePicker.h
inc/FUiCustomControlBase.h
osp-uifw.manifest
packaging/osp-uifw.spec
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/copy&paste_Handler_center.png
res/common/usr/share/osp/bitmaps/480x800/copy&paste_Handler_center_reverse.png
res/common/usr/share/osp/bitmaps/480x800/copy&paste_Handler_left.png
res/common/usr/share/osp/bitmaps/480x800/copy&paste_Handler_left_01.png
res/common/usr/share/osp/bitmaps/480x800/copy&paste_Handler_left_reverse.png
res/common/usr/share/osp/bitmaps/480x800/copy&paste_Handler_right.png
res/common/usr/share/osp/bitmaps/480x800/copy&paste_Magnifier.#.png
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/copy&paste_Handler_center.png
res/common/usr/share/osp/bitmaps/720x1280/copy&paste_Handler_center_reverse.png
res/common/usr/share/osp/bitmaps/720x1280/copy&paste_Handler_left.png
res/common/usr/share/osp/bitmaps/720x1280/copy&paste_Handler_left_01.png
res/common/usr/share/osp/bitmaps/720x1280/copy&paste_Handler_left_reverse.png
res/common/usr/share/osp/bitmaps/720x1280/copy&paste_Handler_right.png
res/common/usr/share/osp/bitmaps/720x1280/copy&paste_Magnifier.#.png
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/CMakeLists.txt
src/graphics/FGrp_Canvas.cpp
src/graphics/inc/FGrp_TextTextObject.h
src/graphics/opengl/FGrpEgl.cpp
src/graphics/text/FGrp_TextTextObject.cpp
src/graphics/text/FGrp_TextTextSimple.cpp
src/ui/FUi_AccessibilityElement.cpp
src/ui/FUi_AccessibilityElementImpl.cpp
src/ui/FUi_AccessibilityManager.cpp
src/ui/FUi_AccessibilitySystemSettingLoader.cpp
src/ui/FUi_Clipboard.cpp
src/ui/FUi_Control.cpp
src/ui/FUi_ControlImpl.cpp
src/ui/FUi_ControlManager.cpp
src/ui/FUi_EflUiEventManager.cpp
src/ui/FUi_OrientationAgent.cpp
src/ui/FUi_SystemUtilImpl.cpp
src/ui/FUi_UiEventManager.cpp
src/ui/FUi_UiKeyEvent.cpp
src/ui/FUi_UiTouchEvent.cpp
src/ui/animations/FUiAnim_EflNode.cpp
src/ui/animations/FUiAnim_EflVisualElementSurfaceImpl.cpp
src/ui/controls/FUiCtrl_Button.cpp
src/ui/controls/FUiCtrl_ButtonImpl.cpp
src/ui/controls/FUiCtrl_ColorPicker.cpp
src/ui/controls/FUiCtrl_ColorPickerPresenter.cpp
src/ui/controls/FUiCtrl_ContextMenuGridPresenter.cpp
src/ui/controls/FUiCtrl_ContextMenuListPresenter.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_Edit.cpp
src/ui/controls/FUiCtrl_EditCopyPasteManager.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_ExpandableListImpl.cpp
src/ui/controls/FUiCtrl_Form.cpp
src/ui/controls/FUiCtrl_FormImpl.cpp
src/ui/controls/FUiCtrl_FrameImpl.cpp
src/ui/controls/FUiCtrl_Gallery.cpp
src/ui/controls/FUiCtrl_IconListItem.cpp
src/ui/controls/FUiCtrl_IconListPresenter.cpp
src/ui/controls/FUiCtrl_InputPadPresenter.cpp
src/ui/controls/FUiCtrl_Keypad.cpp
src/ui/controls/FUiCtrl_Label.cpp
src/ui/controls/FUiCtrl_LabelImpl.cpp
src/ui/controls/FUiCtrl_LabelPresenter.cpp
src/ui/controls/FUiCtrl_ListBaseImpl.cpp
src/ui/controls/FUiCtrl_OptionMenu.cpp
src/ui/controls/FUiCtrl_OptionMenuPresenter.cpp
src/ui/controls/FUiCtrl_PanelImpl.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_Tab.cpp
src/ui/controls/FUiCtrl_TabPresenter.cpp
src/ui/controls/FUiCtrl_TableViewPresenter.cpp
src/ui/controls/FUiCtrl_TextBoxImpl.cpp
src/ui/controls/FUiCtrl_TokenEditPresenter.cpp
src/ui/controls/FUiCtrl_Toolbar.cpp
src/ui/inc/FUiCtrl_Button.h
src/ui/inc/FUiCtrl_ButtonImpl.h
src/ui/inc/FUiCtrl_ColorPicker.h
src/ui/inc/FUiCtrl_ColorPickerPresenter.h
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_Edit.h
src/ui/inc/FUiCtrl_EditDate.h
src/ui/inc/FUiCtrl_EditDatePresenter.h
src/ui/inc/FUiCtrl_EditPresenter.h
src/ui/inc/FUiCtrl_EditTime.h
src/ui/inc/FUiCtrl_EditTimePresenter.h
src/ui/inc/FUiCtrl_Form.h
src/ui/inc/FUiCtrl_Gallery.h
src/ui/inc/FUiCtrl_Keypad.h
src/ui/inc/FUiCtrl_Label.h
src/ui/inc/FUiCtrl_LabelImpl.h
src/ui/inc/FUiCtrl_OptionMenu.h
src/ui/inc/FUiCtrl_OptionMenuPresenter.h
src/ui/inc/FUiCtrl_PanelImpl.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_Tab.h
src/ui/inc/FUiCtrl_TabPresenter.h
src/ui/inc/FUiCtrl_TextBoxImpl.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_Control.h
src/ui/inc/FUi_ControlImpl.h
src/ui/inc/FUi_ITouchEventListener.h
src/ui/inc/FUi_ITouchEventPreviewer.h
src/ui/inc/FUi_LayoutILayoutItemHandler.h
src/ui/inc/FUi_ResourceConfigMacro.h
src/ui/inc/FUi_ResourceListConfig.h
src/ui/inc/FUi_ResourceSliderConfig.h
src/ui/inc/FUi_ResourceTableViewConfig.h
src/ui/inc/FUi_ResourceTokenEditConfig.h
src/ui/inc/FUi_UiEventManager.h
src/ui/inc/FUi_UiKeyEvent.h
src/ui/inc/FUi_UiTouchEvent.h
src/ui/layout/FUi_LayoutLayoutItem.cpp
src/ui/resource/FUi_ResourceCheckButtonConfig.cpp
src/ui/resource/FUi_ResourceConfigParser.cpp
src/ui/resource/FUi_ResourceEditConfig.cpp
src/ui/resource/FUi_ResourceListConfig.cpp
src/ui/resource/FUi_ResourceSliderConfig.cpp
src/ui/resource/FUi_ResourceTableViewConfig.cpp
src/ui/resource/FUi_ResourceTokenEditConfig.cpp

diff --git a/clipboard.service b/clipboard.service
new file mode 100644 (file)
index 0000000..b6abcc1
--- /dev/null
@@ -0,0 +1,13 @@
+  [Unit]
+Description=create folder
+After=
+Before=
+[Service]
+Type=OneShot
+ExecStartPre=/bin/mkdir /tmp/clipboard
+ExecStartPre=/bin/chmod 777 /tmp/clipboard
+ExecStartPre=/usr/bin/chsmack -a 'system::clipboard' /tmp/clipboard
+ExecStart=/usr/bin/chsmack -t /tmp/clipboard
+
+[Install]
+WantedBy=multi-user.target
index 0d9c2f4..7d1aa71 100644 (file)
@@ -105,7 +105,7 @@ DatePickerSample::OnInitializing(void)
        pButton->AddActionEventListener(*this);
 
        // Adds the button to the form
-       AddControl(*pButton);
+       AddControl(pButton);
 
        // Creates an instance of DatePicker
        __pDatePicker = new DatePicker();
index 7cd8e80..9c5d1a9 100644 (file)
@@ -123,8 +123,8 @@ enum FormActionBar
 
        // Gets a pointer of the frame
        Frame *pFrame = UiApp::GetInstance()->GetAppFrame()->GetFrame();
-       pFrame->AddControl(*pForm);
-       pFrame->SetCurrentForm(*pForm);
+       pFrame->AddControl(pForm);
+       pFrame->SetCurrentForm(pForm);
 
        // Implements MyActionEventListener
        IActionEventListener* pListener = new MyActionEventListener();
index 65f96c0..023eec0 100644 (file)
@@ -218,7 +218,7 @@ TableViewSample::CreateItem(int itemIndex, int itemWidth)
        Label* pLabel = new Label();
        pLabel->Construct(Rectangle(0, 0, itemWidth, GetDefaultItemHeight()), text);
 
-       pItem->AddControl(*pLabel);
+       pItem->AddControl(pLabel);
        pItem->SetContextItem(__pContextItem);
 
        return pItem;
index 3add8f0..f0b82e4 100644 (file)
@@ -103,7 +103,7 @@ TimePickerSample::OnInitializing(void)
        pButton->AddActionEventListener(*this);
 
        // Adds a Button to the Form
-       AddControl(*pButton);
+       AddControl(pButton);
 
        // Creates an instance of TimePicker
        __pTimePicker = new TimePicker();
index d2fdb72..9034cbe 100644 (file)
@@ -41,8 +41,6 @@ class _CustomControlBaseImpl;
  * @since   2.0
  *
  * The %CustomControlBase class is the base class for the user-defined UI control classes.
- * @n
- * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/ui/implementing_customcontrolbase.htm">CustomControlBase</a>.
  * @endif
  */
 class _OSP_EXPORT_ CustomControlBase
index ae3e6f7..b8caeaf 100644 (file)
@@ -2,4 +2,8 @@
        <request>
                <domain name="_"/>
        </request>
-</manifest>
\ No newline at end of file
+       <assign>
+               <filesystem path="/usr/lib/systemd/system/clipboard.service" label="_" exec_label="none" />
+               <filesystem path="/usr/lib/systemd/system/multi-user.target.wants/clipboard.service" label="_" exec_label="none" />
+       </assign>
+</manifest>
index 845f46e..604761d 100644 (file)
@@ -117,12 +117,16 @@ cp %{_builddir}/%{name}-%{version}/LICENSE.APLv2  %{buildroot}/usr/share/license
 cp %{_builddir}/%{name}-%{version}/LICENSE.Flora  %{buildroot}/usr/share/license/%{name}
 
 %make_install
-
+mkdir -p %{buildroot}%{_prefix}/lib/systemd/system/multi-user.target.wants
+install -m 0644 clipboard.service %{buildroot}%{_prefix}/lib/systemd/system/clipboard.service
+ln -s ../clipboard.service %{buildroot}%{_prefix}/lib/systemd/system/multi-user.target.wants/clipboard.service
 %post -p /sbin/ldconfig
 
 %postun -p /sbin/ldconfig
 
 %files
+/usr/lib/systemd/system/clipboard.service
+/usr/lib/systemd/system/multi-user.target.wants/clipboard.service
 %manifest osp-uifw.manifest
 /etc/config/screen/sysinfo-screen.xml
 /etc/config/touch/sysinfo-touch.xml
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
index 4ffab9d..2e3d973 100644 (file)
Binary files a/res/common/usr/share/osp/bitmaps/480x800/copy&paste_Handler_center.png and b/res/common/usr/share/osp/bitmaps/480x800/copy&paste_Handler_center.png differ
index 2fbf49d..a3627e7 100644 (file)
Binary files a/res/common/usr/share/osp/bitmaps/480x800/copy&paste_Handler_center_reverse.png and b/res/common/usr/share/osp/bitmaps/480x800/copy&paste_Handler_center_reverse.png differ
index 470413f..5651ae6 100644 (file)
Binary files a/res/common/usr/share/osp/bitmaps/480x800/copy&paste_Handler_left.png and b/res/common/usr/share/osp/bitmaps/480x800/copy&paste_Handler_left.png differ
index eaf41bc..9c9d5c5 100644 (file)
Binary files a/res/common/usr/share/osp/bitmaps/480x800/copy&paste_Handler_left_01.png and b/res/common/usr/share/osp/bitmaps/480x800/copy&paste_Handler_left_01.png differ
index 856f764..3cc438c 100644 (file)
Binary files a/res/common/usr/share/osp/bitmaps/480x800/copy&paste_Handler_left_reverse.png and b/res/common/usr/share/osp/bitmaps/480x800/copy&paste_Handler_left_reverse.png differ
index 11741e5..def2045 100644 (file)
Binary files a/res/common/usr/share/osp/bitmaps/480x800/copy&paste_Handler_right.png and b/res/common/usr/share/osp/bitmaps/480x800/copy&paste_Handler_right.png differ
index ce0dac7..c5a289d 100644 (file)
Binary files a/res/common/usr/share/osp/bitmaps/480x800/copy&paste_Magnifier.#.png and b/res/common/usr/share/osp/bitmaps/480x800/copy&paste_Magnifier.#.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
index 418df8b..127cbda 100644 (file)
Binary files a/res/common/usr/share/osp/bitmaps/720x1280/copy&paste_Handler_center.png and b/res/common/usr/share/osp/bitmaps/720x1280/copy&paste_Handler_center.png differ
index 8d2532a..909efca 100644 (file)
Binary files a/res/common/usr/share/osp/bitmaps/720x1280/copy&paste_Handler_center_reverse.png and b/res/common/usr/share/osp/bitmaps/720x1280/copy&paste_Handler_center_reverse.png differ
index 69ada63..f9e98fb 100644 (file)
Binary files a/res/common/usr/share/osp/bitmaps/720x1280/copy&paste_Handler_left.png and b/res/common/usr/share/osp/bitmaps/720x1280/copy&paste_Handler_left.png differ
index 8e1b2be..6ee3b80 100644 (file)
Binary files a/res/common/usr/share/osp/bitmaps/720x1280/copy&paste_Handler_left_01.png and b/res/common/usr/share/osp/bitmaps/720x1280/copy&paste_Handler_left_01.png differ
index f657c13..eac56f1 100644 (file)
Binary files a/res/common/usr/share/osp/bitmaps/720x1280/copy&paste_Handler_left_reverse.png and b/res/common/usr/share/osp/bitmaps/720x1280/copy&paste_Handler_left_reverse.png differ
index dc4a8e1..2822d3d 100644 (file)
Binary files a/res/common/usr/share/osp/bitmaps/720x1280/copy&paste_Handler_right.png and b/res/common/usr/share/osp/bitmaps/720x1280/copy&paste_Handler_right.png differ
index cc442f5..c85ea30 100644 (file)
Binary files a/res/common/usr/share/osp/bitmaps/720x1280/copy&paste_Magnifier.#.png and b/res/common/usr/share/osp/bitmaps/720x1280/copy&paste_Magnifier.#.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 c2c4136..e8b33cb 100644 (file)
@@ -43,4 +43,4 @@ ADD_SUBDIRECTORY(uifw)
 
 INSTALL(FILES ${CMAKE_SOURCE_DIR}/sysinfo-screen.xml DESTINATION /etc/config/screen)
 INSTALL(FILES ${CMAKE_SOURCE_DIR}/sysinfo-touch.xml DESTINATION /etc/config/touch)
-
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/clipboard.service DESTINATION /usr/lib/systemd/system/ PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
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 d9f43f1..75395da 100644 (file)
@@ -147,6 +147,10 @@ public:
 
        FloatDimension GetTextExtentF(int startTextIndex, int textLength) const;
 
+       Dimension GetTextExtent(void) const;
+
+       FloatDimension GetTextExtentF(void) const;
+
        result SetAction(TextObjectActionType action);
 
        TextObjectActionType GetAction(void) const;
index 85b9aba..a2a72c3 100644 (file)
@@ -41,7 +41,6 @@
 
 #include <Ecore_Evas.h>
 #include <Ecore_X.h>
-#include <Evas_Engine_GL_X11.h>
 
 #include <FBaseSysLog.h>
 #include <FGrpBitmap.h>
@@ -128,15 +127,22 @@ void _SaveCurrentContext(_SglInfo* pSglInfo);
 void _UnregisterRenderCallback(Evas_Object* pObject);
 int __registerCallbackCount = 0;
 _SglInfo* __pPreviousSglInfo = null;
+EGLSurface __pPreviousMakeCurrent = EGL_NO_SURFACE;
 #endif
 
 #if !defined (_OSP_EMUL_)
 #define FGRAPHICS_INTERNAL_USE_DOUBLE_PIXMAP
 #endif
-bool isDoublePixmapEnabled = false;
 
-#define FGRAPHICS_INTERNAL_USE_EVAS_NATIVE_SURFACE
-bool isEvasNativeSetEnabled = false;
+enum _engineType
+{
+       ENGINE_TYPE_SOFEWARE_X11 = 0,
+       ENGINE_TYPE_OPENGL_X11,
+       ENGINE_TYPE_ETC,
+};
+
+_engineType __evasEngineType = ENGINE_TYPE_SOFEWARE_X11;
+bool __isDoublePixmapEnabled = false;
 
 void _OnBoundsChanged(void* pData);
 
@@ -181,7 +187,10 @@ public:
                }
 #endif
 
-               SysTryReturnVoidResult(NID_GRP, pObject != null, E_OPERATION_FAILED, "Invalid object.");
+               if (pObject == null)
+               {
+                       return;
+               }
 
                if (pVisualElement != null)
                {
@@ -200,14 +209,11 @@ public:
                delete pBitmap;
 
                bool needAllocateObject = true;
-               if (isEvasNativeSetEnabled)
+               if (__isDoublePixmapEnabled)
                {
-                       if (isDoublePixmapEnabled)
+                       if (!isBackbuffer)
                        {
-                               if (!isBackbuffer)
-                               {
-                                       needAllocateObject = false;
-                               }
+                               needAllocateObject = false;
                        }
                }
                if (needAllocateObject)
@@ -340,6 +346,11 @@ _OnBoundsChanged(void* pData)
        EGLSurface readSurface = _SglGetCurrentSurface(EGL_READ);
        EGLSurface eglContext = eglGetCurrentContext();
 
+       if (__pPreviousMakeCurrent == drawSurface)
+       {
+               __pPreviousMakeCurrent = EGL_NO_SURFACE;
+       }
+
        if (drawSurface != EGL_NO_SURFACE && readSurface != EGL_NO_SURFACE)
        {
                needSglMakeCurrent = true;
@@ -390,9 +401,9 @@ _OnBoundsChanged(void* pData)
        pSglInfo->isBackbuffer = true;
        pSglInfo->wasShown = false;
        pSglInfo->swapDone = false;
-       pSglInfo->isFirstSwap =  true;
+       pSglInfo->isFirstSwap = true;
 
-       if (isDoublePixmapEnabled)
+       if (__isDoublePixmapEnabled)
        {
                _SglInfo* pSglInfoSecond = pSglInfo->pSecondSglInfo;
                SysTryReturnVoidResult(NID_GRP, pSglInfoSecond != null, E_INVALID_STATE, "Invalid pSecondSglInfo.");
@@ -423,7 +434,7 @@ _OnBoundsChanged(void* pData)
                pSglInfoSecond->wasShown = false;
                pSglInfoSecond->swapDone = true;
 
-               pSglInfo->isFirstSwap =  true;
+               pSglInfo->isFirstSwap = true;
 
                _EvasObjectImageChange(pSglInfoSecond);
        }
@@ -456,7 +467,7 @@ _OnDestroyed(void* pData)
        {
                pSglInfo->pVisualElement = null;
 
-               if (isDoublePixmapEnabled && pSglInfo->pSecondSglInfo != null)
+               if (__isDoublePixmapEnabled && pSglInfo->pSecondSglInfo != null)
                {
                        pSglInfo->pSecondSglInfo->pVisualElement = null;
                }
@@ -704,57 +715,99 @@ _PixmapUnlockCallBack(void* pCallbackParam)
 }
 #endif
 
-bool
-_IsEvasGlEnabled(void)
+_engineType
+_GetEvasEngineType(Evas_Object* pObject)
 {
-       const char* pString = elm_config_preferred_engine_get();
-       String engineName(pString);
-
-       if (engineName.Contains(String("opengl_x11")))
+       if (pObject == null)
        {
-               SysLog(NID_GRP, "gl backend : %s", pString);
-               return true;
-       }
-       else if (engineName.Contains(String("software_x11")))
-       {
-               SysLog(NID_GRP, "sw backend : %s", pString);
-               return false;
+               const char* pString = elm_config_preferred_engine_get();
+               String engineName(pString);
+               SysLog(NID_GRP, "evas backend : %s", pString);
+
+               if (engineName.Contains(String("opengl_x11")))
+               {
+                       return ENGINE_TYPE_OPENGL_X11;
+               }
+               else if (engineName.Contains(String("software_x11")))
+               {
+                       return ENGINE_TYPE_SOFEWARE_X11;
+               }
+               else
+               {
+                       pString = elm_config_engine_get();
+                       String engineName(pString);
+                       SysLog(NID_GRP, "system evas backend : %s", pString);
+                       if (engineName.Contains(String("opengl_x11")))
+                       {
+                               return ENGINE_TYPE_OPENGL_X11;
+                       }
+                       else
+                       {
+                               return ENGINE_TYPE_SOFEWARE_X11;
+                       }
+               }
        }
        else
        {
-               pString = elm_config_engine_get();
+               Evas* pEvas = evas_object_evas_get(pObject);
+               if (pEvas == null)
+               {
+                       SysLogException(NID_GRP, E_OPERATION_FAILED, "Getting pEvas failed.");
+                       return ENGINE_TYPE_SOFEWARE_X11;
+               }
+
+               Ecore_Evas* pEcoreEvas = ecore_evas_ecore_evas_get(pEvas);
+               if (pEcoreEvas == null)
+               {
+                       SysLogException(NID_GRP, E_OPERATION_FAILED, "Getting pEcoreEvas failed.");
+                       return ENGINE_TYPE_SOFEWARE_X11;
+               }
+
+               const char* pString = ecore_evas_engine_name_get(pEcoreEvas);
                String engineName(pString);
+               SysLog(NID_GRP, "evas backend : %s", pString);
+
                if (engineName.Contains(String("opengl_x11")))
                {
-                       SysLog(NID_GRP, "system gl backend : %s", pString);
-                       return true;
+                       return ENGINE_TYPE_OPENGL_X11;
+               }
+               else if (engineName.Contains(String("software_x11")))
+               {
+                       return ENGINE_TYPE_SOFEWARE_X11;
+               }
+               else
+               {
+                       return ENGINE_TYPE_ETC;
                }
        }
-
-       SysLog(NID_GRP, "system sw backend : %s", pString);
-       return false;
 }
 
 void
 _EvasObjectImageChange(_SglInfo* pSglInfo)
 {
-       Evas* pEvas = evas_object_evas_get(pSglInfo->pObject);
-       if (pEvas == null)
+       if(__evasEngineType == ENGINE_TYPE_SOFEWARE_X11 || __evasEngineType == ENGINE_TYPE_OPENGL_X11)
        {
-               return;
-       }
+               Evas* pEvas = evas_object_evas_get(pSglInfo->pObject);
+               if (pEvas == null)
+               {
+                       SysLogException(NID_GRP, E_OPERATION_FAILED, "Getting pEvas failed.");
+                       return;
+               }
 
-       Evas_Engine_Info_GL_X11* pEvasInfo = (Evas_Engine_Info_GL_X11 *)evas_engine_info_get(pEvas);
-       if (pEvasInfo == null)
+               Evas_Native_Surface nativeSurface = {0, };
+               nativeSurface.type = EVAS_NATIVE_SURFACE_X11;
+               nativeSurface.version = EVAS_NATIVE_SURFACE_VERSION;
+               nativeSurface.data.x11.pixmap = (unsigned long)pSglInfo->nativePixmap;
+               nativeSurface.data.x11.visual = ecore_x_default_visual_get(ecore_x_display_get(), ecore_x_default_screen_get());
+               evas_object_image_native_surface_set(pSglInfo->pObject, &nativeSurface);
+       }
+       else
        {
-               return;
+               BufferInfo bufferInfo;
+               pSglInfo->pBitmap->Lock(bufferInfo);
+               evas_object_image_data_set(pSglInfo->pObject, bufferInfo.pPixels);
+               pSglInfo->pBitmap->Unlock();
        }
-       Evas_Native_Surface nativeSurface = {0, };
-       nativeSurface.type = EVAS_NATIVE_SURFACE_X11;
-       nativeSurface.version = EVAS_NATIVE_SURFACE_VERSION;
-       nativeSurface.data.x11.pixmap = (unsigned long)pSglInfo->nativePixmap;
-       nativeSurface.data.x11.visual = pEvasInfo->info.visual;
-       evas_object_image_native_surface_set(pSglInfo->pObject, &nativeSurface);
 }
 
 #if defined(FGRAPHICS_INTERNAL_USE_RESTORE_CONTEXT)
@@ -767,7 +820,7 @@ _PostRenderCallback(Ecore_Evas* ee)
                EGLSurface surface = __pPreviousSglInfo->surface;
                EGLContext context = __pPreviousSglInfo->context;
 
-               if (isDoublePixmapEnabled)
+               if (__isDoublePixmapEnabled)
                {
                        _SglInfo* pBackSglInfo = null;
                        _SglInfo* pFrontSglInfo = null;
@@ -902,7 +955,7 @@ _SglTerminate(EGLDisplay dpy)
 
        _SglInfoTableManipulator::GetInstance()->DestroySglInfoTable();
 
-       if (!_IsEvasGlEnabled())
+       if (!__isDoublePixmapEnabled)
        {
                eglTerminate(dpy);
        }
@@ -954,7 +1007,7 @@ _SglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, EGLNativeWindowType wi
        _SglInfoTableManipulator* pSglInfoTableManipulatorInstance = _SglInfoTableManipulator::GetInstance();
 
 #if 0//!defined(_OSP_EMUL_)
-       if (pFrame != null && !_IsEvasGlEnabled())
+       if (pFrame != null && _GetEvasEngineType(null) != ENGINE_TYPE_OPENGL_X11)
        {
                _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*pControl);
                _WindowImpl* pWindowImpl = dynamic_cast<_WindowImpl*> (pControlImpl);
@@ -1000,18 +1053,6 @@ _SglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, EGLNativeWindowType wi
        {
                result r = E_SUCCESS;
 
-#if defined (FGRAPHICS_INTERNAL_USE_EVAS_NATIVE_SURFACE)
-               isEvasNativeSetEnabled = _IsEvasGlEnabled();
-#else
-               isEvasNativeSetEnabled = false;
-#endif
-
-#if defined (FGRAPHICS_INTERNAL_USE_DOUBLE_PIXMAP)
-               isDoublePixmapEnabled = isEvasNativeSetEnabled;
-#else
-               isDoublePixmapEnabled = false;
-#endif
-
                if (pVisualElement == null)
                {
                        pVisualElement = pControl->GetVisualElement();
@@ -1086,7 +1127,22 @@ _SglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, EGLNativeWindowType wi
                pSglInfo->pVisualElementSurface = pVisualElementSurface;
                pSglInfoTableManipulatorInstance->UnlockSglInfoTable();
 
-               if (isDoublePixmapEnabled)
+               __evasEngineType = _GetEvasEngineType(pObject);
+
+#if defined (FGRAPHICS_INTERNAL_USE_DOUBLE_PIXMAP)
+               if (__evasEngineType == ENGINE_TYPE_OPENGL_X11)
+               {
+                       __isDoublePixmapEnabled = true;
+               }
+               else
+               {
+                       __isDoublePixmapEnabled = false;
+               }
+#else
+               __isDoublePixmapEnabled = false;
+#endif
+
+               if (__isDoublePixmapEnabled)
                {
                        pObject = evas_object_image_filled_add(pEvas);
                        SysTryReturn(NID_GRP, pObject != null, EGL_NO_SURFACE, E_OPERATION_FAILED, "Invalid object.");
@@ -1610,6 +1666,11 @@ CATCH_01:
 EGLBoolean
 _SglDestroySurface(EGLDisplay dpy, EGLSurface surface)
 {
+       if (__pPreviousMakeCurrent == surface)
+       {
+               __pPreviousMakeCurrent = EGL_NO_SURFACE;
+       }
+
        EGLBoolean ret = EGL_FALSE;
        _SglInfoTableManipulator* pSglInfoTableManipulatorInstance = _SglInfoTableManipulator::GetInstance();
 
@@ -1634,7 +1695,7 @@ _SglDestroySurface(EGLDisplay dpy, EGLSurface surface)
        ret = eglDestroySurface(dpy, pSglInfo->surface);
        pSglInfoTableManipulatorInstance->UnlockSglInfoTable();
 
-       if (isDoublePixmapEnabled && pSglInfo->pSecondSglInfo != null)
+       if (__isDoublePixmapEnabled && pSglInfo->pSecondSglInfo != null)
        {
                eglDestroySurface(dpy, pSglInfo->pSecondSglInfo->surface);
                pSglInfoTableManipulatorInstance->DestroySglIndex(pSglInfo->pSecondSglInfo->sglIndex);
@@ -1817,6 +1878,12 @@ _SglDestroyContext(EGLDisplay dpy, EGLContext ctx)
 EGLBoolean
 _SglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx)
 {
+       if (__pPreviousMakeCurrent == draw)
+       {
+               return EGL_TRUE;
+       }
+       __pPreviousMakeCurrent = draw;
+
        _SglInfoTableManipulator* pSglInfoTableManipulatorInstance = _SglInfoTableManipulator::GetInstance();
 
        _SglIndex sglIndexDraw = (_SglIndex)draw;
@@ -1835,7 +1902,7 @@ _SglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx
                }
                sglInfoReadSurface = sglInfoRead->surface;
 
-               if (isDoublePixmapEnabled && !sglInfoRead->isBackbuffer)
+               if (__isDoublePixmapEnabled && !sglInfoRead->isBackbuffer && sglInfoRead->pSecondSglInfo != null)
                {
                        sglInfoReadSurface = sglInfoRead->pSecondSglInfo->surface;
                }
@@ -1852,7 +1919,7 @@ _SglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx
                return eglMakeCurrent(dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, ctx);
        }
 
-       if (isDoublePixmapEnabled && !pSglInfoDraw->isBackbuffer && pSglInfoDraw->pSecondSglInfo != null)
+       if (__isDoublePixmapEnabled && !pSglInfoDraw->isBackbuffer && pSglInfoDraw->pSecondSglInfo != null)
        {
                pSglInfoDraw = pSglInfoDraw->pSecondSglInfo;
        }
@@ -1950,7 +2017,7 @@ _SglSwapBuffers(EGLDisplay dpy, EGLSurface surface)
 #if defined(FGRAPHICS_INTERNAL_USE_EGLCOPYBUFFER)
                _SglUpdateBufferOSP(dpy, surface);
 #else
-               if (isEvasNativeSetEnabled)
+               if(__evasEngineType == ENGINE_TYPE_OPENGL_X11)
                {
                        if (pSglInfo->glVersion == 1)
                        {
@@ -1967,56 +2034,67 @@ _SglSwapBuffers(EGLDisplay dpy, EGLSurface surface)
                }
 #endif
 
-               if (isDoublePixmapEnabled && pSglInfo->pSecondSglInfo != null)
+               if(__evasEngineType == ENGINE_TYPE_SOFEWARE_X11 || __evasEngineType == ENGINE_TYPE_OPENGL_X11)
                {
-                       if (pSglInfo->swapDone || pSglInfo->pSecondSglInfo->swapDone)
+                       if (__isDoublePixmapEnabled && pSglInfo->pSecondSglInfo != null)
                        {
-                               _SglInfo* pBackSglInfo = null;
-                               _SglInfo* pFrontSglInfo = null;
-
-                               if (pSglInfo->isBackbuffer)
-                               {
-                                       pBackSglInfo = pSglInfo;
-                                       pFrontSglInfo = pSglInfo->pSecondSglInfo;
-                               }
-                               else
+                               if (pSglInfo->swapDone || pSglInfo->pSecondSglInfo->swapDone)
                                {
-                                       pBackSglInfo = pSglInfo->pSecondSglInfo;
-                                       pFrontSglInfo = pSglInfo;
+                                       _SglInfo* pBackSglInfo = null;
+                                       _SglInfo* pFrontSglInfo = null;
+
+                                       if (pSglInfo->isBackbuffer)
+                                       {
+                                               pBackSglInfo = pSglInfo;
+                                               pFrontSglInfo = pSglInfo->pSecondSglInfo;
+                                       }
+                                       else
+                                       {
+                                               pBackSglInfo = pSglInfo->pSecondSglInfo;
+                                               pFrontSglInfo = pSglInfo;
+                                       }
+                                       pBackSglInfo->isBackbuffer = false;
+                                       pFrontSglInfo->isBackbuffer = true;
+
+                                       pFrontSglInfo->wasShown = false;
+                                       pFrontSglInfo->swapDone = false;
+                                       if (pSglInfo->pVisualElement != null)
+                                       {
+                                               pSglInfo->pVisualElement->SetSurface(pFrontSglInfo->pVisualElementSurface);
+                                       }
+                                       evas_object_image_pixels_dirty_set(pFrontSglInfo->pObject, EINA_TRUE);
+                                       evas_object_hide(pBackSglInfo->pObject);
+
+                                       if (pSglInfo->isFirstSwap)
+                                       {
+                                               pBackSglInfo->isFirstSwap = false;
+                                               pFrontSglInfo->isFirstSwap = false;
+
+                                               eglWaitGL();
+                                               BufferInfo bufferInfo;
+                                               pFrontSglInfo->pBitmap->Lock(bufferInfo);
+                                               pFrontSglInfo->pBitmap->Merge(Point(0, 0), *pBackSglInfo->pBitmap, Rectangle(0, 0, bufferInfo.width, bufferInfo.height));
+                                               pFrontSglInfo->pBitmap->Unlock();
+                                       }
                                }
-                               pBackSglInfo->isBackbuffer = false;
-                               pFrontSglInfo->isBackbuffer = true;
-
-                               pFrontSglInfo->wasShown = false;
-                               pFrontSglInfo->swapDone = false;
-                               if (pSglInfo->pVisualElement != null)
-                               {
-                                       pSglInfo->pVisualElement->SetSurface(pFrontSglInfo->pVisualElementSurface);
-                               }
-                               evas_object_image_pixels_dirty_set(pFrontSglInfo->pObject, EINA_TRUE);
-                               evas_object_hide(pBackSglInfo->pObject);
-
-                               if (pSglInfo->isFirstSwap)
+                       }
+                       else
+                       {
+                               if (pSglInfo->pObject != null)
                                {
-                                       pBackSglInfo->isFirstSwap = false;
-                                       pFrontSglInfo->isFirstSwap = false;
-
-                                       eglWaitGL();
-                                       BufferInfo bufferInfo;
-                                       pFrontSglInfo->pBitmap->Lock(bufferInfo);
-                                       pFrontSglInfo->pBitmap->Merge(Point(0, 0), *pBackSglInfo->pBitmap, Rectangle(0, 0, bufferInfo.width, bufferInfo.height));
-                                       pFrontSglInfo->pBitmap->Unlock();
+                                       evas_object_image_pixels_dirty_set(pSglInfo->pObject, EINA_TRUE);
                                }
                        }
                }
                else
                {
-                       if (pSglInfo->pObject != null)
+                       if (pSglInfo->pVisualElement != null)
                        {
-                               evas_object_image_pixels_dirty_set(pSglInfo->pObject, EINA_TRUE);
+                               pSglInfo->pVisualElement->SetFlushNeeded();
                        }
                }
 
+
                pSglInfoTableManipulatorInstance->UnlockSglInfoTable();
                return EGL_TRUE;
        }
index 39ecbc0..cc9faa9 100644 (file)
@@ -1124,6 +1124,42 @@ TextObject::GetTextExtentF(int startTextIndex, int textLength) const
        return textSize;
 }
 
+Dimension
+TextObject::GetTextExtent(void) const
+{
+       return _CoordinateSystemUtils::ConvertToInteger(GetTextExtentF());
+}
+
+FloatDimension
+TextObject::GetTextExtentF(void) const
+{
+       IF_NOT_CONSTRUCTED(return FloatDimension(-1, -1));
+
+       TextLine* pTextLine = null;
+       FloatDimension textSize(0.0f, 0.0f);
+       FloatDimension lineSize(0.0f, 0.0f);
+       int lineCount = GetTotalLineCount();
+
+       for (int i = 0; i < lineCount; i++)
+       {
+               pTextLine = __pTextColumn->GetTextLine(i);
+               SysTryReturn(NID_GRP, pTextLine, FloatDimension(-1, -1), E_SYSTEM, "[E_SYSTEM] Fail to get text line.");
+
+               pTextLine->GetRegion(0, pTextLine->GetTextLength(), lineSize.width, lineSize.height);
+
+               if (textSize.width < lineSize.width)
+               {
+                       textSize.width = lineSize.width;
+               }
+       }
+
+       textSize.height = GetTotalHeightF();
+
+       SetLastResult(E_SUCCESS);
+
+       return textSize;
+}
+
 result
 TextObject::AppendElement(TextElement& textElement)
 {
index 5c92052..de84ccb 100644 (file)
@@ -1080,7 +1080,7 @@ TextSimple::GetWordWrapLengthEx(const wchar_t* pText, int textLength, int& actua
 
                return TEXT_RETBY_LINEFEED;
        }
-       else if (IsChinese(pText))
+       else if (IsChinese(pText) || IsJapanese(pText))
        {
                return TEXT_RETBY_NORMAL;
        }
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 bcb0b95..ce76c48 100644 (file)
@@ -54,7 +54,7 @@ namespace
 {
 const int _CLIPBOARD_ITEM_MAX = 12;
 const int _CBHM_ITEM_MAX = 12;
-const String _CLIPBOARD_DEFAULT_PATH = L"/tmp/clipboard_";
+const String _CLIPBOARD_DEFAULT_PATH = L"/tmp/clipboard/clipboard_";
 const String _CLIPBOARD_DEFAULT_EXTENSION = L".png";
 } // Anonymous
 
@@ -968,8 +968,8 @@ _Clipboard::LoadBitmapN(const String& path)
 
        bool hasAlpha = _ImageUtil::HasAlphaChannel(*pStr);
 
-       r = GetLastResult();
-       SysTryReturn(NID_UI, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
+//     r = GetLastResult();
+//     SysTryReturn(NID_UI, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
 
        BitmapPixelFormat bmpPixelFormat = BITMAP_PIXEL_FORMAT_RGB565;
        MediaPixelFormat mediaPixelFormat = MEDIA_PIXEL_FORMAT_RGB565LE;
index 9e9e7f5..50b9501 100644 (file)
@@ -420,9 +420,9 @@ public:
                return clientBounds;
        }
 
-       FloatDimension GetItemContentSize(void) const
+       FloatDimension GetItemContentSize(bool horizontalMode, bool verticalMode) const
        {
-               return __pControl->GetControlDelegate().GetContentSizeF();
+               return __pControl->GetControlDelegate().GetContentSizeF(horizontalMode, verticalMode);
        }
 
        FloatDimension GetItemMinimumSize(void) const
@@ -640,6 +640,54 @@ _Control::OnTouchCanceled(const _Control& source, const _TouchInfo& touchinfo)
        return false;
 }
 
+_UiTouchEventDelivery
+_Control::OnPreviewMousePressed(const _Control& source, const _MouseInfo& mouseinfo)
+{
+       return _UI_TOUCH_EVENT_DELIVERY_YES;
+}
+
+_UiTouchEventDelivery
+_Control::OnPreviewMouseReleased(const _Control& source, const _MouseInfo& mouseinfo)
+{
+       return _UI_TOUCH_EVENT_DELIVERY_YES;
+}
+
+_UiTouchEventDelivery
+_Control::OnPreviewMouseMoved(const _Control& source, const _MouseInfo& mouseinfo)
+{
+       return _UI_TOUCH_EVENT_DELIVERY_YES;
+}
+
+_UiTouchEventDelivery
+_Control::OnPreviewMouseWheeled(const _Control& source, const _MouseInfo& mouseinfo)
+{
+       return _UI_TOUCH_EVENT_DELIVERY_YES;
+}
+
+bool
+_Control::OnMousePressed(const _Control& source, const _MouseInfo& mouseinfo)
+{
+       return false;
+}
+
+bool
+_Control::OnMouseReleased(const _Control& source, const _MouseInfo& mouseinfo)
+{
+       return false;
+}
+
+bool
+_Control::OnMouseMoved(const _Control& source, const _MouseInfo& mouseinfo)
+{
+       return false;
+}
+
+bool
+_Control::OnMouseWheeled(const _Control& source, const _MouseInfo& mouseinfo)
+{
+       return false;
+}
+
 bool
 _Control::OnFocusGained(const _Control& source)
 {
@@ -690,7 +738,7 @@ _Control::GetContentSize(void) const
 }
 
 FloatDimension
-_Control::GetContentSizeF(void) const
+_Control::GetContentSizeF(bool horizontalMode, bool verticalMode) const
 {
        ClearLastResult();
        return FloatDimension(0.0f, 0.0f);
@@ -925,6 +973,7 @@ _Control::OnTouchMoveHandled(const _Control& control)
 void
 _Control::OnFontChanged(Tizen::Graphics::Font* pFont)
 {
+       SetUpdateLayoutState(true);
 }
 
 void
@@ -2526,12 +2575,6 @@ _Control::SetFocused(bool on)
                                IsFocusable(), E_INVALID_OPERATION,
                                E_INVALID_OPERATION, "[E_INVALID_OPERATION] This Control isn't focusable control.");
 
-       bool isVisible = IsVisible();
-       if (isVisible == false)
-       {
-               return E_SUCCESS;
-       }
-
        if (on)
        {
                _Window* pTop = GetRootWindow();
index cc7f28c..7aa6b7e 100644 (file)
@@ -1620,6 +1620,133 @@ public:
                return _UI_TOUCH_EVENT_DELIVERY_YES;
        }
 
+       virtual bool OnMousePressed(const _Control& source, const _MouseInfo& mouseInfo)
+       {
+               SysLog(NID_UI, "Minkyu OnMousePressed, source = 0x%x", &source);
+               bool isFiltered = false;
+
+               // 3. Impl
+               isFiltered = __impl.OnMousePressed(__impl, mouseInfo);
+               if (isFiltered)
+               {
+                       return true;
+               }
+
+               // 4. Core
+               isFiltered = __core.OnMousePressed(source, mouseInfo);
+
+               return isFiltered;
+       }
+
+       virtual bool OnMouseReleased(const _Control& source, const _MouseInfo& mouseInfo)
+       {
+               SysLog(NID_UI, "Minkyu OnMouseReleased, source = 0x%x", &source);
+               bool isFiltered = false;
+
+               // 3. Impl
+               isFiltered = __impl.OnMouseReleased(__impl, mouseInfo);
+               if (isFiltered)
+               {
+                       return true;
+               }
+
+               // 4. Core
+               isFiltered = __core.OnMouseReleased(source, mouseInfo);
+
+               return isFiltered;
+       }
+
+       virtual bool OnMouseMoved(const _Control& source, const _MouseInfo& mouseInfo)
+       {
+               return false;
+       }
+
+       virtual bool OnMouseWheeled(const _Control& source, const _MouseInfo& mouseInfo)
+       {
+               SysLog(NID_UI, "OnWheelMoved, source = 0x%x", &source);
+               bool isFiltered = false;
+
+               // 3. Impl
+               isFiltered = __impl.OnMouseWheeled(__impl, mouseInfo);
+               if (isFiltered)
+               {
+                       return true;
+               }
+
+               // 4. Core
+               isFiltered = __core.OnMouseWheeled(source, mouseInfo);
+
+               return isFiltered;
+       }
+
+       virtual _UiTouchEventDelivery OnPreviewMousePressed(const _Control& source, const _MouseInfo& mouseInfo)
+       {
+               _UiTouchEventDelivery isFiltered = _UI_TOUCH_EVENT_DELIVERY_NO;
+
+               // 3. Impl
+               isFiltered = __impl.OnPreviewMousePressed(__impl, mouseInfo);
+               if (isFiltered == _UI_TOUCH_EVENT_DELIVERY_NO)
+               {
+                       return _UI_TOUCH_EVENT_DELIVERY_NO;
+               }
+
+               // 4. Core
+               isFiltered = __core.OnPreviewMousePressed(source, mouseInfo);
+
+               return isFiltered;
+       }
+
+       virtual _UiTouchEventDelivery OnPreviewMouseReleased(const _Control& source, const _MouseInfo& mouseInfo)
+       {
+               _UiTouchEventDelivery isFiltered = _UI_TOUCH_EVENT_DELIVERY_NO;
+
+               // 3. Impl
+               isFiltered = __impl.OnPreviewMouseReleased(__impl, mouseInfo);
+               if (isFiltered == _UI_TOUCH_EVENT_DELIVERY_NO)
+               {
+                       return _UI_TOUCH_EVENT_DELIVERY_NO;
+               }
+
+               // 4. Core
+               isFiltered = __core.OnPreviewMouseReleased(source, mouseInfo);
+
+               return isFiltered;
+       }
+
+       virtual _UiTouchEventDelivery OnPreviewMouseMoved(const _Control& source, const _MouseInfo& mouseInfo)
+       {
+               _UiTouchEventDelivery isFiltered = _UI_TOUCH_EVENT_DELIVERY_NO;
+
+               // 3. Impl
+               isFiltered = __impl.OnPreviewMouseMoved(__impl, mouseInfo);
+               if (isFiltered == _UI_TOUCH_EVENT_DELIVERY_NO)
+               {
+                       return _UI_TOUCH_EVENT_DELIVERY_NO;
+               }
+
+               // 4. Core
+               isFiltered = __core.OnPreviewMouseMoved(source, mouseInfo);
+
+               return isFiltered;
+       }
+
+       virtual _UiTouchEventDelivery OnPreviewMouseWheeled(const _Control& source, const _MouseInfo& mouseInfo)
+       {
+               _UiTouchEventDelivery isFiltered = _UI_TOUCH_EVENT_DELIVERY_NO;
+
+               // 3. Impl
+               isFiltered = __impl.OnPreviewMouseWheeled(__impl, mouseInfo);
+               if (isFiltered == _UI_TOUCH_EVENT_DELIVERY_NO)
+               {
+                       return _UI_TOUCH_EVENT_DELIVERY_NO;
+               }
+
+               // 4. Core
+               isFiltered = __core.OnPreviewMouseWheeled(source, mouseInfo);
+
+               return isFiltered;
+       }
+
        virtual void OnTouchPressHandled(const _Control& source)
        {
                __impl.OnTouchPressHandled(source);
@@ -1682,6 +1809,44 @@ public:
                }
        }
 
+       virtual bool TranslateKeyEventInfo(const _Control& source, _KeyInfo& keyInfo)
+       {
+               SysTryReturn(NID_UI, __impl.__pCoreKeyEvent, false, E_SYSTEM, "[E_SYSTEM] System error occurred.");
+
+               bool isFiltered = false;
+
+               if (__impl.__pPublicPropagatedKeyEventListener != null)
+               {
+                       _ControlImpl* pControlImpl = static_cast<_ControlImpl*>(source.GetUserData());
+                       SysTryReturn(NID_UI, pControlImpl, false, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] pControlImpl == null.");
+
+                       Control& control = static_cast<Control&>(pControlImpl->GetPublic());
+
+                       KeyEventInfo* pKeyEventInfo = new (std::nothrow) KeyEventInfo(static_cast<KeyCode>(keyInfo.GetKeyCode()),
+                               static_cast<KeyModifier>(keyInfo.GetKeyModifier()));
+
+                       isFiltered = __impl.__pPublicPropagatedKeyEventListener->TranslateKeyEventInfo(control, *pKeyEventInfo);
+                       if (isFiltered)
+                       {
+                               keyInfo.SetKeyCode(static_cast<_KeyCode>(pKeyEventInfo->GetKeyCode()));
+                               keyInfo.SetKeyModifier(static_cast<_KeyModifier>(pKeyEventInfo->GetKeyModifier()));
+                               return true;
+                       }
+               }
+
+               // 3. Impl
+               isFiltered = __impl.TranslateKeyEventInfo(__impl, keyInfo);
+               if (isFiltered)
+               {
+                       return true;
+               }
+
+               // 4. Core
+               isFiltered = __core.TranslateKeyEventInfo(source, keyInfo);
+
+               return isFiltered;
+       }
+
        virtual bool OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo)
        {
                SysTryReturn(NID_UI, __impl.__pCoreKeyEvent, false, E_SYSTEM, "[E_SYSTEM] System error occurred.");
@@ -2178,9 +2343,9 @@ _ControlImpl::GetContentSize(void) const
 }
 
 FloatDimension
-_ControlImpl::GetContentSizeF(void) const
+_ControlImpl::GetContentSizeF(bool horizontalMode, bool verticalMode) const
 {
-       return GetCore().GetContentSizeF();
+       return GetCore().GetContentSizeF(horizontalMode, verticalMode);
 }
 
 HitTestResult
@@ -2712,6 +2877,12 @@ _ControlImpl::OnTouchCancelHandled(const _Control& control)
 }
 
 bool
+_ControlImpl::TranslateKeyEventInfo(const _ControlImpl& source, _KeyInfo& keyInfo)
+{
+       return false;
+}
+
+bool
 _ControlImpl::OnKeyPressed(const _ControlImpl& source, const _KeyInfo& keyInfo)
 {
        return false;
@@ -3006,6 +3177,54 @@ _ControlImpl::OnPreviewTouchCanceled(const _ControlImpl& source, const _TouchInf
 }
 
 bool
+_ControlImpl::OnMousePressed(const _ControlImpl& source, const _MouseInfo& mouseinfo)
+{
+       return false;
+}
+
+bool
+_ControlImpl::OnMouseReleased(const _ControlImpl& source, const _MouseInfo& mouseinfo)
+{
+       return false;
+}
+
+bool
+_ControlImpl::OnMouseMoved(const _ControlImpl& source, const _MouseInfo& mouseinfo)
+{
+       return false;
+}
+
+bool
+_ControlImpl::OnMouseWheeled(const _ControlImpl& source, const _MouseInfo& mouseinfo)
+{
+       return false;
+}
+
+_UiTouchEventDelivery
+_ControlImpl::OnPreviewMousePressed(const _ControlImpl& source, const _MouseInfo& mouseinfo)
+{
+       return _UI_TOUCH_EVENT_DELIVERY_YES;
+}
+
+_UiTouchEventDelivery
+_ControlImpl::OnPreviewMouseReleased(const _ControlImpl& source, const _MouseInfo& mouseinfo)
+{
+       return _UI_TOUCH_EVENT_DELIVERY_YES;
+}
+
+_UiTouchEventDelivery
+_ControlImpl::OnPreviewMouseMoved(const _ControlImpl& source, const _MouseInfo& mouseinfo)
+{
+       return _UI_TOUCH_EVENT_DELIVERY_YES;
+}
+
+_UiTouchEventDelivery
+_ControlImpl::OnPreviewMouseWheeled(const _ControlImpl& source, const _MouseInfo& mouseinfo)
+{
+       return _UI_TOUCH_EVENT_DELIVERY_YES;
+}
+
+bool
 _ControlImpl::OnFocusGained(const _ControlImpl& source)
 {
        return false;
index 4be2227..1c899ba 100644 (file)
@@ -1296,9 +1296,11 @@ _ControlManager::GetTopmostTouchedControl(const Point& point)
                        }
                }
 
-
+               if (pControl != null)
+               {
                return pControl;
        }
+       }
 
        int count = GetWindowCount();
        if (count != 0)
index a25a354..7b17204 100644 (file)
@@ -59,9 +59,10 @@ namespace
 {
 #define __UNUSED__
 
-bool isPressed = false;
 Ecore_X_Atom keyboardExist = 0;
 const wchar_t* KEYBOARD_INSERTED_EVENT = L"KEYBOARD_INSERTED";
+const int DEVICE_COUNT = 999;
+bool touchPressed[DEVICE_COUNT] = {false,};
 
 Evas_Object*
 GetEvasObject(const _Control& control)
@@ -642,6 +643,7 @@ private:
                if (pTarget == null)
                {
                        _TouchManager* pTouchManager = _TouchManager::GetInstance();
+                       pTouchManager->SetTouchCanceled(null);
                        pTouchManager->ResetTouchInfo();
 
                        SysLog(NID_UI, "ResetTouchInfo");
@@ -827,6 +829,328 @@ private:
        _TouchEventManager* __pTouchEventManager;
 }; // _TouchEvent
 
+class _MouseEvent
+       : public _Event
+{
+public:
+       _MouseEvent(int deviceId, _TouchStatus status, int x, int y, int z, unsigned int buttons, unsigned int timeStamp, const _Control* pRootControl)
+               : __pTouchEventManager(null)
+       {
+               __pTouchEventManager = _TouchEventManager::GetInstance();
+               SysTryReturnVoidResult(NID_UI, __pTouchEventManager, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+
+               result r = E_SUCCESS;
+               Tizen::Graphics::Point current(x, y);
+
+               _TouchManager* pTouchManager = _TouchManager::GetInstance();
+               SysTryReturnVoidResult(NID_UI, pTouchManager, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+
+               unsigned int pointId = 0;
+
+               if (status == _TOUCH_PRESSED)
+               {
+                       IListT<_FingerInfo*>* pFingerInfoList = pTouchManager->GetMultiFingerInfoListN();
+                       SysTryReturnVoidResult(NID_UI, pFingerInfoList, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+
+                       const int count = pFingerInfoList->GetCount();
+
+                       for (int i = 0; i < count; i++)
+                       {
+                               _FingerInfo* pFingerInfo = null;
+                               pFingerInfoList->GetAt(i, pFingerInfo);
+                               if (pFingerInfo == null)
+                               {
+                                       continue;
+                               }
+
+                               if (static_cast<int>(pFingerInfo->GetDeviceId()) == deviceId && pFingerInfo->GetStatus() == _TOUCH_PRESSED)
+                               {
+                                       pTouchManager->ResetTouchInfo();
+                                       SysSecureLog(NID_UI, "ResetTouchInfo x(%d), y(%d), deviceID(%d), pointID(%d)", current.x, current.y, deviceId, pFingerInfo->GetPointId());
+                                       break;
+                               }
+                       }
+                       delete pFingerInfoList;
+
+                       pointId = pTouchManager->GeneratePointId(deviceId);
+               }
+               else
+               {
+                       pointId = pTouchManager->GetPointId(deviceId);
+               }
+
+               if (pointId == INVALID_POINT_ID)
+               {
+                       if (status == _TOUCH_RELEASED)
+                       {
+                               _ControlManager* pControlManager = _ControlManager::GetInstance();
+                               SysTryReturnVoidResult(NID_UI, pControlManager, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+
+                               _Window* pWindow = pControlManager->GetTouchedWindow();
+                               if (pWindow == null)
+                               {
+                                       _TouchManager* pTouchManager = _TouchManager::GetInstance();
+                                       if (pTouchManager)
+                                       {
+                                               pTouchManager->ResetTouchInfo();
+                                               SysLog(NID_UI, "pWindow is null, ResetTouchInfo");
+                                       }
+                               }
+                       }
+                       SetLastResult(E_INVALID_CONDITION);
+                       return;
+               }
+
+               if (!pRootControl)
+               {
+                       r = GetPosition(status, x, y, current);
+                       SysTryReturnVoidResult(NID_UI, r != E_OBJ_NOT_FOUND, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] A system error occurred.");
+                       SysTryReturnVoidResult(NID_UI, r == E_SUCCESS, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+               }
+               else
+               {
+                       current = _CoordinateSystemUtils::InverseTransform(current);
+               }
+
+               __mouseInfo.SetTouchInfo(pointId, status, current, z, buttons, false, timeStamp);
+
+               if (status == _TOUCH_PRESSED)
+               {
+                       _Control* pControl = GetTarget(current.x, current.y, pRootControl);
+
+                       if (pControl == null)
+                       {
+                               pTouchManager->ResetTouchInfo();
+                               SysSecureLog(NID_UI, "ResetTouchInfo x(%d), y(%d), deviceID(%d), pointID(%d)", current.x, current.y, deviceId, pointId);
+                               SysTryReturnVoidResult(NID_UI, false, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+                       }
+                       else
+                       {
+                               r = __pTouchEventManager->AddControl(pointId, pControl->GetHandle());
+                               SysTryReturnVoidResult(NID_UI, r == E_SUCCESS, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+
+                               _Control* pParent = pControl->GetParent();
+                               if (pParent)
+                               {
+                                       r = __pTouchEventManager->AddParentControl(pointId, pParent->GetHandle());
+                                       SysTryReturnVoidResult(NID_UI, r == E_SUCCESS, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+                               }
+                       }
+               }
+               else
+               {
+                       _Control* pControl = pTouchManager->GetChangedTouchableTarget();
+                       if (pControl == null)
+                       {
+                               ClearLastResult();
+                       }
+                       else
+                       {
+                               if (pControl->GetChangingEventTarget() == true && pControl->GetVisibleState() == true)
+                               {
+                                       r = __pTouchEventManager->AddControl(pointId, pControl->GetHandle());
+                                       SysTryReturnVoidResult(NID_UI, r == E_SUCCESS, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+                               }
+                       }
+               }
+       }
+
+       virtual ~_MouseEvent(void)
+       {
+       }
+
+private:
+       virtual result SendImpl(void)
+       {
+               _Control* pTarget = __pTouchEventManager->GetControl(__mouseInfo.GetPointId());
+               if (pTarget == null)
+               {
+                       _TouchManager* pTouchManager = _TouchManager::GetInstance();
+                       pTouchManager->ResetTouchInfo();
+
+                       SysLog(NID_UI, "ResetTouchInfo");
+                       return E_SUCCESS;
+               }
+
+               _UiMouseEvent event(pTarget->GetHandle(), __mouseInfo);
+
+               return _pEventManager->SendEvent(event);
+       }
+
+private:
+       _MouseEvent(const _MouseEvent& rhs);
+       _MouseEvent& operator =(const _MouseEvent& rhs);
+
+       _Control* GetTarget(int x, int y, const _Control* pRootControl) const
+       {
+               ClearLastResult();
+
+               _TouchManager* pTouchManager = _TouchManager::GetInstance();
+               SysTryReturn(NID_UI, pTouchManager, null, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+
+               _Control* pCapturedControl = pTouchManager->GetCapturedControl();
+               _Control* pControl = null;
+
+               if (pCapturedControl)
+               {
+                       if (pTouchManager->IsCaptureAllowedOwnerBounds())
+                       {
+                               if (pTouchManager->IsCaptureAllowedOutOfBounds())
+                               {
+                                       pControl = pCapturedControl;
+                               }
+
+                               _Window * pWindow = dynamic_cast<_Window*>(pCapturedControl);
+                               if (pWindow)
+                               {
+                                       _Control* pOwner = pWindow->GetOwner();
+                                       if (pOwner)
+                                       {
+                                               Tizen::Graphics::Rectangle ownerRc(pOwner->GetAbsoluteBounds());
+                                               if ((x >= ownerRc.x) && (x <= (ownerRc.x + ownerRc.width)) && (y >= ownerRc.y) && (y <= (ownerRc.y + ownerRc.height)))
+                                               {
+                                                       pControl = pOwner;
+                                               }
+                                       }
+                               }
+
+                               Tizen::Graphics::Rectangle rc(pCapturedControl->GetAbsoluteBounds());
+                               if ((x >= rc.x) && (x <= (rc.x + rc.width)) && (y >= rc.y) && (y <= (rc.y + rc.height)))
+                               {
+                                       pControl = pCapturedControl;
+                               }
+                       }
+                       else
+                       {
+                               if (pTouchManager->IsCaptureAllowedOutOfBounds())
+                               {
+                                       pControl = pCapturedControl;
+                               }
+                               else
+                               {
+                                       Tizen::Graphics::Rectangle rc(pCapturedControl->GetAbsoluteBounds());
+
+                                       if ((x < rc.x) || (x > (rc.x + rc.width)) || (y < rc.y) || (y > (rc.y + rc.height)))
+                                       {
+                                               pControl = pCapturedControl;
+                                       }
+                               }
+                       }
+
+                       if (pControl != null)
+                       {
+                               return pControl;
+                       }
+               }
+
+               _ControlManager* pControlManager = _ControlManager::GetInstance();
+               SysTryReturn(NID_UI, pControlManager, null, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+
+               Tizen::Graphics::FloatPoint ptf(static_cast<float>(x), static_cast<float>(y));
+
+               _ControlVisualElement* pRootControlElement = null;
+               if (pRootControl)
+               {
+                       pRootControlElement = dynamic_cast<_ControlVisualElement*>(pRootControl->GetVisualElement());
+               }
+               else
+               {
+                       _Window* pWindow = null;
+                       pWindow = pControlManager->GetTouchedWindow();
+                       SysTryReturn(NID_UI, pWindow, null, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+
+                       Rectangle winBounds = pWindow->GetBounds();
+
+                       ptf.x = static_cast<float>(x - winBounds.x);
+                       ptf.y = static_cast<float>(y - winBounds.y);
+
+                       pRootControlElement = dynamic_cast <_ControlVisualElement*>(pWindow->GetVisualElement());
+               }
+
+               SysTryReturn(NID_UI, pRootControlElement, null, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+
+               _ControlVisualElement* pControlVisualElement = pRootControlElement->GetControlChildAtPoint(ptf);
+               SysTryReturn(NID_UI, pControlVisualElement, null, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+
+               pControl = static_cast <_Control*>(pControlVisualElement->GetUserData());
+               SysTryReturn(NID_UI, pControl, null, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+
+               return pControl;
+       }
+
+       result GetPosition(_TouchStatus status, int x, int y, Point& point) const
+       {
+               result r = E_SUCCESS;
+
+               _ControlManager* pControlManager = _ControlManager::GetInstance();
+               SysTryReturn(NID_UI, pControlManager, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+
+               _Window* pWindow = pControlManager->GetTouchedWindow();
+               if (pWindow == null)
+               {
+                       _TouchManager* pTouchManager = _TouchManager::GetInstance();
+                       if (pTouchManager)
+                       {
+                               pTouchManager->ResetTouchInfo();
+                               SysLog(NID_UI, "pWindow is null, ResetTouchInfo");
+                       }
+               }
+               SysTryReturn(NID_UI, pWindow, E_OBJ_NOT_FOUND, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] A system error occurred.");
+
+               _RootVisualElement* pRootVE = pWindow->GetRootVisualElement();
+               SysTryReturn(NID_UI, pRootVE, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+
+               _EflLayer* pLayer = static_cast<_EflLayer*>(pRootVE->GetNativeLayer());
+               SysTryReturn(NID_UI, pLayer, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+
+               Ecore_Evas* pEE = pLayer->GetEcoreEvas();
+               SysTryReturn(NID_UI, pEE, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+
+               const int PORTRAIT = 0;
+               const int LANDSCAPE = 270;
+               const int PORTRAIT_REVERSE = 180;
+               const int LANDSCAPE_REVERSE = 90;
+
+               Dimension dimension = pControlManager->GetScreenSize();
+               Point output(_CoordinateSystemUtils::InverseTransform(point));
+               int rotation = ecore_evas_rotation_get(pEE);
+
+               switch (rotation)
+               {
+               case PORTRAIT:
+                       point.x = output.x;
+                       point.y = output.y;
+                       break;
+
+               case LANDSCAPE:
+                       point.x = output.y;
+                       point.y = dimension.width - output.x;
+                       break;
+
+               case PORTRAIT_REVERSE:
+                       point.x = dimension.width - output.x;
+                       point.y = dimension.height - output.y;
+                       break;
+
+               case LANDSCAPE_REVERSE:
+                       point.x = dimension.height - output.y;
+                       point.y = output.x;
+                       break;
+
+               default:
+                       SysAssertf(0, "[E_SYSTEM][%d]", rotation);
+                       r = E_SYSTEM;
+                       break;
+               }
+
+               return r;
+       }
+
+private:
+       _MouseInfo __mouseInfo;
+       _TouchEventManager* __pTouchEventManager;
+};
+
 Eina_Bool
 OnNotified(void* pData __UNUSED__, int type __UNUSED__, void* pEventInfo)
 {
@@ -928,14 +1252,35 @@ OnTouchPressed(void* pData __UNUSED__, int type __UNUSED__, void* pEventInfo)
        Ecore_Event_Mouse_Button* pEv = static_cast <Ecore_Event_Mouse_Button*>(pEventInfo);
        SysTryReturn(NID_UI, pEv, ECORE_CALLBACK_PASS_ON, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
 
+       SysSecureLog(NID_UI, "OnTouchPressed - x(%d), y(%d), deviceId(%d), buttons(%d)", pEv->root.x, pEv->root.y, pEv->multi.device, pEv->buttons);
+
        _ControlManager* pControlManager = _ControlManager::GetInstance();
        SysTryReturn(NID_UI, pControlManager, ECORE_CALLBACK_PASS_ON, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
 
        pControlManager->SetTouchedWindow((unsigned int)pEv->window);
 
-       isPressed = true;
+       if (touchPressed[pEv->multi.device] == true)
+       {
+               _TouchManager* pTouchManager = _TouchManager::GetInstance();
+               if (pTouchManager)
+               {
+                       pTouchManager->SetTouchCanceled(null);
+                       SysLog(NID_UI, "pWindow is null, CancelTouch");
 
-       SysSecureLog(NID_UI, "OnTouchPressed - x(%d), y(%d), deviceId(%d)", pEv->root.x, pEv->root.y, pEv->multi.device);
+                       for(int i=0; i<DEVICE_COUNT; i++)
+                       {
+                               touchPressed[pEv->multi.device] = false;
+                       }
+
+                       pTouchManager->ResetTouchInfo();
+                       SysLog(NID_UI, "pWindow is null, ResetTouchInfo");
+               }
+       }
+
+       touchPressed[pEv->multi.device] = true;
+
+       if (pEv->buttons == _MOUSE_BUTTON_LEFT || pEv->buttons == _MOUSE_BUTTON_NONE)
+       {
        _TouchEvent event(pEv->multi.device, _TOUCH_PRESSED, pEv->root.x, pEv->root.y, pEv->timestamp, null);
 
        result r = GetLastResult();
@@ -946,6 +1291,21 @@ OnTouchPressed(void* pData __UNUSED__, int type __UNUSED__, void* pEventInfo)
        }
 
        event.Send();
+       }
+       else
+       {
+               //_MouseEvent event(pEv->multi.device, _TOUCH_PRESSED, pEv->root.x, pEv->root.y, 0, pEv->buttons, pEv->timestamp, null);
+               _MouseEvent event(pEv->multi.device, _TOUCH_PRESSED, pEv->root.x, pEv->root.y, 0, _MOUSE_BUTTON_RIGHT, pEv->timestamp, null);
+
+       result r = GetLastResult();
+       if (r != E_SUCCESS)
+       {
+               SysLog(NID_UI, "[%s] Propagating.", GetErrorMessage(r));
+               return ECORE_CALLBACK_PASS_ON;
+       }
+
+       event.Send();
+       }
 
        SetLastResult(E_SUCCESS);
 
@@ -958,12 +1318,15 @@ OnTouchReleased(void* pData __UNUSED__, int type __UNUSED__, void* pEventInfo)
        Ecore_Event_Mouse_Button* pEv = static_cast <Ecore_Event_Mouse_Button*>(pEventInfo);
        SysTryReturn(NID_UI, pEv, ECORE_CALLBACK_PASS_ON, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
 
-       isPressed = false;
+       SysSecureLog(NID_UI, "OnTouchReleased - x(%d), y(%d), deviceId(%d) buttons(%d)", pEv->root.x, pEv->root.y, pEv->multi.device, pEv->buttons);
 
        _TouchManager* pTouchManager = _TouchManager::GetInstance();
        SysTryReturn(NID_UI, pTouchManager, ECORE_CALLBACK_PASS_ON, E_SYSTEM, "[E_SYSTEM] _TouchManager does not exist.");
 
-       SysSecureLog(NID_UI, "OnTouchReleased - x(%d), y(%d), deviceId(%d)", pEv->root.x, pEv->root.y, pEv->multi.device);
+       touchPressed[pEv->multi.device] = false;
+
+       if (pEv->buttons == _MOUSE_BUTTON_LEFT || pEv->buttons == _MOUSE_BUTTON_NONE)
+       {
        _TouchEvent event(pEv->multi.device, _TOUCH_RELEASED, pEv->root.x, pEv->root.y, pEv->timestamp, null);
 
        result r = GetLastResult();
@@ -974,6 +1337,29 @@ OnTouchReleased(void* pData __UNUSED__, int type __UNUSED__, void* pEventInfo)
        }
 
        event.Send();
+       }
+       else
+       {
+               //_MouseEvent event(pEv->multi.device, _TOUCH_RELEASED, pEv->root.x, pEv->root.y, 0, pEv->buttons, pEv->timestamp, null);
+               _MouseEvent event(pEv->multi.device, _TOUCH_RELEASED, pEv->root.x, pEv->root.y, 0, _MOUSE_BUTTON_RIGHT, pEv->timestamp, null);
+
+
+               result r = GetLastResult();
+               if (r!= E_SUCCESS)
+               {
+                       SysLog(NID_UI, "[%s] Propagating.", GetErrorMessage(r));
+                       return ECORE_CALLBACK_PASS_ON;
+               }
+
+               event.Send();
+
+               _TouchManager* pTouchManager = _TouchManager::GetInstance();
+               if (pTouchManager)
+               {
+                       pTouchManager->ResetTouchInfo();
+                       SysLog(NID_UI, "ResetTouchInfo");
+               }
+       }
 
        IListT<_FingerInfo*>* pFingerInfoList = pTouchManager->GetMultiFingerInfoListN();
        SysTryReturn(NID_UI, pFingerInfoList, ECORE_CALLBACK_PASS_ON, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
@@ -1026,6 +1412,28 @@ OnTouchMoved(void* pData __UNUSED__, int type __UNUSED__, void* pEventInfo)
 }
 
 Eina_Bool
+OnMouseWheeled(void* pData __UNUSED__, int type __UNUSED__, void* pEventInfo)
+{
+       _Ecore_Event_Mouse_Wheel* pEv = static_cast <_Ecore_Event_Mouse_Wheel*>(pEventInfo);
+       SysTryReturn(NID_UI, pEv, ECORE_CALLBACK_PASS_ON, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
+
+       SysSecureLog(NID_UI, "OnMouseWheeled - x(%d), y(%d), z(%d)", pEv->root.x, pEv->root.y, pEv->z);
+       _MouseEvent event(0, _WHEEL_MOVED, pEv->root.x, pEv->root.y, pEv->z, _MOUSE_BUTTON_NONE, pEv->timestamp, null);
+
+       result r = GetLastResult();
+       if (r != E_SUCCESS)
+       {
+               return ECORE_CALLBACK_PASS_ON;
+       }
+
+       event.Send();
+
+       SetLastResult(E_SUCCESS);
+
+       return ECORE_CALLBACK_PASS_ON;
+}
+
+Eina_Bool
 OnKeyboardInserted(void* pData __UNUSED__, int type __UNUSED__, void* pEventInfo)
 {
        Ecore_X_Event_Window_Property *pEv = static_cast <Ecore_X_Event_Window_Property*>(pEventInfo);
index ed7823c..6ad9c56 100644 (file)
@@ -39,6 +39,7 @@
 #include "FUi_ControlManager.h"
 #include "FUi_UiNotificationEvent.h"
 #include "FUi_UiEventManager.h"
+#include "FUi_TouchManager.h"
 
 using namespace std;
 using namespace Tizen::Base;
@@ -447,6 +448,15 @@ _OrientationAgent::UpdateOrientation(void)
 
        pEcoreEvas->RotateWindow(*pRootWindow, rotation);
 
+       if (__statusChanged == true)
+       {
+               _TouchManager* pTouchManager = _TouchManager::GetInstance();
+               if (pTouchManager)
+               {
+                       pTouchManager->SetTouchCanceled(null);
+               }
+       }
+
        pImpl->Invalidate(true);
 
        Rectangle bounds = pRootWindow->GetBounds();
index df02b15..b8b9f30 100644 (file)
@@ -311,12 +311,12 @@ _SystemUtilImpl::SendKeyStopMessage(void)
 {
        bool r = false;
        int num;
-       Ecore_X_Window *_keygrab_win = NULL;
+       Ecore_X_Window *_keygrab_win = null;
        char msg_data[] = "PxXF86Stop";
 
        Ecore_X_Atom type = ecore_x_atom_get("_HWKEY_EMULATION");
 
-       int ret = ecore_x_window_prop_property_get(NULL, type, ECORE_X_ATOM_WINDOW, 32, (unsigned char **)&_keygrab_win, &num);
+       int ret = ecore_x_window_prop_property_get(null, type, ECORE_X_ATOM_WINDOW, 32, (unsigned char **)&_keygrab_win, &num);
        if (ret && num)
        {
                Ecore_X_Window xWindow = *_keygrab_win;
index 0becc63..3eea95c 100644 (file)
@@ -429,6 +429,11 @@ _UiEventManager::ProcessEvent(const _UiEvent& event, bool& isFiltered)
 
                        if (r == E_SUCCESS)
                        {
+                               if (event.GetEventType() == _UI_EVENT_KEY)
+                               {
+                                       CallTranslateKeyEventInfo(event,isFiltered);
+                               }
+
                                ProcessTunnelingEvent(tunnelingPath, event, isFiltered);
 
                                if (event.GetEventType() == _UI_EVENT_TOUCH)
@@ -464,6 +469,28 @@ _UiEventManager::ProcessEvent(const _UiEvent& event, bool& isFiltered)
 }
 
 result
+_UiEventManager::CallTranslateKeyEventInfo(const _UiEvent& event, bool& isFiltered)
+{
+       _ControlManager* pControlManager = _ControlManager::GetInstance();
+       SysTryReturn(NID_UI, pControlManager, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] System error occurred.");
+
+       _Control* pTarget = pControlManager->GetObject(event.GetDestination());
+       SysTryReturn(NID_UI, pTarget, E_OBJ_NOT_FOUND, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] pTarget is null.");
+
+       _UiKeyEvent& keyEvent = static_cast<_UiKeyEvent&>(const_cast<_UiEvent&>(event));
+
+       _KeyInfo* pKeyInfo = keyEvent.GetKeyInfo();
+       SysTryReturn(NID_UI, pKeyInfo, E_OBJ_NOT_FOUND, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] pTarget is null.");
+
+       _IPropagatedKeyEventListener* pKeyEventListener = pTarget->GetPropagatedKeyEventListener();
+       SysTryReturn(NID_UI, pKeyEventListener, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] System error occurred.");
+
+       pKeyEventListener->TranslateKeyEventInfo(*pTarget, *pKeyInfo);
+
+       return E_SUCCESS;
+}
+
+result
 _UiEventManager::ProcessGlobalGesture(const _UiEvent& event, bool& isFiltered)
 {
        if (event.GetEventType() != _UI_EVENT_TOUCH)
index f63b247..ec1a0e5 100644 (file)
@@ -142,10 +142,10 @@ _UiKeyEvent::operator =(const _UiKeyEvent& rhs)
        return *this;
 }
 
-const _KeyInfo*
+_KeyInfo*
 _UiKeyEvent::GetKeyInfo(void) const
 {
-       return &__keyInfo;
+       return const_cast<_KeyInfo*>(&__keyInfo);
 }
 
 _UiKeyEvent*
index f1fd6b8..2d0cbf0 100644 (file)
@@ -151,6 +151,126 @@ _TouchInfo::SetTouchInfo(unsigned long pointId, _TouchStatus status, Tizen::Grap
        __timeStamp = timeStamp;
 }
 
+_MouseInfo::_MouseInfo(void)
+       : __pointId(0)
+       , __touchStatus(_TOUCH_PRESSED)
+       , __currentPosition(0, 0)
+       , __zAxis(0)
+       , __buttons(0)
+       , __isFlicked(false)
+       , __timeStamp(0)
+{
+}
+
+_MouseInfo::_MouseInfo(unsigned long pointId, _TouchStatus status, const Tizen::Graphics::FloatPoint& current, int zAxis, int buttons, const bool isFlick, long long timeStamp)
+       : __pointId(pointId)
+       , __touchStatus(status)
+       , __currentPosition(current)
+       , __zAxis(zAxis)
+       , __buttons(buttons)
+       , __isFlicked(isFlick)
+       , __timeStamp(timeStamp)
+{
+}
+
+_MouseInfo::_MouseInfo(const _MouseInfo& rhs)
+       : __pointId(rhs.__pointId)
+       , __touchStatus(rhs.__touchStatus)
+       , __currentPosition(rhs.__currentPosition)
+       , __zAxis(rhs.__zAxis)
+       , __buttons(rhs.__buttons)
+       , __isFlicked(rhs.__isFlicked)
+       , __timeStamp(rhs.__timeStamp)
+{
+}
+
+_MouseInfo&
+_MouseInfo::operator =(const _MouseInfo& rhs)
+{
+       if (this != &rhs)
+       {
+               __pointId = rhs.__pointId;
+               __touchStatus = rhs.__touchStatus;
+               __currentPosition = rhs.__currentPosition;
+               __zAxis = rhs.__zAxis;
+               __buttons = rhs.__buttons;
+               __isFlicked = rhs.__isFlicked;
+               __timeStamp = rhs.__timeStamp;
+       }
+
+       return *this;
+}
+
+_MouseInfo::~_MouseInfo(void)
+{
+}
+
+_TouchStatus
+_MouseInfo::GetTouchStatus(void) const
+{
+       return __touchStatus;
+}
+
+Tizen::Graphics::FloatPoint
+_MouseInfo::GetCurrentPosition(void) const
+{
+       return __currentPosition;
+}
+
+unsigned long
+_MouseInfo::GetPointId(void) const
+{
+       return __pointId;
+}
+
+int
+_MouseInfo::GetZAxis(void) const
+{
+       return __zAxis;
+}
+
+int
+_MouseInfo::GetButtons(void) const
+{
+       return __buttons;
+}
+
+bool
+_MouseInfo::IsFlicked(void) const
+{
+       return __isFlicked;
+}
+
+long long
+_MouseInfo::GetTimeStamp(void) const
+{
+       return __timeStamp;
+}
+
+void
+_MouseInfo::SetTouchInfo(unsigned long pointId, _TouchStatus status, Tizen::Graphics::Point& current, int zAxis, int buttons, bool isFlick, long long timeStamp)
+{
+       __pointId = pointId;
+       __touchStatus = status;
+       __currentPosition = _CoordinateSystemUtils::ConvertToFloat(current);
+       __zAxis = zAxis;
+       __buttons = buttons;
+       __isFlicked = isFlick;
+       __timeStamp = timeStamp;
+}
+
+void
+_MouseInfo::SetTouchInfo(unsigned long pointId, _TouchStatus status, Tizen::Graphics::FloatPoint& current, int zAxis, int buttons, bool isFlick, long long timeStamp)
+{
+       __pointId = pointId;
+       __touchStatus = status;
+       __currentPosition = current;
+       __zAxis = zAxis;
+       __buttons = buttons;
+       __isFlicked = isFlick;
+       __timeStamp = timeStamp;
+}
+
 _UiTouchEvent::_UiTouchEvent(const _UiObjectHandle& destination, const _TouchInfo& touchInfo, _UiEventRouteType routeType, const _UiObjectHandle& source)
        : _UiEvent(destination, source, routeType)
        , __touchInfo(touchInfo)
@@ -592,4 +712,414 @@ _UiTouchEvent::ExistGlobalGesture(void)
        return exist;
 }
 
+_UiMouseEvent::_UiMouseEvent(const _UiObjectHandle& destination, const _MouseInfo& mouseInfo, _UiEventRouteType routeType, const _UiObjectHandle& source)
+       : _UiEvent(destination, source, routeType)
+       , __mouseInfo(mouseInfo)
+       , __pForcedControlList(new (std::nothrow) LinkedListT<_Control*>)
+{
+}
+
+_UiMouseEvent::~_UiMouseEvent(void)
+{
+}
+
+_UiMouseEvent::_UiMouseEvent(const _UiMouseEvent& rhs)
+       : _UiEvent(rhs)
+       , __mouseInfo(rhs.__mouseInfo)
+       , __pForcedControlList(rhs.__pForcedControlList)
+{
+}
+
+_UiMouseEvent&
+_UiMouseEvent::operator =(const _UiMouseEvent& rhs)
+{
+       _UiEvent::operator =(rhs);
+
+       if (this != &rhs)
+       {
+               __mouseInfo = rhs.__mouseInfo;
+               __pForcedControlList = rhs.__pForcedControlList;
+       }
+
+       return *this;
+}
+
+const _MouseInfo*
+_UiMouseEvent::GetTouchInfo(void) const
+{
+       return &__mouseInfo;
+}
+
+_UiMouseEvent*
+_UiMouseEvent::CloneN(void) const
+{
+       return new (std::nothrow) _UiMouseEvent(*this);
+}
+
+_UiEventType
+_UiMouseEvent::GetEventType(void) const
+{
+       return _UI_EVENT_TOUCH;
+}
+
+bool
+_UiMouseEvent::IsEventEnabled(const _Control& control) const
+{
+       if (!_UiEvent::IsEventEnabled(control))
+       {
+               return false;
+       }
+
+       if (GetTouchInfo()->GetTouchStatus() != _TOUCH_CANCELED)
+       {
+               if (!control.IsInputEventEnabled())
+               {
+                       return false;
+               }
+       }
+
+       return true;
+}
+
+result
+_UiMouseEvent::OnPreviewEventProcessing(const _Control& control, bool& isFiltered)
+{
+       result r = E_SUCCESS;
+
+       const _MouseInfo* pMouseInfo = GetTouchInfo();
+       SysTryReturn(NID_UI, pMouseInfo, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] System error occurred.");
+
+       if ((!ExistGlobalGesture() || GetAccessibilityEvent()) && !isFiltered)
+       {
+               _ITouchEventPreviewer* pTouchEventPreviewer = control.GetPropagatedTouchEventListener();
+               SysTryReturn(NID_UI, pTouchEventPreviewer, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] System error occurred.");
+
+               r = FirePreviewListener(pTouchEventPreviewer, &control, isFiltered);
+       }
+
+       return r;
+}
+
+result
+_UiMouseEvent::OnEventProcessing(const _Control& control, bool& isFiltered)
+{
+       result r = E_SUCCESS;
+
+       bool doesControlExist = false;
+
+       const _MouseInfo* pMouseInfo = GetTouchInfo();
+       SysTryReturn(NID_UI, pMouseInfo, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] System error occurred.");
+
+       if ((!ExistGlobalGesture() || GetAccessibilityEvent()) && !isFiltered)
+       {
+               ProcessGesture(control, isFiltered);
+       }
+       else if (isFiltered)
+       {
+               doesControlExist = __pForcedControlList->Contains(const_cast<_Control*>(&control));
+
+               if (doesControlExist)
+               {
+                       bool isForcedFiltered = false;
+                       ProcessGesture(control, isForcedFiltered);
+
+                       if (isForcedFiltered)
+                       {
+                               isFiltered = true;
+                       }
+               }
+       }
+
+       if (!ExistGlobalGesture() || GetAccessibilityEvent())
+       {
+               if(!isFiltered || doesControlExist)
+               {
+                       _ITouchEventListener* pTouchEventListener = control.GetPropagatedTouchEventListener();
+                       SysTryReturn(NID_UI, pTouchEventListener, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] System error occurred.");
+
+                       r = FireListener(pTouchEventListener, &control, true, isFiltered);
+               }
+       }
+
+       return r;
+}
+
+result
+_UiMouseEvent::OnListenerProcessing(const _IUiEventListener& listener, bool& isFiltered)
+{
+       _ITouchEventListener* pTouchEventListener = dynamic_cast <_ITouchEventListener*>(const_cast <_IUiEventListener*>(&listener));
+       SysTryReturn(NID_UI, pTouchEventListener, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] System error occurred.");
+
+       return FireListener(pTouchEventListener, null, true, isFiltered);
+}
+
+result
+_UiMouseEvent::OnEventHandled(const _Control& control)
+{
+       _Control* pTarget = const_cast<_Control*>(GetControl(GetDestination()));
+       SysTryReturn(NID_UI, pTarget, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] System error occurred.");
+
+       const _MouseInfo* pMouseInfo = GetTouchInfo();
+       SysTryReturn(NID_UI, pMouseInfo, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] System error occurred.");
+
+       result r = E_SUCCESS;
+
+       switch (pMouseInfo->GetTouchStatus())
+       {
+       case _TOUCH_PRESSED:
+               pTarget->GetPropagatedTouchEventListener()->OnTouchPressHandled(control);
+               break;
+
+       case _TOUCH_MOVED:
+               pTarget->GetPropagatedTouchEventListener()->OnTouchMoveHandled(control);
+               break;
+
+       case _TOUCH_RELEASED:
+               pTarget->GetPropagatedTouchEventListener()->OnTouchReleaseHandled(control);
+               break;
+
+       case _TOUCH_CANCELED:
+               pTarget->GetPropagatedTouchEventListener()->OnTouchCancelHandled(control);
+               break;
+
+       default:
+               r = E_SYSTEM;
+               break;
+       }
+
+       return r;
+}
+
+result
+_UiMouseEvent::FireListener(const _ITouchEventListener* pListener, const _Control* pControl,  bool isTouchEvent, bool& isFiltered)
+{
+       _ITouchEventListener* pTouchEventListener = const_cast <_ITouchEventListener*>(pListener);
+       SysTryReturn(NID_UI, pTouchEventListener, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] System error occurred.");
+
+       result r = E_SUCCESS;
+
+       const _MouseInfo* pMouseInfo = GetTouchInfo();
+       SysTryReturn(NID_UI, pMouseInfo, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] System error occurred.");
+
+       const _Control* pTarget = GetControl(GetOriginalDestination());
+       if (pTarget == null)
+       {
+               SysLog(NID_UI, "pTarget == null, Call ResetTouchInfo.");
+               _TouchManager* pTouchManager = _TouchManager::GetInstance();
+               pTouchManager->ResetTouchInfo();
+
+               return E_SUCCESS;
+}
+
+       if (ResetTouchInfo(pTarget, *pMouseInfo) == E_SUCCESS)
+       {
+               isFiltered = true;
+               return E_SYSTEM;
+       }
+
+       FloatPoint point(0, 0);
+
+       if (pControl)
+       {
+               _TouchManager* pTouchManager = _TouchManager::GetInstance();
+               SysAssert(pTouchManager != null)
+
+               point = GetRelativePoint(*pControl, pMouseInfo->GetCurrentPosition());
+       }
+       else
+       {
+               point = GetRelativePoint(*pTarget, pMouseInfo->GetCurrentPosition());
+       }
+
+       _MouseInfo mouseInfo(pMouseInfo->GetPointId(), pMouseInfo->GetTouchStatus(), point, pMouseInfo->GetZAxis(), pMouseInfo->GetButtons(), false, pMouseInfo->GetTimeStamp());
+
+       switch (mouseInfo.GetTouchStatus())
+       {
+       case _TOUCH_PRESSED:
+               isFiltered = pTouchEventListener->OnMousePressed(*pTarget, mouseInfo);
+               break;
+
+       case _TOUCH_RELEASED:
+               isFiltered = pTouchEventListener->OnMouseReleased(*pTarget, mouseInfo);
+               break;
+
+       case _TOUCH_MOVED:
+               isFiltered = pTouchEventListener->OnMouseMoved(*pTarget, mouseInfo);
+               break;
+
+       case _WHEEL_MOVED:
+               isFiltered = pTouchEventListener->OnMouseWheeled(*pTarget, mouseInfo);
+               break;
+
+       default:
+               r = E_SYSTEM;
+       }
+
+       if (isFiltered)
+       {
+               if (pControl)
+               {
+                       SysLog(NID_UI, "Event Consumed : isFiltered is True : pControl %x", pControl);
+                       //_UiPrintControl(*pControl, false);
+               }
+               SysLog(NID_UI, "Event Consumed : isFiltered is True : pTarget %x", pTarget);
+       }
+
+       return r;
+}
+
+result
+_UiMouseEvent::FirePreviewListener(const _ITouchEventPreviewer* pListener, const _Control* pControl, bool& isFiltered)
+{
+       _ITouchEventPreviewer* pTouchEventPreviewer = const_cast <_ITouchEventPreviewer*>(pListener);
+       SysTryReturn(NID_UI, pTouchEventPreviewer, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] System error occurred.");
+
+       result r = E_SUCCESS;
+
+       const _MouseInfo* pMouseInfo = GetTouchInfo();
+       SysTryReturn(NID_UI, pMouseInfo, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] System error occurred.");
+
+       const _Control* pTarget = GetControl(GetDestination());
+
+       FloatPoint point = GetRelativePoint(*pControl, pMouseInfo->GetCurrentPosition());
+
+       if (!pControl->IsMultiTouchEnabled() && pMouseInfo->GetPointId() > 0)
+       {
+               isFiltered = false;
+               return E_SUCCESS;
+       }
+
+       _MouseInfo mouseInfo(pMouseInfo->GetPointId(), pMouseInfo->GetTouchStatus(), point, pMouseInfo->GetZAxis(), pMouseInfo->GetButtons(), false, pMouseInfo->GetTimeStamp());
+
+       _UiTouchEventDelivery eventDelivery = _UI_TOUCH_EVENT_DELIVERY_NO;
+
+       //condition 1) if target is not enabled multi touch, point id should be 0
+       //2) target is enabled multi touch
+       switch (mouseInfo.GetTouchStatus())
+       {
+       case _TOUCH_PRESSED:
+               eventDelivery = pTouchEventPreviewer->OnPreviewMousePressed(*pTarget, mouseInfo);
+               break;
+
+       case _TOUCH_RELEASED:
+               eventDelivery = pTouchEventPreviewer->OnPreviewMouseReleased(*pTarget, mouseInfo);
+               break;
+
+       case _TOUCH_MOVED:
+               eventDelivery = pTouchEventPreviewer->OnPreviewMouseMoved(*pTarget, mouseInfo);
+               break;
+
+       case _WHEEL_MOVED:
+               eventDelivery = pTouchEventPreviewer->OnPreviewMouseWheeled(*pTarget, mouseInfo);
+               break;
+
+       default:
+               r = E_SYSTEM;
+               break;
+       }
+
+       if (eventDelivery != _UI_TOUCH_EVENT_DELIVERY_NO)
+       {
+               // isFiltered = (eventDelivery == _UI_TOUCH_EVENT_DELIVERY_FORCED_YES);
+
+               // if (isFiltered)
+               if (eventDelivery == _UI_TOUCH_EVENT_DELIVERY_FORCED_YES)
+               {
+                       __pForcedControlList->Add(const_cast<_Control*>(pControl));
+               }
+       }
+       else
+       {
+               isFiltered = true;
+       }
+
+       return r;
+}
+
+result
+_UiMouseEvent::ProcessGesture(const _Control& control, bool& isFiltered)
+{
+       if (control.IsSendingDelayedEvent())
+       {
+               return E_SUCCESS;
+       }
+
+       IListT<_TouchGestureDetector*>* pGestureList = control.GetGestureDetectorList();
+       if (!pGestureList || (pGestureList && (pGestureList->GetCount() <= 0)))
+       {
+               return E_SUCCESS;
+       }
+
+       IEnumeratorT<_TouchGestureDetector*>* pEnumerator = pGestureList->GetEnumeratorN();
+       SysTryReturn(NID_UI, pEnumerator, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] System error occurred.");
+
+       while (pEnumerator->MoveNext() == E_SUCCESS)
+       {
+               _TouchGestureDetector* pGestureDetector = null;
+               pEnumerator->GetCurrent(pGestureDetector);
+
+               if (!pGestureDetector)
+               {
+                       continue;
+               }
+
+               _ITouchGestureDelegate* pDelegator = pGestureDetector->GetDelegate();
+               if (pDelegator)
+               {
+                       FireListener(pDelegator, &control, false, isFiltered);
+               }
+       }
+
+       delete pEnumerator;
+       return E_SUCCESS;
+}
+
+FloatPoint
+_UiMouseEvent::GetRelativePoint(const _Control& control, const FloatPoint& point) const
+{
+       FloatPoint relativePoint(point);
+       FloatRectangle absRect = control.GetAbsoluteBoundsF();
+
+       relativePoint.x -= absRect.x;
+       relativePoint.y -= absRect.y;
+
+       return relativePoint;
+}
+
+result
+_UiMouseEvent::ResetTouchInfo(const _Control* pControl, const _MouseInfo& mouseInfo)
+{
+       _TouchManager* pTouchManager = _TouchManager::GetInstance();
+       SysTryReturnResult(NID_UI, pTouchManager, E_SYSTEM, "[E_SYSTEM] System error occurred. ");
+
+       if (pControl == null)
+       {
+               if (mouseInfo.GetTouchStatus() == _TOUCH_RELEASED)
+               {
+                       pTouchManager->ResetTouchInfo();
+               }
+
+               return E_SUCCESS;
+       }
+
+       return E_INVALID_CONDITION;
+}
+
+bool
+_UiMouseEvent::ExistGlobalGesture(void)
+{
+       _ControlManager* pControlManager = _ControlManager::GetInstance();
+       SysTryReturn(NID_UI, pControlManager, false, E_SYSTEM, "[E_SYSTEM] System error occurred.");
+
+       bool exist = false;
+
+       IListT<_TouchGestureDetector*>* pGestureList = pControlManager->GetGestureDetectorList();
+       if (pGestureList && (pGestureList->GetCount() > 0))
+       {
+               exist = true;
+       }
+
+       return exist;
+}
+
 }} // Tizen::Ui
index fad204d..0588808 100644 (file)
@@ -672,23 +672,10 @@ _EflNode::RemoveChild(_INativeNode& child)
 result
 _EflNode::SetFlushNeeded(void)
 {
-#if 0
-       evas_damage_rectangle_add(
-               __pEvas,
-               static_cast< int >(floorf(dirtyRectangle.x)),
-               static_cast< int >(floorf(dirtyRectangle.y)),
-               static_cast< int >(ceilf(dirtyRectangle.width)),
-               static_cast< int >(ceilf(dirtyRectangle.height))
-               );
-#endif
-
        if (!__pSurface || !_VisualElementSurfaceImpl::GetInstance(*__pSurface))
        {
                return E_INVALID_STATE;
        }
-#if 0
-       evas_object_image_pixels_dirty_set(reinterpret_cast< Evas_Object* >(_VisualElementSurfaceImpl::GetInstance(*__pSurface)->GetNativeHandle()), true);
-#else
 
        Evas_Object* pImageObject = reinterpret_cast< Evas_Object* >(_VisualElementSurfaceImpl::GetInstance(*__pSharedSurface)->GetNativeHandle());
 
@@ -697,50 +684,15 @@ _EflNode::SetFlushNeeded(void)
                int imageWidth = 0;
                int imageHeight = 0;
 
-               evas_object_image_data_set(pImageObject, evas_object_image_data_get(pImageObject, 1));
-
                evas_object_image_size_get(pImageObject, &imageWidth, &imageHeight);
                evas_object_image_data_update_add(pImageObject, 0, 0, imageWidth, imageHeight);
        }
 
-#endif
-
        if(__pLayer)
        {
                __pLayer->SetFlushNeeded();
        }
 
-#if 0
-       //contentChanged = false;
-       bool contentChanged = false;
-
-       if (contentChanged)
-       {
-               evas_object_image_pixels_dirty_set((Evas_Object*) _VisualElementSurfaceImpl::GetInstance(*__pSurface)->GetNativeHandle(), true);
-       }
-       else
-       {
-               evas_object_image_data_update_add(
-                       (Evas_Object*) _VisualElementSurfaceImpl::GetInstance(*__pSurface)->GetNativeHandle(),
-                       dirtyRectangle.x,
-                       dirtyRectangle.y,
-                       dirtyRectangle.width,
-                       dirtyRectangle.height
-               );
-
-#if 1
-               evas_object_image_data_update_add(
-                       (Evas_Object*) _VisualElementSurfaceImpl::GetInstance(*__pSharedSurface)->GetNativeHandle(),
-                       dirtyRectangle.x,
-                       dirtyRectangle.y,
-                       dirtyRectangle.width,
-                       dirtyRectangle.height
-               );
-#endif
-       }
-
-#endif
-
        return E_SUCCESS;
 }
 
@@ -761,18 +713,12 @@ _EflNode::Flush(void)
 _Colorf
 _EflNode::GetBackgroundColor(void) const
 {
-//     if (!__pRectangleObject)
-//             return _Colorf();   // CHECKME: Default background color ?
-
        return __backgroundColor;
 }
 
 result
 _EflNode::SetBackgroundColor(const _Colorf& backgroundColor)
 {
-//     if (!__pRectangleObject)
-//             return E_INVALID_STATE;
-
        __backgroundColor = backgroundColor;
 
        return E_SUCCESS;
@@ -959,7 +905,7 @@ _EflNode::Reconfigure(VisualElementSurface* pSurface, _VisualElementImpl& elemen
                                        if (pEflVisualElementSurfaceImpl && pEflVisualElementSurfaceImpl->__pBuffer != null)
                                        {
                                                evas_object_image_source_set(pImageObject, pImageObjectNew);
-#if 0
+#if 0  // needed if evas_object_show() has not been called  in ctor of _EflVisualElementSurfaceImpl
                                                evas_object_show(pImageObjectNew);
                                                evas_object_image_source_visible_set(pImageObject, EINA_FALSE);
 #endif
@@ -1125,32 +1071,6 @@ _EflNode::Reconfigure(VisualElementSurface* pSurface, _VisualElementImpl& elemen
                        __realBounds.x += clipX;
                        __realBounds.y += clipY;
                        _VisualElementCoordinateSystem::MakeIntegralPoint(__realBounds.x, __realBounds.y, newX, newY);
-
-#if 0
-                       int evasOutputW, evasOutputH;
-                       evas_output_size_get(__pEvas, &evasOutputW, &evasOutputH);
-
-//                     if (newX >= 480 || newY >= 800 || newX + newW < 0 || newY + newH < 0)
-//                     if ((newX >= SCREEN_WIDTH || newY >= SCREEN_HEIGHT || newX + newW < 0 || newY + newH < 0) ||
-                       if ((newX >= evasOutputW || newY >= evasOutputH || newX + newW < 0 || newY + newH < 0) ||
-                               (likely(pParentClipper) && (newX >= clipX + clipW || newY >= clipY + clipH || newX + newW < clipX || newY + newH < clipY)))
-                       {
-                               if (isEvasVisible)
-                                       evas_object_hide(__pSmartObject);
-
-                               element.__pSharedData->invalidatedNativeProps = 0;
-
-                               goto finished;
-                       }
-#endif
-
-#if 0
-                       if (likely(pParentClipper))
-                       {
-                               if (likely(newX >= clipX) && likely(newY >= clipY) && likely(newX + newW <= clipX + clipW) && likely(newY + newH <= clipY + clipH))
-                                       pParentClipper = null;
-                       }
-#endif
                }
                else
                {
@@ -1553,16 +1473,9 @@ _EflNode::Reconfigure(VisualElementSurface* pSurface, _VisualElementImpl& elemen
                        {
                                evas_object_render_op_set(pImageObjectNew, GetRenderOperation(element.__renderOperation));
                        }
-//
-//                     if (unlikely(__renderOperation == VisualElement::RENDER_OPERATION_COPY))
-//                     {
-//                             evas_object_color_set(pImageObjectNew, 255, 255, 255, 255);
-//                     }
-//                     else
-//                     {
-                               int premultipliedColor =  static_cast< int >(255.0f * alpha); // white color
-                               evas_object_color_set(pImageObjectNew, premultipliedColor, premultipliedColor, premultipliedColor, premultipliedColor);
-//                     }
+
+                       int premultipliedColor =  static_cast< int >(255.0f * alpha); // white color
+                       evas_object_color_set(pImageObjectNew, premultipliedColor, premultipliedColor, premultipliedColor, premultipliedColor);
                }
 
 
index c72c8fe..c946a81 100644 (file)
@@ -125,6 +125,29 @@ _EflVisualElementSurfaceImpl::_EflVisualElementSurfaceImpl(const Handle layer, c
 #endif
 }
 
+_EflVisualElementSurfaceImpl::~_EflVisualElementSurfaceImpl(void)
+{
+       if (__pEvasImage != null)
+       {
+               evas_object_hide(__pEvasImage);
+
+               // * DO NOT delete object which has been created from other modules.
+               if (!__fromOutside)
+               {
+                       evas_object_del(__pEvasImage);
+               }
+               evas_object_smart_member_del(__pEvasImage);
+       }
+
+       if (__pBuffer != null)
+       {
+               delete []__pBuffer;
+       }
+
+       __pBuffer = null;
+       __pEvasImage = null;
+}
+
 result
 _EflVisualElementSurfaceImpl::SetImage(const String& fileName)
 {
@@ -152,30 +175,6 @@ _EflVisualElementSurfaceImpl::SetImage(const String& fileName)
        return E_SUCCESS;
 }
 
-_EflVisualElementSurfaceImpl::~_EflVisualElementSurfaceImpl(void)
-{
-       if (__pEvasImage != null)
-       {
-               evas_object_hide(__pEvasImage);
-
-               // * DO NOT delete object which has been created from other modules.
-               if (!__fromOutside)
-               {
-                       evas_object_image_data_set(__pEvasImage, null);
-                       evas_object_del(__pEvasImage);
-               }
-               evas_object_smart_member_del(__pEvasImage);
-       }
-
-       if (__pBuffer != null)
-       {
-               delete []__pBuffer;
-       }
-
-       __pBuffer = null;
-       __pEvasImage = null;
-}
-
 Handle
 _EflVisualElementSurfaceImpl::GetNativeHandle(void) const
 {
@@ -222,15 +221,6 @@ _EflVisualElementSurfaceImpl::GetPhysicalSize(void) const
 
        evas_object_image_size_get(pSource, &w, &h);
 
-#if 0
-       _CoordinateSystem* pCoordSystem = _CoordinateSystem::GetInstance();
-       _ICoordinateTransformer* pXformer = pCoordSystem->GetInverseTransformer();
-       SysTryReturn(NID_UI_ANIM, pXformer, Dimension(-1, -1), E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Failed to load coordinate transformer.");
-
-       w = pXformer->Transform(w);
-       h = pXformer->Transform(h);
-#endif
-
        return Tizen::Graphics::Dimension(w, h);
 }
 
index bc02ba5..942895d 100644 (file)
@@ -329,6 +329,8 @@ _Button::OnFontChanged(Font* pFont)
 {
        __pButtonPresenter->OnFontChanged(pFont);
 
+       _Control::OnFontChanged(pFont);
+
        return;
 }
 
@@ -1328,20 +1330,14 @@ _Button::GetBottomMarginF(void) const
        return __bottomMargin;
 }
 
-Tizen::Graphics::Dimension
-_Button::GetContentSize(void) const
-{
-       return _CoordinateSystemUtils::ConvertToInteger(GetContentSizeInternalF());
-}
-
 Tizen::Graphics::FloatDimension
-_Button::GetContentSizeF(void) const
+_Button::GetContentSizeF(bool horizontalMode, bool verticalMode) const
 {
-       return GetContentSizeInternalF();
+       return GetContentSizeInternalF(horizontalMode, verticalMode);
 }
 
 Tizen::Graphics::FloatDimension
-_Button::GetContentSizeInternalF(void) const
+_Button::GetContentSizeInternalF(bool horizontalMode, bool verticalMode) const
 {
        for (int i = 0; i < NUMBER_OF_BUTTON_STATUS; i++)
        {
@@ -1360,31 +1356,49 @@ _Button::GetContentSizeInternalF(void) const
        TextObjectWrapType previousWrapType = pTextObject->GetWrap();
        FloatRectangle previousRect = pTextObject->GetBoundsF();
 
+       pTextObject->SetBounds(FloatRectangle(0.0f, 0.0f, GetBoundsF().width - __leftMargin * 2, GetBoundsF().height - __topMargin * 2));
        pTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_NONE);
        pTextObject->SetWrap(TEXT_OBJECT_WRAP_TYPE_WORD);
        pTextObject->Compose();
-       dimension = pTextObject->GetTextExtentF(0, pTextObject->GetTextLength());
 
-       contentRect.width = _ControlManager::GetInstance()->GetScreenSizeF().width;
+       _ControlOrientation orientation = GetOrientation();
+       if (orientation == _CONTROL_ORIENTATION_PORTRAIT)
+       {
+               contentRect.width = _ControlManager::GetInstance()->GetScreenSizeF().width;
+       }
+       else
+       {
+               contentRect.width = _ControlManager::GetInstance()->GetScreenSizeF().height;
+       }
 
-       if (dimension.width > contentRect.width - GetBoundsF().x - __leftMargin * 2)
+       if (horizontalMode == true)
        {
-               dimension.width = contentRect.width - GetBoundsF().x - __leftMargin * 2;
+               dimension = pTextObject->GetTextExtentF(0, pTextObject->GetTextLength());
+
+               if (dimension.width > contentRect.width - GetBoundsF().x - __leftMargin * 2)
+               {
+                       dimension.width = contentRect.width - GetBoundsF().x - __leftMargin * 2;
 
-               pTextObject->SetBounds(FloatRectangle(previousRect.x, previousRect.y, dimension.width, previousRect.height));
-               pTextObject->Compose();
+                       pTextObject->SetBounds(FloatRectangle(previousRect.x, previousRect.y, dimension.width, previousRect.height));
+                       pTextObject->Compose();
 
-               dimension.height = pTextObject->GetTotalHeightF();
+                       dimension.height = pTextObject->GetTotalHeightF();
+               }
        }
 
-       if (dimension.width > GetBoundsF().width - __leftMargin * 2)
+       if (verticalMode == true)
        {
-               dimension.width = GetBoundsF().width - __leftMargin * 2;
+               dimension = pTextObject->GetTextExtentF();
 
-               pTextObject->SetBounds(FloatRectangle(previousRect.x, previousRect.y, dimension.width, previousRect.height));
-               pTextObject->Compose();
+               if (dimension.width > GetBoundsF().width - __leftMargin * 2)
+               {
+                       dimension.width = GetBoundsF().width - __leftMargin * 2;
+
+                       pTextObject->SetBounds(FloatRectangle(previousRect.x, previousRect.y, dimension.width, previousRect.height));
+                       pTextObject->Compose();
 
-               dimension.height = pTextObject->GetTotalHeightF();
+                       dimension.height = pTextObject->GetTotalHeightF();
+               }
        }
 
        pTextObject->SetBounds(previousRect);
@@ -1407,7 +1421,6 @@ _Button::GetContentSizeInternalF(void) const
        return dimension;
 }
 
-
 int
 _Button::GetTextExtentSize(void) const
 {
index cb89489..bad3b60 100644 (file)
@@ -567,16 +567,10 @@ _ButtonImpl::OnTouchCanceled(const _ControlImpl& source, const _TouchInfo& touch
        return false;
 }
 
-Tizen::Graphics::Dimension
-_ButtonImpl::GetContentSize(void) const
-{
-       return GetCore().GetContentSize();
-}
-
 Tizen::Graphics::FloatDimension
-_ButtonImpl::GetContentSizeF(void) const
+_ButtonImpl::GetContentSizeF(bool horizontalMode, bool verticalMode) const
 {
-       return GetCore().GetContentSizeF();
+       return GetCore().GetContentSizeF(horizontalMode, verticalMode);
 }
 
 _ButtonStatus
index e1f4c21..8fec081 100644 (file)
@@ -54,6 +54,9 @@ _ColorPicker::_ColorPicker(void)
        , __pHueBarElement(null)
        , __pSaturationBarElement(null)
        , __pLuminanceBarElement(null)
+       , __currentFocusedHandler(HUE_HANDLER)
+       , __previousFocusedHandler(HSL_NOT)
+       , __isInFocusMode(false)
 {
 }
 
@@ -290,6 +293,8 @@ _ColorPicker::SetPropertyLuminance(const Variant& luminance)
 bool
 _ColorPicker::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo)
 {
+       __pColorPickerPresenter->ClearFocus(__currentFocusedHandler);
+
        return __pColorPickerPresenter->OnTouchPressed(source, touchinfo);
 }
 
@@ -585,4 +590,100 @@ _ColorPicker::OnAccessibilityValueDecreased(const _AccessibilityContainer& contr
        return true;
 }
 
+bool
+_ColorPicker::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo)
+{
+       _KeyCode keyCode = keyInfo.GetKeyCode();
+
+       if (!__isInFocusMode)
+       {
+               return false;
+       }
+
+       switch (keyCode)
+       {
+               case _KEY_RIGHT:
+                       __pColorPickerPresenter->StepHandler(__currentFocusedHandler, true);
+                       break;
+
+               case _KEY_LEFT:
+                       __pColorPickerPresenter->StepHandler(__currentFocusedHandler, false);
+                       break;
+
+               case _KEY_DOWN:
+                       if (__currentFocusedHandler < LUM_HANDLER)
+                       {
+                               __previousFocusedHandler = __currentFocusedHandler;
+                               __currentFocusedHandler = static_cast<_ColorPickerComponentType>(static_cast<int>(__currentFocusedHandler) + 1);
+                               __pColorPickerPresenter->DrawFocus(__currentFocusedHandler, __previousFocusedHandler);
+                       }
+                       break;
+
+               case _KEY_UP:
+                       if (__currentFocusedHandler > HUE_HANDLER)
+                       {
+                               __previousFocusedHandler = __currentFocusedHandler;
+                               __currentFocusedHandler = static_cast<_ColorPickerComponentType>(static_cast<int>(__currentFocusedHandler) - 1);
+                               __pColorPickerPresenter->DrawFocus(__currentFocusedHandler, __previousFocusedHandler);
+                       }
+                       break;
+
+               default:
+                       return false;
+       }
+
+       return true;
+}
+
+bool
+_ColorPicker::OnFocusLost(const _Control& source)
+{
+       result r = E_SUCCESS;
+       r = __pColorPickerPresenter->ClearFocus(__currentFocusedHandler);
+       __previousFocusedHandler = HSL_NOT;
+       __currentFocusedHandler = HUE_HANDLER;
+
+       if (r != E_SUCCESS)
+       {
+               SysLogException(NID_UI_CTRL, r, "[%s] Propagating.", GetErrorMessage(r));
+       }
+       r =  __pColorPickerPresenter->Draw();
+
+       if (r != E_SUCCESS)
+       {
+               SysLogException(NID_UI_CTRL, r, "[%s] Propagating.", GetErrorMessage(r));
+       }
+       _Control::OnFocusLost(source);
+
+       return true;
+}
+
+void
+_ColorPicker::OnDrawFocus(void)
+{
+       __pColorPickerPresenter->DrawFocus(__currentFocusedHandler, __previousFocusedHandler);
+       __isInFocusMode = true;
+
+       return;
+}
+
+void
+_ColorPicker::OnFocusModeStateChanged(void)
+{
+       result r = E_SUCCESS;
+
+       r = __pColorPickerPresenter->ClearFocus(__currentFocusedHandler);
+       __previousFocusedHandler = HSL_NOT;
+       __currentFocusedHandler = HUE_HANDLER;
+       __isInFocusMode = false;
+
+       if (r != E_SUCCESS)
+       {
+               SysLogException(NID_UI_CTRL, r, "[%s] Propagating.", GetErrorMessage(r));
+       }
+       Invalidate();
+
+       return;
+}
+
 }}} // Tizen::Ui::Controls
index 8004480..87a48b9 100644 (file)
@@ -27,6 +27,7 @@
 #include "FUiAnim_VisualElement.h"
 #include "FUiCtrl_ColorPickerPresenter.h"
 #include "FUiCtrl_ColorPickerModel.h"
+#include "FUiCtrl_ColorPicker.h"
 #include "FUi_AccessibilityElement.h"
 #include "FUi_UiTouchEvent.h"
 #include "FUi_ResourceManager.h"
@@ -94,6 +95,7 @@ _ColorPickerPresenter::_ColorPickerPresenter(_ColorPicker& colorPicker)
        , __pLandscapeCustomBitmap(null)
        , __pLandscapeLuminanceSliderBgBitmap(null)
        , __pLandscapeSaturationSliderBgBitmap(null)
+       , __pFocusBitmap(null)
 {
 }
 
@@ -173,6 +175,9 @@ _ColorPickerPresenter::~_ColorPickerPresenter(void)
 
        delete __pLandscapeSaturationSliderBgBitmap;
        __pLandscapeSaturationSliderBgBitmap = null;
+
+       delete __pFocusBitmap;
+       __pFocusBitmap = null;
 }
 
 _ColorPickerPresenter*
@@ -671,6 +676,9 @@ _ColorPickerPresenter::LoadResource(void)
        r = GET_BITMAP_CONFIG_N(COLORPICKER::RIGHT_ARROW_BUTTON_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, pRightArrowDisabledBitmap);
        SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
 
+       r = GET_BITMAP_CONFIG_N(COLORPICKER::HANDLER_HIGHLIGHTED, BITMAP_PIXEL_FORMAT_ARGB8888, __pFocusBitmap);
+       SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
+
        __pColorNormalReplacementBgBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pBgNormalBitmap, Color::GetColor(COLOR_ID_MAGENTA), buttonBgNormalColor);
        r = GetLastResult();
        SysTryCatch(NID_UI_CTRL, (__pColorNormalReplacementBgBitmap != null), , r, "[%s] Propagating.", GetErrorMessage(r));
@@ -815,6 +823,118 @@ CATCH:
        delete __pRightArrowDisabledBitmap;
        __pRightArrowDisabledBitmap = null;
 
+       delete __pFocusBitmap;
+       __pFocusBitmap = null;
+
+       return r;
+}
+
+void
+_ColorPickerPresenter::StepHandler(_ColorPickerComponentType index, bool increase)
+{
+       if (increase)
+       {
+               SetHandlerPosition(index, __componentBounds[index].x + ARROW_MOVE_STEP);
+       }
+       else
+       {
+               SetHandlerPosition(index, __componentBounds[index].x - ARROW_MOVE_STEP);
+       }
+
+       MoveHandler(index);
+       ChangeColorFromCurrentHandlerPosition(index);
+}
+
+result
+_ColorPickerPresenter::DrawFocus(_ColorPickerComponentType currentFocusedIndex, _ColorPickerComponentType prevFocusIndex)
+{
+       result r = E_SUCCESS;
+
+       if (prevFocusIndex != HSL_NOT)
+       {
+               ClearFocus(prevFocusIndex);
+       }
+
+       switch (currentFocusedIndex)
+       {
+               case HUE_HANDLER:
+               {
+                       Canvas *pCanvas = __pColorPicker->GetHueHandler()->GetCanvasN();
+                       r = GetLastResult();
+                       SysTryReturnResult(NID_UI_CTRL, pCanvas != null, r, "[%s] Propagating.", GetErrorMessage(r));
+                       r = DrawResourceBitmap(*pCanvas, FloatRectangle(0, 0, __componentBounds[HUE_HANDLER].width, __componentBounds[HUE_HANDLER].height), __pFocusBitmap);
+                       delete pCanvas;
+               }
+               break;
+               case SAT_HANDLER:
+               {
+                       Canvas *pCanvas = __pColorPicker->GetSaturationHandler()->GetCanvasN();
+                       r = GetLastResult();
+                       SysTryReturnResult(NID_UI_CTRL, pCanvas != null, r, "[%s] Propagating.", GetErrorMessage(r));
+                       r = DrawResourceBitmap(*pCanvas, FloatRectangle(0, 0, __componentBounds[SAT_HANDLER].width, __componentBounds[SAT_HANDLER].height), __pFocusBitmap);
+                       delete pCanvas;
+               }
+               break;
+               case LUM_HANDLER:
+               {
+                       Canvas *pCanvas = __pColorPicker->GetLuminanceHandler()->GetCanvasN();
+                       r = GetLastResult();
+                       SysTryReturnResult(NID_UI_CTRL, pCanvas != null, r, "[%s] Propagating.", GetErrorMessage(r));
+                       r = DrawResourceBitmap(*pCanvas, FloatRectangle(0, 0, __componentBounds[LUM_HANDLER].width, __componentBounds[LUM_HANDLER].height), __pFocusBitmap);
+                       delete pCanvas;
+               }
+               break;
+               default:
+                       break;
+       }
+
+       return r;
+}
+
+result
+_ColorPickerPresenter::ClearFocus(_ColorPickerComponentType index)
+{
+       result r = E_SUCCESS;
+
+       switch (index)
+       {
+               case HUE_HANDLER:
+               {
+                       Canvas *pCanvas = __pColorPicker->GetHueHandler()->GetCanvasN();
+                        r = GetLastResult();
+                       SysTryReturnResult(NID_UI_CTRL, pCanvas != null, r, "[%s] Propagating.", GetErrorMessage(r));
+                       pCanvas->SetBackgroundColor(Color());
+                       pCanvas->Clear();
+                       r = DrawResourceBitmap(*pCanvas, FloatRectangle(0, 0, __componentBounds[HUE_HANDLER].width, __componentBounds[HUE_HANDLER].height), __pHandlerBitmap);
+                       delete pCanvas;
+               }
+               break;
+               case SAT_HANDLER:
+               {
+                       Canvas *pCanvas = __pColorPicker->GetSaturationHandler()->GetCanvasN();
+                        r = GetLastResult();
+                       SysTryReturnResult(NID_UI_CTRL, pCanvas != null, r, "[%s] Propagating.", GetErrorMessage(r));
+                       pCanvas->SetBackgroundColor(Color());
+                       pCanvas->Clear();
+                       r = DrawResourceBitmap(*pCanvas, FloatRectangle(0, 0, __componentBounds[SAT_HANDLER].width, __componentBounds[SAT_HANDLER].height), __pHandlerBitmap);
+                       delete pCanvas;
+               }
+               break;
+               case LUM_HANDLER:
+               {
+                       Canvas *pCanvas = __pColorPicker->GetLuminanceHandler()->GetCanvasN();
+                        r = GetLastResult();
+                       SysTryReturnResult(NID_UI_CTRL, pCanvas != null, r, "[%s] Propagating.", GetErrorMessage(r));
+                       pCanvas->SetBackgroundColor(Color());
+                       pCanvas->Clear();
+                       r = DrawResourceBitmap(*pCanvas, FloatRectangle(0, 0, __componentBounds[LUM_HANDLER].width, __componentBounds[LUM_HANDLER].height), __pHandlerBitmap);
+                       delete pCanvas;
+               }
+               break;
+               default:
+                       break;
+       }
+
        return r;
 }
 
index 82d882d..ce143c2 100644 (file)
@@ -515,16 +515,16 @@ _ContextMenuGridPresenter::CalculateRect(void)
                }
 
                windowRect.x = bodyRect.x;
-               windowRect.y = bodyRect.y;
+               windowRect.y = bodyRect.y + __arrowTopMargin - __anchorPopupOverlap;
                windowRect.width = bodyRect.width;
-               windowRect.height = bodyRect.height + arrowRect.height;
+               windowRect.height = bodyRect.height + arrowRect.height - (__arrowTopMargin - __anchorPopupOverlap);
 
                bodyRect.x = 0.0f;
-               bodyRect.y = __arrowTopMargin - __anchorPopupOverlap;
+               bodyRect.y = 0.0f;
 
                // Set arrow position
                arrowRect.x = anchorPosition.x - (arrowRect.width / 2.0f) - windowRect.x;
-               arrowRect.y = bodyRect.height;
+               arrowRect.y = bodyRect.height - (__arrowTopMargin - __anchorPopupOverlap);
        }
        else if (dropPosition == CONTEXT_MENU_CORE_DROP_POSITION_DOWN)    // up Arrow
        {
@@ -573,7 +573,7 @@ _ContextMenuGridPresenter::CalculateRect(void)
                windowRect.x = bodyRect.x;
                windowRect.y = bodyRect.y - arrowRect.height;
                windowRect.width = bodyRect.width;
-               windowRect.height = bodyRect.height + arrowRect.height;
+               windowRect.height = bodyRect.height + arrowRect.height - __arrowBottomMargin + __anchorPopupOverlap;
 
                bodyRect.x = 0.0f;
                bodyRect.y = arrowRect.height - __arrowBottomMargin + __anchorPopupOverlap;
@@ -632,16 +632,16 @@ _ContextMenuGridPresenter::CalculateRect(void)
                        bodyRect.y = bottomBoundary - bodyRect.height;
                }
 
-               windowRect.x = bodyRect.x;
+               windowRect.x = bodyRect.x + __arrowRightMargin - __anchorPopupOverlap;
                windowRect.y = bodyRect.y;
-               windowRect.width = bodyRect.width + arrowRect.width;
+               windowRect.width = bodyRect.width + arrowRect.width - (__arrowRightMargin - __anchorPopupOverlap);
                windowRect.height = bodyRect.height;
 
-               bodyRect.x = __arrowRightMargin - __anchorPopupOverlap;
+               bodyRect.x = 0.0f;
                bodyRect.y = 0.0f;
 
                // Set arrow position
-               arrowRect.x = bodyRect.width;
+               arrowRect.x = bodyRect.width - (__arrowRightMargin - __anchorPopupOverlap);
                arrowRect.y = anchorPosition.y - (arrowRect.height / 2.0f) - windowRect.y;
        }
        else    // left Arrow
@@ -695,7 +695,7 @@ _ContextMenuGridPresenter::CalculateRect(void)
 
                windowRect.x = bodyRect.x;
                windowRect.y = bodyRect.y;
-               windowRect.width = bodyRect.width + arrowRect.width;
+               windowRect.width = bodyRect.width + arrowRect.width - __arrowLeftMargin + __anchorPopupOverlap;
                windowRect.height = bodyRect.height;
 
                bodyRect.x = arrowRect.width - __arrowLeftMargin + __anchorPopupOverlap;
index 7491ad8..fd7baab 100644 (file)
@@ -506,16 +506,16 @@ _ContextMenuListPresenter::CalculateRect(void)
                }
 
                windowRect.x = bodyRect.x;
-               windowRect.y = bodyRect.y;
+               windowRect.y = bodyRect.y + __arrowTopMargin - __anchorPopupOverlap;
                windowRect.width = bodyRect.width;
-               windowRect.height = bodyRect.height + arrowRect.height;
+               windowRect.height = bodyRect.height + arrowRect.height - (__arrowTopMargin - __anchorPopupOverlap);
 
                bodyRect.x = 0.0f;
-               bodyRect.y = __arrowTopMargin - __anchorPopupOverlap;
+               bodyRect.y = 0.0f;
 
                // Set arrow position
                arrowRect.x = anchorPosition.x - (arrowRect.width / 2.0f) - windowRect.x;
-               arrowRect.y = bodyRect.height;
+               arrowRect.y = bodyRect.height - (__arrowTopMargin - __anchorPopupOverlap);
        }
        else if (dropPosition == CONTEXT_MENU_CORE_DROP_POSITION_DOWN)    // up Arrow
        {
@@ -564,7 +564,7 @@ _ContextMenuListPresenter::CalculateRect(void)
                windowRect.x = bodyRect.x;
                windowRect.y = bodyRect.y - arrowRect.height;
                windowRect.width = bodyRect.width;
-               windowRect.height = bodyRect.height + arrowRect.height;
+               windowRect.height = bodyRect.height + arrowRect.height - __arrowBottomMargin + __anchorPopupOverlap;
 
                bodyRect.x = 0.0f;
                bodyRect.y = arrowRect.height - __arrowBottomMargin + __anchorPopupOverlap;
@@ -623,16 +623,16 @@ _ContextMenuListPresenter::CalculateRect(void)
                        bodyRect.y = bottomBoundary - bodyRect.height;
                }
 
-               windowRect.x = bodyRect.x;
+               windowRect.x = bodyRect.x + __arrowRightMargin - __anchorPopupOverlap;
                windowRect.y = bodyRect.y;
-               windowRect.width = bodyRect.width + arrowRect.width;
+               windowRect.width = bodyRect.width + arrowRect.width - (__arrowRightMargin - __anchorPopupOverlap);
                windowRect.height = bodyRect.height;
 
-               bodyRect.x = __arrowRightMargin - __anchorPopupOverlap;
+               bodyRect.x = 0.0f;
                bodyRect.y = 0.0f;
 
                // Set arrow position
-               arrowRect.x = bodyRect.width;
+               arrowRect.x = bodyRect.width - (__arrowRightMargin - __anchorPopupOverlap);
                arrowRect.y = anchorPosition.y - (arrowRect.height / 2.0f) - windowRect.y;
        }
        else    // left Arrow
@@ -686,7 +686,7 @@ _ContextMenuListPresenter::CalculateRect(void)
 
                windowRect.x = bodyRect.x;
                windowRect.y = bodyRect.y;
-               windowRect.width = bodyRect.width + arrowRect.width;
+               windowRect.width = bodyRect.width + arrowRect.width - __arrowLeftMargin + __anchorPopupOverlap;
                windowRect.height = bodyRect.height;
 
                bodyRect.x = arrowRect.width - __arrowLeftMargin + __anchorPopupOverlap;
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 346d4ae..c5cb1bf 100644 (file)
@@ -239,6 +239,7 @@ _Edit::_Edit(void)
        , __isDestroyed(false)
        , __pTextFilter(null)
        , __previousBounds()
+       , __isTouchMoving(false)
 {
        for (int status = 0; status < EDIT_COLOR_MAX; status++)
        {
@@ -560,7 +561,7 @@ _Edit::GetPresenter(void) const
 }
 
 FloatDimension
-_Edit::GetContentSizeInternalF(void) const
+_Edit::GetContentSizeInternalF(bool horizontalMode, bool verticalMode) const
 {
        if (!GetTextLength())
        {
@@ -576,8 +577,6 @@ _Edit::GetContentSizeInternalF(void) const
        float textBottomMargin = 0.0f;
 
        _ControlOrientation orientation = GetOrientation();
-       GET_SHAPE_CONFIG(EDIT::AREA_LEFT_MARGIN, orientation, leftMargin);
-       GET_SHAPE_CONFIG(EDIT::AREA_RIGHT_MARGIN, orientation, rightMargin);
        GET_SHAPE_CONFIG(EDIT::AREA_TEXT_LEFT_MARGIN, orientation, textLeftMargin);
        GET_SHAPE_CONFIG(EDIT::AREA_TEXT_RIGHT_MARGIN, orientation, textRightMargin);
        GET_SHAPE_CONFIG(EDIT::AREA_TEXT_TOP_MARGIN, orientation, textTopMargin);
@@ -596,31 +595,78 @@ _Edit::GetContentSizeInternalF(void) const
        FloatRectangle previousRect = pTextObject->GetBoundsF();
        FloatRectangle newRect = previousRect;
 
-       if (orientation == _CONTROL_ORIENTATION_PORTRAIT)
+       bool fitToHorizontal = horizontalMode;
+       bool fitToVertical = verticalMode;
+
+       if (fitToHorizontal)
        {
-               newRect.height = _ControlManager::GetInstance()->GetScreenSizeF().height;
+               if (orientation == _CONTROL_ORIENTATION_PORTRAIT)
+               {
+                       newRect.width = _ControlManager::GetInstance()->GetScreenSizeF().width;
+               }
+               else
+               {
+                       newRect.width = _ControlManager::GetInstance()->GetScreenSizeF().height;
+               }
+               newRect.width -= (GetBoundsF().x + textLeftMargin + textRightMargin);
        }
-       else
+       if (fitToVertical)
        {
-               newRect.height = _ControlManager::GetInstance()->GetScreenSizeF().width;
+               if (orientation == _CONTROL_ORIENTATION_PORTRAIT)
+               {
+                       newRect.height = _ControlManager::GetInstance()->GetScreenSizeF().height;
+               }
+               else
+               {
+                       newRect.height = _ControlManager::GetInstance()->GetScreenSizeF().width;
+               }
+               newRect.height -= (GetBoundsF().y + textTopMargin + textBottomMargin);
        }
-       newRect.height -= (GetBoundsF().y + textTopMargin + textBottomMargin);
 
        pTextObject->SetBounds(newRect);
        pTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_NONE);
        pTextObject->SetWrap(TEXT_OBJECT_WRAP_TYPE_WORD);
        pTextObject->Compose();
 
-       float height = pTextObject->GetTotalHeightF();
-       if (height < newRect.height)
+       if (fitToHorizontal && fitToVertical)
+       {
+               dimension = pTextObject->GetTextExtentF(0, pTextObject->GetTextLength());
+               if (dimension.width > newRect.width)
+               {
+                       dimension.width = newRect.width;
+               }
+               float height = pTextObject->GetTotalHeightF();
+               if (height <= newRect.height)
+               {
+                       dimension.height = height;
+               }
+               else
+               {
+                       dimension.height = newRect.height;
+               }
+       }
+       else if (fitToHorizontal)
        {
-               dimension.height = height;
+               dimension = pTextObject->GetTextExtentF(0, pTextObject->GetTextLength());
+               if (dimension.width > newRect.width)
+               {
+                       dimension.width = newRect.width;
+               }
+               dimension.height = GetBoundsF().height;
        }
-       else
+       else if (fitToVertical)
        {
-               dimension.height = newRect.height;
+               float height = pTextObject->GetTotalHeightF();
+               if (height <= newRect.height)
+               {
+                       dimension.height = height;
+               }
+               else
+               {
+                       dimension.height = newRect.height;
+               }
+               dimension.width = GetBoundsF().width;
        }
-       dimension.width = newRect.width;
 
        // restore
        pTextObject->SetBounds(previousRect);
@@ -628,7 +674,14 @@ _Edit::GetContentSizeInternalF(void) const
        pTextObject->SetWrap(previousWrapType);
        pTextObject->Compose();
 
-       dimension.height += textTopMargin + textBottomMargin;
+       if (fitToHorizontal)
+       {
+               dimension.width += textLeftMargin + textRightMargin;
+       }
+       if (fitToVertical)
+       {
+               dimension.height += textTopMargin + textBottomMargin;
+       }
 
        return  dimension;
 }
@@ -1828,16 +1881,20 @@ _Edit::OnTouchCanceled(const _Control& source, const _TouchInfo& touchinfo)
 bool
 _Edit::OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo)
 {
-       if (__editStyle ^ EDIT_STYLE_VIEWER)
+       if ((__editStyle ^ EDIT_STYLE_VIEWER) && !__isTouchMoving)
        {
                PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP);
        }
+       __isTouchMoving = false;
+
        return _pEditPresenter->OnTouchReleased(source, touchinfo);
 }
 
 bool
 _Edit::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo)
 {
+       __isTouchMoving = true;
+
        return _pEditPresenter->OnTouchMoved(source, touchinfo);
 }
 
@@ -2023,6 +2080,8 @@ _Edit::OnFontChanged(Font* pFont)
 {
        _pEditPresenter->OnFontChanged(pFont);
 
+       _Control::OnFontChanged(pFont);
+
        return;
 }
 
index 1e51ace..8c069b9 100644 (file)
@@ -1620,6 +1620,7 @@ _EditCopyPasteManager::CreateCopyPastePopup(void)
        float contextMenuArrowHeight = 0.0f;
        float handlerHeight = 0.0f;
        bool isPasswordStyle = false;
+       bool isClipped = false;
        if (__pEdit->GetEditStyle() & EDIT_STYLE_PASSWORD)
        {
                isPasswordStyle = true;
@@ -1646,13 +1647,14 @@ _EditCopyPasteManager::CreateCopyPastePopup(void)
        GET_SHAPE_CONFIG(CONTEXTMENU::GRID_BOTTOM_MARGIN, orientation, contextMenuBottomMargin);
        GET_SHAPE_CONFIG(CONTEXTMENU::ANCHOR_HEIGHT, orientation, contextMenuArrowHeight);
 
-       if ((__pEdit->GetTextLength() == 0 || __pEdit->GetEditStyle() & EDIT_STYLE_PASSWORD) && !__pEdit->IsClipped())
+       isClipped = __pEdit->IsClipped();
+       if ((__pEdit->GetTextLength() == 0 || __pEdit->GetEditStyle() & EDIT_STYLE_PASSWORD) && !isClipped)
        {
                return;
        }
 
        __contextMenuHeight = contextMenuHeight + contextMenuTopMargin + contextMenuBottomMargin + contextMenuArrowHeight;
-       if (__pEdit->IsClipped() == true && __pEdit->IsViewModeEnabled() == false && __pEdit->GetTextLength() > 0 && orientation == _CONTROL_ORIENTATION_PORTRAIT)
+       if (isClipped && __pEdit->IsViewModeEnabled() == false && __pEdit->GetTextLength() > 0 && orientation == _CONTROL_ORIENTATION_PORTRAIT)
        {
                __contextMenuHeight = __contextMenuHeight + contextMenuHeight;
        }
@@ -1881,7 +1883,7 @@ _EditCopyPasteManager::CreateCopyPastePopup(void)
                }
        }
 
-       if (__pEdit->IsClipped() == true)
+       if (isClipped)
        {
                if (!__pEdit->IsViewModeEnabled())
                {
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 433cf82..eec5ab6 100644 (file)
@@ -103,6 +103,7 @@ float _EditPresenter::__initialParentHeight = 0.0f;
 float _EditPresenter::__clipboardHeight = 0.0f;
 _EditFooterVisibleStatus _EditPresenter::__initialFooterVisibleStatus = EDIT_FOOTER_VISIBLE_STATUS_NONE;
 bool _EditPresenter::__footerVisibleChanged = false;
+unsigned int _EditPresenter::__latestBoundedContext = null;
 
 _EditAnimationProvider::_EditAnimationProvider(void)
 {
@@ -815,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;
        }
@@ -1056,6 +1074,11 @@ _EditPresenter::Dispose(void)
 
        CheckUSBKeyboardStatus();
 
+       if(__latestBoundedContext != (unsigned int)this)//context is already chagned.
+       {
+               __isKeypadHiding = false;
+       }
+
        if (__isInputConnectionBound || __isKeypadHiding || __clipboardConnected) //Edit control removed without FocusLost callback or HideKeypad.
        {
                if (__clipboardConnected) //Edit control removed after FocusLost or without FocusLost callback.
@@ -1083,7 +1106,8 @@ _EditPresenter::Dispose(void)
                        {
                                __pParentForm->SetClipboardShowState(false);
                        }
-                       else
+
+                       if (__isInputConnectionBound || __isKeypadHiding)
                        {
                                __pParentForm->SetKeypadShowState(false);
                        }
@@ -1108,6 +1132,8 @@ _EditPresenter::Dispose(void)
                AdjustParentPanelHeight(true);
 
                __isKeypadExist = false;
+
+               __latestBoundedContext = null;
        }
 
        __initialFooterVisibleStatus = EDIT_FOOTER_VISIBLE_STATUS_NONE;
@@ -2859,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
                {
@@ -5697,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);
@@ -6349,6 +6382,7 @@ _EditPresenter::ShowKeypad(bool focus)
        __isInputConnectionBound = true;
        __isKeypadShowing = true;
        __isKeypadHiding = false;
+       __latestBoundedContext = (unsigned int)this;
 
        SetKeypadStyle(__pEditModel->GetKeypadStyle());
 
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 5ec55c4..8eb35d6 100644 (file)
@@ -601,9 +601,9 @@ _ExpandableListImpl::LoadArrowBitmap(void)
        Color disabledColor;
        Color pressedColor;
 
-       GET_COLOR_CONFIG(TABLEVIEW::EXPANDABLE_ARROW_NORMAL, normalColor);
-       GET_COLOR_CONFIG(TABLEVIEW::EXPANDABLE_ARROW_DISABLED, disabledColor);
-       GET_COLOR_CONFIG(TABLEVIEW::EXPANDABLE_ARROW_PRESSED, pressedColor);
+       GET_COLOR_CONFIG(LIST::EXPANDABLE_ARROW_NORMAL, normalColor);
+       GET_COLOR_CONFIG(LIST::EXPANDABLE_ARROW_DISABLED, disabledColor);
+       GET_COLOR_CONFIG(LIST::EXPANDABLE_ARROW_PRESSED, pressedColor);
 
        r = GET_BITMAP_CONFIG_N(LIST::BUTTON_COLLAPSE_GROUP, BITMAP_PIXEL_FORMAT_ARGB8888, pTempBitmap);
        SysTryReturnResult(NID_UI_CTRL, (r == E_SUCCESS), r, "Failed to fetch Arrow Bitmap");
@@ -623,10 +623,10 @@ _ExpandableListImpl::LoadArrowBitmap(void)
        delete pTempBitmap;
        pTempBitmap = null;
 
-       r = GET_BITMAP_CONFIG_N(TABLEVIEW::BUTTON_EXPAND_CLOSED_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pEffectOpenedImage);
+       r = GET_BITMAP_CONFIG_N(LIST::BUTTON_EXPAND_CLOSED_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pEffectOpenedImage);
        SysTryReturnResult(NID_UI_CTRL, (r == E_SUCCESS), r, "Failed to fetch Arrow effect Bitmap");
 
-       r = GET_BITMAP_CONFIG_N(TABLEVIEW::BUTTON_EXPAND_OPENED_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pEffectClosedImage);
+       r = GET_BITMAP_CONFIG_N(LIST::BUTTON_EXPAND_OPENED_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pEffectClosedImage);
        SysTryReturnResult(NID_UI_CTRL, (r == E_SUCCESS), r, "Failed to fetch Arrow effect Bitmap");
 
        return r;
index b2b14f3..7f29ee4 100644 (file)
@@ -48,6 +48,7 @@
 #include "FUiCtrl_IFormBackEventListener.h"
 #include "FUiCtrl_Indicator.h"
 #include "FUi_SystemUtilImpl.h"
+#include "FUiCtrl_FormImpl.h"
 
 using namespace std;
 using namespace Tizen::Ui::Animations;
@@ -2498,6 +2499,58 @@ _Form::SetFooterBounds(Rectangle& bounds)
        return r;
 }
 
+bool
+_Form::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo)
+{
+       return false;
+}
+
+bool
+_Form::OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo)
+{
+       return false;
+}
+
+bool
+_Form::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo)
+{
+       return false;
+}
+
+bool
+_Form::OnTouchCanceled(const _Control & source, const _TouchInfo & touchinfo)
+{
+       return false;
+}
+
+bool
+_Form::OnMousePressed(const _Control& source, const _MouseInfo& mouseinfo)
+{
+       return false;
+}
+
+bool
+_Form::OnMouseReleased(const _Control& source, const _MouseInfo& mouseinfo)
+{
+       _Toolbar* pToolbar = GetFooter();
+       if (pToolbar == null)
+       {
+               return null;
+       }
+
+       if (pToolbar->IsButtonSet(BACK_BUTTON))
+       {
+               void* pData = GetUserData();
+               if (pData)
+               {
+                       _FormImpl* pDataImpl = static_cast<_FormImpl*>(pData);
+                       pDataImpl->OnFormBackRequested(*this);
+               }
+       }
+
+       return true;
+}
+
 result
 _Form::SetFooterBounds(FloatRectangle& bounds)
 {
@@ -2708,7 +2761,13 @@ _Form::GetIndicatorBounds(void) const
                FrameShowMode mode = pFrame->GetShowMode();
                if (mode != FRAME_SHOW_MODE_FULL_SCREEN)
                {
-                       return Rectangle(0, 0, 0, 0);
+                       if (mode == FRAME_SHOW_MODE_MINIMIZED)
+                       {
+                               if (pFrame->GetShowMode(false) != FRAME_SHOW_MODE_FULL_SCREEN)
+                               {
+                                       return Rectangle(0, 0, 0, 0);
+                               }
+                       }
                }
        }
 
@@ -2742,7 +2801,13 @@ _Form::GetIndicatorBoundsF(void) const
                FrameShowMode mode = pFrame->GetShowMode();
                if (mode != FRAME_SHOW_MODE_FULL_SCREEN)
                {
-                       return FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f);
+                       if (mode == FRAME_SHOW_MODE_MINIMIZED)
+                       {
+                               if (pFrame->GetShowMode(false) != FRAME_SHOW_MODE_FULL_SCREEN)
+                               {
+                                       return FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f);
+                               }
+                       }
                }
        }
 
@@ -3031,7 +3096,25 @@ _Form::AdjustClientBounds(void)
        if (pFrame)
        {
                FrameShowMode mode = pFrame->GetShowMode();
-               if (mode == FRAME_SHOW_MODE_FULL_SCREEN)
+
+               if (mode != FRAME_SHOW_MODE_FULL_SCREEN)
+               {
+                       if (mode == FRAME_SHOW_MODE_MINIMIZED)
+                       {
+                               if (pFrame->GetShowMode(false) == FRAME_SHOW_MODE_FULL_SCREEN)
+                               {
+                                       if (FORM_STYLE_INDICATOR & __formStyle)
+                                       {
+                                               if (IsIndicatorVisible() && !IsIndicatorTranslucent())
+                                               {
+                                                       clientBounds.y += indicatorBounds.height;
+                                                       clientBounds.height -= indicatorBounds.height;
+                                               }
+                                       }
+                               }
+                       }
+               }
+               else
                {
                        if (FORM_STYLE_INDICATOR & __formStyle)
                        {
@@ -3230,7 +3313,25 @@ _Form::UpdateClientBounds(const FloatDimension& size, FloatRectangle& clientBoun
        if (pFrame)
        {
                FrameShowMode mode = pFrame->GetShowMode();
-               if (mode == FRAME_SHOW_MODE_FULL_SCREEN)
+
+               if (mode != FRAME_SHOW_MODE_FULL_SCREEN)
+               {
+                       if (mode == FRAME_SHOW_MODE_MINIMIZED)
+                       {
+                               if (pFrame->GetShowMode(false) == FRAME_SHOW_MODE_FULL_SCREEN)
+                               {
+                                       if (FORM_STYLE_INDICATOR & __formStyle)
+                                       {
+                                               if (IsIndicatorVisible() && !IsIndicatorTranslucent())
+                                               {
+                                                       clientBounds.y += indicatorBounds.height;
+                                                       clientBounds.height -= indicatorBounds.height;
+                                               }
+                                       }
+                               }
+                       }
+               }
+               else
                {
                        if (FORM_STYLE_INDICATOR & __formStyle)
                        {
index e49a12e..e864d2e 100644 (file)
@@ -1138,7 +1138,6 @@ _FormImpl::OnChangeLayout(_ControlOrientation orientation)
                        pFrameImpl->GetCore().SetMovable(true);
 
                        FloatPoint prevPoint = pFrameImpl->GetPositionF();
-                       FloatDimension prevSize = pFrameImpl->GetSizeF();
 
                        FloatPoint curPoint(0.0f, 0.0f);
 
@@ -1146,10 +1145,7 @@ _FormImpl::OnChangeLayout(_ControlOrientation orientation)
                        {
                                if (prevPoint.x < 0.0f)
                                {
-                                       float prevGap = prevSize.width + prevPoint.x;
-                                       float curGap = portraitSize.width / portraitSize.height * prevGap;
-
-                                       curPoint.x = curGap - prevSize.width;
+                                       curPoint.x = portraitSize.height / portraitSize.width * prevPoint.x;                                    
                                }
                                else
                                {
@@ -1158,10 +1154,7 @@ _FormImpl::OnChangeLayout(_ControlOrientation orientation)
 
                                if (prevPoint.y < 0.0f)
                                {
-                                       float prevGap = prevSize.height + prevPoint.y;
-                                       float curGap = portraitSize.height / portraitSize.width * prevGap;
-
-                                       curPoint.y = curGap - prevSize.height;
+                                       curPoint.y = portraitSize.width / portraitSize.height * prevPoint.y;
                                }
                                else
                                {
@@ -1172,10 +1165,7 @@ _FormImpl::OnChangeLayout(_ControlOrientation orientation)
                        {
                                if (prevPoint.x < 0.0f)
                                {
-                                       float prevGap = prevSize.width + prevPoint.x;
-                                       float curGap = portraitSize.height / portraitSize.width * prevGap;
-
-                                       curPoint.x = curGap - prevSize.width;
+                                       curPoint.x = portraitSize.width / portraitSize.height * prevPoint.x;
                                }
                                else
                                {
@@ -1184,10 +1174,7 @@ _FormImpl::OnChangeLayout(_ControlOrientation orientation)
 
                                if (prevPoint.y < 0.0f)
                                {
-                                       float prevGap = prevSize.height + prevPoint.y;
-                                       float curGap = portraitSize.width / portraitSize.height * prevGap;
-
-                                       curPoint.y = curGap - prevSize.height;
+                                       curPoint.y = portraitSize.height / portraitSize.width * prevPoint.y;
                                }
                                else
                                {
@@ -1285,6 +1272,20 @@ _FormImpl::OnChangeLayout(_ControlOrientation orientation)
                if (GetCore().IsIndicatorVisible())
                {
                        indicatorBounds = GetCore().GetIndicatorBoundsF();
+                       if (GetCore().IsIndicatorTranslucent())
+                       {
+                               if (!GetCore().IsHeaderTranslucent())
+                               {
+                                       indicatorBounds.height = 0.0f;
+                               }
+                               else
+                               {
+                                       if (orientation == _CONTROL_ORIENTATION_LANDSCAPE)
+                                       {
+                                               indicatorBounds.height = 0.0f;
+                                       }
+                               }
+                       }
                }
 
                float posY = indicatorBounds.height + titleHeight;
index 810c0cc..c36e3fa 100644 (file)
@@ -362,7 +362,6 @@ _FrameImpl::OnChangeLayout(_ControlOrientation orientation)
                SetMovable(true);
 
                FloatPoint prevPoint = GetPositionF();
-               FloatDimension prevSize = GetSizeF();
 
                FloatPoint curPoint(0.0f, 0.0f);
 
@@ -370,10 +369,7 @@ _FrameImpl::OnChangeLayout(_ControlOrientation orientation)
                {
                        if (prevPoint.x < 0.0f)
                        {
-                               float prevGap = prevSize.width + prevPoint.x;
-                               float curGap = screenSize.width / screenSize.height * prevGap;
-
-                               curPoint.x = curGap - prevSize.width;
+                               curPoint.x = screenSize.height / screenSize.width * prevPoint.x;
                        }
                        else
                        {
@@ -382,10 +378,7 @@ _FrameImpl::OnChangeLayout(_ControlOrientation orientation)
 
                        if (prevPoint.y < 0.0f)
                        {
-                               float prevGap = prevSize.height + prevPoint.y;
-                               float curGap = screenSize.height / screenSize.width * prevGap;
-
-                               curPoint.y = curGap - prevSize.height;
+                               curPoint.y = screenSize.width / screenSize.height * prevPoint.y;
                        }
                        else
                        {
@@ -396,10 +389,7 @@ _FrameImpl::OnChangeLayout(_ControlOrientation orientation)
                {
                        if (prevPoint.x < 0.0f)
                        {
-                               float prevGap = prevSize.width + prevPoint.x;
-                               float curGap = screenSize.height / screenSize.width * prevGap;
-
-                               curPoint.x = curGap - prevSize.width;
+                               curPoint.x = screenSize.width / screenSize.height * prevPoint.x;
                        }
                        else
                        {
@@ -408,10 +398,7 @@ _FrameImpl::OnChangeLayout(_ControlOrientation orientation)
 
                        if (prevPoint.y < 0.0f)
                        {
-                               float prevGap = prevSize.height + prevPoint.y;
-                               float curGap = screenSize.width / screenSize.height * prevGap;
-
-                               curPoint.y = curGap - prevSize.height;
+                               curPoint.y = screenSize.height / screenSize.width * prevPoint.y;
                        }
                        else
                        {
index 6b7c56a..b1ca8b9 100644 (file)
@@ -25,6 +25,7 @@
 #include "FUi_TouchFlickGestureDetector.h"
 #include "FUi_TouchTapGestureDetector.h"
 #include "FUi_TouchPinchGestureDetector.h"
+#include "FUi_TouchLongPressGestureDetector.h"
 #include "FUiCtrl_Gallery.h"
 #include "FUiCtrl_GalleryBitmap.h"
 #include "FUiCtrl_GalleryPresenter.h"
@@ -51,6 +52,7 @@ _Gallery::_Gallery(void)
        : __pRenderer(null)
        , __pPresenter(null)
        , __modelInitialized(false)
+       , __longPressed(false)
        , __pGalleryImageElement(null)
 {
        _AccessibilityContainer* pContainer = GetAccessibilityContainer();
@@ -118,6 +120,20 @@ _Gallery::~_Gallery(void)
                SysAssert(false);
        }
 
+       r = __longPressGesture.RemoveGestureListener(*this);
+       if (r != E_SUCCESS)
+       {
+               SetLastResult(r);
+               SysAssert(false);
+       }
+
+       r = RemoveGestureDetector(__longPressGesture);
+       if (r != E_SUCCESS)
+       {
+               SetLastResult(r);
+               SysAssert(false);
+       }
+
        r = _SettingInfoImpl::RemoveSettingEventListenerForInternal(*this);
        if (r != E_SUCCESS)
        {
@@ -203,6 +219,12 @@ _Gallery::Construct(_GalleryItemProviderAdaptorImpl* pGalleryItemProviderAdaptor
        r = __pinchGesture.AddGestureListener(*this);
        SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
 
+       r = __longPressGesture.AddGestureListener(*this);
+       SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+
+       r = _Control::AddGestureDetector(__longPressGesture);
+       SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+
        r = _SettingInfoImpl::AddSettingEventListenerForInternal(*this);
        SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
 
@@ -397,6 +419,7 @@ _Gallery::RequestToUpdateAllItems(void)
 bool
 _Gallery::OnFlickGestureDetected(_TouchFlickGestureDetector& gesture)
 {
+       __longPressed = false;
        _GalleryViewEventInfo viewEventInfo;
        int distanceX = 0;
        int distanceY = 0;
@@ -422,6 +445,7 @@ _Gallery::OnFlickGestureCanceled(_TouchFlickGestureDetector& gesture)
 bool
 _Gallery::OnTapGestureDetected(_TouchTapGestureDetector& gesture)
 {
+       __longPressed = false;
        if (gesture.GetTapCount() == 1)
        {
                PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP);
@@ -450,7 +474,7 @@ _Gallery::OnTapGestureCanceled(_TouchTapGestureDetector& gesture)
 bool
 _Gallery::OnPinchGestureStarted(_TouchPinchGestureDetector& gesture)
 {
-       //return OnPinchGestureChanged(gesture);
+       __longPressed = false;
        return true;
 }
 
@@ -479,6 +503,19 @@ _Gallery::OnPinchGestureCanceled(_TouchPinchGestureDetector& gesture)
        return false;
 }
 
+bool
+_Gallery::OnLongPressGestureDetected(_TouchLongPressGestureDetector& gesture)
+{
+       __longPressed = true;
+       return true;
+}
+
+bool
+_Gallery::OnLongPressGestureCanceled(_TouchLongPressGestureDetector& gesture)
+{
+       return true;
+}
+
 // Touch Event Callbacks
 bool
 _Gallery::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo)
@@ -495,12 +532,21 @@ _Gallery::OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo)
        _GalleryViewEventInfo viewEventInfo(const_cast <_TouchInfo&>(touchinfo));
        _GalleryViewEvent viewEvent(GALLERY_VIEW_EVENT_TOUCH_RELEASED, &viewEventInfo);
 
-       return GetPresenter().PostEvent(viewEvent);
+       bool touchReturn = GetPresenter().PostEvent(viewEvent);
+       if (__longPressed == true)
+       {
+               PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP);
+               __longPressed = false;
+       }
+
+       return touchReturn;
 }
 
 bool
 _Gallery::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo)
 {
+       __longPressed = false;
+
        _GalleryViewEventInfo viewEventInfo(const_cast <_TouchInfo&>(touchinfo));
        _GalleryViewEvent viewEvent(GALLERY_VIEW_EVENT_TOUCH_MOVED, &viewEventInfo);
 
index 1c459ad..8e179e3 100644 (file)
@@ -25,6 +25,7 @@
 #include <FGrpCanvas.h>
 #include <FUiAnimVisualElementPropertyAnimation.h>
 #include <FUiCtrlIconListViewItem.h>
+#include <FGrpCoordinateSystem.h>
 #include <FGrp_BitmapImpl.h>
 #include <FGrp_CanvasImpl.h>
 #include <FGrp_TextTextObject.h>
@@ -339,10 +340,10 @@ _IconListItem::DrawBitmap(Canvas& canvas, Bitmap& bitmap, bool isFocused, float
        float borderWidth = __pProperty->GetDropShadowBorderWidth();
        if (__pProperty->GetBorderStyle() == ICON_LIST_VIEW_ITEM_BORDER_STYLE_SHADOW || __pProperty->GetBorderStyle() == ICON_LIST_VIEW_ITEM_BORDER_STYLE_OUTLINE)
        {
-               rect.x += 1.0f;
-               rect.y += 1.0f;
-               rect.width -= borderWidth;
-               rect.height -= borderWidth;
+               rect.x += CoordinateSystem::ConvertToLogicalX(1.0f);
+               rect.y += CoordinateSystem::ConvertToLogicalY(1.0f);
+               rect.width -= CoordinateSystem::ConvertToLogicalX(borderWidth);
+               rect.height -= CoordinateSystem::ConvertToLogicalY(borderWidth);
        }
 
        float width = rect.width;
index b546019..0d9a128 100644 (file)
@@ -977,9 +977,7 @@ _IconListPresenter::UpdateList(void)
        __listStatusChanged = true;
 
        AddGroupAndRestoreItem(true);
-
        __pIconListView->Draw();
-       __pIconListView->Show();
 
        return E_SUCCESS;
 }
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 b17068d..79c8211 100644 (file)
@@ -908,4 +908,10 @@ _Keypad::OnSettingChanged(String& key)
        }
 }
 
+bool
+_Keypad::IsLayoutChangable(void) const
+{
+       return true;
+}
+
 } } } // Tizen::Ui::Controls
index afbdd2f..cf292e9 100644 (file)
@@ -236,6 +236,8 @@ _Label::OnFontChanged(Font* pFont)
 {
        __pLabelPresenter->OnFontChanged(pFont);
 
+       _Control::OnFontChanged(pFont);
+
        return;
 }
 
@@ -533,20 +535,14 @@ _Label::GetBottomMarginF(void) const
        return __bottomMargin;
 }
 
-Dimension
-_Label::GetContentSize(void) const
-{
-       return _CoordinateSystemUtils::ConvertToInteger(GetContentSizeInternalF());
-}
-
 FloatDimension
-_Label::GetContentSizeF(void) const
+_Label::GetContentSizeF(bool horizontalMode, bool verticalMode) const
 {
-       return GetContentSizeInternalF();
+       return GetContentSizeInternalF(horizontalMode, verticalMode);
 }
 
 FloatDimension
-_Label::GetContentSizeInternalF(void) const
+_Label::GetContentSizeInternalF(bool horizontalMode, bool verticalMode) const
 {
        if (__text.IsEmpty() && __pBackgroundBitmap == null)
        {
@@ -562,10 +558,10 @@ _Label::GetContentSizeInternalF(void) const
        TextObjectWrapType previousWrapType = pTextObject->GetWrap();
        FloatRectangle previousRect = pTextObject->GetBoundsF();
 
+       pTextObject->SetBounds(FloatRectangle(0.0f, 0.0f, GetBoundsF().width - __leftMargin * 2, GetBoundsF().height - __topMargin * 2));
        pTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_NONE);
        pTextObject->SetWrap(TEXT_OBJECT_WRAP_TYPE_WORD);
        pTextObject->Compose();
-       dimension = pTextObject->GetTextExtentF(0, pTextObject->GetTextLength());
 
        _ControlOrientation orientation = GetOrientation();
        if (orientation == _CONTROL_ORIENTATION_PORTRAIT)
@@ -577,24 +573,34 @@ _Label::GetContentSizeInternalF(void) const
                contentRect.width = _ControlManager::GetInstance()->GetScreenSizeF().height;
        }
 
-       if (dimension.width > contentRect.width - GetBoundsF().x - __leftMargin * 2)
+       if (horizontalMode == true)
        {
-               dimension.width = contentRect.width - GetBoundsF().x - __leftMargin * 2;
+               dimension = pTextObject->GetTextExtentF(0, pTextObject->GetTextLength());
+
+               if (dimension.width > contentRect.width - GetBoundsF().x - __leftMargin * 2)
+               {
+                       dimension.width = contentRect.width - GetBoundsF().x - __leftMargin * 2;
 
-               pTextObject->SetBounds(FloatRectangle(previousRect.x, previousRect.y, dimension.width, previousRect.height));
-               pTextObject->Compose();
+                       pTextObject->SetBounds(FloatRectangle(previousRect.x, previousRect.y, dimension.width, previousRect.height));
+                       pTextObject->Compose();
 
-               dimension.height = pTextObject->GetTotalHeightF();
+                       dimension.height = pTextObject->GetTotalHeightF();
+               }
        }
 
-       if (dimension.width > GetBoundsF().width - __leftMargin * 2)
+       if (verticalMode == true)
        {
-               dimension.width = GetBoundsF().width - __leftMargin * 2;
+               dimension = pTextObject->GetTextExtentF();
 
-               pTextObject->SetBounds(FloatRectangle(previousRect.x, previousRect.y, dimension.width, previousRect.height));
-               pTextObject->Compose();
+               if (dimension.width > GetBoundsF().width - __leftMargin * 2)
+               {
+                       dimension.width = GetBoundsF().width - __leftMargin * 2;
 
-               dimension.height = pTextObject->GetTotalHeightF();
+                       pTextObject->SetBounds(FloatRectangle(previousRect.x, previousRect.y, dimension.width, previousRect.height));
+                       pTextObject->Compose();
+
+                       dimension.height = pTextObject->GetTotalHeightF();
+               }
        }
 
        pTextObject->SetBounds(previousRect);
index 930b90f..cec36fb 100644 (file)
@@ -192,16 +192,10 @@ _LabelImpl::OnBoundsChanged(const FloatRectangle& oldRect, const FloatRectangle&
        return E_SUCCESS;
 }
 
-Tizen::Graphics::Dimension
-_LabelImpl::GetContentSize(void) const
-{
-       return GetCore().GetContentSize();
-}
-
 Tizen::Graphics::FloatDimension
-_LabelImpl::GetContentSizeF(void) const
+_LabelImpl::GetContentSizeF(bool horizontalMode, bool verticalMode) const
 {
-       return GetCore().GetContentSizeF();
+       return GetCore().GetContentSizeF(horizontalMode, verticalMode);
 }
 
 result
index 4e3bb4c..b215241 100644 (file)
@@ -155,6 +155,7 @@ _LabelPresenter::OnFontChanged(Font* pFont)
        {
                __pTextObject->SetFont(__pFont, 0, __pTextObject->GetTextLength());
        }
+
        return;
 }
 
index 7ba002b..88b32f9 100644 (file)
@@ -77,8 +77,6 @@ _ListBaseImpl::CreateMergedBitmapN(Bitmap& pNormalBitmap, Bitmap* pSelectedBitma
        Canvas* pCanvas = null;
 
        Rectangle bitmapBounds;
-       Color canvasBackgroundColor;
-
        result r = E_SUCCESS;
 
        bitmapBounds =  Rectangle(0, 0, pNormalBitmap.GetWidth(), pNormalBitmap.GetHeight());
@@ -86,10 +84,8 @@ _ListBaseImpl::CreateMergedBitmapN(Bitmap& pNormalBitmap, Bitmap* pSelectedBitma
        pCanvas = new (std::nothrow) Canvas();
        SysTryReturn(NID_UI_CTRL, pCanvas != null, null, E_OUT_OF_MEMORY, "Memory allocation failed.");
 
-       GET_COLOR_CONFIG(TABLEVIEW::ITEM_ANNEX_CANVAS_BG_NORMAL, canvasBackgroundColor);
-
        pCanvas->Construct(bitmapBounds);
-       pCanvas->SetBackgroundColor(Color(canvasBackgroundColor.GetRed(), canvasBackgroundColor.GetGreen(), canvasBackgroundColor.GetBlue(), 0));
+       pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
        pCanvas->Clear();
 
        if (_BitmapImpl::CheckNinePatchedBitmapStrictly(pNormalBitmap))
@@ -138,11 +134,8 @@ _ListBaseImpl::CreateOnOffMergedBitmapN(Bitmap& pNormalBitmap, Bitmap& pSelected
        Canvas* pCanvas = null;
 
        Rectangle bitmapBounds;
-
-       result r = E_SUCCESS;
-
        Rectangle handlerBounds;
-       Color canvasBackgroundColor;
+       result r = E_SUCCESS;
 
        bitmapBounds =  Rectangle(0, 0, pNormalBitmap.GetWidth(), pNormalBitmap.GetHeight());
 
@@ -161,10 +154,8 @@ _ListBaseImpl::CreateOnOffMergedBitmapN(Bitmap& pNormalBitmap, Bitmap& pSelected
        pCanvas = new (std::nothrow) Canvas();
        SysTryReturn(NID_UI_CTRL, pCanvas != null, null, E_OUT_OF_MEMORY, "Memory allocation failed.");
 
-       GET_COLOR_CONFIG(TABLEVIEW::ITEM_ANNEX_CANVAS_BG_NORMAL, canvasBackgroundColor);
-
        pCanvas->Construct(bitmapBounds);
-       pCanvas->SetBackgroundColor(Color(canvasBackgroundColor.GetRed(), canvasBackgroundColor.GetGreen(), canvasBackgroundColor.GetBlue(), 0));
+       pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
        pCanvas->Clear();
 
        if (_BitmapImpl::CheckNinePatchedBitmapStrictly(pNormalBitmap))
index be1f19e..d8ca2ee 100644 (file)
@@ -49,6 +49,8 @@ _OptionMenu::_OptionMenu(void)
        , __pActionEvent(null)
        , __pSubMenu(null)
        , __subMenuIndex(-1)
+       , __currentFocusedIndex(-1)
+       , __isFocused(false)
 {
 }
 
@@ -360,13 +362,13 @@ _OptionMenu::ShowSubMenu(int mainIndex, _OptionMenuItem& item)
                        CONTEXT_MENU_CORE_STYLE_LIST,
                        CONTEXT_MENU_CORE_ALIGN_UP);
 
-        __pSubMenu->SetFocusable(true);
-
        if (__pSubMenu == null)
        {
                return GetLastResult();
        }
 
+       __pSubMenu->SetFocusable(true);
+
        if (__pSubMenu->GetOwner() == null)
        {
                _Frame* pFrame = dynamic_cast<_Frame*>(_ControlManager::GetInstance()->GetCurrentFrame());
@@ -511,7 +513,6 @@ _OptionMenu::OnActivated(void)
        }
 
        SetTouchCapture(true, false);
-
        _Window::OnActivated();
 }
 
@@ -566,6 +567,88 @@ _OptionMenu::OnActionPerformed(const _Control& source, int actionId)
        __pOptionMenuPresenter->OnActionPerformed(source, actionId);
 }
 
+bool
+_OptionMenu::OnFocusGained(const _Control &source)
+{
+       __currentFocusedIndex = -1;
+       __isFocused = false;
+       return true;
+}
+
+bool
+_OptionMenu::OnFocusLost(const _Control &source)
+{
+       __pOptionMenuPresenter->ClearFocus(__currentFocusedIndex);
+       __isFocused = false;
+       return true;
+}
+
+void
+_OptionMenu::OnDrawFocus(void)
+{
+       if (!__isFocused)
+       {
+               __isFocused = true;
+               __currentFocusedIndex = -1;
+               __pOptionMenuPresenter->DrawFocus(__currentFocusedIndex);
+       }
+       return;
+}
+
+bool
+_OptionMenu::OnKeyPressed(const _Control &source, const _KeyInfo &keyInfo)
+{
+       if (&source != this)
+       {
+               return false;
+       }
+
+       _KeyCode keyCode = keyInfo.GetKeyCode();
+
+       int count = GetItemCount();
+
+       if(!__isFocused)
+       {
+               return false;
+       }
+
+       switch(keyCode)
+       {
+       case _KEY_RIGHT:
+               if (__currentFocusedIndex >= (count - 1))
+               {
+                       __currentFocusedIndex = count - 1;
+               }
+               else
+               {
+                       __currentFocusedIndex++;
+               }
+               break;
+
+       case _KEY_LEFT:
+               if (__currentFocusedIndex <= -1)
+               {
+                       __currentFocusedIndex = -1;
+               }
+               else
+               {
+                       __currentFocusedIndex--;
+               }
+               break;
+
+       case _KEY_ENTER:
+               __pOptionMenuPresenter->OnEnterKeyPressed(__currentFocusedIndex);
+
+               return true;
+
+       default :
+               return false;
+       }
+       __pOptionMenuPresenter->DrawFocus(__currentFocusedIndex);
+
+       return true;
+}
+
 void
 _OptionMenu::SetBoundsAllAccessibilityElement(void)
 {
index 10ece50..a9c94c6 100644 (file)
@@ -144,6 +144,7 @@ _OptionMenuPresenter::_OptionMenuPresenter(_OptionMenu* optionMenu)
        , __isHandlerPressed(false)
        , __isClosing(false)
        , __isAnimationStarted(false)
+       , __focusedIndex(-1)
        , __pOptionMenuVE(null)
        , __pThirtyThreeTimingFunction(null)
        , __pSixtyTimingFunction(null)
@@ -487,6 +488,7 @@ _OptionMenuPresenter::DrawHandler(Canvas& canvas)
        arrowBounds.height = pHandleArrowBitmap->GetHeightF();
 
        r = DrawResourceBitmap(canvas, arrowBounds, pHandleArrowBitmap);
+       __arrowBounds = arrowBounds;
        SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
 
        if (!isCustomHandleBitmap && (pHandleEffectBitmap!= null))
@@ -736,6 +738,124 @@ _OptionMenuPresenter::DrawItemLine(Canvas& canvas)
 }
 
 result
+_OptionMenuPresenter::DrawFocus(int index)
+{
+       ClearFocus(__focusedIndex);
+
+       result r = E_SUCCESS;
+
+       Canvas* pCanvas;
+       pCanvas = __pOptionMenu->GetCanvasN();
+
+       SysTryReturn(NID_UI_CTRL, (pCanvas != null), r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+       FloatRectangle bounds;
+
+       if (index == -1)
+       {
+               bounds = __arrowBounds;
+       }
+       else
+       {
+               bounds = GetItemBounds(index);
+       }
+
+       Bitmap* pBitmap = null;
+       r = GET_BITMAP_CONFIG_N(FOCUSUI::FOCUS, BITMAP_PIXEL_FORMAT_ARGB8888, pBitmap);
+       SysTryCatch(NID_UI_CTRL, (pBitmap != null), , r, "[%s] Propagating.", GetErrorMessage(r));
+
+       if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*pBitmap))
+       {
+               r = pCanvas->DrawNinePatchedBitmap(bounds, *pBitmap);
+       }
+       else
+       {
+               r = pCanvas->DrawBitmap(bounds, *pBitmap);
+       }
+
+       __focusedIndex = index;
+
+       delete pCanvas;
+       delete pBitmap;
+
+       return r;
+
+CATCH:
+       delete pCanvas;
+
+       return r;
+}
+
+result
+_OptionMenuPresenter::ClearFocus(int index)
+{
+       result r = E_SUCCESS;
+       Canvas* pCanvas;
+
+       pCanvas = __pOptionMenu->GetCanvasN();
+       SysTryReturn(NID_UI_CTRL, (pCanvas != null), r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+       Color background;
+       GET_COLOR_CONFIG(OPTIONMENU::ITEM_BG_NORMAL, background);
+
+       FloatRectangle bounds;
+
+       if (index == -1)
+       {
+               bounds = __arrowBounds;
+       }
+       else
+       {
+               bounds = GetItemBounds(index);
+       }
+
+       pCanvas->SetBackgroundColor(background);
+       pCanvas->Clear(bounds);
+
+       if (index == -1)
+       {
+               DrawHandler(*pCanvas);
+       }
+       else
+       {
+               DrawItem(*pCanvas, index);
+       }
+
+       DrawItemLine(*pCanvas);
+
+       delete pCanvas;
+       return r;
+}
+
+void
+_OptionMenuPresenter::OnEnterKeyPressed(int selectedIndex)
+{
+       if (selectedIndex == -1)
+       {
+               __isHandlerPressed = false;
+               Hide();
+       }
+       else
+       {
+               _OptionMenuItem* pItem = __pOptionMenuModel->GetItem(selectedIndex);
+               if (pItem != null)
+               {
+                       if (pItem->HasSubItem() == true)
+                       {
+                               __pOptionMenu->ShowSubMenu(selectedIndex, *pItem);
+                       }
+                       else
+                       {
+                               // Fire Action Event
+                               Hide();
+                               __pOptionMenu->FireActionEvent(pItem->GetActionId());
+                       }
+               }
+       }
+       return;
+}
+
+result
 _OptionMenuPresenter::RefreshItem(int index)
 {
        if (index < 0 || index >= __pOptionMenuModel->GetItemCount())
@@ -1377,7 +1497,7 @@ _OptionMenuPresenter::OnTouchPressed(const _Control& source, const _TouchInfo& t
                return false;
        }
 
-       SysTryReturn(NID_UI_CTRL, (!__isAnimationStarted), false, E_SUCCESS, "[E_SUCCESS] Animation     is in Progress.");
+       SysTryReturn(NID_UI_CTRL, (!__isAnimationStarted), false, E_SUCCESS, "[E_SUCCESS] Animation is in Progress.");
 
        if (__pOptionMenu->IsSubMenuShown() == true)
        {
index 3e95345..5404848 100644 (file)
@@ -199,7 +199,7 @@ _PanelImpl::OnAttachedToMainTree(void)
                                SysLogException(NID_UI_CTRL, r, "[%s] SetBounds failed", GetErrorMessage(r));
                        }
 
-                       SetChildBuilderBouds(this, controlOrientation);
+                       SetChildBuilderBounds(this, controlOrientation);
                }
        }
 
@@ -209,19 +209,24 @@ _PanelImpl::OnAttachedToMainTree(void)
 }
 
 void
-_PanelImpl::SetChildBuilderBouds(_ContainerImpl* pContainerImpl, _ControlOrientation controlOrientation)
+_PanelImpl::SetChildBuilderBounds(_ContainerImpl* pContainerImpl, _ControlOrientation controlOrientation)
 {
        FloatRectangle builderBounds;
        _ContainerImpl* pTempContainerImpl;
        for(int i = 0; i < pContainerImpl->GetChildCount(); i++)
        {
                _ControlImpl* pControlImpl =  pContainerImpl->GetChild(i);
-               pControlImpl->GetBuilderBoundsF(controlOrientation, builderBounds);
+               bool exist = pControlImpl->GetBuilderBoundsF(controlOrientation, builderBounds);
+               if (!exist)
+               {
+                       continue;
+               }
+
                pControlImpl->SetBounds(builderBounds);
                pTempContainerImpl = dynamic_cast<_ContainerImpl*>(pControlImpl);
                if (pTempContainerImpl != null)
                {
-                       SetChildBuilderBouds(pTempContainerImpl, controlOrientation);
+                       SetChildBuilderBounds(pTempContainerImpl, controlOrientation);
                }
 
        }
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 64fce2d..282a6a2 100644 (file)
@@ -40,6 +40,7 @@ namespace Tizen { namespace Ui { namespace Controls {
 _Tab::_Tab(void)
        : __pTabPresenter(null)
        , __style(_TAB_STYLE_TEXT)
+       , __currentHighlightedItemIndex(-1)
        , __tabStatus(_TAB_STATUS_NORMAL)
        , __pActionEvent(null)
        , __pGestureLongPress(null)
@@ -262,6 +263,12 @@ _Tab::AddItem(const Bitmap& icon, const String& text, int actionId)
 
        __pTabPresenter->SetRecalculateItemBounds(true);
 
+       if (__pTabPresenter->GetItemStatus(__currentHighlightedItemIndex) == _TABITEM_STATUS_HIGHLIGHTED)
+       {
+               __pTabPresenter->SetItemStatus(__currentHighlightedItemIndex, _TABITEM_STATUS_NORMAL);
+       }
+       __currentHighlightedItemIndex = 0;
+
        return __tabItems.Add(*pItem);
 }
 
@@ -304,6 +311,12 @@ _Tab::AddItem(const Bitmap& icon, int actionId)
 
        __pTabPresenter->SetRecalculateItemBounds(true);
 
+       if (__pTabPresenter->GetItemStatus(__currentHighlightedItemIndex) == _TABITEM_STATUS_HIGHLIGHTED)
+       {
+               __pTabPresenter->SetItemStatus(__currentHighlightedItemIndex, _TABITEM_STATUS_NORMAL);
+       }
+       __currentHighlightedItemIndex = 0;
+
        return __tabItems.Add(*pItem);
 }
 
@@ -346,6 +359,11 @@ _Tab::AddItem(const String& text, int actionId)
 
        __pTabPresenter->SetRecalculateItemBounds(true);
 
+       if (__pTabPresenter->GetItemStatus(__currentHighlightedItemIndex) == _TABITEM_STATUS_HIGHLIGHTED)
+       {
+               __pTabPresenter->SetItemStatus(__currentHighlightedItemIndex, _TABITEM_STATUS_NORMAL);
+       }
+       __currentHighlightedItemIndex = 0;
 
        return __tabItems.Add(*pItem);
 }
@@ -410,6 +428,12 @@ _Tab::InsertItemAt(int index, const Bitmap& icon, const String& text, int action
                SetSelectedItemIndex(selectedIndex);
        }
 
+       if (__pTabPresenter->GetItemStatus(__currentHighlightedItemIndex) == _TABITEM_STATUS_HIGHLIGHTED)
+       {
+               __pTabPresenter->SetItemStatus(__currentHighlightedItemIndex, _TABITEM_STATUS_NORMAL);
+       }
+       __currentHighlightedItemIndex = 0;
+
        return r;
 }
 
@@ -469,6 +493,12 @@ _Tab::InsertItemAt(int index, const Bitmap& icon, int actionId)
                SetSelectedItemIndex(selectedIndex);
        }
 
+       if (__pTabPresenter->GetItemStatus(__currentHighlightedItemIndex) == _TABITEM_STATUS_HIGHLIGHTED)
+       {
+               __pTabPresenter->SetItemStatus(__currentHighlightedItemIndex, _TABITEM_STATUS_NORMAL);
+       }
+       __currentHighlightedItemIndex = 0;
+
        return r;
 }
 
@@ -528,6 +558,12 @@ _Tab::InsertItemAt(int index, const String& text, int actionId)
                SetSelectedItemIndex(selectedIndex);
        }
 
+       if (__pTabPresenter->GetItemStatus(__currentHighlightedItemIndex) == _TABITEM_STATUS_HIGHLIGHTED)
+       {
+               __pTabPresenter->SetItemStatus(__currentHighlightedItemIndex, _TABITEM_STATUS_NORMAL);
+       }
+       __currentHighlightedItemIndex = 0;
+
        return r;
 }
 
@@ -672,12 +708,31 @@ _Tab::RemoveItemAt(int index)
 
        SetSelectedItemIndex(0);
 
+       if (__pTabPresenter->GetItemStatus(__currentHighlightedItemIndex) == _TABITEM_STATUS_HIGHLIGHTED)
+       {
+               __pTabPresenter->SetItemStatus(__currentHighlightedItemIndex, _TABITEM_STATUS_NORMAL);
+       }
+       if(GetItemCount() > 0)
+       {
+               __currentHighlightedItemIndex = 0;
+       }
+       else
+       {
+               __currentHighlightedItemIndex = -1;
+       }
+
        return r;
 }
 
 result
 _Tab::RemoveAllItems(void)
 {
+       if (__pTabPresenter->GetItemStatus(__currentHighlightedItemIndex) == _TABITEM_STATUS_HIGHLIGHTED)
+       {
+               __pTabPresenter->SetItemStatus(__currentHighlightedItemIndex, _TABITEM_STATUS_NORMAL);
+       }
+       __currentHighlightedItemIndex = -1;
+
        __pTabPresenter->SetRecalculateItemBounds(true);
        SetSelectedItemIndex(0);
        SetFirstDrawnItemIndex(-1);
@@ -1180,6 +1235,12 @@ _Tab::GetStyle(void) const
        return _TabStyle(__style);
 }
 
+int
+_Tab::GetCurrentHighlightedItemIndex(void) const
+{
+       return __currentHighlightedItemIndex;
+}
+
 void
 _Tab::AddActionEventListener(const _IActionEventListener& listener)
 {
@@ -1217,6 +1278,12 @@ _Tab::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo)
                return true;
        }
 
+       if (__pTabPresenter->GetItemStatus(__currentHighlightedItemIndex) == _TABITEM_STATUS_HIGHLIGHTED)
+       {
+               __pTabPresenter->SetItemStatus(__currentHighlightedItemIndex, _TABITEM_STATUS_NORMAL);
+       }
+       __currentHighlightedItemIndex = -1;
+
        return __pTabPresenter->OnTouchPressed(source, touchinfo);
 }
 
@@ -1331,6 +1398,128 @@ _Tab::OnFontInfoRequested(unsigned long& style, float& size)
     return;
 }
 
+bool
+_Tab::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo)
+{
+       if (this != &source)
+       {
+               return false;
+       }
+       _KeyCode keyCode = keyInfo.GetKeyCode();
+       int itemCount = __pTabPresenter->GetItemCount();
+       if(itemCount == 0)
+       {
+               return false;
+       }
+
+       if (keyCode == _KEY_RIGHT)
+       {
+               if (__currentHighlightedItemIndex < (itemCount - 1))
+               {
+                       if (__pTabPresenter->GetItemStatus(__currentHighlightedItemIndex) != _TABITEM_STATUS_SELECTED)
+                       {
+                               __pTabPresenter->SetItemStatus(__currentHighlightedItemIndex, _TABITEM_STATUS_NORMAL);
+                       }
+
+                       __currentHighlightedItemIndex++;
+
+                       if (__pTabPresenter->GetItemStatus(__currentHighlightedItemIndex) != _TABITEM_STATUS_SELECTED)
+                       {
+                               __pTabPresenter->SetItemStatus(__currentHighlightedItemIndex, _TABITEM_STATUS_HIGHLIGHTED);
+                       }
+                       __pTabPresenter->ShiftToFocusedItem(__currentHighlightedItemIndex, _FOCUS_DIRECTION_MOVE_RIGHT);
+               }
+               return true;
+       }
+
+       if (keyCode == _KEY_LEFT)
+       {
+               if (__currentHighlightedItemIndex >= -1)
+               {
+                       if (__pTabPresenter->GetItemStatus(__currentHighlightedItemIndex) != _TABITEM_STATUS_SELECTED)
+                       {
+                               __pTabPresenter->SetItemStatus(__currentHighlightedItemIndex, _TABITEM_STATUS_NORMAL);
+                       }
+                       if (__currentHighlightedItemIndex == -1)
+                       {
+                               __currentHighlightedItemIndex = 0;
+                       }
+                       if (__currentHighlightedItemIndex > 0)
+                       {
+                               __currentHighlightedItemIndex--;
+                       }
+                       if (__pTabPresenter->GetItemStatus(__currentHighlightedItemIndex) != _TABITEM_STATUS_SELECTED)
+                       {
+                               __pTabPresenter->SetItemStatus(__currentHighlightedItemIndex, _TABITEM_STATUS_HIGHLIGHTED);
+                       }
+                       __pTabPresenter->ShiftToFocusedItem(__currentHighlightedItemIndex, _FOCUS_DIRECTION_MOVE_LEFT);
+               }
+               return true;
+       }
+
+       if (keyCode == _KEY_ENTER && __currentHighlightedItemIndex != -1)
+       {
+               __pTabPresenter->SetItemStatus(__currentHighlightedItemIndex, _TABITEM_STATUS_SELECTED);
+               __pTabPresenter->SetSelectedItemIndex(__currentHighlightedItemIndex);
+               Invalidate();
+               return true;
+       }
+       return false;
+}
+
+bool
+_Tab::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo)
+{
+       return false;
+}
+
+bool
+_Tab::OnFocusGained(const _Control & source)
+{
+       if (this != &source)
+       {
+               return false;
+       }
+
+       if(__pTabPresenter->GetItemCount() > 0)
+       {
+               __currentHighlightedItemIndex = 0;
+       }
+       else
+       {
+               __currentHighlightedItemIndex = -1;
+       }
+       return true;
+}
+
+bool
+_Tab::OnFocusLost(const _Control & source)
+{
+       if (this != &source)
+       {
+               return false;
+       }
+
+       if (__pTabPresenter->GetItemStatus(__currentHighlightedItemIndex) == _TABITEM_STATUS_HIGHLIGHTED)
+       {
+               __pTabPresenter->SetItemStatus(__currentHighlightedItemIndex, _TABITEM_STATUS_NORMAL);
+       }
+       __currentHighlightedItemIndex = -1;
+       Invalidate();
+       return true;
+}
+
+void
+_Tab::OnDrawFocus()
+{
+       if (__pTabPresenter->GetItemStatus(__currentHighlightedItemIndex) != _TABITEM_STATUS_SELECTED)
+       {
+               __pTabPresenter->SetItemStatus(__currentHighlightedItemIndex, _TABITEM_STATUS_HIGHLIGHTED);
+       }
+       __pTabPresenter->ShiftToFocusedItem(__currentHighlightedItemIndex, _FOCUS_DIRECTION_MOVE_LEFT);
+       return;
+}
+
 void
 _Tab::AddAccessibilityElement(const FloatRectangle& itemBounds, const String& itemText, _TabItemStatus status)
 {
index 785c45d..cbc03f1 100644 (file)
@@ -76,6 +76,7 @@ _TabPresenter::_TabPresenter(void)
        , __pFrontScrollingEffectBitmap(null)
        , __pRearScrollingEffectBitmap(null)
        , __pScrollingEffectBitmap(null)
+       , __pFocusBitmap(null)
        , __pScrollingEffectVe(null)
        , __pFlickAnimationTimer(null)
        , __pScrollAnimationTimer(null)
@@ -204,6 +205,12 @@ _TabPresenter::~_TabPresenter(void)
                __pScrollingEffectBitmap = null;
        }
 
+       if(__pFocusBitmap)
+       {
+               delete __pFocusBitmap;
+               __pFocusBitmap = null;
+       }
+
        if (__pScrollingEffectVe)
        {
                __pScrollingEffectVe->RemoveAllAnimations();
@@ -304,6 +311,9 @@ _TabPresenter::LoadBitmap(void)
        r = GET_BITMAP_CONFIG_N(TAB::TAB_BOUNCE_EFFECT_RIGHT, BITMAP_PIXEL_FORMAT_ARGB8888, __pRearScrollingEffectBitmap);
        SysTryLog(NID_UI_CTRL, r == E_SUCCESS, "Failed to locate overscrolling right bitmap.");
 
+       r = GET_BITMAP_CONFIG_N(FOCUSUI::FOCUS, BITMAP_PIXEL_FORMAT_ARGB8888, __pFocusBitmap);
+       SysTryLog(NID_UI_CTRL, r == E_SUCCESS, "Failed to locate focus bitmap.");
+
        delete pBitmap;
        return r;
 }
@@ -489,7 +499,7 @@ _TabPresenter::Draw(void)
        if (__isRecalculateNeeded)
        {
                __isRecalculateNeeded = false;
-               CalcItemBounds();
+               CalculateItemBounds();
        }
        else if (__isFlickEnabled )
        {
@@ -515,6 +525,11 @@ _TabPresenter::Draw(void)
                DrawItem(pCanvas);
        }
 
+       if (__pTab->GetCurrentHighlightedItemIndex() > -1 && __pTab->IsFocused() && GetItemCount() > 0)
+       {
+               DrawResourceBitmap(*pCanvas, GetItemAt(__pTab->GetCurrentHighlightedItemIndex())->GetItemBounds(), __pFocusBitmap);
+       }
+
        RefreshAccessibilityElement();
 
        delete pCanvas;
@@ -1644,7 +1659,7 @@ _TabPresenter::DrawHorizontal()
 
        if ((bounds.x + __moveDistance) > 0.0f)
        {
-               CalcItemBounds();
+               CalculateItemBounds();
                ResetFlickAnimationTimer();
                return;
        }
@@ -1662,6 +1677,26 @@ _TabPresenter::DrawHorizontal()
        return;
 }
 
+result
+_TabPresenter::ShiftToFocusedItem(int itemIndex, _FocusDirectionMove direction)
+{
+       if (direction == _FOCUS_DIRECTION_MOVE_LEFT && itemIndex == __firstLoadedItemIndex - 1)         //left key pressed
+       {
+               SetItemFit(__firstLoadedItemIndex - 1);
+       }
+       if (direction == _FOCUS_DIRECTION_MOVE_RIGHT && itemIndex == __lastLoadedItemIndex + 1)         //right key pressed
+       {
+               SetItemFit(__firstLoadedItemIndex + 1);
+       }
+       if(itemIndex == 0)              //when touched
+       {
+               SetItemFit(0);
+       }
+       __pTab->Invalidate();
+
+       return E_SUCCESS;
+}
+
 void
 _TabPresenter::DrawBadgeIcon(_TabItem* pDrawItem, Canvas* pCanvas)
 {
@@ -1688,7 +1723,7 @@ _TabPresenter::DrawBadgeIcon(_TabItem* pDrawItem, Canvas* pCanvas)
 }
 
 void
-_TabPresenter::CalcItemBounds(void)
+_TabPresenter::CalculateItemBounds(void)
 {
        ClearLastResult();
 
@@ -1702,7 +1737,7 @@ _TabPresenter::CalcItemBounds(void)
                return;
        }
 
-       CalcTabBounds(true);
+       CalculateTabBounds(true);
 
        FloatRectangle bounds = __pTab->GetBoundsF();
 
@@ -1738,7 +1773,7 @@ _TabPresenter::CalcItemBounds(void)
 }
 
 void
-_TabPresenter::CalcTabBounds(bool isReset)
+_TabPresenter::CalculateTabBounds(bool isReset)
 {
        FloatRectangle bounds = __pTab->GetBoundsF();
 
@@ -1848,7 +1883,7 @@ _TabPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touchin
                {
                        SetItemStatus(pressedIndex, _TABITEM_STATUS_NORMAL);
                }
-               CalcItemBounds();
+               CalculateItemBounds();
 
                __moveDistance = -(GetItemAt(__firstLoadedItemIndex)->GetItemBounds().x);
                DrawHorizontal();
@@ -1861,7 +1896,7 @@ _TabPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touchin
        if (__isEditMode && __editItemIndex == __rearIndex)
        {
                FloatRectangle bounds(0.0f, 0.0f, 0.0f, 0.0f);
-               if(__editItemIndex > 0)
+               if (__editItemIndex > 0)
                {
                        pItem = GetItemAt((__editItemIndex - 1));
                        SysTryReturn(NID_UI_CTRL, pItem, false, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
@@ -1872,7 +1907,7 @@ _TabPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touchin
                }
                else
                {
-                       CalcItemBounds();
+                       CalculateItemBounds();
                }
        }
 
@@ -1904,7 +1939,7 @@ _TabPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touchin
                SetLastLoadedItemIndex();
 
 
-               CalcItemBounds();
+               CalculateItemBounds();
                __moveDistance = -(__firstLoadedItemIndex * __itemWidth);
                DrawHorizontal();
        }
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 e9b4d84..986a961 100644 (file)
@@ -605,9 +605,9 @@ _TextBoxImpl::OnTextBlockSelected(_Control& source, int start, int end)
 }
 
 FloatDimension
-_TextBoxImpl::GetContentSizeF(void) const
+_TextBoxImpl::GetContentSizeF(bool horizontalMode, bool verticalMode) const
 {
-       return __pEdit->GetContentSizeInternalF();
+       return __pEdit->GetContentSizeInternalF(horizontalMode, verticalMode);
 }
 
 _TextBoxImpl*
index cc5d17a..09dadf1 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;
 }
@@ -1253,7 +1334,7 @@ _TokenEditPresenter::CalculateTokenPositionFromIndex(int startIndex, bool leftWa
        int tokenCount = __pTokenList->GetCount();
 
        float tokenLeftMargin = 0.0f;
-       float tokenRighttMargin = 0.0f;
+       float tokenRightMargin = 0.0f;
        float tokenTopMargin = 0.0f;
        float tokenBottomMargin = 0.0f;
        float tokenHeight = 0.0f;
@@ -1265,7 +1346,7 @@ _TokenEditPresenter::CalculateTokenPositionFromIndex(int startIndex, bool leftWa
        _ControlOrientation orientation = __pTokenEdit->GetOrientation();
 
        GET_SHAPE_CONFIG(TOKENEDIT::LEFT_MARGIN, orientation, tokenLeftMargin);
-       GET_SHAPE_CONFIG(TOKENEDIT::RIGHT_MARGIN, orientation, tokenRighttMargin);
+       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);
@@ -1305,9 +1386,9 @@ _TokenEditPresenter::CalculateTokenPositionFromIndex(int startIndex, bool leftWa
                                pToken->displayRect.x = __descriptionTextRectForScroll.x + __descriptionTextRectForScroll.width + descriptionTextRightMargin;
                                pToken->displayRect.y = __descriptionTextRectForScroll.y + __scrollValue;
                        }
-                       else        // Set description text.
+                       else    // Set description text.
                        {
-                               pToken->displayRect.x = tokenTextLeftMargin + __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_LEFT_MARGIN);
+                               pToken->displayRect.x = tokenLeftMargin + __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_LEFT_MARGIN);
                                pToken->displayRect.y = tokenTopMargin + __scrollValue + __pTokenEdit->GetVerticalMarginF(EDIT_TEXT_TOP_MARGIN) + __lineSpacing;
 
                        }
@@ -1322,10 +1403,10 @@ _TokenEditPresenter::CalculateTokenPositionFromIndex(int startIndex, bool leftWa
                                findPrevTokenLoopFlag = false;
                        }
 
-                       float tempTextWidth = tokenEditBounds.width - pPreviousToken->displayRect.x - pPreviousToken->displayRect.width - tokenHorizontalSpacing - tokenTextRightMargin - __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_RIGHT_MARGIN);
+                       float tempTextWidth = tokenEditBounds.width - pPreviousToken->displayRect.x - pPreviousToken->displayRect.width - tokenHorizontalSpacing - tokenRightMargin - __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_RIGHT_MARGIN);
                        if (tokenTextLeftMargin + pToken->GetTextPixelWidth() + tokenTextRightMargin > tempTextWidth)           // Line change
                        {
-                               pToken->displayRect.x = tokenTextLeftMargin + __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_LEFT_MARGIN);
+                               pToken->displayRect.x = tokenLeftMargin + __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_LEFT_MARGIN);
                                pToken->displayRect.y = pPreviousToken->displayRect.y + tokenHeight + tokenVerticalSpacing + __lineSpacing;
                                __lineAdded++;
                        }
@@ -1408,6 +1489,8 @@ _TokenEditPresenter::SetInitialBounds(void)
 {
        result r = E_SUCCESS;
 
+       float tokenLeftMargin = 0.0f;
+       float tokenRightMargin = 0.0f;
        float tokenTopMargin = 0.0f;
        float tokenHeight = 0.0f;
        float tokenMinWidth = 0.0f;
@@ -1419,6 +1502,8 @@ _TokenEditPresenter::SetInitialBounds(void)
        float descriptionTextRightMargin = 0.0f;
        _ControlOrientation orientation = GetEditView()->GetOrientation();
 
+       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::TOKEN_HEIGHT, orientation, tokenHeight);
        GET_SHAPE_CONFIG(TOKENEDIT::TOKEN_MIN_WIDTH, orientation, tokenMinWidth);
@@ -1443,21 +1528,18 @@ _TokenEditPresenter::SetInitialBounds(void)
                        if (__pTokenEdit->GetTitleText().GetLength())
                        {
                                FloatRectangle descriptionTextRect = GetDescriptionTextRect();
-
                                tokenTextRect.x = descriptionTextRect.x + descriptionTextRect.width + descriptionTextRightMargin;
-                               tokenTextRect.width -= (tokenTextLeftMargin + tokenTextRightMargin + descriptionTextRect.width + descriptionTextRightMargin + 2.0f * __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_RIGHT_MARGIN));
                        }
                        else
                        {
-                               tokenTextRect.x = tokenTextLeftMargin + __pTokenEdit->GetHorizontalMargin(EDIT_TEXT_LEFT_MARGIN);
-                               tokenTextRect.width -= (tokenTextLeftMargin + tokenTextRightMargin + 2 * __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_RIGHT_MARGIN));
+                               tokenTextRect.x = tokenLeftMargin + __pTokenEdit->GetHorizontalMargin(EDIT_TEXT_LEFT_MARGIN);
                        }
 
                        tokenTextRect.y = tokenTopMargin + __pTokenEdit->GetVerticalMarginF(EDIT_TEXT_TOP_MARGIN) + textBoundsAlignValue;
+                       tokenTextRect.width -= tokenTextRect.x + tokenRightMargin + __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_RIGHT_MARGIN);
                        tokenTextRect.height = textObjectMaxHeight;
 
                        SetTextBounds(tokenTextRect);
-
                        return r;
                }
 
@@ -1467,21 +1549,19 @@ _TokenEditPresenter::SetInitialBounds(void)
                SysTryReturn(NID_UI_CTRL, pToken, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has occurred. The _Token instance is null");
 
                float tempTextRectWidth = 0.0f;
-               tempTextRectWidth = tokenEditBounds.width - pToken->displayRect.x - pToken->displayRect.width - tokenHorizontalSpacing - __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_RIGHT_MARGIN);
+               tempTextRectWidth = tokenEditBounds.width - pToken->displayRect.x - pToken->displayRect.width - tokenHorizontalSpacing - tokenRightMargin - __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_RIGHT_MARGIN);
                if (tokenMinWidth > tempTextRectWidth)        // Line change
                {
-                       tokenTextRect.x = tokenTextLeftMargin + __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_LEFT_MARGIN);
+                       tokenTextRect.x = tokenLeftMargin + __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_LEFT_MARGIN);
                        tokenTextRect.y = pToken->displayRect.y + tokenHeight + tokenVerticalSpacing + __lineSpacing + textBoundsAlignValue;
-                       tokenTextRect.width = tokenEditBounds.width - tokenTextLeftMargin - tokenTextRightMargin - 2 * __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_RIGHT_MARGIN);
                }
                else
                {
                        tokenTextRect.x = pToken->displayRect.x + pToken->displayRect.width + tokenHorizontalSpacing;
                        tokenTextRect.y = pToken->displayRect.y + textBoundsAlignValue;
-                       tokenTextRect.width = tokenEditBounds.width - pToken->displayRect.x - pToken->displayRect.width -
-                                       tokenTextRightMargin - __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_RIGHT_MARGIN) - tokenTextLeftMargin;
                }
 
+               tokenTextRect.width -= tokenTextRect.x + tokenRightMargin + __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_RIGHT_MARGIN);
                tokenTextRect.height = textObjectMaxHeight;
 
                SetTextBounds(tokenTextRect);
@@ -1676,6 +1756,7 @@ _TokenEditPresenter::CalculateDescriptionTextRect(const String& descriptionText)
        result r = E_SUCCESS;
 
        TextSimple* pSimpleText = null;
+       float leftMargin = 0.0f;
        float tokenTopMargin = 0.0f;
        float tokenHeight = 0.0f;
        float tokenVerticalSpacing = 0.0f;
@@ -1685,6 +1766,7 @@ _TokenEditPresenter::CalculateDescriptionTextRect(const String& descriptionText)
        _ControlOrientation orientation = __pTokenEdit->GetOrientation();
 
        GET_SHAPE_CONFIG(TOKENEDIT::TOP_MARGIN, orientation, tokenTopMargin);
+       GET_SHAPE_CONFIG(TOKENEDIT::LEFT_MARGIN, orientation, leftMargin);
        GET_SHAPE_CONFIG(TOKENEDIT::TOKEN_HEIGHT, orientation, tokenHeight);
        GET_SHAPE_CONFIG(TOKENEDIT::TOKEN_VERTICAL_SPACING, orientation, tokenVerticalSpacing);
        GET_SHAPE_CONFIG(TOKENEDIT::TOKEN_TEXT_LEFT_MARGIN, orientation, tokenTextLeftMargin);
@@ -1706,7 +1788,7 @@ _TokenEditPresenter::CalculateDescriptionTextRect(const String& descriptionText)
        r = __pDescriptionTextTextObject->SetAlignment(TEXT_OBJECT_ALIGNMENT_CENTER | TEXT_OBJECT_ALIGNMENT_MIDDLE);
        r = __pDescriptionTextTextObject->SetWrap(TEXT_OBJECT_WRAP_TYPE_NONE);
 
-       __descriptionTextRect.x = tokenTextLeftMargin + __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_LEFT_MARGIN);
+       __descriptionTextRect.x = leftMargin + __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_LEFT_MARGIN);
        __descriptionTextRect.y = tokenTopMargin + __pTokenEdit->GetVerticalMarginF(EDIT_TEXT_TOP_MARGIN);
        if (textSize.width > tokenTitleWidth)
        {
@@ -1870,11 +1952,11 @@ _TokenEditPresenter::TrimTokenAndAdjustEllipsisAt(int index)
 {
        result r = E_SUCCESS;
 
-       float tokenTextRightMargin = 0.0f;
+       float tokenRightMargin = 0.0f;
        float tokenMinimumSize = 0.0f;
 
        _ControlOrientation orientation = __pTokenEdit->GetOrientation();
-       GET_SHAPE_CONFIG(TOKENEDIT::TOKEN_TEXT_RIGHT_MARGIN, orientation, tokenTextRightMargin);
+       GET_SHAPE_CONFIG(TOKENEDIT::RIGHT_MARGIN, orientation, tokenRightMargin);
        GET_SHAPE_CONFIG(TOKENEDIT::TOKEN_MIN_WIDTH, orientation, tokenMinimumSize);
 
        _Token* pToken = null;
@@ -1884,7 +1966,8 @@ _TokenEditPresenter::TrimTokenAndAdjustEllipsisAt(int index)
        FloatRectangle tokenEditBounds = __pTokenEdit->GetBoundsF();
        FloatRectangle tokenRect = pToken->displayRect;
 
-       float remainWidth = tokenEditBounds.width - tokenTextRightMargin - __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_RIGHT_MARGIN);;
+       float remainWidth = tokenEditBounds.width - tokenRightMargin - __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_RIGHT_MARGIN);
+
        float dspTokenWidth = tokenRect.x + tokenRect.width;
        float dspTokenGap = dspTokenWidth - remainWidth;
 
@@ -2193,34 +2276,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 +2712,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 +2872,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 +3044,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 +3069,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 +3098,7 @@ _TokenEditPresenter::OnTextCommitted(const String& commitText)
                        InitializeTokenVisibilityAt(i);
                }
 
-               if (__pressedTokenIndex < 0)
+               if ((__pressedTokenIndex < 0) || (__focusedEditingTokenIndex > -1))
                {
                        SetCursorDisabled(true);
                        __pTokenEdit->Draw();
@@ -3251,6 +3345,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 +3825,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 +3884,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 1e979c1..4ac1b16 100644 (file)
@@ -134,8 +134,7 @@ public:
        virtual void OnFontChanged(Tizen::Graphics::Font* pFont);
        virtual void OnFontInfoRequested(unsigned long& style, int& size);
        virtual void OnFontInfoRequested(unsigned long& style, float& size);
-       virtual Tizen::Graphics::Dimension GetContentSize(void) const;
-       virtual Tizen::Graphics::FloatDimension GetContentSizeF(void) const;
+       virtual Tizen::Graphics::FloatDimension GetContentSizeF(bool horizontalMode, bool verticalMode) const;
        virtual void OnAncestorEnableStateChanged(const _Control& control);
 
 public:
@@ -241,7 +240,7 @@ public:
        float GetRightTouchMarginF(void) const;
        float GetBottomTouchMarginF(void) const;
 
-       Tizen::Graphics::FloatDimension GetContentSizeInternalF(void) const;
+       Tizen::Graphics::FloatDimension GetContentSizeInternalF(bool horizontalMode, bool verticalMode) const;
        int GetTextExtentSize(void) const;
        float GetTextExtentSizeF(void) const;
 
index 6734a00..133ad16 100644 (file)
@@ -117,8 +117,7 @@ public:
        virtual bool OnTouchMoved(const _ControlImpl& source, const _TouchInfo& touchinfo);
        virtual bool OnTouchCanceled(const _ControlImpl& source, const _TouchInfo& touchinfo);
 
-       virtual Tizen::Graphics::Dimension GetContentSize(void) const;
-       virtual Tizen::Graphics::FloatDimension GetContentSizeF(void) const;
+       virtual Tizen::Graphics::FloatDimension GetContentSizeF(bool horizontalMode, bool verticalMode) const;
 
 public:
        static const Tizen::Graphics::Color GetColorOnError(void);
index 6e1b1d5..457d442 100644 (file)
@@ -27,6 +27,7 @@
 #include "FUi_Control.h"
 #include "FUiCtrl_ColorChangeEvent.h"
 #include "FUi_IAccessibilityListener.h"
+#include "FUiCtrl_ColorPickerPresenter.h"
 
 namespace Tizen { namespace Ui {
 class _AccessibilityElement;
@@ -140,6 +141,12 @@ public:
        virtual bool OnAccessibilityValueIncreased(const Tizen::Ui::_AccessibilityContainer&, const Tizen::Ui::_AccessibilityElement&);
        virtual bool OnAccessibilityValueDecreased(const Tizen::Ui::_AccessibilityContainer&, const Tizen::Ui::_AccessibilityElement&);
 
+       virtual bool OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo);
+
+       bool OnFocusLost(const _Control& source);
+       virtual void OnDrawFocus(void);
+       virtual void OnFocusModeStateChanged(void);
+
 private:
        _ColorPicker(void);
 
@@ -164,6 +171,12 @@ private:
        Tizen::Ui::_AccessibilityElement* __pSaturationBarElement;
 
        Tizen::Ui::_AccessibilityElement* __pLuminanceBarElement;
+
+       _ColorPickerComponentType __currentFocusedHandler;
+
+       _ColorPickerComponentType __previousFocusedHandler;
+
+       bool __isInFocusMode;
 };     // _ColorPicker
 
 }}}    // Tizen::Ui::Controls
index ae2b31e..78200ac 100644 (file)
@@ -26,7 +26,7 @@
 #define _FUI_CTRL_INTERNAL_COLORPICKER_PRESENTER_H_
 
 #include <FBaseObject.h>
-#include "FUiCtrl_ColorPicker.h"
+#include "FUi_Control.h"
 
 namespace Tizen { namespace Graphics
 {
@@ -68,6 +68,7 @@ enum _ColorPickerComponentType
 };
 
 class _ColorPickerModel;
+class _ColorPicker;
 
 class _ColorPickerPresenter
        : public Tizen::Base::Object
@@ -95,6 +96,12 @@ public:
 
        void LoadDrawingProperties(const Tizen::Graphics::FloatRectangle& controlBounds);
 
+       void StepHandler(_ColorPickerComponentType index, bool increase);
+
+       result DrawFocus(_ColorPickerComponentType currentIndex, _ColorPickerComponentType prevIndex);
+
+       result ClearFocus(_ColorPickerComponentType index);
+
        void OnChangeLayout(Tizen::Ui::_ControlOrientation orientation);
 
        bool OnTouchPressed(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
@@ -204,6 +211,7 @@ private:
        Tizen::Graphics::Bitmap* __pLandscapeCustomBitmap;
        Tizen::Graphics::Bitmap* __pLandscapeLuminanceSliderBgBitmap;
        Tizen::Graphics::Bitmap* __pLandscapeSaturationSliderBgBitmap;
+       Tizen::Graphics::Bitmap* __pFocusBitmap;
 };     // _ColorPickerPresenter
 
 }}}    // Tizen::Ui::Controls
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 e7c5f50..2813577 100644 (file)
@@ -493,7 +493,7 @@ public:
        virtual void OnSettingChanged(Tizen::Base::String& key);
 
        _EditPresenter* GetPresenter(void) const;
-       Tizen::Graphics::FloatDimension GetContentSizeInternalF(void) const;
+       Tizen::Graphics::FloatDimension GetContentSizeInternalF(bool horizontalMode, bool verticalMode) const;
        bool IsInternalFocused(void) const;
        bool ValidatePastedText(const Tizen::Base::String& pastedText, Tizen::Base::String& replacedText);
        void SetEditTextFilter(IEditTextFilter* pFilter);
@@ -555,6 +555,7 @@ private:
        bool __isDestroyed;
        IEditTextFilter* __pTextFilter;
        Tizen::Graphics::FloatRectangle __previousBounds;
+       bool __isTouchMoving;
 }; // _Edit
 
 }}} // 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 f0f35f0..a19036e 100644 (file)
@@ -550,6 +550,7 @@ private:
        static float __clipboardHeight;
        static _EditFooterVisibleStatus __initialFooterVisibleStatus;
        static bool __footerVisibleChanged;
+       static unsigned int __latestBoundedContext;
 
        wchar_t __echoChar;
 
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 dd7909d..8f220ad 100644 (file)
@@ -184,6 +184,13 @@ public:
        result SetIndicatorShowState(bool state, bool hide = false);
        result SetIndicatorOpacity(_IndicatorOpacity opacity);
 
+       virtual bool OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo);
+       virtual bool OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo);
+       virtual bool OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo);
+       virtual bool OnTouchCanceled(const _Control& source, const _TouchInfo& touchinfo);
+       virtual bool OnMousePressed(const _Control& source, const _MouseInfo& mouseinfo);
+       virtual bool OnMouseReleased(const _Control& source, const _MouseInfo& mouseinfo);
+
        result AdjustClientBounds(void);
 
        result AddActionEventListener(Tizen::Ui::Controls::_IActionEventListener& listener);
index 0210202..8e537e4 100644 (file)
@@ -23,6 +23,7 @@
 #include "FUi_ITouchFlickGestureEventListener.h"
 #include "FUi_ITouchTapGestureEventListener.h"
 #include "FUi_ITouchPinchGestureEventListener.h"
+#include "FUi_ITouchLongPressGestureEventListener.h"
 #include "FUiCtrl_GalleryTypes.h"
 
 
@@ -64,6 +65,7 @@ class _Gallery
        , virtual public Tizen::Ui::_ITouchFlickGestureEventListener
        , virtual public Tizen::Ui::_ITouchTapGestureEventListener
        , virtual public Tizen::Ui::_ITouchPinchGestureEventListener
+       , virtual public Tizen::Ui::_ITouchLongPressGestureEventListener
        , virtual public Tizen::Ui::_IUiEventListener
        , virtual public Tizen::Ui::_ITouchGestureEventListener
        , virtual public Tizen::Ui::_IUiEventPreviewer
@@ -111,6 +113,8 @@ public:
        virtual bool OnPinchGestureChanged(_TouchPinchGestureDetector& gesture);
        virtual bool OnPinchGestureFinished(_TouchPinchGestureDetector& gesture);
        virtual bool OnPinchGestureCanceled(_TouchPinchGestureDetector& gesture);
+       virtual bool OnLongPressGestureDetected(_TouchLongPressGestureDetector& gesture);
+       virtual bool OnLongPressGestureCanceled(_TouchLongPressGestureDetector& gesture);
 
        // Touch Event Callbacks
        virtual bool OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo);
@@ -175,8 +179,10 @@ private:
        _TouchTapGestureDetector __oneTapGesture;
        _TouchTapGestureDetector __twoTapGesture;
        _TouchPinchGestureDetector __pinchGesture;
+       _TouchLongPressGestureDetector __longPressGesture;
 
        bool __modelInitialized;
+       bool __longPressed;
 
        Tizen::Ui::_AccessibilityElement* __pGalleryImageElement;
 }; // _Gallery
index 4a9bce8..80d7c3a 100644 (file)
@@ -106,6 +106,8 @@ public:
        virtual bool IsRotationSynchronized(void) const;
        virtual void OnSettingChanged(Tizen::Base::String& key);
 
+       virtual bool IsLayoutChangable(void) const;
+
 private:
        _Keypad(void);
        _Keypad(const _Keypad&);
index 3e50abc..6c413cc 100644 (file)
@@ -80,8 +80,7 @@ public:
        virtual void OnBoundsChanged(void);
        virtual void OnFontChanged(Tizen::Graphics::Font* pFont);
        virtual void OnFontInfoRequested(unsigned long& style, int& size);
-       virtual Tizen::Graphics::Dimension GetContentSize(void) const;
-       virtual Tizen::Graphics::FloatDimension GetContentSizeF(void) const;
+       virtual Tizen::Graphics::FloatDimension GetContentSizeF(bool horizontalMode, bool verticalMode) const;
 
 public:
        result SetText(const Tizen::Base::String& text);
@@ -123,7 +122,7 @@ public:
        float GetRightMarginF(void) const;
        float GetBottomMarginF(void) const;
 
-       Tizen::Graphics::FloatDimension GetContentSizeInternalF(void) const;
+       Tizen::Graphics::FloatDimension GetContentSizeInternalF(bool horizontalMode, bool verticalMode) const;
 
 protected:
        result SetPresenter(const _LabelPresenter& labelPresenter);
index 5e62b77..d0b53c5 100644 (file)
@@ -87,8 +87,7 @@ public:
 
        virtual result OnBoundsChanged(const Tizen::Graphics::Rectangle& oldRect, const Tizen::Graphics::Rectangle& newRect);
        virtual result OnBoundsChanged(const Tizen::Graphics::FloatRectangle& oldRect, const Tizen::Graphics::FloatRectangle& newRect);
-       virtual Tizen::Graphics::Dimension GetContentSize(void) const;
-       virtual Tizen::Graphics::FloatDimension GetContentSizeF(void) const;
+       virtual Tizen::Graphics::FloatDimension GetContentSizeF(bool horizontalMode, bool verticalMode) const;
 
 public:
        static Tizen::Graphics::Color GetColorOnError(void);
index 8fbd175..6bab331 100644 (file)
@@ -123,6 +123,14 @@ public:
 // _IActionEventListener
        virtual void OnActionPerformed(const Tizen::Ui::_Control& source, int actionId);
 
+       bool OnFocusGained(const _Control& source);
+
+       bool OnFocusLost(const _Control& source);
+
+       void OnDrawFocus(void);
+
+       bool OnKeyPressed(const _Control &source, const _KeyInfo &keyInfo);
+
        virtual ~_OptionMenu(void);
 
        static _OptionMenu* CreateOptionMenuN(void);
@@ -151,6 +159,10 @@ private:
        int __subMenuIndex;
 
        Tizen::Base::Collection::LinkedListT<_AccessibilityElement*> __accessibilityElements;
+
+       int __currentFocusedIndex;
+
+       bool __isFocused;
 }; // _OptionMenu
 
 }}} // Tizen::Ui::Controls
index f645d16..1fe13bb 100644 (file)
@@ -147,6 +147,10 @@ public:
        void OnFontInfoRequested(unsigned long& style, float& size);
        Tizen::Graphics::Font* GetFont(void) const;
 
+       result DrawFocus(int index);
+       result ClearFocus(int index);
+       void OnEnterKeyPressed(int index);
+
 private:
        _OptionMenuPresenter(_OptionMenu* optionMenu);
 
@@ -247,6 +251,10 @@ private:
 
        bool __isAnimationStarted;
 
+       int __focusedIndex;
+
+       Tizen::Graphics::FloatRectangle __arrowBounds;
+
        Tizen::Graphics::FloatMatrix4 _matrixOrigin;
        Tizen::Graphics::FloatMatrix4 _matrixScale;
        Tizen::Ui::Animations::_VisualElement* __pOptionMenuVE;
index ae83088..218ebb7 100644 (file)
@@ -72,7 +72,7 @@ public:
 protected:
        _PanelImpl(Control* pPublic, _Control* pCore, Layout* pPublicPortraitLayout = null, Layout* pPublicLandscapeLayout = null);
 
-       void SetChildBuilderBouds(_ContainerImpl* pContainerImpl, _ControlOrientation controlOrientation);
+       void SetChildBuilderBounds(_ContainerImpl* pContainerImpl, _ControlOrientation controlOrientation);
 
 private:
        // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
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 c65ec4f..8a528a9 100644 (file)
@@ -180,6 +180,8 @@ public:
        void SetStyle(int style);
        _TabStyle GetStyle(void) const;
 
+       int GetCurrentHighlightedItemIndex(void) const;
+
        void AddActionEventListener(const Tizen::Ui::Controls::_IActionEventListener& listener);
        void RemoveActionEventListener(const Tizen::Ui::Controls::_IActionEventListener& listener);
 
@@ -215,6 +217,12 @@ public:
        virtual bool OnAccessibilityValueIncreased(const Tizen::Ui::_AccessibilityContainer&, const Tizen::Ui::_AccessibilityElement&);
        virtual bool OnAccessibilityValueDecreased(const Tizen::Ui::_AccessibilityContainer&, const Tizen::Ui::_AccessibilityElement&);
 
+       virtual bool OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo);
+       virtual bool OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo);
+       bool OnFocusGained(const _Control& source);
+       bool OnFocusLost(const _Control& source);
+       virtual void OnDrawFocus(void);
+
 private:
        int GetItemIndex(int actionId);
        bool CheckDuplicatedActionId(int actionId);
@@ -224,6 +232,7 @@ private:
        _TabPresenter* __pTabPresenter;
 
        int __style;
+       int __currentHighlightedItemIndex;
        _TabStatus __tabStatus;
        Tizen::Base::Collection::ArrayList __tabItems;
 
index 7a7a0f0..67c24b5 100644 (file)
@@ -54,8 +54,13 @@ namespace Tizen { namespace Ui { namespace Controls {
        class _TabItem;
        class _FlickAnimation;
 
-const int _TIMER_COUNT = 3;
-const int _TAB_ITEM_MAXCOUNT = 14;
+// enum
+enum _FocusDirectionMove
+{
+       _FOCUS_DIRECTION_MOVE_LEFT = 0,         /** Move Focus to Left */
+       _FOCUS_DIRECTION_MOVE_RIGHT                     /** Move Focus to Right*/
+};
+
 /**
  * @class _TabPresenter
  * @brief
@@ -130,6 +135,8 @@ public:
 
        virtual bool OnAccessibilityFocusMovedNext(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element);
        virtual bool OnAccessibilityFocusMovedPrevious(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element);
+       result ShiftToFocusedItem(int itemIndex, _FocusDirectionMove direction);
+
 protected:
        result SetModel(const _TabModel& tabModel);
 
@@ -159,8 +166,8 @@ private:
        void DrawBadgeIcon(_TabItem* pDrawItem, Tizen::Graphics::Canvas* pCanvas);
 
 
-       void CalcItemBounds(void);
-       void CalcTabBounds(bool isReset);
+       void CalculateItemBounds(void);
+       void CalculateTabBounds(bool isReset);
 
        void StartFlickAnimation(void);
        result StartFlickAnimationTimer(void);
@@ -202,6 +209,9 @@ private:
        Tizen::Graphics::FloatRectangle __dividerLine;
        Tizen::Graphics::FloatRectangle __selectedLine;
 
+       static const int _TIMER_COUNT = 3;
+       static const int _TAB_ITEM_MAXCOUNT = 14;
+
        struct ReorderAnimationInfo *__pAnimInfo[_TAB_ITEM_MAXCOUNT];
        struct TimerInfo *__pTimerInfo[_TIMER_COUNT];
        bool __isRecalculateNeeded;
@@ -215,6 +225,7 @@ private:
        Tizen::Graphics::Bitmap* __pFrontScrollingEffectBitmap;
        Tizen::Graphics::Bitmap* __pRearScrollingEffectBitmap;
        Tizen::Graphics::Bitmap* __pScrollingEffectBitmap;
+       Tizen::Graphics::Bitmap* __pFocusBitmap;
        Tizen::Ui::Animations::_VisualElement* __pScrollingEffectVe;
 
        Tizen::Base::Runtime::Timer* __pFlickAnimationTimer;
index daba4dd..e0eb696 100644 (file)
@@ -617,7 +617,7 @@ public:
         */
        result RemoveTextBlockEventListener(Tizen::Ui::ITextBlockEventListener& listener);
 
-       virtual Tizen::Graphics::FloatDimension GetContentSizeF(void) const;
+       virtual Tizen::Graphics::FloatDimension GetContentSizeF(bool horizontalMode, bool verticalMode) const;
 
 // Operation
 public:
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 90d72ec..286461e 100644 (file)
@@ -74,7 +74,7 @@ public:
 
        // Queries
        virtual Tizen::Graphics::Dimension GetContentSize(void) const = 0;
-       virtual Tizen::Graphics::FloatDimension GetContentSizeF(void) const = 0;
+       virtual Tizen::Graphics::FloatDimension GetContentSizeF(bool horizontalMode, bool verticalMode) const = 0;
        virtual Tizen::Ui::Animations::HitTestResult HitTest(const Tizen::Graphics::FloatPoint& point) = 0;
        virtual Tizen::Base::String GetDescription(void) const = 0;
 
@@ -144,6 +144,7 @@ public:
        virtual ~_IPropagatedKeyEventListener(void){}
        virtual bool OnPreviewKeyPressed(const _Control& source, const _KeyInfo& keyInfo) = 0;
        virtual bool OnPreviewKeyReleased(const _Control& source, const _KeyInfo& keyInfo) = 0;
+       virtual bool TranslateKeyEventInfo(const _Control& source, _KeyInfo& keyInfo) = 0;
 };
 
 class _OSP_EXPORT_ _Control // Temp: export only for test
@@ -212,6 +213,14 @@ public:
        virtual bool OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo);
        virtual bool OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo);
        virtual bool OnTouchCanceled(const _Control& source, const _TouchInfo& touchinfo);
+       virtual _UiTouchEventDelivery OnPreviewMousePressed(const _Control& source, const _MouseInfo& mouseinfo);
+       virtual _UiTouchEventDelivery OnPreviewMouseReleased(const _Control& source, const _MouseInfo& mouseinfo);
+       virtual _UiTouchEventDelivery OnPreviewMouseMoved(const _Control& source, const _MouseInfo& mouseinfo);
+       virtual _UiTouchEventDelivery OnPreviewMouseWheeled(const _Control& source, const _MouseInfo& mouseinfo);
+       virtual bool OnMousePressed(const _Control& source, const _MouseInfo& mouseinfo);
+       virtual bool OnMouseReleased(const _Control& source, const _MouseInfo& mouseinfo);
+       virtual bool OnMouseMoved(const _Control& source, const _MouseInfo& mouseinfo);
+       virtual bool OnMouseWheeled(const _Control& source, const _MouseInfo& mouseinfo);
        virtual bool OnFocusGained(const _Control& source);
        virtual bool OnFocusLost(const _Control& source);
        virtual bool OnPreviewNotifiedN(const _Control& source, Tizen::Base::Collection::IList* pArgs); // [ToDo] Make the notification id as enumeration.
@@ -219,7 +228,7 @@ public:
 
 // Virtual Queries: Do not use directly. Use through delegate (GetControlDelegate())
        virtual Tizen::Graphics::Dimension GetContentSize(void) const;
-       virtual Tizen::Graphics::FloatDimension GetContentSizeF(void) const;
+       virtual Tizen::Graphics::FloatDimension GetContentSizeF(bool horizontalMode, bool verticalMode) const;
        virtual Tizen::Ui::Animations::HitTestResult HitTest(const Tizen::Graphics::FloatPoint& point);
        virtual Tizen::Base::String GetDescription(void) const;
        virtual float GetVerticalScrollPosition(void) const;
index adee9ce..3b4454f 100644 (file)
@@ -125,7 +125,7 @@ public:
 
 // Queries
        virtual Tizen::Graphics::Dimension GetContentSize(void) const;
-       virtual Tizen::Graphics::FloatDimension GetContentSizeF(void) const;
+       virtual Tizen::Graphics::FloatDimension GetContentSizeF(bool horizontalMode, bool verticalMode) const;
        virtual Tizen::Ui::Animations::HitTestResult HitTest(const Tizen::Graphics::FloatPoint& point);
        virtual Tizen::Base::String GetDescription(void) const;
 
@@ -174,6 +174,7 @@ public:
        virtual void OnFocusableStateChanged(bool focusalbeState);
 
 // Event Callbacks
+       virtual bool TranslateKeyEventInfo(const _ControlImpl& source, _KeyInfo& keyInfo);
        virtual bool OnKeyPressed(const _ControlImpl& source, const _KeyInfo& keyInfo);
        virtual bool OnKeyReleased(const _ControlImpl& source, const _KeyInfo& keyInfo);
 
@@ -190,6 +191,16 @@ public:
        virtual _UiTouchEventDelivery OnPreviewTouchMoved(const _ControlImpl& source, const _TouchInfo& touchInfo);
        virtual _UiTouchEventDelivery OnPreviewTouchCanceled(const _ControlImpl& source, const _TouchInfo& touchInfo);
 
+       virtual _UiTouchEventDelivery OnPreviewMousePressed(const _ControlImpl& source, const _MouseInfo& mouseinfo);
+       virtual _UiTouchEventDelivery OnPreviewMouseReleased(const _ControlImpl& source, const _MouseInfo& mouseinfo);
+       virtual _UiTouchEventDelivery OnPreviewMouseMoved(const _ControlImpl& source, const _MouseInfo& mouseinfo);
+       virtual _UiTouchEventDelivery OnPreviewMouseWheeled(const _ControlImpl& source, const _MouseInfo& mouseinfo);
+
+       virtual bool OnMousePressed(const _ControlImpl& source, const _MouseInfo& mouseinfo);
+       virtual bool OnMouseReleased(const _ControlImpl& source, const _MouseInfo& mouseinfo);
+       virtual bool OnMouseMoved(const _ControlImpl& source, const _MouseInfo& mouseinfo);
+       virtual bool OnMouseWheeled(const _ControlImpl& source, const _MouseInfo& mouseinfo);
+
        virtual bool OnFocusGained(const _ControlImpl& source);
        virtual bool OnFocusLost(const _ControlImpl& source);
        virtual bool OnNotifiedN(const _ControlImpl& source, Tizen::Base::Collection::IList* pArgs);
index 0a512be..3ee05b3 100644 (file)
@@ -95,6 +95,14 @@ public:
         * @param[in]   touchInfo               The touch event information
         */
        virtual bool OnTouchCanceled(const _Control& source, const _TouchInfo& touchinfo) = 0;
+
+       virtual bool OnMousePressed(const _Control& source, const _MouseInfo& mouseinfo){return false;}
+
+       virtual bool OnMouseReleased(const _Control& source, const _MouseInfo& mouseinfo){return false;}
+
+       virtual bool OnMouseMoved(const _Control& source, const _MouseInfo& mouseinfo){return false;}
+
+       virtual bool OnMouseWheeled(const _Control& source, const _MouseInfo& mouseinfo){return false;}
 }; // _ITouchEventListener
 
 }} // Tizen::Ui
index c5291ae..a1843f0 100644 (file)
@@ -34,6 +34,7 @@ namespace Tizen { namespace Ui
 
 class _Control;
 class _TouchInfo;
+class _MouseInfo;
 
 /**
  * @interface  _ITouchEventPreviewer
@@ -96,6 +97,14 @@ public:
         * @param[in]   touchInfo               The touch event information
         */
        virtual _UiTouchEventDelivery OnPreviewTouchCanceled(const _Control& source, const _TouchInfo& touchinfo) = 0;
+
+       virtual _UiTouchEventDelivery OnPreviewMousePressed(const _Control& source, const _MouseInfo& mouseinfo){return _UI_TOUCH_EVENT_DELIVERY_YES;}
+
+       virtual _UiTouchEventDelivery OnPreviewMouseReleased(const _Control& source, const _MouseInfo& mouseinfo){return _UI_TOUCH_EVENT_DELIVERY_YES;}
+
+       virtual _UiTouchEventDelivery OnPreviewMouseMoved(const _Control& source, const _MouseInfo& mouseinfo){return _UI_TOUCH_EVENT_DELIVERY_YES;}
+
+       virtual _UiTouchEventDelivery OnPreviewMouseWheeled(const _Control& source, const _MouseInfo& mouseinfo){return _UI_TOUCH_EVENT_DELIVERY_YES;}
 }; // _ITouchEventPreviewer
 
 }} // Tizen::Ui
index 9fc2841..c4cc0b5 100644 (file)
@@ -45,7 +45,7 @@ public:
        virtual result SetItemBounds(const Tizen::Graphics::FloatRectangle& rect) = 0;
        virtual Tizen::Graphics::FloatRectangle GetItemBounds(void) const = 0;
        virtual Tizen::Graphics::FloatRectangle GetItemClientBoundsFromSize(const Tizen::Graphics::FloatDimension& size) const = 0;
-       virtual Tizen::Graphics::FloatDimension GetItemContentSize(void) const = 0;
+       virtual Tizen::Graphics::FloatDimension GetItemContentSize(bool horizontalMode, bool verticalMode) const = 0;
        virtual Tizen::Graphics::FloatDimension GetItemMinimumSize(void) const = 0;
        virtual Tizen::Graphics::FloatDimension GetItemMaximumSize(void) const = 0;
        virtual result OnItemMeasure(float& width, float& height) = 0;
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 209d8c3..c4bb556 100644 (file)
@@ -32,15 +32,13 @@ DECLARE_UI_CONFIG(LIST);
        DECLARE_COLOR_CONFIG(ELEMENT_TEXT_PRESSED, 5);
        DECLARE_COLOR_CONFIG(ELEMENT_TEXT_HIGHLIGHTED, 6);
        DECLARE_COLOR_CONFIG(ELEMENT_TEXT_DISABLED, 7);
-       DECLARE_IMAGE_CONFIG(CHECK_BG_BITMAP, 1);
-       DECLARE_IMAGE_CONFIG(CHECK_MARK_BG_BITMAP, 2);
-       DECLARE_IMAGE_CONFIG(CHECK_DIM_BITMAP, 3);
-       DECLARE_IMAGE_CONFIG(BUTTON_RADIO_BITMAP, 4);
-       DECLARE_IMAGE_CONFIG(BUTTON_RADIO_SELECTED_BITMAP, 5);
-       DECLARE_IMAGE_CONFIG(BUTTON_OFF_BITMAP, 6);
-       DECLARE_IMAGE_CONFIG(BUTTON_ON_BITMAP, 7);
-       DECLARE_IMAGE_CONFIG(BUTTON_EXPAND_GROUP, 8);
-       DECLARE_IMAGE_CONFIG(BUTTON_COLLAPSE_GROUP, 9);
+       DECLARE_COLOR_CONFIG(EXPANDABLE_ARROW_NORMAL, 8);
+       DECLARE_COLOR_CONFIG(EXPANDABLE_ARROW_DISABLED, 9);
+       DECLARE_COLOR_CONFIG(EXPANDABLE_ARROW_PRESSED, 10);
+       DECLARE_IMAGE_CONFIG(BUTTON_EXPAND_GROUP, 1);
+       DECLARE_IMAGE_CONFIG(BUTTON_COLLAPSE_GROUP, 2);
+       DECLARE_IMAGE_CONFIG(BUTTON_EXPAND_CLOSED_EFFECT, 3);
+       DECLARE_IMAGE_CONFIG(BUTTON_EXPAND_OPENED_EFFECT, 4);
        DECLARE_SHAPE_CONFIG(EMPTY_LIST_TEXT_HEIGHT, 1);
        DECLARE_SHAPE_CONFIG(LIST_ITEM_TEXT_SIZE, 2);
        DECLARE_SHAPE_CONFIG(LIST_STYLE_NUMBER_X, 3);
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 7354cc9..791d558 100644 (file)
@@ -26,9 +26,9 @@
 
 DECLARE_UI_CONFIG(TABLEVIEW);
        DECLARE_COLOR_CONFIG(BG_NORMAL, 1);
-       DECLARE_COLOR_CONFIG(EXPANDABLE_ARROW_NORMAL, 2);
-       DECLARE_COLOR_CONFIG(EXPANDABLE_ARROW_DISABLED, 3);
-       DECLARE_COLOR_CONFIG(EXPANDABLE_ARROW_PRESSED, 4);
+//     DECLARE_COLOR_CONFIG(EXPANDABLE_ARROW_NORMAL, 2);
+//     DECLARE_COLOR_CONFIG(EXPANDABLE_ARROW_DISABLED, 3);
+//     DECLARE_COLOR_CONFIG(EXPANDABLE_ARROW_PRESSED, 4);
        DECLARE_COLOR_CONFIG(ITEM_DIVIDER_TOP_BG_NORMAL, 5);
        DECLARE_COLOR_CONFIG(ITEM_DIVIDER_BOTTOM_BG_NORMAL, 6);
        DECLARE_COLOR_CONFIG(ITEM_BG_NORMAL, 7);
@@ -97,8 +97,8 @@ DECLARE_UI_CONFIG(TABLEVIEW);
        DECLARE_IMAGE_CONFIG(CIRCLE_BUTTON_BG_EFFECT, 32);
 //     DECLARE_IMAGE_CONFIG(CIRCLE_BUTTON_REVEAL, 33);
        DECLARE_IMAGE_CONFIG(SEARCH_ICON_NORMAL, 34);
-       DECLARE_IMAGE_CONFIG(BUTTON_EXPAND_CLOSED_EFFECT, 35);
-       DECLARE_IMAGE_CONFIG(BUTTON_EXPAND_OPENED_EFFECT, 36);
+//     DECLARE_IMAGE_CONFIG(BUTTON_EXPAND_CLOSED_EFFECT, 35);
+//     DECLARE_IMAGE_CONFIG(BUTTON_EXPAND_OPENED_EFFECT, 36);
        DECLARE_IMAGE_CONFIG(CHECKBOX_BG_DISABLED, 37);
        DECLARE_IMAGE_CONFIG(CHECKBOX_CHECK_MARK_DISABLED, 38);
        DECLARE_IMAGE_CONFIG(RADIOBUTTON_NORMAL_DISABLED, 39);
@@ -156,4 +156,4 @@ DECLARE_UI_CONFIG(TABLEVIEW);
        DECLARE_FIXED_VALUE_CONFIG(ITEM_ANNEX_DIVIDER_MARGIN, 4);
 DECLARE_END_UI_CONFIG(TABLEVIEW);
 
-#endif //_FUI_RESOURCE_TABLE_VIEW_CONFIG_H_
\ No newline at end of file
+#endif //_FUI_RESOURCE_TABLE_VIEW_CONFIG_H_
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 ca19229..2de8f25 100644 (file)
@@ -107,6 +107,7 @@ private:
        _UiObjectHandle GetTarget(void) const;
        _UiObjectHandle GetTarget(int x, int y) const;
        void RemoveAllEventListenerList(Tizen::Base::Collection::HashMapT<_UiEventType, Tizen::Base::Collection::LinkedListT<_IUiEventListener*>*>* pMap);
+       result CallTranslateKeyEventInfo(const _UiEvent& event, bool& isFiltered);
        _UiEventManager(void);
        ~_UiEventManager(void);
        _UiEventManager(const _UiEventManager& rhs);
index 7b743fc..ee41341 100644 (file)
@@ -922,7 +922,7 @@ public:
        _UiKeyEvent& operator =(const _UiKeyEvent& rhs);
 
 public:
-       const _KeyInfo* GetKeyInfo(void) const;
+       _KeyInfo* GetKeyInfo(void) const;
 
 private:
        void SetKeyState(KeyState keyState);
index b738b68..63c9ddf 100644 (file)
@@ -43,6 +43,15 @@ enum _TouchStatus
        _TOUCH_FOCUS_IN = TOUCH_FOCUS_IN,                 /**< Touch focus-in event type        */
        _TOUCH_FOCUS_OUT = TOUCH_FOCUS_OUT,               /**< Touch focus-out event type       */
        _TOUCH_CANCELED = TOUCH_CANCELED,               /**< Touch canceled event type  */
+       _WHEEL_MOVED = TOUCH_CANCELED+1,                       /**< Touch moved event type      */
+};
+
+enum _MouseButtons
+{
+       _MOUSE_BUTTON_NONE = 0,
+       _MOUSE_BUTTON_LEFT,
+       _MOUSE_BUTTON_WHEEL,
+       _MOUSE_BUTTON_RIGHT
 };
 
 class _OSP_EXPORT_ _TouchInfo
@@ -93,6 +102,59 @@ private:
        long long __timeStamp;
 }; // _TouchInfo
 
+class _OSP_EXPORT_ _MouseInfo
+{
+public:
+       _MouseInfo(void);
+       _MouseInfo(unsigned long pointId, _TouchStatus status, const Tizen::Graphics::FloatPoint& current, int zAxis, int buttons, const bool isFlick, long long timeStamp);
+       _MouseInfo(const _MouseInfo& rhs);
+       _MouseInfo& operator =(const _MouseInfo& rhs);
+       ~_MouseInfo(void);
+
+public:
+       /**
+        * This method returns the touch status.
+        *
+        * @since               2.0
+        * @return  The touch status
+        */
+       _TouchStatus GetTouchStatus(void) const;
+
+       /**
+        * This method returns the current position of the touch event.
+        *
+        * @since               2.0
+        * @return      The current position of the touch event
+        */
+       Tizen::Graphics::FloatPoint GetCurrentPosition(void) const;
+
+       /**
+        * This method returns the touch pointId.
+        *
+        * @since 2.0
+        * @return  The touch pointId
+        */
+       unsigned long GetPointId(void) const;
+
+       int GetZAxis(void) const;
+
+       int GetButtons(void) const;
+
+       bool IsFlicked(void) const;
+       long long GetTimeStamp(void) const;
+       void SetTouchInfo(unsigned long pointId, _TouchStatus status, Tizen::Graphics::Point& current, int zAxis, int buttons, bool isFlick, long long timeStamp);
+       void SetTouchInfo(unsigned long pointId, _TouchStatus status, Tizen::Graphics::FloatPoint& current, int zAxis, int buttons,  bool isFlick, long long timeStamp);
+
+private:
+       unsigned long __pointId;
+       _TouchStatus __touchStatus;
+       Tizen::Graphics::FloatPoint __currentPosition;
+       int __zAxis;
+       int __buttons;
+       bool __isFlicked;
+       long long __timeStamp;
+}; // _TouchInfo
+
 class _ITouchEventListener;
 class _Control;
 
@@ -148,6 +210,58 @@ private:
        std::tr1::shared_ptr<Tizen::Base::Collection::IListT<_Control*> > __pForcedControlList;
 }; // _UiTouchEvent
 
+/**
+* This is internal. If used in an application, the application can get rejected during the certification process.
+* @class       _UiMouseEvent
+* @brief       This class impliments _UiMouseEvent and
+* fire the Window Event object of a Ui Control.
+*/
+class _OSP_EXPORT_ _UiMouseEvent
+       : public _UiEvent
+{
+// Lifecycle
+public:
+       /**
+       * This is the default class constructor.
+       *
+       */
+       _UiMouseEvent(const _UiObjectHandle& destination, const _MouseInfo& mouseInfo, _UiEventRouteType routeType = _UI_EVENT_ROUTE_TUNNEL_BUBBLE, const _UiObjectHandle& source = _UiObjectHandle());
+       _UiMouseEvent(const _UiMouseEvent& rhs);
+
+       /**
+        * This is the default class destructor.
+        *
+        */
+       virtual ~_UiMouseEvent(void);
+
+public:
+       _UiMouseEvent& operator =(const _UiMouseEvent& rhs);
+
+public:
+       const _MouseInfo* GetTouchInfo(void) const;
+
+private:
+       virtual _UiMouseEvent* CloneN(void) const;
+       virtual _UiEventType GetEventType(void) const;
+       virtual bool IsEventEnabled(const _Control& control) const;
+       virtual result OnPreviewEventProcessing(const _Control& control, bool& isFiltered);
+       virtual result OnEventProcessing(const _Control& control, bool& isFiltered);
+       virtual result OnListenerProcessing(const _IUiEventListener& listener, bool& isFiltered);
+       virtual result OnEventHandled(const _Control& control);
+
+private:
+       result ProcessGesture(const _Control& control, bool& isFiltered);
+       result FireListener(const _ITouchEventListener* pListener, const _Control* pControl, bool isTouchEvent, bool& isFiltered);
+       result FirePreviewListener(const _ITouchEventPreviewer* pListener, const _Control* pControl, bool& isFiltered);
+       Tizen::Graphics::FloatPoint GetRelativePoint(const _Control& control, const Tizen::Graphics::FloatPoint& point) const;
+       result ResetTouchInfo(const _Control* pControl, const _MouseInfo& mouseInfo);
+       bool ExistGlobalGesture(void);
+
+private:
+       _MouseInfo __mouseInfo;
+       std::tr1::shared_ptr<Tizen::Base::Collection::IListT<_Control*> > __pForcedControlList;
+};
+
 }} // Tizen::Ui
 
 #endif //_FUI_INTERNAL_UI_TOUCH_EVENT_H_
index de663ed..af15e83 100644 (file)
@@ -146,9 +146,11 @@ LayoutItem::Measure(float width, float height)
        float wrapContentWidth = 0.0f;
        float wrapContentHeight = 0.0f;
 
-       if (widthMode == WRAP_CONTENT || heightMode == WRAP_CONTENT)
+       bool widthWrapContent = widthMode == WRAP_CONTENT;
+       bool heightWrapContent = heightMode == WRAP_CONTENT;
+       if (widthWrapContent || heightWrapContent)
        {
-               Tizen::Graphics::FloatDimension size = __pOuterControl->GetItemContentSize();
+               Tizen::Graphics::FloatDimension size = __pOuterControl->GetItemContentSize(widthWrapContent, heightWrapContent);
                if (size.width > 0.0f || size.height > 0.0f)
                {
                        __contentSizeState = true;
index 904581d..f62f74e 100644 (file)
@@ -163,10 +163,10 @@ START_UI_CONFIG(CHECKBUTTON);
        START_UI_CONFIG_MODE(720x1280);
                ADD_SHAPE_CONFIG(TITLE_TEXT_FONT_SIZE, 32);
                ADD_SHAPE_CONFIG(TEXT_FONT_SIZE, 44);
-               ADD_SHAPE_CONFIG(TITLE_TEXT_HEIGHT, 48);
-               ADD_SHAPE_CONFIG(TEXT_HEIGHT, 60);
+               ADD_SHAPE_CONFIG(TITLE_TEXT_HEIGHT, 42);
+               ADD_SHAPE_CONFIG(TEXT_HEIGHT, 54);
                ADD_SHAPE_CONFIG(LEFT_MARGIN, 26);
-               ADD_SHAPE_CONFIG(TOP_MARGIN, 10);
+               ADD_SHAPE_CONFIG(TOP_MARGIN, 8);
                ADD_SHAPE_CONFIG(MARK_BITMAP_WIDTH, 63);
                ADD_SHAPE_CONFIG(MARK_BITMAP_HEIGHT, 63);
                ADD_SHAPE_CONFIG(ONOFF_SLIDING_BITMAP_WIDTH, 135);
@@ -188,10 +188,10 @@ START_UI_CONFIG(CHECKBUTTON);
        START_UI_CONFIG_MODE(1280x720);
                ADD_SHAPE_CONFIG(TITLE_TEXT_FONT_SIZE, 32);
                ADD_SHAPE_CONFIG(TEXT_FONT_SIZE, 44);
-               ADD_SHAPE_CONFIG(TITLE_TEXT_HEIGHT, 48);
-               ADD_SHAPE_CONFIG(TEXT_HEIGHT, 60);
+               ADD_SHAPE_CONFIG(TITLE_TEXT_HEIGHT, 42);
+               ADD_SHAPE_CONFIG(TEXT_HEIGHT, 54);
                ADD_SHAPE_CONFIG(LEFT_MARGIN, 26);
-               ADD_SHAPE_CONFIG(TOP_MARGIN, 10);
+               ADD_SHAPE_CONFIG(TOP_MARGIN, 8);
                ADD_SHAPE_CONFIG(MARK_BITMAP_WIDTH, 63);
                ADD_SHAPE_CONFIG(MARK_BITMAP_HEIGHT, 63);
                ADD_SHAPE_CONFIG(ONOFF_SLIDING_BITMAP_WIDTH, 135);
index c73b75e..05089ca 100644 (file)
@@ -3908,18 +3908,6 @@ ConfigParser::GetColorKeyTable(void)
                        __pColorKeyTable->Add(ResourceKey(key), _TABLEVIEW::BG_NORMAL_COLOR);
                }
                {
-                       const char* key ="TABLEVIEW::EXPANDABLE_ARROW_NORMAL";
-                       __pColorKeyTable->Add(ResourceKey(key), _TABLEVIEW::EXPANDABLE_ARROW_NORMAL_COLOR);
-               }
-               {
-                       const char* key ="TABLEVIEW::EXPANDABLE_ARROW_DISABLED";
-                       __pColorKeyTable->Add(ResourceKey(key), _TABLEVIEW::EXPANDABLE_ARROW_DISABLED_COLOR);
-               }
-               {
-                       const char* key ="TABLEVIEW::EXPANDABLE_ARROW_PRESSED";
-                       __pColorKeyTable->Add(ResourceKey(key), _TABLEVIEW::EXPANDABLE_ARROW_PRESSED_COLOR);
-               }
-               {
                        const char* key ="TABLEVIEW::ITEM_DIVIDER_TOP_BG_NORMAL";
                        __pColorKeyTable->Add(ResourceKey(key), _TABLEVIEW::ITEM_DIVIDER_TOP_BG_NORMAL_COLOR);
                }
index aeeee50..2384aa9 100644 (file)
@@ -88,8 +88,8 @@ START_UI_CONFIG(EDIT);
        ADD_SHAPE_CONFIG(DEFAULT_TITLE_FONT_SIZE, 32);
        ADD_SHAPE_CONFIG(CLEAR_ICON_HEIGHT, 45);
        ADD_SHAPE_CONFIG(CLEAR_ICON_WIDTH, 45);
-       ADD_SHAPE_CONFIG(COPYPASTE_HANDLER_WIDTH, 29);
-       ADD_SHAPE_CONFIG(COPYPASTE_HANDLER_HEIGHT, 45);
+       ADD_SHAPE_CONFIG(COPYPASTE_HANDLER_WIDTH, 51);
+       ADD_SHAPE_CONFIG(COPYPASTE_HANDLER_HEIGHT, 79);
        ADD_SHAPE_CONFIG(FIELD_BORDER_WIDTH, 1);
        ADD_SHAPE_CONFIG(FIELD_LEFT_MARGIN, 0);
        ADD_SHAPE_CONFIG(FIELD_RIGHT_MARGIN, 0);
index c693e36..fe2b6aa 100644 (file)
@@ -28,12 +28,17 @@ START_UI_CONFIG(LIST);
        ADD_COLOR_CONFIG(LISTITEM_DIVIDER_LEFT_HALF_COLOR, $B0223);
        ADD_COLOR_CONFIG(LISTITEM_DIVIDER_RIGHT_HALF_COLOR, $B0222);
        ADD_COLOR_CONFIG(EXPANDABLELIST_SUB_ITEM_BG_COLOR, $B0217);
+       ADD_COLOR_CONFIG(EXPANDABLE_ARROW_NORMAL, $F032L1);
+       ADD_COLOR_CONFIG(EXPANDABLE_ARROW_DISABLED, $F032L1D);
+       ADD_COLOR_CONFIG(EXPANDABLE_ARROW_PRESSED, $F032L1P);
        ADD_COLOR_CONFIG(ELEMENT_TEXT_NORMAL, $F011L1);
        ADD_COLOR_CONFIG(ELEMENT_TEXT_PRESSED, $F011L1P);
        ADD_COLOR_CONFIG(ELEMENT_TEXT_HIGHLIGHTED, $F011L1P);
        ADD_COLOR_CONFIG(ELEMENT_TEXT_DISABLED, $F011L1D);
        ADD_IMAGE_CONFIG(BUTTON_EXPAND_GROUP, #00_button_expand_opened.png);
        ADD_IMAGE_CONFIG(BUTTON_COLLAPSE_GROUP, #00_button_expand_closed.png);
+       ADD_IMAGE_CONFIG(BUTTON_EXPAND_CLOSED_EFFECT, #00_button_expand_closed_ef.png);
+       ADD_IMAGE_CONFIG(BUTTON_EXPAND_OPENED_EFFECT, #00_button_expand_opened_ef.png);
 
        START_UI_CONFIG_MODE(720x1280);
                ADD_SHAPE_CONFIG(EMPTY_LIST_TEXT_HEIGHT, 38);
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 2016352..ba45c58 100644 (file)
@@ -25,9 +25,6 @@
 START_UI_CONFIG(TABLEVIEW);
 {
        ADD_COLOR_CONFIG(BG_NORMAL, 0x00000000);
-       ADD_COLOR_CONFIG(EXPANDABLE_ARROW_NORMAL, $F032L1);
-       ADD_COLOR_CONFIG(EXPANDABLE_ARROW_DISABLED, $F032L1D);
-       ADD_COLOR_CONFIG(EXPANDABLE_ARROW_PRESSED, $F032L1P);
        ADD_COLOR_CONFIG(ITEM_DIVIDER_TOP_BG_NORMAL, $B0222);
        ADD_COLOR_CONFIG(ITEM_DIVIDER_BOTTOM_BG_NORMAL, $B0223);
        ADD_COLOR_CONFIG(ITEM_BG_NORMAL, 0x00000000);
@@ -105,8 +102,6 @@ START_UI_CONFIG(TABLEVIEW);
        ADD_IMAGE_CONFIG(CIRCLE_BUTTON_BG_EFFECT_DISABLED, #00_circle_bg_ef_dim.png);
        ADD_IMAGE_CONFIG(CIRCLE_BUTTON_REVEAL_NORMAL, #00_button_right.png);
        ADD_IMAGE_CONFIG(SEARCH_ICON_NORMAL, #00_search_icon.png);
-       ADD_IMAGE_CONFIG(BUTTON_EXPAND_CLOSED_EFFECT, #00_button_expand_closed_ef.png);
-       ADD_IMAGE_CONFIG(BUTTON_EXPAND_OPENED_EFFECT, #00_button_expand_opened_ef.png);
        ADD_IMAGE_CONFIG(CHECKBOX_CHECK_MARK_PRESSED, #00_check_press.png);
        ADD_IMAGE_CONFIG(CIRCLE_BUTTON_REVEAL_PRESSED, #00_button_right.png);
        ADD_IMAGE_CONFIG(CIRCLE_BUTTON_REVEAL_HIGHLIGHTED, #00_button_right.png);
@@ -125,7 +120,6 @@ START_UI_CONFIG(TABLEVIEW);
        ADD_IMAGE_CONFIG(QUICK_MENU_BG_EFFECT, #00_quick_menu_bg_ef.#.png);
 
 
-
        START_UI_CONFIG_MODE(720x1280);
                ADD_DIMENSION_CONFIG(MIN_SIZE, 0, 0);
                ADD_SHAPE_CONFIG(ITEM_DEFAULT_FONT_SIZE, 44);
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);
        {