FolksAvatarCache

FolksAvatarCache — A singleton persistent cache object for avatars used across backends in folks. Avatars may be added to the cache, and referred to by a persistent URI from that point onwards.

Synopsis

#define             FOLKS_TYPE_AVATAR_CACHE
void                folks_avatar_cache_load_avatar      (FolksAvatarCache *self,
                                                         const gchar *id,
                                                         GAsyncReadyCallback _callback_,
                                                         gpointer _user_data_);
GLoadableIcon *     folks_avatar_cache_load_avatar_finish
                                                        (FolksAvatarCache *self,
                                                         GAsyncResult *_res_,
                                                         GError **error);
void                folks_avatar_cache_store_avatar     (FolksAvatarCache *self,
                                                         const gchar *id,
                                                         GLoadableIcon *avatar,
                                                         GAsyncReadyCallback _callback_,
                                                         gpointer _user_data_);
gchar *             folks_avatar_cache_store_avatar_finish
                                                        (FolksAvatarCache *self,
                                                         GAsyncResult *_res_,
                                                         GError **error);
void                folks_avatar_cache_remove_avatar    (FolksAvatarCache *self,
                                                         const gchar *id,
                                                         GAsyncReadyCallback _callback_,
                                                         gpointer _user_data_);
void                folks_avatar_cache_remove_avatar_finish
                                                        (FolksAvatarCache *self,
                                                         GAsyncResult *_res_,
                                                         GError **error);
gchar *             folks_avatar_cache_build_uri_for_avatar
                                                        (FolksAvatarCache *self,
                                                         const gchar *id);
FolksAvatarCache *  folks_avatar_cache_dup              (void);
struct              FolksAvatarCache;

Object Hierarchy

  GObject
   +----FolksAvatarCache

Description

Details

FOLKS_TYPE_AVATAR_CACHE

#define FOLKS_TYPE_AVATAR_CACHE (folks_avatar_cache_get_type ())

The type for FolksAvatarCache.


folks_avatar_cache_load_avatar ()

void                folks_avatar_cache_load_avatar      (FolksAvatarCache *self,
                                                         const gchar *id,
                                                         GAsyncReadyCallback _callback_,
                                                         gpointer _user_data_);

Fetch an avatar from the cache by its globally unique ID.

See also: folks_avatar_cache_load_avatar_finish()

self :

the FolksAvatarCache instance

id :

the globally unique ID for the avatar. [in]

_callback_ :

callback to call when the request is satisfied. [scope async]

_user_data_ :

the data to pass to _callback_ function. [closure]

Since 0.6.0


folks_avatar_cache_load_avatar_finish ()

GLoadableIcon *     folks_avatar_cache_load_avatar_finish
                                                        (FolksAvatarCache *self,
                                                         GAsyncResult *_res_,
                                                         GError **error);

Fetch an avatar from the cache by its globally unique ID.

See also: folks_avatar_cache_load_avatar()

self :

the FolksAvatarCache instance

_res_ :

a GAsyncResult

error :

location to store the error occuring, or NULL to ignore

Returns :

Avatar from the cache, or `null` if it doesn't exist in the cache

Since 0.6.0


folks_avatar_cache_store_avatar ()

void                folks_avatar_cache_store_avatar     (FolksAvatarCache *self,
                                                         const gchar *id,
                                                         GLoadableIcon *avatar,
                                                         GAsyncReadyCallback _callback_,
                                                         gpointer _user_data_);

Store an avatar in the cache, assigning the given globally unique ID to it, which can later be used to load and remove the avatar from the cache. For example, this ID could be the UID of a persona. The URI of the cached avatar file will be returned.

See also: folks_avatar_cache_store_avatar_finish()

self :

the FolksAvatarCache instance

id :

the globally unique ID for the avatar. [in]

avatar :

the avatar data to cache. [in]

_callback_ :

callback to call when the request is satisfied. [scope async]

_user_data_ :

the data to pass to _callback_ function. [closure]

Since 0.6.0


folks_avatar_cache_store_avatar_finish ()

gchar *             folks_avatar_cache_store_avatar_finish
                                                        (FolksAvatarCache *self,
                                                         GAsyncResult *_res_,
                                                         GError **error);

Store an avatar in the cache, assigning the given globally unique ID to it, which can later be used to load and remove the avatar from the cache. For example, this ID could be the UID of a persona. The URI of the cached avatar file will be returned.

See also: folks_avatar_cache_store_avatar()

self :

the FolksAvatarCache instance

_res_ :

a GAsyncResult

error :

location to store the error occuring, or NULL to ignore

Returns :

a URI for the file storing the cached avatar

Since 0.6.0


folks_avatar_cache_remove_avatar ()

void                folks_avatar_cache_remove_avatar    (FolksAvatarCache *self,
                                                         const gchar *id,
                                                         GAsyncReadyCallback _callback_,
                                                         gpointer _user_data_);

Remove an avatar from the cache, if it exists in the cache. If the avatar exists in the cache but there is a problem in removing it, a GError will be thrown.

See also: folks_avatar_cache_remove_avatar_finish()

self :

the FolksAvatarCache instance

id :

the globally unique ID for the avatar. [in]

_callback_ :

callback to call when the request is satisfied. [scope async]

_user_data_ :

the data to pass to _callback_ function. [closure]

Since 0.6.0


folks_avatar_cache_remove_avatar_finish ()

void                folks_avatar_cache_remove_avatar_finish
                                                        (FolksAvatarCache *self,
                                                         GAsyncResult *_res_,
                                                         GError **error);

Remove an avatar from the cache, if it exists in the cache. If the avatar exists in the cache but there is a problem in removing it, a GError will be thrown.

See also: folks_avatar_cache_remove_avatar()

self :

the FolksAvatarCache instance

_res_ :

a GAsyncResult

error :

location to store the error occuring, or NULL to ignore

Since 0.6.0


folks_avatar_cache_build_uri_for_avatar ()

gchar *             folks_avatar_cache_build_uri_for_avatar
                                                        (FolksAvatarCache *self,
                                                         const gchar *id);

Build the URI of an avatar file in the cache from a globally unique ID. This will always succeed, even if the avatar doesn't exist in the cache.

self :

the FolksAvatarCache instance

id :

the globally unique ID for the avatar. [in]

Returns :

URI of the avatar file with the given globally unique ID

Since 0.6.0


folks_avatar_cache_dup ()

FolksAvatarCache *  folks_avatar_cache_dup              (void);

Create or return the singleton folks_avatar_cache_new() class instance. If the instance doesn't exist already, it will be created.

This function is thread-safe.

Returns :

Singleton folks_avatar_cache_new() instance

Since 0.6.0


struct FolksAvatarCache

struct FolksAvatarCache;

A singleton persistent cache object for avatars used across backends in folks. Avatars may be added to the cache, and referred to by a persistent URI from that point onwards.

Since 0.6.0