// SAFIntercomClient.h : Declaration of the CSAFIntercomClient #ifndef __SAFIntercomClient_H_ #define __SAFIntercomClient_H_ //JP:not in connectivitylib.h//#include "resource.h" // main symbols #include #include #include ///////////////////////////////////////////////////////////////////////////// // CSAFIntercomClient class ATL_NO_VTABLE CSAFIntercomClient : // Hungarian safi public IDispatchImpl < ISAFIntercomClient, &IID_ISAFIntercomClient, &LIBID_HelpCenterTypeLib >, public MPC::ConnectionPointImpl< CSAFIntercomClient, &DIID_DSAFIntercomClientEvents, MPC::CComSafeMultiThreadModel >, public IRTCEventNotification { private: CComPtr m_pRTCClient; CComPtr m_pRTCSession; DWORD m_dwSinkCookie; BOOL m_bOnCall; BOOL m_bRTCInit; BOOL m_bAdvised; int m_iSamplingRate; CComPtr m_sink_onVoiceConnected; CComPtr m_sink_onVoiceDisconnected; CComPtr m_sink_onVoiceDisabled; HRESULT Fire_onVoiceConnected (ISAFIntercomClient * safe); HRESULT Fire_onVoiceDisconnected (ISAFIntercomClient * safe); HRESULT Fire_onVoiceDisabled (ISAFIntercomClient * safe); // Worker functions HRESULT Init(); HRESULT Cleanup(); public: CSAFIntercomClient(); ~CSAFIntercomClient(); //DECLARE_PROTECT_FINAL_CONSTRUCT() // TODO: JP: Do we need this here? BEGIN_COM_MAP(CSAFIntercomClient) COM_INTERFACE_ENTRY(ISAFIntercomClient) COM_INTERFACE_ENTRY(IDispatch) COM_INTERFACE_ENTRY(IRTCEventNotification) END_COM_MAP() // ISAFIntercomClient public: STDMETHOD(Disconnect)(); STDMETHOD(Connect)(BSTR bstrIP, BSTR bstrKey); STDMETHOD(RunSetupWizard)(); STDMETHOD(Exit)(); STDMETHOD(put_onVoiceConnected) (/* in */ IDispatch * function); STDMETHOD(put_onVoiceDisconnected) (/* in */ IDispatch * function); STDMETHOD(put_onVoiceDisabled) (/* in */ IDispatch * function); STDMETHOD(put_SamplingRate) (/* in */ LONG newVal); STDMETHOD(get_SamplingRate) (/* out, retval */ LONG * pVal); // IRTCEventNotification STDMETHOD(Event)( RTC_EVENT RTCEvent, IDispatch * pEvent ); HRESULT OnSessionChange(IRTCSession *pSession, RTC_SESSION_STATE nState, HRESULT ResCode); HRESULT onMediaEvent(IRTCMediaEvent * pMedEvent); }; #endif //__SAFIntercomClient_H_