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.

133 lines
4.1 KiB

  1. //----------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 2001.
  5. //
  6. // File: Ccomp.h
  7. //
  8. // Contents: Wifi Policy management Snapin
  9. //
  10. //
  11. // History: TaroonM
  12. // 10/30/01
  13. //
  14. //----------------------------------------------------------------------------
  15. #ifndef _CCOMP_H
  16. #define _CCOMP_H
  17. ///////////////////////////////////////////////////////////////////////////
  18. ///////////////////////////////////////////////////////////////////////////
  19. // Extra cruft (where should we put this?)
  20. #define ARRAYLEN(x) (sizeof(x) / sizeof((x)[0]))
  21. enum CUSTOM_VIEW_ID
  22. {
  23. VIEW_DEFAULT_LV = 0,
  24. VIEW_CALENDAR_OCX = 1,
  25. VIEW_MICROSOFT_URL = 2,
  26. };
  27. ///////////////////////////////////////////////////////////////////////////
  28. ///////////////////////////////////////////////////////////////////////////
  29. // forward decl
  30. class CComponentDataImpl;
  31. class CComponentImpl :
  32. public IComponent,
  33. public IExtendContextMenu,
  34. public IExtendControlbar,
  35. public IExtendPropertySheet,
  36. public IResultDataCompare,
  37. public CComObjectRoot
  38. {
  39. public:
  40. CComponentImpl();
  41. ~CComponentImpl();
  42. BEGIN_COM_MAP(CComponentImpl)
  43. COM_INTERFACE_ENTRY(IComponent)
  44. COM_INTERFACE_ENTRY(IExtendContextMenu)
  45. COM_INTERFACE_ENTRY(IExtendControlbar)
  46. COM_INTERFACE_ENTRY(IExtendPropertySheet)
  47. COM_INTERFACE_ENTRY(IResultDataCompare)
  48. END_COM_MAP()
  49. friend class CDataObject;
  50. static long lDataObjectRefCount;
  51. // IComponent interface members
  52. public:
  53. STDMETHOD(Initialize)(LPCONSOLE lpConsole);
  54. STDMETHOD(Notify)(LPDATAOBJECT pDataObject, MMC_NOTIFY_TYPE event, LPARAM arg, LPARAM param);
  55. STDMETHOD(Destroy)(MMC_COOKIE cookie);
  56. STDMETHOD(GetResultViewType)(MMC_COOKIE cookie, LPOLESTR* ppViewType, long* pViewOptions);
  57. STDMETHOD(QueryDataObject)(MMC_COOKIE cookie, DATA_OBJECT_TYPES type, LPDATAOBJECT* ppDataObject);
  58. STDMETHOD(GetDisplayInfo)(LPRESULTDATAITEM pResultDataItem);
  59. STDMETHOD(CompareObjects)(LPDATAOBJECT pDataObjectA, LPDATAOBJECT pDataObjectB);
  60. // IResultDataCompare
  61. STDMETHOD(Compare)(LPARAM lUserParam, MMC_COOKIE cookieA, MMC_COOKIE cookieB, int* pnResult);
  62. // IExtendControlbar interface
  63. STDMETHOD(SetControlbar)(LPCONTROLBAR pControlbar);
  64. STDMETHOD(ControlbarNotify)(MMC_NOTIFY_TYPE event, LPARAM arg, LPARAM param);
  65. // IExtendPropertySheet interface
  66. public:
  67. STDMETHOD(CreatePropertyPages)(LPPROPERTYSHEETCALLBACK lpProvider, LONG_PTR handle, LPDATAOBJECT pDataObject);
  68. STDMETHOD(QueryPagesFor)(LPDATAOBJECT pDataObject);
  69. public:
  70. // IPersistStream interface members
  71. STDMETHOD(GetClassID)(CLSID *pClassID);
  72. // Helpers for CComponentImpl
  73. public:
  74. void SetIComponentData(CComponentDataImpl* pData);
  75. #if DBG==1
  76. public:
  77. int dbg_cRef;
  78. ULONG InternalAddRef()
  79. {
  80. ++dbg_cRef;
  81. return CComObjectRoot::InternalAddRef();
  82. }
  83. ULONG InternalRelease()
  84. {
  85. --dbg_cRef;
  86. return CComObjectRoot::InternalRelease();
  87. }
  88. #endif // DBG==1
  89. // IExtendContextMenu
  90. public:
  91. STDMETHOD(AddMenuItems)(LPDATAOBJECT pDataObject, LPCONTEXTMENUCALLBACK pCallbackUnknown, long *pInsertionAllowed);
  92. STDMETHOD(Command)(long nCommandID, LPDATAOBJECT pDataObject);
  93. // Helper functions
  94. protected:
  95. void Construct();
  96. // Interface pointers
  97. protected:
  98. LPCONSOLE m_pConsole; // Console's IFrame interface
  99. LPHEADERCTRL m_pHeader; // Result pane's header control interface
  100. LPCOMPONENTDATA m_pComponentData;
  101. LPCONSOLEVERB m_pConsoleVerb; // pointer the console verb
  102. LPRESULTDATA m_pResultData; // My interface pointer to the result pane
  103. CComPtr <IControlbar> m_spControlbar; // Used by IExtendControlbar implementation
  104. CComponentDataImpl* m_pCComponentData;
  105. private:
  106. CUSTOM_VIEW_ID m_CustomViewID;
  107. DWORD m_dwSortOrder; // default is 0, else RSI_DESCENDING
  108. int m_nSortColumn;
  109. };
  110. #endif