Post-release version bump
[platform/upstream/folks.git] / folks / favourite-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  *       Philip Withnall <philip.withnall@collabora.co.uk>
20  */
21
22 using GLib;
23
24 /**
25  * Interface exposing a {@link Persona}'s or {@link Individual}'s user-defined
26  * status as a favourite.
27  */
28 public interface Folks.FavouriteDetails : Object
29 {
30   /**
31    * Whether this contact is a user-defined favourite.
32    */
33   public abstract bool is_favourite { get; set; }
34
35   /**
36    * Change whether the contact is a user-defined favourite.
37    *
38    * It's preferred to call this rather than setting
39    * {@link FavouriteDetails.is_favourite} directly, as this method gives error
40    * notification and will only return once the favouriteness has been written
41    * to the relevant backing store (or the operation's failed).
42    *
43    * @param is_favourite `true` if the contact is a favourite; `false` otherwise
44    * @throws PropertyError if setting the favouriteness failed
45    * @since 0.6.2
46    */
47   public virtual async void change_is_favourite (bool is_favourite)
48       throws PropertyError
49     {
50       /* Default implementation. */
51       throw new PropertyError.NOT_WRITEABLE (
52           _("Favorite status is not writeable on this contact."));
53     }
54 }