gtkmm 4.14.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Related Functions | List of all members
Gtk::SignalListItemFactory Class Reference

A listitem factory providing signals. More...

#include <gtkmm/signallistitemfactory.h>

Inheritance diagram for Gtk::SignalListItemFactory:
Inheritance graph
[legend]

Public Member Functions

 SignalListItemFactory (SignalListItemFactory && src) noexcept
 
SignalListItemFactoryoperator= (SignalListItemFactory && src) noexcept
 
 ~SignalListItemFactory () noexcept override
 
GtkSignalListItemFactory * gobj ()
 Provides access to the underlying C GObject. More...
 
const GtkSignalListItemFactory * gobj () const
 Provides access to the underlying C GObject. More...
 
GtkSignalListItemFactory * gobj_copy ()
 Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...
 
Glib::SignalProxy< void(const Glib::RefPtr< ListItem > &)> signal_setup ()
 This signal is only usable if the factory is being used to make ListItems. More...
 
Glib::SignalProxy< void(const Glib::RefPtr< ListItem > &)> signal_bind ()
 This signal is only usable if the factory is being used to make ListItems. More...
 
Glib::SignalProxy< void(const Glib::RefPtr< ListItem > &)> signal_unbind ()
 This signal is only usable if the factory is being used to make ListItems. More...
 
Glib::SignalProxy< void(const Glib::RefPtr< ListItem > &)> signal_teardown ()
 This signal is only usable if the factory is being used to make ListItems. More...
 
Glib::SignalProxy< void(const Glib::RefPtr< Glib::Object > &)> signal_setup_obj ()
 This is a more generic version of signal_setup(), usable if the factory is being used to make something other than ListItems, for example ListHeader. More...
 
Glib::SignalProxy< void(const Glib::RefPtr< Glib::Object > &)> signal_bind_obj ()
 This is a more generic version of signal_bind(), usable if the factory is being used to make something other than ListItems, for example ListHeader. More...
 
Glib::SignalProxy< void(const Glib::RefPtr< Glib::Object > &)> signal_unbind_obj ()
 This is a more generic version of signal_unbind(), usable if the factory is being used to make something other than ListItems, for example ListHeader. More...
 
Glib::SignalProxy< void(const Glib::RefPtr< Glib::Object > &)> signal_teardown_obj ()
 This is a more generic version of signal_teardown(), usable if the factory is being used to make something other than ListItems, for example ListHeader. More...
 
- Public Member Functions inherited from Gtk::ListItemFactory
 ListItemFactory (ListItemFactory && src) noexcept
 
ListItemFactoryoperator= (ListItemFactory && src) noexcept
 
 ~ListItemFactory () noexcept override
 
GtkListItemFactory * gobj ()
 Provides access to the underlying C GObject. More...
 
const GtkListItemFactory * gobj () const
 Provides access to the underlying C GObject. More...
 
GtkListItemFactory * gobj_copy ()
 Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...
 

Static Public Member Functions

static GType get_type ()
 Get the GType for this class, for use with the underlying GObject type system. More...
 
static Glib::RefPtr< SignalListItemFactorycreate ()
 
- Static Public Member Functions inherited from Gtk::ListItemFactory
static GType get_type ()
 Get the GType for this class, for use with the underlying GObject type system. More...
 

Protected Member Functions

 SignalListItemFactory ()
 

Related Functions

(Note that these are not member functions.)

Glib::RefPtr< Gtk::SignalListItemFactorywrap (GtkSignalListItemFactory * object, bool take_copy=false)
 A Glib::wrap() method for this object. More...
 

Detailed Description

A listitem factory providing signals.

Gtk::SignalListItemFactory is a Gtk::ListItemFactory that provides signals with which user code can manage instances of ListItem or other list objects.

Note the following signals, not suffixed _obj(), are only suitable if the factory is really being used to make ListItem instances. If not, e.g. it is producing ListHeader items in use as a ListView::property_header_factory(), these signals receive null RefPtrs and so are not usable. In such cases, use the versions suffixed _obj(), and cast the Glib::Objects to the right type.

Signals are emitted for every listitem in the same order:

  1. signal_setup() is emitted to set up permanent things on the listitem. This usually means constructing the widgets used in the row and adding them to the listitem.
  2. signal_bind() is emitted to bind the item passed via Gtk::ListItem::property_item() to the widgets that have been created in step 1 or to add item-specific widgets. Signals are connected to listen to changes - both to changes in the item to update the widgets or to changes in the widgets to update the item. After this signal has been called, the listitem may be shown in a list widget.
  3. signal_unbind() is emitted to undo everything done in step 2. Usually this means disconnecting signal handlers. Once this signal has been called, the listitem will no longer be used in a list widget.
  4. signal_bind() and signal_unbind() may be emitted multiple times again to bind the listitem for use with new items. By reusing listitems, potentially costly setup can be avoided. However, it means code needs to make sure to properly clean up the listitem in step 3 so that no information from the previous use leaks into the next use.
  5. signal_teardown() is emitted to allow undoing the effects of signal_setup(). After this signal was emitted on a listitem, the listitem will be destroyed and not be used again.

Note that during the signal emissions, changing properties on the Gtk::ListItems passed will not trigger notify signals as the listitem's notifications are frozen. See Glib::ObjectBase::freeze_notify() for details.

For tracking changes in other properties in the Gtk::ListItem, the Gtk::ListItem notify signal is recommended. The signal can be connected in the signal_setup() signal and removed again during signal_teardown().

See also
Gtk::ListItemFactory
Since gtkmm 3.98:

Constructor & Destructor Documentation

◆ SignalListItemFactory() [1/2]

Gtk::SignalListItemFactory::SignalListItemFactory ( SignalListItemFactory &&  src)
noexcept

◆ ~SignalListItemFactory()

Gtk::SignalListItemFactory::~SignalListItemFactory ( )
overridenoexcept

◆ SignalListItemFactory() [2/2]

Gtk::SignalListItemFactory::SignalListItemFactory ( )
protected

Member Function Documentation

◆ create()

static Glib::RefPtr< SignalListItemFactory > Gtk::SignalListItemFactory::create ( )
static

◆ get_type()

static GType Gtk::SignalListItemFactory::get_type ( )
static

Get the GType for this class, for use with the underlying GObject type system.

◆ gobj() [1/2]

GtkSignalListItemFactory * Gtk::SignalListItemFactory::gobj ( )
inline

Provides access to the underlying C GObject.

◆ gobj() [2/2]

const GtkSignalListItemFactory * Gtk::SignalListItemFactory::gobj ( ) const
inline

Provides access to the underlying C GObject.

◆ gobj_copy()

GtkSignalListItemFactory * Gtk::SignalListItemFactory::gobj_copy ( )

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

◆ operator=()

SignalListItemFactory & Gtk::SignalListItemFactory::operator= ( SignalListItemFactory &&  src)
noexcept

◆ signal_bind()

Glib::SignalProxy< void(const Glib::RefPtr< ListItem > &)> Gtk::SignalListItemFactory::signal_bind ( )

This signal is only usable if the factory is being used to make ListItems.

If not, e.g. because the factory is making ListHeader items via being used as a ListView::property_header_factory(), this signal will receive a null RefPtr and so not be usable. In such cases, use signal_bind_obj() instead.

Slot Prototype:
void on_my_bind(const Glib::RefPtr<ListItem>& list_item)

Flags: Run First

Emitted when an object has been bound, for example when a new Gtk::ListItem::property_item() has been set on a listitem and should be bound for use.

After this signal was emitted, the object might be shown in a Gtk::ListView or other widget.

The signal_unbind() signal is the opposite of this signal and can be used to undo everything done in this signal.

Parameters
list_itemThe Glib::Object to bind.

◆ signal_bind_obj()

Glib::SignalProxy< void(const Glib::RefPtr< Glib::Object > &)> Gtk::SignalListItemFactory::signal_bind_obj ( )

This is a more generic version of signal_bind(), usable if the factory is being used to make something other than ListItems, for example ListHeader.

It receives a RefPtr to Glib::Object, which can be cast to the actual type.

Slot Prototype:
void on_my_bind_obj(const Glib::RefPtr<Glib::Object>& object)

Flags: Run First

Emitted when an object has been bound, for example when a new Gtk::ListItem::property_item() has been set on a listitem and should be bound for use.

After this signal was emitted, the object might be shown in a Gtk::ListView or other widget.

The signal_unbind() signal is the opposite of this signal and can be used to undo everything done in this signal.

Since gtkmm 4.14:
Parameters
objectThe Glib::Object to bind.

◆ signal_setup()

Glib::SignalProxy< void(const Glib::RefPtr< ListItem > &)> Gtk::SignalListItemFactory::signal_setup ( )

This signal is only usable if the factory is being used to make ListItems.

If not, e.g. because the factory is making ListHeader items via being used as a ListView::property_header_factory(), this signal will receive a null RefPtr and so not be usable. In such cases, use signal_setup_obj() instead.

Slot Prototype:
void on_my_setup(const Glib::RefPtr<ListItem>& list_item)

Flags: Run First

Emitted when a new listitem has been created and needs to be setup for use.

It is the first signal emitted for every listitem.

The signal_teardown() signal is the opposite of this signal and can be used to undo everything done in this signal.

Parameters
list_itemThe Glib::Object to set up.

◆ signal_setup_obj()

Glib::SignalProxy< void(const Glib::RefPtr< Glib::Object > &)> Gtk::SignalListItemFactory::signal_setup_obj ( )

This is a more generic version of signal_setup(), usable if the factory is being used to make something other than ListItems, for example ListHeader.

It receives a RefPtr to Glib::Object, which can be cast to the actual type.

Slot Prototype:
void on_my_setup_obj(const Glib::RefPtr<Glib::Object>& object)

Flags: Run First

Emitted when a new listitem has been created and needs to be setup for use.

It is the first signal emitted for every listitem.

The signal_teardown() signal is the opposite of this signal and can be used to undo everything done in this signal.

Since gtkmm 4.14:
Parameters
objectThe Glib::Object to set up.

◆ signal_teardown()

Glib::SignalProxy< void(const Glib::RefPtr< ListItem > &)> Gtk::SignalListItemFactory::signal_teardown ( )

This signal is only usable if the factory is being used to make ListItems.

If not, e.g. because the factory is making ListHeader items via being used as a ListView::property_header_factory(), this signal will receive a null RefPtr and so not be usable. In such cases, use signal_teardown_obj() instead.

Slot Prototype:
void on_my_teardown(const Glib::RefPtr<ListItem>& list_item)

Flags: Run First

Emitted when an object is about to be destroyed.

It is the last signal ever emitted for this list_item.

This signal is the opposite of the signal_setup() signal and should be used to undo everything done in that signal.

Parameters
list_itemThe Glib::Object to tear down.

◆ signal_teardown_obj()

Glib::SignalProxy< void(const Glib::RefPtr< Glib::Object > &)> Gtk::SignalListItemFactory::signal_teardown_obj ( )

This is a more generic version of signal_teardown(), usable if the factory is being used to make something other than ListItems, for example ListHeader.

It receives a RefPtr to Glib::Object, which can be cast to the actual type.

Slot Prototype:
void on_my_teardown_obj(const Glib::RefPtr<Glib::Object>& object)

Flags: Run First

Emitted when an object is about to be destroyed.

It is the last signal ever emitted for this object.

This signal is the opposite of the signal_setup() signal and should be used to undo everything done in that signal.

Since gtkmm 4.14:
Parameters
objectThe Glib::Object to tear down.

◆ signal_unbind()

Glib::SignalProxy< void(const Glib::RefPtr< ListItem > &)> Gtk::SignalListItemFactory::signal_unbind ( )

This signal is only usable if the factory is being used to make ListItems.

If not, e.g. because the factory is making ListHeader items via being used as a ListView::property_header_factory(), this signal will receive a null RefPtr and so not be usable. In such cases, use signal_unbind_obj() instead.

Slot Prototype:
void on_my_unbind(const Glib::RefPtr<ListItem>& list_item)

Flags: Run First

Emitted when an object has been unbound from its item, for example when a listitem was removed from use in a list widget and its Gtk::ListItem::property_item() is about to be unset.

This signal is the opposite of the signal_bind() signal and should be used to undo everything done in that signal.

Parameters
list_itemThe Glib::Object to unbind.

◆ signal_unbind_obj()

Glib::SignalProxy< void(const Glib::RefPtr< Glib::Object > &)> Gtk::SignalListItemFactory::signal_unbind_obj ( )

This is a more generic version of signal_unbind(), usable if the factory is being used to make something other than ListItems, for example ListHeader.

It receives a RefPtr to Glib::Object, which can be cast to the actual type.

Slot Prototype:
void on_my_unbind_obj(const Glib::RefPtr<Glib::Object>& object)

Flags: Run First

Emitted when an object has been unbound from its item, for example when a listitem was removed from use in a list widget and its Gtk::ListItem::property_item() is about to be unset.

This signal is the opposite of the signal_bind() signal and should be used to undo everything done in that signal.

Since gtkmm 4.14:
Parameters
objectThe Glib::Object to unbind.

Friends And Related Function Documentation

◆ wrap()

Glib::RefPtr< Gtk::SignalListItemFactory > wrap ( GtkSignalListItemFactory *  object,
bool  take_copy = false 
)
related

A Glib::wrap() method for this object.

Parameters
objectThe C instance.
take_copyFalse if the result should take ownership of the C instance. True if it should take a new copy or ref.
Returns
A C++ instance that wraps this C instance.