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.

126 lines
4.0 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1998 - 1999
  6. //
  7. // File: snapdata.h
  8. //
  9. //--------------------------------------------------------------------------
  10. #ifndef _SNAPDATA_H
  11. #define _SNAPDATA_H
  12. #include "adsiedit.h"
  13. #include "common.h"
  14. enum
  15. {
  16. //Root node verbs
  17. IDM_CONNECT_TO,
  18. IDM_SETTINGS_CONNECTION,
  19. IDM_REMOVE_CONNECTION,
  20. IDM_UPDATE_SCHEMA,
  21. IDM_FILTER,
  22. //Container node verbs
  23. IDM_RENAME,
  24. IDM_MOVE,
  25. IDM_NEW_OBJECT,
  26. IDM_NEW_QUERY,
  27. IDM_NEW_CONNECT_FROM_HERE,
  28. IDM_NEW_NC_CONNECT_FROM_HERE,
  29. //Query node verbs
  30. IDM_REMOVE_QUERY,
  31. IDM_SETTINGS_QUERY
  32. };
  33. DECLARE_MENU(CADSIEditRootMenuHolder)
  34. DECLARE_MENU(CADSIEditConnectMenuHolder)
  35. DECLARE_MENU(CADSIEditContainerMenuHolder)
  36. DECLARE_MENU(CADSIEditLeafMenuHolder)
  37. DECLARE_MENU(CADSIEditQueryMenuHolder)
  38. // # of items per folder: must be >=0 and <= 0xFFFFFFFF (DWORD) to serialize
  39. #define ADSIEDIT_QUERY_OBJ_COUNT_DEFAULT 10000 // default value
  40. #define ADSIEDIT_QUERY_OBJ_COUNT_MIN 10 // min value
  41. #define ADSIEDIT_QUERY_OBJ_COUNT_MAX 0xFFFFFFFF // max value
  42. #define ADSIEDIT_QUERY_OBJ_TEXT_COUNT_MAX 9 // max # of bytes in text
  43. ///////////////////////////////////////////////////////////////////
  44. // CADSIEditRootData
  45. class CADSIEditRootData : public CRootData
  46. {
  47. public:
  48. CADSIEditRootData(CComponentDataObject* pComponentData);
  49. virtual ~CADSIEditRootData();
  50. // node info
  51. DECLARE_NODE_GUID()
  52. virtual HRESULT OnCommand(long nCommandID,
  53. DATA_OBJECT_TYPES type,
  54. CComponentDataObject* pComponentData,
  55. CNodeList* pNodeList);
  56. virtual void OnDelete(CComponentDataObject* pComponentData,
  57. CNodeList* pNodeList) { ASSERT(FALSE);}
  58. virtual BOOL OnRefresh(CComponentDataObject* pComponentData,
  59. CNodeList* pNodeList);
  60. virtual BOOL OnSetRefreshVerbState(DATA_OBJECT_TYPES type,
  61. BOOL* pbHide,
  62. CNodeList* pNodeList);
  63. virtual HRESULT GetResultViewType(LPOLESTR* ppViewType, long* pViewOptions);
  64. virtual HRESULT OnShow(LPCONSOLE lpConsole);
  65. virtual int GetImageIndex(BOOL bOpenImage) { return ROOT_IMAGE;}
  66. void OnConnectTo(CComponentDataObject* pComponentData);
  67. // IStream manipulation helpers overrides
  68. virtual HRESULT IsDirty();
  69. virtual HRESULT Load(IStream* pStm);
  70. virtual HRESULT Save(IStream* pStm, BOOL fClearDirty);
  71. // Accessors for the Connect to... MRUs
  72. void GetDNMRU(CStringList* psDNList) { CopyStringList(psDNList, &m_sDNMRU); }
  73. void SetDNMRU(CStringList* psDNList) { CopyStringList(&m_sDNMRU, psDNList); }
  74. void GetServerMRU(CStringList* psServerList) { CopyStringList(psServerList, &m_sServerMRU); }
  75. void SetServerMRU(CStringList* psServerList) { CopyStringList(&m_sServerMRU, psServerList); }
  76. HRESULT LoadMRUs(IStream* pStm);
  77. HRESULT SaveMRUs(IStream* pStm);
  78. BOOL FindNode(LPCWSTR lpszPath, CList<CTreeNode*, CTreeNode*>& foundNodeList);
  79. CColumnSet* GetColumnSet() { return ((CADSIEditComponentDataObject*)GetComponentDataObject())->GetColumnSet(); }
  80. LPCWSTR GetColumnID() { return ((CADSIEditComponentDataObject*)GetComponentDataObject())->GetColumnSet()->GetColumnID(); }
  81. virtual LPWSTR GetDescriptionBarText()
  82. {
  83. LPWSTR lpszFormat = L"%d Connection(s)";
  84. int iCount = m_containerChildList.GetCount() + m_leafChildList.GetCount();
  85. m_szDescriptionText.Format(lpszFormat, iCount);
  86. return (LPWSTR)(LPCWSTR)m_szDescriptionText;
  87. }
  88. protected:
  89. virtual BOOL CanCloseSheets();
  90. virtual BOOL OnAddMenuItem(LPCONTEXTMENUITEM2 pContextMenuItem,
  91. long *pInsertionAllowed);
  92. virtual LPCONTEXTMENUITEM2 OnGetContextMenuItemTable()
  93. { return CADSIEditRootMenuHolder::GetContextMenuItem(); }
  94. private:
  95. CStringList m_sDNMRU;
  96. CStringList m_sServerMRU;
  97. CString m_szDescriptionText;
  98. };
  99. #endif // _SNAPDATA_H