Post-release version bump
[platform/upstream/folks.git] / folks / avatar-details.vala
1 /*
2  * Copyright (C) 2010 Collabora Ltd.
3  * Copyright (C) 2011 Philip Withnall
4  *
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.
9  *
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.
14  *
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/>.
17  *
18  * Authors:
19  *       Travis Reitter <travis.reitter@collabora.co.uk>
20  *       Philip Withnall <philip@tecnocode.co.uk>
21  */
22
23 using GLib;
24
25 /**
26  * Interface for classes which represent contacts which have an avatar
27  * (pictorial representation), such as {@link Persona} and {@link Individual}.
28  */
29 public interface Folks.AvatarDetails : Object
30 {
31   /**
32    * An avatar for the contact.
33    *
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.
37    *
38    * @since 0.6.0
39    */
40   public abstract LoadableIcon? avatar { get; set; }
41
42   /**
43    * Change the contact's avatar.
44    *
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).
49    *
50    * @param avatar the new avatar (or `null` to unset the avatar)
51    * @throws PropertyError if setting the avatar failed
52    * @since 0.6.2
53    */
54   public virtual async void change_avatar (LoadableIcon? avatar)
55       throws PropertyError
56     {
57       /* Default implementation. */
58       throw new PropertyError.NOT_WRITEABLE (
59           _("Avatar is not writeable on this contact."));
60     }
61 }