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.

178 lines
5.8 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. // FILE : OutboundGroup.h //
  3. // //
  4. // DESCRIPTION : Header file for the Fax Outbound Routing Group Node //
  5. // //
  6. // AUTHOR : yossg //
  7. // //
  8. // HISTORY : //
  9. // Dec 23 1999 yossg Create //
  10. // Jan 3 2000 yossg add new device(s) //
  11. // //
  12. // Copyright (C) 1999 - 2000 Microsoft Corporation All Rights Reserved //
  13. /////////////////////////////////////////////////////////////////////////////
  14. #ifndef H_FAXOUTBOUNDROUTINGGROUP_H
  15. #define H_FAXOUTBOUNDROUTINGGROUP_H
  16. #include "snapin.h"
  17. #include "snpnres.h"
  18. #include "OutboundDevice.h"
  19. class CFaxOutboundGroupsNode;
  20. class CFaxOutboundRoutingDeviceNode;
  21. class CFaxOutboundRoutingGroupNode : public CNodeWithResultChildrenList<
  22. CFaxOutboundRoutingGroupNode,
  23. CFaxOutboundRoutingDeviceNode,
  24. CSimpleArray<CFaxOutboundRoutingDeviceNode*>,
  25. FALSE>
  26. {
  27. public:
  28. BEGIN_SNAPINCOMMAND_MAP(CFaxOutboundRoutingGroupNode, FALSE)
  29. SNAPINCOMMAND_ENTRY(IDM_NEW_DEVICES, OnNewDevice)
  30. END_SNAPINCOMMAND_MAP()
  31. BEGIN_SNAPINTOOLBARID_MAP(CFaxOutboundRoutingGroupNode)
  32. END_SNAPINTOOLBARID_MAP()
  33. SNAPINMENUID(IDR_OUTGROUP_MENU)
  34. //
  35. // Constructor
  36. //
  37. CFaxOutboundRoutingGroupNode(CSnapInItem * pParentNode, CSnapin * pComponentData) :
  38. CNodeWithResultChildrenList<CFaxOutboundRoutingGroupNode, CFaxOutboundRoutingDeviceNode, CSimpleArray<CFaxOutboundRoutingDeviceNode*>, FALSE>(pParentNode, pComponentData )
  39. {
  40. m_bstrGroupName = L"";
  41. m_lpdwDeviceID = NULL;
  42. m_dwNumOfDevices = 0;
  43. // Succeed ToPopulateAllDevices
  44. m_fSuccess = FALSE;
  45. }
  46. //
  47. // Destructor
  48. //
  49. ~CFaxOutboundRoutingGroupNode()
  50. {
  51. if (NULL != m_lpdwDeviceID)
  52. {
  53. delete[] m_lpdwDeviceID;
  54. }
  55. }
  56. virtual HRESULT PopulateResultChildrenList();
  57. virtual HRESULT InsertColumns(IHeaderCtrl *pHeaderCtrl);
  58. virtual HRESULT SetVerbs(IConsoleVerb *pConsoleVerb);
  59. LPOLESTR GetResultPaneColInfo(int nCol);
  60. STDMETHOD(QueryPagesFor)(DATA_OBJECT_TYPES type)
  61. {
  62. if (type == CCT_SCOPE || type == CCT_RESULT)
  63. return S_OK;
  64. return S_FALSE;
  65. }
  66. void InitParentNode(CFaxOutboundGroupsNode *pParentNode)
  67. {
  68. m_pParentNode = pParentNode;
  69. }
  70. HRESULT Init(PFAX_OUTBOUND_ROUTING_GROUP pGroupConfig);
  71. //
  72. // Events on the Group
  73. //
  74. //delete the group
  75. virtual HRESULT OnDelete(LPARAM arg,
  76. LPARAM param,
  77. IComponentData *pComponentData,
  78. IComponent *pComponent,
  79. DATA_OBJECT_TYPES type,
  80. BOOL fSilent = FALSE);
  81. virtual HRESULT OnRefresh(LPARAM arg,
  82. LPARAM param,
  83. IComponentData *pComponentData,
  84. IComponent * pComponent,
  85. DATA_OBJECT_TYPES type);
  86. HRESULT DoRefresh(CSnapInObjectRootBase *pRoot);
  87. //
  88. // Treat Group Devices
  89. //
  90. HRESULT OnNewDevice(bool &bHandled, CSnapInObjectRootBase *pRoot);
  91. HRESULT DeleteDevice(DWORD dwDeviceIdToRemove, CFaxOutboundRoutingDeviceNode *pChildNode);
  92. HRESULT ChangeDeviceOrder(DWORD dwOrder, DWORD dwNewOrder, DWORD dwDeviceID, CSnapInObjectRootBase *pRoot);
  93. HRESULT SetNewDeviceList(LPDWORD lpdwNewDeviceID);
  94. void UpdateMenuState (UINT id, LPTSTR pBuf, UINT *flags);
  95. //
  96. // Access To private members
  97. //
  98. DWORD GetMaxOrder()
  99. { return( m_fSuccess ? m_dwNumOfDevices : 0); }
  100. LPDWORD GetDeviceIDList() { return m_lpdwDeviceID; }
  101. DWORD GetNumOfDevices() { return m_dwNumOfDevices; }
  102. HRESULT OnShowContextHelp(
  103. IDisplayHelp* pDisplayHelp, LPOLESTR helpFile);
  104. private:
  105. static CColumnsInfo m_ColsInfo;
  106. CFaxOutboundGroupsNode * m_pParentNode;
  107. //
  108. // members
  109. //
  110. CComBSTR m_bstrGroupName;
  111. DWORD m_dwNumOfDevices;
  112. LPDWORD m_lpdwDeviceID;
  113. FAX_ENUM_GROUP_STATUS m_enumStatus;
  114. CComBSTR m_buf;
  115. // Succeed ToPopulateAllDevices
  116. BOOL m_fSuccess;
  117. //
  118. // Methods
  119. //
  120. HRESULT InitMembers (PFAX_OUTBOUND_ROUTING_GROUP pGroupConfig);
  121. HRESULT InitGroupName(LPCTSTR lpctstrGroupName);
  122. UINT GetStatusIDS (FAX_ENUM_GROUP_STATUS enumStatus);
  123. void InitIcons ();
  124. //
  125. // for internal usage. similar to the public init
  126. // but creates and frees its own configuration structure
  127. //
  128. HRESULT RefreshFromRPC();
  129. HRESULT RefreshNameSpaceNode();
  130. };
  131. typedef CNodeWithResultChildrenList<CFaxOutboundRoutingGroupNode, CFaxOutboundRoutingDeviceNode, CSimpleArray<CFaxOutboundRoutingDeviceNode*>, FALSE>
  132. CBaseFaxOutboundRoutingGroupNode;
  133. #endif //H_FAXOUTBOUNDROUTINGGROUP_H