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