src/mn-keyring.h (2035B) - 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_KEYRING_H
21 #define _MN_KEYRING_H
22
23 #include <gnome-keyring.h>
24
25 /*
26 * These functions augment the gnome-keyring sync API by taking a
27 * callback parameter which is invoked when the request is started and
28 * completed. This allows another thread to call
29 * gnome_keyring_cancel_request() while the calling thread performs
30 * the request. The provided callback is executed in the thread that
31 * runs the GLib main loop, with the GDK lock not held.
32 */
33
34 typedef void (*MNKeyringRequestCallback) (gpointer request, gpointer data);
35
36 /* returns NULL if not found */
37 char *mn_keyring_get_password_sync (const char *username,
38 const char *domain,
39 const char *server,
40 const char *protocol,
41 const char *authtype,
42 int port,
43 MNKeyringRequestCallback request_callback,
44 gpointer data);
45
46 GnomeKeyringResult mn_keyring_set_password_sync (const char *keyring,
47 const char *username,
48 const char *domain,
49 const char *server,
50 const char *protocol,
51 const char *authtype,
52 int port,
53 const char *password,
54 guint32 *item_id,
55 MNKeyringRequestCallback request_callback,
56 gpointer data);
57
58 #endif /* _MN_KEYRING_H */