ucl::Result setVolume(int volume);
/**
- * @brief Sets handler for monitoring volume state change
- * @param[in] handler Handler to set
+ * @brief Sets volume state change handler
+ * @param[in] handler Volume state change handler
*/
void setVolumeStateHandler(const NotiHandler &handler);
UCL_DECLARE_REF_ALIASES(Page);
+ /**
+ * @brief Base class for pages
+ */
class Page : public ucl::GuiPresenter,
public ucl::IDisposable {
public:
+
+ /**
+ * @brief Page exit request handler definition
+ */
using ExitRequestHandler = ucl::WeakDelegate<void(Page &page)>;
public:
+
+ /**
+ * @brief Gets naviframe
+ * @return Reference to Naviframe
+ */
ucl::Naviframe &getNaviframe();
+ /**
+ * @brief Checks whether page is top in page stack
+ * @return true if page is top, false otherwise
+ */
bool isAtTop() const;
+
+ /**
+ * @brief Checks whether page is bottom in page stack
+ * @return true if page is bottom, false otherwise
+ */
bool isAtBottom() const;
+ /**
+ * @brief Requests to remove page from stack
+ * @remark If page is top in page stack it will be removed
+ * with transition animation. Otherwise it will be removed
+ * without animation
+ */
void exit();
+ /**
+ * @brief Pops other pages from stack above current page
+ * @remark Upper pages will be removed with single transition animation
+ */
void popTo();
+
+ /**
+ * @brief Deletes other pages that are in stack above current page
+ * @remark No transition animation will be provided
+ */
void deleteTo();
+
+ /**
+ * @brief Promotes page to the top of the page stack
+ */
void promote();
+ /**
+ * @brief Inserts page after some page that is already in stack
+ * @param[in] args List of params @see ucl::Naviframe
+ */
template <class ...ARGS>
ucl::NaviItem insertAfter(ARGS &&...args);
+ /**
+ * @brief Inserts page before some page that is already in stack
+ * @param[in] args List of params @see ucl::Naviframe
+ */
template <class ...ARGS>
ucl::NaviItem insertBefore(ARGS &&...args);
// ucl::IDisposable //
+ /**
+ * @see ucl::IDisposable::dispose()
+ */
virtual void dispose() override;
+
+ /**
+ * @see ucl::IDisposable::isDisposed()
+ */
virtual bool isDisposed() const final override;
protected:
+
+ /**
+ * @brief Constructor
+ * @param[in] rc Reference count object
+ * @param[in] navi Application naviframe
+ * @param[in] onExitRequest Exit request handler
+ */
Page(ucl::IRefCountObj &rc, const ucl::NaviframeSRef &navi,
const ExitRequestHandler &onExitRequest);
+ /**
+ * @brief Destructor
+ */
~Page();
+ /**
+ * @brief Prepare method to initialize main Page components
+ * @param[in] onPrepare Function callback that will be called
+ * on user side for creation NaviItem and its content
+ * @return RES_OK on success or another result otherwise
+ */
template <class ON_PREPARE>
ucl::Result prepare(ON_PREPARE &&onPrepare);
+ /**
+ * @brief Gets naviframe item
+ * @return Naviframe item
+ */
ucl::NaviItem getItem();
+ /**
+ * @brief Makes request on Page exit
+ * @remark Set ExitRequestHandler will be called.
+ */
void requestExit();
+ /**
+ * @brief Called when Page gets Back key event
+ * @remark By default it make Page exit request
+ */
virtual void onBackKey();
private:
UCL_DECLARE_REF_ALIASES(AcceptDialog);
+ /**
+ * @brief Presenter of Accept call dialog
+ */
class AcceptDialog final : public ucl::GuiPresenter,
public ucl::IDisposable {
public:
+
+ /**
+ * @brief Enumeration of dialog events
+ */
enum class Event {
- HOLD_AND_ACCEPT,
- END_AND_ACCEPT,
- BACK
+ HOLD_AND_ACCEPT, /**< Set active call on hold and accept incoming */
+ END_AND_ACCEPT, /**< End active call and accept incoming */
+ BACK /**< Back button event */
};
- using EventHandler = ucl::WeakDelegate<bool(
- AcceptDialog &, Event)>;
+
+ /**
+ * @brief Dialog event handler definition
+ */
+ using EventHandler = ucl::WeakDelegate<bool(AcceptDialog &, Event)>;
public:
+
+ /**
+ * AcceptDialog builer
+ */
class Builder {
public:
+ /**
+ * @brief Constructor
+ */
Builder();
+
+ /**
+ * @brief Sets event handler
+ * @param[in] handler Event handler
+ * @return Reference to builder
+ */
Builder &setHandler(EventHandler handler);
+
+ /**
+ * @brief Builds AcceptDialog
+ * @param[in] parent Parent widget for dialog
+ * @return Weak reference to AcceptDialog
+ */
AcceptDialogWRef build(ucl::ElmWidget &parent) const;
private:
EventHandler m_handler;
};
public:
+
+ /**
+ * @brief Dismisses dialog
+ */
void dismiss();
// ucl::IDisposable //
+ /**
+ * @see ucl::IDisposable::dispose()
+ */
virtual void dispose() final override;
+
+ /**
+ * @see ucl::IDisposable::isDisposed()
+ */
virtual bool isDisposed() const final override;
private:
UCL_DECLARE_REF_ALIASES(AcceptRejectPresenter);
+ /**
+ * @brief Presenter of Accept / Reject call widget
+ */
class AcceptRejectPresenter final : public ucl::GuiPresenter {
public:
+ /**
+ * @brief AcceptRejectPresenter builder
+ */
class Builder {
public:
+ /**
+ * @brief Constructor
+ */
Builder();
+
+ /**
+ * @brief Sets Incoming Call instance
+ * @param[in] call Incoming Call instance
+ * @return Reference to builder
+ */
Builder &setIncomingCall(const IIncomingCallSRef &call);
+
+ /**
+ * @brief Sets Sound Manager instance
+ * @param[in] sm Sound Manager instance
+ * @return Reference to builder
+ */
Builder &setSoundManager(const ISoundManagerSRef &sm);
+
+ /**
+ * @brief Sets available calls flag
+ * @param[in] calls Available calls flag
+ * @return Reference to builder
+ */
Builder &setAvailableCallsFlag(CallMask calls);
+
+ /**
+ * @brief Sets parent widget for UI components creation
+ * @param[in] parentWidget Parent widget
+ * @return Reference to builder
+ */
Builder &setParentWidget(const ucl::ElmWidgetSRef &parentWidget);
+
+ /**
+ * @brief Creates new instance of AcceptRejectPresenter
+ * @param[in] parent Parent presenter
+ * @return Shared reference to AcceptRejectPresenter instance
+ * on success or NULL otherwise
+ */
AcceptRejectPresenterSRef build(ucl::GuiPresenter &parent) const;
private:
};
public:
+
+ /**
+ * @brief Returns widget
+ * @return Reference to widget
+ */
ucl::Widget &getWidget();
+
+ /**
+ * @brief Updates presenter
+ * @param[in] calls Available calls flag
+ */
void update(CallMask calls);
+ /**
+ * @brief Gets accept button Access object
+ * @return Pointer to access object on success, NULL otherwise
+ */
ucl::ElmWidget *getAcceptAo();
+
+ /**
+ * @brief Gets reject button Access object
+ * @return Pointer to access object on success, NULL otherwise
+ */
ucl::ElmWidget *getRejectAo();
private:
UCL_DECLARE_REF_ALIASES(AccessoryPresenter);
+ /**
+ * @brief Presenter of additional call controls.
+ * Provides UI controls to manipulate volume, voice mute,
+ * BT Headset turn on/off.
+ */
class AccessoryPresenter final : public ucl::GuiPresenter {
public:
+ /**
+ * @brief AccessoryPresenter builder
+ */
class Builder {
public:
+
+ /**
+ * @brief Constructor
+ */
Builder();
+
+ /**
+ * @brief Sets Sound Manager instance
+ * @param[in] sm Sound Manager instance
+ * @return Reference to builder
+ */
Builder &setSoundManager(const ISoundManagerSRef &sm);
+
+ /**
+ * @brief Sets Call Manager instance
+ * @param[in] cm Call Manager instance
+ * @return Reference to builder
+ */
Builder &setCallManager(const ICallManagerSRef &cm);
+
+ /**
+ * @brief Sets request exit application handler
+ * @param[in] handler Event Request exit handler
+ * @return Reference to builder
+ */
Builder &setRequestExitHandler(const NotiHandler &handler);
+
+ /**
+ * @brief Sets parent widget for UI components creation
+ * @param[in] parentWidget Parent widget
+ * @return Reference to builder
+ */
Builder &setParentWidget(const ucl::ElmWidgetSRef &parentWidget);
+
+ /**
+ * @brief Creates new instance of AccessoryPresenter
+ * @param[in] parent Parent presenter
+ * @return Shared reference to AccessoryPresenter instance
+ * on success or NULL otherwise
+ */
AccessoryPresenterSRef build(ucl::GuiPresenter &parent) const;
private:
};
public:
+
+ /**
+ * @brief Returns widget
+ * @return Reference to widget
+ */
ucl::Widget &getWidget();
+
+ /**
+ * @brief Force hides volume control components
+ */
void hideVolumeControls();
+
+ /**
+ * @brief Updates presenter
+ * @param[in] cm Call Manager instance
+ * @return RES_OK on success or another result otherwise
+ */
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
+ */
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();
private:
UCL_DECLARE_REF_ALIASES(AtspiHighlightHelper);
+ /**
+ * @brief Represents helper presenter for Screen Reader feature
+ */
class AtspiHighlightHelper final : public ucl::GuiPresenter {
public:
+
+ /**
+ * @brief Relation event handler definition
+ */
using RelationEventHandler = ucl::WeakDelegate<Elm_Interface_Atspi_Accessible *(
Elm_Interface_Atspi_Accessible *ao,
Elm_Atspi_Relation_Type flowRelation)>;
+ /**
+ * @brief Gesture event handler definition
+ */
using GestureEventHandler = ucl::WeakDelegate<bool (
Elm_Interface_Atspi_Accessible *ao,
Elm_Atspi_Gesture_Type gestureType)>;
public:
+
+ /**
+ * @brief Creates new instance of AtspiHighlightHelper
+ * @param[in] parent Parent presenter
+ * @param[in] rootWidget Root widget for Screen Reader
+ * @return Shared reference to AtspiHighlightHelper instance
+ * on success or NULL otherwise
+ */
static AtspiHighlightHelperSRef newInstance(GuiPresenter &parent,
ucl::ElmWidget &rootWidget);
+ /**
+ * @brief Sets relation event handler
+ * @param[in] handler Relation event handler
+ */
void setRelationEventHandler(RelationEventHandler handler);
+
+ /**
+ * @brief Sets gesture event handler
+ * @param[in] handler Gesture event handler
+ */
void setGestureEventHandler(GestureEventHandler handler);
+
+ /**
+ * @brief Registers widget for Screen Reader events
+ * relation and gesture events
+ * @param[in] widget Widget to register
+ */
void registerWidget(ucl::ElmWidget &widget);
+
+ /**
+ * @brief Handles gesture events on Access object that
+ * are not register by AtspiHighlightHelper
+ * @param[in] widget Access object
+ * @param[in] info Gesture info
+ * @return true if no need to process gesture event by EFL,
+ * false otherwise
+ */
bool handleGesture(Elm_Interface_Atspi_Accessible *widget,
const Elm_Atspi_Gesture_Info &info);
return *m_widget;
}
- CallMode CallInfoPresenter::getMode() const
- {
- return m_mode;
- }
-
void CallInfoPresenter::initCallInfos(const ICallManagerSRef &cm)
{
auto incom = cm->getIncomingCall();
if (contactInfo) {
return encloseBidirectionalText(std::move(
callInfo->getPhoneNumber()),
- BidiTextEncoseType::LRM);
+ BidiTextEncloseType::LRM);
}
return "";
}
auto displStr = m_activeCallInfo->getPhoneNumber();
if (displStr.empty()) {
displStr = encloseBidirectionalText(std::move(displStr),
- BidiTextEncoseType::LRM);
+ BidiTextEncloseType::LRM);
}
auto contactInfo = m_activeCallInfo->getContactInfo();
if (contactInfo) {
if (contactInfo->getNameSourceType() ==
ContactNameSourceType::NUMBER) {
displStr = encloseBidirectionalText(std::move(displStr),
- BidiTextEncoseType::LRM);
+ BidiTextEncloseType::LRM);
}
}
}
if (contactInfo->getNameSourceType() ==
ContactNameSourceType::NUMBER) {
mainTxt = encloseBidirectionalText(std::move(mainTxt),
- BidiTextEncoseType::LRM);
+ BidiTextEncloseType::LRM);
}
}
UCL_DECLARE_REF_ALIASES(CallInfoPresenter);
+ /**
+ * @brief Presenter for displaying Call Info information
+ */
class CallInfoPresenter final : public ucl::GuiPresenter {
public:
+
+ /**
+ * @brief CallInfoPresenter builder
+ */
class Builder {
public:
+
+ /**
+ * @brief Constructor
+ */
Builder();
+
+ /**
+ * @brief Sets Call Manager instance
+ * @param[in] cm Call Manager instance
+ * @return Reference to builder
+ */
Builder &setCallManager(const ICallManagerSRef &cm);
+
+ /**
+ * @brief Sets Call mode
+ * @param[in] mode Call mode
+ * @return Reference to builder
+ */
Builder &setMode(CallMode mode);
+
+ /**
+ * @brief Sets parent widget for UI components creation
+ * @param[in] parentWidget Parent widget
+ * @return Reference to builder
+ */
Builder &setParentWidget(const ucl::ElmWidgetSRef &parentWidget);
+
+ /**
+ * @brief Creates new instance of CallInfoPresenter
+ * @param[in] parent Parent presenter
+ * @return Shared reference to CallInfoPresenter instance
+ * on success or NULL otherwise
+ */
CallInfoPresenterSRef build(ucl::GuiPresenter &parent) const;
private:
ICallManagerSRef m_cm;
};
public:
+
+ /**
+ * @brief Returns widget
+ * @return Reference to widget
+ */
ucl::Widget &getWidget();
- CallMode getMode() const;
+
+ /**
+ * @brief Update presenter
+ * @param[in] mode Call mode
+ * @param[in] cm Call Manager instance
+ * @return RES_OK on success or another result otherwise
+ */
ucl::Result update(CallMode mode, const ICallManagerSRef &cm);
+ /**
+ * @brief Gets Access object for status text area
+ * @remark Use only for Screen Reader feature
+ * @return Pointer to widget on success or NULL otherwise
+ */
ucl::ElmWidget *getStatusTxtAo();
+
+ /**
+ * @brief Gets Access object for main text area
+ * @remark Use only for Screen Reader feature
+ * @return Pointer to widget on success or NULL otherwise
+ */
ucl::ElmWidget *getMainTxtAo();
+
+ /**
+ * @brief Gets Access object for sub text area
+ * @remark Use only for Screen Reader feature
+ * @return Pointer to widget on success or NULL otherwise
+ */
ucl::ElmWidget *getSubTxtAo();
private:
}
struct tm tmp = info->getDuration();
- tryUpdateCallDurationTime(
- m_duration,
- tmp,
- *m_ly,
- impl::PART_TXT_TEXT_INFO);
+ if ((m_duration.tm_sec - tmp.tm_sec) != 0) {
+ m_duration = tmp;
+ m_ly->setText(getCallDurationTxt(m_duration),
+ impl::PART_TXT_TEXT_INFO);
+ }
return ECORE_CALLBACK_RENEW;
}
if (const auto info = m_info.lock()) {
m_duration = info->getDuration();
}
- m_ly->setText(getCallDuration(m_duration),
+ m_ly->setText(getCallDurationTxt(m_duration),
impl::PART_TXT_TEXT_INFO);
if (m_timer) {
Eina_Bool CallStatusPresenter::onBlinkingTimerCb()
{
if ((m_blinkCount % 2) == 0) {
- m_ly->setText(getCallDuration(m_duration),
+ m_ly->setText(getCallDurationTxt(m_duration),
impl::PART_TXT_TEXT_INFO);
} else if ((m_blinkCount % 2) == 1) {
m_ly->setText("", impl::PART_TXT_TEXT_INFO);
UCL_DECLARE_REF_ALIASES(CallStatusPresenter);
+ /**
+ * @brief Presenter for displaying Call Status information
+ */
class CallStatusPresenter final : public ucl::GuiPresenter {
public:
+
+ /**
+ * @brief CallStatusPresenter builder
+ */
class Builder {
public:
+ /**
+ * @brief Constructor
+ */
Builder();
+
+ /**
+ * @brief Sets Call mode
+ * @param[in] mode Call mode
+ * @return Reference to builder
+ */
Builder &setMode(CallMode mode);
+
+ /**
+ * @brief Sets Call Info
+ * @param[in] info Call Info instance
+ * @return Reference to builder
+ */
Builder &setCallInfo(const ICallInfoWCRef &info);
+
+ /**
+ * @brief Sets call Hold state
+ * @param[in] isOnHold Call Hold state: true if current
+ * call is on hold, false otherwise
+ * @return Reference to builder
+ */
Builder &setCallHoldState(bool isOnHold);
+
+ /**
+ * @brief Sets Call Info layout
+ * @param[in] info Call Info layout
+ * @return Reference to builder
+ */
Builder &setLayout(const ucl::LayoutSRef &layout);
+
+ /**
+ * @brief Creates new instance of CallStatusPresenter
+ * @param[in] parent Parent presenter
+ * @return Shared reference to CallStatusPresenter instance
+ * on success or NULL otherwise
+ */
CallStatusPresenterSRef build(ucl::GuiPresenter &parent) const;
private:
ucl::LayoutSRef m_ly;
bool m_isOnHold;
};
public:
+
+ /**
+ * @brief Gets Access object for status text area
+ * @remark Use only for Screen Reader feature
+ * @return Pointer to widget on success or NULL otherwise
+ */
ucl::ElmWidget *getStatusTextAo();
private:
UCL_DECLARE_REF_ALIASES(DeviceStatePresenter);
+ /**
+ * @brief Presenter for manipulating device parameters
+ */
class DeviceStatePresenter final {
public:
+
+ /**
+ * @brief Enumeration of device Display states
+ */
enum class DisplayState {
- UNDEFINED,
- ON,
- OFF,
- DIM
+ UNDEFINED, /**< Undefined */
+ ON, /**< Display turned on */
+ OFF, /**< Display turned off */
+ DIM /**< Display dimmed */
};
+ /**
+ * @brief Enumeration of device Display modes
+ */
enum class DisplayMode {
- UNDEFINED,
- REGULAR,
- TOP_PRIORITY
+ UNDEFINED, /**< Undefined */
+ REGULAR, /**< Turns the screen off after a timeout */
+ TOP_PRIORITY /**< Keeps the screen turned on */
};
public:
+
+ /**
+ * @brief DeviceStatePresenter builder
+ */
class Builder {
public:
+
+ /**
+ * @brief Constructor
+ */
Builder();
+
+ /**
+ * @brief Sets display state
+ * @param[in] state Display state
+ * @return Reference to builder
+ */
Builder &setDisplayState(DisplayState state);
+
+ /**
+ * @brief Sets display mode
+ * @param[in] mode Display mode
+ * @return Reference to builder
+ */
Builder &setDisplayMode(DisplayMode mode);
+
+ /**
+ * @brief Sets CPU lock state
+ * @param[in] lockState CPU lock state
+ * @return Reference to builder
+ */
Builder &setCpuLockState(bool lockState);
+
+ /**
+ * @brief Creates new instance of DeviceStatePresenter
+ * @param[in] window Window instance
+ * @return Shared reference to DeviceStatePresenter instance
+ * on success or NULL otherwise
+ */
DeviceStatePresenterSRef build(
const ucl::WindowSRef &window) const;
private:
};
public:
- ucl::Result setDisplayState(DisplayState state,
- bool forse = false);
+
+ /**
+ * @brief Sets display state
+ * @param[in] state Display state
+ * @param[in] forse Force flag:
+ * true - sets display state no matter on current state,
+ * false(default) - do not set state if @state is the same as current
+ * @return RES_OK on success or another result otherwise
+ */
+ ucl::Result setDisplayState(DisplayState state, bool forse = false);
+
+ /**
+ * @brief Sets display mode
+ * @param[in] mode Display mode
+ * @return RES_OK on success or another result otherwise
+ */
ucl::Result setDisplayMode(DisplayMode mode);
+
+ /**
+ * @brief Sets CPU lock state
+ * @param[in] lockState CPU lock state
+ * @return RES_OK on success or another result otherwise
+ */
ucl::Result setCpuLockState(bool lockState);
private:
return *m_widget;
}
- void IndicatorPresenter::udapteIncomingCallMode(bool isIncomingCallMode)
+ void IndicatorPresenter::setIncomingCallMode(bool isIncomingCallMode)
{
if (m_isIncomingCallMode == isIncomingCallMode) {
return;
UCL_DECLARE_REF_ALIASES(IndicatorPresenter);
+ /**
+ * @brief Presenter of application indicator
+ */
class IndicatorPresenter final : public ucl::GuiPresenter,
public IIndicatorStateListener {
public:
+
+ /**
+ * @brief IndicatorPresenter builder
+ */
class Builder {
public:
+
+ /**
+ * @brief Constructor
+ */
Builder();
+
+ /**
+ * @brief Sets Indicator State provider
+ * @param[in] provider Indicator State provider
+ * @return Reference to builder
+ */
Builder &setIndicatorStateProvider(
const IIndicatorStateProviderSRef &provider);
- Builder &setParentWidget(const ucl::ElmWidgetSRef
- &parentWidget);
+
+ /**
+ * @brief Sets parent widget for UI components creation
+ * @param[in] parentWidget Parent widget
+ * @return Reference to builder
+ */
+ Builder &setParentWidget(const ucl::ElmWidgetSRef &parentWidget);
+
+ /**
+ * @brief Creates new instance of IndicatorPresenter
+ * @param[in] parent Parent presenter
+ * @return Shared reference to IndicatorPresenter instance
+ * on success or NULL otherwise
+ */
IndicatorPresenterSRef build(ucl::GuiPresenter &parent) const;
private:
IIndicatorStateProviderSRef m_provider;
};
public:
+
+ /**
+ * @brief Returns widget
+ * @return Reference to widget
+ */
ucl::Widget &getWidget();
- void udapteIncomingCallMode(bool isIncomingCallMode);
+ /**
+ * @brief Sets incoming call mode
+ * @remark Used for display Voice Answer icon on incoming
+ * call if feature is turned on
+ * @param[in] isIncomingCallMode incoming call mode
+ */
+ void setIncomingCallMode(bool isIncomingCallMode);
private:
IndicatorPresenter(ucl::IRefCountObj &rc,
const IIndicatorStateProviderSRef &provider);
~IndicatorPresenter();
- ucl::Result prepare(ucl::GuiPresenter &parent, ucl::ElmWidget &parentWidget);
+ ucl::Result prepare(ucl::GuiPresenter &parent,
+ ucl::ElmWidget &parentWidget);
ucl::Result createWidget(ucl::ElmWidget &parent);
ucl::Result createConnectionLayout();
}
m_info = info;
m_duration = info->getDuration();
- auto temp = getCallDuration(m_duration);
+ auto temp = getCallDurationTxt(m_duration);
m_panelLy->setText(temp, impl::PART_TXT_STATUS);
FAIL_RETURN_VOID(startCallDurationTimer(), "startTimer() failed!");
}
struct tm tmp = info->getDuration();
- tryUpdateCallDurationTime(
- m_duration,
- tmp,
- *m_panelLy,
- impl::PART_TXT_STATUS);
+ if ((m_duration.tm_sec - tmp.tm_sec) != 0) {
+ m_duration = tmp;
+ m_panelLy->setText(getCallDurationTxt(m_duration),
+ impl::PART_TXT_STATUS);
+ }
return ECORE_CALLBACK_RENEW;
}
UCL_DECLARE_REF_ALIASES(MoreOptionsPresenter);
+ /**
+ * Presenter of More options
+ */
class MoreOptionsPresenter final : public ucl::GuiPresenter {
public:
+ /**
+ * @brief MoreOptionsPresenter builder
+ */
class Builder {
public:
+ /**
+ * @brief Constructor
+ */
Builder();
+
+ /**
+ * @brief Sets Call Manager instance
+ * @param[in] cm Call Manager instance
+ * @return Reference to builder
+ */
Builder &setCallManager(const ICallManagerSRef &cm);
+
+ /**
+ * @brief Sets Sound Manager instance
+ * @param[in] sm Sound Manager instance
+ * @return Reference to builder
+ */
Builder &setSoundManager(const ISoundManagerSRef &sm);
+
+ /**
+ * @brief Sets Naviframe instance
+ * @param[in] sm Naviframe instance
+ * @return Reference to builder
+ */
Builder &setNaviframe(const ucl::NaviframeSRef &navi);
+
+ /**
+ * @brief Sets parent widget for UI components creation
+ * @param[in] parentWidget Parent widget
+ * @return Reference to builder
+ */
Builder &setParentWidget(const ucl::ElmWidgetSRef &parentWidget);
+
+ /**
+ * @brief Creates new instance of MoreOptionsPresenter
+ * @param[in] parent Parent presenter
+ * @return Shared reference to MoreOptionsPresenter instance
+ * on success or NULL otherwise
+ */
MoreOptionsPresenterSRef build(ucl::GuiPresenter &parent) const;
private:
};
public:
+
+ /**
+ * @brief Returns widget
+ * @return Reference to widget
+ */
ucl::Widget &getWidget();
+
+ /**
+ * @brief Updates presenter
+ */
void update();
+ /**
+ * @brief Gets Access object of More options cue
+ * @remark Use only for Screen Reader feature
+ */
ucl::ElmWidget *getCueAo();
private:
{
}
- MotionSensorPresenter::Builder::~Builder()
- {
- }
-
MotionSensorPresenterSRef
MotionSensorPresenter::Builder::build(
const NotiHandler handler) const
UCL_DECLARE_REF_ALIASES(MotionSensorPresenter);
+ /**
+ * @brief Presenter of device Motion Sensor
+ */
class MotionSensorPresenter final {
public:
+
+ /**
+ * @brief MotionSensorPresenter builder
+ */
class Builder {
public:
+
+ /**
+ * @brief Constructor
+ */
Builder();
- ~Builder();
+
+ /**
+ * @brief Creates new instance of MotionSensorPresenter
+ * @param[in] handler Motion event handler
+ * @return Shared reference to MotionSensorPresenter instance
+ * on success or NULL otherwise
+ */
MotionSensorPresenterSRef build(const NotiHandler handler) const;
};
private:
UCL_DECLARE_REF_ALIASES(RejectMsgPresenter);
+ /**
+ * @brief Presenter of Reject messages view
+ */
class RejectMsgPresenter final : public ucl::GuiPresenter {
public:
+
+ /**
+ * @brief Enumeration of Reject message states
+ */
enum class State {
- HIDDEN,
- IN_TRANSITION,
- SHOWN
+ HIDDEN, /**< Reject message panel is hidden */
+ IN_TRANSITION, /**< Reject message panel is in animation transition to appear/disappear */
+ SHOWN /**< Reject message panel is shown */
};
+
+ /**
+ * State change event handler definition
+ */
using StateHandler = ucl::WeakDelegate<void(State)>;
+
+ /**
+ * Select reject message event handler definition
+ */
using SelectHandler = ucl::WeakDelegate<void(
const IRejectMsgSRef &rm)>;
public:
+
+ /**
+ * @brief RejectMsgPresenter builder
+ */
class Builder {
public:
+
+ /**
+ * @brief Constructor
+ */
Builder();
+
+ /**
+ * @brief Sets Reject message provider
+ * @param[in] provider Reject message provider instance
+ * @return Reference to builder
+ */
Builder &setProvider(const IRejectMsgProviderSRef &provider);
+
+ /**
+ * @brief Sets state change event handler
+ * @param[in] handler State change event handler
+ * @return Reference to builder
+ */
Builder &setStateHandler(const StateHandler &handler);
+
+ /**
+ * @brief Sets select reject message event handler
+ * @param[in] handler Select reject message event handler
+ * @return Reference to builder
+ */
Builder &setSelectHandler(const SelectHandler &handler);
+
+ /**
+ * @brief Sets parent widget for UI components creation
+ * @param[in] parentWidget Parent widget
+ * @return Reference to builder
+ */
Builder &setParentWidget(const ucl::ElmWidgetSRef &parentWidget);
+
+ /**
+ * @brief Creates new instance of RejectMsgPresenter
+ * @param[in] parent Parent presenter
+ * @return Shared reference to RejectMsgPresenter instance
+ * on success or NULL otherwise
+ */
RejectMsgPresenterSRef build(ucl::GuiPresenter &parent) const;
private:
};
public:
+
+ /**
+ * @brief Returns widget
+ * @return Reference to widget
+ */
ucl::Widget &getWidget();
+ /**
+ * @brief Returns current state
+ * @return Current state
+ */
State getState();
+ /**
+ * @brief Requests to show Reject message panel
+ */
void showPanel();
+
+ /**
+ * @brief Requests to hide Reject message panel
+ */
void hidePanel();
+ /**
+ * @brief Sets state change event handler
+ * @param[in] handler State change event handler
+ */
void setStateHandler(const StateHandler &handler);
+
+ /**
+ * @brief Sets select reject message event handler
+ * @param[in] handler Select reject message event handler
+ */
void setSelectHandler(const SelectHandler &handler);
private:
}
}
- TString getCallDuration(const struct tm &time)
+ TString getCallDurationTxt(const struct tm &time)
{
TString tmp;
if (time.tm_hour > 0) {
- tmp = himpl::STR_HH_MM_SS_TIME.format(time.tm_hour, time.tm_min, time.tm_sec);
+ tmp = himpl::STR_HH_MM_SS_TIME.format(
+ time.tm_hour, time.tm_min, time.tm_sec);
} else {
- tmp = himpl::STR_MM_SS_TIME.format(time.tm_min, time.tm_sec);
+ tmp = himpl::STR_MM_SS_TIME.format(
+ time.tm_min, time.tm_sec);
}
return tmp;
}
- void tryUpdateCallDurationTime(
- struct tm &curTime,
- struct tm &compTime,
- EdjeWidget &widget,
- const EdjePart &part)
- {
- if ((compTime.tm_sec - curTime.tm_sec) != 0) {
- curTime = compTime;
- auto tmp = getCallDuration(curTime);
- widget.setText(tmp, part);
- }
- }
-
- std::string encloseBidirectionalText(const std::string &txt, BidiTextEncoseType type)
+ std::string encloseBidirectionalText(const std::string &txt,
+ BidiTextEncloseType type)
{
switch (type) {
- case BidiTextEncoseType::LRM:
+ case BidiTextEncloseType::LRM:
return himpl::BIDI_TXT_LRM + txt + himpl::BIDI_TXT_LRM;
- case BidiTextEncoseType::RLM:
+ case BidiTextEncloseType::RLM:
return himpl::BIDI_TXT_RLM + txt + himpl::BIDI_TXT_RLM;
- case BidiTextEncoseType::LRM_RLM:
+ case BidiTextEncloseType::LRM_RLM:
return himpl::BIDI_TXT_LRM_RLM + txt + himpl::BIDI_TXT_RLM_LRM;
- case BidiTextEncoseType::RLM_LRM:
+ case BidiTextEncloseType::RLM_LRM:
return himpl::BIDI_TXT_RLM_LRM + txt + himpl::BIDI_TXT_LRM_RLM;
default:
ELOG("Invalid type");
return txt;
}
- std::string encloseBidirectionalText(std::string &&txt, BidiTextEncoseType type)
+ std::string encloseBidirectionalText(std::string &&txt,
+ BidiTextEncloseType type)
{
switch (type) {
- case BidiTextEncoseType::LRM:
+ case BidiTextEncloseType::LRM:
txt.insert(0, himpl::BIDI_TXT_LRM);
txt.append(himpl::BIDI_TXT_LRM);
break;
- case BidiTextEncoseType::RLM:
+ case BidiTextEncloseType::RLM:
txt.insert(0, himpl::BIDI_TXT_RLM);
txt.append(himpl::BIDI_TXT_RLM);
break;
- case BidiTextEncoseType::LRM_RLM:
+ case BidiTextEncloseType::LRM_RLM:
txt.insert(0, himpl::BIDI_TXT_LRM_RLM);
txt.append(himpl::BIDI_TXT_RLM_LRM);
break;
- case BidiTextEncoseType::RLM_LRM:
+ case BidiTextEncloseType::RLM_LRM:
txt.insert(0, himpl::BIDI_TXT_RLM_LRM);
txt.append(himpl::BIDI_TXT_LRM_RLM);
break;
return std::move(txt);
}
- Result isLTRCharacterOrientation(const std::string &lang)
+ Result isLTRCharacterOrientation(const std::string &local)
{
- if (lang.empty()) {
- LOG_RETURN(RES_INVALID_ARGUMENTS, "lang is empty");
+ if (local.empty()) {
+ LOG_RETURN(RES_INVALID_ARGUMENTS, "local is empty");
}
i18n_ulocale_layout_type_e layout = I18N_ULOCALE_LAYOUT_UNKNOWN;
- int ret = i18n_ulocale_get_character_orientation(lang.c_str(),
+ int ret = i18n_ulocale_get_character_orientation(local.c_str(),
&layout);
if (ret != I18N_ERROR_NONE) {
LOG_RETURN(RES_FAIL,
namespace callui {
- enum class BidiTextEncoseType {
- LRM,
- RLM,
- LRM_RLM,
- RLM_LRM
+ /**
+ * @brief Enumeration for text enclose types of bidirectional text
+ */
+ enum class BidiTextEncloseType {
+ LRM, /**< Encloses text with LRM symbols */
+ RLM, /**< Encloses text with RLM symbols */
+ LRM_RLM, /**< Encloses text with LRM and RLM symbols */
+ RLM_LRM /**< Encloses text with RLM and LRM symbols */
};
+ /**
+ * @brief Application Instance pause smart event definition
+ */
constexpr ucl::SmartEvent INSTANCE_PAUSED {"callui,instance,paused"};
+
+ /**
+ * @brief Application Instance resume smart event definition
+ */
constexpr ucl::SmartEvent INSTANCE_RESUMED {"callui,instance,resumed"};
+ /**
+ * @brief Sets whether application Instance is in pause or not
+ * @param[in] win Window instance
+ * @param[in] value Application instance pause state
+ */
void setInstancePaused(ucl::Window &win, bool value);
- bool isInstancePaused(const ucl::Window &win);
- ucl::TString getCallDuration(const struct tm &time);
+ /**
+ * @brief Checks whether application Instance is in pause or not
+ * @param[in] win Window instance
+ * @return Application instance pause state:
+ * true - application Instance is paused, false - otherwise
+ */
+ bool isInstancePaused(const ucl::Window &win);
- void tryUpdateCallDurationTime(
- struct tm &curTime, struct tm &compTime,
- ucl::EdjeWidget &widget, const ucl::EdjePart &part);
+ /**
+ * @brief Gets call duration as a text
+ * @param[in] time Time structure
+ * @return Call duration string
+ */
+ ucl::TString getCallDurationTxt(const struct tm &time);
+ /**
+ * @brief Replaces selected substring in string text
+ * @param[in] str String text to modify
+ * @param[in] from Text to replaces
+ * @param[in] to Text to replace on
+ */
void replaceSubstringInString(std::string &str,
const std::string &from, const std::string &to);
- ucl::Result isLTRCharacterOrientation(const std::string &lang);
+ /**
+ * @brief Checks whether locale is LRT character orientation
+ * @param[in] locale Locale to check
+ * @return RES_OK - if local is LRT oriented,
+ * RES_FALSE - if not,
+ * other result on error
+ */
+ ucl::Result isLTRCharacterOrientation(const std::string &locale);
- std::string encloseBidirectionalText(const std::string &txt, BidiTextEncoseType type);
+ /**
+ * @brief Encloses text with selected bidirectional symbols
+ * @param[in] txt Text to modify
+ * @param[in] type Type of bidirectional symbols to enclose with
+ * @return Enclosed string
+ */
+ std::string encloseBidirectionalText(const std::string &txt, BidiTextEncloseType type);
- std::string encloseBidirectionalText(std::string &&txt, BidiTextEncoseType type);
+ /**
+ * @brief Encloses text with selected bidirectional symbols
+ * @param[in] txt Text to modify
+ * @param[in] type Type of bidirectional symbols to enclose with
+ * @return Enclosed string
+ */
+ std::string encloseBidirectionalText(std::string &&txt, BidiTextEncloseType type);
}
#endif // __CALL_UI_PRESENTERS_MISC_HELPERS_H__
namespace callui {
+ /**
+ * @brief Enumeration of Call modes
+ */
enum class CallMode {
- UNDEFINED,
- INCOMING,
- OUTGOING,
- DURING,
- END
+ UNDEFINED, /**< Undefined */
+ INCOMING, /**< Incoming */
+ OUTGOING, /**< Outgoing */
+ DURING, /**< During */
+ END /**< End */
};
}
UCL_DECLARE_REF_ALIASES(KeypadPage);
+ /**
+ * @brief Presenter of Keypad page
+ */
class KeypadPage final : public Page {
public:
+
+ /**
+ * @brief KeypadPage builder
+ */
class Builder {
public:
+
+ /**
+ * @brief Constructor
+ */
Builder();
+
+ /**
+ * @brief Sets Naviframe instance
+ * @param[in] navi Naviframe instance
+ * @return Reference to builder
+ */
Builder &setNaviframe(const ucl::NaviframeSRef &navi);
+
+ /**
+ * @brief Sets Sound Manager instance
+ * @param[in] navi Sound Manager instance
+ * @return Reference to builder
+ */
Builder &setSoundManager(const ISoundManagerSRef &sm);
+
+ /**
+ * @brief Creates new instance of KeypadPage
+ * @param[in] onExitRequest Page exit request event handler
+ * @return Shared reference to KeypadPage instance
+ * on success or NULL otherwise
+ */
KeypadPageSRef build(const ExitRequestHandler onExitRequest) const;
private:
ISoundManagerSRef m_sm;
{
}
- MainPage::Builder::~Builder()
- {
- }
-
MainPage::Builder &MainPage::Builder::setNaviframe(
const NaviframeSRef &navi)
{
}
MainPageSRef MainPage::Builder::build(
- const ExitRequestHandler handler) const
+ const ExitRequestHandler onExitRequest) const
{
- if (!handler) {
+ if (!onExitRequest) {
LOG_RETURN_VALUE(RES_INVALID_ARGUMENTS, {},
"onExitRequest is NULL");
}
}
auto result = makeShared<MainPage>(
- m_navi, handler, m_call);
+ m_navi, onExitRequest, m_call);
FAIL_RETURN_VALUE(result->prepare([&result](NaviItem &item)
{
MainPage::MainPage(IRefCountObj &rc,
const NaviframeSRef &navi,
- const ExitRequestHandler handler,
+ const ExitRequestHandler onExitRequest,
const ICallUISRef &call) :
- Page(rc, navi, handler),
+ Page(rc, navi, onExitRequest),
m_call(call),
m_mode(CallMode::UNDEFINED),
m_ecTimer(nullptr),
}
if (m_indicator) {
- m_indicator->udapteIncomingCallMode(true);
+ m_indicator->setIncomingCallMode(true);
}
return RES_OK;
Result MainPage::processEndCallMode()
{
if (m_indicator) {
- m_indicator->udapteIncomingCallMode(false);
+ m_indicator->setIncomingCallMode(false);
}
FAIL_RETURN(createAccessoryPresenter(),
m_rmCueAo.reset();
if (m_indicator) {
- m_indicator->udapteIncomingCallMode(false);
+ m_indicator->setIncomingCallMode(false);
}
FAIL_RETURN(createAccessoryPresenter(),
UCL_DECLARE_REF_ALIASES(MainPage);
+ /**
+ * @brief Presenter of Main page
+ */
class MainPage final : public Page,
public ICallListener {
public:
+
+ /**
+ * @brief MainPage builder
+ */
class Builder {
public:
+
+ /**
+ * @brief Constructor
+ */
Builder();
- ~Builder();
+
+ /**
+ * @brief Sets Naviframe instance
+ * @param[in] navi Naviframe instance
+ * @return Reference to builder
+ */
Builder &setNaviframe(const ucl::NaviframeSRef &navi);
+
+ /**
+ * @brief Sets CallUI instance
+ * @param[in] call CallUI instance
+ * @return Reference to builder
+ */
Builder &setCallUI(const ICallUISRef &call);
- MainPageSRef build(const ExitRequestHandler handler) const;
+
+ /**
+ * @brief Creates new instance of MainPage
+ * @param[in] onExitRequest Page exit request event handler
+ * @return Shared reference to MainPage instance
+ * on success or NULL otherwise
+ */
+ MainPageSRef build(const ExitRequestHandler onExitRequest) const;
private:
ucl::NaviframeSRef m_navi;
ICallUISRef m_call;
private:
MainPage(ucl::IRefCountObj &rc,
const ucl::NaviframeSRef &navi,
- const ExitRequestHandler handler,
+ const ExitRequestHandler onExitRequest,
const ICallUISRef &call);
~MainPage() = default;