// Copyright © 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. using System; using System.Collections.Generic; using System.IO; using CefSharp.Structs; namespace CefSharp { /// /// Used to represent drag data. /// public interface IDragData : IDisposable { /// /// Gets a copy of the current drag data /// /// a clone of the current object IDragData Clone(); /// /// Returns true if this object is read-only. /// bool IsReadOnly { get; } /// /// Return the name of the file being dragged out of the browser window. /// string FileName { get; set; } /// /// Retrieve the list of file names that are being dragged into the browser window /// IList FileNames { get; } /// /// Return the base URL that the fragment came from. This value is used for resolving relative URLs and may be empty. /// string FragmentBaseUrl { get; set; } /// /// Return the text/html fragment that is being dragged. /// string FragmentHtml { get; set; } /// /// Return the plain text fragment that is being dragged. /// string FragmentText { get; set; } /// /// Returns true if an image representation of drag data is available. /// bool HasImage { get; } /// /// Get the image representation of drag data. /// May return NULL if no image representation is available. /// IImage Image { get; } /// /// Get the image hotspot (drag start location relative to image dimensions). /// Point ImageHotspot { get; } /// /// Return the metadata, if any, associated with the link being dragged. /// string LinkMetaData { set; get; } /// /// Return the title associated with the link being dragged. /// string LinkTitle { set; get; } /// /// Return the link URL that is being dragged. /// string LinkUrl { set; get; } /// /// Returns true if the drag data is a file. /// bool IsFile { get; set; } /// /// Returns true if the drag data is a text or html fragment. /// bool IsFragment { get; set; } /// /// Returns true if the drag data is a link /// bool IsLink { get; set; } /// /// Add a file that is being dragged into the webview. /// /// File Path /// Optional Display Name void AddFile(string path, string displayName = null); /// /// Reset the file contents. You should do this before calling /// CefBrowserHost::DragTargetDragEnter as the web view does not allow us to /// drag in this kind of data. /// void ResetFileContents(); /// /// Write the contents of the file being dragged out of the web view into the provided /// For a suggested filename check the property /// /// Stream data is to be written to. If null this method will return the /// size of the file contents in bytes. /// Returns the number of bytes written to the stream Int64 GetFileContents(Stream stream); /// /// Gets a value indicating whether the object has been disposed of. /// bool IsDisposed { get; } } }