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 gsv.SourceCompletionInfo;
26 
27 private import glib.ConstructionException;
28 private import gobject.ObjectG;
29 private import gobject.Signals;
30 private import gsvc.gsv;
31 public  import gsvc.gsvtypes;
32 private import gtk.BuildableIF;
33 private import gtk.BuildableT;
34 private import gtk.TextIter;
35 private import gtk.TextView;
36 private import gtk.Widget;
37 private import gtk.Window;
38 public  import gtkc.gdktypes;
39 
40 
41 /** */
42 public class SourceCompletionInfo : Window
43 {
44 	/** the main Gtk struct */
45 	protected GtkSourceCompletionInfo* gtkSourceCompletionInfo;
46 
47 	/** Get the main Gtk struct */
48 	public GtkSourceCompletionInfo* getSourceCompletionInfoStruct()
49 	{
50 		return gtkSourceCompletionInfo;
51 	}
52 
53 	/** the main Gtk struct as a void* */
54 	protected override void* getStruct()
55 	{
56 		return cast(void*)gtkSourceCompletionInfo;
57 	}
58 
59 	protected override void setStruct(GObject* obj)
60 	{
61 		gtkSourceCompletionInfo = cast(GtkSourceCompletionInfo*)obj;
62 		super.setStruct(obj);
63 	}
64 
65 	/**
66 	 * Sets our main struct and passes it to the parent class.
67 	 */
68 	public this (GtkSourceCompletionInfo* gtkSourceCompletionInfo, bool ownedRef = false)
69 	{
70 		this.gtkSourceCompletionInfo = gtkSourceCompletionInfo;
71 		super(cast(GtkWindow*)gtkSourceCompletionInfo, ownedRef);
72 	}
73 
74 
75 	/** */
76 	public static GType getType()
77 	{
78 		return gtk_source_completion_info_get_type();
79 	}
80 
81 	/**
82 	 * Return: a new GtkSourceCompletionInfo.
83 	 *
84 	 * Throws: ConstructionException GTK+ fails to create the object.
85 	 */
86 	public this()
87 	{
88 		auto p = gtk_source_completion_info_new();
89 		
90 		if(p is null)
91 		{
92 			throw new ConstructionException("null returned by new");
93 		}
94 		
95 		this(cast(GtkSourceCompletionInfo*) p);
96 	}
97 
98 	/**
99 	 * Get the current content widget.
100 	 *
101 	 * Deprecated: Use gtk_bin_get_child() instead.
102 	 *
103 	 * Return: The current content widget.
104 	 */
105 	public Widget getWidget()
106 	{
107 		auto p = gtk_source_completion_info_get_widget(gtkSourceCompletionInfo);
108 		
109 		if(p is null)
110 		{
111 			return null;
112 		}
113 		
114 		return ObjectG.getDObject!(Widget)(cast(GtkWidget*) p);
115 	}
116 
117 	/**
118 	 * Moves the #GtkSourceCompletionInfo to @iter. If @iter is %NULL @info is
119 	 * moved to the cursor position. Moving will respect the #GdkGravity setting
120 	 * of the info window and will ensure the line at @iter is not occluded by
121 	 * the window.
122 	 *
123 	 * Params:
124 	 *     view = a #GtkTextView on which the info window should be positioned.
125 	 *     iter = a #GtkTextIter.
126 	 */
127 	public void moveToIter(TextView view, TextIter iter)
128 	{
129 		gtk_source_completion_info_move_to_iter(gtkSourceCompletionInfo, (view is null) ? null : view.getTextViewStruct(), (iter is null) ? null : iter.getTextIterStruct());
130 	}
131 
132 	/**
133 	 * Sets the content widget of the info window. See that the previous widget will
134 	 * lose a reference and it can be destroyed, so if you do not want this to
135 	 * happen you must use g_object_ref() before calling this method.
136 	 *
137 	 * Deprecated: Use gtk_container_add() instead. If there is already a child
138 	 * widget, remove it with gtk_container_remove().
139 	 *
140 	 * Params:
141 	 *     widget = a #GtkWidget.
142 	 */
143 	public void setWidget(Widget widget)
144 	{
145 		gtk_source_completion_info_set_widget(gtkSourceCompletionInfo, (widget is null) ? null : widget.getWidgetStruct());
146 	}
147 
148 	int[string] connectedSignals;
149 
150 	void delegate(SourceCompletionInfo)[] onBeforeShowListeners;
151 	/**
152 	 * This signal is emitted before any "show" management. You can connect
153 	 * to this signal if you want to change some properties or position
154 	 * before the real "show".
155 	 *
156 	 * Deprecated: This signal should not be used.
157 	 */
158 	void addOnBeforeShow(void delegate(SourceCompletionInfo) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
159 	{
160 		if ( "before-show" !in connectedSignals )
161 		{
162 			Signals.connectData(
163 				this,
164 				"before-show",
165 				cast(GCallback)&callBackBeforeShow,
166 				cast(void*)this,
167 				null,
168 				connectFlags);
169 			connectedSignals["before-show"] = 1;
170 		}
171 		onBeforeShowListeners ~= dlg;
172 	}
173 	extern(C) static void callBackBeforeShow(GtkSourceCompletionInfo* sourcecompletioninfoStruct, SourceCompletionInfo _sourcecompletioninfo)
174 	{
175 		foreach ( void delegate(SourceCompletionInfo) dlg; _sourcecompletioninfo.onBeforeShowListeners )
176 		{
177 			dlg(_sourcecompletioninfo);
178 		}
179 	}
180 }