]> git.saurik.com Git - wxWidgets.git/blame - include/wx/msw/ole/droptgt.h
Renamed HasChildren() to IsContainer(), added GetParent() to wxDataViewModel
[wxWidgets.git] / include / wx / msw / ole / droptgt.h
CommitLineData
bbf1f0e5
KB
1///////////////////////////////////////////////////////////////////////////////
2// Name: ole/droptgt.h
3// Purpose: declaration of the wxDropTarget class
4// Author: Vadim Zeitlin
e1ee679c 5// Modified by:
bbf1f0e5
KB
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
bbf1f0e5
KB
10///////////////////////////////////////////////////////////////////////////////
11
bbcdf8bc
JS
12#ifndef _WX_OLEDROPTGT_H
13#define _WX_OLEDROPTGT_H
bbf1f0e5 14
0a0e6a5b 15#if wxUSE_DRAG_AND_DROP
bbf1f0e5
KB
16
17// ----------------------------------------------------------------------------
18// forward declarations
19// ----------------------------------------------------------------------------
9e2896e5 20
bbf1f0e5
KB
21class wxIDropTarget;
22struct IDataObject;
23
bbf1f0e5
KB
24// ----------------------------------------------------------------------------
25// An instance of the class wxDropTarget may be associated with any wxWindow
26// derived object via SetDropTarget() function. If this is done, the virtual
27// methods of wxDropTarget are called when something is dropped on the window.
e1ee679c 28//
bbf1f0e5
KB
29// Note that wxDropTarget is an abstract base class (ABC) and you should derive
30// your own class from it implementing pure virtual function in order to use it
31// (all of them, including protected ones which are called by the class itself)
32// ----------------------------------------------------------------------------
9e2896e5
VZ
33
34class WXDLLEXPORT wxDropTarget : public wxDropTargetBase
bbf1f0e5
KB
35{
36public:
e1ee679c 37 // ctor & dtor
9e2896e5 38 wxDropTarget(wxDataObject *dataObject = NULL);
e1ee679c 39 virtual ~wxDropTarget();
bbf1f0e5 40
e1ee679c
VZ
41 // normally called by wxWindow on window creation/destruction, but might be
42 // called `manually' as well. Register() returns true on success.
43 bool Register(WXHWND hwnd);
44 void Revoke(WXHWND hwnd);
bbf1f0e5 45
9e2896e5
VZ
46 // provide default implementation for base class pure virtuals
47 virtual bool OnDrop(wxCoord x, wxCoord y);
48 virtual bool GetData();
49
50 // implementation only from now on
51 // -------------------------------
52
e1ee679c 53 // do we accept this kind of data?
9e2896e5
VZ
54 bool IsAcceptedData(IDataObject *pIDataSource) const;
55
56 // give us the data source from IDropTarget::Drop() - this is later used by
57 // GetData() when it's called from inside OnData()
58 void SetDataSource(IDataObject *pIDataSource);
bbf1f0e5
KB
59
60private:
9e2896e5
VZ
61 // helper used by IsAcceptedData() and GetData()
62 wxDataFormat GetSupportedFormat(IDataObject *pIDataSource) const;
63
64 wxIDropTarget *m_pIDropTarget; // the pointer to our COM interface
65 IDataObject *m_pIDataSource; // the pointer to the source data object
22f3361e
VZ
66
67 DECLARE_NO_COPY_CLASS(wxDropTarget)
bbf1f0e5
KB
68};
69
0a0e6a5b
WS
70#endif //wxUSE_DRAG_AND_DROP
71
bbcdf8bc 72#endif //_WX_OLEDROPTGT_H