// GENERATED — DO NOT EDIT

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

///|
pub(open) trait IDropDown {
  fn as_drop_down(Self) -> DropDown
  fn get_enable_search(Self) -> Bool = _
  fn get_factory(Self) -> ListItemFactory? = _
  fn get_header_factory(Self) -> ListItemFactory? = _
  fn get_list_factory(Self) -> ListItemFactory? = _
  fn get_model(Self) -> @gio.ListModel? = _
  fn get_search_match_mode(Self) -> StringFilterMatchMode = _
  fn get_selected(Self) -> UInt = _
  fn get_selected_item(Self) -> @gobject.Object? = _
  fn get_show_arrow(Self) -> Bool = _
  fn set_enable_search(Self, Bool) -> Unit = _
  fn set_factory(Self, &IListItemFactory?) -> Unit = _
  fn set_header_factory(Self, &IListItemFactory?) -> Unit = _
  fn set_list_factory(Self, &IListItemFactory?) -> Unit = _
  fn set_model(Self, &@gio.IListModel?) -> Unit = _
  fn set_search_match_mode(Self, StringFilterMatchMode) -> Unit = _
  fn set_selected(Self, UInt) -> Unit = _
  fn set_show_arrow(Self, Bool) -> Unit = _
  fn connect_activate(Self, (DropDown) -> Unit) -> UInt64 = _
}

///|
pub impl IDropDown for DropDown with fn as_drop_down(self) {
  self
}

///|
#borrow(__sa_strings)
extern "c" fn moonbit_gtk_drop_down_new_from_strings(
  __sa_strings : FixedArray[Bytes],
) -> DropDown = "moonbit_gtk_drop_down_new_from_strings"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/ctor.DropDown.new_from_strings.html).
pub fn DropDown::new_from_strings(strings : Array[String]) -> DropDown {
  moonbit_gtk_drop_down_new_from_strings(
    FixedArray::from_array(strings.map(fn(s) { @encoding/utf8.encode(s) })),
  )
}

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

///|
#borrow(self_)
extern "c" fn moonbit_gtk_drop_down_get_factory(
  self_ : DropDown,
) -> @glib.Nullable[ListItemFactory] = "moonbit_gtk_drop_down_get_factory"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.DropDown.get_factory.html).
pub fn DropDown::get_factory(self : DropDown) -> ListItemFactory? {
  let raw_result = moonbit_gtk_drop_down_get_factory(self)
  raw_result.to_option()
}

///|
#borrow(self_)
extern "c" fn moonbit_gtk_drop_down_get_header_factory(
  self_ : DropDown,
) -> @glib.Nullable[ListItemFactory] = "moonbit_gtk_drop_down_get_header_factory"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.DropDown.get_header_factory.html).
pub fn DropDown::get_header_factory(self : DropDown) -> ListItemFactory? {
  let raw_result = moonbit_gtk_drop_down_get_header_factory(self)
  raw_result.to_option()
}

///|
#borrow(self_)
extern "c" fn moonbit_gtk_drop_down_get_list_factory(
  self_ : DropDown,
) -> @glib.Nullable[ListItemFactory] = "moonbit_gtk_drop_down_get_list_factory"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.DropDown.get_list_factory.html).
pub fn DropDown::get_list_factory(self : DropDown) -> ListItemFactory? {
  let raw_result = moonbit_gtk_drop_down_get_list_factory(self)
  raw_result.to_option()
}

///|
#borrow(self_)
extern "c" fn moonbit_gtk_drop_down_get_model(
  self_ : DropDown,
) -> @glib.Nullable[@gio.ListModel] = "moonbit_gtk_drop_down_get_model"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.DropDown.get_model.html).
pub fn DropDown::get_model(self : DropDown) -> @gio.ListModel? {
  let raw_result = moonbit_gtk_drop_down_get_model(self)
  raw_result.to_option()
}

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.DropDown.get_search_match_mode.html).
#borrow(self)
pub extern "c" fn DropDown::get_search_match_mode(
  self : DropDown,
) -> StringFilterMatchMode = "moonbit_gtk_drop_down_get_search_match_mode"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.DropDown.get_selected.html).
#borrow(self)
pub extern "c" fn DropDown::get_selected(self : DropDown) -> UInt = "moonbit_gtk_drop_down_get_selected"

///|
#borrow(self_)
extern "c" fn moonbit_gtk_drop_down_get_selected_item(
  self_ : DropDown,
) -> @glib.Nullable[@gobject.Object] = "moonbit_gtk_drop_down_get_selected_item"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.DropDown.get_selected_item.html).
pub fn DropDown::get_selected_item(self : DropDown) -> @gobject.Object? {
  let raw_result = moonbit_gtk_drop_down_get_selected_item(self)
  raw_result.to_option()
}

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

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.DropDown.set_enable_search.html).
#borrow(self)
pub extern "c" fn DropDown::set_enable_search(
  self : DropDown,
  enable_search : Bool,
) = "moonbit_gtk_drop_down_set_enable_search"

///|
#borrow(self_, factory)
extern "c" fn moonbit_gtk_drop_down_set_factory(
  self_ : DropDown,
  factory : @glib.Nullable[ListItemFactory],
) = "moonbit_gtk_drop_down_set_factory"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.DropDown.set_factory.html).
pub fn DropDown::set_factory(
  self : DropDown,
  factory : &IListItemFactory?,
) -> Unit {
  moonbit_gtk_drop_down_set_factory(
    self,
    match factory {
      Some(v) => @glib.Nullable::some(v.as_list_item_factory())
      None => @glib.Nullable::null()
    },
  )
}

///|
#borrow(self_, factory)
extern "c" fn moonbit_gtk_drop_down_set_header_factory(
  self_ : DropDown,
  factory : @glib.Nullable[ListItemFactory],
) = "moonbit_gtk_drop_down_set_header_factory"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.DropDown.set_header_factory.html).
pub fn DropDown::set_header_factory(
  self : DropDown,
  factory : &IListItemFactory?,
) -> Unit {
  moonbit_gtk_drop_down_set_header_factory(
    self,
    match factory {
      Some(v) => @glib.Nullable::some(v.as_list_item_factory())
      None => @glib.Nullable::null()
    },
  )
}

///|
#borrow(self_, factory)
extern "c" fn moonbit_gtk_drop_down_set_list_factory(
  self_ : DropDown,
  factory : @glib.Nullable[ListItemFactory],
) = "moonbit_gtk_drop_down_set_list_factory"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.DropDown.set_list_factory.html).
pub fn DropDown::set_list_factory(
  self : DropDown,
  factory : &IListItemFactory?,
) -> Unit {
  moonbit_gtk_drop_down_set_list_factory(
    self,
    match factory {
      Some(v) => @glib.Nullable::some(v.as_list_item_factory())
      None => @glib.Nullable::null()
    },
  )
}

///|
#borrow(self_, model)
extern "c" fn moonbit_gtk_drop_down_set_model(
  self_ : DropDown,
  model : @glib.Nullable[@gio.ListModel],
) = "moonbit_gtk_drop_down_set_model"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.DropDown.set_model.html).
pub fn DropDown::set_model(self : DropDown, model : &@gio.IListModel?) -> Unit {
  moonbit_gtk_drop_down_set_model(
    self,
    match model {
      Some(v) => @glib.Nullable::some(v.as_list_model())
      None => @glib.Nullable::null()
    },
  )
}

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.DropDown.set_search_match_mode.html).
#borrow(self)
pub extern "c" fn DropDown::set_search_match_mode(
  self : DropDown,
  search_match_mode : StringFilterMatchMode,
) = "moonbit_gtk_drop_down_set_search_match_mode"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.DropDown.set_selected.html).
#borrow(self)
pub extern "c" fn DropDown::set_selected(self : DropDown, position : UInt) = "moonbit_gtk_drop_down_set_selected"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.DropDown.set_show_arrow.html).
#borrow(self)
pub extern "c" fn DropDown::set_show_arrow(self : DropDown, show_arrow : Bool) = "moonbit_gtk_drop_down_set_show_arrow"

///|
#borrow(instance)
extern "c" fn gtk_drop_down_connect_activate(
  instance : DropDown,
  function : FuncRef[(DropDown, (DropDown) -> Unit) -> Unit],
  closure : (DropDown) -> Unit,
) -> UInt64 = "moonbit_gtk_drop_down_connect_activate"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/signal.DropDown.activate.html).
pub fn DropDown::connect_activate(
  self : DropDown,
  f : (DropDown) -> Unit,
) -> UInt64 {
  gtk_drop_down_connect_activate(self, fn(instance_, f) { f(instance_) }, f)
}

///|
impl IDropDown with fn get_enable_search(self) -> Bool {
  self.as_drop_down().get_enable_search()
}

///|
impl IDropDown with fn get_factory(self) -> ListItemFactory? {
  self.as_drop_down().get_factory()
}

///|
impl IDropDown with fn get_header_factory(self) -> ListItemFactory? {
  self.as_drop_down().get_header_factory()
}

///|
impl IDropDown with fn get_list_factory(self) -> ListItemFactory? {
  self.as_drop_down().get_list_factory()
}

///|
impl IDropDown with fn get_model(self) -> @gio.ListModel? {
  self.as_drop_down().get_model()
}

///|
impl IDropDown with fn get_search_match_mode(self) -> StringFilterMatchMode {
  self.as_drop_down().get_search_match_mode()
}

///|
impl IDropDown with fn get_selected(self) -> UInt {
  self.as_drop_down().get_selected()
}

///|
impl IDropDown with fn get_selected_item(self) -> @gobject.Object? {
  self.as_drop_down().get_selected_item()
}

///|
impl IDropDown with fn get_show_arrow(self) -> Bool {
  self.as_drop_down().get_show_arrow()
}

///|
impl IDropDown with fn set_enable_search(self, enable_search) -> Unit {
  self.as_drop_down().set_enable_search(enable_search)
}

///|
impl IDropDown with fn set_factory(self, factory) -> Unit {
  self.as_drop_down().set_factory(factory)
}

///|
impl IDropDown with fn set_header_factory(self, factory) -> Unit {
  self.as_drop_down().set_header_factory(factory)
}

///|
impl IDropDown with fn set_list_factory(self, factory) -> Unit {
  self.as_drop_down().set_list_factory(factory)
}

///|
impl IDropDown with fn set_model(self, model) -> Unit {
  self.as_drop_down().set_model(model)
}

///|
impl IDropDown with fn set_search_match_mode(self, search_match_mode) -> Unit {
  self.as_drop_down().set_search_match_mode(search_match_mode)
}

///|
impl IDropDown with fn set_selected(self, position) -> Unit {
  self.as_drop_down().set_selected(position)
}

///|
impl IDropDown with fn set_show_arrow(self, show_arrow) -> Unit {
  self.as_drop_down().set_show_arrow(show_arrow)
}

///|
impl IDropDown with fn connect_activate(self, f) -> UInt64 {
  self.as_drop_down().connect_activate(f)
}

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

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

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

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