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.

117 lines
3.1 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. faxport.h
  5. Abstract:
  6. This module contains the port class definitions.
  7. Author:
  8. Wesley Witt (wesw) 20-May-1997
  9. Revision History:
  10. --*/
  11. #ifndef __FAXPORT_H_
  12. #define __FAXPORT_H_
  13. #include "resource.h"
  14. #include <winfax.h>
  15. #include "faxsvr.h"
  16. class ATL_NO_VTABLE CFaxPorts :
  17. public CComObjectRootEx<CComSingleThreadModel>,
  18. public CComCoClass<CFaxPorts, &CLSID_FaxPorts>,
  19. public IDispatchImpl<IFaxPorts, &IID_IFaxPorts, &LIBID_FAXCOMLib>
  20. {
  21. public:
  22. CFaxPorts();
  23. ~CFaxPorts();
  24. BOOL Init(CFaxServer *pFaxServer);
  25. DECLARE_REGISTRY_RESOURCEID(IDR_FAXPORTS)
  26. BEGIN_COM_MAP(CFaxPorts)
  27. COM_INTERFACE_ENTRY(IFaxPorts)
  28. COM_INTERFACE_ENTRY(IDispatch)
  29. END_COM_MAP()
  30. // IFaxPorts
  31. public:
  32. STDMETHOD(get_Item)(long Index, /*[out, retval]*/ VARIANT *pVal);
  33. STDMETHOD(get_Count)(/*[out, retval]*/ long *pVal);
  34. private:
  35. CFaxServer *m_pFaxServer;
  36. DWORD m_LastFaxError;
  37. DWORD m_PortCount;
  38. CComVariant *m_VarVect;
  39. };
  40. class ATL_NO_VTABLE CFaxPort :
  41. public CComObjectRootEx<CComSingleThreadModel>,
  42. public CComCoClass<CFaxPort, &CLSID_FaxPort>,
  43. public IDispatchImpl<IFaxPort, &IID_IFaxPort, &LIBID_FAXCOMLib>
  44. {
  45. public:
  46. CFaxPort();
  47. ~CFaxPort();
  48. BOOL Initialize(CFaxServer*,DWORD,DWORD,DWORD,DWORD,LPCWSTR,LPCWSTR,LPCWSTR);
  49. HANDLE GetPortHandle() { return m_FaxPortHandle; };
  50. DWORD GetDeviceId() { return m_DeviceId; };
  51. BSTR GetDeviceName() { return m_Name; };
  52. DECLARE_REGISTRY_RESOURCEID(IDR_FAXPORT)
  53. BEGIN_COM_MAP(CFaxPort)
  54. COM_INTERFACE_ENTRY(IFaxPort)
  55. COM_INTERFACE_ENTRY(IDispatch)
  56. END_COM_MAP()
  57. public:
  58. STDMETHOD(GetStatus)(/*[out, retval]*/ VARIANT* retval);
  59. STDMETHOD(GetRoutingMethods)(VARIANT* retval);
  60. STDMETHOD(get_CanModify)(/*[out, retval]*/ BOOL *pVal);
  61. STDMETHOD(get_Priority)(/*[out, retval]*/ long *pVal);
  62. STDMETHOD(put_Priority)(/*[in]*/ long newVal);
  63. STDMETHOD(get_Receive)(/*[out, retval]*/ BOOL *pVal);
  64. STDMETHOD(put_Receive)(/*[in]*/ BOOL newVal);
  65. STDMETHOD(get_Send)(/*[out, retval]*/ BOOL *pVal);
  66. STDMETHOD(put_Send)(/*[in]*/ BOOL newVal);
  67. STDMETHOD(get_Tsid)(/*[out, retval]*/ BSTR *pVal);
  68. STDMETHOD(put_Tsid)(/*[in]*/ BSTR newVal);
  69. STDMETHOD(get_Csid)(/*[out, retval]*/ BSTR *pVal);
  70. STDMETHOD(put_Csid)(/*[in]*/ BSTR newVal);
  71. STDMETHOD(get_Rings)(/*[out, retval]*/ long *pVal);
  72. STDMETHOD(put_Rings)(/*[in]*/ long newVal);
  73. STDMETHOD(get_DeviceId)(/*[out, retval]*/ long *pVal);
  74. STDMETHOD(get_Name)(/*[out, retval]*/ BSTR *pVal);
  75. private:
  76. BOOL ChangePort();
  77. CFaxServer *m_pFaxServer;
  78. HANDLE m_FaxPortHandle;
  79. BOOL m_Send;
  80. BOOL m_Receive;
  81. BOOL m_Modify;
  82. BSTR m_Name;
  83. BSTR m_Csid;
  84. BSTR m_Tsid;
  85. DWORD m_LastFaxError;
  86. DWORD m_DeviceId;
  87. DWORD m_Rings;
  88. DWORD m_Priority;
  89. };
  90. #endif //__FAXPORT_H_