1use glib::translate::*;
4
5use crate::{ffi, prelude::*, DirectoryList};
6
7impl DirectoryList {
8 #[doc(alias = "gtk_directory_list_get_io_priority")]
14 #[doc(alias = "get_io_priority")]
15 pub fn io_priority(&self) -> glib::Priority {
16 unsafe {
17 from_glib(ffi::gtk_directory_list_get_io_priority(
18 self.to_glib_none().0,
19 ))
20 }
21 }
22
23 #[doc(alias = "gtk_directory_list_set_io_priority")]
35 pub fn set_io_priority(&self, io_priority: glib::Priority) {
36 unsafe {
37 ffi::gtk_directory_list_set_io_priority(self.to_glib_none().0, io_priority.into_glib());
38 }
39 }
40
41 pub fn builder() -> DirectoryListBuilder {
49 DirectoryListBuilder::new()
50 }
51}
52
53#[must_use = "The builder must be built to be used"]
58pub struct DirectoryListBuilder {
59 builder: glib::object::ObjectBuilder<'static, DirectoryList>,
60}
61
62impl DirectoryListBuilder {
63 fn new() -> Self {
64 Self {
65 builder: glib::object::Object::builder(),
66 }
67 }
68 #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
69 pub fn build(self) -> DirectoryList {
70 self.builder.build()
71 }
72
73 pub fn attributes(self, attributes: &str) -> Self {
74 Self {
75 builder: self.builder.property("attributes", attributes),
76 }
77 }
78
79 pub fn file(self, file: &impl IsA<gio::File>) -> Self {
80 Self {
81 builder: self.builder.property("file", file),
82 }
83 }
84
85 pub fn io_priority(self, io_priority: glib::Priority) -> Self {
86 Self {
87 builder: self
88 .builder
89 .property("io-priority", io_priority.into_glib()),
90 }
91 }
92
93 pub fn monitored(self, monitored: bool) -> Self {
94 Self {
95 builder: self.builder.property("monitored", monitored),
96 }
97 }
98}