diff --git a/CefSharp.Core/Internals/ClientAdapter.cpp b/CefSharp.Core/Internals/ClientAdapter.cpp index 8eef5c4aa..2d29fe237 100644 --- a/CefSharp.Core/Internals/ClientAdapter.cpp +++ b/CefSharp.Core/Internals/ClientAdapter.cpp @@ -484,7 +484,7 @@ namespace CefSharp bool handled; - handled = handler->OnDragEnter(_browserControl); + handled = handler->OnDragEnter(_browserControl, (CefRefPtr)dragData); return handled; } diff --git a/CefSharp/CefSharp.csproj b/CefSharp/CefSharp.csproj index 960115b91..d4edbac51 100644 --- a/CefSharp/CefSharp.csproj +++ b/CefSharp/CefSharp.csproj @@ -89,6 +89,7 @@ + diff --git a/CefSharp/DragData.cs b/CefSharp/DragData.cs new file mode 100644 index 000000000..d57f3134b --- /dev/null +++ b/CefSharp/DragData.cs @@ -0,0 +1,66 @@ +// Copyright © 2010-2014 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + + +namespace CefSharp +{ + public class DragData + { + /// + /// Return the name of the file being dragged out of the browser window. + /// + public string GetFileName { get; set; } + + /// + /// Retrieve the list of file names that are being dragged into the browser window + /// + public bool GetFileNames { get; set; } + + /// + /// Return the base URL that the fragment came from. This value is used for resolving relative URLs and may be empty. + /// + public string GetFragmentBaseURL { get; set; } + + /// + /// Return the text/html fragment that is being dragged. + /// + public string GetFragmentHtml { get; set; } + + /// + /// Return the plain text fragment that is being dragged. + /// + public string GetFragmentText { get; set; } + + /// + /// Return the metadata, if any, associated with the link being dragged. + /// + public string GetLinkMetadata { set; get; } + + /// + /// Return the title associated with the link being dragged. + /// + public string GetLinkTitle { set; get; } + + /// + /// Return the link URL that is being dragged. + /// + public string GetLinkURL { set; get; } + + /// + /// Returns true if the drag data is a file. + /// + public bool IsFile { get; set; } + + /// + /// Returns true if the drag data is a text or html fragment. + /// + public bool IsFragment { get; set; } + + /// + /// Returns true if the drag data is a link + /// + public bool IsLink { get; set; } + + } +} diff --git a/CefSharp/IDragHandler.cs b/CefSharp/IDragHandler.cs index 2f68c6532..bceff9bfb 100644 --- a/CefSharp/IDragHandler.cs +++ b/CefSharp/IDragHandler.cs @@ -2,10 +2,12 @@ // // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. - namespace CefSharp +using System.Collections.Generic; + +namespace CefSharp { public interface IDragHandler { - bool OnDragEnter(IWebBrowser browser); + bool OnDragEnter(IWebBrowser browser, List dragData, out List result); } }