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.

84 lines
2.7 KiB

  1. // spttsengui.cpp : Implementation of SpTtsEngUI
  2. #include "stdafx.h"
  3. #include "spttsengui.h"
  4. #include "ttspropertiesdialog.h"
  5. #include "spddkhlp.h"
  6. /****************************************************************************
  7. * SpTtsEngUI::IsUISupported *
  8. *-------------------------*
  9. * Description: Determines if the supplied standard UI component is
  10. * supported by the engine.
  11. *
  12. * Returns:
  13. * *pfSupported - set to TRUE if the specified standard UI component
  14. * is supported.
  15. * E_INVALIDARG - If one of the supplied arguments is invalid.
  16. *
  17. ********************************************************************* AH ***/
  18. STDMETHODIMP SpTtsEngUI::IsUISupported( const WCHAR * pszTypeOfUI,
  19. void * /* pvExtraData */,
  20. ULONG /* cbExtraData */,
  21. IUnknown * /* punkObject */,
  22. BOOL * pfSupported )
  23. {
  24. SPDBG_FUNC("SpTtsEngUI::IsUISupported");
  25. // Validate the params
  26. if ( pfSupported == NULL ||
  27. SP_IS_BAD_WRITE_PTR( pfSupported ) )
  28. {
  29. return E_INVALIDARG;
  30. }
  31. *pfSupported = FALSE;
  32. // Test to see if the UI is supported
  33. if ( wcscmp( pszTypeOfUI, SPDUI_EngineProperties ) == 0 )
  34. {
  35. *pfSupported = TRUE;
  36. }
  37. return S_OK;
  38. } /* IsUISupported */
  39. /****************************************************************************
  40. * SpTtsEngUI::DisplayUI *
  41. *---------------------*
  42. * Description:
  43. *
  44. * Returns:
  45. *
  46. ********************************************************************* AH ***/
  47. STDMETHODIMP SpTtsEngUI::DisplayUI( HWND hwndParent,
  48. const WCHAR * pszTitle,
  49. const WCHAR * pszTypeOfUI,
  50. void * /* pvExtraData */,
  51. ULONG /* cbExtraData */,
  52. ISpObjectToken * pToken,
  53. IUnknown * /* punkObject */)
  54. {
  55. SPDBG_FUNC("SpTtsEngUI::DisplayUI");
  56. // Validate the params
  57. if ( !IsWindow( hwndParent ) ||
  58. SP_IS_BAD_READ_PTR( pszTitle ) ||
  59. SP_IS_BAD_INTERFACE_PTR( pToken ) )
  60. {
  61. return E_INVALIDARG;
  62. }
  63. HRESULT hr = S_OK;
  64. // Display the UI
  65. if ( SUCCEEDED( hr ) )
  66. {
  67. if ( wcscmp( pszTypeOfUI, SPDUI_EngineProperties ) == 0)
  68. {
  69. CTTSPropertiesDialog dlg( _Module.GetModuleInstance(), hwndParent );
  70. hr = dlg.Run();
  71. }
  72. }
  73. return hr;
  74. } /* DisplayUI */