/*---------------------------------------------------------------------------*/
/* call_kit.h                                                                */
/* copyright (c) innovaphone 2018                                            */
/*                                                                           */
/*---------------------------------------------------------------------------*/

enum CxCallEndedReason {
    CX_CALL_ENDED_REASON_UNSPECIFIED,
    CX_CALL_ENDED_REASON_FAILED,
    CX_CALL_ENDED_REASON_REMOTE_ENDED,
    CX_CALL_ENDED_REASON_UNANSWERED,
    CX_CALL_ENDED_REASON_ANSWERED_ELSEWHERE,
    CX_CALL_ENDED_REASON_DECLINED_ELSEWHERE,
};

class ICallKit {
public:
    virtual ~ICallKit() {};

    virtual void CxUse(bool use, const char *ringtone, bool supportsVideo, int maximumCallGroups, int maximumCallsPerCallGroup) = 0;
    virtual void CxReportNewIncomingCall(const char *uuid, const char *number, const char *name, const char *transfer, const char *called,
        bool hasVideo, bool supportsDTMF, bool supportsHolding, bool supportsGrouping, bool supportsUngrouping) = 0;
    virtual void CxReportOutgoingCallConnecting(const char *uuid) = 0;
    virtual void CxReportOutgoingCallConnected(const char *uuid) = 0;
    virtual void CxReportCallUpdated(const char *uuid, const char *number, const char *name, const char *transfer, const char *called,
        bool hasVideo, bool supportsDTMF, bool supportsHolding, bool supportsGrouping, bool supportsUngrouping) = 0;
    virtual void CxReportCallEnded(const char *uuid, enum CxCallEndedReason reason) = 0;
    virtual void CxRequestStartCall(const char *uuid, const char *number, const char *name, bool video) = 0;
    virtual void CxRequestEndCall(const char *uuid) = 0;
    virtual void CxRequestSetHeldCall(const char *uuid, bool held) = 0;
    virtual void CxRequestSetMutedCall(const char *uuid, bool muted) = 0;
    virtual void CxRequestSetGroupCall(const char *uuid, const char *with) = 0;
    virtual void CxRequestPlayDTMF(const char *uuid, const char *digits) = 0;
};

enum CxCallError {
    CX_CALL_ERROR_SUCCESS,
    CX_CALL_ERROR_UNSPECIFIED,
    CX_CALL_ERROR_UNENTITLED,
    CX_CALL_ERROR_DUPLICATE_UUID,
    CX_CALL_ERROR_INCOMING_DO_NOT_DISTURB,
    CX_CALL_ERROR_INCOMING_BLOCKED,
    CX_CALL_ERROR_NO_PROVIDER,
    CX_CALL_ERROR_UNKNOWN_UUID,
    CX_CALL_ERROR_REQUEST_INVALID,
    CX_CALL_ERROR_TOO_MANY_GROUPS,
};

class UCallKit {
public:
    virtual ~UCallKit() {};

    virtual void CxSupported(bool supported) = 0;
    virtual void CxStartCallAction(const char * uuid, const char * number, const char * name, bool video) = 0;
    virtual void CxAnswerCallAction(const char * uuid) = 0;
    virtual void CxEndCallAction(const char * uuid, enum CxCallError callError) = 0;
    virtual void CxSetHeldCallAction(const char * uuid, bool held) = 0;
    virtual void CxSetMutedCallAction(const char * uuid, bool muted) = 0;
    virtual void CxAudioRouteChanged(const char * uuid, const char * deviceId) = 0;
    virtual void CxSetGroupCallAction(const char * uuid, const char * with) = 0;
    virtual void CxPlayDTMFCallAction(const char * uuid, const char * digits) = 0;
    virtual void CxCallError(const char * uuid, enum CxCallError callError) = 0;
    virtual void CxShowIncomingCallUi(const char * uuid) = 0;
    virtual void CxCheckIncomingCall(const char * uuid) = 0;
};

