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.

134 lines
3.2 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 2000, Microsoft Corp. All rights reserved.
  4. //
  5. // FILE
  6. //
  7. // proxynode.h
  8. //
  9. // SYNOPSIS
  10. //
  11. // Declares the class ProxyNode
  12. //
  13. // MODIFICATION HISTORY
  14. //
  15. // 02/19/2000 Original version.
  16. //
  17. ///////////////////////////////////////////////////////////////////////////////
  18. #ifndef PROXYNODE_H
  19. #define PROXYNODE_H
  20. #if _MSC_VER >= 1000
  21. #pragma once
  22. #endif
  23. #include <hiddenworker.h>
  24. class ProxyPolicies;
  25. class ServerGroups;
  26. ///////////////////////////////////////////////////////////////////////////////
  27. //
  28. // CLASS
  29. //
  30. // ProxyNode
  31. //
  32. // DESCRIPTION
  33. //
  34. // The data item for the Proxy node.
  35. //
  36. ///////////////////////////////////////////////////////////////////////////////
  37. class __declspec(uuid("fab6fa0a-1e4f-4c2e-bc07-692cf4adaec1")) ProxyNode;
  38. class ProxyNode : public SnapInPreNamedItem
  39. {
  40. public:
  41. ProxyNode(
  42. SnapInView& view,
  43. IDataObject* parentData,
  44. HSCOPEITEM parentId
  45. );
  46. // SnapInDataItem methods.
  47. const GUID* getNodeType() const throw ()
  48. { return &__uuidof(this); }
  49. virtual HRESULT getResultViewType(
  50. LPOLESTR* ppViewType,
  51. long* pViewOptions
  52. ) throw ();
  53. virtual HRESULT onExpand(
  54. SnapInView& view,
  55. HSCOPEITEM itemId,
  56. BOOL expanded
  57. );
  58. virtual HRESULT onShow(
  59. SnapInView& view,
  60. HSCOPEITEM itemId,
  61. BOOL selected
  62. );
  63. virtual HRESULT onContextHelp(SnapInView& view) throw ();
  64. private:
  65. class Connector : private HiddenDialogWithWorker
  66. {
  67. public:
  68. Connector();
  69. void BeginConnect(
  70. ProxyNode& owner,
  71. SnapInView& view,
  72. IDataObject* parentData,
  73. HSCOPEITEM parentId
  74. ) throw ();
  75. private:
  76. virtual LPARAM DoWork() throw ();
  77. virtual void OnComplete(LPARAM result) throw ();
  78. ProxyNode* node;
  79. CComPtr<IConsoleNameSpace2> nameSpace;
  80. CComPtr<IDataObject> dataObject;
  81. HSCOPEITEM relativeID;
  82. // Not implemented.
  83. Connector(const Connector&);
  84. Connector& operator=(const Connector&);
  85. };
  86. friend class Connector;
  87. enum State
  88. {
  89. CONNECTING,
  90. CONNECTED,
  91. EXPANDED,
  92. SUPPRESSED,
  93. FAILED
  94. };
  95. // Called by the Connector.
  96. State connect(IDataObject* dataObject) throw ();
  97. void setConnectResult(
  98. IConsoleNameSpace2* nameSpace,
  99. HSCOPEITEM relativeID,
  100. State newState
  101. ) throw ();
  102. // Current state of the node.
  103. State state;
  104. // Title text for the result pane message view.
  105. ResourceString title;
  106. // Body text for the result pane message view.
  107. ResourceString body;
  108. // Connection to the SDOs.
  109. SdoConnection connection;
  110. // Child proxy policy node.
  111. CComPtr<ProxyPolicies> policies;
  112. // Child server groups node.
  113. CComPtr<ServerGroups> groups;
  114. // Handle to the connect thread.
  115. Connector worker;
  116. };
  117. #endif // PROXYNODE_H