widget/cocoa/nsDragService.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/widget/cocoa/nsDragService.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,45 @@
     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 +
    1.14 +#include <Cocoa/Cocoa.h>
    1.15 +
    1.16 +extern NSString* const kWildcardPboardType;
    1.17 +extern NSString* const kCorePboardType_url;
    1.18 +extern NSString* const kCorePboardType_urld;
    1.19 +extern NSString* const kCorePboardType_urln;
    1.20 +
    1.21 +class nsDragService : public nsBaseDragService
    1.22 +{
    1.23 +public:
    1.24 +  nsDragService();
    1.25 +  virtual ~nsDragService();
    1.26 +
    1.27 +  // nsIDragService
    1.28 +  NS_IMETHOD InvokeDragSession(nsIDOMNode *aDOMNode, nsISupportsArray * anArrayTransferables,
    1.29 +                               nsIScriptableRegion * aRegion, uint32_t aActionType);
    1.30 +  NS_IMETHOD EndDragSession(bool aDoneDrag);
    1.31 +
    1.32 +  // nsIDragSession
    1.33 +  NS_IMETHOD GetData(nsITransferable * aTransferable, uint32_t aItemIndex);
    1.34 +  NS_IMETHOD IsDataFlavorSupported(const char *aDataFlavor, bool *_retval);
    1.35 +  NS_IMETHOD GetNumDropItems(uint32_t * aNumItems);
    1.36 +
    1.37 +private:
    1.38 +
    1.39 +  NSImage* ConstructDragImage(nsIDOMNode* aDOMNode,
    1.40 +                              nsIntRect* aDragRect,
    1.41 +                              nsIScriptableRegion* aRegion);
    1.42 +
    1.43 +  nsCOMPtr<nsISupportsArray> mDataItems; // only valid for a drag started within gecko
    1.44 +  NSView* mNativeDragView;
    1.45 +  NSEvent* mNativeDragEvent;
    1.46 +};
    1.47 +
    1.48 +#endif // nsDragService_h_

mercurial