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.

144 lines
4.3 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows/NT **/
  3. /** Copyright(c) Microsoft Corporation, 1997 - 1998 **/
  4. /**********************************************************************/
  5. /*
  6. lines.h
  7. FILE HISTORY:
  8. */
  9. #ifndef _LINES_H
  10. #define _LINES_H
  11. #ifndef _TAPIHAND_H
  12. #include "tapihand.h"
  13. #endif
  14. #ifndef _TAPIDB_H
  15. #include "tapidb.h"
  16. #endif
  17. #define TAPISNAP_UPDATE_STATUS ( 0x10000000 )
  18. typedef struct TapiStrRecord_t
  19. {
  20. CString strName;
  21. CString strUsers;
  22. } TapiStrRecord;
  23. // hash table for Tapi string records
  24. typedef CMap<int, int, TapiStrRecord, TapiStrRecord&> CTapiRecordMap;
  25. typedef CMap<int, int, CString, CString&> CTapiStatusRecordMap;
  26. /*---------------------------------------------------------------------------
  27. Class: CProviderHandler
  28. ---------------------------------------------------------------------------*/
  29. class CProviderHandler : public CTapiHandler
  30. {
  31. public:
  32. CProviderHandler(ITFSComponentData* pTFSComponentData);
  33. ~CProviderHandler();
  34. // Interface
  35. public:
  36. // base handler functionality we override
  37. OVERRIDE_NodeHandler_HasPropertyPages();
  38. OVERRIDE_NodeHandler_CreatePropertyPages();
  39. OVERRIDE_NodeHandler_OnAddMenuItems();
  40. OVERRIDE_NodeHandler_OnCommand();
  41. OVERRIDE_NodeHandler_GetString()
  42. { return (nCol == 0) ? GetDisplayName() : NULL; }
  43. // Base handler notifications we handle
  44. OVERRIDE_BaseHandlerNotify_OnCreateNodeId2();
  45. OVERRIDE_BaseHandlerNotify_OnExpand();
  46. OVERRIDE_BaseHandlerNotify_OnDelete();
  47. OVERRIDE_BaseHandlerNotify_OnPropertyChange();
  48. // Result handler functionality we override
  49. OVERRIDE_BaseResultHandlerNotify_OnResultSelect();
  50. OVERRIDE_BaseResultHandlerNotify_OnResultUpdateView();
  51. OVERRIDE_BaseResultHandlerNotify_OnResultItemClkOrDblClk();
  52. OVERRIDE_ResultHandler_OnGetResultViewType();
  53. OVERRIDE_ResultHandler_GetVirtualString();
  54. OVERRIDE_ResultHandler_GetVirtualImage();
  55. OVERRIDE_ResultHandler_AddMenuItems();
  56. OVERRIDE_ResultHandler_Command();
  57. STDMETHODIMP CacheHint(int nStartIndex, int nEndIndex);
  58. STDMETHODIMP SortItems(int nColumn,
  59. DWORD dwSortOptions,
  60. LPARAM lUserParam);
  61. // base handler overrides
  62. virtual HRESULT LoadColumns(ITFSComponent *, MMC_COOKIE, LPARAM, LPARAM);
  63. // multi select support
  64. virtual const GUID * GetVirtualGuid(int nIndex)
  65. {
  66. return &GUID_TapiLineNodeType;
  67. }
  68. public:
  69. // CMTTapiHandler functionality
  70. virtual HRESULT InitializeNode(ITFSNode * pNode);
  71. virtual int GetImageIndex(BOOL bOpenImage);
  72. ITFSQueryObject* OnCreateQuery(ITFSNode * pNode);
  73. public:
  74. // implementation specific
  75. HRESULT BuildDisplayName(CString * pstrDisplayName);
  76. HRESULT InitData(CTapiProvider & tapiProvider, ITapiInfo * pTapiInfo);
  77. HRESULT UpdateListboxCount(ITFSNode * pNode, BOOL bClear = FALSE);
  78. HRESULT UpdateStatus(ITFSNode * pNode);
  79. HRESULT UpdateColumnText(ITFSComponent * pComponent);
  80. void SetColumnInfo();
  81. BOOL BuildTapiStrRecord(int nIndex, TapiStrRecord & tsr);
  82. BOOL BuildStatus(int nIndex, CString & strStatus);
  83. DWORD GetID() { return m_dwProviderID; }
  84. // Implementation
  85. private:
  86. // Command handlers
  87. HRESULT OnConfigureProvider(ITFSNode * pNode);
  88. HRESULT OnDelete(ITFSNode * pNode);
  89. HRESULT OnEditUsers(ITFSComponent * pComponent, LPDATAOBJECT pDataObject, MMC_COOKIE cookie);
  90. private:
  91. DWORD m_dwProviderID;
  92. DWORD m_dwFlags;
  93. CString m_strProviderName;
  94. SPITapiInfo m_spTapiInfo;
  95. CTapiRecordMap m_mapRecords;
  96. CTapiStatusRecordMap m_mapStatus;
  97. DEVICE_TYPE m_deviceType;
  98. };
  99. /*---------------------------------------------------------------------------
  100. Class: CProviderHandlerQueryObj
  101. ---------------------------------------------------------------------------*/
  102. class CProviderHandlerQueryObj : public CTapiQueryObj
  103. {
  104. public:
  105. CProviderHandlerQueryObj(ITFSComponentData * pTFSComponentData,
  106. ITFSNodeMgr * pNodeMgr)
  107. : CTapiQueryObj(pTFSComponentData, pNodeMgr) {};
  108. STDMETHODIMP Execute();
  109. public:
  110. };
  111. #endif _LINES_H