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.

101 lines
2.6 KiB

  1. /* Taskpad.h
  2. *
  3. * Define the CTaskEnum class interface.
  4. *
  5. * Copyright (c) 1998-1999 Microsoft Corporation
  6. */
  7. #include <atlcom.h>
  8. #ifndef __mmc_h__
  9. #include <mmc.h> // ..\..\..\public\sdk\inc
  10. #endif
  11. #ifndef IDS_TASK_TITLE
  12. #include "resrc1.h"
  13. #endif
  14. /*
  15. * CTaskEnumBase - a class to handle our taskpad functionality.
  16. *
  17. * History: a-jsari 3/4/98 Initial version.
  18. */
  19. class CTaskEnumBase:
  20. public IEnumTASK,
  21. public CComObjectRoot
  22. {
  23. BEGIN_COM_MAP(CTaskEnumBase)
  24. COM_INTERFACE_ENTRY(IEnumTASK)
  25. END_COM_MAP()
  26. public:
  27. ~CTaskEnumBase() { }
  28. // IEnumTask interface
  29. public:
  30. STDMETHOD(Next)(ULONG celt, MMC_TASK *rgelt, ULONG *pceltFetched);
  31. STDMETHOD(Skip)(ULONG celt);
  32. STDMETHOD(Reset)();
  33. STDMETHOD(Clone)(IEnumTASK **ppenum);
  34. protected:
  35. CTaskEnumBase(unsigned cTasks) : m_iTask(0), m_cTasks(cTasks) { }
  36. virtual long FirstCommandID() = 0;
  37. virtual unsigned FirstTaskTextResourceID() = 0;
  38. virtual unsigned FirstTaskHelpResourceID() = 0;
  39. virtual unsigned FirstMouseOffResourceID() = 0;
  40. unsigned MouseOverResourceID() { return IDS_MOUSEOVER_RESPATH; }
  41. private:
  42. const int m_cTasks;
  43. int m_iTask;
  44. };
  45. /*
  46. * CTaskEnumPrimary - The CTaskEnum for our internal taskpad.
  47. *
  48. * History: a-jsari 3/4/98 Initial version.
  49. */
  50. class CTaskEnumPrimary : public CTaskEnumBase {
  51. friend class CSystemInfo;
  52. public:
  53. CTaskEnumPrimary() : CTaskEnumBase(5) { }
  54. ~CTaskEnumPrimary() { }
  55. long FirstCommandID() { return IDM_DISPLAY_BASIC; }
  56. unsigned FirstTaskTextResourceID() { return IDS_ORDERED_TASKTEXT0; }
  57. unsigned FirstTaskHelpResourceID() { return IDS_ORDERED_TASKHELP0; }
  58. unsigned FirstMouseOffResourceID() { return IDS_ORDERED_TASKBUTTON0; }
  59. private:
  60. enum PrimaryCommandIDs
  61. { IDM_DISPLAY_BASIC = 556,
  62. IDM_DISPLAY_ADVANCED = IDM_DISPLAY_BASIC + 1,
  63. IDM_TASK_SAVE_FILE = IDM_DISPLAY_ADVANCED + 1,
  64. IDM_TASK_PRINT_REPORT = IDM_TASK_SAVE_FILE + 1,
  65. IDM_PROBLEM_DEVICES = IDM_TASK_PRINT_REPORT + 1
  66. };
  67. };
  68. /*
  69. * CTaskEnumExtension - The CTaskEnum we use to extend Computer
  70. * Management. Computer management only requires a navigation task
  71. * from us.
  72. *
  73. * History: a-jsari 3/4/98 Initial version.
  74. */
  75. class CTaskEnumExtension : public CTaskEnumBase {
  76. friend class CSystemInfo;
  77. public:
  78. CTaskEnumExtension() : CTaskEnumBase(1) { }
  79. ~CTaskEnumExtension() { }
  80. long FirstCommandID() { return IDM_MSINFO32; }
  81. unsigned FirstTaskTextResourceID() { return IDS_NAVIGATION_TASKTEXT; }
  82. unsigned FirstTaskHelpResourceID() { return IDS_NAVIGATION_TASKHELP; }
  83. unsigned FirstMouseOffResourceID() { return IDS_NAVIGATION_TASKBUTTON; }
  84. private:
  85. enum ExtensionCommandIDs { IDM_MSINFO32 = 555 };
  86. };