ReactOS 0.4.16-dev-1521-gb8f1da6
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 66 of file documentmgr.h.

Constructor & Destructor Documentation

◆ CEnumTfContext()

CEnumTfContext::CEnumTfContext ( _In_opt_ CDocumentMgr mgr)

Definition at line 311 of file documentmgr.cpp.

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

◆ ~CEnumTfContext()

CEnumTfContext::~CEnumTfContext ( )
virtual

Definition at line 320 of file documentmgr.cpp.

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

Member Function Documentation

◆ Clone()

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

Implements IEnumTfContexts.

Definition at line 426 of file documentmgr.cpp.

427{
428 TRACE("%p -> (%p)\n", this, ppenum);
429
430 if (!ppenum)
431 {
432 ERR("!ppenum\n");
433 return E_POINTER;
434 }
435
437 if (!This)
438 {
439 ERR("E_OUTOFMEMORY\n");
440 return E_OUTOFMEMORY;
441 }
442
443 This->m_index = m_index;
444 *ppenum = This;
445 return S_OK;
446}
#define ERR(fmt,...)
Definition: precomp.h:57
#define cicNoThrow
Definition: cicbase.h:46
#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:3481

◆ CreateInstance()

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

Definition at line 329 of file documentmgr.cpp.

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

Referenced by EnumTfContext_Constructor().

◆ Next()

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

Implements IEnumTfContexts.

Definition at line 383 of file documentmgr.cpp.

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

◆ QueryInterface()

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

Definition at line 349 of file documentmgr.cpp.

350{
351 TRACE("%p -> (%s, %p)\n", this, wine_dbgstr_guid(&iid), ppvObject);
352
353 *ppvObject = NULL;
354
355 if (iid == IID_IUnknown || iid == IID_IEnumTfContexts)
356 *ppvObject = static_cast<IEnumTfContexts *>(this);
357
358 if (*ppvObject)
359 {
360 AddRef();
361 return S_OK;
362 }
363
364 WARN("E_NOINTERFACE: %s\n", wine_dbgstr_guid(&iid));
365 return E_NOINTERFACE;
366}
#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
#define E_NOINTERFACE
Definition: winerror.h:3480

◆ Reset()

STDMETHODIMP CEnumTfContext::Reset ( )
override

Implements IEnumTfContexts.

Definition at line 419 of file documentmgr.cpp.

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

◆ Skip()

STDMETHODIMP CEnumTfContext::Skip ( ULONG  celt)
override

Implements IEnumTfContexts.

Definition at line 412 of file documentmgr.cpp.

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

◆ 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 87 of file documentmgr.h.

◆ m_index

DWORD CEnumTfContext::m_index
protected

Definition at line 88 of file documentmgr.h.

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

◆ m_pDocMgr

CDocumentMgr* CEnumTfContext::m_pDocMgr
protected

Definition at line 89 of file documentmgr.h.

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


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