3 * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd. All Rights Reserved.
5 * This file is part of msg-service.
7 * Contact: Jaeyun Jeong <jyjeong@samsung.com>
8 * Sangkoo Kim <sangkoo.kim@samsung.com>
9 * Seunghwan Lee <sh.cat.lee@samsung.com>
10 * SoonMin Jung <sm0415.jung@samsung.com>
11 * Jae-Young Lee <jy4710.lee@samsung.com>
12 * KeeBum Kim <keebum.kim@samsung.com>
14 * PROPRIETARY/CONFIDENTIAL
16 * This software is the confidential and proprietary information of
17 * SAMSUNG ELECTRONICS ("Confidential Information"). You shall not
18 * disclose such Confidential Information and shall use it only in
19 * accordance with the terms of the license agreement you entered
20 * into with SAMSUNG ELECTRONICS.
22 * SAMSUNG make no representations or warranties about the suitability
23 * of the software, either express or implied, including but not limited
24 * to the implied warranties of merchantability, fitness for a particular
25 * purpose, or non-infringement. SAMSUNG shall not be liable for any
26 * damages suffered by licensee as a result of using, modifying or
27 * distributing this software or its derivatives.
32 * @file MapiTransport.h
33 * @brief Defines transport API of messaging framework
37 #ifndef MAPI_TRANSPORT_H
38 #define MAPI_TRANSPORT_H
41 * @section Introduction
42 * - Introduction : Overview on Messaging Transport API
44 * - Program : Messaging Transport API Reference
47 /*==================================================================================================
49 ==================================================================================================*/
51 #include "MsgTransportTypes.h"
59 * @ingroup MESSAGING_FRAMEWORK
60 * @defgroup MESSAGING_TRANSPORT_API Messaging Transport API
64 /*==================================================================================================
66 ==================================================================================================*/
71 * Submits a request to the Messaging Framework.
74 * This API is used to submit a request to the Messaging Framework.
76 * \par Typical use case:
77 * Submit a request to Messaging Service such as Send Message, Forward etc.
79 * \par Method of function operation:
80 * Sets up the database connection and inserts the message to message table.
82 * \par Sync (or) Async:
83 * This is a Synchronous API.
85 * \par Important notes:
86 * - The result information will be sent back by using the callback function, msg_sent_status_cb.
87 * - Applications MUST fill in the valid message type.
88 * - reqId will be filled in the framework.
90 * \param input - handle is Message handle.
91 * \param input - req is a pointer to an MSG_REQUEST_S structure.
93 * \return Return Type (int(MSG_ERROR_T)) \n
94 * - MSG_SUCCESS Success in operation.
95 * - MSG_ERR_INVALID_MSGHANDLE Message handle is invalid.
96 * - MSG_ERR_NULL_POINTER Pointer is NULL.
98 * \par Prospective clients:
99 * External/Native Apps using Messaging Services.
101 * \par Related functions:
104 * \par Known issues/bugs:
111 * int err = MSG_SUCCESS;
115 * req.sendOpt = sendOpt;
117 * err = msg_submit_req(msgHandle, &req);
118 * if (err != MSG_SUCCESS)
126 /*================================================================================================*/
127 int msg_submit_req(MSG_HANDLE_T handle, MSG_REQUEST_S *req);
133 * Registers sent status callback function to Message handle.
136 * This API is used to register sent status callback function "msg_sent_status_cb" to Message handle.
138 * \par Typical use case:
139 * Register for sent status callback.
141 * \par Method of function operation:
142 * Adds the msg_sent_status_cb API to sent status callback list.
144 * \par Sync (or) Async:
145 * This is a Synchronous API.
147 * \par Important notes:
148 * This function MUST be called after Message handle is opened.
150 * \param input - handle is Message handle.
151 * \param input - cb is a function to be called.
152 * \param input - user_param is a pointer to user data.
154 * \return Return Type (int(MSG_ERROR_T)) \n
155 * - MSG_SUCCESS Success in operation.
156 * - MSG_ERR_INVALID_MSGHANDLE Message handle is invalid.
158 * \par Prospective clients:
159 * External/Native Apps using Messaging Services.
161 * \par Related functions:
164 * \par Known issues/bugs:
171 * int err = MSG_SUCCESS;
175 * req.sendOpt = sendOpt;
177 * err = msg_reg_sent_status_callback(msgHandle, &sentStatusCB, (void*)"sent status callback");
178 * if (err != MSG_SUCCESS)
185 * void sentStatusCB(MSG_HANDLE_T Handle, MSG_SENT_STATUS_S *pStatus, void *pUserParam)
192 /*================================================================================================*/
193 int msg_reg_sent_status_callback(MSG_HANDLE_T handle, msg_sent_status_cb cb, void *user_param);
199 * Registers incoming SMS callback to Message handle.
202 * This API is used to Registers incoming SMS callback function "msg_sms_incoming_cb" to Message handle.
204 * \par Typical use case:
205 * Register incoming SMS message callback.
207 * \par Method of function operation:
208 * Adds the msg_sms_incoming_cb API to incoming SMS callback list.
210 * \par Sync (or) Async:
211 * This is a Synchronous API.
213 * \par Important notes:
214 * This function MUST be called after Message handle is opened.
216 * \param input - handle is Message handle.
217 * \param input - cb is a function to be called.
218 * \param input - port is used for listening. If port is not used, please assign 0 to it.
219 * \param input - user_param is a pointer to user data.
221 * \return Return Type (int(MSG_ERROR_T)) \n
222 * - MSG_SUCCESS Success in operation.
223 * - MSG_ERR_INVALID_MSGHANDLE Message handle is invalid.
225 * \par Prospective clients:
226 * External/Native Apps using Messaging Services.
228 * \par Related functions:
231 * \par Known issues/bugs:
238 * int err = MSG_SUCCESS;
242 * req.sendOpt = sendOpt;
244 * err = msg_reg_sms_message_callback(msgHandle, &incomingSmsCB, 0, (void*)"sms message callback");
245 * if (err != MSG_SUCCESS)
252 * void incomingSmsCB(MSG_HANDLE_T Handle, msg_message_t msg, void *pUserParam)
259 /*================================================================================================*/
260 int msg_reg_sms_message_callback(MSG_HANDLE_T handle, msg_sms_incoming_cb cb, unsigned short port, void *user_param);
266 * Registers incoming MMS callback to Message handle.
269 * This API is used to Registers incoming MMS callback function "msg_mms_conf_msg_incoming_cb" to Message handle.
271 * \par Typical use case:
272 * Register incoming SMS message callback.
274 * \par Method of function operation:
275 * Adds the msg_mms_conf_msg_incoming_cb API to incoming MMS callback list.
277 * \par Sync (or) Async:
278 * This is a Synchronous API.
280 * \par Important notes:
281 * This function MUST be called after Message handle is opened.
283 * \param input - handle is Message handle.
284 * \param input - handle is Message handle.
285 * \param input - cb is a function to be called.
286 * \param input - app_id is used for listening. If appId is not used, please assign NULL to it.
287 * \param input - user_param is a pointer to user data.
289 * \return Return Type (int(MSG_ERROR_T)) \n
290 * - MSG_SUCCESS Success in operation.
291 * - MSG_ERR_INVALID_MSGHANDLE Message handle is invalid.
293 * \par Prospective clients:
294 * External/Native Apps using Messaging Services.
296 * \par Related functions:
299 * \par Known issues/bugs:
306 * int err = MSG_SUCCESS;
310 * req.sendOpt = sendOpt;
312 * err = msg_reg_mms_conf_message_callback(msgHandle, &incomingMmsConfCB, NULL, NULL);
313 * if (err != MSG_SUCCESS)
320 * void incomingMmsConfCB(MSG_HANDLE_T Handle, msg_message_t msg, void *pUserParam)
327 /*================================================================================================*/
328 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);
334 * Registers incoming SyncML Message callback to Message handle.
337 * This API is used to Registers incoming SyncML Message callback function "msg_syncml_msg_incoming_cb" to Message handle.
339 * \par Typical use case:
340 * Register incoming SMS message callback.
342 * \par Method of function operation:
343 * Adds the msg_syncml_msg_incoming_cb API to incoming SyncML callback list.
345 * \par Sync (or) Async:
346 * This is a Synchronous API.
348 * \par Important notes:
349 * This function MUST be called after Message handle is opened.
351 * \param input - handle is Message handle.
352 * \param input - cb is a function to be called.
353 * \param input - user_param is a pointer to user data.
355 * \return Return Type (int(MSG_ERROR_T)) \n
356 * - MSG_SUCCESS Success in operation.
357 * - MSG_ERR_MSGHANDLE_NOT_CONNECTED Message handle is not connected.
358 * - MSG_ERR_MEMORY_ERROR Memory is error.
360 * \par Prospective clients:
361 * External/Native Apps using Messaging Services.
363 * \par Related functions:
366 * \par Known issues/bugs:
373 * int err = MSG_SUCCESS;
375 * err = err = msg_reg_syncml_message_callback(msgHandle, &syncMLCB, NULL);
376 * if (err != MSG_SUCCESS)
383 * void syncMLCB(MSG_HANDLE_T hMsgHandle, MSG_SYNCML_MESSAGE_TYPE_T msgType, const char* pPushHeader, int PushHeaderLen, const char* pPushBody, int PushBodyLen, void *pUserParam)
390 /*================================================================================================*/
391 int msg_reg_syncml_message_callback(MSG_HANDLE_T handle, msg_syncml_msg_incoming_cb cb, void *user_param);
397 * Registers incoming LBS Message callback to Message handle.
400 * This API is used to Registers incoming LBS Message callback function "msg_lbs_msg_incoming_cb" to Message handle.
402 * \par Typical use case:
403 * Register incoming SMS message callback.
405 * \par Method of function operation:
406 * Adds the msg_lbs_msg_incoming_cb API to incoming LBS Message callback list.
408 * \par Sync (or) Async:
409 * This is a Synchronous API.
411 * \par Important notes:
412 * This function MUST be called after Message handle is opened.
414 * \param input - handle is Message handle.
415 * \param input - cb is a function to be called.
416 * \param input - user_param is a pointer to user data.
418 * \return Return Type (int(MSG_ERROR_T)) \n
419 * - MSG_SUCCESS Success in operation.
420 * - MSG_ERR_MSGHANDLE_NOT_CONNECTED Message handle is not connected.
421 * - MSG_ERR_MEMORY_ERROR Memory is error.
423 * \par Prospective clients:
424 * External/Native Apps using Messaging Services.
426 * \par Related functions:
429 * \par Known issues/bugs:
436 * int err = MSG_SUCCESS;
438 * err = msg_reg_lbs_message_callback(msgHandle, &lbsCB, NULL);
439 * if (err != MSG_SUCCESS)
446 * void lbsCB(MSG_HANDLE_T hMsgHandle, const char* pPushHeader, const char* pPushBody, int pushBodyLen, void *pUserParam)
453 /*================================================================================================*/
454 int msg_reg_lbs_message_callback(MSG_HANDLE_T handle, msg_lbs_msg_incoming_cb cb, void *user_param);
460 * Registers incoming LBS Message callback to Message handle.
463 * This API is used to Registers incoming LBS Message callback function "msg_lbs_msg_incoming_cb" to Message handle.
465 * \par Typical use case:
466 * Register incoming SMS message callback.
468 * \par Method of function operation:
469 * Adds the msg_lbs_msg_incoming_cb API to incoming LBS Message callback list.
471 * \par Sync (or) Async:
472 * This is a Synchronous API.
474 * \par Important notes:
475 * This function MUST be called after Message handle is opened.
477 * \param input - handle is Message handle.
478 * \param input - cb is a function to be called.
479 * \param input - user_param is a pointer to user data.
481 * \return Return Type (int(MSG_ERROR_T)) \n
482 * - MSG_SUCCESS Success in operation.
483 * - MSG_ERR_MSGHANDLE_NOT_CONNECTED Message handle is not connected.
484 * - MSG_ERR_MEMORY_ERROR Memory is error.
486 * \par Prospective clients:
487 * External/Native Apps using Messaging Services.
489 * \par Related functions:
492 * \par Known issues/bugs:
499 * int err = MSG_SUCCESS;
501 * err = msg_reg_lbs_message_callback(msgHandle, &lbsCB, NULL);
502 * if (err != MSG_SUCCESS)
509 * void lbsCB(MSG_HANDLE_T hMsgHandle, const char* pPushHeader, const char* pPushBody, int pushBodyLen, void *pUserParam)
516 /*================================================================================================*/
517 int msg_reg_syncml_message_operation_callback(MSG_HANDLE_T handle, msg_syncml_msg_operation_cb cb, void *user_param);
523 * Registers incoming LBS Message callback to Message handle.
526 * This API is used to Registers incoming LBS Message callback function "msg_lbs_msg_incoming_cb" to Message handle.
528 * \par Typical use case:
529 * Register incoming SMS message callback.
531 * \par Method of function operation:
532 * Adds the msg_lbs_msg_incoming_cb API to incoming LBS Message callback list.
534 * \par Sync (or) Async:
535 * This is a Synchronous API.
537 * \par Important notes:
538 * This function MUST be called after Message handle is opened.
540 * \param input - handle is Message handle.
541 * \param input - cb is a function to be called.
542 * \param input - user_param is a pointer to user data.
544 * \return Return Type (int(MSG_ERROR_T)) \n
545 * - MSG_SUCCESS Success in operation.
546 * - MSG_ERR_MSGHANDLE_NOT_CONNECTED Message handle is not connected.
547 * - MSG_ERR_MEMORY_ERROR Memory is error.
549 * \par Prospective clients:
550 * External/Native Apps using Messaging Services.
552 * \par Related functions:
555 * \par Known issues/bugs:
562 * int err = MSG_SUCCESS;
564 * err = msg_reg_lbs_message_callback(msgHandle, &lbsCB, NULL);
565 * if (err != MSG_SUCCESS)
572 * void lbsCB(MSG_HANDLE_T hMsgHandle, const char* pPushHeader, const char* pPushBody, int pushBodyLen, void *pUserParam)
579 /*================================================================================================*/
580 int msg_syncml_message_operation(MSG_HANDLE_T handle, MSG_MESSAGE_ID_T msgId);
586 * Sends SMS. It is a synchronous API which has been blocked until sent status arrives.
589 * This API is used to sends SMS.
591 * \par Typical use case:
592 * Sends a SMS Message
594 * \par Method of function operation:
595 * It is a synchronous API which has been blocked until sent status arrives.
597 * \par Sync (or) Async:
598 * This is a Synchronous API.
600 * \par Important notes:
603 * \param input - phone_num is the list of phone numbers. It is separated by ",".
604 * \param input - sms_text is a SMS text.
605 * \param input - cb is a function to be called.
606 * \param input - user_param is for user data.
608 * \return Return Type (int(MSG_ERROR_T)) \n
609 * - MSG_SUCCESS Success in operation.
610 * - MSG_ERR_NULL_POINTER Invalid parameter.
611 * - MSG_ERR_MEMORY_ERROR Memory is error.
613 * \par Prospective clients:
614 * External/Native Apps using Messaging Services.
616 * \par Related functions:
619 * \par Known issues/bugs:
626 * int err = MSG_SUCCESS;
628 * err = msg_sms_send("01000000000,01000000000", "1234567890", sentStatusCB, NULL);
629 * if (err != MSG_SUCCESS)
637 /*================================================================================================*/
638 int msg_sms_send(const char *phone_num, const char *sms_text, msg_simple_sent_status_cb cb, void *user_param);
644 * Submits request to send SMS message.
647 * This API is used to submit request to send SMS message.
649 * \par Typical use case:
650 * Submits request to send SMS message.
652 * \par Method of function operation:
653 * Submits a request to send SMS.
655 * \par Sync (or) Async:
656 * This is a Synchronous API.
658 * \par Important notes:
661 * \param input - phone_num is the list of phone numbers. It is separated by ",".
662 * \param input - sms_text is a SMS text.
663 * \param input - cb is a function to be called.
664 * \param input - user_param is for user data.
666 * \return Return Type (int(MSG_ERROR_T)) \n
667 * - MSG_SUCCESS Success in operation.
668 * - MSG_ERR_NULL_POINTER Invalid parameter.
669 * - MSG_ERR_MEMORY_ERROR Memory is error.
671 * \par Prospective clients:
672 * External/Native Apps using Messaging Services.
674 * \par Related functions:
677 * \par Known issues/bugs:
684 * int err = MSG_SUCCESS;
688 * req.sendOpt = sendOpt;
690 * err = msg_sms_send_message(msgHandle, &req);
691 * if (err != MSG_SUCCESS)
699 /*================================================================================================*/
700 int msg_sms_send_message(MSG_HANDLE_T handle, MSG_REQUEST_S* req);
706 * Submits request to send MMS message.
709 * This API is used to submit request to send MMS message.
711 * \par Typical use case:
712 * Submits request to send MMS message.
714 * \par Method of function operation:
715 * Submits a request to send MMS.
717 * \par Sync (or) Async:
718 * This is a Synchronous API.
720 * \par Important notes:
723 * \param input - handle is Message handle.
724 * \param input - req is a pointer to an MSG_REQUEST_S structure.
726 * \return Return Type (int(MSG_ERROR_T)) \n
727 * - MSG_SUCCESS Success in operation.
728 * - MSG_ERR_NULL_POINTER Invalid parameter.
729 * - MSG_ERR_MEMORY_ERROR Memory is error.
731 * \par Prospective clients:
732 * External/Native Apps using Messaging Services.
734 * \par Related functions:
737 * \par Known issues/bugs:
744 * int err = MSG_SUCCESS;
748 * req.sendOpt = sendOpt;
750 * err = msg_mms_send_message(msgHandle, &req);
751 * if (err != MSG_SUCCESS)
759 /*================================================================================================*/
760 int msg_mms_send_message(MSG_HANDLE_T handle, MSG_REQUEST_S* req);
766 * Submits request to send MMS read report request.
769 * This API is used to submit request to send MMS read report request.
771 * \par Typical use case:
772 * Submits request to send MMS read report request.
774 * \par Method of function operation:
775 * Submits a request to send MMS read report request.
777 * \par Sync (or) Async:
778 * This is a Synchronous API.
780 * \par Important notes:
783 * \param input - handle is Message handle.
784 * \param input - msg_id is a message id, which is a positive integer.
785 * \param input - mms_read_status is status whether message was read or not.
787 * \return Return Type (int(MSG_ERROR_T)) \n
788 * - MSG_SUCCESS Success in operation.
789 * - MSG_ERR_NULL_POINTER Invalid parameter.
790 * - MSG_ERR_MEMORY_ERROR Memory is error.
792 * \par Prospective clients:
793 * External/Native Apps using Messaging Services.
795 * \par Related functions:
798 * \par Known issues/bugs:
805 * int err = MSG_SUCCESS;
807 * err = err = msg_mms_send_read_report(NULL, 0, MSG_READ_REPORT_IS_READ);
808 * if (err != MSG_SUCCESS)
816 /*================================================================================================*/
817 int msg_mms_send_read_report(MSG_HANDLE_T handle, MSG_MESSAGE_ID_T msgId, MSG_READ_REPORT_STATUS_T mms_read_status);
823 * Submits request to send forward MMS request.
826 * This API is used to submit request to send forward MMS request.
828 * \par Typical use case:
829 * Submits request to send forward MMS request.
831 * \par Method of function operation:
832 * Submits a request to send forward MMS request.
834 * \par Sync (or) Async:
835 * This is a Synchronous API.
837 * \par Important notes:
840 * \param input - handle is Message handle.
841 * \param input - req is a pointer to an MSG_REQUEST_S structure.
843 * \return Return Type (int(MSG_ERROR_T)) \n
844 * - MSG_SUCCESS Success in operation.
845 * - MSG_ERR_INVALID_MSGHANDLE Message handle is invalid.
846 * - MSG_ERR_NULL_POINTER Pointer is NULL.
848 * \par Prospective clients:
849 * External/Native Apps using Messaging Services.
851 * \par Related functions:
854 * \par Known issues/bugs:
861 * int err = MSG_SUCCESS;
863 * err = err = msg_mms_send_read_report(NULL, 0, MSG_READ_REPORT_IS_READ);
864 * if (err != MSG_SUCCESS)
872 /*================================================================================================*/
873 int msg_mms_forward_message(MSG_HANDLE_T handle, MSG_REQUEST_S* req);
879 * Submits request to retrieve MMS request.
882 * This API is used to submit request to retrieve MMS request.
884 * \par Typical use case:
885 * Submits request to retrieve MMS request.
887 * \par Method of function operation:
888 * Submits a request to send forward MMS request.
890 * \par Sync (or) Async:
891 * This is a Synchronous API.
893 * \par Important notes:
896 * \param input - handle is Message handle.
897 * \param input - req is a pointer to an MSG_REQUEST_S structure.
899 * \return Return Type (int(MSG_ERROR_T)) \n
900 * - MSG_SUCCESS Success in operation.
901 * - MSG_ERR_INVALID_MSGHANDLE Message handle is invalid.
902 * - MSG_ERR_NULL_POINTER Pointer is NULL.
904 * \par Prospective clients:
905 * External/Native Apps using Messaging Services.
907 * \par Related functions:
910 * \par Known issues/bugs:
917 * int err = MSG_SUCCESS;
919 * err = msg_mms_retrieve_message(handle, &req);
920 * if (err != MSG_SUCCESS)
928 /*================================================================================================*/
929 int msg_mms_retrieve_message(MSG_HANDLE_T handle, MSG_REQUEST_S* req);
932 /* reject_msg_support */
936 * Submits request to reject MMS message.
939 * This API is used to submit request to reject MMS message.
941 * \par Typical use case:
942 * Submits request to reject MMS message.
944 * \par Method of function operation:
945 * Submits a request to send forward reject MMS message.
947 * \par Sync (or) Async:
948 * This is a Synchronous API.
950 * \par Important notes:
953 * \param input - handle is Message handle.
954 * \param input - req is a pointer to an MSG_REQUEST_S structure.
956 * \return Return Type (int(MSG_ERROR_T)) \n
957 * - MSG_SUCCESS Success in operation.
958 * - MSG_ERR_INVALID_MSGHANDLE Message handle is invalid.
959 * - MSG_ERR_NULL_POINTER Pointer is NULL.
961 * \par Prospective clients:
962 * External/Native Apps using Messaging Services.
964 * \par Related functions:
967 * \par Known issues/bugs:
974 * int err = MSG_SUCCESS;
976 * err = msg_mms_reject_message(handle, &req);
977 * if (err != MSG_SUCCESS)
985 /*================================================================================================*/
986 int msg_mms_reject_message(MSG_HANDLE_T handle, MSG_REQUEST_S* req);
996 #endif // MAPI_TRANSPORT_H