]> git.saurik.com Git - wxWidgets.git/blame - include/wx/msw/ole/dropsrc.h
Avoid CRT deprecation warnings for MSVC build using makefiles too.
[wxWidgets.git] / include / wx / msw / ole / dropsrc.h
CommitLineData
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
VZ
6// Created: 06.03.98
7// RCS-ID: $Id$
8// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
65571936 9// Licence: wxWindows licence
1737035f
VZ
10///////////////////////////////////////////////////////////////////////////////
11
bbcdf8bc
JS
12#ifndef _WX_OLEDROPSRC_H
13#define _WX_OLEDROPSRC_H
1737035f 14
0a0e6a5b 15#if wxUSE_DRAG_AND_DROP
1737035f
VZ
16
17// ----------------------------------------------------------------------------
18// forward declarations
19// ----------------------------------------------------------------------------
8e193f38 20
1737035f 21class wxIDropSource;
b5dbe15d
VS
22class WXDLLIMPEXP_FWD_CORE wxDataObject;
23class WXDLLIMPEXP_FWD_CORE wxWindow;
8e193f38 24
f6bcfd97
BP
25// ----------------------------------------------------------------------------
26// macros
27// ----------------------------------------------------------------------------
28
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.
9a83f860 33#define wxDROP_ICON(name) wxCursor(wxT(#name))
f6bcfd97 34
1737035f
VZ
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// ----------------------------------------------------------------------------
8e193f38 39
53a2db12 40class WXDLLIMPEXP_CORE wxDropSource : public wxDropSourceBase
1737035f
VZ
41{
42public:
e1ee679c
VZ
43 // ctors: if you use default ctor you must call SetData() later!
44 //
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,
2d93e133
VZ
48 const wxCursor &cursorCopy = wxNullCursor,
49 const wxCursor &cursorMove = wxNullCursor,
50 const wxCursor &cursorStop = wxNullCursor);
e1ee679c 51 wxDropSource(wxDataObject& data,
2d93e133
VZ
52 wxWindow *win = NULL,
53 const wxCursor &cursorCopy = wxNullCursor,
54 const wxCursor &cursorMove = wxNullCursor,
55 const wxCursor &cursorStop = wxNullCursor);
e1ee679c
VZ
56
57 virtual ~wxDropSource();
58
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
2245b2b2 61 virtual wxDragResult DoDragDrop(int flags = wxDrag_CopyOnly);
e1ee679c
VZ
62
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.
2d93e133 66 virtual bool GiveFeedback(wxDragResult effect);
1737035f
VZ
67
68protected:
e1ee679c 69 void Init();
1737035f
VZ
70
71private:
e1ee679c 72 wxIDropSource *m_pIDropSource; // the pointer to COM interface
22f3361e 73
c0c133e1 74 wxDECLARE_NO_COPY_CLASS(wxDropSource);
1737035f
VZ
75};
76
0a0e6a5b
WS
77#endif //wxUSE_DRAG_AND_DROP
78
46ccb510 79#endif //_WX_OLEDROPSRC_H