Fixes a crash added in a recent commit
[modest] / src / widgets / modest-account-settings-dialog.h
1 /* Copyright (c) 2007, Nokia Corporation
2  * All rights reserved.
3  *
4  */
5
6 #ifndef _MODEST_ACCOUNT_SETTINGS_DIALOG
7 #define _MODEST_ACCOUNT_SETTINGS_DIALOG
8
9 #include <gtk/gtkdialog.h>
10 #include <gtk/gtknotebook.h>
11 #include "modest-account-mgr.h"
12
13 G_BEGIN_DECLS
14
15 #define MODEST_TYPE_ACCOUNT_SETTINGS_DIALOG modest_account_settings_dialog_get_type()
16
17 #define MODEST_ACCOUNT_SETTINGS_DIALOG(obj) \
18         (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
19         MODEST_TYPE_ACCOUNT_SETTINGS_DIALOG, ModestAccountSettingsDialog))
20
21 #define MODEST_ACCOUNT_SETTINGS_DIALOG_CLASS(klass) \
22         (G_TYPE_CHECK_CLASS_CAST ((klass), \
23         MODEST_TYPE_ACCOUNT_SETTINGS_DIALOG, ModestAccountSettingsDialogClass))
24
25 #define MODEST_IS_ACCOUNT_SETTINGS_DIALOG(obj) \
26         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
27         MODEST_TYPE_ACCOUNT_SETTINGS_DIALOG))
28
29 #define MODEST_IS_ACCOUNT_SETTINGS_DIALOG_CLASS(klass) \
30         (G_TYPE_CHECK_CLASS_TYPE ((klass), \
31         MODEST_TYPE_ACCOUNT_SETTINGS_DIALOG))
32
33 #define MODEST_ACCOUNT_SETTINGS_DIALOG_GET_CLASS(obj) \
34         (G_TYPE_INSTANCE_GET_CLASS ((obj), \
35         MODEST_TYPE_ACCOUNT_SETTINGS_DIALOG, ModestAccountSettingsDialogClass))
36
37 typedef struct {
38         GtkDialog parent;
39         
40         /* Used by derived widgets to query existing accounts,
41          * and to create new accounts: */
42         ModestAccountMgr *account_manager;
43         ModestAccountSettings *settings;
44         
45         gboolean modified;
46         gboolean save_password;
47         gchar * account_name; /* This may not change. It is not user visible. */
48         ModestTransportStoreProtocol incoming_protocol; /* This may not change. */
49         ModestTransportStoreProtocol outgoing_protocol; /* This may not change. */
50         gchar * original_account_title;
51
52         ModestAuthProtocol protocol_authentication_incoming;
53         
54         GtkNotebook *notebook;
55         
56         GtkWidget *page_account_details;
57         GtkWidget *entry_account_title;
58         GtkWidget *combo_retrieve;
59         GtkWidget *combo_limit_retrieve;
60         GtkWidget *caption_leave_messages;
61         GtkWidget *checkbox_leave_messages;
62         
63         GtkWidget *page_user_details;
64         GtkWidget *entry_user_name;
65         GtkWidget *entry_user_username;
66         GtkWidget *entry_user_password;
67         GtkWidget *entry_user_email;
68         GtkWidget *entry_incoming_port;
69         GtkWidget *button_signature;
70         
71         GtkWidget *page_complete_easysetup;
72         
73         GtkWidget *page_incoming;
74         GtkWidget *caption_incoming;
75         GtkWidget *entry_incomingserver;
76         GtkWidget *combo_incoming_security;
77         GtkWidget *checkbox_incoming_auth;
78
79         GtkWidget *page_outgoing;
80         GtkWidget *entry_outgoingserver;
81         GtkWidget *caption_outgoing_username;
82         GtkWidget *entry_outgoing_username;
83         GtkWidget *caption_outgoing_password;
84         GtkWidget *entry_outgoing_password;
85         GtkWidget *combo_outgoing_security;
86         GtkWidget *combo_outgoing_auth;
87         GtkWidget *entry_outgoing_port;
88         GtkWidget *checkbox_outgoing_smtp_specific;
89         GtkWidget *button_outgoing_smtp_servers;
90         
91         GtkWidget *signature_dialog;
92         
93 } ModestAccountSettingsDialog;
94
95 typedef struct {
96         GtkDialogClass parent_class;
97         
98 } ModestAccountSettingsDialogClass;
99
100 GType modest_account_settings_dialog_get_type (void);
101
102 ModestAccountSettingsDialog* modest_account_settings_dialog_new (void);
103
104 void modest_account_settings_dialog_set_account (ModestAccountSettingsDialog *dialog, ModestAccountSettings *settings);
105
106 void modest_account_settings_dialog_switch_to_user_info (ModestAccountSettingsDialog *dialog);
107
108 void modest_account_settings_dialog_set_modified (ModestAccountSettingsDialog *dialog, gboolean modified);
109
110 void modest_account_settings_dialog_save_password (ModestAccountSettingsDialog *dialog);
111
112 void modest_account_settings_dialog_check_allow_changes (ModestAccountSettingsDialog *self);
113 G_END_DECLS
114
115 #endif /* _MODEST_ACCOUNT_SETTINGS_DIALOG */