Qt 4.8
Macros | Enumerations | Functions | Variables
qwininputcontext_win.cpp File Reference
#include "qwininputcontext_p.h"
#include "qinputcontext_p.h"
#include "qfont.h"
#include "qwidget.h"
#include "qapplication.h"
#include "qevent.h"
#include "qtextformat.h"
#include "qtextboundaryfinder.h"

Go to the source code of this file.

Macros

#define IFMETHOD   HRESULT STDMETHODCALLTYPE
 
#define LGRPID_ARABIC   0x000d
 
#define LGRPID_ARMENIAN   0x0011
 
#define LGRPID_BALTIC   0x0003
 
#define LGRPID_CENTRAL_EUROPE   0x0002
 
#define LGRPID_CYRILLIC   0x0005
 
#define LGRPID_GEORGIAN   0x0010
 
#define LGRPID_GREEK   0x0004
 
#define LGRPID_HEBREW   0x000c
 
#define LGRPID_INDIC   0x000f
 
#define LGRPID_INSTALLED   0x00000001
 
#define LGRPID_JAPANESE   0x0007
 
#define LGRPID_KOREAN   0x0008
 
#define LGRPID_SIMPLIFIED_CHINESE   0x000a
 
#define LGRPID_SUPPORTED   0x00000002
 
#define LGRPID_THAI   0x000b
 
#define LGRPID_TRADITIONAL_CHINESE   0x0009
 
#define LGRPID_TURKISH   0x0006
 
#define LGRPID_VIETNAMESE   0x000e
 
#define LGRPID_WESTERN_EUROPE   0x0001
 

Enumerations

enum  StandardFormat { PreeditFormat, SelectionFormat }
 

Functions

virtual IFMETHOD Activate (BOOL fRestoreLayout)=0
 
virtual IFMETHOD AssociateContextEx (HWND hWnd, HIMC hIMC, DWORD dwFlags)=0
 
virtual IFMETHOD ConfigureIMEW (HKL hKL, HWND hWnd, DWORD dwMode, REGISTERWORDW __RPC_FAR *pData)=0
 
virtual IFMETHOD CreateContext (HIMC __RPC_FAR *phIMC)=0
 
virtual IFMETHOD Deactivate (void)=0
 
 DEFINE_GUID (IID_IActiveIMMApp, 0x08c0e040, 0x62d1, 0x11d1, 0x93, 0x26, 0x0, 0x60, 0xb0, 0x67, 0xb8, 0x6e)
 
 DEFINE_GUID (CLSID_CActiveIMM, 0x4955DD33, 0xB159, 0x11d0, 0x8F, 0xCF, 0x0, 0xAA, 0x00, 0x6B, 0xCC, 0x59)
 
 DEFINE_GUID (IID_IActiveIMMMessagePumpOwner, 0xb5cf2cfa, 0x8aeb, 0x11d1, 0x93, 0x64, 0x0, 0x60, 0xb0, 0x67, 0xb8, 0x6e)
 
virtual IFMETHOD DestroyContext (HIMC hIME)=0
 
virtual IFMETHOD DisableIME (DWORD idThread)=0
 
virtual IFMETHOD dummy_ConfigureIMEA ()=0
 
virtual IFMETHOD dummy_EnumRegisterWordA ()=0
 
virtual IFMETHOD dummy_EscapeA ()=0
 
virtual IFMETHOD dummy_GetCandidateListA ()=0
 
virtual IFMETHOD dummy_GetCandidateListCountA ()=0
 
virtual IFMETHOD dummy_GetCodePageA ()=0
 
virtual IFMETHOD dummy_GetCompositionFontA ()=0
 
virtual IFMETHOD dummy_GetCompositionStringA ()=0
 
virtual IFMETHOD dummy_GetConversionListA ()=0
 
virtual IFMETHOD dummy_GetDescriptionA ()=0
 
virtual IFMETHOD dummy_GetGuideLineA ()=0
 
virtual IFMETHOD dummy_GetIMEFileNameA ()=0
 
virtual IFMETHOD dummy_GetImeMenuItemsA ()=0
 
virtual IFMETHOD dummy_GetRegisterWordStyleA ()=0
 
virtual IFMETHOD dummy_InstallIMEA ()=0
 
virtual IFMETHOD dummy_IsUIMessageA ()=0
 
virtual IFMETHOD dummy_RegisterWordA ()=0
 
virtual IFMETHOD dummy_SetCompositionStringA ()=0
 
virtual IFMETHOD dummy_UnregisterWordA ()=0
 
void enableIme (QWidget *w, bool value)
 
virtual IFMETHOD End (void)=0
 
virtual IFMETHOD EnumInputContext (DWORD idThread, IEnumInputContext __RPC_FAR *__RPC_FAR *ppEnum)=0
 
virtual IFMETHOD EnumRegisterWordW (HKL hKL, LPWSTR szReading, DWORD dwStyle, LPWSTR szRegister, LPVOID pData, IEnumRegisterWordW __RPC_FAR *__RPC_FAR *pEnum)=0
 
virtual IFMETHOD EscapeW (HKL hKL, HIMC hIMC, UINT uEscape, LPVOID pData, LRESULT __RPC_FAR *plResult)=0
 
virtual IFMETHOD FilterClientWindows (ATOM __RPC_FAR *aaClassList, UINT uSize)=0
 
QWidgetfindParentforPopup (QWidget *w)
 
virtual IFMETHOD GetCandidateListCountW (HIMC hIMC, DWORD __RPC_FAR *pdwListSize, DWORD __RPC_FAR *pdwBufLen)=0
 
virtual IFMETHOD GetCandidateListW (HIMC hIMC, DWORD dwIndex, UINT uBufLen, CANDIDATELIST __RPC_FAR *pCandList, UINT __RPC_FAR *puCopied)=0
 
virtual IFMETHOD GetCandidateWindow (HIMC hIMC, DWORD dwIndex, CANDIDATEFORM __RPC_FAR *pCandidate)=0
 
virtual IFMETHOD GetCompositionFontW (HIMC hIMC, LOGFONTW __RPC_FAR *plf)=0
 
static LONG getCompositionString (HIMC himc, DWORD dwIndex, LPVOID lpbuf, DWORD dBufLen)
 
virtual IFMETHOD GetCompositionStringW (HIMC hIMC, DWORD dwIndex, DWORD dwBufLen, LONG __RPC_FAR *plCopied, LPVOID pBuf)=0
 
virtual IFMETHOD GetCompositionWindow (HIMC hIMC, COMPOSITIONFORM __RPC_FAR *pCompForm)=0
 
virtual IFMETHOD GetContext (HWND hWnd, HIMC __RPC_FAR *phIMC)=0
 
static HIMC getContext (HWND wnd)
 
virtual IFMETHOD GetConversionListW (HKL hKL, HIMC hIMC, LPWSTR pSrc, UINT uBufLen, UINT uFlag, CANDIDATELIST __RPC_FAR *pDst, UINT __RPC_FAR *puCopied)=0
 
virtual IFMETHOD GetConversionStatus (HIMC hIMC, DWORD __RPC_FAR *pfdwConversion, DWORD __RPC_FAR *pfdwSentence)=0
 
static int getCursorPosition (HIMC himc)
 
virtual IFMETHOD GetDefaultIMEWnd (HWND hWnd, HWND __RPC_FAR *phDefWnd)=0
 
static HWND getDefaultIMEWnd (HWND wnd)
 
virtual IFMETHOD GetDescriptionW (HKL hKL, UINT uBufLen, LPWSTR szDescription, UINT __RPC_FAR *puCopied)=0
 
virtual IFMETHOD GetGuideLineW (HIMC hIMC, DWORD dwIndex, DWORD dwBufLen, LPWSTR pBuf, DWORD __RPC_FAR *pdwResult)=0
 
virtual IFMETHOD GetIMEFileNameW (HKL hKL, UINT uBufLen, LPWSTR szFileName, UINT __RPC_FAR *puCopied)=0
 
virtual IFMETHOD GetImeMenuItemsW (HIMC hIMC, DWORD dwFlags, DWORD dwType, void __RPC_FAR *pImeParentMenu, void __RPC_FAR *pImeMenu, DWORD dwSize, DWORD __RPC_FAR *pdwResult)=0
 
virtual IFMETHOD GetLangId (HKL hKL, LANGID __RPC_FAR *plid)=0
 
virtual IFMETHOD GetOpenStatus (HIMC hIMC)=0
 
virtual IFMETHOD GetProperty (HKL hKL, DWORD fdwIndex, DWORD __RPC_FAR *pdwProperty)=0
 
virtual IFMETHOD GetRegisterWordStyleW (HKL hKL, UINT nItem, STYLEBUFW __RPC_FAR *pStyleBuf, UINT __RPC_FAR *puCopied)=0
 
virtual IFMETHOD GetStatusWindowPos (HIMC hIMC, POINT __RPC_FAR *pptPos)=0
 
static QString getString (HIMC himc, DWORD dwindex, int *selStart=0, int *selLength=0)
 
virtual IFMETHOD GetVirtualKey (HWND hWnd, UINT __RPC_FAR *puVirtualKey)=0
 
virtual IFMETHOD InstallIMEW (LPWSTR szIMEFileName, LPWSTR szLayoutText, HKL __RPC_FAR *phKL)=0
 
virtual IFMETHOD IsIME (HKL hKL)=0
 
bool isInPopup (QWidget *w)
 
bool isPopup (QWidget *w)
 
virtual IFMETHOD IsUIMessageW (HWND hWndIME, UINT msg, WPARAM wParam, LPARAM lParam)=0
 
virtual IFMETHOD NotifyIME (HIMC hIMC, DWORD dwAction, DWORD dwIndex, DWORD dwValue)=0
 
static void notifyIME (HIMC imc, DWORD dwAction, DWORD dwIndex, DWORD dwValue)
 
virtual IFMETHOD OnDefWindowProc (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, LRESULT __RPC_FAR *plResult)=0
 
virtual IFMETHOD OnTranslateMessage (const MSG __RPC_FAR *pMsg)=0
 
virtual IFMETHOD Pause (DWORD __RPC_FAR *pdwCookie)=0
 
bool qt_sendSpontaneousEvent (QObject *, QEvent *)
 
void qt_wince_show_SIP (bool show)
 
virtual IFMETHOD RegisterWordW (HKL hKL, LPWSTR szReading, DWORD dwStyle, LPWSTR szRegister)=0
 
virtual IFMETHOD ReleaseContext (HWND hWnd, HIMC hIMC)=0
 
static void releaseContext (HWND wnd, HIMC imc)
 
virtual IFMETHOD Resume (DWORD dwCookie)=0
 
virtual IFMETHOD SetCandidateWindow (HIMC hIMC, CANDIDATEFORM __RPC_FAR *pCandidate)=0
 
virtual IFMETHOD SetCompositionFontA (HIMC hIMC, LOGFONTA __RPC_FAR *plf)=0
 
virtual IFMETHOD SetCompositionFontW (HIMC hIMC, LOGFONTW __RPC_FAR *plf)=0
 
virtual IFMETHOD SetCompositionStringW (HIMC hIMC, DWORD dwIndex, LPVOID pComp, DWORD dwCompLen, LPVOID pRead, DWORD dwReadLen)=0
 
virtual IFMETHOD SetCompositionWindow (HIMC hIMC, COMPOSITIONFORM __RPC_FAR *pCompForm)=0
 
virtual IFMETHOD SetConversionStatus (HIMC hIMC, DWORD fdwConversion, DWORD fdwSentence)=0
 
virtual IFMETHOD SetOpenStatus (HIMC hIMC, BOOL fOpen)=0
 
virtual IFMETHOD SetStatusWindowPos (HIMC hIMC, POINT __RPC_FAR *pptPos)=0
 
virtual IFMETHOD SimulateHotKey (HWND hWnd, DWORD dwHotKeyID)=0
 
virtual IFMETHOD UnregisterWordW (HKL hKL, LPWSTR szReading, DWORD dwStyle, LPWSTR szUnregister)=0
 

Variables

static IActiveIMMApp * aimm = 0
 
static IActiveIMMMessagePumpOwner * aimmpump = 0
 
static HIMC defaultContext = 0
 
static bool haveCaret = false
 
interface HIMC hIME
 
static QStringimeComposition = 0
 
static int imePosition = -1
 
interface HIMC HIMC __RPC_FAR * phPrev = 0
 
bool qt_use_rtl_extensions
 
static DWORD WM_MSIME_MOUSE = 0
 

Macro Definition Documentation

◆ IFMETHOD

#define IFMETHOD   HRESULT STDMETHODCALLTYPE

Definition at line 90 of file qwininputcontext_win.cpp.

◆ LGRPID_ARABIC

#define LGRPID_ARABIC   0x000d

Definition at line 206 of file qwininputcontext_win.cpp.

Referenced by QWinInputContext::QWinInputContext().

◆ LGRPID_ARMENIAN

#define LGRPID_ARMENIAN   0x0011

Definition at line 210 of file qwininputcontext_win.cpp.

◆ LGRPID_BALTIC

#define LGRPID_BALTIC   0x0003

Definition at line 196 of file qwininputcontext_win.cpp.

◆ LGRPID_CENTRAL_EUROPE

#define LGRPID_CENTRAL_EUROPE   0x0002

Definition at line 195 of file qwininputcontext_win.cpp.

◆ LGRPID_CYRILLIC

#define LGRPID_CYRILLIC   0x0005

Definition at line 198 of file qwininputcontext_win.cpp.

◆ LGRPID_GEORGIAN

#define LGRPID_GEORGIAN   0x0010

Definition at line 209 of file qwininputcontext_win.cpp.

◆ LGRPID_GREEK

#define LGRPID_GREEK   0x0004

Definition at line 197 of file qwininputcontext_win.cpp.

◆ LGRPID_HEBREW

#define LGRPID_HEBREW   0x000c

Definition at line 205 of file qwininputcontext_win.cpp.

Referenced by QWinInputContext::QWinInputContext().

◆ LGRPID_INDIC

#define LGRPID_INDIC   0x000f

Definition at line 208 of file qwininputcontext_win.cpp.

◆ LGRPID_INSTALLED

#define LGRPID_INSTALLED   0x00000001

Definition at line 189 of file qwininputcontext_win.cpp.

Referenced by QWinInputContext::QWinInputContext().

◆ LGRPID_JAPANESE

#define LGRPID_JAPANESE   0x0007

Definition at line 200 of file qwininputcontext_win.cpp.

◆ LGRPID_KOREAN

#define LGRPID_KOREAN   0x0008

Definition at line 201 of file qwininputcontext_win.cpp.

◆ LGRPID_SIMPLIFIED_CHINESE

#define LGRPID_SIMPLIFIED_CHINESE   0x000a

Definition at line 203 of file qwininputcontext_win.cpp.

◆ LGRPID_SUPPORTED

#define LGRPID_SUPPORTED   0x00000002

Definition at line 190 of file qwininputcontext_win.cpp.

◆ LGRPID_THAI

#define LGRPID_THAI   0x000b

Definition at line 204 of file qwininputcontext_win.cpp.

◆ LGRPID_TRADITIONAL_CHINESE

#define LGRPID_TRADITIONAL_CHINESE   0x0009

Definition at line 202 of file qwininputcontext_win.cpp.

◆ LGRPID_TURKISH

#define LGRPID_TURKISH   0x0006

Definition at line 199 of file qwininputcontext_win.cpp.

◆ LGRPID_VIETNAMESE

#define LGRPID_VIETNAMESE   0x000e

Definition at line 207 of file qwininputcontext_win.cpp.

◆ LGRPID_WESTERN_EUROPE

#define LGRPID_WESTERN_EUROPE   0x0001

Definition at line 194 of file qwininputcontext_win.cpp.

Enumeration Type Documentation

◆ StandardFormat

Enumerator
PreeditFormat 
SelectionFormat 

Definition at line 531 of file qwininputcontext_win.cpp.

Function Documentation

◆ Activate()

virtual IFMETHOD Activate ( BOOL  fRestoreLayout)
pure virtual

◆ AssociateContextEx()

virtual IFMETHOD AssociateContextEx ( HWND  hWnd,
HIMC  hIMC,
DWORD  dwFlags 
)
pure virtual

◆ ConfigureIMEW()

virtual IFMETHOD ConfigureIMEW ( HKL  hKL,
HWND  hWnd,
DWORD  dwMode,
REGISTERWORDW __RPC_FAR *  pData 
)
pure virtual

◆ CreateContext()

virtual IFMETHOD CreateContext ( HIMC __RPC_FAR *  phIMC)
pure virtual

◆ Deactivate()

virtual IFMETHOD Deactivate ( void  )
pure virtual

◆ DEFINE_GUID() [1/3]

DEFINE_GUID ( IID_IActiveIMMApp  ,
0x08c0e040  ,
0x62d1  ,
0x11d1  ,
0x93  ,
0x26  ,
0x0  ,
0x60  ,
0xb0  ,
0x67  ,
0xb8  ,
0x6e   
)

◆ DEFINE_GUID() [2/3]

DEFINE_GUID ( CLSID_CActiveIMM  ,
0x4955DD33  ,
0xB159  ,
0x11d0  ,
0x8F  ,
0xCF  ,
0x0  ,
0xAA  ,
0x00  ,
0x6B  ,
0xCC  ,
0x59   
)

◆ DEFINE_GUID() [3/3]

DEFINE_GUID ( IID_IActiveIMMMessagePumpOwner  ,
0xb5cf2cfa  ,
0x8aeb  ,
0x11d1  ,
0x93  ,
0x64  ,
0x0  ,
0x60  ,
0xb0  ,
0x67  ,
0xb8  ,
0x6e   
)

◆ DestroyContext()

virtual IFMETHOD DestroyContext ( HIMC  hIME)
pure virtual

◆ DisableIME()

virtual IFMETHOD DisableIME ( DWORD  idThread)
pure virtual

◆ dummy_ConfigureIMEA()

virtual IFMETHOD dummy_ConfigureIMEA ( )
pure virtual

◆ dummy_EnumRegisterWordA()

virtual IFMETHOD dummy_EnumRegisterWordA ( )
pure virtual

◆ dummy_EscapeA()

virtual IFMETHOD dummy_EscapeA ( )
pure virtual

◆ dummy_GetCandidateListA()

virtual IFMETHOD dummy_GetCandidateListA ( )
pure virtual

◆ dummy_GetCandidateListCountA()

virtual IFMETHOD dummy_GetCandidateListCountA ( )
pure virtual

◆ dummy_GetCodePageA()

virtual IFMETHOD dummy_GetCodePageA ( )
pure virtual

◆ dummy_GetCompositionFontA()

virtual IFMETHOD dummy_GetCompositionFontA ( )
pure virtual

◆ dummy_GetCompositionStringA()

virtual IFMETHOD dummy_GetCompositionStringA ( )
pure virtual

◆ dummy_GetConversionListA()

virtual IFMETHOD dummy_GetConversionListA ( )
pure virtual

◆ dummy_GetDescriptionA()

virtual IFMETHOD dummy_GetDescriptionA ( )
pure virtual

◆ dummy_GetGuideLineA()

virtual IFMETHOD dummy_GetGuideLineA ( )
pure virtual

◆ dummy_GetIMEFileNameA()

virtual IFMETHOD dummy_GetIMEFileNameA ( )
pure virtual

◆ dummy_GetImeMenuItemsA()

virtual IFMETHOD dummy_GetImeMenuItemsA ( )
pure virtual

◆ dummy_GetRegisterWordStyleA()

virtual IFMETHOD dummy_GetRegisterWordStyleA ( )
pure virtual

◆ dummy_InstallIMEA()

virtual IFMETHOD dummy_InstallIMEA ( )
pure virtual

◆ dummy_IsUIMessageA()

virtual IFMETHOD dummy_IsUIMessageA ( )
pure virtual

◆ dummy_RegisterWordA()

virtual IFMETHOD dummy_RegisterWordA ( )
pure virtual

◆ dummy_SetCompositionStringA()

virtual IFMETHOD dummy_SetCompositionStringA ( )
pure virtual

◆ dummy_UnregisterWordA()

virtual IFMETHOD dummy_UnregisterWordA ( )
pure virtual

◆ enableIme()

void enableIme ( QWidget w,
bool  value 
)
inline

Definition at line 658 of file qwininputcontext_win.cpp.

Referenced by QWinInputContext::enable(), and QWinInputContext::enablePopupChild().

659 {
660  if (value) {
661  // enable ime
662  if (defaultContext)
663  ImmAssociateContext(w->effectiveWinId(), defaultContext);
664 #ifdef Q_WS_WINCE
665  if (qApp->autoSipEnabled())
666  qt_wince_show_SIP(true);
667 #endif
668  } else {
669  // disable ime
670  HIMC oldimc = ImmAssociateContext(w->effectiveWinId(), 0);
671  if (!defaultContext)
672  defaultContext = oldimc;
673 #ifdef Q_WS_WINCE
674  if (qApp->autoSipEnabled())
675  qt_wince_show_SIP(false);
676 #endif
677  }
678 }
WId effectiveWinId() const
Returns the effective window system identifier of the widget, i.
Definition: qwidget.cpp:2654
void qt_wince_show_SIP(bool show)
#define qApp
static HIMC defaultContext

◆ End()

virtual IFMETHOD End ( void  )
pure virtual

Referenced by gray_render_line().

◆ EnumInputContext()

virtual IFMETHOD EnumInputContext ( DWORD  idThread,
IEnumInputContext __RPC_FAR *__RPC_FAR *  ppEnum 
)
pure virtual

◆ EnumRegisterWordW()

virtual IFMETHOD EnumRegisterWordW ( HKL  hKL,
LPWSTR  szReading,
DWORD  dwStyle,
LPWSTR  szRegister,
LPVOID  pData,
IEnumRegisterWordW __RPC_FAR *__RPC_FAR *  pEnum 
)
pure virtual

◆ EscapeW()

virtual IFMETHOD EscapeW ( HKL  hKL,
HIMC  hIMC,
UINT  uEscape,
LPVOID  pData,
LRESULT __RPC_FAR *  plResult 
)
pure virtual

◆ FilterClientWindows()

virtual IFMETHOD FilterClientWindows ( ATOM __RPC_FAR *  aaClassList,
UINT  uSize 
)
pure virtual

◆ findParentforPopup()

QWidget* findParentforPopup ( QWidget w)
inline

Definition at line 641 of file qwininputcontext_win.cpp.

Referenced by QWinInputContext::enablePopupChild().

642 {
644  // check if this or its parent is a popup
645  while (isInPopup(e)) {
646  e = e->window()->parentWidget();
647  if (!e)
648  break;
649  e = QWidget::find(e->effectiveWinId());
650  }
651  if (e)
652  return e->window();
653  else
654  return 0;
655 }
QWidget * parentWidget() const
Returns the parent of this widget, or 0 if it does not have any parent widget.
Definition: qwidget.h:1035
WId effectiveWinId() const
Returns the effective window system identifier of the widget, i.
Definition: qwidget.cpp:2654
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
static QWidget * find(WId)
Returns a pointer to the widget with window identifer/handle id.
Definition: qwidget.cpp:2517
QWidget * window() const
Returns the window for this widget, i.e.
Definition: qwidget.cpp:4492
bool isInPopup(QWidget *w)

◆ GetCandidateListCountW()

virtual IFMETHOD GetCandidateListCountW ( HIMC  hIMC,
DWORD __RPC_FAR *  pdwListSize,
DWORD __RPC_FAR *  pdwBufLen 
)
pure virtual

◆ GetCandidateListW()

virtual IFMETHOD GetCandidateListW ( HIMC  hIMC,
DWORD  dwIndex,
UINT  uBufLen,
CANDIDATELIST __RPC_FAR *  pCandList,
UINT __RPC_FAR *  puCopied 
)
pure virtual

◆ GetCandidateWindow()

virtual IFMETHOD GetCandidateWindow ( HIMC  hIMC,
DWORD  dwIndex,
CANDIDATEFORM __RPC_FAR *  pCandidate 
)
pure virtual

◆ GetCompositionFontW()

virtual IFMETHOD GetCompositionFontW ( HIMC  hIMC,
LOGFONTW __RPC_FAR *  plf 
)
pure virtual

◆ getCompositionString()

static LONG getCompositionString ( HIMC  himc,
DWORD  dwIndex,
LPVOID  lpbuf,
DWORD  dBufLen 
)
static

Definition at line 314 of file qwininputcontext_win.cpp.

Referenced by getCursorPosition(), and getString().

315 {
316  LONG len = 0;
317  if (aimm)
318  aimm->GetCompositionStringW(himc, dwIndex, dBufLen, &len, lpbuf);
319  else
320  len = ImmGetCompositionString(himc, dwIndex, lpbuf, dBufLen);
321  return len;
322 }
static IActiveIMMApp * aimm

◆ GetCompositionStringW()

virtual IFMETHOD GetCompositionStringW ( HIMC  hIMC,
DWORD  dwIndex,
DWORD  dwBufLen,
LONG __RPC_FAR *  plCopied,
LPVOID  pBuf 
)
pure virtual

◆ GetCompositionWindow()

virtual IFMETHOD GetCompositionWindow ( HIMC  hIMC,
COMPOSITIONFORM __RPC_FAR *  pCompForm 
)
pure virtual

◆ GetContext()

virtual IFMETHOD GetContext ( HWND  hWnd,
HIMC __RPC_FAR *  phIMC 
)
pure virtual

◆ getContext()

static HIMC getContext ( HWND  wnd)
static

Definition at line 285 of file qwininputcontext_win.cpp.

Referenced by QWinInputContext::composition(), QWinInputContext::endComposition(), QDeclarativeEnginePrivate::get(), QWinInputContext::mouseHandler(), QWinInputContext::reset(), and QWinInputContext::update().

286 {
287  HIMC imc;
288  if (aimm)
289  aimm->GetContext(wnd, &imc);
290  else
291  imc = ImmGetContext(wnd);
292 
293  return imc;
294 }
static IActiveIMMApp * aimm

◆ GetConversionListW()

virtual IFMETHOD GetConversionListW ( HKL  hKL,
HIMC  hIMC,
LPWSTR  pSrc,
UINT  uBufLen,
UINT  uFlag,
CANDIDATELIST __RPC_FAR *  pDst,
UINT __RPC_FAR *  puCopied 
)
pure virtual

◆ GetConversionStatus()

virtual IFMETHOD GetConversionStatus ( HIMC  hIMC,
DWORD __RPC_FAR *  pfdwConversion,
DWORD __RPC_FAR *  pfdwSentence 
)
pure virtual

◆ getCursorPosition()

static int getCursorPosition ( HIMC  himc)
static

Definition at line 324 of file qwininputcontext_win.cpp.

Referenced by QWinInputContext::composition().

325 {
326  return getCompositionString(himc, GCS_CURSORPOS, 0, 0);
327 }
static LONG getCompositionString(HIMC himc, DWORD dwIndex, LPVOID lpbuf, DWORD dBufLen)

◆ GetDefaultIMEWnd()

virtual IFMETHOD GetDefaultIMEWnd ( HWND  hWnd,
HWND __RPC_FAR *  phDefWnd 
)
pure virtual

◆ getDefaultIMEWnd()

static HWND getDefaultIMEWnd ( HWND  wnd)
static

Definition at line 275 of file qwininputcontext_win.cpp.

Referenced by QWinInputContext::mouseHandler().

276 {
277  HWND ime_wnd;
278  if(aimm)
279  aimm->GetDefaultIMEWnd(wnd, &ime_wnd);
280  else
281  ime_wnd = ImmGetDefaultIMEWnd(wnd);
282  return ime_wnd;
283 }
static IActiveIMMApp * aimm

◆ GetDescriptionW()

virtual IFMETHOD GetDescriptionW ( HKL  hKL,
UINT  uBufLen,
LPWSTR  szDescription,
UINT __RPC_FAR *  puCopied 
)
pure virtual

◆ GetGuideLineW()

virtual IFMETHOD GetGuideLineW ( HIMC  hIMC,
DWORD  dwIndex,
DWORD  dwBufLen,
LPWSTR  pBuf,
DWORD __RPC_FAR *  pdwResult 
)
pure virtual

◆ GetIMEFileNameW()

virtual IFMETHOD GetIMEFileNameW ( HKL  hKL,
UINT  uBufLen,
LPWSTR  szFileName,
UINT __RPC_FAR *  puCopied 
)
pure virtual

◆ GetImeMenuItemsW()

virtual IFMETHOD GetImeMenuItemsW ( HIMC  hIMC,
DWORD  dwFlags,
DWORD  dwType,
void __RPC_FAR *  pImeParentMenu,
void __RPC_FAR *  pImeMenu,
DWORD  dwSize,
DWORD __RPC_FAR *  pdwResult 
)
pure virtual

◆ GetLangId()

virtual IFMETHOD GetLangId ( HKL  hKL,
LANGID __RPC_FAR *  plid 
)
pure virtual

◆ GetOpenStatus()

virtual IFMETHOD GetOpenStatus ( HIMC  hIMC)
pure virtual

◆ GetProperty()

virtual IFMETHOD GetProperty ( HKL  hKL,
DWORD  fdwIndex,
DWORD __RPC_FAR *  pdwProperty 
)
pure virtual

◆ GetRegisterWordStyleW()

virtual IFMETHOD GetRegisterWordStyleW ( HKL  hKL,
UINT  nItem,
STYLEBUFW __RPC_FAR *  pStyleBuf,
UINT __RPC_FAR *  puCopied 
)
pure virtual

◆ GetStatusWindowPos()

virtual IFMETHOD GetStatusWindowPos ( HIMC  hIMC,
POINT __RPC_FAR *  pptPos 
)
pure virtual

◆ getString()

static QString getString ( HIMC  himc,
DWORD  dwindex,
int *  selStart = 0,
int *  selLength = 0 
)
static

Definition at line 329 of file qwininputcontext_win.cpp.

Referenced by QWinInputContext::composition().

330 {
331  const int bufferSize = 256;
332  wchar_t buffer[bufferSize];
333  int len = getCompositionString(himc, dwindex, buffer, bufferSize * sizeof(wchar_t));
334 
335  if (selStart) {
336  char attrbuffer[bufferSize];
337  int attrlen = getCompositionString(himc, GCS_COMPATTR, attrbuffer, bufferSize);
338  *selStart = attrlen+1;
339  *selLength = -1;
340  for (int i = 0; i < attrlen; i++) {
341  if (attrbuffer[i] & ATTR_TARGET_CONVERTED) {
342  *selStart = qMin(*selStart, i);
343  *selLength = qMax(*selLength, i);
344  }
345  }
346  *selLength = qMax(0, *selLength - *selStart + 1);
347  }
348 
349  if (len <= 0)
350  return QString();
351 
352  return QString((QChar*)buffer, len / sizeof(QChar));
353 }
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
Definition: qglobal.h:1215
The QString class provides a Unicode character string.
Definition: qstring.h:83
The QChar class provides a 16-bit Unicode character.
Definition: qchar.h:72
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
static LONG getCompositionString(HIMC himc, DWORD dwIndex, LPVOID lpbuf, DWORD dBufLen)

◆ GetVirtualKey()

virtual IFMETHOD GetVirtualKey ( HWND  hWnd,
UINT __RPC_FAR *  puVirtualKey 
)
pure virtual

◆ InstallIMEW()

virtual IFMETHOD InstallIMEW ( LPWSTR  szIMEFileName,
LPWSTR  szLayoutText,
HKL __RPC_FAR *  phKL 
)
pure virtual

◆ IsIME()

virtual IFMETHOD IsIME ( HKL  hKL)
pure virtual

◆ isInPopup()

bool isInPopup ( QWidget w)
inline

Definition at line 631 of file qwininputcontext_win.cpp.

Referenced by QWinInputContext::enablePopupChild(), findParentforPopup(), and QWinInputContext::updateImeStatus().

632 {
633  if (w && (isPopup(w) || isPopup(w->window())))
634  return true;
635  else
636  return false;
637 }
bool isPopup(QWidget *w)
QWidget * window() const
Returns the window for this widget, i.e.
Definition: qwidget.cpp:4492

◆ isPopup()

bool isPopup ( QWidget w)
inline

Definition at line 623 of file qwininputcontext_win.cpp.

Referenced by isInPopup().

624 {
625  if (w && (w->windowFlags() & Qt::Popup) == Qt::Popup)
626  return true;
627  else
628  return false;
629 }
Qt::WindowFlags windowFlags() const
Window flags are a combination of a type (e.
Definition: qwidget.h:939

◆ IsUIMessageW()

virtual IFMETHOD IsUIMessageW ( HWND  hWndIME,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)
pure virtual

◆ NotifyIME()

virtual IFMETHOD NotifyIME ( HIMC  hIMC,
DWORD  dwAction,
DWORD  dwIndex,
DWORD  dwValue 
)
pure virtual

◆ notifyIME()

static void notifyIME ( HIMC  imc,
DWORD  dwAction,
DWORD  dwIndex,
DWORD  dwValue 
)
static

Definition at line 304 of file qwininputcontext_win.cpp.

Referenced by QWinInputContext::endComposition(), and QWinInputContext::reset().

305 {
306  if (!imc)
307  return;
308  if (aimm)
309  aimm->NotifyIME(imc, dwAction, dwIndex, dwValue);
310  else
311  ImmNotifyIME(imc, dwAction, dwIndex, dwValue);
312 }
static IActiveIMMApp * aimm

◆ OnDefWindowProc()

virtual IFMETHOD OnDefWindowProc ( HWND  hWnd,
UINT  Msg,
WPARAM  wParam,
LPARAM  lParam,
LRESULT __RPC_FAR *  plResult 
)
pure virtual

◆ OnTranslateMessage()

virtual IFMETHOD OnTranslateMessage ( const MSG __RPC_FAR *  pMsg)
pure virtual

◆ Pause()

virtual IFMETHOD Pause ( DWORD __RPC_FAR *  pdwCookie)
pure virtual

◆ qt_sendSpontaneousEvent()

bool qt_sendSpontaneousEvent ( QObject ,
QEvent  
)

Definition at line 5779 of file qapplication.cpp.

Referenced by QWinInputContext::composition(), QWinInputContext::endComposition(), QWinInputContext::reconvertString(), and QWinInputContext::reset().

5780 {
5782 }
EventRef event
static bool sendSpontaneousEvent(QObject *receiver, QEvent *event)

◆ qt_wince_show_SIP()

void qt_wince_show_SIP ( bool  show)

Definition at line 394 of file qguifunctions_wince.cpp.

Referenced by enableIme().

395 {
396  resolveAygLibs();
397  if (!ptrAygSHSipInfo)
398  return;
399 
400  AygSIPINFO si;
401  memset(&si, 0, sizeof(si));
402  si.cbSize = sizeof(si);
403  ptrAygSHSipInfo(SPI_GETSIPINFO, 0, &si, 0);
404  si.cbSize = sizeof(si);
405  si.fdwFlags = (show ? SIPF_ON : SIPF_OFF);
406  ptrAygSHSipInfo(SPI_SETSIPINFO, 0, &si, 0);
407 }
#define SPI_GETSIPINFO
#define SPI_SETSIPINFO
#define SIPF_OFF
static AygSHSipInfo ptrAygSHSipInfo
#define SIPF_ON
static void resolveAygLibs()

◆ RegisterWordW()

virtual IFMETHOD RegisterWordW ( HKL  hKL,
LPWSTR  szReading,
DWORD  dwStyle,
LPWSTR  szRegister 
)
pure virtual

◆ ReleaseContext()

virtual IFMETHOD ReleaseContext ( HWND  hWnd,
HIMC  hIMC 
)
pure virtual

◆ releaseContext()

static void releaseContext ( HWND  wnd,
HIMC  imc 
)
static

Definition at line 296 of file qwininputcontext_win.cpp.

Referenced by QWinInputContext::composition(), QWinInputContext::endComposition(), QWinInputContext::mouseHandler(), QWinInputContext::reset(), and QWinInputContext::update().

297 {
298  if (aimm)
299  aimm->ReleaseContext(wnd, imc);
300  else
301  ImmReleaseContext(wnd, imc);
302 }
static IActiveIMMApp * aimm

◆ Resume()

virtual IFMETHOD Resume ( DWORD  dwCookie)
pure virtual

◆ SetCandidateWindow()

virtual IFMETHOD SetCandidateWindow ( HIMC  hIMC,
CANDIDATEFORM __RPC_FAR *  pCandidate 
)
pure virtual

◆ SetCompositionFontA()

virtual IFMETHOD SetCompositionFontA ( HIMC  hIMC,
LOGFONTA __RPC_FAR *  plf 
)
pure virtual

◆ SetCompositionFontW()

virtual IFMETHOD SetCompositionFontW ( HIMC  hIMC,
LOGFONTW __RPC_FAR *  plf 
)
pure virtual

◆ SetCompositionStringW()

virtual IFMETHOD SetCompositionStringW ( HIMC  hIMC,
DWORD  dwIndex,
LPVOID  pComp,
DWORD  dwCompLen,
LPVOID  pRead,
DWORD  dwReadLen 
)
pure virtual

◆ SetCompositionWindow()

virtual IFMETHOD SetCompositionWindow ( HIMC  hIMC,
COMPOSITIONFORM __RPC_FAR *  pCompForm 
)
pure virtual

◆ SetConversionStatus()

virtual IFMETHOD SetConversionStatus ( HIMC  hIMC,
DWORD  fdwConversion,
DWORD  fdwSentence 
)
pure virtual

◆ SetOpenStatus()

virtual IFMETHOD SetOpenStatus ( HIMC  hIMC,
BOOL  fOpen 
)
pure virtual

◆ SetStatusWindowPos()

virtual IFMETHOD SetStatusWindowPos ( HIMC  hIMC,
POINT __RPC_FAR *  pptPos 
)
pure virtual

◆ SimulateHotKey()

virtual IFMETHOD SimulateHotKey ( HWND  hWnd,
DWORD  dwHotKeyID 
)
pure virtual

◆ UnregisterWordW()

virtual IFMETHOD UnregisterWordW ( HKL  hKL,
LPWSTR  szReading,
DWORD  dwStyle,
LPWSTR  szUnregister 
)
pure virtual

Variable Documentation

◆ aimm

IActiveIMMApp* aimm = 0
static

Definition at line 181 of file qwininputcontext_win.cpp.

◆ aimmpump

IActiveIMMMessagePumpOwner* aimmpump = 0
static

Definition at line 182 of file qwininputcontext_win.cpp.

◆ defaultContext

HIMC defaultContext = 0
static

Definition at line 620 of file qwininputcontext_win.cpp.

Referenced by QWinInputContext::enable(), and enableIme().

◆ haveCaret

bool haveCaret = false
static

◆ hIME

interface HIMC hIME

Definition at line 95 of file qwininputcontext_win.cpp.

◆ imeComposition

QString* imeComposition = 0
static

Definition at line 183 of file qwininputcontext_win.cpp.

Referenced by QWinInputContext::~QWinInputContext().

◆ imePosition

int imePosition = -1
static

◆ phPrev

interface HIMC HIMC __RPC_FAR* phPrev = 0

Definition at line 95 of file qwininputcontext_win.cpp.

◆ qt_use_rtl_extensions

bool qt_use_rtl_extensions

Definition at line 266 of file qapplication_win.cpp.

Referenced by QWinInputContext::QWinInputContext().

◆ WM_MSIME_MOUSE

DWORD WM_MSIME_MOUSE = 0
static