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.

114 lines
4.3 KiB

  1. //////////////////////////////////////////////////////////////////
  2. // File : cpadsvr.h
  3. // Purpose : Class for Client that uses IMEPad.
  4. // This is Super(Abstract) class.
  5. //
  6. //
  7. // Date : Fri Apr 16 14:34:49 1999
  8. // Author : ToshiaK
  9. //
  10. // Copyright(c) 1995-1999, Microsoft Corp. All rights reserved
  11. //////////////////////////////////////////////////////////////////
  12. #ifndef __C_IMEPAD_SERVER_FOR_UIM_H__
  13. #define __C_IMEPAD_SERVER_FOR_UIM_H__
  14. #include "imepadsv.h"
  15. //----------------------------------------------------------------
  16. //Forward declare
  17. //----------------------------------------------------------------
  18. class CImePadCallbackUIM;
  19. typedef CImePadCallbackUIM *LPCImePadCallbackUIM;
  20. class CImePadSvrUIM;
  21. typedef CImePadSvrUIM* LPCImePadSvrUIM;
  22. //----------------------------------------------------------------
  23. //OLE API func's pointer declare
  24. //----------------------------------------------------------------
  25. typedef HRESULT (WINAPI* FN_COINITIALIZE)(LPVOID pvReserved);
  26. typedef HRESULT (WINAPI* FN_COCREATEINSTANCE)(REFCLSID rclsid,
  27. LPUNKNOWN pUnkOuter,
  28. DWORD dwClsContext,
  29. REFIID riid,
  30. LPVOID FAR* ppv);
  31. typedef void (WINAPI* FN_COUNINITIALIZE)(void);
  32. typedef HRESULT (WINAPI* FN_CODISCONNECTOBJECT)(LPUNKNOWN pUnk, DWORD dwReserved);
  33. typedef LPVOID (WINAPI* FN_COTASKMEMALLOC)(ULONG cb);
  34. typedef LPVOID (WINAPI* FN_COTASKMEMREALLOC)(LPVOID pv, ULONG cb);
  35. typedef VOID (WINAPI* FN_COTASKMEMFREE)(LPVOID pv);
  36. class CImePadSvrUIM
  37. {
  38. public:
  39. //----------------------------------------------------------------
  40. //Static method declare
  41. //----------------------------------------------------------------
  42. static HRESULT CreateInstance(HINSTANCE hInst,
  43. LPCImePadSvrUIM *pp,
  44. LPARAM lReserved1,
  45. LPARAM lReserved2);
  46. static HRESULT DeleteInstance(LPCImePadSvrUIM lpCImePadSvrUIM,
  47. LPARAM lReserved);
  48. public:
  49. friend class CImePadCallbackUIM;
  50. //VOID* operator new( size_t size );
  51. //VOID operator delete( VOID *lp );
  52. public:
  53. CImePadSvrUIM(HINSTANCE hInst);
  54. virtual ~CImePadSvrUIM();
  55. virtual BOOL IsAvailable (VOID)=0;
  56. virtual BOOL OnIMEPadClose (VOID)=0;
  57. //----------------------------------------------------------------
  58. //IImePadSvr interface
  59. //----------------------------------------------------------------
  60. virtual INT Initialize (LANGID imeLangID,
  61. DWORD dwImeInputID,
  62. LPVOID lpVoid)=0;
  63. virtual INT Terminate (LPVOID lpVoid)=0;
  64. virtual INT ForceDisConnect (VOID)=0;
  65. virtual INT ShowUI (BOOL fShow)=0;
  66. virtual INT IsVisible (BOOL *pfVisible)=0;
  67. virtual INT ActivateApplet (UINT activateID,
  68. LPARAM dwActParam,
  69. LPWSTR lpwstr1,
  70. LPWSTR lpwstr2)=0;
  71. virtual INT Notify (INT id,
  72. WPARAM wParam,
  73. LPARAM lParam)=0;
  74. virtual INT GetAppletConfigList(DWORD dwMask,
  75. INT* pCountApplet,
  76. IMEPADAPPLETCONFIG **ppCfgList)=0;
  77. //----------------------------------------------------------------
  78. //Set/Get IImeIPoint, IImeCallback interface
  79. //----------------------------------------------------------------
  80. virtual IUnknown* SetIUnkIImeIPoint (IUnknown *pIUnk)=0;
  81. virtual IUnknown* SetIUnkIImeCallback (IUnknown *pIUnk)=0;
  82. virtual IUnknown* GetIUnkIImeIPoint (VOID)=0;
  83. virtual IUnknown* GetIUnkIImeCallback (VOID)=0;
  84. protected:
  85. HMODULE m_hModClient;
  86. INT InitOleAPI(VOID);
  87. INT TermOleAPI(VOID);
  88. BOOL m_fCoInitSuccess; //Flag for CoInitialize() successed or not.
  89. BOOL m_fOLELoaded; //OLE32.DLL is loaded by Application or explicitly loaded.
  90. HMODULE m_hModOLE; //OLE32.DLL module handle.
  91. FN_COINITIALIZE m_fnCoInitialize; //CoInitialize() function pointer.
  92. FN_COCREATEINSTANCE m_fnCoCreateInstance; //CoCreateInstance() function pointer.
  93. FN_COUNINITIALIZE m_fnCoUninitialize; //CoUninitialize() function pointer.
  94. FN_CODISCONNECTOBJECT m_fnCoDisconnectObject; //CoDisconnectObject() function pointer.
  95. FN_COTASKMEMALLOC m_fnCoTaskMemAlloc; //CoTaskMemAlloc() function pointer.
  96. FN_COTASKMEMREALLOC m_fnCoTaskMemRealloc; //CoTaskMemRealloc() function pointer.
  97. FN_COTASKMEMFREE m_fnCoTaskMemFree; //CoTaskMemFree() function pointer.
  98. };
  99. #endif //__C_IMEPAD_SERVER_FOR_UIM_H__