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_PRIVATE_H__
18 #define __TIZEN_MESSAGING_PRIVATE_H__
25 #include <system_info.h>
27 typedef struct _messages_service_s {
28 msg_handle_t service_h;
30 void* incoming_cb_user_data;
31 bool incoming_cb_enabled;
33 GSList* push_incoming_cb_list;
36 typedef struct _messages_message_s {
39 GSList* attachment_list;
42 typedef struct _messages_attachment_s {
44 char filepath[MSG_FILEPATH_LEN_MAX +1];
45 } messages_attachment_s;
47 typedef struct _messages_sent_callback_s {
51 } messages_sent_callback_s;
53 typedef struct _messages_push_incoming_callback_s {
57 } messages_push_incoming_callback_s;
59 #define MESSAGES_PRIVILEGE_READ "http://tizen.org/privilege/message.read"
60 #define MESSAGES_PRIVILEGE_WRITE "http://tizen.org/privilege/message.write"
62 #define MESSAGES_TELEPHONY_FEATURE "http://tizen.org/feature/network.telephony"
63 #define MESSAGES_TELEPHONY_MMS_FEATURE "http://tizen.org/feature/network.telephony.mms"
65 #define ERROR_CONVERT(err) _messages_error_converter(err, __FUNCTION__, __LINE__);
66 #define CHECK_NULL(p) \
68 LOGE("[%s] INVALID_PARAMETER(0x%08x) %s is null.", \
69 __FUNCTION__, MESSAGES_ERROR_INVALID_PARAMETER, #p); \
70 return MESSAGES_ERROR_INVALID_PARAMETER; \
73 #define IS_SMS(x) ((x & MESSAGES_TYPE_SMS) == MESSAGES_TYPE_SMS)
74 #define IS_MMS(x) ((x & MESSAGES_TYPE_MMS) == MESSAGES_TYPE_MMS)
76 #define CHECK_MESSAGES_SUPPORTED(feature_name) \
78 bool is_supported = false; \
79 if (!system_info_get_platform_bool(feature_name, &is_supported)) { \
80 if (is_supported == false) { \
81 LOGE("[%s] feature is disabled", feature_name); \
82 return MESSAGES_ERROR_NOT_SUPPORTED; \
85 LOGE("Error - Feature getting from System Info"); \
86 return MESSAGES_ERROR_OPERATION_FAILED; \
90 int _messages_convert_mbox_to_fw(messages_message_box_e mbox);
91 int _messages_convert_msgtype_to_fw(messages_message_type_e type);
92 int _messages_convert_recipient_to_fw(messages_recipient_type_e type);
93 int _messages_error_converter(int err, const char *func, int line);
99 #endif /* __TIZEN_MESSAGING_PRIVATE_H__ */