Leaked source code of windows server 2003
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.

138 lines
2.9 KiB

  1. // CallNotification.h : Declaration of the CCallNotification
  2. #ifndef __CALLNOTIFICATION_H_
  3. #define __CALLNOTIFICATION_H_
  4. /////////////////////////////////////////////////////////////////////////////
  5. //
  6. // CTAPIEventNotification
  7. //
  8. /////////////////////////////////////////////////////////////////////////////
  9. class CTAPIEventNotification :
  10. public ITTAPIEventNotification
  11. {
  12. public:
  13. DWORD m_dwRefCount;
  14. CTAPIEventNotification(){ m_dwRefCount = 0;}
  15. HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, void **ppvObject)
  16. {
  17. if (iid == IID_ITTAPIEventNotification)
  18. {
  19. *ppvObject = (void *)this;
  20. AddRef();
  21. return S_OK;
  22. }
  23. if (iid == IID_IUnknown)
  24. {
  25. *ppvObject = (void *)this;
  26. AddRef();
  27. return S_OK;
  28. }
  29. return E_NOINTERFACE;
  30. }
  31. ULONG STDMETHODCALLTYPE AddRef()
  32. {
  33. m_dwRefCount++;
  34. return m_dwRefCount;
  35. }
  36. ULONG STDMETHODCALLTYPE Release()
  37. {
  38. m_dwRefCount--;
  39. if ( 0 == m_dwRefCount)
  40. {
  41. delete this;
  42. }
  43. return 1;
  44. }
  45. // ICallNotification
  46. public:
  47. HRESULT STDMETHODCALLTYPE Event(
  48. TAPI_EVENT TapiEvent,
  49. IDispatch * pEvent
  50. );
  51. };
  52. #ifdef ENABLE_DIGIT_DETECTION_STUFF
  53. /////////////////////////////////////////////////////////////////////////////
  54. //
  55. // CDigitDetectionNotification
  56. //
  57. /////////////////////////////////////////////////////////////////////////////
  58. class CDigitDetectionNotification :
  59. public ITDigitDetectionNotification
  60. {
  61. public:
  62. DWORD m_dwRefCount;
  63. CDigitDetectionNotification(){ m_dwRefCount = 0;}
  64. HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, void **ppvObject)
  65. {
  66. if (iid == IID_ITDigitDetectionNotification)
  67. {
  68. *ppvObject = (void *)this;
  69. AddRef();
  70. return S_OK;
  71. }
  72. if (iid == IID_IUnknown)
  73. {
  74. *ppvObject = (void *)this;
  75. AddRef();
  76. return S_OK;
  77. }
  78. if (iid == IID_IDispatch)
  79. {
  80. *ppvObject = (void *)this;
  81. AddRef();
  82. return S_OK;
  83. }
  84. return E_NOINTERFACE;
  85. }
  86. ULONG STDMETHODCALLTYPE AddRef()
  87. {
  88. m_dwRefCount++;
  89. return m_dwRefCount;
  90. }
  91. ULONG STDMETHODCALLTYPE Release()
  92. {
  93. m_dwRefCount--;
  94. if ( 0 == m_dwRefCount)
  95. {
  96. delete this;
  97. }
  98. return 1;
  99. }
  100. // ICallNotification
  101. public:
  102. HRESULT STDMETHODCALLTYPE DigitDetected(
  103. unsigned char ucDigit,
  104. TAPI_DIGITMODE DigitMode,
  105. long ulTickCount
  106. );
  107. };
  108. #endif // ENABLE_DIGIT_DETECTION_STUFF
  109. #endif //__CALLNOTIFICATION_H_