1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 
25 module gio.DBusActionGroup;
26 
27 private import gio.ActionGroupIF;
28 private import gio.ActionGroupT;
29 private import gio.DBusConnection;
30 private import gio.RemoteActionGroupIF;
31 private import gio.RemoteActionGroupT;
32 private import gio.c.functions;
33 public  import gio.c.types;
34 private import glib.ConstructionException;
35 private import glib.Str;
36 private import gobject.ObjectG;
37 public  import gtkc.giotypes;
38 
39 
40 /**
41  * #GDBusActionGroup is an implementation of the #GActionGroup
42  * interface that can be used as a proxy for an action group
43  * that is exported over D-Bus with g_dbus_connection_export_action_group().
44  */
45 public class DBusActionGroup : ObjectG, ActionGroupIF, RemoteActionGroupIF
46 {
47 	/** the main Gtk struct */
48 	protected GDBusActionGroup* gDBusActionGroup;
49 
50 	/** Get the main Gtk struct */
51 	public GDBusActionGroup* getDBusActionGroupStruct(bool transferOwnership = false)
52 	{
53 		if (transferOwnership)
54 			ownedRef = false;
55 		return gDBusActionGroup;
56 	}
57 
58 	/** the main Gtk struct as a void* */
59 	protected override void* getStruct()
60 	{
61 		return cast(void*)gDBusActionGroup;
62 	}
63 
64 	protected override void setStruct(GObject* obj)
65 	{
66 		gDBusActionGroup = cast(GDBusActionGroup*)obj;
67 		super.setStruct(obj);
68 	}
69 
70 	/**
71 	 * Sets our main struct and passes it to the parent class.
72 	 */
73 	public this (GDBusActionGroup* gDBusActionGroup, bool ownedRef = false)
74 	{
75 		this.gDBusActionGroup = gDBusActionGroup;
76 		super(cast(GObject*)gDBusActionGroup, ownedRef);
77 	}
78 
79 	// add the ActionGroup capabilities
80 	mixin ActionGroupT!(GDBusActionGroup);
81 
82 	// add the RemoteActionGroup capabilities
83 	mixin RemoteActionGroupT!(GDBusActionGroup);
84 
85 	/**
86 	 * See_Also: get().
87 	 */
88 	this(DBusConnection connection, string busName, string objectPath)
89 	{
90 		auto p =  g_dbus_action_group_get((connection is null) ? null : connection.getDBusConnectionStruct(), Str.toStringz(busName), Str.toStringz(objectPath));
91 
92 		if(p is null)
93 		{
94 			throw new ConstructionException("null returned by g_dbus_action_group_get");
95 		}
96 		this(cast(GDBusActionGroup*) p, true);
97 	}
98 
99 	/**
100 	 */
101 
102 	/** */
103 	public static GType getType()
104 	{
105 		return g_dbus_action_group_get_type();
106 	}
107 
108 	/**
109 	 * Obtains a #GDBusActionGroup for the action group which is exported at
110 	 * the given @bus_name and @object_path.
111 	 *
112 	 * The thread default main context is taken at the time of this call.
113 	 * All signals on the menu model (and any linked models) are reported
114 	 * with respect to this context.  All calls on the returned menu model
115 	 * (and linked models) must also originate from this same context, with
116 	 * the thread default main context unchanged.
117 	 *
118 	 * This call is non-blocking.  The returned action group may or may not
119 	 * already be filled in.  The correct thing to do is connect the signals
120 	 * for the action group to monitor for changes and then to call
121 	 * g_action_group_list_actions() to get the initial list.
122 	 *
123 	 * Params:
124 	 *     connection = A #GDBusConnection
125 	 *     busName = the bus name which exports the action group
126 	 *     objectPath = the object path at which the action group is exported
127 	 *
128 	 * Returns: a #GDBusActionGroup
129 	 *
130 	 * Since: 2.32
131 	 */
132 	public static DBusActionGroup get(DBusConnection connection, string busName, string objectPath)
133 	{
134 		auto p = g_dbus_action_group_get((connection is null) ? null : connection.getDBusConnectionStruct(), Str.toStringz(busName), Str.toStringz(objectPath));
135 
136 		if(p is null)
137 		{
138 			return null;
139 		}
140 
141 		return ObjectG.getDObject!(DBusActionGroup)(cast(GDBusActionGroup*) p, true);
142 	}
143 }