3ds Max C++ API Reference
FileDropType Class Reference

#include <idraganddrop.h>

+ Inheritance diagram for FileDropType:

Public Member Functions

 FileDropType ()
 
int TypeCode ()
 
bool IsDropType (int code)
 
CoreExport bool Load (bool showProgress=true)
 
virtual bool CheckDropType (const MCHAR *filename)
 
STDMETHODIMP GetData (FORMATETC *pFormatetc, STGMEDIUM *pmedium)
 
STDMETHODIMP GetDataHere (FORMATETC *pFormatetc, STGMEDIUM *pmedium)
 
STDMETHODIMP QueryGetData (FORMATETC *pFormatetc)
 
- Public Member Functions inherited from DropType
 DropType ()
 
virtual CoreExport ~DropType ()
 
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 CoreExport FileDropTypeFindDropType (const MCHAR *filename, IDataObject *pDataObject=NULL)
 
static CoreExport bool DownloadPackage (URLTab &package, const MCHAR *szDirectory, HWND hwnd=NULL, bool showProgress=true)
 
static CoreExport const MCHARGetDownloadDirectory ()
 
static CoreExport void SetDragSetting (MCHAR *setting)
 
static CoreExport const MCHARGetDragSetting ()
 
static CoreExport bool DownloadUrlToDisk (HWND hwnd, const MCHAR *szUrl, const MCHAR *szPathname, DWORD flags=0)
 
- Static Public Member Functions inherited from DropType
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 URLTab current_package
 
- Static Public Attributes inherited from DropType
static CoreExport IDataObject * current_dataobject
 

Static Protected Member Functions

static CoreExport bool CheckForCachedFile (const MCHAR *filename)
 
static CoreExport bool IsInternetCachedFile (const MCHAR *filename)
 
static CoreExport bool AppendUrlFilename (const MCHAR *szUrl, MSTR &pathname, bool &is_URL)
 

Static Protected Attributes

static CoreExport Tab< FileDropType * > fileDropTypes
 
static CoreExport MSTR download_directory
 
static CoreExport MSTR drag_setting
 
- Static Protected Attributes inherited from DropType
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 DropType, Class URLTab, Class SceneFileDropType, Class ImageFileDropType, Class ImportFileDropType, Class ScriptFileDropType, DropTypes
Description:
This is an intermediate base class for drop content that comes in the form of a package of filenames or URLS. This class maintains a list of all its subclass singleton instances and provides utility methods for finding an appropriate subclass instance, based on the dropped filename, and for download URL packages.
Data Members:
protected:

static Tab<FileDropType*> fileDropTypes;

The table of FileDropTypes.

static MSTR download_directory;

Cache for current default URL package download directory .

public

static URLTab current_package;

Currently dropping URL package. Filled in by the active DropClipFormat in its ParseDataObject() method .

Constructor & Destructor Documentation

◆ FileDropType()

FileDropType ( )
inline
Remarks
Constructor.
906 { FileDropType* dt = this; fileDropTypes.Append(1, &dt); }
Definition: idraganddrop.h:891
static CoreExport Tab< FileDropType * > fileDropTypes
Definition: idraganddrop.h:893
int Append(int num, T *el, int allocExtra=0)
Appends items at the end of the Tab.
Definition: tab.h:281

Member Function Documentation

◆ CheckForCachedFile()

static CoreExport bool CheckForCachedFile ( const MCHAR filename)
staticprotected

◆ IsInternetCachedFile()

static CoreExport bool IsInternetCachedFile ( const MCHAR filename)
staticprotected

◆ AppendUrlFilename()

static CoreExport bool AppendUrlFilename ( const MCHAR szUrl,
MSTR pathname,
bool &  is_URL 
)
staticprotected

◆ Init()

static void Init ( )
inlinestatic
Remarks
This method clears the currently-parsed drop data.
Default Implementation:
{ current_package.Clear(); DropType::Init(); }
static void Init()
Definition: idraganddrop.h:779
static CoreExport MSTR drag_setting
Definition: idraganddrop.h:895
static CoreExport URLTab current_package
Definition: idraganddrop.h:903
CoreExport void Clear()

◆ TypeCode()

int TypeCode ( )
inlinevirtual
Remarks
This method returns the typecode of the DropType.
Default Implementation:
{ return FILE_DROPTYPE; }

Implements DropType.

Reimplemented in MCGFileDropType, PathConfigDropType, MSZipPackageFileDropType, DropScriptFileDropType, ScriptFileDropType, ImportFileDropType, ImageFileDropType, and SceneFileDropType.

916 { return FILE_DROPTYPE; }
#define FILE_DROPTYPE
A package of file names or URL's.
Definition: idraganddrop.h:861

◆ IsDropType()

bool IsDropType ( int  code)
inlinevirtual
Remarks
This method returns TRUE if the DropType is of the specified DropType code, otherwise FALSE.
Parameters:
int code

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

Reimplemented from DropType.

924 { return code == TypeCode() || code == FILE_DROPTYPE; }
int TypeCode()
Definition: idraganddrop.h:916

◆ Load()

CoreExport bool Load ( bool  showProgress = true)
virtual
Remarks
This method will load the URLTab in current_package (filled in by the current DropClipFormat).
Parameters:
bool showProgress = true

The download progress dialog can be displayed by passing true.

Reimplemented from DropType.

Reimplemented in MSZipPackageFileDropType, and DropScriptFileDropType.

◆ FindDropType()

static CoreExport FileDropType* FindDropType ( const MCHAR filename,
IDataObject *  pDataObject = NULL 
)
static
Remarks
This method finds and returns the FileDropType subclass corresponding to the given filename suffix. See DropTypes for more details.
Parameters:
MCHAR* filename

The filename suffix.

IDataObject* pDataObject = NULL

A pointer to the IDataObject.
Returns
The FileDropType that corresponds to the filename suffix. This could be one of the following; sceneFileDropType, imageFileDropType, importFileDropType, dropScriptFileDropType.

◆ CheckDropType()

virtual bool CheckDropType ( const MCHAR filename)
inlinevirtual
Remarks
Subclasses should implement this method to recognize the file types associated with this drop type. This is used by FindDropType().
Parameters:
MCHAR* filename

The filename suffix.
Returns
TRUE if the filename suffix checks out, otherwise FALSE.
Default Implementation:
{ return false; }

Reimplemented in MCGFileDropType, PathConfigDropType, MSZipPackageFileDropType, DropScriptFileDropType, ScriptFileDropType, ImportFileDropType, ImageFileDropType, and SceneFileDropType.

957 { return false; }

◆ DownloadPackage()

static CoreExport bool DownloadPackage ( URLTab package,
const MCHAR szDirectory,
HWND  hwnd = NULL,
bool  showProgress = true 
)
static
Remarks
This method serves as a utility function that can be used to download a package of URLs to the specified directory. If the hwnd argument is supplied, any progress or other messages are centered over that window.
Parameters:
URLTab& package

A reference to the local copies of the URL strings.

MCHAR* directory

The directory path string to download to.

HWND hwnd = NULL

A handle to the window. If this is set to NULL, the default 3ds Max window is used.

bool showProgress = false

The download progress dialog can be displayed by passing true.
Returns
TRUE if the download was successful, otherwise FALSE.

◆ GetDownloadDirectory()

static CoreExport const MCHAR* GetDownloadDirectory ( )
static
Remarks
This method returns the fully-specified path to the directory in which package drops are downloaded.

◆ SetDragSetting()

static CoreExport void SetDragSetting ( MCHAR setting)
static

◆ GetDragSetting()

static CoreExport const MCHAR* GetDragSetting ( )
static

◆ DownloadUrlToDisk()

static CoreExport bool DownloadUrlToDisk ( HWND  hwnd,
const MCHAR szUrl,
const MCHAR szPathname,
DWORD  flags = 0 
)
static
Remarks
This method allows you to download the file referenced by the URL to disk.
Parameters:
HWND hwnd = NULL

A handle to the window.

MCHAR* url

The URL string of the file to download.

MCHAR* fileName

The filename string of the URL to store on disk.

DWORD flags=0

Additional controls to the download behavior. Currently only one flag is supported, DOWNLOADDLG_NOPLACE, which hides an option in the progress dialog that allows the user to place (move) a dropped object immediately after being dropped.
Returns
TRUE if the download was successful, otherwise FALSE.

◆ GetData()

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

◆ GetDataHere()

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

◆ QueryGetData()

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

Member Data Documentation

◆ fileDropTypes

CoreExport Tab<FileDropType*> fileDropTypes
staticprotected

◆ download_directory

CoreExport MSTR download_directory
staticprotected

◆ drag_setting

CoreExport MSTR drag_setting
staticprotected

◆ current_package

CoreExport URLTab current_package
static