use glib::{prelude::*, translate::*};
use std::fmt;
glib::wrapper! {
#[doc(alias = "GtkPlugAccessible")]
pub struct PlugAccessible(Object<ffi::GtkPlugAccessible, ffi::GtkPlugAccessibleClass>) @extends atk::Object;
match fn {
type_ => || ffi::gtk_plug_accessible_get_type(),
}
}
impl PlugAccessible {
pub const NONE: Option<&'static PlugAccessible> = None;
pub fn builder() -> PlugAccessibleBuilder {
PlugAccessibleBuilder::new()
}
}
#[must_use = "The builder must be built to be used"]
pub struct PlugAccessibleBuilder {
builder: glib::object::ObjectBuilder<'static, PlugAccessible>,
}
impl PlugAccessibleBuilder {
fn new() -> Self {
Self {
builder: glib::object::Object::builder(),
}
}
pub fn accessible_description(self, accessible_description: impl Into<glib::GString>) -> Self {
Self {
builder: self
.builder
.property("accessible-description", accessible_description.into()),
}
}
pub fn accessible_name(self, accessible_name: impl Into<glib::GString>) -> Self {
Self {
builder: self
.builder
.property("accessible-name", accessible_name.into()),
}
}
pub fn accessible_parent(self, accessible_parent: &impl IsA<atk::Object>) -> Self {
Self {
builder: self
.builder
.property("accessible-parent", accessible_parent.clone().upcast()),
}
}
pub fn accessible_role(self, accessible_role: atk::Role) -> Self {
Self {
builder: self.builder.property("accessible-role", accessible_role),
}
}
pub fn accessible_table_caption(
self,
accessible_table_caption: impl Into<glib::GString>,
) -> Self {
Self {
builder: self
.builder
.property("accessible-table-caption", accessible_table_caption.into()),
}
}
pub fn accessible_table_caption_object(
self,
accessible_table_caption_object: &impl IsA<atk::Object>,
) -> Self {
Self {
builder: self.builder.property(
"accessible-table-caption-object",
accessible_table_caption_object.clone().upcast(),
),
}
}
pub fn accessible_table_column_description(
self,
accessible_table_column_description: impl Into<glib::GString>,
) -> Self {
Self {
builder: self.builder.property(
"accessible-table-column-description",
accessible_table_column_description.into(),
),
}
}
pub fn accessible_table_column_header(
self,
accessible_table_column_header: &impl IsA<atk::Object>,
) -> Self {
Self {
builder: self.builder.property(
"accessible-table-column-header",
accessible_table_column_header.clone().upcast(),
),
}
}
pub fn accessible_table_row_description(
self,
accessible_table_row_description: impl Into<glib::GString>,
) -> Self {
Self {
builder: self.builder.property(
"accessible-table-row-description",
accessible_table_row_description.into(),
),
}
}
pub fn accessible_table_row_header(
self,
accessible_table_row_header: &impl IsA<atk::Object>,
) -> Self {
Self {
builder: self.builder.property(
"accessible-table-row-header",
accessible_table_row_header.clone().upcast(),
),
}
}
pub fn accessible_table_summary(
self,
accessible_table_summary: &impl IsA<atk::Object>,
) -> Self {
Self {
builder: self.builder.property(
"accessible-table-summary",
accessible_table_summary.clone().upcast(),
),
}
}
pub fn accessible_value(self, accessible_value: f64) -> Self {
Self {
builder: self.builder.property("accessible-value", accessible_value),
}
}
#[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
pub fn build(self) -> PlugAccessible {
self.builder.build()
}
}
mod sealed {
pub trait Sealed {}
impl<T: super::IsA<super::PlugAccessible>> Sealed for T {}
}
pub trait PlugAccessibleExt: IsA<PlugAccessible> + sealed::Sealed + 'static {
#[doc(alias = "gtk_plug_accessible_get_id")]
#[doc(alias = "get_id")]
fn id(&self) -> Option<glib::GString> {
unsafe {
from_glib_full(ffi::gtk_plug_accessible_get_id(
self.as_ref().to_glib_none().0,
))
}
}
}
impl<O: IsA<PlugAccessible>> PlugAccessibleExt for O {}
impl fmt::Display for PlugAccessible {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str("PlugAccessible")
}
}