1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
/* ***** BEGIN LICENSE BLOCK *****
3
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
5
* The contents of this file are subject to the Netscape Public License
6
* Version 1.1 (the "License"); you may not use this file except in
7
* compliance with the License. You may obtain a copy of the License at
8
* http://www.mozilla.org/NPL/
10
* Software distributed under the License is distributed on an "AS IS" basis,
11
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12
* for the specific language governing rights and limitations under the
15
* The Original Code is Mozilla Communicator client code.
17
* The Initial Developer of the Original Code is
18
* Netscape Communications Corporation.
19
* Portions created by the Initial Developer are Copyright (C) 1998
20
* the Initial Developer. All Rights Reserved.
24
* Alternatively, the contents of this file may be used under the terms of
25
* either the GNU General Public License Version 2 or later (the "GPL"), or
26
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27
* in which case the provisions of the GPL or the LGPL are applicable instead
28
* of those above. If you wish to allow use of your version of this file only
29
* under the terms of either the GPL or the LGPL, and not to allow others to
30
* use your version of this file under the terms of the NPL, indicate your
31
* decision by deleting the provisions above and replace them with the notice
32
* and other provisions required by the GPL or the LGPL. If you do not delete
33
* the provisions above, a recipient may use your version of this file under
34
* the terms of any one of the NPL, the GPL or the LGPL.
36
* ***** END LICENSE BLOCK ***** */
37
#ifndef _nsNativeDragTarget_h_
38
#define _nsNativeDragTarget_h_
40
#include "nsGUIEvent.h"
42
#include "nsIDragSession.h"
51
* nsNativeDragTarget implements the IDropTarget interface and gets most of its
52
* behavior from the associated adapter (m_dragDrop).
55
class nsNativeDragTarget : public IDropTarget
57
public: // construction, destruction
59
nsNativeDragTarget(nsIWidget * aWnd);
60
~nsNativeDragTarget();
62
public: // IUnknown members - see iunknown.h for documentation
63
STDMETHODIMP QueryInterface(REFIID, void**);
64
STDMETHODIMP_(ULONG) AddRef ();
65
STDMETHODIMP_(ULONG) Release ();
67
public: // IDataTarget members
69
// Set pEffect based on whether this object can support a drop based on
70
// the data available from pSource, the key and mouse states specified
71
// in grfKeyState, and the coordinates specified by point. This is
72
// called by OLE when a drag enters this object's window (as registered
74
STDMETHODIMP DragEnter(LPDATAOBJECT pSource, DWORD grfKeyState,
75
POINTL point, DWORD* pEffect);
77
// Similar to DragEnter except it is called frequently while the drag
78
// is over this object's window.
79
STDMETHODIMP DragOver(DWORD grfKeyState, POINTL point, DWORD* pEffect);
81
// Release the drag-drop source and put internal state back to the point
82
// before the call to DragEnter. This is called when the drag leaves
83
// without a drop occurring.
84
STDMETHODIMP DragLeave();
86
// If point is within our region of interest and pSource's data supports
87
// one of our formats, get the data and set pEffect according to
88
// grfKeyState (DROPEFFECT_MOVE if the control key was not pressed,
89
// DROPEFFECT_COPY if the control key was pressed). Otherwise return
91
STDMETHODIMP Drop(LPDATAOBJECT pSource, DWORD grfKeyState,
92
POINTL point, DWORD* pEffect);
96
void GetGeckoDragAction ( LPDATAOBJECT pData, DWORD grfKeyState, LPDWORD pdwEffect, PRUint32 * aGeckoAction );
97
void ProcessDrag ( LPDATAOBJECT pData, PRUint32 aEventType, DWORD grfKeyState,
98
POINTL pt, DWORD* pdwEffect );
99
void DispatchDragDropEvent(PRUint32 aType, POINTL pt);
102
ULONG m_cRef; // reference count
108
nsIDragService * mDragService;
111
#endif // _nsNativeDragTarget_h_