ReactOS 0.4.15-dev-8058-ga7cbb60
inputcontext.h
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS msctfime.ime
3 * LICENSE: LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later)
4 * PURPOSE: Input Context of msctfime.ime
5 * COPYRIGHT: Copyright 2024 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
6 */
7
8#pragma once
9
10#include "sinks.h"
11#include "misc.h"
12
13class CInputContextOwnerCallBack;
15class CicInputContext;
16
17
19
20/***********************************************************************
21 * CInputContextOwner
22 */
24 : public ITfContextOwner
25 , public ITfMouseTrackerACP
26{
27protected:
33
34public:
35 CInputContextOwner(FN_IC_OWNER_CALLBACK fnCallback, LPVOID pCallbackPV);
36 virtual ~CInputContextOwner();
37
38 HRESULT _Advise(IUnknown *pContext);
40
41 // IUnknown methods
42 STDMETHODIMP QueryInterface(REFIID riid, LPVOID* ppvObj) override;
45
46 // ITfContextOwner methods
48 const POINT *ptScreen,
50 LONG *pacp) override;
52 LONG acpStart,
53 LONG acpEnd,
54 RECT *prc,
55 BOOL *pfClipped) override;
57 STDMETHODIMP GetStatus(TF_STATUS *pdcs) override;
58 STDMETHODIMP GetWnd(HWND *phwnd) override;
59 STDMETHODIMP GetAttribute(REFGUID rguidAttribute, VARIANT *pvarValue) override;
60
61 // ITfMouseTrackerACP methods
64 ITfMouseSink *pSink,
65 DWORD *pdwCookie) override;
66 STDMETHODIMP UnadviseMouseSink(DWORD dwCookie) override;
67};
68
69/***********************************************************************
70 * CicInputContext
71 *
72 * The msctfime.ime's input context.
73 */
77 , public ITfCompositionSink
78{
79public:
85 CInputContextOwnerCallBack *m_pICOwnerCallback;
111
112public:
114 _In_ TfClientId cliendId,
115 _Inout_ PCIC_LIBTHREAD pLibThread,
116 _In_ HIMC hIMC);
117 virtual ~CicInputContext() { }
118
119 // IUnknown interface
120 STDMETHODIMP QueryInterface(REFIID riid, LPVOID* ppvObj) override;
123
124 // ITfCleanupContextSink interface
126
127 // ITfContextOwnerCompositionSink interface
128 STDMETHODIMP OnStartComposition(ITfCompositionView *pComposition, BOOL *pfOk) override;
129 STDMETHODIMP OnUpdateComposition(ITfCompositionView *pComposition, ITfRange *pRangeNew) override;
130 STDMETHODIMP OnEndComposition(ITfCompositionView *pComposition) override;
131
132 // ITfCompositionSink interface
133 STDMETHODIMP OnCompositionTerminated(TfEditCookie ecWrite, ITfComposition *pComposition) override;
134
135 HRESULT
137 _Inout_ CicIMCLock& imcLock,
138 _In_ BYTE iAtom,
139 _Out_opt_ LPDWORD pdwGuidAtom);
140
143
144 BOOL SetCompositionString(CicIMCLock& imcLock, ITfThreadMgr_P *pThreadMgr, DWORD dwIndex,
145 LPCVOID lpComp, DWORD dwCompLen, LPCVOID lpRead, DWORD dwReadLen,
146 UINT uCodePage);
147
148 HRESULT SetupDocFeedString(CicIMCLock& imcLock, UINT uCodePage);
153 CicIMCLock& imcLock,
154 ITfThreadMgr_P *pThreadMgr,
155 UINT uCodePage,
156 UINT uMsg,
157 BOOL bUndo);
159 DWORD dwUnknown58,
160 DWORD dwUnknown59,
161 UINT keys,
162 CicIMCLock& imcLock);
163
167
168 HRESULT OnSetCandidatePos(TLS *pTLS, CicIMCLock& imcLock);
169};
#define GetStatus(BaseIoAddress, Status)
Definition: atapi.h:328
#define STDMETHODIMP
Definition: basetyps.h:43
STDMETHODIMP GetACPFromPoint(const POINT *ptScreen, DWORD dwFlags, LONG *pacp) override
@unimplemented
STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppvObj) override
@implemented
STDMETHODIMP UnadviseMouseSink(DWORD dwCookie) override
@implemented
HRESULT _Advise(IUnknown *pContext)
@implemented
FN_IC_OWNER_CALLBACK m_fnCallback
Definition: inputcontext.h:31
STDMETHODIMP GetScreenExt(RECT *prc) override
@implemented
STDMETHODIMP GetTextExt(LONG acpStart, LONG acpEnd, RECT *prc, BOOL *pfClipped) override
@unimplemented
STDMETHODIMP_(ULONG) Release() override
HRESULT _Unadvise()
@implemented
IUnknown * m_pContext
Definition: inputcontext.h:29
STDMETHODIMP AdviseMouseSink(ITfRangeACP *range, ITfMouseSink *pSink, DWORD *pdwCookie) override
@implemented
virtual ~CInputContextOwner()
@implemented
STDMETHODIMP GetWnd(HWND *phwnd) override
@unimplemented
STDMETHODIMP_(ULONG) AddRef() override
STDMETHODIMP GetAttribute(REFGUID rguidAttribute, VARIANT *pvarValue) override
@unimplemented
Definition: misc.h:63
ITfContextOwnerServices * m_pContextOwnerServices
Definition: inputcontext.h:84
STDMETHODIMP OnEndComposition(ITfCompositionView *pComposition) override
@implemented
STDMETHODIMP OnStartComposition(ITfCompositionView *pComposition, BOOL *pfOk) override
@implemented
ITfContext * m_pContext
Definition: inputcontext.h:83
HRESULT SetupReconvertString(CicIMCLock &imcLock, ITfThreadMgr_P *pThreadMgr, UINT uCodePage, UINT uMsg, BOOL bUndo)
@unimplemented
DWORD m_dwUnknown3[3]
Definition: inputcontext.h:90
DWORD m_dwUnknown4[2]
Definition: inputcontext.h:91
CInputContextOwnerCallBack * m_pICOwnerCallback
Definition: inputcontext.h:85
STDMETHODIMP_(ULONG) AddRef() override
STDMETHODIMP OnUpdateComposition(ITfCompositionView *pComposition, ITfRange *pRangeNew) override
@implemented
BOOL SetCompositionString(CicIMCLock &imcLock, ITfThreadMgr_P *pThreadMgr, DWORD dwIndex, LPCVOID lpComp, DWORD dwCompLen, LPCVOID lpRead, DWORD dwReadLen, UINT uCodePage)
@unimplemented
HRESULT EscbCompComplete(CicIMCLock &imcLock)
@unimplemented
STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppvObj) override
@implemented
STDMETHODIMP OnCleanupContext(_In_ TfEditCookie ecWrite, _Inout_ ITfContext *pic) override
@implemented
HRESULT DelayedReconvertFuncCall(CicIMCLock &imcLock)
@unimplemented
void ClearPrevCandidatePos()
HRESULT EscbClearDocFeedBuffer(CicIMCLock &imcLock, BOOL bFlag)
@unimplemented
CCompartmentEventSink * m_pCompEventSink2
Definition: inputcontext.h:88
HRESULT EndReconvertString(CicIMCLock &imcLock)
@unimplemented
DWORD m_dwUnknown6_5[9]
Definition: inputcontext.h:97
ITfDocumentMgr * m_pDocumentMgr
Definition: inputcontext.h:82
CModeBias m_ModeBias
Definition: inputcontext.h:94
CCompartmentEventSink * m_pCompEventSink1
Definition: inputcontext.h:87
HRESULT GetGuidAtom(_Inout_ CicIMCLock &imcLock, _In_ BYTE iAtom, _Out_opt_ LPDWORD pdwGuidAtom)
@implemented
STDMETHODIMP_(ULONG) Release() override
CTextEventSink * m_pTextEventSink
Definition: inputcontext.h:86
HRESULT SetupDocFeedString(CicIMCLock &imcLock, UINT uCodePage)
@unimplemented
HRESULT OnSetCandidatePos(TLS *pTLS, CicIMCLock &imcLock)
@unimplemented
HRESULT DestroyInputContext()
@unimplemented
CInputContextOwner * m_pInputContextOwner
Definition: inputcontext.h:89
DWORD m_dwUnknown7[5]
Definition: inputcontext.h:101
HRESULT EscbCompCancel(CicIMCLock &imcLock)
@unimplemented
virtual ~CicInputContext()
Definition: inputcontext.h:117
DWORD m_adwGuidAtoms[256]
Definition: inputcontext.h:104
HRESULT CreateInputContext(_Inout_ ITfThreadMgr *pThreadMgr, _Inout_ CicIMCLock &imcLock)
@unimplemented
HRESULT MsImeMouseHandler(DWORD dwUnknown58, DWORD dwUnknown59, UINT keys, CicIMCLock &imcLock)
@unimplemented
STDMETHODIMP OnCompositionTerminated(TfEditCookie ecWrite, ITfComposition *pComposition) override
@implemented
TfClientId m_clientId
Definition: inputcontext.h:109
CANDIDATEFORM m_CandForm
Definition: inputcontext.h:107
Definition: tls.h:14
DWORD HIMC
Definition: dimm.idl:75
#define CALLBACK
Definition: compat.h:35
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
GLenum GLint * range
Definition: glext.h:7539
GLfloat param
Definition: glext.h:5796
REFIID riid
Definition: atlbase.h:39
HRESULT(CALLBACK * FN_IC_OWNER_CALLBACK)(UINT uType, LPVOID args, LPVOID param)
Definition: inputcontext.h:18
ULONG AddRef()
ULONG Release()
#define _Out_opt_
Definition: ms_sal.h:346
#define _Inout_
Definition: ms_sal.h:378
#define _In_
Definition: ms_sal.h:308
DWORD TfClientId
Definition: msctf.idl:105
DWORD TfEditCookie
Definition: msctf.idl:104
unsigned int UINT
Definition: ndis.h:50
_Out_ LPRECT prc
Definition: ntgdi.h:1658
long LONG
Definition: pedump.c:60
#define REFIID
Definition: guiddef.h:118
#define args
Definition: format.c:66
Definition: scsiwmi.h:51
uint32_t * LPDWORD
Definition: typedefs.h:59
uint32_t ULONG
Definition: typedefs.h:59
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
CONST void * LPCVOID
Definition: windef.h:191
#define HRESULT
Definition: msvc.h:7
unsigned char BYTE
Definition: xxhash.c:193