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.

169 lines
4.8 KiB

  1. /*++
  2. Copyright (c) 1998-1999 Microsoft Corporation
  3. Module Name:
  4. AgentSession.h
  5. Abstract:
  6. Declaration of the CAgentSession & CAgentSessionEvent classes
  7. Author:
  8. noela 11-04-97
  9. Notes:
  10. Revision History:
  11. --*/
  12. #ifndef __AGENTSESSION_H_
  13. #define __AGENTSESSION_H_
  14. #include "resource.h" // main symbols
  15. class CAgentHandler;
  16. class CAgent;
  17. /////////////////////////////////////////////////////////////////////////////
  18. // CAgentSession
  19. class ATL_NO_VTABLE CAgentSession :
  20. public CTAPIComObjectRoot<CAgentSession>,
  21. public IDispatchImpl<ITAgentSession, &IID_ITAgentSession, &LIBID_TAPI3Lib>,
  22. public CObjectSafeImpl
  23. {
  24. private:
  25. HAGENTSESSION m_hAgentSession;
  26. AGENT_SESSION_STATE m_SessionState;
  27. AGENT_SESSION_STATE m_NextSessionState;
  28. ITAgent * m_pAgent;
  29. ITACDGroup * m_pGroup;
  30. ITAddress * m_pReceiveCallsOnThisAddress;
  31. AddressLineStruct * m_pAddressLine;
  32. BOOL m_bRequiresUpdating;
  33. CAgentHandler * m_pHandler;
  34. DATE m_dwSessionStartTime;
  35. DWORD m_dwSessionDuration;
  36. DWORD m_dwNumberOfCalls;
  37. DWORD m_dwTotalTalkTime;
  38. DWORD m_dwAverageTalkTime;
  39. DWORD m_dwTotalCallTime;
  40. DWORD m_dwAverageCallTime;
  41. DWORD m_dwTotalWrapUpTime;
  42. DWORD m_dwAverageWrapUpTime;
  43. CURRENCY m_dwACDCallRate;
  44. DWORD m_dwLongestTimeToAnswer;
  45. DWORD m_dwAverageTimeToAnswer;
  46. public:
  47. CAgentSession(){}
  48. ~CAgentSession(){}
  49. void FinalRelease();
  50. void SetState(AGENT_SESSION_STATE state) { m_SessionState = state;}
  51. STDMETHOD(UpdateInfo) ();
  52. STDMETHOD(CheckIfUpToDate) ();
  53. inline void SetRequiresUpdate() {m_bRequiresUpdating = TRUE;}
  54. inline HAGENTSESSION getHandle() {return m_hAgentSession;}
  55. CAgentHandler * GetAgentHandler() { return m_pHandler; }
  56. DECLARE_DEBUG_ADDREF_RELEASE(CAgentSession)
  57. DECLARE_MARSHALQI(CAgentSession)
  58. DECLARE_TRACELOG_CLASS(CAgentSession)
  59. BEGIN_COM_MAP(CAgentSession)
  60. COM_INTERFACE_ENTRY(ITAgentSession)
  61. COM_INTERFACE_ENTRY(IDispatch)
  62. COM_INTERFACE_ENTRY(IObjectSafety)
  63. COM_INTERFACE_ENTRY_FUNC(IID_IMarshal, 0, IMarshalQI)
  64. COM_INTERFACE_ENTRY_AGGREGATE(IID_IMarshal, m_pFTM)
  65. END_COM_MAP()
  66. // ITAgentSession
  67. public:
  68. STDMETHOD(get_AverageTimeToAnswer)(long * pulAnswerTime);
  69. STDMETHOD(get_LongestTimeToAnswer)(long * pulAnswerTime);
  70. STDMETHOD(get_ACDCallRate)(CURRENCY * pcyCallrate);
  71. STDMETHOD(get_AverageWrapUpTime)(long * pulAverageWrapUpTime);
  72. STDMETHOD(get_TotalWrapUpTime)(long * pulTotalWrapUpTime);
  73. STDMETHOD(get_AverageCallTime)(long * pulAverageCallTime);
  74. STDMETHOD(get_TotalCallTime)(long * pulTotalCallTime);
  75. STDMETHOD(get_AverageTalkTime)(long * pulAverageTalkTime);
  76. STDMETHOD(get_TotalTalkTime)(long * pulTotalTalkTime);
  77. STDMETHOD(get_NumberOfCalls)(long * pulNumberOfCalls);
  78. STDMETHOD(get_SessionDuration)(long * pulSessionDuration);
  79. STDMETHOD(get_SessionStartTime)(DATE * dateSessionStart);
  80. STDMETHOD(get_State)(AGENT_SESSION_STATE * pSessionState);
  81. STDMETHOD(put_State)(AGENT_SESSION_STATE sessionState);
  82. STDMETHOD(get_ACDGroup)(ITACDGroup **ppACDGroup);
  83. STDMETHOD(get_Address)(ITAddress **ppAddress);
  84. STDMETHOD(get_Agent)(ITAgent **ppAgent);
  85. STDMETHOD(Initialize)
  86. (
  87. HAGENTSESSION hAgentSession,
  88. ITAgent * pAgent,
  89. ITACDGroup * pGroup,
  90. ITAddress * pAddress,
  91. CAgentHandler * pHandler,
  92. AddressLineStruct * pAddressLine
  93. );
  94. };
  95. /////////////////////////////////////////////////////////////////////////////
  96. // CAgentSessionEvent
  97. class ATL_NO_VTABLE CAgentSessionEvent :
  98. public CTAPIComObjectRoot<CAgentSessionEvent>,
  99. public IDispatchImpl<ITAgentSessionEvent, &IID_ITAgentSessionEvent, &LIBID_TAPI3Lib>,
  100. public CObjectSafeImpl
  101. {
  102. protected:
  103. AGENT_SESSION_EVENT m_SessionEvent;
  104. ITAgentSession * m_pSession;
  105. public:
  106. CAgentSessionEvent()
  107. {
  108. }
  109. static HRESULT FireEvent(
  110. CAgentSession * pAgentSession,
  111. AGENT_SESSION_EVENT sessionEvent
  112. );
  113. void FinalRelease();
  114. DECLARE_MARSHALQI(CAgentSessionEvent)
  115. DECLARE_TRACELOG_CLASS(CAgentSessionEvent)
  116. BEGIN_COM_MAP(CAgentSessionEvent)
  117. COM_INTERFACE_ENTRY(ITAgentSessionEvent)
  118. COM_INTERFACE_ENTRY(IDispatch)
  119. COM_INTERFACE_ENTRY(IObjectSafety)
  120. COM_INTERFACE_ENTRY_FUNC(IID_IMarshal, 0, IMarshalQI)
  121. COM_INTERFACE_ENTRY_AGGREGATE(IID_IMarshal, m_pFTM)
  122. END_COM_MAP()
  123. // ITAgentSessionEvent
  124. public:
  125. STDMETHOD(get_Event)(AGENT_SESSION_EVENT * pEvent);
  126. STDMETHOD(get_Session)(ITAgentSession ** ppSession);
  127. };
  128. #endif //__AGENTSESSION_H_