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