// GENERATED — DO NOT EDIT

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/class.LinkButton.html).
pub type LinkButton

///|
pub(open) trait ILinkButton {
  fn as_link_button(Self) -> LinkButton
  fn get_uri(Self) -> String = _
  fn get_visited(Self) -> Bool = _
  fn set_uri(Self, String) -> Unit = _
  fn set_visited(Self, Bool) -> Unit = _
  fn connect_activate_link(Self, (LinkButton) -> Bool) -> UInt64 = _
}

///|
pub impl ILinkButton for LinkButton with fn as_link_button(self) {
  self
}

///|
#borrow(uri)
extern "c" fn moonbit_gtk_link_button_new(uri : Bytes) -> LinkButton = "moonbit_gtk_link_button_new"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/ctor.LinkButton.new.html).
pub fn LinkButton::new(uri : String) -> LinkButton {
  moonbit_gtk_link_button_new(@encoding/utf8.encode(uri))
}

///|
#borrow(uri, label)
extern "c" fn moonbit_gtk_link_button_new_with_label(
  uri : Bytes,
  label : @glib.Nullable[Bytes],
) -> LinkButton = "moonbit_gtk_link_button_new_with_label"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/ctor.LinkButton.new_with_label.html).
pub fn LinkButton::new_with_label(uri : String, label : String?) -> LinkButton {
  moonbit_gtk_link_button_new_with_label(
    @encoding/utf8.encode(uri),
    match label {
      Some(s) => @glib.Nullable::some(@encoding/utf8.encode(s))
      None => @glib.Nullable::null()
    },
  )
}

///|
#borrow(self_)
extern "c" fn moonbit_gtk_link_button_get_uri(self_ : LinkButton) -> Bytes = "moonbit_gtk_link_button_get_uri"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.LinkButton.get_uri.html).
pub fn LinkButton::get_uri(self : LinkButton) -> String {
  @encoding/utf8.decode_lossy(moonbit_gtk_link_button_get_uri(self))
}

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.LinkButton.get_visited.html).
#borrow(self)
pub extern "c" fn LinkButton::get_visited(self : LinkButton) -> Bool = "moonbit_gtk_link_button_get_visited"

///|
#borrow(self_, uri)
extern "c" fn moonbit_gtk_link_button_set_uri(self_ : LinkButton, uri : Bytes) = "moonbit_gtk_link_button_set_uri"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.LinkButton.set_uri.html).
pub fn LinkButton::set_uri(self : LinkButton, uri : String) -> Unit {
  moonbit_gtk_link_button_set_uri(self, @encoding/utf8.encode(uri))
}

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.LinkButton.set_visited.html).
#borrow(self)
pub extern "c" fn LinkButton::set_visited(self : LinkButton, visited : Bool) = "moonbit_gtk_link_button_set_visited"

///|
#borrow(instance)
extern "c" fn gtk_link_button_connect_activate_link(
  instance : LinkButton,
  function : FuncRef[(LinkButton, (LinkButton) -> Bool) -> Bool],
  closure : (LinkButton) -> Bool,
) -> UInt64 = "moonbit_gtk_link_button_connect_activate_link"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/signal.LinkButton.activate-link.html).
pub fn LinkButton::connect_activate_link(
  self : LinkButton,
  f : (LinkButton) -> Bool,
) -> UInt64 {
  gtk_link_button_connect_activate_link(
    self,
    fn(instance_, f) { f(instance_) },
    f,
  )
}

///|
impl ILinkButton with fn get_uri(self) -> String {
  self.as_link_button().get_uri()
}

///|
impl ILinkButton with fn get_visited(self) -> Bool {
  self.as_link_button().get_visited()
}

///|
impl ILinkButton with fn set_uri(self, uri) -> Unit {
  self.as_link_button().set_uri(uri)
}

///|
impl ILinkButton with fn set_visited(self, visited) -> Unit {
  self.as_link_button().set_visited(visited)
}

///|
impl ILinkButton with fn connect_activate_link(self, f) -> UInt64 {
  self.as_link_button().connect_activate_link(f)
}

///|
pub fn LinkButton::as_button(self : LinkButton) -> Button = "%identity"

///|
pub impl IButton for LinkButton with fn as_button(self) {
  self.as_button()
}

///|
pub fn LinkButton::as_widget(self : LinkButton) -> Widget = "%identity"

///|
pub impl IWidget for LinkButton with fn as_widget(self) {
  self.as_widget()
}

///|
pub fn LinkButton::as_gobject_object(self : LinkButton) -> @gobject.Object = "%identity"

///|
pub impl @gobject.IObject for LinkButton with fn as_object(self) {
  self.as_gobject_object()
}