-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtsfread.h
50 lines (40 loc) · 1.45 KB
/
tsfread.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef _TSFREAD_H_
#define _TSFREAD_H_
#include <msctf.h>
class CCompositionPopup;
class CTSFRead : public ITfThreadMgrEventSink,
public ITfTextEditSink
{
public:
CTSFRead();
~CTSFRead();
// IUnknown
STDMETHODIMP QueryInterface(REFIID riid, void **ppvObj);
STDMETHODIMP_(ULONG) AddRef(void);
STDMETHODIMP_(ULONG) Release(void);
// ITfThreadMgrEventSink
STDMETHODIMP OnInitDocumentMgr(ITfDocumentMgr *pDocMgr);
STDMETHODIMP OnUninitDocumentMgr(ITfDocumentMgr *pDocMgr);
STDMETHODIMP OnSetFocus(ITfDocumentMgr *pDocMgrFocus, ITfDocumentMgr *pDocMgrPrevFocus);
STDMETHODIMP OnPushContext(ITfContext *pContext);
STDMETHODIMP OnPopContext(ITfContext *pContext);
// ITfTextEditSink
STDMETHODIMP OnEndEdit(ITfContext *pContext, TfEditCookie ecReadOnly, ITfEditRecord *pEditRecord);
BOOL InitThreadMgrSink();
void UninitThreadMgrSink();
BOOL InitTextEditSink(ITfDocumentMgr *pDocMgr);
void ClearCompositionText();
BOOL CheckComposition(ITfContext *pContext, TfEditCookie ecReadOnly);
HRESULT Initialize();
HRESULT Uninitialize();
protected:
static HRESULT GetDispAttrFromRange(ITfContext *pContext, ITfRange *pRange, TfEditCookie ec, TF_DISPLAYATTRIBUTE *pDispAttr);
private:
DWORD m_dwThreadMgrEventSinkCookie;
DWORD m_dwTextEditSinkCookie;
CComPtr<ITfContext>m_pTextEditSinkContext;
CComPtr<ITfThreadMgr> m_pThreadMgr;
std::wstring m_strCompositionText;
LONG m_nRefCount;
};
#endif _TSFREAD_H_