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;
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;
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:
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:
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:
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()
return dialVoiceCall(telNum);
}
- Result CallManager::processIncomingCall(SimSlot slot)
+ Result CallManager::processIncomingCall()
{
if (m_incomingCall) {
if (m_slot == SimSlot::UNDEFINED) {
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:
DLOG("Sim slot [%s]", tmp);
free(tmp);
- ret = m_callManager->processIncomingCall(
- convertCMSimSlot(static_cast<cm_multi_sim_slot_type_e>(atoi(tmp))));
+ ret = m_callManager->processIncomingCall();
} else {
tmp = static_cast<char *>(uri + 4);
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());
}
UCL_DECLARE_REF_ALIASES(CallUI);
+ /**
+ * @brief Represents implementation of ICallUI interface
+ * @see ICallUI
+ */
class CallUI final :
public ucl::RefCountAware,
public ICallUI,
// 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:
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:
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:
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,
// 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:
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:
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:
m_bits.isEnable = isEnable;
}
- void HdVoiceStateSource::updateState(bool isEnable)
+ void HdVoiceStateSource::setState(bool isEnable)
{
if (m_bits.isEnable != isEnable) {
m_bits.isEnable = isEnable;
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:
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;
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:
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:
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:
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:
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:
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:
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:
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:
return makeShared<SimSlotStateSource>(slot, isForwarded);
}
- void SimSlotStateSource::updateSimSlot(SimSlot slot, bool isForwarded)
+ void SimSlotStateSource::setSimSlot(SimSlot slot, bool isForwarded)
{
int simSlotInt = convertEnumValueToInt(slot);
bool needUpdate = false;
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;
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;
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:
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;
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<typename TYPE>
- constexpr auto convertEnumValueToInt(TYPE e) -> typename std::underlying_type<TYPE>::type
- {
- return static_cast<typename std::underlying_type<TYPE>::type>(e);
- }
+ constexpr auto convertEnumValueToInt(TYPE e) ->
+ typename std::underlying_type<TYPE>::type;
}
#include "helpers.hpp"
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;
return status;
}
+ template<typename TYPE>
+ inline constexpr auto convertEnumValueToInt(TYPE e) ->
+ typename std::underlying_type<TYPE>::type
+ {
+ return static_cast<typename std::underlying_type<TYPE>::type>(e);
+ }
+
}