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.

253 lines
6.5 KiB

  1. //____________________________________________________________________________
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997 - 1999
  5. //
  6. // File: viewdata.h
  7. //
  8. // Contents:
  9. //
  10. // Classes:
  11. //
  12. // Functions:
  13. //
  14. // History: 5/18/1997 RaviR Created
  15. //____________________________________________________________________________
  16. //
  17. #ifndef _MMC_VIEWDATA_H_
  18. #define _MMC_VIEWDATA_H_
  19. class CNode;
  20. class CColumnSetData;
  21. class CColumnInfoList;
  22. class CColumnSortInfo;
  23. class CComponent;
  24. // Note: CViewData should have no data of its own!
  25. class CViewData : public SViewData
  26. {
  27. public:
  28. void ToggleToolbar(long lMenuID);
  29. void ShowStdButtons(bool b);
  30. void ShowSnapinButtons(bool b);
  31. void UpdateToolbars(DWORD dwToolbars);
  32. SC ScUpdateStdbarVerbs();
  33. SC ScUpdateStdbarVerb (MMC_CONSOLE_VERB cVerb);
  34. SC ScUpdateStdbarVerb (MMC_CONSOLE_VERB cVerb, BYTE byState, BOOL bFlag);
  35. SC ScIsVerbSetContextForMultiSelect(bool& bMultiSelection);
  36. SC ScGetVerbSetData(IDataObject **ppDataObject, CComponent **ppComponent,
  37. bool& bScope, bool& bSelected
  38. #ifdef DBG
  39. , LPCTSTR *ppszNodeName
  40. #endif
  41. );
  42. // member access methods
  43. public:
  44. IScopeTree* GetScopeTree() const
  45. {
  46. ASSERT(m_pConsoleData != NULL);
  47. ASSERT(m_pConsoleData->m_spScopeTree != NULL);
  48. return m_pConsoleData ? m_pConsoleData->m_spScopeTree : NULL;
  49. }
  50. INodeCallback * GetNodeCallback() const
  51. {
  52. return m_spNodeCallback;
  53. }
  54. int GetViewID() const
  55. {
  56. return m_nViewID;
  57. }
  58. IFramePrivate* GetNodeManager() const
  59. {
  60. ASSERT(m_spNodeManager != NULL);
  61. return m_spNodeManager;
  62. }
  63. IResultDataPrivate* GetResultData() const
  64. {
  65. ASSERT(m_spResultData != NULL);
  66. return m_spResultData;
  67. }
  68. IImageListPrivate* GetRsltImageList() const
  69. {
  70. ASSERT(m_spRsltImageList != NULL);
  71. return m_spRsltImageList;
  72. }
  73. IConsoleVerb* GetVerbSet() const
  74. {
  75. ASSERT(m_spVerbSet != NULL);
  76. return m_spVerbSet;
  77. }
  78. HWND GetMainFrame() const
  79. {
  80. return m_pConsoleData ? m_pConsoleData->m_hwndMainFrame : NULL;
  81. }
  82. CConsoleFrame* GetConsoleFrame() const
  83. {
  84. return m_pConsoleData ? m_pConsoleData->GetConsoleFrame() : NULL;
  85. }
  86. HWND GetView() const
  87. {
  88. return m_hwndView;
  89. }
  90. HWND GetListCtrl() const
  91. {
  92. return m_hwndListCtrl;
  93. }
  94. HWND GetChildFrame() const
  95. {
  96. return m_hwndChildFrame;
  97. }
  98. // the various view options
  99. DWORD GetListOptions() const {return m_rvt.GetListOptions();}
  100. DWORD GetHTMLOptions() const {return m_rvt.GetHTMLOptions();}
  101. DWORD GetOCXOptions() const {return m_rvt.GetOCXOptions();}
  102. DWORD GetMiscOptions() const {return m_rvt.GetMiscOptions();}
  103. long GetWindowOptions() const
  104. {
  105. return m_lWindowOptions;
  106. }
  107. IControlbarsCache* GetControlbarsCache()
  108. {
  109. if (m_spControlbarsCache == NULL)
  110. CreateControlbarsCache();
  111. ASSERT(m_spControlbarsCache != NULL);
  112. return m_spControlbarsCache;
  113. }
  114. CMultiSelection* GetMultiSelection() const
  115. {
  116. return m_pMultiSelection;
  117. }
  118. void SetMultiSelection(CMultiSelection* pMultiSelection)
  119. {
  120. m_pMultiSelection = pMultiSelection;
  121. }
  122. bool IsStatusBarVisible(void) const
  123. {
  124. return ((m_dwToolbarsDisplayed & STATUS_BAR) != 0);
  125. }
  126. bool IsAuthorMode() const
  127. {
  128. ASSERT(m_pConsoleData != NULL);
  129. return ((m_pConsoleData) ? (m_pConsoleData->GetMode() == eMode_Author) : true);
  130. }
  131. bool IsUserMode() const
  132. {
  133. return (!IsAuthorMode());
  134. }
  135. // Needed for "New Window From Here" menu item.
  136. bool IsUser_SDIMode() const
  137. {
  138. return ((m_pConsoleData) ? (m_pConsoleData->GetMode() == eMode_User_SDI) : true);
  139. }
  140. bool AllowViewCustomization(void) const
  141. {
  142. ASSERT(m_pConsoleData != NULL);
  143. if (IsUserMode())
  144. return (!(m_pConsoleData->m_dwFlags & eFlag_PreventViewCustomization));
  145. return true;
  146. }
  147. DWORD GetToolbarsDisplayed(void) const
  148. {
  149. return (ToolbarsOf (m_dwToolbarsDisplayed));
  150. }
  151. void SetToolbarsDisplayed(DWORD dwToolbars)
  152. {
  153. m_dwToolbarsDisplayed = StatusBarOf (m_dwToolbarsDisplayed) |
  154. ToolbarsOf (dwToolbars);
  155. }
  156. bool IsColumnPersistObjectInitialized()
  157. {
  158. if ( (NULL != m_pConsoleData) &&
  159. (NULL != m_pConsoleData->m_spPersistStreamColumnData) &&
  160. (NULL != m_pConsoleData->m_pXMLPersistColumnData) )
  161. return true;
  162. return false;
  163. }
  164. void InitializeColumnPersistObject(IPersistStream* pPersistStreamColumnData, CXMLObject* pPersistXMLColumnData)
  165. {
  166. ASSERT(m_pConsoleData != NULL);
  167. if ( (NULL != m_pConsoleData ) &&
  168. (NULL == m_pConsoleData->m_spPersistStreamColumnData) )
  169. {
  170. m_pConsoleData->m_spPersistStreamColumnData = pPersistStreamColumnData;
  171. // NOTE!! the pointer below relies on reference held by m_spPersistStreamColumnData
  172. m_pConsoleData->m_pXMLPersistColumnData = pPersistXMLColumnData;
  173. ASSERT(pPersistXMLColumnData != NULL);
  174. }
  175. }
  176. void SetSnapinChangingView()
  177. {
  178. m_bSnapinChangingView = TRUE;
  179. }
  180. void ResetSnapinChangingView()
  181. {
  182. m_bSnapinChangingView = FALSE;
  183. }
  184. BOOL IsSnapinChangingView()
  185. {
  186. return m_bSnapinChangingView;
  187. }
  188. public:
  189. BOOL RetrieveColumnData( const CLSID& refSnapinCLSID, const SColumnSetID& colID,
  190. CColumnSetData& columnSetData);
  191. BOOL SaveColumnData( const CLSID& refSnapinCLSID, const SColumnSetID& colID,
  192. CColumnSetData& columnSetData);
  193. SC ScSaveColumnInfoList(const CLSID& refSnapinCLSID, const SColumnSetID& colID, const CColumnInfoList& colInfoList);
  194. SC ScSaveColumnSortData(const CLSID& refSnapinCLSID, const SColumnSetID& colID, const CColumnSortInfo& colSortInfo);
  195. VOID DeleteColumnData( const CLSID& refSnapinCLSID, const SColumnSetID& colID);
  196. CNode* GetSelectedNode () const;
  197. private:
  198. void CreateControlbarsCache();
  199. void ShowMenuBar();
  200. }; // class CViewData
  201. #endif // _MMC_VIEWDATA_H_