Tizen Native API  5.5

The MMS API provides functions to manage attachments and subject of the MMS message.

Required Header

#include <messages.h>

Overview

The MMS API provides the following functionalities:

  • Setting/Getting the subject
  • Attaching the media files(image, video, audio)
  • Retrieving the attachments
  • Deleting all attachments

Related Features

This API is related with the following features:

Functions

int messages_mms_set_subject (messages_message_h msg, const char *subject)
 Sets the subject of the message.
int messages_mms_get_subject (messages_message_h msg, char **subject)
 Gets the subject of the message.
int messages_mms_add_attachment (messages_message_h msg, messages_media_type_e type, const char *path)
 Adds the attachment to the MMS message.
int messages_mms_get_attachment (messages_message_h msg, int index, messages_media_type_e *type, char **path)
 Gets the file path of the attachment with the specified index.
int messages_mms_get_attachment_count (messages_message_h msg, int *count)
 Gets the attachment with the specified index.
int messages_mms_remove_all_attachments (messages_message_h msg)
 Removes all attachments to the MMS message.

Function Documentation

int messages_mms_add_attachment ( messages_message_h  msg,
messages_media_type_e  type,
const char *  path 
)

Adds the attachment to the MMS message.

Since :
2.3
Parameters:
[in]msgThe message handle
[in]typeThe attachment type
[in]pathThe file path to attach
The maximum length of path is 1024
Returns:
0 on success, otherwise a negative error value
Return values:
MESSAGES_ERROR_NONESuccessful
MESSAGES_ERROR_INVALID_PARAMETERInvalid parameter
MESSAGES_ERROR_OUT_OF_MEMORYOut of memory
MESSAGES_ERROR_NOT_SUPPORTEDNot supported
Precondition:
msg is created as a MESSAGES_TYPE_MMS.
See also:
messages_mms_get_attachment()
messages_mms_get_attachment_count()
messages_mms_remove_all_attachments()
int messages_mms_get_attachment ( messages_message_h  msg,
int  index,
messages_media_type_e type,
char **  path 
)

Gets the file path of the attachment with the specified index.

Since :
2.3
Remarks:
You must release path using free().
Parameters:
[in]msgThe message handle
[in]indexThe zero-based index of the attachment
[out]typeThe attachment type
[out]pathThe file path to attach
Returns:
0 on success, otherwise a negative error value
Return values:
MESSAGES_ERROR_NONESuccessful
MESSAGES_ERROR_INVALID_PARAMETERInvalid parameter
MESSAGES_ERROR_OUT_OF_MEMORYOut of memory
MESSAGES_ERROR_NOT_SUPPORTEDNot supported
Precondition:
msg is created as a MESSAGES_TYPE_MMS.
See also:
messages_mms_add_attachment()
messages_mms_get_attachment_count()
messages_mms_remove_all_attachments()
int messages_mms_get_attachment_count ( messages_message_h  msg,
int *  count 
)

Gets the attachment with the specified index.

Since :
2.3
Parameters:
[in]msgThe message handle
[out]countThe total number of attachments
Returns:
0 on success, otherwise a negative error value
Return values:
MESSAGES_ERROR_NONESuccessful
MESSAGES_ERROR_INVALID_PARAMETERInvalid parameter
MESSAGES_ERROR_NOT_SUPPORTEDNot supported
Precondition:
msg is created as a MESSAGES_TYPE_MMS.
See also:
messages_mms_add_attachment()
messages_mms_get_attachment()
messages_mms_remove_all_attachments()
int messages_mms_get_subject ( messages_message_h  msg,
char **  subject 
)

Gets the subject of the message.

Since :
2.3
Remarks:
You must release subject using free().
Parameters:
[in]msgThe message handle
[out]subjectThe subject of the message
Returns:
0 on success, otherwise a negative error value
Return values:
MESSAGES_ERROR_NONESuccessful
MESSAGES_ERROR_INVALID_PARAMETERInvalid parameter
MESSAGES_ERROR_OUT_OF_MEMORYOut of memory
MESSAGES_ERROR_NOT_SUPPORTEDNot supported
Precondition:
msg is created as a MESSAGES_TYPE_MMS.
See also:
messages_mms_set_subject()

Removes all attachments to the MMS message.

Since :
2.3
Parameters:
[in]msgThe message handle
Returns:
0 on success, otherwise a negative error value
Return values:
MESSAGES_ERROR_NONESuccessful
MESSAGES_ERROR_INVALID_PARAMETERInvalid parameter
MESSAGES_ERROR_NOT_SUPPORTEDNot supported
Precondition:
msg is created as a MESSAGES_TYPE_MMS.
See also:
messages_mms_add_attachment()
messages_mms_get_attachment()
messages_mms_get_attachment_count()
int messages_mms_set_subject ( messages_message_h  msg,
const char *  subject 
)

Sets the subject of the message.

Since :
2.3
Parameters:
[in]msgThe message handle
[in]subjectThe subject of the message
The maximum length of subject is 120
Returns:
0 on success, otherwise a negative error value
Return values:
MESSAGES_ERROR_NONESuccessful
MESSAGES_ERROR_INVALID_PARAMETERInvalid parameter
MESSAGES_ERROR_NOT_SUPPORTEDNot supported
Precondition:
msg is created as a MESSAGES_TYPE_MMS.
See also:
messages_mms_get_subject()