// This file was generated by gir (https://github.com/gtk-rs/gir)
// from
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT

use crate::{MoviePlayMode, ffi};
use glib::translate::*;

glib::wrapper! {
    #[doc(alias = "PopplerMovie")]
    pub struct Movie(Object<ffi::PopplerMovie>);

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

impl Movie {
    #[cfg(feature = "v0_80")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v0_80")))]
    #[doc(alias = "poppler_movie_get_duration")]
    #[doc(alias = "get_duration")]
    pub fn duration(&self) -> u64 {
        unsafe { ffi::poppler_movie_get_duration(self.to_glib_none().0) }
    }

    #[doc(alias = "poppler_movie_get_filename")]
    #[doc(alias = "get_filename")]
    pub fn filename(&self) -> Option<glib::GString> {
        unsafe { from_glib_none(ffi::poppler_movie_get_filename(self.to_glib_none().0)) }
    }

    #[doc(alias = "poppler_movie_get_play_mode")]
    #[doc(alias = "get_play_mode")]
    pub fn play_mode(&self) -> MoviePlayMode {
        unsafe { from_glib(ffi::poppler_movie_get_play_mode(self.to_glib_none().0)) }
    }

    #[cfg(feature = "v0_80")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v0_80")))]
    #[doc(alias = "poppler_movie_get_rate")]
    #[doc(alias = "get_rate")]
    pub fn rate(&self) -> f64 {
        unsafe { ffi::poppler_movie_get_rate(self.to_glib_none().0) }
    }

    #[cfg(feature = "v0_80")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v0_80")))]
    #[doc(alias = "poppler_movie_get_rotation_angle")]
    #[doc(alias = "get_rotation_angle")]
    pub fn rotation_angle(&self) -> libc::c_ushort {
        unsafe { ffi::poppler_movie_get_rotation_angle(self.to_glib_none().0) }
    }

    #[cfg(feature = "v0_80")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v0_80")))]
    #[doc(alias = "poppler_movie_get_start")]
    #[doc(alias = "get_start")]
    pub fn start(&self) -> u64 {
        unsafe { ffi::poppler_movie_get_start(self.to_glib_none().0) }
    }

    #[cfg(feature = "v0_80")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v0_80")))]
    #[doc(alias = "poppler_movie_get_volume")]
    #[doc(alias = "get_volume")]
    pub fn volume(&self) -> f64 {
        unsafe { ffi::poppler_movie_get_volume(self.to_glib_none().0) }
    }

    #[cfg(feature = "v0_80")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v0_80")))]
    #[doc(alias = "poppler_movie_is_synchronous")]
    pub fn is_synchronous(&self) -> bool {
        unsafe { from_glib(ffi::poppler_movie_is_synchronous(self.to_glib_none().0)) }
    }

    #[doc(alias = "poppler_movie_need_poster")]
    pub fn need_poster(&self) -> bool {
        unsafe { from_glib(ffi::poppler_movie_need_poster(self.to_glib_none().0)) }
    }

    #[doc(alias = "poppler_movie_show_controls")]
    pub fn show_controls(&self) -> bool {
        unsafe { from_glib(ffi::poppler_movie_show_controls(self.to_glib_none().0)) }
    }
}
