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 = GtkPrintUnixDialog.html 27 * outPack = gtk 28 * outFile = PrintUnixDialog 29 * strct = GtkPrintUnixDialog 30 * realStrct= 31 * ctorStrct= 32 * clss = PrintUnixDialog 33 * interf = 34 * class Code: No 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * prefixes: 40 * - gtk_print_unix_dialog_ 41 * omit structs: 42 * omit prefixes: 43 * omit code: 44 * omit signals: 45 * imports: 46 * - glib.Str 47 * - gtk.PageSetup 48 * - gtk.Printer 49 * - gtk.PrintSettings 50 * - gtk.Widget 51 * - gtk.Window 52 * structWrap: 53 * - GtkPageSetup* -> PageSetup 54 * - GtkPrintSettings* -> PrintSettings 55 * - GtkPrinter* -> Printer 56 * - GtkWidget* -> Widget 57 * - GtkWindow* -> Window 58 * module aliases: 59 * local aliases: 60 * - getSettings -> getPrintSettings 61 * - setSettings -> setPrintSettings 62 * overrides: 63 */ 64 65 module gtk.PrintUnixDialog; 66 67 public import gtkc.gtktypes; 68 69 private import gtkc.gtk; 70 private import glib.ConstructionException; 71 private import gobject.ObjectG; 72 73 private import glib.Str; 74 private import gtk.PageSetup; 75 private import gtk.Printer; 76 private import gtk.PrintSettings; 77 private import gtk.Widget; 78 private import gtk.Window; 79 80 81 private import gtk.Dialog; 82 83 /** 84 * GtkPrintUnixDialog implements a print dialog for platforms 85 * which don't provide a native print dialog, like Unix. It can 86 * be used very much like any other GTK+ dialog, at the cost of 87 * the portability offered by the 88 * high-level printing API 89 * 90 * In order to print something with GtkPrintUnixDialog, you need 91 * to use gtk_print_unix_dialog_get_selected_printer() to obtain 92 * a GtkPrinter object and use it to construct a GtkPrintJob using 93 * gtk_print_job_new(). 94 * 95 * GtkPrintUnixDialog uses the following response values: 96 * 97 * GTK_RESPONSE_OK 98 * 99 * for the "Print" button 100 * 101 * GTK_RESPONSE_APPLY 102 * 103 * for the "Preview" button 104 * 105 * GTK_RESPONSE_CANCEL 106 * 107 * for the "Cancel" button 108 * 109 * Printing support was added in GTK+ 2.10. 110 * 111 * GtkPrintUnixDialog as GtkBuildable 112 * 113 * The GtkPrintUnixDialog implementation of the GtkBuildable interface exposes its 114 * notebook internal children with the name "notebook". 115 * 116 * $(DDOC_COMMENT example) 117 */ 118 public class PrintUnixDialog : Dialog 119 { 120 121 /** the main Gtk struct */ 122 protected GtkPrintUnixDialog* gtkPrintUnixDialog; 123 124 125 /** Get the main Gtk struct */ 126 public GtkPrintUnixDialog* getPrintUnixDialogStruct() 127 { 128 return gtkPrintUnixDialog; 129 } 130 131 132 /** the main Gtk struct as a void* */ 133 protected override void* getStruct() 134 { 135 return cast(void*)gtkPrintUnixDialog; 136 } 137 138 /** 139 * Sets our main struct and passes it to the parent class 140 */ 141 public this (GtkPrintUnixDialog* gtkPrintUnixDialog) 142 { 143 super(cast(GtkDialog*)gtkPrintUnixDialog); 144 this.gtkPrintUnixDialog = gtkPrintUnixDialog; 145 } 146 147 protected override void setStruct(GObject* obj) 148 { 149 super.setStruct(obj); 150 gtkPrintUnixDialog = cast(GtkPrintUnixDialog*)obj; 151 } 152 153 /** 154 */ 155 156 /** 157 * Creates a new GtkPrintUnixDialog. 158 * Since 2.10 159 * Params: 160 * title = Title of the dialog, or NULL. [allow-none] 161 * parent = Transient parent of the dialog, or NULL. [allow-none] 162 * Throws: ConstructionException GTK+ fails to create the object. 163 */ 164 public this (string title, Window parent) 165 { 166 // GtkWidget * gtk_print_unix_dialog_new (const gchar *title, GtkWindow *parent); 167 auto p = gtk_print_unix_dialog_new(Str.toStringz(title), (parent is null) ? null : parent.getWindowStruct()); 168 if(p is null) 169 { 170 throw new ConstructionException("null returned by gtk_print_unix_dialog_new(Str.toStringz(title), (parent is null) ? null : parent.getWindowStruct())"); 171 } 172 this(cast(GtkPrintUnixDialog*) p); 173 } 174 175 /** 176 * Sets the page setup of the GtkPrintUnixDialog. 177 * Since 2.10 178 * Params: 179 * pageSetup = a GtkPageSetup 180 */ 181 public void setPageSetup(PageSetup pageSetup) 182 { 183 // void gtk_print_unix_dialog_set_page_setup (GtkPrintUnixDialog *dialog, GtkPageSetup *page_setup); 184 gtk_print_unix_dialog_set_page_setup(gtkPrintUnixDialog, (pageSetup is null) ? null : pageSetup.getPageSetupStruct()); 185 } 186 187 /** 188 * Gets the page setup that is used by the GtkPrintUnixDialog. 189 * Since 2.10 190 * Returns: the page setup of dialog. [transfer none] 191 */ 192 public PageSetup getPageSetup() 193 { 194 // GtkPageSetup * gtk_print_unix_dialog_get_page_setup (GtkPrintUnixDialog *dialog); 195 auto p = gtk_print_unix_dialog_get_page_setup(gtkPrintUnixDialog); 196 197 if(p is null) 198 { 199 return null; 200 } 201 202 return ObjectG.getDObject!(PageSetup)(cast(GtkPageSetup*) p); 203 } 204 205 /** 206 * Sets the current page number. If current_page is not -1, this enables 207 * the current page choice for the range of pages to print. 208 * Since 2.10 209 * Params: 210 * currentPage = the current page number. 211 */ 212 public void setCurrentPage(int currentPage) 213 { 214 // void gtk_print_unix_dialog_set_current_page (GtkPrintUnixDialog *dialog, gint current_page); 215 gtk_print_unix_dialog_set_current_page(gtkPrintUnixDialog, currentPage); 216 } 217 218 /** 219 * Gets the current page of the GtkPrintUnixDialog. 220 * Since 2.10 221 * Returns: the current page of dialog 222 */ 223 public int getCurrentPage() 224 { 225 // gint gtk_print_unix_dialog_get_current_page (GtkPrintUnixDialog *dialog); 226 return gtk_print_unix_dialog_get_current_page(gtkPrintUnixDialog); 227 } 228 229 /** 230 * Sets the GtkPrintSettings for the GtkPrintUnixDialog. Typically, 231 * this is used to restore saved print settings from a previous print 232 * operation before the print dialog is shown. 233 * Since 2.10 234 * Params: 235 * settings = a GtkPrintSettings, or NULL. [allow-none] 236 */ 237 public void setPrintSettings(PrintSettings settings) 238 { 239 // void gtk_print_unix_dialog_set_settings (GtkPrintUnixDialog *dialog, GtkPrintSettings *settings); 240 gtk_print_unix_dialog_set_settings(gtkPrintUnixDialog, (settings is null) ? null : settings.getPrintSettingsStruct()); 241 } 242 243 /** 244 * Gets a new GtkPrintSettings object that represents the 245 * current values in the print dialog. Note that this creates a 246 * new object, and you need to unref it 247 * if don't want to keep it. 248 * Since 2.10 249 * Returns: a new GtkPrintSettings object with the values from dialog 250 */ 251 public PrintSettings getPrintSettings() 252 { 253 // GtkPrintSettings * gtk_print_unix_dialog_get_settings (GtkPrintUnixDialog *dialog); 254 auto p = gtk_print_unix_dialog_get_settings(gtkPrintUnixDialog); 255 256 if(p is null) 257 { 258 return null; 259 } 260 261 return ObjectG.getDObject!(PrintSettings)(cast(GtkPrintSettings*) p); 262 } 263 264 /** 265 * Gets the currently selected printer. 266 * Since 2.10 267 * Returns: the currently selected printer. [transfer none] 268 */ 269 public Printer getSelectedPrinter() 270 { 271 // GtkPrinter * gtk_print_unix_dialog_get_selected_printer (GtkPrintUnixDialog *dialog); 272 auto p = gtk_print_unix_dialog_get_selected_printer(gtkPrintUnixDialog); 273 274 if(p is null) 275 { 276 return null; 277 } 278 279 return ObjectG.getDObject!(Printer)(cast(GtkPrinter*) p); 280 } 281 282 /** 283 * Adds a custom tab to the print dialog. 284 * Since 2.10 285 * Params: 286 * child = the widget to put in the custom tab 287 * tabLabel = the widget to use as tab label 288 */ 289 public void addCustomTab(Widget child, Widget tabLabel) 290 { 291 // void gtk_print_unix_dialog_add_custom_tab (GtkPrintUnixDialog *dialog, GtkWidget *child, GtkWidget *tab_label); 292 gtk_print_unix_dialog_add_custom_tab(gtkPrintUnixDialog, (child is null) ? null : child.getWidgetStruct(), (tabLabel is null) ? null : tabLabel.getWidgetStruct()); 293 } 294 295 /** 296 * Sets whether the print dialog allows user to print a selection. 297 * Since 2.18 298 * Params: 299 * supportSelection = TRUE to allow print selection 300 */ 301 public void setSupportSelection(int supportSelection) 302 { 303 // void gtk_print_unix_dialog_set_support_selection (GtkPrintUnixDialog *dialog, gboolean support_selection); 304 gtk_print_unix_dialog_set_support_selection(gtkPrintUnixDialog, supportSelection); 305 } 306 307 /** 308 * Gets the value of "support-selection" property. 309 * Since 2.18 310 * Returns: whether the application supports print of selection 311 */ 312 public int getSupportSelection() 313 { 314 // gboolean gtk_print_unix_dialog_get_support_selection (GtkPrintUnixDialog *dialog); 315 return gtk_print_unix_dialog_get_support_selection(gtkPrintUnixDialog); 316 } 317 318 /** 319 * Sets whether a selection exists. 320 * Since 2.18 321 * Params: 322 * hasSelection = TRUE indicates that a selection exists 323 */ 324 public void setHasSelection(int hasSelection) 325 { 326 // void gtk_print_unix_dialog_set_has_selection (GtkPrintUnixDialog *dialog, gboolean has_selection); 327 gtk_print_unix_dialog_set_has_selection(gtkPrintUnixDialog, hasSelection); 328 } 329 330 /** 331 * Gets the value of "has-selection" property. 332 * Since 2.18 333 * Returns: whether there is a selection 334 */ 335 public int getHasSelection() 336 { 337 // gboolean gtk_print_unix_dialog_get_has_selection (GtkPrintUnixDialog *dialog); 338 return gtk_print_unix_dialog_get_has_selection(gtkPrintUnixDialog); 339 } 340 341 /** 342 * Embed page size combo box and orientation combo box into page setup page. 343 * Since 2.18 344 * Params: 345 * embed = embed page setup selection 346 */ 347 public void setEmbedPageSetup(int embed) 348 { 349 // void gtk_print_unix_dialog_set_embed_page_setup (GtkPrintUnixDialog *dialog, gboolean embed); 350 gtk_print_unix_dialog_set_embed_page_setup(gtkPrintUnixDialog, embed); 351 } 352 353 /** 354 * Gets the value of "embed-page-setup" property. 355 * Since 2.18 356 * Returns: whether there is a selection 357 */ 358 public int getEmbedPageSetup() 359 { 360 // gboolean gtk_print_unix_dialog_get_embed_page_setup (GtkPrintUnixDialog *dialog); 361 return gtk_print_unix_dialog_get_embed_page_setup(gtkPrintUnixDialog); 362 } 363 364 /** 365 * Gets the page setup that is used by the GtkPrintUnixDialog. 366 * Since 2.18 367 * Returns: whether a page setup was set by user. 368 */ 369 public int getPageSetupSet() 370 { 371 // gboolean gtk_print_unix_dialog_get_page_setup_set (GtkPrintUnixDialog *dialog); 372 return gtk_print_unix_dialog_get_page_setup_set(gtkPrintUnixDialog); 373 } 374 375 /** 376 * This lets you specify the printing capabilities your application 377 * supports. For instance, if you can handle scaling the output then 378 * you pass GTK_PRINT_CAPABILITY_SCALE. If you don't pass that, then 379 * the dialog will only let you select the scale if the printing 380 * system automatically handles scaling. 381 * Since 2.10 382 * Params: 383 * capabilities = the printing capabilities of your application 384 */ 385 public void setManualCapabilities(GtkPrintCapabilities capabilities) 386 { 387 // void gtk_print_unix_dialog_set_manual_capabilities (GtkPrintUnixDialog *dialog, GtkPrintCapabilities capabilities); 388 gtk_print_unix_dialog_set_manual_capabilities(gtkPrintUnixDialog, capabilities); 389 } 390 391 /** 392 * Gets the value of "manual-capabilities" property. 393 * Since 2.18 394 * Returns: the printing capabilities 395 */ 396 public GtkPrintCapabilities getManualCapabilities() 397 { 398 // GtkPrintCapabilities gtk_print_unix_dialog_get_manual_capabilities (GtkPrintUnixDialog *dialog); 399 return gtk_print_unix_dialog_get_manual_capabilities(gtkPrintUnixDialog); 400 } 401 }