svc: parameterize sipe_svc_ab_entry_request()
[siplcs.git] / src / core / sipe-svc.h
blob83421e68291cc4adcab8829d085a83c99c441efc
1 /**
2 * @file sipe-svc.h
4 * pidgin-sipe
6 * Copyright (C) 2011 SIPE Project <http://sipe.sourceforge.net/>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 * Interface dependencies:
27 * <glib.h>
30 /* Forward declarations */
31 struct sipe_core_private;
32 struct sipe_tls_random;
33 struct _sipe_xml;
35 /**
36 * Service XML callback
38 * @param sipe_private SIPE core private data
39 * @param uri service URI (NULL when request aborted)
40 * @param raw raw XML data (NULL when request failed)
41 * @param xml parsed XML data (NULL when request failed)
42 * @param callback_data callback data
44 typedef void (sipe_svc_callback)(struct sipe_core_private *sipe_private,
45 const gchar *uri,
46 const gchar *raw,
47 struct _sipe_xml *xml,
48 gpointer callback_data);
50 /**
51 * Trigger fetch of Get & Publish certificate
53 * @param sipe_private SIPE core private data
54 * @param uri service URI
55 * @param wsse_security predefined authentication token
56 * @param certreq certificate request (Base64 encoded)
57 * @param callback callback function
58 * @param callback_data callback data
59 * @return @c TRUE if certificate fetch was triggered
61 gboolean sipe_svc_get_and_publish_cert(struct sipe_core_private *sipe_private,
62 const gchar *uri,
63 const gchar *wsse_security,
64 const gchar *certreq,
65 sipe_svc_callback *callback,
66 gpointer callback_data);
68 /**
69 * Trigger [MS-DLX] address book entry search
71 * @param sipe_private SIPE core private data
72 * @param uri service URI
73 * @param wsse_security predefined authentication token
74 * @param search [MS-DLX] AbEntryRequest.ChangeSearchQuery in XML
75 * @param entries array entries in search XML string
76 * @param max_returns how many entries to return
77 * @param callback callback function
78 * @param callback_data callback data
79 * @return @c TRUE if search was triggered
81 gboolean sipe_svc_ab_entry_request(struct sipe_core_private *sipe_private,
82 const gchar *uri,
83 const gchar *wsse_security,
84 const gchar *search,
85 guint entries,
86 guint max_returns,
87 sipe_svc_callback *callback,
88 gpointer callback_data);
90 /**
91 * Trigger fetch of WebTicket security token
93 * @param sipe_private SIPE core private data
94 * @param uri service URI
95 * @param wsse_security predefined authentication token. May be @c NULL
96 * @param service_uri request token for this service URI
97 * @param entropy random bytes buffer for entropy
98 * @param callback callback function
99 * @param callback_data callback data
100 * @return @c TRUE if token fetch was triggered
102 gboolean sipe_svc_webticket(struct sipe_core_private *sipe_private,
103 const gchar *uri,
104 const gchar *wsse_security,
105 const gchar *service_uri,
106 const struct sipe_tls_random *entropy,
107 sipe_svc_callback *callback,
108 gpointer callback_data);
111 * Trigger fetch of WebTicket security token from login.microsoftonline.com
113 * @param sipe_private SIPE core private data
114 * @param service_uri request token for this service URI
115 * @param callback callback function
116 * @param callback_data callback data
117 * @return @c TRUE if token fetch was triggered
119 gboolean sipe_svc_webticket_lmc(struct sipe_core_private *sipe_private,
120 const gchar *service_uri,
121 sipe_svc_callback *callback,
122 gpointer callback_data);
125 * Trigger fetch of service metadata
127 * @param sipe_private SIPE core private data
128 * @param uri service URI
129 * @param callback callback function
130 * @param callback_data callback data
131 * @return @c TRUE if metadata fetch was triggered
133 gboolean sipe_svc_metadata(struct sipe_core_private *sipe_private,
134 const gchar *uri,
135 sipe_svc_callback *callback,
136 gpointer callback_data);
139 * Free service data
141 * @param sipe_private SIPE core private data
143 void sipe_svc_free(struct sipe_core_private *sipe_private);