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.

142 lines
5.0 KiB

  1. //----------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 2001.
  5. //
  6. // File: Mngrfldr.h
  7. //
  8. // Contents: Wireless Policy Snapin - Policy Main Page Manager.
  9. //
  10. //
  11. // History: TaroonM
  12. // 10/30/01
  13. //
  14. //----------------------------------------------------------------------------
  15. #ifndef _MNGRFLDR_H
  16. #define _MNGRFLDR_H
  17. ///////////////////////////////////////////////////////////////////////////////
  18. // class CWirelessManagerFolder - represents the MMC scope view item
  19. class CWirelessManagerFolder :
  20. public CWirelessSnapInDataObjectImpl <CWirelessManagerFolder>,
  21. public CDataObjectImpl <CWirelessManagerFolder>,
  22. public CComObjectRoot,
  23. public CSnapObject
  24. {
  25. // ATL Maps
  26. DECLARE_NOT_AGGREGATABLE(CWirelessManagerFolder)
  27. BEGIN_COM_MAP(CWirelessManagerFolder)
  28. COM_INTERFACE_ENTRY(IDataObject)
  29. COM_INTERFACE_ENTRY(IWirelessSnapInDataObject)
  30. END_COM_MAP()
  31. public:
  32. CWirelessManagerFolder ();
  33. virtual ~CWirelessManagerFolder ();
  34. virtual void Initialize (CComponentDataImpl* pComponentDataImpl, CComponentImpl* pComponentImpl, int nImage, int nOpenImage, BOOL bHasChildrenBox);
  35. public:
  36. // IWirelessSnapInDataObject interface
  37. // handle IExtendContextMenu
  38. STDMETHOD(AddMenuItems)( LPCONTEXTMENUCALLBACK piCallback,
  39. long *pInsertionAllowed );
  40. STDMETHOD(Command)( long lCommandID,
  41. IConsoleNameSpace *pNameSpace );
  42. STDMETHOD(QueryPagesFor)( void );
  43. // Notify helper
  44. STDMETHOD(OnPropertyChange)(LPARAM lParam, LPCONSOLE pConsole );
  45. // let us know when we are 'bout to go away
  46. STDMETHOD(Destroy)( void );
  47. // handle IComponent and IComponentData
  48. STDMETHOD(Notify)( MMC_NOTIFY_TYPE event,
  49. LPARAM arg,
  50. LPARAM param,
  51. BOOL bComponentData,
  52. IConsole *pConsole,
  53. IHeaderCtrl *pHeader );
  54. // handle IComponent
  55. STDMETHOD(GetResultDisplayInfo)( RESULTDATAITEM *pResultDataItem );
  56. // handle IComponentData
  57. STDMETHOD(GetScopeDisplayInfo)( SCOPEDATAITEM *pScopeDataItem );
  58. // IWirelessSnapInData
  59. STDMETHOD(GetScopeData)( SCOPEDATAITEM **ppScopeDataItem );
  60. STDMETHOD(GetGuidForCompare)( GUID *pGuid );
  61. STDMETHOD(AdjustVerbState)(LPCONSOLEVERB pConsoleVerb);
  62. STDMETHOD_(BOOL, UpdateToolbarButton)( UINT id, // button ID
  63. BOOL bSnapObjSelected, // ==TRUE when result/scope item is selected
  64. BYTE fsState ); // enable/disable this button state by returning TRUE/FALSE
  65. void RemoveResultItem( LPUNKNOWN pUnkWalkingDead );
  66. public:
  67. STDMETHOD_(void, SetHeaders)(LPHEADERCTRL pHeader, LPRESULTDATA pResult);
  68. STDMETHOD(EnumerateResults)(LPRESULTDATA pResult, int nSortColumn, DWORD dwSortOrder);
  69. // ExtendContextMenu helpers
  70. public:
  71. // Note: The following IDM_* have been defined in resource.h because they
  72. // are potential candidates for toolbar buttons. The value assigned to
  73. // each IDM_* is the value of the related IDS_MENUDESCRIPTION_* string ID.
  74. /*
  75. enum
  76. {
  77. // Identifiers for each of the commands/views to be inserted into the context menu
  78. IDM_CREATENEWSECPOL,
  79. IDM_MANAGENEGPOLS_FILTERS,
  80. IDM_IMPORTFILE,
  81. IDM_EXPORTFILE,
  82. IDM_POLICYINTEGRITYCHECK,
  83. IDM_RESTOREDEFAULTPOLICIES
  84. };
  85. */
  86. // IExtendControlbar helpers
  87. public:
  88. BEGIN_SNAPINTOOLBARID_MAP(CWirelessManagerFolder)
  89. SNAPINTOOLBARID_ENTRY(IDR_TOOLBAR_WIRELESS_MGR_SCOPE)
  90. END_SNAPINTOOLBARID_MAP(CWirelessManagerFolder)
  91. // Notify helpers
  92. protected:
  93. HRESULT ForceRefresh( LPRESULTDATA pResultData );
  94. HRESULT OnScopeExpand( LPCONSOLENAMESPACE pConsoleNameSpace, HSCOPEITEM hScopeItem );
  95. HRESULT OnAddImages(LPARAM arg, LPARAM param, IImageList* pImageList );
  96. // attributes
  97. public:
  98. void SetExtScopeObject( CComObject<CWirelessManagerFolder>* pScope )
  99. {
  100. ASSERT( NULL == m_pExtScopeObject );
  101. m_pExtScopeObject = pScope;
  102. }
  103. CComObject<CWirelessManagerFolder>* GetExtScopeObject() { return m_pExtScopeObject; }
  104. LPSCOPEDATAITEM GetScopeItem() {return &m_ScopeItem;};
  105. void SetNodeNameByLocation();
  106. void LocationPageDisplayEnable (BOOL bOk) {m_bLocationPageOk = bOk;};
  107. protected:
  108. BOOL IsEnumerated() {return m_bEnumerated;};
  109. void SetEnumerated(BOOL bState) { m_bEnumerated = bState; };
  110. void GenerateUniqueSecPolicyName (CString& strName, UINT nID);
  111. HRESULT CreateWirelessPolicy(PWIRELESS_POLICY_DATA pPolicy);
  112. private:
  113. CComObject <CWirelessManagerFolder> *m_pExtScopeObject; // NULL if we are a standalone snap-in
  114. TCHAR *m_ptszResultDisplayName;
  115. BOOL m_bEnumerated;
  116. SCOPEDATAITEM m_ScopeItem;
  117. BOOL m_bLocationPageOk;
  118. DWORD m_dwSortOrder; // default is 0, else RSI_DESCENDING
  119. int m_nSortColumn;
  120. BOOL m_bScopeItemInserted;
  121. int m_dwNumPolItems;
  122. };
  123. #endif
  124.