~ubuntu-branches/ubuntu/utopic/evolution-data-server/utopic-proposed

« back to all changes in this revision

Viewing changes to docs/reference/eds/html/eds-EOAuth2Support.html

  • Committer: Package Import Robot
  • Author(s): Iain Lane
  • Date: 2014-06-13 12:02:14 UTC
  • mfrom: (1.1.116) (1.2.35 sid)
  • Revision ID: package-import@ubuntu.com-20140613120214-1zx93d8jxwt093aw
Tags: 3.12.2-1ubuntu1
* Merge with Debian, remaining changes:
  - debian/control: build depend on hardening-wrapper
  - Add build-depends and pass configure flag to enable Ubuntu Online
    Accounts support.
  - Filter out -Bsymbolic-functions from LDFLAGS (for future people
    wondering about this change, see e.g. BGO #594473 and duplicates).
  - Enable Ubuntu Online Accounts and split it and GOA into a separate
    package

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 
2
<html>
 
3
<head>
 
4
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 
5
<title>EOAuth2Support</title>
 
6
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
 
7
<link rel="home" href="index.html" title="Evolution-Data-Server Reference Manual">
 
8
<link rel="up" href="ch07.html" title="Registry Service Classes">
 
9
<link rel="prev" href="eds-ECollectionBackendFactory.html" title="ECollectionBackendFactory">
 
10
<link rel="next" href="eds-EServerSideSource.html" title="EServerSideSource">
 
11
<meta name="generator" content="GTK-Doc V1.19 (XML mode)">
 
12
<link rel="stylesheet" href="style.css" type="text/css">
 
13
</head>
 
14
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
 
15
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
 
16
<tr valign="middle">
 
17
<td><a accesskey="p" href="eds-ECollectionBackendFactory.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
 
18
<td><a accesskey="u" href="ch07.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
 
19
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
 
20
<th width="100%" align="center">Evolution-Data-Server Reference Manual</th>
 
21
<td><a accesskey="n" href="eds-EServerSideSource.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
 
22
</tr>
 
23
<tr><td colspan="5" class="shortcuts">
 
24
<a href="#eds-EOAuth2Support.synopsis" class="shortcut">Top</a>
 
25
                   | 
 
26
                  <a href="#eds-EOAuth2Support.description" class="shortcut">Description</a>
 
27
</td></tr>
 
28
</table>
 
29
<div class="refentry">
 
30
<a name="eds-EOAuth2Support"></a><div class="titlepage"></div>
 
31
<div class="refnamediv"><table width="100%"><tr>
 
32
<td valign="top">
 
33
<h2><span class="refentrytitle"><a name="eds-EOAuth2Support.top_of_page"></a>EOAuth2Support</span></h2>
 
34
<p>EOAuth2Support — An interface for OAuth 2.0 support</p>
 
35
</td>
 
36
<td valign="top" align="right"></td>
 
37
</tr></table></div>
 
38
<div class="refsynopsisdiv">
 
39
<a name="eds-EOAuth2Support.synopsis"></a><h2>Synopsis</h2>
 
40
<pre class="synopsis">
 
41
#include &lt;libebackend/libebackend.h&gt;
 
42
 
 
43
struct              <a class="link" href="eds-EOAuth2Support.html#EOAuth2SupportInterface" title="struct EOAuth2SupportInterface">EOAuth2SupportInterface</a>;
 
44
<span class="returnvalue">gboolean</span>            <a class="link" href="eds-EOAuth2Support.html#e-oauth2-support-get-access-token-sync" title="e_oauth2_support_get_access_token_sync ()">e_oauth2_support_get_access_token_sync</a>
 
45
                                                        (<em class="parameter"><code><span class="type">EOAuth2Support</span> *support</code></em>,
 
46
                                                         <em class="parameter"><code><a class="link" href="eds-ESource.html#ESource" title="struct ESource"><span class="type">ESource</span></a> *source</code></em>,
 
47
                                                         <em class="parameter"><code><span class="type">GCancellable</span> *cancellable</code></em>,
 
48
                                                         <em class="parameter"><code><span class="type">gchar</span> **out_access_token</code></em>,
 
49
                                                         <em class="parameter"><code><span class="type">gint</span> *out_expires_in</code></em>,
 
50
                                                         <em class="parameter"><code><span class="type">GError</span> **error</code></em>);
 
51
<span class="returnvalue">void</span>                <a class="link" href="eds-EOAuth2Support.html#e-oauth2-support-get-access-token" title="e_oauth2_support_get_access_token ()">e_oauth2_support_get_access_token</a>   (<em class="parameter"><code><span class="type">EOAuth2Support</span> *support</code></em>,
 
52
                                                         <em class="parameter"><code><a class="link" href="eds-ESource.html#ESource" title="struct ESource"><span class="type">ESource</span></a> *source</code></em>,
 
53
                                                         <em class="parameter"><code><span class="type">GCancellable</span> *cancellable</code></em>,
 
54
                                                         <em class="parameter"><code><span class="type">GAsyncReadyCallback</span> callback</code></em>,
 
55
                                                         <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);
 
56
<span class="returnvalue">gboolean</span>            <a class="link" href="eds-EOAuth2Support.html#e-oauth2-support-get-access-token-finish" title="e_oauth2_support_get_access_token_finish ()">e_oauth2_support_get_access_token_finish</a>
 
57
                                                        (<em class="parameter"><code><span class="type">EOAuth2Support</span> *support</code></em>,
 
58
                                                         <em class="parameter"><code><span class="type">GAsyncResult</span> *result</code></em>,
 
59
                                                         <em class="parameter"><code><span class="type">gchar</span> **out_access_token</code></em>,
 
60
                                                         <em class="parameter"><code><span class="type">gint</span> *out_expires_in</code></em>,
 
61
                                                         <em class="parameter"><code><span class="type">GError</span> **error</code></em>);
 
62
</pre>
 
63
</div>
 
64
<div class="refsect1">
 
65
<a name="eds-EOAuth2Support.description"></a><h2>Description</h2>
 
66
<p>
 
67
Support for OAuth 2.0 access tokens is typically provided through
 
68
dynamically loaded modules.  The module will provide an extension
 
69
class which implements the <a class="link" href="eds-EOAuth2Support.html#EOAuth2SupportInterface" title="struct EOAuth2SupportInterface"><span class="type">EOAuth2SupportInterface</span></a>, which can be
 
70
plugged into all appropriate <a class="link" href="eds-EServerSideSource.html#EServerSideSource" title="struct EServerSideSource"><span class="type">EServerSideSource</span></a> instances through
 
71
<a class="link" href="eds-EServerSideSource.html#e-server-side-source-set-oauth2-support" title="e_server_side_source_set_oauth2_support ()"><code class="function">e_server_side_source_set_oauth2_support()</code></a>.  Incoming requests for
 
72
access tokens are then forwarded to the extension providing OAuth
 
73
2.0 support through <a class="link" href="eds-EOAuth2Support.html#e-oauth2-support-get-access-token" title="e_oauth2_support_get_access_token ()"><code class="function">e_oauth2_support_get_access_token()</code></a>.
 
74
</p>
 
75
</div>
 
76
<div class="refsect1">
 
77
<a name="eds-EOAuth2Support.details"></a><h2>Details</h2>
 
78
<div class="refsect2">
 
79
<a name="EOAuth2SupportInterface"></a><h3>struct EOAuth2SupportInterface</h3>
 
80
<pre class="programlisting">struct EOAuth2SupportInterface {
 
81
        GTypeInterface parent_interface;
 
82
 
 
83
        /* Synchronous I/O Methods */
 
84
        gboolean (*get_access_token_sync)
 
85
                                                (EOAuth2Support *support,
 
86
                                                 ESource *source,
 
87
                                                 GCancellable *cancellable,
 
88
                                                 gchar **out_access_token,
 
89
                                                 gint *out_expires_in,
 
90
                                                 GError **error);
 
91
 
 
92
        /* Asynchronous I/O Methods (all have defaults) */
 
93
        void            (*get_access_token) (EOAuth2Support *support,
 
94
                                                 ESource *source,
 
95
                                                 GCancellable *cancellable,
 
96
                                                 GAsyncReadyCallback callback,
 
97
                                                 gpointer user_data);
 
98
        gboolean (*get_access_token_finish)
 
99
                                                (EOAuth2Support *support,
 
100
                                                 GAsyncResult *result,
 
101
                                                 gchar **out_access_token,
 
102
                                                 gint *out_expires_in,
 
103
                                                 GError **error);
 
104
};
 
105
</pre>
 
106
<p class="since">Since 3.8</p>
 
107
</div>
 
108
<hr>
 
109
<div class="refsect2">
 
110
<a name="e-oauth2-support-get-access-token-sync"></a><h3>e_oauth2_support_get_access_token_sync ()</h3>
 
111
<pre class="programlisting"><span class="returnvalue">gboolean</span>            e_oauth2_support_get_access_token_sync
 
112
                                                        (<em class="parameter"><code><span class="type">EOAuth2Support</span> *support</code></em>,
 
113
                                                         <em class="parameter"><code><a class="link" href="eds-ESource.html#ESource" title="struct ESource"><span class="type">ESource</span></a> *source</code></em>,
 
114
                                                         <em class="parameter"><code><span class="type">GCancellable</span> *cancellable</code></em>,
 
115
                                                         <em class="parameter"><code><span class="type">gchar</span> **out_access_token</code></em>,
 
116
                                                         <em class="parameter"><code><span class="type">gint</span> *out_expires_in</code></em>,
 
117
                                                         <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
 
118
<p>
 
119
Obtains the OAuth 2.0 access token for <em class="parameter"><code>source</code></em> along with its expiry
 
120
in seconds from the current time (or 0 if unknown).
 
121
</p>
 
122
<p>
 
123
Free the returned access token with <code class="function">g_free()</code> when finished with it.
 
124
If an error occurs, the function will set <em class="parameter"><code>error</code></em> and return <code class="literal">FALSE</code>.
 
125
</p>
 
126
<div class="variablelist"><table border="0">
 
127
<col align="left" valign="top">
 
128
<tbody>
 
129
<tr>
 
130
<td><p><span class="term"><em class="parameter"><code>support</code></em> :</span></p></td>
 
131
<td>an <span class="type">EOAuthSupport</span>
 
132
</td>
 
133
</tr>
 
134
<tr>
 
135
<td><p><span class="term"><em class="parameter"><code>source</code></em> :</span></p></td>
 
136
<td>an <a class="link" href="eds-ESource.html#ESource" title="struct ESource"><span class="type">ESource</span></a>
 
137
</td>
 
138
</tr>
 
139
<tr>
 
140
<td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
 
141
<td>optional <span class="type">GCancellable</span> object, or <code class="literal">NULL</code>
 
142
</td>
 
143
</tr>
 
144
<tr>
 
145
<td><p><span class="term"><em class="parameter"><code>out_access_token</code></em> :</span></p></td>
 
146
<td>return location for the access token, or <code class="literal">NULL</code>
 
147
</td>
 
148
</tr>
 
149
<tr>
 
150
<td><p><span class="term"><em class="parameter"><code>out_expires_in</code></em> :</span></p></td>
 
151
<td>return location for the token expiry, or <code class="literal">NULL</code>
 
152
</td>
 
153
</tr>
 
154
<tr>
 
155
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
 
156
<td>return location for a <span class="type">GError</span>, or <code class="literal">NULL</code>
 
157
</td>
 
158
</tr>
 
159
<tr>
 
160
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
161
<td>
 
162
<code class="literal">TRUE</code> on success, <code class="literal">FALSE</code> on failure</td>
 
163
</tr>
 
164
</tbody>
 
165
</table></div>
 
166
<p class="since">Since 3.8</p>
 
167
</div>
 
168
<hr>
 
169
<div class="refsect2">
 
170
<a name="e-oauth2-support-get-access-token"></a><h3>e_oauth2_support_get_access_token ()</h3>
 
171
<pre class="programlisting"><span class="returnvalue">void</span>                e_oauth2_support_get_access_token   (<em class="parameter"><code><span class="type">EOAuth2Support</span> *support</code></em>,
 
172
                                                         <em class="parameter"><code><a class="link" href="eds-ESource.html#ESource" title="struct ESource"><span class="type">ESource</span></a> *source</code></em>,
 
173
                                                         <em class="parameter"><code><span class="type">GCancellable</span> *cancellable</code></em>,
 
174
                                                         <em class="parameter"><code><span class="type">GAsyncReadyCallback</span> callback</code></em>,
 
175
                                                         <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre>
 
176
<p>
 
177
Asynchronously obtains the OAuth 2.0 access token for <em class="parameter"><code>source</code></em> along
 
178
with its expiry in seconds from the current time (or 0 if unknown).
 
179
</p>
 
180
<p>
 
181
When the operation is finished, <em class="parameter"><code>callback</code></em> will be called.  You can then
 
182
call <a class="link" href="eds-EOAuth2Support.html#e-oauth2-support-get-access-token-finish" title="e_oauth2_support_get_access_token_finish ()"><code class="function">e_oauth2_support_get_access_token_finish()</code></a> to get the result of the
 
183
operation.
 
184
</p>
 
185
<div class="variablelist"><table border="0">
 
186
<col align="left" valign="top">
 
187
<tbody>
 
188
<tr>
 
189
<td><p><span class="term"><em class="parameter"><code>support</code></em> :</span></p></td>
 
190
<td>an <span class="type">EOAuth2Support</span>
 
191
</td>
 
192
</tr>
 
193
<tr>
 
194
<td><p><span class="term"><em class="parameter"><code>source</code></em> :</span></p></td>
 
195
<td>an <a class="link" href="eds-ESource.html#ESource" title="struct ESource"><span class="type">ESource</span></a>
 
196
</td>
 
197
</tr>
 
198
<tr>
 
199
<td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
 
200
<td>optional <span class="type">GCancellable</span> object, or <code class="literal">NULL</code>
 
201
</td>
 
202
</tr>
 
203
<tr>
 
204
<td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td>
 
205
<td>a <span class="type">GAsyncReadyCallback</span> to call when the request is satisfied</td>
 
206
</tr>
 
207
<tr>
 
208
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
 
209
<td>data to pass to the callback function</td>
 
210
</tr>
 
211
</tbody>
 
212
</table></div>
 
213
<p class="since">Since 3.8</p>
 
214
</div>
 
215
<hr>
 
216
<div class="refsect2">
 
217
<a name="e-oauth2-support-get-access-token-finish"></a><h3>e_oauth2_support_get_access_token_finish ()</h3>
 
218
<pre class="programlisting"><span class="returnvalue">gboolean</span>            e_oauth2_support_get_access_token_finish
 
219
                                                        (<em class="parameter"><code><span class="type">EOAuth2Support</span> *support</code></em>,
 
220
                                                         <em class="parameter"><code><span class="type">GAsyncResult</span> *result</code></em>,
 
221
                                                         <em class="parameter"><code><span class="type">gchar</span> **out_access_token</code></em>,
 
222
                                                         <em class="parameter"><code><span class="type">gint</span> *out_expires_in</code></em>,
 
223
                                                         <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
 
224
<p>
 
225
Finishes the operation started with <a class="link" href="eds-EOAuth2Support.html#e-oauth2-support-get-access-token" title="e_oauth2_support_get_access_token ()"><code class="function">e_oauth2_support_get_access_token()</code></a>.
 
226
</p>
 
227
<p>
 
228
Free the returned access token with <code class="function">g_free()</code> when finished with it.
 
229
If an error occurred, the function will set <em class="parameter"><code>error</code></em> and return <code class="literal">FALSE</code>.
 
230
</p>
 
231
<div class="variablelist"><table border="0">
 
232
<col align="left" valign="top">
 
233
<tbody>
 
234
<tr>
 
235
<td><p><span class="term"><em class="parameter"><code>support</code></em> :</span></p></td>
 
236
<td>an <span class="type">EOAuth2Support</span>
 
237
</td>
 
238
</tr>
 
239
<tr>
 
240
<td><p><span class="term"><em class="parameter"><code>result</code></em> :</span></p></td>
 
241
<td>a <span class="type">GAsyncResult</span>
 
242
</td>
 
243
</tr>
 
244
<tr>
 
245
<td><p><span class="term"><em class="parameter"><code>out_access_token</code></em> :</span></p></td>
 
246
<td>return location for the access token, or <code class="literal">NULL</code>
 
247
</td>
 
248
</tr>
 
249
<tr>
 
250
<td><p><span class="term"><em class="parameter"><code>out_expires_in</code></em> :</span></p></td>
 
251
<td>return location for the token expiry, or <code class="literal">NULL</code>
 
252
</td>
 
253
</tr>
 
254
<tr>
 
255
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
 
256
<td>return location for a <span class="type">GError</span>, or <code class="literal">NULL</code>
 
257
</td>
 
258
</tr>
 
259
<tr>
 
260
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
261
<td>
 
262
<code class="literal">TRUE</code> on success, <code class="literal">FALSE</code> on failure</td>
 
263
</tr>
 
264
</tbody>
 
265
</table></div>
 
266
<p class="since">Since 3.8</p>
 
267
</div>
 
268
</div>
 
269
</div>
 
270
<div class="footer">
 
271
<hr>
 
272
          Generated by GTK-Doc V1.19</div>
 
273
</body>
 
274
</html>
 
 
b'\\ No newline at end of file'