alternative to assert
[gtkD.git] / src / gtk / AboutDialog.d
blob11356658061c56acf1b6a804a257799878d5a140
1 /*
2 * This file is part of duit.
4 * duit is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * duit is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with duit; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = GtkAboutDialog.html
26 * outPack = gtk
27 * outFile = AboutDialog
28 * strct = GtkAboutDialog
29 * realStrct=
30 * ctorStrct=
31 * clss = AboutDialog
32 * interf =
33 * class Code: No
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - gtk_about_dialog_
40 * - gtk_
41 * omit structs:
42 * omit prefixes:
43 * omit code:
44 * imports:
45 * - glib.Str
46 * - gdk.Pixbuf
47 * - gtk.Window
48 * structWrap:
49 * - GdkPixbuf* -> Pixbuf
50 * - GtkWindow* -> Window
51 * local aliases:
54 module gtk.AboutDialog;
56 private import gtk.gtktypes;
58 private import lib.gtk;
60 private import glib.Str;
61 private import gdk.Pixbuf;
62 private import gtk.Window;
64 /**
65 * Description
66 * The GtkAboutDialog offers a simple way to display information about
67 * a program like its logo, name, copyright, website and license. It is
68 * also possible to give credits to the authors, documenters, translators
69 * and artists who have worked on the program. An about dialog is typically
70 * opened when the user selects the About option from
71 * the Help menu. All parts of the dialog are optional.
72 * About dialog often contain links and email addresses. GtkAboutDialog
73 * supports this by offering global hooks, which are called when the user
74 * clicks on a link or email address, see gtk_about_dialog_set_email_hook()
75 * and gtk_about_dialog_set_url_hook(). Email addresses in the
76 * authors, documenters and artists properties are recognized by looking for
77 * <user@host>, URLs are
78 * recognized by looking for http://url, with
79 * url extending to the next space, tab or line break.
80 * To make constructing a GtkAboutDialog as convenient as possible, you can
81 * use the function gtk_show_about_dialog() which constructs and shows a dialog
82 * and keeps it around so that it can be shown again.
84 private import gtk.Dialog;
85 public class AboutDialog : Dialog
88 /** the main Gtk struct */
89 protected GtkAboutDialog* gtkAboutDialog;
92 public GtkAboutDialog* getAboutDialogStruct()
94 return gtkAboutDialog;
98 /** the main Gtk struct as a void* */
99 protected void* getStruct()
101 return cast(void*)gtkAboutDialog;
105 * Sets our main struct and passes it to the parent class
107 public this (GtkAboutDialog* gtkAboutDialog)
109 super(cast(GtkDialog*)gtkAboutDialog);
110 this.gtkAboutDialog = gtkAboutDialog;
118 * Creates a new GtkAboutDialog.
119 * Returns:
120 * a newly created GtkAboutDialog
121 * Since 2.6
123 public this ()
125 // GtkWidget* gtk_about_dialog_new (void);
126 this(cast(GtkAboutDialog*)gtk_about_dialog_new() );
130 * Returns the program name displayed in the about dialog.
131 * about:
132 * a GtkAboutDialog
133 * Returns:
134 * The program name. The string is owned by the about
135 * dialog and must not be modified.
136 * Since 2.6
138 public char[] getName()
140 // const gchar* gtk_about_dialog_get_name (GtkAboutDialog *about);
141 return Str.toString(gtk_about_dialog_get_name(gtkAboutDialog) );
145 * Sets the name to display in the about dialog.
146 * If this is not set, it defaults to g_get_application_name().
147 * about:
148 * a GtkAboutDialog
149 * name:
150 * the program name
151 * Since 2.6
153 public void setName(char[] name)
155 // void gtk_about_dialog_set_name (GtkAboutDialog *about, const gchar *name);
156 gtk_about_dialog_set_name(gtkAboutDialog, Str.toStringz(name));
160 * Returns the version string.
161 * about:
162 * a GtkAboutDialog
163 * Returns:
164 * The version string. The string is owned by the about
165 * dialog and must not be modified.
166 * Since 2.6
168 public char[] getVersion()
170 // const gchar* gtk_about_dialog_get_version (GtkAboutDialog *about);
171 return Str.toString(gtk_about_dialog_get_version(gtkAboutDialog) );
175 * Sets the version string to display in the about dialog.
176 * about:
177 * a GtkAboutDialog
178 * version:
179 * the version string
180 * Since 2.6
182 public void setVersion(char[] versio)
184 // void gtk_about_dialog_set_version (GtkAboutDialog *about, const gchar *version);
185 gtk_about_dialog_set_version(gtkAboutDialog, Str.toStringz(versio));
189 * Returns the copyright string.
190 * about:
191 * a GtkAboutDialog
192 * Returns:
193 * The copyright string. The string is owned by the about
194 * dialog and must not be modified.
195 * Since 2.6
197 public char[] getCopyright()
199 // const gchar* gtk_about_dialog_get_copyright (GtkAboutDialog *about);
200 return Str.toString(gtk_about_dialog_get_copyright(gtkAboutDialog) );
204 * Sets the copyright string to display in the about dialog.
205 * This should be a short string of one or two lines.
206 * about:
207 * a GtkAboutDialog
208 * copyright:
209 * the copyright string
210 * Since 2.6
212 public void setCopyright(char[] copyright)
214 // void gtk_about_dialog_set_copyright (GtkAboutDialog *about, const gchar *copyright);
215 gtk_about_dialog_set_copyright(gtkAboutDialog, Str.toStringz(copyright));
219 * Returns the comments string.
220 * about:
221 * a GtkAboutDialog
222 * Returns:
223 * The comments. The string is owned by the about
224 * dialog and must not be modified.
225 * Since 2.6
227 public char[] getComments()
229 // const gchar* gtk_about_dialog_get_comments (GtkAboutDialog *about);
230 return Str.toString(gtk_about_dialog_get_comments(gtkAboutDialog) );
234 * Sets the comments string to display in the about
235 * dialog. This should be a short string of one or
236 * two lines.
237 * about:
238 * a GtkAboutDialog
239 * comments:
240 * a comments string
241 * Since 2.6
243 public void setComments(char[] comments)
245 // void gtk_about_dialog_set_comments (GtkAboutDialog *about, const gchar *comments);
246 gtk_about_dialog_set_comments(gtkAboutDialog, Str.toStringz(comments));
250 * Returns the license information.
251 * about:
252 * a GtkAboutDialog
253 * Returns:
254 * The license information. The string is owned by the about
255 * dialog and must not be modified.
256 * Since 2.6
258 public char[] getLicense()
260 // const gchar* gtk_about_dialog_get_license (GtkAboutDialog *about);
261 return Str.toString(gtk_about_dialog_get_license(gtkAboutDialog) );
265 * Sets the license information to be displayed in the secondary
266 * license dialog. If license is NULL, the license button is
267 * hidden.
268 * about:
269 * a GtkAboutDialog
270 * license:
271 * the license information or NULL
272 * Since 2.6
274 public void setLicense(char[] license)
276 // void gtk_about_dialog_set_license (GtkAboutDialog *about, const gchar *license);
277 gtk_about_dialog_set_license(gtkAboutDialog, Str.toStringz(license));
281 * Returns whether the license text in about is
282 * automatically wrapped.
283 * about:
284 * a GtkAboutDialog
285 * Returns:
286 * TRUE if the license text is wrapped
287 * Since 2.8
289 public int getWrapLicense()
291 // gboolean gtk_about_dialog_get_wrap_license (GtkAboutDialog *about);
292 return gtk_about_dialog_get_wrap_license(gtkAboutDialog);
296 * Sets whether the license text in about is
297 * automatically wrapped.
298 * about:
299 * a GtkAboutDialog
300 * wrap_license:
301 * whether to wrap the license
302 * Since 2.8
304 public void setWrapLicense(int wrapLicense)
306 // void gtk_about_dialog_set_wrap_license (GtkAboutDialog *about, gboolean wrap_license);
307 gtk_about_dialog_set_wrap_license(gtkAboutDialog, wrapLicense);
311 * Returns the website URL.
312 * about:
313 * a GtkAboutDialog
314 * Returns:
315 * The website URL. The string is owned by the about
316 * dialog and must not be modified.
317 * Since 2.6
319 public char[] getWebsite()
321 // const gchar* gtk_about_dialog_get_website (GtkAboutDialog *about);
322 return Str.toString(gtk_about_dialog_get_website(gtkAboutDialog) );
326 * Sets the URL to use for the website link.
327 * about:
328 * a GtkAboutDialog
329 * website:
330 * a URL string starting with "http://"
331 * Since 2.6
333 public void setWebsite(char[] website)
335 // void gtk_about_dialog_set_website (GtkAboutDialog *about, const gchar *website);
336 gtk_about_dialog_set_website(gtkAboutDialog, Str.toStringz(website));
340 * Returns the label used for the website link.
341 * about:
342 * a GtkAboutDialog
343 * Returns:
344 * The label used for the website link. The string is owned by the about
345 * dialog and must not be modified.
346 * Since 2.6
348 public char[] getWebsiteLabel()
350 // const gchar* gtk_about_dialog_get_website_label (GtkAboutDialog *about);
351 return Str.toString(gtk_about_dialog_get_website_label(gtkAboutDialog) );
355 * Sets the label to be used for the website link.
356 * It defaults to the website URL.
357 * about:
358 * a GtkAboutDialog
359 * website_label:
360 * the label used for the website link
361 * Since 2.6
363 public void setWebsiteLabel(char[] websiteLabel)
365 // void gtk_about_dialog_set_website_label (GtkAboutDialog *about, const gchar *website_label);
366 gtk_about_dialog_set_website_label(gtkAboutDialog, Str.toStringz(websiteLabel));
370 * Returns the string which are displayed in the authors tab
371 * of the secondary credits dialog.
372 * about:
373 * a GtkAboutDialog
374 * Returns:
375 * A NULL-terminated string array containing
376 * the authors. The array is owned by the about dialog
377 * and must not be modified.
378 * Since 2.6
380 public char** getAuthors()
382 // const gchar* const * gtk_about_dialog_get_authors (GtkAboutDialog *about);
383 return gtk_about_dialog_get_authors(gtkAboutDialog);
387 * Sets the strings which are displayed in the authors tab
388 * of the secondary credits dialog.
389 * about:
390 * a GtkAboutDialog
391 * authors:
392 * a NULL-terminated array of strings
393 * Since 2.6
395 public void setAuthors(char** authors)
397 // void gtk_about_dialog_set_authors (GtkAboutDialog *about, const gchar **authors);
398 gtk_about_dialog_set_authors(gtkAboutDialog, authors);
402 * Returns the string which are displayed in the artists tab
403 * of the secondary credits dialog.
404 * about:
405 * a GtkAboutDialog
406 * Returns:
407 * A NULL-terminated string array containing
408 * the artists. The array is owned by the about dialog
409 * and must not be modified.
410 * Since 2.6
412 public char** getArtists()
414 // const gchar* const * gtk_about_dialog_get_artists (GtkAboutDialog *about);
415 return gtk_about_dialog_get_artists(gtkAboutDialog);
419 * Sets the strings which are displayed in the artists tab
420 * of the secondary credits dialog.
421 * about:
422 * a GtkAboutDialog
423 * artists:
424 * a NULL-terminated array of strings
425 * Since 2.6
427 public void setArtists(char** artists)
429 // void gtk_about_dialog_set_artists (GtkAboutDialog *about, const gchar **artists);
430 gtk_about_dialog_set_artists(gtkAboutDialog, artists);
434 * Returns the string which are displayed in the documenters
435 * tab of the secondary credits dialog.
436 * about:
437 * a GtkAboutDialog
438 * Returns:
439 * A NULL-terminated string array containing
440 * the documenters. The array is owned by the about dialog
441 * and must not be modified.
442 * Since 2.6
444 public char** getDocumenters()
446 // const gchar* const * gtk_about_dialog_get_documenters (GtkAboutDialog *about);
447 return gtk_about_dialog_get_documenters(gtkAboutDialog);
451 * Sets the strings which are displayed in the documenters tab
452 * of the secondary credits dialog.
453 * about:
454 * a GtkAboutDialog
455 * documenters:
456 * a NULL-terminated array of strings
457 * Since 2.6
459 public void setDocumenters(char** documenters)
461 // void gtk_about_dialog_set_documenters (GtkAboutDialog *about, const gchar **documenters);
462 gtk_about_dialog_set_documenters(gtkAboutDialog, documenters);
466 * Returns the translator credits string which is displayed
467 * in the translators tab of the secondary credits dialog.
468 * about:
469 * a GtkAboutDialog
470 * Returns:
471 * The translator credits string. The string is
472 * owned by the about dialog and must not be modified.
473 * Since 2.6
475 public char[] getTranslatorCredits()
477 // const gchar* gtk_about_dialog_get_translator_credits (GtkAboutDialog *about);
478 return Str.toString(gtk_about_dialog_get_translator_credits(gtkAboutDialog) );
482 * Sets the translator credits string which is displayed in
483 * the translators tab of the secondary credits dialog.
484 * The intended use for this string is to display the translator
485 * of the language which is currently used in the user interface.
486 * Using gettext(), a simple way to achieve that is to mark the
487 * string for translation:
488 * gtk_about_dialog_set_translator_credits (about, _("translator-credits"));
489 * It is a good idea to use the customary msgid "translator-credits" for this
490 * purpose, since translators will already know the purpose of that msgid, and
491 * since GtkAboutDialog will detect if "translator-credits" is untranslated
492 * and hide the tab.
493 * about:
494 * a GtkAboutDialog
495 * translator_credits:
496 * the translator credits
497 * Since 2.6
499 public void setTranslatorCredits(char[] translatorCredits)
501 // void gtk_about_dialog_set_translator_credits (GtkAboutDialog *about, const gchar *translator_credits);
502 gtk_about_dialog_set_translator_credits(gtkAboutDialog, Str.toStringz(translatorCredits));
506 * Returns the pixbuf displayed as logo in the about dialog.
507 * about:
508 * a GtkAboutDialog
509 * Returns:
510 * the pixbuf displayed as logo. The pixbuf is
511 * owned by the about dialog. If you want to keep a reference
512 * to it, you have to call g_object_ref() on it.
513 * Since 2.6
515 public Pixbuf getLogo()
517 // GdkPixbuf* gtk_about_dialog_get_logo (GtkAboutDialog *about);
518 return new Pixbuf( gtk_about_dialog_get_logo(gtkAboutDialog) );
522 * Sets the pixbuf to be displayed as logo in
523 * the about dialog. If it is NULL, the default
524 * window icon set with gtk_window_set_default_icon()
525 * will be used.
526 * about:
527 * a GtkAboutDialog
528 * logo:
529 * a GdkPixbuf, or NULL
530 * Since 2.6
532 public void setLogo(Pixbuf logo)
534 // void gtk_about_dialog_set_logo (GtkAboutDialog *about, GdkPixbuf *logo);
535 gtk_about_dialog_set_logo(gtkAboutDialog, (logo is null) ? null : logo.getPixbufStruct());
539 * Returns the icon name displayed as logo in the about dialog.
540 * about:
541 * a GtkAboutDialog
542 * Returns:
543 * the icon name displayed as logo. The string is
544 * owned by the dialog. If you want to keep a reference
545 * to it, you have to call g_strdup() on it.
546 * Since 2.6
548 public char[] getLogoIconName()
550 // const gchar* gtk_about_dialog_get_logo_icon_name (GtkAboutDialog *about);
551 return Str.toString(gtk_about_dialog_get_logo_icon_name(gtkAboutDialog) );
555 * Sets the pixbuf to be displayed as logo in
556 * the about dialog. If it is NULL, the default
557 * window icon set with gtk_window_set_default_icon()
558 * will be used.
559 * about:
560 * a GtkAboutDialog
561 * icon_name:
562 * an icon name, or NULL
563 * Since 2.6
565 public void setLogoIconName(char[] iconName)
567 // void gtk_about_dialog_set_logo_icon_name (GtkAboutDialog *about, const gchar *icon_name);
568 gtk_about_dialog_set_logo_icon_name(gtkAboutDialog, Str.toStringz(iconName));
573 * Installs a global function to be called whenever the user activates an
574 * email link in an about dialog.
575 * func:
576 * a function to call when an email link is activated.
577 * data:
578 * data to pass to func
579 * destroy:
580 * GDestroyNotify for data
581 * Returns:
582 * the previous email hook.
583 * Since 2.6
585 public static GtkAboutDialogActivateLinkFunc setEmailHook(GtkAboutDialogActivateLinkFunc func, void* data, GDestroyNotify destroy)
587 // GtkAboutDialogActivateLinkFunc gtk_about_dialog_set_email_hook (GtkAboutDialogActivateLinkFunc func, gpointer data, GDestroyNotify destroy);
588 return gtk_about_dialog_set_email_hook(func, data, destroy);
592 * Installs a global function to be called whenever the user activates a
593 * URL link in an about dialog.
594 * func:
595 * a function to call when a URL link is activated.
596 * data:
597 * data to pass to func
598 * destroy:
599 * GDestroyNotify for data
600 * Returns:
601 * the previous URL hook.
602 * Since 2.6
604 public static GtkAboutDialogActivateLinkFunc setUrlHook(GtkAboutDialogActivateLinkFunc func, void* data, GDestroyNotify destroy)
606 // GtkAboutDialogActivateLinkFunc gtk_about_dialog_set_url_hook (GtkAboutDialogActivateLinkFunc func, gpointer data, GDestroyNotify destroy);
607 return gtk_about_dialog_set_url_hook(func, data, destroy);
611 * This is a convenience function for showing an application's about box.
612 * The constructed dialog is associated with the parent window and
613 * reused for future invocations of this function.
614 * parent:
615 * transient parent, or NULL for none
616 * first_property_name:
617 * the name of the first property
618 * ...:
619 * value of first property, followed by more properties, NULL-terminated
620 * Since 2.6
621 * Property Details
622 * The "artists" property
623 * "artists" GStrv : Read / Write
624 * The people who contributed artwork to the program, as a NULL-terminated array of strings.
625 * Each string may contain email addresses and URLs, which will be displayed
626 * as links, see the introduction for more details.
627 * Since 2.6
629 public static void showAboutDialog(Window parent, char[] firstPropertyName, ... )
631 // void gtk_show_about_dialog (GtkWindow *parent, const gchar *first_property_name, ...);
632 gtk_show_about_dialog((parent is null) ? null : parent.getWindowStruct(), Str.toStringz(firstPropertyName));