2006-10-26 02:45:22 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 15:12:37 +04: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/. */
|
2006-10-26 02:45:22 +04:00
|
|
|
|
2007-01-18 09:34:07 +03:00
|
|
|
#ifndef nsDragService_h_
|
|
|
|
#define nsDragService_h_
|
2006-10-26 02:45:22 +04:00
|
|
|
|
|
|
|
#include "nsBaseDragService.h"
|
|
|
|
|
2007-03-20 15:14:52 +03:00
|
|
|
#include <Cocoa/Cocoa.h>
|
|
|
|
|
2007-05-29 09:06:12 +04:00
|
|
|
extern NSString* const kWildcardPboardType;
|
2007-09-25 02:41:10 +04:00
|
|
|
extern NSString* const kCorePboardType_url;
|
2007-09-28 05:50:09 +04:00
|
|
|
extern NSString* const kCorePboardType_urld;
|
2007-09-25 02:41:10 +04:00
|
|
|
extern NSString* const kCorePboardType_urln;
|
2016-04-21 21:11:14 +03:00
|
|
|
extern NSString* const kCustomTypesPboardType;
|
2007-05-29 09:06:12 +04:00
|
|
|
|
2006-10-26 02:45:22 +04:00
|
|
|
class nsDragService : public nsBaseDragService
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
nsDragService();
|
|
|
|
|
2015-10-21 12:16:40 +03:00
|
|
|
// nsBaseDragService
|
2016-10-18 21:56:20 +03:00
|
|
|
virtual nsresult InvokeDragSessionImpl(nsIArray* anArrayTransferables,
|
2015-10-21 12:16:40 +03:00
|
|
|
nsIScriptableRegion* aRegion,
|
|
|
|
uint32_t aActionType);
|
2006-10-26 02:45:22 +04:00
|
|
|
// nsIDragService
|
2011-09-29 10:19:26 +04:00
|
|
|
NS_IMETHOD EndDragSession(bool aDoneDrag);
|
2006-10-26 02:45:22 +04:00
|
|
|
|
|
|
|
// nsIDragSession
|
2012-08-22 19:56:38 +04:00
|
|
|
NS_IMETHOD GetData(nsITransferable * aTransferable, uint32_t aItemIndex);
|
2011-09-29 10:19:26 +04:00
|
|
|
NS_IMETHOD IsDataFlavorSupported(const char *aDataFlavor, bool *_retval);
|
2012-08-22 19:56:38 +04:00
|
|
|
NS_IMETHOD GetNumDropItems(uint32_t * aNumItems);
|
2006-10-26 02:45:22 +04:00
|
|
|
|
2014-07-09 01:23:18 +04:00
|
|
|
protected:
|
|
|
|
virtual ~nsDragService();
|
|
|
|
|
2006-10-26 02:45:22 +04:00
|
|
|
private:
|
|
|
|
|
2007-03-20 15:14:52 +03:00
|
|
|
NSImage* ConstructDragImage(nsIDOMNode* aDOMNode,
|
2016-10-19 22:01:39 +03:00
|
|
|
mozilla::LayoutDeviceIntRect* aDragRect,
|
2007-03-20 15:14:52 +03:00
|
|
|
nsIScriptableRegion* aRegion);
|
2015-08-15 00:33:59 +03:00
|
|
|
bool IsValidType(NSString* availableType, bool allowFileURL);
|
|
|
|
NSString* GetStringForType(NSPasteboardItem* item, const NSString* type,
|
|
|
|
bool allowFileURL = false);
|
|
|
|
NSString* GetTitleForURL(NSPasteboardItem* item);
|
|
|
|
NSString* GetFilePath(NSPasteboardItem* item);
|
2007-06-28 23:20:12 +04:00
|
|
|
|
2016-10-18 21:56:20 +03:00
|
|
|
nsCOMPtr<nsIArray> mDataItems; // only valid for a drag started within gecko
|
2007-09-24 04:01:04 +04:00
|
|
|
NSView* mNativeDragView;
|
|
|
|
NSEvent* mNativeDragEvent;
|
2006-10-26 02:45:22 +04:00
|
|
|
};
|
|
|
|
|
2007-01-18 09:34:07 +03:00
|
|
|
#endif // nsDragService_h_
|