2 * Copyright (C) 2011 Collabora Ltd.
3 * Copyright (C) 2011 Philip Withnall
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.
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.
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/>.
19 * Alban Crequy <alban.crequy@collabora.co.uk>
20 * Philip Withnall <philip@tecnocode.co.uk>
26 * Object representing a web service contact that can have some parameters
29 * See {@link Folks.AbstractFieldDetails}.
33 public class Folks.WebServiceFieldDetails : AbstractFieldDetails<string>
36 * Create a new WebServiceFieldDetails.
38 * @param value the value of the field, a non-empty web service address
39 * @param parameters initial parameters. See
40 * {@link AbstractFieldDetails.parameters}. A `null` value is equivalent to an
41 * empty map of parameters.
43 * @return a new WebServiceFieldDetails
47 public WebServiceFieldDetails (string value,
48 MultiMap<string, string>? parameters = null)
52 warning ("Empty web service address passed to " +
53 "WebServiceFieldDetails.");
57 parameters: parameters);
65 public override bool equal (AbstractFieldDetails<string> that)
67 return base.equal (that);
75 public override uint hash ()
82 * Web service contact details.
86 public interface Folks.WebServiceDetails : Object
89 * A mapping of web service to an (unordered) set of web service addresses.
91 * Each mapping is from an arbitrary web service identifier to a set of web
92 * service addresses for the contact, listed in no particular order.
94 * Web service addresses are guaranteed to be unique per web service, but
95 * not necessarily unique amongst all web services.
100 Gee.MultiMap<string, WebServiceFieldDetails> web_service_addresses
106 * Change the contact's web service addresses.
108 * It's preferred to call this rather than setting
109 * {@link WebServiceDetails.web_service_addresses} directly, as this method
110 * gives error notification and will only return once the addresses have been
111 * written to the relevant backing store (or the operation's failed).
113 * @param web_service_addresses the set of addresses
114 * @throws PropertyError if setting the addresses failed
117 public virtual async void change_web_service_addresses (
118 MultiMap<string, WebServiceFieldDetails> web_service_addresses)
121 /* Default implementation. */
122 throw new PropertyError.NOT_WRITEABLE (
123 _("Web service addresses are not writeable on this contact."));