1 /* 2 * e-passwords.h 3 * 4 * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) 5 */ 6 7 /* 8 * This program is free software; you can redistribute it and/or modify it 9 * under the terms of the GNU Lesser General Public License as published by 10 * the Free Software Foundation. 11 * 12 * This program is distributed in the hope that it will be useful, but 13 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 14 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 15 * for more details. 16 * 17 * You should have received a copy of the GNU Lesser General Public License 18 * along with this program; if not, see <http://www.gnu.org/licenses/>. 19 */ 20 21 #if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) 22 #error "Only <e-util/e-util.h> should be included directly." 23 #endif 24 25 #ifndef EVO_DISABLE_DEPRECATED 26 27 #ifndef E_PASSWORDS_H 28 #define E_PASSWORDS_H 29 30 #include <gtk/gtk.h> 31 32 G_BEGIN_DECLS 33 34 typedef enum { 35 E_PASSWORDS_REMEMBER_NEVER, 36 E_PASSWORDS_REMEMBER_SESSION, 37 E_PASSWORDS_REMEMBER_FOREVER, 38 E_PASSWORDS_REMEMBER_MASK = 0xf, 39 40 /* option bits */ 41 E_PASSWORDS_SECRET = 1 << 8, 42 E_PASSWORDS_REPROMPT = 1 << 9, 43 E_PASSWORDS_ONLINE = 1<<10, /* only ask if we're online */ 44 E_PASSWORDS_DISABLE_REMEMBER = 1<<11, /* disable the 'remember password' checkbox */ 45 E_PASSWORDS_PASSPHRASE = 1<<12 /* We are asking a passphrase */ 46 } EPasswordsRememberType; 47 48 /* 49 * initialization is now implicit when you call any of the functions 50 * below, although this is only correct if the functions are called 51 * from the main thread. 52 */ 53 void e_passwords_init (void); 54 void e_passwords_set_online (gint state); 55 void e_passwords_remember_password (const gchar *key); 56 void e_passwords_add_password (const gchar *key, 57 const gchar *passwd); 58 gchar * e_passwords_get_password (const gchar *key); 59 void e_passwords_forget_password (const gchar *key); 60 gchar * e_passwords_ask_password (const gchar *title, 61 const gchar *key, 62 const gchar *prompt, 63 EPasswordsRememberType remember_type, 64 gboolean *remember, 65 GtkWindow *parent); 66 67 G_END_DECLS 68 69 #endif /* E_PASSWORDS_H */ 70 71 #endif /* EVO_DISABLE_DEPRECATED */ 72