Blender
V3.3
|
#include <UI_abstract_view.hh>
Public Member Functions | |
virtual | ~AbstractViewItemDropController ()=default |
virtual bool | can_drop (const wmDrag &drag, const char **r_disabled_hint) const =0 |
virtual std::string | drop_tooltip (const wmDrag &drag) const =0 |
virtual bool | on_drop (struct bContext *C, const wmDrag &drag)=0 |
Drag 'n Drop | |
AbstractViewItemDropController (AbstractView &view) | |
template<class ViewType > | |
ViewType & | get_view () const |
Protected Attributes | |
AbstractView & | view_ |
Class to define the behavior when dropping something onto/into a view item, plus the behavior when dragging over this item. An item can return a drop controller for itself via a custom implementation of #AbstractViewItem::create_drop_controller().
Definition at line 229 of file UI_abstract_view.hh.
blender::ui::AbstractViewItemDropController::AbstractViewItemDropController | ( | AbstractView & | view | ) |
Definition at line 192 of file abstract_view_item.cc.
|
virtualdefault |
|
pure virtual |
Check if the data dragged with drag can be dropped on the item this controller is for.
r_disabled_hint | Return a static string to display to the user, explaining why dropping isn't possible on this item. Shouldn't be done too aggressively, e.g. don't set this if the drag-type can't be dropped here; only if it can but there's another reason it can't be dropped. Can assume this is a non-null pointer. |
Implemented in blender::ed::asset_browser::AssetCatalogDropController.
|
pure virtual |
Custom text to display when dragging over a view item. Should explain what happens when dropping the data onto this item. Will only be used if #AbstractViewItem::can_drop() returns true, so the implementing override doesn't have to check that again. The returned value must be a translated string.
Implemented in blender::ed::asset_browser::AssetCatalogDropController.
|
inline |
Request the view the item is registered for as type #ViewType. Throws a std::bad_cast
exception if the view is not of the requested type.
Definition at line 271 of file UI_abstract_view.hh.
References view_.
|
pure virtual |
Execute the logic to apply a drop of the data dragged with drag onto/into the item this controller is for.
Implemented in blender::ed::asset_browser::AssetCatalogDropController.
|
protected |
Definition at line 231 of file UI_abstract_view.hh.
Referenced by get_view().