home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / winfe / edtrcdll / src / imewrap.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  3.8 KB  |  101 lines

  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18.  
  19. #ifndef _IMEWRAP_H
  20. #define _IMEWRAP_H
  21.  
  22. //THIS IS DUMMIED UP BECAUSE WIN16 DOES NOT USE IME INPUT!
  23.  
  24. #include "edtdlgs.h"
  25.  
  26. /*note!
  27. this dll may not be present! this is OK!!! all functions will return FALSE
  28. */
  29.  
  30. #if WIN32
  31. #include "imm.h"
  32.  
  33. typedef BOOL (WINAPI *IMMNOTIFYIME)(HIMC, DWORD dwAction, DWORD dwIndex, DWORD dwValue);
  34. typedef HIMC (WINAPI *IMMGETCONTEXT)(HWND);
  35. typedef BOOL (WINAPI *IMMRELEASECONTEXT)(HWND,HIMC);
  36. typedef LONG (WINAPI *IMMGETCOMPOSITIONSTRING)(HIMC,DWORD,LPVOID,DWORD);
  37. typedef BOOL (WINAPI *IMMSETCANDIDATEWINDOW)(HIMC, LPCANDIDATEFORM);
  38. typedef BOOL (WINAPI *IMMSETCOMPOSITIONWINDOW)(HIMC, LPCOMPOSITIONFORM);
  39. typedef BOOL (WINAPI *IMMSETCOMPOSITIONFONT)(HIMC, LPLOGFONT);
  40. typedef BOOL (WINAPI *IMMSETCOMPOSITIONSTRING)(HIMC,DWORD,LPVOID,DWORD,LPVOID,DWORD);
  41. typedef BOOL (WINAPI *IMMGETCONVERSIONSTATUS)(HIMC,LPDWORD,LPDWORD);
  42. typedef BOOL (WINAPI *IMMSETCONVERSIONSTATUS)(HIMC,DWORD,DWORD);
  43. typedef LRESULT (WINAPI *IMEESCAPE)(HKL,HIMC,UINT,LPVOID);
  44.  
  45. #else //WIN16
  46.  
  47. #include "ime16.h"
  48.  
  49. typedef BOOL (WINAPI *SENDIMEMESSAGE)(HWND, LPARAM);
  50. typedef BOOL (WINAPI *SENDIMEMESSAGEEX)(HWND, LPARAM);
  51. typedef BOOL (WINAPI *IMPGETIME)( HWND, LPIMEPRO );
  52. #endif //WIN32
  53.  
  54. class CIMEDll:public IIMEDll
  55. {
  56.     static HINSTANCE s_dllinstance;
  57. #if WIN32
  58.     static unsigned int s_refcount;
  59.     //placeholders for exported functions
  60.     static IMMNOTIFYIME s_ImmNotifyIME;
  61.     static IMMGETCONTEXT s_ImmGetContext;
  62.     static IMMRELEASECONTEXT s_ImmReleaseContext;
  63.     static IMMGETCOMPOSITIONSTRING s_ImmGetCompositionString;
  64.     static IMMSETCANDIDATEWINDOW s_ImmSetCandidateWindow;
  65.     static IMMSETCOMPOSITIONWINDOW s_ImmSetCompositionWindow;
  66.     static IMMSETCOMPOSITIONFONT s_ImmSetCompositionFont;
  67.     static IMMSETCOMPOSITIONSTRING s_ImmSetCompositionString;
  68.     static IMMGETCONVERSIONSTATUS s_ImmGetConversionStatus;
  69.     static IMMSETCONVERSIONSTATUS s_ImmSetConversionStatus;
  70.     static IMEESCAPE s_ImmEscape;
  71. #else
  72.     static unsigned int s_refcount;
  73.     static SENDIMEMESSAGE s_SendIMEMessage;
  74.     static SENDIMEMESSAGEEX s_SendIMEMessageEx;
  75.     static IMPGETIME s_IMPGetIME;
  76. #endif //WIN32
  77. public:
  78.     CIMEDll();
  79.     ~CIMEDll();
  80. #ifdef WIN32
  81.     BOOL ImmNotifyIME(HIMC,DWORD,DWORD,DWORD);
  82.     HIMC ImmGetContext(HWND);
  83.     BOOL ImmReleaseContext(HWND,HIMC);
  84.     LONG ImmGetCompositionString(HIMC,DWORD,LPVOID,DWORD);
  85.     BOOL ImmSetCompositionString(HIMC,DWORD,LPVOID,DWORD,LPVOID,DWORD);
  86.     BOOL ImmGetConversionStatus(HIMC,LPDWORD,LPDWORD);
  87.     BOOL ImmSetConversionStatus(HIMC,DWORD,DWORD);
  88.     BOOL ImmSetCandidateWindow(HIMC, LPCANDIDATEFORM);
  89.     BOOL ImmSetCompositionWindow(HIMC,LPCOMPOSITIONFORM);
  90.     BOOL ImmSetCompositionFont(HIMC,LPLOGFONT);
  91.     LRESULT ImeEscape(HKL hKL,HIMC hIMC,UINT uEscape,LPVOID lpData);
  92. #else //WIN16
  93.     WORD    LOADDS SendIMEMessage( HWND, LPARAM );
  94.     LRESULT LOADDS SendIMEMessageEx( HWND, LPARAM ); /* New for win3.1 */
  95.     BOOL    LOADDS IMPGetIME( HWND, LPIMEPRO );
  96. #endif //WIN32
  97. };
  98.  
  99.  
  100. #endif //_IMEWRAP_H
  101.