1use crate::{
6 ffi, Accessible, AccessibleRole, Adjustment, Align, Buildable, ColumnViewColumn,
7 ConstraintTarget, LayoutManager, Overflow, Scrollable, ScrollablePolicy, SelectionModel,
8 SortType, Sorter, Widget,
9};
10#[cfg(feature = "v4_12")]
11#[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
12use crate::{ListItemFactory, ListScrollFlags, ListTabBehavior, ScrollInfo};
13use glib::{
14 object::ObjectType as _,
15 prelude::*,
16 signal::{connect_raw, SignalHandlerId},
17 translate::*,
18};
19use std::boxed::Box as Box_;
20
21glib::wrapper! {
22 #[doc(alias = "GtkColumnView")]
23 pub struct ColumnView(Object<ffi::GtkColumnView, ffi::GtkColumnViewClass>) @extends Widget, @implements Accessible, Buildable, ConstraintTarget, Scrollable;
24
25 match fn {
26 type_ => || ffi::gtk_column_view_get_type(),
27 }
28}
29
30impl ColumnView {
31 #[doc(alias = "gtk_column_view_new")]
32 pub fn new(model: Option<impl IsA<SelectionModel>>) -> ColumnView {
33 assert_initialized_main_thread!();
34 unsafe {
35 Widget::from_glib_none(ffi::gtk_column_view_new(
36 model.map(|p| p.upcast()).into_glib_ptr(),
37 ))
38 .unsafe_cast()
39 }
40 }
41
42 pub fn builder() -> ColumnViewBuilder {
47 ColumnViewBuilder::new()
48 }
49
50 #[doc(alias = "gtk_column_view_append_column")]
51 pub fn append_column(&self, column: &ColumnViewColumn) {
52 unsafe {
53 ffi::gtk_column_view_append_column(self.to_glib_none().0, column.to_glib_none().0);
54 }
55 }
56
57 #[doc(alias = "gtk_column_view_get_columns")]
58 #[doc(alias = "get_columns")]
59 pub fn columns(&self) -> gio::ListModel {
60 unsafe { from_glib_none(ffi::gtk_column_view_get_columns(self.to_glib_none().0)) }
61 }
62
63 #[doc(alias = "gtk_column_view_get_enable_rubberband")]
64 #[doc(alias = "get_enable_rubberband")]
65 #[doc(alias = "enable-rubberband")]
66 pub fn enables_rubberband(&self) -> bool {
67 unsafe {
68 from_glib(ffi::gtk_column_view_get_enable_rubberband(
69 self.to_glib_none().0,
70 ))
71 }
72 }
73
74 #[cfg(feature = "v4_12")]
75 #[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
76 #[doc(alias = "gtk_column_view_get_header_factory")]
77 #[doc(alias = "get_header_factory")]
78 #[doc(alias = "header-factory")]
79 pub fn header_factory(&self) -> Option<ListItemFactory> {
80 unsafe {
81 from_glib_none(ffi::gtk_column_view_get_header_factory(
82 self.to_glib_none().0,
83 ))
84 }
85 }
86
87 #[doc(alias = "gtk_column_view_get_model")]
88 #[doc(alias = "get_model")]
89 pub fn model(&self) -> Option<SelectionModel> {
90 unsafe { from_glib_none(ffi::gtk_column_view_get_model(self.to_glib_none().0)) }
91 }
92
93 #[doc(alias = "gtk_column_view_get_reorderable")]
94 #[doc(alias = "get_reorderable")]
95 #[doc(alias = "reorderable")]
96 pub fn is_reorderable(&self) -> bool {
97 unsafe { from_glib(ffi::gtk_column_view_get_reorderable(self.to_glib_none().0)) }
98 }
99
100 #[cfg(feature = "v4_12")]
101 #[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
102 #[doc(alias = "gtk_column_view_get_row_factory")]
103 #[doc(alias = "get_row_factory")]
104 #[doc(alias = "row-factory")]
105 pub fn row_factory(&self) -> Option<ListItemFactory> {
106 unsafe { from_glib_none(ffi::gtk_column_view_get_row_factory(self.to_glib_none().0)) }
107 }
108
109 #[doc(alias = "gtk_column_view_get_show_column_separators")]
110 #[doc(alias = "get_show_column_separators")]
111 #[doc(alias = "show-column-separators")]
112 pub fn shows_column_separators(&self) -> bool {
113 unsafe {
114 from_glib(ffi::gtk_column_view_get_show_column_separators(
115 self.to_glib_none().0,
116 ))
117 }
118 }
119
120 #[doc(alias = "gtk_column_view_get_show_row_separators")]
121 #[doc(alias = "get_show_row_separators")]
122 #[doc(alias = "show-row-separators")]
123 pub fn shows_row_separators(&self) -> bool {
124 unsafe {
125 from_glib(ffi::gtk_column_view_get_show_row_separators(
126 self.to_glib_none().0,
127 ))
128 }
129 }
130
131 #[doc(alias = "gtk_column_view_get_single_click_activate")]
132 #[doc(alias = "get_single_click_activate")]
133 #[doc(alias = "single-click-activate")]
134 pub fn is_single_click_activate(&self) -> bool {
135 unsafe {
136 from_glib(ffi::gtk_column_view_get_single_click_activate(
137 self.to_glib_none().0,
138 ))
139 }
140 }
141
142 #[doc(alias = "gtk_column_view_get_sorter")]
143 #[doc(alias = "get_sorter")]
144 pub fn sorter(&self) -> Option<Sorter> {
145 unsafe { from_glib_none(ffi::gtk_column_view_get_sorter(self.to_glib_none().0)) }
146 }
147
148 #[cfg(feature = "v4_12")]
149 #[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
150 #[doc(alias = "gtk_column_view_get_tab_behavior")]
151 #[doc(alias = "get_tab_behavior")]
152 #[doc(alias = "tab-behavior")]
153 pub fn tab_behavior(&self) -> ListTabBehavior {
154 unsafe { from_glib(ffi::gtk_column_view_get_tab_behavior(self.to_glib_none().0)) }
155 }
156
157 #[doc(alias = "gtk_column_view_insert_column")]
158 pub fn insert_column(&self, position: u32, column: &ColumnViewColumn) {
159 unsafe {
160 ffi::gtk_column_view_insert_column(
161 self.to_glib_none().0,
162 position,
163 column.to_glib_none().0,
164 );
165 }
166 }
167
168 #[doc(alias = "gtk_column_view_remove_column")]
169 pub fn remove_column(&self, column: &ColumnViewColumn) {
170 unsafe {
171 ffi::gtk_column_view_remove_column(self.to_glib_none().0, column.to_glib_none().0);
172 }
173 }
174
175 #[cfg(feature = "v4_12")]
176 #[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
177 #[doc(alias = "gtk_column_view_scroll_to")]
178 pub fn scroll_to(
179 &self,
180 pos: u32,
181 column: Option<&ColumnViewColumn>,
182 flags: ListScrollFlags,
183 scroll: Option<ScrollInfo>,
184 ) {
185 unsafe {
186 ffi::gtk_column_view_scroll_to(
187 self.to_glib_none().0,
188 pos,
189 column.to_glib_none().0,
190 flags.into_glib(),
191 scroll.into_glib_ptr(),
192 );
193 }
194 }
195
196 #[doc(alias = "gtk_column_view_set_enable_rubberband")]
197 #[doc(alias = "enable-rubberband")]
198 pub fn set_enable_rubberband(&self, enable_rubberband: bool) {
199 unsafe {
200 ffi::gtk_column_view_set_enable_rubberband(
201 self.to_glib_none().0,
202 enable_rubberband.into_glib(),
203 );
204 }
205 }
206
207 #[cfg(feature = "v4_12")]
208 #[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
209 #[doc(alias = "gtk_column_view_set_header_factory")]
210 #[doc(alias = "header-factory")]
211 pub fn set_header_factory(&self, factory: Option<&impl IsA<ListItemFactory>>) {
212 unsafe {
213 ffi::gtk_column_view_set_header_factory(
214 self.to_glib_none().0,
215 factory.map(|p| p.as_ref()).to_glib_none().0,
216 );
217 }
218 }
219
220 #[doc(alias = "gtk_column_view_set_model")]
221 #[doc(alias = "model")]
222 pub fn set_model(&self, model: Option<&impl IsA<SelectionModel>>) {
223 unsafe {
224 ffi::gtk_column_view_set_model(
225 self.to_glib_none().0,
226 model.map(|p| p.as_ref()).to_glib_none().0,
227 );
228 }
229 }
230
231 #[doc(alias = "gtk_column_view_set_reorderable")]
232 #[doc(alias = "reorderable")]
233 pub fn set_reorderable(&self, reorderable: bool) {
234 unsafe {
235 ffi::gtk_column_view_set_reorderable(self.to_glib_none().0, reorderable.into_glib());
236 }
237 }
238
239 #[cfg(feature = "v4_12")]
240 #[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
241 #[doc(alias = "gtk_column_view_set_row_factory")]
242 #[doc(alias = "row-factory")]
243 pub fn set_row_factory(&self, factory: Option<&impl IsA<ListItemFactory>>) {
244 unsafe {
245 ffi::gtk_column_view_set_row_factory(
246 self.to_glib_none().0,
247 factory.map(|p| p.as_ref()).to_glib_none().0,
248 );
249 }
250 }
251
252 #[doc(alias = "gtk_column_view_set_show_column_separators")]
253 #[doc(alias = "show-column-separators")]
254 pub fn set_show_column_separators(&self, show_column_separators: bool) {
255 unsafe {
256 ffi::gtk_column_view_set_show_column_separators(
257 self.to_glib_none().0,
258 show_column_separators.into_glib(),
259 );
260 }
261 }
262
263 #[doc(alias = "gtk_column_view_set_show_row_separators")]
264 #[doc(alias = "show-row-separators")]
265 pub fn set_show_row_separators(&self, show_row_separators: bool) {
266 unsafe {
267 ffi::gtk_column_view_set_show_row_separators(
268 self.to_glib_none().0,
269 show_row_separators.into_glib(),
270 );
271 }
272 }
273
274 #[doc(alias = "gtk_column_view_set_single_click_activate")]
275 #[doc(alias = "single-click-activate")]
276 pub fn set_single_click_activate(&self, single_click_activate: bool) {
277 unsafe {
278 ffi::gtk_column_view_set_single_click_activate(
279 self.to_glib_none().0,
280 single_click_activate.into_glib(),
281 );
282 }
283 }
284
285 #[cfg(feature = "v4_12")]
286 #[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
287 #[doc(alias = "gtk_column_view_set_tab_behavior")]
288 #[doc(alias = "tab-behavior")]
289 pub fn set_tab_behavior(&self, tab_behavior: ListTabBehavior) {
290 unsafe {
291 ffi::gtk_column_view_set_tab_behavior(self.to_glib_none().0, tab_behavior.into_glib());
292 }
293 }
294
295 #[doc(alias = "gtk_column_view_sort_by_column")]
296 pub fn sort_by_column(&self, column: Option<&ColumnViewColumn>, direction: SortType) {
297 unsafe {
298 ffi::gtk_column_view_sort_by_column(
299 self.to_glib_none().0,
300 column.to_glib_none().0,
301 direction.into_glib(),
302 );
303 }
304 }
305
306 #[doc(alias = "activate")]
307 pub fn connect_activate<F: Fn(&Self, u32) + 'static>(&self, f: F) -> SignalHandlerId {
308 unsafe extern "C" fn activate_trampoline<F: Fn(&ColumnView, u32) + 'static>(
309 this: *mut ffi::GtkColumnView,
310 position: std::ffi::c_uint,
311 f: glib::ffi::gpointer,
312 ) {
313 let f: &F = &*(f as *const F);
314 f(&from_glib_borrow(this), position)
315 }
316 unsafe {
317 let f: Box_<F> = Box_::new(f);
318 connect_raw(
319 self.as_ptr() as *mut _,
320 c"activate".as_ptr() as *const _,
321 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
322 activate_trampoline::<F> as *const (),
323 )),
324 Box_::into_raw(f),
325 )
326 }
327 }
328
329 #[doc(alias = "columns")]
330 pub fn connect_columns_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
331 unsafe extern "C" fn notify_columns_trampoline<F: Fn(&ColumnView) + 'static>(
332 this: *mut ffi::GtkColumnView,
333 _param_spec: glib::ffi::gpointer,
334 f: glib::ffi::gpointer,
335 ) {
336 let f: &F = &*(f as *const F);
337 f(&from_glib_borrow(this))
338 }
339 unsafe {
340 let f: Box_<F> = Box_::new(f);
341 connect_raw(
342 self.as_ptr() as *mut _,
343 c"notify::columns".as_ptr() as *const _,
344 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
345 notify_columns_trampoline::<F> as *const (),
346 )),
347 Box_::into_raw(f),
348 )
349 }
350 }
351
352 #[doc(alias = "enable-rubberband")]
353 pub fn connect_enable_rubberband_notify<F: Fn(&Self) + 'static>(
354 &self,
355 f: F,
356 ) -> SignalHandlerId {
357 unsafe extern "C" fn notify_enable_rubberband_trampoline<F: Fn(&ColumnView) + 'static>(
358 this: *mut ffi::GtkColumnView,
359 _param_spec: glib::ffi::gpointer,
360 f: glib::ffi::gpointer,
361 ) {
362 let f: &F = &*(f as *const F);
363 f(&from_glib_borrow(this))
364 }
365 unsafe {
366 let f: Box_<F> = Box_::new(f);
367 connect_raw(
368 self.as_ptr() as *mut _,
369 c"notify::enable-rubberband".as_ptr() as *const _,
370 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
371 notify_enable_rubberband_trampoline::<F> as *const (),
372 )),
373 Box_::into_raw(f),
374 )
375 }
376 }
377
378 #[cfg(feature = "v4_12")]
379 #[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
380 #[doc(alias = "header-factory")]
381 pub fn connect_header_factory_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
382 unsafe extern "C" fn notify_header_factory_trampoline<F: Fn(&ColumnView) + 'static>(
383 this: *mut ffi::GtkColumnView,
384 _param_spec: glib::ffi::gpointer,
385 f: glib::ffi::gpointer,
386 ) {
387 let f: &F = &*(f as *const F);
388 f(&from_glib_borrow(this))
389 }
390 unsafe {
391 let f: Box_<F> = Box_::new(f);
392 connect_raw(
393 self.as_ptr() as *mut _,
394 c"notify::header-factory".as_ptr() as *const _,
395 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
396 notify_header_factory_trampoline::<F> as *const (),
397 )),
398 Box_::into_raw(f),
399 )
400 }
401 }
402
403 #[doc(alias = "model")]
404 pub fn connect_model_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
405 unsafe extern "C" fn notify_model_trampoline<F: Fn(&ColumnView) + 'static>(
406 this: *mut ffi::GtkColumnView,
407 _param_spec: glib::ffi::gpointer,
408 f: glib::ffi::gpointer,
409 ) {
410 let f: &F = &*(f as *const F);
411 f(&from_glib_borrow(this))
412 }
413 unsafe {
414 let f: Box_<F> = Box_::new(f);
415 connect_raw(
416 self.as_ptr() as *mut _,
417 c"notify::model".as_ptr() as *const _,
418 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
419 notify_model_trampoline::<F> as *const (),
420 )),
421 Box_::into_raw(f),
422 )
423 }
424 }
425
426 #[doc(alias = "reorderable")]
427 pub fn connect_reorderable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
428 unsafe extern "C" fn notify_reorderable_trampoline<F: Fn(&ColumnView) + 'static>(
429 this: *mut ffi::GtkColumnView,
430 _param_spec: glib::ffi::gpointer,
431 f: glib::ffi::gpointer,
432 ) {
433 let f: &F = &*(f as *const F);
434 f(&from_glib_borrow(this))
435 }
436 unsafe {
437 let f: Box_<F> = Box_::new(f);
438 connect_raw(
439 self.as_ptr() as *mut _,
440 c"notify::reorderable".as_ptr() as *const _,
441 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
442 notify_reorderable_trampoline::<F> as *const (),
443 )),
444 Box_::into_raw(f),
445 )
446 }
447 }
448
449 #[cfg(feature = "v4_12")]
450 #[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
451 #[doc(alias = "row-factory")]
452 pub fn connect_row_factory_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
453 unsafe extern "C" fn notify_row_factory_trampoline<F: Fn(&ColumnView) + 'static>(
454 this: *mut ffi::GtkColumnView,
455 _param_spec: glib::ffi::gpointer,
456 f: glib::ffi::gpointer,
457 ) {
458 let f: &F = &*(f as *const F);
459 f(&from_glib_borrow(this))
460 }
461 unsafe {
462 let f: Box_<F> = Box_::new(f);
463 connect_raw(
464 self.as_ptr() as *mut _,
465 c"notify::row-factory".as_ptr() as *const _,
466 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
467 notify_row_factory_trampoline::<F> as *const (),
468 )),
469 Box_::into_raw(f),
470 )
471 }
472 }
473
474 #[doc(alias = "show-column-separators")]
475 pub fn connect_show_column_separators_notify<F: Fn(&Self) + 'static>(
476 &self,
477 f: F,
478 ) -> SignalHandlerId {
479 unsafe extern "C" fn notify_show_column_separators_trampoline<
480 F: Fn(&ColumnView) + 'static,
481 >(
482 this: *mut ffi::GtkColumnView,
483 _param_spec: glib::ffi::gpointer,
484 f: glib::ffi::gpointer,
485 ) {
486 let f: &F = &*(f as *const F);
487 f(&from_glib_borrow(this))
488 }
489 unsafe {
490 let f: Box_<F> = Box_::new(f);
491 connect_raw(
492 self.as_ptr() as *mut _,
493 c"notify::show-column-separators".as_ptr() as *const _,
494 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
495 notify_show_column_separators_trampoline::<F> as *const (),
496 )),
497 Box_::into_raw(f),
498 )
499 }
500 }
501
502 #[doc(alias = "show-row-separators")]
503 pub fn connect_show_row_separators_notify<F: Fn(&Self) + 'static>(
504 &self,
505 f: F,
506 ) -> SignalHandlerId {
507 unsafe extern "C" fn notify_show_row_separators_trampoline<F: Fn(&ColumnView) + 'static>(
508 this: *mut ffi::GtkColumnView,
509 _param_spec: glib::ffi::gpointer,
510 f: glib::ffi::gpointer,
511 ) {
512 let f: &F = &*(f as *const F);
513 f(&from_glib_borrow(this))
514 }
515 unsafe {
516 let f: Box_<F> = Box_::new(f);
517 connect_raw(
518 self.as_ptr() as *mut _,
519 c"notify::show-row-separators".as_ptr() as *const _,
520 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
521 notify_show_row_separators_trampoline::<F> as *const (),
522 )),
523 Box_::into_raw(f),
524 )
525 }
526 }
527
528 #[doc(alias = "single-click-activate")]
529 pub fn connect_single_click_activate_notify<F: Fn(&Self) + 'static>(
530 &self,
531 f: F,
532 ) -> SignalHandlerId {
533 unsafe extern "C" fn notify_single_click_activate_trampoline<
534 F: Fn(&ColumnView) + 'static,
535 >(
536 this: *mut ffi::GtkColumnView,
537 _param_spec: glib::ffi::gpointer,
538 f: glib::ffi::gpointer,
539 ) {
540 let f: &F = &*(f as *const F);
541 f(&from_glib_borrow(this))
542 }
543 unsafe {
544 let f: Box_<F> = Box_::new(f);
545 connect_raw(
546 self.as_ptr() as *mut _,
547 c"notify::single-click-activate".as_ptr() as *const _,
548 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
549 notify_single_click_activate_trampoline::<F> as *const (),
550 )),
551 Box_::into_raw(f),
552 )
553 }
554 }
555
556 #[doc(alias = "sorter")]
557 pub fn connect_sorter_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
558 unsafe extern "C" fn notify_sorter_trampoline<F: Fn(&ColumnView) + 'static>(
559 this: *mut ffi::GtkColumnView,
560 _param_spec: glib::ffi::gpointer,
561 f: glib::ffi::gpointer,
562 ) {
563 let f: &F = &*(f as *const F);
564 f(&from_glib_borrow(this))
565 }
566 unsafe {
567 let f: Box_<F> = Box_::new(f);
568 connect_raw(
569 self.as_ptr() as *mut _,
570 c"notify::sorter".as_ptr() as *const _,
571 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
572 notify_sorter_trampoline::<F> as *const (),
573 )),
574 Box_::into_raw(f),
575 )
576 }
577 }
578
579 #[cfg(feature = "v4_12")]
580 #[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
581 #[doc(alias = "tab-behavior")]
582 pub fn connect_tab_behavior_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
583 unsafe extern "C" fn notify_tab_behavior_trampoline<F: Fn(&ColumnView) + 'static>(
584 this: *mut ffi::GtkColumnView,
585 _param_spec: glib::ffi::gpointer,
586 f: glib::ffi::gpointer,
587 ) {
588 let f: &F = &*(f as *const F);
589 f(&from_glib_borrow(this))
590 }
591 unsafe {
592 let f: Box_<F> = Box_::new(f);
593 connect_raw(
594 self.as_ptr() as *mut _,
595 c"notify::tab-behavior".as_ptr() as *const _,
596 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
597 notify_tab_behavior_trampoline::<F> as *const (),
598 )),
599 Box_::into_raw(f),
600 )
601 }
602 }
603}
604
605impl Default for ColumnView {
606 fn default() -> Self {
607 glib::object::Object::new::<Self>()
608 }
609}
610
611#[must_use = "The builder must be built to be used"]
616pub struct ColumnViewBuilder {
617 builder: glib::object::ObjectBuilder<'static, ColumnView>,
618}
619
620impl ColumnViewBuilder {
621 fn new() -> Self {
622 Self {
623 builder: glib::object::Object::builder(),
624 }
625 }
626
627 pub fn enable_rubberband(self, enable_rubberband: bool) -> Self {
628 Self {
629 builder: self
630 .builder
631 .property("enable-rubberband", enable_rubberband),
632 }
633 }
634
635 #[cfg(feature = "v4_12")]
636 #[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
637 pub fn header_factory(self, header_factory: &impl IsA<ListItemFactory>) -> Self {
638 Self {
639 builder: self
640 .builder
641 .property("header-factory", header_factory.clone().upcast()),
642 }
643 }
644
645 pub fn model(self, model: &impl IsA<SelectionModel>) -> Self {
646 Self {
647 builder: self.builder.property("model", model.clone().upcast()),
648 }
649 }
650
651 pub fn reorderable(self, reorderable: bool) -> Self {
652 Self {
653 builder: self.builder.property("reorderable", reorderable),
654 }
655 }
656
657 #[cfg(feature = "v4_12")]
658 #[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
659 pub fn row_factory(self, row_factory: &impl IsA<ListItemFactory>) -> Self {
660 Self {
661 builder: self
662 .builder
663 .property("row-factory", row_factory.clone().upcast()),
664 }
665 }
666
667 pub fn show_column_separators(self, show_column_separators: bool) -> Self {
668 Self {
669 builder: self
670 .builder
671 .property("show-column-separators", show_column_separators),
672 }
673 }
674
675 pub fn show_row_separators(self, show_row_separators: bool) -> Self {
676 Self {
677 builder: self
678 .builder
679 .property("show-row-separators", show_row_separators),
680 }
681 }
682
683 pub fn single_click_activate(self, single_click_activate: bool) -> Self {
684 Self {
685 builder: self
686 .builder
687 .property("single-click-activate", single_click_activate),
688 }
689 }
690
691 #[cfg(feature = "v4_12")]
692 #[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
693 pub fn tab_behavior(self, tab_behavior: ListTabBehavior) -> Self {
694 Self {
695 builder: self.builder.property("tab-behavior", tab_behavior),
696 }
697 }
698
699 pub fn can_focus(self, can_focus: bool) -> Self {
700 Self {
701 builder: self.builder.property("can-focus", can_focus),
702 }
703 }
704
705 pub fn can_target(self, can_target: bool) -> Self {
706 Self {
707 builder: self.builder.property("can-target", can_target),
708 }
709 }
710
711 pub fn css_classes(self, css_classes: impl Into<glib::StrV>) -> Self {
712 Self {
713 builder: self.builder.property("css-classes", css_classes.into()),
714 }
715 }
716
717 pub fn css_name(self, css_name: impl Into<glib::GString>) -> Self {
718 Self {
719 builder: self.builder.property("css-name", css_name.into()),
720 }
721 }
722
723 pub fn cursor(self, cursor: &gdk::Cursor) -> Self {
724 Self {
725 builder: self.builder.property("cursor", cursor.clone()),
726 }
727 }
728
729 pub fn focus_on_click(self, focus_on_click: bool) -> Self {
730 Self {
731 builder: self.builder.property("focus-on-click", focus_on_click),
732 }
733 }
734
735 pub fn focusable(self, focusable: bool) -> Self {
736 Self {
737 builder: self.builder.property("focusable", focusable),
738 }
739 }
740
741 pub fn halign(self, halign: Align) -> Self {
742 Self {
743 builder: self.builder.property("halign", halign),
744 }
745 }
746
747 pub fn has_tooltip(self, has_tooltip: bool) -> Self {
748 Self {
749 builder: self.builder.property("has-tooltip", has_tooltip),
750 }
751 }
752
753 pub fn height_request(self, height_request: i32) -> Self {
754 Self {
755 builder: self.builder.property("height-request", height_request),
756 }
757 }
758
759 pub fn hexpand(self, hexpand: bool) -> Self {
760 Self {
761 builder: self.builder.property("hexpand", hexpand),
762 }
763 }
764
765 pub fn hexpand_set(self, hexpand_set: bool) -> Self {
766 Self {
767 builder: self.builder.property("hexpand-set", hexpand_set),
768 }
769 }
770
771 pub fn layout_manager(self, layout_manager: &impl IsA<LayoutManager>) -> Self {
772 Self {
773 builder: self
774 .builder
775 .property("layout-manager", layout_manager.clone().upcast()),
776 }
777 }
778
779 #[cfg(feature = "v4_18")]
780 #[cfg_attr(docsrs, doc(cfg(feature = "v4_18")))]
781 pub fn limit_events(self, limit_events: bool) -> Self {
782 Self {
783 builder: self.builder.property("limit-events", limit_events),
784 }
785 }
786
787 pub fn margin_bottom(self, margin_bottom: i32) -> Self {
788 Self {
789 builder: self.builder.property("margin-bottom", margin_bottom),
790 }
791 }
792
793 pub fn margin_end(self, margin_end: i32) -> Self {
794 Self {
795 builder: self.builder.property("margin-end", margin_end),
796 }
797 }
798
799 pub fn margin_start(self, margin_start: i32) -> Self {
800 Self {
801 builder: self.builder.property("margin-start", margin_start),
802 }
803 }
804
805 pub fn margin_top(self, margin_top: i32) -> Self {
806 Self {
807 builder: self.builder.property("margin-top", margin_top),
808 }
809 }
810
811 pub fn name(self, name: impl Into<glib::GString>) -> Self {
812 Self {
813 builder: self.builder.property("name", name.into()),
814 }
815 }
816
817 pub fn opacity(self, opacity: f64) -> Self {
818 Self {
819 builder: self.builder.property("opacity", opacity),
820 }
821 }
822
823 pub fn overflow(self, overflow: Overflow) -> Self {
824 Self {
825 builder: self.builder.property("overflow", overflow),
826 }
827 }
828
829 pub fn receives_default(self, receives_default: bool) -> Self {
830 Self {
831 builder: self.builder.property("receives-default", receives_default),
832 }
833 }
834
835 pub fn sensitive(self, sensitive: bool) -> Self {
836 Self {
837 builder: self.builder.property("sensitive", sensitive),
838 }
839 }
840
841 pub fn tooltip_markup(self, tooltip_markup: impl Into<glib::GString>) -> Self {
842 Self {
843 builder: self
844 .builder
845 .property("tooltip-markup", tooltip_markup.into()),
846 }
847 }
848
849 pub fn tooltip_text(self, tooltip_text: impl Into<glib::GString>) -> Self {
850 Self {
851 builder: self.builder.property("tooltip-text", tooltip_text.into()),
852 }
853 }
854
855 pub fn valign(self, valign: Align) -> Self {
856 Self {
857 builder: self.builder.property("valign", valign),
858 }
859 }
860
861 pub fn vexpand(self, vexpand: bool) -> Self {
862 Self {
863 builder: self.builder.property("vexpand", vexpand),
864 }
865 }
866
867 pub fn vexpand_set(self, vexpand_set: bool) -> Self {
868 Self {
869 builder: self.builder.property("vexpand-set", vexpand_set),
870 }
871 }
872
873 pub fn visible(self, visible: bool) -> Self {
874 Self {
875 builder: self.builder.property("visible", visible),
876 }
877 }
878
879 pub fn width_request(self, width_request: i32) -> Self {
880 Self {
881 builder: self.builder.property("width-request", width_request),
882 }
883 }
884
885 pub fn accessible_role(self, accessible_role: AccessibleRole) -> Self {
886 Self {
887 builder: self.builder.property("accessible-role", accessible_role),
888 }
889 }
890
891 pub fn hadjustment(self, hadjustment: &impl IsA<Adjustment>) -> Self {
892 Self {
893 builder: self
894 .builder
895 .property("hadjustment", hadjustment.clone().upcast()),
896 }
897 }
898
899 pub fn hscroll_policy(self, hscroll_policy: ScrollablePolicy) -> Self {
900 Self {
901 builder: self.builder.property("hscroll-policy", hscroll_policy),
902 }
903 }
904
905 pub fn vadjustment(self, vadjustment: &impl IsA<Adjustment>) -> Self {
906 Self {
907 builder: self
908 .builder
909 .property("vadjustment", vadjustment.clone().upcast()),
910 }
911 }
912
913 pub fn vscroll_policy(self, vscroll_policy: ScrollablePolicy) -> Self {
914 Self {
915 builder: self.builder.property("vscroll-policy", vscroll_policy),
916 }
917 }
918
919 #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
922 pub fn build(self) -> ColumnView {
923 assert_initialized_main_thread!();
924 self.builder.build()
925 }
926}