2 * Copyright 2012-2013 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.1 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://floralicense.org/license/
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 * @file MapiTransport.h
19 * @brief Defines transport API of messaging framework
23 #ifndef MAPI_TRANSPORT_H
24 #define MAPI_TRANSPORT_H
27 * @section Introduction
28 * - Introduction : Overview on Messaging Transport API
30 * - Program : Messaging Transport API Reference
33 /*==================================================================================================
35 ==================================================================================================*/
37 #include "msg_transport_types.h"
45 * @ingroup MESSAGING_FRAMEWORK
46 * @defgroup MESSAGING_TRANSPORT_API Messaging Transport API
50 /*==================================================================================================
52 ==================================================================================================*/
57 * Submits a request to the Messaging Framework.
60 * This API is used to submit a request to the Messaging Framework.
62 * \par Typical use case:
63 * Submit a request to Messaging Service such as Send Message, Forward etc.
65 * \par Method of function operation:
66 * Sets up the database connection and inserts the message to message table.
68 * \par Sync (or) Async:
69 * This is a Synchronous API.
71 * \par Important notes:
72 * - The result information will be sent back by using the callback function, msg_sent_status_cb.
73 * - Applications MUST fill in the valid message type.
74 * - reqId will be filled in the framework.
76 * \param input - handle is Message handle.
77 * \param input - req is a pointer to an MSG_REQUEST_S structure.
79 * \return Return Type (int(msg_error_t)) \n
80 * - MSG_SUCCESS Success in operation.
81 * - MSG_ERR_INVALID_MSGHANDLE Message handle is invalid.
82 * - MSG_ERR_NULL_POINTER Pointer is NULL.
84 * \par Prospective clients:
85 * External/Native Apps using Messaging Services.
87 * \par Related functions:
90 * \par Known issues/bugs:
97 * int err = MSG_SUCCESS;
101 * req.sendOpt = sendOpt;
103 * err = msg_submit_req(msgHandle, &req);
104 * if (err != MSG_SUCCESS)
112 /*================================================================================================*/
113 int msg_submit_req(msg_handle_t handle, msg_struct_t req);
119 * Registers sent status callback function to Message handle.
122 * This API is used to register sent status callback function "msg_sent_status_cb" to Message handle.
124 * \par Typical use case:
125 * Register for sent status callback.
127 * \par Method of function operation:
128 * Adds the msg_sent_status_cb API to sent status callback list.
130 * \par Sync (or) Async:
131 * This is a Synchronous API.
133 * \par Important notes:
134 * This function MUST be called after Message handle is opened.
136 * \param input - handle is Message handle.
137 * \param input - cb is a function to be called.
138 * \param input - user_param is a pointer to user data.
140 * \return Return Type (int(msg_error_t)) \n
141 * - MSG_SUCCESS Success in operation.
142 * - MSG_ERR_INVALID_MSGHANDLE Message handle is invalid.
144 * \par Prospective clients:
145 * External/Native Apps using Messaging Services.
147 * \par Related functions:
150 * \par Known issues/bugs:
157 * int err = MSG_SUCCESS;
161 * req.sendOpt = sendOpt;
163 * err = msg_reg_sent_status_callback(msgHandle, &sentStatusCB, (void*)"sent status callback");
164 * if (err != MSG_SUCCESS)
171 * void sentStatusCB(msg_handle_t Handle, MSG_SENT_STATUS_S *pStatus, void *pUserParam)
178 /*================================================================================================*/
179 int msg_reg_sent_status_callback(msg_handle_t handle, msg_sent_status_cb cb, void *user_param);
185 * Registers incoming SMS callback to Message handle.
188 * This API is used to Registers incoming SMS callback function "msg_sms_incoming_cb" to Message handle.
190 * \par Typical use case:
191 * Register incoming SMS message callback.
193 * \par Method of function operation:
194 * Adds the msg_sms_incoming_cb API to incoming SMS callback list.
196 * \par Sync (or) Async:
197 * This is a Synchronous API.
199 * \par Important notes:
200 * This function MUST be called after Message handle is opened.
202 * \param input - handle is Message handle.
203 * \param input - cb is a function to be called.
204 * \param input - port is used for listening. If port is not used, please assign 0 to it.
205 * \param input - user_param is a pointer to user data.
207 * \return Return Type (int(msg_error_t)) \n
208 * - MSG_SUCCESS Success in operation.
209 * - MSG_ERR_INVALID_MSGHANDLE Message handle is invalid.
211 * \par Prospective clients:
212 * External/Native Apps using Messaging Services.
214 * \par Related functions:
217 * \par Known issues/bugs:
224 * int err = MSG_SUCCESS;
228 * req.sendOpt = sendOpt;
230 * err = msg_reg_sms_message_callback(msgHandle, &incomingSmsCB, 0, (void*)"sms message callback");
231 * if (err != MSG_SUCCESS)
238 * void incomingSmsCB(msg_handle_t Handle, msg_message_t msg, void *pUserParam)
245 /*================================================================================================*/
246 int msg_reg_sms_message_callback(msg_handle_t handle, msg_sms_incoming_cb cb, unsigned short port, void *user_param);
252 * Registers incoming MMS callback to Message handle.
255 * This API is used to Registers incoming MMS callback function "msg_mms_conf_msg_incoming_cb" to Message handle.
257 * \par Typical use case:
258 * Register incoming SMS message callback.
260 * \par Method of function operation:
261 * Adds the msg_mms_conf_msg_incoming_cb API to incoming MMS callback list.
263 * \par Sync (or) Async:
264 * This is a Synchronous API.
266 * \par Important notes:
267 * This function MUST be called after Message handle is opened.
269 * \param input - handle is Message handle.
270 * \param input - handle is Message handle.
271 * \param input - cb is a function to be called.
272 * \param input - app_id is used for listening. If appId is not used, please assign NULL to it.
273 * \param input - user_param is a pointer to user data.
275 * \return Return Type (int(msg_error_t)) \n
276 * - MSG_SUCCESS Success in operation.
277 * - MSG_ERR_INVALID_MSGHANDLE Message handle is invalid.
279 * \par Prospective clients:
280 * External/Native Apps using Messaging Services.
282 * \par Related functions:
285 * \par Known issues/bugs:
292 * int err = MSG_SUCCESS;
296 * req.sendOpt = sendOpt;
298 * err = msg_reg_mms_conf_message_callback(msgHandle, &incomingMmsConfCB, NULL, NULL);
299 * if (err != MSG_SUCCESS)
306 * void incomingMmsConfCB(msg_handle_t Handle, msg_message_t msg, void *pUserParam)
313 /*================================================================================================*/
314 int msg_reg_mms_conf_message_callback(msg_handle_t handle, msg_mms_conf_msg_incoming_cb cb, const char *app_id, void *user_param);
320 * Registers incoming SyncML Message callback to Message handle.
323 * This API is used to Registers incoming SyncML Message callback function "msg_syncml_msg_incoming_cb" to Message handle.
325 * \par Typical use case:
326 * Register incoming SMS message callback.
328 * \par Method of function operation:
329 * Adds the msg_syncml_msg_incoming_cb API to incoming SyncML callback list.
331 * \par Sync (or) Async:
332 * This is a Synchronous API.
334 * \par Important notes:
335 * This function MUST be called after Message handle is opened.
337 * \param input - handle is Message handle.
338 * \param input - cb is a function to be called.
339 * \param input - user_param is a pointer to user data.
341 * \return Return Type (int(msg_error_t)) \n
342 * - MSG_SUCCESS Success in operation.
343 * - MSG_ERR_MSGHANDLE_NOT_CONNECTED Message handle is not connected.
344 * - MSG_ERR_MEMORY_ERROR Memory is error.
346 * \par Prospective clients:
347 * External/Native Apps using Messaging Services.
349 * \par Related functions:
352 * \par Known issues/bugs:
359 * int err = MSG_SUCCESS;
361 * err = err = msg_reg_syncml_message_callback(msgHandle, &syncMLCB, NULL);
362 * if (err != MSG_SUCCESS)
369 * void syncMLCB(msg_handle_t hMsgHandle, msg_syncml_message_type_t msgType, const char* pPushHeader, int PushHeaderLen, const char* pPushBody, int PushBodyLen, void *pUserParam)
376 /*================================================================================================*/
377 int msg_reg_syncml_message_callback(msg_handle_t handle, msg_syncml_msg_incoming_cb cb, void *user_param);
383 * Registers incoming LBS Message callback to Message handle.
386 * This API is used to Registers incoming LBS Message callback function "msg_lbs_msg_incoming_cb" to Message handle.
388 * \par Typical use case:
389 * Register incoming SMS message callback.
391 * \par Method of function operation:
392 * Adds the msg_lbs_msg_incoming_cb API to incoming LBS Message callback list.
394 * \par Sync (or) Async:
395 * This is a Synchronous API.
397 * \par Important notes:
398 * This function MUST be called after Message handle is opened.
400 * \param input - handle is Message handle.
401 * \param input - cb is a function to be called.
402 * \param input - user_param is a pointer to user data.
404 * \return Return Type (int(msg_error_t)) \n
405 * - MSG_SUCCESS Success in operation.
406 * - MSG_ERR_MSGHANDLE_NOT_CONNECTED Message handle is not connected.
407 * - MSG_ERR_MEMORY_ERROR Memory is error.
409 * \par Prospective clients:
410 * External/Native Apps using Messaging Services.
412 * \par Related functions:
415 * \par Known issues/bugs:
422 * int err = MSG_SUCCESS;
424 * err = msg_reg_lbs_message_callback(msgHandle, &lbsCB, NULL);
425 * if (err != MSG_SUCCESS)
432 * void lbsCB(msg_handle_t hMsgHandle, const char* pPushHeader, const char* pPushBody, int pushBodyLen, void *pUserParam)
439 /*================================================================================================*/
440 int msg_reg_lbs_message_callback(msg_handle_t handle, msg_lbs_msg_incoming_cb cb, void *user_param);
446 * Registers incoming LBS Message callback to Message handle.
449 * This API is used to Registers incoming LBS Message callback function "msg_lbs_msg_incoming_cb" to Message handle.
451 * \par Typical use case:
452 * Register incoming SMS message callback.
454 * \par Method of function operation:
455 * Adds the msg_lbs_msg_incoming_cb API to incoming LBS Message callback list.
457 * \par Sync (or) Async:
458 * This is a Synchronous API.
460 * \par Important notes:
461 * This function MUST be called after Message handle is opened.
463 * \param input - handle is Message handle.
464 * \param input - cb is a function to be called.
465 * \param input - user_param is a pointer to user data.
467 * \return Return Type (int(msg_error_t)) \n
468 * - MSG_SUCCESS Success in operation.
469 * - MSG_ERR_MSGHANDLE_NOT_CONNECTED Message handle is not connected.
470 * - MSG_ERR_MEMORY_ERROR Memory is error.
472 * \par Prospective clients:
473 * External/Native Apps using Messaging Services.
475 * \par Related functions:
478 * \par Known issues/bugs:
485 * int err = MSG_SUCCESS;
487 * err = msg_reg_lbs_message_callback(msgHandle, &lbsCB, NULL);
488 * if (err != MSG_SUCCESS)
495 * void lbsCB(msg_handle_t hMsgHandle, const char* pPushHeader, const char* pPushBody, int pushBodyLen, void *pUserParam)
502 /*================================================================================================*/
503 int msg_reg_syncml_message_operation_callback(msg_handle_t handle, msg_syncml_msg_operation_cb cb, void *user_param);
506 int msg_reg_push_message_callback(msg_handle_t handle, msg_push_msg_incoming_cb cb, const char *app_id, void *user_param);
508 int msg_reg_cb_message_callback(msg_handle_t handle, msg_cb_incoming_cb cb, bool bsave, void *user_param);
513 * Registers incoming LBS Message callback to Message handle.
516 * This API is used to Registers incoming LBS Message callback function "msg_lbs_msg_incoming_cb" to Message handle.
518 * \par Typical use case:
519 * Register incoming SMS message callback.
521 * \par Method of function operation:
522 * Adds the msg_lbs_msg_incoming_cb API to incoming LBS Message callback list.
524 * \par Sync (or) Async:
525 * This is a Synchronous API.
527 * \par Important notes:
528 * This function MUST be called after Message handle is opened.
530 * \param input - handle is Message handle.
531 * \param input - cb is a function to be called.
532 * \param input - user_param is a pointer to user data.
534 * \return Return Type (int(msg_error_t)) \n
535 * - MSG_SUCCESS Success in operation.
536 * - MSG_ERR_MSGHANDLE_NOT_CONNECTED Message handle is not connected.
537 * - MSG_ERR_MEMORY_ERROR Memory is error.
539 * \par Prospective clients:
540 * External/Native Apps using Messaging Services.
542 * \par Related functions:
545 * \par Known issues/bugs:
552 * int err = MSG_SUCCESS;
554 * err = msg_reg_lbs_message_callback(msgHandle, &lbsCB, NULL);
555 * if (err != MSG_SUCCESS)
562 * void lbsCB(msg_handle_t hMsgHandle, const char* pPushHeader, const char* pPushBody, int pushBodyLen, void *pUserParam)
569 /*================================================================================================*/
570 int msg_syncml_message_operation(msg_handle_t handle, msg_message_id_t msgId);
576 * Sends SMS. It is a synchronous API which has been blocked until sent status arrives.
579 * This API is used to sends SMS.
581 * \par Typical use case:
582 * Sends a SMS Message
584 * \par Method of function operation:
585 * It is a synchronous API which has been blocked until sent status arrives.
587 * \par Sync (or) Async:
588 * This is a Synchronous API.
590 * \par Important notes:
593 * \param input - phone_num is the list of phone numbers. It is separated by ",".
594 * \param input - sms_text is a SMS text.
595 * \param input - cb is a function to be called.
596 * \param input - user_param is for user data.
598 * \return Return Type (int(msg_error_t)) \n
599 * - MSG_SUCCESS Success in operation.
600 * - MSG_ERR_NULL_POINTER Invalid parameter.
601 * - MSG_ERR_MEMORY_ERROR Memory is error.
603 * \par Prospective clients:
604 * External/Native Apps using Messaging Services.
606 * \par Related functions:
609 * \par Known issues/bugs:
616 * int err = MSG_SUCCESS;
618 * err = msg_sms_send("01000000000,01000000000", "1234567890", sentStatusCB, NULL);
619 * if (err != MSG_SUCCESS)
627 /*================================================================================================*/
628 int msg_sms_send(const char *phone_num, const char *sms_text, msg_simple_sent_status_cb cb, void *user_param);
634 * Submits request to send SMS message.
637 * This API is used to submit request to send SMS message.
639 * \par Typical use case:
640 * Submits request to send SMS message.
642 * \par Method of function operation:
643 * Submits a request to send SMS.
645 * \par Sync (or) Async:
646 * This is a Synchronous API.
648 * \par Important notes:
651 * \param input - phone_num is the list of phone numbers. It is separated by ",".
652 * \param input - sms_text is a SMS text.
653 * \param input - cb is a function to be called.
654 * \param input - user_param is for user data.
656 * \return Return Type (int(msg_error_t)) \n
657 * - MSG_SUCCESS Success in operation.
658 * - MSG_ERR_NULL_POINTER Invalid parameter.
659 * - MSG_ERR_MEMORY_ERROR Memory is error.
661 * \par Prospective clients:
662 * External/Native Apps using Messaging Services.
664 * \par Related functions:
667 * \par Known issues/bugs:
674 * int err = MSG_SUCCESS;
678 * req.sendOpt = sendOpt;
680 * err = msg_sms_send_message(msgHandle, &req);
681 * if (err != MSG_SUCCESS)
689 /*================================================================================================*/
690 int msg_sms_send_message(msg_handle_t handle, msg_struct_t req);
696 * Submits request to send MMS message.
699 * This API is used to submit request to send MMS message.
701 * \par Typical use case:
702 * Submits request to send MMS message.
704 * \par Method of function operation:
705 * Submits a request to send MMS.
707 * \par Sync (or) Async:
708 * This is a Synchronous API.
710 * \par Important notes:
713 * \param input - handle is Message handle.
714 * \param input - req is a pointer to an MSG_REQUEST_S structure.
716 * \return Return Type (int(msg_error_t)) \n
717 * - MSG_SUCCESS Success in operation.
718 * - MSG_ERR_NULL_POINTER Invalid parameter.
719 * - MSG_ERR_MEMORY_ERROR Memory is error.
721 * \par Prospective clients:
722 * External/Native Apps using Messaging Services.
724 * \par Related functions:
727 * \par Known issues/bugs:
734 * int err = MSG_SUCCESS;
738 * req.sendOpt = sendOpt;
740 * err = msg_mms_send_message(msgHandle, &req);
741 * if (err != MSG_SUCCESS)
749 /*================================================================================================*/
750 int msg_mms_send_message(msg_handle_t handle, msg_struct_t req);
756 * Submits request to send MMS read report request.
759 * This API is used to submit request to send MMS read report request.
761 * \par Typical use case:
762 * Submits request to send MMS read report request.
764 * \par Method of function operation:
765 * Submits a request to send MMS read report request.
767 * \par Sync (or) Async:
768 * This is a Synchronous API.
770 * \par Important notes:
773 * \param input - handle is Message handle.
774 * \param input - msg_id is a message id, which is a positive integer.
775 * \param input - mms_read_status is status whether message was read or not.
777 * \return Return Type (int(msg_error_t)) \n
778 * - MSG_SUCCESS Success in operation.
779 * - MSG_ERR_NULL_POINTER Invalid parameter.
780 * - MSG_ERR_MEMORY_ERROR Memory is error.
782 * \par Prospective clients:
783 * External/Native Apps using Messaging Services.
785 * \par Related functions:
788 * \par Known issues/bugs:
795 * int err = MSG_SUCCESS;
797 * err = err = msg_mms_send_read_report(NULL, 0, MSG_READ_REPORT_IS_READ);
798 * if (err != MSG_SUCCESS)
806 /*================================================================================================*/
807 int msg_mms_send_read_report(msg_handle_t handle, msg_message_id_t msgId, msg_read_report_status_t mms_read_status);
813 * Submits request to send forward MMS request.
816 * This API is used to submit request to send forward MMS request.
818 * \par Typical use case:
819 * Submits request to send forward MMS request.
821 * \par Method of function operation:
822 * Submits a request to send forward MMS request.
824 * \par Sync (or) Async:
825 * This is a Synchronous API.
827 * \par Important notes:
830 * \param input - handle is Message handle.
831 * \param input - req is a pointer to an MSG_REQUEST_S structure.
833 * \return Return Type (int(msg_error_t)) \n
834 * - MSG_SUCCESS Success in operation.
835 * - MSG_ERR_INVALID_MSGHANDLE Message handle is invalid.
836 * - MSG_ERR_NULL_POINTER Pointer is NULL.
838 * \par Prospective clients:
839 * External/Native Apps using Messaging Services.
841 * \par Related functions:
844 * \par Known issues/bugs:
851 * int err = MSG_SUCCESS;
853 * err = err = msg_mms_send_read_report(NULL, 0, MSG_READ_REPORT_IS_READ);
854 * if (err != MSG_SUCCESS)
862 /*================================================================================================*/
863 int msg_mms_forward_message(msg_handle_t handle, msg_struct_t req);
869 * Submits request to retrieve MMS request.
872 * This API is used to submit request to retrieve MMS request.
874 * \par Typical use case:
875 * Submits request to retrieve MMS request.
877 * \par Method of function operation:
878 * Submits a request to send forward MMS request.
880 * \par Sync (or) Async:
881 * This is a Synchronous API.
883 * \par Important notes:
886 * \param input - handle is Message handle.
887 * \param input - req is a pointer to an MSG_REQUEST_S structure.
889 * \return Return Type (int(msg_error_t)) \n
890 * - MSG_SUCCESS Success in operation.
891 * - MSG_ERR_INVALID_MSGHANDLE Message handle is invalid.
892 * - MSG_ERR_NULL_POINTER Pointer is NULL.
894 * \par Prospective clients:
895 * External/Native Apps using Messaging Services.
897 * \par Related functions:
900 * \par Known issues/bugs:
907 * int err = MSG_SUCCESS;
909 * err = msg_mms_retrieve_message(handle, &req);
910 * if (err != MSG_SUCCESS)
918 /*================================================================================================*/
919 int msg_mms_retrieve_message(msg_handle_t handle, msg_struct_t req);
922 /* reject_msg_support */
926 * Submits request to reject MMS message.
929 * This API is used to submit request to reject MMS message.
931 * \par Typical use case:
932 * Submits request to reject MMS message.
934 * \par Method of function operation:
935 * Submits a request to send forward reject MMS message.
937 * \par Sync (or) Async:
938 * This is a Synchronous API.
940 * \par Important notes:
943 * \param input - handle is Message handle.
944 * \param input - req is a pointer to an MSG_REQUEST_S structure.
946 * \return Return Type (int(msg_error_t)) \n
947 * - MSG_SUCCESS Success in operation.
948 * - MSG_ERR_INVALID_MSGHANDLE Message handle is invalid.
949 * - MSG_ERR_NULL_POINTER Pointer is NULL.
951 * \par Prospective clients:
952 * External/Native Apps using Messaging Services.
954 * \par Related functions:
957 * \par Known issues/bugs:
964 * int err = MSG_SUCCESS;
966 * err = msg_mms_reject_message(handle, &req);
967 * if (err != MSG_SUCCESS)
975 /*================================================================================================*/
976 int msg_mms_reject_message(msg_handle_t handle, msg_struct_t req);
986 #endif // MAPI_TRANSPORT_H