Evince
Evince is a document viewer capable of displaying multiple and single page document formats like PDF and Postscript.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ev-keyring.h File Reference
#include <glib.h>
#include <gio/gio.h>
+ Include dependency graph for ev-keyring.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

G_BEGIN_DECLS gboolean ev_keyring_is_available (void)
 
gchar * ev_keyring_lookup_password (const gchar *uri)
 
gboolean ev_keyring_save_password (const gchar *uri, const gchar *password, GPasswordSave flags)
 

Function Documentation

G_BEGIN_DECLS gboolean ev_keyring_is_available ( void  )

Definition at line 43 of file ev-keyring.c.

44 {
45 #ifdef WITH_KEYRING
46  return TRUE;
47 #else
48  return FALSE;
49 #endif
50 }

+ Here is the caller graph for this function:

gchar* ev_keyring_lookup_password ( const gchar *  uri)

Definition at line 53 of file ev-keyring.c.

54 {
55 #ifdef WITH_KEYRING
56  g_return_val_if_fail (uri != NULL, NULL);
57 
58  return secret_password_lookup_sync (EV_DOCUMENT_PASSWORD_SCHEMA,
59  NULL, NULL,
60  "type", "document_password",
61  "uri", uri,
62  NULL);
63 #else
64  return NULL;
65 #endif /* WITH_KEYRING */
66 }

+ Here is the caller graph for this function:

gboolean ev_keyring_save_password ( const gchar *  uri,
const gchar *  password,
GPasswordSave  flags 
)

Definition at line 69 of file ev-keyring.c.

72 {
73 #ifdef WITH_KEYRING
74  const gchar *keyring;
75  gchar *name;
76  gchar *unescaped_uri;
77  gboolean retval;
78 
79  g_return_val_if_fail (uri != NULL, FALSE);
80 
81  if (flags == G_PASSWORD_SAVE_NEVER)
82  return FALSE;
83 
84  keyring = (flags == G_PASSWORD_SAVE_FOR_SESSION) ? SECRET_COLLECTION_SESSION : NULL;
85  unescaped_uri = g_uri_unescape_string (uri, NULL);
86  name = g_strdup_printf (_("Password for document %s"), unescaped_uri);
87  g_free (unescaped_uri);
88 
89  retval = secret_password_store_sync (EV_DOCUMENT_PASSWORD_SCHEMA, keyring,
90  name, password, NULL, NULL,
91  "type", "document_password",
92  "uri", uri,
93  NULL);
94  g_free (name);
95 
96  return retval;
97 #else
98  return FALSE;
99 #endif /* WITH_KEYRING */
100 }

+ Here is the caller graph for this function: