diff options
Diffstat (limited to 'views/view.h')
-rw-r--r-- | views/view.h | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/views/view.h b/views/view.h index ba892c1..66ef76f 100644 --- a/views/view.h +++ b/views/view.h @@ -9,9 +9,11 @@ #include <algorithm> #include <map> +#include <set> #include <string> #include <vector> +#include "app/os_exchange_data.h" #include "base/gfx/native_widget_types.h" #include "base/gfx/rect.h" #include "base/scoped_ptr.h" @@ -20,17 +22,12 @@ #include "views/background.h" #include "views/border.h" -#if defined(OS_WIN) -struct IDataObject; -#endif // defined(OS_WIN) - namespace gfx { class Canvas; class Insets; class Path; } -class OSExchangeData; class ViewAccessibilityWrapper; class ThemeProvider; @@ -742,9 +739,12 @@ class View : public AcceleratorTarget { DragController* GetDragController(); // During a drag and drop session when the mouse moves the view under the - // mouse is queried to see if it should be a target for the drag and drop - // session. A view indicates it is a valid target by returning true from - // CanDrop. If a view returns true from CanDrop, + // mouse is queried for the drop types it supports by way of the + // GetDropFormats methods. If the view returns true and the drag site can + // provide data in one of the formats, the view is asked if the drop data + // is required before any other drop events are sent. Once the + // data is available the view is asked if it supports the drop (by way of + // the CanDrop method). If a view returns true from CanDrop, // OnDragEntered is sent to the view when the mouse first enters the view, // as the mouse moves around within the view OnDragUpdated is invoked. // If the user releases the mouse over the view and OnDragUpdated returns a @@ -756,6 +756,18 @@ class View : public AcceleratorTarget { // the mouse does not support the drop, the ancestors are walked until one // is found that supports the drop. + // Override and return the set of formats that can be dropped on this view. + // |formats| is a bitmask of the formats defined bye OSExchangeData::Format. + // The default implementation returns false, which means the view doesn't + // support dropping. + virtual bool GetDropFormats( + int* formats, + std::set<OSExchangeData::CustomFormat>* custom_formats); + + // Override and return true if the data must be available before any drop + // methods should be invoked. The default is false. + virtual bool AreDropTypesRequired(); + // A view that supports drag and drop must override this and return true if // data contains a type that may be dropped on this view. virtual bool CanDrop(const OSExchangeData& data); |