2 * Copyright (C) 2010 Collabora Ltd.
3 * Copyright (C) 2011 Philip Withnall
5 * This library is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as published by
7 * the Free Software Foundation, either version 2.1 of the License, or
8 * (at your option) any later version.
10 * This library 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 Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this library. If not, see <http://www.gnu.org/licenses/>.
19 * Travis Reitter <travis.reitter@collabora.co.uk>
20 * Philip Withnall <philip@tecnocode.co.uk>
26 * Interface for classes which represent contacts which have an avatar
27 * (pictorial representation), such as {@link Persona} and {@link Individual}.
29 public interface Folks.AvatarDetails : Object
32 * An avatar for the contact.
34 * An avatar is a small image file which represents the contact. It may be
35 * `null` if unset. Otherwise, the image data may be asynchronously loaded
36 * using the methods of the {@link GLib.LoadableIcon} implementation.
40 public abstract LoadableIcon? avatar { get; set; }
43 * Change the contact's avatar.
45 * It's preferred to call this rather than setting
46 * {@link AvatarDetails.avatar} directly, as this method gives error
47 * notification and will only return once the avatar has been written to the
48 * relevant backing store (or the operation's failed).
50 * @param avatar the new avatar (or `null` to unset the avatar)
51 * @throws PropertyError if setting the avatar failed
54 public virtual async void change_avatar (LoadableIcon? avatar)
57 /* Default implementation. */
58 throw new PropertyError.NOT_WRITEABLE (
59 _("Avatar is not writeable on this contact."));