gio/auto/
remote_action_group.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 gio_sys;
6use glib;
7use glib::object::IsA;
8use glib::translate::*;
9use std::fmt;
10use ActionGroup;
11
12glib_wrapper! {
13    pub struct RemoteActionGroup(Interface<gio_sys::GRemoteActionGroup>) @requires ActionGroup;
14
15    match fn {
16        get_type => || gio_sys::g_remote_action_group_get_type(),
17    }
18}
19
20pub const NONE_REMOTE_ACTION_GROUP: Option<&RemoteActionGroup> = None;
21
22pub trait RemoteActionGroupExt: 'static {
23    fn activate_action_full(
24        &self,
25        action_name: &str,
26        parameter: Option<&glib::Variant>,
27        platform_data: &glib::Variant,
28    );
29
30    fn change_action_state_full(
31        &self,
32        action_name: &str,
33        value: &glib::Variant,
34        platform_data: &glib::Variant,
35    );
36}
37
38impl<O: IsA<RemoteActionGroup>> RemoteActionGroupExt for O {
39    fn activate_action_full(
40        &self,
41        action_name: &str,
42        parameter: Option<&glib::Variant>,
43        platform_data: &glib::Variant,
44    ) {
45        unsafe {
46            gio_sys::g_remote_action_group_activate_action_full(
47                self.as_ref().to_glib_none().0,
48                action_name.to_glib_none().0,
49                parameter.to_glib_none().0,
50                platform_data.to_glib_none().0,
51            );
52        }
53    }
54
55    fn change_action_state_full(
56        &self,
57        action_name: &str,
58        value: &glib::Variant,
59        platform_data: &glib::Variant,
60    ) {
61        unsafe {
62            gio_sys::g_remote_action_group_change_action_state_full(
63                self.as_ref().to_glib_none().0,
64                action_name.to_glib_none().0,
65                value.to_glib_none().0,
66                platform_data.to_glib_none().0,
67            );
68        }
69    }
70}
71
72impl fmt::Display for RemoteActionGroup {
73    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
74        write!(f, "RemoteActionGroup")
75    }
76}