Modified logic so that accessibility can work properly and enter_key operation in...
authoryouseong.ji <youseong.ji@samsung.com>
Mon, 3 Jun 2013 05:16:37 +0000 (14:16 +0900)
committeryouseong.ji <youseong.ji@samsung.com>
Mon, 3 Jun 2013 05:16:37 +0000 (14:16 +0900)
Change-Id: If8116d7904713dde69a3d9f1bba3c2a8a646384c
Signed-off-by: youseong.ji <youseong.ji@samsung.com>
src/ui/controls/FUiCtrl_ListViewItem.cpp
src/ui/controls/FUiCtrl_TableView.cpp
src/ui/controls/FUiCtrl_TableViewItem.cpp
src/ui/controls/FUiCtrl_TableViewPresenter.cpp
src/ui/inc/FUiCtrl_TableView.h

index ae991d4..1498d40 100644 (file)
@@ -1934,6 +1934,7 @@ _ListViewItem::SetAccessibilityElement(void)
 
        if (pContainer != null)
        {
+               pContainer->Activate(true);
                if (__pAccessibilityElement == null)
                {
                        __pAccessibilityElement = new (std::nothrow) _AccessibilityElement(true);
index 894060d..bf30055 100644 (file)
@@ -1085,6 +1085,12 @@ _TableView::CollapseAllGroup(bool animation)
 }
 
 void
+_TableView::StopExpandCollapseAnimation(void)
+{
+       __pTableViewPresenter->StopExpandCollapseAnimation();
+}
+
+void
 _TableView::SetGroupedLookEnabled(bool enable)
 {
        __groupedLookEnable = enable;
index 86ac35b..96ecfe5 100644 (file)
@@ -442,6 +442,8 @@ _TableViewItem::Initialize(void)
                SetAccessibilityElement();
        }
 
+       GetAccessibilityContainer()->Activate(false);
+
        return r;
 
 CATCH:
@@ -983,6 +985,7 @@ _TableViewItem::SetItemType(const TableViewItemType itemType)
                {
                        GET_COLOR_CONFIG(TABLEVIEW::GROUPITEM_BG_PRESSED, __colorItemBg[TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED]);
                }
+               GetAccessibilityContainer()->Activate(true);
        }
 }
 
@@ -1553,10 +1556,27 @@ _TableViewItem::OnDraw(void)
 void
 _TableViewItem::OnChildAttached(const _Control& child)
 {
-       _AccessibilityContainer* pContainer = const_cast<_Control*>(&child)->GetAccessibilityContainer();
-       pContainer->Activate(false);
-
        _Control* pControl = const_cast<_Control*>(&child);
+       _AccessibilityContainer* pContainer = pControl->GetAccessibilityContainer();
+
+       if (__individualSelectionControls.Contains(child))
+       {
+               pContainer->Activate(true);
+       }
+       else
+       {
+               pContainer->Activate(false);
+
+               if(!(pControl == static_cast<_Control*>(__pItemAnnexLeftDivider)
+                       || pControl == static_cast<_Control*>(__pItemAnnexRightDivider)
+                       || pControl == static_cast<_Control*>(__pItemCover)
+                       || pControl == static_cast<_Control*>(__pItemDivider)
+                       || pControl== static_cast<_Control*>(__pItemTopDivider)))
+               {
+                       GetAccessibilityContainer()->Activate(true);
+               }
+       }
+
        pControl->SetTouchPressThreshold(SENSITIVE);
 
        FloatRectangle bounds = child.GetBoundsF();
@@ -4132,6 +4152,30 @@ _TableViewItem::SetIndividualSelectionEnabled(const _Control& control, bool enab
 
                _AccessibilityContainer* pContainer = const_cast<_Control*>(&control)->GetAccessibilityContainer();
                pContainer->Activate(true);
+               int controlCount = 0;
+               for(int i=0; i<GetChildCount(); i++)
+               {
+                       _Control* pChildControl = GetChild(i);
+                       if(pChildControl == static_cast<_Control*>(__pItemAnnexLeftDivider)
+                               || pChildControl == static_cast<_Control*>(__pItemAnnexRightDivider)
+                               || pChildControl == static_cast<_Control*>(__pItemCover)
+                               || pChildControl == static_cast<_Control*>(__pItemDivider)
+                               || pChildControl== static_cast<_Control*>(__pItemTopDivider))
+                       {
+                               continue;
+                       }
+
+                       controlCount++;
+               }
+
+               if(controlCount == 0 || __individualSelectionControls.GetCount() == controlCount)
+               {
+                       GetAccessibilityContainer()->Activate(false);
+               }
+               else
+               {
+                       GetAccessibilityContainer()->Activate(true);
+               }
        }
        else
        {
@@ -4316,6 +4360,7 @@ void
 _TableViewItem::SetAccessibilityElement(void)
 {
        _AccessibilityContainer* pContainer = GetAccessibilityContainer();
+
        if(pContainer != null)
        {
                if(__pAccessibilityElement == null)
@@ -4557,41 +4602,96 @@ _TableViewItem::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo)
                 }
                 break;
 
-        case _KEY_RIGHT:
-                if (pFocusedControl != null)
-                {
-                        pChildControl = GetNextFocusChildControl(*pFocusedControl);
-                }
-                break;
+       case _KEY_RIGHT:
+               if (pFocusedControl != null)
+               {
+                       pChildControl = GetNextFocusChildControl(*pFocusedControl);
+               }
+               break;
 
-        default:
-                return false;
-        }
+       case _KEY_ENTER:
+               if (&source == this)
+               {
+                       __pressedControl = TABLE_VIEW_ITEM_PRESSED_ITEM;
+               }
+               else if (&source == GetLabelCore(__pItemAnnex))
+               {
+                       __pressedControl = TABLE_VIEW_ITEM_PRESSED_ANNEX;
+               }
+               else if (IsIndividualSelectionEnabled(source))
+               {
+                       __pressedControl = TABLE_VIEW_ITEM_PRESSED_INDIVIDUAL;
+               }
+               else
+               {
+                       __pressedControl = TABLE_VIEW_ITEM_PRESSED_NONE;
+               }
+               __itemSelected = true;
+               FireItemTouchPressed();
+               break;
 
-        if (pFocusedControl != null)
-        {
-                if (pChildControl)
-                {
-                        pChildControl->SetFocused(true);
-                        pChildControl->DrawFocus();
-                }
-                else
-                {
-                        _Control* pParentControl = pFocusedControl->GetParent();
-                        pParentControl->SetFocused(true);
-                        pParentControl->DrawFocus();
-                }
-        }
+       default:
+               return false;
+       }
 
-        return true;
+       if (keyCode == _KEY_LEFT || keyCode == _KEY_RIGHT)
+       {
+               if (pFocusedControl != null)
+               {
+                       if (pChildControl)
+                       {
+                               pChildControl->SetFocused(true);
+                               pChildControl->DrawFocus();
+                       }
+                       else
+                       {
+                               _Control* pParentControl = pFocusedControl->GetParent();
+                               pParentControl->SetFocused(true);
+                               pParentControl->DrawFocus();
+                       }
+               }
+       }
+       return true;
 }
 
 bool
 _TableViewItem::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo)
 {
-        _KeyCode keyCode = keyInfo.GetKeyCode();
+       _KeyCode keyCode = keyInfo.GetKeyCode();
 
-       if (keyCode == _KEY_LEFT || keyCode == _KEY_RIGHT)
+       switch (keyCode)
+       {
+       case _KEY_ENTER:
+               if (&source == this)
+               {
+                       __releasedControl = TABLE_VIEW_ITEM_PRESSED_ITEM;
+               }
+               else if (&source == GetLabelCore(__pItemAnnex))
+               {
+                       __releasedControl = TABLE_VIEW_ITEM_PRESSED_ANNEX;
+               }
+               else if (IsIndividualSelectionEnabled(source))
+               {
+                       __releasedControl = TABLE_VIEW_ITEM_PRESSED_INDIVIDUAL;
+               }
+               else
+               {
+                       __releasedControl = TABLE_VIEW_ITEM_PRESSED_NONE;
+               }
+               break;
+
+       default:
+               return false;
+       }
+
+       if(keyCode == _KEY_ENTER)
+       {
+               _TableView* pParent = dynamic_cast<_TableView*>(GetParent());
+               pParent->StopExpandCollapseAnimation();
+               FireItemTouchReleased();
+               return true;
+       }
+       else if (keyCode == _KEY_LEFT || keyCode == _KEY_RIGHT)
        {
                return true;
        }
index 8f4a58f..9ced5cc 100644 (file)
@@ -5402,45 +5402,6 @@ _TableViewPresenter::OnKeyPressed(const _Control& source, const _KeyInfo& keyInf
                 }
                 break;
 
-        case _KEY_ENTER:
-                if (pFocusedControl != null)
-                {
-                        pItem = dynamic_cast<_TableViewItem*>(pFocusedControl);
-                        if (pItem != null)
-                        {
-                                TableViewNotifyType eventType = TABLEVIEW_NOTIFY_TYPE_SELECTED_ITEM;
-                                int annexStyle = pItem->GetItemStyle();
-                                pItem->GetItemIndex(itemPos.groupIndex, itemPos.itemIndex);
-                                if ((annexStyle == TABLE_VIEW_ANNEX_STYLE_MARK)
-                                                || (annexStyle == TABLE_VIEW_ANNEX_STYLE_RADIO)
-                                                || (annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING))
-                                {
-                                        if (pItem->IsChecked())
-                                        {
-                                                eventType = TABLEVIEW_NOTIFY_TYPE_ANNEX_UNCHECK;
-                                        }
-                                        else
-                                        {
-                                                eventType = TABLEVIEW_NOTIFY_TYPE_ANNEX_CHECK;
-                                        }
-                                }
-                                else if (__pTableView->GetTableViewStyle() == TABLE_VIEW_STYLE_GROUPED && itemPos.itemIndex == -1)
-                                {
-                                        if (IsGroupExpanded(itemPos.groupIndex))
-                                        {
-                                                CollapseGroup(itemPos.groupIndex, false);
-                                        }
-                                        else
-                                        {
-                                                ExpandGroup(itemPos.groupIndex, false);
-                                        }
-                                        eventType = TABLEVIEW_NOTIFY_TYPE_NONE;
-                                }
-                                __pTableView->FireTableViewItemEvent(itemPos.groupIndex, itemPos.itemIndex, eventType, pItem);
-                        }
-                }
-                break;
-
         default:
                 return false;
         }
@@ -5453,7 +5414,7 @@ _TableViewPresenter::OnKeyReleased(const _Control& source, const _KeyInfo& keyIn
 {
         _KeyCode keyCode = keyInfo.GetKeyCode();
 
-       if (keyCode == _KEY_UP || keyCode == _KEY_DOWN || keyCode == _KEY_ENTER)
+       if (keyCode == _KEY_UP || keyCode == _KEY_DOWN)
        {
                return true;
        }
index f15a251..608a33d 100644 (file)
@@ -202,6 +202,7 @@ public:
 
        result ExpandAllGroup(bool animation);
        result CollapseAllGroup(bool animation);
+       void StopExpandCollapseAnimation(void);
 
        void SetGroupedLookEnabled(bool enable);
        bool IsGroupedLookEnabled(void) const;