]> git.saurik.com Git - wxWidgets.git/blame - include/wx/msw/ole/dropsrc.h
Restored wxSizeEvent code form last week -> wxGLCanvas
[wxWidgets.git] / include / wx / msw / ole / dropsrc.h
CommitLineData
1737035f
VZ
1///////////////////////////////////////////////////////////////////////////////
2// Name: ole/dropsrc.h
3// Purpose: declaration of the wxDropSource class
4// Author: Vadim Zeitlin
5// Modified by:
6// Created: 06.03.98
7// RCS-ID: $Id$
8// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
bbcdf8bc 9// Licence: wxWindows licence
1737035f
VZ
10///////////////////////////////////////////////////////////////////////////////
11
bbcdf8bc
JS
12#ifndef _WX_OLEDROPSRC_H
13#define _WX_OLEDROPSRC_H
1737035f
VZ
14
15#ifdef __GNUG__
16#pragma interface
17#endif
7dee726c 18#include "wx/window.h"
f97c9854 19#if !wxUSE_DRAG_AND_DROP
47d67540 20 #error "You should #define wxUSE_DRAG_AND_DROP to 1 to compile this file!"
1737035f
VZ
21#endif //WX_DRAG_DROP
22
23// ----------------------------------------------------------------------------
24// forward declarations
25// ----------------------------------------------------------------------------
26class wxIDropSource;
27class wxDataObject;
28
46ccb510
JS
29enum wxDragResult
30 {
31 wxDragError, // error prevented the d&d operation from completing
32 wxDragNone, // drag target didn't accept the data
33 wxDragCopy, // the data was successfully copied
34 wxDragMove, // the data was successfully moved
35 wxDragCancel // the operation was cancelled by user (not an error)
36 };
37
1737035f
VZ
38// ----------------------------------------------------------------------------
39// wxDropSource is used to start the drag-&-drop operation on associated
40// wxDataObject object. It's responsible for giving UI feedback while dragging.
41// ----------------------------------------------------------------------------
8853b9a8 42class WXDLLEXPORT wxDropSource
1737035f
VZ
43{
44public:
1737035f 45 // ctors: if you use default ctor you must call SetData() later!
4b13e6ae
VZ
46 // NB: the "wxWindow *win" parameter is unused and is here only for wxGTK
47 // compatibility
48 wxDropSource(wxWindow *win = NULL);
49 wxDropSource(wxDataObject& data, wxWindow *win = NULL);
1737035f
VZ
50
51 void SetData(wxDataObject& data);
52
53 virtual ~wxDropSource();
54
55 // do it (call this in response to a mouse button press, for example)
56 // params: if bAllowMove is false, data can be only copied
46ccb510 57 wxDragResult DoDragDrop(bool bAllowMove = FALSE);
1737035f
VZ
58
59 // overridable: you may give some custom UI feedback during d&d operation
60 // in this function (it's called on each mouse move, so it shouldn't be too
61 // slow). Just return false if you want default feedback.
46ccb510 62 virtual bool GiveFeedback(wxDragResult effect, bool bScrolling);
1737035f
VZ
63
64protected:
65 void Init();
66
67 wxDataObject *m_pData; // pointer to associated data object
68
69private:
70 wxIDropSource *m_pIDropSource; // the pointer to COM interface
71};
72
46ccb510 73#endif //_WX_OLEDROPSRC_H