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.

82 lines
2.4 KiB

  1. /*--------------------------------------------------------------------------*
  2. *
  3. * Microsoft Windows
  4. * Copyright (C) Microsoft Corporation, 1992 - 1999
  5. *
  6. * File: tasknode.h
  7. *
  8. * Contents: Interface file for console taskpad CMTNode- and CNode-derived
  9. * classes.
  10. *
  11. * History: 29-Oct-98 jeffro Created
  12. *
  13. *--------------------------------------------------------------------------*/
  14. #ifndef TASKNODE_H
  15. #define TASKNODE_H
  16. #pragma once
  17. class CConsoleTaskCallbackImpl;
  18. //____________________________________________________________________________
  19. //
  20. // Class: CConsoleTaskCallbackImpl
  21. //
  22. // PURPOSE: Implements ITaskCallback.
  23. //____________________________________________________________________________
  24. //
  25. class CConsoleTaskCallbackImpl :
  26. public ITaskCallback,
  27. public CComObjectRoot
  28. {
  29. // typedefs
  30. typedef CConsoleTaskpad::TaskIter TaskIter;
  31. DECLARE_NOT_AGGREGATABLE(CConsoleTaskCallbackImpl)
  32. BEGIN_COM_MAP(CConsoleTaskCallbackImpl)
  33. COM_INTERFACE_ENTRY(ITaskCallback)
  34. END_COM_MAP()
  35. public:
  36. // must call Initialize after constructing.
  37. SC ScInitialize(const CLSID& clsid);
  38. SC ScInitialize(CConsoleTaskpad *pConsoleTaskpad, CScopeTree *pScopeTree, CNode *pNodeTarget);
  39. // ITaskCallback
  40. STDMETHOD(IsEditable)();
  41. STDMETHOD(OnModifyTaskpad)();
  42. STDMETHOD(OnDeleteTaskpad)();
  43. STDMETHOD(GetTaskpadID)(GUID *pGuid);
  44. // constructor/destructor
  45. CConsoleTaskCallbackImpl();
  46. HRESULT OnNewTask();
  47. void EnumerateTasks();
  48. CConsoleTaskpad * GetConsoleTaskpad() const {return m_pConsoleTaskpad;}
  49. private: // implementation
  50. void CheckInitialized() const {ASSERT(m_fInitialized);}
  51. CNode* GetTargetNode() const {CheckInitialized(); return m_pNodeTarget;}
  52. CScopeTree * GetScopeTree() const {return m_pScopeTree;}
  53. CViewData * GetViewData() const {return m_pViewData;}
  54. bool IsTaskpad() const { return (m_fTaskpad); }
  55. // attributes
  56. CLSID m_clsid;
  57. bool m_fTaskpad;
  58. /*
  59. * these are used for console taskpads only
  60. */
  61. bool m_fInitialized;
  62. CConsoleTaskpad * m_pConsoleTaskpad;
  63. CViewData * m_pViewData;
  64. CScopeTree * m_pScopeTree;
  65. CNode * m_pNodeTarget;
  66. };
  67. #endif /* TASKNODE_H */