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