Tizen Native API
7.0
|
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:
- http://tizen.org/feature/network.telephony
- http://tizen.org/feature/network.telephony.sms
- http://tizen.org/feature/network.telephony.mms
It is recommended to design feature related codes in your application for reliability.
You can check if a device supports the related features for this API by using System Information, thereby controlling the procedure of your application.
To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.
More details on featuring your application can be found from Feature Element.
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] msg The message handle [in] type The attachment type [in] path The file path to attach
The maximum length of path is1024
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MESSAGES_ERROR_NONE Successful MESSAGES_ERROR_INVALID_PARAMETER Invalid parameter MESSAGES_ERROR_OUT_OF_MEMORY Out of memory MESSAGES_ERROR_NOT_SUPPORTED Not supported
- Precondition:
- msg is created as a MESSAGES_TYPE_MMS.
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] msg The message handle [in] index The zero-based index of the attachment [out] type The attachment type [out] path The file path to attach
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MESSAGES_ERROR_NONE Successful MESSAGES_ERROR_INVALID_PARAMETER Invalid parameter MESSAGES_ERROR_OUT_OF_MEMORY Out of memory MESSAGES_ERROR_NOT_SUPPORTED Not supported
- Precondition:
- msg is created as a MESSAGES_TYPE_MMS.
int messages_mms_get_attachment_count | ( | messages_message_h | msg, |
int * | count | ||
) |
Gets the attachment with the specified index.
- Since :
- 2.3
- Parameters:
-
[in] msg The message handle [out] count The total number of attachments
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MESSAGES_ERROR_NONE Successful MESSAGES_ERROR_INVALID_PARAMETER Invalid parameter MESSAGES_ERROR_NOT_SUPPORTED Not supported
- Precondition:
- msg is created as a MESSAGES_TYPE_MMS.
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] msg The message handle [out] subject The subject of the message
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MESSAGES_ERROR_NONE Successful MESSAGES_ERROR_INVALID_PARAMETER Invalid parameter MESSAGES_ERROR_OUT_OF_MEMORY Out of memory MESSAGES_ERROR_NOT_SUPPORTED Not 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] msg The message handle
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MESSAGES_ERROR_NONE Successful MESSAGES_ERROR_INVALID_PARAMETER Invalid parameter MESSAGES_ERROR_NOT_SUPPORTED Not supported
- Precondition:
- msg is created as a MESSAGES_TYPE_MMS.
int messages_mms_set_subject | ( | messages_message_h | msg, |
const char * | subject | ||
) |
Sets the subject of the message.
- Since :
- 2.3
- Parameters:
-
[in] msg The message handle [in] subject The subject of the message
The maximum length of subject is120
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MESSAGES_ERROR_NONE Successful MESSAGES_ERROR_INVALID_PARAMETER Invalid parameter MESSAGES_ERROR_NOT_SUPPORTED Not supported
- Precondition:
- msg is created as a MESSAGES_TYPE_MMS.
- See also:
- messages_mms_get_subject()