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__
|
1999-10-16 21:18:49 -04:00
|
|
|
#pragma interface
|
1998-05-27 19:24:11 -04:00
|
|
|
#endif
|
1999-10-16 21:18:49 -04:00
|
|
|
|
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
|
|
|
|
// ----------------------------------------------------------------------------
|
1999-10-16 21:18:49 -04:00
|
|
|
|
1998-05-27 19:24:11 -04:00
|
|
|
class wxIDropSource;
|
1999-10-16 21:18:49 -04:00
|
|
|
class WXDLLEXPORT wxDataObject;
|
|
|
|
class WXDLLEXPORT wxWindow;
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// constants
|
|
|
|
// ----------------------------------------------------------------------------
|
1998-05-27 19:24:11 -04:00
|
|
|
|
1998-09-17 12:57:01 -04:00
|
|
|
enum wxDragResult
|
1999-10-16 21:18:49 -04:00
|
|
|
{
|
1998-09-17 12:57:01 -04:00
|
|
|
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)
|
1999-10-16 21:18:49 -04:00
|
|
|
};
|
1998-09-17 12:57:01 -04:00
|
|
|
|
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.
|
|
|
|
// ----------------------------------------------------------------------------
|
1999-10-16 21:18:49 -04:00
|
|
|
|
1999-01-08 08:15:42 -05:00
|
|
|
class WXDLLEXPORT wxDropSource
|
1998-05-27 19:24:11 -04:00
|
|
|
{
|
|
|
|
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
|
1999-10-16 21:18:49 -04:00
|
|
|
// compatibility, as well as both icon parameters
|
|
|
|
wxDropSource(wxWindow *win = NULL,
|
|
|
|
const wxIcon &go = wxNullIcon,
|
|
|
|
const wxIcon &stop = wxNullIcon );
|
|
|
|
wxDropSource(wxDataObject& data,
|
|
|
|
wxWindow *win = NULL,
|
|
|
|
const wxIcon &go = wxNullIcon,
|
|
|
|
const wxIcon &stop = wxNullIcon );
|
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
|