Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

164 lines
3.8 KiB

  1. /***************************************************************************/
  2. /** Microsoft Windows **/
  3. /** Copyright(c) Microsoft Corp., 1995-1996 **/
  4. /***************************************************************************/
  5. //
  6. // The COutgoingCall class is defined, which is used while placing calls
  7. //
  8. #ifndef _ICALL_H_
  9. #define _ICALL_H_
  10. #include "cncodes.h" // needed for CNSTATUS and CN_
  11. class CConfObject;
  12. class COutgoingCall : public INmCall, public RefCount,
  13. public CConnectionPointContainer
  14. {
  15. private:
  16. enum CNODESTATE
  17. {
  18. CNS_IDLE,
  19. CNS_SEARCHING, // dummy state to keep compatible with NM2.X
  20. CNS_WAITING_T120_OPEN,
  21. CNS_QUERYING_REMOTE,
  22. CNS_CREATING_LOCAL,
  23. CNS_INVITING_REMOTE,
  24. CNS_TERMINATING_AFTER_INVITE,
  25. CNS_QUERYING_REMOTE_AFTER_INVITE,
  26. CNS_JOINING_REMOTE,
  27. CNS_COMPLETE
  28. };
  29. // Attributes:
  30. CNODESTATE m_cnState;
  31. CConfObject* m_pConfObject;
  32. REQUEST_HANDLE m_hRequest;
  33. BOOL m_fCanceled;
  34. // User Info
  35. BSTR m_bstrAddr;
  36. LPTSTR m_pszAddr;
  37. BSTR m_bstrConfToJoin;
  38. BSTR m_bstrPassword;
  39. NM_ADDR_TYPE m_addrType;
  40. DWORD m_dwFlags;
  41. // Info that we obtain during processing
  42. CNSTATUS m_cnResult;
  43. BOOL m_fService;
  44. // Protected Methods:
  45. BOOL ReportError(CNSTATUS cns);
  46. VOID SetCallState(CNODESTATE cnState);
  47. public:
  48. COutgoingCall(CConfObject* pco, DWORD dwFlags, NM_ADDR_TYPE addrType, BSTR bstrAdr,
  49. BSTR bstrConference, BSTR bstrPassword);
  50. ~COutgoingCall();
  51. // Methods:
  52. VOID PlaceCall(void);
  53. VOID CallComplete(void);
  54. HRESULT _Cancel(BOOL fLeaving);
  55. // Properties:
  56. DWORD GetFlags() { return m_dwFlags; }
  57. REQUEST_HANDLE GetCurrentRequestHandle() { return m_hRequest; }
  58. BOOL FCanceled() { return m_fCanceled; }
  59. BOOL FIsComplete() { return (CNS_COMPLETE == m_cnState); }
  60. BOOL MatchActiveCallee(LPCTSTR pszDest, BSTR bstrAlias, BSTR bstrConference);
  61. // Event Handlers:
  62. // Received by only this COutgoingCall object
  63. BOOL OnQueryRemoteResult(HRESULT ncsResult,
  64. BOOL fMCU,
  65. PWSTR pwszConfNames[],
  66. PWSTR pwszConfDescriptors[]);
  67. BOOL OnInviteResult(HRESULT ncsResult, UINT uNodeID);
  68. // Received by all COutgoingCall objects sharing the same conference
  69. BOOL OnConferenceEnded();
  70. // Received by all COutgoingCall objects
  71. BOOL OnConferenceStarted(CONF_HANDLE hNewConf,
  72. HRESULT ncsResult);
  73. STDMETHODIMP_(ULONG) AddRef(void);
  74. STDMETHODIMP_(ULONG) Release(void);
  75. STDMETHODIMP QueryInterface(REFIID riid, PVOID *ppvObj);
  76. STDMETHODIMP IsIncoming(void);
  77. STDMETHODIMP GetState(NM_CALL_STATE *pState);
  78. STDMETHODIMP GetAddress(BSTR *pbstr);
  79. STDMETHODIMP GetConference(INmConference **ppConference);
  80. STDMETHODIMP Accept(void);
  81. STDMETHODIMP Reject(void);
  82. STDMETHODIMP Cancel(void);
  83. };
  84. class COprahNCUI;
  85. class COutgoingCallManager
  86. {
  87. private:
  88. COBLIST m_CallList;
  89. UINT GetNodeCount();
  90. BOOL MatchActiveCallee(LPCTSTR pszDest, BSTR bstrAlias, BSTR bstrConference);
  91. public:
  92. COutgoingCallManager();
  93. ~COutgoingCallManager();
  94. UINT GetCallCount();
  95. BOOL RemoveFromList(COutgoingCall* pCall);
  96. HRESULT Call( INmCall **ppCall,
  97. COprahNCUI* pManager,
  98. DWORD dwFlags,
  99. NM_ADDR_TYPE addrType,
  100. BSTR bstrAddr,
  101. BSTR bstrConference,
  102. BSTR bstrPassword);
  103. VOID OnConferenceStarted(CONF_HANDLE hConference, HRESULT hResult);
  104. VOID OnQueryRemoteResult( PVOID pvCallerContext,
  105. HRESULT hResult,
  106. BOOL fMCU,
  107. PWSTR* ppwszConferenceNames,
  108. PWSTR* ppwszConfDescriptors);
  109. VOID OnInviteResult( CONF_HANDLE hConference,
  110. REQUEST_HANDLE hRequest,
  111. UINT uNodeID,
  112. HRESULT hResult);
  113. VOID OnConferenceEnded(CONF_HANDLE hConference);
  114. VOID CancelCalls();
  115. };
  116. #endif // _ICALL_H_