tkOleDND_TEnumFormatEtc.h

Go to the documentation of this file.
00001 /*
00002  *----------------------------------------------------------------------
00003  * File: tenumformatetc.h
00004  *
00005  *  This file defines the TEnumFormatEtc, an enerator class for the
00006  *  IEnumFORMATETC object.  The IEnumFORMATETC object has the standard
00007  *  enumerator interface.   The only creation oddity it has it the
00008  *  IUnknown interface it takes as its first parameter.  This allows
00009  *  the object to increase the reference count of the object that is
00010  *  being enumerated.  Only after this enumerator is destroyed can the
00011  *  object that created it be destroyed.  This object should only be
00012  *  created by the IDataObject::EnumFormatEtc function.
00013  *----------------------------------------------------------------------
00014  */
00015  
00016 #ifndef _TENUMFORMATETC_H_
00017 #define _TENUMFORMATETC_H_
00018 
00019 class TEnumFormatEtc;
00020 typedef class TEnumFormatEtc *PTEnumFormatEtc;
00021 
00022 class TEnumFormatEtc: public IEnumFORMATETC
00023 {
00024   private:
00025     ULONG           m_refCnt;    /* Reference count */
00026     LPUNKNOWN       m_pUnknownObj;  /* IUnknown for ref counting */
00027     ULONG           m_currElement;  /* Current element */
00028     ULONG           m_numFormats;  /* Number of FORMATETCs in us */
00029     LPFORMATETC      m_formatList;  /* List of formats */
00030 
00031   public:
00032     TEnumFormatEtc(LPUNKNOWN, ULONG, LPFORMATETC);
00033     ~TEnumFormatEtc(void);
00034 
00035     /* IUnknown members */
00036     STDMETHODIMP   QueryInterface(REFIID, LPVOID *);
00037     STDMETHODIMP_(ULONG) AddRef(void);
00038     STDMETHODIMP_(ULONG) Release(void);
00039 
00040     /* IEnumFORMATETC members */
00041     STDMETHODIMP  Next(ULONG, LPFORMATETC, ULONG *);
00042     STDMETHODIMP  Skip(ULONG);
00043     STDMETHODIMP  Reset(void);
00044     STDMETHODIMP  Clone(IEnumFORMATETC **);
00045 };
00046 
00047 extern LPENUMFORMATETC
00048 CreateFormatEtcEnumerator(LPUNKNOWN, ULONG, LPFORMATETC);
00049 
00050 #endif /* _TENUMFORMATETC_H_ */

Generated by  doxygen 1.6.2