3ds Max C++ API Reference
DropType Class Referenceabstract

#include <idraganddrop.h>

+ Inheritance diagram for DropType:

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 Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary. More...
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
 

Static Public Attributes

static CoreExport IDataObject * current_dataobject
 

Static Protected Attributes

static CoreExport IDragAndDropMgrdndMgr
 
static CoreExport bool dragging
 
static CoreExport POINT startPt
 
static CoreExport WPARAM startKeyState
 
static CoreExport HWND startWnd
 
static CoreExport bool loaded
 

Detailed Description

See also
Class DropClipFormat, Class FileDropType, Class DropScriptDropType, DropTypes
Description:
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 package 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 packages is already downloaded.

static IDataObject* current_dataobject;

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

Constructor & Destructor Documentation

◆ DropType()

DropType ( )
inline
Remarks
Constructor.
771 { if (dndMgr == NULL) dndMgr = GetDragAndDropMgr(); }
#define NULL
Definition: autoptr.h:18
static CoreExport IDragAndDropMgr * dndMgr
Definition: idraganddrop.h:759
IDragAndDropMgr * GetDragAndDropMgr()
Definition: idraganddrop.h:79

◆ ~DropType()

virtual CoreExport ~DropType ( )
virtual
Remarks
Destructor.

Member Function Documentation

◆ Init()

static void Init ( )
inlinestatic
Remarks
This method clears the currently-parsed drop data.
Default Implementation:
{ current_dataobject = NULL; loaded = false; }
779 { current_dataobject = NULL; loaded = false; }
static CoreExport IDataObject * current_dataobject
Definition: idraganddrop.h:768
static CoreExport bool loaded
Definition: idraganddrop.h:764

◆ TypeCode()

◆ IsDropType()

virtual bool IsDropType ( int  code)
inlinevirtual
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 DropScriptDropType, and FileDropType.

799 { return code == TypeCode(); }
virtual int TypeCode()=0

◆ Load()

virtual bool Load ( bool  showProgress = true)
inlinevirtual
Remarks
Subclasses should implement this method if they need to perform any droptype-specific loading prior to clipformat data use. For example, the URL package 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 MSZipPackageFileDropType, DropScriptFileDropType, and FileDropType.

815 { return true; }

◆ DropEffect()

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

Reimplemented in DropScriptDropType.

822 { return DROPEFFECT_MOVE; }

◆ QueryInterface()

CoreExport STDMETHODIMP QueryInterface ( REFIID  iid,
void **  ppvObject 
)

◆ STDMETHODIMP_() [1/2]

CoreExport STDMETHODIMP_ ( ULONG  )
inline
828 { return 1; }

◆ STDMETHODIMP_() [2/2]

CoreExport STDMETHODIMP_ ( ULONG  )
inline
829 { return 1; }

◆ GetData()

CoreExport STDMETHODIMP GetData ( FORMATETC *  pFormatetc,
STGMEDIUM *  pmedium 
)
inline
832 { return E_UNEXPECTED; }

◆ GetDataHere()

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

◆ QueryGetData()

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

◆ GetCanonicalFormatEtc()

CoreExport STDMETHODIMP GetCanonicalFormatEtc ( FORMATETC *  pFormatetcIn,
FORMATETC *  pFormatetcOut 
)

◆ SetData()

CoreExport STDMETHODIMP SetData ( FORMATETC *  pFormatetc,
STGMEDIUM *  pmedium,
BOOL  fRelease 
)

◆ EnumFormatEtc()

CoreExport STDMETHODIMP EnumFormatEtc ( DWORD  dwDirection,
IEnumFORMATETC **  ppenumFormatetc 
)

◆ DAdvise()

CoreExport STDMETHODIMP DAdvise ( FORMATETC *  pFormatetc,
DWORD  advf,
IAdviseSink *  pAdvSink,
DWORD *  pdwConnection 
)

◆ DUnadvise()

CoreExport STDMETHODIMP DUnadvise ( DWORD  dwConnection)

◆ EnumDAdvise()

CoreExport STDMETHODIMP EnumDAdvise ( IEnumSTATDATA **  ppenumAdvise)

◆ QueryContinueDrag()

CoreExport STDMETHODIMP QueryContinueDrag ( BOOL  fEscapePressed,
DWORD  grfKeyState 
)

◆ GiveFeedback()

CoreExport STDMETHODIMP GiveFeedback ( DWORD  dwEffect)
inline
844 { return DRAGDROP_S_USEDEFAULTCURSORS; }

◆ InitDragDropCheck()

virtual CoreExport void InitDragDropCheck ( LPARAM  mousePt,
WPARAM  keyState,
HWND  hwnd 
)
virtual

◆ CancelDragDropCheck()

virtual CoreExport void CancelDragDropCheck ( )
virtual

◆ DragDropCheck()

virtual CoreExport bool DragDropCheck ( LPARAM  mousePt,
WPARAM  keyState,
DWORD  allowedEffects 
)
virtual

◆ ReadyToDrag()

virtual CoreExport bool ReadyToDrag ( )
inlinevirtual

Reimplemented in DropScriptDropType.

850 { return false; }

Member Data Documentation

◆ dndMgr

CoreExport IDragAndDropMgr* dndMgr
staticprotected

◆ dragging

CoreExport bool dragging
staticprotected

◆ startPt

CoreExport POINT startPt
staticprotected

◆ startKeyState

CoreExport WPARAM startKeyState
staticprotected

◆ startWnd

CoreExport HWND startWnd
staticprotected

◆ loaded

CoreExport bool loaded
staticprotected

◆ current_dataobject

CoreExport IDataObject* current_dataobject
static