use crate::{ffi,MobileProvider};
use glib::{translate::*};
glib::wrapper! {
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct CountryInfo(Shared<ffi::NMACountryInfo>);
match fn {
ref => |ptr| ffi::nma_country_info_ref(ptr),
unref => |ptr| ffi::nma_country_info_unref(ptr),
type_ => || ffi::nma_country_info_get_type(),
}
}
impl CountryInfo {
#[doc(alias = "nma_country_info_get_country_code")]
#[doc(alias = "get_country_code")]
pub fn country_code(&self) -> glib::GString {
unsafe {
from_glib_none(ffi::nma_country_info_get_country_code(self.to_glib_none().0))
}
}
#[doc(alias = "nma_country_info_get_country_name")]
#[doc(alias = "get_country_name")]
pub fn country_name(&self) -> glib::GString {
unsafe {
from_glib_none(ffi::nma_country_info_get_country_name(self.to_glib_none().0))
}
}
#[doc(alias = "nma_country_info_get_providers")]
#[doc(alias = "get_providers")]
pub fn providers(&self) -> Vec<MobileProvider> {
unsafe {
FromGlibPtrContainer::from_glib_none(ffi::nma_country_info_get_providers(self.to_glib_none().0))
}
}
}