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.

152 lines
4.0 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. /*++
  3. Copyright (C) Microsoft Corporation, 1997 - 2000
  4. Module Name:
  5. Component.h
  6. Abstract:
  7. The CComponent class implements several interfaces which MMC uses:
  8. The IComponent interface is basically how MMC talks to the snap-in
  9. to get it to implement a right-hand-side "scope" pane. There can be several
  10. objects implementing this interface instantiated at once. These are best
  11. thought of as "views" on the single object implementing the IComponentData
  12. "document" (see ComponentData.cpp).
  13. The IExtendPropertySheet interface is how the snap-in adds property sheets
  14. for any of the items a user might click on.
  15. The IExtendContextMenu interface what we do to add custom entries
  16. to the menu which appears when a user right-clicks on a node.
  17. The IExtendControlBar interface allows us to support a custom
  18. iconic toolbar.
  19. See Component.cpp for implementation details.
  20. Note:
  21. Much of the functionality of this class is implemented in atlsnap.h
  22. by IComponentImpl. We are mostly overriding here.
  23. Revision History:
  24. mmaguire 11/6/97 - created using MMC snap-in wizard
  25. --*/
  26. //////////////////////////////////////////////////////////////////////////////
  27. #if !defined(_NAP_COMPONENT_H_)
  28. #define _NAP_COMPONENT_H_
  29. //////////////////////////////////////////////////////////////////////////////
  30. // BEGIN INCLUDES
  31. //
  32. // where we can find what this class derives from:
  33. //
  34. //Moved to Precompiled.h: #include <atlsnap.h>
  35. //
  36. //
  37. // where we can find what this class has or uses:
  38. //
  39. #include "ComponentData.h"
  40. //
  41. // END INCLUDES
  42. //////////////////////////////////////////////////////////////////////////////
  43. class CComponent :
  44. public CComObjectRootEx<CComSingleThreadModel>
  45. , public CSnapInObjectRoot<2, CComponentData>
  46. , public IExtendPropertySheetImpl<CComponent>
  47. , public IExtendContextMenuImpl<CComponent>
  48. , public IExtendControlbarImpl<CComponent>
  49. , public IResultDataCompare
  50. , public IExtendTaskPadImpl<CComponent>
  51. , public IComponentImpl<CComponent>
  52. {
  53. public:
  54. BEGIN_COM_MAP(CComponent)
  55. COM_INTERFACE_ENTRY(IComponent)
  56. COM_INTERFACE_ENTRY(IExtendPropertySheet2)
  57. COM_INTERFACE_ENTRY(IExtendContextMenu)
  58. COM_INTERFACE_ENTRY(IExtendControlbar)
  59. COM_INTERFACE_ENTRY(IResultDataCompare)
  60. COM_INTERFACE_ENTRY(IExtendTaskPad)
  61. END_COM_MAP()
  62. CComponent();
  63. ~CComponent();
  64. // We are overiding ATLsnap.h's IComponentImpl implementation of this
  65. // in order to correctly handle messages which it is incorrectly
  66. // ignoring (e.g. MMCN_COLUMN_CLICK and MMCN_SNAPINHELP)
  67. STDMETHOD(Notify)(
  68. LPDATAOBJECT lpDataObject
  69. , MMC_NOTIFY_TYPE event
  70. , LPARAM arg
  71. , LPARAM param
  72. );
  73. STDMETHOD(CompareObjects)(
  74. LPDATAOBJECT lpDataObjectA
  75. , LPDATAOBJECT lpDataObjectB
  76. );
  77. // IResultDataCompare
  78. STDMETHOD(Compare)(LPARAM lUserParam,
  79. MMC_COOKIE cookieA,
  80. MMC_COOKIE cookieB,
  81. int *pnResult);
  82. // IExtendPropertySheet2 -- to support wizard 97
  83. STDMETHOD(GetWatermarks)(
  84. LPDATAOBJECT lpIDataObject,
  85. HBITMAP *lphWatermark,
  86. HBITMAP *lphHeader,
  87. HPALETTE *lphPalette,
  88. BOOL *bStretch);
  89. CSnapInItem * m_pSelectedNode;
  90. protected:
  91. virtual HRESULT OnColumnClick(
  92. LPARAM arg
  93. , LPARAM param
  94. );
  95. virtual HRESULT OnViewChange(
  96. LPARAM arg
  97. , LPARAM param
  98. );
  99. virtual HRESULT OnPropertyChange(
  100. LPARAM arg
  101. , LPARAM param
  102. );
  103. virtual HRESULT OnAddImages(
  104. LPARAM arg
  105. , LPARAM param
  106. );
  107. // html help
  108. HRESULT OnResultContextHelp(LPDATAOBJECT lpDataObject);
  109. public:
  110. int m_nLastClickedColumn;
  111. DWORD m_dwLastSortOptions;
  112. };
  113. #endif // _NAP_COMPONENT_H_