// GENERATED — DO NOT EDIT
///|
/// [Upstream documentation](https://docs.gtk.org/gio/iface.AppInfo.html).
pub type AppInfo
///|
pub(open) trait IAppInfo {
fn as_app_info(Self) -> AppInfo
fn add_supports_type(Self, String) -> Bool raise @glib.Error_ = _
fn can_delete(Self) -> Bool = _
fn can_remove_supports_type(Self) -> Bool = _
fn delete(Self) -> Bool = _
fn dup(Self) -> AppInfo = _
fn equal(Self, &IAppInfo) -> Bool = _
fn get_commandline(Self) -> String? = _
fn get_description(Self) -> String? = _
fn get_display_name(Self) -> String = _
fn get_executable(Self) -> String = _
fn get_icon(Self) -> Icon? = _
fn get_id(Self) -> String? = _
fn get_name(Self) -> String = _
fn launch_uris_finish(Self, &IAsyncResult) -> Bool raise @glib.Error_ = _
fn remove_supports_type(Self, String) -> Bool raise @glib.Error_ = _
fn set_as_default_for_extension(Self, String) -> Bool raise @glib.Error_ = _
fn set_as_default_for_type(Self, String) -> Bool raise @glib.Error_ = _
fn set_as_last_used_for_type(Self, String) -> Bool raise @glib.Error_ = _
fn should_show(Self) -> Bool = _
fn supports_files(Self) -> Bool = _
fn supports_uris(Self) -> Bool = _
}
///|
pub impl IAppInfo for AppInfo with fn as_app_info(self) {
self
}
///|
#borrow(commandline, application_name, error)
extern "c" fn moonbit_g_app_info_create_from_commandline(
commandline : Bytes,
application_name : @glib.Nullable[Bytes],
flags : Int,
error : Ref[@glib.Nullable[@glib.Error_]],
) -> AppInfo = "moonbit_g_app_info_create_from_commandline"
///|
/// [Upstream documentation](https://docs.gtk.org/gio/type_func.AppInfo.create_from_commandline.html).
pub fn AppInfo::create_from_commandline(
commandline : String,
application_name : String?,
flags : AppInfoCreateFlags,
) -> AppInfo raise @glib.Error_ {
let error_ : Ref[@glib.Nullable[@glib.Error_]] = Ref(@glib.Nullable::null())
let result = moonbit_g_app_info_create_from_commandline(
@encoding/utf8.encode(commandline),
match application_name {
Some(s) => @glib.Nullable::some(@encoding/utf8.encode(s))
None => @glib.Nullable::null()
},
flags.to_int(),
error_,
)
match error_.val.to_option() {
Some(e) => raise e
None => result
}
}
///|
#borrow(result)
extern "c" fn moonbit_g_app_info_get_all(result : Ref[FixedArray[AppInfo]]) = "moonbit_g_app_info_get_all"
///|
/// [Upstream documentation](https://docs.gtk.org/gio/type_func.AppInfo.get_all.html).
pub fn AppInfo::get_all() -> Array[AppInfo] {
let result_ref : Ref[FixedArray[AppInfo]] = Ref([])
moonbit_g_app_info_get_all(result_ref)
let values : Array[AppInfo] = Array::new(capacity=result_ref.val.length())
for value in result_ref.val {
values.push(value)
}
values
}
///|
#borrow(content_type, result)
extern "c" fn moonbit_g_app_info_get_all_for_type(
content_type : Bytes,
result : Ref[FixedArray[AppInfo]],
) = "moonbit_g_app_info_get_all_for_type"
///|
/// [Upstream documentation](https://docs.gtk.org/gio/type_func.AppInfo.get_all_for_type.html).
pub fn AppInfo::get_all_for_type(content_type : String) -> Array[AppInfo] {
let result_ref : Ref[FixedArray[AppInfo]] = Ref([])
moonbit_g_app_info_get_all_for_type(
@encoding/utf8.encode(content_type),
result_ref,
)
let values : Array[AppInfo] = Array::new(capacity=result_ref.val.length())
for value in result_ref.val {
values.push(value)
}
values
}
///|
#borrow(content_type)
extern "c" fn moonbit_g_app_info_get_default_for_type(
content_type : Bytes,
must_support_uris : Bool,
) -> @glib.Nullable[AppInfo] = "moonbit_g_app_info_get_default_for_type"
///|
/// [Upstream documentation](https://docs.gtk.org/gio/type_func.AppInfo.get_default_for_type.html).
pub fn AppInfo::get_default_for_type(
content_type : String,
must_support_uris : Bool,
) -> AppInfo? {
let raw_result = moonbit_g_app_info_get_default_for_type(
@encoding/utf8.encode(content_type),
must_support_uris,
)
raw_result.to_option()
}
///|
#borrow(result, error)
extern "c" fn moonbit_g_app_info_get_default_for_type_finish(
result : AsyncResult,
error : Ref[@glib.Nullable[@glib.Error_]],
) -> AppInfo = "moonbit_g_app_info_get_default_for_type_finish"
///|
/// [Upstream documentation](https://docs.gtk.org/gio/type_func.AppInfo.get_default_for_type_finish.html).
pub fn AppInfo::get_default_for_type_finish(
result : &IAsyncResult,
) -> AppInfo raise @glib.Error_ {
let error_ : Ref[@glib.Nullable[@glib.Error_]] = Ref(@glib.Nullable::null())
let result = moonbit_g_app_info_get_default_for_type_finish(
result.as_async_result(),
error_,
)
match error_.val.to_option() {
Some(e) => raise e
None => result
}
}
///|
#borrow(uri_scheme)
extern "c" fn moonbit_g_app_info_get_default_for_uri_scheme(
uri_scheme : Bytes,
) -> @glib.Nullable[AppInfo] = "moonbit_g_app_info_get_default_for_uri_scheme"
///|
/// [Upstream documentation](https://docs.gtk.org/gio/type_func.AppInfo.get_default_for_uri_scheme.html).
pub fn AppInfo::get_default_for_uri_scheme(uri_scheme : String) -> AppInfo? {
let raw_result = moonbit_g_app_info_get_default_for_uri_scheme(
@encoding/utf8.encode(uri_scheme),
)
raw_result.to_option()
}
///|
#borrow(result, error)
extern "c" fn moonbit_g_app_info_get_default_for_uri_scheme_finish(
result : AsyncResult,
error : Ref[@glib.Nullable[@glib.Error_]],
) -> AppInfo = "moonbit_g_app_info_get_default_for_uri_scheme_finish"
///|
/// [Upstream documentation](https://docs.gtk.org/gio/type_func.AppInfo.get_default_for_uri_scheme_finish.html).
pub fn AppInfo::get_default_for_uri_scheme_finish(
result : &IAsyncResult,
) -> AppInfo raise @glib.Error_ {
let error_ : Ref[@glib.Nullable[@glib.Error_]] = Ref(@glib.Nullable::null())
let result = moonbit_g_app_info_get_default_for_uri_scheme_finish(
result.as_async_result(),
error_,
)
match error_.val.to_option() {
Some(e) => raise e
None => result
}
}
///|
#borrow(content_type, result)
extern "c" fn moonbit_g_app_info_get_fallback_for_type(
content_type : Bytes,
result : Ref[FixedArray[AppInfo]],
) = "moonbit_g_app_info_get_fallback_for_type"
///|
/// [Upstream documentation](https://docs.gtk.org/gio/type_func.AppInfo.get_fallback_for_type.html).
pub fn AppInfo::get_fallback_for_type(content_type : String) -> Array[AppInfo] {
let result_ref : Ref[FixedArray[AppInfo]] = Ref([])
moonbit_g_app_info_get_fallback_for_type(
@encoding/utf8.encode(content_type),
result_ref,
)
let values : Array[AppInfo] = Array::new(capacity=result_ref.val.length())
for value in result_ref.val {
values.push(value)
}
values
}
///|
#borrow(content_type, result)
extern "c" fn moonbit_g_app_info_get_recommended_for_type(
content_type : Bytes,
result : Ref[FixedArray[AppInfo]],
) = "moonbit_g_app_info_get_recommended_for_type"
///|
/// [Upstream documentation](https://docs.gtk.org/gio/type_func.AppInfo.get_recommended_for_type.html).
pub fn AppInfo::get_recommended_for_type(
content_type : String,
) -> Array[AppInfo] {
let result_ref : Ref[FixedArray[AppInfo]] = Ref([])
moonbit_g_app_info_get_recommended_for_type(
@encoding/utf8.encode(content_type),
result_ref,
)
let values : Array[AppInfo] = Array::new(capacity=result_ref.val.length())
for value in result_ref.val {
values.push(value)
}
values
}
///|
#borrow(uri, context, error)
extern "c" fn moonbit_g_app_info_launch_default_for_uri(
uri : Bytes,
context : @glib.Nullable[AppLaunchContext],
error : Ref[@glib.Nullable[@glib.Error_]],
) -> Bool = "moonbit_g_app_info_launch_default_for_uri"
///|
/// [Upstream documentation](https://docs.gtk.org/gio/type_func.AppInfo.launch_default_for_uri.html).
pub fn AppInfo::launch_default_for_uri(
uri : String,
context : &IAppLaunchContext?,
) -> Bool raise @glib.Error_ {
let error_ : Ref[@glib.Nullable[@glib.Error_]] = Ref(@glib.Nullable::null())
let result = moonbit_g_app_info_launch_default_for_uri(
@encoding/utf8.encode(uri),
match context {
Some(v) => @glib.Nullable::some(v.as_app_launch_context())
None => @glib.Nullable::null()
},
error_,
)
match error_.val.to_option() {
Some(e) => raise e
None => result
}
}
///|
#borrow(result, error)
extern "c" fn moonbit_g_app_info_launch_default_for_uri_finish(
result : AsyncResult,
error : Ref[@glib.Nullable[@glib.Error_]],
) -> Bool = "moonbit_g_app_info_launch_default_for_uri_finish"
///|
/// [Upstream documentation](https://docs.gtk.org/gio/type_func.AppInfo.launch_default_for_uri_finish.html).
pub fn AppInfo::launch_default_for_uri_finish(
result : &IAsyncResult,
) -> Bool raise @glib.Error_ {
let error_ : Ref[@glib.Nullable[@glib.Error_]] = Ref(@glib.Nullable::null())
let result = moonbit_g_app_info_launch_default_for_uri_finish(
result.as_async_result(),
error_,
)
match error_.val.to_option() {
Some(e) => raise e
None => result
}
}
///|
#borrow(content_type)
extern "c" fn moonbit_g_app_info_reset_type_associations(content_type : Bytes) = "moonbit_g_app_info_reset_type_associations"
///|
/// [Upstream documentation](https://docs.gtk.org/gio/type_func.AppInfo.reset_type_associations.html).
pub fn AppInfo::reset_type_associations(content_type : String) -> Unit {
moonbit_g_app_info_reset_type_associations(
@encoding/utf8.encode(content_type),
)
}
///|
#borrow(self_, content_type, error)
extern "c" fn moonbit_g_app_info_add_supports_type(
self_ : AppInfo,
content_type : Bytes,
error : Ref[@glib.Nullable[@glib.Error_]],
) -> Bool = "moonbit_g_app_info_add_supports_type"
///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.AppInfo.add_supports_type.html).
pub fn AppInfo::add_supports_type(
self : AppInfo,
content_type : String,
) -> Bool raise @glib.Error_ {
let error_ : Ref[@glib.Nullable[@glib.Error_]] = Ref(@glib.Nullable::null())
let result = moonbit_g_app_info_add_supports_type(
self,
@encoding/utf8.encode(content_type),
error_,
)
match error_.val.to_option() {
Some(e) => raise e
None => ()
}
result
}
///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.AppInfo.can_delete.html).
#borrow(self)
pub extern "c" fn AppInfo::can_delete(self : AppInfo) -> Bool = "moonbit_g_app_info_can_delete"
///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.AppInfo.can_remove_supports_type.html).
#borrow(self)
pub extern "c" fn AppInfo::can_remove_supports_type(self : AppInfo) -> Bool = "moonbit_g_app_info_can_remove_supports_type"
///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.AppInfo.delete.html).
#borrow(self)
pub extern "c" fn AppInfo::delete(self : AppInfo) -> Bool = "moonbit_g_app_info_delete"
///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.AppInfo.dup.html).
#borrow(self)
pub extern "c" fn AppInfo::dup(self : AppInfo) -> AppInfo = "moonbit_g_app_info_dup"
///|
#borrow(self_, appinfo2)
extern "c" fn moonbit_g_app_info_equal(
self_ : AppInfo,
appinfo2 : AppInfo,
) -> Bool = "moonbit_g_app_info_equal"
///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.AppInfo.equal.html).
pub fn AppInfo::equal(self : AppInfo, appinfo2 : &IAppInfo) -> Bool {
moonbit_g_app_info_equal(self, appinfo2.as_app_info())
}
///|
#borrow(self_)
extern "c" fn moonbit_g_app_info_get_commandline(
self_ : AppInfo,
) -> @glib.Nullable[Bytes] = "moonbit_g_app_info_get_commandline"
///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.AppInfo.get_commandline.html).
pub fn AppInfo::get_commandline(self : AppInfo) -> String? {
let result = moonbit_g_app_info_get_commandline(self)
match result.to_option() {
Some(bytes) => Some(@encoding/utf8.decode_lossy(bytes))
None => None
}
}
///|
#borrow(self_)
extern "c" fn moonbit_g_app_info_get_description(
self_ : AppInfo,
) -> @glib.Nullable[Bytes] = "moonbit_g_app_info_get_description"
///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.AppInfo.get_description.html).
pub fn AppInfo::get_description(self : AppInfo) -> String? {
let result = moonbit_g_app_info_get_description(self)
match result.to_option() {
Some(bytes) => Some(@encoding/utf8.decode_lossy(bytes))
None => None
}
}
///|
#borrow(self_)
extern "c" fn moonbit_g_app_info_get_display_name(self_ : AppInfo) -> Bytes = "moonbit_g_app_info_get_display_name"
///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.AppInfo.get_display_name.html).
pub fn AppInfo::get_display_name(self : AppInfo) -> String {
@encoding/utf8.decode_lossy(moonbit_g_app_info_get_display_name(self))
}
///|
#borrow(self_)
extern "c" fn moonbit_g_app_info_get_executable(self_ : AppInfo) -> Bytes = "moonbit_g_app_info_get_executable"
///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.AppInfo.get_executable.html).
pub fn AppInfo::get_executable(self : AppInfo) -> String {
@encoding/utf8.decode_lossy(moonbit_g_app_info_get_executable(self))
}
///|
#borrow(self_)
extern "c" fn moonbit_g_app_info_get_icon(
self_ : AppInfo,
) -> @glib.Nullable[Icon] = "moonbit_g_app_info_get_icon"
///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.AppInfo.get_icon.html).
pub fn AppInfo::get_icon(self : AppInfo) -> Icon? {
let raw_result = moonbit_g_app_info_get_icon(self)
raw_result.to_option()
}
///|
#borrow(self_)
extern "c" fn moonbit_g_app_info_get_id(
self_ : AppInfo,
) -> @glib.Nullable[Bytes] = "moonbit_g_app_info_get_id"
///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.AppInfo.get_id.html).
pub fn AppInfo::get_id(self : AppInfo) -> String? {
let result = moonbit_g_app_info_get_id(self)
match result.to_option() {
Some(bytes) => Some(@encoding/utf8.decode_lossy(bytes))
None => None
}
}
///|
#borrow(self_)
extern "c" fn moonbit_g_app_info_get_name(self_ : AppInfo) -> Bytes = "moonbit_g_app_info_get_name"
///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.AppInfo.get_name.html).
pub fn AppInfo::get_name(self : AppInfo) -> String {
@encoding/utf8.decode_lossy(moonbit_g_app_info_get_name(self))
}
///|
#borrow(self_, result, error)
extern "c" fn moonbit_g_app_info_launch_uris_finish(
self_ : AppInfo,
result : AsyncResult,
error : Ref[@glib.Nullable[@glib.Error_]],
) -> Bool = "moonbit_g_app_info_launch_uris_finish"
///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.AppInfo.launch_uris_finish.html).
pub fn AppInfo::launch_uris_finish(
self : AppInfo,
result : &IAsyncResult,
) -> Bool raise @glib.Error_ {
let error_ : Ref[@glib.Nullable[@glib.Error_]] = Ref(@glib.Nullable::null())
let result = moonbit_g_app_info_launch_uris_finish(
self,
result.as_async_result(),
error_,
)
match error_.val.to_option() {
Some(e) => raise e
None => ()
}
result
}
///|
#borrow(self_, content_type, error)
extern "c" fn moonbit_g_app_info_remove_supports_type(
self_ : AppInfo,
content_type : Bytes,
error : Ref[@glib.Nullable[@glib.Error_]],
) -> Bool = "moonbit_g_app_info_remove_supports_type"
///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.AppInfo.remove_supports_type.html).
pub fn AppInfo::remove_supports_type(
self : AppInfo,
content_type : String,
) -> Bool raise @glib.Error_ {
let error_ : Ref[@glib.Nullable[@glib.Error_]] = Ref(@glib.Nullable::null())
let result = moonbit_g_app_info_remove_supports_type(
self,
@encoding/utf8.encode(content_type),
error_,
)
match error_.val.to_option() {
Some(e) => raise e
None => ()
}
result
}
///|
#borrow(self_, extension, error)
extern "c" fn moonbit_g_app_info_set_as_default_for_extension(
self_ : AppInfo,
extension : Bytes,
error : Ref[@glib.Nullable[@glib.Error_]],
) -> Bool = "moonbit_g_app_info_set_as_default_for_extension"
///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.AppInfo.set_as_default_for_extension.html).
pub fn AppInfo::set_as_default_for_extension(
self : AppInfo,
extension : String,
) -> Bool raise @glib.Error_ {
let error_ : Ref[@glib.Nullable[@glib.Error_]] = Ref(@glib.Nullable::null())
let result = moonbit_g_app_info_set_as_default_for_extension(
self,
@encoding/utf8.encode(extension),
error_,
)
match error_.val.to_option() {
Some(e) => raise e
None => ()
}
result
}
///|
#borrow(self_, content_type, error)
extern "c" fn moonbit_g_app_info_set_as_default_for_type(
self_ : AppInfo,
content_type : Bytes,
error : Ref[@glib.Nullable[@glib.Error_]],
) -> Bool = "moonbit_g_app_info_set_as_default_for_type"
///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.AppInfo.set_as_default_for_type.html).
pub fn AppInfo::set_as_default_for_type(
self : AppInfo,
content_type : String,
) -> Bool raise @glib.Error_ {
let error_ : Ref[@glib.Nullable[@glib.Error_]] = Ref(@glib.Nullable::null())
let result = moonbit_g_app_info_set_as_default_for_type(
self,
@encoding/utf8.encode(content_type),
error_,
)
match error_.val.to_option() {
Some(e) => raise e
None => ()
}
result
}
///|
#borrow(self_, content_type, error)
extern "c" fn moonbit_g_app_info_set_as_last_used_for_type(
self_ : AppInfo,
content_type : Bytes,
error : Ref[@glib.Nullable[@glib.Error_]],
) -> Bool = "moonbit_g_app_info_set_as_last_used_for_type"
///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.AppInfo.set_as_last_used_for_type.html).
pub fn AppInfo::set_as_last_used_for_type(
self : AppInfo,
content_type : String,
) -> Bool raise @glib.Error_ {
let error_ : Ref[@glib.Nullable[@glib.Error_]] = Ref(@glib.Nullable::null())
let result = moonbit_g_app_info_set_as_last_used_for_type(
self,
@encoding/utf8.encode(content_type),
error_,
)
match error_.val.to_option() {
Some(e) => raise e
None => ()
}
result
}
///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.AppInfo.should_show.html).
#borrow(self)
pub extern "c" fn AppInfo::should_show(self : AppInfo) -> Bool = "moonbit_g_app_info_should_show"
///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.AppInfo.supports_files.html).
#borrow(self)
pub extern "c" fn AppInfo::supports_files(self : AppInfo) -> Bool = "moonbit_g_app_info_supports_files"
///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.AppInfo.supports_uris.html).
#borrow(self)
pub extern "c" fn AppInfo::supports_uris(self : AppInfo) -> Bool = "moonbit_g_app_info_supports_uris"
///|
impl IAppInfo with fn add_supports_type(self, content_type) -> Bool raise @glib.Error_ {
self.as_app_info().add_supports_type(content_type)
}
///|
impl IAppInfo with fn can_delete(self) -> Bool {
self.as_app_info().can_delete()
}
///|
impl IAppInfo with fn can_remove_supports_type(self) -> Bool {
self.as_app_info().can_remove_supports_type()
}
///|
impl IAppInfo with fn delete(self) -> Bool {
self.as_app_info().delete()
}
///|
impl IAppInfo with fn dup(self) -> AppInfo {
self.as_app_info().dup()
}
///|
impl IAppInfo with fn equal(self, appinfo2) -> Bool {
self.as_app_info().equal(appinfo2)
}
///|
impl IAppInfo with fn get_commandline(self) -> String? {
self.as_app_info().get_commandline()
}
///|
impl IAppInfo with fn get_description(self) -> String? {
self.as_app_info().get_description()
}
///|
impl IAppInfo with fn get_display_name(self) -> String {
self.as_app_info().get_display_name()
}
///|
impl IAppInfo with fn get_executable(self) -> String {
self.as_app_info().get_executable()
}
///|
impl IAppInfo with fn get_icon(self) -> Icon? {
self.as_app_info().get_icon()
}
///|
impl IAppInfo with fn get_id(self) -> String? {
self.as_app_info().get_id()
}
///|
impl IAppInfo with fn get_name(self) -> String {
self.as_app_info().get_name()
}
///|
impl IAppInfo with fn launch_uris_finish(self, result) -> Bool raise @glib.Error_ {
self.as_app_info().launch_uris_finish(result)
}
///|
impl IAppInfo with fn remove_supports_type(self, content_type) -> Bool raise @glib.Error_ {
self.as_app_info().remove_supports_type(content_type)
}
///|
impl IAppInfo with fn set_as_default_for_extension(self, extension) -> Bool raise @glib.Error_ {
self.as_app_info().set_as_default_for_extension(extension)
}
///|
impl IAppInfo with fn set_as_default_for_type(self, content_type) -> Bool raise @glib.Error_ {
self.as_app_info().set_as_default_for_type(content_type)
}
///|
impl IAppInfo with fn set_as_last_used_for_type(self, content_type) -> Bool raise @glib.Error_ {
self.as_app_info().set_as_last_used_for_type(content_type)
}
///|
impl IAppInfo with fn should_show(self) -> Bool {
self.as_app_info().should_show()
}
///|
impl IAppInfo with fn supports_files(self) -> Bool {
self.as_app_info().supports_files()
}
///|
impl IAppInfo with fn supports_uris(self) -> Bool {
self.as_app_info().supports_uris()
}