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
28 * strct = GtkAssistant
49 * - GdkPixbuf* -> Pixbuf
50 * - GtkWidget* -> Widget
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
;
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()
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
)
110 if ( gtkAssistant
is null )
115 Stdout("struct gtkAssistant is null on constructor").newline
;
119 printf("struct gtkAssistant is null on constructor");
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
) )
148 cast(GCallback
)&callBackApply
,
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
)
168 void delegate(Assistant
)[] onCancelListeners
;
169 void addOnCancel(void delegate(Assistant
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
171 if ( !("cancel" in connectedSignals
) )
176 cast(GCallback
)&callBackCancel
,
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
)
196 void delegate(Assistant
)[] onCloseListeners
;
197 void addOnClose(void delegate(Assistant
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
199 if ( !("close" in connectedSignals
) )
204 cast(GCallback
)&callBackClose
,
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
)
224 void delegate(Widget
, Assistant
)[] onPrepareListeners
;
225 void addOnPrepare(void delegate(Widget
, Assistant
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
227 if ( !("prepare" in connectedSignals
) )
232 cast(GCallback
)&callBackPrepare
,
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
);
255 * Creates a new GtkAssistant.
257 * a newly created GtkAssistant
262 // GtkWidget* gtk_assistant_new (void);
263 this(cast(GtkAssistant
*)gtk_assistant_new() );
267 * Returns the page number of the current page
271 * The index (starting from 0) of the current page in
272 * the assistant, if the assistant has no pages, -1 will be returned
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().
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
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
305 * The number of pages in the assistant.
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.
319 * The index of a page in the assistant, or -1 to get the last page;
321 * The child widget, or NULL if page_num is out of bounds.
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.
337 * the index (starting at 0) of the inserted page
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.
353 * the index (starting at 0) of the inserted page
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.
369 * the index (starting at 0) at which to insert the page,
370 * or -1 to append the page to the assistant
372 * the index (starting from 0) of the inserted page
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
391 * the GtkAssistantPageFunc, or NULL to use the default one
393 * user data for page_func
395 * destroy notifier for data
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.
411 * a page of assistant
413 * the new type for page
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.
427 * a page of assistant
429 * the page type of page.
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.
444 * a page of assistant
446 * the new title for page
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.
460 * a page of assistant
462 * the title for page.
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.
477 * a page of assistant
479 * the new header image page
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.
493 * a page of assistant
495 * the header image for page, or NULL
496 * if there's no header image for the page.
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.
511 * a page of assistant
513 * the new header image page
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.
527 * a page of assistant
529 * the side image for page, or NULL
530 * if there's no side image for the page.
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.
545 * a page of assistant
547 * the completeness status of the page
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..
561 * a page of assistant
563 * TRUE if page is complete.
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.
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.
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.
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
620 public void updateButtonsState()
622 // void gtk_assistant_update_buttons_state (GtkAssistant *assistant);
623 gtk_assistant_update_buttons_state(gtkAssistant
);