]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/ole/dropsrc.h
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
19 #if !wxUSE_DRAG_AND_DROP
20 #error "You should #define wxUSE_DRAG_AND_DROP to 1 to compile this file!"
23 // ----------------------------------------------------------------------------
24 // forward declarations
25 // ----------------------------------------------------------------------------
28 class WXDLLEXPORT wxDataObject
;
29 class WXDLLEXPORT wxWindow
;
31 // ----------------------------------------------------------------------------
32 // wxDropSource is used to start the drag-&-drop operation on associated
33 // wxDataObject object. It's responsible for giving UI feedback while dragging.
34 // ----------------------------------------------------------------------------
36 class WXDLLEXPORT wxDropSource
: public wxDropSourceBase
39 // ctors: if you use default ctor you must call SetData() later!
41 // NB: the "wxWindow *win" parameter is unused and is here only for wxGTK
42 // compatibility, as well as both icon parameters
43 wxDropSource(wxWindow
*win
= NULL
,
44 const wxIcon
&go
= wxNullIcon
,
45 const wxIcon
&stop
= wxNullIcon
);
46 wxDropSource(wxDataObject
& data
,
48 const wxIcon
&go
= wxNullIcon
,
49 const wxIcon
&stop
= wxNullIcon
);
51 virtual ~wxDropSource();
53 // do it (call this in response to a mouse button press, for example)
54 // params: if bAllowMove is false, data can be only copied
55 virtual wxDragResult
DoDragDrop(bool bAllowMove
= FALSE
);
57 // overridable: you may give some custom UI feedback during d&d operation
58 // in this function (it's called on each mouse move, so it shouldn't be
59 // too slow). Just return false if you want default feedback.
60 virtual bool GiveFeedback(wxDragResult effect
, bool bScrolling
);
66 wxIDropSource
*m_pIDropSource
; // the pointer to COM interface
69 #endif //_WX_OLEDROPSRC_H