Blender  V3.3
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
blender::ui::AbstractGridViewItem Class Referenceabstract

#include <UI_grid_view.hh>

Inheritance diagram for blender::ui::AbstractGridViewItem:
blender::ui::AbstractViewItem blender::ui::PreviewGridItem

Public Member Functions

virtual ~AbstractGridViewItem ()=default
 
virtual void build_grid_tile (uiLayout &layout) const =0
 
const AbstractGridViewget_view () const
 
- Public Member Functions inherited from blender::ui::AbstractViewItem
virtual ~AbstractViewItem ()=default
 
virtual void build_context_menu (bContext &C, uiLayout &column) const
 
virtual std::unique_ptr< AbstractViewItemDragControllercreate_drag_controller () const
 
virtual std::unique_ptr< AbstractViewItemDropControllercreate_drop_controller () const
 
AbstractViewget_view () const
 
bool is_active () const
 
virtual bool supports_renaming () const
 
virtual bool rename (StringRefNull new_name)
 
virtual StringRef get_rename_string () const
 
bool is_renaming () const
 
void begin_renaming ()
 
void end_renaming ()
 
void rename_apply ()
 

Protected Member Functions

 AbstractGridViewItem (StringRef identifier)
 
virtual bool matches (const AbstractViewItem &other) const override
 
virtual void on_activate ()
 
virtual std::optional< boolshould_be_active () const
 
void activate ()
 
void deactivate ()
 
- Protected Member Functions inherited from blender::ui::AbstractViewItem
 AbstractViewItem ()=default
 
virtual void update_from_old (const AbstractViewItem &old)
 
void add_rename_button (uiBlock &block)
 

Protected Attributes

StringRef identifier_ {}
 
uiButViewItemview_item_but_ = nullptr
 
- Protected Attributes inherited from blender::ui::AbstractViewItem
AbstractViewview_ = nullptr
 
bool is_active_ = false
 
bool is_renaming_ = false
 

Friends

class AbstractGridView
 
class GridViewLayoutBuilder
 

Additional Inherited Members

- Static Public Member Functions inherited from blender::ui::AbstractViewItem
template<typename ToType = AbstractViewItem>
static ToType * from_item_handle (uiViewItemHandle *handle)
 

Detailed Description

Definition at line 35 of file UI_grid_view.hh.

Constructor & Destructor Documentation

◆ ~AbstractGridViewItem()

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

◆ AbstractGridViewItem()

blender::ui::AbstractGridViewItem::AbstractGridViewItem ( StringRef  identifier)
protected

Definition at line 93 of file grid_view.cc.

Member Function Documentation

◆ activate()

void blender::ui::AbstractGridViewItem::activate ( )
protected

Activates this item, deactivates other items, and calls the #AbstractGridViewItem::on_activate() function. Requires the tree to have completed reconstruction, see #is_reconstructed(). Otherwise the actual item state is unknown, possibly calling state-change update functions incorrectly.

Definition at line 154 of file grid_view.cc.

References BLI_assert_msg, blender::ui::AbstractGridView::foreach_item(), get_view(), blender::ui::AbstractViewItem::is_active(), blender::ui::AbstractViewItem::is_active_, and on_activate().

◆ build_grid_tile()

virtual void blender::ui::AbstractGridViewItem::build_grid_tile ( uiLayout layout) const
pure virtual

◆ deactivate()

void blender::ui::AbstractGridViewItem::deactivate ( )
protected

Definition at line 171 of file grid_view.cc.

References blender::ui::AbstractViewItem::is_active_.

◆ get_view()

const AbstractGridView & blender::ui::AbstractGridViewItem::get_view ( ) const

◆ matches()

bool blender::ui::AbstractGridViewItem::matches ( const AbstractViewItem other) const
overrideprotectedvirtual

See AbstractViewItem::matches().

Implements blender::ui::AbstractViewItem.

Definition at line 97 of file grid_view.cc.

References identifier_.

◆ on_activate()

void blender::ui::AbstractGridViewItem::on_activate ( )
protectedvirtual

Called when the item's state changes from inactive to active.

Definition at line 136 of file grid_view.cc.

Referenced by activate().

◆ should_be_active()

std::optional< bool > blender::ui::AbstractGridViewItem::should_be_active ( ) const
protectedvirtual

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.

Definition at line 141 of file grid_view.cc.

Friends And Related Function Documentation

◆ AbstractGridView

friend class AbstractGridView
friend

Definition at line 36 of file UI_grid_view.hh.

◆ GridViewLayoutBuilder

friend class GridViewLayoutBuilder
friend

Definition at line 37 of file UI_grid_view.hh.

Member Data Documentation

◆ identifier_

StringRef blender::ui::AbstractGridViewItem::identifier_ {}
protected

Reference to a string that uniquely identifies this item in the view.

Definition at line 41 of file UI_grid_view.hh.

Referenced by matches().

◆ view_item_but_

uiButViewItem* blender::ui::AbstractGridViewItem::view_item_but_ = nullptr
protected

Every visible item gets a button of type UI_BTYPE_VIEW_ITEM during the layout building.

Definition at line 43 of file UI_grid_view.hh.


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