#define _PHN_CALL_PRESENTATION_MODEL_H_
#include <FApp.h>
+#include <FTelephony.h>
+#include "CallAppControlRequestMgr.h"
#include "CallTypes.h"
#include "CallITelephonyEventListener.h"
#include "CalllogManager.h"
-class CallInfo;
+class AppCallInfo;
class TelephonyManager;
class SettingsPresentationModel;
*/
class CallPresentationModel: public ITelephonyEventListener
, public Tizen::App::IAppControlResponseListener
+ , public Tizen::Telephony::ITelephonyNetworkEventListener
+ , public Tizen::Telephony::ITelephonySimEventListener
{
public:
//create a singleton instance
virtual ~CallPresentationModel(void);
CallPresentationModel& operator =(const CallPresentationModel& presentor);
-
result Construct(void);
static void CreateInstance(void);
static void DestroyInstance(void);
+ //gets the sim info
+ result GetSimInfo(void);
+ //Used to check if sim is available
+ bool IsSimAvailable(void);
+ bool IfNumberEndsWithHash(Tizen::Base::String& contactNumber);
public:
//set the telephony event listener
//Send DTMF strings
void SendDTMFSignal(Tizen::Base::String& textToBeSent);
//Function to get the conference call info
- CallInfo* GetConferenceCallInfoN(void);
+ AppCallInfo* GetConferenceCallInfoN(void);
//Split this call from the conference call
- void SplitFromConference(SplitConfCallerCmdIds splitCallerCmdId, Tizen::Base::Collection::IListT<CallInfo>* pConfCallList);
+ bool SplitFromConference(SplitConfCallerCmdIds splitCallerCmdId, Tizen::Base::Collection::IListT<AppCallInfo>* pConfCallList);
//End this single call from the conference call
- void EndCallFromConference(EndConfCallerCmdIds endCallerCmdId, Tizen::Base::Collection::IListT<CallInfo>* pConfCallList);
+ void EndCallFromConference(EndConfCallerCmdIds endCallerCmdId, Tizen::Base::Collection::IListT<AppCallInfo>* pConfCallList);
//returns true, if split operation is allowed. Else, returns false.
bool IsSplitAllowed(void);
//Accept the incoming call as per the options
//Get the current call count
int GetCurrentCallCount(void);
//Get the current call list
- Tizen::Base::Collection::IListT<CallInfo>* GetCallListN(void);
+ Tizen::Base::Collection::IListT<AppCallInfo>* GetCallListN(void);
//Check if modem and sim initialization is complete.
bool CheckSimInitializationIsCompleted();
//This function returns true, if contact number is emergency no.
bool IsEmergencyNumber(const Tizen::Base::String& phoneNumber, bool isSimInitialized);
//Start the alert in case of incoming call
- void StartAlert(CallInfo& incomingCallInfo);
+ void StartAlert(AppCallInfo& incomingCallInfo);
//Stop the alert in case of incoming call
void StopAlert(void);
//Gets the contact for the given phonenumber.returns null if not present.
Tizen::Social::Contact* GetContactN(const Tizen::Base::String& phoneNumber);
//Fetch the incoming call details.
- CallInfo* FetchIncomingCallDetailsN(const Tizen::Base::String& callHandle, const Tizen::Base::String& contactNumber);
+ AppCallInfo* FetchIncomingCallDetailsN(const Tizen::Base::String& callHandle, const Tizen::Base::String& contactNumber);
//Function is used to auto reject the call based on call settings and return true, if rejected.
- bool CheckIncomingCallToBeRejected(CallInfo* pIncomingCallInfo);
+ bool CheckIncomingCallToBeRejected(AppCallInfo* pIncomingCallInfo);
//Launch dial appcontrol for add call senario
- result LaunchDialAppControl();
+ void LaunchDialAppControl();
+ //Used to check if Join button should be enabled or not
+ bool IsEnableJoinCallButton(void);
+ //Used to check if incomig call is present
+ bool IsIncomingorDialingCallPresent(void);
+ //Used to launch Messaging AppControl to compose message.
+ bool LaunchComposeMessageAppControl(Tizen::Base::String& contactNumber, Tizen::App::IAppControlResponseListener* pListener);
+ //Used to make "ViewContact" AppControl request.
+ bool LaunchViewContactAppControl(Tizen::Base::String& contactId, Tizen::App::IAppControlResponseListener* pListener);
+ //Used to make "AddContact" AppControl request.
+ bool LaunchAddContactAppControl(Tizen::Base::String& contactNumber, Tizen::App::IAppControlResponseListener* pListener);
+ //Used to check if there is any AppControl request in progress.
+ bool IsAppControlRunning(void);
+ //Used to abort any running AppControl request.
+ void AbortAppControlRequest(void);
+ //Used to complete any running AppControl request.
+ void AppControlRequestCompleted(void);
//Event Listener methods from ITelephonyEventListener
- virtual void HandleCallConnected(Tizen::Base::Collection::IListT<CallInfo>& pCallList);
- virtual void HandleCallDisconnected(bool isLastCall, Tizen::Base::Collection::IListT<CallInfo>& pCallList);
- virtual void HandleConferenceCall(CallInfo& pCallInfo);
- virtual void HandleIncomingCall(CallInfo& pCallInfo);
- virtual void HandleCallSwapOccured(Tizen::Base::Collection::IListT<CallInfo>& pCallList);
+ virtual void HandleCallConnected(Tizen::Base::Collection::IListT<AppCallInfo>& pCallList);
+ virtual void HandleCallDisconnected(bool isLastCall, Tizen::Base::Collection::IListT<AppCallInfo>& pCallList);
+ virtual void HandleConferenceCall(AppCallInfo& pCallInfo);
+ virtual void HandleIncomingCall(AppCallInfo& pCallInfo);
+ virtual void HandleCallSwapOccured(Tizen::Base::Collection::IListT<AppCallInfo>& pCallList);
virtual void HandleConferenceChange(void);
virtual void HandleTelephonyError(int errorCode);
//From IAppControlResponseListener
virtual void OnAppControlCompleteResponseReceived(const Tizen::App::AppId& appId, const Tizen::Base::String& operationId, Tizen::App::AppCtrlResult appControlResult, const Tizen::Base::Collection::IMap* pExtraData);
+ virtual void OnAppForeground(void);
+ virtual void OnTelephonyNetworkStatusChanged(const Tizen::Telephony::NetworkStatus& networkStatus);
+ virtual void OnTelephonySimStateChanged(Tizen::Telephony::SimState state);
private:
static CallPresentationModel* __pInstance;
// incoming call is rejected with "Reject With message" by opening Msg AppControl.
bool __isMessageAppControlRunning;
bool __isDialAppControlRunning;
+ //Used to manage AppControl requests.
+ CallAppControlRequestMgr* __pAppControlMgr;
+ Tizen::Telephony::NetworkManager* __pNetworkManager;
+ Tizen::Telephony::SimStateManager* __psimStateManager;
+ Tizen::Telephony::SimInfo* __psimInfo;
};
#endif // _PHN_CALL_PRESENTATION_MODEL_H_