1
///////////////////////////////////////////////////////////////////////////////
2
// Name: wx/msw/ole/dropsrc.h
3
// Purpose: declaration of the wxDropSource class
4
// Author: Vadim Zeitlin
7
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
8
// Licence: wxWindows licence
9
///////////////////////////////////////////////////////////////////////////////
11
#ifndef _WX_OLEDROPSRC_H
12
#define _WX_OLEDROPSRC_H
14
#if wxUSE_DRAG_AND_DROP
16
// ----------------------------------------------------------------------------
17
// forward declarations
18
// ----------------------------------------------------------------------------
21
class WXDLLIMPEXP_FWD_CORE wxDataObject;
22
class WXDLLIMPEXP_FWD_CORE wxWindow;
24
// ----------------------------------------------------------------------------
26
// ----------------------------------------------------------------------------
28
// this macro may be used instead for wxDropSource ctor arguments: it will use
29
// the cursor 'name' from the resources under MSW, but will expand to
30
// something else under GTK. If you don't use it, you will have to use #ifdef
31
// in the application code.
32
#define wxDROP_ICON(name) wxCursor(wxT(#name))
34
// ----------------------------------------------------------------------------
35
// wxDropSource is used to start the drag-&-drop operation on associated
36
// wxDataObject object. It's responsible for giving UI feedback while dragging.
37
// ----------------------------------------------------------------------------
39
class WXDLLIMPEXP_CORE wxDropSource : public wxDropSourceBase
42
// ctors: if you use default ctor you must call SetData() later!
44
// NB: the "wxWindow *win" parameter is unused and is here only for wxGTK
45
// compatibility, as well as both icon parameters
46
wxDropSource(wxWindow *win = NULL,
47
const wxCursor &cursorCopy = wxNullCursor,
48
const wxCursor &cursorMove = wxNullCursor,
49
const wxCursor &cursorStop = wxNullCursor);
50
wxDropSource(wxDataObject& data,
52
const wxCursor &cursorCopy = wxNullCursor,
53
const wxCursor &cursorMove = wxNullCursor,
54
const wxCursor &cursorStop = wxNullCursor);
56
virtual ~wxDropSource();
58
// do it (call this in response to a mouse button press, for example)
59
// params: if bAllowMove is false, data can be only copied
60
virtual wxDragResult DoDragDrop(int flags = wxDrag_CopyOnly);
62
// overridable: you may give some custom UI feedback during d&d operation
63
// in this function (it's called on each mouse move, so it shouldn't be
64
// too slow). Just return false if you want default feedback.
65
virtual bool GiveFeedback(wxDragResult effect);
71
wxIDropSource *m_pIDropSource; // the pointer to COM interface
73
wxDECLARE_NO_COPY_CLASS(wxDropSource);
76
#endif //wxUSE_DRAG_AND_DROP
78
#endif //_WX_OLEDROPSRC_H