| Evolution Utilities Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | Prerequisites | ||||
#include <e-util/e-util.h>
EPhotoSource;
struct EPhotoSourceInterface;
void e_photo_source_get_photo (EPhotoSource *photo_source,
const gchar *email_address,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean e_photo_source_get_photo_finish (EPhotoSource *photo_source,
GAsyncResult *result,
GInputStream **out_stream,
gint *out_priority,
GError **error);
EPhotoSource is an interface used to extend the functionality of
EPhotoCache. You can add an object implementing EPhotoSource to an
EPhotoCache with e_photo_cache_add_photo_source() and remove it with
e_photo_cache_remove_photo_source(). When EPhotoCache needs a photo
for an email address it will invoke e_photo_source_get_photo() on all
available EPhotoSource objects simultaneously and select one photo.
struct EPhotoSourceInterface {
GTypeInterface parent_interface;
void (*get_photo) (EPhotoSource *photo_source,
const gchar *email_address,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean (*get_photo_finish) (EPhotoSource *photo_source,
GAsyncResult *result,
GInputStream **out_stream,
gint *out_priority,
GError **error);
};
void e_photo_source_get_photo (EPhotoSource *photo_source,const gchar *email_address,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data);
Asynchronously searches for a photo for email_address.
When the operation is finished, callback will be called. You can then
call e_photo_source_get_photo_finish() to get the result of the operation.
|
an EPhotoSource |
|
an email address |
|
optional GCancellable object, or NULL
|
|
a GAsyncReadyCallback to call when the request is satisfied |
|
data to pass to the callback function |
gboolean e_photo_source_get_photo_finish (EPhotoSource *photo_source,GAsyncResult *result,GInputStream **out_stream,gint *out_priority,GError **error);
Finishes the operation started with e_photo_source_get_photo().
If a match was found, a GInputStream from which to read image data is
returned through the out_stream return location, and a suggested priority
value for the match is returned through the out_priority return location.
You can use the out_priority value to rank this result among other
EPhotoSource results. The value is usually G_PRIORITY_DEFAULT, but
may be G_PRIORITY_LOW if the result is a fallback image.
If no match was found, the out_stream return location is set to NULL
(the out_priority return location will remain unset).
The return value indicates whether the search completed successfully,
not whether a match was found. If an error occurred, the function will
set error and return FALSE.
|
an EPhotoSource |
|
a GAsyncResult |
|
return location for a GInputStream |
|
return location for a priority value, or NULL
|
|
return location for a GError, or NULL
|
Returns : |
whether the search completed successfully |