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.

197 lines
5.8 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. // FILE : Device.h //
  3. // //
  4. // DESCRIPTION : Header file for CFaxDeviceNode class //
  5. // This is node apears both in the scope pane and //
  6. // with full detailes in the result pane. //
  7. // //
  8. // AUTHOR : yossg //
  9. // //
  10. // HISTORY : //
  11. // Sep 22 1999 yossg Create //
  12. // Dec 1 1999 yossg Change totaly for New Mockup (0.7) //
  13. // Dec 6 1999 yossg add FaxChangeState functionality //
  14. // Dec 12 1999 yossg add OnPropertyChange functionality //
  15. // Aug 3 2000 yossg Add Device status real-time notification //
  16. // Windows XP //
  17. // Feb 14 2001 yossg Add Manual Receive support //
  18. // //
  19. // Copyright (C) 1999 - 2000 Microsoft Corporation All Rights Reserved //
  20. /////////////////////////////////////////////////////////////////////////////
  21. #ifndef H_DEVICE_H
  22. #define H_DEVICE_H
  23. //#pragma message( "H_DEVICE_H" )
  24. #include "snapin.h"
  25. #include "snpnscp.h"
  26. class CFaxDevicesNode;
  27. class CppFaxDeviceGeneral;
  28. class CFaxServer;
  29. //class CNodeWithScopeChildrenList;
  30. class CFaxDeviceNode : public CNodeWithScopeChildrenList<CFaxDeviceNode, FALSE>
  31. {
  32. public:
  33. BEGIN_SNAPINCOMMAND_MAP(CFaxDeviceNode, FALSE)
  34. SNAPINCOMMAND_ENTRY(IDM_FAX_DEVICE_SEND, OnFaxSend)
  35. SNAPINCOMMAND_RANGE_ENTRY(IDM_FAX_DEVICE_RECEIVE_AUTO, IDM_FAX_DEVICE_RECEIVE_MANUAL, OnFaxReceive)
  36. END_SNAPINCOMMAND_MAP()
  37. BEGIN_SNAPINTOOLBARID_MAP(CFaxDeviceNode)
  38. END_SNAPINTOOLBARID_MAP()
  39. SNAPINMENUID(IDR_DEVICE_MENU)
  40. CFaxDeviceNode(CSnapInItem * pParentNode, CSnapin * pComponentData) :
  41. CNodeWithScopeChildrenList<CFaxDeviceNode, FALSE>(pParentNode, pComponentData ),
  42. m_dwDeviceID(0),
  43. m_fSend(FALSE),
  44. m_fAutoReceive(FALSE),
  45. m_fManualReceive(FALSE),
  46. m_dwRings(0),
  47. m_dwStatus(0),
  48. m_pFaxServer(NULL)
  49. {}
  50. ~CFaxDeviceNode()
  51. {
  52. }
  53. //
  54. // Menu item handlers
  55. //
  56. HRESULT OnFaxReceive (UINT nID, bool &bHandled, CSnapInObjectRootBase *pRoot);
  57. HRESULT OnFaxSend (bool &bHandled, CSnapInObjectRootBase *pRoot);
  58. HRESULT FaxChangeState(UINT uiIDM, BOOL fState);
  59. virtual HRESULT PopulateScopeChildrenList();
  60. virtual HRESULT InsertColumns(IHeaderCtrl* pHeaderCtrl);
  61. virtual HRESULT SetVerbs(IConsoleVerb *pConsoleVerb);
  62. LPOLESTR GetResultPaneColInfo(int nCol);
  63. STDMETHOD(CreatePropertyPages)(LPPROPERTYSHEETCALLBACK lpProvider,
  64. LONG_PTR handle,
  65. IUnknown* pUnk,
  66. DATA_OBJECT_TYPES type);
  67. STDMETHOD(QueryPagesFor)(DATA_OBJECT_TYPES type)
  68. {
  69. if (type == CCT_SCOPE || type == CCT_RESULT)
  70. return S_OK;
  71. return S_FALSE;
  72. }
  73. // virtual
  74. HRESULT OnRefresh(LPARAM arg,
  75. LPARAM param,
  76. IComponentData *pComponentData,
  77. IComponent * pComponent,
  78. DATA_OBJECT_TYPES type);
  79. void InitParentNode(CFaxDevicesNode *pParentNode)
  80. {
  81. m_pParentNode = pParentNode;
  82. }
  83. void UpdateMenuState(UINT id, LPTSTR pBuf, UINT *flags);
  84. HRESULT DoRefresh();
  85. HRESULT RefreshAllViews(IConsole *pConsole);
  86. HRESULT RefreshTheView();
  87. HRESULT Init( PFAX_PORT_INFO_EX pFaxDeviceConfig );
  88. HRESULT UpdateMembers( PFAX_PORT_INFO_EX pFaxDeviceConfig );
  89. HRESULT UpdateDeviceStatus( DWORD dwDeviceStatus );
  90. DWORD GetDeviceID();
  91. //
  92. // Get methods for CLIPFORMAT FillData
  93. //
  94. CComBSTR GetFspGuid()
  95. {
  96. return m_bstrProviderGUID;
  97. }
  98. //
  99. // FillData
  100. //
  101. STDMETHOD (FillData)(CLIPFORMAT cf, LPSTREAM pStream);
  102. //
  103. // Clipboard Formats
  104. //
  105. static CLIPFORMAT m_CFPermanentDeviceID;
  106. static CLIPFORMAT m_CFFspGuid;
  107. static CLIPFORMAT m_CFServerName;
  108. //
  109. // inline parent ptr
  110. //
  111. inline CFaxDevicesNode * GetParent() /*const*/
  112. {
  113. return m_pParentNode;
  114. };
  115. HRESULT OnShowContextHelp(
  116. IDisplayHelp* pDisplayHelp, LPOLESTR helpFile);
  117. private:
  118. //
  119. // Config Structure member
  120. //
  121. DWORD m_dwDeviceID;
  122. CComBSTR m_bstrDescription;
  123. CComBSTR m_bstrProviderName;
  124. CComBSTR m_bstrProviderGUID;
  125. BOOL m_fSend;
  126. BOOL m_fAutoReceive;
  127. BOOL m_fManualReceive;
  128. DWORD m_dwRings;
  129. CComBSTR m_bstrCsid;
  130. CComBSTR m_bstrTsid;
  131. DWORD m_dwStatus;
  132. CComBSTR m_bstrServerName;
  133. //
  134. // get data from RPC
  135. //
  136. /*
  137. * (in use during refresh only)
  138. * (private to avoid usage by out functions )
  139. */
  140. HRESULT InitRPC( PFAX_PORT_INFO_EX * pFaxDeviceConfig );
  141. CComBSTR m_buf;
  142. CppFaxDeviceGeneral * m_pFaxDeviceGeneral;
  143. static CColumnsInfo m_ColsInfo;
  144. CFaxDevicesNode * m_pParentNode;
  145. CFaxServer * m_pFaxServer;
  146. };
  147. #endif //H_DEVICE_H