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.

166 lines
5.1 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows/NT **/
  3. /** Copyright(c) Microsoft Corporation, 1997 - 1998 **/
  4. /**********************************************************************/
  5. /*
  6. TAPIhand.h
  7. Header file for tapi specific base handler classes and query obj
  8. FILE HISTORY:
  9. */
  10. #ifndef _TAPIHAND_H
  11. #define _TAPIHAND_H
  12. #ifndef _HANDLERS_H
  13. #include <handlers.h>
  14. #endif
  15. #ifndef _QUERYOBJ_H
  16. #include <queryobj.h>
  17. #endif
  18. extern const TCHAR g_szDefaultHelpTopic[];
  19. /*---------------------------------------------------------------------------
  20. Class: CHandlerEx
  21. ---------------------------------------------------------------------------*/
  22. class CHandlerEx
  23. {
  24. // Interface
  25. public:
  26. virtual HRESULT InitializeNode(ITFSNode * pNode) = 0;
  27. LPCTSTR GetDisplayName() { return m_strDisplayName; }
  28. void SetDisplayName(LPCTSTR pName) { m_strDisplayName = pName; }
  29. private:
  30. CString m_strDisplayName;
  31. };
  32. /*---------------------------------------------------------------------------
  33. Class: CTapiHandler
  34. ---------------------------------------------------------------------------*/
  35. class CTapiHandler :
  36. public CHandler,
  37. public CHandlerEx
  38. {
  39. public:
  40. CTapiHandler(ITFSComponentData *pCompData) : CHandler(pCompData) {};
  41. ~CTapiHandler() {};
  42. // base handler virtual function over-rides
  43. virtual HRESULT SaveColumns(ITFSComponent *, MMC_COOKIE, LPARAM, LPARAM);
  44. // by default we don't allow nodes to be renamed
  45. OVERRIDE_BaseHandlerNotify_OnRename() { return hrFalse; }
  46. OVERRIDE_BaseResultHandlerNotify_OnResultSelect();
  47. OVERRIDE_BaseResultHandlerNotify_OnResultDelete();
  48. OVERRIDE_BaseResultHandlerNotify_OnResultContextHelp();
  49. // Multi-select functionalty
  50. OVERRIDE_ResultHandler_OnCreateDataObject();
  51. void EnableVerbs(IConsoleVerb * pConsoleVerb,
  52. MMC_BUTTON_STATE ButtonState[],
  53. BOOL bEnable[]);
  54. protected:
  55. HRESULT CreateMultiSelectData(ITFSComponent * pComponent, CDataObject * pObject);
  56. public:
  57. };
  58. /*---------------------------------------------------------------------------
  59. Class: CMTTapiHandler
  60. ---------------------------------------------------------------------------*/
  61. class CMTTapiHandler :
  62. public CMTHandler,
  63. public CHandlerEx
  64. {
  65. public:
  66. // enumeration for node states, to handle icon changes
  67. typedef enum
  68. {
  69. notLoaded = 0, // initial state, valid only if server never contacted
  70. loading,
  71. loaded,
  72. unableToLoad
  73. } nodeStateType;
  74. CMTTapiHandler(ITFSComponentData *pCompData) : CMTHandler(pCompData)
  75. { m_nState = notLoaded; m_bSelected = FALSE; m_fExpandSync = FALSE; }
  76. ~CMTTapiHandler() {};
  77. // base handler virtual function over-rides
  78. virtual HRESULT SaveColumns(ITFSComponent *, MMC_COOKIE, LPARAM, LPARAM);
  79. // by default we don't allow nodes to be renamed
  80. OVERRIDE_BaseHandlerNotify_OnRename() { return hrFalse; }
  81. OVERRIDE_BaseHandlerNotify_OnExpandSync();
  82. // base result handler overrides
  83. OVERRIDE_BaseResultHandlerNotify_OnResultRefresh();
  84. OVERRIDE_BaseResultHandlerNotify_OnResultUpdateView();
  85. OVERRIDE_BaseResultHandlerNotify_OnResultSelect();
  86. OVERRIDE_BaseResultHandlerNotify_OnResultContextHelp();
  87. // Multi-select functionalty
  88. OVERRIDE_ResultHandler_OnCreateDataObject();
  89. void EnableVerbs(IConsoleVerb * pConsoleVerb,
  90. MMC_BUTTON_STATE ButtonState[],
  91. BOOL bEnable[]);
  92. protected:
  93. virtual void OnChangeState(ITFSNode* pNode);
  94. virtual void GetErrorPrefix(ITFSNode * pNode, CString * pstrPrefix) { };
  95. virtual void OnHaveData(ITFSNode * pParentNode, ITFSNode * pNewNode)
  96. {
  97. if (pNewNode->IsContainer())
  98. {
  99. // assume all the child containers are derived from this class
  100. //((CTapiMTContainer*)pNode)->SetServer(GetServer());
  101. }
  102. pParentNode->AddChild(pNewNode);
  103. }
  104. virtual void UpdateConsoleVerbs(IConsoleVerb * pConsoleVerb, LONG_PTR dwNodeType, BOOL bMultiSelect = FALSE);
  105. void UpdateStandardVerbs(ITFSNode * pToolbar, LONG_PTR dwNodeType);
  106. HRESULT CreateMultiSelectData(ITFSComponent * pComponent, CDataObject * pObject);
  107. void ExpandNode(ITFSNode * pNode, BOOL fExpand);
  108. protected:
  109. BOOL m_bSelected;
  110. BOOL m_fExpandSync;
  111. };
  112. /*---------------------------------------------------------------------------
  113. Class: CTapiQueryObj : general purpose base class
  114. ---------------------------------------------------------------------------*/
  115. class CTapiQueryObj : public CNodeQueryObject
  116. {
  117. public:
  118. CTapiQueryObj
  119. (
  120. ITFSComponentData * pTFSCompData,
  121. ITFSNodeMgr * pNodeMgr
  122. ) : m_dwErr(0)
  123. {
  124. m_spTFSCompData.Set(pTFSCompData);
  125. m_spNodeMgr.Set(pNodeMgr);
  126. }
  127. CQueueDataListBase & GetQueue() { return m_dataQueue; }
  128. public:
  129. CString m_strServer;
  130. SPITFSComponentData m_spTFSCompData;
  131. SPITFSNodeMgr m_spNodeMgr;
  132. DWORD m_dwErr;
  133. };
  134. #endif _TAPIHAND_H