1998-05-27 19:24:11 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: ole/dropsrc.h
|
|
|
|
// Purpose: declaration of the wxDropSource class
|
|
|
|
// Author: Vadim Zeitlin
|
|
|
|
// Modified by:
|
|
|
|
// Created: 06.03.98
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
|
1998-08-07 19:52:45 -04:00
|
|
|
// Licence: wxWindows licence
|
1998-05-27 19:24:11 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1998-08-07 19:52:45 -04:00
|
|
|
#ifndef _WX_OLEDROPSRC_H
|
|
|
|
#define _WX_OLEDROPSRC_H
|
1998-05-27 19:24:11 -04:00
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
1998-09-28 11:42:54 -04:00
|
|
|
#if !wxUSE_DRAG_AND_DROP
|
1998-09-25 09:28:52 -04:00
|
|
|
#error "You should #define wxUSE_DRAG_AND_DROP to 1 to compile this file!"
|
1998-05-27 19:24:11 -04:00
|
|
|
#endif //WX_DRAG_DROP
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// forward declarations
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
class wxIDropSource;
|
|
|
|
class wxDataObject;
|
|
|
|
|
1998-09-17 12:57:01 -04:00
|
|
|
enum wxDragResult
|
|
|
|
{
|
|
|
|
wxDragError, // error prevented the d&d operation from completing
|
|
|
|
wxDragNone, // drag target didn't accept the data
|
|
|
|
wxDragCopy, // the data was successfully copied
|
|
|
|
wxDragMove, // the data was successfully moved
|
|
|
|
wxDragCancel // the operation was cancelled by user (not an error)
|
|
|
|
};
|
|
|
|
|
1998-05-27 19:24:11 -04:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxDropSource is used to start the drag-&-drop operation on associated
|
|
|
|
// wxDataObject object. It's responsible for giving UI feedback while dragging.
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
class wxDropSource
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
// ctors: if you use default ctor you must call SetData() later!
|
1998-08-12 18:37:20 -04:00
|
|
|
// NB: the "wxWindow *win" parameter is unused and is here only for wxGTK
|
|
|
|
// compatibility
|
|
|
|
wxDropSource(wxWindow *win = NULL);
|
|
|
|
wxDropSource(wxDataObject& data, wxWindow *win = NULL);
|
1998-05-27 19:24:11 -04:00
|
|
|
|
|
|
|
void SetData(wxDataObject& data);
|
|
|
|
|
|
|
|
virtual ~wxDropSource();
|
|
|
|
|
|
|
|
// do it (call this in response to a mouse button press, for example)
|
|
|
|
// params: if bAllowMove is false, data can be only copied
|
1998-09-17 12:57:01 -04:00
|
|
|
wxDragResult DoDragDrop(bool bAllowMove = FALSE);
|
1998-05-27 19:24:11 -04:00
|
|
|
|
|
|
|
// overridable: you may give some custom UI feedback during d&d operation
|
|
|
|
// in this function (it's called on each mouse move, so it shouldn't be too
|
|
|
|
// slow). Just return false if you want default feedback.
|
1998-09-17 12:57:01 -04:00
|
|
|
virtual bool GiveFeedback(wxDragResult effect, bool bScrolling);
|
1998-05-27 19:24:11 -04:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void Init();
|
|
|
|
|
|
|
|
wxDataObject *m_pData; // pointer to associated data object
|
|
|
|
|
|
|
|
private:
|
|
|
|
wxIDropSource *m_pIDropSource; // the pointer to COM interface
|
|
|
|
};
|
|
|
|
|
1998-09-17 12:57:01 -04:00
|
|
|
#endif //_WX_OLEDROPSRC_H
|