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