ReactOS 0.4.15-dev-8408-g466a198
CActiveLanguageProfileNotifySink Class Reference

#include <sinks.h>

Inheritance diagram for CActiveLanguageProfileNotifySink:
Collaboration diagram for CActiveLanguageProfileNotifySink:

Public Member Functions

 CActiveLanguageProfileNotifySink (_In_ FN_COMPARE fnCompare, _Inout_opt_ void *pUserData)
 @implemented
 
virtual ~CActiveLanguageProfileNotifySink ()
 @implemented
 
HRESULT _Advise (ITfThreadMgr *pThreadMgr)
 @implemented
 
HRESULT _Unadvise ()
 @implemented
 
STDMETHODIMP QueryInterface (REFIID riid, LPVOID *ppvObj) override
 @implemented
 
 STDMETHODIMP_ (ULONG) AddRef() override
 
 STDMETHODIMP_ (ULONG) Release() override
 
STDMETHODIMP OnActivated (REFCLSID clsid, REFGUID guidProfile, BOOL fActivated) override
 @implemented
 
HRESULT OnActivated ([in] REFCLSID clsid, [in] REFGUID guidProfile, [in] BOOL fActivated)
 
- Public Member Functions inherited from IUnknown
HRESULT QueryInterface ([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
 
ULONG AddRef ()
 
ULONG Release ()
 

Protected Types

typedef INT(CALLBACKFN_COMPARE) (REFGUID rguid1, REFGUID rguid2, BOOL fActivated, LPVOID pUserData)
 

Protected Attributes

LONG m_cRefs
 
ITfThreadMgrm_pThreadMgr
 
DWORD m_dwConnection
 
FN_COMPARE m_fnCompare
 
LPVOID m_pUserData
 

Additional Inherited Members

- Public Types inherited from IUnknown
typedef IUnknownLPUNKNOWN
 

Detailed Description

Definition at line 137 of file sinks.h.

Member Typedef Documentation

◆ FN_COMPARE

typedef INT(CALLBACK * CActiveLanguageProfileNotifySink::FN_COMPARE) (REFGUID rguid1, REFGUID rguid2, BOOL fActivated, LPVOID pUserData)
protected

Definition at line 140 of file sinks.h.

Constructor & Destructor Documentation

◆ CActiveLanguageProfileNotifySink()

CActiveLanguageProfileNotifySink::CActiveLanguageProfileNotifySink ( _In_ FN_COMPARE  fnCompare,
_Inout_opt_ void pUserData 
)

@implemented

Definition at line 414 of file sinks.cpp.

417{
418 m_dwConnection = (DWORD)-1;
419 m_fnCompare = fnCompare;
420 m_cRefs = 1;
421 m_pUserData = pUserData;
422}
#define DWORD
Definition: nt_native.h:44

◆ ~CActiveLanguageProfileNotifySink()

CActiveLanguageProfileNotifySink::~CActiveLanguageProfileNotifySink ( )
virtual

@implemented

Definition at line 425 of file sinks.cpp.

426{
427}

Member Function Documentation

◆ _Advise()

HRESULT CActiveLanguageProfileNotifySink::_Advise ( ITfThreadMgr pThreadMgr)

@implemented

Definition at line 472 of file sinks.cpp.

474{
476
477 ITfSource *pSource = NULL;
478 HRESULT hr = pThreadMgr->QueryInterface(IID_ITfSource, (void **)&pSource);
479 if (FAILED(hr))
480 return E_FAIL;
481
482 hr = pSource->AdviseSink(IID_ITfActiveLanguageProfileNotifySink, this, &m_dwConnection);
483 if (SUCCEEDED(hr))
484 {
485 m_pThreadMgr = pThreadMgr;
486 pThreadMgr->AddRef();
487 hr = S_OK;
488 }
489 else
490 {
491 hr = E_FAIL;
492 }
493
494 if (pSource)
495 pSource->Release();
496
497 return hr;
498}
ITfThreadMgr * m_pThreadMgr
Definition: sinks.h:143
#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
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
HRESULT hr
Definition: shlfolder.c:183

Referenced by CicProfile::InitProfileInstance().

◆ _Unadvise()

HRESULT CActiveLanguageProfileNotifySink::_Unadvise ( )

@implemented

Definition at line 502 of file sinks.cpp.

503{
504 if (!m_pThreadMgr)
505 return E_FAIL;
506
507 ITfSource *pSource = NULL;
508 HRESULT hr = m_pThreadMgr->QueryInterface(IID_ITfSource, (void **)&pSource);
509 if (SUCCEEDED(hr))
510 {
511 hr = pSource->UnadviseSink(m_dwConnection);
512 if (SUCCEEDED(hr))
513 hr = S_OK;
514 }
515
516 if (pSource)
517 pSource->Release();
518
519 if (m_pThreadMgr)
520 {
523 }
524
525 return hr;
526}
ULONG Release()

Referenced by CicProfile::~CicProfile().

◆ OnActivated()

STDMETHODIMP CActiveLanguageProfileNotifySink::OnActivated ( REFCLSID  clsid,
REFGUID  guidProfile,
BOOL  fActivated 
)
override

@implemented

Implements ITfActiveLanguageProfileNotifySink.

Definition at line 459 of file sinks.cpp.

463{
464 if (!m_fnCompare)
465 return 0;
466
467 return m_fnCompare(clsid, guidProfile, fActivated, m_pUserData);
468}
REFCLSID clsid
Definition: msctf.c:82
GUID guidProfile
Definition: msctf.idl:646

◆ QueryInterface()

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

@implemented

Definition at line 430 of file sinks.cpp.

431{
432 static const QITAB c_tab[] =
433 {
435 { NULL }
436 };
437 return ::QISearch(this, c_tab, riid, ppvObj);
438}
REFIID riid
Definition: atlbase.h:39
#define QITABENT(Cthis, Ifoo)
Definition: shlwapi.h:2094

◆ STDMETHODIMP_() [1/2]

CActiveLanguageProfileNotifySink::STDMETHODIMP_ ( ULONG  )
override

◆ STDMETHODIMP_() [2/2]

CActiveLanguageProfileNotifySink::STDMETHODIMP_ ( ULONG  )
override

Member Data Documentation

◆ m_cRefs

LONG CActiveLanguageProfileNotifySink::m_cRefs
protected

Definition at line 142 of file sinks.h.

Referenced by CActiveLanguageProfileNotifySink().

◆ m_dwConnection

DWORD CActiveLanguageProfileNotifySink::m_dwConnection
protected

Definition at line 144 of file sinks.h.

Referenced by _Advise(), _Unadvise(), and CActiveLanguageProfileNotifySink().

◆ m_fnCompare

FN_COMPARE CActiveLanguageProfileNotifySink::m_fnCompare
protected

Definition at line 145 of file sinks.h.

Referenced by CActiveLanguageProfileNotifySink(), and OnActivated().

◆ m_pThreadMgr

ITfThreadMgr* CActiveLanguageProfileNotifySink::m_pThreadMgr
protected

Definition at line 143 of file sinks.h.

Referenced by _Advise(), and _Unadvise().

◆ m_pUserData

LPVOID CActiveLanguageProfileNotifySink::m_pUserData
protected

Definition at line 146 of file sinks.h.

Referenced by CActiveLanguageProfileNotifySink(), and OnActivated().


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