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.

189 lines
6.3 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows/NT **/
  3. /** Copyright(c) Microsoft Corporation, 1997 - 1998 **/
  4. /**********************************************************************/
  5. /*
  6. tapicomp.h
  7. This file contains the derived prototypes from CComponent
  8. and CComponentData for the TAPI admin snapin.
  9. FILE HISTORY:
  10. */
  11. #ifndef _TAPICOMP_H
  12. #define _TAPICOMP_H
  13. #include "resource.h" // main symbols
  14. #ifndef __mmc_h__
  15. #include <mmc.h>
  16. #endif
  17. #ifndef _COMPONT_H_
  18. #include "compont.h"
  19. #endif
  20. #ifndef _XSTREAM_H
  21. #include "xstream.h"
  22. #endif
  23. #define COLORREF_PINK 0x00FF00FF
  24. // Use FormatMessage() to get a system error message
  25. LONG GetSystemMessage ( UINT nId, TCHAR * chBuffer, int cbBuffSize ) ;
  26. BOOL LoadMessage (UINT nIdPrompt, TCHAR * chMsg, int nMsgSize);
  27. // Surrogate AfxMessageBox replacement for error message filtering.
  28. int TapiMessageBox(UINT nIdPrompt,
  29. UINT nType = MB_OK,
  30. const TCHAR * pszSuffixString = NULL,
  31. UINT nHelpContext = -1);
  32. int TapiMessageBoxEx(UINT nIdPrompt,
  33. LPCTSTR pszPrefixMessage,
  34. UINT nType = MB_OK,
  35. UINT nHelpContext = -1);
  36. enum TAPISTRM_TAG
  37. {
  38. TAPISTRM_TAG_VERSION = XFER_TAG(1, XFER_DWORD),
  39. TAPISTRM_TAG_VERSIONADMIN = XFER_TAG(2, XFER_DWORD),
  40. TAPISTRM_TAG_SERVER_NAME = XFER_TAG(3, XFER_STRING_ARRAY),
  41. TAPISTRM_TAG_SERVER_REFRESH_INTERVAL = XFER_TAG(4, XFER_DWORD_ARRAY),
  42. TAPISTRM_TAG_COLUMN_INFO = XFER_TAG(5, XFER_DWORD_ARRAY),
  43. TAPISTRM_TAG_SERVER_OPTIONS = XFER_TAG(6, XFER_DWORD_ARRAY),
  44. TAPISTRM_TAG_SERVER_LINE_SIZE = XFER_TAG(7, XFER_DWORD_ARRAY),
  45. TAPISTRM_TAG_SERVER_PHONE_SIZE = XFER_TAG(8, XFER_DWORD_ARRAY)
  46. };
  47. /////////////////////////////////////////////////////////////////////////////
  48. // CTapiComponentData
  49. class CTapiComponentData :
  50. public CComponentData,
  51. public CComObjectRoot
  52. {
  53. public:
  54. BEGIN_COM_MAP(CTapiComponentData)
  55. COM_INTERFACE_ENTRY(IComponentData)
  56. COM_INTERFACE_ENTRY(IExtendPropertySheet)
  57. COM_INTERFACE_ENTRY(IExtendContextMenu)
  58. COM_INTERFACE_ENTRY(IPersistStreamInit)
  59. COM_INTERFACE_ENTRY(ISnapinHelp)
  60. END_COM_MAP()
  61. // These are the interfaces that we MUST implement
  62. // We will implement our common behavior here, with the derived
  63. // classes implementing the specific behavior.
  64. DeclareIPersistStreamInitMembers(IMPL)
  65. DeclareITFSCompDataCallbackMembers(IMPL)
  66. CTapiComponentData();
  67. HRESULT FinalConstruct();
  68. void FinalRelease();
  69. protected:
  70. SPITFSNodeMgr m_spNodeMgr;
  71. SPITFSNode m_spRootNode;
  72. // Notify handler declarations
  73. private:
  74. };
  75. /////////////////////////////////////////////////////////////////////////////
  76. // CTapiComponent
  77. class CTapiComponent :
  78. public TFSComponent
  79. {
  80. public:
  81. CTapiComponent();
  82. ~CTapiComponent();
  83. STDMETHOD(InitializeBitmaps)(MMC_COOKIE cookie);
  84. STDMETHOD(SetControlbar)(LPCONTROLBAR pControlbar);
  85. STDMETHOD(ControlbarNotify)(MMC_NOTIFY_TYPE event, LPARAM arg, LPARAM param);
  86. STDMETHOD(QueryDataObject)(MMC_COOKIE cookie,
  87. DATA_OBJECT_TYPES type,
  88. LPDATAOBJECT* ppDataObject);
  89. STDMETHOD(OnSnapinHelp)(LPDATAOBJECT pDataObject, LPARAM arg, LPARAM param);
  90. //Attributes
  91. private:
  92. SPIToolbar m_spToolbar; // Toolbar
  93. CBitmap* m_pbmpToolbar; // Imagelist for toolbar
  94. };
  95. /*---------------------------------------------------------------------------
  96. This is how the DHCP snapin implements its extension functionality.
  97. It actually exposes two interfaces that are CoCreate-able. One is the
  98. primary interface, the other the extension interface.
  99. Author: EricDav
  100. ---------------------------------------------------------------------------*/
  101. class CTapiComponentDataPrimary : public CTapiComponentData,
  102. public CComCoClass<CTapiComponentDataPrimary, &CLSID_TapiSnapin>
  103. {
  104. public:
  105. DECLARE_REGISTRY(CTapiComponentDataPrimary,
  106. _T("TelephonySnapin.TelephonySnapin.1"),
  107. _T("TelephonySnapin.TelephonySnapin"),
  108. IDS_SNAPIN_DESC, THREADFLAGS_BOTH)
  109. STDMETHODIMP_(const CLSID *)GetCoClassID() { return &CLSID_TapiSnapin; }
  110. };
  111. class CTapiComponentDataExtension : public CTapiComponentData,
  112. public CComCoClass<CTapiComponentDataExtension, &CLSID_TapiSnapinExtension>
  113. {
  114. public:
  115. DECLARE_REGISTRY(CTapiComponentDataExtension,
  116. _T("TelephonySnapinExtension.TelephonySnapinExtension.1"),
  117. _T("TelephonySnapinExtension.TelephonySnapinExtension"),
  118. IDS_SNAPIN_DESC, THREADFLAGS_BOTH)
  119. STDMETHODIMP_(const CLSID *)GetCoClassID() { return &CLSID_TapiSnapinExtension; }
  120. };
  121. /*---------------------------------------------------------------------------
  122. This is the derived class for handling the IAbout interface from MMC
  123. Author: EricDav
  124. ---------------------------------------------------------------------------*/
  125. class CTapiAbout :
  126. public CAbout,
  127. public CComCoClass<CTapiAbout, &CLSID_TapiSnapinAbout>
  128. {
  129. public:
  130. DECLARE_REGISTRY(CTapiAbout, _T("TelephonySnapin.About.1"),
  131. _T("TelephonySnapin.About"),
  132. IDS_SNAPIN_DESC, THREADFLAGS_BOTH)
  133. BEGIN_COM_MAP(CTapiAbout)
  134. COM_INTERFACE_ENTRY(ISnapinAbout) // Must have one static entry
  135. COM_INTERFACE_ENTRY_CHAIN(CAbout) // chain to the base class
  136. END_COM_MAP()
  137. DECLARE_NOT_AGGREGATABLE(CTapiAbout)
  138. // these must be overridden to provide values to the base class
  139. protected:
  140. virtual UINT GetAboutDescriptionId() { return IDS_ABOUT_DESCRIPTION; }
  141. virtual UINT GetAboutProviderId() { return IDS_ABOUT_PROVIDER; }
  142. virtual UINT GetAboutVersionId() { return IDS_ABOUT_VERSION; }
  143. virtual UINT GetAboutIconId() { return IDI_TAPI_SNAPIN; }
  144. virtual UINT GetSmallRootId() { return IDB_ROOT_SMALL; }
  145. virtual UINT GetSmallOpenRootId() { return IDB_ROOT_SMALL; }
  146. virtual UINT GetLargeRootId() { return IDB_ROOT_LARGE; }
  147. virtual COLORREF GetLargeColorMask() { return (COLORREF) COLORREF_PINK; }
  148. };
  149. #endif _TAPICOMP_H