Skip to main content

gtk4/auto/
tree_view_column.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// DO NOT EDIT
4#![allow(deprecated)]
5
6use crate::{
7    Buildable, CellArea, CellLayout, CellRenderer, SortType, TreeIter, TreeModel,
8    TreeViewColumnSizing, Widget, ffi,
9};
10use glib::{
11    object::ObjectType as _,
12    prelude::*,
13    signal::{SignalHandlerId, connect_raw},
14    translate::*,
15};
16use std::boxed::Box as Box_;
17
18glib::wrapper! {
19    /// Use [`ColumnView`][crate::ColumnView] and [`ColumnViewColumn`][crate::ColumnViewColumn]
20    ///   instead of [`TreeView`][crate::TreeView] to show a tabular list
21    /// A visible column in a [`TreeView`][crate::TreeView] widget
22    ///
23    /// The [`TreeViewColumn`][crate::TreeViewColumn] object represents a visible column in a [`TreeView`][crate::TreeView] widget.
24    /// It allows to set properties of the column header, and functions as a holding pen
25    /// for the cell renderers which determine how the data in the column is displayed.
26    ///
27    /// Please refer to the [tree widget conceptual overview](section-tree-widget.html)
28    /// for an overview of all the objects and data types related to the tree widget and
29    /// how they work together, and to the [`TreeView`][crate::TreeView] documentation for specifics
30    /// about the CSS node structure for treeviews and their headers.
31    ///
32    /// ## Properties
33    ///
34    ///
35    /// #### `alignment`
36    ///  Readable | Writable
37    ///
38    ///
39    /// #### `cell-area`
40    ///  The [`CellArea`][crate::CellArea] used to layout cell renderers for this column.
41    ///
42    /// If no area is specified when creating the tree view column with gtk_tree_view_column_new_with_area()
43    /// a horizontally oriented [`CellAreaBox`][crate::CellAreaBox] will be used.
44    ///
45    /// Readable | Writable | Construct Only
46    ///
47    ///
48    /// #### `clickable`
49    ///  Readable | Writable
50    ///
51    ///
52    /// #### `expand`
53    ///  Readable | Writable
54    ///
55    ///
56    /// #### `fixed-width`
57    ///  Readable | Writable
58    ///
59    ///
60    /// #### `max-width`
61    ///  Readable | Writable
62    ///
63    ///
64    /// #### `min-width`
65    ///  Readable | Writable
66    ///
67    ///
68    /// #### `reorderable`
69    ///  Readable | Writable
70    ///
71    ///
72    /// #### `resizable`
73    ///  Readable | Writable
74    ///
75    ///
76    /// #### `sizing`
77    ///  Readable | Writable
78    ///
79    ///
80    /// #### `sort-column-id`
81    ///  Logical sort column ID this column sorts on when selected for sorting. Setting the sort column ID makes the column header
82    /// clickable. Set to -1 to make the column unsortable.
83    ///
84    /// Readable | Writable
85    ///
86    ///
87    /// #### `sort-indicator`
88    ///  Readable | Writable
89    ///
90    ///
91    /// #### `sort-order`
92    ///  Readable | Writable
93    ///
94    ///
95    /// #### `spacing`
96    ///  Readable | Writable
97    ///
98    ///
99    /// #### `title`
100    ///  Readable | Writable
101    ///
102    ///
103    /// #### `visible`
104    ///  Readable | Writable
105    ///
106    ///
107    /// #### `widget`
108    ///  Readable | Writable
109    ///
110    ///
111    /// #### `width`
112    ///  Readable
113    ///
114    ///
115    /// #### `x-offset`
116    ///  Readable
117    ///
118    /// ## Signals
119    ///
120    ///
121    /// #### `clicked`
122    ///  Emitted when the column's header has been clicked.
123    ///
124    ///
125    ///
126    /// # Implements
127    ///
128    /// [`trait@glib::ObjectExt`], [`BuildableExt`][trait@crate::prelude::BuildableExt], [`CellLayoutExt`][trait@crate::prelude::CellLayoutExt], [`CellLayoutExtManual`][trait@crate::prelude::CellLayoutExtManual]
129    #[doc(alias = "GtkTreeViewColumn")]
130    pub struct TreeViewColumn(Object<ffi::GtkTreeViewColumn>) @implements Buildable, CellLayout;
131
132    match fn {
133        type_ => || ffi::gtk_tree_view_column_get_type(),
134    }
135}
136
137impl TreeViewColumn {
138    /// Creates a new [`TreeViewColumn`][crate::TreeViewColumn].
139    ///
140    /// # Deprecated since 4.10
141    ///
142    /// Use GtkColumnView instead
143    ///
144    /// # Returns
145    ///
146    /// A newly created [`TreeViewColumn`][crate::TreeViewColumn].
147    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
148    #[allow(deprecated)]
149    #[doc(alias = "gtk_tree_view_column_new")]
150    pub fn new() -> TreeViewColumn {
151        assert_initialized_main_thread!();
152        unsafe { from_glib_none(ffi::gtk_tree_view_column_new()) }
153    }
154
155    /// Creates a new [`TreeViewColumn`][crate::TreeViewColumn] using @area to render its cells.
156    ///
157    /// # Deprecated since 4.10
158    ///
159    /// Use GtkColumnView instead
160    /// ## `area`
161    /// the [`CellArea`][crate::CellArea] that the newly created column should use to layout cells.
162    ///
163    /// # Returns
164    ///
165    /// A newly created [`TreeViewColumn`][crate::TreeViewColumn].
166    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
167    #[allow(deprecated)]
168    #[doc(alias = "gtk_tree_view_column_new_with_area")]
169    #[doc(alias = "new_with_area")]
170    pub fn with_area(area: &impl IsA<CellArea>) -> TreeViewColumn {
171        skip_assert_initialized!();
172        unsafe {
173            from_glib_none(ffi::gtk_tree_view_column_new_with_area(
174                area.as_ref().to_glib_none().0,
175            ))
176        }
177    }
178
179    // rustdoc-stripper-ignore-next
180    /// Creates a new builder-pattern struct instance to construct [`TreeViewColumn`] objects.
181    ///
182    /// This method returns an instance of [`TreeViewColumnBuilder`](crate::builders::TreeViewColumnBuilder) which can be used to create [`TreeViewColumn`] objects.
183    pub fn builder() -> TreeViewColumnBuilder {
184        TreeViewColumnBuilder::new()
185    }
186
187    ///  attribute of a [`CellRendererText`][crate::CellRendererText] get its values from
188    /// column 2.
189    ///
190    /// # Deprecated since 4.10
191    ///
192    /// Use GtkColumnView instead
193    /// ## `cell_renderer`
194    /// the [`CellRenderer`][crate::CellRenderer] to set attributes on
195    /// ## `attribute`
196    /// An attribute on the renderer
197    /// ## `column`
198    /// The column position on the model to get the attribute from.
199    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
200    #[allow(deprecated)]
201    #[doc(alias = "gtk_tree_view_column_add_attribute")]
202    pub fn add_attribute(
203        &self,
204        cell_renderer: &impl IsA<CellRenderer>,
205        attribute: &str,
206        column: i32,
207    ) {
208        unsafe {
209            ffi::gtk_tree_view_column_add_attribute(
210                self.to_glib_none().0,
211                cell_renderer.as_ref().to_glib_none().0,
212                attribute.to_glib_none().0,
213                column,
214            );
215        }
216    }
217
218    /// Obtains the horizontal position and size of a cell in a column.
219    ///
220    /// If the  cell is not found in the column, @start_pos and @width
221    /// are not changed and [`false`] is returned.
222    ///
223    /// # Deprecated since 4.10
224    ///
225    /// Use GtkColumnView instead
226    /// ## `cell_renderer`
227    /// a [`CellRenderer`][crate::CellRenderer]
228    ///
229    /// # Returns
230    ///
231    /// [`true`] if @cell belongs to @self
232    ///
233    /// ## `x_offset`
234    /// return location for the horizontal
235    ///   position of @cell within @self
236    ///
237    /// ## `width`
238    /// return location for the width of @cell
239    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
240    #[allow(deprecated)]
241    #[doc(alias = "gtk_tree_view_column_cell_get_position")]
242    pub fn cell_get_position(&self, cell_renderer: &impl IsA<CellRenderer>) -> Option<(i32, i32)> {
243        unsafe {
244            let mut x_offset = std::mem::MaybeUninit::uninit();
245            let mut width = std::mem::MaybeUninit::uninit();
246            let ret = from_glib(ffi::gtk_tree_view_column_cell_get_position(
247                self.to_glib_none().0,
248                cell_renderer.as_ref().to_glib_none().0,
249                x_offset.as_mut_ptr(),
250                width.as_mut_ptr(),
251            ));
252            if ret {
253                Some((x_offset.assume_init(), width.assume_init()))
254            } else {
255                None
256            }
257        }
258    }
259
260    /// Obtains the width and height needed to render the column.  This is used
261    /// primarily by the [`TreeView`][crate::TreeView].
262    ///
263    /// # Deprecated since 4.10
264    ///
265    /// Use GtkColumnView instead
266    ///
267    /// # Returns
268    ///
269    ///
270    /// ## `x_offset`
271    /// location to return x offset of a cell relative to @cell_area
272    ///
273    /// ## `y_offset`
274    /// location to return y offset of a cell relative to @cell_area
275    ///
276    /// ## `width`
277    /// location to return width needed to render a cell
278    ///
279    /// ## `height`
280    /// location to return height needed to render a cell
281    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
282    #[allow(deprecated)]
283    #[doc(alias = "gtk_tree_view_column_cell_get_size")]
284    pub fn cell_get_size(&self) -> (i32, i32, i32, i32) {
285        unsafe {
286            let mut x_offset = std::mem::MaybeUninit::uninit();
287            let mut y_offset = std::mem::MaybeUninit::uninit();
288            let mut width = std::mem::MaybeUninit::uninit();
289            let mut height = std::mem::MaybeUninit::uninit();
290            ffi::gtk_tree_view_column_cell_get_size(
291                self.to_glib_none().0,
292                x_offset.as_mut_ptr(),
293                y_offset.as_mut_ptr(),
294                width.as_mut_ptr(),
295                height.as_mut_ptr(),
296            );
297            (
298                x_offset.assume_init(),
299                y_offset.assume_init(),
300                width.assume_init(),
301                height.assume_init(),
302            )
303        }
304    }
305
306    /// Returns [`true`] if any of the cells packed into the @self are visible.
307    /// For this to be meaningful, you must first initialize the cells with
308    /// gtk_tree_view_column_cell_set_cell_data()
309    ///
310    /// # Deprecated since 4.10
311    ///
312    /// Use GtkColumnView instead
313    ///
314    /// # Returns
315    ///
316    /// [`true`], if any of the cells packed into the @self are currently visible
317    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
318    #[allow(deprecated)]
319    #[doc(alias = "gtk_tree_view_column_cell_is_visible")]
320    pub fn cell_is_visible(&self) -> bool {
321        unsafe {
322            from_glib(ffi::gtk_tree_view_column_cell_is_visible(
323                self.to_glib_none().0,
324            ))
325        }
326    }
327
328    /// Sets the cell renderer based on the @tree_model and @iter.  That is, for
329    /// every attribute mapping in @self, it will get a value from the set
330    /// column on the @iter, and use that value to set the attribute on the cell
331    /// renderer.  This is used primarily by the [`TreeView`][crate::TreeView].
332    ///
333    /// # Deprecated since 4.10
334    ///
335    /// Use GtkColumnView instead
336    /// ## `tree_model`
337    /// The [`TreeModel`][crate::TreeModel] to get the cell renderers attributes from.
338    /// ## `iter`
339    /// s attributes from.
340    /// ## `is_expander`
341    /// [`true`], if the row has children
342    /// ## `is_expanded`
343    /// [`true`], if the row has visible children
344    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
345    #[allow(deprecated)]
346    #[doc(alias = "gtk_tree_view_column_cell_set_cell_data")]
347    pub fn cell_set_cell_data(
348        &self,
349        tree_model: &impl IsA<TreeModel>,
350        iter: &TreeIter,
351        is_expander: bool,
352        is_expanded: bool,
353    ) {
354        unsafe {
355            ffi::gtk_tree_view_column_cell_set_cell_data(
356                self.to_glib_none().0,
357                tree_model.as_ref().to_glib_none().0,
358                mut_override(iter.to_glib_none().0),
359                is_expander.into_glib(),
360                is_expanded.into_glib(),
361            );
362        }
363    }
364
365    /// Unsets all the mappings on all renderers on the @self.
366    ///
367    /// # Deprecated since 4.10
368    ///
369    /// Use GtkColumnView instead
370    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
371    #[allow(deprecated)]
372    #[doc(alias = "gtk_tree_view_column_clear")]
373    pub fn clear(&self) {
374        unsafe {
375            ffi::gtk_tree_view_column_clear(self.to_glib_none().0);
376        }
377    }
378
379    /// Clears all existing attributes previously set with
380    /// gtk_tree_view_column_set_attributes().
381    ///
382    /// # Deprecated since 4.10
383    ///
384    /// Use GtkColumnView instead
385    /// ## `cell_renderer`
386    /// a [`CellRenderer`][crate::CellRenderer] to clear the attribute mapping on.
387    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
388    #[allow(deprecated)]
389    #[doc(alias = "gtk_tree_view_column_clear_attributes")]
390    pub fn clear_attributes(&self, cell_renderer: &impl IsA<CellRenderer>) {
391        unsafe {
392            ffi::gtk_tree_view_column_clear_attributes(
393                self.to_glib_none().0,
394                cell_renderer.as_ref().to_glib_none().0,
395            );
396        }
397    }
398
399    ///  signal on the column.  This function will only work if
400    /// @self is clickable.
401    ///
402    /// # Deprecated since 4.10
403    ///
404    /// Use GtkColumnView instead
405    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
406    #[allow(deprecated)]
407    #[doc(alias = "gtk_tree_view_column_clicked")]
408    pub fn clicked(&self) {
409        unsafe {
410            ffi::gtk_tree_view_column_clicked(self.to_glib_none().0);
411        }
412    }
413
414    /// Sets the current keyboard focus to be at @cell, if the column contains
415    /// 2 or more editable and activatable cells.
416    ///
417    /// # Deprecated since 4.10
418    ///
419    /// Use GtkColumnView instead
420    /// ## `cell`
421    /// A [`CellRenderer`][crate::CellRenderer]
422    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
423    #[allow(deprecated)]
424    #[doc(alias = "gtk_tree_view_column_focus_cell")]
425    pub fn focus_cell(&self, cell: &impl IsA<CellRenderer>) {
426        unsafe {
427            ffi::gtk_tree_view_column_focus_cell(
428                self.to_glib_none().0,
429                cell.as_ref().to_glib_none().0,
430            );
431        }
432    }
433
434    /// Returns the current x alignment of @self.  This value can range
435    /// between 0.0 and 1.0.
436    ///
437    /// # Deprecated since 4.10
438    ///
439    /// Use GtkColumnView instead
440    ///
441    /// # Returns
442    ///
443    /// The current alignent of @self.
444    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
445    #[allow(deprecated)]
446    #[doc(alias = "gtk_tree_view_column_get_alignment")]
447    #[doc(alias = "get_alignment")]
448    pub fn alignment(&self) -> f32 {
449        unsafe { ffi::gtk_tree_view_column_get_alignment(self.to_glib_none().0) }
450    }
451
452    /// Returns the button used in the treeview column header
453    ///
454    /// # Deprecated since 4.10
455    ///
456    /// Use GtkColumnView instead
457    ///
458    /// # Returns
459    ///
460    /// The button for the column header.
461    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
462    #[allow(deprecated)]
463    #[doc(alias = "gtk_tree_view_column_get_button")]
464    #[doc(alias = "get_button")]
465    pub fn button(&self) -> Widget {
466        unsafe { from_glib_none(ffi::gtk_tree_view_column_get_button(self.to_glib_none().0)) }
467    }
468
469    /// Returns [`true`] if the user can click on the header for the column.
470    ///
471    /// # Deprecated since 4.10
472    ///
473    /// Use GtkColumnView instead
474    ///
475    /// # Returns
476    ///
477    /// [`true`] if user can click the column header.
478    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
479    #[allow(deprecated)]
480    #[doc(alias = "gtk_tree_view_column_get_clickable")]
481    #[doc(alias = "get_clickable")]
482    #[doc(alias = "clickable")]
483    pub fn is_clickable(&self) -> bool {
484        unsafe {
485            from_glib(ffi::gtk_tree_view_column_get_clickable(
486                self.to_glib_none().0,
487            ))
488        }
489    }
490
491    /// Returns [`true`] if the column expands to fill available space.
492    ///
493    /// # Deprecated since 4.10
494    ///
495    /// Use GtkColumnView instead
496    ///
497    /// # Returns
498    ///
499    /// [`true`] if the column expands to fill available space.
500    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
501    #[allow(deprecated)]
502    #[doc(alias = "gtk_tree_view_column_get_expand")]
503    #[doc(alias = "get_expand")]
504    #[doc(alias = "expand")]
505    pub fn expands(&self) -> bool {
506        unsafe { from_glib(ffi::gtk_tree_view_column_get_expand(self.to_glib_none().0)) }
507    }
508
509    /// Gets the fixed width of the column.  This may not be the actual displayed
510    /// width of the column; for that, use gtk_tree_view_column_get_width().
511    ///
512    /// # Deprecated since 4.10
513    ///
514    /// Use GtkColumnView instead
515    ///
516    /// # Returns
517    ///
518    /// The fixed width of the column.
519    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
520    #[allow(deprecated)]
521    #[doc(alias = "gtk_tree_view_column_get_fixed_width")]
522    #[doc(alias = "get_fixed_width")]
523    #[doc(alias = "fixed-width")]
524    pub fn fixed_width(&self) -> i32 {
525        unsafe { ffi::gtk_tree_view_column_get_fixed_width(self.to_glib_none().0) }
526    }
527
528    /// Returns the maximum width in pixels of the @self, or -1 if no maximum
529    /// width is set.
530    ///
531    /// # Deprecated since 4.10
532    ///
533    /// Use GtkColumnView instead
534    ///
535    /// # Returns
536    ///
537    /// The maximum width of the @self.
538    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
539    #[allow(deprecated)]
540    #[doc(alias = "gtk_tree_view_column_get_max_width")]
541    #[doc(alias = "get_max_width")]
542    #[doc(alias = "max-width")]
543    pub fn max_width(&self) -> i32 {
544        unsafe { ffi::gtk_tree_view_column_get_max_width(self.to_glib_none().0) }
545    }
546
547    /// Returns the minimum width in pixels of the @self, or -1 if no minimum
548    /// width is set.
549    ///
550    /// # Deprecated since 4.10
551    ///
552    /// Use GtkColumnView instead
553    ///
554    /// # Returns
555    ///
556    /// The minimum width of the @self.
557    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
558    #[allow(deprecated)]
559    #[doc(alias = "gtk_tree_view_column_get_min_width")]
560    #[doc(alias = "get_min_width")]
561    #[doc(alias = "min-width")]
562    pub fn min_width(&self) -> i32 {
563        unsafe { ffi::gtk_tree_view_column_get_min_width(self.to_glib_none().0) }
564    }
565
566    /// Returns [`true`] if the @self can be reordered by the user.
567    ///
568    /// # Deprecated since 4.10
569    ///
570    /// Use GtkColumnView instead
571    ///
572    /// # Returns
573    ///
574    /// [`true`] if the @self can be reordered by the user.
575    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
576    #[allow(deprecated)]
577    #[doc(alias = "gtk_tree_view_column_get_reorderable")]
578    #[doc(alias = "get_reorderable")]
579    #[doc(alias = "reorderable")]
580    pub fn is_reorderable(&self) -> bool {
581        unsafe {
582            from_glib(ffi::gtk_tree_view_column_get_reorderable(
583                self.to_glib_none().0,
584            ))
585        }
586    }
587
588    /// Returns [`true`] if the @self can be resized by the end user.
589    ///
590    /// # Deprecated since 4.10
591    ///
592    /// Use GtkColumnView instead
593    ///
594    /// # Returns
595    ///
596    /// [`true`], if the @self can be resized.
597    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
598    #[allow(deprecated)]
599    #[doc(alias = "gtk_tree_view_column_get_resizable")]
600    #[doc(alias = "get_resizable")]
601    #[doc(alias = "resizable")]
602    pub fn is_resizable(&self) -> bool {
603        unsafe {
604            from_glib(ffi::gtk_tree_view_column_get_resizable(
605                self.to_glib_none().0,
606            ))
607        }
608    }
609
610    /// Returns the current type of @self.
611    ///
612    /// # Deprecated since 4.10
613    ///
614    /// Use GtkColumnView instead
615    ///
616    /// # Returns
617    ///
618    /// The type of @self.
619    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
620    #[allow(deprecated)]
621    #[doc(alias = "gtk_tree_view_column_get_sizing")]
622    #[doc(alias = "get_sizing")]
623    pub fn sizing(&self) -> TreeViewColumnSizing {
624        unsafe { from_glib(ffi::gtk_tree_view_column_get_sizing(self.to_glib_none().0)) }
625    }
626
627    /// Gets the logical @sort_column_id that the model sorts on
628    /// when this column is selected for sorting.
629    ///
630    /// See [`set_sort_column_id()`][Self::set_sort_column_id()].
631    ///
632    /// # Deprecated since 4.10
633    ///
634    /// Use GtkColumnView instead
635    ///
636    /// # Returns
637    ///
638    /// t be used for sorting
639    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
640    #[allow(deprecated)]
641    #[doc(alias = "gtk_tree_view_column_get_sort_column_id")]
642    #[doc(alias = "get_sort_column_id")]
643    #[doc(alias = "sort-column-id")]
644    pub fn sort_column_id(&self) -> i32 {
645        unsafe { ffi::gtk_tree_view_column_get_sort_column_id(self.to_glib_none().0) }
646    }
647
648    /// Gets the value set by gtk_tree_view_column_set_sort_indicator().
649    ///
650    /// # Deprecated since 4.10
651    ///
652    /// Use GtkColumnView instead
653    ///
654    /// # Returns
655    ///
656    /// whether the sort indicator arrow is displayed
657    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
658    #[allow(deprecated)]
659    #[doc(alias = "gtk_tree_view_column_get_sort_indicator")]
660    #[doc(alias = "get_sort_indicator")]
661    #[doc(alias = "sort-indicator")]
662    pub fn is_sort_indicator(&self) -> bool {
663        unsafe {
664            from_glib(ffi::gtk_tree_view_column_get_sort_indicator(
665                self.to_glib_none().0,
666            ))
667        }
668    }
669
670    /// Gets the value set by gtk_tree_view_column_set_sort_order().
671    ///
672    /// # Deprecated since 4.10
673    ///
674    /// Use GtkColumnView instead
675    ///
676    /// # Returns
677    ///
678    /// the sort order the sort indicator is indicating
679    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
680    #[allow(deprecated)]
681    #[doc(alias = "gtk_tree_view_column_get_sort_order")]
682    #[doc(alias = "get_sort_order")]
683    #[doc(alias = "sort-order")]
684    pub fn sort_order(&self) -> SortType {
685        unsafe {
686            from_glib(ffi::gtk_tree_view_column_get_sort_order(
687                self.to_glib_none().0,
688            ))
689        }
690    }
691
692    /// Returns the spacing of @self.
693    ///
694    /// # Deprecated since 4.10
695    ///
696    /// Use GtkColumnView instead
697    ///
698    /// # Returns
699    ///
700    /// the spacing of @self.
701    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
702    #[allow(deprecated)]
703    #[doc(alias = "gtk_tree_view_column_get_spacing")]
704    #[doc(alias = "get_spacing")]
705    pub fn spacing(&self) -> i32 {
706        unsafe { ffi::gtk_tree_view_column_get_spacing(self.to_glib_none().0) }
707    }
708
709    /// Returns the title of the widget.
710    ///
711    /// # Deprecated since 4.10
712    ///
713    /// Use GtkColumnView instead
714    ///
715    /// # Returns
716    ///
717    /// the title of the column. This string should not be
718    /// modified or freed.
719    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
720    #[allow(deprecated)]
721    #[doc(alias = "gtk_tree_view_column_get_title")]
722    #[doc(alias = "get_title")]
723    pub fn title(&self) -> glib::GString {
724        unsafe { from_glib_none(ffi::gtk_tree_view_column_get_title(self.to_glib_none().0)) }
725    }
726
727    /// Returns the [`TreeView`][crate::TreeView] wherein @self has been inserted.
728    /// If @column is currently not inserted in any tree view, [`None`] is
729    /// returned.
730    ///
731    /// # Deprecated since 4.10
732    ///
733    /// Use GtkColumnView instead
734    ///
735    /// # Returns
736    ///
737    /// The tree view wherein @column
738    ///   has been inserted
739    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
740    #[allow(deprecated)]
741    #[doc(alias = "gtk_tree_view_column_get_tree_view")]
742    #[doc(alias = "get_tree_view")]
743    pub fn tree_view(&self) -> Option<Widget> {
744        unsafe {
745            from_glib_none(ffi::gtk_tree_view_column_get_tree_view(
746                self.to_glib_none().0,
747            ))
748        }
749    }
750
751    /// Returns [`true`] if @self is visible.
752    ///
753    /// # Deprecated since 4.10
754    ///
755    /// Use GtkColumnView instead
756    ///
757    /// # Returns
758    ///
759    /// whether the column is visible or not.  If it is visible, then
760    /// the tree will show the column.
761    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
762    #[allow(deprecated)]
763    #[doc(alias = "gtk_tree_view_column_get_visible")]
764    #[doc(alias = "get_visible")]
765    #[doc(alias = "visible")]
766    pub fn is_visible(&self) -> bool {
767        unsafe { from_glib(ffi::gtk_tree_view_column_get_visible(self.to_glib_none().0)) }
768    }
769
770    /// Returns the [`Widget`][crate::Widget] in the button on the column header.
771    ///
772    /// If a custom widget has not been set then [`None`] is returned.
773    ///
774    /// # Deprecated since 4.10
775    ///
776    /// Use GtkColumnView instead
777    ///
778    /// # Returns
779    ///
780    /// The [`Widget`][crate::Widget] in the column header
781    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
782    #[allow(deprecated)]
783    #[doc(alias = "gtk_tree_view_column_get_widget")]
784    #[doc(alias = "get_widget")]
785    pub fn widget(&self) -> Option<Widget> {
786        unsafe { from_glib_none(ffi::gtk_tree_view_column_get_widget(self.to_glib_none().0)) }
787    }
788
789    /// Returns the current size of @self in pixels.
790    ///
791    /// # Deprecated since 4.10
792    ///
793    /// Use GtkColumnView instead
794    ///
795    /// # Returns
796    ///
797    /// The current width of @self.
798    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
799    #[allow(deprecated)]
800    #[doc(alias = "gtk_tree_view_column_get_width")]
801    #[doc(alias = "get_width")]
802    pub fn width(&self) -> i32 {
803        unsafe { ffi::gtk_tree_view_column_get_width(self.to_glib_none().0) }
804    }
805
806    /// Returns the current X offset of @self in pixels.
807    ///
808    /// # Deprecated since 4.10
809    ///
810    /// Use GtkColumnView instead
811    ///
812    /// # Returns
813    ///
814    /// The current X offset of @self.
815    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
816    #[allow(deprecated)]
817    #[doc(alias = "gtk_tree_view_column_get_x_offset")]
818    #[doc(alias = "get_x_offset")]
819    #[doc(alias = "x-offset")]
820    pub fn x_offset(&self) -> i32 {
821        unsafe { ffi::gtk_tree_view_column_get_x_offset(self.to_glib_none().0) }
822    }
823
824    /// Adds the @cell to end of the column. If @expand is [`false`], then the @cell
825    /// is allocated no more space than it needs. Any unused space is divided
826    /// evenly between cells for which @expand is [`true`].
827    ///
828    /// # Deprecated since 4.10
829    ///
830    /// Use GtkColumnView instead
831    /// ## `cell`
832    /// The [`CellRenderer`][crate::CellRenderer]
833    /// ## `expand`
834    /// [`true`] if @cell is to be given extra space allocated to @self.
835    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
836    #[allow(deprecated)]
837    #[doc(alias = "gtk_tree_view_column_pack_end")]
838    pub fn pack_end(&self, cell: &impl IsA<CellRenderer>, expand: bool) {
839        unsafe {
840            ffi::gtk_tree_view_column_pack_end(
841                self.to_glib_none().0,
842                cell.as_ref().to_glib_none().0,
843                expand.into_glib(),
844            );
845        }
846    }
847
848    /// Packs the @cell into the beginning of the column. If @expand is [`false`], then
849    /// the @cell is allocated no more space than it needs. Any unused space is divided
850    /// evenly between cells for which @expand is [`true`].
851    ///
852    /// # Deprecated since 4.10
853    ///
854    /// Use GtkColumnView instead
855    /// ## `cell`
856    /// The [`CellRenderer`][crate::CellRenderer]
857    /// ## `expand`
858    /// [`true`] if @cell is to be given extra space allocated to @self.
859    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
860    #[allow(deprecated)]
861    #[doc(alias = "gtk_tree_view_column_pack_start")]
862    pub fn pack_start(&self, cell: &impl IsA<CellRenderer>, expand: bool) {
863        unsafe {
864            ffi::gtk_tree_view_column_pack_start(
865                self.to_glib_none().0,
866                cell.as_ref().to_glib_none().0,
867                expand.into_glib(),
868            );
869        }
870    }
871
872    /// Flags the column, and the cell renderers added to this column, to have
873    /// their sizes renegotiated.
874    ///
875    /// # Deprecated since 4.10
876    ///
877    /// Use GtkColumnView instead
878    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
879    #[allow(deprecated)]
880    #[doc(alias = "gtk_tree_view_column_queue_resize")]
881    pub fn queue_resize(&self) {
882        unsafe {
883            ffi::gtk_tree_view_column_queue_resize(self.to_glib_none().0);
884        }
885    }
886
887    /// Sets the alignment of the title or custom widget inside the column header.
888    /// The alignment determines its location inside the button -- 0.0 for left, 0.5
889    /// for center, 1.0 for right.
890    ///
891    /// # Deprecated since 4.10
892    ///
893    /// Use GtkColumnView instead
894    /// ## `xalign`
895    /// The alignment, which is between [0.0 and 1.0] inclusive.
896    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
897    #[allow(deprecated)]
898    #[doc(alias = "gtk_tree_view_column_set_alignment")]
899    #[doc(alias = "alignment")]
900    pub fn set_alignment(&self, xalign: f32) {
901        unsafe {
902            ffi::gtk_tree_view_column_set_alignment(self.to_glib_none().0, xalign);
903        }
904    }
905
906    /// Sets the `GtkTreeCellDataFunc` to use for the column.
907    ///
908    /// This
909    /// function is used instead of the standard attributes mapping for
910    /// setting the column value, and should set the value of @self's
911    /// cell renderer as appropriate.  @func may be [`None`] to remove an
912    /// older one.
913    ///
914    /// # Deprecated since 4.10
915    ///
916    /// Use GtkColumnView instead
917    /// ## `cell_renderer`
918    /// A [`CellRenderer`][crate::CellRenderer]
919    /// ## `func`
920    /// The `GtkTreeCellDataFunc` to use.
921    /// ## `func_data`
922    /// The user data for @func.
923    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
924    #[allow(deprecated)]
925    #[doc(alias = "gtk_tree_view_column_set_cell_data_func")]
926    pub fn set_cell_data_func<
927        P: Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static,
928    >(
929        &self,
930        cell_renderer: &impl IsA<CellRenderer>,
931        func: P,
932    ) {
933        let func_data: Box_<P> = Box_::new(func);
934        unsafe extern "C" fn func_func<
935            P: Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static,
936        >(
937            tree_column: *mut ffi::GtkTreeViewColumn,
938            cell: *mut ffi::GtkCellRenderer,
939            tree_model: *mut ffi::GtkTreeModel,
940            iter: *mut ffi::GtkTreeIter,
941            data: glib::ffi::gpointer,
942        ) {
943            unsafe {
944                let tree_column = from_glib_borrow(tree_column);
945                let cell = from_glib_borrow(cell);
946                let tree_model = from_glib_borrow(tree_model);
947                let iter = from_glib_borrow(iter);
948                let callback = &*(data as *mut P);
949                (*callback)(&tree_column, &cell, &tree_model, &iter)
950            }
951        }
952        let func = Some(func_func::<P> as _);
953        unsafe extern "C" fn destroy_func<
954            P: Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static,
955        >(
956            data: glib::ffi::gpointer,
957        ) {
958            unsafe {
959                let _callback = Box_::from_raw(data as *mut P);
960            }
961        }
962        let destroy_call4 = Some(destroy_func::<P> as _);
963        let super_callback0: Box_<P> = func_data;
964        unsafe {
965            ffi::gtk_tree_view_column_set_cell_data_func(
966                self.to_glib_none().0,
967                cell_renderer.as_ref().to_glib_none().0,
968                func,
969                Box_::into_raw(super_callback0) as *mut _,
970                destroy_call4,
971            );
972        }
973    }
974
975    /// Sets the header to be active if @clickable is [`true`].  When the header is
976    /// active, then it can take keyboard focus, and can be clicked.
977    ///
978    /// # Deprecated since 4.10
979    ///
980    /// Use GtkColumnView instead
981    /// ## `clickable`
982    /// [`true`] if the header is active.
983    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
984    #[allow(deprecated)]
985    #[doc(alias = "gtk_tree_view_column_set_clickable")]
986    #[doc(alias = "clickable")]
987    pub fn set_clickable(&self, clickable: bool) {
988        unsafe {
989            ffi::gtk_tree_view_column_set_clickable(self.to_glib_none().0, clickable.into_glib());
990        }
991    }
992
993    ///  property changes when the column is
994    /// resized by the user.
995    ///
996    /// # Deprecated since 4.10
997    ///
998    /// Use GtkColumnView instead
999    /// ## `expand`
1000    /// [`true`] if the column should expand to fill available space.
1001    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1002    #[allow(deprecated)]
1003    #[doc(alias = "gtk_tree_view_column_set_expand")]
1004    #[doc(alias = "expand")]
1005    pub fn set_expand(&self, expand: bool) {
1006        unsafe {
1007            ffi::gtk_tree_view_column_set_expand(self.to_glib_none().0, expand.into_glib());
1008        }
1009    }
1010
1011    ///  property changes when the column is
1012    /// resized by the user.
1013    ///
1014    /// # Deprecated since 4.10
1015    ///
1016    /// Use GtkColumnView instead
1017    /// ## `fixed_width`
1018    /// The new fixed width, in pixels, or -1.
1019    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1020    #[allow(deprecated)]
1021    #[doc(alias = "gtk_tree_view_column_set_fixed_width")]
1022    #[doc(alias = "fixed-width")]
1023    pub fn set_fixed_width(&self, fixed_width: i32) {
1024        unsafe {
1025            ffi::gtk_tree_view_column_set_fixed_width(self.to_glib_none().0, fixed_width);
1026        }
1027    }
1028
1029    /// s the last column in a view.  In this case, the column expands to
1030    /// fill any extra space.
1031    ///
1032    /// # Deprecated since 4.10
1033    ///
1034    /// Use GtkColumnView instead
1035    /// ## `max_width`
1036    /// The maximum width of the column in pixels, or -1.
1037    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1038    #[allow(deprecated)]
1039    #[doc(alias = "gtk_tree_view_column_set_max_width")]
1040    #[doc(alias = "max-width")]
1041    pub fn set_max_width(&self, max_width: i32) {
1042        unsafe {
1043            ffi::gtk_tree_view_column_set_max_width(self.to_glib_none().0, max_width);
1044        }
1045    }
1046
1047    /// Sets the minimum width of the @self.  If @min_width is -1, then the
1048    /// minimum width is unset.
1049    ///
1050    /// # Deprecated since 4.10
1051    ///
1052    /// Use GtkColumnView instead
1053    /// ## `min_width`
1054    /// The minimum width of the column in pixels, or -1.
1055    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1056    #[allow(deprecated)]
1057    #[doc(alias = "gtk_tree_view_column_set_min_width")]
1058    #[doc(alias = "min-width")]
1059    pub fn set_min_width(&self, min_width: i32) {
1060        unsafe {
1061            ffi::gtk_tree_view_column_set_min_width(self.to_glib_none().0, min_width);
1062        }
1063    }
1064
1065    /// If @reorderable is [`true`], then the column can be reordered by the end user
1066    /// dragging the header.
1067    ///
1068    /// # Deprecated since 4.10
1069    ///
1070    /// Use GtkColumnView instead
1071    /// ## `reorderable`
1072    /// [`true`], if the column can be reordered.
1073    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1074    #[allow(deprecated)]
1075    #[doc(alias = "gtk_tree_view_column_set_reorderable")]
1076    #[doc(alias = "reorderable")]
1077    pub fn set_reorderable(&self, reorderable: bool) {
1078        unsafe {
1079            ffi::gtk_tree_view_column_set_reorderable(
1080                self.to_glib_none().0,
1081                reorderable.into_glib(),
1082            );
1083        }
1084    }
1085
1086    /// If @resizable is [`true`], then the user can explicitly resize the column by
1087    /// grabbing the outer edge of the column button.
1088    ///
1089    /// If resizable is [`true`] and
1090    /// sizing mode of the column is [`TreeViewColumnSizing::Autosize`][crate::TreeViewColumnSizing::Autosize], then the sizing
1091    /// mode is changed to [`TreeViewColumnSizing::GrowOnly`][crate::TreeViewColumnSizing::GrowOnly].
1092    ///
1093    /// # Deprecated since 4.10
1094    ///
1095    /// Use GtkColumnView instead
1096    /// ## `resizable`
1097    /// [`true`], if the column can be resized
1098    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1099    #[allow(deprecated)]
1100    #[doc(alias = "gtk_tree_view_column_set_resizable")]
1101    #[doc(alias = "resizable")]
1102    pub fn set_resizable(&self, resizable: bool) {
1103        unsafe {
1104            ffi::gtk_tree_view_column_set_resizable(self.to_glib_none().0, resizable.into_glib());
1105        }
1106    }
1107
1108    /// Sets the growth behavior of @self to @type_.
1109    ///
1110    /// # Deprecated since 4.10
1111    ///
1112    /// Use GtkColumnView instead
1113    /// ## `type_`
1114    /// The [`TreeViewColumn`][crate::TreeViewColumn]Sizing.
1115    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1116    #[allow(deprecated)]
1117    #[doc(alias = "gtk_tree_view_column_set_sizing")]
1118    #[doc(alias = "sizing")]
1119    pub fn set_sizing(&self, type_: TreeViewColumnSizing) {
1120        unsafe {
1121            ffi::gtk_tree_view_column_set_sizing(self.to_glib_none().0, type_.into_glib());
1122        }
1123    }
1124
1125    /// Sets the logical @sort_column_id that this column sorts on when this column
1126    /// is selected for sorting.  Doing so makes the column header clickable.
1127    ///
1128    /// # Deprecated since 4.10
1129    ///
1130    /// Use GtkColumnView instead
1131    /// ## `sort_column_id`
1132    /// The @sort_column_id of the model to sort on.
1133    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1134    #[allow(deprecated)]
1135    #[doc(alias = "gtk_tree_view_column_set_sort_column_id")]
1136    #[doc(alias = "sort-column-id")]
1137    pub fn set_sort_column_id(&self, sort_column_id: i32) {
1138        unsafe {
1139            ffi::gtk_tree_view_column_set_sort_column_id(self.to_glib_none().0, sort_column_id);
1140        }
1141    }
1142
1143    /// Call this function with a @setting of [`true`] to display an arrow in
1144    /// the header button indicating the column is sorted. Call
1145    /// gtk_tree_view_column_set_sort_order() to change the direction of
1146    /// the arrow.
1147    ///
1148    /// # Deprecated since 4.10
1149    ///
1150    /// Use GtkColumnView instead
1151    /// ## `setting`
1152    /// [`true`] to display an indicator that the column is sorted
1153    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1154    #[allow(deprecated)]
1155    #[doc(alias = "gtk_tree_view_column_set_sort_indicator")]
1156    #[doc(alias = "sort-indicator")]
1157    pub fn set_sort_indicator(&self, setting: bool) {
1158        unsafe {
1159            ffi::gtk_tree_view_column_set_sort_indicator(
1160                self.to_glib_none().0,
1161                setting.into_glib(),
1162            );
1163        }
1164    }
1165
1166    /// Changes the appearance of the sort indicator.
1167    ///
1168    /// This does not actually sort the model.  Use
1169    /// gtk_tree_view_column_set_sort_column_id() if you want automatic sorting
1170    /// support.  This function is primarily for custom sorting behavior, and should
1171    /// be used in conjunction with gtk_tree_sortable_set_sort_column_id() to do
1172    /// that. For custom models, the mechanism will vary.
1173    ///
1174    /// The sort indicator changes direction to indicate normal sort or reverse sort.
1175    /// Note that you must have the sort indicator enabled to see anything when
1176    /// calling this function; see gtk_tree_view_column_set_sort_indicator().
1177    ///
1178    /// # Deprecated since 4.10
1179    ///
1180    /// Use GtkColumnView instead
1181    /// ## `order`
1182    /// sort order that the sort indicator should indicate
1183    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1184    #[allow(deprecated)]
1185    #[doc(alias = "gtk_tree_view_column_set_sort_order")]
1186    #[doc(alias = "sort-order")]
1187    pub fn set_sort_order(&self, order: SortType) {
1188        unsafe {
1189            ffi::gtk_tree_view_column_set_sort_order(self.to_glib_none().0, order.into_glib());
1190        }
1191    }
1192
1193    /// Sets the spacing field of @self, which is the number of pixels to
1194    /// place between cell renderers packed into it.
1195    ///
1196    /// # Deprecated since 4.10
1197    ///
1198    /// Use GtkColumnView instead
1199    /// ## `spacing`
1200    /// distance between cell renderers in pixels.
1201    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1202    #[allow(deprecated)]
1203    #[doc(alias = "gtk_tree_view_column_set_spacing")]
1204    #[doc(alias = "spacing")]
1205    pub fn set_spacing(&self, spacing: i32) {
1206        unsafe {
1207            ffi::gtk_tree_view_column_set_spacing(self.to_glib_none().0, spacing);
1208        }
1209    }
1210
1211    /// Sets the title of the @self.  If a custom widget has been set, then
1212    /// this value is ignored.
1213    ///
1214    /// # Deprecated since 4.10
1215    ///
1216    /// Use GtkColumnView instead
1217    /// ## `title`
1218    /// The title of the @self.
1219    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1220    #[allow(deprecated)]
1221    #[doc(alias = "gtk_tree_view_column_set_title")]
1222    #[doc(alias = "title")]
1223    pub fn set_title(&self, title: &str) {
1224        unsafe {
1225            ffi::gtk_tree_view_column_set_title(self.to_glib_none().0, title.to_glib_none().0);
1226        }
1227    }
1228
1229    /// Sets the visibility of @self.
1230    ///
1231    /// # Deprecated since 4.10
1232    ///
1233    /// Use GtkColumnView instead
1234    /// ## `visible`
1235    /// [`true`] if the @self is visible.
1236    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1237    #[allow(deprecated)]
1238    #[doc(alias = "gtk_tree_view_column_set_visible")]
1239    #[doc(alias = "visible")]
1240    pub fn set_visible(&self, visible: bool) {
1241        unsafe {
1242            ffi::gtk_tree_view_column_set_visible(self.to_glib_none().0, visible.into_glib());
1243        }
1244    }
1245
1246    /// Sets the widget in the header to be @widget.  If widget is [`None`], then the
1247    /// header button is set with a [`Label`][crate::Label] set to the title of @self.
1248    ///
1249    /// # Deprecated since 4.10
1250    ///
1251    /// Use GtkColumnView instead
1252    /// ## `widget`
1253    /// A child [`Widget`][crate::Widget]
1254    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1255    #[allow(deprecated)]
1256    #[doc(alias = "gtk_tree_view_column_set_widget")]
1257    #[doc(alias = "widget")]
1258    pub fn set_widget(&self, widget: Option<&impl IsA<Widget>>) {
1259        unsafe {
1260            ffi::gtk_tree_view_column_set_widget(
1261                self.to_glib_none().0,
1262                widget.map(|p| p.as_ref()).to_glib_none().0,
1263            );
1264        }
1265    }
1266
1267    /// The [`CellArea`][crate::CellArea] used to layout cell renderers for this column.
1268    ///
1269    /// If no area is specified when creating the tree view column with gtk_tree_view_column_new_with_area()
1270    /// a horizontally oriented [`CellAreaBox`][crate::CellAreaBox] will be used.
1271    #[doc(alias = "cell-area")]
1272    pub fn cell_area(&self) -> Option<CellArea> {
1273        ObjectExt::property(self, "cell-area")
1274    }
1275
1276    /// Emitted when the column's header has been clicked.
1277    #[doc(alias = "clicked")]
1278    pub fn connect_clicked<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1279        unsafe extern "C" fn clicked_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1280            this: *mut ffi::GtkTreeViewColumn,
1281            f: glib::ffi::gpointer,
1282        ) {
1283            unsafe {
1284                let f: &F = &*(f as *const F);
1285                f(&from_glib_borrow(this))
1286            }
1287        }
1288        unsafe {
1289            let f: Box_<F> = Box_::new(f);
1290            connect_raw(
1291                self.as_ptr() as *mut _,
1292                c"clicked".as_ptr(),
1293                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1294                    clicked_trampoline::<F> as *const (),
1295                )),
1296                Box_::into_raw(f),
1297            )
1298        }
1299    }
1300
1301    #[doc(alias = "alignment")]
1302    pub fn connect_alignment_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1303        unsafe extern "C" fn notify_alignment_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1304            this: *mut ffi::GtkTreeViewColumn,
1305            _param_spec: glib::ffi::gpointer,
1306            f: glib::ffi::gpointer,
1307        ) {
1308            unsafe {
1309                let f: &F = &*(f as *const F);
1310                f(&from_glib_borrow(this))
1311            }
1312        }
1313        unsafe {
1314            let f: Box_<F> = Box_::new(f);
1315            connect_raw(
1316                self.as_ptr() as *mut _,
1317                c"notify::alignment".as_ptr(),
1318                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1319                    notify_alignment_trampoline::<F> as *const (),
1320                )),
1321                Box_::into_raw(f),
1322            )
1323        }
1324    }
1325
1326    #[doc(alias = "clickable")]
1327    pub fn connect_clickable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1328        unsafe extern "C" fn notify_clickable_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1329            this: *mut ffi::GtkTreeViewColumn,
1330            _param_spec: glib::ffi::gpointer,
1331            f: glib::ffi::gpointer,
1332        ) {
1333            unsafe {
1334                let f: &F = &*(f as *const F);
1335                f(&from_glib_borrow(this))
1336            }
1337        }
1338        unsafe {
1339            let f: Box_<F> = Box_::new(f);
1340            connect_raw(
1341                self.as_ptr() as *mut _,
1342                c"notify::clickable".as_ptr(),
1343                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1344                    notify_clickable_trampoline::<F> as *const (),
1345                )),
1346                Box_::into_raw(f),
1347            )
1348        }
1349    }
1350
1351    #[doc(alias = "expand")]
1352    pub fn connect_expand_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1353        unsafe extern "C" fn notify_expand_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1354            this: *mut ffi::GtkTreeViewColumn,
1355            _param_spec: glib::ffi::gpointer,
1356            f: glib::ffi::gpointer,
1357        ) {
1358            unsafe {
1359                let f: &F = &*(f as *const F);
1360                f(&from_glib_borrow(this))
1361            }
1362        }
1363        unsafe {
1364            let f: Box_<F> = Box_::new(f);
1365            connect_raw(
1366                self.as_ptr() as *mut _,
1367                c"notify::expand".as_ptr(),
1368                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1369                    notify_expand_trampoline::<F> as *const (),
1370                )),
1371                Box_::into_raw(f),
1372            )
1373        }
1374    }
1375
1376    #[doc(alias = "fixed-width")]
1377    pub fn connect_fixed_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1378        unsafe extern "C" fn notify_fixed_width_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1379            this: *mut ffi::GtkTreeViewColumn,
1380            _param_spec: glib::ffi::gpointer,
1381            f: glib::ffi::gpointer,
1382        ) {
1383            unsafe {
1384                let f: &F = &*(f as *const F);
1385                f(&from_glib_borrow(this))
1386            }
1387        }
1388        unsafe {
1389            let f: Box_<F> = Box_::new(f);
1390            connect_raw(
1391                self.as_ptr() as *mut _,
1392                c"notify::fixed-width".as_ptr(),
1393                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1394                    notify_fixed_width_trampoline::<F> as *const (),
1395                )),
1396                Box_::into_raw(f),
1397            )
1398        }
1399    }
1400
1401    #[doc(alias = "max-width")]
1402    pub fn connect_max_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1403        unsafe extern "C" fn notify_max_width_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1404            this: *mut ffi::GtkTreeViewColumn,
1405            _param_spec: glib::ffi::gpointer,
1406            f: glib::ffi::gpointer,
1407        ) {
1408            unsafe {
1409                let f: &F = &*(f as *const F);
1410                f(&from_glib_borrow(this))
1411            }
1412        }
1413        unsafe {
1414            let f: Box_<F> = Box_::new(f);
1415            connect_raw(
1416                self.as_ptr() as *mut _,
1417                c"notify::max-width".as_ptr(),
1418                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1419                    notify_max_width_trampoline::<F> as *const (),
1420                )),
1421                Box_::into_raw(f),
1422            )
1423        }
1424    }
1425
1426    #[doc(alias = "min-width")]
1427    pub fn connect_min_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1428        unsafe extern "C" fn notify_min_width_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1429            this: *mut ffi::GtkTreeViewColumn,
1430            _param_spec: glib::ffi::gpointer,
1431            f: glib::ffi::gpointer,
1432        ) {
1433            unsafe {
1434                let f: &F = &*(f as *const F);
1435                f(&from_glib_borrow(this))
1436            }
1437        }
1438        unsafe {
1439            let f: Box_<F> = Box_::new(f);
1440            connect_raw(
1441                self.as_ptr() as *mut _,
1442                c"notify::min-width".as_ptr(),
1443                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1444                    notify_min_width_trampoline::<F> as *const (),
1445                )),
1446                Box_::into_raw(f),
1447            )
1448        }
1449    }
1450
1451    #[doc(alias = "reorderable")]
1452    pub fn connect_reorderable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1453        unsafe extern "C" fn notify_reorderable_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1454            this: *mut ffi::GtkTreeViewColumn,
1455            _param_spec: glib::ffi::gpointer,
1456            f: glib::ffi::gpointer,
1457        ) {
1458            unsafe {
1459                let f: &F = &*(f as *const F);
1460                f(&from_glib_borrow(this))
1461            }
1462        }
1463        unsafe {
1464            let f: Box_<F> = Box_::new(f);
1465            connect_raw(
1466                self.as_ptr() as *mut _,
1467                c"notify::reorderable".as_ptr(),
1468                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1469                    notify_reorderable_trampoline::<F> as *const (),
1470                )),
1471                Box_::into_raw(f),
1472            )
1473        }
1474    }
1475
1476    #[doc(alias = "resizable")]
1477    pub fn connect_resizable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1478        unsafe extern "C" fn notify_resizable_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1479            this: *mut ffi::GtkTreeViewColumn,
1480            _param_spec: glib::ffi::gpointer,
1481            f: glib::ffi::gpointer,
1482        ) {
1483            unsafe {
1484                let f: &F = &*(f as *const F);
1485                f(&from_glib_borrow(this))
1486            }
1487        }
1488        unsafe {
1489            let f: Box_<F> = Box_::new(f);
1490            connect_raw(
1491                self.as_ptr() as *mut _,
1492                c"notify::resizable".as_ptr(),
1493                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1494                    notify_resizable_trampoline::<F> as *const (),
1495                )),
1496                Box_::into_raw(f),
1497            )
1498        }
1499    }
1500
1501    #[doc(alias = "sizing")]
1502    pub fn connect_sizing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1503        unsafe extern "C" fn notify_sizing_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1504            this: *mut ffi::GtkTreeViewColumn,
1505            _param_spec: glib::ffi::gpointer,
1506            f: glib::ffi::gpointer,
1507        ) {
1508            unsafe {
1509                let f: &F = &*(f as *const F);
1510                f(&from_glib_borrow(this))
1511            }
1512        }
1513        unsafe {
1514            let f: Box_<F> = Box_::new(f);
1515            connect_raw(
1516                self.as_ptr() as *mut _,
1517                c"notify::sizing".as_ptr(),
1518                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1519                    notify_sizing_trampoline::<F> as *const (),
1520                )),
1521                Box_::into_raw(f),
1522            )
1523        }
1524    }
1525
1526    #[doc(alias = "sort-column-id")]
1527    pub fn connect_sort_column_id_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1528        unsafe extern "C" fn notify_sort_column_id_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1529            this: *mut ffi::GtkTreeViewColumn,
1530            _param_spec: glib::ffi::gpointer,
1531            f: glib::ffi::gpointer,
1532        ) {
1533            unsafe {
1534                let f: &F = &*(f as *const F);
1535                f(&from_glib_borrow(this))
1536            }
1537        }
1538        unsafe {
1539            let f: Box_<F> = Box_::new(f);
1540            connect_raw(
1541                self.as_ptr() as *mut _,
1542                c"notify::sort-column-id".as_ptr(),
1543                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1544                    notify_sort_column_id_trampoline::<F> as *const (),
1545                )),
1546                Box_::into_raw(f),
1547            )
1548        }
1549    }
1550
1551    #[doc(alias = "sort-indicator")]
1552    pub fn connect_sort_indicator_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1553        unsafe extern "C" fn notify_sort_indicator_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1554            this: *mut ffi::GtkTreeViewColumn,
1555            _param_spec: glib::ffi::gpointer,
1556            f: glib::ffi::gpointer,
1557        ) {
1558            unsafe {
1559                let f: &F = &*(f as *const F);
1560                f(&from_glib_borrow(this))
1561            }
1562        }
1563        unsafe {
1564            let f: Box_<F> = Box_::new(f);
1565            connect_raw(
1566                self.as_ptr() as *mut _,
1567                c"notify::sort-indicator".as_ptr(),
1568                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1569                    notify_sort_indicator_trampoline::<F> as *const (),
1570                )),
1571                Box_::into_raw(f),
1572            )
1573        }
1574    }
1575
1576    #[doc(alias = "sort-order")]
1577    pub fn connect_sort_order_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1578        unsafe extern "C" fn notify_sort_order_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1579            this: *mut ffi::GtkTreeViewColumn,
1580            _param_spec: glib::ffi::gpointer,
1581            f: glib::ffi::gpointer,
1582        ) {
1583            unsafe {
1584                let f: &F = &*(f as *const F);
1585                f(&from_glib_borrow(this))
1586            }
1587        }
1588        unsafe {
1589            let f: Box_<F> = Box_::new(f);
1590            connect_raw(
1591                self.as_ptr() as *mut _,
1592                c"notify::sort-order".as_ptr(),
1593                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1594                    notify_sort_order_trampoline::<F> as *const (),
1595                )),
1596                Box_::into_raw(f),
1597            )
1598        }
1599    }
1600
1601    #[doc(alias = "spacing")]
1602    pub fn connect_spacing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1603        unsafe extern "C" fn notify_spacing_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1604            this: *mut ffi::GtkTreeViewColumn,
1605            _param_spec: glib::ffi::gpointer,
1606            f: glib::ffi::gpointer,
1607        ) {
1608            unsafe {
1609                let f: &F = &*(f as *const F);
1610                f(&from_glib_borrow(this))
1611            }
1612        }
1613        unsafe {
1614            let f: Box_<F> = Box_::new(f);
1615            connect_raw(
1616                self.as_ptr() as *mut _,
1617                c"notify::spacing".as_ptr(),
1618                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1619                    notify_spacing_trampoline::<F> as *const (),
1620                )),
1621                Box_::into_raw(f),
1622            )
1623        }
1624    }
1625
1626    #[doc(alias = "title")]
1627    pub fn connect_title_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1628        unsafe extern "C" fn notify_title_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1629            this: *mut ffi::GtkTreeViewColumn,
1630            _param_spec: glib::ffi::gpointer,
1631            f: glib::ffi::gpointer,
1632        ) {
1633            unsafe {
1634                let f: &F = &*(f as *const F);
1635                f(&from_glib_borrow(this))
1636            }
1637        }
1638        unsafe {
1639            let f: Box_<F> = Box_::new(f);
1640            connect_raw(
1641                self.as_ptr() as *mut _,
1642                c"notify::title".as_ptr(),
1643                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1644                    notify_title_trampoline::<F> as *const (),
1645                )),
1646                Box_::into_raw(f),
1647            )
1648        }
1649    }
1650
1651    #[doc(alias = "visible")]
1652    pub fn connect_visible_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1653        unsafe extern "C" fn notify_visible_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1654            this: *mut ffi::GtkTreeViewColumn,
1655            _param_spec: glib::ffi::gpointer,
1656            f: glib::ffi::gpointer,
1657        ) {
1658            unsafe {
1659                let f: &F = &*(f as *const F);
1660                f(&from_glib_borrow(this))
1661            }
1662        }
1663        unsafe {
1664            let f: Box_<F> = Box_::new(f);
1665            connect_raw(
1666                self.as_ptr() as *mut _,
1667                c"notify::visible".as_ptr(),
1668                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1669                    notify_visible_trampoline::<F> as *const (),
1670                )),
1671                Box_::into_raw(f),
1672            )
1673        }
1674    }
1675
1676    #[doc(alias = "widget")]
1677    pub fn connect_widget_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1678        unsafe extern "C" fn notify_widget_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1679            this: *mut ffi::GtkTreeViewColumn,
1680            _param_spec: glib::ffi::gpointer,
1681            f: glib::ffi::gpointer,
1682        ) {
1683            unsafe {
1684                let f: &F = &*(f as *const F);
1685                f(&from_glib_borrow(this))
1686            }
1687        }
1688        unsafe {
1689            let f: Box_<F> = Box_::new(f);
1690            connect_raw(
1691                self.as_ptr() as *mut _,
1692                c"notify::widget".as_ptr(),
1693                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1694                    notify_widget_trampoline::<F> as *const (),
1695                )),
1696                Box_::into_raw(f),
1697            )
1698        }
1699    }
1700
1701    #[doc(alias = "width")]
1702    pub fn connect_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1703        unsafe extern "C" fn notify_width_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1704            this: *mut ffi::GtkTreeViewColumn,
1705            _param_spec: glib::ffi::gpointer,
1706            f: glib::ffi::gpointer,
1707        ) {
1708            unsafe {
1709                let f: &F = &*(f as *const F);
1710                f(&from_glib_borrow(this))
1711            }
1712        }
1713        unsafe {
1714            let f: Box_<F> = Box_::new(f);
1715            connect_raw(
1716                self.as_ptr() as *mut _,
1717                c"notify::width".as_ptr(),
1718                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1719                    notify_width_trampoline::<F> as *const (),
1720                )),
1721                Box_::into_raw(f),
1722            )
1723        }
1724    }
1725
1726    #[doc(alias = "x-offset")]
1727    pub fn connect_x_offset_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1728        unsafe extern "C" fn notify_x_offset_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1729            this: *mut ffi::GtkTreeViewColumn,
1730            _param_spec: glib::ffi::gpointer,
1731            f: glib::ffi::gpointer,
1732        ) {
1733            unsafe {
1734                let f: &F = &*(f as *const F);
1735                f(&from_glib_borrow(this))
1736            }
1737        }
1738        unsafe {
1739            let f: Box_<F> = Box_::new(f);
1740            connect_raw(
1741                self.as_ptr() as *mut _,
1742                c"notify::x-offset".as_ptr(),
1743                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1744                    notify_x_offset_trampoline::<F> as *const (),
1745                )),
1746                Box_::into_raw(f),
1747            )
1748        }
1749    }
1750}
1751
1752impl Default for TreeViewColumn {
1753    fn default() -> Self {
1754        Self::new()
1755    }
1756}
1757
1758// rustdoc-stripper-ignore-next
1759/// A [builder-pattern] type to construct [`TreeViewColumn`] objects.
1760///
1761/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
1762#[must_use = "The builder must be built to be used"]
1763pub struct TreeViewColumnBuilder {
1764    builder: glib::object::ObjectBuilder<'static, TreeViewColumn>,
1765}
1766
1767impl TreeViewColumnBuilder {
1768    fn new() -> Self {
1769        Self {
1770            builder: glib::object::Object::builder(),
1771        }
1772    }
1773
1774    pub fn alignment(self, alignment: f32) -> Self {
1775        Self {
1776            builder: self.builder.property("alignment", alignment),
1777        }
1778    }
1779
1780    /// The [`CellArea`][crate::CellArea] used to layout cell renderers for this column.
1781    ///
1782    /// If no area is specified when creating the tree view column with gtk_tree_view_column_new_with_area()
1783    /// a horizontally oriented [`CellAreaBox`][crate::CellAreaBox] will be used.
1784    pub fn cell_area(self, cell_area: &impl IsA<CellArea>) -> Self {
1785        Self {
1786            builder: self
1787                .builder
1788                .property("cell-area", cell_area.clone().upcast()),
1789        }
1790    }
1791
1792    pub fn clickable(self, clickable: bool) -> Self {
1793        Self {
1794            builder: self.builder.property("clickable", clickable),
1795        }
1796    }
1797
1798    pub fn expand(self, expand: bool) -> Self {
1799        Self {
1800            builder: self.builder.property("expand", expand),
1801        }
1802    }
1803
1804    pub fn fixed_width(self, fixed_width: i32) -> Self {
1805        Self {
1806            builder: self.builder.property("fixed-width", fixed_width),
1807        }
1808    }
1809
1810    pub fn max_width(self, max_width: i32) -> Self {
1811        Self {
1812            builder: self.builder.property("max-width", max_width),
1813        }
1814    }
1815
1816    pub fn min_width(self, min_width: i32) -> Self {
1817        Self {
1818            builder: self.builder.property("min-width", min_width),
1819        }
1820    }
1821
1822    pub fn reorderable(self, reorderable: bool) -> Self {
1823        Self {
1824            builder: self.builder.property("reorderable", reorderable),
1825        }
1826    }
1827
1828    pub fn resizable(self, resizable: bool) -> Self {
1829        Self {
1830            builder: self.builder.property("resizable", resizable),
1831        }
1832    }
1833
1834    pub fn sizing(self, sizing: TreeViewColumnSizing) -> Self {
1835        Self {
1836            builder: self.builder.property("sizing", sizing),
1837        }
1838    }
1839
1840    /// Logical sort column ID this column sorts on when selected for sorting. Setting the sort column ID makes the column header
1841    /// clickable. Set to -1 to make the column unsortable.
1842    pub fn sort_column_id(self, sort_column_id: i32) -> Self {
1843        Self {
1844            builder: self.builder.property("sort-column-id", sort_column_id),
1845        }
1846    }
1847
1848    pub fn sort_indicator(self, sort_indicator: bool) -> Self {
1849        Self {
1850            builder: self.builder.property("sort-indicator", sort_indicator),
1851        }
1852    }
1853
1854    pub fn sort_order(self, sort_order: SortType) -> Self {
1855        Self {
1856            builder: self.builder.property("sort-order", sort_order),
1857        }
1858    }
1859
1860    pub fn spacing(self, spacing: i32) -> Self {
1861        Self {
1862            builder: self.builder.property("spacing", spacing),
1863        }
1864    }
1865
1866    pub fn title(self, title: impl Into<glib::GString>) -> Self {
1867        Self {
1868            builder: self.builder.property("title", title.into()),
1869        }
1870    }
1871
1872    pub fn visible(self, visible: bool) -> Self {
1873        Self {
1874            builder: self.builder.property("visible", visible),
1875        }
1876    }
1877
1878    pub fn widget(self, widget: &impl IsA<Widget>) -> Self {
1879        Self {
1880            builder: self.builder.property("widget", widget.clone().upcast()),
1881        }
1882    }
1883
1884    // rustdoc-stripper-ignore-next
1885    /// Build the [`TreeViewColumn`].
1886    #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
1887    pub fn build(self) -> TreeViewColumn {
1888        assert_initialized_main_thread!();
1889        self.builder.build()
1890    }
1891}