#![allow(deprecated)]
use crate::MimeInfo;
use glib::{prelude::*, translate::*};
glib::wrapper! {
#[doc(alias = "WebKitPlugin")]
pub struct Plugin(Object<ffi::WebKitPlugin, ffi::WebKitPluginClass>);
match fn {
type_ => || ffi::webkit_plugin_get_type(),
}
}
impl Plugin {
pub const NONE: Option<&'static Plugin> = None;
}
mod sealed {
pub trait Sealed {}
impl<T: super::IsA<super::Plugin>> Sealed for T {}
}
pub trait PluginExt: IsA<Plugin> + sealed::Sealed + 'static {
#[cfg_attr(feature = "v2_32", deprecated = "Since 2.32")]
#[allow(deprecated)]
#[doc(alias = "webkit_plugin_get_description")]
#[doc(alias = "get_description")]
fn description(&self) -> Option<glib::GString> {
unsafe {
from_glib_none(ffi::webkit_plugin_get_description(
self.as_ref().to_glib_none().0,
))
}
}
#[cfg_attr(feature = "v2_32", deprecated = "Since 2.32")]
#[allow(deprecated)]
#[doc(alias = "webkit_plugin_get_mime_info_list")]
#[doc(alias = "get_mime_info_list")]
fn mime_info_list(&self) -> Vec<MimeInfo> {
unsafe {
FromGlibPtrContainer::from_glib_none(ffi::webkit_plugin_get_mime_info_list(
self.as_ref().to_glib_none().0,
))
}
}
#[cfg_attr(feature = "v2_32", deprecated = "Since 2.32")]
#[allow(deprecated)]
#[doc(alias = "webkit_plugin_get_name")]
#[doc(alias = "get_name")]
fn name(&self) -> Option<glib::GString> {
unsafe { from_glib_none(ffi::webkit_plugin_get_name(self.as_ref().to_glib_none().0)) }
}
#[cfg_attr(feature = "v2_32", deprecated = "Since 2.32")]
#[allow(deprecated)]
#[doc(alias = "webkit_plugin_get_path")]
#[doc(alias = "get_path")]
fn path(&self) -> Option<glib::GString> {
unsafe { from_glib_none(ffi::webkit_plugin_get_path(self.as_ref().to_glib_none().0)) }
}
}
impl<O: IsA<Plugin>> PluginExt for O {}