ReactOS 0.4.16-dev-122-g325d74c
EnumFormatEtcImpl Class Reference

implementation of IEnumFORMATETC interface More...

#include <dragdropimpl.h>

Inheritance diagram for EnumFormatEtcImpl:
Collaboration diagram for EnumFormatEtcImpl:

Public Member Functions

 EnumFormatEtcImpl (const FormatArray &ArrFE)
 
 EnumFormatEtcImpl (const StorageArray &ArrFE)
 
virtual ~EnumFormatEtcImpl ()
 
virtual HRESULT STDMETHODCALLTYPE Next (ULONG, LPFORMATETC, ULONG *)
 
virtual HRESULT STDMETHODCALLTYPE Skip (ULONG)
 
virtual HRESULT STDMETHODCALLTYPE Reset (void)
 
virtual HRESULT STDMETHODCALLTYPE Clone (IEnumFORMATETC **)
 
- Public Member Functions inherited from IComSrvBase< IEnumFORMATETC, EnumFormatEtcImpl >
 STDMETHODIMP_ (ULONG) AddRef()
 
 STDMETHODIMP_ (ULONG) Release()
 
- Public Member Functions inherited from IComSrvQI< BASE >
 IComSrvQI (REFIID uuid_base)
 
STDMETHODIMP QueryInterface (REFIID riid, LPVOID *ppv)
 
- Public Member Functions inherited from SimpleComObject
ULONG IncRef ()
 
ULONG DecRef ()
 

Private Types

typedef IComSrvBase< IEnumFORMATETC, EnumFormatEtcImplsuper
 

Private Attributes

ULONG m_cRefCount
 
FormatArray m_pFmtEtc
 
size_t m_iCur
 

Additional Inherited Members

- Protected Member Functions inherited from IComSrvBase< IEnumFORMATETC, EnumFormatEtcImpl >
 IComSrvBase (REFIID uuid_base)
 
- Protected Member Functions inherited from IComSrvQI< BASE >
 IComSrvQI ()
 
virtual ~IComSrvQI ()
 
- Protected Member Functions inherited from ComSrvObject
 ComSrvObject ()
 
virtual ~ComSrvObject ()
 
- Protected Attributes inherited from IComSrvQI< BASE >
REFIID _uuid_base
 
- Protected Attributes inherited from ComSrvObject
ULONG _ref
 

Detailed Description

implementation of IEnumFORMATETC interface

Definition at line 27 of file dragdropimpl.h.

Member Typedef Documentation

◆ super

Constructor & Destructor Documentation

◆ EnumFormatEtcImpl() [1/2]

EnumFormatEtcImpl::EnumFormatEtcImpl ( const FormatArray ArrFE)

Definition at line 254 of file dragdropimpl.cpp.

256 m_cRefCount(0),
257 m_iCur(0)
258{
259 for(FormatArray::const_iterator it=ArrFE.begin(); it!=ArrFE.end(); ++it)
260 m_pFmtEtc.push_back(*it);
261}
FormatArray m_pFmtEtc
Definition: dragdropimpl.h:34
IComSrvBase< IEnumFORMATETC, EnumFormatEtcImpl > super
Definition: dragdropimpl.h:30
const GUID IID_IEnumFORMATETC
iterator end()
Definition: _vector.h:184
void push_back(const _Tp &__x=_STLP_DEFAULT_CONSTRUCTED(_Tp))
Definition: _vector.h:379
iterator begin()
Definition: _vector.h:182
const value_type * const_iterator
Definition: _vector.h:125

◆ EnumFormatEtcImpl() [2/2]

EnumFormatEtcImpl::EnumFormatEtcImpl ( const StorageArray ArrFE)

Definition at line 263 of file dragdropimpl.cpp.

265 m_cRefCount(0),
266 m_iCur(0)
267{
268 for(StorageArray::const_iterator it=ArrFE.begin(); it!=ArrFE.end(); ++it)
269 m_pFmtEtc.push_back(*it->_format);
270}
structure containing information for one format of EnumFormatEtcImpl
Definition: dragdropimpl.h:18

◆ ~EnumFormatEtcImpl()

virtual EnumFormatEtcImpl::~EnumFormatEtcImpl ( )
inlinevirtual

Definition at line 40 of file dragdropimpl.h.

40{}

Member Function Documentation

◆ Clone()

STDMETHODIMP EnumFormatEtcImpl::Clone ( IEnumFORMATETC **  ppCloneEnumFormatEtc)
virtual

Definition at line 311 of file dragdropimpl.cpp.

312{
313 if (ppCloneEnumFormatEtc == NULL)
314 return E_POINTER;
315
317
318 if (!newEnum)
319 return E_OUTOFMEMORY;
320
321 newEnum->AddRef();
322 newEnum->m_iCur = m_iCur;
323 *ppCloneEnumFormatEtc = newEnum;
324
325 return S_OK;
326}
implementation of IEnumFORMATETC interface
Definition: dragdropimpl.h:29
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define NULL
Definition: types.h:112
#define S_OK
Definition: intsafe.h:52
#define E_POINTER
Definition: winerror.h:2365

◆ Next()

STDMETHODIMP EnumFormatEtcImpl::Next ( ULONG  celt,
LPFORMATETC  lpFormatEtc,
ULONG pceltFetched 
)
virtual

Definition at line 272 of file dragdropimpl.cpp.

273{
274 if (pceltFetched != NULL)
275 *pceltFetched=0;
276
277 ULONG cReturn = celt;
278
279 if (celt <= 0 || lpFormatEtc == NULL || m_iCur >= m_pFmtEtc.size())
280 return S_FALSE;
281
282 if (pceltFetched == NULL && celt != 1) // pceltFetched can be NULL only for 1 item request
283 return S_FALSE;
284
285 while (m_iCur < m_pFmtEtc.size() && cReturn > 0)
286 {
287 *lpFormatEtc++ = m_pFmtEtc[m_iCur++];
288 --cReturn;
289 }
290 if (pceltFetched != NULL)
291 *pceltFetched = celt - cReturn;
292
293 return (cReturn == 0) ? S_OK : S_FALSE;
294}
size_type size() const
Definition: _vector.h:192
uint32_t ULONG
Definition: typedefs.h:59
#define S_FALSE
Definition: winerror.h:2357

◆ Reset()

STDMETHODIMP EnumFormatEtcImpl::Reset ( void  )
virtual

Definition at line 305 of file dragdropimpl.cpp.

306{
307 m_iCur = 0;
308 return S_OK;
309}

◆ Skip()

STDMETHODIMP EnumFormatEtcImpl::Skip ( ULONG  celt)
virtual

Definition at line 296 of file dragdropimpl.cpp.

297{
298 if ((m_iCur + int(celt)) >= m_pFmtEtc.size())
299 return S_FALSE;
300
301 m_iCur += celt;
302 return S_OK;
303}

Member Data Documentation

◆ m_cRefCount

ULONG EnumFormatEtcImpl::m_cRefCount
private

Definition at line 33 of file dragdropimpl.h.

◆ m_iCur

size_t EnumFormatEtcImpl::m_iCur
private

Definition at line 35 of file dragdropimpl.h.

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

◆ m_pFmtEtc

FormatArray EnumFormatEtcImpl::m_pFmtEtc
private

Definition at line 34 of file dragdropimpl.h.

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


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