// GENERATED — DO NOT EDIT

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

///|
pub(open) trait IListStore {
  fn as_list_store(Self) -> ListStore
  fn append(Self, &@gobject.IObject) -> Unit = _
  fn find(Self, &@gobject.IObject) -> (Bool, UInt) = _
  fn insert(Self, UInt, &@gobject.IObject) -> Unit = _
  fn remove(Self, UInt) -> Unit = _
  fn remove_all(Self) -> Unit = _
}

///|
pub impl IListStore for ListStore with fn as_list_store(self) {
  self
}

///|
#borrow(self_, item)
extern "c" fn moonbit_g_list_store_append(
  self_ : ListStore,
  item : @gobject.Object,
) = "moonbit_g_list_store_append"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.ListStore.append.html).
pub fn ListStore::append(self : ListStore, item : &@gobject.IObject) -> Unit {
  moonbit_g_list_store_append(self, item.as_object())
}

///|
#borrow(self_, item, position)
extern "c" fn moonbit_g_list_store_find(
  self_ : ListStore,
  item : @gobject.Object,
  position : Ref[UInt],
) -> Bool = "moonbit_g_list_store_find"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.ListStore.find.html).
pub fn ListStore::find(
  self : ListStore,
  item : &@gobject.IObject,
) -> (Bool, UInt) {
  let position = Ref(0U)
  let result = moonbit_g_list_store_find(self, item.as_object(), position)
  (result, position.val)
}

///|
#borrow(self_, item)
extern "c" fn moonbit_g_list_store_insert(
  self_ : ListStore,
  position : UInt,
  item : @gobject.Object,
) = "moonbit_g_list_store_insert"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.ListStore.insert.html).
pub fn ListStore::insert(
  self : ListStore,
  position : UInt,
  item : &@gobject.IObject,
) -> Unit {
  moonbit_g_list_store_insert(self, position, item.as_object())
}

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.ListStore.remove.html).
#borrow(self)
pub extern "c" fn ListStore::remove(self : ListStore, position : UInt) = "moonbit_g_list_store_remove"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.ListStore.remove_all.html).
#borrow(self)
pub extern "c" fn ListStore::remove_all(self : ListStore) = "moonbit_g_list_store_remove_all"

///|
/// Creates a new ListStore with default property values.
pub extern "c" fn ListStore::new() -> ListStore = "moonbit_g_list_store_new"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/property.ListStore.n-items.html).
#borrow(self_)
pub extern "c" fn ListStore::get_n_items(self_ : ListStore) -> UInt = "moonbit_g_list_store_get_n_items"

///|
impl IListStore with fn append(self, item) -> Unit {
  self.as_list_store().append(item)
}

///|
impl IListStore with fn find(self, item) -> (Bool, UInt) {
  self.as_list_store().find(item)
}

///|
impl IListStore with fn insert(self, position, item) -> Unit {
  self.as_list_store().insert(position, item)
}

///|
impl IListStore with fn remove(self, position) -> Unit {
  self.as_list_store().remove(position)
}

///|
impl IListStore with fn remove_all(self) -> Unit {
  self.as_list_store().remove_all()
}

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

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

///|
pub fn ListStore::as_list_model(self : ListStore) -> ListModel = "%identity"

///|
pub impl IListModel for ListStore with fn as_list_model(self) {
  self.as_list_model()
}