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.

96 lines
2.8 KiB

  1. /////////////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1997 Active Voice Corporation. All Rights Reserved.
  4. //
  5. // Active Agent(r) and Unified Communications(tm) are trademarks of Active Voice Corporation.
  6. //
  7. // Other brand and product names used herein are trademarks of their respective owners.
  8. //
  9. // The entire program and user interface including the structure, sequence, selection,
  10. // and arrangement of the dialog, the exclusively "yes" and "no" choices represented
  11. // by "1" and "2," and each dialog message are protected by copyrights registered in
  12. // the United States and by international treaties.
  13. //
  14. // Protected by one or more of the following United States patents: 5,070,526, 5,488,650,
  15. // 5,434,906, 5,581,604, 5,533,102, 5,568,540, 5,625,676, 5,651,054.
  16. //
  17. // Active Voice Corporation
  18. // Seattle, Washington
  19. // USA
  20. //
  21. /////////////////////////////////////////////////////////////////////////////////////////
  22. ////////////////////////////////////////////////////////////
  23. // TapiModule.h
  24. #ifndef __TAPIMODULE_H__
  25. #define __TAPIMODULE_H__
  26. #include <list>
  27. using namespace std;
  28. typedef list<HANDLE> THREADIDLIST;
  29. class CAVTapi;
  30. struct IAVTapi;
  31. class CAVGeneralNotification;
  32. struct IAVGeneralNotification;
  33. class CTapiModule : public CComModule
  34. {
  35. // Construction
  36. public:
  37. CTapiModule();
  38. virtual ~CTapiModule();
  39. // Members
  40. public:
  41. HANDLE m_hEventThread;
  42. HANDLE m_hEventThreadWakeUp;
  43. long m_lNumThreads;
  44. protected:
  45. long m_lInit;
  46. CAVTapi *m_pAVTapi;
  47. CAVGeneralNotification *m_pAVGenNot;
  48. HWND m_hWndParent;
  49. CComAutoCriticalSection m_critThreadIDs;
  50. THREADIDLIST m_lstThreadIDs;
  51. // Attributes
  52. public:
  53. HRESULT get_AVTapi( IAVTapi **pp );
  54. HRESULT GetAVTapi( CAVTapi **pp );
  55. void SetAVTapi( CAVTapi *p );
  56. HRESULT get_AVGenNot( IAVGeneralNotification **pp );
  57. void SetAVGenNot( CAVGeneralNotification *p );
  58. HWND GetParentWnd() const { if ( m_hWndParent ) return m_hWndParent; else return GetActiveWindow(); }
  59. void SetParentWnd( HWND hWnd ) { m_hWndParent = hWnd; }
  60. bool IsMachineName( int nLen, LPCTSTR pszText );
  61. bool IsIPAddress( int nLen, LPCTSTR pszText );
  62. bool IsEmailAddress( int nLen, LPCTSTR pszText );
  63. bool IsPhoneNumber( int nLen, LPCTSTR pszText );
  64. // Operations
  65. public:
  66. void ShutdownThreads();
  67. bool StartupThreads();
  68. void AddThread( HANDLE hThread );
  69. void RemoveThread( HANDLE hThread );
  70. void KillThreads();
  71. int DoMessageBox( UINT nIDS, UINT nType, bool bUseActiveWnd );
  72. int DoMessageBox( const TCHAR *lpszText, UINT nType, bool bUseActiveWnd );
  73. DWORD GuessAddressType( LPCTSTR pszText );
  74. // Overrides
  75. public:
  76. virtual void Init( _ATL_OBJMAP_ENTRY* p, HINSTANCE h );
  77. virtual void Term();
  78. };
  79. #endif // __TAPIMODULE_H__