ReactOS 0.4.16-dev-340-g0540c21
CThreadMgrEventSink Class Reference

#include <sinks.h>

Inheritance diagram for CThreadMgrEventSink:
Collaboration diagram for CThreadMgrEventSink:

Public Member Functions

 CThreadMgrEventSink (_In_ FN_INITDOCMGR fnInit, _In_ FN_PUSHPOP fnPushPop=NULL, _Inout_ LPVOID pvCallbackPV=NULL)
 @implemented
 
virtual ~CThreadMgrEventSink ()
 
void SetCallbackPV (_Inout_ LPVOID pv)
 
HRESULT _Advise (ITfThreadMgr *pThreadMgr)
 
HRESULT _Unadvise ()
 
STDMETHODIMP QueryInterface (REFIID riid, LPVOID *ppvObj) override
 @implemented
 
 STDMETHODIMP_ (ULONG) AddRef() override
 
 STDMETHODIMP_ (ULONG) Release() override
 
STDMETHODIMP OnInitDocumentMgr (ITfDocumentMgr *pdim) override
 
STDMETHODIMP OnUninitDocumentMgr (ITfDocumentMgr *pdim) override
 
STDMETHODIMP OnSetFocus (ITfDocumentMgr *pdimFocus, ITfDocumentMgr *pdimPrevFocus) override
 
STDMETHODIMP OnPushContext (ITfContext *pic) override
 
STDMETHODIMP OnPopContext (ITfContext *pic) override
 
HRESULT OnInitDocumentMgr ([in] ITfDocumentMgr *pdim)
 
HRESULT OnUninitDocumentMgr ([in] ITfDocumentMgr *pdim)
 
HRESULT OnSetFocus ([in] ITfDocumentMgr *pdimFocus, [in] ITfDocumentMgr *pdimPrevFocus)
 
HRESULT OnPushContext ([in] ITfContext *pic)
 
HRESULT OnPopContext ([in] ITfContext *pic)
 
- Public Member Functions inherited from IUnknown
HRESULT QueryInterface ([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
 
ULONG AddRef ()
 
ULONG Release ()
 

Static Public Member Functions

static INT CALLBACK DIMCallback (UINT nCode, ITfDocumentMgr *pDocMgr1, ITfDocumentMgr *pDocMgr2, LPVOID pUserData)
 

Protected Attributes

ITfThreadMgrm_pThreadMgr
 
DWORD m_dwCookie
 
FN_INITDOCMGR m_fnInit
 
FN_PUSHPOP m_fnPushPop
 
DWORD m_dw
 
LPVOID m_pCallbackPV
 
LONG m_cRefs
 

Additional Inherited Members

- Public Types inherited from IUnknown
typedef IUnknownLPUNKNOWN
 

Detailed Description

Definition at line 94 of file sinks.h.

Constructor & Destructor Documentation

◆ CThreadMgrEventSink()

CThreadMgrEventSink::CThreadMgrEventSink ( _In_ FN_INITDOCMGR  fnInit,
_In_ FN_PUSHPOP  fnPushPop = NULL,
_Inout_ LPVOID  pvCallbackPV = NULL 
)

@implemented

Definition at line 274 of file sinks.cpp.

278{
279 m_fnInit = fnInit;
280 m_fnPushPop = fnPushPop;
281 m_pCallbackPV = pvCallbackPV;
282 m_cRefs = 1;
283}
FN_INITDOCMGR m_fnInit
Definition: sinks.h:99
FN_PUSHPOP m_fnPushPop
Definition: sinks.h:100
LPVOID m_pCallbackPV
Definition: sinks.h:102

◆ ~CThreadMgrEventSink()

virtual CThreadMgrEventSink::~CThreadMgrEventSink ( )
inlinevirtual

Definition at line 110 of file sinks.h.

110{ }

Member Function Documentation

◆ _Advise()

HRESULT CThreadMgrEventSink::_Advise ( ITfThreadMgr pThreadMgr)

Definition at line 365 of file sinks.cpp.

366{
368
369 HRESULT hr = E_FAIL;
370 ITfSource *pSource = NULL;
371 if (pThreadMgr->QueryInterface(IID_ITfSource, (void **)&pSource) == S_OK &&
372 pSource->AdviseSink(IID_ITfThreadMgrEventSink, this, &m_dwCookie) == S_OK)
373 {
374 m_pThreadMgr = pThreadMgr;
375 pThreadMgr->AddRef();
376 hr = S_OK;
377 }
378
379 if (pSource)
380 pSource->Release();
381
382 return hr;
383}
ITfThreadMgr * m_pThreadMgr
Definition: sinks.h:97
DWORD m_dwCookie
Definition: sinks.h:98
#define E_FAIL
Definition: ddrawi.h:102
#define NULL
Definition: types.h:112
ULONG AddRef()
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
nsrefcnt Release()
#define S_OK
Definition: intsafe.h:52
HRESULT hr
Definition: shlfolder.c:183

Referenced by CicBridge::InitIMMX().

◆ _Unadvise()

HRESULT CThreadMgrEventSink::_Unadvise ( )

Definition at line 385 of file sinks.cpp.

386{
387 HRESULT hr = E_FAIL;
388 ITfSource *pSource = NULL;
389
390 if (m_pThreadMgr)
391 {
392 if (m_pThreadMgr->QueryInterface(IID_ITfSource, (void **)&pSource) == S_OK &&
393 pSource->UnadviseSink(m_dwCookie) == S_OK)
394 {
395 hr = S_OK;
396 }
397
398 if (pSource)
399 pSource->Release();
400 }
401
402 if (m_pThreadMgr)
403 {
406 }
407
408 return hr;
409}
ULONG Release()

Referenced by CicBridge::UnInitIMMX().

◆ DIMCallback()

INT CALLBACK CThreadMgrEventSink::DIMCallback ( UINT  nCode,
ITfDocumentMgr pDocMgr1,
ITfDocumentMgr pDocMgr2,
LPVOID  pUserData 
)
static

Definition at line 314 of file sinks.cpp.

319{
320 return E_NOTIMPL;
321}
#define E_NOTIMPL
Definition: ddrawi.h:99

Referenced by CicBridge::InitIMMX().

◆ OnInitDocumentMgr()

STDMETHODIMP CThreadMgrEventSink::OnInitDocumentMgr ( ITfDocumentMgr pdim)
override

Implements ITfThreadMgrEventSink.

Definition at line 323 of file sinks.cpp.

324{
325 if (!m_fnInit)
326 return S_OK;
327 return m_fnInit(0, pdim, NULL, m_pCallbackPV);
328}

◆ OnPopContext()

STDMETHODIMP CThreadMgrEventSink::OnPopContext ( ITfContext pic)
override

Implements ITfThreadMgrEventSink.

Definition at line 352 of file sinks.cpp.

353{
354 if (!m_fnPushPop)
355 return S_OK;
356 return m_fnPushPop(4, pic, m_pCallbackPV);
357}

◆ OnPushContext()

STDMETHODIMP CThreadMgrEventSink::OnPushContext ( ITfContext pic)
override

Implements ITfThreadMgrEventSink.

Definition at line 345 of file sinks.cpp.

346{
347 if (!m_fnPushPop)
348 return S_OK;
349 return m_fnPushPop(3, pic, m_pCallbackPV);
350}

◆ OnSetFocus()

STDMETHODIMP CThreadMgrEventSink::OnSetFocus ( ITfDocumentMgr pdimFocus,
ITfDocumentMgr pdimPrevFocus 
)
override

Implements ITfThreadMgrEventSink.

Definition at line 338 of file sinks.cpp.

339{
340 if (!m_fnInit)
341 return S_OK;
342 return m_fnInit(2, pdimFocus, pdimPrevFocus, m_pCallbackPV);
343}

◆ OnUninitDocumentMgr()

STDMETHODIMP CThreadMgrEventSink::OnUninitDocumentMgr ( ITfDocumentMgr pdim)
override

Implements ITfThreadMgrEventSink.

Definition at line 330 of file sinks.cpp.

331{
332 if (!m_fnInit)
333 return S_OK;
334 return m_fnInit(1, pdim, NULL, m_pCallbackPV);
335}

◆ QueryInterface()

STDMETHODIMP CThreadMgrEventSink::QueryInterface ( REFIID  riid,
LPVOID ppvObj 
)
override

@implemented

Definition at line 286 of file sinks.cpp.

287{
288 static const QITAB c_tab[] =
289 {
291 { NULL }
292 };
293 return ::QISearch(this, c_tab, riid, ppvObj);
294}
REFIID riid
Definition: atlbase.h:39
#define QITABENT(Cthis, Ifoo)
Definition: shlwapi.h:2122

◆ SetCallbackPV()

void CThreadMgrEventSink::SetCallbackPV ( _Inout_ LPVOID  pv)

Definition at line 359 of file sinks.cpp.

360{
361 if (!m_pCallbackPV)
362 m_pCallbackPV = pv;
363}

Referenced by CicBridge::InitIMMX().

◆ STDMETHODIMP_() [1/2]

CThreadMgrEventSink::STDMETHODIMP_ ( ULONG  )
override

◆ STDMETHODIMP_() [2/2]

CThreadMgrEventSink::STDMETHODIMP_ ( ULONG  )
override

Member Data Documentation

◆ m_cRefs

LONG CThreadMgrEventSink::m_cRefs
protected

Definition at line 103 of file sinks.h.

Referenced by CThreadMgrEventSink().

◆ m_dw

DWORD CThreadMgrEventSink::m_dw
protected

Definition at line 101 of file sinks.h.

◆ m_dwCookie

DWORD CThreadMgrEventSink::m_dwCookie
protected

Definition at line 98 of file sinks.h.

Referenced by _Advise(), and _Unadvise().

◆ m_fnInit

FN_INITDOCMGR CThreadMgrEventSink::m_fnInit
protected

Definition at line 99 of file sinks.h.

Referenced by CThreadMgrEventSink(), OnInitDocumentMgr(), OnSetFocus(), and OnUninitDocumentMgr().

◆ m_fnPushPop

FN_PUSHPOP CThreadMgrEventSink::m_fnPushPop
protected

Definition at line 100 of file sinks.h.

Referenced by CThreadMgrEventSink(), OnPopContext(), and OnPushContext().

◆ m_pCallbackPV

LPVOID CThreadMgrEventSink::m_pCallbackPV
protected

◆ m_pThreadMgr

ITfThreadMgr* CThreadMgrEventSink::m_pThreadMgr
protected

Definition at line 97 of file sinks.h.

Referenced by _Advise(), and _Unadvise().


The documentation for this class was generated from the following files: