widget/windows/nsDragService.h

branch
TOR_BUG_9701
changeset 10
ac0c01689b40
equal deleted inserted replaced
-1:000000000000 0:2d95b2e118f3
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
6 #ifndef nsDragService_h__
7 #define nsDragService_h__
8
9 #include "nsBaseDragService.h"
10 #include <windows.h>
11 #include <shlobj.h>
12
13 struct IDropSource;
14 struct IDataObject;
15 class nsNativeDragTarget;
16 class nsDataObjCollection;
17 class nsString;
18
19 /**
20 * Native Win32 DragService wrapper
21 */
22
23 class nsDragService : public nsBaseDragService
24 {
25 public:
26 nsDragService();
27 virtual ~nsDragService();
28
29 // nsIDragService
30 NS_IMETHOD InvokeDragSession(nsIDOMNode *aDOMNode,
31 nsISupportsArray *anArrayTransferables,
32 nsIScriptableRegion *aRegion,
33 uint32_t aActionType);
34
35 // nsIDragSession
36 NS_IMETHOD GetData(nsITransferable * aTransferable, uint32_t anItem);
37 NS_IMETHOD GetNumDropItems(uint32_t * aNumItems);
38 NS_IMETHOD IsDataFlavorSupported(const char *aDataFlavor, bool *_retval);
39 NS_IMETHOD EndDragSession(bool aDoneDrag);
40
41 // native impl.
42 NS_IMETHOD SetIDataObject(IDataObject * aDataObj);
43 NS_IMETHOD StartInvokingDragSession(IDataObject * aDataObj,
44 uint32_t aActionType);
45
46 // A drop occurred within the application vs. outside of it.
47 void SetDroppedLocal();
48
49 protected:
50 nsDataObjCollection* GetDataObjCollection(IDataObject * aDataObj);
51
52 // determine if we have a single data object or one of our private
53 // collections
54 bool IsCollectionObject(IDataObject* inDataObj);
55
56 // Create a bitmap for drag operations
57 bool CreateDragImage(nsIDOMNode *aDOMNode,
58 nsIScriptableRegion *aRegion,
59 SHDRAGIMAGE *psdi);
60
61 IDataObject * mDataObject;
62 bool mSentLocalDropEvent;
63 };
64
65 #endif // nsDragService_h__

mercurial