// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
// DO NOT EDIT

use crate::ffi;
use glib::translate::*;

glib::wrapper! {
    #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
    pub struct InstallPluginsContext(Boxed<ffi::GstInstallPluginsContext>);

    match fn {
        copy => |ptr| ffi::gst_install_plugins_context_copy(mut_override(ptr)),
        free => |ptr| ffi::gst_install_plugins_context_free(ptr),
        type_ => || ffi::gst_install_plugins_context_get_type(),
    }
}

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

    #[doc(alias = "gst_install_plugins_context_set_confirm_search")]
    pub fn set_confirm_search(&mut self, confirm_search: bool) {
        unsafe {
            ffi::gst_install_plugins_context_set_confirm_search(
                self.to_glib_none_mut().0,
                confirm_search.into_glib(),
            );
        }
    }

    #[doc(alias = "gst_install_plugins_context_set_desktop_id")]
    pub fn set_desktop_id(&mut self, desktop_id: &str) {
        unsafe {
            ffi::gst_install_plugins_context_set_desktop_id(
                self.to_glib_none_mut().0,
                desktop_id.to_glib_none().0,
            );
        }
    }

    #[doc(alias = "gst_install_plugins_context_set_startup_notification_id")]
    pub fn set_startup_notification_id(&mut self, startup_id: &str) {
        unsafe {
            ffi::gst_install_plugins_context_set_startup_notification_id(
                self.to_glib_none_mut().0,
                startup_id.to_glib_none().0,
            );
        }
    }

    #[doc(alias = "gst_install_plugins_context_set_xid")]
    pub fn set_xid(&mut self, xid: u32) {
        unsafe {
            ffi::gst_install_plugins_context_set_xid(self.to_glib_none_mut().0, xid);
        }
    }
}

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

unsafe impl Send for InstallPluginsContext {}
unsafe impl Sync for InstallPluginsContext {}
