widget/windows/nsDragService.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 #ifndef nsDragService_h__
     7 #define nsDragService_h__
     9 #include "nsBaseDragService.h"
    10 #include <windows.h>
    11 #include <shlobj.h>
    13 struct IDropSource;
    14 struct IDataObject;
    15 class  nsNativeDragTarget;
    16 class  nsDataObjCollection;
    17 class  nsString;
    19 /**
    20  * Native Win32 DragService wrapper
    21  */
    23 class nsDragService : public nsBaseDragService
    24 {
    25 public:
    26   nsDragService();
    27   virtual ~nsDragService();
    29   // nsIDragService
    30   NS_IMETHOD InvokeDragSession(nsIDOMNode *aDOMNode,
    31                                nsISupportsArray *anArrayTransferables,
    32                                nsIScriptableRegion *aRegion,
    33                                uint32_t aActionType);
    35   // nsIDragSession
    36   NS_IMETHOD GetData(nsITransferable * aTransferable, uint32_t anItem);
    37   NS_IMETHOD GetNumDropItems(uint32_t * aNumItems);
    38   NS_IMETHOD IsDataFlavorSupported(const char *aDataFlavor, bool *_retval);
    39   NS_IMETHOD EndDragSession(bool aDoneDrag);
    41   // native impl.
    42   NS_IMETHOD SetIDataObject(IDataObject * aDataObj);
    43   NS_IMETHOD StartInvokingDragSession(IDataObject * aDataObj,
    44                                       uint32_t aActionType);
    46   // A drop occurred within the application vs. outside of it.
    47   void SetDroppedLocal();
    49 protected:
    50   nsDataObjCollection* GetDataObjCollection(IDataObject * aDataObj);
    52   // determine if we have a single data object or one of our private
    53   // collections
    54   bool IsCollectionObject(IDataObject* inDataObj);
    56   // Create a bitmap for drag operations
    57   bool CreateDragImage(nsIDOMNode *aDOMNode,
    58                          nsIScriptableRegion *aRegion,
    59                          SHDRAGIMAGE *psdi);
    61   IDataObject * mDataObject;
    62   bool mSentLocalDropEvent;
    63 };
    65 #endif // nsDragService_h__

mercurial