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 gtk.IMMulticontext;
26 
27 private import glib.ConstructionException;
28 private import glib.Str;
29 private import glib.c.functions;
30 private import gobject.ObjectG;
31 private import gtk.IMContext;
32 private import gtk.c.functions;
33 public  import gtk.c.types;
34 
35 
36 /**
37  * `GtkIMMulticontext` is input method supporting multiple, switchable input
38  * methods.
39  * 
40  * Text widgets such as `GtkText` or `GtkTextView` use a `GtkIMMultiContext`
41  * to implement their `im-module` property for switching between different
42  * input methods.
43  */
44 public class IMMulticontext : IMContext
45 {
46 	/** the main Gtk struct */
47 	protected GtkIMMulticontext* gtkIMMulticontext;
48 
49 	/** Get the main Gtk struct */
50 	public GtkIMMulticontext* getIMMulticontextStruct(bool transferOwnership = false)
51 	{
52 		if (transferOwnership)
53 			ownedRef = false;
54 		return gtkIMMulticontext;
55 	}
56 
57 	/** the main Gtk struct as a void* */
58 	protected override void* getStruct()
59 	{
60 		return cast(void*)gtkIMMulticontext;
61 	}
62 
63 	/**
64 	 * Sets our main struct and passes it to the parent class.
65 	 */
66 	public this (GtkIMMulticontext* gtkIMMulticontext, bool ownedRef = false)
67 	{
68 		this.gtkIMMulticontext = gtkIMMulticontext;
69 		super(cast(GtkIMContext*)gtkIMMulticontext, ownedRef);
70 	}
71 
72 
73 	/** */
74 	public static GType getType()
75 	{
76 		return gtk_im_multicontext_get_type();
77 	}
78 
79 	/**
80 	 * Creates a new `GtkIMMulticontext`.
81 	 *
82 	 * Returns: a new `GtkIMMulticontext`.
83 	 *
84 	 * Throws: ConstructionException GTK+ fails to create the object.
85 	 */
86 	public this()
87 	{
88 		auto __p = gtk_im_multicontext_new();
89 
90 		if(__p is null)
91 		{
92 			throw new ConstructionException("null returned by new");
93 		}
94 
95 		this(cast(GtkIMMulticontext*) __p, true);
96 	}
97 
98 	/**
99 	 * Gets the id of the currently active delegate of the @context.
100 	 *
101 	 * Returns: the id of the currently active delegate
102 	 */
103 	public string getContextId()
104 	{
105 		return Str.toString(gtk_im_multicontext_get_context_id(gtkIMMulticontext));
106 	}
107 
108 	/**
109 	 * Sets the context id for @context.
110 	 *
111 	 * This causes the currently active delegate of @context to be
112 	 * replaced by the delegate corresponding to the new context id.
113 	 *
114 	 * Params:
115 	 *     contextId = the id to use
116 	 */
117 	public void setContextId(string contextId)
118 	{
119 		gtk_im_multicontext_set_context_id(gtkIMMulticontext, Str.toStringz(contextId));
120 	}
121 }