2007-04-29 Murray Cumming <murrayc@murrayc.com>
[modest] / src / maemo / easysetup / modest-wizard-dialog.h
1 /*
2  * This is a copy of modest-wizard-dialog.h with a rename and some API additions,
3  * for osso-modest-easysetup.
4  * 
5  * This file was part of modest-libs
6  *
7  * Copyright (C) 2005, 2006, 2007 Nokia Corporation, all rights reserved.
8  *
9  */
10  
11 #ifndef __MODEST_WIZARD_DIALOG_H__
12 #define __MODEST_WIZARD_DIALOG_H__
13
14 #include <gtk/gtkwidget.h>
15 #include <gtk/gtkwindow.h>
16 #include <gtk/gtknotebook.h>
17 #include <gtk/gtkdialog.h>
18
19 G_BEGIN_DECLS
20
21 #define MODEST_TYPE_WIZARD_DIALOG (modest_wizard_dialog_get_type())
22
23 #define MODEST_WIZARD_DIALOG(obj) (GTK_CHECK_CAST ((obj), \
24             MODEST_TYPE_WIZARD_DIALOG, ModestWizardDialog))
25
26 #define MODEST_WIZARD_DIALOG_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), \
27             MODEST_TYPE_WIZARD_DIALOG, ModestWizardDialogClass))
28
29 #define MODEST_IS_WIZARD_DIALOG(obj) (GTK_CHECK_TYPE ((obj), \
30             MODEST_TYPE_WIZARD_DIALOG))
31
32 #define MODEST_IS_WIZARD_DIALOG_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), \
33             MODEST_TYPE_WIZARD_DIALOG))
34             
35 #define MODEST_WIZARD_DIALOG_GET_CLASS(obj) \
36             (G_TYPE_INSTANCE_GET_CLASS ((obj), \
37             MODEST_TYPE_WIZARD_DIALOG, ModestWizardDialogClass))
38
39 typedef struct _ModestWizardDialog ModestWizardDialog;
40
41 typedef struct _ModestWizardDialogClass ModestWizardDialogClass;
42
43 typedef struct _ModestWizardDialogPrivate ModestWizardDialogPrivate;
44
45 /* button response IDs */
46 enum {
47     MODEST_WIZARD_DIALOG_CANCEL = GTK_RESPONSE_CANCEL,
48     MODEST_WIZARD_DIALOG_PREVIOUS = 0,
49     MODEST_WIZARD_DIALOG_NEXT,
50     MODEST_WIZARD_DIALOG_FINISH
51 };
52
53 struct _ModestWizardDialog {
54     GtkDialog                   parent;
55     ModestWizardDialogPrivate   *priv;
56 };
57
58 struct _ModestWizardDialogClass {
59     GtkDialogClass          parent_class;
60     
61         /** Implementations of this vfunc should prepare the next page if necessary, 
62          * and only return TRUE if the navigation should be allowed.
63          * You may even change the next page, via the GtkNotebook API, in the signal handler. */
64         gboolean (* before_next) (ModestWizardDialog *dialog, GtkWidget *current_page, GtkWidget *next_page);
65
66         /** Implementations of this vfunc should enable or disable 
67          * the next/forward buttons appropriately, based on the entered data. */
68         void (* enable_buttons) (ModestWizardDialog *dialog, GtkWidget *current_page);
69
70
71     void (*_gtk_reserved2)  (void);
72     void (*_gtk_reserved3)  (void);
73     void (*_gtk_reserved4)  (void);
74 };
75
76
77 GType modest_wizard_dialog_get_type   (void) G_GNUC_CONST;
78
79 GtkWidget* modest_wizard_dialog_new   (GtkWindow        *parent,
80                                        const char       *wizard_name,
81                                        GtkNotebook      *notebook);
82
83 G_END_DECLS
84
85 #endif /* __MODEST_WIZARD_DIALOG_H__ */