]>
Commit | Line | Data |
---|---|---|
1737035f | 1 | /////////////////////////////////////////////////////////////////////////////// |
80fdcdb9 | 2 | // Name: wx/msw/ole/dropsrc.h |
1737035f VZ |
3 | // Purpose: declaration of the wxDropSource class |
4 | // Author: Vadim Zeitlin | |
e1ee679c | 5 | // Modified by: |
1737035f | 6 | // Created: 06.03.98 |
1737035f | 7 | // Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr> |
65571936 | 8 | // Licence: wxWindows licence |
1737035f VZ |
9 | /////////////////////////////////////////////////////////////////////////////// |
10 | ||
bbcdf8bc JS |
11 | #ifndef _WX_OLEDROPSRC_H |
12 | #define _WX_OLEDROPSRC_H | |
1737035f | 13 | |
0a0e6a5b | 14 | #if wxUSE_DRAG_AND_DROP |
1737035f VZ |
15 | |
16 | // ---------------------------------------------------------------------------- | |
17 | // forward declarations | |
18 | // ---------------------------------------------------------------------------- | |
8e193f38 | 19 | |
1737035f | 20 | class wxIDropSource; |
b5dbe15d VS |
21 | class WXDLLIMPEXP_FWD_CORE wxDataObject; |
22 | class WXDLLIMPEXP_FWD_CORE wxWindow; | |
8e193f38 | 23 | |
f6bcfd97 BP |
24 | // ---------------------------------------------------------------------------- |
25 | // macros | |
26 | // ---------------------------------------------------------------------------- | |
27 | ||
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. | |
9a83f860 | 32 | #define wxDROP_ICON(name) wxCursor(wxT(#name)) |
f6bcfd97 | 33 | |
1737035f VZ |
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 | // ---------------------------------------------------------------------------- | |
8e193f38 | 38 | |
53a2db12 | 39 | class WXDLLIMPEXP_CORE wxDropSource : public wxDropSourceBase |
1737035f VZ |
40 | { |
41 | public: | |
e1ee679c VZ |
42 | // ctors: if you use default ctor you must call SetData() later! |
43 | // | |
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, | |
2d93e133 VZ |
47 | const wxCursor &cursorCopy = wxNullCursor, |
48 | const wxCursor &cursorMove = wxNullCursor, | |
49 | const wxCursor &cursorStop = wxNullCursor); | |
e1ee679c | 50 | wxDropSource(wxDataObject& data, |
2d93e133 VZ |
51 | wxWindow *win = NULL, |
52 | const wxCursor &cursorCopy = wxNullCursor, | |
53 | const wxCursor &cursorMove = wxNullCursor, | |
54 | const wxCursor &cursorStop = wxNullCursor); | |
e1ee679c VZ |
55 | |
56 | virtual ~wxDropSource(); | |
57 | ||
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 | |
2245b2b2 | 60 | virtual wxDragResult DoDragDrop(int flags = wxDrag_CopyOnly); |
e1ee679c VZ |
61 | |
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. | |
2d93e133 | 65 | virtual bool GiveFeedback(wxDragResult effect); |
1737035f VZ |
66 | |
67 | protected: | |
e1ee679c | 68 | void Init(); |
1737035f VZ |
69 | |
70 | private: | |
e1ee679c | 71 | wxIDropSource *m_pIDropSource; // the pointer to COM interface |
22f3361e | 72 | |
c0c133e1 | 73 | wxDECLARE_NO_COPY_CLASS(wxDropSource); |
1737035f VZ |
74 | }; |
75 | ||
0a0e6a5b WS |
76 | #endif //wxUSE_DRAG_AND_DROP |
77 | ||
46ccb510 | 78 | #endif //_WX_OLEDROPSRC_H |