ReactOS  0.4.15-dev-1636-gf634010
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< IEnumFORMATETC >
 IComSrvQI (REFIID uuid_base)
 
STDMETHODIMP QueryInterface (REFIID riid, LPVOID *ppv)
 
- Public Member Functions inherited from IEnumFORMATETC
HRESULT Next ([in] ULONG celt, [out, size_is(celt), length_is(*pceltFetched)] FORMATETC *rgelt, [out] ULONG *pceltFetched)
 
HRESULT RemoteNext ([in] ULONG celt, [out, size_is(celt), length_is(*pceltFetched)] FORMATETC *rgelt, [out] ULONG *pceltFetched)
 
- Public Member Functions inherited from IUnknown
HRESULT QueryInterface ([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
 
ULONG AddRef ()
 
ULONG Release ()
 
- 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

- Public Types inherited from IEnumFORMATETC
typedef IEnumFORMATETCLPENUMFORMATETC
 
typedef struct IEnumFORMATETC::tagDVTARGETDEVICE DVTARGETDEVICE
 
typedef CLIPFORMAT * LPCLIPFORMAT
 
typedef struct IEnumFORMATETC::tagFORMATETC FORMATETC
 
typedef struct IEnumFORMATETC::tagFORMATETCLPFORMATETC
 
- Public Types inherited from IUnknown
typedef IUnknownLPUNKNOWN
 
- Protected Member Functions inherited from IComSrvBase< IEnumFORMATETC, EnumFormatEtcImpl >
 IComSrvBase (REFIID uuid_base)
 
- Protected Member Functions inherited from IComSrvQI< IEnumFORMATETC >
 IComSrvQI ()
 
virtual ~IComSrvQI ()
 
- Protected Member Functions inherited from ComSrvObject
 ComSrvObject ()
 
virtual ~ComSrvObject ()
 
- Protected Attributes inherited from IComSrvQI< IEnumFORMATETC >
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 }
iterator end()
Definition: _vector.h:184
IComSrvBase< IEnumFORMATETC, EnumFormatEtcImpl > super
Definition: dragdropimpl.h:30
FormatArray m_pFmtEtc
Definition: dragdropimpl.h:34
void push_back(const _Tp &__x=_STLP_DEFAULT_CONSTRUCTED(_Tp))
Definition: _vector.h:379
const GUID IID_IEnumFORMATETC
iterator begin()
Definition: _vector.h:182
const value_type * const_iterator
Definition: _vector.h:125

Referenced by Clone().

◆ 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
iterator end()
Definition: _vector.h:184
IComSrvBase< IEnumFORMATETC, EnumFormatEtcImpl > super
Definition: dragdropimpl.h:30
FormatArray m_pFmtEtc
Definition: dragdropimpl.h:34
void push_back(const _Tp &__x=_STLP_DEFAULT_CONSTRUCTED(_Tp))
Definition: _vector.h:379
const GUID IID_IEnumFORMATETC
iterator begin()
Definition: _vector.h:182

◆ ~EnumFormatEtcImpl()

virtual EnumFormatEtcImpl::~EnumFormatEtcImpl ( )
inlinevirtual

Definition at line 40 of file dragdropimpl.h.

40 {}

Member Function Documentation

◆ Clone()

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

Implements IEnumFORMATETC.

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 }
EnumFormatEtcImpl(const FormatArray &ArrFE)
implementation of IEnumFORMATETC interface
Definition: dragdropimpl.h:27
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
FormatArray m_pFmtEtc
Definition: dragdropimpl.h:34
ULONG AddRef()
#define S_OK
Definition: intsafe.h:51
#define NULL
Definition: types.h:112
#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 }
FormatArray m_pFmtEtc
Definition: dragdropimpl.h:34
#define S_FALSE
Definition: winerror.h:2357
#define S_OK
Definition: intsafe.h:51
#define NULL
Definition: types.h:112
size_type size() const
Definition: _vector.h:192
unsigned int ULONG
Definition: retypes.h:1

◆ Reset()

STDMETHODIMP EnumFormatEtcImpl::Reset ( void  )
virtual

Implements IEnumFORMATETC.

Definition at line 305 of file dragdropimpl.cpp.

306 {
307  m_iCur = 0;
308  return S_OK;
309 }
#define S_OK
Definition: intsafe.h:51

◆ Skip()

STDMETHODIMP EnumFormatEtcImpl::Skip ( ULONG  celt)
virtual

Implements IEnumFORMATETC.

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 }
FormatArray m_pFmtEtc
Definition: dragdropimpl.h:34
#define S_FALSE
Definition: winerror.h:2357
#define S_OK
Definition: intsafe.h:51
size_type size() const
Definition: _vector.h:192

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: