Qt 4.8
Public Functions | Properties | List of all members
QWindowsEnumerate Class Reference
Inheritance diagram for QWindowsEnumerate:

Public Functions

ULONG STDMETHODCALLTYPE AddRef ()
 
HRESULT STDMETHODCALLTYPE Clone (IEnumVARIANT **ppEnum)
 
HRESULT STDMETHODCALLTYPE Next (unsigned long celt, VARIANT FAR *rgVar, unsigned long FAR *pCeltFetched)
 
HRESULT STDMETHODCALLTYPE QueryInterface (REFIID, LPVOID *)
 
 QWindowsEnumerate (const QVector< int > &a)
 
ULONG STDMETHODCALLTYPE Release ()
 
HRESULT STDMETHODCALLTYPE Reset ()
 
HRESULT STDMETHODCALLTYPE Skip (unsigned long celt)
 
virtual ~QWindowsEnumerate ()
 

Properties

QVector< int > array
 
ULONG current
 
ULONG ref
 

Detailed Description

Definition at line 509 of file qaccessible_win.cpp.

Constructors and Destructors

◆ QWindowsEnumerate()

QWindowsEnumerate::QWindowsEnumerate ( const QVector< int > &  a)
inline

Definition at line 512 of file qaccessible_win.cpp.

513  : ref(0), current(0),array(a)
514  {
515  }
QVector< int > array

◆ ~QWindowsEnumerate()

virtual QWindowsEnumerate::~QWindowsEnumerate ( )
inlinevirtual

Definition at line 517 of file qaccessible_win.cpp.

517 {}

Functions

◆ AddRef()

ULONG STDMETHODCALLTYPE QWindowsEnumerate::AddRef ( )

Definition at line 550 of file qaccessible_win.cpp.

Referenced by Clone().

551 {
552  return ++ref;
553 }

◆ Clone()

HRESULT STDMETHODCALLTYPE QWindowsEnumerate::Clone ( IEnumVARIANT **  ppEnum)

Definition at line 564 of file qaccessible_win.cpp.

565 {
566  QWindowsEnumerate *penum = 0;
567  *ppEnum = 0;
568 
569  penum = new QWindowsEnumerate(array);
570  if (!penum)
571  return E_OUTOFMEMORY;
572  penum->current = current;
573  penum->array = array;
574  penum->AddRef();
575  *ppEnum = penum;
576 
577  return S_OK;
578 }
QVector< int > array
ULONG STDMETHODCALLTYPE AddRef()
QWindowsEnumerate(const QVector< int > &a)

◆ Next()

HRESULT STDMETHODCALLTYPE QWindowsEnumerate::Next ( unsigned long  celt,
VARIANT FAR *  rgVar,
unsigned long FAR *  pCeltFetched 
)

Definition at line 580 of file qaccessible_win.cpp.

581 {
582  if (pCeltFetched)
583  *pCeltFetched = 0;
584 
585  ULONG l;
586  for (l = 0; l < celt; l++) {
587  VariantInit(&rgVar[l]);
588  if ((current+1) > (ULONG)array.size()) {
589  *pCeltFetched = l;
590  return S_FALSE;
591  }
592 
593  rgVar[l].vt = VT_I4;
594  rgVar[l].lVal = array[(int)current];
595  ++current;
596  }
597  *pCeltFetched = l;
598  return S_OK;
599 }
QVector< int > array
QFactoryLoader * l
int size() const
Returns the number of items in the vector.
Definition: qvector.h:137

◆ QueryInterface()

HRESULT STDMETHODCALLTYPE QWindowsEnumerate::QueryInterface ( REFIID  id,
LPVOID *  iface 
)

Definition at line 534 of file qaccessible_win.cpp.

535 {
536  *iface = 0;
537  if (id == IID_IUnknown)
538  *iface = (IUnknown*)this;
539  else if (id == IID_IEnumVARIANT)
540  *iface = (IEnumVARIANT*)this;
541 
542  if (*iface) {
543  AddRef();
544  return S_OK;
545  }
546 
547  return E_NOINTERFACE;
548 }
ULONG STDMETHODCALLTYPE AddRef()

◆ Release()

ULONG STDMETHODCALLTYPE QWindowsEnumerate::Release ( )

Definition at line 555 of file qaccessible_win.cpp.

556 {
557  if (!--ref) {
558  delete this;
559  return 0;
560  }
561  return ref;
562 }

◆ Reset()

HRESULT STDMETHODCALLTYPE QWindowsEnumerate::Reset ( )

Definition at line 601 of file qaccessible_win.cpp.

602 {
603  current = 0;
604  return S_OK;
605 }

◆ Skip()

HRESULT STDMETHODCALLTYPE QWindowsEnumerate::Skip ( unsigned long  celt)

Definition at line 607 of file qaccessible_win.cpp.

608 {
609  current += celt;
610  if (current > (ULONG)array.size()) {
611  current = array.size();
612  return S_FALSE;
613  }
614  return S_OK;
615 }
QVector< int > array
int size() const
Returns the number of items in the vector.
Definition: qvector.h:137

Properties

◆ array

QVector<int> QWindowsEnumerate::array
private

Definition at line 531 of file qaccessible_win.cpp.

Referenced by Clone().

◆ current

ULONG QWindowsEnumerate::current
private

Definition at line 530 of file qaccessible_win.cpp.

Referenced by Clone().

◆ ref

ULONG QWindowsEnumerate::ref
private

Definition at line 529 of file qaccessible_win.cpp.


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