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  = AtkObjectFactory.html
27  * outPack = atk
28  * outFile = ObjectFactory
29  * strct   = AtkObjectFactory
30  * realStrct=
31  * ctorStrct=
32  * clss    = ObjectFactory
33  * interf  = 
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- atk_object_factory_
41  * omit structs:
42  * omit prefixes:
43  * omit code:
44  * omit signals:
45  * imports:
46  * 	- atk.ObjectAtk
47  * 	- gobject.ObjectG
48  * structWrap:
49  * 	- AtkObject* -> ObjectAtk
50  * 	- GObject* -> ObjectG
51  * module aliases:
52  * local aliases:
53  * overrides:
54  */
55 
56 module atk.ObjectFactory;
57 
58 public  import gtkc.atktypes;
59 
60 private import gtkc.atk;
61 private import glib.ConstructionException;
62 private import gobject.ObjectG;
63 
64 private import atk.ObjectAtk;
65 private import gobject.ObjectG;
66 
67 
68 private import gobject.ObjectG;
69 
70 /**
71  * This class is the base object class for a factory used to create an
72  * accessible object for a specific GType. The function
73  * atk_registry_set_factory_type() is normally called to store in the
74  * registry the factory type to be used to create an accessible of a
75  * particular GType.
76  */
77 public class ObjectFactory : ObjectG
78 {
79 	
80 	/** the main Gtk struct */
81 	protected AtkObjectFactory* atkObjectFactory;
82 	
83 	
84 	/** Get the main Gtk struct */
85 	public AtkObjectFactory* getObjectFactoryStruct()
86 	{
87 		return atkObjectFactory;
88 	}
89 	
90 	
91 	/** the main Gtk struct as a void* */
92 	protected override void* getStruct()
93 	{
94 		return cast(void*)atkObjectFactory;
95 	}
96 	
97 	/**
98 	 * Sets our main struct and passes it to the parent class
99 	 */
100 	public this (AtkObjectFactory* atkObjectFactory)
101 	{
102 		super(cast(GObject*)atkObjectFactory);
103 		this.atkObjectFactory = atkObjectFactory;
104 	}
105 	
106 	protected override void setStruct(GObject* obj)
107 	{
108 		super.setStruct(obj);
109 		atkObjectFactory = cast(AtkObjectFactory*)obj;
110 	}
111 	
112 	/**
113 	 */
114 	
115 	/**
116 	 * Provides an AtkObject that implements an accessibility interface
117 	 * on behalf of obj
118 	 * Params:
119 	 * obj = a GObject
120 	 * Returns: an AtkObject that implements an accessibility interface on behalf of obj. [transfer full]
121 	 */
122 	public ObjectAtk createAccessible(ObjectG obj)
123 	{
124 		// AtkObject * atk_object_factory_create_accessible  (AtkObjectFactory *factory,  GObject *obj);
125 		auto p = atk_object_factory_create_accessible(atkObjectFactory, (obj is null) ? null : obj.getObjectGStruct());
126 		
127 		if(p is null)
128 		{
129 			return null;
130 		}
131 		
132 		return ObjectG.getDObject!(ObjectAtk)(cast(AtkObject*) p);
133 	}
134 	
135 	/**
136 	 * Gets the GType of the accessible which is created by the factory.
137 	 * Returns: the type of the accessible which is created by the factory. The value G_TYPE_INVALID is returned if no type if found.
138 	 */
139 	public GType getAccessibleType()
140 	{
141 		// GType atk_object_factory_get_accessible_type  (AtkObjectFactory *factory);
142 		return atk_object_factory_get_accessible_type(atkObjectFactory);
143 	}
144 	
145 	/**
146 	 * Inform factory that it is no longer being used to create
147 	 * accessibles. When called, factory may need to inform
148 	 * AtkObjects which it has created that they need to be re-instantiated.
149 	 * Note: primarily used for runtime replacement of AtkObjectFactorys
150 	 * in object registries.
151 	 */
152 	public void invalidate()
153 	{
154 		// void atk_object_factory_invalidate (AtkObjectFactory *factory);
155 		atk_object_factory_invalidate(atkObjectFactory);
156 	}
157 }