1 /*
2 callbacks.h
3 Copyright (C) 2010-2017 Belledonne Communications SARL
4 
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
9 
10 This program 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 General Public License for more details.
14 
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
18 */
19 
20 #ifndef LINPHONE_CALLBACKS_H_
21 #define LINPHONE_CALLBACKS_H_
22 
23 
24 #include "linphone/types.h"
25 
26 
27 /**
28  * @addtogroup chatroom
29  * @{
30  */
31 
32 /**
33  * Call back used to notify message delivery status
34  * @param msg #LinphoneChatMessage object
35  * @param status LinphoneChatMessageState
36  * @param ud application user data
37  * @deprecated Use LinphoneChatMessageCbsMsgStateChangedCb instead.
38  * @donotwrap
39  */
40 typedef void (*LinphoneChatMessageStateChangedCb)(LinphoneChatMessage* msg,LinphoneChatMessageState state,void* ud);
41 
42 /**
43  * Call back used to notify message delivery status
44  * @param msg #LinphoneChatMessage object
45  * @param status LinphoneChatMessageState
46  */
47 typedef void (*LinphoneChatMessageCbsMsgStateChangedCb)(LinphoneChatMessage* msg, LinphoneChatMessageState state);
48 
49 /**
50  * File transfer receive callback prototype. This function is called by the core upon an incoming File transfer is started. This function may be call several time for the same file in case of large file.
51  * @param message #LinphoneChatMessage message from which the body is received.
52  * @param content #LinphoneContent incoming content information
53  * @param buffer #LinphoneBuffer holding the received data. Empty buffer means end of file.
54  */
55 typedef void (*LinphoneChatMessageCbsFileTransferRecvCb)(LinphoneChatMessage *message, const LinphoneContent* content, const LinphoneBuffer *buffer);
56 
57 /**
58  * File transfer send callback prototype. This function is called by the core when an outgoing file transfer is started. This function is called until size is set to 0.
59  * @param message #LinphoneChatMessage message from which the body is received.
60  * @param content #LinphoneContent outgoing content
61  * @param offset the offset in the file from where to get the data to be sent
62  * @param size the number of bytes expected by the framework
63  * @return A LinphoneBuffer object holding the data written by the application. An empty buffer means end of file.
64  */
65 typedef LinphoneBuffer * (*LinphoneChatMessageCbsFileTransferSendCb)(LinphoneChatMessage *message,  const LinphoneContent* content, size_t offset, size_t size);
66 
67 /**
68  * File transfer progress indication callback prototype.
69  * @param message #LinphoneChatMessage message from which the body is received.
70  * @param content #LinphoneContent incoming content information
71  * @param offset The number of bytes sent/received since the beginning of the transfer.
72  * @param total The total number of bytes to be sent/received.
73  */
74 typedef void (*LinphoneChatMessageCbsFileTransferProgressIndicationCb)(LinphoneChatMessage *message, const LinphoneContent* content, size_t offset, size_t total);
75 
76 /**
77  * @}
78 **/
79 
80 /**
81  * @addtogroup call_control
82  * @{
83 **/
84 
85 /**
86  * Callback for being notified of received DTMFs.
87  * @param call LinphoneCall object that received the dtmf
88  * @param dtmf The ascii code of the dtmf
89  */
90 typedef void (*LinphoneCallCbsDtmfReceivedCb)(LinphoneCall *call, int dtmf);
91 
92 /**
93  * Call encryption changed callback.
94  * @param call LinphoneCall object whose encryption is changed.
95  * @param on Whether encryption is activated.
96  * @param authentication_token An authentication_token, currently set for ZRTP kind of encryption only.
97  */
98 typedef void (*LinphoneCallCbsEncryptionChangedCb)(LinphoneCall *call, bool_t on, const char *authentication_token);
99 
100 /**
101  * Callback for receiving info messages.
102  * @param call LinphoneCall whose info message belongs to.
103  * @param msg LinphoneInfoMessage object.
104  */
105 typedef void (*LinphoneCallCbsInfoMessageReceivedCb)(LinphoneCall *call, const LinphoneInfoMessage *msg);
106 
107 /**
108  * Call state notification callback.
109  * @param call LinphoneCall whose state is changed.
110  * @param cstate The new state of the call
111  * @param message An informational message about the state.
112  */
113 typedef void (*LinphoneCallCbsStateChangedCb)(LinphoneCall *call, LinphoneCallState cstate, const char *message);
114 
115 /**
116  * Callback for receiving quality statistics for calls.
117  * @param call LinphoneCall object whose statistics are notified
118  * @param stats LinphoneCallStats object
119  */
120 typedef void (*LinphoneCallCbsStatsUpdatedCb)(LinphoneCall *call, const LinphoneCallStats *stats);
121 
122 /**
123  * Callback for notifying progresses of transfers.
124  * @param call LinphoneCall that was transfered
125  * @param cstate The state of the call to transfer target at the far end.
126  */
127 typedef void (*LinphoneCallCbsTransferStateChangedCb)(LinphoneCall *call, LinphoneCallState cstate);
128 
129 /**
130  * Callback for notifying the processing SIP ACK messages.
131  * @param call LinphoneCall for which an ACK is being received or sent
132  * @param ack the ACK message
133  * @param is_received if TRUE this ACK is an incoming one, otherwise it is an ACK about to be sent.
134  */
135 typedef void (*LinphoneCallCbsAckProcessingCb)(LinphoneCall *call, LinphoneHeaders *ack, bool_t is_received);
136 
137 /**
138  * @}
139 **/
140 
141 /**
142  * @addtogroup initializing
143  * @{
144 **/
145 
146 /**
147  * Callback notifying that a new LinphoneCall (either incoming or outgoing) has been created.
148  * @param[in] lc LinphoneCore object that has created the call
149  * @param[in] call The newly created LinphoneCall object
150  */
151 typedef void (*LinphoneCoreCbsCallCreatedCb)(LinphoneCore *lc, LinphoneCall *call);
152 
153 /**
154  * Global state notification callback.
155  * @param lc the #LinphoneCore.
156  * @param gstate the global state
157  * @param message informational message.
158  */
159 typedef void (*LinphoneCoreCbsGlobalStateChangedCb)(LinphoneCore *lc, LinphoneGlobalState gstate, const char *message);
160 
161 /**
162  * Old name of #LinphoneCoreCbsGlobalStateChangedCb.
163  */
164 typedef LinphoneCoreCbsGlobalStateChangedCb LinphoneCoreGlobalStateChangedCb;
165 
166 /**
167  * Call state notification callback.
168  * @param lc the LinphoneCore
169  * @param call the call object whose state is changed.
170  * @param cstate the new state of the call
171  * @param message a non NULL informational message about the state.
172  */
173 typedef void (*LinphoneCoreCbsCallStateChangedCb)(LinphoneCore *lc, LinphoneCall *call, LinphoneCallState cstate, const char *message);
174 
175 /**
176  * Old name of #LinphoneCoreCbsCallStateChangedCb.
177  */
178 typedef LinphoneCoreCbsCallStateChangedCb LinphoneCoreCallStateChangedCb;
179 
180 /**
181  * Call encryption changed callback.
182  * @param lc the LinphoneCore
183  * @param call the call on which encryption is changed.
184  * @param on whether encryption is activated.
185  * @param authentication_token an authentication_token, currently set for ZRTP kind of encryption only.
186  */
187 typedef void (*LinphoneCoreCbsCallEncryptionChangedCb)(LinphoneCore *lc, LinphoneCall *call, bool_t on, const char *authentication_token);
188 
189 /**
190  * Old name of #LinphoneCoreCbsCallEncryptionChangedCb.
191  */
192 typedef LinphoneCoreCbsCallEncryptionChangedCb LinphoneCoreCallEncryptionChangedCb;
193 
194 /**
195  * Registration state notification callback prototype
196  * @ingroup Proxies
197  */
198 typedef void (*LinphoneCoreCbsRegistrationStateChangedCb)(LinphoneCore *lc, LinphoneProxyConfig *cfg, LinphoneRegistrationState cstate, const char *message);
199 
200 /**
201  * Old name of #LinphoneCoreCbsRegistrationStateChangedCb.
202  */
203 typedef LinphoneCoreCbsRegistrationStateChangedCb LinphoneCoreRegistrationStateChangedCb;
204 
205 /**
206  * Report status change for a friend previously \link linphone_core_add_friend() added \endlink to #LinphoneCore.
207  * @param lc #LinphoneCore object .
208  * @param lf Updated #LinphoneFriend .
209  */
210 typedef void (*LinphoneCoreCbsNotifyPresenceReceivedCb)(LinphoneCore *lc, LinphoneFriend * lf);
211 
212 /**
213  * Old name of #LinphoneCoreCbsNotifyPresenceReceivedCb.
214  */
215 typedef LinphoneCoreCbsNotifyPresenceReceivedCb LinphoneCoreNotifyPresenceReceivedCb;
216 
217 /**
218  * Reports presence model change for a specific URI or phone number of a friend
219  * @param lc #LinphoneCore object
220  * @param lf #LinphoneFriend object
221  * @param uri_or_tel The URI or phone number for which teh presence model has changed
222  * @param presence_model The new presence model
223  */
224 typedef void (*LinphoneCoreCbsNotifyPresenceReceivedForUriOrTelCb)(LinphoneCore *lc, LinphoneFriend *lf, const char *uri_or_tel, const LinphonePresenceModel *presence_model);
225 
226 /**
227  * Old name of #LinphoneCoreCbsNotifyPresenceReceivedForUriOrTelCb.
228  */
229 typedef LinphoneCoreCbsNotifyPresenceReceivedForUriOrTelCb LinphoneCoreNotifyPresenceReceivedForUriOrTelCb;
230 
231 /**
232  * Reports that a new subscription request has been received and wait for a decision.
233  * Status on this subscription request is notified by \link linphone_friend_set_inc_subscribe_policy() changing policy \endlink for this friend
234  * @param lc #LinphoneCore object
235  * @param lf #LinphoneFriend corresponding to the subscriber
236  * @param url of the subscriber
237  */
238 typedef void (*LinphoneCoreCbsNewSubscriptionRequestedCb)(LinphoneCore *lc, LinphoneFriend *lf, const char *url);
239 
240 /**
241  * Old name of #LinphoneCoreCbsNewSubscriptionRequestedCb.
242  */
243 typedef LinphoneCoreCbsNewSubscriptionRequestedCb LinphoneCoreNewSubscriptionRequestedCb;
244 
245 /**
246  * Callback for requesting authentication information to application or user.
247  * @param lc the LinphoneCore
248  * @param realm the realm (domain) on which authentication is required.
249  * @param username the username that needs to be authenticated.
250  * @param domain the domain on which authentication is required.
251  * Application shall reply to this callback using linphone_core_add_auth_info().
252  */
253 typedef void (*LinphoneCoreAuthInfoRequestedCb)(LinphoneCore *lc, const char *realm, const char *username, const char *domain);
254 
255 /**
256  * Callback for requesting authentication information to application or user.
257  * @param lc the LinphoneCore
258  * @param auth_info a LinphoneAuthInfo pre-filled with username, realm and domain values as much as possible
259  * @param method the type of authentication requested
260  * Application shall reply to this callback using linphone_core_add_auth_info().
261  */
262 typedef void (*LinphoneCoreCbsAuthenticationRequestedCb)(LinphoneCore *lc, LinphoneAuthInfo *auth_info, LinphoneAuthMethod method);
263 
264 /**
265  * Old name of #LinphoneCoreCbsAuthenticationRequestedCb.
266  */
267 typedef LinphoneCoreCbsAuthenticationRequestedCb LinphoneCoreAuthenticationRequestedCb;
268 
269 /**
270  * Callback to notify a new call-log entry has been added.
271  * This is done typically when a call terminates.
272  * @param lc the LinphoneCore
273  * @param newcl the new call log entry added.
274  */
275 typedef void (*LinphoneCoreCbsCallLogUpdatedCb)(LinphoneCore *lc, LinphoneCallLog *newcl);
276 
277 /**
278  * Old name of #LinphoneCoreCbsCallLogUpdatedCb.
279  */
280 typedef LinphoneCoreCbsCallLogUpdatedCb LinphoneCoreCallLogUpdatedCb;
281 
282 /**
283  * Callback prototype
284  * @param lc #LinphoneCore object
285  * @param room #LinphoneChatRoom involved in this conversation. Can be be created by the framework in case \link #LinphoneAddress the from \endlink is not present in any chat room.
286  * @param from #LinphoneAddress from
287  * @param message incoming message
288  * @deprecated use #LinphoneCoreMessageReceivedCb instead.
289  * @donotwrap
290  */
291 typedef void (*LinphoneCoreTextMessageReceivedCb)(LinphoneCore *lc, LinphoneChatRoom *room, const LinphoneAddress *from, const char *message);
292 
293 /**
294  * Chat message callback prototype
295  * @param lc #LinphoneCore object
296  * @param room #LinphoneChatRoom involved in this conversation. Can be be created by the framework in case \link #LinphoneAddress the from \endlink is not present in any chat room.
297  * @param LinphoneChatMessage incoming message
298  */
299 typedef void (*LinphoneCoreCbsMessageReceivedCb)(LinphoneCore *lc, LinphoneChatRoom *room, LinphoneChatMessage *message);
300 
301 /**
302  * Old name of #LinphoneCoreCbsMessageReceivedCb.
303  */
304 typedef LinphoneCoreCbsMessageReceivedCb LinphoneCoreMessageReceivedCb;
305 
306 /**
307  * Chat message not decrypted callback prototype
308  * @param lc #LinphoneCore object
309  * @param room #LinphoneChatRoom involved in this conversation. Can be be created by the framework in case \link #LinphoneAddress the from \endlink is not present in any chat room.
310  * @param LinphoneChatMessage incoming message
311  */
312 typedef void (*LinphoneCoreCbsMessageReceivedUnableDecryptCb)(LinphoneCore *lc, LinphoneChatRoom *room, LinphoneChatMessage *message);
313 
314 /**
315  * File transfer receive callback prototype. This function is called by the core upon an incoming File transfer is started. This function may be call several time for the same file in case of large file.
316  * @param lc #LinphoneCore object
317  * @param message #LinphoneChatMessage message from which the body is received.
318  * @param content #LinphoneContent incoming content information
319  * @param buff pointer to the received data
320  * @param size number of bytes to be read from buff. 0 means end of file.
321  */
322 typedef void (*LinphoneCoreFileTransferRecvCb)(LinphoneCore *lc, LinphoneChatMessage *message, const LinphoneContent* content, const char* buff, size_t size);
323 
324 /**
325  * File transfer send callback prototype. This function is called by the core upon an outgoing file transfer is started. This function is called until size is set to 0.
326  * @param lc #LinphoneCore object
327  * @param message #LinphoneChatMessage message from which the body is received.
328  * @param content #LinphoneContent outgoing content
329  * @param buff pointer to the buffer where data chunk shall be written by the app
330  * @param size as input value, it represents the number of bytes expected by the framework. As output value, it means the number of bytes wrote by the application in the buffer. 0 means end of file.
331  *
332  */
333 typedef void (*LinphoneCoreFileTransferSendCb)(LinphoneCore *lc, LinphoneChatMessage *message,  const LinphoneContent* content, char* buff, size_t* size);
334 
335 /**
336  * File transfer progress indication callback prototype.
337  * @param lc #LinphoneCore object
338  * @param message #LinphoneChatMessage message from which the body is received.
339  * @param content #LinphoneContent incoming content information
340  * @param offset The number of bytes sent/received since the beginning of the transfer.
341  * @param total The total number of bytes to be sent/received.
342  */
343 typedef void (*LinphoneCoreFileTransferProgressIndicationCb)(LinphoneCore *lc, LinphoneChatMessage *message, const LinphoneContent* content, size_t offset, size_t total);
344 
345 /**
346  * Is composing notification callback prototype.
347  * @param[in] lc #LinphoneCore object
348  * @param[in] room #LinphoneChatRoom involved in the conversation.
349  */
350 typedef void (*LinphoneCoreCbsIsComposingReceivedCb)(LinphoneCore *lc, LinphoneChatRoom *room);
351 
352 /**
353  * Old name of #LinphoneCoreCbsIsComposingReceivedCb.
354  */
355 typedef LinphoneCoreCbsIsComposingReceivedCb LinphoneCoreIsComposingReceivedCb;
356 
357 /**
358  * Callback for being notified of DTMFs received.
359  * @param lc the linphone core
360  * @param call the call that received the dtmf
361  * @param dtmf the ascii code of the dtmf
362  */
363 typedef void (*LinphoneCoreCbsDtmfReceivedCb)(LinphoneCore* lc, LinphoneCall *call, int dtmf);
364 
365 /**
366  * Old name of #LinphoneCoreCbsDtmfReceivedCb.
367  */
368 typedef LinphoneCoreCbsDtmfReceivedCb LinphoneCoreDtmfReceivedCb;
369 
370 /** Callback prototype */
371 typedef void (*LinphoneCoreCbsReferReceivedCb)(LinphoneCore *lc, const char *refer_to);
372 
373 /**
374  * Old name of #LinphoneCoreCbsReferReceivedCb.
375  */
376 typedef LinphoneCoreCbsReferReceivedCb LinphoneCoreReferReceivedCb;
377 
378 /** Callback prototype */
379 typedef void (*LinphoneCoreCbsBuddyInfoUpdatedCb)(LinphoneCore *lc, LinphoneFriend *lf);
380 
381 /**
382  * Old name of #LinphoneCoreCbsBuddyInfoUpdatedCb.
383  */
384 typedef LinphoneCoreCbsBuddyInfoUpdatedCb LinphoneCoreBuddyInfoUpdatedCb;
385 
386 /**
387  * Callback for notifying progresses of transfers.
388  * @param lc the LinphoneCore
389  * @param transfered the call that was transfered
390  * @param new_call_state the state of the call to transfer target at the far end.
391  */
392 typedef void (*LinphoneCoreCbsTransferStateChangedCb)(LinphoneCore *lc, LinphoneCall *transfered, LinphoneCallState new_call_state);
393 
394 /**
395  * Old name of LinphoneCoreCbsTransferStateChangedCb.
396  */
397 typedef LinphoneCoreCbsTransferStateChangedCb LinphoneCoreTransferStateChangedCb;
398 
399 /**
400  * Callback for receiving quality statistics for calls.
401  * @param lc the LinphoneCore
402  * @param call the call
403  * @param stats the call statistics.
404  */
405 typedef void (*LinphoneCoreCbsCallStatsUpdatedCb)(LinphoneCore *lc, LinphoneCall *call, const LinphoneCallStats *stats);
406 
407 /**
408  * Old name of #LinphoneCoreCbsCallStatsUpdatedCb.
409  */
410 typedef LinphoneCoreCbsCallStatsUpdatedCb LinphoneCoreCallStatsUpdatedCb;
411 
412 /**
413  * Callback prototype for receiving info messages.
414  * @param lc the LinphoneCore
415  * @param call the call whose info message belongs to.
416  * @param msg the info message.
417  */
418 typedef void (*LinphoneCoreCbsInfoReceivedCb)(LinphoneCore *lc, LinphoneCall *call, const LinphoneInfoMessage *msg);
419 
420 /**
421  * Old name of #LinphoneCoreCbsInfoReceivedCb.
422  */
423 typedef LinphoneCoreCbsInfoReceivedCb LinphoneCoreInfoReceivedCb;
424 
425 /**
426  * Callback prototype for configuring status changes notification
427  * @param lc the LinphoneCore
428  * @param message informational message.
429  */
430 typedef void (*LinphoneCoreCbsConfiguringStatusCb)(LinphoneCore *lc, LinphoneConfiguringState status, const char *message);
431 
432 /**
433  * Old name of #LinphoneCoreCbsConfiguringStatusCb.
434  */
435 typedef LinphoneCoreCbsConfiguringStatusCb LinphoneCoreConfiguringStatusCb;
436 
437 /**
438  * Callback prototype for reporting network change either automatically detected or notified by #linphone_core_set_network_reachable.
439  * @param lc the LinphoneCore
440  * @param reachable true if network is reachable.
441  */
442 typedef void (*LinphoneCoreCbsNetworkReachableCb)(LinphoneCore *lc, bool_t reachable);
443 
444 /**
445  * Old name of #LinphoneCoreCbsNetworkReachableCb.
446  */
447 typedef LinphoneCoreCbsNetworkReachableCb LinphoneCoreNetworkReachableCb;
448 
449 /**
450  * Callback prototype for reporting log collection upload state change.
451  * @param[in] lc LinphoneCore object
452  * @param[in] state The state of the log collection upload
453  * @param[in] info Additional information: error message in case of error state, URL of uploaded file in case of success.
454  */
455 typedef void (*LinphoneCoreCbsLogCollectionUploadStateChangedCb)(LinphoneCore *lc, LinphoneCoreLogCollectionUploadState state, const char *info);
456 
457 /**
458  * Old name of #LinphoneCoreCbsLogCollectionUploadStateChangedCb.
459  */
460 typedef LinphoneCoreCbsLogCollectionUploadStateChangedCb LinphoneCoreLogCollectionUploadStateChangedCb;
461 
462 /**
463  * Callback prototype for reporting log collection upload progress indication.
464  * @param[in] lc LinphoneCore object
465  */
466 typedef void (*LinphoneCoreCbsLogCollectionUploadProgressIndicationCb)(LinphoneCore *lc, size_t offset, size_t total);
467 
468 /**
469  * Old name of #LinphoneCoreCbsLogCollectionUploadProgressIndicationCb.
470  */
471 typedef LinphoneCoreCbsLogCollectionUploadProgressIndicationCb LinphoneCoreLogCollectionUploadProgressIndicationCb;
472 
473 /**
474  * Callback prototype for reporting when a friend list has been added to the core friends list.
475  * @param[in] lc LinphoneCore object
476  * @param[in] list LinphoneFriendList object
477  */
478 typedef void (*LinphoneCoreCbsFriendListCreatedCb) (LinphoneCore *lc, LinphoneFriendList *list);
479 
480 /**
481  * Old name of #LinphoneCoreCbsFriendListCreatedCb.
482  */
483 typedef LinphoneCoreCbsFriendListCreatedCb LinphoneCoreFriendListCreatedCb;
484 
485 /**
486  * Callback prototype for reporting when a friend list has been removed from the core friends list.
487  * @param[in] lc LinphoneCore object
488  * @param[in] list LinphoneFriendList object
489  */
490 typedef void (*LinphoneCoreCbsFriendListRemovedCb) (LinphoneCore *lc, LinphoneFriendList *list);
491 
492 /**
493  * Old name of #LinphoneCoreCbsFriendListRemovedCb.
494  */
495 typedef LinphoneCoreCbsFriendListRemovedCb LinphoneCoreFriendListRemovedCb;
496 
497 /**
498  * Callback prototype for reporting the result of a version update check.
499  * @param[in] lc LinphoneCore object
500  * @param[in] result The result of the version update check
501  * @param[in] url The url where to download the new version if the result is LinphoneVersionUpdateCheckNewVersionAvailable
502  */
503 typedef void (*LinphoneCoreCbsVersionUpdateCheckResultReceivedCb) (LinphoneCore *lc, LinphoneVersionUpdateCheckResult result, const char *version, const char *url);
504 
505 /**
506  * @}
507 **/
508 
509 /**
510  * @addtogroup event_api
511  * @{
512 **/
513 
514 /**
515  * Callback prototype for notifying the application about notification received from the network.
516 **/
517 typedef void (*LinphoneCoreCbsNotifyReceivedCb)(LinphoneCore *lc, LinphoneEvent *lev, const char *notified_event, const LinphoneContent *body);
518 
519 /**
520  * Old name of #LinphoneCoreCbsNotifyReceivedCb.
521  */
522 typedef LinphoneCoreCbsNotifyReceivedCb LinphoneCoreNotifyReceivedCb;
523 
524 /**
525  * Callback prototype for notifying the application about changes of subscription states, including arrival of new subscriptions.
526 **/
527 typedef void (*LinphoneCoreCbsSubscriptionStateChangedCb)(LinphoneCore *lc, LinphoneEvent *lev, LinphoneSubscriptionState state);
528 
529 /**
530  * Old name of #LinphoneCoreCbsSubscriptionStateChangedCb.
531  */
532 typedef LinphoneCoreCbsSubscriptionStateChangedCb LinphoneCoreSubscriptionStateChangedCb;
533 
534 /**
535  * Callback prototype for notifying the application about changes of publish states.
536 **/
537 typedef void (*LinphoneCoreCbsPublishStateChangedCb)(LinphoneCore *lc, LinphoneEvent *lev, LinphonePublishState state);
538 
539 /**
540  * Old name of LinphoneCoreCbsPublishStateChangedCb.
541  */
542 typedef LinphoneCoreCbsPublishStateChangedCb LinphoneCorePublishStateChangedCb;
543 
544 /**
545  * @}
546 **/
547 
548 /**
549  * @addtogroup buddy_list
550  * @{
551  */
552 
553 /**
554  * Callback used to notify a new contact has been created on the CardDAV server and downloaded locally
555  * @param list The LinphoneFriendList object the new contact is added to
556  * @param lf The LinphoneFriend object that has been created
557 **/
558 typedef void (*LinphoneFriendListCbsContactCreatedCb)(LinphoneFriendList *list, LinphoneFriend *lf);
559 
560 /**
561  * Callback used to notify a contact has been deleted on the CardDAV server
562  * @param list The LinphoneFriendList object a contact has been removed from
563  * @param lf The LinphoneFriend object that has been deleted
564 **/
565 typedef void (*LinphoneFriendListCbsContactDeletedCb)(LinphoneFriendList *list, LinphoneFriend *lf);
566 
567 /**
568  * Callback used to notify a contact has been updated on the CardDAV server
569  * @param list The LinphoneFriendList object in which a contact has been updated
570  * @param new_friend The new LinphoneFriend object corresponding to the updated contact
571  * @param old_friend The old LinphoneFriend object before update
572 **/
573 typedef void (*LinphoneFriendListCbsContactUpdatedCb)(LinphoneFriendList *list, LinphoneFriend *new_friend, LinphoneFriend *old_friend);
574 
575 /**
576  * Callback used to notify the status of the synchronization has changed
577  * @param list The LinphoneFriendList object for which the status has changed
578  * @param status The new synchronisation status
579  * @param msg An additional information on the status update
580 **/
581 typedef void (*LinphoneFriendListCbsSyncStateChangedCb)(LinphoneFriendList *list, LinphoneFriendListSyncStatus status, const char *msg);
582 
583 /**
584  * @}
585 **/
586 
587 /**
588  * @addtogroup misc
589  * @{
590  */
591 
592 /**
593  * Callback to decrypt incoming LinphoneChatMessage
594  * @param engine ImEncryptionEngine object
595  * @param room LinphoneChatRoom object
596  * @param msg LinphoneChatMessage object
597  * @return -1 if nothing to be done, 0 on success or an integer > 0 for error
598 */
599 typedef int (*LinphoneImEncryptionEngineCbsIncomingMessageCb)(LinphoneImEncryptionEngine *engine, LinphoneChatRoom *room, LinphoneChatMessage *msg);
600 
601 /**
602  * Callback to encrypt outgoing LinphoneChatMessage
603  * @param engine LinphoneImEncryptionEngine object
604  * @param room LinphoneChatRoom object
605  * @param msg LinphoneChatMessage object
606  * @return -1 if nothing to be done, 0 on success or an integer > 0 for error
607 */
608 typedef int (*LinphoneImEncryptionEngineCbsOutgoingMessageCb)(LinphoneImEncryptionEngine *engine, LinphoneChatRoom *room, LinphoneChatMessage *msg);
609 
610 /**
611  * Callback to know whether or not the engine will encrypt files before uploading them
612  * @param engine LinphoneImEncryptionEngine object
613  * @param room LinphoneChatRoom object
614  * @return TRUE if files will be encrypted, FALSE otherwise
615 */
616 typedef bool_t (*LinphoneImEncryptionEngineCbsIsEncryptionEnabledForFileTransferCb)(LinphoneImEncryptionEngine *engine, LinphoneChatRoom *room);
617 
618 /**
619  * Callback to generate the key used to encrypt the files before uploading them
620  * Key can be stored in the LinphoneContent object inside the LinphoneChatMessage using linphone_content_set_key
621  * @param engine LinphoneImEncryptionEngine object
622  * @param room LinphoneChatRoom object
623  * @param msg LinphoneChatMessage object
624 */
625 typedef void (*LinphoneImEncryptionEngineCbsGenerateFileTransferKeyCb)(LinphoneImEncryptionEngine *engine, LinphoneChatRoom *room, LinphoneChatMessage *msg);
626 
627 /**
628  * Callback to decrypt downloading file
629  * @param engine LinphoneImEncryptionEngine object
630  * @param msg LinphoneChatMessage object
631  * @param offset The current offset of the upload
632  * @param[in] buffer Encrypted data buffer
633  * @param[in] size Size of the encrypted data buffer and maximum size of the decrypted data buffer
634  * @param[out] decrypted_buffer Buffer in which to write the decrypted data which maximum size is size
635  * @return -1 if nothing to be done, 0 on success or an integer > 0 for error
636 */
637 typedef int (*LinphoneImEncryptionEngineCbsDownloadingFileCb)(LinphoneImEncryptionEngine *engine, LinphoneChatMessage *msg, size_t offset, const uint8_t *buffer, size_t size, uint8_t *decrypted_buffer);
638 
639 /**
640  * Callback to encrypt uploading file
641  * @param engine LinphoneImEncryptionEngine object
642  * @param msg LinphoneChatMessage object
643  * @param offset The current offset of the upload
644  * @param[in] buffer Encrypted data buffer
645  * @param[in,out] size Size of the plain data buffer and the size of the encrypted data buffer once encryption is done
646  * @param[out] encrypted_buffer Buffer in which to write the encrypted data which maxmimum size is size
647  * @return -1 if nothing to be done, 0 on success or an integer > 0 for error
648 */
649 typedef int (*LinphoneImEncryptionEngineCbsUploadingFileCb)(LinphoneImEncryptionEngine *engine, LinphoneChatMessage *msg, size_t offset, const uint8_t *buffer, size_t *size, uint8_t *encrypted_buffer);
650 
651 /**
652  * Callback used to notify the response to an XML-RPC request.
653  * @param[in] request LinphoneXmlRpcRequest object
654 **/
655 typedef void (*LinphoneXmlRpcRequestCbsResponseCb)(LinphoneXmlRpcRequest *request);
656 
657 /**
658  * @}
659 **/
660 
661 /**
662  * @addtogroup call_control
663  * @{
664  */
665 
666 /**
667  * Callback for notifying end of play (file).
668  * @param[in] player The LinphonePlayer object
669 **/
670 typedef void (*LinphonePlayerCbsEofReachedCb)(LinphonePlayer *obj);
671 
672 
673 /**
674  * @}
675 **/
676 
677 #endif /* LINPHONE_CALLBACKS_H_ */
678