1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 * Authors: Jeffrey Stedfast <fejj@ximian.com>
5 * Copyright 2001 Ximian, Inc. (www.ximian.com)
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of version 2 of the GNU General Public
9 * License as published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public
17 * License along with this program; if not, write to the
18 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, USA.
27 #include <glib-object.h>
29 #include "camel/camel-provider.h" /* can't forward-declare enums, bah */
33 struct _EAccountService
;
36 struct _ESignatureList
;
46 #endif /* __cplusplus */
48 typedef struct _MailConfigSignature
{
54 } MailConfigSignature
;
58 MAIL_CONFIG_HTTP_NEVER
,
59 MAIL_CONFIG_HTTP_SOMETIMES
,
60 MAIL_CONFIG_HTTP_ALWAYS
64 MAIL_CONFIG_FORWARD_ATTACHED
,
65 MAIL_CONFIG_FORWARD_INLINE
,
66 MAIL_CONFIG_FORWARD_QUOTED
67 } MailConfigForwardStyle
;
70 MAIL_CONFIG_REPLY_QUOTED
,
71 MAIL_CONFIG_REPLY_DO_NOT_QUOTE
,
72 MAIL_CONFIG_REPLY_ATTACH
73 } MailConfigReplyStyle
;
76 MAIL_CONFIG_DISPLAY_NORMAL
,
77 MAIL_CONFIG_DISPLAY_FULL_HEADERS
,
78 MAIL_CONFIG_DISPLAY_SOURCE
,
79 MAIL_CONFIG_DISPLAY_MAX
80 } MailConfigDisplayStyle
;
83 MAIL_CONFIG_NOTIFY_NOT
,
84 MAIL_CONFIG_NOTIFY_BEEP
,
85 MAIL_CONFIG_NOTIFY_PLAY_SOUND
,
86 } MailConfigNewMailNotify
;
89 MAIL_CONFIG_XMAILER_NONE
= 0,
90 MAIL_CONFIG_XMAILER_EVO
= 1,
91 MAIL_CONFIG_XMAILER_OTHER
= 2,
92 MAIL_CONFIG_XMAILER_RUPERT_APPROVED
= 4
93 } MailConfigXMailerDisplayStyle
;
101 #define LABEL_DEFAULTS_NUM 5
102 extern MailConfigLabel label_defaults
[5];
105 void mail_config_init (void);
106 void mail_config_clear (void);
107 void mail_config_write (void);
108 void mail_config_write_on_exit (void);
110 struct _GConfClient
*mail_config_get_gconf_client (void);
112 /* General Accessor functions */
113 gboolean
mail_config_is_configured (void);
114 gboolean
mail_config_is_corrupt (void);
116 GSList
*mail_config_get_labels (void);
117 const char *mail_config_get_label_color_by_name (const char *name
);
118 const char *mail_config_get_label_color_by_index (int index
);
120 const char **mail_config_get_allowable_mime_types (void);
122 void mail_config_service_set_save_passwd (struct _EAccountService
*service
, gboolean save_passwd
);
125 gboolean
mail_config_find_account (struct _EAccount
*account
);
126 struct _EAccount
*mail_config_get_default_account (void);
127 struct _EAccount
*mail_config_get_account_by_name (const char *account_name
);
128 struct _EAccount
*mail_config_get_account_by_uid (const char *uid
);
129 struct _EAccount
*mail_config_get_account_by_source_url (const char *url
);
130 struct _EAccount
*mail_config_get_account_by_transport_url (const char *url
);
132 struct _EAccountList
*mail_config_get_accounts (void);
133 void mail_config_add_account (struct _EAccount
*account
);
134 void mail_config_remove_account (struct _EAccount
*account
);
135 void mail_config_set_default_account (struct _EAccount
*account
);
136 int mail_config_get_address_count (void);
137 int mail_config_get_message_limit (void);
139 void mail_config_remove_account_proxies (struct _EAccount
*account
);
140 void mail_config_prune_proxies (void);
141 int mail_config_has_proxies (struct _EAccount
*account
);
143 struct _EAccountIdentity
*mail_config_get_default_identity (void);
144 struct _EAccountService
*mail_config_get_default_transport (void);
146 void mail_config_save_accounts (void);
149 struct _ESignature
*mail_config_signature_new (const char *filename
, gboolean script
, gboolean html
);
150 struct _ESignature
*mail_config_get_signature_by_uid (const char *uid
);
151 struct _ESignature
*mail_config_get_signature_by_name (const char *name
);
153 struct _ESignatureList
*mail_config_get_signatures (void);
154 void mail_config_add_signature (struct _ESignature
*signature
);
155 void mail_config_remove_signature (struct _ESignature
*signature
);
157 void mail_config_save_signatures (void);
159 char *mail_config_signature_run_script (const char *script
);
162 /* uri's got changed by the store, etc */
163 void mail_config_uri_renamed (GCompareFunc uri_cmp
, const char *old
, const char *new);
164 void mail_config_uri_deleted (GCompareFunc uri_cmp
, const char *uri
);
166 /* static utility functions */
167 char *mail_config_folder_to_cachename (struct _CamelFolder
*folder
, const char *prefix
);
168 char *mail_config_folder_to_safe_url (struct _CamelFolder
*folder
);
170 GType
evolution_mail_config_get_type (void);
172 gboolean
evolution_mail_config_factory_init (void);
176 #endif /* __cplusplus */
178 #endif /* MAIL_CONFIG_H */