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  * Conversion parameters:
26  * inFile  = GDBusActionGroup.html
27  * outPack = gio
28  * outFile = DBusActionGroup
29  * strct   = GDBusActionGroup
30  * realStrct=
31  * ctorStrct=
32  * clss    = DBusActionGroup
33  * interf  = 
34  * class Code: Yes
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * 	- ActionGroupIF
40  * 	- RemoteActionGroupIF
41  * prefixes:
42  * 	- g_dbus_action_group_
43  * omit structs:
44  * omit prefixes:
45  * omit code:
46  * omit signals:
47  * imports:
48  * 	- glib.Str
49  * 	- gio.DBusConnection
50  * 	- gio.ActionGroupIF
51  * 	- gio.ActionGroupT
52  * 	- gio.RemoteActionGroupIF
53  * 	- gio.RemoteActionGroupT
54  * structWrap:
55  * 	- GDBusActionGroup* -> DBusActionGroup
56  * 	- GDBusConnection* -> DBusConnection
57  * module aliases:
58  * local aliases:
59  * overrides:
60  */
61 
62 module gio.DBusActionGroup;
63 
64 public  import gtkc.giotypes;
65 
66 private import gtkc.gio;
67 private import glib.ConstructionException;
68 private import gobject.ObjectG;
69 
70 private import glib.Str;
71 private import gio.DBusConnection;
72 private import gio.ActionGroupIF;
73 private import gio.ActionGroupT;
74 private import gio.RemoteActionGroupIF;
75 private import gio.RemoteActionGroupT;
76 
77 
78 private import gobject.ObjectG;
79 
80 /**
81  * GDBusActionGroup is an implementation of the GActionGroup
82  * interface that can be used as a proxy for an action group
83  * that is exported over D-Bus with g_dbus_connection_export_action_group().
84  */
85 public class DBusActionGroup : ObjectG, ActionGroupIF, RemoteActionGroupIF
86 {
87 	
88 	/** the main Gtk struct */
89 	protected GDBusActionGroup* gDBusActionGroup;
90 	
91 	
92 	/** Get the main Gtk struct */
93 	public GDBusActionGroup* getDBusActionGroupStruct()
94 	{
95 		return gDBusActionGroup;
96 	}
97 	
98 	
99 	/** the main Gtk struct as a void* */
100 	protected override void* getStruct()
101 	{
102 		return cast(void*)gDBusActionGroup;
103 	}
104 	
105 	/**
106 	 * Sets our main struct and passes it to the parent class
107 	 */
108 	public this (GDBusActionGroup* gDBusActionGroup)
109 	{
110 		super(cast(GObject*)gDBusActionGroup);
111 		this.gDBusActionGroup = gDBusActionGroup;
112 	}
113 	
114 	protected override void setStruct(GObject* obj)
115 	{
116 		super.setStruct(obj);
117 		gDBusActionGroup = cast(GDBusActionGroup*)obj;
118 	}
119 	
120 	// add the ActionGroup capabilities
121 	mixin ActionGroupT!(GDBusActionGroup);
122 	
123 	// add the RemoteActionGroup capabilities
124 	mixin RemoteActionGroupT!(GDBusActionGroup);
125 	
126 	/**
127 	 * See_Also: get().
128 	 */
129 	this(DBusConnection connection, string busName, string objectPath)
130 	{
131 		auto p =  g_dbus_action_group_get((connection is null) ? null : connection.getDBusConnectionStruct(), Str.toStringz(busName), Str.toStringz(objectPath));
132 		
133 		if(p is null)
134 		{
135 			throw new ConstructionException("null returned by g_dbus_action_group_get");
136 		}
137 		this(cast(GDBusActionGroup*) p);
138 	}
139 	
140 	/**
141 	 */
142 	
143 	/**
144 	 * Obtains a GDBusActionGroup for the action group which is exported at
145 	 * the given bus_name and object_path.
146 	 * The thread default main context is taken at the time of this call.
147 	 * All signals on the menu model (and any linked models) are reported
148 	 * with respect to this context. All calls on the returned menu model
149 	 * (and linked models) must also originate from this same context, with
150 	 * the thread default main context unchanged.
151 	 * This call is non-blocking. The returned action group may or may not
152 	 * already be filled in. The correct thing to do is connect the signals
153 	 * for the action group to monitor for changes and then to call
154 	 * g_action_group_list_actions() to get the initial list.
155 	 * Since 2.32
156 	 * Params:
157 	 * connection = A GDBusConnection
158 	 * busName = the bus name which exports the action group
159 	 * objectPath = the object path at which the action group is exported
160 	 * Returns: a GDBusActionGroup. [transfer full]
161 	 */
162 	public static DBusActionGroup get(DBusConnection connection, string busName, string objectPath)
163 	{
164 		// GDBusActionGroup * g_dbus_action_group_get (GDBusConnection *connection,  const gchar *bus_name,  const gchar *object_path);
165 		auto p = g_dbus_action_group_get((connection is null) ? null : connection.getDBusConnectionStruct(), Str.toStringz(busName), Str.toStringz(objectPath));
166 		
167 		if(p is null)
168 		{
169 			return null;
170 		}
171 		
172 		return ObjectG.getDObject!(DBusActionGroup)(cast(GDBusActionGroup*) p);
173 	}
174 }