fixed bug (Accessblility/ClipBoard/Copy&Paste)
authorChulheon <ch.jeong47@samsung.com>
Fri, 12 Apr 2013 13:03:09 +0000 (22:03 +0900)
committerChulheon <ch.jeong47@samsung.com>
Fri, 12 Apr 2013 13:03:09 +0000 (22:03 +0900)
Change-Id: I9941774847da247c4d73d19545515294a941bc80

src/ui/controls/FUiCtrl_Edit.cpp
src/ui/controls/FUiCtrl_EditPresenter.cpp

index c07bfb6..bb134eb 100644 (file)
@@ -1021,17 +1021,20 @@ _Edit::UpdateAccessibilityElement(EditAccessibilityElementType type)
                _AccessibilityContainer* pEditAccessibilityContainer = GetAccessibilityContainer();
                if (pEditAccessibilityContainer)
                {
-                       if (!GetTextLength() && __pClearButtonTextAccessibilityElement)
+                       if (!GetTextLength())
                        {
                                if (__pClearButtonTextAccessibilityElement)
                                {
                                        __pClearButtonTextAccessibilityElement->Activate(false);
-                                       __pClearButtonTextAccessibilityElement = null;
                                }
                        }
-                       if (GetTextLength() && !__pClearButtonTextAccessibilityElement)
+                       else
                        {
-                               if (__editStyle & EDIT_STYLE_CLEAR && GetTextLength())
+                               if (__pClearButtonTextAccessibilityElement && !__pClearButtonTextAccessibilityElement->IsActivated())
+                               {       
+                                       __pClearButtonTextAccessibilityElement->Activate(true);
+                               }
+                               else if (!__pClearButtonTextAccessibilityElement)
                                {
                                        __pClearButtonTextAccessibilityElement = new _AccessibilityElement(true);
                                        __pClearButtonTextAccessibilityElement->SetBounds(_pEditPresenter->GetClearIconBoundsF());
index 82d96f5..1877af0 100755 (executable)
@@ -275,7 +275,7 @@ _EditPresenter::OnInputConnectionPanelShowStateChanged(InputConnection& source,
                        }
                }
 
-               if (__isUSBKeyboardConnected && __isKeypadCommandButtonVisible)
+               if ((__isUSBKeyboardConnected && __isKeypadCommandButtonVisible) || (__isKeypadCommandButtonVisible && __pCommandButton &&  __pCommandButton->GetVisibleState()))
                {
                        __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_BOUNDS_CHANGED);
                }
@@ -377,7 +377,8 @@ _EditPresenter::OnInputConnectionPanelShowStateChanged(InputConnection& source,
                {
                        __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_BOUNDS_CHANGED);
                }
-               else if(__isUSBKeyboardConnected && __isKeypadCommandButtonVisible && !__isInputConnectionBound)
+               else if((__isUSBKeyboardConnected && __isKeypadCommandButtonVisible && !__isInputConnectionBound) ||
+                               (__isUSBKeyboardConnected && __isClipboardExist))
                {
                        //do nothing
                }
@@ -944,7 +945,14 @@ _EditPresenter::OnClipboardPopupClosed(void)
                                __pParentForm->Draw();
                        }
 
-                       __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_CLOSE);
+                       if (!__isKeypadCommandButtonVisible)
+                       {
+                               __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_CLOSE);
+                       }
+                       else
+                       {
+                               __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_BOUNDS_CHANGED);
+                       }
                }
 
                __clipboardConnected = false;
@@ -1835,7 +1843,6 @@ _EditPresenter::DrawTextForEntireFontSetting(Canvas& canvas)
                if (IsBlocked() == true && editStatus == EDIT_STATUS_HIGHLIGHTED)
                {
                        __pTextObject->SetBackgroundColor(__pEdit->GetColor(EDIT_STATUS_HIGHLIGHTED), 0, __pTextObject->GetTextLength());
-                       __pTextObject->SetForegroundColor(__pEdit->GetTextColor(editStatus), 0, __pTextObject->GetTextLength());
                        __pTextObject->SetBlock(true);
                        __pTextObject->SetRange(__blockStartPos, __cursorPos - __blockStartPos);
                }
@@ -3762,6 +3769,15 @@ _EditPresenter::OnClipboardPopupClosed(const ClipboardItem* pClipboardItem)
                ReleaseTextBlock();
        }
 
+       if (__isCopyPasteManagerExist)
+       {
+               if (IsBlocked())
+               {
+                       __pCopyPasteManager->SetTextBlockReleaseFlag(false);
+               }
+               InitializeCopyPasteManager();
+       }
+
        SysTryReturnVoidResult(NID_UI_CTRL, pClipboardItem != null, E_SYSTEM, "[E_SYSTEM] _EditPresenter::OnClipboardPopupClosed: Unable to get the clipboarditem instance.");
 
        String* pClipString = dynamic_cast<String*>(pClipboardItem->GetData());
@@ -4445,7 +4461,7 @@ _EditPresenter::SetText(const String& text)
        InitializeCopyPasteManager();
 
        int length = text.GetLength();
-       if ((__pEdit->GetEditStyle() & EDIT_STYLE_FLEXIBLE) || (__pEdit->GetEditStyle() & EDIT_STYLE_VIEWER))
+       if (__pEdit->GetEditStyle() & EDIT_STYLE_VIEWER)
        {
                if (__limitLength <= length)
                {
@@ -4741,6 +4757,8 @@ _EditPresenter::ClearText(void)
        r = DeleteText(0, textLength);
        SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
+       __pEdit->UpdateAccessibilityElement(EDIT_ACCESSIBILITY_ELEMENT_TYPE_CLEAR_ICON);
+
        return r;
 }
 
@@ -5091,6 +5109,11 @@ _EditPresenter::SetKeypadEnabled(bool enable)
 
        __pEditModel->SetKeypadEnabled(enable);
 
+       if (__pInputConnection)
+       {
+               __pInputConnection->SetKeyEventSkipped(!enable);
+       }
+
        return;
 }
 
@@ -6122,8 +6145,8 @@ _EditPresenter::ShowFullscreenKeypad(void)
 
        if (IsKeypadEnabled() == false)
        {
-               r = ShowKeypad();       //Just bind to input connection and skip to open fullscreen keypad
-               return r;
+               __pEdit->SetFocused();
+               return E_SUCCESS;
        }
 
        if (__pFullscreenKeypad)
@@ -6273,9 +6296,15 @@ _EditPresenter::CheckKeypadExist(_ControlOrientation orientation)
 result
 _EditPresenter::ShowKeypad(bool focus)
 {
+       if (IsKeypadEnabled() == false)
+       {
+               return E_SUCCESS;
+       }
+
        if (focus)
        {
                __pEdit->SetFocused();
+               return E_SUCCESS;
        }
 
        if (!__isInitialized)
@@ -6326,77 +6355,77 @@ _EditPresenter::ShowKeypad(bool focus)
                SetCurrentLanguage(initialKeypadLanguage);
        }
        //layout rearrange
-       if (IsKeypadEnabled())
+       if (__isUSBKeyboardConnected)
        {
-               if (__isUSBKeyboardConnected)
+               SysLog(NID_UI_CTRL, "[EDIT]ShowKeypad called in USB ON mode!!!!");
+               if (__initialFooterVisibleStatus == EDIT_FOOTER_VISIBLE_STATUS_NONE)
                {
-                       SysLog(NID_UI_CTRL, "[EDIT]ShowKeypad called in USB ON mode!!!!");
-                       if (__initialFooterVisibleStatus == EDIT_FOOTER_VISIBLE_STATUS_NONE)
-                       {
-                               CheckInitialFooterVisibleState();
-                       }
-
-                       if (__isKeypadCommandButtonVisible)
-                       {
-                               __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_CREATED);
-                               __pEdit->AttachScrollPanelEvent();
-                               __pEdit->SendScrollPanelEvent(CORE_OVERLAY_CONTROL_CREATED);
+                       CheckInitialFooterVisibleState();
+               }
 
-                               SetFooterVisible(false);
-                               ChangeLayoutInternal(__pEdit->GetOrientation());
-                               AdjustParentPanelHeight(false);
+               if (__isKeypadCommandButtonVisible)
+               {
+                       __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_CREATED);
+                       __pEdit->AttachScrollPanelEvent();
+                       __pEdit->SendScrollPanelEvent(CORE_OVERLAY_CONTROL_CREATED);
 
-                               __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_OPEN);
-                               __pEdit->SendScrollPanelEvent(CORE_OVERLAY_CONTROL_OPENED);
-                       }
+                       SetFooterVisible(false);
+                       ChangeLayoutInternal(__pEdit->GetOrientation());
+                       AdjustParentPanelHeight(false);
 
-                       ScrollPanelToExposedRegion(true);
-                       ScrollPanelToCursorPosition();
+                       __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_OPEN);
+                       __pEdit->SendScrollPanelEvent(CORE_OVERLAY_CONTROL_OPENED);
                }
-               else
-               {
-                       SysLog(NID_UI_CTRL, "[EDIT]ShowKeypad called in USB OFF mode!!!!");
 
-                       __isKeypadExist = CheckKeypadExist(__pEdit->GetOrientation()); //call once only from here.
+               ScrollPanelToExposedRegion(true);
+               ScrollPanelToCursorPosition();
+       }
+       else
+       {
+               SysLog(NID_UI_CTRL, "[EDIT]ShowKeypad called in USB OFF mode!!!!");
+
+               __isKeypadExist = CheckKeypadExist(__pEdit->GetOrientation()); //call once only from here.
 
-                       if (!__isKeypadExist)
+               if (!__isKeypadExist)
+               {
+                       if (__pCommandButton && !__pCommandButton->GetVisibleState())
                        {
                                __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_CREATED);
                                __pEdit->AttachScrollPanelEvent();
                                __pEdit->SendScrollPanelEvent(CORE_OVERLAY_CONTROL_CREATED);
-
-                               if (__initialFooterVisibleStatus == EDIT_FOOTER_VISIBLE_STATUS_NONE)
-                               {
-                                       CheckInitialFooterVisibleState();
-                               }
                        }
 
-                       if (__isKeypadCommandButtonVisible)
+                       if (__initialFooterVisibleStatus == EDIT_FOOTER_VISIBLE_STATUS_NONE)
                        {
-                               SetFooterVisible(false);
+                               CheckInitialFooterVisibleState();
                        }
+               }
 
-                       if (__isKeypadExist)
-                       {
-                               ChangeLayoutInternal(__pEdit->GetOrientation());
-                               //ChangeLayoutInternal(__pEdit->GetOrientation(), false);
-                               ScrollPanelToExposedRegion(true);
-                               ScrollPanelToCursorPosition();
-                               if (__pParentForm)
-                               {
-                                       __pParentForm->SetKeypadShowState(true);//First show keypad after dispose
-                                       __pParentForm->Draw();
-                               }
-                       }
-                       else
+               if (__isKeypadCommandButtonVisible)
+               {
+                       SetFooterVisible(false);
+               }
+
+               if (__isKeypadExist)
+               {
+                       ChangeLayoutInternal(__pEdit->GetOrientation());
+                       //ChangeLayoutInternal(__pEdit->GetOrientation(), false);
+                       ScrollPanelToExposedRegion(true);
+                       ScrollPanelToCursorPosition();
+                       if (__pParentForm)
                        {
-                               __initialParentHeight = 0.0f;
-                               ScrollPanelToExposedRegion(true);
-                               ScrollPanelToCursorPosition();
+                               __pParentForm->SetKeypadShowState(true);//First show keypad after dispose
+                               __pParentForm->Draw();
                        }
-
-                       __pInputConnection->ShowInputPanel();
                }
+               else
+               {
+                       __initialParentHeight = 0.0f;
+                       ScrollPanelToExposedRegion(true);
+                       ScrollPanelToCursorPosition();
+               }
+
+               __pInputConnection->ShowInputPanel();
        }
 
        return E_SUCCESS;