Blender V5.0
blender::ui::AbstractViewItemDragController Class Referenceabstract

#include <UI_abstract_view.hh>

Inherited by blender::ed::asset::shelf::AssetDragController, blender::ed::asset_browser::AssetCatalogDragController, blender::ed::object::shapekey::ShapeKeyDragController, blender::ui::bonecollections::BoneCollectionDragController, and blender::ui::greasepencil::LayerViewItemDragController.

Public Member Functions

virtual ~AbstractViewItemDragController ()=default
virtual std::optional< eWM_DragDataTypeget_drag_type () const =0
virtual void * create_drag_data () const =0
Drag 'n Drop
 AbstractViewItemDragController (AbstractView &view)
virtual void on_drag_start (bContext &C)
template<class ViewType>
ViewType & get_view () const

Protected Attributes

AbstractViewview_

Detailed Description

Class to enable dragging a view item. An item can return a drag controller for itself by implementing #AbstractViewItem::create_drag_controller().

Definition at line 419 of file UI_abstract_view.hh.

Constructor & Destructor Documentation

◆ AbstractViewItemDragController()

◆ ~AbstractViewItemDragController()

virtual blender::ui::AbstractViewItemDragController::~AbstractViewItemDragController ( )
virtualdefault

Member Function Documentation

◆ create_drag_data()

◆ get_drag_type()

◆ get_view()

template<class ViewType>
ViewType & blender::ui::AbstractViewItemDragController::get_view ( ) const
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 440 of file UI_abstract_view.hh.

References view_.

Referenced by blender::ed::asset::shelf::AssetDragController::get_drag_type(), blender::ed::asset::shelf::AssetDragController::on_drag_start(), and blender::ed::asset_browser::AssetCatalogDragController::on_drag_start().

◆ on_drag_start()

void blender::ui::AbstractViewItemDragController::on_drag_start ( bContext & C)
virtual

Called when beginning to drag. Also called when get_drag_type() doesn't return a value, so an arbitrary action can be executed.

Reimplemented in blender::ed::asset::shelf::AssetDragController, blender::ed::asset_browser::AssetCatalogDragController, blender::ui::bonecollections::BoneCollectionDragController, and blender::ui::greasepencil::LayerViewItemDragController.

Definition at line 320 of file abstract_view_item.cc.

Member Data Documentation

◆ view_

AbstractView& blender::ui::AbstractViewItemDragController::view_
protected

Definition at line 421 of file UI_abstract_view.hh.

Referenced by AbstractViewItemDragController(), and get_view().


The documentation for this class was generated from the following files: