Public Member Functions | Static Public Member Functions | Static Public Attributes | Static Protected Attributes

DropType Class Reference

Search for all occurrences

Detailed Description

See also:
Class DropClipFormat, Class FileDropType, Class DropScriptDropType, DropTypes.

Description:
This class is available in release 4.0 and later only.

This is the base class for droppable content types. Distinguished instances of subclasses represent different types of drop content, such as a file distinguished by file suffix or a scene object The active DropClipFormat parses dropped IDataObject into one of these dropped types, filling its data members with appropriate guff from the data object.

Each DropClipFormat can encompass multiple possible types of dropped data. For example, the iDrop module can drop max files, image files, script files, etc. The DropClipFormat classes parse raw dropped clipboard data into one of the DropType family of classes. These contain recognizer predicates, extracted data from the current drop, and utilities for working with the data, such as URL downloads, script compile & execution, etc. Custom drop-types can be created by subclassing one of the DropType base classes. The built-in DropTypes are listed in DropTypes.
Data Members:
protected:

static IDragAndDropMgr* dndMgr;

Cached pointer to the drag and drop manager.

static bool dragging;

The drop source state.

static POINT startPt;

The drag and drop starting point.

static WPARAM startKeyState;

They starting state of the keyboard.

static HWND startWnd;

The handle to the starting window.

static bool loaded;

Flags if the current modules is already downloaded.

static IDataObject* current_dataobject;

Currently dropping IDataObject. Filled in by the low-level DragEnter() code.

#include <idraganddrop.h>

Inheritance diagram for DropType:
Inheritance graph
[legend]

List of all members.

Public Member Functions

  DropType ()
virtual CoreExport  ~DropType ()
virtual int  TypeCode ()=0
virtual bool  IsDropType (int code)
virtual bool  Load (bool showProgress=true)
virtual DWORD  DropEffect ()
CoreExport STDMETHODIMP  QueryInterface (REFIID iid, void **ppvObject)
CoreExport  STDMETHODIMP_ (ULONG) AddRef(void)
CoreExport  STDMETHODIMP_ (ULONG) Release(void)
CoreExport STDMETHODIMP  GetData (FORMATETC *pFormatetc, STGMEDIUM *pmedium)
CoreExport STDMETHODIMP  GetDataHere (FORMATETC *pFormatetc, STGMEDIUM *pmedium)
CoreExport STDMETHODIMP  QueryGetData (FORMATETC *pFormatetc)
CoreExport STDMETHODIMP  GetCanonicalFormatEtc (FORMATETC *pFormatetcIn, FORMATETC *pFormatetcOut)
CoreExport STDMETHODIMP  SetData (FORMATETC *pFormatetc, STGMEDIUM *pmedium, BOOL fRelease)
CoreExport STDMETHODIMP  EnumFormatEtc (DWORD dwDirection, IEnumFORMATETC **ppenumFormatetc)
CoreExport STDMETHODIMP  DAdvise (FORMATETC *pFormatetc, DWORD advf, IAdviseSink *pAdvSink, DWORD *pdwConnection)
CoreExport STDMETHODIMP  DUnadvise (DWORD dwConnection)
CoreExport STDMETHODIMP  EnumDAdvise (IEnumSTATDATA **ppenumAdvise)
CoreExport STDMETHODIMP  QueryContinueDrag (BOOL fEscapePressed, DWORD grfKeyState)
CoreExport STDMETHODIMP  GiveFeedback (DWORD dwEffect)
virtual CoreExport void  InitDragDropCheck (LPARAM mousePt, WPARAM keyState, HWND hwnd)
virtual CoreExport void  CancelDragDropCheck ()
virtual CoreExport bool  DragDropCheck (LPARAM mousePt, WPARAM keyState, DWORD allowedEffects)
virtual CoreExport bool  ReadyToDrag ()

Static Public Member Functions

static void  Init ()

Static Public Attributes

static CoreExport IDataObject *  current_dataobject

Static Protected Attributes

static CoreExport IDragAndDropMgr dndMgr
static CoreExport bool  dragging
static CoreExport POINT  startPt
static CoreExport WPARAM  startKeyState
static CoreExport HWND  startWnd
static CoreExport bool  loaded

Constructor & Destructor Documentation

DropType ( ) [inline]
Remarks:
Constructor.
{ if (dndMgr == NULL) dndMgr = GetDragAndDropMgr(); }
virtual CoreExport ~DropType ( ) [virtual]
Remarks:
Destructor.

Member Function Documentation

static void Init ( ) [inline, static]
Remarks:
This method clears the currently-parsed drop data.
Default Implementation:
{ current_dataobject = NULL; loaded = false; }

Reimplemented in FileDropType.

{ current_dataobject = NULL; loaded = false; }
virtual int TypeCode ( ) [pure virtual]
virtual bool IsDropType ( int  code ) [inline, virtual]
Remarks:
This method returns TRUE if the DropType is of the specified DropType code, otherwise FALSE.

Each DropType subclass is given a unique integer code that can be used for type-testing, switching, etc. The TypeCode() method must be implemented to return this code and isDropType() to test against the given code (this is provided to that intermediate DropType base classes with codes can effectively support superclass testing). The codes for the built-in DropTypes are given by the following defined symbols which are listed in DropTypes.
Parameters:
int code

The DropType code.
Default Implementation:
{ return code == TypeCode(); }

Reimplemented in FileDropType, and DropScriptDropType.

{ return code == TypeCode(); }
virtual bool Load ( bool  showProgress = true ) [inline, virtual]
Remarks:
Subclasses should implement this method if they need to perform any droptype-specific loading prior to clipformat data use. For example, the URL module types all download any web-resident files in this method. Control any implemented progress dialog with the showProgress parameter.
Parameters:
bool showProgress = true

The download progress dialog can be displayed by passing true.
Default Implementation:
{ return true; }

Reimplemented in FileDropType, DropScriptFileDropType, and MSZipPackageFileDropType.

{ return true; }
virtual DWORD DropEffect ( ) [inline, virtual]
Remarks:
This method returns the dropeffect currently supported by the accepted dropping type.
Default Implementation:
{ return DROPEFFECT_MOVE; }

Reimplemented in DropScriptDropType.

{ return DROPEFFECT_MOVE; }
CoreExport STDMETHODIMP QueryInterface ( REFIID  iid,
void **  ppvObject 
)
CoreExport STDMETHODIMP_ ( ULONG  ) [inline]
CoreExport STDMETHODIMP_ ( ULONG  ) [inline]
CoreExport STDMETHODIMP GetData ( FORMATETC *  pFormatetc,
STGMEDIUM *  pmedium 
) [inline]

Reimplemented in FileDropType, and DropScriptDropType.

{ return E_UNEXPECTED; }
CoreExport STDMETHODIMP GetDataHere ( FORMATETC *  pFormatetc,
STGMEDIUM *  pmedium 
) [inline]

Reimplemented in FileDropType, and DropScriptDropType.

{ return E_UNEXPECTED; }
CoreExport STDMETHODIMP QueryGetData ( FORMATETC *  pFormatetc ) [inline]

Reimplemented in FileDropType, and DropScriptDropType.

{ return E_UNEXPECTED; }
CoreExport STDMETHODIMP GetCanonicalFormatEtc ( FORMATETC *  pFormatetcIn,
FORMATETC *  pFormatetcOut 
)
CoreExport STDMETHODIMP SetData ( FORMATETC *  pFormatetc,
STGMEDIUM *  pmedium,
BOOL  fRelease 
)
CoreExport STDMETHODIMP EnumFormatEtc ( DWORD  dwDirection,
IEnumFORMATETC **  ppenumFormatetc 
)
CoreExport STDMETHODIMP DAdvise ( FORMATETC *  pFormatetc,
DWORD  advf,
IAdviseSink *  pAdvSink,
DWORD *  pdwConnection 
)
CoreExport STDMETHODIMP DUnadvise ( DWORD  dwConnection )
CoreExport STDMETHODIMP EnumDAdvise ( IEnumSTATDATA **  ppenumAdvise )
CoreExport STDMETHODIMP QueryContinueDrag ( BOOL  fEscapePressed,
DWORD  grfKeyState 
)
CoreExport STDMETHODIMP GiveFeedback ( DWORD  dwEffect ) [inline]
{ return DRAGDROP_S_USEDEFAULTCURSORS; }
virtual CoreExport void InitDragDropCheck ( LPARAM  mousePt,
WPARAM  keyState,
HWND  hwnd 
) [virtual]
virtual CoreExport void CancelDragDropCheck ( ) [virtual]
virtual CoreExport bool DragDropCheck ( LPARAM  mousePt,
WPARAM  keyState,
DWORD  allowedEffects 
) [virtual]
virtual CoreExport bool ReadyToDrag ( ) [inline, virtual]

Reimplemented in DropScriptDropType.

{ return false; }

Member Data Documentation

CoreExport IDragAndDropMgr* dndMgr [static, protected]
CoreExport bool dragging [static, protected]
CoreExport POINT startPt [static, protected]
CoreExport WPARAM startKeyState [static, protected]
CoreExport HWND startWnd [static, protected]
CoreExport bool loaded [static, protected]
CoreExport IDataObject* current_dataobject [static]

DropType DropType DropType DropType DropType DropType DropType DropType DropType DropType
DropType DropType DropType DropType DropType DropType DropType DropType DropType DropType