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