use crate::DOMDOMWindow;
use crate::DOMDocument;
use crate::DOMElement;
use crate::DOMEventTarget;
use crate::DOMHTMLElement;
use crate::DOMNode;
use crate::DOMObject;
use glib::object::Cast;
use glib::object::IsA;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use std::boxed::Box as Box_;
use std::fmt;
use std::mem::transmute;
glib::wrapper! {
#[doc(alias = "WebKitDOMHTMLFrameElement")]
pub struct DOMHTMLFrameElement(Object<ffi::WebKitDOMHTMLFrameElement, ffi::WebKitDOMHTMLFrameElementClass>) @extends DOMHTMLElement, DOMElement, DOMNode, DOMObject, @implements DOMEventTarget;
match fn {
type_ => || ffi::webkit_dom_html_frame_element_get_type(),
}
}
impl DOMHTMLFrameElement {
pub const NONE: Option<&'static DOMHTMLFrameElement> = None;
}
pub trait DOMHTMLFrameElementExt: 'static {
#[cfg_attr(feature = "v2_22", deprecated = "Since 2.22")]
#[doc(alias = "webkit_dom_html_frame_element_get_content_document")]
#[doc(alias = "get_content_document")]
fn content_document(&self) -> Option<DOMDocument>;
#[cfg_attr(feature = "v2_22", deprecated = "Since 2.22")]
#[doc(alias = "webkit_dom_html_frame_element_get_content_window")]
#[doc(alias = "get_content_window")]
fn content_window(&self) -> Option<DOMDOMWindow>;
#[cfg_attr(feature = "v2_22", deprecated = "Since 2.22")]
#[doc(alias = "webkit_dom_html_frame_element_get_frame_border")]
#[doc(alias = "get_frame_border")]
fn frame_border(&self) -> Option<glib::GString>;
#[cfg_attr(feature = "v2_22", deprecated = "Since 2.22")]
#[doc(alias = "webkit_dom_html_frame_element_get_height")]
#[doc(alias = "get_height")]
fn height(&self) -> libc::c_long;
#[cfg_attr(feature = "v2_22", deprecated = "Since 2.22")]
#[doc(alias = "webkit_dom_html_frame_element_get_long_desc")]
#[doc(alias = "get_long_desc")]
fn long_desc(&self) -> Option<glib::GString>;
#[cfg_attr(feature = "v2_22", deprecated = "Since 2.22")]
#[doc(alias = "webkit_dom_html_frame_element_get_margin_height")]
#[doc(alias = "get_margin_height")]
fn margin_height(&self) -> Option<glib::GString>;
#[cfg_attr(feature = "v2_22", deprecated = "Since 2.22")]
#[doc(alias = "webkit_dom_html_frame_element_get_margin_width")]
#[doc(alias = "get_margin_width")]
fn margin_width(&self) -> Option<glib::GString>;
#[cfg_attr(feature = "v2_22", deprecated = "Since 2.22")]
#[doc(alias = "webkit_dom_html_frame_element_get_name")]
#[doc(alias = "get_name")]
fn name(&self) -> Option<glib::GString>;
#[cfg_attr(feature = "v2_22", deprecated = "Since 2.22")]
#[doc(alias = "webkit_dom_html_frame_element_get_no_resize")]
#[doc(alias = "get_no_resize")]
fn is_no_resize(&self) -> bool;
#[cfg_attr(feature = "v2_22", deprecated = "Since 2.22")]
#[doc(alias = "webkit_dom_html_frame_element_get_scrolling")]
#[doc(alias = "get_scrolling")]
fn scrolling(&self) -> Option<glib::GString>;
#[cfg_attr(feature = "v2_22", deprecated = "Since 2.22")]
#[doc(alias = "webkit_dom_html_frame_element_get_src")]
#[doc(alias = "get_src")]
fn src(&self) -> Option<glib::GString>;
#[cfg_attr(feature = "v2_22", deprecated = "Since 2.22")]
#[doc(alias = "webkit_dom_html_frame_element_get_width")]
#[doc(alias = "get_width")]
fn width(&self) -> libc::c_long;
#[cfg_attr(feature = "v2_22", deprecated = "Since 2.22")]
#[doc(alias = "webkit_dom_html_frame_element_set_frame_border")]
fn set_frame_border(&self, value: &str);
#[cfg_attr(feature = "v2_22", deprecated = "Since 2.22")]
#[doc(alias = "webkit_dom_html_frame_element_set_long_desc")]
fn set_long_desc(&self, value: &str);
#[cfg_attr(feature = "v2_22", deprecated = "Since 2.22")]
#[doc(alias = "webkit_dom_html_frame_element_set_margin_height")]
fn set_margin_height(&self, value: &str);
#[cfg_attr(feature = "v2_22", deprecated = "Since 2.22")]
#[doc(alias = "webkit_dom_html_frame_element_set_margin_width")]
fn set_margin_width(&self, value: &str);
#[cfg_attr(feature = "v2_22", deprecated = "Since 2.22")]
#[doc(alias = "webkit_dom_html_frame_element_set_name")]
fn set_name(&self, value: &str);
#[cfg_attr(feature = "v2_22", deprecated = "Since 2.22")]
#[doc(alias = "webkit_dom_html_frame_element_set_no_resize")]
fn set_no_resize(&self, value: bool);
#[cfg_attr(feature = "v2_22", deprecated = "Since 2.22")]
#[doc(alias = "webkit_dom_html_frame_element_set_scrolling")]
fn set_scrolling(&self, value: &str);
#[cfg_attr(feature = "v2_22", deprecated = "Since 2.22")]
#[doc(alias = "webkit_dom_html_frame_element_set_src")]
fn set_src(&self, value: &str);
#[doc(alias = "content-document")]
fn connect_content_document_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
#[doc(alias = "content-window")]
fn connect_content_window_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
#[doc(alias = "frame-border")]
fn connect_frame_border_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
#[doc(alias = "height")]
fn connect_height_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
#[doc(alias = "long-desc")]
fn connect_long_desc_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
#[doc(alias = "margin-height")]
fn connect_margin_height_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
#[doc(alias = "margin-width")]
fn connect_margin_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
#[doc(alias = "name")]
fn connect_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
#[doc(alias = "no-resize")]
fn connect_no_resize_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
#[doc(alias = "scrolling")]
fn connect_scrolling_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
#[doc(alias = "src")]
fn connect_src_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
#[doc(alias = "width")]
fn connect_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
}
impl<O: IsA<DOMHTMLFrameElement>> DOMHTMLFrameElementExt for O {
fn content_document(&self) -> Option<DOMDocument> {
unsafe {
from_glib_none(ffi::webkit_dom_html_frame_element_get_content_document(self.as_ref().to_glib_none().0))
}
}
fn content_window(&self) -> Option<DOMDOMWindow> {
unsafe {
from_glib_full(ffi::webkit_dom_html_frame_element_get_content_window(self.as_ref().to_glib_none().0))
}
}
fn frame_border(&self) -> Option<glib::GString> {
unsafe {
from_glib_full(ffi::webkit_dom_html_frame_element_get_frame_border(self.as_ref().to_glib_none().0))
}
}
fn height(&self) -> libc::c_long {
unsafe {
ffi::webkit_dom_html_frame_element_get_height(self.as_ref().to_glib_none().0)
}
}
fn long_desc(&self) -> Option<glib::GString> {
unsafe {
from_glib_full(ffi::webkit_dom_html_frame_element_get_long_desc(self.as_ref().to_glib_none().0))
}
}
fn margin_height(&self) -> Option<glib::GString> {
unsafe {
from_glib_full(ffi::webkit_dom_html_frame_element_get_margin_height(self.as_ref().to_glib_none().0))
}
}
fn margin_width(&self) -> Option<glib::GString> {
unsafe {
from_glib_full(ffi::webkit_dom_html_frame_element_get_margin_width(self.as_ref().to_glib_none().0))
}
}
fn name(&self) -> Option<glib::GString> {
unsafe {
from_glib_full(ffi::webkit_dom_html_frame_element_get_name(self.as_ref().to_glib_none().0))
}
}
fn is_no_resize(&self) -> bool {
unsafe {
from_glib(ffi::webkit_dom_html_frame_element_get_no_resize(self.as_ref().to_glib_none().0))
}
}
fn scrolling(&self) -> Option<glib::GString> {
unsafe {
from_glib_full(ffi::webkit_dom_html_frame_element_get_scrolling(self.as_ref().to_glib_none().0))
}
}
fn src(&self) -> Option<glib::GString> {
unsafe {
from_glib_full(ffi::webkit_dom_html_frame_element_get_src(self.as_ref().to_glib_none().0))
}
}
fn width(&self) -> libc::c_long {
unsafe {
ffi::webkit_dom_html_frame_element_get_width(self.as_ref().to_glib_none().0)
}
}
fn set_frame_border(&self, value: &str) {
unsafe {
ffi::webkit_dom_html_frame_element_set_frame_border(self.as_ref().to_glib_none().0, value.to_glib_none().0);
}
}
fn set_long_desc(&self, value: &str) {
unsafe {
ffi::webkit_dom_html_frame_element_set_long_desc(self.as_ref().to_glib_none().0, value.to_glib_none().0);
}
}
fn set_margin_height(&self, value: &str) {
unsafe {
ffi::webkit_dom_html_frame_element_set_margin_height(self.as_ref().to_glib_none().0, value.to_glib_none().0);
}
}
fn set_margin_width(&self, value: &str) {
unsafe {
ffi::webkit_dom_html_frame_element_set_margin_width(self.as_ref().to_glib_none().0, value.to_glib_none().0);
}
}
fn set_name(&self, value: &str) {
unsafe {
ffi::webkit_dom_html_frame_element_set_name(self.as_ref().to_glib_none().0, value.to_glib_none().0);
}
}
fn set_no_resize(&self, value: bool) {
unsafe {
ffi::webkit_dom_html_frame_element_set_no_resize(self.as_ref().to_glib_none().0, value.into_glib());
}
}
fn set_scrolling(&self, value: &str) {
unsafe {
ffi::webkit_dom_html_frame_element_set_scrolling(self.as_ref().to_glib_none().0, value.to_glib_none().0);
}
}
fn set_src(&self, value: &str) {
unsafe {
ffi::webkit_dom_html_frame_element_set_src(self.as_ref().to_glib_none().0, value.to_glib_none().0);
}
}
fn connect_content_document_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_content_document_trampoline<P: IsA<DOMHTMLFrameElement>, F: Fn(&P) + 'static>(this: *mut ffi::WebKitDOMHTMLFrameElement, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
let f: &F = &*(f as *const F);
f(DOMHTMLFrameElement::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::content-document\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(notify_content_document_trampoline::<Self, F> as *const ())), Box_::into_raw(f))
}
}
fn connect_content_window_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_content_window_trampoline<P: IsA<DOMHTMLFrameElement>, F: Fn(&P) + 'static>(this: *mut ffi::WebKitDOMHTMLFrameElement, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
let f: &F = &*(f as *const F);
f(DOMHTMLFrameElement::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::content-window\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(notify_content_window_trampoline::<Self, F> as *const ())), Box_::into_raw(f))
}
}
fn connect_frame_border_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_frame_border_trampoline<P: IsA<DOMHTMLFrameElement>, F: Fn(&P) + 'static>(this: *mut ffi::WebKitDOMHTMLFrameElement, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
let f: &F = &*(f as *const F);
f(DOMHTMLFrameElement::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::frame-border\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(notify_frame_border_trampoline::<Self, F> as *const ())), Box_::into_raw(f))
}
}
fn connect_height_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_height_trampoline<P: IsA<DOMHTMLFrameElement>, F: Fn(&P) + 'static>(this: *mut ffi::WebKitDOMHTMLFrameElement, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
let f: &F = &*(f as *const F);
f(DOMHTMLFrameElement::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::height\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(notify_height_trampoline::<Self, F> as *const ())), Box_::into_raw(f))
}
}
fn connect_long_desc_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_long_desc_trampoline<P: IsA<DOMHTMLFrameElement>, F: Fn(&P) + 'static>(this: *mut ffi::WebKitDOMHTMLFrameElement, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
let f: &F = &*(f as *const F);
f(DOMHTMLFrameElement::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::long-desc\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(notify_long_desc_trampoline::<Self, F> as *const ())), Box_::into_raw(f))
}
}
fn connect_margin_height_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_margin_height_trampoline<P: IsA<DOMHTMLFrameElement>, F: Fn(&P) + 'static>(this: *mut ffi::WebKitDOMHTMLFrameElement, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
let f: &F = &*(f as *const F);
f(DOMHTMLFrameElement::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::margin-height\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(notify_margin_height_trampoline::<Self, F> as *const ())), Box_::into_raw(f))
}
}
fn connect_margin_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_margin_width_trampoline<P: IsA<DOMHTMLFrameElement>, F: Fn(&P) + 'static>(this: *mut ffi::WebKitDOMHTMLFrameElement, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
let f: &F = &*(f as *const F);
f(DOMHTMLFrameElement::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::margin-width\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(notify_margin_width_trampoline::<Self, F> as *const ())), Box_::into_raw(f))
}
}
fn connect_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_name_trampoline<P: IsA<DOMHTMLFrameElement>, F: Fn(&P) + 'static>(this: *mut ffi::WebKitDOMHTMLFrameElement, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
let f: &F = &*(f as *const F);
f(DOMHTMLFrameElement::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::name\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(notify_name_trampoline::<Self, F> as *const ())), Box_::into_raw(f))
}
}
fn connect_no_resize_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_no_resize_trampoline<P: IsA<DOMHTMLFrameElement>, F: Fn(&P) + 'static>(this: *mut ffi::WebKitDOMHTMLFrameElement, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
let f: &F = &*(f as *const F);
f(DOMHTMLFrameElement::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::no-resize\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(notify_no_resize_trampoline::<Self, F> as *const ())), Box_::into_raw(f))
}
}
fn connect_scrolling_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_scrolling_trampoline<P: IsA<DOMHTMLFrameElement>, F: Fn(&P) + 'static>(this: *mut ffi::WebKitDOMHTMLFrameElement, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
let f: &F = &*(f as *const F);
f(DOMHTMLFrameElement::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::scrolling\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(notify_scrolling_trampoline::<Self, F> as *const ())), Box_::into_raw(f))
}
}
fn connect_src_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_src_trampoline<P: IsA<DOMHTMLFrameElement>, F: Fn(&P) + 'static>(this: *mut ffi::WebKitDOMHTMLFrameElement, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
let f: &F = &*(f as *const F);
f(DOMHTMLFrameElement::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::src\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(notify_src_trampoline::<Self, F> as *const ())), Box_::into_raw(f))
}
}
fn connect_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_width_trampoline<P: IsA<DOMHTMLFrameElement>, F: Fn(&P) + 'static>(this: *mut ffi::WebKitDOMHTMLFrameElement, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
let f: &F = &*(f as *const F);
f(DOMHTMLFrameElement::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::width\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(notify_width_trampoline::<Self, F> as *const ())), Box_::into_raw(f))
}
}
}
impl fmt::Display for DOMHTMLFrameElement {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str("DOMHTMLFrameElement")
}
}