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.

180 lines
5.0 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 2000, Microsoft Corp. All rights reserved.
  4. //
  5. // FILE
  6. //
  7. // proxypolicies.h
  8. //
  9. // SYNOPSIS
  10. //
  11. // Declares the classes ProxyPolicy and ProxyPolicies.
  12. //
  13. // MODIFICATION HISTORY
  14. //
  15. // 02/10/2000 Original version.
  16. // 04/19/2000 SdoScopeItem::getSelf returns by value, not reference.
  17. //
  18. ///////////////////////////////////////////////////////////////////////////////
  19. #ifndef PROXYPOLICIES_H
  20. #define PROXYPOLICIES_H
  21. #if _MSC_VER >= 1000
  22. #pragma once
  23. #endif
  24. #include <sdonode.h>
  25. class ProxyPolicies;
  26. ///////////////////////////////////////////////////////////////////////////////
  27. //
  28. // CLASS
  29. //
  30. // ProxyPolicy
  31. //
  32. // DESCRIPTION
  33. //
  34. // Implements SnapInDataItem for a proxy policy result pane item.
  35. //
  36. ///////////////////////////////////////////////////////////////////////////////
  37. class ProxyPolicy : public SdoResultItem
  38. {
  39. public:
  40. ProxyPolicy(
  41. SdoScopeItem& owner,
  42. ISdo* sdo
  43. );
  44. // Returns parent as a ProxyPolicies ref (instead of a SdoScopeItem).
  45. ProxyPolicies& getParent() const throw ();
  46. Sdo& getProfile();
  47. // Flags returned by getToolbarFlags below.
  48. enum ToolbarFlags
  49. {
  50. MOVE_UP_ALLOWED = 0x1,
  51. MOVE_DN_ALLOWED = 0x2,
  52. ORDER_REVERSED = 0x4
  53. };
  54. // Analyzes the view to determine the current state of the Toolbar.
  55. ULONG getToolbarFlags(const SnapInView& view) throw ();
  56. // Get and set the merit. Used for normalizing and reordering.
  57. LONG getMerit() const throw ()
  58. { return merit; }
  59. void setMerit(LONG newMerit);
  60. virtual PCWSTR getDisplayName(int column = 0) const throw ();
  61. virtual HRESULT addMenuItems(
  62. SnapInView& view,
  63. LPCONTEXTMENUCALLBACK callback,
  64. long insertionAllowed
  65. );
  66. virtual int compare(
  67. SnapInDataItem& item,
  68. int column
  69. ) throw ();
  70. virtual HRESULT createPropertyPages(
  71. SnapInView& view,
  72. LPPROPERTYSHEETCALLBACK provider,
  73. LONG_PTR handle
  74. );
  75. virtual HRESULT onDelete(
  76. SnapInView& view
  77. );
  78. virtual HRESULT onMenuCommand(
  79. SnapInView& view,
  80. long commandId
  81. );
  82. virtual HRESULT onRename(
  83. SnapInView& view,
  84. LPCOLESTR newName
  85. );
  86. virtual HRESULT onToolbarButtonClick(
  87. SnapInView& view,
  88. int buttonId
  89. );
  90. virtual HRESULT onToolbarSelect(
  91. SnapInView& view,
  92. BOOL scopeItem,
  93. BOOL selected
  94. );
  95. virtual HRESULT onContextHelp(SnapInView& view) throw ();
  96. // Function to sort an ObjectVector of ProxyPolicy's.
  97. static int __cdecl SortByMerit(
  98. const SdoResultItem* const* t1,
  99. const SdoResultItem* const* t2
  100. ) throw ();
  101. protected:
  102. virtual UINT mapResourceId(ResourceId id) const throw ();
  103. private:
  104. Sdo profile;
  105. LONG merit;
  106. WCHAR szMerit[10];
  107. };
  108. ///////////////////////////////////////////////////////////////////////////////
  109. //
  110. // CLASS
  111. //
  112. // ProxyPolicies
  113. //
  114. // DESCRIPTION
  115. //
  116. // Implements SnapInDataItem for the proxy policies scope pane node.
  117. //
  118. ///////////////////////////////////////////////////////////////////////////////
  119. class __declspec(uuid("3ad3b34e-6e1b-486c-ad73-d42f8fdcd41b")) ProxyPolicies;
  120. class ProxyPolicies : public SdoScopeItem
  121. {
  122. public:
  123. ProxyPolicies(SdoConnection& connection);
  124. ~ProxyPolicies() throw ();
  125. // Returns the ProxyPolicy with a given merit.
  126. ProxyPolicy& getPolicyByMerit(LONG merit) const throw ()
  127. { return *static_cast<ProxyPolicy*>(items[merit - 1]); }
  128. const GUID* getNodeType() const throw ()
  129. { return &__uuidof(this); }
  130. // Move a ProxyPolicy in response to a command.
  131. HRESULT movePolicy(
  132. SnapInView& view,
  133. ProxyPolicy& policy,
  134. LONG commandId
  135. );
  136. virtual HRESULT onContextHelp(SnapInView& view) throw ();
  137. protected:
  138. virtual SdoCollection getSelf();
  139. virtual void getResultItems(SdoEnum& src, ResultItems& dst);
  140. virtual void insertColumns(IHeaderCtrl2* headerCtrl);
  141. virtual HRESULT onMenuCommand(
  142. SnapInView& view,
  143. long commandId
  144. );
  145. virtual void propertyChanged(SnapInView& view, IASPROPERTIES id);
  146. private:
  147. ResourceString nameColumn;
  148. ResourceString orderColumn;
  149. };
  150. inline ProxyPolicies& ProxyPolicy::getParent() const throw ()
  151. {
  152. return static_cast<ProxyPolicies&>(parent);
  153. }
  154. #endif // PROXYPOLICIES_H