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  = GtkFontChooser.html
27  * outPack = gtk
28  * outFile = FontChooserIF
29  * strct   = GtkFontChooser
30  * realStrct=
31  * ctorStrct=
32  * clss    = FontChooserT
33  * interf  = FontChooserIF
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- gtk_font_chooser_
41  * omit structs:
42  * omit prefixes:
43  * omit code:
44  * omit signals:
45  * imports:
46  * 	- glib.Str
47  * 	- pango.PgFontDescription
48  * 	- pango.PgFontFace
49  * 	- pango.PgFontFamily
50  * structWrap:
51  * 	- PangoFontDescription* -> PgFontDescription
52  * 	- PangoFontFace* -> PgFontFace
53  * 	- PangoFontFamily* -> PgFontFamily
54  * module aliases:
55  * local aliases:
56  * overrides:
57  */
58 
59 module gtk.FontChooserIF;
60 
61 public  import gtkc.gtktypes;
62 
63 private import gtkc.gtk;
64 private import glib.ConstructionException;
65 private import gobject.ObjectG;
66 
67 private import gobject.Signals;
68 public  import gtkc.gdktypes;
69 private import glib.Str;
70 private import pango.PgFontDescription;
71 private import pango.PgFontFace;
72 private import pango.PgFontFamily;
73 
74 
75 
76 /**
77  * GtkFontChooser is an interface that can be implemented by widgets
78  * displaying the list of fonts. In GTK+, the main objects
79  * that implement this interface are GtkFontChooserWidget,
80  * GtkFontChooserDialog and GtkFontButton.
81  */
82 public interface FontChooserIF
83 {
84 	
85 	
86 	/** Get the main Gtk struct */
87 	public GtkFontChooser* getFontChooserTStruct();
88 	
89 	/** the main Gtk struct as a void* */
90 	protected void* getStruct();
91 	
92 	
93 	/**
94 	 */
95 	
96 	@property void delegate(string, FontChooserIF)[] onFontActivatedListeners();
97 	/**
98 	 * Emitted when a font is activated.
99 	 * This usually happens when the user double clicks an item,
100 	 * or an item is selected and the user presses one of the keys
101 	 * Space, Shift+Space, Return or Enter.
102 	 * See Also
103 	 * GtkFontChooserDialog, GtkFontChooserWidget, GtkFontButton
104 	 */
105 	void addOnFontActivated(void delegate(string, FontChooserIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0);
106 	
107 	/**
108 	 * Gets the PangoFontFamily representing the selected font family.
109 	 * Font families are a collection of font faces.
110 	 * If the selected font is not installed, returns NULL.
111 	 * Returns: A PangoFontFamily representing the selected font family, or NULL. The returned object is owned by fontchooser and must not be modified or freed. [transfer none] Since 3.2
112 	 */
113 	public PgFontFamily getFontFamily();
114 	
115 	/**
116 	 * Gets the PangoFontFace representing the selected font group
117 	 * details (i.e. family, slant, weight, width, etc).
118 	 * If the selected font is not installed, returns NULL.
119 	 * Returns: A PangoFontFace representing the selected font group details, or NULL. The returned object is owned by fontchooser and must not be modified or freed. [transfer none] Since 3.2
120 	 */
121 	public PgFontFace getFontFace();
122 	
123 	/**
124 	 * The selected font size.
125 	 * Returns: A n integer representing the selected font size, or -1 if no font size is selected. Since 3.2
126 	 */
127 	public int getFontSize();
128 	
129 	/**
130 	 * Gets the currently-selected font name.
131 	 * Note that this can be a different string than what you set with
132 	 * gtk_font_chooser_set_font(), as the font chooser widget may
133 	 * normalize font names and thus return a string with a different
134 	 * structure. For example, "Helvetica Italic Bold 12" could be
135 	 * normalized to "Helvetica Bold Italic 12".
136 	 * Use pango_font_description_equal() if you want to compare two
137 	 * font descriptions.
138 	 * Returns: A string with the name of the current font, or NULL if no font is selected. You must free this string with g_free(). [transfer full][allow-none] Since 3.2
139 	 */
140 	public string getFont();
141 	
142 	/**
143 	 * Sets the currently-selected font.
144 	 * Params:
145 	 * fontname = a font name like "Helvetica 12" or "Times Bold 18"
146 	 * Since 3.2
147 	 */
148 	public void setFont(string fontname);
149 	
150 	/**
151 	 * Gets the currently-selected font.
152 	 * Note that this can be a different string than what you set with
153 	 * gtk_font_chooser_set_font(), as the font chooser widget may
154 	 * normalize font names and thus return a string with a different
155 	 * structure. For example, "Helvetica Italic Bold 12" could be
156 	 * normalized to "Helvetica Bold Italic 12".
157 	 * Use pango_font_description_equal() if you want to compare two
158 	 * font descriptions.
159 	 * Returns: A PangoFontDescription for the current font, or NULL if no font is selected. [transfer full][allow-none] Since 3.2
160 	 */
161 	public PgFontDescription getFontDesc();
162 	
163 	/**
164 	 * Sets the currently-selected font from font_desc.
165 	 * Params:
166 	 * fontDesc = a PangoFontDescription
167 	 * Since 3.2
168 	 */
169 	public void setFontDesc(PgFontDescription fontDesc);
170 	
171 	/**
172 	 * Gets the text displayed in the preview area.
173 	 * Returns: the text displayed in the preview area. [transfer full] Since 3.2
174 	 */
175 	public string getPreviewText();
176 	
177 	/**
178 	 * Sets the text displayed in the preview area.
179 	 * The text is used to show how the selected font looks.
180 	 * Params:
181 	 * text = the text to display in the preview area. [transfer none]
182 	 * Since 3.2
183 	 */
184 	public void setPreviewText(string text);
185 	
186 	/**
187 	 * Returns whether the preview entry is shown or not.
188 	 * Returns: TRUE if the preview entry is shown or FALSE if it is hidden. Since 3.2
189 	 */
190 	public int getShowPreviewEntry();
191 	
192 	/**
193 	 * Shows or hides the editable preview entry.
194 	 * Params:
195 	 * showPreviewEntry = whether to show the editable preview entry or not
196 	 * Since 3.2
197 	 */
198 	public void setShowPreviewEntry(int showPreviewEntry);
199 	
200 	/**
201 	 * Adds a filter function that decides which fonts to display
202 	 * in the font chooser.
203 	 * Params:
204 	 * filter = a GtkFontFilterFunc, or NULL. [allow-none]
205 	 * userData = data to pass to filter
206 	 * destroy = function to call to free data when it is no longer needed
207 	 * Since 3.2
208 	 */
209 	public void setFilterFunc(GtkFontFilterFunc filter, void* userData, GDestroyNotify destroy);
210 }