atk/auto/
streamable_content.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// DO NOT EDIT
4
5use atk_sys;
6use glib::object::IsA;
7use glib::translate::*;
8use glib::GString;
9use std::fmt;
10
11glib_wrapper! {
12    pub struct StreamableContent(Interface<atk_sys::AtkStreamableContent>);
13
14    match fn {
15        get_type => || atk_sys::atk_streamable_content_get_type(),
16    }
17}
18
19pub const NONE_STREAMABLE_CONTENT: Option<&StreamableContent> = None;
20
21pub trait StreamableContentExt: 'static {
22    fn get_mime_type(&self, i: i32) -> Option<GString>;
23
24    fn get_n_mime_types(&self) -> i32;
25
26    //fn get_stream(&self, mime_type: &str) -> /*Ignored*/Option<glib::IOChannel>;
27
28    fn get_uri(&self, mime_type: &str) -> Option<GString>;
29}
30
31impl<O: IsA<StreamableContent>> StreamableContentExt for O {
32    fn get_mime_type(&self, i: i32) -> Option<GString> {
33        unsafe {
34            from_glib_none(atk_sys::atk_streamable_content_get_mime_type(
35                self.as_ref().to_glib_none().0,
36                i,
37            ))
38        }
39    }
40
41    fn get_n_mime_types(&self) -> i32 {
42        unsafe { atk_sys::atk_streamable_content_get_n_mime_types(self.as_ref().to_glib_none().0) }
43    }
44
45    //fn get_stream(&self, mime_type: &str) -> /*Ignored*/Option<glib::IOChannel> {
46    //    unsafe { TODO: call atk_sys:atk_streamable_content_get_stream() }
47    //}
48
49    fn get_uri(&self, mime_type: &str) -> Option<GString> {
50        unsafe {
51            from_glib_none(atk_sys::atk_streamable_content_get_uri(
52                self.as_ref().to_glib_none().0,
53                mime_type.to_glib_none().0,
54            ))
55        }
56    }
57}
58
59impl fmt::Display for StreamableContent {
60    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
61        write!(f, "StreamableContent")
62    }
63}