ReactOS 0.4.15-dev-8222-g9164419
sinks.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: The sinks of msctfime.ime
5 * COPYRIGHT: Copyright 2024 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
6 */
7
8#pragma once
9
10/***********************************************************************/
11
12typedef struct CESMAP
13{
17
19
21{
26
27public:
28 CCompartmentEventSink(FN_EVENTSINK fnEventSink, LPVOID pUserData);
29 virtual ~CCompartmentEventSink();
30
31 HRESULT _Advise(IUnknown *pUnknown, REFGUID rguid, BOOL bThread);
33
34 // IUnknown interface
35 STDMETHODIMP QueryInterface(REFIID riid, LPVOID* ppvObj) override;
38
39 // ITfCompartmentEventSink interface
40 STDMETHODIMP OnChange(REFGUID rguid) override;
41};
42
43/***********************************************************************/
44
46typedef INT (CALLBACK *FN_LAYOUTCHANGE)(UINT nType, FN_ENDEDIT fnEndEdit, ITfContextView *pView);
47
49{
50protected:
55 union
56 {
59 };
62
63public:
64 CTextEventSink(FN_ENDEDIT fnEndEdit, LPVOID pCallbackPV);
65 virtual ~CTextEventSink();
66
69
70 // IUnknown interface
71 STDMETHODIMP QueryInterface(REFIID riid, LPVOID* ppvObj) override;
74
75 // ITfTextEditSink interface
77 ITfContext *pic,
78 TfEditCookie ecReadOnly,
79 ITfEditRecord *pEditRecord) override;
80
81 // ITfTextLayoutSink interface
84 ITfContext *pContext,
85 TfLayoutCode lcode,
86 ITfContextView *pContextView) override;
87};
88
89/***********************************************************************/
90
93
95{
96protected:
104
105public:
107 _In_ FN_INITDOCMGR fnInit,
108 _In_ FN_PUSHPOP fnPushPop = NULL,
109 _Inout_ LPVOID pvCallbackPV = NULL);
111
113 HRESULT _Advise(ITfThreadMgr *pThreadMgr);
115
116 // IUnknown interface
117 STDMETHODIMP QueryInterface(REFIID riid, LPVOID* ppvObj) override;
120
121 // ITfThreadMgrEventSink interface
124 STDMETHODIMP OnSetFocus(ITfDocumentMgr *pdimFocus, ITfDocumentMgr *pdimPrevFocus) override;
126 STDMETHODIMP OnPopContext(ITfContext *pic) override;
127
128 static INT CALLBACK DIMCallback(
129 UINT nCode,
130 ITfDocumentMgr *pDocMgr1,
131 ITfDocumentMgr *pDocMgr2,
132 LPVOID pUserData);
133};
134
135/***********************************************************************/
136
138{
139protected:
140 typedef INT (CALLBACK *FN_COMPARE)(REFGUID rguid1, REFGUID rguid2, BOOL fActivated,
141 LPVOID pUserData);
147
148public:
151
152 HRESULT _Advise(ITfThreadMgr *pThreadMgr);
154
155 // IUnknown interface
156 STDMETHODIMP QueryInterface(REFIID riid, LPVOID* ppvObj) override;
159
160 // ITfActiveLanguageProfileNotifySink interface
165 BOOL fActivated) override;
166};
#define STDMETHODIMP
Definition: basetyps.h:43
STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppvObj) override
@implemented
Definition: sinks.cpp:430
ITfThreadMgr * m_pThreadMgr
Definition: sinks.h:143
STDMETHODIMP_(ULONG) AddRef() override
HRESULT _Advise(ITfThreadMgr *pThreadMgr)
@implemented
Definition: sinks.cpp:472
virtual ~CActiveLanguageProfileNotifySink()
@implemented
Definition: sinks.cpp:425
STDMETHODIMP_(ULONG) Release() override
STDMETHODIMP OnActivated(REFCLSID clsid, REFGUID guidProfile, BOOL fActivated) override
@implemented
Definition: sinks.cpp:459
HRESULT _Unadvise()
@implemented
Definition: sinks.cpp:502
INT(CALLBACK * FN_COMPARE)(REFGUID rguid1, REFGUID rguid2, BOOL fActivated, LPVOID pUserData)
Definition: sinks.h:140
LPVOID m_pUserData
Definition: sinks.h:25
STDMETHODIMP_(ULONG) Release() override
FN_EVENTSINK m_fnEventSink
Definition: sinks.h:24
STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppvObj) override
@implemented
Definition: sinks.cpp:27
CicArray< CESMAP > m_array
Definition: sinks.h:22
HRESULT _Advise(IUnknown *pUnknown, REFGUID rguid, BOOL bThread)
@implemented
Definition: sinks.cpp:62
HRESULT _Unadvise()
@implemented
Definition: sinks.cpp:100
virtual ~CCompartmentEventSink()
@implemented
Definition: sinks.cpp:22
STDMETHODIMP OnChange(REFGUID rguid) override
@implemented
Definition: sinks.cpp:55
STDMETHODIMP_(ULONG) AddRef() override
IUnknown * m_pUnknown
Definition: sinks.h:52
DWORD m_dwLayoutSinkCookie
Definition: sinks.h:54
HRESULT _Unadvise()
@implemented
Definition: sinks.cpp:248
HRESULT _Advise(IUnknown *pUnknown, UINT uFlags)
@implemented
Definition: sinks.cpp:215
LONG m_cRefs
Definition: sinks.h:51
STDMETHODIMP_(ULONG) Release() override
DWORD m_dwEditSinkCookie
Definition: sinks.h:53
STDMETHODIMP OnLayoutChange(ITfContext *pContext, TfLayoutCode lcode, ITfContextView *pContextView) override
@implemented
Definition: sinks.cpp:196
FN_LAYOUTCHANGE m_fnLayoutChange
Definition: sinks.h:58
STDMETHODIMP_(ULONG) AddRef() override
virtual ~CTextEventSink()
@implemented
Definition: sinks.cpp:145
UINT m_uFlags
Definition: sinks.h:57
LPVOID m_pCallbackPV
Definition: sinks.h:61
STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppvObj) override
@implemented
Definition: sinks.cpp:150
FN_ENDEDIT m_fnEndEdit
Definition: sinks.h:60
STDMETHODIMP OnEndEdit(ITfContext *pic, TfEditCookie ecReadOnly, ITfEditRecord *pEditRecord) override
@implemented
Definition: sinks.cpp:186
FN_INITDOCMGR m_fnInit
Definition: sinks.h:99
STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppvObj) override
@implemented
Definition: sinks.cpp:286
STDMETHODIMP OnInitDocumentMgr(ITfDocumentMgr *pdim) override
Definition: sinks.cpp:323
STDMETHODIMP_(ULONG) Release() override
STDMETHODIMP OnUninitDocumentMgr(ITfDocumentMgr *pdim) override
Definition: sinks.cpp:330
STDMETHODIMP_(ULONG) AddRef() override
ITfThreadMgr * m_pThreadMgr
Definition: sinks.h:97
HRESULT _Unadvise()
Definition: sinks.cpp:385
FN_PUSHPOP m_fnPushPop
Definition: sinks.h:100
DWORD m_dwCookie
Definition: sinks.h:98
STDMETHODIMP OnPushContext(ITfContext *pic) override
Definition: sinks.cpp:345
static INT CALLBACK DIMCallback(UINT nCode, ITfDocumentMgr *pDocMgr1, ITfDocumentMgr *pDocMgr2, LPVOID pUserData)
Definition: sinks.cpp:314
LPVOID m_pCallbackPV
Definition: sinks.h:102
STDMETHODIMP OnSetFocus(ITfDocumentMgr *pdimFocus, ITfDocumentMgr *pdimPrevFocus) override
Definition: sinks.cpp:338
virtual ~CThreadMgrEventSink()
Definition: sinks.h:110
STDMETHODIMP OnPopContext(ITfContext *pic) override
Definition: sinks.cpp:352
void SetCallbackPV(_Inout_ LPVOID pv)
Definition: sinks.cpp:359
HRESULT _Advise(ITfThreadMgr *pThreadMgr)
Definition: sinks.cpp:365
#define NULL
Definition: types.h:112
UINT uFlags
Definition: api.c:59
#define CALLBACK
Definition: compat.h:35
_In_ PUNKNOWN pUnknown
Definition: drmk.h:76
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
REFIID riid
Definition: atlbase.h:39
ULONG AddRef()
ULONG Release()
#define _Inout_
Definition: ms_sal.h:378
#define _Inout_opt_
Definition: ms_sal.h:379
#define _In_
Definition: ms_sal.h:308
REFCLSID clsid
Definition: msctf.c:82
GUID guidProfile
Definition: msctf.idl:646
DWORD TfEditCookie
Definition: msctf.idl:104
unsigned int UINT
Definition: ndis.h:50
#define LPVOID
Definition: nt_native.h:45
long LONG
Definition: pedump.c:60
#define INT
Definition: polytest.cpp:20
#define REFGUID
Definition: guiddef.h:116
#define REFIID
Definition: guiddef.h:118
#define REFCLSID
Definition: guiddef.h:117
INT(CALLBACK * FN_PUSHPOP)(UINT, ITfContext *, LPVOID)
Definition: sinks.h:92
INT(CALLBACK * FN_ENDEDIT)(INT, LPVOID, LPVOID)
Definition: sinks.h:45
INT(CALLBACK * FN_INITDOCMGR)(UINT, ITfDocumentMgr *, ITfDocumentMgr *, LPVOID)
Definition: sinks.h:91
struct CESMAP * PCESMAP
INT(CALLBACK * FN_EVENTSINK)(LPVOID, REFGUID)
Definition: sinks.h:18
INT(CALLBACK * FN_LAYOUTCHANGE)(UINT nType, FN_ENDEDIT fnEndEdit, ITfContextView *pView)
Definition: sinks.h:46
Definition: sinks.h:13
DWORD m_dwCookie
Definition: sinks.h:15
ITfCompartment * m_pComp
Definition: sinks.h:14
Definition: scsiwmi.h:51
int32_t INT
Definition: typedefs.h:58
uint32_t ULONG
Definition: typedefs.h:59