Detailed Description
The base class from which specialized drag-and-drop handlers
should be derived.
#include <idraganddrop.h>
List of all
members.
Public Member Functions
|
|
DragAndDropHandler () |
|
constructor
|
virtual
CoreExport HRESULT |
DragEnter (HWND window, IDataObject *pDataObject, DWORD
grfKeyState, POINTL pt, DWORD *pdwEffect) |
|
Gets low level control over drag and drop
operations.
|
virtual
CoreExport HRESULT |
Drop (HWND window, IDataObject *pDataObject, DWORD grfKeyState,
POINTL pt, DWORD *pdwEffect) |
virtual
CoreExport HRESULT |
DragOver (HWND window, DWORD grfKeyState, POINTL pt, DWORD
*pdwEffect) |
virtual
CoreExport HRESULT |
DragLeave (HWND window) |
virtual
HRESULT |
DragEnter (HWND window, DropType *type, DWORD grfKeyState, POINT
&pt, DWORD *pdwEffect) |
virtual
HRESULT |
Drop (HWND window, DropType *type, DWORD grfKeyState, POINT
&pt, DWORD *pdwEffect) |
virtual
HRESULT |
DragOver (HWND window, DWORD grfKeyState, POINT &pt, DWORD
*pdwEffect) |
virtual
void |
Acquire () |
virtual
void |
Release () |
|
This method is called called during a when
the drag and drop manager stops managing drag and drop events for a
particular window for this handler.
|
Protected Attributes
|
DropType * |
current_droptype |
|
Cache for the currently parsed DropType.
|
Static Protected
Attributes
|
static
CoreExport IDragAndDropMgr * |
dndMgr |
|
Cached pointer to drag and drop manager.
|
Constructor & Destructor Documentation
Member Function Documentation
virtual CoreExport HRESULT DragEnter |
( |
HWND |
window, |
|
|
IDataObject * |
pDataObject, |
|
|
DWORD |
grfKeyState, |
|
|
POINTL |
pt, |
|
|
DWORD * |
pdwEffect |
|
) |
|
[virtual] |
Gets low level control over drag and drop operations.
Override this method in your
DragAndDropHandler subclass to get low-level control over drag
and drop operations. This is just a redirect of the identical
method called on the OLE IDropTarget interface, see MSDN docs for
details.
The default implementation for this methods use the DropClipFormat and
DropType classes to
recognize and parse the incoming IDataObject into a DropType instance and hand this to
the associated high-level drag and drop handler methods desribed
next.
As an example, here is the default DragEnter()
implementation which does the initial parsing on entry to a
window:
- Parameters:
-
window |
- The specified handle to the window in which the drag and drop
event is occuring. This is one of the windows that was enabled via
a IDragAndDropMgr::EnabledDnD() call, so it may be the parent of
the lowest-level window that the mouse is actually over. |
pDataObject |
- The incoming IDataObject. |
grfKeyState |
- The specified current state of the keyboard modifier keys on
the keyboard. Valid values can be a combination of any of the flags
MK_CONTROL, MK_SHIFT, MK_ALT, MK_BUTTON, MK_LBUTTON, MK_MBUTTON,
and MK_RBUTTON. |
pt |
- The specified current cursor coordinates in the coordinate
space of the drop-target window. |
pdwEffect |
- On entry, pointer to the value of the pdwEffect parameter of
the DoDragDrop function. On return, must contain one of the effect
flags from the Win32 DROPEFFECT enumeration, which indicates what
the result of the drop operation would be. |
- Returns:
- Standard return values of E_OUTOFMEMORY, E_INVALIDARG,
F_UNEXPECTED, and E_FAIL, S_OK.
virtual CoreExport HRESULT Drop |
( |
HWND |
window, |
|
|
IDataObject * |
pDataObject, |
|
|
DWORD |
grfKeyState, |
|
|
POINTL |
pt, |
|
|
DWORD * |
pdwEffect |
|
) |
|
[virtual] |
- Parameters:
- HWND window
The specified handle to the window in which the drag and drop event
is occuring. This is one of the windows that was enabled via a
IDragAndDropMgr::EnabledDnD() call, so it may be the parent
of the lowest-level window that the mouse is actually over.
IDataObject* pDataObject
The incoming IDataObject.
DWORD grfKeyState
The specified current state of the keyboard modifier keys on the
keyboard. Valid values can be a combination of any of the flags
MK_CONTROL, MK_SHIFT, MK_ALT, MK_BUTTON, MK_LBUTTON,
MK_MBUTTON, and MK_RBUTTON.
POINTL pt
The specified current cursor coordinates in the coordinate space of
the drop-target window.
DWORD* pdwEffect
On entry, pointer to the value of the pdwEffect parameter of
the DoDragDrop function. On return, must contain one of the
effect flags from the Win32 DROPEFFECT enumeration, which
indicates what the result of the drop operation would be.
- Returns:
- Standard return values of E_OUTOFMEMORY, E_INVALIDARG,
F_UNEXPECTED, and E_FAIL, S_OK.
virtual CoreExport HRESULT DragOver |
( |
HWND |
window, |
|
|
DWORD |
grfKeyState, |
|
|
POINTL |
pt, |
|
|
DWORD * |
pdwEffect |
|
) |
|
[virtual] |
- Parameters:
- HWND window
The specified handle to the window in which the drag and drop event
is occuring. This is one of the windows that was enabled via a
IDragAndDropMgr::EnabledDnD() call, so it may be the parent
of the lowest-level window that the mouse is actually over.
DWORD grfKeyState
The specified current state of the keyboard modifier keys on the
keyboard. Valid values can be a combination of any of the flags
MK_CONTROL, MK_SHIFT, MK_ALT, MK_BUTTON, MK_LBUTTON,
MK_MBUTTON, and MK_RBUTTON.
POINTL pt
The specified current cursor coordinates in the coordinate space of
the drop-target window.
DWORD* pdwEffect
On entry, pointer to the value of the pdwEffect parameter of
the DoDragDrop function. On return, must contain one of the
effect flags from the Win32 DROPEFFECT enumeration, which
indicates what the result of the drop operation would be.
- Returns:
- Standard return values of E_OUTOFMEMORY, E_INVALIDARG,
F_UNEXPECTED, and E_FAIL, S_OK.
virtual CoreExport HRESULT DragLeave |
( |
HWND |
window |
) |
[inline, virtual] |
- Parameters:
- HWND window
The specified handle to the window in which the drag and drop event
is occuring. This is one of the windows that was enabled via a
IDragAndDropMgr::EnabledDnD() call, so it may be the parent
of the lowest-level window that the mouse is actually over.
- Returns:
- Standard return values of E_OUTOFMEMORY, E_INVALIDARG,
F_UNEXPECTED, and E_FAIL, S_OK.
- Default Implementation:
- { return E_FAIL; }
virtual HRESULT DragEnter |
( |
HWND |
window, |
|
|
DropType * |
type, |
|
|
DWORD |
grfKeyState, |
|
|
POINT & |
pt, |
|
|
DWORD * |
pdwEffect |
|
) |
|
[inline, virtual] |
- Parameters:
- HWND window
The specified handle to the window in which the drag and drop event
is occuring. This is one of the windows that was enabled via a
IDragAndDropMgr::EnabledDnD() call, so it may be the parent
of the lowest-level window that the mouse is actually over.
DropType* type
The specified Pointer to the DropType instance that corresponds
to the data in the dropped IDataObject. You can use the
DropType::TypeCode()
method to determine the droptype (see the built-in codes in the
DropType
section). Each DropType subclass instance has
utility methods and public data members containing the parsed drop
data. See each subclass definition for details.
DWORD grfKeyState
The specified current state of the keyboard modifier keys on the
keyboard. Valid values can be a combination of any of the flags
MK_CONTROL, MK_SHIFT, MK_ALT, MK_BUTTON, MK_LBUTTON,
MK_MBUTTON, and MK_RBUTTON.
POINT& pt
The specified current cursor coordinates in the coordinate space of
the drop-target window.
DWORD* pdwEffect
On entry, pointer to the value of the pdwEffect parameter of
the DoDragDrop function. On return, must contain one of the
effect flags from the Win32 DROPEFFECT enumeration, which
indicates what the result of the drop operation would be.
- Returns:
- Standard return values of E_OUTOFMEMORY, E_INVALIDARG,
F_UNEXPECTED, and E_FAIL, S_OK.
- Default Implementation:
- { return E_FAIL; }
virtual HRESULT Drop |
( |
HWND |
window, |
|
|
DropType * |
type, |
|
|
DWORD |
grfKeyState, |
|
|
POINT & |
pt, |
|
|
DWORD * |
pdwEffect |
|
) |
|
[inline, virtual] |
- Parameters:
- HWND window
The specified handle to the window in which the drag and drop event
is occuring. This is one of the windows that was enabled via a
IDragAndDropMgr::EnabledDnD() call, so it may be the parent
of the lowest-level window that the mouse is actually over.
DropType* type
The specified Pointer to the DropType instance that corresponds
to the data in the dropped IDataObject. You can use the
DropType::TypeCode()
method to determine the droptype (see the built-in codes in the
DropType
section). Each DropType subclass instance has
utility methods and public data members containing the parsed drop
data. See each subclass definition for details.
DWORD grfKeyState
The specified current state of the keyboard modifier keys on the
keyboard. Valid values can be a combination of any of the flags
MK_CONTROL, MK_SHIFT, MK_ALT, MK_BUTTON, MK_LBUTTON,
MK_MBUTTON, and MK_RBUTTON.
POINT& pt
The specified current cursor coordinates in the coordinate space of
the drop-target window.
DWORD* pdwEffect
On entry, pointer to the value of the pdwEffect parameter of
the DoDragDrop function. On return, must contain one of the
effect flags from the Win32 DROPEFFECT enumeration, which
indicates what the result of the drop operation would be.
- Returns:
- Standard return values of E_OUTOFMEMORY, E_INVALIDARG,
F_UNEXPECTED, and E_FAIL, S_OK.
- Default Implementation:
- { return E_FAIL; }
virtual HRESULT DragOver |
( |
HWND |
window, |
|
|
DWORD |
grfKeyState, |
|
|
POINT & |
pt, |
|
|
DWORD * |
pdwEffect |
|
) |
|
[inline, virtual] |
- Parameters:
- HWND window
The specified handle to the window in which the drag and drop event
is occuring. This is one of the windows that was enabled via a
IDragAndDropMgr::EnabledDnD() call, so it may be the parent
of the lowest-level window that the mouse is actually over.
DWORD grfKeyState
The specified current state of the keyboard modifier keys on the
keyboard. Valid values can be a combination of any of the flags
MK_CONTROL, MK_SHIFT, MK_ALT, MK_BUTTON, MK_LBUTTON,
MK_MBUTTON, and MK_RBUTTON.
POINT& pt
The specified current cursor coordinates in the coordinate space of
the drop-target window.
DWORD* pdwEffect
On entry, pointer to the value of the pdwEffect parameter of
the DoDragDrop function. On return, must contain one of the
effect flags from the Win32 DROPEFFECT enumeration, which
indicates what the result of the drop operation would be.
- Returns:
- Standard return values of E_OUTOFMEMORY, E_INVALIDARG,
F_UNEXPECTED, and E_FAIL, S_OK.
- Default Implementation:
- { return E_FAIL; }
virtual void Acquire |
( |
|
) |
[inline, virtual] |
- Default Implementation:
- { }
virtual void Release |
( |
|
) |
[inline, virtual] |
This method is called called during a when the drag and drop
manager stops managing drag and drop events for a particular window
for this handler.
By default, the drag and drop manager will call this method on
all registered DragAndDropHandler's during a NOTIFY_SYSTEM_SHUTDOWN
broadcast. You should provide an implementation if you need to keep
track of extant uses of the handler (say, by ref-counting) or to do
handler-specific cleanup.
- Default Implementation:
- { }
Member Data Documentation
Cached pointer to drag and drop manager.
DragAndDropHandler DragAndDropHandler
DragAndDropHandler DragAndDropHandler DragAndDropHandler
DragAndDropHandler DragAndDropHandler DragAndDropHandler
DragAndDropHandler DragAndDropHandler
DragAndDropHandler DragAndDropHandler
DragAndDropHandler DragAndDropHandler DragAndDropHandler
DragAndDropHandler DragAndDropHandler DragAndDropHandler
DragAndDropHandler DragAndDropHandler