Manages the dispatching of drag-and-drop targets between DUI windows. More...
#include <SDropTargetDispatcher.h>
Public Member Functions | |
| SDropTargetDispatcher () | |
| Constructor. | |
| ~SDropTargetDispatcher (void) | |
| Destructor. | |
| void | SetOwner (SWindow *pOwner) |
| Sets the owner window. | |
| BOOL | RegisterDragDrop (SWND swnd, IDropTarget *pDropTarget) |
| Registers a drag-and-drop target for a window. | |
| BOOL | UnregisterDragDrop (SWND swnd) |
| Unregisters a drag-and-drop target for a window. | |
| HRESULT | QueryInterface (REFIID riid, void **ppvObject) |
| Queries for a specific interface. | |
| ULONG | AddRef (void) |
| Increments the reference count. | |
| ULONG | Release (void) |
| Decrements the reference count. | |
| HRESULT | DragEnter (IDataObject *pDataObj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect) |
| Handles the DragEnter event. | |
| HRESULT | DragOver (DWORD grfKeyState, POINTL pt, DWORD *pdwEffect) |
| Handles the DragOver event. | |
| HRESULT | DragLeave (void) |
| Handles the DragLeave event. | |
| HRESULT | Drop (IDataObject *pDataObj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect) |
| Handles the Drop event. | |
Protected Types | |
| typedef SMap< SWND, IDropTarget * > | DTMAP |
Protected Member Functions | |
| POINT | PointL2FrameClient (const POINTL &pt) |
| Converts POINTL to frame client coordinates. | |
Protected Attributes | |
| DTMAP | m_mapDropTarget |
| IDataObject * | m_pDataObj |
| SWND | m_hHover |
| SWindow * | m_pOwner |
Manages the dispatching of drag-and-drop targets between DUI windows.
This class handles the registration and dispatching of drag-and-drop targets for DUI windows. It implements the IDropTarget interface to manage drag-and-drop operations and routes them to the appropriate window.
Definition at line 31 of file SDropTargetDispatcher.h.
|
protected |
Map type for storing drop targets.
Definition at line 182 of file SDropTargetDispatcher.h.
| SNSBEGIN SDropTargetDispatcher::SDropTargetDispatcher | ( | ) |
Constructor.
Initializes the drop target dispatcher.
Definition at line 6 of file SDropTargetDispatcher.cpp.
| SDropTargetDispatcher::~SDropTargetDispatcher | ( | void | ) |
Destructor.
Cleans up the drop target dispatcher.
Definition at line 18 of file SDropTargetDispatcher.cpp.
|
inline |
Increments the reference count.
Increments the reference count of the object. Always returns 1.
Definition at line 96 of file SDropTargetDispatcher.h.
| HRESULT SDropTargetDispatcher::DragEnter | ( | IDataObject * | pDataObj, |
| DWORD | grfKeyState, | ||
| POINTL | pt, | ||
| DWORD * | pdwEffect ) |
Handles the DragEnter event.
| pDataObj | Pointer to the data object |
| grfKeyState | State of the keyboard and mouse |
| pt | Mouse position |
| pdwEffect | Pointer to the drag effect |
Handles the DragEnter event and routes it to the appropriate window.
Definition at line 65 of file SDropTargetDispatcher.cpp.
| HRESULT STDMETHODCALLTYPE SDropTargetDispatcher::DragLeave | ( | void | ) |
Handles the DragLeave event.
Handles the DragLeave event and routes it to the appropriate window.
Definition at line 117 of file SDropTargetDispatcher.cpp.
| HRESULT SDropTargetDispatcher::DragOver | ( | DWORD | grfKeyState, |
| POINTL | pt, | ||
| DWORD * | pdwEffect ) |
Handles the DragOver event.
| grfKeyState | State of the keyboard and mouse |
| pt | Mouse position |
| pdwEffect | Pointer to the drag effect |
Handles the DragOver event and routes it to the appropriate window.
Definition at line 75 of file SDropTargetDispatcher.cpp.
| HRESULT STDMETHODCALLTYPE SDropTargetDispatcher::Drop | ( | IDataObject * | pDataObj, |
| DWORD | grfKeyState, | ||
| POINTL | pt, | ||
| DWORD * | pdwEffect ) |
Handles the Drop event.
| pDataObj | Pointer to the data object |
| grfKeyState | State of the keyboard and mouse |
| pt | Mouse position |
| pdwEffect | Pointer to the drag effect |
Handles the Drop event and routes it to the appropriate window.
Definition at line 127 of file SDropTargetDispatcher.cpp.
|
protected |
Converts POINTL to frame client coordinates.
| pt | POINTL structure |
Converts the POINTL structure to frame client coordinates.
Definition at line 144 of file SDropTargetDispatcher.cpp.
| HRESULT SDropTargetDispatcher::QueryInterface | ( | REFIID | riid, |
| void ** | ppvObject ) |
Queries for a specific interface.
| riid | Interface identifier |
| ppvObject | Pointer to the interface pointer |
Queries for the specified interface and returns a pointer to it.
Definition at line 54 of file SDropTargetDispatcher.cpp.
| BOOL SDropTargetDispatcher::RegisterDragDrop | ( | SWND | swnd, |
| IDropTarget * | pDropTarget ) |
Registers a drag-and-drop target for a window.
| swnd | Handle to the window |
| pDropTarget | Pointer to the drop target |
Registers a drag-and-drop target for the specified window.
Definition at line 29 of file SDropTargetDispatcher.cpp.
|
inline |
Decrements the reference count.
Decrements the reference count of the object. Always returns 1.
Definition at line 107 of file SDropTargetDispatcher.h.
| void SDropTargetDispatcher::SetOwner | ( | SWindow * | pOwner | ) |
Sets the owner window.
| pOwner | Pointer to the owner window |
Sets the owner window for the drop target dispatcher.
Definition at line 13 of file SDropTargetDispatcher.cpp.
| BOOL SDropTargetDispatcher::UnregisterDragDrop | ( | SWND | swnd | ) |
Unregisters a drag-and-drop target for a window.
| swnd | Handle to the window |
Unregisters the drag-and-drop target for the specified window.
Definition at line 38 of file SDropTargetDispatcher.cpp.
|
protected |
Handle to the window currently being hovered over.
Definition at line 185 of file SDropTargetDispatcher.h.
|
protected |
Map of drop targets associated with windows.
Definition at line 183 of file SDropTargetDispatcher.h.
|
protected |
Pointer to the data object.
Definition at line 184 of file SDropTargetDispatcher.h.
|
protected |
Pointer to the owner window.
Definition at line 186 of file SDropTargetDispatcher.h.