TizenRefApp-9738 [Call UI] Reimplement ATSPI highlight custom logic using AoSequencer 71/158271/6
authorIgor Olshevskyi <i.olshevskyi@samsung.com>
Mon, 30 Oct 2017 13:09:56 +0000 (15:09 +0200)
committerIgor Olshevskyi <i.olshevskyi@samsung.com>
Wed, 1 Nov 2017 08:44:22 +0000 (10:44 +0200)
Change-Id: Id7995c9e9df2173a3e7535e381dd08f3fd0aa682

call-ui/presenters/misc/AccessoryPresenter.cpp
call-ui/presenters/misc/AccessoryPresenter.h
call-ui/presenters/misc/MoreOptionsPresenter.cpp
call-ui/presenters/misc/RejectMsgPresenter.cpp
call-ui/presenters/pages/KeypadPage.cpp
call-ui/presenters/pages/KeypadPage.h
call-ui/presenters/pages/MainPage.cpp
call-ui/presenters/pages/MainPage.h
call-ui/presenters/types.h
call-ui/view/VolumeControl.cpp
call-ui/view/VolumeControl.h

index dcee9e5f2b63f9bf985138f113abafb811a7d2f3..66f68fa40ba87f304894fec03d6c36cb44d59ed5 100644 (file)
@@ -18,6 +18,8 @@
 
 #include "ucl/appfw/types.h"
 
+#include "call-ui/view/AoSequencer.h"
+
 #include "call-ui/resources.h"
 
 #include "call-ui/presenters/common.h"
@@ -123,6 +125,14 @@ namespace callui {
                return *this;
        }
 
+       AccessoryPresenter::Builder &
+       AccessoryPresenter::Builder::setAoRequestHandler(
+                       AoRequestHandler handler)
+       {
+               m_aoRequestHandler = std::move(handler);
+               return *this;
+       }
+
        AccessoryPresenter::Builder &
        AccessoryPresenter::Builder::setParentWidget(ElmWidgetSRef parentWidget)
        {
@@ -133,23 +143,27 @@ namespace callui {
        AccessoryPresenterSRef
        AccessoryPresenter::Builder::build(GuiPresenter &parent) const
        {
-               if (!m_sm || !m_cm || !m_parentWidget) {
+               if (!m_sm || !m_cm || !m_parentWidget || !m_aoRequestHandler) {
                        LOG_RETURN_VALUE(RES_FAIL, {}, "Main params are not set");
                }
 
-               auto result = makeShared<AccessoryPresenter>(m_sm, m_exitHandler);
-               FAIL_RETURN_VALUE(result->prepare(parent, *m_parentWidget, m_cm), {},
-                               "result->prepare() failed!");
+               auto result = makeShared<AccessoryPresenter>(m_sm,
+                               m_exitHandler,
+                               m_aoRequestHandler);
+               FAIL_RETURN_VALUE(result->prepare(parent, *m_parentWidget, m_cm),
+                               {}, "result->prepare() failed!");
 
                return result;
        }
 
        AccessoryPresenter::AccessoryPresenter(IRefCountObj &rc,
                        ISoundManagerSRef sm,
-                       NotiHandler handler):
+                       NotiHandler exitHandler,
+                       AoRequestHandler aoReqHandler):
                GuiPresenter(rc),
                m_sm(std::move(sm)),
-               m_exitHandler(std::move(handler)),
+               m_exitHandler(std::move(exitHandler)),
+               m_aoRequestHandler(std::move(aoReqHandler)),
                m_vcTimer(nullptr),
                m_audioState(m_sm->getAudioState()),
                m_mode(CallMode::UNDEFINED),
@@ -171,13 +185,12 @@ namespace callui {
 
                FAIL_RETURN(createWidget(parentWidget),
                                "createWidget() failed!");
-
                FAIL_RETURN(createSlider(),
                                "createSlider() failed!");
-
                FAIL_RETURN(createVolumeControl(),
                                "createVolumeControl() failed!");
-
+               FAIL_RETURN(createAtspiHighlightHelper(),
+                               "createAtspiHighlightHelper() failed!");
 
                updateCurrentVolume();
 
@@ -233,11 +246,17 @@ namespace callui {
                switch (m_mode) {
                case CallMode::OUTGOING:
                case CallMode::DURING:
-                       return setActiveCallCompomnents();
+                       FAIL_RETURN(setActiveCallCompomnents(),
+                                       "setActiveCallCompomnents() failed!");
+                       registerActiveCallAoCompomnents();
+                       break;
                case CallMode::END:
-                       return setEndCallCompomnents(cm);
+                       FAIL_RETURN(setEndCallCompomnents(cm),
+                                       "setEndCallCompomnents() failed!");
+                       registerEndCallAoCompomnents();
+                       break;
                default:
-                       return RES_OK;
+                       break;
                }
                return RES_OK;
        }
@@ -299,6 +318,11 @@ namespace callui {
                hide(*m_vc);
        }
 
+       bool AccessoryPresenter::getVolumeControlsVisibility()
+       {
+               return m_vc->isVisible();
+       }
+
        Result AccessoryPresenter::createWidget(ElmWidget &parent)
        {
                m_widget = Layout::Builder().
@@ -308,6 +332,8 @@ namespace callui {
                        LOG_RETURN(RES_FAIL, "Layout::build() failed!");
                }
 
+               setDeactivatorSink(m_widget);
+
                return RES_OK;
        }
 
@@ -346,7 +372,11 @@ namespace callui {
                m_vc->resize(w, h);
                hide(*m_vc);
 
-               registerVolumeControlAo();
+               m_vc->getDecreaseBtn().addEventHandler(ATSPI_HIGHLIGHTED,
+                               WEAK_DELEGATE_THIS(onVolumeControlScreenReaderReadStart));
+
+               m_vc->getIncreaseBtn().addEventHandler(ATSPI_HIGHLIGHTED,
+                               WEAK_DELEGATE_THIS(onVolumeControlScreenReaderReadStart));
 
                return RES_OK;
        }
@@ -479,7 +509,8 @@ namespace callui {
                }
        }
 
-       void AccessoryPresenter::onAddContactBtnClicked(Widget &widget, void *eventInfo)
+       void AccessoryPresenter::onAddContactBtnClicked(Widget &widget,
+                       void *eventInfo)
        {
                Result res = impl::launchAddContact(m_unsavedPhoneNumber);
                if (res != RES_OK) {
@@ -724,67 +755,106 @@ namespace callui {
                                m_muteBtn->emit(impl::SIGNAL_TURN_OFF);
        }
 
-       ElmWidget *AccessoryPresenter::getVolumBtn()
+       void AccessoryPresenter::onVolumeControlScreenReaderReadStart(
+                       Widget &widget,
+                       void *eventInfo)
        {
-               return m_volumeBtn.get();
+               restartVCTimer();
        }
 
-       ElmWidget *AccessoryPresenter::getBluetoothBtn()
+       Result AccessoryPresenter::createAtspiHighlightHelper()
        {
-               return m_bluetoothBtn.get();
-       }
+               m_atspiHelper = AtspiHighlightHelper::newInstance(*this);
+               if (!m_atspiHelper) {
+                       LOG_RETURN(RES_FAIL,
+                                       "AtspiHighlightHelper::newInstance() failed!");
+               }
 
-       ElmWidget *AccessoryPresenter::getMuteBtn()
-       {
-               return m_muteBtn.get();
-       }
+               m_atspiHelper->setEventHandler(
+                               WEAK_DELEGATE_THIS(onAtspiHighlight));
 
-       ElmWidget *AccessoryPresenter::getAddContactBtn()
-       {
-               return m_addContactBtn.get();
+               return RES_OK;
        }
 
-       ElmWidget *AccessoryPresenter::getVolumeControlLy()
+       const Elm_Interface_Atspi_Accessible *AccessoryPresenter::onAtspiHighlight(
+                       const Elm_Interface_Atspi_Accessible *ao,
+                       Elm_Atspi_Relation_Type flowRelation)
        {
-               return m_vc.get();
-       }
+               AoSequencer seq(ao, flowRelation);
 
-       ElmWidget *AccessoryPresenter::getVolumeControlDecreaseBtn()
-       {
-               return m_vc->getDecreaseBtn();
+               switch (m_mode) {
+               case CallMode::OUTGOING:
+               case CallMode::DURING:
+                       if (m_vc->isVisible()) {
+                               return seq.process(m_vc).
+                                               process(m_vc->getDecreaseBtn()).
+                                               process(m_vc->getValueTxtAo()).
+                                               process(m_vc->getIncreaseBtn()).
+                                               getNext();
+                       } else {
+                               return seq.process(requestNextAo(false)).
+                                               process(m_volumeBtn).
+                                               process(m_bluetoothBtn).
+                                               process(m_muteBtn).
+                                               process(requestNextAo(true)).
+                                               getNext();
+                       }
+               case CallMode::END:
+                       return seq.process(requestNextAo(false)).
+                                       process(m_addContactBtn).
+                                       process(requestNextAo(true)).
+                                       getNext();
+               default:
+                       break;
+               }
+
+               return nullptr;
        }
 
-       ElmWidget *AccessoryPresenter::getVolumeControlIncreaseBtn()
+       void AccessoryPresenter::registerActiveCallAoCompomnents()
        {
-               return m_vc->getIncreaseBtn();
+               m_atspiHelper->registerObject(*m_volumeBtn);
+               m_atspiHelper->registerObject(*m_bluetoothBtn);
+               m_atspiHelper->registerObject(*m_muteBtn);
+
+               m_atspiHelper->registerObject(*m_vc);
+               m_atspiHelper->registerObject(m_vc->getDecreaseBtn());
+               m_atspiHelper->registerObject(m_vc->getIncreaseBtn());
+               m_atspiHelper->registerObject(m_vc->getValueTxtAo());
        }
 
-       ElmWidget *AccessoryPresenter::getVolumeControlValueTxtAo()
+       void AccessoryPresenter::registerEndCallAoCompomnents()
        {
-               return m_vc->getValueTxtAo();
+               m_atspiHelper->registerObject(*m_addContactBtn);
        }
 
-       void AccessoryPresenter::registerVolumeControlAo()
+       Elm_Interface_Atspi_Accessible *AccessoryPresenter::requestNextAo(
+                       bool isFlowsTo)
        {
-               auto decrBtn = m_vc->getDecreaseBtn();
-               if (decrBtn) {
-                       decrBtn->addEventHandler(ATSPI_HIGHLIGHTED,
-                                       WEAK_DELEGATE_THIS(onVolumeControlScreenReaderReadStart));
-               }
-
-               auto incrBtn = m_vc->getIncreaseBtn();
-               if (incrBtn) {
-                       incrBtn->addEventHandler(ATSPI_HIGHLIGHTED,
-                                       WEAK_DELEGATE_THIS(onVolumeControlScreenReaderReadStart));
+               if (const auto handler = m_aoRequestHandler.lock()) {
+                       return handler(isFlowsTo);
                }
+               return nullptr;
        }
 
-       void AccessoryPresenter::onVolumeControlScreenReaderReadStart(
-                       Widget &widget,
-                       void *eventInfo)
+       Elm_Interface_Atspi_Accessible *AccessoryPresenter::getNextAo(
+                       bool isFlowsTo)
        {
-               restartVCTimer();
+               switch (m_mode) {
+               case CallMode::OUTGOING:
+               case CallMode::DURING:
+                       if (m_vc->isVisible()) {
+                               return as_ao(m_vc);
+                       } else {
+                               return isFlowsTo ? as_ao(m_volumeBtn) : as_ao(m_muteBtn);
+                       }
+                       break;
+               case CallMode::END:
+                       return as_ao(m_addContactBtn);
+                       break;
+               default:
+                       break;
+               }
+               return nullptr;
        }
-
 }
-
index 0b8b5b31099a4cc32b4646a86a18254c992cf191..86d1cb63578e7836d84be0df49f8262cd63a9a21 100644 (file)
@@ -30,6 +30,8 @@
 #include "call-ui/view/VolumeControl.h"
 #include "call-ui/view/Slider.h"
 
+#include "call-ui/presenters/misc/AtspiHighlightHelper.h"
+
 #include "call-ui/presenters/types.h"
 
 namespace callui {
@@ -75,6 +77,13 @@ namespace callui {
                         */
                        Builder &setRequestExitHandler(NotiHandler handler);
 
+                       /**
+                        * @brief Sets access object request handler
+                        * @param[in] handler Access object request handler
+                        * @return Reference to builder
+                        */
+                       Builder &setAoRequestHandler(AoRequestHandler handler);
+
                        /**
                         * @brief Sets parent widget for UI components creation
                         * @param[in] parentWidget Parent widget
@@ -95,6 +104,7 @@ namespace callui {
                        ICallManagerSRef m_cm;
                        ucl::ElmWidgetSRef m_parentWidget;
                        NotiHandler m_exitHandler;
+                       AoRequestHandler m_aoRequestHandler;
                };
 
        public:
@@ -106,10 +116,17 @@ namespace callui {
                ucl::Widget &getWidget();
 
                /**
-                * @brief Force hides volume control components
+                * @brief Force hides volume control UI components
                 */
                void hideVolumeControls();
 
+               /**
+                * @brief Gets volume control UI components visibility status
+                * @return true - if volume control UI components are visible,
+                *  false - if not
+                */
+               bool getVolumeControlsVisibility();
+
                /**
                 * @brief Updates presenter
                 * @param[in] cm Call Manager instance
@@ -118,65 +135,20 @@ namespace callui {
                ucl::Result update(const ICallManagerSRef &cm);
 
                /**
-                * @brief Gets volume button widget
-                * @remark Use only for Screen Reader feature
-                * @return Pointer to widget on success or NULL otherwise
+                * @brief Gets next ATSPI access object according to
+                *  relation flow direction
+                * param[in] isFlowsTo ATSPI highlight flow relation flag
+                *  (true for get to next object request,
+                *  false for get to previous object request)
+                *@return ATSPI object
                 */
-               ucl::ElmWidget *getVolumBtn();
-
-               /**
-                * @brief Gets bluetooth button widget
-                * @remark Use only for Screen Reader feature
-                * @return Widget on success or NULL otherwise
-                */
-               ucl::ElmWidget *getBluetoothBtn();
-
-               /**
-                * @brief Gets mute button widget
-                * @remark Use only for Screen Reader feature
-                * @return Pointer to widget on success or NULL otherwise
-                */
-               ucl::ElmWidget *getMuteBtn();
-
-               /**
-                * @brief Gets add Contact button widget
-                * @remark Use only for Screen Reader feature
-                * @return Pointer to widget on success or NULL otherwise
-                */
-               ucl::ElmWidget *getAddContactBtn();
-
-               /**
-                * @brief Gets Volume Control widget
-                * @remark Use only for Screen Reader feature
-                * @return Pointer to widget on success or NULL otherwise
-                */
-               ucl::ElmWidget *getVolumeControlLy();
-
-               /**
-                * @brief Gets Volume Controls decrease volume button widget
-                * @remark Use only for Screen Reader feature
-                * @return Pointer to widget on success or NULL otherwise
-                */
-               ucl::ElmWidget *getVolumeControlDecreaseBtn();
-
-               /**
-                * @brief Gets Volume Controls increase volume button widget
-                * @remark Use only for Screen Reader feature
-                * @return Pointer to widget on success or NULL otherwise
-                */
-               ucl::ElmWidget *getVolumeControlIncreaseBtn();
-
-               /**
-                * @brief Gets Volume Controls value text access object
-                * @remark Use only for Screen Reader feature
-                * @return Pointer to widget on success or NULL otherwise
-                */
-               ucl::ElmWidget *getVolumeControlValueTxtAo();
+               Elm_Interface_Atspi_Accessible *getNextAo(bool isFlowsTo);
 
        private:
                AccessoryPresenter(ucl::IRefCountObj &rc,
                                ISoundManagerSRef sm,
-                               NotiHandler handler);
+                               NotiHandler exitHandler,
+                               AoRequestHandler m_aoRequestHandler);
                ~AccessoryPresenter();
 
                ucl::Result prepare(ucl::GuiPresenter &parent,
@@ -226,21 +198,30 @@ namespace callui {
                ucl::Result setActiveCallCompomnents();
                ucl::Result setEndCallCompomnents(const ICallManagerSRef &cm);
 
-               void registerVolumeControlAo();
-               void onVolumeControlScreenReaderReadStart(ucl::Widget &widget, void *eventInfo);
+               void onVolumeControlScreenReaderReadStart(ucl::Widget &widget,
+                               void *eventInfo);
+
+               ucl::Result createAtspiHighlightHelper();
+               const Elm_Interface_Atspi_Accessible *onAtspiHighlight(
+                               const Elm_Interface_Atspi_Accessible *ao,
+                               Elm_Atspi_Relation_Type flowRelation);
+               void registerActiveCallAoCompomnents();
+               void registerEndCallAoCompomnents();
+               Elm_Interface_Atspi_Accessible *requestNextAo(bool isFlowsTo);
 
        private:
                const ISoundManagerSRef m_sm;
                const NotiHandler m_exitHandler;
+               const AoRequestHandler m_aoRequestHandler;
 
                ucl::LayoutSRef m_widget;
                ucl::StyledWidgetSRef m_volumeBtn;
                ucl::StyledWidgetSRef m_muteBtn;
                ucl::StyledWidgetSRef m_bluetoothBtn;
                ucl::StyledWidgetSRef m_addContactBtn;
-
                SliderSRef m_slider;
                VolumeControlSRef m_vc;
+               AtspiHighlightHelperSRef m_atspiHelper;
 
                Ecore_Timer *m_vcTimer;
                AudioStateType m_audioState;
index 8ec22e9f9b67bcd0b02efbb21a1b85e146eeab37..415503aedd23b6d8d0882d73b03430749901d0f6 100644 (file)
@@ -20,6 +20,8 @@
 
 #include "ucl/appfw/types.h"
 
+#include "call-ui/view/AoSequencer.h"
+
 #include "call-ui/presenters/pages/KeypadPage.h"
 
 #include "call-ui/resources.h"
@@ -567,49 +569,22 @@ namespace callui {
                                        const Elm_Interface_Atspi_Accessible *ao,
                                        Elm_Atspi_Relation_Type flowRelation)
        {
-               const auto swapBtnAo = utils::getAo(m_btnSwap.get());
-               const auto unholdBtnAo = utils::getAo(m_btnUnhold.get());
-               const auto keypadBtnAo = utils::getAo(m_btnKeypad.get());
-               const auto statusTxtAo = utils::getAo(m_statusTxtAo.get());
-               const auto fakeAo = utils::getAo(m_fakeAo.get());
-
-               if (ao == swapBtnAo) {
-                       DLOG("Swap button");
-                       if (flowRelation == ELM_ATSPI_RELATION_FLOWS_TO) {
-                               return keypadBtnAo;
-                       }
-               } else if (ao == unholdBtnAo) {
-                       DLOG("Unhold button");
-                       if (flowRelation == ELM_ATSPI_RELATION_FLOWS_TO) {
-                               return keypadBtnAo;
-                       }
-               } else if (ao == keypadBtnAo) {
-                       DLOG("Keypad button");
-                       if (flowRelation == ELM_ATSPI_RELATION_FLOWS_TO) {
-                               return statusTxtAo;
+               if (ao == as_ao(m_fakeAo)) {
+                       if (m_btnSwap) {
+                               return as_ao(m_btnSwap);
+                       } else if (m_btnUnhold) {
+                               return as_ao(m_btnUnhold);
                        } else {
-                               if (swapBtnAo) {
-                                       return swapBtnAo;
-                               } else if (unholdBtnAo) {
-                                       return unholdBtnAo;
-                               }
-                       }
-               } else if (ao == statusTxtAo) {
-                       DLOG("Status text");
-                       if (flowRelation == ELM_ATSPI_RELATION_FLOWS_FROM) {
-                               return keypadBtnAo;
-                       }
-               } else if (ao == as_ao(getWindow()) || ao == fakeAo) {
-                       DLOG("window or panelLy");
-                       if (swapBtnAo) {
-                               return swapBtnAo;
-                       } else if (unholdBtnAo) {
-                               return unholdBtnAo;
-                       } else {
-                               return keypadBtnAo;
+                               return as_ao(m_btnKeypad);
                        }
                }
-               LOG_RETURN_VALUE(RES_FAIL, nullptr, "Unknown object!");
+
+               return AoSequencer(ao, flowRelation).
+                               process(m_btnSwap).
+                               process(m_btnUnhold).
+                               process(m_btnKeypad).
+                               process(m_statusTxtAo).
+                               getNext();
        }
 
        Result MoreOptionsPresenter::createAccessObjects()
index 1f3b62ff5de83291f677d4eb1b02d60ad91a462a..9a7ec3493893ae5b23fc6f79bd756eae4afcaede 100644 (file)
@@ -19,6 +19,8 @@
 #include "call-ui/presenters/items/RejectMsgListItem.h"
 #include "call-ui/presenters/misc/helpers.h"
 
+#include "call-ui/view/AoSequencer.h"
+
 #include "call-ui/resources.h"
 
 #include "call-ui/presenters/common.h"
@@ -156,19 +158,14 @@ namespace callui {
 
                FAIL_RETURN(createWidget(parentWidget),
                                "createWidget() failed!");
-
                FAIL_RETURN(createPanel(),
                                "createPanel() failed!");
-
                FAIL_RETURN(createPanelBg(),
                                "createPanelBg() failed!");
-
                FAIL_RETURN(createPanelLy(),
                                "createPanelLy() failed!");
-
                FAIL_RETURN(createCircleSurfaceLy(),
                                "createCircleSurfaceLy() failed!");
-
                FAIL_RETURN(createAtspiHighlightHelper(),
                                "createScreenReaderRoute() failed!");
 
@@ -491,31 +488,14 @@ namespace callui {
                        const Elm_Interface_Atspi_Accessible *ao,
                        Elm_Atspi_Relation_Type flowRelation)
        {
-               DLOG("ENTER");
-
-               const Elm_Interface_Atspi_Accessible * firstListAo = nullptr;
-               if (m_firstItem) {
-                       firstListAo = as_ao(*m_firstItem);
-               }
-               const Elm_Interface_Atspi_Accessible * lastListAo = nullptr;
-               if (m_lastItem) {
-                       lastListAo = as_ao(*m_lastItem);
-               }
-
-               if (ao == firstListAo) {
-                       if (flowRelation == ELM_ATSPI_RELATION_FLOWS_TO) {
-                               return nullptr;
-                       }
-               } else if (ao == lastListAo) {
-                       if (flowRelation == ELM_ATSPI_RELATION_FLOWS_FROM) {
-                               return nullptr;
-                       }
-               } else if (ao == as_ao(getWindow())) {
-                       return firstListAo;
-               } else {
-                       LOG_RETURN_VALUE(RES_FAIL, nullptr, "Unknown object!");
+               if (ao == as_ao(getWindow())) {
+                       return as_ao(m_firstItem);
                }
 
-               return ao;
+               return AoSequencer(ao, flowRelation).
+                               process(m_firstItem).
+                               processDefault().
+                               process(m_lastItem).
+                               getNext();
        }
 }
index 2911c99a8d104ad0599b89eb9952052694cb2257..95559d90e73a6c45a1c344c47ab6fdd156f60a08 100644 (file)
@@ -16,6 +16,8 @@
 
 #include "KeypadPage.h"
 
+#include "call-ui/view/AoSequencer.h"
+
 #include "call-ui/resources.h"
 
 #include "call-ui/presenters/types.h"
@@ -161,18 +163,16 @@ namespace callui {
        {
                FAIL_RETURN(createWidget(),
                                "createWidget() failed!");
-
                FAIL_RETURN(createEntry(),
                                "createEntry() failed!");
-
                FAIL_RETURN(createButtons(),
                                "createButtons() failed!");
-
                FAIL_RETURN(createVolumeControl(),
                                "createVolumeControl() failed!");
-
                FAIL_RETURN(registerPowerKeyHandling(),
                                "registerPowerKeyHandling() failed!");
+               FAIL_RETURN(createAtspiHighlightHelper(),
+                               "createAtspiHighlightHelper() failed!");
 
                registerCallbacks();
 
@@ -303,37 +303,37 @@ namespace callui {
 
        ucl::Result KeypadPage::createButtons()
        {
-               Evas_Object *button;
-               StyledWidgetSRef buttonSRef;
+               Evas_Object *eo;
+               StyledWidgetSRef btn;
 
                for (int i = 0; i < impl::KEYPAD_BTN_MAX_COUNT; ++i) {
-                       button = elm_button_add(as_eo(*m_widget));
-                       if (!button) {
+                       eo = elm_button_add(as_eo(*m_widget));
+                       if (!eo) {
                                LOG_RETURN(RES_FAIL, "elm_button_add() failed!");
                        }
 
-                       buttonSRef = makeShared<StyledWidget>(button, false);
-                       buttonSRef->bindToEo();
-                       buttonSRef->setData(impl::BTN_DATA_KEY, &(impl::buttonsInfo[i]));
-                       buttonSRef->setStyle(impl::buttonsInfo[i].style);
+                       btn = makeShared<StyledWidget>(eo, false);
+                       btn->setData(impl::BTN_DATA_KEY, &(impl::buttonsInfo[i]));
+                       btn->setStyle(impl::buttonsInfo[i].style);
+                       m_widget->setContent(*btn, impl::buttonsInfo[i].swlPart);
+                       show(*btn);
 
                        if (impl::buttonsInfo[i].type == impl::OperationType::DTMF) {
-                               buttonSRef->addEventHandler(impl::BTN_PRESSED,
+                               btn->addEventHandler(impl::BTN_PRESSED,
                                                WEAK_DELEGATE_THIS(onBtnPressed));
 
-                               buttonSRef->addEventHandler(impl::BTN_UNPRESSED,
+                               btn->addEventHandler(impl::BTN_UNPRESSED,
                                                WEAK_DELEGATE_THIS(onBtnUnpressed));
                        } else {
-                               buttonSRef->addEventHandler(BTN_CLICKED,
+                               btn->addEventHandler(BTN_CLICKED,
                                                WEAK_DELEGATE_THIS(onBtnClicked));
 
                                // RTL support
-                               elm_object_mirrored_automatic_set(button, EINA_FALSE);
-                               elm_object_mirrored_set(button, false);
+                               elm_object_mirrored_automatic_set(eo, EINA_FALSE);
+                               elm_object_mirrored_set(eo, false);
                        }
 
-                       // Screen Reader
-                       auto &atspi = buttonSRef->getAtspi();
+                       auto &atspi = btn->getAtspi();
                        atspi.setTDomain(TEXT_DOMAIN);
                        if (impl::buttonsInfo[i].type == impl::OperationType::DTMF) {
                                atspi.setName(impl::buttonsInfo[i].str);
@@ -341,8 +341,11 @@ namespace callui {
                                atspi.setName(STR_VOLUME);
                        }
 
-                       m_widget->setContent(*buttonSRef, impl::buttonsInfo[i].swlPart);
-                       show(*buttonSRef);
+                       if (i == 0) {
+                               m_firstBtn = btn;
+                       } else if (i == impl::KEYPAD_BTN_MAX_COUNT - 1) {
+                               m_lastBtn = btn;
+                       }
                }
 
                return RES_OK;
@@ -385,7 +388,11 @@ namespace callui {
                m_vc->resize(w, h);
                hide(*m_vc);
 
-               registerVolumeControlAo();
+               m_vc->getDecreaseBtn().addEventHandler(ATSPI_HIGHLIGHTED,
+                               WEAK_DELEGATE_THIS(onVolumeControlScreenReaderReadStart));
+
+               m_vc->getIncreaseBtn().addEventHandler(ATSPI_HIGHLIGHTED,
+                               WEAK_DELEGATE_THIS(onVolumeControlScreenReaderReadStart));
 
                return RES_OK;
        }
@@ -584,12 +591,14 @@ namespace callui {
                                WEAK_DELEGATE_THIS(onAtspiHighlight));
 
                m_atspiHelper->registerObject(getWindow());
-               m_atspiHelper->registerObject(*getFirstButton());
-               m_atspiHelper->registerObject(*getLastButton());
-               m_atspiHelper->registerObject(*m_vc.get());
-               m_atspiHelper->registerObject(*m_vc->getDecreaseBtn());
-               m_atspiHelper->registerObject(*m_vc->getIncreaseBtn());
-               m_atspiHelper->registerObject(*m_vc->getValueTxtAo());
+
+               m_atspiHelper->registerObject(*m_firstBtn);
+               m_atspiHelper->registerObject(*m_lastBtn);
+
+               m_atspiHelper->registerObject(*m_vc);
+               m_atspiHelper->registerObject(m_vc->getDecreaseBtn());
+               m_atspiHelper->registerObject(m_vc->getIncreaseBtn());
+               m_atspiHelper->registerObject(m_vc->getValueTxtAo());
 
                return RES_OK;
        }
@@ -598,80 +607,25 @@ namespace callui {
                                const Elm_Interface_Atspi_Accessible *ao,
                                Elm_Atspi_Relation_Type flowRelation)
        {
-               DLOG();
-
-               auto firstBtnAo = utils::getAo(getFirstButton());
-               auto lastBtnAo = utils::getAo(getLastButton());
-               auto vcLayoutAo = utils::getAo(m_vc.get());
-               auto vcDecrVolumeBtnAo = utils::getAo(m_vc->getDecreaseBtn());
-               auto vcIncrVolumeBtnAo = utils::getAo(m_vc->getIncreaseBtn());
-               auto vcVolumeValueAo = utils::getAo(m_vc->getValueTxtAo());
-
-               if (firstBtnAo && ao == firstBtnAo) {
-                       if (flowRelation == ELM_ATSPI_RELATION_FLOWS_TO) {
-                               return nullptr;
-                       }
-               } else if (lastBtnAo && ao == lastBtnAo) {
-                       if (flowRelation == ELM_ATSPI_RELATION_FLOWS_FROM) {
-                               return nullptr;
-                       }
-               } else if (ao == vcLayoutAo) {
-                       if (flowRelation == ELM_ATSPI_RELATION_FLOWS_TO) {
-                               return vcDecrVolumeBtnAo;
-                       }
-               } else if (ao == vcDecrVolumeBtnAo) {
-                       if (flowRelation == ELM_ATSPI_RELATION_FLOWS_TO) {
-                               return vcVolumeValueAo;
-                       } else {
-                               return vcLayoutAo;
-                       }
-               } else if (ao == vcVolumeValueAo) {
-                       if (flowRelation == ELM_ATSPI_RELATION_FLOWS_TO) {
-                               return vcIncrVolumeBtnAo;
-                       } else {
-                               return vcDecrVolumeBtnAo;
-                       }
-               } else if (ao == vcIncrVolumeBtnAo) {
-                       if (flowRelation == ELM_ATSPI_RELATION_FLOWS_FROM) {
-                               return vcVolumeValueAo;
-                       }
-               } else if (ao == as_ao(getWindow())) {
-                       if (firstBtnAo) {
-                               return firstBtnAo;
+               if (m_vc->isVisible()) {
+                       if (ao == as_ao(getWindow())) {
+                               return as_ao(m_vc);
                        }
+                       return AoSequencer(ao, flowRelation).
+                                       process(m_vc).
+                                       process(m_vc->getDecreaseBtn()).
+                                       process(m_vc->getValueTxtAo()).
+                                       process(m_vc->getIncreaseBtn()).
+                                       getNext();
                } else {
-                       LOG_RETURN_VALUE(RES_FAIL, nullptr, "Unknown object!");
-               }
-
-               return ao;
-       }
-
-       ElmWidget *KeypadPage::getFirstButton()
-       {
-               return dynamicWidgetCast<ElmWidget>(
-                               m_widget->getContent(impl::buttonsInfo[0].swlPart));
-       }
-
-       ElmWidget *KeypadPage::getLastButton()
-       {
-               return dynamicWidgetCast<ElmWidget>(
-                               m_widget->getContent(impl::buttonsInfo[(
-                                               impl::KEYPAD_BTN_MAX_COUNT - 1)].swlPart));
-       }
-
-       void KeypadPage::registerVolumeControlAo()
-       {
-               auto decrBtn = m_vc->getDecreaseBtn();
-
-               if (decrBtn) {
-                       decrBtn->addEventHandler(ATSPI_HIGHLIGHTED,
-                                       WEAK_DELEGATE_THIS(onVolumeControlScreenReaderReadStart));
-               }
-
-               auto incrBtn = m_vc->getIncreaseBtn();
-               if (incrBtn) {
-                       incrBtn->addEventHandler(ATSPI_HIGHLIGHTED,
-                                       WEAK_DELEGATE_THIS(onVolumeControlScreenReaderReadStart));
+                       if (ao == as_ao(getWindow())) {
+                               return as_ao(m_firstBtn);
+                       }
+                       return AoSequencer(ao, flowRelation).
+                                       process(m_firstBtn).
+                                       processDefault().
+                                       process(m_lastBtn).
+                                       getNext();
                }
        }
 
index 5938aa8698af27200d439bf5c031c765b2e9b753..b9f7987ff63e42718759dea14de19e46865f0b68 100644 (file)
@@ -120,9 +120,6 @@ namespace callui {
                const Elm_Interface_Atspi_Accessible *onAtspiHighlight(
                                const Elm_Interface_Atspi_Accessible *ao,
                                Elm_Atspi_Relation_Type flowRelation);
-               ucl::ElmWidget *getFirstButton();
-               ucl::ElmWidget *getLastButton();
-               void registerVolumeControlAo();
                void onVolumeControlScreenReaderReadStart(
                                ucl::Widget &widget,
                                void *eventInfo);
@@ -136,6 +133,8 @@ namespace callui {
 
                ucl::LayoutSRef m_widget;
                ucl::ElmWidgetSRef m_entry;
+               ucl::ElmWidgetSRef m_firstBtn;
+               ucl::ElmWidgetSRef m_lastBtn;
 
                bool m_smInUse;
 
index da99bd98e6f0d89b62e4c110943639ead6b9b822..903ecd30e40562dba697027ba35abc3238016ef3 100644 (file)
@@ -19,6 +19,8 @@
 #include "ucl/gui/Window.h"
 #include "ucl/gui/Widget.h"
 
+#include "call-ui/view/AoSequencer.h"
+
 #include "call-ui/resources.h"
 
 #include "call-ui/presenters/types.h"
@@ -525,6 +527,8 @@ namespace callui {
                                setSoundManager(m_call->getSoundManager()).
                                setCallManager(m_cm).
                                setRequestExitHandler(WEAK_DELEGATE_THIS(onExitAppRequest)).
+                               setAoRequestHandler(
+                                               WEAK_DELEGATE_THIS(onAccessoryAoRequest)).
                                setParentWidget(m_widget).
                                build(*this);
 
@@ -715,52 +719,32 @@ namespace callui {
 
        void MainPage::registerIncomingCallModeAo()
        {
-               DLOG("ENTER");
                m_atspiHelper->setEventHandler(
                                WEAK_DELEGATE_THIS(onIncomingCallModeAtspiHighlight));
 
-               auto acceptAo = m_acceptRejectPrs->getAcceptAo();
-               if (!acceptAo) {
-                       DLOG("acceptAO is NULL");
-               } else {
+               if (const auto acceptAo = m_acceptRejectPrs->getAcceptAo()) {
                        m_atspiHelper->registerObject(*acceptAo);
                }
 
-               auto rejectAo = m_acceptRejectPrs->getRejectAo();
-               if (!rejectAo) {
-                       DLOG("rejectAo is NULL");
-               } else {
+               if (const auto rejectAo = m_acceptRejectPrs->getRejectAo()) {
                        m_atspiHelper->registerObject(*rejectAo);
                }
 
-               auto statusTxtAo = m_callInfoPrs->getStatusTxtAo();
-               if (!statusTxtAo) {
-                       DLOG("statusTxtAo is NULL");
-               } else {
+               if (const auto statusTxtAo = m_callInfoPrs->getStatusTxtAo()) {
                        m_atspiHelper->registerObject(*statusTxtAo);
                }
 
-               auto mainTxtAo = m_callInfoPrs->getMainTxtAo();
-               if (!mainTxtAo) {
-                       DLOG("mainTxtAo is NULL");
-               } else {
+               if (const auto mainTxtAo = m_callInfoPrs->getMainTxtAo()) {
                        m_atspiHelper->registerObject(*mainTxtAo);
                }
 
-               auto subTxtAo = m_callInfoPrs->getSubTxtAo();
-               if (!subTxtAo) {
-                       DLOG("subTxtAo is NULL");
-               } else {
+               if (const auto subTxtAo = m_callInfoPrs->getSubTxtAo()) {
                        m_atspiHelper->registerObject(*subTxtAo);
                }
 
-               if (!m_rmCueAo) {
-                       DLOG("m_rmCueAo is NULL");
-               } else {
+               if (m_rmCueAo) {
                        m_atspiHelper->registerObject(*m_rmCueAo);
                }
-
-               DLOG("EXIT");
        }
 
        const Elm_Interface_Atspi_Accessible *
@@ -768,132 +752,40 @@ namespace callui {
                                        const Elm_Interface_Atspi_Accessible *ao,
                                        Elm_Atspi_Relation_Type flowRelation)
        {
-               const auto acceptAo = utils::getAo(m_acceptRejectPrs->getAcceptAo());
-               const auto rejectAo = utils::getAo(m_acceptRejectPrs->getRejectAo());
-               const auto statusTxtAo = utils::getAo(m_callInfoPrs->getStatusTxtAo());
-               const auto mainTxtAo = utils::getAo(m_callInfoPrs->getMainTxtAo());
-               const auto subTxtAo = utils::getAo(m_callInfoPrs->getSubTxtAo());
-               const auto rmCueAo = utils::getAo(m_rmCueAo.get());
-
-               if (ao == acceptAo) {
-                       if (flowRelation == ELM_ATSPI_RELATION_FLOWS_TO) {
-                               return statusTxtAo;
-                       }
-               } else if (ao == statusTxtAo) {
-                       if (flowRelation == ELM_ATSPI_RELATION_FLOWS_TO) {
-                               return mainTxtAo;
-                       } else if (flowRelation == ELM_ATSPI_RELATION_FLOWS_FROM) {
-                               return acceptAo;
-                       }
-               } else if (ao == mainTxtAo) {
-                       if (flowRelation == ELM_ATSPI_RELATION_FLOWS_TO) {
-                               return (subTxtAo) ? subTxtAo : rejectAo;
-                       } else if (flowRelation == ELM_ATSPI_RELATION_FLOWS_FROM) {
-                               return statusTxtAo;
-                       }
-               } else if (ao == subTxtAo) {
-                       if (flowRelation == ELM_ATSPI_RELATION_FLOWS_TO) {
-                               return rejectAo;
-                       } else if (flowRelation == ELM_ATSPI_RELATION_FLOWS_FROM) {
-                               return mainTxtAo;
-                       }
-               } else if (ao == rejectAo) {
-                       if (flowRelation == ELM_ATSPI_RELATION_FLOWS_TO) {
-                               return rmCueAo ? rmCueAo : ao;
-                       } else if (flowRelation == ELM_ATSPI_RELATION_FLOWS_FROM) {
-                               return (subTxtAo) ? subTxtAo : mainTxtAo;
-                       }
-               } else if (ao == rmCueAo) {
-                       if (flowRelation == ELM_ATSPI_RELATION_FLOWS_FROM) {
-                               return rmCueAo;
-                       }
-               } else if (ao == as_ao(getWindow())) {
-                       return acceptAo;
-               } else {
-                       LOG_RETURN_VALUE(RES_FAIL, nullptr, "Unknown object!");
-               }
-
-               return ao;
+               return AoSequencer(ao, flowRelation).
+                               process(m_acceptRejectPrs->getAcceptAo()).
+                               process(m_callInfoPrs->getStatusTxtAo()).
+                               process(m_callInfoPrs->getMainTxtAo()).
+                               process(m_callInfoPrs->getSubTxtAo()).
+                               process(m_acceptRejectPrs->getRejectAo()).
+                               process(m_rmCueAo).
+                               getNext();
        }
 
        void MainPage::registerActiveCallModeAo()
        {
-               DLOG("ENTER");
                m_atspiHelper->setEventHandler(
                                WEAK_DELEGATE_THIS(onActiveCallModeAtspiHighlight));
 
-               auto statusTxtAo = m_callInfoPrs->getStatusTxtAo();
-               if (!statusTxtAo) {
-                       DLOG("statusTxtAo is NULL");
-               } else {
+               if (const auto statusTxtAo = m_callInfoPrs->getStatusTxtAo()) {
                        m_atspiHelper->registerObject(*statusTxtAo);
                }
 
-               auto mainTxtAo = m_callInfoPrs->getMainTxtAo();
-               if (!mainTxtAo) {
-                       DLOG("mainTxtAo is NULL");
-               } else {
+               if (const auto mainTxtAo = m_callInfoPrs->getMainTxtAo()) {
                        m_atspiHelper->registerObject(*mainTxtAo);
                }
 
-               auto subTxtAo = m_callInfoPrs->getSubTxtAo();
-               if (!subTxtAo) {
-                       DLOG("subTxtAo is NULL");
-               } else {
+               if (const auto subTxtAo = m_callInfoPrs->getSubTxtAo()) {
                        m_atspiHelper->registerObject(*subTxtAo);
                }
 
-               auto volumeBtnAo = m_accessoryPrs->getVolumBtn();
-               if (!volumeBtnAo) {
-                       DLOG("volumeBtnAo is NULL");
-               } else {
-                       m_atspiHelper->registerObject(*volumeBtnAo);
-               }
-
-               auto bluetoothBtnAo = m_accessoryPrs->getBluetoothBtn();
-               if (!bluetoothBtnAo) {
-                       DLOG("bluetoothBtnAo is NULL");
-               } else {
-                       m_atspiHelper->registerObject(*bluetoothBtnAo);
-               }
-
-               auto muteBtnAo = m_accessoryPrs->getMuteBtn();
-               if (!muteBtnAo) {
-                       DLOG("muteBtnAo is NULL");
-               } else {
-                       m_atspiHelper->registerObject(*muteBtnAo);
-               }
-
-               auto moreOptCueAo = m_moreOptionsPrs->getCueAo();
-               if (!moreOptCueAo) {
-                       DLOG("moreCueAo is NULL");
-               } else {
+               if (const auto moreOptCueAo = m_moreOptionsPrs->getCueAo()) {
                        m_atspiHelper->registerObject(*moreOptCueAo);
                }
 
-               if (!m_bottomBtn) {
-                       DLOG("m_bottomBtn is NULL");
-               } else {
+               if (m_bottomBtn) {
                        m_atspiHelper->registerObject(*m_bottomBtn);
                }
-
-               auto vcLayout = m_accessoryPrs->getVolumeControlLy();
-               if (!vcLayout) {
-                       DLOG("vcLayout is NULL");
-               } else {
-                       m_atspiHelper->registerObject(*vcLayout);
-
-                       m_atspiHelper->registerObject(*m_accessoryPrs->
-                                       getVolumeControlDecreaseBtn());
-
-                       m_atspiHelper->registerObject(*m_accessoryPrs->
-                                       getVolumeControlIncreaseBtn());
-
-                       m_atspiHelper->registerObject(*m_accessoryPrs->
-                                       getVolumeControlValueTxtAo());
-               }
-
-               DLOG("EXIT");
        }
 
        const Elm_Interface_Atspi_Accessible *
@@ -901,109 +793,21 @@ namespace callui {
                                        const Elm_Interface_Atspi_Accessible *ao,
                                        Elm_Atspi_Relation_Type flowRelation)
        {
-               const auto statusTxtAo =
-                               utils::getAo(m_callInfoPrs->getStatusTxtAo());
-               const auto mainTxtAo =
-                               utils::getAo(m_callInfoPrs->getMainTxtAo());
-               const auto subTxtAo =
-                               utils::getAo(m_callInfoPrs->getSubTxtAo());
-               const auto volumeBtnAo =
-                               utils::getAo(m_accessoryPrs->getVolumBtn());
-               const auto bluetoothBtnAo =
-                               utils::getAo(m_accessoryPrs->getBluetoothBtn());
-               const auto muteBtnAo =
-                               utils::getAo(m_accessoryPrs->getMuteBtn());
-               const auto moreOptCueAo =
-                               utils::getAo(m_moreOptionsPrs->getCueAo());
-               const auto vcLayout =
-                               utils::getAo(m_accessoryPrs->getVolumeControlLy());
-               const auto vcDecrVolumeBtn =
-                               utils::getAo(m_accessoryPrs->getVolumeControlDecreaseBtn());
-               const auto vcIncrVolumeBtn =
-                               utils::getAo(m_accessoryPrs->getVolumeControlIncreaseBtn());
-               const auto vcVolumeValueAo =
-                               utils::getAo(m_accessoryPrs->getVolumeControlValueTxtAo());
-               const auto bottomBtnAo = utils::getAo(m_bottomBtn.get());
-
-               if (ao == statusTxtAo) {
-                       if (flowRelation == ELM_ATSPI_RELATION_FLOWS_TO) {
-                               return mainTxtAo;
-                       }
-               } else if (ao == mainTxtAo) {
-                       if (flowRelation == ELM_ATSPI_RELATION_FLOWS_TO) {
-                               if (subTxtAo) {
-                                       return subTxtAo;
-                               } else {
-                                       return volumeBtnAo;
-                               }
-                       } else {
-                               return statusTxtAo;
-                       }
-               } else if (ao == subTxtAo) {
-                       if (flowRelation == ELM_ATSPI_RELATION_FLOWS_TO) {
-                               return volumeBtnAo;
-                       } else {
-                               return mainTxtAo;
-                       }
-               } else if (ao == volumeBtnAo) {
-                       if (flowRelation == ELM_ATSPI_RELATION_FLOWS_TO) {
-                               return bluetoothBtnAo;
-                       } else {
-                               if (subTxtAo) {
-                                       return subTxtAo;
-                               } else {
-                                       return mainTxtAo;
-                               }
-                       }
-               } else if (ao == bluetoothBtnAo) {
-                       if (flowRelation == ELM_ATSPI_RELATION_FLOWS_TO) {
-                               return muteBtnAo;
-                       } else {
-                               return volumeBtnAo;
-                       }
-               } else if (ao == muteBtnAo) {
-                       if (flowRelation == ELM_ATSPI_RELATION_FLOWS_TO) {
-                               return moreOptCueAo;
-                       } else {
-                               return bluetoothBtnAo;
-                       }
-               } else if (ao == moreOptCueAo) {
-                       if (flowRelation == ELM_ATSPI_RELATION_FLOWS_TO) {
-                                       return bottomBtnAo;
-                       } else {
-                               return muteBtnAo;
-                       }
-               } else if (ao == bottomBtnAo) {
-                       if (flowRelation == ELM_ATSPI_RELATION_FLOWS_FROM) {
-                               return moreOptCueAo;
-                       }
-               } else if (ao == vcLayout) {
-                       if (flowRelation == ELM_ATSPI_RELATION_FLOWS_TO) {
-                               return vcDecrVolumeBtn;
-                       }
-               } else if (ao == vcDecrVolumeBtn) {
-                       if (flowRelation == ELM_ATSPI_RELATION_FLOWS_TO) {
-                               return vcVolumeValueAo;
-                       } else {
-                               return vcLayout;
-                       }
-               } else if (ao == vcVolumeValueAo) {
-                       if (flowRelation == ELM_ATSPI_RELATION_FLOWS_TO) {
-                               return vcIncrVolumeBtn;
-                       } else {
-                               return vcDecrVolumeBtn;
-                       }
-               } else if (ao == vcIncrVolumeBtn) {
-                       if (flowRelation == ELM_ATSPI_RELATION_FLOWS_FROM) {
-                               return vcVolumeValueAo;
+               if (ao == as_ao(getWindow())) {
+                       if (m_accessoryPrs->getVolumeControlsVisibility()) {
+                               m_accessoryPrs->getNextAo(true);
                        }
-               } else if (ao == as_ao(getWindow())) {
-                       return statusTxtAo;
-               } else {
-                       LOG_RETURN_VALUE(RES_FAIL, nullptr, "Unknown object!");
                }
 
-               return ao;
+               return AoSequencer(ao, flowRelation).
+                               process(m_callInfoPrs->getStatusTxtAo()).
+                               process(m_callInfoPrs->getMainTxtAo()).
+                               process(m_callInfoPrs->getSubTxtAo()).
+                               process(m_accessoryPrs->getNextAo(true)).
+                               process(m_accessoryPrs->getNextAo(false)).
+                               process(m_moreOptionsPrs->getCueAo()).
+                               process(m_bottomBtn).
+                               getNext();
        }
 
        void MainPage::registerEndCallModeAo()
@@ -1011,34 +815,17 @@ namespace callui {
                m_atspiHelper->setEventHandler(
                                WEAK_DELEGATE_THIS(onEndCallModeAtspiHighlight));
 
-               auto statusTxtAo = m_callInfoPrs->getStatusTxtAo();
-               if (!statusTxtAo) {
-                       DLOG("statusTxtAo is NULL");
-               } else {
+               if (const auto statusTxtAo = m_callInfoPrs->getStatusTxtAo()) {
                        m_atspiHelper->registerObject(*statusTxtAo);
                }
 
-               auto mainTxtAo = m_callInfoPrs->getMainTxtAo();
-               if (!mainTxtAo) {
-                       DLOG("mainTxtAo is NULL");
-               } else {
+               if (const auto mainTxtAo = m_callInfoPrs->getMainTxtAo()) {
                        m_atspiHelper->registerObject(*mainTxtAo);
                }
 
-               auto addContactsBtnAo = m_accessoryPrs->getAddContactBtn();
-               if (!addContactsBtnAo) {
-                       DLOG("addContactsBtnAo is NULL");
-               } else {
-                       m_atspiHelper->registerObject(*addContactsBtnAo);
-               }
-
-               if (!m_bottomBtn) {
-                       DLOG("m_bottomBtn is NULL");
-               } else {
+               if (m_bottomBtn) {
                        m_atspiHelper->registerObject(*m_bottomBtn);
                }
-
-               DLOG("EXIT");
        }
 
        const Elm_Interface_Atspi_Accessible *
@@ -1046,50 +833,26 @@ namespace callui {
                                        const Elm_Interface_Atspi_Accessible *ao,
                                        Elm_Atspi_Relation_Type flowRelation)
        {
-               DLOG();
-
-               const auto statusTxtAo =
-                               utils::getAo(m_callInfoPrs->getStatusTxtAo());
-               const auto mainTxtAo =
-                               utils::getAo(m_callInfoPrs->getMainTxtAo());
-               const auto addContactsBtnAo =
-                               utils::getAo(m_accessoryPrs->getAddContactBtn());
-               const auto bottomBtnAo = utils::getAo(m_bottomBtn.get());
-
-               if (ao == statusTxtAo) {
-                       if (flowRelation == ELM_ATSPI_RELATION_FLOWS_TO) {
-                               return mainTxtAo;
-                       }
-               } else if (ao == mainTxtAo) {
-                       if (flowRelation == ELM_ATSPI_RELATION_FLOWS_TO) {
-                               if (addContactsBtnAo) {
-                                       return addContactsBtnAo;
-                               } else {
-                                       return bottomBtnAo;
-                               }
-                       } else {
-                               return statusTxtAo;
-                       }
-               } else if (ao == addContactsBtnAo) {
-                       if (flowRelation == ELM_ATSPI_RELATION_FLOWS_TO) {
-                               return bottomBtnAo;
-                       } else {
-                               return mainTxtAo;
-                       }
-               } else if (ao == bottomBtnAo) {
-                       if (flowRelation == ELM_ATSPI_RELATION_FLOWS_FROM) {
-                               if (addContactsBtnAo) {
-                                       return addContactsBtnAo;
-                               } else {
-                                       return mainTxtAo;
-                               }
-                       }
-               } else if (ao == as_ao(getWindow())) {
-                       return statusTxtAo;
+               return AoSequencer(ao, flowRelation).
+                               process(m_callInfoPrs->getStatusTxtAo()).
+                               process(m_callInfoPrs->getMainTxtAo()).
+                               process(m_accessoryPrs->getNextAo(true)).
+                               process(m_accessoryPrs->getNextAo(false)).
+                               process(m_bottomBtn).
+                               getNext();
+       }
+
+       Elm_Interface_Atspi_Accessible *
+                       MainPage::onAccessoryAoRequest(bool isFlowsTo)
+       {
+               if (isFlowsTo) {
+                       return (m_mode == CallMode::END) ? as_ao(m_bottomBtn) :
+                                       as_ao(m_moreOptionsPrs->getCueAo());
                } else {
-                       LOG_RETURN_VALUE(RES_FAIL, nullptr, "Unknown object!");
+                       const auto subTxtAo = m_callInfoPrs->getSubTxtAo();
+                       return (subTxtAo ? as_ao(subTxtAo) :
+                                       as_ao(m_callInfoPrs->getMainTxtAo()));
                }
-
-               return ao;
+               return nullptr;
        }
 }
index c6654c00099f160d0807654aab68e5522229a2ae..0eeb7000242cb20b2b86321e098063dc561814cd 100644 (file)
@@ -145,6 +145,7 @@ namespace callui {
                const Elm_Interface_Atspi_Accessible *onEndCallModeAtspiHighlight(
                                const Elm_Interface_Atspi_Accessible *ao,
                                Elm_Atspi_Relation_Type flowRelation);
+               Elm_Interface_Atspi_Accessible *onAccessoryAoRequest(bool isFlowsTo);
 
                // Page //
 
index eff272df96edc8c6eb41d805b3924bd580a52e4e..eb270f8c9a473dd6a15ddc39867e6ec88ec9cf36 100644 (file)
 
 namespace callui {
 
+       /**
+        * @brief Power button event info structure
+        */
        struct PowerBtnEventInfo {
                bool stopPropagation = false;
        };
 
+       /**
+        * @brief Map of text-containing edje parts
+        */
        using PartTextMap = ucl::HashMap<ucl::EdjePart, ucl::TString>;
+
+       /**
+        * @brief Access object request handler definition
+        */
+       using AoRequestHandler = ucl::WeakDelegate<
+                       Elm_Interface_Atspi_Accessible *(bool)>;
 }
 
 #endif // __CALL_UI_PRESENTERS_TYPES_H__
index 478070d76b53205f798a75ce8a564ddf764a7680..f775e63a89feac08e311d741b29bda03d30c5ddb 100644 (file)
@@ -183,19 +183,19 @@ namespace callui {
                }
        }
 
-       ElmWidget *VolumeControl::getDecreaseBtn()
+       ElmWidget &VolumeControl::getDecreaseBtn()
        {
-               return &m_decreaseBtn;
+               return m_decreaseBtn;
        }
 
-       ElmWidget *VolumeControl::getIncreaseBtn()
+       ElmWidget &VolumeControl::getIncreaseBtn()
        {
-               return &m_increaseBtn;
+               return m_increaseBtn;
        }
 
-       ElmWidget *VolumeControl::getValueTxtAo()
+       ElmWidget &VolumeControl::getValueTxtAo()
        {
-               return m_valueTxtAo.get();
+               return *m_valueTxtAo;
        }
 
        void VolumeControl::registerAccessObjectInformation()
index 5b14b8d55980d2681f772403d1f4191634257344..6a08fdeba455cab35c2b4d050d26d07895d10249 100644 (file)
@@ -130,23 +130,23 @@ namespace callui {
                /**
                 * @brief Gets Access object of decrease volume button
                 * @remark Use only for Screen Reader feature
-                * @return Pointer to widget on success or NULL otherwise
+                * @return Reference to widget
                 */
-               ucl::ElmWidget *getDecreaseBtn();
+               ucl::ElmWidget &getDecreaseBtn();
 
                /**
                 * @brief Gets Access object of increase volume button
                 * @remark Use only for Screen Reader feature
-                * @return Pointer to widget on success or NULL otherwise
+                * @return Reference to widget
                 */
-               ucl::ElmWidget *getIncreaseBtn();
+               ucl::ElmWidget &getIncreaseBtn();
 
                /**
                 * @brief Gets Access object of volume value text area
                 * @remark Use only for Screen Reader feature
-                * @return Pointer to widget on success or NULL otherwise
+                * @return Reference to widget
                 */
-               ucl::ElmWidget *getValueTxtAo();
+               ucl::ElmWidget &getValueTxtAo();
 
                // Slider //