Wrote the README_GIT file to be a proper tutorial on git, repo.or.cz and gtkD.
[gtkD.git] / gtkD / src / gtk / Assistant.d
blobb60c566459b2a78127cc2369511246fd790700de
1 /*
2 * This file is part of gtkD.
4 * gtkD 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 * gtkD 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 gtkD; 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 = GtkAssistant.html
26 * outPack = gtk
27 * outFile = Assistant
28 * strct = GtkAssistant
29 * realStrct=
30 * ctorStrct=
31 * clss = Assistant
32 * interf =
33 * class Code: No
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - gtk_assistant_
40 * - gtk_
41 * omit structs:
42 * omit prefixes:
43 * omit code:
44 * imports:
45 * - glib.Str
46 * - gdk.Pixbuf
47 * - gtk.Widget
48 * structWrap:
49 * - GdkPixbuf* -> Pixbuf
50 * - GtkWidget* -> Widget
51 * module aliases:
52 * local aliases:
55 module gtk.Assistant;
57 version(noAssert)
59 version(Tango)
61 import tango.io.Stdout; // use the tango loging?
65 private import gtkc.gtktypes;
67 private import gtkc.gtk;
70 private import glib.Str;
71 private import gdk.Pixbuf;
72 private import gtk.Widget;
77 /**
78 * Description
79 * A GtkAssistant is a widget used to represent a generally complex
80 * operation splitted in several steps, guiding the user through its pages
81 * and controlling the page flow to collect the necessary data.
83 private import gtk.Window;
84 public class Assistant : Window
87 /** the main Gtk struct */
88 protected GtkAssistant* gtkAssistant;
91 public GtkAssistant* getAssistantStruct()
93 return gtkAssistant;
97 /** the main Gtk struct as a void* */
98 protected void* getStruct()
100 return cast(void*)gtkAssistant;
104 * Sets our main struct and passes it to the parent class
106 public this (GtkAssistant* gtkAssistant)
108 version(noAssert)
110 if ( gtkAssistant is null )
112 int zero = 0;
113 version(Tango)
115 Stdout("struct gtkAssistant is null on constructor").newline;
117 else
119 printf("struct gtkAssistant is null on constructor");
121 zero = zero / zero;
124 else
126 assert(gtkAssistant !is null, "struct gtkAssistant is null on constructor");
128 super(cast(GtkWindow*)gtkAssistant);
129 this.gtkAssistant = gtkAssistant;
135 // imports for the signal processing
136 private import gobject.Signals;
137 private import gtkc.gdktypes;
138 int[char[]] connectedSignals;
140 void delegate(Assistant)[] onApplyListeners;
141 void addOnApply(void delegate(Assistant) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
143 if ( !("apply" in connectedSignals) )
145 Signals.connectData(
146 getStruct(),
147 "apply",
148 cast(GCallback)&callBackApply,
149 cast(void*)this,
150 null,
151 connectFlags);
152 connectedSignals["apply"] = 1;
154 onApplyListeners ~= dlg;
156 extern(C) static void callBackApply(GtkAssistant* assistantStruct, Assistant assistant)
158 bool consumed = false;
160 foreach ( void delegate(Assistant) dlg ; assistant.onApplyListeners )
162 dlg(assistant);
165 return consumed;
168 void delegate(Assistant)[] onCancelListeners;
169 void addOnCancel(void delegate(Assistant) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
171 if ( !("cancel" in connectedSignals) )
173 Signals.connectData(
174 getStruct(),
175 "cancel",
176 cast(GCallback)&callBackCancel,
177 cast(void*)this,
178 null,
179 connectFlags);
180 connectedSignals["cancel"] = 1;
182 onCancelListeners ~= dlg;
184 extern(C) static void callBackCancel(GtkAssistant* assistantStruct, Assistant assistant)
186 bool consumed = false;
188 foreach ( void delegate(Assistant) dlg ; assistant.onCancelListeners )
190 dlg(assistant);
193 return consumed;
196 void delegate(Assistant)[] onCloseListeners;
197 void addOnClose(void delegate(Assistant) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
199 if ( !("close" in connectedSignals) )
201 Signals.connectData(
202 getStruct(),
203 "close",
204 cast(GCallback)&callBackClose,
205 cast(void*)this,
206 null,
207 connectFlags);
208 connectedSignals["close"] = 1;
210 onCloseListeners ~= dlg;
212 extern(C) static void callBackClose(GtkAssistant* assistantStruct, Assistant assistant)
214 bool consumed = false;
216 foreach ( void delegate(Assistant) dlg ; assistant.onCloseListeners )
218 dlg(assistant);
221 return consumed;
224 void delegate(Widget, Assistant)[] onPrepareListeners;
225 void addOnPrepare(void delegate(Widget, Assistant) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
227 if ( !("prepare" in connectedSignals) )
229 Signals.connectData(
230 getStruct(),
231 "prepare",
232 cast(GCallback)&callBackPrepare,
233 cast(void*)this,
234 null,
235 connectFlags);
236 connectedSignals["prepare"] = 1;
238 onPrepareListeners ~= dlg;
240 extern(C) static void callBackPrepare(GtkAssistant* assistantStruct, GtkWidget* page, Assistant assistant)
242 bool consumed = false;
244 foreach ( void delegate(Widget, Assistant) dlg ; assistant.onPrepareListeners )
246 dlg(new Widget(page), assistant);
249 return consumed;
255 * Creates a new GtkAssistant.
256 * Returns:
257 * a newly created GtkAssistant
258 * Since 2.10
260 public this ()
262 // GtkWidget* gtk_assistant_new (void);
263 this(cast(GtkAssistant*)gtk_assistant_new() );
267 * Returns the page number of the current page
268 * assistant:
269 * a GtkAssistant
270 * Returns:
271 * The index (starting from 0) of the current page in
272 * the assistant, if the assistant has no pages, -1 will be returned
273 * Since 2.10
275 public int getCurrentPage()
277 // gint gtk_assistant_get_current_page (GtkAssistant *assistant);
278 return gtk_assistant_get_current_page(gtkAssistant);
282 * Switches the page to page_num. Note that this will only be necessary
283 * in custom buttons, as the assistant flow can be set with
284 * gtk_assistant_set_forward_page_func().
285 * assistant:
286 * a GtkAssistant
287 * page_num:
288 * index of the page to switch to, starting from 0.
289 * If negative, the last page will be used. If greater
290 * than the number of pages in the assistant, nothing
291 * will be done.
292 * Since 2.10
294 public void setCurrentPage(int pageNum)
296 // void gtk_assistant_set_current_page (GtkAssistant *assistant, gint page_num);
297 gtk_assistant_set_current_page(gtkAssistant, pageNum);
301 * Returns the number of pages in the assistant
302 * assistant:
303 * a GtkAssistant
304 * Returns:
305 * The number of pages in the assistant.
306 * Since 2.10
308 public int getNPages()
310 // gint gtk_assistant_get_n_pages (GtkAssistant *assistant);
311 return gtk_assistant_get_n_pages(gtkAssistant);
315 * Returns the child widget contained in page number page_num.
316 * assistant:
317 * a GtkAssistant
318 * page_num:
319 * The index of a page in the assistant, or -1 to get the last page;
320 * Returns:
321 * The child widget, or NULL if page_num is out of bounds.
322 * Since 2.10
324 public Widget getNthPage(int pageNum)
326 // GtkWidget* gtk_assistant_get_nth_page (GtkAssistant *assistant, gint page_num);
327 return new Widget( gtk_assistant_get_nth_page(gtkAssistant, pageNum) );
331 * Prepends a page to the assistant.
332 * assistant:
333 * a GtkAssistant
334 * page:
335 * a GtkWidget
336 * Returns:
337 * the index (starting at 0) of the inserted page
338 * Since 2.10
340 public int prependPage(Widget page)
342 // gint gtk_assistant_prepend_page (GtkAssistant *assistant, GtkWidget *page);
343 return gtk_assistant_prepend_page(gtkAssistant, (page is null) ? null : page.getWidgetStruct());
347 * Appends a page to the assistant.
348 * assistant:
349 * a GtkAssistant
350 * page:
351 * a GtkWidget
352 * Returns:
353 * the index (starting at 0) of the inserted page
354 * Since 2.10
356 public int appendPage(Widget page)
358 // gint gtk_assistant_append_page (GtkAssistant *assistant, GtkWidget *page);
359 return gtk_assistant_append_page(gtkAssistant, (page is null) ? null : page.getWidgetStruct());
363 * Inserts a page in the assistant at a given position.
364 * assistant:
365 * a GtkAssistant
366 * page:
367 * a GtkWidget
368 * position:
369 * the index (starting at 0) at which to insert the page,
370 * or -1 to append the page to the assistant
371 * Returns:
372 * the index (starting from 0) of the inserted page
373 * Since 2.10
375 public int insertPage(Widget page, int position)
377 // gint gtk_assistant_insert_page (GtkAssistant *assistant, GtkWidget *page, gint position);
378 return gtk_assistant_insert_page(gtkAssistant, (page is null) ? null : page.getWidgetStruct(), position);
383 * Sets the page forwarding function to be page_func, this function will
384 * be used to determine what will be the next page when the user presses
385 * the forward button. Setting page_func to NULL will make the assistant
386 * to use the default forward function, which just goes to the next visible
387 * page.
388 * assistant:
389 * a GtkAssistant
390 * page_func:
391 * the GtkAssistantPageFunc, or NULL to use the default one
392 * data:
393 * user data for page_func
394 * destroy:
395 * destroy notifier for data
396 * Since 2.10
398 public void setForwardPageFunc(GtkAssistantPageFunc pageFunc, void* data, GDestroyNotify destroy)
400 // void gtk_assistant_set_forward_page_func (GtkAssistant *assistant, GtkAssistantPageFunc page_func, gpointer data, GDestroyNotify destroy);
401 gtk_assistant_set_forward_page_func(gtkAssistant, pageFunc, data, destroy);
406 * Sets the page type for page. The page type determines the page
407 * behavior in the assistant.
408 * assistant:
409 * a GtkAssistant
410 * page:
411 * a page of assistant
412 * type:
413 * the new type for page
414 * Since 2.10
416 public void setPageType(Widget page, GtkAssistantPageType type)
418 // void gtk_assistant_set_page_type (GtkAssistant *assistant, GtkWidget *page, GtkAssistantPageType type);
419 gtk_assistant_set_page_type(gtkAssistant, (page is null) ? null : page.getWidgetStruct(), type);
423 * Gets the page type of page.
424 * assistant:
425 * a GtkAssistant
426 * page:
427 * a page of assistant
428 * Returns:
429 * the page type of page.
430 * Since 2.10
432 public GtkAssistantPageType getPageType(Widget page)
434 // GtkAssistantPageType gtk_assistant_get_page_type (GtkAssistant *assistant, GtkWidget *page);
435 return gtk_assistant_get_page_type(gtkAssistant, (page is null) ? null : page.getWidgetStruct());
439 * Sets a title for page. The title is displayed in the header
440 * area of the assistant when page is the current page.
441 * assistant:
442 * a GtkAssistant
443 * page:
444 * a page of assistant
445 * title:
446 * the new title for page
447 * Since 2.10
449 public void setPageTitle(Widget page, char[] title)
451 // void gtk_assistant_set_page_title (GtkAssistant *assistant, GtkWidget *page, const gchar *title);
452 gtk_assistant_set_page_title(gtkAssistant, (page is null) ? null : page.getWidgetStruct(), Str.toStringz(title));
456 * Gets the title for page.
457 * assistant:
458 * a GtkAssistant
459 * page:
460 * a page of assistant
461 * Returns:
462 * the title for page.
463 * Since 2.10
465 public char[] getPageTitle(Widget page)
467 // const gchar* gtk_assistant_get_page_title (GtkAssistant *assistant, GtkWidget *page);
468 return Str.toString(gtk_assistant_get_page_title(gtkAssistant, (page is null) ? null : page.getWidgetStruct()) );
472 * Sets a header image for page. This image is displayed in the header
473 * area of the assistant when page is the current page.
474 * assistant:
475 * a GtkAssistant
476 * page:
477 * a page of assistant
478 * pixbuf:
479 * the new header image page
480 * Since 2.10
482 public void setPageHeaderImage(Widget page, Pixbuf pixbuf)
484 // void gtk_assistant_set_page_header_image (GtkAssistant *assistant, GtkWidget *page, GdkPixbuf *pixbuf);
485 gtk_assistant_set_page_header_image(gtkAssistant, (page is null) ? null : page.getWidgetStruct(), (pixbuf is null) ? null : pixbuf.getPixbufStruct());
489 * Gets the header image for page.
490 * assistant:
491 * a GtkAssistant
492 * page:
493 * a page of assistant
494 * Returns:
495 * the header image for page, or NULL
496 * if there's no header image for the page.
497 * Since 2.10
499 public Pixbuf getPageHeaderImage(Widget page)
501 // GdkPixbuf* gtk_assistant_get_page_header_image (GtkAssistant *assistant, GtkWidget *page);
502 return new Pixbuf( gtk_assistant_get_page_header_image(gtkAssistant, (page is null) ? null : page.getWidgetStruct()) );
506 * Sets a header image for page. This image is displayed in the side
507 * area of the assistant when page is the current page.
508 * assistant:
509 * a GtkAssistant
510 * page:
511 * a page of assistant
512 * pixbuf:
513 * the new header image page
514 * Since 2.10
516 public void setPageSideImage(Widget page, Pixbuf pixbuf)
518 // void gtk_assistant_set_page_side_image (GtkAssistant *assistant, GtkWidget *page, GdkPixbuf *pixbuf);
519 gtk_assistant_set_page_side_image(gtkAssistant, (page is null) ? null : page.getWidgetStruct(), (pixbuf is null) ? null : pixbuf.getPixbufStruct());
523 * Gets the header image for page.
524 * assistant:
525 * a GtkAssistant
526 * page:
527 * a page of assistant
528 * Returns:
529 * the side image for page, or NULL
530 * if there's no side image for the page.
531 * Since 2.10
533 public Pixbuf getPageSideImage(Widget page)
535 // GdkPixbuf* gtk_assistant_get_page_side_image (GtkAssistant *assistant, GtkWidget *page);
536 return new Pixbuf( gtk_assistant_get_page_side_image(gtkAssistant, (page is null) ? null : page.getWidgetStruct()) );
540 * Sets whether page contents are complete. This will make
541 * assistant update the buttons state to be able to continue the task.
542 * assistant:
543 * a GtkAssistant
544 * page:
545 * a page of assistant
546 * complete:
547 * the completeness status of the page
548 * Since 2.10
550 public void setPageComplete(Widget page, int complete)
552 // void gtk_assistant_set_page_complete (GtkAssistant *assistant, GtkWidget *page, gboolean complete);
553 gtk_assistant_set_page_complete(gtkAssistant, (page is null) ? null : page.getWidgetStruct(), complete);
557 * Gets whether page is complete..
558 * assistant:
559 * a GtkAssistant
560 * page:
561 * a page of assistant
562 * Returns:
563 * TRUE if page is complete.
564 * Since 2.10
566 public int getPageComplete(Widget page)
568 // gboolean gtk_assistant_get_page_complete (GtkAssistant *assistant, GtkWidget *page);
569 return gtk_assistant_get_page_complete(gtkAssistant, (page is null) ? null : page.getWidgetStruct());
573 * Adds a widget to the action area of a GtkAssistant.
574 * assistant:
575 * a GtkAssistant
576 * child:
577 * a GtkWidget
578 * Since 2.10
580 public void addActionWidget(Widget child)
582 // void gtk_assistant_add_action_widget (GtkAssistant *assistant, GtkWidget *child);
583 gtk_assistant_add_action_widget(gtkAssistant, (child is null) ? null : child.getWidgetStruct());
587 * Removes a widget from the action area of a GtkAssistant.
588 * assistant:
589 * a GtkAssistant
590 * child:
591 * a GtkWidget
592 * Since 2.10
594 public void removeActionWidget(Widget child)
596 // void gtk_assistant_remove_action_widget (GtkAssistant *assistant, GtkWidget *child);
597 gtk_assistant_remove_action_widget(gtkAssistant, (child is null) ? null : child.getWidgetStruct());
601 * Forces assistant to recompute the buttons state.
602 * GTK+ automatically takes care of this in most situations,
603 * e.g. when the user goes to a different page, or when the
604 * visibility or completeness of a page changes.
605 * One situation where it can be necessary to call this
606 * function is when changing a value on the current page
607 * affects the future page flow of the assistant.
608 * assistant:
609 * a GtkAssistant
610 * Since 2.10
611 * Child Property Details
612 * The "complete" child property
613 * "complete" gboolean : Read / Write
614 * Setting the "complete" child property to TRUE marks a page as complete
615 * (i.e.: all the required fields are filled out). GTK+ uses this information
616 * to control the sensitivity of the navigation buttons.
617 * Default value: FALSE
618 * Since 2.10
620 public void updateButtonsState()
622 // void gtk_assistant_update_buttons_state (GtkAssistant *assistant);
623 gtk_assistant_update_buttons_state(gtkAssistant);