// GENERATED — DO NOT EDIT

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

///|
pub(open) trait ITooltip {
  fn as_tooltip(Self) -> Tooltip
  fn set_custom(Self, &IWidget?) -> Unit = _
  fn set_icon(Self, &@gdk.IPaintable?) -> Unit = _
  fn set_icon_from_gicon(Self, &@gio.IIcon?) -> Unit = _
  fn set_icon_from_icon_name(Self, String?) -> Unit = _
  fn set_markup(Self, String?) -> Unit = _
  fn set_text(Self, String?) -> Unit = _
  fn set_tip_area(Self, @gdk.Rectangle) -> Unit = _
}

///|
pub impl ITooltip for Tooltip with fn as_tooltip(self) {
  self
}

///|
#borrow(self_, custom_widget)
extern "c" fn moonbit_gtk_tooltip_set_custom(
  self_ : Tooltip,
  custom_widget : @glib.Nullable[Widget],
) = "moonbit_gtk_tooltip_set_custom"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Tooltip.set_custom.html).
pub fn Tooltip::set_custom(self : Tooltip, custom_widget : &IWidget?) -> Unit {
  moonbit_gtk_tooltip_set_custom(
    self,
    match custom_widget {
      Some(v) => @glib.Nullable::some(v.as_widget())
      None => @glib.Nullable::null()
    },
  )
}

///|
#borrow(self_, paintable)
extern "c" fn moonbit_gtk_tooltip_set_icon(
  self_ : Tooltip,
  paintable : @glib.Nullable[@gdk.Paintable],
) = "moonbit_gtk_tooltip_set_icon"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Tooltip.set_icon.html).
pub fn Tooltip::set_icon(self : Tooltip, paintable : &@gdk.IPaintable?) -> Unit {
  moonbit_gtk_tooltip_set_icon(
    self,
    match paintable {
      Some(v) => @glib.Nullable::some(v.as_paintable())
      None => @glib.Nullable::null()
    },
  )
}

///|
#borrow(self_, gicon)
extern "c" fn moonbit_gtk_tooltip_set_icon_from_gicon(
  self_ : Tooltip,
  gicon : @glib.Nullable[@gio.Icon],
) = "moonbit_gtk_tooltip_set_icon_from_gicon"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Tooltip.set_icon_from_gicon.html).
pub fn Tooltip::set_icon_from_gicon(
  self : Tooltip,
  gicon : &@gio.IIcon?,
) -> Unit {
  moonbit_gtk_tooltip_set_icon_from_gicon(
    self,
    match gicon {
      Some(v) => @glib.Nullable::some(v.as_icon())
      None => @glib.Nullable::null()
    },
  )
}

///|
#borrow(self_, icon_name)
extern "c" fn moonbit_gtk_tooltip_set_icon_from_icon_name(
  self_ : Tooltip,
  icon_name : @glib.Nullable[Bytes],
) = "moonbit_gtk_tooltip_set_icon_from_icon_name"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Tooltip.set_icon_from_icon_name.html).
pub fn Tooltip::set_icon_from_icon_name(
  self : Tooltip,
  icon_name : String?,
) -> Unit {
  moonbit_gtk_tooltip_set_icon_from_icon_name(
    self,
    match icon_name {
      Some(s) => @glib.Nullable::some(@encoding/utf8.encode(s))
      None => @glib.Nullable::null()
    },
  )
}

///|
#borrow(self_, markup)
extern "c" fn moonbit_gtk_tooltip_set_markup(
  self_ : Tooltip,
  markup : @glib.Nullable[Bytes],
) = "moonbit_gtk_tooltip_set_markup"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Tooltip.set_markup.html).
pub fn Tooltip::set_markup(self : Tooltip, markup : String?) -> Unit {
  moonbit_gtk_tooltip_set_markup(
    self,
    match markup {
      Some(s) => @glib.Nullable::some(@encoding/utf8.encode(s))
      None => @glib.Nullable::null()
    },
  )
}

///|
#borrow(self_, text)
extern "c" fn moonbit_gtk_tooltip_set_text(
  self_ : Tooltip,
  text : @glib.Nullable[Bytes],
) = "moonbit_gtk_tooltip_set_text"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Tooltip.set_text.html).
pub fn Tooltip::set_text(self : Tooltip, text : String?) -> Unit {
  moonbit_gtk_tooltip_set_text(
    self,
    match text {
      Some(s) => @glib.Nullable::some(@encoding/utf8.encode(s))
      None => @glib.Nullable::null()
    },
  )
}

///|
#borrow(self_, rect)
extern "c" fn moonbit_gtk_tooltip_set_tip_area(
  self_ : Tooltip,
  rect : @gdk.Rectangle,
) = "moonbit_gtk_tooltip_set_tip_area"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Tooltip.set_tip_area.html).
pub fn Tooltip::set_tip_area(self : Tooltip, rect : @gdk.Rectangle) -> Unit {
  moonbit_gtk_tooltip_set_tip_area(self, rect)
}

///|
impl ITooltip with fn set_custom(self, custom_widget) -> Unit {
  self.as_tooltip().set_custom(custom_widget)
}

///|
impl ITooltip with fn set_icon(self, paintable) -> Unit {
  self.as_tooltip().set_icon(paintable)
}

///|
impl ITooltip with fn set_icon_from_gicon(self, gicon) -> Unit {
  self.as_tooltip().set_icon_from_gicon(gicon)
}

///|
impl ITooltip with fn set_icon_from_icon_name(self, icon_name) -> Unit {
  self.as_tooltip().set_icon_from_icon_name(icon_name)
}

///|
impl ITooltip with fn set_markup(self, markup) -> Unit {
  self.as_tooltip().set_markup(markup)
}

///|
impl ITooltip with fn set_text(self, text) -> Unit {
  self.as_tooltip().set_text(text)
}

///|
impl ITooltip with fn set_tip_area(self, rect) -> Unit {
  self.as_tooltip().set_tip_area(rect)
}

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

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