1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 * Copyright (C) 2003 Ximian, Inc.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of version 2 of the GNU Lesser General Public
7 * License as published by the Free Software Foundation.
9 * This program 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 GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
23 #include <glib-object.h>
27 #define E_TYPE_ACCOUNT (e_account_get_type ())
28 #define E_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_ACCOUNT, EAccount))
29 #define E_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_ACCOUNT, EAccountClass))
30 #define E_IS_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_ACCOUNT))
31 #define E_IS_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_ACCOUNT))
33 typedef enum _e_account_item_t {
38 E_ACCOUNT_ID_REPLY_TO,
39 E_ACCOUNT_ID_ORGANIZATION,
40 E_ACCOUNT_ID_SIGNATURE,
42 E_ACCOUNT_SOURCE_URL, /* what about separating out host/user/path settings?? sigh */
43 E_ACCOUNT_SOURCE_KEEP_ON_SERVER,
44 E_ACCOUNT_SOURCE_AUTO_CHECK,
45 E_ACCOUNT_SOURCE_AUTO_CHECK_TIME,
46 E_ACCOUNT_SOURCE_SAVE_PASSWD,
48 E_ACCOUNT_TRANSPORT_URL,
49 E_ACCOUNT_TRANSPORT_SAVE_PASSWD,
51 E_ACCOUNT_DRAFTS_FOLDER_URI,
52 E_ACCOUNT_SENT_FOLDER_URI,
60 E_ACCOUNT_RECEIPT_POLICY,
63 E_ACCOUNT_PGP_ENCRYPT_TO_SELF,
64 E_ACCOUNT_PGP_ALWAYS_SIGN,
65 E_ACCOUNT_PGP_NO_IMIP_SIGN,
66 E_ACCOUNT_PGP_ALWAYS_TRUST,
68 E_ACCOUNT_SMIME_SIGN_KEY,
69 E_ACCOUNT_SMIME_ENCRYPT_KEY,
70 E_ACCOUNT_SMIME_SIGN_DEFAULT,
71 E_ACCOUNT_SMIME_ENCRYPT_TO_SELF,
72 E_ACCOUNT_SMIME_ENCRYPT_DEFAULT,
74 E_ACCOUNT_PROXY_PARENT_UID,
79 typedef enum _e_account_access_t {
80 E_ACCOUNT_ACCESS_WRITE = 1<<0,
83 typedef struct _EAccountIdentity {
92 typedef enum _EAccountReceiptPolicy {
93 E_ACCOUNT_RECEIPT_NEVER,
94 E_ACCOUNT_RECEIPT_ASK,
95 E_ACCOUNT_RECEIPT_ALWAYS
96 } EAccountReceiptPolicy;
98 typedef struct _EAccountService {
100 gboolean keep_on_server;
103 gboolean save_passwd;
104 gboolean get_password_canceled;
107 typedef struct _EAccount {
108 GObject parent_object;
115 EAccountIdentity *id;
116 EAccountService *source;
117 EAccountService *transport;
119 char *drafts_folder_uri, *sent_folder_uri;
126 EAccountReceiptPolicy receipt_policy;
129 gboolean pgp_encrypt_to_self;
130 gboolean pgp_always_sign;
131 gboolean pgp_no_imip_sign;
132 gboolean pgp_always_trust;
136 char *smime_sign_key;
137 char *smime_encrypt_key;
138 gboolean smime_sign_default;
139 gboolean smime_encrypt_to_self;
140 gboolean smime_encrypt_default;
144 GObjectClass parent_class;
146 void (*changed)(EAccount *, int field);
150 GType e_account_get_type (void);
152 EAccount *e_account_new (void);
154 EAccount *e_account_new_from_xml (const char *xml);
156 gboolean e_account_set_from_xml (EAccount *account,
159 void e_account_import (EAccount *dest,
162 char *e_account_to_xml (EAccount *account);
165 char *e_account_uid_from_xml (const char *xml);
167 const char *e_account_get_string (EAccount *,
168 e_account_item_t type);
170 int e_account_get_int (EAccount *,
171 e_account_item_t type);
173 gboolean e_account_get_bool (EAccount *,
174 e_account_item_t type);
176 void e_account_set_string (EAccount *,
177 e_account_item_t type, const char *);
179 void e_account_set_int (EAccount *,
180 e_account_item_t type, int);
182 void e_account_set_bool (EAccount *,
183 e_account_item_t type, gboolean);
185 gboolean e_account_writable (EAccount *ea,
186 e_account_item_t type);
188 gboolean e_account_writable_option (EAccount *ea,
189 const char *protocol,
194 #endif /* __E_ACCOUNT__ */