Commit a5a3b2ad authored by Sylvain Berfini's avatar Sylvain Berfini 🎩
Browse files

Added chat message callbacks to c wrapper

parent c0d1e3ec
...@@ -43,76 +43,6 @@ ...@@ -43,76 +43,6 @@
#include "content/content-type.h" #include "content/content-type.h"
static void _linphone_chat_message_destroy(LinphoneChatMessage *msg);
BELLE_SIP_DECLARE_NO_IMPLEMENTED_INTERFACES(LinphoneChatMessageCbs);
BELLE_SIP_INSTANCIATE_VPTR(LinphoneChatMessageCbs, belle_sip_object_t,
NULL, // destroy
NULL, // clone
NULL, // marshal
FALSE);
LinphoneChatMessageCbs *linphone_chat_message_cbs_new(void) {
return belle_sip_object_new(LinphoneChatMessageCbs);
}
LinphoneChatMessageCbs *linphone_chat_message_cbs_ref(LinphoneChatMessageCbs *cbs) {
belle_sip_object_ref(cbs);
return cbs;
}
void linphone_chat_message_cbs_unref(LinphoneChatMessageCbs *cbs) {
belle_sip_object_unref(cbs);
}
void *linphone_chat_message_cbs_get_user_data(const LinphoneChatMessageCbs *cbs) {
return cbs->user_data;
}
void linphone_chat_message_cbs_set_user_data(LinphoneChatMessageCbs *cbs, void *ud) {
cbs->user_data = ud;
}
LinphoneChatMessageCbsMsgStateChangedCb
linphone_chat_message_cbs_get_msg_state_changed(const LinphoneChatMessageCbs *cbs) {
return cbs->msg_state_changed;
}
void linphone_chat_message_cbs_set_msg_state_changed(LinphoneChatMessageCbs *cbs,
LinphoneChatMessageCbsMsgStateChangedCb cb) {
cbs->msg_state_changed = cb;
}
LinphoneChatMessageCbsFileTransferRecvCb linphone_chat_message_cbs_get_file_transfer_recv(const LinphoneChatMessageCbs *cbs) {
return cbs->file_transfer_recv;
}
void linphone_chat_message_cbs_set_file_transfer_recv(LinphoneChatMessageCbs *cbs,
LinphoneChatMessageCbsFileTransferRecvCb cb) {
cbs->file_transfer_recv = cb;
}
LinphoneChatMessageCbsFileTransferSendCb linphone_chat_message_cbs_get_file_transfer_send(const LinphoneChatMessageCbs *cbs) {
return cbs->file_transfer_send;
}
void linphone_chat_message_cbs_set_file_transfer_send(LinphoneChatMessageCbs *cbs,
LinphoneChatMessageCbsFileTransferSendCb cb) {
cbs->file_transfer_send = cb;
}
LinphoneChatMessageCbsFileTransferProgressIndicationCb
linphone_chat_message_cbs_get_file_transfer_progress_indication(const LinphoneChatMessageCbs *cbs) {
return cbs->file_transfer_progress_indication;
}
void linphone_chat_message_cbs_set_file_transfer_progress_indication(
LinphoneChatMessageCbs *cbs, LinphoneChatMessageCbsFileTransferProgressIndicationCb cb) {
cbs->file_transfer_progress_indication = cb;
}
BELLE_SIP_DECLARE_NO_IMPLEMENTED_INTERFACES(LinphoneChatMessage); BELLE_SIP_DECLARE_NO_IMPLEMENTED_INTERFACES(LinphoneChatMessage);
void linphone_chat_message_set_state(LinphoneChatMessage *msg, LinphoneChatMessageState state) { void linphone_chat_message_set_state(LinphoneChatMessage *msg, LinphoneChatMessageState state) {
......
...@@ -60,6 +60,62 @@ LINPHONE_PUBLIC void * linphone_chat_message_cbs_get_user_data (const LinphoneCh ...@@ -60,6 +60,62 @@ LINPHONE_PUBLIC void * linphone_chat_message_cbs_get_user_data (const LinphoneCh
**/ **/
LINPHONE_PUBLIC void linphone_chat_message_cbs_set_user_data (LinphoneChatMessageCbs *cbs, void *ud); LINPHONE_PUBLIC void linphone_chat_message_cbs_set_user_data (LinphoneChatMessageCbs *cbs, void *ud);
/**
* Get the message state changed callback.
* @param[in] cbs LinphoneChatMessageCbs object.
* @return The current message state changed callback.
*/
LINPHONE_PUBLIC LinphoneChatMessageCbsMsgStateChangedCb linphone_chat_message_cbs_get_msg_state_changed(const LinphoneChatMessageCbs *cbs);
/**
* Set the message state changed callback.
* @param[in] cbs LinphoneChatMessageCbs object.
* @param[in] cb The message state changed callback to be used.
*/
LINPHONE_PUBLIC void linphone_chat_message_cbs_set_msg_state_changed(LinphoneChatMessageCbs *cbs, LinphoneChatMessageCbsMsgStateChangedCb cb);
/**
* Get the file transfer receive callback.
* @param[in] cbs LinphoneChatMessageCbs object.
* @return The current file transfer receive callback.
*/
LINPHONE_PUBLIC LinphoneChatMessageCbsFileTransferRecvCb linphone_chat_message_cbs_get_file_transfer_recv(const LinphoneChatMessageCbs *cbs);
/**
* Set the file transfer receive callback.
* @param[in] cbs LinphoneChatMessageCbs object.
* @param[in] cb The file transfer receive callback to be used.
*/
LINPHONE_PUBLIC void linphone_chat_message_cbs_set_file_transfer_recv(LinphoneChatMessageCbs *cbs, LinphoneChatMessageCbsFileTransferRecvCb cb);
/**
* Get the file transfer send callback.
* @param[in] cbs LinphoneChatMessageCbs object.
* @return The current file transfer send callback.
*/
LINPHONE_PUBLIC LinphoneChatMessageCbsFileTransferSendCb linphone_chat_message_cbs_get_file_transfer_send(const LinphoneChatMessageCbs *cbs);
/**
* Set the file transfer send callback.
* @param[in] cbs LinphoneChatMessageCbs object.
* @param[in] cb The file transfer send callback to be used.
*/
LINPHONE_PUBLIC void linphone_chat_message_cbs_set_file_transfer_send(LinphoneChatMessageCbs *cbs, LinphoneChatMessageCbsFileTransferSendCb cb);
/**
* Get the file transfer progress indication callback.
* @param[in] cbs LinphoneChatMessageCbs object.
* @return The current file transfer progress indication callback.
*/
LINPHONE_PUBLIC LinphoneChatMessageCbsFileTransferProgressIndicationCb linphone_chat_message_cbs_get_file_transfer_progress_indication(const LinphoneChatMessageCbs *cbs);
/**
* Set the file transfer progress indication callback.
* @param[in] cbs LinphoneChatMessageCbs object.
* @param[in] cb The file transfer progress indication callback to be used.
*/
LINPHONE_PUBLIC void linphone_chat_message_cbs_set_file_transfer_progress_indication(LinphoneChatMessageCbs *cbs, LinphoneChatMessageCbsFileTransferProgressIndicationCb cb);
/** /**
* @} * @}
*/ */
......
...@@ -342,89 +342,6 @@ LINPHONE_PUBLIC const char* linphone_chat_message_get_message_id(const LinphoneC ...@@ -342,89 +342,6 @@ LINPHONE_PUBLIC const char* linphone_chat_message_get_message_id(const LinphoneC
*/ */
LINPHONE_PUBLIC LinphoneChatMessageCbs * linphone_chat_message_get_callbacks(const LinphoneChatMessage *msg); LINPHONE_PUBLIC LinphoneChatMessageCbs * linphone_chat_message_get_callbacks(const LinphoneChatMessage *msg);
/**
* Acquire a reference to the LinphoneChatMessageCbs object.
* @param[in] cbs LinphoneChatMessageCbs object.
* @return The same LinphoneChatMessageCbs object.
*/
LINPHONE_PUBLIC LinphoneChatMessageCbs * linphone_chat_message_cbs_ref(LinphoneChatMessageCbs *cbs);
/**
* Release reference to the LinphoneChatMessageCbs object.
* @param[in] cbs LinphoneChatMessageCbs object.
*/
LINPHONE_PUBLIC void linphone_chat_message_cbs_unref(LinphoneChatMessageCbs *cbs);
/**
* Retrieve the user pointer associated with the LinphoneChatMessageCbs object.
* @param[in] cbs LinphoneChatMessageCbs object.
* @return The user pointer associated with the LinphoneChatMessageCbs object.
*/
LINPHONE_PUBLIC void *linphone_chat_message_cbs_get_user_data(const LinphoneChatMessageCbs *cbs);
/**
* Assign a user pointer to the LinphoneChatMessageCbs object.
* @param[in] cbs LinphoneChatMessageCbs object.
* @param[in] ud The user pointer to associate with the LinphoneChatMessageCbs object.
*/
LINPHONE_PUBLIC void linphone_chat_message_cbs_set_user_data(LinphoneChatMessageCbs *cbs, void *ud);
/**
* Get the message state changed callback.
* @param[in] cbs LinphoneChatMessageCbs object.
* @return The current message state changed callback.
*/
LINPHONE_PUBLIC LinphoneChatMessageCbsMsgStateChangedCb linphone_chat_message_cbs_get_msg_state_changed(const LinphoneChatMessageCbs *cbs);
/**
* Set the message state changed callback.
* @param[in] cbs LinphoneChatMessageCbs object.
* @param[in] cb The message state changed callback to be used.
*/
LINPHONE_PUBLIC void linphone_chat_message_cbs_set_msg_state_changed(LinphoneChatMessageCbs *cbs, LinphoneChatMessageCbsMsgStateChangedCb cb);
/**
* Get the file transfer receive callback.
* @param[in] cbs LinphoneChatMessageCbs object.
* @return The current file transfer receive callback.
*/
LINPHONE_PUBLIC LinphoneChatMessageCbsFileTransferRecvCb linphone_chat_message_cbs_get_file_transfer_recv(const LinphoneChatMessageCbs *cbs);
/**
* Set the file transfer receive callback.
* @param[in] cbs LinphoneChatMessageCbs object.
* @param[in] cb The file transfer receive callback to be used.
*/
LINPHONE_PUBLIC void linphone_chat_message_cbs_set_file_transfer_recv(LinphoneChatMessageCbs *cbs, LinphoneChatMessageCbsFileTransferRecvCb cb);
/**
* Get the file transfer send callback.
* @param[in] cbs LinphoneChatMessageCbs object.
* @return The current file transfer send callback.
*/
LINPHONE_PUBLIC LinphoneChatMessageCbsFileTransferSendCb linphone_chat_message_cbs_get_file_transfer_send(const LinphoneChatMessageCbs *cbs);
/**
* Set the file transfer send callback.
* @param[in] cbs LinphoneChatMessageCbs object.
* @param[in] cb The file transfer send callback to be used.
*/
LINPHONE_PUBLIC void linphone_chat_message_cbs_set_file_transfer_send(LinphoneChatMessageCbs *cbs, LinphoneChatMessageCbsFileTransferSendCb cb);
/**
* Get the file transfer progress indication callback.
* @param[in] cbs LinphoneChatMessageCbs object.
* @return The current file transfer progress indication callback.
*/
LINPHONE_PUBLIC LinphoneChatMessageCbsFileTransferProgressIndicationCb linphone_chat_message_cbs_get_file_transfer_progress_indication(const LinphoneChatMessageCbs *cbs);
/**
* Set the file transfer progress indication callback.
* @param[in] cbs LinphoneChatMessageCbs object.
* @param[in] cb The file transfer progress indication callback to be used.
*/
LINPHONE_PUBLIC void linphone_chat_message_cbs_set_file_transfer_progress_indication(LinphoneChatMessageCbs *cbs, LinphoneChatMessageCbsFileTransferProgressIndicationCb cb);
/** /**
* @} * @}
*/ */
......
...@@ -65,3 +65,41 @@ void * linphone_chat_message_cbs_get_user_data (const LinphoneChatMessageCbs *cb ...@@ -65,3 +65,41 @@ void * linphone_chat_message_cbs_get_user_data (const LinphoneChatMessageCbs *cb
void linphone_chat_message_cbs_set_user_data (LinphoneChatMessageCbs *cbs, void *ud) { void linphone_chat_message_cbs_set_user_data (LinphoneChatMessageCbs *cbs, void *ud) {
cbs->userData = ud; cbs->userData = ud;
} }
LinphoneChatMessageCbsMsgStateChangedCb
linphone_chat_message_cbs_get_msg_state_changed(const LinphoneChatMessageCbs *cbs) {
return cbs->msg_state_changed;
}
void linphone_chat_message_cbs_set_msg_state_changed(LinphoneChatMessageCbs *cbs,
LinphoneChatMessageCbsMsgStateChangedCb cb) {
cbs->msg_state_changed = cb;
}
LinphoneChatMessageCbsFileTransferRecvCb linphone_chat_message_cbs_get_file_transfer_recv(const LinphoneChatMessageCbs *cbs) {
return cbs->file_transfer_recv;
}
void linphone_chat_message_cbs_set_file_transfer_recv(LinphoneChatMessageCbs *cbs,
LinphoneChatMessageCbsFileTransferRecvCb cb) {
cbs->file_transfer_recv = cb;
}
LinphoneChatMessageCbsFileTransferSendCb linphone_chat_message_cbs_get_file_transfer_send(const LinphoneChatMessageCbs *cbs) {
return cbs->file_transfer_send;
}
void linphone_chat_message_cbs_set_file_transfer_send(LinphoneChatMessageCbs *cbs,
LinphoneChatMessageCbsFileTransferSendCb cb) {
cbs->file_transfer_send = cb;
}
LinphoneChatMessageCbsFileTransferProgressIndicationCb
linphone_chat_message_cbs_get_file_transfer_progress_indication(const LinphoneChatMessageCbs *cbs) {
return cbs->file_transfer_progress_indication;
}
void linphone_chat_message_cbs_set_file_transfer_progress_indication(
LinphoneChatMessageCbs *cbs, LinphoneChatMessageCbsFileTransferProgressIndicationCb cb) {
cbs->file_transfer_progress_indication = cb;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment