michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef nsDragService_h__ michael@0: #define nsDragService_h__ michael@0: michael@0: #include "nsBaseDragService.h" michael@0: #include michael@0: #include michael@0: michael@0: struct IDropSource; michael@0: struct IDataObject; michael@0: class nsNativeDragTarget; michael@0: class nsDataObjCollection; michael@0: class nsString; michael@0: michael@0: /** michael@0: * Native Win32 DragService wrapper michael@0: */ michael@0: michael@0: class nsDragService : public nsBaseDragService michael@0: { michael@0: public: michael@0: nsDragService(); michael@0: virtual ~nsDragService(); michael@0: michael@0: // nsIDragService michael@0: NS_IMETHOD InvokeDragSession(nsIDOMNode *aDOMNode, michael@0: nsISupportsArray *anArrayTransferables, michael@0: nsIScriptableRegion *aRegion, michael@0: uint32_t aActionType); michael@0: michael@0: // nsIDragSession michael@0: NS_IMETHOD GetData(nsITransferable * aTransferable, uint32_t anItem); michael@0: NS_IMETHOD GetNumDropItems(uint32_t * aNumItems); michael@0: NS_IMETHOD IsDataFlavorSupported(const char *aDataFlavor, bool *_retval); michael@0: NS_IMETHOD EndDragSession(bool aDoneDrag); michael@0: michael@0: // native impl. michael@0: NS_IMETHOD SetIDataObject(IDataObject * aDataObj); michael@0: NS_IMETHOD StartInvokingDragSession(IDataObject * aDataObj, michael@0: uint32_t aActionType); michael@0: michael@0: // A drop occurred within the application vs. outside of it. michael@0: void SetDroppedLocal(); michael@0: michael@0: protected: michael@0: nsDataObjCollection* GetDataObjCollection(IDataObject * aDataObj); michael@0: michael@0: // determine if we have a single data object or one of our private michael@0: // collections michael@0: bool IsCollectionObject(IDataObject* inDataObj); michael@0: michael@0: // Create a bitmap for drag operations michael@0: bool CreateDragImage(nsIDOMNode *aDOMNode, michael@0: nsIScriptableRegion *aRegion, michael@0: SHDRAGIMAGE *psdi); michael@0: michael@0: IDataObject * mDataObject; michael@0: bool mSentLocalDropEvent; michael@0: }; michael@0: michael@0: #endif // nsDragService_h__