1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/widget/windows/nsDragService.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,65 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#ifndef nsDragService_h__ 1.10 +#define nsDragService_h__ 1.11 + 1.12 +#include "nsBaseDragService.h" 1.13 +#include <windows.h> 1.14 +#include <shlobj.h> 1.15 + 1.16 +struct IDropSource; 1.17 +struct IDataObject; 1.18 +class nsNativeDragTarget; 1.19 +class nsDataObjCollection; 1.20 +class nsString; 1.21 + 1.22 +/** 1.23 + * Native Win32 DragService wrapper 1.24 + */ 1.25 + 1.26 +class nsDragService : public nsBaseDragService 1.27 +{ 1.28 +public: 1.29 + nsDragService(); 1.30 + virtual ~nsDragService(); 1.31 + 1.32 + // nsIDragService 1.33 + NS_IMETHOD InvokeDragSession(nsIDOMNode *aDOMNode, 1.34 + nsISupportsArray *anArrayTransferables, 1.35 + nsIScriptableRegion *aRegion, 1.36 + uint32_t aActionType); 1.37 + 1.38 + // nsIDragSession 1.39 + NS_IMETHOD GetData(nsITransferable * aTransferable, uint32_t anItem); 1.40 + NS_IMETHOD GetNumDropItems(uint32_t * aNumItems); 1.41 + NS_IMETHOD IsDataFlavorSupported(const char *aDataFlavor, bool *_retval); 1.42 + NS_IMETHOD EndDragSession(bool aDoneDrag); 1.43 + 1.44 + // native impl. 1.45 + NS_IMETHOD SetIDataObject(IDataObject * aDataObj); 1.46 + NS_IMETHOD StartInvokingDragSession(IDataObject * aDataObj, 1.47 + uint32_t aActionType); 1.48 + 1.49 + // A drop occurred within the application vs. outside of it. 1.50 + void SetDroppedLocal(); 1.51 + 1.52 +protected: 1.53 + nsDataObjCollection* GetDataObjCollection(IDataObject * aDataObj); 1.54 + 1.55 + // determine if we have a single data object or one of our private 1.56 + // collections 1.57 + bool IsCollectionObject(IDataObject* inDataObj); 1.58 + 1.59 + // Create a bitmap for drag operations 1.60 + bool CreateDragImage(nsIDOMNode *aDOMNode, 1.61 + nsIScriptableRegion *aRegion, 1.62 + SHDRAGIMAGE *psdi); 1.63 + 1.64 + IDataObject * mDataObject; 1.65 + bool mSentLocalDropEvent; 1.66 +}; 1.67 + 1.68 +#endif // nsDragService_h__