1998-05-20 10:21:00 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: ole/droptgt.h
|
|
|
|
// Purpose: declaration of the wxDropTarget class
|
|
|
|
// Author: Vadim Zeitlin
|
1999-10-20 20:25:42 -04:00
|
|
|
// Modified by:
|
1998-05-20 10:21:00 -04:00
|
|
|
// Created: 06.03.98
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 10:21:00 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1998-08-07 19:52:45 -04:00
|
|
|
#ifndef _WX_OLEDROPTGT_H
|
|
|
|
#define _WX_OLEDROPTGT_H
|
1998-05-20 10:21:00 -04:00
|
|
|
|
2004-08-16 08:45:46 -04:00
|
|
|
#if wxUSE_DRAG_AND_DROP
|
1998-05-20 10:21:00 -04:00
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// forward declarations
|
|
|
|
// ----------------------------------------------------------------------------
|
1999-10-20 21:58:57 -04:00
|
|
|
|
1998-05-20 10:21:00 -04:00
|
|
|
class wxIDropTarget;
|
|
|
|
struct IDataObject;
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// An instance of the class wxDropTarget may be associated with any wxWindow
|
|
|
|
// derived object via SetDropTarget() function. If this is done, the virtual
|
|
|
|
// methods of wxDropTarget are called when something is dropped on the window.
|
1999-10-20 20:25:42 -04:00
|
|
|
//
|
1998-05-20 10:21:00 -04:00
|
|
|
// Note that wxDropTarget is an abstract base class (ABC) and you should derive
|
|
|
|
// your own class from it implementing pure virtual function in order to use it
|
|
|
|
// (all of them, including protected ones which are called by the class itself)
|
|
|
|
// ----------------------------------------------------------------------------
|
1999-10-20 21:58:57 -04:00
|
|
|
|
2008-03-26 11:06:00 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxDropTarget : public wxDropTargetBase
|
1998-05-20 10:21:00 -04:00
|
|
|
{
|
|
|
|
public:
|
1999-10-20 20:25:42 -04:00
|
|
|
// ctor & dtor
|
1999-10-20 21:58:57 -04:00
|
|
|
wxDropTarget(wxDataObject *dataObject = NULL);
|
1999-10-20 20:25:42 -04:00
|
|
|
virtual ~wxDropTarget();
|
1998-05-20 10:21:00 -04:00
|
|
|
|
1999-10-20 20:25:42 -04:00
|
|
|
// normally called by wxWindow on window creation/destruction, but might be
|
|
|
|
// called `manually' as well. Register() returns true on success.
|
|
|
|
bool Register(WXHWND hwnd);
|
|
|
|
void Revoke(WXHWND hwnd);
|
1998-05-20 10:21:00 -04:00
|
|
|
|
1999-10-20 21:58:57 -04:00
|
|
|
// provide default implementation for base class pure virtuals
|
|
|
|
virtual bool OnDrop(wxCoord x, wxCoord y);
|
|
|
|
virtual bool GetData();
|
|
|
|
|
|
|
|
// implementation only from now on
|
|
|
|
// -------------------------------
|
|
|
|
|
1999-10-20 20:25:42 -04:00
|
|
|
// do we accept this kind of data?
|
1999-10-20 21:58:57 -04:00
|
|
|
bool IsAcceptedData(IDataObject *pIDataSource) const;
|
|
|
|
|
|
|
|
// give us the data source from IDropTarget::Drop() - this is later used by
|
|
|
|
// GetData() when it's called from inside OnData()
|
|
|
|
void SetDataSource(IDataObject *pIDataSource);
|
1998-05-20 10:21:00 -04:00
|
|
|
|
|
|
|
private:
|
1999-10-20 21:58:57 -04:00
|
|
|
// helper used by IsAcceptedData() and GetData()
|
|
|
|
wxDataFormat GetSupportedFormat(IDataObject *pIDataSource) const;
|
|
|
|
|
|
|
|
wxIDropTarget *m_pIDropTarget; // the pointer to our COM interface
|
|
|
|
IDataObject *m_pIDataSource; // the pointer to the source data object
|
2003-01-02 18:38:11 -05:00
|
|
|
|
|
|
|
DECLARE_NO_COPY_CLASS(wxDropTarget)
|
1998-05-20 10:21:00 -04:00
|
|
|
};
|
|
|
|
|
2004-08-16 08:45:46 -04:00
|
|
|
#endif //wxUSE_DRAG_AND_DROP
|
|
|
|
|
1998-08-07 19:52:45 -04:00
|
|
|
#endif //_WX_OLEDROPTGT_H
|