Repository navigation
API Review: DragStarting Event API - #4900
Conversation
Start API review for DragStarting event on the CompositionController
…tion a little more descriptive
… why .NET and WinRT will not be done
Add Spec: DragStarting API
| /// This interface is implemented by the | ||
| /// Microsoft.Web.WebView2.Core.CoreWebView2CompositionController runtime class. | ||
| [uuid(7a4daef9-1701-463f-992d-2136460cf76e), object, pointer_default(unique)] | ||
| interface ICoreWebView2StagingCompositionControllerInterop : IUnknown { |
There was a problem hiding this comment.
nit: Remove Staging from interface names
There was a problem hiding this comment.
Please fix.
| # API Details | ||
| ```C++ | ||
| /// Flags enum that represents the effects that a given WebView2 drag drop | ||
| /// operation can have. The values of this enum align with the ole DROPEFFECT |
There was a problem hiding this comment.
Can we add a link to any public doc here?
There was a problem hiding this comment.
Please fix. (Also ole -> OLE)
| # Examples | ||
| ## DragStarting | ||
| Users can use `add_DragStarting` on the CompositionController to add an event | ||
| handler that is invoked when drag is starting. They can use the the event args |
There was a problem hiding this comment.
| handler that is invoked when drag is starting. They can use the the event args | |
| handler that is invoked when drag is starting. They can use the event args |
There was a problem hiding this comment.
Please fix
| /// constant with the exception of DROPEFFECT_SCROLL which is only relevant for | ||
| /// drop and therefore unsupported. | ||
| [v1_enum] | ||
| typedef enum COREWEBVIEW2_DRAG_EFFECTS { |
There was a problem hiding this comment.
The existing CompositionController APIs for DragEnter, DragOver, and Drop use DWORD* for the DROPEFFECT. Should we follow that existing pattern?
There was a problem hiding this comment.
Yes let's use a DWORD here. It simplifies expected usage of the API and is consistent with our existing drag/drop WebView2 APIs.
| # Examples | ||
| ## DragStarting | ||
| Users can use `add_DragStarting` on the CompositionController to add an event | ||
| handler that is invoked when drag is starting. They can use the the event args |
There was a problem hiding this comment.
Please fix
| # API Details | ||
| ```C++ | ||
| /// Flags enum that represents the effects that a given WebView2 drag drop | ||
| /// operation can have. The values of this enum align with the ole DROPEFFECT |
There was a problem hiding this comment.
Please fix. (Also ole -> OLE)
| /// constant with the exception of DROPEFFECT_SCROLL which is only relevant for | ||
| /// drop and therefore unsupported. | ||
| [v1_enum] | ||
| typedef enum COREWEBVIEW2_DRAG_EFFECTS { |
There was a problem hiding this comment.
Yes let's use a DWORD here. It simplifies expected usage of the API and is consistent with our existing drag/drop WebView2 APIs.
| [uuid(edb6b243-334f-59d0-b3b3-de87dd401adc), object, pointer_default(unique)] | ||
| interface ICoreWebView2DragStartingEventArgs : IUnknown { | ||
| /// The operations this drag data supports. | ||
| [propget] HRESULT AllowedOperations( |
There was a problem hiding this comment.
Please change to AllowedDropEffects
| [propget] HRESULT Data([out, retval] IDataObject** value); | ||
|
|
||
| /// The position at which drag was detected. This position is given in | ||
| /// screen pixel coordinates as opposed to WebView2 relative coordinates. |
There was a problem hiding this comment.
Please update docs to explain DPI story. It should be WebView2 client coord space like what DragOver does
| /// This interface is implemented by the | ||
| /// Microsoft.Web.WebView2.Core.CoreWebView2CompositionController runtime class. | ||
| [uuid(7a4daef9-1701-463f-992d-2136460cf76e), object, pointer_default(unique)] | ||
| interface ICoreWebView2StagingCompositionControllerInterop : IUnknown { |
There was a problem hiding this comment.
Please fix.
This is an API review for the DragStarting event API