Post-release version bump
[platform/upstream/folks.git] / folks / birthday-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 GLib;
24
25 /**
26  * This interface contains the birth date of a {@link Persona} and
27  * {@link Individual}
28  *
29  * @since 0.4.0
30  */
31 public interface Folks.BirthdayDetails : Object
32 {
33   /**
34    * The birthday of the {@link Persona} and {@link Individual}. This
35    * is assumed to be in UTC.
36    *
37    * If this is `null`, the contact's birthday isn't known.
38    *
39    * @since 0.4.0
40    */
41   public abstract DateTime? birthday { get; set; }
42
43   /**
44    * Change the contact's birthday.
45    *
46    * It's preferred to call this rather than setting
47    * {@link BirthdayDetails.birthday} directly, as this method gives error
48    * notification and will only return once the birthday has been written to the
49    * relevant backing store (or the operation's failed).
50    *
51    * @param birthday the new birthday (or `null` to unset the birthday)
52    * @throws PropertyError if setting the birthday failed
53    * @since 0.6.2
54    */
55   public virtual async void change_birthday (DateTime? birthday)
56       throws PropertyError
57     {
58       /* Default implementation. */
59       throw new PropertyError.NOT_WRITEABLE (
60           _("Birthday is not writeable on this contact."));
61     }
62
63   /**
64    * The event ID of the birthday event from the source calendar.
65    *
66    * If this is `null`, the birthday event is unknown.
67    *
68    * @since 0.4.0
69    */
70   public abstract string? calendar_event_id { get; set; }
71
72   /**
73    * Change the contact's birthday event ID.
74    *
75    * It's preferred to call this rather than setting
76    * {@link BirthdayDetails.calendar_event_id} directly, as this method gives
77    * error notification and will only return once the event has been written to
78    * the relevant backing store (or the operation's failed).
79    *
80    * @param event_id the new birthday event ID (or `null` to unset the event ID)
81    * @throws PropertyError if setting the birthday event ID failed
82    * @since 0.6.2
83    */
84   public virtual async void change_calendar_event_id (string? event_id)
85       throws PropertyError
86     {
87       /* Default implementation. */
88       throw new PropertyError.NOT_WRITEABLE (
89           _("Birthday event ID is not writeable on this contact."));
90     }
91 }