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.

90 lines
6.6 KiB

  1. /*
  2. * SnapinVirtualItem.hxx
  3. *
  4. *
  5. * Copyright (c) 1998 Microsoft Corporation
  6. *
  7. * PURPOSE: Defines the CVirtualSnapinItemImpl class.
  8. * This class is used in the same way as the
  9. * CBaseSnapinItem class. Except the virtual snapin
  10. * class is only supposed to be used in a virtual results pane.
  11. * These snapin items are created as needed and go away when
  12. * not in use anymore. This is because they are in a virtual
  13. * list and so we just do not have memory to support all the
  14. * list elements at one time.
  15. *
  16. * This class puts asserts around all functions that should
  17. * NOT be called. Since we are virtual we should never be
  18. * a scope item and these asserts protect against this from
  19. * happening.
  20. *
  21. * OWNER: mcoburn
  22. */
  23. #ifndef _SNAPINVIRTUALITEM_HXX
  24. #define _SNAPINVIRTUALITEM_HXX
  25. #define BAD_FUNCTION_CALL(_func, _return_value) \
  26. { \
  27. AssertAlways(L#_func LITERAL(": This function should not be called")); \
  28. return _return_value; \
  29. } \
  30. class CVirtualSnapinItem : public CBaseSnapinItem
  31. {
  32. public:
  33. CVirtualSnapinItem() {}
  34. virtual ~CVirtualSnapinItem() {}
  35. protected:
  36. virtual SC ScGetField(DAT dat, STR * pstrField) BAD_FUNCTION_CALL(ScGetField, S_OK)
  37. virtual SC ScGetField(INT nIndex, DAT dat, STR * pstrField, IResultData *ipResultData) BAD_FUNCTION_CALL(ScGetField, S_OK)
  38. virtual IconID Iconid(INT nIndex) BAD_FUNCTION_CALL(Iconid, iconNil)
  39. virtual SC ScDeleteSubTree(BOOL fDeleteRoot) BAD_FUNCTION_CALL(ScDeleteSubTree, S_OK)
  40. virtual SC ScInitializeChild(CBaseSnapinItem* pitem) BAD_FUNCTION_CALL(ScInitializeChild, S_OK)
  41. virtual SC ScGetDisplayInfo(LPSCOPEDATAITEM pScopeItem) BAD_FUNCTION_CALL(ScGetDisplayInfo, S_OK)
  42. virtual SC ScGetDisplayInfo(LPRESULTDATAITEM pResultItem) BAD_FUNCTION_CALL(ScGetDisplayInfo, S_OK)
  43. virtual SC ScGetVirtualDisplayInfo(LPRESULTDATAITEM pResultItem) BAD_FUNCTION_CALL(ScGetVirtualDisplayInfo, S_OK)
  44. virtual SC ScQueryDataObject(long cookie, DATA_OBJECT_TYPES type, LPDATAOBJECT* ppDataObject) BAD_FUNCTION_CALL(ScQueryDataObject, S_OK)
  45. virtual SC ScVirtualQueryDataObject(long cookie, DATA_OBJECT_TYPES type, LPDATAOBJECT* ppDataObject) BAD_FUNCTION_CALL(ScVirtualQueryDataObject, S_OK)
  46. virtual SC ScOnShow(CComponent *pComponent, BOOL fSelect) BAD_FUNCTION_CALL(ScOnShow, S_OK)
  47. virtual SC ScInsertScopeItem(BOOL fExpand, HSCOPEITEM item, IConsoleNameSpace * ipConsoleNameSpace) BAD_FUNCTION_CALL(ScInsertScopeItem, S_OK)
  48. virtual BOOL FIsVirtualContainer(LPDATAOBJECT lpDataObject) BAD_FUNCTION_CALL(FIsVirtualContainer, FALSE)
  49. // Notification Handlers for Extension snapins
  50. virtual SC ScInitializeNamespaceExtension(LPDATAOBJECT lpDataObject, HSCOPEITEM item,
  51. CNodeType *pnodetype, BOOL fExpand) { return S_OK;}
  52. public:
  53. virtual STR * PstrDisplayName() BAD_FUNCTION_CALL(PstrDisplayName, NULL)
  54. virtual SC ScGetResultViewType(LPOLESTR* ppViewType, long* pViewOptions) BAD_FUNCTION_CALL(ScGetResultViewType, S_OK)
  55. virtual SC ScInitializeResultView(CComponent *pComponent) BAD_FUNCTION_CALL(ScInitializeResultView, S_OK)
  56. virtual SC ScInsertResultItem(CComponent *pComponent) BAD_FUNCTION_CALL(ScInsertResultItem, S_OK)
  57. virtual SC ScRemoveResultItems(LPRESULTDATA ipResultData) BAD_FUNCTION_CALL(ScRemoveResultItems, S_OK)
  58. virtual SC ScOnAddImages(IImageList* ipResultImageList) BAD_FUNCTION_CALL(ScOnAddImages, S_OK)
  59. virtual BOOL FVirtualResultsPane() BAD_FUNCTION_CALL(FVirtualResultsPane, FALSE)
  60. IconID Iconid() BAD_FUNCTION_CALL(Iconid, iconNil)
  61. virtual SC ScCreateChildren() BAD_FUNCTION_CALL(ScCreateChildren, S_OK)
  62. public:
  63. virtual SC ScCompare(CBaseSnapinItem * psnapinitem) { return S_OK; }
  64. // Property page functions
  65. virtual SC ScQueryPagesFor() { return S_OK; }
  66. virtual SC ScCreatePropertyPages(LPPROPERTYSHEETCALLBACK ipPropertySheetCallback) { return S_OK; }
  67. virtual BOOL FIsContainer() { return FALSE; }
  68. virtual SC ScOnSelect(CComponent * pComponent, LPDATAOBJECT lpDataObject, BOOL fScope, BOOL fSelect) { return S_OK; }
  69. };
  70. #endif // _SNAPINVIRTUALITEM_HXX