Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Private Attributes
ClipDataObj Class Reference

List of all members.

Public Member Functions

 ClipDataObj ()
 ~ClipDataObj ()
 STDMETHODIMP_ (ULONG) AddRef()
STDMETHODIMP QueryInterface (REFIID iid, void **ppvObject)
 STDMETHODIMP_ (ULONG) Release()
STDMETHODIMP GetData (FORMATETC *pFormatEtc, STGMEDIUM *pMedium)
STDMETHODIMP GetDataHere (LPFORMATETC pFE, LPSTGMEDIUM pSTM)
STDMETHODIMP QueryGetData (LPFORMATETC pFE)
STDMETHODIMP GetCanonicalFormatEtc (LPFORMATETC pFE, LPFORMATETC pCanonFE)
STDMETHODIMP SetData (LPFORMATETC pFE, LPSTGMEDIUM pSTM, BOOL release)
STDMETHODIMP EnumFormatEtc (DWORD dwDirection, LPENUMFORMATETC *ppEnum)
STDMETHODIMP DAdvise (LPFORMATETC pFE, DWORD flags, LPADVISESINK pAdvise, DWORD *pConn)
STDMETHODIMP DUnadvise (DWORD pConn)
STDMETHODIMP EnumDAdvise (LPENUMSTATDATA *ppEnum)

Private Attributes

LONG mRefCnt

Detailed Description

Definition at line 73 of file clipboard.cpp.


Constructor & Destructor Documentation

Definition at line 76 of file clipboard.cpp.

  {
    mRefCnt = 0;
  } 

Definition at line 81 of file clipboard.cpp.

  {  
  }

Member Function Documentation

STDMETHODIMP ClipDataObj::DAdvise ( LPFORMATETC  pFE,
DWORD  flags,
LPADVISESINK  pAdvise,
DWORD pConn 
) [inline]

Definition at line 177 of file clipboard.cpp.

  {
    return OLE_E_ADVISENOTSUPPORTED;
  }
STDMETHODIMP ClipDataObj::DUnadvise ( DWORD  pConn) [inline]

Definition at line 182 of file clipboard.cpp.

  {
    return OLE_E_ADVISENOTSUPPORTED;
  }
STDMETHODIMP ClipDataObj::EnumDAdvise ( LPENUMSTATDATA *  ppEnum) [inline]

Definition at line 187 of file clipboard.cpp.

  {
    return OLE_E_ADVISENOTSUPPORTED;
  }
STDMETHODIMP ClipDataObj::EnumFormatEtc ( DWORD  dwDirection,
LPENUMFORMATETC *  ppEnum 
) [inline]

Definition at line 172 of file clipboard.cpp.

  {
    return E_NOTIMPL;
  }
STDMETHODIMP ClipDataObj::GetCanonicalFormatEtc ( LPFORMATETC  pFE,
LPFORMATETC  pCanonFE 
) [inline]

Definition at line 161 of file clipboard.cpp.

  {
    pFE->ptd = NULL;
    return E_NOTIMPL;
  }
STDMETHODIMP ClipDataObj::GetData ( FORMATETC *  pFormatEtc,
STGMEDIUM *  pMedium 
) [inline]

Definition at line 119 of file clipboard.cpp.

  {
    
    oleSetup();
    
    BOOL b = OpenClipboard(gClipboardWND);
    
    if (!b)
      return E_FAIL;
    
    HANDLE hData = GetClipboardData(pFormatEtc->cfFormat);
    
    LPVOID src = GlobalLock(hData);
    if(src) {
      ULONG  size  = GlobalSize(hData);
      HANDLE hDest = GlobalAlloc(GHND, size);
      LPVOID dest  = GlobalLock(hDest);
      memcpy(dest, src, size);
      
      GlobalUnlock(hDest);
      GlobalUnlock(hData);
      
      hData = hDest;
    }
    
    pMedium->tymed = (hData == 0) ? TYMED_NULL : TYMED_HGLOBAL;
    pMedium->hGlobal = (HGLOBAL)hData;
    pMedium->pUnkForRelease = NULL;
    
    return S_OK;
  }

Here is the call graph for this function:

STDMETHODIMP ClipDataObj::GetDataHere ( LPFORMATETC  pFE,
LPSTGMEDIUM  pSTM 
) [inline]

Definition at line 151 of file clipboard.cpp.

  {
    return DATA_E_FORMATETC;
  }
STDMETHODIMP ClipDataObj::QueryGetData ( LPFORMATETC  pFE) [inline]

Definition at line 156 of file clipboard.cpp.

  {
    return S_OK;
  }
STDMETHODIMP ClipDataObj::QueryInterface ( REFIID  iid,
void **  ppvObject 
) [inline]

Definition at line 91 of file clipboard.cpp.

  {
    // check to see what interface has been requested
    if(iid == IID_IDataObject || iid == IID_IUnknown)
    {
      AddRef();
      *ppvObject = this;
      return S_OK;
    }
    else
    {
      *ppvObject = 0;
      return E_NOINTERFACE;
    }
  }

Here is the call graph for this function:

Here is the caller graph for this function:

STDMETHODIMP ClipDataObj::SetData ( LPFORMATETC  pFE,
LPSTGMEDIUM  pSTM,
BOOL  release 
) [inline]

Definition at line 167 of file clipboard.cpp.

  {
    return E_NOTIMPL;
  }

Definition at line 85 of file clipboard.cpp.

  {
    mRefCnt++; 
    return mRefCnt; 
  }

Definition at line 107 of file clipboard.cpp.

  {
    mRefCnt--;
    if (mRefCnt == 0)
    {
      delete this;
      return 0;
    }
    
    return mRefCnt;
  }

Member Data Documentation

Definition at line 192 of file clipboard.cpp.


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