Skip to main content

gtk4/auto/
tree_drag_dest.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::{TreePath, ffi};
7use glib::{prelude::*, translate::*};
8
9glib::wrapper! {
10    /// List views use widgets to display their contents.
11    ///   You can use [`DropTarget`][crate::DropTarget] to implement a drop destination
12    /// Interface for Drag-and-Drop destinations in [`TreeView`][crate::TreeView].
13    ///
14    /// # Implements
15    ///
16    /// [`TreeDragDestExt`][trait@crate::prelude::TreeDragDestExt]
17    #[doc(alias = "GtkTreeDragDest")]
18    pub struct TreeDragDest(Interface<ffi::GtkTreeDragDest, ffi::GtkTreeDragDestIface>);
19
20    match fn {
21        type_ => || ffi::gtk_tree_drag_dest_get_type(),
22    }
23}
24
25impl TreeDragDest {
26    pub const NONE: Option<&'static TreeDragDest> = None;
27}
28
29/// Trait containing all [`struct@TreeDragDest`] methods.
30///
31/// # Implementors
32///
33/// [`ListStore`][struct@crate::ListStore], [`TreeDragDest`][struct@crate::TreeDragDest], [`TreeStore`][struct@crate::TreeStore]
34pub trait TreeDragDestExt: IsA<TreeDragDest> + 'static {
35    /// Asks the [`TreeDragDest`][crate::TreeDragDest] to insert a row before the path @dest,
36    /// deriving the contents of the row from @value. If @dest is
37    /// outside the tree so that inserting before it is impossible, [`false`]
38    /// will be returned. Also, [`false`] may be returned if the new row is
39    /// not created for some model-specific reason.  Should robustly handle
40    /// a @dest no longer found in the model!
41    ///
42    /// # Deprecated since 4.10
43    ///
44    /// Use list models instead
45    /// ## `dest`
46    /// row to drop in front of
47    /// ## `value`
48    /// data to drop
49    ///
50    /// # Returns
51    ///
52    /// whether a new row was created before position @dest
53    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
54    #[allow(deprecated)]
55    #[doc(alias = "gtk_tree_drag_dest_drag_data_received")]
56    fn drag_data_received(&self, dest: &TreePath, value: &glib::Value) -> bool {
57        unsafe {
58            from_glib(ffi::gtk_tree_drag_dest_drag_data_received(
59                self.as_ref().to_glib_none().0,
60                mut_override(dest.to_glib_none().0),
61                value.to_glib_none().0,
62            ))
63        }
64    }
65
66    /// t exist, though.
67    ///
68    /// # Deprecated since 4.10
69    ///
70    /// Use list models instead
71    /// ## `dest_path`
72    /// destination row
73    /// ## `value`
74    /// the data being dropped
75    ///
76    /// # Returns
77    ///
78    /// [`true`] if a drop is possible before @dest_path
79    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
80    #[allow(deprecated)]
81    #[doc(alias = "gtk_tree_drag_dest_row_drop_possible")]
82    fn row_drop_possible(&self, dest_path: &TreePath, value: &glib::Value) -> bool {
83        unsafe {
84            from_glib(ffi::gtk_tree_drag_dest_row_drop_possible(
85                self.as_ref().to_glib_none().0,
86                mut_override(dest_path.to_glib_none().0),
87                value.to_glib_none().0,
88            ))
89        }
90    }
91}
92
93impl<O: IsA<TreeDragDest>> TreeDragDestExt for O {}