]>
Commit | Line | Data |
---|---|---|
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 | |
18 | ||
19 | #if !USE_DRAG_AND_DROP | |
20 | #error "You should #define USE_DRAG_AND_DROP to 1 to compile this file!" | |
21 | #endif //WX_DRAG_DROP | |
22 | ||
23 | // ---------------------------------------------------------------------------- | |
24 | // forward declarations | |
25 | // ---------------------------------------------------------------------------- | |
26 | class wxIDropSource; | |
27 | class wxDataObject; | |
28 | ||
29 | // ---------------------------------------------------------------------------- | |
30 | // wxDropSource is used to start the drag-&-drop operation on associated | |
31 | // wxDataObject object. It's responsible for giving UI feedback while dragging. | |
32 | // ---------------------------------------------------------------------------- | |
33 | class wxDropSource | |
34 | { | |
35 | public: | |
36 | enum DragResult | |
37 | { | |
38 | Error, // error prevented the d&d operation from completing | |
39 | None, // drag target didn't accept the data | |
40 | Copy, // the data was successfully copied | |
41 | Move, // the data was successfully moved | |
42 | Cancel // the operation was cancelled by user (not an error) | |
43 | }; | |
44 | ||
45 | // ctors: if you use default ctor you must call SetData() later! | |
46 | wxDropSource(); | |
47 | wxDropSource(wxDataObject& data); | |
48 | ||
49 | void SetData(wxDataObject& data); | |
50 | ||
51 | virtual ~wxDropSource(); | |
52 | ||
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 | |
bb6290e3 | 55 | DragResult DoDragDrop(bool bAllowMove = FALSE); |
1737035f VZ |
56 | |
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 too | |
59 | // slow). Just return false if you want default feedback. | |
60 | virtual bool GiveFeedback(DragResult effect, bool bScrolling); | |
61 | ||
62 | protected: | |
63 | void Init(); | |
64 | ||
65 | wxDataObject *m_pData; // pointer to associated data object | |
66 | ||
67 | private: | |
68 | wxIDropSource *m_pIDropSource; // the pointer to COM interface | |
69 | }; | |
70 | ||
bbcdf8bc | 71 | #endif //_WX_OLEDROPSRC_H |