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 atk.Plug;
26 
27 private import atk.ComponentIF;
28 private import atk.ComponentT;
29 private import atk.ObjectAtk;
30 private import glib.ConstructionException;
31 private import glib.Str;
32 private import gobject.ObjectG;
33 private import gtkc.atk;
34 public  import gtkc.atktypes;
35 
36 
37 /**
38  * See #AtkSocket
39  */
40 public class Plug : ObjectAtk, ComponentIF
41 {
42 	/** the main Gtk struct */
43 	protected AtkPlug* atkPlug;
44 
45 	/** Get the main Gtk struct */
46 	public AtkPlug* getPlugStruct()
47 	{
48 		return atkPlug;
49 	}
50 
51 	/** the main Gtk struct as a void* */
52 	protected override void* getStruct()
53 	{
54 		return cast(void*)atkPlug;
55 	}
56 
57 	protected override void setStruct(GObject* obj)
58 	{
59 		atkPlug = cast(AtkPlug*)obj;
60 		super.setStruct(obj);
61 	}
62 
63 	/**
64 	 * Sets our main struct and passes it to the parent class.
65 	 */
66 	public this (AtkPlug* atkPlug, bool ownedRef = false)
67 	{
68 		this.atkPlug = atkPlug;
69 		super(cast(AtkObject*)atkPlug, ownedRef);
70 	}
71 
72 	// add the Component capabilities
73 	mixin ComponentT!(AtkPlug);
74 
75 
76 	/** */
77 	public static GType getType()
78 	{
79 		return atk_plug_get_type();
80 	}
81 
82 	/** */
83 	public this()
84 	{
85 		auto p = atk_plug_new();
86 		
87 		if(p is null)
88 		{
89 			throw new ConstructionException("null returned by new");
90 		}
91 		
92 		this(cast(AtkPlug*) p, true);
93 	}
94 
95 	/**
96 	 * Gets the unique ID of an #AtkPlug object, which can be used to
97 	 * embed inside of an #AtkSocket using atk_socket_embed().
98 	 *
99 	 * Internally, this calls a class function that should be registered
100 	 * by the IPC layer (usually at-spi2-atk). The implementor of an
101 	 * #AtkPlug object should call this function (after atk-bridge is
102 	 * loaded) and pass the value to the process implementing the
103 	 * #AtkSocket, so it could embed the plug.
104 	 *
105 	 * Return: the unique ID for the plug
106 	 *
107 	 * Since: 1.30
108 	 */
109 	public string getId()
110 	{
111 		auto retStr = atk_plug_get_id(atkPlug);
112 		
113 		scope(exit) Str.freeString(retStr);
114 		return Str.toString(retStr);
115 	}
116 }