2001-09-28 20:14:13 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 11:12:37 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
1999-03-23 15:37:34 +00:00
|
|
|
|
|
|
|
#ifndef nsDragService_h__
|
|
|
|
#define nsDragService_h__
|
|
|
|
|
1999-04-17 13:49:39 +00:00
|
|
|
#include "nsBaseDragService.h"
|
2006-02-20 20:48:35 +00:00
|
|
|
#include <windows.h>
|
|
|
|
#include <shlobj.h>
|
1999-03-23 15:37:34 +00:00
|
|
|
|
1999-04-17 13:49:39 +00:00
|
|
|
struct IDropSource;
|
|
|
|
struct IDataObject;
|
|
|
|
class nsNativeDragTarget;
|
2002-06-14 11:28:13 +00:00
|
|
|
class nsDataObjCollection;
|
2006-02-20 20:48:35 +00:00
|
|
|
class nsString;
|
|
|
|
|
1999-03-23 15:37:34 +00:00
|
|
|
/**
|
|
|
|
* Native Win32 DragService wrapper
|
|
|
|
*/
|
|
|
|
|
1999-04-17 13:49:39 +00:00
|
|
|
class nsDragService : public nsBaseDragService
|
1999-03-23 15:37:34 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
nsDragService();
|
|
|
|
virtual ~nsDragService();
|
|
|
|
|
1999-04-23 14:35:26 +00:00
|
|
|
// nsIDragService
|
2005-03-15 00:26:15 +00:00
|
|
|
NS_IMETHOD InvokeDragSession(nsIDOMNode *aDOMNode,
|
|
|
|
nsISupportsArray *anArrayTransferables,
|
|
|
|
nsIScriptableRegion *aRegion,
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t aActionType);
|
1999-05-07 19:55:00 +00:00
|
|
|
|
|
|
|
// nsIDragSession
|
2012-08-22 15:56:38 +00:00
|
|
|
NS_IMETHOD GetData(nsITransferable * aTransferable, uint32_t anItem);
|
|
|
|
NS_IMETHOD GetNumDropItems(uint32_t * aNumItems);
|
2011-09-29 06:19:26 +00:00
|
|
|
NS_IMETHOD IsDataFlavorSupported(const char *aDataFlavor, bool *_retval);
|
|
|
|
NS_IMETHOD EndDragSession(bool aDoneDrag);
|
1999-03-23 15:37:34 +00:00
|
|
|
|
1999-04-23 14:35:26 +00:00
|
|
|
// native impl.
|
2005-03-15 00:26:15 +00:00
|
|
|
NS_IMETHOD SetIDataObject(IDataObject * aDataObj);
|
|
|
|
NS_IMETHOD StartInvokingDragSession(IDataObject * aDataObj,
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t aActionType);
|
1999-03-23 15:37:34 +00:00
|
|
|
|
2010-05-13 12:19:50 +00:00
|
|
|
// A drop occurred within the application vs. outside of it.
|
2008-09-28 20:57:33 +00:00
|
|
|
void SetDroppedLocal();
|
|
|
|
|
1999-03-23 15:37:34 +00:00
|
|
|
protected:
|
2005-03-15 00:26:15 +00:00
|
|
|
nsDataObjCollection* GetDataObjCollection(IDataObject * aDataObj);
|
2000-06-05 00:34:11 +00:00
|
|
|
|
2005-03-15 00:26:15 +00:00
|
|
|
// determine if we have a single data object or one of our private
|
|
|
|
// collections
|
2011-09-29 06:19:26 +00:00
|
|
|
bool IsCollectionObject(IDataObject* inDataObj);
|
2000-06-05 00:34:11 +00:00
|
|
|
|
2007-11-17 04:31:32 +00:00
|
|
|
// Create a bitmap for drag operations
|
2011-09-29 06:19:26 +00:00
|
|
|
bool CreateDragImage(nsIDOMNode *aDOMNode,
|
2007-11-17 04:31:32 +00:00
|
|
|
nsIScriptableRegion *aRegion,
|
|
|
|
SHDRAGIMAGE *psdi);
|
|
|
|
|
2005-03-15 00:26:15 +00:00
|
|
|
IDataObject * mDataObject;
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mSentLocalDropEvent;
|
1999-03-23 15:37:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // nsDragService_h__
|