gtk4/auto/
assistant_page.rs
1#![allow(deprecated)]
5
6use crate::{ffi, AssistantPageType, Widget};
7use glib::{
8 prelude::*,
9 signal::{connect_raw, SignalHandlerId},
10 translate::*,
11};
12use std::boxed::Box as Box_;
13
14glib::wrapper! {
15 #[doc(alias = "GtkAssistantPage")]
51 pub struct AssistantPage(Object<ffi::GtkAssistantPage>);
52
53 match fn {
54 type_ => || ffi::gtk_assistant_page_get_type(),
55 }
56}
57
58impl AssistantPage {
59 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
69 #[allow(deprecated)]
70 #[doc(alias = "gtk_assistant_page_get_child")]
71 #[doc(alias = "get_child")]
72 pub fn child(&self) -> Widget {
73 unsafe { from_glib_none(ffi::gtk_assistant_page_get_child(self.to_glib_none().0)) }
74 }
75
76 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
85 pub fn is_complete(&self) -> bool {
86 ObjectExt::property(self, "complete")
87 }
88
89 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
98 pub fn set_complete(&self, complete: bool) {
99 ObjectExt::set_property(self, "complete", complete)
100 }
101
102 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
108 #[doc(alias = "page-type")]
109 pub fn page_type(&self) -> AssistantPageType {
110 ObjectExt::property(self, "page-type")
111 }
112
113 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
119 #[doc(alias = "page-type")]
120 pub fn set_page_type(&self, page_type: AssistantPageType) {
121 ObjectExt::set_property(self, "page-type", page_type)
122 }
123
124 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
130 pub fn title(&self) -> Option<glib::GString> {
131 ObjectExt::property(self, "title")
132 }
133
134 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
140 pub fn set_title(&self, title: Option<&str>) {
141 ObjectExt::set_property(self, "title", title)
142 }
143
144 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
145 #[doc(alias = "complete")]
146 pub fn connect_complete_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
147 unsafe extern "C" fn notify_complete_trampoline<F: Fn(&AssistantPage) + 'static>(
148 this: *mut ffi::GtkAssistantPage,
149 _param_spec: glib::ffi::gpointer,
150 f: glib::ffi::gpointer,
151 ) {
152 let f: &F = &*(f as *const F);
153 f(&from_glib_borrow(this))
154 }
155 unsafe {
156 let f: Box_<F> = Box_::new(f);
157 connect_raw(
158 self.as_ptr() as *mut _,
159 b"notify::complete\0".as_ptr() as *const _,
160 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
161 notify_complete_trampoline::<F> as *const (),
162 )),
163 Box_::into_raw(f),
164 )
165 }
166 }
167
168 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
169 #[doc(alias = "page-type")]
170 pub fn connect_page_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
171 unsafe extern "C" fn notify_page_type_trampoline<F: Fn(&AssistantPage) + 'static>(
172 this: *mut ffi::GtkAssistantPage,
173 _param_spec: glib::ffi::gpointer,
174 f: glib::ffi::gpointer,
175 ) {
176 let f: &F = &*(f as *const F);
177 f(&from_glib_borrow(this))
178 }
179 unsafe {
180 let f: Box_<F> = Box_::new(f);
181 connect_raw(
182 self.as_ptr() as *mut _,
183 b"notify::page-type\0".as_ptr() as *const _,
184 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
185 notify_page_type_trampoline::<F> as *const (),
186 )),
187 Box_::into_raw(f),
188 )
189 }
190 }
191
192 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
193 #[doc(alias = "title")]
194 pub fn connect_title_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
195 unsafe extern "C" fn notify_title_trampoline<F: Fn(&AssistantPage) + 'static>(
196 this: *mut ffi::GtkAssistantPage,
197 _param_spec: glib::ffi::gpointer,
198 f: glib::ffi::gpointer,
199 ) {
200 let f: &F = &*(f as *const F);
201 f(&from_glib_borrow(this))
202 }
203 unsafe {
204 let f: Box_<F> = Box_::new(f);
205 connect_raw(
206 self.as_ptr() as *mut _,
207 b"notify::title\0".as_ptr() as *const _,
208 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
209 notify_title_trampoline::<F> as *const (),
210 )),
211 Box_::into_raw(f),
212 )
213 }
214 }
215}