forked from gtk-rs/gtk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
message_dialog.rs
144 lines (122 loc) · 5.34 KB
/
message_dialog.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
// This file was generated by gir (b7f5189) from gir-files (71d73f0)
// DO NOT EDIT
use Bin;
use ButtonsType;
use Container;
use Dialog;
use MessageType;
use Widget;
use Window;
use ffi;
use glib::Value;
use glib::object::IsA;
use glib::translate::*;
use gobject_ffi;
use std::mem::transmute;
glib_wrapper! {
pub struct MessageDialog(Object<ffi::GtkMessageDialog>): Dialog, Window, Bin, Container, Widget;
match fn {
get_type => || ffi::gtk_message_dialog_get_type(),
}
}
impl MessageDialog {
//pub fn new<'a, T: IsA<Window>, U: Into<Option<&'a str>>>(parent: Option<&T>, flags: DialogFlags, type_: MessageType, buttons: ButtonsType, message_format: U, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) -> MessageDialog {
// unsafe { TODO: call ffi::gtk_message_dialog_new() }
//}
//pub fn new_with_markup<'a, T: IsA<Window>, U: Into<Option<&'a str>>>(parent: Option<&T>, flags: DialogFlags, type_: MessageType, buttons: ButtonsType, message_format: U, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) -> MessageDialog {
// unsafe { TODO: call ffi::gtk_message_dialog_new_with_markup() }
//}
//pub fn format_secondary_markup(&self, message_format: &str, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) {
// unsafe { TODO: call ffi::gtk_message_dialog_format_secondary_markup() }
//}
//pub fn format_secondary_text<'a, T: Into<Option<&'a str>>>(&self, message_format: T, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) {
// unsafe { TODO: call ffi::gtk_message_dialog_format_secondary_text() }
//}
pub fn get_image(&self) -> Option<Widget> {
unsafe {
from_glib_none(ffi::gtk_message_dialog_get_image(self.to_glib_none().0))
}
}
pub fn get_message_area(&self) -> Option<Widget> {
unsafe {
from_glib_none(ffi::gtk_message_dialog_get_message_area(self.to_glib_none().0))
}
}
pub fn set_image<T: IsA<Widget>>(&self, image: &T) {
unsafe {
ffi::gtk_message_dialog_set_image(self.to_glib_none().0, image.to_glib_none().0);
}
}
pub fn set_markup(&self, str: &str) {
unsafe {
ffi::gtk_message_dialog_set_markup(self.to_glib_none().0, str.to_glib_none().0);
}
}
pub fn set_property_buttons(&self, buttons: ButtonsType) {
let buttons = buttons.to_glib() as i32;
unsafe {
gobject_ffi::g_object_set_property(self.to_glib_none().0, "buttons".to_glib_none().0, Value::from(&buttons).to_glib_none().0);
}
}
pub fn get_property_message_type(&self) -> MessageType {
let mut value = Value::from(&0);
unsafe {
gobject_ffi::g_object_get_property(self.to_glib_none().0, "message-type".to_glib_none().0, value.to_glib_none_mut().0);
from_glib(transmute(value.get::<i32>().unwrap()))
}
}
pub fn set_property_message_type(&self, message_type: MessageType) {
let message_type = message_type.to_glib() as i32;
unsafe {
gobject_ffi::g_object_set_property(self.to_glib_none().0, "message-type".to_glib_none().0, Value::from(&message_type).to_glib_none().0);
}
}
pub fn get_property_secondary_text(&self) -> Option<String> {
let mut value = Value::from(None::<&str>);
unsafe {
gobject_ffi::g_object_get_property(self.to_glib_none().0, "secondary-text".to_glib_none().0, value.to_glib_none_mut().0);
}
value.get()
}
pub fn set_property_secondary_text(&self, secondary_text: Option<&str>) {
unsafe {
gobject_ffi::g_object_set_property(self.to_glib_none().0, "secondary-text".to_glib_none().0, Value::from(secondary_text).to_glib_none().0);
}
}
pub fn get_property_secondary_use_markup(&self) -> bool {
let mut value = Value::from(&false);
unsafe {
gobject_ffi::g_object_get_property(self.to_glib_none().0, "secondary-use-markup".to_glib_none().0, value.to_glib_none_mut().0);
}
value.get().unwrap()
}
pub fn set_property_secondary_use_markup(&self, secondary_use_markup: bool) {
unsafe {
gobject_ffi::g_object_set_property(self.to_glib_none().0, "secondary-use-markup".to_glib_none().0, Value::from(&secondary_use_markup).to_glib_none().0);
}
}
pub fn get_property_text(&self) -> Option<String> {
let mut value = Value::from(None::<&str>);
unsafe {
gobject_ffi::g_object_get_property(self.to_glib_none().0, "text".to_glib_none().0, value.to_glib_none_mut().0);
}
value.get()
}
pub fn set_property_text(&self, text: Option<&str>) {
unsafe {
gobject_ffi::g_object_set_property(self.to_glib_none().0, "text".to_glib_none().0, Value::from(text).to_glib_none().0);
}
}
pub fn get_property_use_markup(&self) -> bool {
let mut value = Value::from(&false);
unsafe {
gobject_ffi::g_object_get_property(self.to_glib_none().0, "use-markup".to_glib_none().0, value.to_glib_none_mut().0);
}
value.get().unwrap()
}
pub fn set_property_use_markup(&self, use_markup: bool) {
unsafe {
gobject_ffi::g_object_set_property(self.to_glib_none().0, "use-markup".to_glib_none().0, Value::from(&use_markup).to_glib_none().0);
}
}
}