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.

148 lines
4.4 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1999 - 1999
  6. //
  7. // File: querynode.h
  8. //
  9. //--------------------------------------------------------------------------
  10. #ifndef _QUERYNODE_H
  11. #define _QUERYNODE_H
  12. #include "editor.h"
  13. //#include "connection.h"
  14. //#include "resource.h"
  15. //#include "snapdata.h"
  16. //////////////////////////////////////////////////////////////////////////////////
  17. // CADSIEditQueryData :
  18. class CADSIEditQueryData
  19. {
  20. public :
  21. CADSIEditQueryData() {}
  22. ~CADSIEditQueryData() {}
  23. void SetName(LPCWSTR lpszName) { m_sName = lpszName; }
  24. void GetName(CString& sName) { sName = m_sName; }
  25. void SetDN(LPCWSTR lpszDN) { m_sDN = lpszDN; }
  26. void GetDN(CString& szDN) { szDN = m_sDN; }
  27. PCWSTR GetDNString() { return m_sDN; }
  28. void SetFilter(LPCWSTR lpszFilter) { m_sFilter = lpszFilter; }
  29. void GetFilter(CString& sFilter) { sFilter = m_sFilter; }
  30. void SetRootPath(LPCWSTR lpszRootPath);
  31. void GetRootPath(CString& sRootPath) { sRootPath = m_sRootPath; }
  32. void SetScope(ADS_SCOPEENUM scope) { m_scope = scope; }
  33. ADS_SCOPEENUM GetScope() { return m_scope; }
  34. void GetDisplayPath(CString& sDisplayPath);
  35. void GetDisplayName(CString& sDisplayName);
  36. private :
  37. CString m_sName;
  38. CString m_sDN;
  39. CString m_sFilter;
  40. CString m_sRootPath;
  41. ADS_SCOPEENUM m_scope;
  42. };
  43. //////////////////////////////////////////////////////////////////////////////////
  44. // CADSIEditQueryNode :
  45. class CADSIEditQueryNode : public CADSIEditContainerNode
  46. {
  47. public:
  48. // enumeration for node states, to handle icon changes
  49. typedef enum
  50. {
  51. notLoaded = 0, // initial state, valid only if server never contacted
  52. loading,
  53. loaded,
  54. unableToLoad,
  55. accessDenied
  56. } nodeStateType;
  57. public:
  58. CADSIEditQueryNode() : m_pQueryData(NULL)
  59. {
  60. // NOTICE-2002/02/27-artm Under low memory environment CString can
  61. // throw out of memory exceptions. ADSI edit prefers to shutdown over
  62. // trying to handle the exception (since no other components depend on
  63. // the tool).
  64. m_sType.LoadString(IDS_QUERY_STRING);
  65. }
  66. CADSIEditQueryNode(CADsObject* pADsObject, CADSIEditQueryData* pQueryData);
  67. ~CADSIEditQueryNode()
  68. {
  69. }
  70. // node info
  71. DECLARE_NODE_GUID()
  72. virtual BOOL OnAddMenuItem(LPCONTEXTMENUITEM2 pContextMenuItem,
  73. long *pInsertionAllowed);
  74. virtual HRESULT OnCommand(long nCommandID,
  75. DATA_OBJECT_TYPES type,
  76. CComponentDataObject* pComponentData,
  77. CNodeList* pNodeList);
  78. virtual BOOL OnSetDeleteVerbState(DATA_OBJECT_TYPES type,
  79. BOOL* pbHide,
  80. CNodeList* pNodeList);
  81. virtual void OnDelete(CComponentDataObject* pComponentData,
  82. CNodeList* pNodeList);
  83. virtual CQueryObj* OnCreateQuery();
  84. virtual LPCWSTR GetString(int nCol);
  85. void OnSettings(CComponentDataObject* pComponentData);
  86. void OnRemove(CComponentDataObject* pComponentData);
  87. virtual BOOL HasPropertyPages(DATA_OBJECT_TYPES type,
  88. BOOL* pbHideVerb,
  89. CNodeList* pNodeList);
  90. virtual int GetImageIndex(BOOL bOpenImage);
  91. virtual BOOL OnSetRefreshVerbState(DATA_OBJECT_TYPES type,
  92. BOOL* pbHide,
  93. CNodeList* pNodeList);
  94. virtual LPCONTEXTMENUITEM2 OnGetContextMenuItemTable()
  95. { return CADSIEditQueryMenuHolder::GetContextMenuItem(); }
  96. virtual CBackgroundThread* CreateThreadObject()
  97. {
  98. return new CADSIEditBackgroundThread(); // override if need derived type of object
  99. }
  100. virtual BOOL CanCloseSheets();
  101. virtual void OnChangeState(CComponentDataObject* pComponentDataObject);
  102. virtual void OnHaveData(CObjBase* pObj, CComponentDataObject* pComponentDataObject);
  103. virtual void OnError(DWORD dwErr);
  104. void SetQueryData(CADSIEditQueryData* pQueryData) { m_pQueryData = pQueryData; }
  105. CADSIEditQueryData* GetQueryData() { return m_pQueryData; }
  106. //
  107. // Allow multiple selection
  108. //
  109. virtual HRESULT GetResultViewType(LPOLESTR* ppViewType, long* pViewOptions)
  110. {
  111. *pViewOptions = MMC_VIEW_OPTIONS_MULTISELECT;
  112. *ppViewType = NULL;
  113. return S_FALSE;
  114. }
  115. private:
  116. CADSIEditQueryData* m_pQueryData;
  117. CString m_sType;
  118. };
  119. #endif _QUERYNODE_H