Blender V5.0
blender::ed::object::shapekey::ShapeKeyItem Class Reference

Inherits blender::ui::AbstractTreeViewItem.

Public Member Functions

 ShapeKeyItem (Object *object, Key *key, KeyBlock *kb, int index)
void build_row (uiLayout &row) override
std::optional< bool > should_be_active () const override
void on_activate (bContext &C) override
std::optional< bool > should_be_selected () const override
void set_selected (const bool select) override
bool supports_renaming () const override
bool rename (const bContext &C, StringRefNull new_name) override
StringRef get_rename_string () const override
void delete_item (bContext *C) override
void build_context_menu (bContext &C, uiLayout &layout) const override
std::unique_ptr< ui::AbstractViewItemDragControllercreate_drag_controller () const override
std::unique_ptr< ui::TreeViewItemDropTargetcreate_drop_target () override
Public Member Functions inherited from blender::ui::AbstractTreeViewItem
 ~AbstractTreeViewItem () override=default
std::optional< std::string > debug_name () const override
std::unique_ptr< DropTargetInterfacecreate_item_drop_target () final
AbstractTreeViewget_tree_view () const
std::optional< rctfget_win_rect (const ARegion &region) const
void begin_renaming ()
bool toggle_collapsed ()
virtual bool set_collapsed (bool collapsed)
virtual void on_collapse_change (bContext &C, bool is_collapsed)
virtual std::optional< bool > should_be_collapsed () const
void uncollapse_by_default ()
bool is_collapsed () const
bool is_collapsible () const
int count_parents () const
void on_filter_change () override
Public Member Functions inherited from blender::ui::AbstractViewItem
virtual ~AbstractViewItem ()=default
void activate (bContext &C)
void activate_for_context_menu (bContext &C)
void deactivate ()
AbstractViewget_view () const
uiButViewItemview_item_button () const
void disable_interaction ()
bool is_interactive () const
void disable_activatable ()
void select_on_click_set ()
bool is_select_on_click () const
void always_reactivate_on_click ()
void activate_for_context_menu_set ()
bool is_active () const
bool is_selected () const
bool is_search_highlight () const
bool is_renaming () const
void begin_renaming ()
void end_renaming ()
void rename_apply (const bContext &C)
bool is_filtered_visible () const
Public Member Functions inherited from blender::ui::TreeViewItemContainer
template<class ItemT, typename... Args>
ItemT & add_tree_item (Args &&...args)
AbstractTreeViewItemadd_tree_item (std::unique_ptr< AbstractTreeViewItem > item)

Additional Inherited Members

Public Types inherited from blender::ui::TreeViewItemContainer
enum class  IterOptions { None = 0 , SkipCollapsed = 1 << 0 , SkipFiltered = 1 << 1 }
using ItemIterFn = FunctionRef<void(AbstractTreeViewItem &)>
Protected Member Functions inherited from blender::ui::AbstractTreeViewItem
virtual bool supports_collapsing () const
void toggle_collapsed_from_view (bContext &C)
void change_state_delayed () override
bool matches (const AbstractViewItem &other) const override
void update_from_old (const AbstractViewItem &old) override
virtual bool matches_single (const AbstractTreeViewItem &other) const
bool is_hovered () const
void ensure_parents_uncollapsed ()
Protected Member Functions inherited from blender::ui::AbstractViewItem
 AbstractViewItem ()=default
void add_rename_button (uiBlock &block)
virtual bool should_be_filtered_visible (StringRefNull filter_string) const
Protected Member Functions inherited from blender::ui::TreeViewItemContainer
void foreach_item_recursive (ItemIterFn iter_fn, IterOptions options=IterOptions::None) const
void foreach_parent (ItemIterFn iter_fn) const
Protected Attributes inherited from blender::ui::AbstractTreeViewItem
std::string label_
Protected Attributes inherited from blender::ui::AbstractViewItem
AbstractViewview_ = nullptr
uiButViewItemview_item_but_ = nullptr
bool is_activatable_ = true
bool is_interactive_ = true
bool is_active_ = false
bool is_selected_ = false
bool is_renaming_ = false
bool is_highlighted_search_ = false
bool is_filtered_visible_ = true
bool is_always_collapsible_ = false
bool select_on_click_ = false
bool reactivate_on_click_ = false
bool activate_for_context_menu_ = false
Protected Attributes inherited from blender::ui::TreeViewItemContainer
Vector< std::unique_ptr< AbstractTreeViewItem > > children_
TreeViewItemContainer * root_ = nullptr
AbstractTreeViewItemparent_ = nullptr
bool is_flat_ = false

Detailed Description

Definition at line 192 of file interface_template_shape_key_tree.cc.

Constructor & Destructor Documentation

◆ ShapeKeyItem()

blender::ed::object::shapekey::ShapeKeyItem::ShapeKeyItem ( Object * object,
Key * key,
KeyBlock * kb,
int index )
inline

Member Function Documentation

◆ build_context_menu()

void blender::ed::object::shapekey::ShapeKeyItem::build_context_menu ( bContext & C,
uiLayout & layout ) const
inlineoverridevirtual

Reimplemented from blender::ui::AbstractViewItem.

Definition at line 280 of file interface_template_shape_key_tree.cc.

References C, UI_menutype_draw(), and WM_menutype_find().

◆ build_row()

◆ create_drag_controller()

std::unique_ptr< ui::AbstractViewItemDragController > blender::ed::object::shapekey::ShapeKeyItem::create_drag_controller ( ) const
inlineoverridevirtual

If an item wants to support being dragged, it has to return a drag controller here. That is an object implementing #AbstractViewItemDragController.

Reimplemented from blender::ui::AbstractViewItem.

Definition at line 289 of file interface_template_shape_key_tree.cc.

References blender::ui::AbstractTreeViewItem::get_tree_view().

◆ create_drop_target()

std::unique_ptr< ui::TreeViewItemDropTarget > blender::ed::object::shapekey::ShapeKeyItem::create_drop_target ( )
inlineoverridevirtual

Reimplemented from blender::ui::AbstractTreeViewItem.

Definition at line 295 of file interface_template_shape_key_tree.cc.

References blender::ui::Reorder.

◆ delete_item()

void blender::ed::object::shapekey::ShapeKeyItem::delete_item ( bContext * C)
inlineoverridevirtual

◆ get_rename_string()

StringRef blender::ed::object::shapekey::ShapeKeyItem::get_rename_string ( ) const
inlineoverridevirtual

See AbstractViewItem::get_rename_string().

Reimplemented from blender::ui::AbstractTreeViewItem.

Definition at line 266 of file interface_template_shape_key_tree.cc.

References blender::ui::AbstractTreeViewItem::label_.

◆ on_activate()

void blender::ed::object::shapekey::ShapeKeyItem::on_activate ( bContext & C)
inlineoverridevirtual

Called when the view changes an item's state from inactive to active. Will only be called if the state change is triggered through the view, not through external changes. E.g. a click on an item calls it, a change in the value returned by should_be_active() to reflect an external state change does not.

Reimplemented from blender::ui::AbstractViewItem.

Definition at line 230 of file interface_template_shape_key_tree.cc.

References C, ED_undo_push(), RNA_pointer_create_discrete(), RNA_property_int_set(), RNA_property_update(), and RNA_struct_find_property().

◆ rename()

bool blender::ed::object::shapekey::ShapeKeyItem::rename ( const bContext & C,
StringRefNull new_name )
inlineoverridevirtual

See AbstractViewItem::rename().

Reimplemented from blender::ui::AbstractTreeViewItem.

Definition at line 257 of file interface_template_shape_key_tree.cc.

References C, blender::StringRefNull::c_str(), ED_undo_push(), RNA_pointer_create_discrete(), and RNA_string_set().

◆ set_selected()

void blender::ed::object::shapekey::ShapeKeyItem::set_selected ( const bool select)
inlineoverridevirtual

Reimplemented from blender::ui::AbstractViewItem.

Definition at line 246 of file interface_template_shape_key_tree.cc.

References KEYBLOCK_SEL, select, and SET_FLAG_FROM_TEST.

◆ should_be_active()

std::optional< bool > blender::ed::object::shapekey::ShapeKeyItem::should_be_active ( ) const
inlineoverridevirtual

If the result is not empty, it controls whether the item should be active or not, usually depending on the data that the view represents. Note that since this is meant to reflect externally managed state changes, on_activate() will never be called if this returns true.

Reimplemented from blender::ui::AbstractViewItem.

Definition at line 225 of file interface_template_shape_key_tree.cc.

◆ should_be_selected()

std::optional< bool > blender::ed::object::shapekey::ShapeKeyItem::should_be_selected ( ) const
inlineoverridevirtual

Reimplemented from blender::ui::AbstractViewItem.

Definition at line 241 of file interface_template_shape_key_tree.cc.

References KEYBLOCK_SEL.

◆ supports_renaming()

bool blender::ed::object::shapekey::ShapeKeyItem::supports_renaming ( ) const
inlineoverridevirtual

Queries if the view item supports renaming in principle. Renaming may still fail, e.g. if another item is already being renamed.

Reimplemented from blender::ui::AbstractViewItem.

Definition at line 252 of file interface_template_shape_key_tree.cc.


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