1998-05-27 19:24:11 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: ole/dropsrc.h
|
|
|
|
// Purpose: declaration of the wxDropSource class
|
|
|
|
// Author: Vadim Zeitlin
|
1999-10-20 20:25:42 -04:00
|
|
|
// Modified by:
|
1998-05-27 19:24:11 -04:00
|
|
|
// 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;
|
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// macros
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// this macro may be used instead for wxDropSource ctor arguments: it will use
|
|
|
|
// the cursor 'name' from the resources under MSW, but will expand to
|
|
|
|
// something else under GTK. If you don't use it, you will have to use #ifdef
|
|
|
|
// in the application code.
|
|
|
|
#define wxDROP_ICON(name) wxCursor(#name)
|
|
|
|
|
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-10-20 21:58:57 -04:00
|
|
|
class WXDLLEXPORT wxDropSource : public wxDropSourceBase
|
1998-05-27 19:24:11 -04:00
|
|
|
{
|
|
|
|
public:
|
1999-10-20 20:25:42 -04:00
|
|
|
// ctors: if you use default ctor you must call SetData() later!
|
|
|
|
//
|
|
|
|
// NB: the "wxWindow *win" parameter is unused and is here only for wxGTK
|
|
|
|
// compatibility, as well as both icon parameters
|
|
|
|
wxDropSource(wxWindow *win = NULL,
|
1999-10-24 15:34:11 -04:00
|
|
|
const wxCursor &cursorCopy = wxNullCursor,
|
|
|
|
const wxCursor &cursorMove = wxNullCursor,
|
|
|
|
const wxCursor &cursorStop = wxNullCursor);
|
1999-10-20 20:25:42 -04:00
|
|
|
wxDropSource(wxDataObject& data,
|
1999-10-24 15:34:11 -04:00
|
|
|
wxWindow *win = NULL,
|
|
|
|
const wxCursor &cursorCopy = wxNullCursor,
|
|
|
|
const wxCursor &cursorMove = wxNullCursor,
|
|
|
|
const wxCursor &cursorStop = wxNullCursor);
|
1999-10-20 20:25:42 -04:00
|
|
|
|
|
|
|
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
|
|
|
|
virtual wxDragResult DoDragDrop(bool bAllowMove = FALSE);
|
|
|
|
|
|
|
|
// 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.
|
1999-10-24 15:34:11 -04:00
|
|
|
virtual bool GiveFeedback(wxDragResult effect);
|
1998-05-27 19:24:11 -04:00
|
|
|
|
|
|
|
protected:
|
1999-10-20 20:25:42 -04:00
|
|
|
void Init();
|
1998-05-27 19:24:11 -04:00
|
|
|
|
|
|
|
private:
|
1999-10-20 20:25:42 -04:00
|
|
|
wxIDropSource *m_pIDropSource; // the pointer to COM interface
|
1998-05-27 19:24:11 -04:00
|
|
|
};
|
|
|
|
|
1998-09-17 12:57:01 -04:00
|
|
|
#endif //_WX_OLEDROPSRC_H
|