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.

78 lines
2.3 KiB

  1. /****************************************************************************
  2. funcprv.cpp : CFunctionProvider class implementation
  3. History:
  4. 15-NOV-1999 CSLim Created
  5. ****************************************************************************/
  6. #include "private.h"
  7. #include "globals.h"
  8. #include "common.h"
  9. #include "korimx.h"
  10. #include "funcprv.h"
  11. #include "fnrecon.h"
  12. #include "fnconfig.h"
  13. #include "helpers.h"
  14. #include "immxutil.h"
  15. //////////////////////////////////////////////////////////////////////////////
  16. //
  17. // CFunctionProvider
  18. //
  19. //////////////////////////////////////////////////////////////////////////////
  20. /*---------------------------------------------------------------------------
  21. CFunctionProvider::CFunctionProvider
  22. Ctor
  23. ---------------------------------------------------------------------------*/
  24. CFunctionProvider::CFunctionProvider(CKorIMX *pime) : CFunctionProviderBase(pime->GetTID())
  25. {
  26. Init(CLSID_KorIMX, L"Kor TFX");
  27. _pime = pime;
  28. }
  29. /*---------------------------------------------------------------------------
  30. CFunctionProvider::GetFunction
  31. Get Fuction object
  32. ---------------------------------------------------------------------------*/
  33. STDAPI CFunctionProvider::GetFunction(REFGUID rguid, REFIID riid, IUnknown **ppunk)
  34. {
  35. *ppunk = NULL;
  36. if (!IsEqualIID(rguid, GUID_NULL))
  37. return E_NOINTERFACE;
  38. if (IsEqualIID(riid, IID_ITfFnReconversion))
  39. {
  40. // ITfFnReconversion is used for correction. Through this function, the
  41. // applications can get the simple alternative lists or ask the function to show
  42. // the alternative list UI.
  43. *ppunk = new CFnReconversion(_pime, this);
  44. }
  45. else if (IsEqualIID(riid, IID_ITfFnConfigure))
  46. {
  47. CFnConfigure *pconfig = new CFnConfigure(this);
  48. *ppunk = SAFECAST(pconfig, ITfFnConfigure *);
  49. }
  50. else if (IsEqualIID(riid, IID_ITfFnConfigureRegisterWord))
  51. {
  52. CFnConfigure *pconfig = new CFnConfigure(this);
  53. *ppunk = SAFECAST(pconfig, ITfFnConfigureRegisterWord *);
  54. }
  55. else if (IsEqualIID(riid, IID_ITfFnShowHelp))
  56. {
  57. CFnShowHelp *phelp = new CFnShowHelp(this);
  58. *ppunk = SAFECAST(phelp, ITfFnShowHelp *);
  59. }
  60. if (*ppunk)
  61. return S_OK;
  62. return E_NOINTERFACE;
  63. }