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.

188 lines
5.3 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. /*++
  3. Copyright (C) Microsoft Corporation
  4. Module Name:
  5. PolicyNode.h
  6. Abstract:
  7. Header file for the CPolicyNode subnode
  8. See PolicyNode.cpp for implementation.
  9. Revision History:
  10. mmaguire 12/15/97 - created
  11. --*/
  12. //////////////////////////////////////////////////////////////////////////////
  13. #if !defined(_NAP_POLICY_NODE_H_)
  14. #define _NAP_POLICY_NODE_H_
  15. //////////////////////////////////////////////////////////////////////////////
  16. // BEGIN INCLUDES
  17. //
  18. // where we can find what this class derives from:
  19. //
  20. #include "SnapinNode.h"
  21. #include "Condition.h"
  22. //
  23. //
  24. // For include file dependency reasons, we have forward declarations here,
  25. // and include the needed header files in our .cpp files.
  26. //
  27. #include "IASAttrList.h"
  28. class CPoliciesNode;
  29. class CPolicyPage1;
  30. class CPolicyPage2;
  31. class CComponentData;
  32. class CComponent;
  33. //
  34. // END INCLUDES
  35. //////////////////////////////////////////////////////////////////////////////
  36. // policy node
  37. class CPolicyNode : public CSnapinNode< CPolicyNode, CComponentData, CComponent >
  38. {
  39. public:
  40. CPolicyNode(CSnapInItem* pParentNode,
  41. LPTSTR pszServerAddress,
  42. CIASAttrList* pAttrList,
  43. BOOL fBrandNewNode,
  44. BOOL fUseActiveDirectory,
  45. bool isWin2k
  46. );
  47. ~CPolicyNode();
  48. public:
  49. SNAPINMENUID(IDM_POLICY_NODE)
  50. BEGIN_SNAPINTOOLBARID_MAP(CPolicyNode)
  51. SNAPINTOOLBARID_ENTRY(IDR_POLICY_TOOLBAR)
  52. END_SNAPINTOOLBARID_MAP()
  53. BEGIN_SNAPINCOMMAND_MAP(CPolicyNode, TRUE)
  54. SNAPINCOMMAND_ENTRY(ID_MENUITEM_POLICY_TOP__MOVE_UP, OnPolicyMoveUp)
  55. SNAPINCOMMAND_ENTRY(ID_BUTTON_POLICY_MOVEUP, OnPolicyMoveUp)
  56. SNAPINCOMMAND_ENTRY(ID_MENUITEM_POLICY_TOP__MOVE_DOWN, OnPolicyMoveDown)
  57. SNAPINCOMMAND_ENTRY(ID_BUTTON_POLICY_MOVEDOWN, OnPolicyMoveDown)
  58. END_SNAPINCOMMAND_MAP()
  59. HRESULT OnPolicyMoveUp( bool &bHandled, CSnapInObjectRootBase* pObj );
  60. HRESULT OnPolicyMoveDown( bool &bHandled, CSnapInObjectRootBase* pObj );
  61. STDMETHOD(CreatePropertyPages)(
  62. LPPROPERTYSHEETCALLBACK pPropertySheetCallback
  63. , LONG_PTR handle
  64. , IUnknown* pUnk
  65. , DATA_OBJECT_TYPES type
  66. );
  67. STDMETHOD(ControlbarNotify)(IControlbar *pControlbar,
  68. IExtendControlbar *pExtendControlbar,
  69. CSimpleMap<UINT, IUnknown*>* pToolbarMap,
  70. MMC_NOTIFY_TYPE event,
  71. LPARAM arg,
  72. LPARAM param,
  73. CSnapInObjectRootBase* pObj,
  74. DATA_OBJECT_TYPES type);
  75. STDMETHOD(QueryPagesFor)( DATA_OBJECT_TYPES type );
  76. OLECHAR* GetResultPaneColInfo(int nCol);
  77. void UpdateMenuState(UINT id, LPTSTR pBuf, UINT *flags);
  78. BOOL UpdateToolbarButton(UINT id, BYTE fsState);
  79. virtual HRESULT OnRename(
  80. LPARAM arg
  81. , LPARAM param
  82. , IComponentData * pComponentData
  83. , IComponent * pComponent
  84. , DATA_OBJECT_TYPES type
  85. );
  86. virtual HRESULT OnDelete(
  87. LPARAM arg
  88. , LPARAM param
  89. , IComponentData * pComponentData
  90. , IComponent * pComponent
  91. , DATA_OBJECT_TYPES type
  92. , BOOL fSilent
  93. );
  94. virtual HRESULT OnPropertyChange(
  95. LPARAM arg
  96. , LPARAM param
  97. , IComponentData * pComponentData
  98. , IComponent * pComponent
  99. , DATA_OBJECT_TYPES type
  100. );
  101. virtual HRESULT SetVerbs( IConsoleVerb * pConsoleVerb );
  102. CComponentData * GetComponentData( void );
  103. int GetMerit();
  104. BOOL SetMerit(int nMeritValue);
  105. //
  106. // set the sdo pointer. Here we just need the PolicySdo pointer
  107. //
  108. HRESULT SetSdo( ISdo *pPolicySdo
  109. , ISdoDictionaryOld *pDictionarySdo
  110. , ISdo *pProfileSdo
  111. , ISdoCollection *pProfilesCollectionSdo
  112. , ISdoCollection *pPoliciesCollectionSdo
  113. , ISdoServiceControl * pSdoServiceControl
  114. );
  115. HRESULT LoadSdoData();
  116. BOOL IsBrandNew() { return m_fBrandNewNode;}
  117. void SetBrandNew(BOOL fBrandNew) { m_fBrandNewNode = fBrandNew; }
  118. LPTSTR m_pszServerAddress; // server name
  119. CPolicyPage1* m_pPolicyPage1; // pointer to the property page of this node
  120. CComPtr<ISdo> m_spPolicySdo;
  121. CComPtr<ISdo> m_spProfileSdo;
  122. protected:
  123. // Interface pointers to the Sdo objects.
  124. CComPtr<ISdoDictionaryOld> m_spDictionarySdo;
  125. CComPtr<ISdoCollection> m_spProfilesCollectionSdo;
  126. CComPtr<ISdoCollection> m_spPoliciesCollectionSdo;
  127. // Smart pointer to interface for telling service to reload data.
  128. CComPtr<ISdoServiceControl> m_spSdoServiceControl;
  129. // pointer to the global condition attribute list
  130. //
  131. CIASAttrList *m_pAttrList;
  132. private:
  133. int m_nMeritValue; // a numeric value, actually invoking sequence
  134. TCHAR m_tszMeritString[64]; // merit value in string format
  135. BOOL m_fBrandNewNode; // is this a new node?
  136. BOOL m_fUseActiveDirectory; // Are we getting this policy from active directory?
  137. LPTSTR m_ptzLocation;
  138. bool m_isWin2k;
  139. CSnapInObjectRootBase* m_pControBarNotifySnapinObj;
  140. };
  141. #endif // _NAP_CLIENT_NODE_H_