Fixed PLM5063 and Changed not to adjust margin GE 100px.
authorclone <ingyou.park@samsung.com>
Thu, 23 May 2013 12:25:07 +0000 (21:25 +0900)
committerclone <ingyou.park@samsung.com>
Thu, 23 May 2013 12:34:29 +0000 (21:34 +0900)
Change-Id: Ia7229148e747170c139ca51a17662ba94d2c5811
Signed-off-by: clone <ingyou.park@samsung.com>
src/ui/controls/FUiCtrl_ContextMenu.cpp
src/ui/controls/FUiCtrl_ContextMenuGridPresenter.cpp
src/ui/controls/FUiCtrl_ContextMenuItem.cpp
src/ui/controls/FUiCtrl_ContextMenuListPresenter.cpp
src/ui/inc/FUiCtrl_ContextMenu.h
src/ui/inc/FUiCtrl_ContextMenuItem.h

index 474e0d9..e11bc77 100644 (file)
@@ -158,6 +158,7 @@ _ContextMenu::CreateContextMenuN(const FloatPoint& point, enum ContextMenuCoreSt
        if (pContextMenu->GetAccessibilityContainer() != null)
        {
                pContextMenu->GetAccessibilityContainer()->Activate(true);
+               pContextMenu->GetAccessibilityContainer()->AddListener(*pContextMenu);
        }
 
        if (style == CONTEXT_MENU_CORE_STYLE_LIST)
@@ -327,9 +328,7 @@ _ContextMenu::OnAttachedToMainTree(void)
        SetAllAccessibilityElement();
 
        _VisualElement* pVisualElement = GetVisualElement();
-
        FloatRectangle pBounds = pVisualElement->GetBounds();
-
        float oldBoundsX = pBounds.x;
        float oldBoundsY = pBounds.y;
        float distanceX = 0.0f;
@@ -1265,17 +1264,69 @@ _ContextMenu::SetAllAccessibilityElement(void)
        __pContextMenuPresenter->SetAllAccessibilityElement();
 }
 
+bool
+_ContextMenu::OnAccessibilityFocusMovedNext(const _AccessibilityContainer& control, const _AccessibilityElement& element)
+{
+       return false;
+}
+
+bool
+_ContextMenu::OnAccessibilityFocusMovedPrevious(const _AccessibilityContainer& control, const _AccessibilityElement& element)
+{
+       return false;
+}
+
+bool
+_ContextMenu::OnAccessibilityReadElement(const _AccessibilityContainer& control, const _AccessibilityElement& element)
+{
+       return false;
+}
+
+bool
+_ContextMenu::OnAccessibilityReadingElement(const _AccessibilityContainer& control, const _AccessibilityElement& element)
+{
+       return false;
+}
+
+bool
+_ContextMenu::OnAccessibilityFocusIn(const _AccessibilityContainer& control, const _AccessibilityElement& element)
+{
+       return false;
+}
+
+bool
+_ContextMenu::OnAccessibilityFocusOut(const _AccessibilityContainer& control, const _AccessibilityElement& element)
+{
+       return false;
+}
+
+bool
+_ContextMenu::OnAccessibilityActionPerformed(const _AccessibilityContainer& control, const _AccessibilityElement& element)
+{
+       SetVisibleState(false);
+
+       return true;
+}
+
+bool
+_ContextMenu::OnAccessibilityValueIncreased(const _AccessibilityContainer& control, const _AccessibilityElement& element)
+{
+       return false;
+}
+
+bool
+_ContextMenu::OnAccessibilityValueDecreased(const _AccessibilityContainer& control, const _AccessibilityElement& element)
+{
+       return false;
+}
+
 void
 _ContextMenu::RemoveAllAccessibilityElement(void)
 {
-       while (__accessibilityElements.GetCount() > 0)
+       _AccessibilityContainer* pAccessibilityContainer = GetAccessibilityContainer();
+       if (pAccessibilityContainer && pAccessibilityContainer->IsActivated())
        {
-               _AccessibilityElement* pElement = null;
-               if (__accessibilityElements.GetAt(0, pElement) == E_SUCCESS)
-               {
-                       __accessibilityElements.RemoveAt(0);
-                       pElement->GetParent()->RemoveElement(*pElement);
-               }
+               pAccessibilityContainer->RemoveAllElement();
        }
 }
 
index ce143c2..eb9db26 100644 (file)
@@ -514,17 +514,18 @@ _ContextMenuGridPresenter::CalculateRect(void)
                        bodyRect.y = topBoundary;
                }
 
+               float correctLength = __arrowTopMargin - __anchorPopupOverlap;
                windowRect.x = bodyRect.x;
-               windowRect.y = bodyRect.y + __arrowTopMargin - __anchorPopupOverlap;
+               windowRect.y = bodyRect.y + correctLength;
                windowRect.width = bodyRect.width;
-               windowRect.height = bodyRect.height + arrowRect.height - (__arrowTopMargin - __anchorPopupOverlap);
+               windowRect.height = bodyRect.height + arrowRect.height - correctLength;
 
                bodyRect.x = 0.0f;
                bodyRect.y = 0.0f;
 
                // Set arrow position
                arrowRect.x = anchorPosition.x - (arrowRect.width / 2.0f) - windowRect.x;
-               arrowRect.y = bodyRect.height - (__arrowTopMargin - __anchorPopupOverlap);
+               arrowRect.y = bodyRect.height - correctLength;
        }
        else if (dropPosition == CONTEXT_MENU_CORE_DROP_POSITION_DOWN)    // up Arrow
        {
@@ -570,13 +571,14 @@ _ContextMenuGridPresenter::CalculateRect(void)
                        bodyRect.y = bottomBoundary - bodyRect.height;
                }
 
+               float correctLength = __arrowBottomMargin - __anchorPopupOverlap;
                windowRect.x = bodyRect.x;
                windowRect.y = bodyRect.y - arrowRect.height;
                windowRect.width = bodyRect.width;
-               windowRect.height = bodyRect.height + arrowRect.height - __arrowBottomMargin + __anchorPopupOverlap;
+               windowRect.height = bodyRect.height + arrowRect.height - correctLength;
 
                bodyRect.x = 0.0f;
-               bodyRect.y = arrowRect.height - __arrowBottomMargin + __anchorPopupOverlap;
+               bodyRect.y = arrowRect.height - correctLength;
 
                // Set arrow position
                arrowRect.x = anchorPosition.x - (arrowRect.width / 2.0f) - windowRect.x;
@@ -632,16 +634,17 @@ _ContextMenuGridPresenter::CalculateRect(void)
                        bodyRect.y = bottomBoundary - bodyRect.height;
                }
 
-               windowRect.x = bodyRect.x + __arrowRightMargin - __anchorPopupOverlap;
+               float correctLength = __arrowRightMargin - __anchorPopupOverlap;
+               windowRect.x = bodyRect.x + correctLength;
                windowRect.y = bodyRect.y;
-               windowRect.width = bodyRect.width + arrowRect.width - (__arrowRightMargin - __anchorPopupOverlap);
+               windowRect.width = bodyRect.width + arrowRect.width - correctLength;
                windowRect.height = bodyRect.height;
 
                bodyRect.x = 0.0f;
                bodyRect.y = 0.0f;
 
                // Set arrow position
-               arrowRect.x = bodyRect.width - (__arrowRightMargin - __anchorPopupOverlap);
+               arrowRect.x = bodyRect.width - correctLength;
                arrowRect.y = anchorPosition.y - (arrowRect.height / 2.0f) - windowRect.y;
        }
        else    // left Arrow
@@ -693,12 +696,13 @@ _ContextMenuGridPresenter::CalculateRect(void)
                        bodyRect.y = bottomBoundary - bodyRect.height;
                }
 
+               float correctLength = __arrowLeftMargin - __anchorPopupOverlap;
                windowRect.x = bodyRect.x;
                windowRect.y = bodyRect.y;
-               windowRect.width = bodyRect.width + arrowRect.width - __arrowLeftMargin + __anchorPopupOverlap;
+               windowRect.width = bodyRect.width + arrowRect.width - correctLength;
                windowRect.height = bodyRect.height;
 
-               bodyRect.x = arrowRect.width - __arrowLeftMargin + __anchorPopupOverlap;
+               bodyRect.x = arrowRect.width - correctLength;
                bodyRect.y = 0.0f;
 
                // Set arrow position
@@ -997,7 +1001,12 @@ _ContextMenuGridPresenter::AdjustItemLayoutTabStyle(void)
                FloatRectangle drawRect;
                float width = lineWidthList[line];
                int count = lineItemCountList[line];
-               float margin = (maxWidth - width) / count;
+               float blank = maxWidth - width;
+               float addMargin = blank / count;
+               if (_FloatCompareGE(blank, 100.0f) && line == lineCount - 1)
+               {
+                       addMargin = 0.0f;
+               }
 
                float pressedTopMargin = 0.0f, pressedBottomMargin = 0.0f;
                if (line == 0)
@@ -1021,8 +1030,8 @@ _ContextMenuGridPresenter::AdjustItemLayoutTabStyle(void)
 
                        drawRect = pItem->GetDrawRect();
 
-                       drawRect.width = drawRect.width + margin;
-                       drawRect.x = drawRect.x + (i * margin);
+                       drawRect.width = drawRect.width + addMargin;
+                       drawRect.x = drawRect.x + (i * addMargin);
 
                        pItem->SetDrawRect(drawRect);
 
@@ -1565,17 +1574,15 @@ _ContextMenuGridPresenter::SetAllAccessibilityElement(void)
        _AccessibilityContainer* pContainer = __pContextMenu->GetAccessibilityContainer();
        if (pContainer != null)
        {
-               /* not confirmed yet
-               _AccessibilityElement* pElement = new (std::nothrow) _AccessibilityElement(true);
-               if (pElement != null)
-               {
-                       pElement->SetTrait(L"Contextual popup");
-                       pElement->SetHint(L"double tap to close");
-                       pElement->SetBounds(FloatRectangle(0.0f, 0.0f, __pContextMenu->GetBoundsF().width, __pContextMenu->GetBoundsF().height));
-                       pContainer->AddElement(*pElement);
-                       __pContextMenu->AddAccessibilityElement(*pElement);
-               }
-               */
+               _AccessibilityElement* pElementContextMenu = new (std::nothrow) _AccessibilityElement(true);
+               SysTryReturnVoidResult(NID_UI_CTRL, pElementContextMenu, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage.");
+
+               pElementContextMenu->SetSupportOperatingGesture(false);
+               pElementContextMenu->SetTrait(L"Contextual popup");
+               pElementContextMenu->SetHint(L"double tap to close");
+               pElementContextMenu->SetBounds(FloatRectangle(0.0f, 0.0f, __pContextMenu->GetBoundsF().width, __pContextMenu->GetBoundsF().height));
+               pContainer->AddElement(*pElementContextMenu);
+               __pContextMenu->AddAccessibilityElement(*pElementContextMenu);
 
                int itemCount = __pModel->GetItemCount();
                for (int i = 0; i < itemCount; i++)
index ed4a8cf..4a9223f 100644 (file)
@@ -76,6 +76,8 @@ _ContextMenuItem::_ContextMenuItem(void)
        GET_COLOR_CONFIG(CONTEXTMENU::LIST_ITEM_DIVIDER_01_NORMAL, __lowerDividerLineColor);    // lower divider of item n and
        GET_COLOR_CONFIG(CONTEXTMENU::LIST_ITEM_DIVIDER_02_NORMAL, __upperDividerLineColor);    // upper divider of item n+1 are bonded together.
        GET_BITMAP_CONFIG_N(CONTEXTMENU::ITEM_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pMagentaBgBitmap);
+
+       InitializeAccessibilityElement();
 }
 
 _ContextMenuItem::~_ContextMenuItem(void)
@@ -121,6 +123,12 @@ _ContextMenuItem::~_ContextMenuItem(void)
                delete __pLowerDividerLineLabel;
                __pLowerDividerLineLabel = null;
        }
+
+       _AccessibilityContainer* pContainer = GetAccessibilityContainer();
+       if (pContainer)
+       {
+               pContainer->RemoveAllElement();
+       }
 }
 
 _ContextMenuItem*
@@ -144,6 +152,24 @@ _ContextMenuItem::CreateContextMenuItemN(void)
 }
 
 void
+_ContextMenuItem::InitializeAccessibilityElement(void)
+{
+       _AccessibilityContainer* pContainer = GetAccessibilityContainer();
+       if (pContainer)
+       {
+               pContainer->Activate(true);
+               _AccessibilityElement* pElement = new (std::nothrow) _AccessibilityElement(true);
+               SysTryReturnVoidResult(NID_UI_CTRL, pElement, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage.");
+
+               pElement->SetTrait(L"Contextual popup");
+               pElement->SetBounds(FloatRectangle(0.0f, 0.0f, GetBoundsF().width, GetBoundsF().height));
+               pContainer->AddElement(*pElement);
+       }
+
+       return;
+}
+
+void
 _ContextMenuItem::SetBitmapLabel(_Label* pLabel)
 {
        __pBitmapLabel = pLabel;
@@ -313,6 +339,20 @@ _ContextMenuItem::Release(void)
 }
 
 void
+_ContextMenuItem::OnBoundsChanged(void)
+{
+       _AccessibilityContainer* pContainer = GetAccessibilityContainer();
+       if (pContainer)
+       {
+               _AccessibilityElement* pElement = pContainer->GetChildElement(0);
+               if (pElement)
+               {
+                       pElement->SetBounds(FloatRectangle(0.0f, 0.0f, GetBoundsF().width, GetBoundsF().height));
+               }
+       }
+}
+
+void
 _ContextMenuItem::OnDraw(void)
 {
        DrawItem();
@@ -346,6 +386,12 @@ _ContextMenuItem::DrawItemUpperDivider(void)
                __pUpperDividerLineLabel->SetBounds(FloatRectangle(__leftMargin, 0.0f, bounds.width - __leftMargin - __rightMargin, __dividerHeight));
 
                AttachChild(*__pUpperDividerLineLabel);
+
+               _AccessibilityContainer* pContainer = __pUpperDividerLineLabel->GetAccessibilityContainer();
+               if (pContainer)
+               {
+                       pContainer->Activate(false);
+               }
        }
 
        Color dividerLineColor = Color(0, 0, 0, 0);
@@ -356,12 +402,6 @@ _ContextMenuItem::DrawItemUpperDivider(void)
 
        __pUpperDividerLineLabel->SetBackgroundColor(dividerLineColor);
        __pUpperDividerLineLabel->Invalidate();
-
-       _AccessibilityContainer* pContainer = __pUpperDividerLineLabel->GetAccessibilityContainer();
-       if (pContainer)
-       {
-               pContainer->Activate(false);
-       }
 }
 
 void
@@ -379,6 +419,12 @@ _ContextMenuItem::DrawItemBackground(void)
                __pBackgroundLabel->SetTouchPressThreshold(TOUCH_PRESS_THRESHOLD_INSENSITIVE);
                AttachChild(*__pBackgroundLabel);
                MoveChildToBottom(*__pBackgroundLabel);
+
+               _AccessibilityContainer* pContainer = __pBackgroundLabel->GetAccessibilityContainer();
+               if (pContainer)
+               {
+                       pContainer->Activate(false);
+               }
        }
 
        Color color= Color(0, 0, 0, 0);
@@ -402,7 +448,7 @@ _ContextMenuItem::DrawItemBackground(void)
        }
 
        float bottomOverlap = bounds.y + bounds.height - (pScrollPanel->GetScrollPosition() + boundsScrollPanel.height);
-       if (bottomOverlap > 0.0f) 
+       if (bottomOverlap > 0.0f)
        {
                bottomMargin = bottomOverlap + __bgPressedMargin;
        }
@@ -421,12 +467,6 @@ _ContextMenuItem::DrawItemBackground(void)
        BgBitmap = null;
 
        __pBackgroundLabel->Invalidate();
-
-       _AccessibilityContainer* pContainer = __pBackgroundLabel->GetAccessibilityContainer();
-       if (pContainer)
-       {
-               pContainer->Activate(false);
-       }
 }
 
 void
@@ -441,6 +481,12 @@ _ContextMenuItem::DrawItemLowerDivider(void)
                __pLowerDividerLineLabel->SetBounds(FloatRectangle(__leftMargin, bounds.height - __dividerHeight, bounds.width - __leftMargin - __rightMargin, __dividerHeight));
 
                AttachChild(*__pLowerDividerLineLabel);
+
+               _AccessibilityContainer* pContainer = __pLowerDividerLineLabel->GetAccessibilityContainer();
+               if (pContainer)
+               {
+                       pContainer->Activate(false);
+               }
        }
 
        Color dividerLineColor = Color(0, 0, 0, 0);
@@ -451,12 +497,6 @@ _ContextMenuItem::DrawItemLowerDivider(void)
 
        __pLowerDividerLineLabel->SetBackgroundColor(dividerLineColor);
        __pLowerDividerLineLabel->Invalidate();
-
-       _AccessibilityContainer* pContainer = __pLowerDividerLineLabel->GetAccessibilityContainer();
-       if (pContainer)
-       {
-               pContainer->Activate(false);
-       }
 }
 
 _UiTouchEventDelivery
index fd7baab..55b9320 100644 (file)
@@ -505,17 +505,18 @@ _ContextMenuListPresenter::CalculateRect(void)
                        bodyRect.y = topBoundary;
                }
 
+               float correctLength = __arrowTopMargin - __anchorPopupOverlap;
                windowRect.x = bodyRect.x;
-               windowRect.y = bodyRect.y + __arrowTopMargin - __anchorPopupOverlap;
+               windowRect.y = bodyRect.y + correctLength;
                windowRect.width = bodyRect.width;
-               windowRect.height = bodyRect.height + arrowRect.height - (__arrowTopMargin - __anchorPopupOverlap);
+               windowRect.height = bodyRect.height + arrowRect.height - correctLength;
 
                bodyRect.x = 0.0f;
                bodyRect.y = 0.0f;
 
                // Set arrow position
                arrowRect.x = anchorPosition.x - (arrowRect.width / 2.0f) - windowRect.x;
-               arrowRect.y = bodyRect.height - (__arrowTopMargin - __anchorPopupOverlap);
+               arrowRect.y = bodyRect.height - correctLength;
        }
        else if (dropPosition == CONTEXT_MENU_CORE_DROP_POSITION_DOWN)    // up Arrow
        {
@@ -561,13 +562,14 @@ _ContextMenuListPresenter::CalculateRect(void)
                        bodyRect.y = bottomBoundary - bodyRect.height;
                }
 
+               float correctLength = __arrowBottomMargin - __anchorPopupOverlap;
                windowRect.x = bodyRect.x;
                windowRect.y = bodyRect.y - arrowRect.height;
                windowRect.width = bodyRect.width;
-               windowRect.height = bodyRect.height + arrowRect.height - __arrowBottomMargin + __anchorPopupOverlap;
+               windowRect.height = bodyRect.height + arrowRect.height - correctLength;
 
                bodyRect.x = 0.0f;
-               bodyRect.y = arrowRect.height - __arrowBottomMargin + __anchorPopupOverlap;
+               bodyRect.y = arrowRect.height - correctLength;
 
                // Set arrow position
                arrowRect.x = anchorPosition.x - (arrowRect.width / 2.0f) - windowRect.x;
@@ -623,16 +625,17 @@ _ContextMenuListPresenter::CalculateRect(void)
                        bodyRect.y = bottomBoundary - bodyRect.height;
                }
 
-               windowRect.x = bodyRect.x + __arrowRightMargin - __anchorPopupOverlap;
+               float correctLength = __arrowRightMargin - __anchorPopupOverlap;
+               windowRect.x = bodyRect.x + correctLength;
                windowRect.y = bodyRect.y;
-               windowRect.width = bodyRect.width + arrowRect.width - (__arrowRightMargin - __anchorPopupOverlap);
+               windowRect.width = bodyRect.width + arrowRect.width - correctLength;
                windowRect.height = bodyRect.height;
 
                bodyRect.x = 0.0f;
                bodyRect.y = 0.0f;
 
                // Set arrow position
-               arrowRect.x = bodyRect.width - (__arrowRightMargin - __anchorPopupOverlap);
+               arrowRect.x = bodyRect.width - correctLength;
                arrowRect.y = anchorPosition.y - (arrowRect.height / 2.0f) - windowRect.y;
        }
        else    // left Arrow
@@ -684,12 +687,13 @@ _ContextMenuListPresenter::CalculateRect(void)
                        bodyRect.y = bottomBoundary - bodyRect.height;
                }
 
+               float correctLength = __arrowLeftMargin - __anchorPopupOverlap;
                windowRect.x = bodyRect.x;
                windowRect.y = bodyRect.y;
-               windowRect.width = bodyRect.width + arrowRect.width - __arrowLeftMargin + __anchorPopupOverlap;
+               windowRect.width = bodyRect.width + arrowRect.width - correctLength;
                windowRect.height = bodyRect.height;
 
-               bodyRect.x = arrowRect.width - __arrowLeftMargin + __anchorPopupOverlap;
+               bodyRect.x = arrowRect.width - correctLength;
                bodyRect.y = 0.0f;
 
                // Set arrow position
@@ -1081,50 +1085,51 @@ _ContextMenuListPresenter::OnFontInfoRequested(unsigned long& style, float& size
 void
 _ContextMenuListPresenter::SetAllAccessibilityElement(void)
 {
-       _AccessibilityContainer* pContainer = __pContextMenu->GetAccessibilityContainer();
-       if (pContainer != null)
+       _AccessibilityContainer* pContainerContextMenu = __pContextMenu->GetAccessibilityContainer();
+       if (pContainerContextMenu != null)
        {
-               /* not confirmed yet
-               _AccessibilityElement* pElement = new (std::nothrow) _AccessibilityElement(true);
-               if (pElement != null)
-               {
-                       pElement->SetTrait(L"Contextual popup");
-                       pElement->SetHint(L"double tap to close");
-                       pElement->SetBounds(FloatRectangle(0.0f, 0.0f, __pContextMenu->GetBoundsF().width, __pContextMenu->GetBoundsF().height));
-                       pContainer->AddElement(*pElement);
-                       __pContextMenu->AddAccessibilityElement(*pElement);
-               }
-               */
+               _AccessibilityElement* pElementContextMenu = new (std::nothrow) _AccessibilityElement(true);
+               SysTryReturnVoidResult(NID_UI_CTRL, pElementContextMenu, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage.");
+
+               pElementContextMenu->SetSupportOperatingGesture(false);
+               pElementContextMenu->SetTrait(L"Contextual popup");
+               pElementContextMenu->SetHint(L"double tap to close");
+               pElementContextMenu->SetBounds(FloatRectangle(0.0f, 0.0f, __pContextMenu->GetBoundsF().width, __pContextMenu->GetBoundsF().height));
+               pContainerContextMenu->AddElement(*pElementContextMenu);
+               __pContextMenu->AddAccessibilityElement(*pElementContextMenu);
 
                int itemCount = __pModel->GetItemCount();
                for (int i = 0; i < itemCount; i++)
                {
                        _ContextMenuItem* pItem = __pModel->GetItem(i);
-                       _AccessibilityElement* pElement = new (std::nothrow) _AccessibilityElement(true);
-                       if (pItem != null && pElement != null)
+                       if (pItem)
                        {
-                               pElement->SetName(L"ContextMenuItem" + Integer::ToString(i));
-                               if (pItem->GetType() == CONTEXT_MENU_ITEM_DRAWING_TYPE_BITMAP)
-                               {
-                                       pElement->SetLabel(L"icon " + pItem->GetText());
-                               }
-                               else
+                               _AccessibilityContainer* pContainer = pItem->GetAccessibilityContainer();
+                               if (pContainer != null)
                                {
-                                       pElement->SetLabel(pItem->GetText());
+                                       LinkedListT<_AccessibilityElement*> accessibilityElements;
+                                       _AccessibilityElement* pElement = null;
+
+                                       pContainer->GetElements(accessibilityElements);
+                                       if (accessibilityElements.GetAt(0, pElement) == E_SUCCESS)
+                                       {
+                                               pElement->SetName(L"ContextMenuItem" + Integer::ToString(i));
+                                               if (pItem->GetType() == CONTEXT_MENU_ITEM_DRAWING_TYPE_BITMAP)
+                                               {
+                                                       pElement->SetLabel(L"icon " + pItem->GetText());
+                                               }
+                                               else
+                                               {
+                                                       pElement->SetLabel(pItem->GetText());
+                                               }
+
+                                               pElement->SetBounds(FloatRectangle(0.0f, 0.0f, pItem->GetBoundsF().width, pItem->GetBoundsF().height));
+                                       }
+                                       pContainerContextMenu->AddChildContainer(*pContainer);
                                }
-
-                               pElement->SetTrait(L"Contextual popup");
-                               pElement->SetBounds(pItem->GetDrawRect());
-                               pContainer->AddElement(*pElement);
-                               __pContextMenu->AddAccessibilityElement(*pElement);
-                       }
-                       else
-                       {
-                               delete pElement;
                        }
                }
        }
-
 }
 
 _ContextMenuItemInfo
index da6bf96..c7631c5 100644 (file)
@@ -95,6 +95,7 @@ class _OSP_EXPORT_ _ContextMenu
        , virtual public Tizen::Base::Runtime::IEventListener
        , virtual public _IUiEventListener
        , virtual public _IUiEventPreviewer
+       , public _IAccessibilityListener
 {
        DECLARE_CLASS_BEGIN(_ContextMenu, _Control);
        DECLARE_PROPERTY("color", GetPropertyColor, SetPropertyColor);
@@ -203,6 +204,16 @@ public:
        virtual void OnChangeLayout(_ControlOrientation orientation);
        virtual void OnOwnerChanged(_Control* pOldOwner);
 
+       virtual bool OnAccessibilityFocusMovedNext(const _AccessibilityContainer& control, const _AccessibilityElement& element);
+       virtual bool OnAccessibilityFocusMovedPrevious(const _AccessibilityContainer& control, const _AccessibilityElement& element);
+       virtual bool OnAccessibilityReadingElement(const _AccessibilityContainer& control, const _AccessibilityElement& element);
+       virtual bool OnAccessibilityReadElement(const _AccessibilityContainer& control, const _AccessibilityElement& element);
+       virtual bool OnAccessibilityFocusIn(const _AccessibilityContainer& control, const _AccessibilityElement& element);
+       virtual bool OnAccessibilityFocusOut(const _AccessibilityContainer& control, const _AccessibilityElement& element);
+       virtual bool OnAccessibilityActionPerformed(const _AccessibilityContainer& control, const _AccessibilityElement& element);
+       virtual bool OnAccessibilityValueIncreased(const _AccessibilityContainer& control, const _AccessibilityElement& element);
+       virtual bool OnAccessibilityValueDecreased(const _AccessibilityContainer& control, const _AccessibilityElement& element);
+
        Tizen::Ui::_AccessibilityElement* GetAccessibilityElement(const int mainIndex) const;
        void AddAccessibilityElement(const _AccessibilityElement& element);
 
index 4ef8669..447c3be 100644 (file)
@@ -71,6 +71,8 @@ public:
 
        static _ContextMenuItem* CreateContextMenuItemN(void);
 
+       void InitializeAccessibilityElement(void);
+
        void SetType(ContextMenuItemDrawingType type);
        ContextMenuItemDrawingType GetType(void) const;
 
@@ -109,6 +111,7 @@ public:
        void SetAndInvalidate(bool flag);
        const Tizen::Graphics::Bitmap* GetMagentaBgBitmap(void) const;
 
+       virtual void OnBoundsChanged(void);
        // draw
        virtual void OnDraw(void);
        void DrawItem(void);