diff options
author | Igor Olshevskyi <i.olshevskyi@samsung.com> | 2017-10-30 15:09:56 +0200 |
---|---|---|
committer | Igor Olshevskyi <i.olshevskyi@samsung.com> | 2017-11-01 10:44:22 +0200 |
commit | 31f32afaeef8cc20153850bab26db255d1acaade (patch) | |
tree | c214d86cb9a502ec72b8d0fc5486e1764177fec7 | |
parent | f05d01383952ac4ec2a32aab31a9c0a19b4930d1 (diff) | |
download | call-ui-31f32afaeef8cc20153850bab26db255d1acaade.tar.gz call-ui-31f32afaeef8cc20153850bab26db255d1acaade.tar.bz2 call-ui-31f32afaeef8cc20153850bab26db255d1acaade.zip |
TizenRefApp-9738 [Call UI] Reimplement ATSPI highlight custom logic using AoSequencer
Change-Id: Id7995c9e9df2173a3e7535e381dd08f3fd0aa682
-rw-r--r-- | call-ui/presenters/misc/AccessoryPresenter.cpp | 176 | ||||
-rw-r--r-- | call-ui/presenters/misc/AccessoryPresenter.h | 97 | ||||
-rw-r--r-- | call-ui/presenters/misc/MoreOptionsPresenter.cpp | 55 | ||||
-rw-r--r-- | call-ui/presenters/misc/RejectMsgPresenter.cpp | 38 | ||||
-rw-r--r-- | call-ui/presenters/pages/KeypadPage.cpp | 154 | ||||
-rw-r--r-- | call-ui/presenters/pages/KeypadPage.h | 5 | ||||
-rw-r--r-- | call-ui/presenters/pages/MainPage.cpp | 351 | ||||
-rw-r--r-- | call-ui/presenters/pages/MainPage.h | 1 | ||||
-rw-r--r-- | call-ui/presenters/types.h | 12 | ||||
-rw-r--r-- | call-ui/view/VolumeControl.cpp | 12 | ||||
-rw-r--r-- | call-ui/view/VolumeControl.h | 12 |
11 files changed, 324 insertions, 589 deletions
diff --git a/call-ui/presenters/misc/AccessoryPresenter.cpp b/call-ui/presenters/misc/AccessoryPresenter.cpp index dcee9e5..66f68fa 100644 --- a/call-ui/presenters/misc/AccessoryPresenter.cpp +++ b/call-ui/presenters/misc/AccessoryPresenter.cpp @@ -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" @@ -124,6 +126,14 @@ namespace callui { } AccessoryPresenter::Builder & + AccessoryPresenter::Builder::setAoRequestHandler( + AoRequestHandler handler) + { + m_aoRequestHandler = std::move(handler); + return *this; + } + + AccessoryPresenter::Builder & AccessoryPresenter::Builder::setParentWidget(ElmWidgetSRef parentWidget) { m_parentWidget = std::move(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; } - } - diff --git a/call-ui/presenters/misc/AccessoryPresenter.h b/call-ui/presenters/misc/AccessoryPresenter.h index 0b8b5b3..86d1cb6 100644 --- a/call-ui/presenters/misc/AccessoryPresenter.h +++ b/call-ui/presenters/misc/AccessoryPresenter.h @@ -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 { @@ -76,6 +78,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 * @return Reference to builder @@ -95,6 +104,7 @@ namespace callui { ICallManagerSRef m_cm; ucl::ElmWidgetSRef m_parentWidget; NotiHandler m_exitHandler; + AoRequestHandler m_aoRequestHandler; }; public: @@ -106,11 +116,18 @@ 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 * @return RES_OK on success or another result otherwise @@ -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; diff --git a/call-ui/presenters/misc/MoreOptionsPresenter.cpp b/call-ui/presenters/misc/MoreOptionsPresenter.cpp index 8ec22e9..415503a 100644 --- a/call-ui/presenters/misc/MoreOptionsPresenter.cpp +++ b/call-ui/presenters/misc/MoreOptionsPresenter.cpp @@ -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() diff --git a/call-ui/presenters/misc/RejectMsgPresenter.cpp b/call-ui/presenters/misc/RejectMsgPresenter.cpp index 1f3b62f..9a7ec34 100644 --- a/call-ui/presenters/misc/RejectMsgPresenter.cpp +++ b/call-ui/presenters/misc/RejectMsgPresenter.cpp @@ -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(); } } diff --git a/call-ui/presenters/pages/KeypadPage.cpp b/call-ui/presenters/pages/KeypadPage.cpp index 2911c99..95559d9 100644 --- a/call-ui/presenters/pages/KeypadPage.cpp +++ b/call-ui/presenters/pages/KeypadPage.cpp @@ -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(); } } diff --git a/call-ui/presenters/pages/KeypadPage.h b/call-ui/presenters/pages/KeypadPage.h index 5938aa8..b9f7987 100644 --- a/call-ui/presenters/pages/KeypadPage.h +++ b/call-ui/presenters/pages/KeypadPage.h @@ -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; diff --git a/call-ui/presenters/pages/MainPage.cpp b/call-ui/presenters/pages/MainPage.cpp index da99bd9..903ecd3 100644 --- a/call-ui/presenters/pages/MainPage.cpp +++ b/call-ui/presenters/pages/MainPage.cpp @@ -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; } } diff --git a/call-ui/presenters/pages/MainPage.h b/call-ui/presenters/pages/MainPage.h index c6654c0..0eeb700 100644 --- a/call-ui/presenters/pages/MainPage.h +++ b/call-ui/presenters/pages/MainPage.h @@ -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 // diff --git a/call-ui/presenters/types.h b/call-ui/presenters/types.h index eff272d..eb270f8 100644 --- a/call-ui/presenters/types.h +++ b/call-ui/presenters/types.h @@ -24,11 +24,23 @@ 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__ diff --git a/call-ui/view/VolumeControl.cpp b/call-ui/view/VolumeControl.cpp index 478070d..f775e63 100644 --- a/call-ui/view/VolumeControl.cpp +++ b/call-ui/view/VolumeControl.cpp @@ -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() diff --git a/call-ui/view/VolumeControl.h b/call-ui/view/VolumeControl.h index 5b14b8d..6a08fde 100644 --- a/call-ui/view/VolumeControl.h +++ b/call-ui/view/VolumeControl.h @@ -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 // |