Skip to main content

atk/auto/
table.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
5use crate::Object;
6use glib::{
7    prelude::*,
8    signal::{connect_raw, SignalHandlerId},
9    translate::*,
10};
11use std::{boxed::Box as Box_, fmt, mem::transmute};
12
13glib::wrapper! {
14    /// The ATK interface implemented for UI components which contain tabular or row/column information.
15    ///
16    /// [`Table`][crate::Table] should be implemented by components which present
17    /// elements ordered via rows and columns. It may also be used to
18    /// present tree-structured information if the nodes of the trees can
19    /// be said to contain multiple "columns". Individual elements of an
20    /// [`Table`][crate::Table] are typically referred to as "cells". Those cells should
21    /// implement the interface [`TableCell`][crate::TableCell], but `Atk` doesn't require
22    /// them to be direct children of the current [`Table`][crate::Table]. They can be
23    /// grand-children, grand-grand-children etc. [`Table`][crate::Table] provides the
24    /// API needed to get a individual cell based on the row and column
25    /// numbers.
26    ///
27    /// Children of [`Table`][crate::Table] are frequently "lightweight" objects, that
28    /// is, they may not have backing widgets in the host UI toolkit. They
29    /// are therefore often transient.
30    ///
31    /// Since tables are often very complex, [`Table`][crate::Table] includes provision
32    /// for offering simplified summary information, as well as row and
33    /// column headers and captions. Headers and captions are `AtkObjects`
34    /// which may implement other interfaces ([`Text`][crate::Text], [`Image`][crate::Image], etc.) as
35    /// appropriate. [`Table`][crate::Table] summaries may themselves be (simplified)
36    /// `AtkTables`, etc.
37    ///
38    /// Note for implementors: in the past, [`Table`][crate::Table] required that all the
39    /// cells should be direct children of [`Table`][crate::Table], and provided some
40    /// index based methods to request the cells. The practice showed that
41    /// that forcing made [`Table`][crate::Table] implementation complex, and hard to
42    /// expose other kind of children, like rows or captions. Right now,
43    /// index-based methods are deprecated.
44    ///
45    /// ## Signals
46    ///
47    ///
48    /// #### `column-deleted`
49    ///  The "column-deleted" signal is emitted by an object which
50    /// implements the AtkTable interface when a column is deleted.
51    ///
52    ///
53    ///
54    ///
55    /// #### `column-inserted`
56    ///  The "column-inserted" signal is emitted by an object which
57    /// implements the AtkTable interface when a column is inserted.
58    ///
59    ///
60    ///
61    ///
62    /// #### `column-reordered`
63    ///  The "column-reordered" signal is emitted by an object which
64    /// implements the AtkTable interface when the columns are
65    /// reordered.
66    ///
67    ///
68    ///
69    ///
70    /// #### `model-changed`
71    ///  The "model-changed" signal is emitted by an object which
72    /// implements the AtkTable interface when the model displayed by
73    /// the table changes.
74    ///
75    ///
76    ///
77    ///
78    /// #### `row-deleted`
79    ///  The "row-deleted" signal is emitted by an object which
80    /// implements the AtkTable interface when a row is deleted.
81    ///
82    ///
83    ///
84    ///
85    /// #### `row-inserted`
86    ///  The "row-inserted" signal is emitted by an object which
87    /// implements the AtkTable interface when a row is inserted.
88    ///
89    ///
90    ///
91    ///
92    /// #### `row-reordered`
93    ///  The "row-reordered" signal is emitted by an object which
94    /// implements the AtkTable interface when the rows are
95    /// reordered.
96    ///
97    ///
98    ///
99    /// # Implements
100    ///
101    /// [`TableExt`][trait@crate::prelude::TableExt], [`TableExtManual`][trait@crate::prelude::TableExtManual]
102    #[doc(alias = "AtkTable")]
103    pub struct Table(Interface<ffi::AtkTable, ffi::AtkTableIface>);
104
105    match fn {
106        type_ => || ffi::atk_table_get_type(),
107    }
108}
109
110impl Table {
111    pub const NONE: Option<&'static Table> = None;
112}
113
114mod sealed {
115    pub trait Sealed {}
116    impl<T: super::IsA<super::Table>> Sealed for T {}
117}
118
119/// Trait containing all [`struct@Table`] methods.
120///
121/// # Implementors
122///
123/// [`NoOpObject`][struct@crate::NoOpObject], [`Table`][struct@crate::Table]
124pub trait TableExt: IsA<Table> + sealed::Sealed + 'static {
125    /// Adds the specified `column` to the selection.
126    /// ## `column`
127    /// a `gint` representing a column in `self`
128    ///
129    /// # Returns
130    ///
131    /// a gboolean representing if the column was successfully added to
132    /// the selection, or 0 if value does not implement this interface.
133    #[doc(alias = "atk_table_add_column_selection")]
134    fn add_column_selection(&self, column: i32) -> bool {
135        unsafe {
136            from_glib(ffi::atk_table_add_column_selection(
137                self.as_ref().to_glib_none().0,
138                column,
139            ))
140        }
141    }
142
143    /// Adds the specified `row` to the selection.
144    /// ## `row`
145    /// a `gint` representing a row in `self`
146    ///
147    /// # Returns
148    ///
149    /// a gboolean representing if row was successfully added to selection,
150    /// or 0 if value does not implement this interface.
151    #[doc(alias = "atk_table_add_row_selection")]
152    fn add_row_selection(&self, row: i32) -> bool {
153        unsafe {
154            from_glib(ffi::atk_table_add_row_selection(
155                self.as_ref().to_glib_none().0,
156                row,
157            ))
158        }
159    }
160
161    /// Gets the caption for the `self`.
162    ///
163    /// # Returns
164    ///
165    /// a AtkObject* representing the
166    /// table caption, or [`None`] if value does not implement this interface.
167    #[doc(alias = "atk_table_get_caption")]
168    #[doc(alias = "get_caption")]
169    fn caption(&self) -> Option<Object> {
170        unsafe { from_glib_none(ffi::atk_table_get_caption(self.as_ref().to_glib_none().0)) }
171    }
172
173    /// Gets a `gint` representing the column at the specified `index_`.
174    ///
175    /// # Deprecated
176    ///
177    /// Since 2.12.
178    /// ## `index_`
179    /// a `gint` representing an index in `self`
180    ///
181    /// # Returns
182    ///
183    /// a gint representing the column at the specified index,
184    /// or -1 if the table does not implement this method.
185    #[doc(alias = "atk_table_get_column_at_index")]
186    #[doc(alias = "get_column_at_index")]
187    fn column_at_index(&self, index_: i32) -> i32 {
188        unsafe { ffi::atk_table_get_column_at_index(self.as_ref().to_glib_none().0, index_) }
189    }
190
191    /// Gets the description text of the specified `column` in the table
192    /// ## `column`
193    /// a `gint` representing a column in `self`
194    ///
195    /// # Returns
196    ///
197    /// a gchar* representing the column description, or [`None`]
198    /// if value does not implement this interface.
199    #[doc(alias = "atk_table_get_column_description")]
200    #[doc(alias = "get_column_description")]
201    fn column_description(&self, column: i32) -> Option<glib::GString> {
202        unsafe {
203            from_glib_none(ffi::atk_table_get_column_description(
204                self.as_ref().to_glib_none().0,
205                column,
206            ))
207        }
208    }
209
210    /// Gets the number of columns occupied by the accessible object
211    /// at the specified `row` and `column` in the `self`.
212    /// ## `row`
213    /// a `gint` representing a row in `self`
214    /// ## `column`
215    /// a `gint` representing a column in `self`
216    ///
217    /// # Returns
218    ///
219    /// a gint representing the column extent at specified position, or 0
220    /// if value does not implement this interface.
221    #[doc(alias = "atk_table_get_column_extent_at")]
222    #[doc(alias = "get_column_extent_at")]
223    fn column_extent_at(&self, row: i32, column: i32) -> i32 {
224        unsafe { ffi::atk_table_get_column_extent_at(self.as_ref().to_glib_none().0, row, column) }
225    }
226
227    /// Gets the column header of a specified column in an accessible table.
228    /// ## `column`
229    /// a `gint` representing a column in the table
230    ///
231    /// # Returns
232    ///
233    /// a AtkObject* representing the
234    /// specified column header, or [`None`] if value does not implement this
235    /// interface.
236    #[doc(alias = "atk_table_get_column_header")]
237    #[doc(alias = "get_column_header")]
238    fn column_header(&self, column: i32) -> Option<Object> {
239        unsafe {
240            from_glib_none(ffi::atk_table_get_column_header(
241                self.as_ref().to_glib_none().0,
242                column,
243            ))
244        }
245    }
246
247    /// Gets a `gint` representing the index at the specified `row` and
248    /// `column`.
249    ///
250    /// # Deprecated
251    ///
252    /// Since 2.12. Use [`ref_at()`][Self::ref_at()] in order to get the
253    /// accessible that represents the cell at (`row`, `column`)
254    /// ## `row`
255    /// a `gint` representing a row in `self`
256    /// ## `column`
257    /// a `gint` representing a column in `self`
258    ///
259    /// # Returns
260    ///
261    /// a `gint` representing the index at specified position.
262    /// The value -1 is returned if the object at row,column is not a child
263    /// of table or table does not implement this interface.
264    #[doc(alias = "atk_table_get_index_at")]
265    #[doc(alias = "get_index_at")]
266    fn index_at(&self, row: i32, column: i32) -> i32 {
267        unsafe { ffi::atk_table_get_index_at(self.as_ref().to_glib_none().0, row, column) }
268    }
269
270    /// Gets the number of columns in the table.
271    ///
272    /// # Returns
273    ///
274    /// a gint representing the number of columns, or 0
275    /// if value does not implement this interface.
276    #[doc(alias = "atk_table_get_n_columns")]
277    #[doc(alias = "get_n_columns")]
278    fn n_columns(&self) -> i32 {
279        unsafe { ffi::atk_table_get_n_columns(self.as_ref().to_glib_none().0) }
280    }
281
282    /// Gets the number of rows in the table.
283    ///
284    /// # Returns
285    ///
286    /// a gint representing the number of rows, or 0
287    /// if value does not implement this interface.
288    #[doc(alias = "atk_table_get_n_rows")]
289    #[doc(alias = "get_n_rows")]
290    fn n_rows(&self) -> i32 {
291        unsafe { ffi::atk_table_get_n_rows(self.as_ref().to_glib_none().0) }
292    }
293
294    /// Gets a `gint` representing the row at the specified `index_`.
295    ///
296    /// # Deprecated
297    ///
298    /// since 2.12.
299    /// ## `index_`
300    /// a `gint` representing an index in `self`
301    ///
302    /// # Returns
303    ///
304    /// a gint representing the row at the specified index,
305    /// or -1 if the table does not implement this method.
306    #[doc(alias = "atk_table_get_row_at_index")]
307    #[doc(alias = "get_row_at_index")]
308    fn row_at_index(&self, index_: i32) -> i32 {
309        unsafe { ffi::atk_table_get_row_at_index(self.as_ref().to_glib_none().0, index_) }
310    }
311
312    /// Gets the description text of the specified row in the table
313    /// ## `row`
314    /// a `gint` representing a row in `self`
315    ///
316    /// # Returns
317    ///
318    /// a gchar* representing the row description, or
319    /// [`None`] if value does not implement this interface.
320    #[doc(alias = "atk_table_get_row_description")]
321    #[doc(alias = "get_row_description")]
322    fn row_description(&self, row: i32) -> Option<glib::GString> {
323        unsafe {
324            from_glib_none(ffi::atk_table_get_row_description(
325                self.as_ref().to_glib_none().0,
326                row,
327            ))
328        }
329    }
330
331    /// Gets the number of rows occupied by the accessible object
332    /// at a specified `row` and `column` in the `self`.
333    /// ## `row`
334    /// a `gint` representing a row in `self`
335    /// ## `column`
336    /// a `gint` representing a column in `self`
337    ///
338    /// # Returns
339    ///
340    /// a gint representing the row extent at specified position, or 0
341    /// if value does not implement this interface.
342    #[doc(alias = "atk_table_get_row_extent_at")]
343    #[doc(alias = "get_row_extent_at")]
344    fn row_extent_at(&self, row: i32, column: i32) -> i32 {
345        unsafe { ffi::atk_table_get_row_extent_at(self.as_ref().to_glib_none().0, row, column) }
346    }
347
348    /// Gets the row header of a specified row in an accessible table.
349    /// ## `row`
350    /// a `gint` representing a row in the table
351    ///
352    /// # Returns
353    ///
354    /// a AtkObject* representing the
355    /// specified row header, or [`None`] if value does not implement this
356    /// interface.
357    #[doc(alias = "atk_table_get_row_header")]
358    #[doc(alias = "get_row_header")]
359    fn row_header(&self, row: i32) -> Option<Object> {
360        unsafe {
361            from_glib_none(ffi::atk_table_get_row_header(
362                self.as_ref().to_glib_none().0,
363                row,
364            ))
365        }
366    }
367
368    /// Gets the summary description of the table.
369    ///
370    /// # Returns
371    ///
372    /// a AtkObject* representing a summary description
373    /// of the table, or zero if value does not implement this interface.
374    #[doc(alias = "atk_table_get_summary")]
375    #[doc(alias = "get_summary")]
376    fn summary(&self) -> Option<Object> {
377        unsafe { from_glib_full(ffi::atk_table_get_summary(self.as_ref().to_glib_none().0)) }
378    }
379
380    /// Gets a boolean value indicating whether the specified `column`
381    /// is selected
382    /// ## `column`
383    /// a `gint` representing a column in `self`
384    ///
385    /// # Returns
386    ///
387    /// a gboolean representing if the column is selected, or 0
388    /// if value does not implement this interface.
389    #[doc(alias = "atk_table_is_column_selected")]
390    fn is_column_selected(&self, column: i32) -> bool {
391        unsafe {
392            from_glib(ffi::atk_table_is_column_selected(
393                self.as_ref().to_glib_none().0,
394                column,
395            ))
396        }
397    }
398
399    /// Gets a boolean value indicating whether the specified `row`
400    /// is selected
401    /// ## `row`
402    /// a `gint` representing a row in `self`
403    ///
404    /// # Returns
405    ///
406    /// a gboolean representing if the row is selected, or 0
407    /// if value does not implement this interface.
408    #[doc(alias = "atk_table_is_row_selected")]
409    fn is_row_selected(&self, row: i32) -> bool {
410        unsafe {
411            from_glib(ffi::atk_table_is_row_selected(
412                self.as_ref().to_glib_none().0,
413                row,
414            ))
415        }
416    }
417
418    /// Gets a boolean value indicating whether the accessible object
419    /// at the specified `row` and `column` is selected
420    /// ## `row`
421    /// a `gint` representing a row in `self`
422    /// ## `column`
423    /// a `gint` representing a column in `self`
424    ///
425    /// # Returns
426    ///
427    /// a gboolean representing if the cell is selected, or 0
428    /// if value does not implement this interface.
429    #[doc(alias = "atk_table_is_selected")]
430    fn is_selected(&self, row: i32, column: i32) -> bool {
431        unsafe {
432            from_glib(ffi::atk_table_is_selected(
433                self.as_ref().to_glib_none().0,
434                row,
435                column,
436            ))
437        }
438    }
439
440    /// Get a reference to the table cell at `row`, `column`. This cell
441    /// should implement the interface [`TableCell`][crate::TableCell]
442    /// ## `row`
443    /// a `gint` representing a row in `self`
444    /// ## `column`
445    /// a `gint` representing a column in `self`
446    ///
447    /// # Returns
448    ///
449    /// an [`Object`][crate::Object] representing the referred
450    /// to accessible
451    #[doc(alias = "atk_table_ref_at")]
452    fn ref_at(&self, row: i32, column: i32) -> Option<Object> {
453        unsafe {
454            from_glib_full(ffi::atk_table_ref_at(
455                self.as_ref().to_glib_none().0,
456                row,
457                column,
458            ))
459        }
460    }
461
462    /// Adds the specified `column` to the selection.
463    /// ## `column`
464    /// a `gint` representing a column in `self`
465    ///
466    /// # Returns
467    ///
468    /// a gboolean representing if the column was successfully removed from
469    /// the selection, or 0 if value does not implement this interface.
470    #[doc(alias = "atk_table_remove_column_selection")]
471    fn remove_column_selection(&self, column: i32) -> bool {
472        unsafe {
473            from_glib(ffi::atk_table_remove_column_selection(
474                self.as_ref().to_glib_none().0,
475                column,
476            ))
477        }
478    }
479
480    /// Removes the specified `row` from the selection.
481    /// ## `row`
482    /// a `gint` representing a row in `self`
483    ///
484    /// # Returns
485    ///
486    /// a gboolean representing if the row was successfully removed from
487    /// the selection, or 0 if value does not implement this interface.
488    #[doc(alias = "atk_table_remove_row_selection")]
489    fn remove_row_selection(&self, row: i32) -> bool {
490        unsafe {
491            from_glib(ffi::atk_table_remove_row_selection(
492                self.as_ref().to_glib_none().0,
493                row,
494            ))
495        }
496    }
497
498    /// Sets the caption for the table.
499    /// ## `caption`
500    /// a [`Object`][crate::Object] representing the caption to set for `self`
501    #[doc(alias = "atk_table_set_caption")]
502    fn set_caption(&self, caption: &impl IsA<Object>) {
503        unsafe {
504            ffi::atk_table_set_caption(
505                self.as_ref().to_glib_none().0,
506                caption.as_ref().to_glib_none().0,
507            );
508        }
509    }
510
511    /// Sets the description text for the specified `column` of the `self`.
512    /// ## `column`
513    /// a `gint` representing a column in `self`
514    /// ## `description`
515    /// a `gchar` representing the description text
516    /// to set for the specified `column` of the `self`
517    #[doc(alias = "atk_table_set_column_description")]
518    fn set_column_description(&self, column: i32, description: &str) {
519        unsafe {
520            ffi::atk_table_set_column_description(
521                self.as_ref().to_glib_none().0,
522                column,
523                description.to_glib_none().0,
524            );
525        }
526    }
527
528    /// Sets the specified column header to `header`.
529    /// ## `column`
530    /// a `gint` representing a column in `self`
531    /// ## `header`
532    /// an [`Table`][crate::Table]
533    #[doc(alias = "atk_table_set_column_header")]
534    fn set_column_header(&self, column: i32, header: &impl IsA<Object>) {
535        unsafe {
536            ffi::atk_table_set_column_header(
537                self.as_ref().to_glib_none().0,
538                column,
539                header.as_ref().to_glib_none().0,
540            );
541        }
542    }
543
544    /// Sets the description text for the specified `row` of `self`.
545    /// ## `row`
546    /// a `gint` representing a row in `self`
547    /// ## `description`
548    /// a `gchar` representing the description text
549    /// to set for the specified `row` of `self`
550    #[doc(alias = "atk_table_set_row_description")]
551    fn set_row_description(&self, row: i32, description: &str) {
552        unsafe {
553            ffi::atk_table_set_row_description(
554                self.as_ref().to_glib_none().0,
555                row,
556                description.to_glib_none().0,
557            );
558        }
559    }
560
561    /// Sets the specified row header to `header`.
562    /// ## `row`
563    /// a `gint` representing a row in `self`
564    /// ## `header`
565    /// an [`Table`][crate::Table]
566    #[doc(alias = "atk_table_set_row_header")]
567    fn set_row_header(&self, row: i32, header: &impl IsA<Object>) {
568        unsafe {
569            ffi::atk_table_set_row_header(
570                self.as_ref().to_glib_none().0,
571                row,
572                header.as_ref().to_glib_none().0,
573            );
574        }
575    }
576
577    /// Sets the summary description of the table.
578    /// ## `accessible`
579    /// an [`Object`][crate::Object] representing the summary description
580    /// to set for `self`
581    #[doc(alias = "atk_table_set_summary")]
582    fn set_summary(&self, accessible: &impl IsA<Object>) {
583        unsafe {
584            ffi::atk_table_set_summary(
585                self.as_ref().to_glib_none().0,
586                accessible.as_ref().to_glib_none().0,
587            );
588        }
589    }
590
591    /// The "column-deleted" signal is emitted by an object which
592    /// implements the AtkTable interface when a column is deleted.
593    /// ## `arg1`
594    /// The index of the first column deleted.
595    /// ## `arg2`
596    /// The number of columns deleted.
597    #[doc(alias = "column-deleted")]
598    fn connect_column_deleted<F: Fn(&Self, i32, i32) + 'static>(&self, f: F) -> SignalHandlerId {
599        unsafe extern "C" fn column_deleted_trampoline<
600            P: IsA<Table>,
601            F: Fn(&P, i32, i32) + 'static,
602        >(
603            this: *mut ffi::AtkTable,
604            arg1: libc::c_int,
605            arg2: libc::c_int,
606            f: glib::ffi::gpointer,
607        ) {
608            let f: &F = &*(f as *const F);
609            f(Table::from_glib_borrow(this).unsafe_cast_ref(), arg1, arg2)
610        }
611        unsafe {
612            let f: Box_<F> = Box_::new(f);
613            connect_raw(
614                self.as_ptr() as *mut _,
615                b"column-deleted\0".as_ptr() as *const _,
616                Some(transmute::<_, unsafe extern "C" fn()>(
617                    column_deleted_trampoline::<Self, F> as *const (),
618                )),
619                Box_::into_raw(f),
620            )
621        }
622    }
623
624    /// The "column-inserted" signal is emitted by an object which
625    /// implements the AtkTable interface when a column is inserted.
626    /// ## `arg1`
627    /// The index of the column inserted.
628    /// ## `arg2`
629    /// The number of colums inserted.
630    #[doc(alias = "column-inserted")]
631    fn connect_column_inserted<F: Fn(&Self, i32, i32) + 'static>(&self, f: F) -> SignalHandlerId {
632        unsafe extern "C" fn column_inserted_trampoline<
633            P: IsA<Table>,
634            F: Fn(&P, i32, i32) + 'static,
635        >(
636            this: *mut ffi::AtkTable,
637            arg1: libc::c_int,
638            arg2: libc::c_int,
639            f: glib::ffi::gpointer,
640        ) {
641            let f: &F = &*(f as *const F);
642            f(Table::from_glib_borrow(this).unsafe_cast_ref(), arg1, arg2)
643        }
644        unsafe {
645            let f: Box_<F> = Box_::new(f);
646            connect_raw(
647                self.as_ptr() as *mut _,
648                b"column-inserted\0".as_ptr() as *const _,
649                Some(transmute::<_, unsafe extern "C" fn()>(
650                    column_inserted_trampoline::<Self, F> as *const (),
651                )),
652                Box_::into_raw(f),
653            )
654        }
655    }
656
657    /// The "column-reordered" signal is emitted by an object which
658    /// implements the AtkTable interface when the columns are
659    /// reordered.
660    #[doc(alias = "column-reordered")]
661    fn connect_column_reordered<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
662        unsafe extern "C" fn column_reordered_trampoline<P: IsA<Table>, F: Fn(&P) + 'static>(
663            this: *mut ffi::AtkTable,
664            f: glib::ffi::gpointer,
665        ) {
666            let f: &F = &*(f as *const F);
667            f(Table::from_glib_borrow(this).unsafe_cast_ref())
668        }
669        unsafe {
670            let f: Box_<F> = Box_::new(f);
671            connect_raw(
672                self.as_ptr() as *mut _,
673                b"column-reordered\0".as_ptr() as *const _,
674                Some(transmute::<_, unsafe extern "C" fn()>(
675                    column_reordered_trampoline::<Self, F> as *const (),
676                )),
677                Box_::into_raw(f),
678            )
679        }
680    }
681
682    /// The "model-changed" signal is emitted by an object which
683    /// implements the AtkTable interface when the model displayed by
684    /// the table changes.
685    #[doc(alias = "model-changed")]
686    fn connect_model_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
687        unsafe extern "C" fn model_changed_trampoline<P: IsA<Table>, F: Fn(&P) + 'static>(
688            this: *mut ffi::AtkTable,
689            f: glib::ffi::gpointer,
690        ) {
691            let f: &F = &*(f as *const F);
692            f(Table::from_glib_borrow(this).unsafe_cast_ref())
693        }
694        unsafe {
695            let f: Box_<F> = Box_::new(f);
696            connect_raw(
697                self.as_ptr() as *mut _,
698                b"model-changed\0".as_ptr() as *const _,
699                Some(transmute::<_, unsafe extern "C" fn()>(
700                    model_changed_trampoline::<Self, F> as *const (),
701                )),
702                Box_::into_raw(f),
703            )
704        }
705    }
706
707    /// The "row-deleted" signal is emitted by an object which
708    /// implements the AtkTable interface when a row is deleted.
709    /// ## `arg1`
710    /// The index of the first row deleted.
711    /// ## `arg2`
712    /// The number of rows deleted.
713    #[doc(alias = "row-deleted")]
714    fn connect_row_deleted<F: Fn(&Self, i32, i32) + 'static>(&self, f: F) -> SignalHandlerId {
715        unsafe extern "C" fn row_deleted_trampoline<
716            P: IsA<Table>,
717            F: Fn(&P, i32, i32) + 'static,
718        >(
719            this: *mut ffi::AtkTable,
720            arg1: libc::c_int,
721            arg2: libc::c_int,
722            f: glib::ffi::gpointer,
723        ) {
724            let f: &F = &*(f as *const F);
725            f(Table::from_glib_borrow(this).unsafe_cast_ref(), arg1, arg2)
726        }
727        unsafe {
728            let f: Box_<F> = Box_::new(f);
729            connect_raw(
730                self.as_ptr() as *mut _,
731                b"row-deleted\0".as_ptr() as *const _,
732                Some(transmute::<_, unsafe extern "C" fn()>(
733                    row_deleted_trampoline::<Self, F> as *const (),
734                )),
735                Box_::into_raw(f),
736            )
737        }
738    }
739
740    /// The "row-inserted" signal is emitted by an object which
741    /// implements the AtkTable interface when a row is inserted.
742    /// ## `arg1`
743    /// The index of the first row inserted.
744    /// ## `arg2`
745    /// The number of rows inserted.
746    #[doc(alias = "row-inserted")]
747    fn connect_row_inserted<F: Fn(&Self, i32, i32) + 'static>(&self, f: F) -> SignalHandlerId {
748        unsafe extern "C" fn row_inserted_trampoline<
749            P: IsA<Table>,
750            F: Fn(&P, i32, i32) + 'static,
751        >(
752            this: *mut ffi::AtkTable,
753            arg1: libc::c_int,
754            arg2: libc::c_int,
755            f: glib::ffi::gpointer,
756        ) {
757            let f: &F = &*(f as *const F);
758            f(Table::from_glib_borrow(this).unsafe_cast_ref(), arg1, arg2)
759        }
760        unsafe {
761            let f: Box_<F> = Box_::new(f);
762            connect_raw(
763                self.as_ptr() as *mut _,
764                b"row-inserted\0".as_ptr() as *const _,
765                Some(transmute::<_, unsafe extern "C" fn()>(
766                    row_inserted_trampoline::<Self, F> as *const (),
767                )),
768                Box_::into_raw(f),
769            )
770        }
771    }
772
773    /// The "row-reordered" signal is emitted by an object which
774    /// implements the AtkTable interface when the rows are
775    /// reordered.
776    #[doc(alias = "row-reordered")]
777    fn connect_row_reordered<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
778        unsafe extern "C" fn row_reordered_trampoline<P: IsA<Table>, F: Fn(&P) + 'static>(
779            this: *mut ffi::AtkTable,
780            f: glib::ffi::gpointer,
781        ) {
782            let f: &F = &*(f as *const F);
783            f(Table::from_glib_borrow(this).unsafe_cast_ref())
784        }
785        unsafe {
786            let f: Box_<F> = Box_::new(f);
787            connect_raw(
788                self.as_ptr() as *mut _,
789                b"row-reordered\0".as_ptr() as *const _,
790                Some(transmute::<_, unsafe extern "C" fn()>(
791                    row_reordered_trampoline::<Self, F> as *const (),
792                )),
793                Box_::into_raw(f),
794            )
795        }
796    }
797}
798
799impl<O: IsA<Table>> TableExt for O {}
800
801impl fmt::Display for Table {
802    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
803        f.write_str("Table")
804    }
805}