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.

136 lines
3.6 KiB

  1. //============================================================================
  2. // Copyright (C) Microsoft Corporation, 1997 - 1999
  3. //
  4. // File: basertr.h
  5. //
  6. // History:
  7. // 07/22/97 Kenn M. Takara Created.
  8. //
  9. // Basic interface node functionality. This is the base router
  10. // handler.
  11. //
  12. //============================================================================
  13. #ifndef _BASERTR_H
  14. #define _BASERTR_H
  15. #ifndef _BASEHAND_H
  16. #include "basehand.h"
  17. #endif
  18. #ifndef _HANDLERS_H
  19. #include "handlers.h"
  20. #endif
  21. #ifndef _DYNEXT_H
  22. #include "dynext.h"
  23. #endif
  24. /*---------------------------------------------------------------------------
  25. Class: BaseRouterHandler
  26. This is the base class for the router handlers. Functionality common
  27. to all router handlers (both result and scope handlers) should be
  28. implemented here.
  29. - This class will handle the basic verb enabling/disabling. Derived
  30. classes should set the appropriate values.
  31. ---------------------------------------------------------------------------*/
  32. enum
  33. {
  34. MMC_VERB_OPEN_INDEX = 0,
  35. MMC_VERB_COPY_INDEX,
  36. MMC_VERB_PASTE_INDEX,
  37. MMC_VERB_DELETE_INDEX,
  38. MMC_VERB_PROPERTIES_INDEX,
  39. MMC_VERB_RENAME_INDEX,
  40. MMC_VERB_REFRESH_INDEX,
  41. MMC_VERB_PRINT_INDEX,
  42. MMC_VERB_COUNT,
  43. };
  44. #define INDEX_TO_VERB(i) (_MMC_CONSOLE_VERB)((0x8000 + (i)))
  45. #define VERB_TO_INDEX(i) (0x000F & (i))
  46. struct SRouterNodeMenu
  47. {
  48. ULONG m_sidMenu; // string/command id for this menu item
  49. ULONG (*m_pfnGetMenuFlags)(const SRouterNodeMenu *pMenuData,
  50. INT_PTR pUserData);
  51. ULONG m_ulPosition;
  52. LPCTSTR m_pszLangIndStr; // language independent string
  53. };
  54. class BaseRouterHandler :
  55. public CHandler
  56. {
  57. public:
  58. BaseRouterHandler(ITFSComponentData *pCompData);
  59. // Node Id 2 support
  60. OVERRIDE_BaseHandlerNotify_OnCreateNodeId2();
  61. // Help support
  62. OVERRIDE_BaseResultHandlerNotify_OnResultContextHelp();
  63. // To provide the verb functionality, override the select
  64. OVERRIDE_BaseResultHandlerNotify_OnResultSelect();
  65. // Property page support
  66. OVERRIDE_BaseHandlerNotify_OnPropertyChange();
  67. OVERRIDE_BaseResultHandlerNotify_OnResultPropertyChange();
  68. // Refresh support
  69. OVERRIDE_BaseHandlerNotify_OnVerbRefresh();
  70. OVERRIDE_BaseResultHandlerNotify_OnResultRefresh();
  71. // Helpful utility function - this will forward the
  72. // message to the parent node.
  73. HRESULT ForwardCommandToParent(ITFSNode *pNode,
  74. long nCommandId,
  75. DATA_OBJECT_TYPES type,
  76. LPDATAOBJECT pDataObject,
  77. DWORD dwType);
  78. HRESULT EnumDynamicExtensions(ITFSNode * pNode);
  79. HRESULT AddDynamicNamespaceExtensions(ITFSNode * pNode);
  80. protected:
  81. // Adds an array of menu items
  82. HRESULT AddArrayOfMenuItems(ITFSNode *pNode,
  83. const SRouterNodeMenu *prgMenu,
  84. UINT crgMenu,
  85. LPCONTEXTMENUCALLBACK pCallback,
  86. long iInsertionAllowed,
  87. INT_PTR pUserData);
  88. void EnableVerbs(IConsoleVerb *pConsoleVerb);
  89. // This holds the actual state of a button (HIDDEN/ENABLED)
  90. MMC_BUTTON_STATE m_rgButtonState[MMC_VERB_COUNT];
  91. // Given that a button is enabled, what is its value (TRUE/FALSE)
  92. BOOL m_bState[MMC_VERB_COUNT];
  93. // This is the default verb, by default it is set to MMC_VERB_NONE
  94. MMC_CONSOLE_VERB m_verbDefault;
  95. SPIRouterInfo m_spRouterInfo;
  96. CDynamicExtensions m_dynExtensions;
  97. UINT m_nHelpTopicId;
  98. };
  99. #endif _BASERTR_H