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_TYPES_H__
18 #define __TIZEN_MESSAGING_TYPES_H__
28 * @addtogroup CAPI_MESSAGING_MESSAGES_MODULE
33 * @brief The messaging service handle.
34 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
36 typedef struct messages_service_s *messages_service_h;
40 * @brief The message handle.
41 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
43 typedef struct messages_message_s *messages_message_h;
46 * @brief Enumeration for the message box type.
47 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
50 MESSAGES_MBOX_ALL = 0, /**< All message box type */
51 MESSAGES_MBOX_INBOX = 1, /**< Inbox type */
52 MESSAGES_MBOX_OUTBOX = 2, /**< Outbox type*/
53 MESSAGES_MBOX_SENTBOX = 3, /**< Sentbox type */
54 MESSAGES_MBOX_DRAFT = 4, /**< Draft type */
55 } messages_message_box_e;
59 * @brief Enumeration for the message type.
60 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
63 MESSAGES_TYPE_UNKNOWN = 0, /**< Unknown type */
64 MESSAGES_TYPE_SMS = 1, /**< SMS type */
65 MESSAGES_TYPE_MMS = 2, /**< MMS type */
66 MESSAGES_TYPE_SMS_CB = MESSAGES_TYPE_SMS | 1 << 4, /**< CB(Cell Broadcast) Type */
67 MESSAGES_TYPE_SMS_PUSH = MESSAGES_TYPE_SMS | 10 << 4, /**< WAP Push Type */
68 MESSAGES_TYPE_SMS_ETWS_PRIMARY = MESSAGES_TYPE_SMS | 21 << 4, /**< ETWS(Earthquake and Tsunami Warning System) Primary Type */
69 MESSAGES_TYPE_SMS_ETWS_SECONDARY = MESSAGES_TYPE_SMS | 22 << 4, /**< ETWS(Earthquake and Tsunami Warning System) Secondary Type */
70 } messages_message_type_e;
74 * @brief Enumeration for the attachment type for MMS messaging.
75 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
78 MESSAGES_MEDIA_UNKNOWN = 0, /**< Unknown */
79 MESSAGES_MEDIA_IMAGE = 1, /**< The image */
80 MESSAGES_MEDIA_AUDIO = 2, /**< The audio */
81 MESSAGES_MEDIA_VIDEO = 3, /**< The video */
82 } messages_media_type_e;
85 * @brief Enumeration for the recipient type of a message.
86 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
89 MESSAGES_RECIPIENT_UNKNOWN = 0, /**< Unknown */
90 MESSAGES_RECIPIENT_TO = 1, /**< The 'To' recipient */
91 MESSAGES_RECIPIENT_CC = 2, /**< The 'Cc' (carbon copy) recipient */
92 MESSAGES_RECIPIENT_BCC = 3, /**< The 'Bcc' (blind carbon copy) recipient */
93 } messages_recipient_type_e;
96 * @brief Enumeration for the result of sending a message.
97 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
100 MESSAGES_SENDING_FAILED = -1, /**< Message sending failed */
101 MESSAGES_SENDING_SUCCEEDED = 0, /**< Message sending succeeded */
102 } messages_sending_result_e;
105 * @brief Enumeration for the SIM index of a message.
106 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
109 MESSAGES_SIM_INDEX_UNKNOWN = 0, /**< Unknown SIM Index*/
110 MESSAGES_SIM_INDEX_1 = 1, /**< SIM Index 1 */
111 MESSAGES_SIM_INDEX_2 = 2, /**< SIM Index 2 */
112 } messages_sim_index_e;
115 * @brief Called when the process of sending a message to all recipients finishes.
117 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
119 * @param[in] result The result of message sending
120 * @param[in] user_data The user data passed from the callback registration function
122 * @pre messages_send_message() will invoke this callback function.
124 * @see messages_send_message()
126 typedef void (* messages_sent_cb)(messages_sending_result_e result, void *user_data);
130 * @brief Called when an incoming message is received.
132 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
134 * @param[in] incoming_msg The incoming message
135 * @param[in] user_data The user data passed from the callback registration function
137 * @pre You register this callback using messages_set_message_incoming_cb() for getting an incoming message.
139 * @see messages_set_message_incoming_cb()
140 * @see messages_unset_message_incoming_cb()
142 typedef void (* messages_incoming_cb)(messages_message_h incoming_msg, void *user_data);
146 * @brief Called when a message is retrieved from a search request.
148 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
150 * @remarks You should not call messages_destroy_message() with @a msg.
152 * @param[in] msg The message handle \n
153 * It can be @c NULL if nothing is found.
154 * @param[in] user_data The user data passed from the foreach function
155 * @param[in] index The index of a message from the messages that have been retrieved as a search result
156 * @param[in] result_count The count of the messages that have been retrieved as a result applying @a limit and @a offset \n
157 * If the search has a @a limit, then this value is always equal or less than the limit.
158 * @param[in] total_count The count of the messages that have been retrieved as a result without applying @a limit and @a offset \n
159 * The value can be used to calculate the total number of page views for the searched messages. \n
160 * 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.
162 * @return @c true to continue with the next iteration of the loop,
163 * otherwise return @c false to break out of the loop
165 * @pre messages_foreach_message() will invoke this callback function.
167 * @see messages_foreach_message()
169 typedef bool (* messages_search_cb)(messages_message_h msg, int index, int result_count, int total_count, void *user_data);
173 * @addtogroup CAPI_MESSAGING_MESSAGES_PUSH_MODULE
178 * @brief Called when an incoming push message is received.
180 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
182 * @param[in] header The header of the push message
183 * @param[in] body The body of the push message \n
184 * It is not a null-terminated string.
185 * @param[in] body_length The length of @a body
186 * @param[in] user_data The user data to be passed to the callback function
188 * @pre You register this callback using messages_push_set_incoming_cb() for getting an incoming message.
190 * @see messages_push_set_incoming_cb()
191 * @see messages_push_unset_incoming_cb()
193 typedef void (* messages_push_incoming_cb)(const char *header, const char *body, int body_length, void *user_data);
208 #endif /* __TIZEN_MESSAGING_TYPES_H__ */