Source code of Windows XP (NT5)
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.

144 lines
4.1 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. m_sType.LoadString(IDS_QUERY_STRING);
  61. }
  62. CADSIEditQueryNode(CADsObject* pADsObject, CADSIEditQueryData* pQueryData);
  63. ~CADSIEditQueryNode()
  64. {
  65. }
  66. // node info
  67. DECLARE_NODE_GUID()
  68. virtual BOOL OnAddMenuItem(LPCONTEXTMENUITEM2 pContextMenuItem,
  69. long *pInsertionAllowed);
  70. virtual HRESULT OnCommand(long nCommandID,
  71. DATA_OBJECT_TYPES type,
  72. CComponentDataObject* pComponentData,
  73. CNodeList* pNodeList);
  74. virtual BOOL OnSetDeleteVerbState(DATA_OBJECT_TYPES type,
  75. BOOL* pbHide,
  76. CNodeList* pNodeList);
  77. virtual void OnDelete(CComponentDataObject* pComponentData,
  78. CNodeList* pNodeList) { ASSERT(FALSE); }
  79. virtual CQueryObj* OnCreateQuery();
  80. virtual LPCWSTR GetString(int nCol);
  81. void OnSettings(CComponentDataObject* pComponentData);
  82. void OnRemove(CComponentDataObject* pComponentData);
  83. virtual BOOL HasPropertyPages(DATA_OBJECT_TYPES type,
  84. BOOL* pbHideVerb,
  85. CNodeList* pNodeList);
  86. virtual int GetImageIndex(BOOL bOpenImage);
  87. virtual BOOL OnSetRefreshVerbState(DATA_OBJECT_TYPES type,
  88. BOOL* pbHide,
  89. CNodeList* pNodeList);
  90. virtual LPCONTEXTMENUITEM2 OnGetContextMenuItemTable()
  91. { return CADSIEditQueryMenuHolder::GetContextMenuItem(); }
  92. virtual CBackgroundThread* CreateThreadObject()
  93. {
  94. return new CADSIEditBackgroundThread(); // override if need derived type of object
  95. }
  96. virtual BOOL CanCloseSheets();
  97. virtual void OnChangeState(CComponentDataObject* pComponentDataObject);
  98. virtual void OnHaveData(CObjBase* pObj, CComponentDataObject* pComponentDataObject);
  99. virtual void OnError(DWORD dwErr);
  100. void SetQueryData(CADSIEditQueryData* pQueryData) { m_pQueryData = pQueryData; }
  101. CADSIEditQueryData* GetQueryData() { return m_pQueryData; }
  102. //
  103. // Allow multiple selection
  104. //
  105. virtual HRESULT GetResultViewType(LPOLESTR* ppViewType, long* pViewOptions)
  106. {
  107. *pViewOptions = MMC_VIEW_OPTIONS_MULTISELECT;
  108. *ppViewType = NULL;
  109. return S_FALSE;
  110. }
  111. private:
  112. CADSIEditQueryData* m_pQueryData;
  113. CString m_sType;
  114. };
  115. #endif _QUERYNODE_H