// 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::{Report, ReportingDetails, Runner, ffi};
use glib::{prelude::*, translate::*};

glib::wrapper! {
    #[doc(alias = "GstValidateReporter")]
    pub struct Reporter(Interface<ffi::GstValidateReporter, ffi::GstValidateReporterInterface>);

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

impl Reporter {
    pub const NONE: Option<&'static Reporter> = None;
}

unsafe impl Send for Reporter {}
unsafe impl Sync for Reporter {}

pub trait ReporterExt: IsA<Reporter> + 'static {
    #[doc(alias = "gst_validate_reporter_get_name")]
    #[doc(alias = "get_name")]
    fn name(&self) -> Option<glib::GString> {
        unsafe {
            from_glib_none(ffi::gst_validate_reporter_get_name(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    #[doc(alias = "gst_validate_reporter_get_pipeline")]
    #[doc(alias = "get_pipeline")]
    fn pipeline(&self) -> Option<gst::Pipeline> {
        unsafe {
            from_glib_full(ffi::gst_validate_reporter_get_pipeline(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    //#[doc(alias = "gst_validate_reporter_get_report")]
    //#[doc(alias = "get_report")]
    //fn report(&self, issue_id: /*Ignored*/IssueId) -> Option<Report> {
    //    unsafe { TODO: call ffi:gst_validate_reporter_get_report() }
    //}

    #[doc(alias = "gst_validate_reporter_get_reporting_level")]
    #[doc(alias = "get_reporting_level")]
    fn reporting_level(&self) -> ReportingDetails {
        unsafe {
            from_glib(ffi::gst_validate_reporter_get_reporting_level(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    #[doc(alias = "gst_validate_reporter_get_reports")]
    #[doc(alias = "get_reports")]
    fn reports(&self) -> Vec<Report> {
        unsafe {
            FromGlibPtrContainer::from_glib_full(ffi::gst_validate_reporter_get_reports(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    #[doc(alias = "gst_validate_reporter_get_reports_count")]
    #[doc(alias = "get_reports_count")]
    fn reports_count(&self) -> i32 {
        unsafe { ffi::gst_validate_reporter_get_reports_count(self.as_ref().to_glib_none().0) }
    }

    #[doc(alias = "gst_validate_reporter_get_runner")]
    #[doc(alias = "get_runner")]
    fn runner(&self) -> Option<Runner> {
        unsafe {
            from_glib_full(ffi::gst_validate_reporter_get_runner(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    #[doc(alias = "gst_validate_reporter_init")]
    fn init(&self, name: &str) {
        unsafe {
            ffi::gst_validate_reporter_init(self.as_ref().to_glib_none().0, name.to_glib_none().0);
        }
    }

    #[doc(alias = "gst_validate_reporter_purge_reports")]
    fn purge_reports(&self) {
        unsafe {
            ffi::gst_validate_reporter_purge_reports(self.as_ref().to_glib_none().0);
        }
    }

    //#[doc(alias = "gst_validate_reporter_report_simple")]
    //fn report_simple(&self, issue_id: /*Ignored*/IssueId, message: &str) {
    //    unsafe { TODO: call ffi:gst_validate_reporter_report_simple() }
    //}

    #[doc(alias = "gst_validate_reporter_set_handle_g_logs")]
    fn set_handle_g_logs(&self) {
        unsafe {
            ffi::gst_validate_reporter_set_handle_g_logs(self.as_ref().to_glib_none().0);
        }
    }

    #[doc(alias = "gst_validate_reporter_set_name")]
    fn set_name(&self, name: Option<glib::GString>) {
        unsafe {
            ffi::gst_validate_reporter_set_name(
                self.as_ref().to_glib_none().0,
                name.into_glib_ptr(),
            );
        }
    }

    #[doc(alias = "gst_validate_reporter_set_runner")]
    fn set_runner(&self, runner: &impl IsA<Runner>) {
        unsafe {
            ffi::gst_validate_reporter_set_runner(
                self.as_ref().to_glib_none().0,
                runner.as_ref().to_glib_none().0,
            );
        }
    }

    #[doc(alias = "validate-runner")]
    fn validate_runner(&self) -> Option<Runner> {
        ObjectExt::property(self.as_ref(), "validate-runner")
    }
}

impl<O: IsA<Reporter>> ReporterExt for O {}
