Post-release version bump
[platform/upstream/folks.git] / folks / local-id-details.vala
1 /*
2  * Copyright (C) 2011 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  *       Raul Gutierrez Segales <raul.gutierrez.segales@collabora.co.uk>
20  *       Philip Withnall <philip@tecnocode.co.uk>
21  */
22
23 using Gee;
24 using GLib;
25
26 /**
27  * This interface represents the list of {@link Persona.iid}s
28  * corresponding to {@link Persona}s from backends with write
29  * support so that they can be linked.
30  *
31  * This is necessary so that personas from the same backend
32  * can be linked together even if they have no other linkeable
33  * properties set.
34  *
35  * @since 0.5.0
36  */
37 public interface Folks.LocalIdDetails : Object
38 {
39   /**
40    * The IIDs corresponding to {@link Persona}s in a
41    * backend that we fully trust.
42    *
43    * @since 0.5.1
44    */
45   public abstract Set<string> local_ids { get; set; }
46
47   /**
48    * Change the contact's local IDs.
49    *
50    * It's preferred to call this rather than setting
51    * {@link LocalIdDetails.local_ids} directly, as this method gives error
52    * notification and will only return once the local IDs have been written to
53    * the relevant backing store (or the operation's failed).
54    *
55    * @param local_ids the set of local IDs
56    * @throws PropertyError if setting the local IDs failed
57    * @since 0.6.2
58    */
59   public virtual async void change_local_ids (Set<string> local_ids)
60       throws PropertyError
61     {
62       /* Default implementation. */
63       throw new PropertyError.NOT_WRITEABLE (
64           _("Local IDs are not writeable on this contact."));
65     }
66 }