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

use glib::object::IsA;
use glib::translate::*;
use gtk;
use handy_sys;
use std::fmt;
use HeaderBar;
use HeaderGroup;
use HeaderGroupChildType;

glib_wrapper! {
    pub struct HeaderGroupChild(Object<handy_sys::HdyHeaderGroupChild, handy_sys::HdyHeaderGroupChildClass, HeaderGroupChildClass>);

    match fn {
        get_type => || handy_sys::hdy_header_group_child_get_type(),
    }
}

pub const NONE_HEADER_GROUP_CHILD: Option<&HeaderGroupChild> = None;

pub trait HeaderGroupChildExt: 'static {
    fn get_child_type(&self) -> HeaderGroupChildType;

    fn get_gtk_header_bar(&self) -> Option<gtk::HeaderBar>;

    fn get_header_bar(&self) -> Option<HeaderBar>;

    fn get_header_group(&self) -> Option<HeaderGroup>;
}

impl<O: IsA<HeaderGroupChild>> HeaderGroupChildExt for O {
    fn get_child_type(&self) -> HeaderGroupChildType {
        unsafe {
            from_glib(handy_sys::hdy_header_group_child_get_child_type(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    fn get_gtk_header_bar(&self) -> Option<gtk::HeaderBar> {
        unsafe {
            from_glib_none(handy_sys::hdy_header_group_child_get_gtk_header_bar(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    fn get_header_bar(&self) -> Option<HeaderBar> {
        unsafe {
            from_glib_none(handy_sys::hdy_header_group_child_get_header_bar(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    fn get_header_group(&self) -> Option<HeaderGroup> {
        unsafe {
            from_glib_none(handy_sys::hdy_header_group_child_get_header_group(
                self.as_ref().to_glib_none().0,
            ))
        }
    }
}

impl fmt::Display for HeaderGroupChild {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(f, "HeaderGroupChild")
    }
}
