src/mn-conf.h (6981B) - raw
1 /* 2 * Mail Notification 3 * Copyright (C) 2003-2008 Jean-Yves Lefort <jylefort@brutele.be> 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 3 of the License, or 8 * (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License along 16 * with this program; if not, write to the Free Software Foundation, Inc., 17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 */ 19 20 #ifndef _MN_CONF_H 21 #define _MN_CONF_H 22 23 #include <stdarg.h> 24 #include <gtk/gtk.h> 25 #include <gconf/gconf-client.h> 26 27 #define MN_CONF_NAMESPACE \ 28 "/apps/mail-notification" 29 #define MN_CONF_COMMANDS_NAMESPACE \ 30 MN_CONF_NAMESPACE "/commands" 31 #define MN_CONF_COMMANDS_NEW_MAIL_NAMESPACE \ 32 MN_CONF_COMMANDS_NAMESPACE "/new-mail" 33 #define MN_CONF_COMMANDS_NEW_MAIL_ENABLED \ 34 MN_CONF_COMMANDS_NEW_MAIL_NAMESPACE "/enabled" 35 #define MN_CONF_COMMANDS_NEW_MAIL_COMMAND \ 36 MN_CONF_COMMANDS_NEW_MAIL_NAMESPACE "/command" 37 #define MN_CONF_COMMANDS_MAIL_READ_NAMESPACE \ 38 MN_CONF_COMMANDS_NAMESPACE "/mail-read" 39 #define MN_CONF_COMMANDS_MAIL_READ_ENABLED \ 40 MN_CONF_COMMANDS_MAIL_READ_NAMESPACE "/enabled" 41 #define MN_CONF_COMMANDS_MAIL_READ_COMMAND \ 42 MN_CONF_COMMANDS_MAIL_READ_NAMESPACE "/command" 43 #define MN_CONF_COMMANDS_MAIL_CHANGED_NAMESPACE \ 44 MN_CONF_COMMANDS_NAMESPACE "/mail-changed" 45 #define MN_CONF_COMMANDS_MAIL_CHANGED_ENABLED \ 46 MN_CONF_COMMANDS_MAIL_CHANGED_NAMESPACE "/enabled" 47 #define MN_CONF_COMMANDS_MAIL_CHANGED_COMMAND \ 48 MN_CONF_COMMANDS_MAIL_CHANGED_NAMESPACE "/command" 49 #define MN_CONF_SOUNDS_NAMESPACE \ 50 MN_CONF_NAMESPACE "/sounds" 51 #define MN_CONF_SOUNDS_NEW_MAIL_NAMESPACE \ 52 MN_CONF_SOUNDS_NAMESPACE "/new-mail" 53 #define MN_CONF_SOUNDS_NEW_MAIL_ENABLED \ 54 MN_CONF_SOUNDS_NEW_MAIL_NAMESPACE "/enabled" 55 #define MN_CONF_SOUNDS_NEW_MAIL_FILE \ 56 MN_CONF_SOUNDS_NEW_MAIL_NAMESPACE "/file" 57 #define MN_CONF_SOUNDS_PLAY_COMMAND \ 58 MN_CONF_SOUNDS_NAMESPACE "/play-command" 59 #define MN_CONF_UI_NAMESPACE \ 60 MN_CONF_NAMESPACE "/ui" 61 #define MN_CONF_PROPERTIES_DIALOG \ 62 MN_CONF_UI_NAMESPACE "/properties-dialog" 63 #define MN_CONF_BLINK_ON_ERRORS \ 64 MN_CONF_NAMESPACE "/blink-on-errors" 65 #define MN_CONF_TRUSTED_X509_CERTIFICATES \ 66 MN_CONF_NAMESPACE "/trusted-x509-certificates" 67 #define MN_CONF_TRUSTED_SERVERS \ 68 MN_CONF_NAMESPACE "/trusted-servers" 69 #define MN_CONF_DISPLAY_SEEN_MAIL \ 70 MN_CONF_NAMESPACE "/display-seen-mail" 71 #define MN_CONF_TOOLTIP_MAIL_SUMMARY \ 72 MN_CONF_NAMESPACE "/tooltip-mail-summary" 73 #define MN_CONF_TOOLTIP_MAIL_SUMMARY_LIMIT \ 74 MN_CONF_NAMESPACE "/tooltip-mail-summary-limit" 75 #define MN_CONF_ALWAYS_DISPLAY_ICON \ 76 MN_CONF_NAMESPACE "/always-display-icon" 77 #define MN_CONF_DISPLAY_MESSAGE_COUNT \ 78 MN_CONF_NAMESPACE "/display-message-count" 79 #define MN_CONF_CLICK_ACTION \ 80 MN_CONF_NAMESPACE "/click-action-3" 81 #define MN_CONF_POPUPS_NAMESPACE \ 82 MN_CONF_NAMESPACE "/popups" 83 #define MN_CONF_POPUPS_ENABLED \ 84 MN_CONF_POPUPS_NAMESPACE "/enabled" 85 #define MN_CONF_POPUPS_POSITION \ 86 MN_CONF_POPUPS_NAMESPACE "/position" 87 #define MN_CONF_POPUPS_EXPIRATION_NAMESPACE \ 88 MN_CONF_POPUPS_NAMESPACE "/expiration" 89 #define MN_CONF_POPUPS_EXPIRATION_ENABLED \ 90 MN_CONF_POPUPS_EXPIRATION_NAMESPACE "/enabled" 91 #define MN_CONF_POPUPS_EXPIRATION_DELAY \ 92 MN_CONF_POPUPS_EXPIRATION_NAMESPACE "/delay-2" 93 #define MN_CONF_POPUPS_ACTIONS \ 94 MN_CONF_POPUPS_NAMESPACE "/actions" 95 #define MN_CONF_POPUPS_LIMIT \ 96 MN_CONF_POPUPS_NAMESPACE "/limit" 97 #define MN_CONF_FALLBACK_CHARSETS \ 98 MN_CONF_NAMESPACE "/fallback-charsets" 99 #define MN_CONF_MESSAGES_CONSIDERED_AS_READ \ 100 MN_CONF_NAMESPACE "/messages-considered-as-read" 101 102 /* obsolete keys */ 103 #define MN_CONF_OBSOLETE_MAILBOXES \ 104 MN_CONF_NAMESPACE "/mailboxes" 105 106 /* foreign keys */ 107 #define MN_CONF_GNOME_MAIL_READER_NAMESPACE \ 108 "/desktop/gnome/url-handlers/mailto" 109 #define MN_CONF_GNOME_MAIL_READER_COMMAND \ 110 MN_CONF_GNOME_MAIL_READER_NAMESPACE "/command" 111 #define MN_CONF_GNOME_MAIL_READER_NEEDS_TERMINAL \ 112 MN_CONF_GNOME_MAIL_READER_NAMESPACE "/needs_terminal" 113 #define MN_CONF_SYSTEM_HTTP_PROXY_NAMESPACE \ 114 "/system/http_proxy" 115 #define MN_CONF_SYSTEM_HTTP_PROXY_USE_HTTP_PROXY \ 116 MN_CONF_SYSTEM_HTTP_PROXY_NAMESPACE "/use_http_proxy" 117 #define MN_CONF_SYSTEM_HTTP_PROXY_HOST \ 118 MN_CONF_SYSTEM_HTTP_PROXY_NAMESPACE "/host" 119 #define MN_CONF_SYSTEM_HTTP_PROXY_PORT \ 120 MN_CONF_SYSTEM_HTTP_PROXY_NAMESPACE "/port" 121 #define MN_CONF_SYSTEM_HTTP_PROXY_USE_AUTHENTICATION \ 122 MN_CONF_SYSTEM_HTTP_PROXY_NAMESPACE "/use_authentication" 123 #define MN_CONF_SYSTEM_HTTP_PROXY_AUTHENTICATION_USER \ 124 MN_CONF_SYSTEM_HTTP_PROXY_NAMESPACE "/authentication_user" 125 #define MN_CONF_SYSTEM_HTTP_PROXY_AUTHENTICATION_PASSWORD \ 126 MN_CONF_SYSTEM_HTTP_PROXY_NAMESPACE "/authentication_password" 127 128 extern const char *mn_conf_dot_dir; 129 130 void mn_conf_init (void); 131 void mn_conf_unset_obsolete (void); 132 133 GConfClient *mn_conf_get_client (void); 134 135 GConfValue *mn_conf_get_value (const char *key); 136 void mn_conf_set_value (const char *key, 137 const GConfValue *value); 138 139 gboolean mn_conf_get_bool (const char *key); 140 void mn_conf_set_bool (const char *key, 141 gboolean value); 142 143 int mn_conf_get_int (const char *key); 144 void mn_conf_set_int (const char *key, 145 int value); 146 147 char *mn_conf_get_string (const char *key); 148 void mn_conf_set_string (const char *key, 149 const char *value); 150 151 GSList *mn_conf_get_string_list (const char *key); 152 void mn_conf_set_string_list (const char *key, 153 GSList *list); 154 155 GHashTable *mn_conf_get_string_hash_set (const char *key); 156 void mn_conf_set_string_hash_set (const char *key, 157 GHashTable *set); 158 159 void mn_conf_suggest_sync (void); 160 161 void mn_conf_recursive_unset (const char *key, 162 GConfUnsetFlags flags); 163 164 gboolean mn_conf_is_set (const char *key); 165 166 void mn_conf_monitor_add (const char *directory); 167 168 unsigned int mn_conf_notification_add (const char *key, 169 GConfClientNotifyFunc callback, 170 gpointer user_data, 171 GFreeFunc destroy_notify); 172 void mn_conf_notification_remove (unsigned int notification_id); 173 174 void mn_conf_link_object (gpointer object, 175 const char *key, 176 const char *property_name); 177 void mn_conf_link_window (GtkWindow *window, 178 const char *key); 179 void mn_conf_link_non_linear_range (GtkRange *range, 180 const char *key); 181 void mn_conf_link_radio_group_to_enum (GType enum_type, 182 const char *key, 183 ...) G_GNUC_NULL_TERMINATED; 184 185 int mn_conf_get_enum_value (GType enum_type, 186 const char *key); 187 188 gboolean mn_conf_has_command (const char *namespace); 189 void mn_conf_execute_command (const char *conf_key); 190 void mn_conf_execute_mail_reader (void); 191 192 #endif /* _MN_CONF_H */