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  = GtkSourceSearchSettings.html
27  * outPack = gsv
28  * outFile = SourceSearchSettings
29  * strct   = GtkSourceSearchSettings
30  * realStrct=
31  * ctorStrct=
32  * clss    = SourceSearchSettings
33  * interf  = 
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- gtk_source_search_settings_
41  * omit structs:
42  * omit prefixes:
43  * omit code:
44  * omit signals:
45  * imports:
46  * 	- glib.Str
47  * structWrap:
48  * module aliases:
49  * local aliases:
50  * overrides:
51  */
52 
53 module gsv.SourceSearchSettings;
54 
55 public  import gsvc.gsvtypes;
56 
57 private import gsvc.gsv;
58 private import glib.ConstructionException;
59 private import gobject.ObjectG;
60 
61 
62 private import glib.Str;
63 
64 
65 
66 private import gobject.ObjectG;
67 
68 /**
69  * A GtkSourceSearchSettings object represents the settings of a search. The
70  * search settings can be associated with one or several
71  * GtkSourceSearchContexts.
72  */
73 public class SourceSearchSettings : ObjectG
74 {
75 	
76 	/** the main Gtk struct */
77 	protected GtkSourceSearchSettings* gtkSourceSearchSettings;
78 	
79 	
80 	public GtkSourceSearchSettings* getSourceSearchSettingsStruct()
81 	{
82 		return gtkSourceSearchSettings;
83 	}
84 	
85 	
86 	/** the main Gtk struct as a void* */
87 	protected override void* getStruct()
88 	{
89 		return cast(void*)gtkSourceSearchSettings;
90 	}
91 	
92 	/**
93 	 * Sets our main struct and passes it to the parent class
94 	 */
95 	public this (GtkSourceSearchSettings* gtkSourceSearchSettings)
96 	{
97 		super(cast(GObject*)gtkSourceSearchSettings);
98 		this.gtkSourceSearchSettings = gtkSourceSearchSettings;
99 	}
100 	
101 	protected override void setStruct(GObject* obj)
102 	{
103 		super.setStruct(obj);
104 		gtkSourceSearchSettings = cast(GtkSourceSearchSettings*)obj;
105 	}
106 	
107 	/**
108 	 */
109 	
110 	/**
111 	 * Creates a new search settings object.
112 	 * Throws: ConstructionException GTK+ fails to create the object.
113 	 */
114 	public this ()
115 	{
116 		// GtkSourceSearchSettings * gtk_source_search_settings_new  (void);
117 		auto p = gtk_source_search_settings_new();
118 		if(p is null)
119 		{
120 			throw new ConstructionException("null returned by gtk_source_search_settings_new()");
121 		}
122 		this(cast(GtkSourceSearchSettings*) p);
123 	}
124 	
125 	/**
126 	 * Gets the text to search. The return value must not be freed.
127 	 * You may be interested to call gtk_source_utils_escape_search_text() after
128 	 * this function.
129 	 * Returns: the text to search, or NULL if the search is disabled. Since 3.10
130 	 */
131 	public string getSearchText()
132 	{
133 		// const gchar * gtk_source_search_settings_get_search_text  (GtkSourceSearchSettings *settings);
134 		return Str.toString(gtk_source_search_settings_get_search_text(gtkSourceSearchSettings));
135 	}
136 	
137 	/**
138 	 * Sets the text to search. If text is NULL or is empty, the search will be
139 	 * disabled. A copy of text will be made, so you can safely free text after
140 	 * a call to this function.
141 	 * You may be interested to call gtk_source_utils_unescape_search_text() before
142 	 * this function.
143 	 * Params:
144 	 * searchText = the nul-terminated text to search, or NULL to disable the search. [allow-none]
145 	 * Since 3.10
146 	 */
147 	public void setSearchText(string searchText)
148 	{
149 		// void gtk_source_search_settings_set_search_text  (GtkSourceSearchSettings *settings,  const gchar *search_text);
150 		gtk_source_search_settings_set_search_text(gtkSourceSearchSettings, Str.toStringz(searchText));
151 	}
152 	
153 	/**
154 	 * Returns: whether the search is case sensitive. Since 3.10
155 	 */
156 	public int getCaseSensitive()
157 	{
158 		// gboolean gtk_source_search_settings_get_case_sensitive  (GtkSourceSearchSettings *settings);
159 		return gtk_source_search_settings_get_case_sensitive(gtkSourceSearchSettings);
160 	}
161 	
162 	/**
163 	 * Enables or disables the case sensitivity for the search.
164 	 * Params:
165 	 * caseSensitive = the setting.
166 	 * Since 3.10
167 	 */
168 	public void setCaseSensitive(int caseSensitive)
169 	{
170 		// void gtk_source_search_settings_set_case_sensitive  (GtkSourceSearchSettings *settings,  gboolean case_sensitive);
171 		gtk_source_search_settings_set_case_sensitive(gtkSourceSearchSettings, caseSensitive);
172 	}
173 	
174 	/**
175 	 * Returns: whether to search at word boundaries. Since 3.10
176 	 */
177 	public int getAtWordBoundaries()
178 	{
179 		// gboolean gtk_source_search_settings_get_at_word_boundaries  (GtkSourceSearchSettings *settings);
180 		return gtk_source_search_settings_get_at_word_boundaries(gtkSourceSearchSettings);
181 	}
182 	
183 	/**
184 	 * Change whether the search is done at word boundaries. If at_word_boundaries
185 	 * is TRUE, a search match must start and end a word. The match can span
186 	 * multiple words. See also gtk_text_iter_starts_word() and
187 	 * gtk_text_iter_ends_word().
188 	 * Params:
189 	 * atWordBoundaries = the setting.
190 	 * Since 3.10
191 	 */
192 	public void setAtWordBoundaries(int atWordBoundaries)
193 	{
194 		// void gtk_source_search_settings_set_at_word_boundaries  (GtkSourceSearchSettings *settings,  gboolean at_word_boundaries);
195 		gtk_source_search_settings_set_at_word_boundaries(gtkSourceSearchSettings, atWordBoundaries);
196 	}
197 	
198 	/**
199 	 * Returns: whether to wrap around the search. Since 3.10
200 	 */
201 	public int getWrapAround()
202 	{
203 		// gboolean gtk_source_search_settings_get_wrap_around  (GtkSourceSearchSettings *settings);
204 		return gtk_source_search_settings_get_wrap_around(gtkSourceSearchSettings);
205 	}
206 	
207 	/**
208 	 * Enables or disables the wrap around search. If wrap_around is TRUE, the
209 	 * forward search continues at the beginning of the buffer if no search
210 	 * occurrences are found. Similarly, the backward search continues to search at
211 	 * the end of the buffer.
212 	 * Params:
213 	 * wrapAround = the setting.
214 	 * Since 3.10
215 	 */
216 	public void setWrapAround(int wrapAround)
217 	{
218 		// void gtk_source_search_settings_set_wrap_around  (GtkSourceSearchSettings *settings,  gboolean wrap_around);
219 		gtk_source_search_settings_set_wrap_around(gtkSourceSearchSettings, wrapAround);
220 	}
221 	
222 	/**
223 	 * Returns: whether to search by regular expressions. Since 3.10
224 	 */
225 	public int getRegexEnabled()
226 	{
227 		// gboolean gtk_source_search_settings_get_regex_enabled  (GtkSourceSearchSettings *settings);
228 		return gtk_source_search_settings_get_regex_enabled(gtkSourceSearchSettings);
229 	}
230 	
231 	/**
232 	 * Enables or disables whether to search by regular expressions.
233 	 * If enabled, the "search-text" property contains the
234 	 * pattern of the regular expression.
235 	 * Params:
236 	 * regexEnabled = the setting.
237 	 * Since 3.10
238 	 */
239 	public void setRegexEnabled(int regexEnabled)
240 	{
241 		// void gtk_source_search_settings_set_regex_enabled  (GtkSourceSearchSettings *settings,  gboolean regex_enabled);
242 		gtk_source_search_settings_set_regex_enabled(gtkSourceSearchSettings, regexEnabled);
243 	}
244 }