From 6836606926a4386c2eab5159c6156644edbae96c Mon Sep 17 00:00:00 2001 From: Igor Olshevskyi Date: Fri, 22 Sep 2017 13:26:28 +0300 Subject: [PATCH] TizenRefApp-9411 [Call UI] Add doxygen documentation for Model implementation classes Change-Id: I3fe628c1d0a52530623e1b9d78e5813e87d052e4 --- call-ui/model/impl/ActiveCall.h | 30 +++++++ call-ui/model/impl/BatteryStateSource.h | 18 ++++ call-ui/model/impl/BluetoothManager.h | 38 +++++++++ call-ui/model/impl/CallClient.h | 19 +++++ call-ui/model/impl/CallInfo.h | 49 +++++++++++ call-ui/model/impl/CallManager.cpp | 5 +- call-ui/model/impl/CallManager.h | 82 ++++++++++++++++++- call-ui/model/impl/CallUI.cpp | 7 +- call-ui/model/impl/CallUI.h | 30 +++++++ call-ui/model/impl/ConferenceCallInfo.h | 23 ++++++ call-ui/model/impl/ConnectionStateSource.h | 17 ++++ call-ui/model/impl/ContactInfo.h | 25 ++++++ call-ui/model/impl/ContactInfoProvider.h | 15 ++++ call-ui/model/impl/EndCall.h | 19 +++++ call-ui/model/impl/HdVoiceStateSource.cpp | 2 +- call-ui/model/impl/HdVoiceStateSource.h | 25 +++++- call-ui/model/impl/HeldCall.h | 35 ++++++++ call-ui/model/impl/ICallManagerListener.h | 14 ++++ call-ui/model/impl/IIndicatorStateSource.h | 14 ++++ call-ui/model/impl/IncomingCall.h | 35 ++++++++ call-ui/model/impl/IndicatorStateProvider.h | 23 ++++++ call-ui/model/impl/MsgClient.h | 19 +++++ call-ui/model/impl/RejectMsg.h | 26 +++++- call-ui/model/impl/RejectMsgProvider.h | 17 ++++ call-ui/model/impl/RssiStateSource.h | 18 ++++ call-ui/model/impl/SimSlotStateSource.cpp | 2 +- call-ui/model/impl/SimSlotStateSource.h | 28 ++++++- call-ui/model/impl/SoundManager.h | 82 +++++++++++++++++++ .../model/impl/VoiceControlStateProvider.h | 24 ++++++ call-ui/model/impl/VoiceControlStateSource.h | 19 +++++ call-ui/model/impl/helpers.h | 58 +++++++++++-- call-ui/model/impl/helpers.hpp | 9 +- 32 files changed, 809 insertions(+), 18 deletions(-) diff --git a/call-ui/model/impl/ActiveCall.h b/call-ui/model/impl/ActiveCall.h index 834b16b..9b644b7 100644 --- a/call-ui/model/impl/ActiveCall.h +++ b/call-ui/model/impl/ActiveCall.h @@ -32,17 +32,47 @@ namespace callui { UCL_DECLARE_REF_ALIASES(ActiveCall); + /** + * @brief Represents implementation of IActiveCall interface + * @see IActiveCall + */ class ActiveCall final : public IActiveCall { public: + + /** + * @brief Creates new instance of ActiveCall + * @param[in] cm Weak reference to CallManager + * @param[in] callData The platform Call Manager Call data handle + * @return Shared reference to ActiveCall + */ static ActiveCallSRef newInstance(CallManagerWRef cm, cm_call_data_h callData); // IActiveCall // + /** + * @see IActiveCall::getInfo() + */ virtual ICallInfoSCRef getInfo() const override final; + + /** + * @see IActiveCall::isDialingMode() + */ virtual bool isDialingMode() const override final; + + /** + * @see IActiveCall::hold() + */ virtual ucl::Result hold() override final; + + /** + * @see IActiveCall::end() + */ virtual ucl::Result end() override final; + + /** + * @see IActiveCall::split() + */ virtual ucl::Result split( const IConferenceCallInfoSCRef &confCallInfo) override final; diff --git a/call-ui/model/impl/BatteryStateSource.h b/call-ui/model/impl/BatteryStateSource.h index 53c5e21..9a5f06b 100644 --- a/call-ui/model/impl/BatteryStateSource.h +++ b/call-ui/model/impl/BatteryStateSource.h @@ -27,13 +27,31 @@ namespace callui { UCL_DECLARE_REF_ALIASES(BatteryStateSource); + /** + * @brief Represents Battery state source for IndicatorStateProvider + * Inherits from IIndicatorStateSource + * @see IIndicatorStateSource + */ class BatteryStateSource final : public IIndicatorStateSource { public: + + /** + * @brief Creates new instance of BatteryStateSource + * @return Shared reference to BatteryStateSource instance on success + * or NULL otherwise + */ static BatteryStateSourceSRef newInstance(); // IIndicatorStateSource // + /** + * @see IIndicatorStateSource::getState() + */ virtual IndicatorState getState() const override final; + + /** + * @see IIndicatorStateSource::setStateChangeHandler() + */ virtual void setStateChangeHandler( const NotiHandler &handler) override final; diff --git a/call-ui/model/impl/BluetoothManager.h b/call-ui/model/impl/BluetoothManager.h index 3380521..b1b69dc 100644 --- a/call-ui/model/impl/BluetoothManager.h +++ b/call-ui/model/impl/BluetoothManager.h @@ -25,17 +25,55 @@ namespace callui { UCL_DECLARE_REF_ALIASES(BluetoothManager); + /** + * @brief Represents Bluetooth headset manager to operate + * Headset connected devices + */ class BluetoothManager final { public: + + /** + * @brief Creates new instance of BluetoothManager + * @return Shared reference to BluetoothManager instance on success + * or NULL otherwise + */ static BluetoothManagerSRef newInstance(); + /** + * @brief Gets volume level of connected BT headset device + * @return Volume level + */ int getVolume() const; + + /** + * @brief Gets max volume level of connected BT headset device + * @return Max volume level + */ int getMaxVolume() const; + + /** + * @brief Gets max volume level of connected BT headset device + * @param[in] volume Volume level to set + * @return RES_OK on success or another result otherwise + */ ucl::Result setVolume(int volume); + /** + * @brief Sets handler for monitoring volume state change + * @param[in] handler Handler to set + */ void setVolumeStateHandler(const NotiHandler &handler); + /** + * @brief Checks whether headset device is connected + * @return true if headset device is connected, false + */ bool isHeadsetConnected() const; + + /** + * @brief Sets handler for monitoring headset connection change + * @return true if headset device is connected, false + */ void setHeadsetConnectionChangeHandler(const NotiHandler &handler); private: diff --git a/call-ui/model/impl/CallClient.h b/call-ui/model/impl/CallClient.h index 3b926e2..415753f 100644 --- a/call-ui/model/impl/CallClient.h +++ b/call-ui/model/impl/CallClient.h @@ -25,10 +25,29 @@ namespace callui { UCL_DECLARE_REF_ALIASES(CallClient); + /** + * @brief Represents wrapper on platform Call Manager handle + */ class CallClient { public: + + /** + * @brief Creates new instance of CallClient + * @return Shared reference to CallClient instance on success + * or NULL otherwise + */ static CallClientSRef newInstance(); + + /** + * @brief Gets platform Call Manager handle + * @return Platform Call Manager handle on success + * or NULL otherwise + */ cm_client_h getCmClient() const; + + /** + * @brief Operator cm_client_h + */ operator cm_client_h() const; private: diff --git a/call-ui/model/impl/CallInfo.h b/call-ui/model/impl/CallInfo.h index 0042bd2..cb40295 100644 --- a/call-ui/model/impl/CallInfo.h +++ b/call-ui/model/impl/CallInfo.h @@ -31,23 +31,72 @@ namespace callui { UCL_DECLARE_REF_ALIASES(CallInfo); + /** + * @brief Represents implementation of ICallInfo interface + * @see ICallInfo + */ class CallInfo final : public ICallInfo { public: + + /** + * @brief Creates new instance of CallInfo + * @return Shared reference to CallInfo instance on success + * or NULL otherwise + */ static CallInfoSRef newInstance(CallClient &client, cm_call_data_h callData, ContactInfoProviderSRef callInfoProvider); // ICallInfo // + /** + * @see ICallInfo::getCallId() + */ virtual unsigned int getCallId() const override final; + + /** + * @see ICallInfo::getPhoneNumber() + */ virtual const std::string &getPhoneNumber() const override final; + + /** + * @see ICallInfo::getContactInfo() + */ virtual IContactInfoSCRef getContactInfo() const override final; + + /** + * @see ICallInfo::getDuration() + */ virtual struct tm getDuration() const override final; + + /** + * @see ICallInfo::isEmergency() + */ virtual bool isEmergency() const override final; + + /** + * @see ICallInfo::isHDVoice() + */ virtual bool isHDVoice() const override final; + + /** + * @see ICallInfo::isForwarded() + */ virtual bool isForwarded() const override final; + + /** + * @see ICallInfo::isVoiceMailNumber() + */ virtual bool isVoiceMailNumber() const override final; + + /** + * @see ICallInfo::getConferenceMemberCount() + */ virtual int getConferenceMemberCount() const override final; + + /** + * @see ICallInfo::getConferenceMemberList() + */ virtual const ConfMemberList &getConferenceMemberList() const override final; private: diff --git a/call-ui/model/impl/CallManager.cpp b/call-ui/model/impl/CallManager.cpp index f931f3e..194a6eb 100644 --- a/call-ui/model/impl/CallManager.cpp +++ b/call-ui/model/impl/CallManager.cpp @@ -200,7 +200,8 @@ namespace callui { LOG_RETURN(RES_FAIL, "Not a member of conference call"); } - return endCall((*iter)->getCallId(), CallReleaseType::BY_CALL_HANDLE); + return convertCMResult( + cm_split_call(*m_callClient, (*iter)->getCallId())); } ContactInfoProviderSRef CallManager::getContactInfoProvider() @@ -405,7 +406,7 @@ namespace callui { return dialVoiceCall(telNum); } - Result CallManager::processIncomingCall(SimSlot slot) + Result CallManager::processIncomingCall() { if (m_incomingCall) { if (m_slot == SimSlot::UNDEFINED) { diff --git a/call-ui/model/impl/CallManager.h b/call-ui/model/impl/CallManager.h index f4acbf2..1910ff9 100644 --- a/call-ui/model/impl/CallManager.h +++ b/call-ui/model/impl/CallManager.h @@ -35,31 +35,111 @@ namespace callui { UCL_DECLARE_REF_ALIASES(CallManager); + /** + * @brief Represents implementation of ICallManager interface + * @see ICallManager + */ class CallManager final : public ucl::RefCountAware, public ICallManager { public: + + /** + * @brief Creates new instance of CallManager + * @param[in] callClient Call client + * @param[in] listener Call Manager listener + * @return Shared reference to CallManager instance on success + * or NULL otherwise + */ static CallManagerSRef newInstance(const CallClientSRef &callClient, ICallManagerListenerWRef listener); + /** + * @brief Gets call client + * @return Reference on CallManager instance + */ CallClient &getCallClient(); + + /** + * @brief Gets active call Sim slot + * @return Sim slot + */ SimSlot getSimSlot() const; + + /** + * @brief Dials provided number for a voice call + * @param[in] number Telephone number to dial + * @return RES_OK on success or another result otherwise + */ ucl::Result dialVoiceCall(const std::string &number); + + /** + * @brief Ends call + * @param[in] callId Call ID to end + * @param[in] type Call release type + * @return RES_OK on success or another result otherwise + */ ucl::Result endCall(unsigned int callId, CallReleaseType type); + + /** + * @brief Splits selected conference call + * @param[in] callInfo Call info of a conference call + * @param[in] confCallInfo Call info of a call that must be split + * @return RES_OK on success or another result otherwise + */ ucl::Result splitCalls(CallInfoSRef callInfo, const IConferenceCallInfoSCRef &confCallInfo); + + /** + * @brief Gets contact info provider + * @return Shared reference to ContactInfoProvider instance + */ ContactInfoProviderSRef getContactInfoProvider(); + + /** + * @brief Gets reject message provider + * @return Shared reference to RejectMsgProvider instance + */ RejectMsgProviderSRef getRejectMsgProvider(); + /** + * @brief Processes outgoing call request + * @param[in] telNum Telephone number for outgoing call + * @return RES_OK on success or another result otherwise + */ ucl::Result processOutgoingCall(const std::string &telNum); - ucl::Result processIncomingCall(SimSlot slot); + + /** + * @brief Processes incoming call request + * @return RES_OK on success or another result otherwise + */ + ucl::Result processIncomingCall(); // ICallManager // + /* + * @see ICallManager::getIncomingCall() + */ virtual IIncomingCallSRef getIncomingCall() override final; + + /* + * @see ICallManager::getActiveCall() + */ virtual IActiveCallSRef getActiveCall() override final; + + /* + * @see ICallManager::getHeldCall() + */ virtual IHeldCallSRef getHeldCall() override final; + + /* + * @see ICallManager::getEndCall() + */ virtual IEndCallSRef getEndCall() override final; + + /* + * @see ICallManager::getAvailableCalls() + */ virtual CallMask getAvailableCalls() const override final; private: diff --git a/call-ui/model/impl/CallUI.cpp b/call-ui/model/impl/CallUI.cpp index b6cc912..17f42fb 100644 --- a/call-ui/model/impl/CallUI.cpp +++ b/call-ui/model/impl/CallUI.cpp @@ -89,8 +89,7 @@ namespace callui { DLOG("Sim slot [%s]", tmp); free(tmp); - ret = m_callManager->processIncomingCall( - convertCMSimSlot(static_cast(atoi(tmp)))); + ret = m_callManager->processIncomingCall(); } else { tmp = static_cast(uri + 4); @@ -254,12 +253,12 @@ namespace callui { void CallUI::updateHdVoiceStateSource() { - m_hdCallStSrc->updateState(getHDVoiceStatus()); + m_hdCallStSrc->setState(getHDVoiceStatus()); } void CallUI::updateSimSlotStateSource() { - m_simSlotStSrc->updateSimSlot(m_callManager->getSimSlot(), + m_simSlotStSrc->setSimSlot(m_callManager->getSimSlot(), getForwardedCallStatus()); } diff --git a/call-ui/model/impl/CallUI.h b/call-ui/model/impl/CallUI.h index 554f403..8114f82 100644 --- a/call-ui/model/impl/CallUI.h +++ b/call-ui/model/impl/CallUI.h @@ -37,6 +37,10 @@ namespace callui { UCL_DECLARE_REF_ALIASES(CallUI); + /** + * @brief Represents implementation of ICallUI interface + * @see ICallUI + */ class CallUI final : public ucl::RefCountAware, public ICallUI, @@ -45,15 +49,41 @@ namespace callui { // ICallUI // + /** + * @see ICallUI::setListener() + */ virtual void setListener(const ICallListenerWRef &listener) override final; + + /** + * @see ICallUI::processAppControl() + */ virtual ucl::Result processAppControl(app_control_h appControl) override final; + + /** + * @see ICallUI::getSoundManager() + */ virtual ISoundManagerSRef getSoundManager() override final; + + /** + * @see ICallUI::getCallManager() + */ virtual ICallManagerSRef getCallManager() override final; + + /** + * @see ICallUI::getIndicatorStateProvider() + */ virtual IIndicatorStateProviderSRef getIndicatorStateProvider() override final; // ICallManagerListener // + /** + * @see ICallManagerListener::onCallEvent() + */ virtual void onCallEvent(CallEventType type) override final; + + /** + * @see ICallManagerListener::onError() + */ virtual void onError(CallManagerErr err) override final; private: diff --git a/call-ui/model/impl/ConferenceCallInfo.h b/call-ui/model/impl/ConferenceCallInfo.h index 42dbc9b..84e8f12 100644 --- a/call-ui/model/impl/ConferenceCallInfo.h +++ b/call-ui/model/impl/ConferenceCallInfo.h @@ -29,16 +29,39 @@ namespace callui { UCL_DECLARE_REF_ALIASES(ConferenceCallInfo); + /** + * @brief Represents implementation of IConferenceCallInfo interface + * @see IConferenceCallInfo + */ class ConferenceCallInfo final : public IConferenceCallInfo { public: + + /** + * @brief Creates new instance of ConferenceCallInfo + * @param[in] confCallData Native Call Manager conference call handler + * @param[in] callInfoProvider Contact info provider + * @return Shared reference to ConferenceCallInfo instance on success + * or NULL otherwise + */ static ConferenceCallInfoSRef newInstance( cm_conf_call_data_t *confCallData, ContactInfoProviderSRef callInfoProvider); // IConferenceCallInfo // + /** + * @see IConferenceCallInfo::getCallId() + */ virtual unsigned int getCallId() const override final; + + /** + * @see IConferenceCallInfo::getPhoneNumber() + */ virtual const std::string &getPhoneNumber() const override final; + + /** + * @see IConferenceCallInfo::getContactInfo() + */ virtual IContactInfoSCRef getContactInfo() const override final; private: diff --git a/call-ui/model/impl/ConnectionStateSource.h b/call-ui/model/impl/ConnectionStateSource.h index 18af9d2..053d03f 100644 --- a/call-ui/model/impl/ConnectionStateSource.h +++ b/call-ui/model/impl/ConnectionStateSource.h @@ -27,13 +27,30 @@ namespace callui { UCL_DECLARE_REF_ALIASES(ConnectionStateSource); + /** + * @brief Represents Connection state source for IndicatorStateProvider + * @see IIndicatorStateSource + */ class ConnectionStateSource final : public IIndicatorStateSource { public: + + /** + * @brief Creates new instance of ConnectionStateSource + * @return Shared reference to ConnectionStateSource instance on success + * or NULL otherwise + */ static ConnectionStateSourceSRef newInstance(); // IIndicatorStateSource // + /** + * @see IIndicatorStateSource::getState() + */ virtual IndicatorState getState() const override final; + + /** + * @see IIndicatorStateSource::setStateChangeHandler() + */ virtual void setStateChangeHandler(const NotiHandler &handler) override final; private: diff --git a/call-ui/model/impl/ContactInfo.h b/call-ui/model/impl/ContactInfo.h index 3515e35..064bbf5 100644 --- a/call-ui/model/impl/ContactInfo.h +++ b/call-ui/model/impl/ContactInfo.h @@ -27,8 +27,22 @@ namespace callui { UCL_DECLARE_REF_ALIASES(ContactInfo); + /** + * @brief Represents implementation of IContactInfo interface + * @see IContactInfo + */ class ContactInfo final : public IContactInfo { public: + + /** + * @brief Creates new instance of ContactInfo + * @param[in] personId Contact database person ID + * @param[in] name Contact name + * @param[in] imagePath Path to contact image + * @param[in] type Contact name source type + * @return Shared reference to ContactInfo instance on success + * or NULL otherwise + */ static ContactInfoSRef newInstance(int personId, const std::string &name, const std::string &imagePath, @@ -36,8 +50,19 @@ namespace callui { // IContactInfo // + /** + * @see IContactInfo::getName() + */ virtual const std::string &getName() const override final; + + /** + * @see IContactInfo::getImagePath() + */ virtual const std::string &getImagePath() const override final; + + /** + * @see IContactInfo::getNameSourceType() + */ virtual ContactNameSourceType getNameSourceType() const override final; private: diff --git a/call-ui/model/impl/ContactInfoProvider.h b/call-ui/model/impl/ContactInfoProvider.h index e248642..4d3d3c9 100644 --- a/call-ui/model/impl/ContactInfoProvider.h +++ b/call-ui/model/impl/ContactInfoProvider.h @@ -25,10 +25,25 @@ namespace callui { UCL_DECLARE_REF_ALIASES(ContactInfoProvider); + /** + * @brief Represents Contact info provider + */ class ContactInfoProvider { public: + + /** + * @brief Creates new instance of ContactInfoProvider + * @return Shared reference to ContactInfoProvider instance on success + * or NULL otherwise + */ static ContactInfoProviderSRef newInstance(); + /** + * @brief Creates new instance of ContactInfo + * @param[in] contactId Id of the caller in Contact database + * @return Shared reference to ContactInfo instance on success + * or NULL otherwise + */ ContactInfoSRef createContactInfo(int contactId); private: diff --git a/call-ui/model/impl/EndCall.h b/call-ui/model/impl/EndCall.h index 1203bc7..925db90 100644 --- a/call-ui/model/impl/EndCall.h +++ b/call-ui/model/impl/EndCall.h @@ -29,13 +29,32 @@ namespace callui { UCL_DECLARE_REF_ALIASES(EndCall); + /** + * @brief Implementation of IEndCall interface + * @see IEndCall + */ class EndCall final : public IEndCall { public: + + /** + * @brief Creates new instance of EndCall + * @param[in] cm Weak reference to CallManager + * @param[in] callInfo Call info of the last ended call + * @return Shared reference to EndCall on success + * or NULL otherwise + */ static EndCallSRef newInstance(CallManagerWRef cm, ICallInfoSCRef callInfo); // IEndCall // + /** + * @see IEndCall::getInfo() + */ virtual ICallInfoSCRef getInfo() const override final; + + /** + * @see IEndCall::callBack() + */ virtual ucl::Result callBack() override final; private: diff --git a/call-ui/model/impl/HdVoiceStateSource.cpp b/call-ui/model/impl/HdVoiceStateSource.cpp index 633210a..a8c2019 100644 --- a/call-ui/model/impl/HdVoiceStateSource.cpp +++ b/call-ui/model/impl/HdVoiceStateSource.cpp @@ -42,7 +42,7 @@ namespace callui { m_bits.isEnable = isEnable; } - void HdVoiceStateSource::updateState(bool isEnable) + void HdVoiceStateSource::setState(bool isEnable) { if (m_bits.isEnable != isEnable) { m_bits.isEnable = isEnable; diff --git a/call-ui/model/impl/HdVoiceStateSource.h b/call-ui/model/impl/HdVoiceStateSource.h index deea001..218b977 100644 --- a/call-ui/model/impl/HdVoiceStateSource.h +++ b/call-ui/model/impl/HdVoiceStateSource.h @@ -23,14 +23,37 @@ namespace callui { UCL_DECLARE_REF_ALIASES(HdVoiceStateSource); + /** + * @brief Represents HD voice state source for IndicatorStateProvider + * Inherits from IIndicatorStateSource + * @see IIndicatorStateSource + */ class HdVoiceStateSource final : public IIndicatorStateSource { public: + + /** + * @brief Creates new instance of HdVoiceStateSource + * @return Shared reference to HdVoiceStateSource instance on success + * or NULL otherwise + */ static HdVoiceStateSourceSRef newInstance(bool isEnable); - void updateState(bool isEnable); + + /** + * @brief Sets HD voice state + * @param[in] isEnable State of HD voice + */ + void setState(bool isEnable); // IIndicatorStateSource // + /** + * @see IIndicatorStateSource::getState() + */ virtual IndicatorState getState() const override final; + + /** + * @see IIndicatorStateSource::setStateChangeHandler() + */ virtual void setStateChangeHandler(const NotiHandler &handler) override final; private: diff --git a/call-ui/model/impl/HeldCall.h b/call-ui/model/impl/HeldCall.h index 64d54f8..f03cb85 100644 --- a/call-ui/model/impl/HeldCall.h +++ b/call-ui/model/impl/HeldCall.h @@ -30,18 +30,53 @@ namespace callui { UCL_DECLARE_REF_ALIASES(HeldCall); + /** + * @brief Implementation of IHeldCall interface + * @see IHeldCall + */ class HeldCall final : public IHeldCall { public: + + /** + * @brief Creates new instance of HeldCall + * @param[in] cm Weak reference to CallManager + * @param[in] callData The platform Call Manager Call data handle + * @return Shared reference to HeldCall on success + * or NULL otherwise + */ static HeldCallSRef newInstance(CallManagerWRef cm, cm_call_data_h callData); // IHeldCall // + /** + * @see IHeldCall::getInfo() + */ virtual ICallInfoSCRef getInfo() const override final; + + /** + * @see IHeldCall::unhold() + */ virtual ucl::Result unhold() override final; + + /** + * @see IHeldCall::joinWithActive() + */ virtual ucl::Result joinWithActive() override final; + + /** + * @see IHeldCall::swapWithActive() + */ virtual ucl::Result swapWithActive() override final; + + /** + * @see IHeldCall::end() + */ virtual ucl::Result end() override final; + + /** + * @see IHeldCall::split() + */ virtual ucl::Result split( const IConferenceCallInfoSCRef &confCallInfo) override final; diff --git a/call-ui/model/impl/ICallManagerListener.h b/call-ui/model/impl/ICallManagerListener.h index 892e650..b5ece70 100644 --- a/call-ui/model/impl/ICallManagerListener.h +++ b/call-ui/model/impl/ICallManagerListener.h @@ -23,9 +23,23 @@ namespace callui { UCL_DECLARE_REF_ALIASES(ICallManagerListener); + /** + * @brief Represents Call Manager listener interface. + * Uses for get notifications from Call Manager about changes + */ class ICallManagerListener : protected ucl::NonCopyable { public: + + /** + * @brief Called on Call Manager call event + * @param[in] type Call event type + */ virtual void onCallEvent(CallEventType type) = 0; + + /** + * @brief Called on Call Manager error + * @param[in] err Error type + */ virtual void onError(CallManagerErr err) = 0; protected: diff --git a/call-ui/model/impl/IIndicatorStateSource.h b/call-ui/model/impl/IIndicatorStateSource.h index 1aa894c..3869db8 100644 --- a/call-ui/model/impl/IIndicatorStateSource.h +++ b/call-ui/model/impl/IIndicatorStateSource.h @@ -25,9 +25,23 @@ namespace callui { UCL_DECLARE_REF_ALIASES(IIndicatorStateSource); + /** + * @brief Represents Indicator state source interface. + * Provides API to get value and notification about indicator state + */ class IIndicatorStateSource : protected ucl::NonCopyable { public: + + /** + * @brief Gets state + * @return Indicator state instance + */ virtual IndicatorState getState() const = 0; + + /** + * @brief Sets state change handler + * @param[in] handler Handler to be set + */ virtual void setStateChangeHandler(const NotiHandler &handler) = 0; protected: diff --git a/call-ui/model/impl/IncomingCall.h b/call-ui/model/impl/IncomingCall.h index 72f4e14..839d737 100644 --- a/call-ui/model/impl/IncomingCall.h +++ b/call-ui/model/impl/IncomingCall.h @@ -30,17 +30,52 @@ namespace callui { UCL_DECLARE_REF_ALIASES(IncomingCall); + /** + * @brief Implementation of IIncomingCall interface + * @see IIncomingCall + */ class IncomingCall final : public IIncomingCall { public: + + /** + * @brief Creates new instance of IncomingCall + * @param[in] cm Weak reference to CallManager + * @param[in] callData The platform Call Manager Call data handle + * @return Shared reference to IncomingCall on success + * or NULL otherwise + */ static IncomingCallSRef newInstance(CallManagerWRef cm, cm_call_data_h callData); // IIncomingCall // + /* + * @see IIncomingCall::getInfo() + */ virtual ICallInfoSCRef getInfo() const override final; + + /* + * @see IIncomingCall::getRejectMsgProvider() + */ virtual IRejectMsgProviderSRef getRejectMsgProvider() const override final; + + /* + * @see IIncomingCall::answer() + */ virtual ucl::Result answer(CallAnswerType type) override final; + + /* + * @see IIncomingCall::reject() + */ virtual ucl::Result reject() override final; + + /* + * @see IIncomingCall::rejectWithMessage() + */ virtual ucl::Result rejectWithMessage(IRejectMsgSRef message) override final; + + /* + * @see IIncomingCall::stopAlert() + */ virtual ucl::Result stopAlert() override final; private: diff --git a/call-ui/model/impl/IndicatorStateProvider.h b/call-ui/model/impl/IndicatorStateProvider.h index 724fdf8..30b27a7 100644 --- a/call-ui/model/impl/IndicatorStateProvider.h +++ b/call-ui/model/impl/IndicatorStateProvider.h @@ -27,16 +27,39 @@ namespace callui { UCL_DECLARE_REF_ALIASES(IndicatorStateProvider); + /** + * @brief Implementation of IIndicatorStateProvider interface + * @see IIncomingCall + */ class IndicatorStateProvider final: public IIndicatorStateProvider { public: + + /** + * @brief Creates new instance of IndicatorStateProvider + * @return Shared reference to IndicatorStateProvider on success + * or NULL otherwise + */ static IndicatorStateProviderSRef newInstance(); + /** + * @brief Sets state source + * @param[in] property Property type to set + * @param[in] source State source to set in accordance to property type + * @return RES_OK on success or another result otherwise + */ ucl::Result setStateSource(IndicatorProperty property, IIndicatorStateSourceSRef source); // IIndicatorStateProvider // + /** + * @see IIndicatorStateProvider::getState() + */ virtual IndicatorState getState(IndicatorProperty property) const override final; + + /** + * @see IIndicatorStateProvider::setListener() + */ virtual void setListener(IIndicatorStateListenerWRef listener) override final; private: diff --git a/call-ui/model/impl/MsgClient.h b/call-ui/model/impl/MsgClient.h index 96a0b03..2ab153c 100644 --- a/call-ui/model/impl/MsgClient.h +++ b/call-ui/model/impl/MsgClient.h @@ -25,10 +25,29 @@ namespace callui { UCL_DECLARE_REF_ALIASES(MsgClient); + /** + * @brief Represents wrapper on platform Message handle + */ class MsgClient { public: + + /** + * @brief Creates new instance of MsgClient + * @return Shared reference to MsgClient instance on success + * or NULL otherwise + */ static MsgClientSRef newInstance(); + + /** + * @brief Gets platform Message handle + * @return Platform Message handle on success + * or NULL otherwise + */ msg_handle_t getMsgHandle() const; + + /** + * @brief Operator msg_handle_t + */ operator msg_handle_t() const; private: diff --git a/call-ui/model/impl/RejectMsg.h b/call-ui/model/impl/RejectMsg.h index b8f317f..617f5b1 100644 --- a/call-ui/model/impl/RejectMsg.h +++ b/call-ui/model/impl/RejectMsg.h @@ -29,12 +29,36 @@ namespace callui { UCL_DECLARE_REF_ALIASES(RejectMsg); + /** + * @brief Implementation of IRejectMsg interface + * @see IRejectMsg + */ class RejectMsg : public IRejectMsg { public: - static RejectMsgSRef newInstance(MsgClientWRef client, const ucl::TString &string); + + /** + * @brief Creates new instance of RejectMsg + * @param[in] client Message client instance + * @param[in] string Message text + * @return Shared reference to RejectMsg on success + * or NULL otherwise + */ + static RejectMsgSRef newInstance(MsgClientWRef client, + const ucl::TString &string); + + /** + * @brief Sends reject message + * @param[in] number Sending number + * @param[in] slot Sim slot to send from + * @return RES_OK on success or another result otherwise + */ ucl::Result send(const std::string &number, SimSlot slot); // IRejectMsg // + + /** + * @see IRejectMsg::getText() + */ std::string getText() const override final; private: diff --git a/call-ui/model/impl/RejectMsgProvider.h b/call-ui/model/impl/RejectMsgProvider.h index 86d663f..0747a42 100644 --- a/call-ui/model/impl/RejectMsgProvider.h +++ b/call-ui/model/impl/RejectMsgProvider.h @@ -27,13 +27,30 @@ namespace callui { UCL_DECLARE_REF_ALIASES(RejectMsgProvider); + /** + * @brief Implementation of IRejectMsgProvider interface + * @see IRejectMsgProvider + */ class RejectMsgProvider : public IRejectMsgProvider { public: + + /** + * @brief Creates new instance of RejectMsgProvider + * @return Shared reference to RejectMsgProvider on success + * or NULL otherwise + */ static RejectMsgProviderSRef newInstance(); // IRejectMsgProvider // + /** + * @see IRejectMsgProvider::getMsgList() + */ virtual RejectMsgList getMsgList() const override final; + + /** + * @see IRejectMsgProvider::getMsgCount() + */ virtual int getMsgCount() const override final; private: diff --git a/call-ui/model/impl/RssiStateSource.h b/call-ui/model/impl/RssiStateSource.h index c4d3812..10761a8 100644 --- a/call-ui/model/impl/RssiStateSource.h +++ b/call-ui/model/impl/RssiStateSource.h @@ -27,13 +27,31 @@ namespace callui { UCL_DECLARE_REF_ALIASES(RssiStateSource); + /** + * @brief Represents RSSI state source for IndicatorStateProvider + * Inherits from IIndicatorStateSource + * @see IIndicatorStateSource + */ class RssiStateSource final : public IIndicatorStateSource { public: + + /** + * @brief Creates new instance of RssiStateSource + * @return Shared reference to RssiStateSource instance on success + * or NULL otherwise + */ static RssiStateSourceSRef newInstance(); // IIndicatorStateSource // + /** + * @see IIndicatorStateSource::getState() + */ virtual IndicatorState getState() const override final; + + /** + * @see IIndicatorStateSource::setStateChangeHandler() + */ virtual void setStateChangeHandler(const NotiHandler &handler) override final; private: diff --git a/call-ui/model/impl/SimSlotStateSource.cpp b/call-ui/model/impl/SimSlotStateSource.cpp index 5b89186..7cf7a73 100644 --- a/call-ui/model/impl/SimSlotStateSource.cpp +++ b/call-ui/model/impl/SimSlotStateSource.cpp @@ -48,7 +48,7 @@ namespace callui { return makeShared(slot, isForwarded); } - void SimSlotStateSource::updateSimSlot(SimSlot slot, bool isForwarded) + void SimSlotStateSource::setSimSlot(SimSlot slot, bool isForwarded) { int simSlotInt = convertEnumValueToInt(slot); bool needUpdate = false; diff --git a/call-ui/model/impl/SimSlotStateSource.h b/call-ui/model/impl/SimSlotStateSource.h index db7f380..bb3fa97 100644 --- a/call-ui/model/impl/SimSlotStateSource.h +++ b/call-ui/model/impl/SimSlotStateSource.h @@ -23,15 +23,41 @@ namespace callui { UCL_DECLARE_REF_ALIASES(SimSlotStateSource); + /** + * @brief Represents Sim slot source for IndicatorStateProvider + * Inherits from IIndicatorStateSource + * @see IIndicatorStateSource + */ class SimSlotStateSource final : public IIndicatorStateSource { public: + + /** + * @brief Creates new instance of SimSlotStateSource + * @param[in] slot Sim slot type + * @param[in] isForwarded Is current call forwarded + * @return Shared reference to SimSlotStateSource instance on success + * or NULL otherwise + */ static SimSlotStateSourceSRef newInstance(SimSlot slot, bool isForwarded); - void updateSimSlot(SimSlot slot, bool isForwarded); + + /** + * @brief Sets Sim slot type + * @param[in] slot Sim slot type + * @param[in] isForwarded Is current call forwarded + */ + void setSimSlot(SimSlot slot, bool isForwarded); // IIndicatorStateSource // + /** + * @see IIndicatorStateSource::getState() + */ virtual IndicatorState getState() const override final; + + /** + * @see IIndicatorStateSource::setStateChangeHandler() + */ virtual void setStateChangeHandler( const NotiHandler &handler) override final; diff --git a/call-ui/model/impl/SoundManager.h b/call-ui/model/impl/SoundManager.h index f70c427..0f3223b 100644 --- a/call-ui/model/impl/SoundManager.h +++ b/call-ui/model/impl/SoundManager.h @@ -31,49 +31,131 @@ namespace callui { UCL_DECLARE_REF_ALIASES(SoundManager); + /** + * @brief Implementation of ISoundManager interface + * @see ISoundManager + */ class SoundManager final : public ucl::RefCountAware, public ISoundManager { public: + + /** + * @brief Creates new instance of SoundManager + * @param[in] client Call client instance + * @return Shared reference to SoundManager on success + * or NULL otherwise + */ static SoundManagerSRef newInstance(const CallClientSRef &client); // ISoundManager // + /** + * @see ISoundManager::setSpeakerState() + */ virtual ucl::Result setSpeakerState(bool isEnable) override final; + + /** + * @see ISoundManager::setBluetoothState() + */ virtual ucl::Result setBluetoothState(bool isEnable) override final; + + /** + * @see ISoundManager::getAudioState() + */ virtual AudioStateType getAudioState() const override final; + /** + * @see ISoundManager::setMuteState() + */ virtual ucl::Result setMuteState(bool isEnable) override final; + + /** + * @see ISoundManager::getMuteState() + */ virtual bool getMuteState() const override final; + /** + * @see ISoundManager::startDtmf() + */ virtual ucl::Result startDtmf( const unsigned char dtmfDigit) override final; + + /** + * @see ISoundManager::stopDtmf() + */ virtual ucl::Result stopDtmf() override final; + /** + * @see ISoundManager::addAudioStateHandler() + */ virtual void addAudioStateHandler( NotiHandler handler) override final; + + /** + * @see ISoundManager::delAudioStateHandler() + */ virtual void delAudioStateHandler( const NotiHandler &handler) override final; + /** + * @see ISoundManager::addMuteStateHandler() + */ virtual void addMuteStateHandler( NotiHandler handler) override final; + + /** + * @see ISoundManager::delMuteStateHandler() + */ virtual void delMuteStateHandler( const NotiHandler &handler) override final; + /** + * @see ISoundManager::addVolumeStateHandler() + */ virtual void addVolumeStateHandler( NotiHandler handler) override final; + + /** + * @see ISoundManager::delVolumeStateHandler() + */ virtual void delVolumeStateHandler( const NotiHandler &handler) override final; + /** + * @see ISoundManager::getMaxVolume() + */ virtual int getMaxVolume() const override final; + + /** + * @see ISoundManager::getVolume() + */ virtual int getVolume() const override final; + + /** + * @see ISoundManager::setVolume() + */ virtual ucl::Result setVolume(int value) override final; + /** + * @see ISoundManager::isBTSupported() + */ virtual bool isBTSupported() const override final; + /** + * @see ISoundManager::isBTHeadsetConnected() + */ virtual bool isBTHeadsetConnected() const override final; + + /** + * @see ISoundManager::addBTHeadsetConnectionChangeHandler() + */ virtual void addBTHeadsetConnectionChangeHandler( NotiHandler handler) override final; + + /** + * @see ISoundManager::delBTHeadsetConnectionChangeHandler() + */ virtual void delBTHeadsetConnectionChangeHandler( const NotiHandler &handler) override final; diff --git a/call-ui/model/impl/VoiceControlStateProvider.h b/call-ui/model/impl/VoiceControlStateProvider.h index 0c034b5..bec63d5 100644 --- a/call-ui/model/impl/VoiceControlStateProvider.h +++ b/call-ui/model/impl/VoiceControlStateProvider.h @@ -25,12 +25,36 @@ namespace callui { UCL_DECLARE_REF_ALIASES(VoiceControlStateProvider); + /** + * @brief Voice control state provider. + * Provides state whether enable/disable voice control + */ class VoiceControlStateProvider final { public: + + /** + * @brief Creates new instance of VoiceControlStateProvider + * @return Shared reference to VoiceControlStateProvider + * instance on success or NULL otherwise + */ static VoiceControlStateProviderSRef newInstance(); + /** + * Gets state + * @return true if aVoice control is enable, false otherwise + */ bool getState() const; + + /** + * Adds state change handler + * @param[in] handler Handler to add + */ void addStateChangeHandler(const NotiHandler &handler); + + /** + * Removes state change handler + * @param[in] handler Handler to remove + */ void removeStateChangeHandler(const NotiHandler &handler); private: diff --git a/call-ui/model/impl/VoiceControlStateSource.h b/call-ui/model/impl/VoiceControlStateSource.h index 440a904..85b04d6 100644 --- a/call-ui/model/impl/VoiceControlStateSource.h +++ b/call-ui/model/impl/VoiceControlStateSource.h @@ -27,16 +27,35 @@ namespace callui { UCL_DECLARE_REF_ALIASES(VoiceControlStateSource); + /** + * @brief Represents Voice control state source for IndicatorStateProvider + * Inherits from IIndicatorStateSource + * @see IIndicatorStateSource + */ class VoiceControlStateSource final : public IIndicatorStateSource, public ucl::RefCountAware { public: + + /** + * @brief Creates new instance of VoiceControlStateSource + * @param[in] provider Voice control state provider + * @return Shared reference to VoiceControlStateSource + * instance on success or NULL otherwise + */ static VoiceControlStateSourceSRef newInstance( const VoiceControlStateProviderSRef &provider); // IIndicatorStateSource // + /** + * IIndicatorStateSource::getState() + */ virtual IndicatorState getState() const override final; + + /** + * IIndicatorStateSource::setStateChangeHandler() + */ virtual void setStateChangeHandler( const NotiHandler &handler) override final; diff --git a/call-ui/model/impl/helpers.h b/call-ui/model/impl/helpers.h index 7c631fb..fdf12e1 100644 --- a/call-ui/model/impl/helpers.h +++ b/call-ui/model/impl/helpers.h @@ -24,27 +24,75 @@ namespace callui { + /** + * @brief Converts native Call Manager results into application results + * @param[in] cmRes Native Call Manager result + * @return Application defined result + */ ucl::Result convertCMResult(int cmRes); + /** + * @brief Converts native Call Manager audio states types + * into application types + * @param[in] state Native Call Manager audio states type + * @return Application defined audio states type + */ AudioStateType convertCMAudioState(cm_audio_state_type_e state); + /** + * @brief Converts application Sim slot types into Call Manager types + * @param[in] slot Application defined sim slot type + * @return Native Call Manager sim slot type + */ cm_multi_sim_slot_type_e convertCUISimSlot(SimSlot slot); + /** + * @brief Converts native Call Manager Sim slot types + * into application types + * @param[in] slot Native Call Manager Sim slot type + * @return Application defined Sim slot type + */ SimSlot convertCMSimSlot(cm_multi_sim_slot_type_e slot); + /** + * @brief Converts application call release types + * into Call Manager types + * @param[in] type Application defined call release type + * @return Native Call Manager call release type + */ cm_call_release_type_e convertCUICallReleaseType(CallReleaseType type); - ucl::Result convertCMEventType(cm_call_event_e cmEvent, CallEventType *appEvent); + /** + * @brief Converts native Call Manager call event types + * into application types + * @param[in] cmEvent Native Call Manager call event type + * @param[out] appEvent Application defined call event type + * @return RES_OK on success or another result otherwise + */ + ucl::Result convertCMEventType(cm_call_event_e cmEvent, + CallEventType *appEvent); + /** + * @brief Converts application call answer types into Call Manager types + * @param[in] type Application defined call answer type + * @return Native Call Manager call answer type + */ cm_call_answer_type_e convertCUICallAnswerType(CallAnswerType type); + /** + * @brief Checks whether Flight mode is turned on + * @return true if Flight mode is active, false otherwise + */ bool isFlightModeActive(); + /** + * @brief Converts enum class value to int value + * @param[in] e Template type of enum class + * @return int value of enum class + */ template - constexpr auto convertEnumValueToInt(TYPE e) -> typename std::underlying_type::type - { - return static_cast::type>(e); - } + constexpr auto convertEnumValueToInt(TYPE e) -> + typename std::underlying_type::type; } #include "helpers.hpp" diff --git a/call-ui/model/impl/helpers.hpp b/call-ui/model/impl/helpers.hpp index 302350b..10ae638 100644 --- a/call-ui/model/impl/helpers.hpp +++ b/call-ui/model/impl/helpers.hpp @@ -132,7 +132,7 @@ namespace callui { inline bool isFlightModeActive() { - int status = false;; + int status = false; if (vconf_get_bool(VCONFKEY_TELEPHONY_FLIGHT_MODE, &status) != 0) { ELOG("Get Flight mode status failed!"); return false; @@ -140,4 +140,11 @@ namespace callui { return status; } + template + inline constexpr auto convertEnumValueToInt(TYPE e) -> + typename std::underlying_type::type + { + return static_cast::type>(e); + } + } -- 2.34.1