Post-release version bump
[platform/upstream/folks.git] / folks / alias-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 aliasable contacts, such as
27  * {@link Persona} and {@link Individual}.
28  */
29 public interface Folks.AliasDetails : Object
30 {
31   /**
32    * An alias for the contact.
33    *
34    * An alias is a user-given name, to be used in UIs as the sole way to
35    * represent the contact to the user.
36    *
37    * This may not be `null`: an empty string represents an unset alias.
38    */
39   public abstract string alias { get; set; }
40
41   /**
42    * Change the contact's alias.
43    *
44    * It's preferred to call this rather than setting {@link AliasDetails.alias}
45    * directly, as this method gives error notification and will only return
46    * once the alias has been written to the relevant backing store (or the
47    * operation's failed).
48    *
49    * @param alias the new alias
50    * @throws PropertyError if setting the alias failed
51    * @since 0.6.2
52    */
53   public virtual async void change_alias (string alias) throws PropertyError
54     {
55       /* Default implementation. */
56       throw new PropertyError.NOT_WRITEABLE (
57           _("Alias is not writeable on this contact."));
58     }
59 }