atk/auto/hyperlink_impl.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
5use crate::Hyperlink;
6use glib::{prelude::*, translate::*};
7use std::fmt;
8
9glib::wrapper! {
10 /// A queryable interface which allows AtkHyperlink instances
11 /// associated with an AtkObject to be obtained. AtkHyperlinkImpl
12 /// corresponds to AT-SPI's Hyperlink interface, and differs from
13 /// AtkHyperlink in that AtkHyperlink is an object type, rather than an
14 /// interface, and thus cannot be directly queried. FTW
15 ///
16 /// # Implements
17 ///
18 /// [`HyperlinkImplExt`][trait@crate::prelude::HyperlinkImplExt]
19 #[doc(alias = "AtkHyperlinkImpl")]
20 pub struct HyperlinkImpl(Interface<ffi::AtkHyperlinkImpl, ffi::AtkHyperlinkImplIface>);
21
22 match fn {
23 type_ => || ffi::atk_hyperlink_impl_get_type(),
24 }
25}
26
27impl HyperlinkImpl {
28 pub const NONE: Option<&'static HyperlinkImpl> = None;
29}
30
31mod sealed {
32 pub trait Sealed {}
33 impl<T: super::IsA<super::HyperlinkImpl>> Sealed for T {}
34}
35
36/// Trait containing all [`struct@HyperlinkImpl`] methods.
37///
38/// # Implementors
39///
40/// [`HyperlinkImpl`][struct@crate::HyperlinkImpl]
41pub trait HyperlinkImplExt: IsA<HyperlinkImpl> + sealed::Sealed + 'static {
42 /// Gets the hyperlink associated with this object.
43 ///
44 /// # Returns
45 ///
46 /// an AtkHyperlink object which points to this
47 /// implementing AtkObject.
48 #[doc(alias = "atk_hyperlink_impl_get_hyperlink")]
49 #[doc(alias = "get_hyperlink")]
50 fn hyperlink(&self) -> Option<Hyperlink> {
51 unsafe {
52 from_glib_full(ffi::atk_hyperlink_impl_get_hyperlink(
53 self.as_ref().to_glib_none().0,
54 ))
55 }
56 }
57}
58
59impl<O: IsA<HyperlinkImpl>> HyperlinkImplExt for O {}
60
61impl fmt::Display for HyperlinkImpl {
62 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
63 f.write_str("HyperlinkImpl")
64 }
65}