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  = GtkIMMulticontext.html
27  * outPack = gtk
28  * outFile = IMMulticontext
29  * strct   = GtkIMMulticontext
30  * realStrct=
31  * ctorStrct=GtkIMContext
32  * clss    = IMMulticontext
33  * interf  = 
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- gtk_im_multicontext_
41  * omit structs:
42  * omit prefixes:
43  * omit code:
44  * omit signals:
45  * imports:
46  * 	- glib.Str
47  * 	- gtk.MenuShell
48  * structWrap:
49  * 	- GtkMenuShell* -> MenuShell
50  * module aliases:
51  * local aliases:
52  * overrides:
53  */
54 
55 module gtk.IMMulticontext;
56 
57 public  import gtkc.gtktypes;
58 
59 private import gtkc.gtk;
60 private import glib.ConstructionException;
61 private import gobject.ObjectG;
62 
63 
64 private import glib.Str;
65 private import gtk.MenuShell;
66 
67 
68 
69 private import gtk.IMContext;
70 
71 /**
72  */
73 public class IMMulticontext : IMContext
74 {
75 	
76 	/** the main Gtk struct */
77 	protected GtkIMMulticontext* gtkIMMulticontext;
78 	
79 	
80 	public GtkIMMulticontext* getIMMulticontextStruct()
81 	{
82 		return gtkIMMulticontext;
83 	}
84 	
85 	
86 	/** the main Gtk struct as a void* */
87 	protected override void* getStruct()
88 	{
89 		return cast(void*)gtkIMMulticontext;
90 	}
91 	
92 	/**
93 	 * Sets our main struct and passes it to the parent class
94 	 */
95 	public this (GtkIMMulticontext* gtkIMMulticontext)
96 	{
97 		super(cast(GtkIMContext*)gtkIMMulticontext);
98 		this.gtkIMMulticontext = gtkIMMulticontext;
99 	}
100 	
101 	protected override void setStruct(GObject* obj)
102 	{
103 		super.setStruct(obj);
104 		gtkIMMulticontext = cast(GtkIMMulticontext*)obj;
105 	}
106 	
107 	/**
108 	 */
109 	
110 	/**
111 	 * Creates a new GtkIMMulticontext.
112 	 * Throws: ConstructionException GTK+ fails to create the object.
113 	 */
114 	public this ()
115 	{
116 		// GtkIMContext * gtk_im_multicontext_new (void);
117 		auto p = gtk_im_multicontext_new();
118 		if(p is null)
119 		{
120 			throw new ConstructionException("null returned by gtk_im_multicontext_new()");
121 		}
122 		this(cast(GtkIMMulticontext*) p);
123 	}
124 	
125 	/**
126 	 * Warning
127 	 * gtk_im_multicontext_append_menuitems has been deprecated since version 3.10 and should not be used in newly-written code. It is better to use the system-wide input
128 	 *  method framework for changing input methods. Modern
129 	 *  desktop shells offer on-screen displays for this that
130 	 *  can triggered with a keyboard shortcut, e.g. Super-Space.
131 	 * Add menuitems for various available input methods to a menu;
132 	 * the menuitems, when selected, will switch the input method
133 	 * for the context and the global default input method.
134 	 * Params:
135 	 * menushell = a GtkMenuShell
136 	 */
137 	public void appendMenuitems(MenuShell menushell)
138 	{
139 		// void gtk_im_multicontext_append_menuitems  (GtkIMMulticontext *context,  GtkMenuShell *menushell);
140 		gtk_im_multicontext_append_menuitems(gtkIMMulticontext, (menushell is null) ? null : menushell.getMenuShellStruct());
141 	}
142 	
143 	/**
144 	 * Gets the id of the currently active slave of the context.
145 	 * Since 2.16
146 	 * Returns: the id of the currently active slave
147 	 */
148 	public string getContextId()
149 	{
150 		// const char * gtk_im_multicontext_get_context_id (GtkIMMulticontext *context);
151 		return Str.toString(gtk_im_multicontext_get_context_id(gtkIMMulticontext));
152 	}
153 	
154 	/**
155 	 * Sets the context id for context.
156 	 * This causes the currently active slave of context to be
157 	 * replaced by the slave corresponding to the new context id.
158 	 * Since 2.16
159 	 * Params:
160 	 * context = a GtkIMMulticontext
161 	 * contextId = the id to use
162 	 */
163 	public void setContextId(string contextId)
164 	{
165 		// void gtk_im_multicontext_set_context_id (GtkIMMulticontext *context,  const char *context_id);
166 		gtk_im_multicontext_set_context_id(gtkIMMulticontext, Str.toStringz(contextId));
167 	}
168 }