// This file was generated by gir (https://github.com/gtk-rs/gir)
// from
// from gir-files (https://github.com/gtk-rs/gir-files.git)
// DO NOT EDIT
#![allow(deprecated)]

use glib::translate::*;
use std::fmt;

glib::wrapper! {
    #[doc(alias = "TrackerNamespaceManager")]
    pub struct NamespaceManager(Object<ffi::TrackerNamespaceManager, ffi::TrackerNamespaceManagerClass>);

    match fn {
        type_ => || ffi::tracker_namespace_manager_get_type(),
    }
}

impl NamespaceManager {
    #[doc(alias = "tracker_namespace_manager_new")]
    pub fn new() -> NamespaceManager {
        assert_initialized_main_thread!();
        unsafe { from_glib_full(ffi::tracker_namespace_manager_new()) }
    }

    #[doc(alias = "tracker_namespace_manager_add_prefix")]
    pub fn add_prefix(&self, prefix: &str, ns: &str) {
        unsafe {
            ffi::tracker_namespace_manager_add_prefix(
                self.to_glib_none().0,
                prefix.to_glib_none().0,
                ns.to_glib_none().0,
            );
        }
    }

    #[cfg(any(feature = "v3_3", feature = "dox"))]
    #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_3")))]
    #[doc(alias = "tracker_namespace_manager_compress_uri")]
    pub fn compress_uri(&self, uri: &str) -> Option<glib::GString> {
        unsafe {
            from_glib_full(ffi::tracker_namespace_manager_compress_uri(
                self.to_glib_none().0,
                uri.to_glib_none().0,
            ))
        }
    }

    #[doc(alias = "tracker_namespace_manager_expand_uri")]
    pub fn expand_uri(&self, compact_uri: &str) -> Option<glib::GString> {
        unsafe {
            from_glib_full(ffi::tracker_namespace_manager_expand_uri(
                self.to_glib_none().0,
                compact_uri.to_glib_none().0,
            ))
        }
    }

    #[doc(alias = "tracker_namespace_manager_has_prefix")]
    pub fn has_prefix(&self, prefix: &str) -> bool {
        unsafe {
            from_glib(ffi::tracker_namespace_manager_has_prefix(
                self.to_glib_none().0,
                prefix.to_glib_none().0,
            ))
        }
    }

    #[doc(alias = "tracker_namespace_manager_lookup_prefix")]
    pub fn lookup_prefix(&self, prefix: &str) -> Option<glib::GString> {
        unsafe {
            from_glib_none(ffi::tracker_namespace_manager_lookup_prefix(
                self.to_glib_none().0,
                prefix.to_glib_none().0,
            ))
        }
    }

    #[doc(alias = "tracker_namespace_manager_print_turtle")]
    pub fn print_turtle(&self) -> Option<glib::GString> {
        unsafe {
            from_glib_full(ffi::tracker_namespace_manager_print_turtle(
                self.to_glib_none().0,
            ))
        }
    }

    #[cfg_attr(feature = "v3_3", deprecated = "Since 3.3")]
    #[allow(deprecated)]
    #[doc(alias = "tracker_namespace_manager_get_default")]
    #[doc(alias = "get_default")]
    #[allow(clippy::should_implement_trait)]
    pub fn default() -> Option<NamespaceManager> {
        assert_initialized_main_thread!();
        unsafe { from_glib_none(ffi::tracker_namespace_manager_get_default()) }
    }
}

impl Default for NamespaceManager {
    fn default() -> Self {
        Self::new()
    }
}

impl fmt::Display for NamespaceManager {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        f.write_str("NamespaceManager")
    }
}
