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 *       Marco Barisione <marco.barisione@collabora.co.uk>
20 *       Travis Reitter <travis.reitter@collabora.co.uk>
21 *       Philip Withnall <philip@tecnocode.co.uk>
22 */
23
24using GLib;
25
26/**
27 * The gender of a contact
28 *
29 * @since 0.3.5
30 */
31public enum Folks.Gender
32{
33  /**
34   * The gender of the contact is unknown or the contact didn't specify it.
35   */
36  UNSPECIFIED,
37  /**
38   * The contact is male.
39   */
40  MALE,
41  /**
42   * The contact is female.
43   */
44  FEMALE
45}
46
47/**
48 * Gender of a contact.
49 *
50 * This allows representation of the gender of a contact.
51 *
52 * @since 0.3.5
53 */
54public interface Folks.GenderDetails : Object
55{
56  /**
57   * The gender of the contact.
58   *
59   * @since 0.3.5
60   */
61  public abstract Gender gender { get; set; }
62
63  /**
64   * Change the contact's gender.
65   *
66   * It's preferred to call this rather than setting
67   * {@link GenderDetails.gender} directly, as this method gives error
68   * notification and will only return once the gender has been written to the
69   * relevant backing store (or the operation's failed).
70   *
71   * @param gender the contact's gender
72   * @throws PropertyError if setting the gender failed
73   * @since 0.6.2
74   */
75  public virtual async void change_gender (Gender gender) throws PropertyError
76    {
77      /* Default implementation. */
78      throw new PropertyError.NOT_WRITEABLE (
79          _("Gender is not writeable on this contact."));
80    }
81}
82