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
2.3 KiB

  1. //____________________________________________________________________________
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997 - 1999
  5. //
  6. // File: taskhost.h
  7. //
  8. // Contents:
  9. //
  10. // Classes:
  11. //
  12. // Functions:
  13. //
  14. // History: 11/19/1997 RaviR Created
  15. //____________________________________________________________________________
  16. //
  17. #ifndef TASKHOST_H__
  18. #define TASKHOST_H__
  19. class CTaskPadHost : public ITaskPadHost,
  20. public CComObjectRoot
  21. {
  22. // Constructor & destructor
  23. public:
  24. CTaskPadHost() : m_pAMCView(NULL)
  25. {
  26. }
  27. void Init(CAMCView* pv)
  28. {
  29. ASSERT(pv);
  30. m_pAMCView = pv;
  31. }
  32. ~CTaskPadHost()
  33. {
  34. m_pAMCView = NULL;
  35. }
  36. // ATL COM map
  37. public:
  38. BEGIN_COM_MAP(CTaskPadHost)
  39. COM_INTERFACE_ENTRY(ITaskPadHost)
  40. END_COM_MAP()
  41. // ITaskPadHost methods
  42. public:
  43. STDMETHOD(TaskNotify )(BSTR szClsid, VARIANT * pvArg, VARIANT * pvParam);
  44. STDMETHOD(GetTaskEnumerator )(BSTR szTaskGroup, IEnumTASK** ppEnumTASK);
  45. STDMETHOD(GetPrimaryTask )(IExtendTaskPad** ppExtendTaskPad);
  46. STDMETHOD(GetTitle )(BSTR szTaskGroup, BSTR * pbstrTitle);
  47. STDMETHOD(GetDescriptiveText)(BSTR szTaskGroup, BSTR * pbstrDescriptiveText);
  48. STDMETHOD(GetBackground )(BSTR szTaskGroup, MMC_TASK_DISPLAY_OBJECT * pTDO);
  49. // STDMETHOD(GetBranding )(BSTR szTaskGroup, MMC_TASK_DISPLAY_OBJECT * pTDO);
  50. STDMETHOD(GetListPadInfo )(BSTR szTaskGroup, MMC_ILISTPAD_INFO * pIListPadInfo);
  51. // Implementation
  52. private:
  53. CAMCView* m_pAMCView;
  54. IExtendTaskPadPtr m_spExtendTaskPadPrimary;
  55. INodeCallback* _GetNodeCallback(void)
  56. {
  57. return m_pAMCView->GetNodeCallback();
  58. }
  59. IExtendTaskPad* _GetPrimaryExtendTaskPad()
  60. {
  61. if (m_spExtendTaskPadPrimary == NULL)
  62. {
  63. IExtendTaskPadPtr spExtendTaskPad;
  64. HRESULT hr = GetPrimaryTask(&spExtendTaskPad);
  65. if (SUCCEEDED(hr))
  66. m_spExtendTaskPadPrimary.Attach(spExtendTaskPad.Detach());
  67. }
  68. ASSERT(m_spExtendTaskPadPrimary != NULL);
  69. return m_spExtendTaskPadPrimary;
  70. }
  71. // Ensure that default copy constructor & assignment are not used.
  72. CTaskPadHost(const CTaskPadHost& rhs);
  73. CTaskPadHost& operator=(const CTaskPadHost& rhs);
  74. }; // class CTaskPadHost
  75. #endif // TASKHOST_H__