ReactOS 0.4.16-dev-1438-g4866a25
CEnumTfContext Class Reference

#include <documentmgr.h>

Inheritance diagram for CEnumTfContext:
Collaboration diagram for CEnumTfContext:

Public Member Functions

 CEnumTfContext (_In_opt_ CDocumentMgr *mgr)
 
virtual ~CEnumTfContext ()
 
STDMETHODIMP QueryInterface (REFIID iid, LPVOID *ppvObject) override
 
 STDMETHODIMP_ (ULONG) AddRef() override
 
 STDMETHODIMP_ (ULONG) Release() override
 
STDMETHODIMP Next (ULONG ulCount, ITfContext **rgContext, ULONG *pcFetched) override
 
STDMETHODIMP Skip (ULONG celt) override
 
STDMETHODIMP Reset () override
 
STDMETHODIMP Clone (IEnumTfContexts **ppenum) override
 
HRESULT Clone ([out] IEnumTfContexts **ppEnum)
 
HRESULT Next ([in] ULONG ulCount, [out, size_is(ulCount), length_is(*pcFetched)] ITfContext **rgContext, [out] ULONG *pcFetched)
 
HRESULT Reset ()
 
HRESULT Skip ([in] ULONG ulCount)
 
- 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 HRESULT CreateInstance (_In_opt_ CDocumentMgr *mgr, _Out_ IEnumTfContexts **ppOut)
 

Protected Attributes

LONG m_cRefs
 
DWORD m_index
 
CDocumentMgrm_pDocMgr
 

Additional Inherited Members

- Public Types inherited from IUnknown
typedef IUnknownLPUNKNOWN
 

Detailed Description

Definition at line 62 of file documentmgr.h.

Constructor & Destructor Documentation

◆ CEnumTfContext()

CEnumTfContext::CEnumTfContext ( _In_opt_ CDocumentMgr mgr)

Definition at line 312 of file documentmgr.cpp.

313 : m_cRefs(1)
314 , m_index(0)
315 , m_pDocMgr(mgr)
316{
317 if (mgr)
318 mgr->AddRef();
319}
CDocumentMgr * m_pDocMgr
Definition: documentmgr.h:85
ULONG AddRef()

◆ ~CEnumTfContext()

CEnumTfContext::~CEnumTfContext ( )
virtual

Definition at line 321 of file documentmgr.cpp.

322{
323 if (m_pDocMgr)
324 {
326 m_pDocMgr = NULL;
327 }
328}
#define NULL
Definition: types.h:112
ULONG Release()

Member Function Documentation

◆ Clone()

STDMETHODIMP CEnumTfContext::Clone ( IEnumTfContexts **  ppenum)
override

Implements IEnumTfContexts.

Definition at line 427 of file documentmgr.cpp.

428{
429 TRACE("%p -> (%p)\n", this, ppenum);
430
431 if (!ppenum)
432 {
433 ERR("!ppenum\n");
434 return E_POINTER;
435 }
436
438 if (!This)
439 {
440 ERR("E_OUTOFMEMORY\n");
441 return E_OUTOFMEMORY;
442 }
443
444 This->m_index = m_index;
445 *ppenum = This;
446 return S_OK;
447}
#define ERR(fmt,...)
Definition: precomp.h:57
#define cicNoThrow
Definition: cicbase.h:34
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define S_OK
Definition: intsafe.h:52
#define TRACE(s)
Definition: solgame.cpp:4
#define E_POINTER
Definition: winerror.h:2365

◆ CreateInstance()

HRESULT CEnumTfContext::CreateInstance ( _In_opt_ CDocumentMgr mgr,
_Out_ IEnumTfContexts **  ppOut 
)
static

Definition at line 330 of file documentmgr.cpp.

331{
332 if (!ppOut)
333 {
334 ERR("!ppOut\n");
335 return E_POINTER;
336 }
337
339 if (This == NULL)
340 {
341 ERR("E_OUTOFMEMORY\n");
342 return E_OUTOFMEMORY;
343 }
344
345 *ppOut = static_cast<IEnumTfContexts *>(This);
346 TRACE("returning %p\n", *ppOut);
347 return S_OK;
348}

Referenced by EnumTfContext_Constructor().

◆ Next()

STDMETHODIMP CEnumTfContext::Next ( ULONG  ulCount,
ITfContext **  rgContext,
ULONG pcFetched 
)
override

Implements IEnumTfContexts.

Definition at line 384 of file documentmgr.cpp.

385{
386 TRACE("%p -> (%lu, %p, %p)\n",this, ulCount, rgContext, pcFetched);
387
388 if (!rgContext)
389 {
390 ERR("!rgContext\n");
391 return E_POINTER;
392 }
393
394 ULONG fetched;
395 for (fetched = 0; fetched < ulCount; ++fetched, ++m_index, ++rgContext)
396 {
398 break;
399
401 break;
402
403 *rgContext = m_pDocMgr->m_contextStack[m_index];
404 (*rgContext)->AddRef();
405 }
406
407 if (pcFetched)
408 *pcFetched = fetched;
409
410 return (fetched == ulCount) ? S_OK : S_FALSE;
411}
ITfContext * m_contextStack[2]
Definition: documentmgr.h:54
#define _countof(array)
Definition: sndvol32.h:70
uint32_t ULONG
Definition: typedefs.h:59
#define S_FALSE
Definition: winerror.h:2357

◆ QueryInterface()

STDMETHODIMP CEnumTfContext::QueryInterface ( REFIID  iid,
LPVOID ppvObject 
)
override

Definition at line 350 of file documentmgr.cpp.

351{
352 TRACE("%p -> (%s, %p)\n", this, wine_dbgstr_guid(&iid), ppvObject);
353
354 *ppvObject = NULL;
355
356 if (iid == IID_IUnknown || iid == IID_IEnumTfContexts)
357 *ppvObject = static_cast<IEnumTfContexts *>(this);
358
359 if (*ppvObject)
360 {
361 AddRef();
362 return S_OK;
363 }
364
365 WARN("E_NOINTERFACE: %s\n", wine_dbgstr_guid(&iid));
366 return E_NOINTERFACE;
367}
#define WARN(fmt,...)
Definition: precomp.h:61
const GUID IID_IUnknown
static __inline const char * wine_dbgstr_guid(const GUID *id)
Definition: debug.h:197
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
Definition: wincrypt.h:6082
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ Reset()

STDMETHODIMP CEnumTfContext::Reset ( )
override

Implements IEnumTfContexts.

Definition at line 420 of file documentmgr.cpp.

421{
422 TRACE("%p -> ()\n", this);
423 m_index = 0;
424 return S_OK;
425}

◆ Skip()

STDMETHODIMP CEnumTfContext::Skip ( ULONG  celt)
override

Implements IEnumTfContexts.

Definition at line 413 of file documentmgr.cpp.

414{
415 TRACE("%p -> (%lu)\n", this, celt);
416 m_index += celt;
417 return S_OK;
418}

◆ STDMETHODIMP_() [1/2]

CEnumTfContext::STDMETHODIMP_ ( ULONG  )
override

◆ STDMETHODIMP_() [2/2]

CEnumTfContext::STDMETHODIMP_ ( ULONG  )
override

Member Data Documentation

◆ m_cRefs

LONG CEnumTfContext::m_cRefs
protected

Definition at line 83 of file documentmgr.h.

◆ m_index

DWORD CEnumTfContext::m_index
protected

Definition at line 84 of file documentmgr.h.

Referenced by Clone(), Next(), Reset(), and Skip().

◆ m_pDocMgr

CDocumentMgr* CEnumTfContext::m_pDocMgr
protected

Definition at line 85 of file documentmgr.h.

Referenced by Clone(), Next(), and ~CEnumTfContext().


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