]> git.saurik.com Git - wxWidgets.git/blame - include/wx/osx/dnd.h
MinGW-w64 provides isfinite() in both 32 and 64 bit builds.
[wxWidgets.git] / include / wx / osx / dnd.h
CommitLineData
6762286d 1///////////////////////////////////////////////////////////////////////////////
233f5738 2// Name: wx/osx/dnd.h
6762286d
SC
3// Purpose: Declaration of the wxDropTarget, wxDropSource class etc.
4// Author: Stefan Csomor
6762286d
SC
5// Copyright: (c) 1998 Stefan Csomor
6// Licence: wxWindows licence
7///////////////////////////////////////////////////////////////////////////////
8
9#ifndef _WX_DND_H_
10#define _WX_DND_H_
11
12#if wxUSE_DRAG_AND_DROP
13
14#include "wx/defs.h"
15#include "wx/object.h"
16#include "wx/string.h"
17#include "wx/string.h"
18#include "wx/dataobj.h"
19#include "wx/cursor.h"
20
21//-------------------------------------------------------------------------
22// classes
23//-------------------------------------------------------------------------
24
25class WXDLLIMPEXP_FWD_CORE wxWindow;
26
27class WXDLLIMPEXP_FWD_CORE wxDropTarget;
28class WXDLLIMPEXP_FWD_CORE wxTextDropTarget;
29class WXDLLIMPEXP_FWD_CORE wxFileDropTarget;
30
31class WXDLLIMPEXP_FWD_CORE wxDropSource;
32
33// ----------------------------------------------------------------------------
34// macros
35// ----------------------------------------------------------------------------
36
37// this macro may be used instead for wxDropSource ctor arguments: it will use
38// the icon 'name' from an XPM file under GTK, but will expand to something
39// else under MSW. If you don't use it, you will have to use #ifdef in the
40// application code.
41#define wxDROP_ICON(X) wxCursor(X##_xpm)
42
43//-------------------------------------------------------------------------
44// wxDropTarget
45//-------------------------------------------------------------------------
46
47class WXDLLIMPEXP_CORE wxDropTarget: public wxDropTargetBase
48{
49 public:
50
d3b9f782 51 wxDropTarget(wxDataObject *dataObject = NULL );
6762286d
SC
52
53 virtual wxDragResult OnDragOver(wxCoord x, wxCoord y, wxDragResult def);
54 virtual bool OnDrop(wxCoord x, wxCoord y);
55 virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult def);
56 virtual bool GetData();
03647350 57 // NOTE: This is needed by the generic wxDataViewCtrl, not sure how to implement.
ada08326 58 virtual wxDataFormat GetMatchingPair();
6762286d
SC
59
60 bool CurrentDragHasSupportedFormat() ;
4dd9fdf8 61 void SetCurrentDragPasteboard( void* dragpasteboard ) { m_currentDragPasteboard = dragpasteboard ; }
6762286d 62 protected :
4dd9fdf8 63 void* m_currentDragPasteboard ;
6762286d
SC
64};
65
66//-------------------------------------------------------------------------
67// wxDropSource
68//-------------------------------------------------------------------------
69
70class WXDLLIMPEXP_CORE wxDropSource: public wxDropSourceBase
71{
72public:
73 // ctors: if you use default ctor you must call SetData() later!
74 //
75 // NB: the "wxWindow *win" parameter is unused and is here only for wxGTK
76 // compatibility, as well as both icon parameters
d3b9f782 77 wxDropSource( wxWindow *win = NULL,
6762286d
SC
78 const wxCursor &cursorCopy = wxNullCursor,
79 const wxCursor &cursorMove = wxNullCursor,
80 const wxCursor &cursorStop = wxNullCursor);
81
82 /* constructor for setting one data object */
83 wxDropSource( wxDataObject& data,
84 wxWindow *win,
85 const wxCursor &cursorCopy = wxNullCursor,
86 const wxCursor &cursorMove = wxNullCursor,
87 const wxCursor &cursorStop = wxNullCursor);
88
89 virtual ~wxDropSource();
90
91 // do it (call this in response to a mouse button press, for example)
92 // params: if bAllowMove is false, data can be only copied
93 virtual wxDragResult DoDragDrop(int flags = wxDrag_CopyOnly);
94
95 wxWindow* GetWindow() { return m_window ; }
4dd9fdf8 96 void SetCurrentDragPasteboard( void* dragpasteboard ) { m_currentDragPasteboard = dragpasteboard ; }
6762286d 97 bool MacInstallDefaultCursor(wxDragResult effect) ;
808cbd17 98 static wxDropSource* GetCurrentDropSource();
6762286d
SC
99 protected :
100
101 wxWindow *m_window;
4dd9fdf8 102 void* m_currentDragPasteboard ;
6762286d
SC
103};
104
105#endif // wxUSE_DRAG_AND_DROP
106
5c6eb3a8 107#endif
6762286d 108 //_WX_DND_H_