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 = GtkAssistant.html
28 * strct = GtkAssistant
49 * - GdkPixbuf* -> Pixbuf
50 * - GtkWidget* -> Widget
56 private import gtk
.gtktypes
;
58 private import lib
.gtk
;
60 private import glib
.Str
;
61 private import gdk
.Pixbuf
;
62 private import gtk
.Widget
;
66 * A GtkAssistant is a widget used to represent a generally complex
67 * operation splitted in several steps, guiding the user through its pages
68 * and controlling the page flow to collect the necessary data.
70 private import gtk
.Window
;
71 public class Assistant
: Window
74 /** the main Gtk struct */
75 protected GtkAssistant
* gtkAssistant
;
78 public GtkAssistant
* getAssistantStruct()
84 /** the main Gtk struct as a void* */
85 protected void* getStruct()
87 return cast(void*)gtkAssistant
;
91 * Sets our main struct and passes it to the parent class
93 public this (GtkAssistant
* gtkAssistant
)
95 super(cast(GtkWindow
*)gtkAssistant
);
96 this.gtkAssistant
= gtkAssistant
;
102 // imports for the signal processing
103 private import gobject
.Signals
;
104 private import gdk
.gdktypes
;
105 int[char[]] connectedSignals
;
107 void delegate(Assistant
)[] onApplyListeners
;
108 void addOnApply(void delegate(Assistant
) dlg
)
110 if ( !("apply" in connectedSignals
) )
115 cast(GCallback
)&callBackApply
,
118 cast(ConnectFlags
)0);
119 connectedSignals
["apply"] = 1;
121 onApplyListeners
~= dlg
;
123 extern(C
) static void callBackApply(GtkAssistant
* assistantStruct
, Assistant assistant
)
125 bit consumed
= false;
127 foreach ( void delegate(Assistant
) dlg
; assistant
.onApplyListeners
)
135 void delegate(Assistant
)[] onCancelListeners
;
136 void addOnCancel(void delegate(Assistant
) dlg
)
138 if ( !("cancel" in connectedSignals
) )
143 cast(GCallback
)&callBackCancel
,
146 cast(ConnectFlags
)0);
147 connectedSignals
["cancel"] = 1;
149 onCancelListeners
~= dlg
;
151 extern(C
) static void callBackCancel(GtkAssistant
* assistantStruct
, Assistant assistant
)
153 bit consumed
= false;
155 foreach ( void delegate(Assistant
) dlg
; assistant
.onCancelListeners
)
163 void delegate(Assistant
)[] onCloseListeners
;
164 void addOnClose(void delegate(Assistant
) dlg
)
166 if ( !("close" in connectedSignals
) )
171 cast(GCallback
)&callBackClose
,
174 cast(ConnectFlags
)0);
175 connectedSignals
["close"] = 1;
177 onCloseListeners
~= dlg
;
179 extern(C
) static void callBackClose(GtkAssistant
* assistantStruct
, Assistant assistant
)
181 bit consumed
= false;
183 foreach ( void delegate(Assistant
) dlg
; assistant
.onCloseListeners
)
191 void delegate(Widget
, Assistant
)[] onPrepareListeners
;
192 void addOnPrepare(void delegate(Widget
, Assistant
) dlg
)
194 if ( !("prepare" in connectedSignals
) )
199 cast(GCallback
)&callBackPrepare
,
202 cast(ConnectFlags
)0);
203 connectedSignals
["prepare"] = 1;
205 onPrepareListeners
~= dlg
;
207 extern(C
) static void callBackPrepare(GtkAssistant
* assistantStruct
, GtkWidget
* page
, Assistant assistant
)
209 bit consumed
= false;
211 foreach ( void delegate(Widget
, Assistant
) dlg
; assistant
.onPrepareListeners
)
213 dlg(new Widget(page
), assistant
);
222 * Creates a new GtkAssistant.
224 * a newly created GtkAssistant
229 // GtkWidget* gtk_assistant_new (void);
230 this(cast(GtkAssistant
*)gtk_assistant_new() );
234 * Returns the page number of the current page
238 * The index (starting from 0) of the current page in
239 * the assistant, if the assistant has no pages, -1 will be returned
242 public int getCurrentPage()
244 // gint gtk_assistant_get_current_page (GtkAssistant *assistant);
245 return gtk_assistant_get_current_page(gtkAssistant
);
249 * Switches the page to page_num. Note that this will only be necessary
250 * in custom buttons, as the assistant flow can be set with
251 * gtk_assistant_set_forward_page_func().
255 * index of the page to switch to, starting from 0.
256 * If negative, the last page will be used. If greater
257 * than the number of pages in the assistant, nothing
261 public void setCurrentPage(int pageNum
)
263 // void gtk_assistant_set_current_page (GtkAssistant *assistant, gint page_num);
264 gtk_assistant_set_current_page(gtkAssistant
, pageNum
);
268 * Returns the number of pages in the assistant
272 * The number of pages in the assistant.
275 public int getNPages()
277 // gint gtk_assistant_get_n_pages (GtkAssistant *assistant);
278 return gtk_assistant_get_n_pages(gtkAssistant
);
282 * Returns the child widget contained in page number page_num.
286 * The index of a page in the assistant, or -1 to get the last page;
288 * The child widget, or NULL if page_num is out of bounds.
291 public Widget
getNthPage(int pageNum
)
293 // GtkWidget* gtk_assistant_get_nth_page (GtkAssistant *assistant, gint page_num);
294 return new Widget( gtk_assistant_get_nth_page(gtkAssistant
, pageNum
) );
298 * Prepends a page to the assistant.
304 * the index (starting at 0) of the inserted page
307 public int prependPage(Widget page
)
309 // gint gtk_assistant_prepend_page (GtkAssistant *assistant, GtkWidget *page);
310 return gtk_assistant_prepend_page(gtkAssistant
, (page
is null) ?
null : page
.getWidgetStruct());
314 * Appends a page to the assistant.
320 * the index (starting at 0) of the inserted page
323 public int appendPage(Widget page
)
325 // gint gtk_assistant_append_page (GtkAssistant *assistant, GtkWidget *page);
326 return gtk_assistant_append_page(gtkAssistant
, (page
is null) ?
null : page
.getWidgetStruct());
330 * Inserts a page in the assistant at a given position.
336 * the index (starting at 0) at which to insert the page,
337 * or -1 to append the page to the assistant
339 * the index (starting from 0) of the inserted page
342 public int insertPage(Widget page
, int position
)
344 // gint gtk_assistant_insert_page (GtkAssistant *assistant, GtkWidget *page, gint position);
345 return gtk_assistant_insert_page(gtkAssistant
, (page
is null) ?
null : page
.getWidgetStruct(), position
);
350 * Sets the page forwarding function to be page_func, this function will
351 * be used to determine what will be the next page when the user presses
352 * the forward button. Setting page_func to NULL will make the assistant
353 * to use the default forward function, which just goes to the next visible
358 * the GtkAssistantPageFunc, or NULL to use the default one
360 * user data for page_func
362 * destroy notifier for data
365 public void setForwardPageFunc(GtkAssistantPageFunc pageFunc
, void* data
, GDestroyNotify destroy
)
367 // void gtk_assistant_set_forward_page_func (GtkAssistant *assistant, GtkAssistantPageFunc page_func, gpointer data, GDestroyNotify destroy);
368 gtk_assistant_set_forward_page_func(gtkAssistant
, pageFunc
, data
, destroy
);
373 * Sets the page type for page. The page type determines the page
374 * behavior in the assistant.
378 * a page of assistant
380 * the new type for page
383 public void setPageType(Widget page
, GtkAssistantPageType type
)
385 // void gtk_assistant_set_page_type (GtkAssistant *assistant, GtkWidget *page, GtkAssistantPageType type);
386 gtk_assistant_set_page_type(gtkAssistant
, (page
is null) ?
null : page
.getWidgetStruct(), type
);
390 * Gets the page type of page.
394 * a page of assistant
396 * the page type of page.
399 public GtkAssistantPageType
getPageType(Widget page
)
401 // GtkAssistantPageType gtk_assistant_get_page_type (GtkAssistant *assistant, GtkWidget *page);
402 return gtk_assistant_get_page_type(gtkAssistant
, (page
is null) ?
null : page
.getWidgetStruct());
406 * Sets a title for page. The title is displayed in the header
407 * area of the assistant when page is the current page.
411 * a page of assistant
413 * the new title for page
416 public void setPageTitle(Widget page
, char[] title
)
418 // void gtk_assistant_set_page_title (GtkAssistant *assistant, GtkWidget *page, const gchar *title);
419 gtk_assistant_set_page_title(gtkAssistant
, (page
is null) ?
null : page
.getWidgetStruct(), Str
.toStringz(title
));
423 * Gets the title for page.
427 * a page of assistant
429 * the title for page.
432 public char[] getPageTitle(Widget page
)
434 // const gchar* gtk_assistant_get_page_title (GtkAssistant *assistant, GtkWidget *page);
435 return Str
.toString(gtk_assistant_get_page_title(gtkAssistant
, (page
is null) ?
null : page
.getWidgetStruct()) );
439 * Sets a header image for page. This image is displayed in the header
440 * area of the assistant when page is the current page.
444 * a page of assistant
446 * the new header image page
449 public void setPageHeaderImage(Widget page
, Pixbuf pixbuf
)
451 // void gtk_assistant_set_page_header_image (GtkAssistant *assistant, GtkWidget *page, GdkPixbuf *pixbuf);
452 gtk_assistant_set_page_header_image(gtkAssistant
, (page
is null) ?
null : page
.getWidgetStruct(), (pixbuf
is null) ?
null : pixbuf
.getPixbufStruct());
456 * Gets the header image for page.
460 * a page of assistant
462 * the header image for page, or NULL
463 * if there's no header image for the page.
466 public Pixbuf
getPageHeaderImage(Widget page
)
468 // GdkPixbuf* gtk_assistant_get_page_header_image (GtkAssistant *assistant, GtkWidget *page);
469 return new Pixbuf( gtk_assistant_get_page_header_image(gtkAssistant
, (page
is null) ?
null : page
.getWidgetStruct()) );
473 * Sets a header image for page. This image is displayed in the side
474 * area of the assistant when page is the current page.
478 * a page of assistant
480 * the new header image page
483 public void setPageSideImage(Widget page
, Pixbuf pixbuf
)
485 // void gtk_assistant_set_page_side_image (GtkAssistant *assistant, GtkWidget *page, GdkPixbuf *pixbuf);
486 gtk_assistant_set_page_side_image(gtkAssistant
, (page
is null) ?
null : page
.getWidgetStruct(), (pixbuf
is null) ?
null : pixbuf
.getPixbufStruct());
490 * Gets the header image for page.
494 * a page of assistant
496 * the side image for page, or NULL
497 * if there's no side image for the page.
500 public Pixbuf
getPageSideImage(Widget page
)
502 // GdkPixbuf* gtk_assistant_get_page_side_image (GtkAssistant *assistant, GtkWidget *page);
503 return new Pixbuf( gtk_assistant_get_page_side_image(gtkAssistant
, (page
is null) ?
null : page
.getWidgetStruct()) );
507 * Sets whether page contents are complete. This will make
508 * assistant update the buttons state to be able to continue the task.
512 * a page of assistant
514 * the completeness status of the page
517 public void setPageComplete(Widget page
, int complete
)
519 // void gtk_assistant_set_page_complete (GtkAssistant *assistant, GtkWidget *page, gboolean complete);
520 gtk_assistant_set_page_complete(gtkAssistant
, (page
is null) ?
null : page
.getWidgetStruct(), complete
);
524 * Gets whether page is complete..
528 * a page of assistant
530 * TRUE if page is complete.
533 public int getPageComplete(Widget page
)
535 // gboolean gtk_assistant_get_page_complete (GtkAssistant *assistant, GtkWidget *page);
536 return gtk_assistant_get_page_complete(gtkAssistant
, (page
is null) ?
null : page
.getWidgetStruct());
540 * Adds a widget to the action area of a GtkAssistant.
547 public void addActionWidget(Widget child
)
549 // void gtk_assistant_add_action_widget (GtkAssistant *assistant, GtkWidget *child);
550 gtk_assistant_add_action_widget(gtkAssistant
, (child
is null) ?
null : child
.getWidgetStruct());
554 * Removes a widget from the action area of a GtkAssistant.
561 public void removeActionWidget(Widget child
)
563 // void gtk_assistant_remove_action_widget (GtkAssistant *assistant, GtkWidget *child);
564 gtk_assistant_remove_action_widget(gtkAssistant
, (child
is null) ?
null : child
.getWidgetStruct());
568 * Forces assistant to recompute the buttons state.
569 * GTK+ automatically takes care of this in most situations,
570 * e.g. when the user goes to a different page, or when the
571 * visibility or completeness of a page changes.
572 * One situation where it can be necessary to call this
573 * function is when changing a value on the current page
574 * affects the future page flow of the assistant.
578 * Child Property Details
579 * The "complete" child property
580 * "complete" gboolean : Read / Write
581 * Setting the "complete" child property to TRUE marks a page as complete
582 * (i.e.: all the required fields are filled out). GTK+ uses this information
583 * to control the sensitivity of the navigation buttons.
584 * Default value: FALSE
587 public void updateButtonsState()
589 // void gtk_assistant_update_buttons_state (GtkAssistant *assistant);
590 gtk_assistant_update_buttons_state(gtkAssistant
);