2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (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://www.apache.org/licenses/LICENSE-2.0
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.
17 #ifndef __TIZEN_MESSAGING_H__
18 #define __TIZEN_MESSAGING_H__
22 #include <messages_types.h>
23 #include <messages_error.h>
32 * @brief This file contains the messages API.
37 * @addtogroup CAPI_MESSAGING_MESSAGES_MODULE
43 * @brief Opens a handle for the messaging service.
45 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
47 * @privilege %http://tizen.org/privilege/message.read
49 * @remarks You must release @a service using messages_close_service().
51 * @param[out] service The message service handle
53 * @return @c 0 on success,
54 * otherwise a negative error value
56 * @retval #MESSAGES_ERROR_NONE Successful
57 * @retval #MESSAGES_ERROR_INVALID_PARAMETER Invalid parameter
58 * @retval #MESSAGES_ERROR_SERVER_NOT_READY Server is not read
59 * @retval #MESSAGES_ERROR_COMMUNICATION_WITH_SERVER_FAILED Communication with server failed
60 * @retval #MESSAGES_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
61 * @retval #MESSAGES_ERROR_NOT_SUPPORTED Not supported
63 * @see messages_close_service()
65 int messages_open_service(messages_service_h *service);
69 * @brief Closes a handle for the messaging service.
71 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
73 * @privilege %http://tizen.org/privilege/message.read
75 * @param[in] service The message service handle
77 * @return @c 0 on success,
78 * otherwise a negative error value
80 * @retval #MESSAGES_ERROR_NONE Successful
81 * @retval #MESSAGES_ERROR_INVALID_PARAMETER Invalid parameter
82 * @retval #MESSAGES_ERROR_COMMUNICATION_WITH_SERVER_FAILED Communication with server failed
83 * @retval #MESSAGES_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
84 * @retval #MESSAGES_ERROR_NOT_SUPPORTED Not supported
86 * @see messages_open_service()
88 int messages_close_service(messages_service_h service);
92 * @brief Creates a message handle.
94 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
96 * @remarks You must release @a msg using messages_destroy_message().
98 * @param[in] type The message type (#MESSAGES_TYPE_SMS or #MESSAGES_TYPE_MMS) \n
99 * If @a type is #MESSAGES_TYPE_UNKNOWN, #MESSAGES_ERROR_INVALID_PARAMETER occurs.
100 * @param[out] msg The message handle that is newly created if successful
102 * @return @c 0 on success,
103 * otherwise a negative error value
105 * @retval #MESSAGES_ERROR_NONE Successful
106 * @retval #MESSAGES_ERROR_INVALID_PARAMETER Invalid parameter
107 * @retval #MESSAGES_ERROR_OUT_OF_MEMORY Out of memory
108 * @retval #MESSAGES_ERROR_NOT_SUPPORTED Not supported
110 * @see messages_destroy_message()
112 int messages_create_message(messages_message_type_e type, messages_message_h *msg);
116 * @brief Destroys a message handle and releases all its resources.
118 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
120 * @param[in] msg The message handle to destroy
122 * @return @c 0 on success,
123 * otherwise a negative error value
125 * @retval #MESSAGES_ERROR_NONE Successful
126 * @retval #MESSAGES_ERROR_INVALID_PARAMETER Invalid parameter
127 * @retval #MESSAGES_ERROR_NOT_SUPPORTED Not supported
129 * @see messages_create_message()
131 int messages_destroy_message(messages_message_h msg);
134 * @brief Gets the message ID of the message.
136 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
138 * @param[in] msg The message handle
139 * @param[out] msg_id The message ID
141 * @return @c 0 on success,
142 * otherwise a negative error value
144 * @retval #MESSAGES_ERROR_NONE Successful
145 * @retval #MESSAGES_ERROR_INVALID_PARAMETER Invalid parameter
146 * @retval #MESSAGES_ERROR_OPERATION_FAILED Messaging operation failed
147 * @retval #MESSAGES_ERROR_NOT_SUPPORTED Not supported
149 * @see messages_search_message_by_id()
151 int messages_get_message_id(messages_message_h msg, int *msg_id);
155 * @brief Sets the SIM ID of the sending message.
157 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
159 * @param[in] msg The message handle
160 * @param[in] sim_id The SIM id to send message
162 * @return @c 0 on success,
163 * otherwise a negative error value
165 * @retval #MESSAGES_ERROR_NONE Successful
166 * @retval #MESSAGES_ERROR_INVALID_PARAMETER Invalid parameter
167 * @retval #MESSAGES_ERROR_OPERATION_FAILED Messaging operation failed
168 * @retval #MESSAGES_ERROR_NOT_SUPPORTED Not supported
170 * @see messages_get_sim_id()
172 int messages_set_sim_id(messages_message_h msg, int sim_id);
176 * @brief Gets the SIM ID of the message.
178 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
180 * @param[in] msg The message handle
181 * @param[out] sim_id The SIM id of message
183 * @return @c 0 on success,
184 * otherwise a negative error value
186 * @retval #MESSAGES_ERROR_NONE Successful
187 * @retval #MESSAGES_ERROR_INVALID_PARAMETER Invalid parameter
188 * @retval #MESSAGES_ERROR_OPERATION_FAILED Messaging operation failed
189 * @retval #MESSAGES_ERROR_NOT_SUPPORTED Not supported
191 * @see messages_set_sim_id()
193 int messages_get_sim_id(messages_message_h msg, int *sim_id);
197 * @brief Gets the message box type of the message.
199 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
201 * @param[in] msg The message handle
202 * @param[out] mbox The message box type
204 * @return @c 0 on success,
205 * otherwise a negative error value
207 * @retval #MESSAGES_ERROR_NONE Successful
208 * @retval #MESSAGES_ERROR_INVALID_PARAMETER Invalid parameter
209 * @retval #MESSAGES_ERROR_NOT_SUPPORTED Not supported
211 int messages_get_mbox_type(messages_message_h msg, messages_message_box_e *mbox);
214 * @brief Gets the destination port of the message.
216 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
218 * @param[in] msg The message handle
219 * @param[out] port The destination port of the message
221 * @return @c 0 on success,
222 * otherwise a negative error value
224 * @retval #MESSAGES_ERROR_NONE Successful
225 * @retval #MESSAGES_ERROR_INVALID_PARAMETER Invalid parameter
226 * @retval #MESSAGES_ERROR_NOT_SUPPORTED Not supported
228 * @see messages_add_sms_listening_port()
230 int messages_get_message_port(messages_message_h msg, int *port);
233 * @brief Gets the type of the message.
235 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
237 * @param[in] msg The message handle
238 * @param[out] type The message type
240 * @return @c 0 on success,
241 * otherwise a negative error value
243 * @retval #MESSAGES_ERROR_NONE Successful
244 * @retval #MESSAGES_ERROR_INVALID_PARAMETER Invalid parameter
245 * @retval #MESSAGES_ERROR_NOT_SUPPORTED Not supported
247 int messages_get_message_type(messages_message_h msg, messages_message_type_e *type);
251 * @brief Adds an recipient's address(phone number) to the message.
252 * @details The maximum number of recipients per a message is 10.
254 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
256 * @param[in] msg The message handle
257 * @param[in] address The recipient's address to receive a message \n
258 * The maximum length of @a address is @c 254.
259 * @param[in] type The recipient's type of the @a address
261 * @return @c 0 on success,
262 * otherwise a negative error value
264 * @retval #MESSAGES_ERROR_NONE Successful
265 * @retval #MESSAGES_ERROR_INVALID_PARAMETER Invalid parameter
266 * @retval #MESSAGES_ERROR_NOT_SUPPORTED Not supported
268 * @see messages_get_address()
269 * @see messages_remove_all_addresses()
271 int messages_add_address(messages_message_h msg, const char *address, messages_recipient_type_e type);
275 * @brief Gets the total number of recipients in the message.
277 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
279 * @param[in] msg The message handle
280 * @param[out] count The total number of recipients
282 * @return @c 0 on success,
283 * otherwise a negative error value
285 * @retval #MESSAGES_ERROR_NONE Successful
286 * @retval #MESSAGES_ERROR_INVALID_PARAMETER Invalid parameter
287 * @retval #MESSAGES_ERROR_NOT_SUPPORTED Not supported
289 * @see messages_add_address()
290 * @see messages_remove_all_addresses()
292 int messages_get_address_count(messages_message_h msg, int *count);
296 * @brief Gets a recipient's address with specified index.
298 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
300 * @remarks You must release @a address using free().
302 * @param[in] msg The message handle
303 * @param[in] index The zero-based index of an address to receive a message.
304 * @param[out] address The recipient's address with specified index
305 * @param[out] type The recipient's type of the @a address
307 * @return @c 0 on success,
308 * otherwise a negative error value
310 * @retval #MESSAGES_ERROR_NONE Successful
311 * @retval #MESSAGES_ERROR_INVALID_PARAMETER Invalid parameter
312 * @retval #MESSAGES_ERROR_OUT_OF_MEMORY Out of memory
313 * @retval #MESSAGES_ERROR_NOT_SUPPORTED Not supported
315 * @see messages_add_address()
316 * @see messages_remove_all_addresses()
318 int messages_get_address(messages_message_h msg, int index, char **address, messages_recipient_type_e *type);
322 * @brief Removes all recipients in the message.
324 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
326 * @param[in] msg The message handle
328 * @return @c 0 on success,
329 * otherwise a negative error value
331 * @retval #MESSAGES_ERROR_NONE Successful
332 * @retval #MESSAGES_ERROR_INVALID_PARAMETER Invalid parameter
333 * @retval #MESSAGES_ERROR_NOT_SUPPORTED Not supported
335 * @see messages_add_address()
336 * @see messages_get_address()
338 int messages_remove_all_addresses(messages_message_h msg);
342 * @brief Sets the text of the message.
344 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
346 * @param[in] msg The message handle
347 * @param[in] text The text of the message \n
348 * The maximum length of @a text is @c 1530.
350 * @return @c 0 on success,
351 * otherwise a negative error value
353 * @retval #MESSAGES_ERROR_NONE Successful
354 * @retval #MESSAGES_ERROR_INVALID_PARAMETER Invalid parameter
355 * @retval #MESSAGES_ERROR_OUT_OF_MEMORY Out of memory
356 * @retval #MESSAGES_ERROR_NOT_SUPPORTED Not supported
358 * @see messages_get_text()
360 int messages_set_text(messages_message_h msg, const char *text);
364 * @brief Gets the text of the message.
366 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
368 * @remarks You must release @a text using free().
370 * @param[in] msg The message handle
371 * @param[out] text The text of the message
373 * @return @c 0 on success,
374 * otherwise a negative error value
376 * @retval #MESSAGES_ERROR_NONE Successful
377 * @retval #MESSAGES_ERROR_INVALID_PARAMETER Invalid parameter
378 * @retval #MESSAGES_ERROR_OUT_OF_MEMORY Out of memory
379 * @retval #MESSAGES_ERROR_NOT_SUPPORTED Not supported
381 * @see messages_set_text()
383 int messages_get_text(messages_message_h msg, char **text);
387 * @brief Gets the time of the message.
389 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
391 * @param[in] msg The message handle
392 * @param[out] time The time of the message
394 * @return @c 0 on success,
395 * otherwise a negative error value
397 * @retval #MESSAGES_ERROR_NONE Successful
398 * @retval #MESSAGES_ERROR_INVALID_PARAMETER Invalid parameter
399 * @retval #MESSAGES_ERROR_NOT_SUPPORTED Not supported
401 int messages_get_time(messages_message_h msg, time_t *time);
404 * @brief Sends the message to all recipients.
406 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
408 * @privilege %http://tizen.org/privilege/message.write
410 * @param[in] service The message service handle
411 * @param[in] msg The message handle
412 * @param[in] save_to_sentbox Set to @c true to save the message in the sentbox,
413 * otherwise set to @c false to not save the message in the sentbox
414 * @param[in] callback The callback function
415 * @param[in] user_data The user data to be passed to the callback function
417 * @return @c 0 on success,
418 * otherwise a negative error value
420 * @retval #MESSAGES_ERROR_NONE Successful
421 * @retval #MESSAGES_ERROR_INVALID_PARAMETER Invalid parameter
422 * @retval #MESSAGES_ERROR_SENDING_FAILED Sending a message failed
423 * @retval #MESSAGES_ERROR_OPERATION_FAILED Messaging operation failed
424 * @retval #MESSAGES_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
425 * @retval #MESSAGES_ERROR_NOT_SUPPORTED Not supported
427 * @see messages_sent_cb()
429 int messages_send_message(messages_service_h service, messages_message_h msg, bool save_to_sentbox, messages_sent_cb callback, void *user_data);
432 * @brief Gets the message count in the specific message box.
433 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
436 * @privilege %http://tizen.org/privilege/message.read
438 * @param[in] service The message service handle
439 * @param[in] mbox The message box type
440 * @param[in] type The message type \n
441 * If @a type is #MESSAGES_TYPE_UNKNOWN, all SMS and MMS messages are counted.
442 * @param[out] count The number of messages
444 * @return @c 0 on success,
445 * otherwise a negative error value
447 * @retval #MESSAGES_ERROR_NONE Successful
448 * @retval #MESSAGES_ERROR_INVALID_PARAMETER Invalid parameter
449 * @retval #MESSAGES_ERROR_OPERATION_FAILED Messaging operation failed
450 * @retval #MESSAGES_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
451 * @retval #MESSAGES_ERROR_NOT_SUPPORTED Not supported
454 int messages_get_message_count(messages_service_h service,
455 messages_message_box_e mbox, messages_message_type_e type,
461 * @brief Searches for messages.
463 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
465 * @privilege %http://tizen.org/privilege/message.read
467 * @remarks You must release @a message_array using messages_free_message_array().
469 * @param[in] service The message service handle
470 * @param[in] mbox The message box type
471 * @param[in] type The message type \n
472 * If @a type is #MESSAGES_TYPE_UNKNOWN, all SMS and MMS messages are searched.
473 * @param[in] keyword The keyword search in the text and subject
474 * @param[in] address The recipient address
475 * @param[in] offset The start position (base @c 0)
476 * @param[in] limit The maximum amount of messages to get \n
477 * In case of @c 0, this method passes to the callback all searched messages.
478 * @param[out] message_array The array of the message handle
479 * @param[out] length The number of messages of the @a message_array
480 * @param[out] total The count of the messages that have been retrieved as a result without applying @a limit and @a offset\ n
481 * The value can be used to calculate the total number of page views for the searched messages\ n
482 * For example, if the count of message search is @c 50 and the limit is @c 20, then using this value, you can notice the total page is @c 3.
484 * @return @c 0 on success,
485 * otherwise a negative error value
487 * @retval #MESSAGES_ERROR_NONE Successful
488 * @retval #MESSAGES_ERROR_INVALID_PARAMETER Invalid parameter
489 * @retval #MESSAGES_ERROR_OUT_OF_MEMORY Out of memory
490 * @retval #MESSAGES_ERROR_OPERATION_FAILED Messaging operation failed
491 * @retval #MESSAGES_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
492 * @retval #MESSAGES_ERROR_NOT_SUPPORTED Not supported
494 * @see messages_free_message_array()
496 int messages_search_message(messages_service_h service,
497 messages_message_box_e mbox,
498 messages_message_type_e type,
499 const char *keyword, const char *address,
500 int offset, int limit,
501 messages_message_h **message_array, int *length, int *total);
504 * @brief Searches a message with the given message ID.
506 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
508 * @privilege %http://tizen.org/privilege/message.read
510 * @remarks You must release @a msg using messages_destroy_message().
512 * @param[in] service The message service handle
513 * @param[in] msg_id The message ID
514 * @param[out] msg The message handle that is newly created if successful
516 * @return @c 0 on success,
517 * otherwise a negative error value
519 * @retval #MESSAGES_ERROR_NONE Successful
520 * @retval #MESSAGES_ERROR_INVALID_PARAMETER Invalid parameter
521 * @retval #MESSAGES_ERROR_OUT_OF_MEMORY Out of memory
522 * @retval #MESSAGES_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
523 * @retval #MESSAGES_ERROR_NOT_SUPPORTED Not supported
525 * @see messages_get_message_id()
527 int messages_search_message_by_id(messages_service_h service, int msg_id, messages_message_h *msg);
531 * @brief Frees the message array.
533 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
535 * @param[in] message_array The array of the message handle
537 * @return @c 0 on success,
538 * otherwise a negative error value
540 * @retval #MESSAGES_ERROR_NONE Successful
541 * @retval #MESSAGES_ERROR_INVALID_PARAMETER Invalid parameter
542 * @retval #MESSAGES_ERROR_NOT_SUPPORTED Not supported
544 * @see messages_search_message()
546 int messages_free_message_array(messages_message_h *message_array);
550 * @brief Retrieves the searched messages by invoking the given callback function iteratively.
552 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
554 * @privilege %http://tizen.org/privilege/message.read
556 * @param[in] service The message service handle
557 * @param[in] mbox The message box type
558 * @param[in] type The message type \n
559 * If @a type is #MESSAGES_TYPE_UNKNOWN, all SMS and MMS messages are searched.
560 * @param[in] keyword The keyword search in the text and subject
561 * @param[in] address The recipient address
562 * @param[in] offset The start position (base 0)
563 * @param[in] limit The maximum amount of messages to get \n
564 * In case of @c 0, this method passes to the callback all searched messages.
565 * @param[in] callback The callback function to get a message
566 * @param[in] user_data The user data to be passed to the callback function
568 * @return @c 0 on success,
569 * otherwise a negative error value
571 * @retval #MESSAGES_ERROR_NONE Successful
572 * @retval #MESSAGES_ERROR_INVALID_PARAMETER Invalid parameter
573 * @retval #MESSAGES_ERROR_OUT_OF_MEMORY Out of memory
574 * @retval #MESSAGES_ERROR_OPERATION_FAILED Messaging operation failed
575 * @retval #MESSAGES_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
576 * @retval #MESSAGES_ERROR_NOT_SUPPORTED Not supported
578 * @post It invokes messages_search_cb().
580 * @see messages_search_cb()
582 int messages_foreach_message(messages_service_h service,
583 messages_message_box_e mbox,
584 messages_message_type_e type,
585 const char *keyword, const char *address,
586 int offset, int limit,
587 messages_search_cb callback, void *user_data);
590 * @brief Registers a callback to be invoked when an incoming message is received.
592 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
594 * @privilege %http://tizen.org/privilege/message.read
596 * @param[in] service The message service handle
597 * @param[in] callback The callback function
598 * @param[in] user_data The user data to be passed to the callback function
600 * @return @c 0 on success,
601 * otherwise a negative error value
603 * @retval #MESSAGES_ERROR_NONE Successful
604 * @retval #MESSAGES_ERROR_INVALID_PARAMETER Invalid parameter
605 * @retval #MESSAGES_ERROR_OPERATION_FAILED Messaging operation failed
606 * @retval #MESSAGES_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
607 * @retval #MESSAGES_ERROR_NOT_SUPPORTED Not supported
609 * @post It will invoke messages_incoming_cb().
611 * @see messages_unset_message_incoming_cb()
612 * @see messages_incoming_cb()
614 int messages_set_message_incoming_cb(messages_service_h service, messages_incoming_cb callback, void *user_data);
618 * @brief Unregisters the callback function.
620 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
622 * @privilege %http://tizen.org/privilege/message.write
624 * @param[in] service The message service handle
626 * @return @c 0 on success,
627 * otherwise a negative error value
629 * @retval #MESSAGES_ERROR_NONE Successful
630 * @retval #MESSAGES_ERROR_INVALID_PARAMETER Invalid parameter
631 * @retval #MESSAGES_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
632 * @retval #MESSAGES_ERROR_NOT_SUPPORTED Not supported
634 * @see messages_set_message_incoming_cb()
635 * @see messages_incoming_cb()
637 int messages_unset_message_incoming_cb(messages_service_h service);
640 * @brief Adds an additional listening port for the incoming SMS messages.
642 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
644 * @privilege %http://tizen.org/privilege/message.read
646 * @param[in] service The message service handle
647 * @param[in] port The listening port for the SMS messages
649 * @return @c 0 on success,
650 * otherwise a negative error value
652 * @retval #MESSAGES_ERROR_NONE Successful
653 * @retval #MESSAGES_ERROR_INVALID_PARAMETER Invalid parameter
654 * @retval #MESSAGES_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
655 * @retval #MESSAGES_ERROR_NOT_SUPPORTED Not supported
657 * @see messages_set_message_incoming_cb()
658 * @see messages_get_message_port()
660 int messages_add_sms_listening_port(messages_service_h service, int port);
663 * @addtogroup CAPI_MESSAGING_MESSAGES_MMS_MODULE
667 * @brief Sets the subject of the message.
669 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
671 * @param[in] msg The message handle
672 * @param[in] subject The subject of the message \n
673 * The maximum length of @a subject is @c 120.
675 * @return @c 0 on success,
676 * otherwise a negative error value
678 * @retval #MESSAGES_ERROR_NONE Successful
679 * @retval #MESSAGES_ERROR_INVALID_PARAMETER Invalid parameter
680 * @retval #MESSAGES_ERROR_NOT_SUPPORTED Not supported
682 * @pre @a msg is created as a #MESSAGES_TYPE_MMS.
684 * @see messages_mms_get_subject()
686 int messages_mms_set_subject(messages_message_h msg, const char *subject);
690 * @brief Gets the subject of the message.
692 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
694 * @remarks You must release @a subject using free().
696 * @param[in] msg The message handle
697 * @param[out] subject The subject of the message
699 * @return @c 0 on success,
700 * otherwise a negative error value
702 * @retval #MESSAGES_ERROR_NONE Successful
703 * @retval #MESSAGES_ERROR_INVALID_PARAMETER Invalid parameter
704 * @retval #MESSAGES_ERROR_OUT_OF_MEMORY Out of memory
705 * @retval #MESSAGES_ERROR_NOT_SUPPORTED Not supported
707 * @pre @a msg is created as a #MESSAGES_TYPE_MMS.
709 * @see messages_mms_set_subject()
711 int messages_mms_get_subject(messages_message_h msg, char **subject);
715 * @brief Adds the attachment to the MMS message.
717 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
719 * @param[in] msg The message handle
720 * @param[in] type The attachment type
721 * @param[in] path The file path to attach \n
722 * The maximum length of @a path is @c 1024.
724 * @return @c 0 on success,
725 * otherwise a negative error value
727 * @retval #MESSAGES_ERROR_NONE Successful
728 * @retval #MESSAGES_ERROR_INVALID_PARAMETER Invalid parameter
729 * @retval #MESSAGES_ERROR_OUT_OF_MEMORY Out of memory
730 * @retval #MESSAGES_ERROR_NOT_SUPPORTED Not supported
732 * @pre @a msg is created as a #MESSAGES_TYPE_MMS.
734 * @see messages_mms_get_attachment()
735 * @see messages_mms_get_attachment_count()
736 * @see messages_mms_remove_all_attachments()
738 int messages_mms_add_attachment(messages_message_h msg, messages_media_type_e type, const char *path);
742 * @brief Gets the file path of the attachment with the specified index.
744 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
746 * @remarks You must release @a path using free().
748 * @param[in] msg The message handle
749 * @param[in] index The zero-based index of the attachment
750 * @param[out] type The attachment type
751 * @param[out] path The file path to attach
753 * @return @c 0 on success,
754 * otherwise a negative error value
756 * @retval #MESSAGES_ERROR_NONE Successful
757 * @retval #MESSAGES_ERROR_INVALID_PARAMETER Invalid parameter
758 * @retval #MESSAGES_ERROR_OUT_OF_MEMORY Out of memory
759 * @retval #MESSAGES_ERROR_NOT_SUPPORTED Not supported
761 * @pre @a msg is created as a #MESSAGES_TYPE_MMS.
763 * @see messages_mms_add_attachment()
764 * @see messages_mms_get_attachment_count()
765 * @see messages_mms_remove_all_attachments()
767 int messages_mms_get_attachment(messages_message_h msg, int index, messages_media_type_e *type, char **path);
771 * @brief Gets the attachment with the specified index.
773 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
775 * @param[in] msg The message handle
776 * @param[out] count The total number of attachments
778 * @return @c 0 on success,
779 * otherwise a negative error value
781 * @retval #MESSAGES_ERROR_NONE Successful
782 * @retval #MESSAGES_ERROR_INVALID_PARAMETER Invalid parameter
783 * @retval #MESSAGES_ERROR_NOT_SUPPORTED Not supported
785 * @pre @a msg is created as a #MESSAGES_TYPE_MMS.
787 * @see messages_mms_add_attachment()
788 * @see messages_mms_get_attachment()
789 * @see messages_mms_remove_all_attachments()
791 int messages_mms_get_attachment_count(messages_message_h msg, int *count);
795 * @brief Removes all attachments to the MMS message.
797 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
799 * @param[in] msg The message handle
801 * @return @c 0 on success,
802 * otherwise a negative error value
804 * @retval #MESSAGES_ERROR_NONE Successful
805 * @retval #MESSAGES_ERROR_INVALID_PARAMETER Invalid parameter
806 * @retval #MESSAGES_ERROR_NOT_SUPPORTED Not supported
808 * @pre @a msg is created as a #MESSAGES_TYPE_MMS.
810 * @see messages_mms_add_attachment()
811 * @see messages_mms_get_attachment()
812 * @see messages_mms_get_attachment_count()
814 int messages_mms_remove_all_attachments(messages_message_h msg);
820 * @addtogroup CAPI_MESSAGING_MESSAGES_PUSH_MODULE
825 * @brief Registers a callback to be invoked when an WAP Push message is received.
827 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
829 * @privilege %http://tizen.org/privilege/message.read
831 * @param[in] service The message service handle
832 * @param[in] app_id The "X-WAP-Application-ID" to indicate a destination WAP Push application ID
833 * @param[in] callback The callback function
834 * @param[in] user_data The user data to be passed to the callback function
836 * @return @c 0 on success,
837 * otherwise a negative error value
839 * @retval #MESSAGES_ERROR_NONE Successful
840 * @retval #MESSAGES_ERROR_INVALID_PARAMETER Invalid parameter
841 * @retval #MESSAGES_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
842 * @retval #MESSAGES_ERROR_NOT_SUPPORTED Not supported
844 int messages_push_add_incoming_cb(messages_service_h service, const char *app_id,
845 messages_push_incoming_cb callback, void *user_data);
849 * @brief Unregisters the WAP push incoming callback function.
851 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
853 * @param[in] service The message service handle
854 * @param[in] app_id The "X-WAP-Application-ID" to indicate a destination WAP Push application ID
856 * @return @c 0 on success,
857 * otherwise a negative error value
859 * @retval #MESSAGES_ERROR_NONE Successful
860 * @retval #MESSAGES_ERROR_INVALID_PARAMETER Invalid parameter
861 * @retval #MESSAGES_ERROR_NOT_SUPPORTED Not supported
863 int messages_push_remove_incoming_cb(messages_service_h service, const char *app_id);
867 * @brief Registers an application to the mapping table of the WAP Push service.
869 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
871 * @privilege %http://tizen.org/privilege/message.write
873 * @param[in] service The message service handle
874 * @param[in] content_type The MIME content type of the content
875 * @param[in] app_id The "X-WAP-Application-ID" to indicate a destination WAP Push application ID
877 * @return @c 0 on success,
878 * otherwise a negative error value
880 * @retval #MESSAGES_ERROR_NONE Successful
881 * @retval #MESSAGES_ERROR_INVALID_PARAMETER Invalid parameter
882 * @retval #MESSAGES_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
883 * @retval #MESSAGES_ERROR_NOT_SUPPORTED Not supported
885 int messages_push_register(messages_service_h service, const char *content_type, const char *app_id);
889 * @brief De-registers an application from the mapping table of the WAP Push service.
891 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
893 * @privilege %http://tizen.org/privilege/message.write
895 * @param[in] service The message service handle
896 * @param[in] content_type The MIME content type of the content
897 * @param[in] app_id The "X-WAP-Application-ID" to indicate a destination WAP Push application ID
899 * @return @c 0 on success,
900 * otherwise a negative error value
902 * @retval #MESSAGES_ERROR_NONE Successful
903 * @retval #MESSAGES_ERROR_INVALID_PARAMETER Invalid parameter
904 * @retval #MESSAGES_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
905 * @retval #MESSAGES_ERROR_NOT_SUPPORTED Not supported
907 int messages_push_deregister(messages_service_h service, const char *content_type, const char *app_id);
911 * @brief Re-registers an application to the mapping table of the WAP Push service.
913 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
915 * @privilege %http://tizen.org/privilege/message.write
917 * @param[in] service The message service handle
918 * @param[in] content_type An element of the composite key for searching registered entry \n
919 * The MIME content type of the content.
920 * @param[in] app_id The composite key for searching mapping information \n
921 * The "X-WAP-Application-ID" to indicate a destination WAP Push application ID.
922 * @param[in] dst_content_type The MIME content type of the content
923 * @param[in] dst_app_id The "X-WAP-Application-ID" to indicate a destination WAP Push application ID
925 * @return @c 0 on success,
926 * otherwise a negative error value
928 * @retval #MESSAGES_ERROR_NONE Successful
929 * @retval #MESSAGES_ERROR_INVALID_PARAMETER Invalid parameter
930 * @retval #MESSAGES_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
931 * @retval #MESSAGES_ERROR_NOT_SUPPORTED Not supported
934 int messages_push_reregister(messages_service_h service, const char *content_type, const char *app_id,
935 const char *dst_content_type, const char *dst_app_id);
951 #endif /* __TIZEN_MESSAGING_H__ */