1998-05-27 23:24:11 +00: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 23:52:45 +00:00
|
|
|
// Licence: wxWindows licence
|
1998-05-27 23:24:11 +00:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1998-08-07 23:52:45 +00:00
|
|
|
#ifndef _WX_OLEDROPSRC_H
|
|
|
|
#define _WX_OLEDROPSRC_H
|
1998-05-27 23:24:11 +00:00
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
1998-09-28 15:42:54 +00:00
|
|
|
#if !wxUSE_DRAG_AND_DROP
|
1998-09-25 13:28:52 +00:00
|
|
|
#error "You should #define wxUSE_DRAG_AND_DROP to 1 to compile this file!"
|
1998-05-27 23:24:11 +00:00
|
|
|
#endif //WX_DRAG_DROP
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// forward declarations
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
class wxIDropSource;
|
|
|
|
class wxDataObject;
|
|
|
|
|
1998-09-17 16:57:01 +00: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 23:24:11 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxDropSource is used to start the drag-&-drop operation on associated
|
|
|
|
// wxDataObject object. It's responsible for giving UI feedback while dragging.
|
|
|
|
// ----------------------------------------------------------------------------
|
1999-01-08 13:15:42 +00:00
|
|
|
class WXDLLEXPORT wxDropSource
|
1998-05-27 23:24:11 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
// ctors: if you use default ctor you must call SetData() later!
|
1998-08-12 22:37:20 +00: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 23:24:11 +00: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 16:57:01 +00:00
|
|
|
wxDragResult DoDragDrop(bool bAllowMove = FALSE);
|
1998-05-27 23:24:11 +00: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 16:57:01 +00:00
|
|
|
virtual bool GiveFeedback(wxDragResult effect, bool bScrolling);
|
1998-05-27 23:24:11 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void Init();
|
|
|
|
|
|
|
|
wxDataObject *m_pData; // pointer to associated data object
|
|
|
|
|
|
|
|
private:
|
|
|
|
wxIDropSource *m_pIDropSource; // the pointer to COM interface
|
|
|
|
};
|
|
|
|
|
1998-09-17 16:57:01 +00:00
|
|
|
#endif //_WX_OLEDROPSRC_H
|