gtkmm 4.16.0
|
A sorter implementation that is geared towards the needs of Gtk::ColumnView. More...
#include <gtkmm/columnviewsorter.h>
Public Member Functions | |
ColumnViewSorter (ColumnViewSorter &&src) noexcept | |
ColumnViewSorter & | operator= (ColumnViewSorter &&src) noexcept |
~ColumnViewSorter () noexcept override | |
GtkColumnViewSorter * | gobj () |
Provides access to the underlying C GObject. | |
const GtkColumnViewSorter * | gobj () const |
Provides access to the underlying C GObject. | |
GtkColumnViewSorter * | gobj_copy () |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. | |
Glib::RefPtr< ColumnViewColumn > | get_primary_sort_column () |
Returns the primary sort column. | |
Glib::RefPtr< const ColumnViewColumn > | get_primary_sort_column () const |
Returns the primary sort column. | |
SortType | get_primary_sort_order () const |
Returns the primary sort order. | |
unsigned int | get_n_sort_columns () const |
Returns the number of columns by which the sorter sorts. | |
std::pair< Glib::RefPtr< ColumnViewColumn >, SortType > | get_nth_sort_column (unsigned int position) |
Gets the position'th sort column and its associated sort order. | |
std::pair< Glib::RefPtr< const ColumnViewColumn >, SortType > | get_nth_sort_column (unsigned int position) const |
See the non-const get_nth_sort_column(). | |
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< ColumnViewColumn > > | property_primary_sort_column () const |
The primary sort column. | |
Glib::PropertyProxy_ReadOnly< SortType > | property_primary_sort_order () const |
The primary sort order. | |
Public Member Functions inherited from Gtk::Sorter | |
Sorter (Sorter &&src) noexcept | |
Sorter & | operator= (Sorter &&src) noexcept |
~Sorter () noexcept override | |
GtkSorter * | gobj () |
Provides access to the underlying C GObject. | |
const GtkSorter * | gobj () const |
Provides access to the underlying C GObject. | |
GtkSorter * | gobj_copy () |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. | |
Ordering | compare (gpointer item1, gpointer item2) |
Compares two given items according to the sort order implemented by the sorter. | |
Order | get_order () const |
Gets the order that self conforms to. | |
void | changed (Change change) |
Notifies all users of the sorter that it has changed. | |
Glib::SignalProxy< void(Change)> | signal_changed () |
Static Public Member Functions | |
static GType | get_type () |
Get the GType for this class, for use with the underlying GObject type system. | |
Static Public Member Functions inherited from Gtk::Sorter | |
static GType | get_type () |
Get the GType for this class, for use with the underlying GObject type system. | |
Protected Member Functions | |
ColumnViewSorter () | |
Protected Member Functions inherited from Gtk::Sorter | |
Sorter () | |
virtual Ordering | compare_vfunc (gpointer item1, gpointer item2) |
virtual Order | get_order_vfunc () |
Related Symbols | |
(Note that these are not member symbols.) | |
Glib::RefPtr< Gtk::ColumnViewSorter > | wrap (GtkColumnViewSorter *object, bool take_copy=false) |
A Glib::wrap() method for this object. | |
Related Symbols inherited from Gtk::Sorter | |
Glib::RefPtr< Gtk::Sorter > | wrap (GtkSorter *object, bool take_copy=false) |
A Glib::wrap() method for this object. | |
Additional Inherited Members | |
Public Types inherited from Gtk::Sorter | |
enum class | Order { PARTIAL , NONE , TOTAL } |
enum class | Change { DIFFERENT , INVERTED , LESS_STRICT , MORE_STRICT } |
A sorter implementation that is geared towards the needs of Gtk::ColumnView.
The sorter returned by Gtk::ColumnView::get_sorter() is a Gtk::ColumnViewSorter.
In column views, sorting can be configured by associating sorters with columns, and users can invert sort order by clicking on column headers. The API of Gtk::ColumnViewSorter is designed to allow saving and restoring this configuration.
If you are only interested in the primary sort column (i.e. the column where a sort indicator is shown in the header), then you can just look at property_primary_sort_column() and property_primary_sort_order().
If you want to store the full sort configuration, including secondary sort columns that are used for tie breaking, then you can use get_nth_sort_column(). To get notified about changes, use Gtk::Sorter::signal_changed().
To restore a saved sort configuration on a Gtk::ColumnView, use code like:
|
noexcept |
|
overridenoexcept |
|
protected |
unsigned int Gtk::ColumnViewSorter::get_n_sort_columns | ( | ) | const |
Returns the number of columns by which the sorter sorts.
If the sorter of the primary sort column does not determine a total order, then the secondary sorters are consulted to break the ties.
Use the Gtk::Sorter::signal_changed() signal to get notified when the number of sort columns changes.
std::pair< Glib::RefPtr< ColumnViewColumn >, SortType > Gtk::ColumnViewSorter::get_nth_sort_column | ( | unsigned int | position | ) |
Gets the position'th sort column and its associated sort order.
Use the Gtk::Sorter::signal_changed() signal to get notified when sort columns change.
position | The position of the sort column to retrieve (0 for the primary sort column). |
std::pair< Glib::RefPtr< const ColumnViewColumn >, SortType > Gtk::ColumnViewSorter::get_nth_sort_column | ( | unsigned int | position | ) | const |
See the non-const get_nth_sort_column().
Glib::RefPtr< ColumnViewColumn > Gtk::ColumnViewSorter::get_primary_sort_column | ( | ) |
Returns the primary sort column.
The primary sort column is the one that displays the triangle in a column view header.
Glib::RefPtr< const ColumnViewColumn > Gtk::ColumnViewSorter::get_primary_sort_column | ( | ) | const |
Returns the primary sort column.
The primary sort column is the one that displays the triangle in a column view header.
SortType Gtk::ColumnViewSorter::get_primary_sort_order | ( | ) | const |
Returns the primary sort order.
The primary sort order determines whether the triangle displayed in the column view header of the primary sort column points upwards or downwards.
If there is no primary sort column, then this function returns Gtk::SortType::ASCENDING
.
|
static |
Get the GType for this class, for use with the underlying GObject type system.
|
inline |
Provides access to the underlying C GObject.
|
inline |
Provides access to the underlying C GObject.
GtkColumnViewSorter * Gtk::ColumnViewSorter::gobj_copy | ( | ) |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
|
noexcept |
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< ColumnViewColumn > > Gtk::ColumnViewSorter::property_primary_sort_column | ( | ) | const |
The primary sort column.
The primary sort column is the one that displays the triangle in a column view header.
Glib::PropertyProxy_ReadOnly< SortType > Gtk::ColumnViewSorter::property_primary_sort_order | ( | ) | const |
The primary sort order.
The primary sort order determines whether the triangle displayed in the column view header of the primary sort column points upwards or downwards.
Default value: Gtk::SortType::ASCENDING
|
related |
A Glib::wrap() method for this object.
object | The C instance. |
take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |