OssoABookAvatar

OssoABookAvatar — Avatar representation.

Synopsis

                    OssoABookAvatar;
                    OssoABookAvatarIface;
GdkPixbuf*          osso_abook_avatar_get_image         (OssoABookAvatar *avatar);
GdkPixbuf*          osso_abook_avatar_get_image_scaled  (OssoABookAvatar *avatar,
                                                         gint width,
                                                         gint height,
                                                         gboolean crop);
gboolean            osso_abook_avatar_is_done_loading   (OssoABookAvatar *avatar);

Description

OssoABookAvatar is an interface that represents the user's avatar.

Details

OssoABookAvatar

typedef struct _OssoABookAvatar OssoABookAvatar;

Dummy type for the OssoABookAvatar interface.


OssoABookAvatarIface

typedef struct {
        GdkPixbuf * (* get_image_scaled) (OssoABookAvatar *avatar,
                                          int              width,
                                          int              height,
                                          gboolean         crop);

        void        (* load_error)       (OssoABookAvatar *avatar,
                                          const GError    *error);
} OssoABookAvatarIface;

Virtual methods of the OssoABookAvatar interface.

get_image_scaled () virtual method for osso_abook_avatar_get_image_scaled()
load_error () virtual method for OssoABookAvatar::load-error

osso_abook_avatar_get_image ()

GdkPixbuf*          osso_abook_avatar_get_image         (OssoABookAvatar *avatar);

Retrieves the avatar image from avatar. The avatar is automatically scaled to a 64x64 pixels image so it is suited for display in a OssoABookTreeView. If you need a different size, use osso_abook_avatar_get_image_scaled().

avatar : a OssoABookAvatar
Returns : the avatar image. The returned GdkPixbuf is owned by the avatar object and should not be modified or freed.

osso_abook_avatar_get_image_scaled ()

GdkPixbuf*          osso_abook_avatar_get_image_scaled  (OssoABookAvatar *avatar,
                                                         gint width,
                                                         gint height,
                                                         gboolean crop);

Retrieves the avatar image from avatar. If width and height are -1, the full image is returned; otherwise, the image will be scaled to the desired size. if crop is TRUE, the image will be cropped to fit into the desired size, otherwise it will be downscaled to fit.

avatar : a OssoABookAvatar
width : desired width of the avatar image, or -1
height : desired height of the avatar image, or -1
crop : whether the image should be cropped or downscaled
Returns : the avatar image. You should use g_object_unref() after you're done using it.

osso_abook_avatar_is_done_loading ()

gboolean            osso_abook_avatar_is_done_loading   (OssoABookAvatar *avatar);

Returns whether the OssoABookAvatar object has finished loading the image for the avatar.

avatar : a OssoABookAvatar
Returns : TRUE if the avatar has successfully loaded the image.