2.0_beta
authorSangkoo Kim <sangkoo.kim@samsung.com>
Tue, 21 Aug 2012 08:31:39 +0000 (17:31 +0900)
committerSangkoo Kim <sangkoo.kim@samsung.com>
Tue, 21 Aug 2012 08:31:39 +0000 (17:31 +0900)
480 files changed:
AUTHORS
CMakeLists.txt
SLP_MessagingFW_PG.h
TC/_export_env.sh [deleted file]
TC/_export_target_env.sh [deleted file]
TC/build.sh [deleted file]
TC/execute.sh [deleted file]
TC/making_new_tet_scen.py [deleted file]
TC/msgTC/MapiControl/Makefile [deleted file]
TC/msgTC/MapiControl/tslist [deleted file]
TC/msgTC/MapiControl/utc_msg_close_msg_handle.c [deleted file]
TC/msgTC/MapiControl/utc_msg_close_msg_handle.h [deleted file]
TC/msgTC/MapiControl/utc_msg_open_msg_handle.c [deleted file]
TC/msgTC/MapiControl/utc_msg_open_msg_handle.h [deleted file]
TC/msgTC/MapiMessage/Makefile [deleted file]
TC/msgTC/MapiMessage/tslist [deleted file]
TC/msgTC/MapiMessage/utc_msg_add_address.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_add_address.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_get_address_count.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_get_address_count.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_get_dest_port.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_get_dest_port.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_get_direction_info.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_get_direction_info.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_get_encode_type.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_get_encode_type.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_get_folder_id.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_get_folder_id.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_get_ith_address.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_get_ith_address.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_get_ith_contact_id.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_get_ith_contact_id.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_get_ith_name.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_get_ith_name.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_get_ith_recipient_type.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_get_ith_recipient_type.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_get_ith_thread_id.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_get_ith_thread_id.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_get_message_body_size.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_get_message_body_size.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_get_message_id.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_get_message_id.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_get_message_type.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_get_message_type.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_get_network_status.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_get_network_status.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_get_priority_info.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_get_priority_info.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_get_scheduled_time.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_get_scheduled_time.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_get_src_port.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_get_src_port.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_get_storage_id.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_get_storage_id.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_get_subject.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_get_subject.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_get_time.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_get_time.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_is_in_sim.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_is_in_sim.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_is_mms.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_is_mms.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_is_protected.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_is_protected.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_is_read.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_is_read.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_is_sms.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_is_sms.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_mms_add_attachment.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_mms_add_attachment.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_mms_add_media.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_mms_add_media.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_mms_add_meta.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_mms_add_meta.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_mms_add_page.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_mms_add_page.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_mms_add_region.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_mms_add_region.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_mms_add_transition.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_mms_add_transition.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_mms_create_message.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_mms_create_message.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_mms_destroy_message.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_mms_destroy_message.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_mms_get_attachment.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_mms_get_attachment.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_mms_get_media.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_mms_get_media.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_mms_get_message_body.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_mms_get_message_body.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_mms_get_meta.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_mms_get_meta.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_mms_get_page.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_mms_get_page.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_mms_get_smil_region.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_mms_get_smil_region.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_mms_get_transition.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_mms_get_transition.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_mms_set_message_body.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_mms_set_message_body.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_mms_set_rootlayout.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_mms_set_rootlayout.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_new_message.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_new_message.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_release_message.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_release_message.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_reset_address.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_reset_address.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_set_direction_info.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_set_direction_info.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_set_encode_type.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_set_encode_type.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_set_folder_id.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_set_folder_id.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_set_message_id.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_set_message_id.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_set_message_type.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_set_message_type.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_set_network_status.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_set_network_status.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_set_port.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_set_port.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_set_priority_info.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_set_priority_info.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_set_protect_status.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_set_protect_status.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_set_read_status.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_set_read_status.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_set_scheduled_time.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_set_scheduled_time.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_set_storage_id.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_set_storage_id.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_set_subject.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_set_subject.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_set_time.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_set_time.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_sms_get_message_body.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_sms_get_message_body.h [deleted file]
TC/msgTC/MapiMessage/utc_msg_sms_set_message_body.c [deleted file]
TC/msgTC/MapiMessage/utc_msg_sms_set_message_body.h [deleted file]
TC/msgTC/MapiSetting/Makefile [deleted file]
TC/msgTC/MapiSetting/tslist [deleted file]
TC/msgTC/MapiSetting/utc_msg_get_config.c [deleted file]
TC/msgTC/MapiSetting/utc_msg_get_config.h [deleted file]
TC/msgTC/MapiSetting/utc_msg_set_config.c [deleted file]
TC/msgTC/MapiSetting/utc_msg_set_config.h [deleted file]
TC/msgTC/MapiStorage/Makefile [deleted file]
TC/msgTC/MapiStorage/tslist [deleted file]
TC/msgTC/MapiStorage/utc_msg_add_folder.c [deleted file]
TC/msgTC/MapiStorage/utc_msg_add_folder.h [deleted file]
TC/msgTC/MapiStorage/utc_msg_add_message.c [deleted file]
TC/msgTC/MapiStorage/utc_msg_add_message.h [deleted file]
TC/msgTC/MapiStorage/utc_msg_add_syncml_message.c [deleted file]
TC/msgTC/MapiStorage/utc_msg_add_syncml_message.h [deleted file]
TC/msgTC/MapiStorage/utc_msg_count_message.c [deleted file]
TC/msgTC/MapiStorage/utc_msg_count_message.h [deleted file]
TC/msgTC/MapiStorage/utc_msg_count_msg_by_contact.c [deleted file]
TC/msgTC/MapiStorage/utc_msg_count_msg_by_contact.h [deleted file]
TC/msgTC/MapiStorage/utc_msg_count_msg_by_type.c [deleted file]
TC/msgTC/MapiStorage/utc_msg_count_msg_by_type.h [deleted file]
TC/msgTC/MapiStorage/utc_msg_delete_all_msgs_in_folder.c [deleted file]
TC/msgTC/MapiStorage/utc_msg_delete_all_msgs_in_folder.h [deleted file]
TC/msgTC/MapiStorage/utc_msg_delete_folder.c [deleted file]
TC/msgTC/MapiStorage/utc_msg_delete_folder.h [deleted file]
TC/msgTC/MapiStorage/utc_msg_delete_message.c [deleted file]
TC/msgTC/MapiStorage/utc_msg_delete_message.h [deleted file]
TC/msgTC/MapiStorage/utc_msg_delete_thread_message_list.c [deleted file]
TC/msgTC/MapiStorage/utc_msg_delete_thread_message_list.h [deleted file]
TC/msgTC/MapiStorage/utc_msg_generate_message.c [deleted file]
TC/msgTC/MapiStorage/utc_msg_generate_message.h [deleted file]
TC/msgTC/MapiStorage/utc_msg_get_conversation_view_list.c [deleted file]
TC/msgTC/MapiStorage/utc_msg_get_conversation_view_list.h [deleted file]
TC/msgTC/MapiStorage/utc_msg_get_folder_list.c [deleted file]
TC/msgTC/MapiStorage/utc_msg_get_folder_list.h [deleted file]
TC/msgTC/MapiStorage/utc_msg_get_folder_view_list.c [deleted file]
TC/msgTC/MapiStorage/utc_msg_get_folder_view_list.h [deleted file]
TC/msgTC/MapiStorage/utc_msg_get_mem_size.c [deleted file]
TC/msgTC/MapiStorage/utc_msg_get_mem_size.h [deleted file]
TC/msgTC/MapiStorage/utc_msg_get_message.c [deleted file]
TC/msgTC/MapiStorage/utc_msg_get_message.h [deleted file]
TC/msgTC/MapiStorage/utc_msg_get_quick_panel_data.c [deleted file]
TC/msgTC/MapiStorage/utc_msg_get_quick_panel_data.h [deleted file]
TC/msgTC/MapiStorage/utc_msg_get_thread_view_list.c [deleted file]
TC/msgTC/MapiStorage/utc_msg_get_thread_view_list.h [deleted file]
TC/msgTC/MapiStorage/utc_msg_move_msg_to_folder.c [deleted file]
TC/msgTC/MapiStorage/utc_msg_move_msg_to_folder.h [deleted file]
TC/msgTC/MapiStorage/utc_msg_move_msg_to_storage.c [deleted file]
TC/msgTC/MapiStorage/utc_msg_move_msg_to_storage.h [deleted file]
TC/msgTC/MapiStorage/utc_msg_release_folder_list.c [deleted file]
TC/msgTC/MapiStorage/utc_msg_release_folder_list.h [deleted file]
TC/msgTC/MapiStorage/utc_msg_release_thread_view_list.c [deleted file]
TC/msgTC/MapiStorage/utc_msg_release_thread_view_list.h [deleted file]
TC/msgTC/MapiStorage/utc_msg_reset_database.c [deleted file]
TC/msgTC/MapiStorage/utc_msg_reset_database.h [deleted file]
TC/msgTC/MapiStorage/utc_msg_thread_view_get_address.c [deleted file]
TC/msgTC/MapiStorage/utc_msg_thread_view_get_address.h [deleted file]
TC/msgTC/MapiStorage/utc_msg_thread_view_get_contact_id.c [deleted file]
TC/msgTC/MapiStorage/utc_msg_thread_view_get_contact_id.h [deleted file]
TC/msgTC/MapiStorage/utc_msg_thread_view_get_data.c [deleted file]
TC/msgTC/MapiStorage/utc_msg_thread_view_get_data.h [deleted file]
TC/msgTC/MapiStorage/utc_msg_thread_view_get_direction.c [deleted file]
TC/msgTC/MapiStorage/utc_msg_thread_view_get_direction.h [deleted file]
TC/msgTC/MapiStorage/utc_msg_thread_view_get_image_path.c [deleted file]
TC/msgTC/MapiStorage/utc_msg_thread_view_get_image_path.h [deleted file]
TC/msgTC/MapiStorage/utc_msg_thread_view_get_mms_cnt.c [deleted file]
TC/msgTC/MapiStorage/utc_msg_thread_view_get_mms_cnt.h [deleted file]
TC/msgTC/MapiStorage/utc_msg_thread_view_get_name.c [deleted file]
TC/msgTC/MapiStorage/utc_msg_thread_view_get_name.h [deleted file]
TC/msgTC/MapiStorage/utc_msg_thread_view_get_sms_cnt.c [deleted file]
TC/msgTC/MapiStorage/utc_msg_thread_view_get_sms_cnt.h [deleted file]
TC/msgTC/MapiStorage/utc_msg_thread_view_get_thread_id.c [deleted file]
TC/msgTC/MapiStorage/utc_msg_thread_view_get_thread_id.h [deleted file]
TC/msgTC/MapiStorage/utc_msg_thread_view_get_time.c [deleted file]
TC/msgTC/MapiStorage/utc_msg_thread_view_get_time.h [deleted file]
TC/msgTC/MapiStorage/utc_msg_thread_view_get_unread_cnt.c [deleted file]
TC/msgTC/MapiStorage/utc_msg_thread_view_get_unread_cnt.h [deleted file]
TC/msgTC/MapiStorage/utc_msg_update_folder.c [deleted file]
TC/msgTC/MapiStorage/utc_msg_update_folder.h [deleted file]
TC/msgTC/MapiStorage/utc_msg_update_message.c [deleted file]
TC/msgTC/MapiStorage/utc_msg_update_message.h [deleted file]
TC/msgTC/MapiStorage/utc_msg_update_protected_status.c [deleted file]
TC/msgTC/MapiStorage/utc_msg_update_protected_status.h [deleted file]
TC/msgTC/MapiStorage/utc_msg_update_read_status.c [deleted file]
TC/msgTC/MapiStorage/utc_msg_update_read_status.h [deleted file]
TC/msgTC/MapiTransport/Makefile [deleted file]
TC/msgTC/MapiTransport/tslist [deleted file]
TC/msgTC/MapiTransport/utc_msg_mms_forward_message.c [deleted file]
TC/msgTC/MapiTransport/utc_msg_mms_forward_message.h [deleted file]
TC/msgTC/MapiTransport/utc_msg_mms_reject_message.c [deleted file]
TC/msgTC/MapiTransport/utc_msg_mms_reject_message.h [deleted file]
TC/msgTC/MapiTransport/utc_msg_mms_retrieve_message.c [deleted file]
TC/msgTC/MapiTransport/utc_msg_mms_retrieve_message.h [deleted file]
TC/msgTC/MapiTransport/utc_msg_mms_send_message.c [deleted file]
TC/msgTC/MapiTransport/utc_msg_mms_send_message.h [deleted file]
TC/msgTC/MapiTransport/utc_msg_mms_send_read_report.c [deleted file]
TC/msgTC/MapiTransport/utc_msg_mms_send_read_report.h [deleted file]
TC/msgTC/MapiTransport/utc_msg_reg_lbs_message_callback.c [deleted file]
TC/msgTC/MapiTransport/utc_msg_reg_lbs_message_callback.h [deleted file]
TC/msgTC/MapiTransport/utc_msg_reg_mms_conf_message_callback.c [deleted file]
TC/msgTC/MapiTransport/utc_msg_reg_mms_conf_message_callback.h [deleted file]
TC/msgTC/MapiTransport/utc_msg_reg_sent_status_callback.c [deleted file]
TC/msgTC/MapiTransport/utc_msg_reg_sent_status_callback.h [deleted file]
TC/msgTC/MapiTransport/utc_msg_reg_sms_message_callback.c [deleted file]
TC/msgTC/MapiTransport/utc_msg_reg_sms_message_callback.h [deleted file]
TC/msgTC/MapiTransport/utc_msg_reg_syncml_message_callback.c [deleted file]
TC/msgTC/MapiTransport/utc_msg_reg_syncml_message_callback.h [deleted file]
TC/msgTC/MapiTransport/utc_msg_sms_send.c [deleted file]
TC/msgTC/MapiTransport/utc_msg_sms_send.h [deleted file]
TC/msgTC/MapiTransport/utc_msg_sms_send_message.c [deleted file]
TC/msgTC/MapiTransport/utc_msg_sms_send_message.h [deleted file]
TC/msgTC/MapiTransport/utc_msg_submit_req.c [deleted file]
TC/msgTC/MapiTransport/utc_msg_submit_req.h [deleted file]
TC/tet_scen [deleted file]
TC/tetbuild.cfg [deleted file]
TC/tetclean.cfg [deleted file]
TC/tetexec.cfg [deleted file]
TC/tslist.txt [deleted file]
config/.msg_service.db [deleted file]
config/.msg_service.db-journal [deleted file]
config/kdb-setting.sh [deleted file]
debian/changelog [deleted file]
debian/compat [deleted file]
debian/control [deleted file]
debian/dirs [deleted file]
debian/docs [deleted file]
debian/libslp-mms-plugin.install.in [deleted file]
debian/libslp-msg-service-0.install.in [deleted file]
debian/libslp-msg-service-dev.install.in [deleted file]
debian/libslp-sms-plugin.install.in [deleted file]
debian/msg-service-tools.install.in [deleted file]
debian/msg-service-tools.postinst [deleted file]
debian/rules [deleted file]
framework/CMakeLists.txt
framework/deliver-handler/MsgDeliverHandler.cpp
framework/main.cpp
framework/plugin-manager/MsgPluginConfig.cpp
framework/plugin-manager/MsgPluginManager.cpp
framework/setting-handler/MsgSettingHandler.cpp
framework/storage-handler/MsgStorageFilter.cpp [new file with mode: 0755]
framework/storage-handler/MsgStorageFolder.cpp
framework/storage-handler/MsgStorageManager.cpp
framework/storage-handler/MsgStorageMessage.cpp
framework/storage-handler/MsgStorageMms.cpp
framework/storage-handler/MsgStorageSim.cpp
framework/storage-handler/MsgStorageUtil.cpp
framework/submit-handler/MsgSubmitHandler.cpp
framework/transaction-manager/MsgCmdHandlerFilter.cpp [new file with mode: 0755]
framework/transaction-manager/MsgCmdHandlerSetting.cpp
framework/transaction-manager/MsgCmdHandlerStorage.cpp
framework/transaction-manager/MsgCmdHandlerTransport.cpp
framework/transaction-manager/MsgTransManager.cpp
include/common/MsgCmdTypes.h
include/common/MsgCppTypes.h
include/common/MsgFilterTypes.h [new file with mode: 0755]
include/common/MsgInternalTypes.h
include/common/MsgMmsTypes.h
include/common/MsgPluginInterface.h
include/common/MsgQueue.h
include/common/MsgSettingTypes.h
include/common/MsgStorageTypes.h
include/common/MsgThread.h
include/common/MsgTransportTypes.h
include/common/MsgTypes.h
include/framework/MsgCmdHandler.h
include/framework/MsgDeliverHandler.h
include/framework/MsgPluginConfig.h
include/framework/MsgPluginManager.h
include/framework/MsgSettingHandler.h
include/framework/MsgStorageHandler.h
include/framework/MsgSubmitHandler.h
include/framework/MsgTransManager.h
include/mapi/MapiMessage.h [deleted file]
include/mapi/MapiSetting.h [deleted file]
include/mapi/msg.h [moved from include/mapi/MapiControl.h with 50% similarity]
include/mapi/msg_private.h [new file with mode: 0755]
include/mapi/msg_storage.h [moved from include/mapi/MapiStorage.h with 58% similarity]
include/mapi/msg_storage_types.h [new file with mode: 0755]
include/mapi/msg_transport.h [moved from include/mapi/MapiTransport.h with 88% similarity]
include/mapi/msg_transport_types.h [new file with mode: 0755]
include/mapi/msg_types.h [new file with mode: 0755]
include/msg_helper/MsgHelper.h
include/proxy/MsgHandle.h
include/proxy/MsgProxyListener.h
include/utils/MsgContact.h
include/utils/MsgDebug.h
include/utils/MsgDrmWrapper.h
include/utils/MsgException.h
include/utils/MsgGconfWrapper.h
include/utils/MsgIpcSocket.h
include/utils/MsgMemory.h
include/utils/MsgMmsMessage.h
include/utils/MsgMutex.h
include/utils/MsgNotificationWrapper.h
include/utils/MsgSoundPlayer.h
include/utils/MsgSpamFilter.h [new file with mode: 0755]
include/utils/MsgSqliteWrapper.h
include/utils/MsgUtilFile.h
include/utils/MsgUtilFunction.h
include/utils/MsgUtilStorage.h
mapi/CMakeLists.txt
mapi/MapiMessage.cpp [deleted file]
mapi/MapiSetting.cpp [deleted file]
mapi/MapiStorage.cpp [deleted file]
mapi/MapiTransport.cpp [deleted file]
mapi/msg_control.cpp [moved from mapi/MapiControl.cpp with 61% similarity]
mapi/msg_filter.cpp [new file with mode: 0755]
mapi/msg_message.cpp [new file with mode: 0755]
mapi/msg_mms.cpp [new file with mode: 0755]
mapi/msg_setting.cpp [new file with mode: 0755]
mapi/msg_storage.cpp [new file with mode: 0755]
mapi/msg_svc.cpp [new file with mode: 0755]
mapi/msg_transport.cpp [new file with mode: 0755]
msg-server
msg_helper/CMakeLists.txt
msg_helper/MsgSensorWrapper.cpp [new file with mode: 0755]
msg_helper/MsgSoundPlayer.cpp
msg_helper/main.cpp
packaging/msg-service.spec
plugin/mms_plugin/CMakeLists.txt
plugin/mms_plugin/LanguagePack/MmsPluginWmLngLatinUni.cpp
plugin/mms_plugin/LanguagePack/MmsPluginWmLngString.cpp
plugin/mms_plugin/LanguagePack/MmsPluginWmLngUTF8Uni.cpp
plugin/mms_plugin/LanguagePack/MmsPluginWmLngUniUTF8.cpp
plugin/mms_plugin/MmsPluginAvCodec.cpp
plugin/mms_plugin/MmsPluginCodec.cpp
plugin/mms_plugin/MmsPluginConnManWrapper.cpp
plugin/mms_plugin/MmsPluginContentCodec.cpp
plugin/mms_plugin/MmsPluginDebug.cpp
plugin/mms_plugin/MmsPluginDecode.cpp
plugin/mms_plugin/MmsPluginDrm.cpp
plugin/mms_plugin/MmsPluginEncode.cpp
plugin/mms_plugin/MmsPluginEventHandler.cpp
plugin/mms_plugin/MmsPluginHttp.cpp
plugin/mms_plugin/MmsPluginInternal.cpp
plugin/mms_plugin/MmsPluginMIME.cpp
plugin/mms_plugin/MmsPluginMain.cpp
plugin/mms_plugin/MmsPluginMessage.cpp
plugin/mms_plugin/MmsPluginSMILValidate.cpp
plugin/mms_plugin/MmsPluginSmil.cpp
plugin/mms_plugin/MmsPluginStorage.cpp
plugin/mms_plugin/MmsPluginTransport.cpp
plugin/mms_plugin/MmsPluginUserAgent.cpp
plugin/mms_plugin/include/MmsPluginAvCodec.h
plugin/mms_plugin/include/MmsPluginCodec.h
plugin/mms_plugin/include/MmsPluginConnManWrapper.h
plugin/mms_plugin/include/MmsPluginData.h
plugin/mms_plugin/include/MmsPluginDebug.h
plugin/mms_plugin/include/MmsPluginDrm.h
plugin/mms_plugin/include/MmsPluginEventHandler.h
plugin/mms_plugin/include/MmsPluginHttp.h
plugin/mms_plugin/include/MmsPluginInternal.h
plugin/mms_plugin/include/MmsPluginMIME.h
plugin/mms_plugin/include/MmsPluginMain.h
plugin/mms_plugin/include/MmsPluginMessage.h
plugin/mms_plugin/include/MmsPluginSMILValidate.h
plugin/mms_plugin/include/MmsPluginSetup.h
plugin/mms_plugin/include/MmsPluginSmil.h
plugin/mms_plugin/include/MmsPluginStorage.h
plugin/mms_plugin/include/MmsPluginTransport.h
plugin/mms_plugin/include/MmsPluginTypes.h
plugin/mms_plugin/include/MmsPluginUserAgent.h
plugin/mms_plugin/include/MmsPluginWmLngPack.h
plugin/sms_plugin/CMakeLists.txt
plugin/sms_plugin/SmsPluginCallback.cpp
plugin/sms_plugin/SmsPluginCbMsgHandler.cpp
plugin/sms_plugin/SmsPluginConcatHandler.cpp
plugin/sms_plugin/SmsPluginEventHandler.cpp
plugin/sms_plugin/SmsPluginMain.cpp
plugin/sms_plugin/SmsPluginParamCodec.cpp
plugin/sms_plugin/SmsPluginSatHandler.cpp
plugin/sms_plugin/SmsPluginSetting.cpp
plugin/sms_plugin/SmsPluginSimMsg.cpp
plugin/sms_plugin/SmsPluginStorage.cpp
plugin/sms_plugin/SmsPluginTextConvert.cpp
plugin/sms_plugin/SmsPluginTpduCodec.cpp
plugin/sms_plugin/SmsPluginTransport.cpp
plugin/sms_plugin/SmsPluginUAManager.cpp
plugin/sms_plugin/SmsPluginUDCodec.cpp
plugin/sms_plugin/SmsPluginWapPushHandler.cpp
plugin/sms_plugin/include/SmsPluginCallback.h
plugin/sms_plugin/include/SmsPluginCbMsgHandler.h
plugin/sms_plugin/include/SmsPluginConcatHandler.h
plugin/sms_plugin/include/SmsPluginEventHandler.h
plugin/sms_plugin/include/SmsPluginMain.h
plugin/sms_plugin/include/SmsPluginParamCodec.h
plugin/sms_plugin/include/SmsPluginSatHandler.h
plugin/sms_plugin/include/SmsPluginSetting.h
plugin/sms_plugin/include/SmsPluginSimMsg.h
plugin/sms_plugin/include/SmsPluginStorage.h
plugin/sms_plugin/include/SmsPluginTextConvert.h
plugin/sms_plugin/include/SmsPluginTpduCodec.h
plugin/sms_plugin/include/SmsPluginTransport.h
plugin/sms_plugin/include/SmsPluginTypes.h
plugin/sms_plugin/include/SmsPluginUAManager.h
plugin/sms_plugin/include/SmsPluginUDCodec.h
plugin/sms_plugin/include/SmsPluginWapPushHandler.h
proxy/CMakeLists.txt
proxy/MsgHandleControl.cpp
proxy/MsgHandleFilter.cpp [new file with mode: 0755]
proxy/MsgHandleSetting.cpp
proxy/MsgHandleStorage.cpp
proxy/MsgHandleTransport.cpp
proxy/MsgProxyListener.cpp
test_app/CMakeLists.txt [deleted file]
test_app/MsgTestConvert.cpp [deleted file]
test_app/MsgTestConvert.h [deleted file]
test_app/MsgTestSetting.cpp [deleted file]
test_app/MsgTestSetting.h [deleted file]
test_app/MsgTestStorage.cpp [deleted file]
test_app/MsgTestStorage.h [deleted file]
test_app/MsgTestThreadView.cpp [deleted file]
test_app/MsgTestThreadView.h [deleted file]
test_app/MsgTestTransport.cpp [deleted file]
test_app/MsgTestTransport.h [deleted file]
test_app/main.cpp [deleted file]
test_app/main.h [deleted file]
test_app/mms_files/A.smi [deleted file]
test_app/mms_files/P091120_104633.jpg [deleted file]
test_app/mms_files/Temp0_2.txt [deleted file]
test_app/mms_files/Temp1_0.txt [deleted file]
test_app/mms_files/V091120_104905.3gp [deleted file]
test_app/mms_files/audio.amr [deleted file]
utils/CMakeLists.txt
utils/MsgContact.cpp
utils/MsgDebug.cpp
utils/MsgDrmWrapper.cpp
utils/MsgException.cpp
utils/MsgGconfWrapper.cpp
utils/MsgIpcSocket.cpp
utils/MsgMemory.cpp
utils/MsgMmsMessage.cpp
utils/MsgMutex.cpp
utils/MsgNotificationWrapper.cpp
utils/MsgSoundPlayer.cpp
utils/MsgSpamFilter.cpp [new file with mode: 0755]
utils/MsgSqliteWrapper.cpp
utils/MsgUtilFile.cpp
utils/MsgUtilFunction.cpp
utils/MsgUtilStorage.cpp
version.sh [deleted file]

diff --git a/AUTHORS b/AUTHORS
index 6ce40ef..fd16fcc 100755 (executable)
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,6 +1,4 @@
-Jaeyun Jeong <jyjeong@samsung.com>\r
+Chang-Seok Oh <seok.oh@samsung.com>\r
 Sangkoo Kim <sangkoo.kim@samsung.com>\r
 Seunghwan Lee <sh.cat.lee@samsung.com>\r
-SoonMin Jung <sm0415.jung@samsung.com>\r
-Jae-Young Lee <jy4710.lee@samsung.com>\r
 KeeBum Kim <keebum.kim@samsung.com>
\ No newline at end of file
index 16400fd..d6b9892 100755 (executable)
@@ -19,7 +19,6 @@ ADD_SUBDIRECTORY(utils)
 ADD_SUBDIRECTORY(framework)
 ADD_SUBDIRECTORY(proxy)
 ADD_SUBDIRECTORY(mapi)
-ADD_SUBDIRECTORY(test_app)
 ADD_SUBDIRECTORY(plugin/sms_plugin)
 ADD_SUBDIRECTORY(plugin/mms_plugin)
 ADD_SUBDIRECTORY(msg_helper)
@@ -29,16 +28,12 @@ ADD_SUBDIRECTORY(msg_helper)
 # Install Header Files
 ##########################################################
 SET(MAPI-HEADERS
-       ${CMAKE_CURRENT_SOURCE_DIR}/include/mapi/MapiControl.h
-       ${CMAKE_CURRENT_SOURCE_DIR}/include/mapi/MapiSetting.h
-       ${CMAKE_CURRENT_SOURCE_DIR}/include/mapi/MapiStorage.h
-       ${CMAKE_CURRENT_SOURCE_DIR}/include/mapi/MapiTransport.h
-       ${CMAKE_CURRENT_SOURCE_DIR}/include/mapi/MapiMessage.h
-       ${CMAKE_CURRENT_SOURCE_DIR}/include/common/MsgTypes.h
-       ${CMAKE_CURRENT_SOURCE_DIR}/include/common/MsgMmsTypes.h
-       ${CMAKE_CURRENT_SOURCE_DIR}/include/common/MsgSettingTypes.h
-       ${CMAKE_CURRENT_SOURCE_DIR}/include/common/MsgStorageTypes.h
-       ${CMAKE_CURRENT_SOURCE_DIR}/include/common/MsgTransportTypes.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/include/mapi/msg.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/include/mapi/msg_types.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/include/mapi/msg_storage.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/include/mapi/msg_storage_types.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/include/mapi/msg_transport.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/include/mapi/msg_transport_types.h
        ${CMAKE_CURRENT_SOURCE_DIR}/SLP_MessagingFW_PG.h )
 INSTALL(FILES ${MAPI-HEADERS} DESTINATION include/msg-service)
 
@@ -49,19 +44,6 @@ INSTALL(FILES ${MAPI-HEADERS} DESTINATION include/msg-service)
 
 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/config/plugin.cfg DESTINATION /usr/share/msg-service)
 
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/config/alert_on_call.mp3 DESTINATION /opt/etc/msg-service)
-
-SET(MMS-FILES
-       ${CMAKE_CURRENT_SOURCE_DIR}/test_app/mms_files/A.smi
-       ${CMAKE_CURRENT_SOURCE_DIR}/test_app/mms_files/audio.amr
-       ${CMAKE_CURRENT_SOURCE_DIR}/test_app/mms_files/P091120_104633.jpg
-       ${CMAKE_CURRENT_SOURCE_DIR}/test_app/mms_files/Temp0_2.txt
-       ${CMAKE_CURRENT_SOURCE_DIR}/test_app/mms_files/Temp1_0.txt
-       ${CMAKE_CURRENT_SOURCE_DIR}/test_app/mms_files/V091120_104905.3gp
-)
-
-INSTALL(FILES ${MMS-FILES} DESTINATION /opt/etc/msg-service)
-
 SET(RINGTONE-FILES
        ${CMAKE_CURRENT_SOURCE_DIR}/config/message_tone/Sherbet.wav
 )
index fababac..ecff3d7 100755 (executable)
@@ -1,18 +1,3 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
 /**
  *
  * @ingroup   SLP_PG
diff --git a/TC/_export_env.sh b/TC/_export_env.sh
deleted file mode 100755 (executable)
index 6dd507a..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-export ARCH=target
-
-export TET_INSTALL_PATH=/home/givme/share/tetware/TETware  # tetware root path
-export TET_TARGET_PATH=$TET_INSTALL_PATH/tetware-target # tetware target path
-export PATH=$TET_TARGET_PATH/bin:$PATH
-export LD_LIBRARY_PATH=$TET_TARGET_PATH/lib/tet3:$LD_LIBRARY_PATH
-
-export TET_ROOT=$TET_TARGET_PATH
-
-set $(pwd)
-export TET_SUITE_ROOT=$1
-
-set $(date +%s)
-FILE_NAME_EXTENSION=$1
-
diff --git a/TC/_export_target_env.sh b/TC/_export_target_env.sh
deleted file mode 100755 (executable)
index 89ea16c..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-
-export ARCH=target
-
-export TET_INSTALL_PATH=/opt/slp/TETware  # path to mount
-export TET_TARGET_PATH=$TET_INSTALL_PATH/tetware-target
-export PATH=$TET_TARGET_PATH/bin:$PATH
-export LD_LIBRARY_PATH=$TET_TARGET_PATH/lib/tet3:$LD_LIBRARY_PATH
-
-export TET_ROOT=$TET_TARGET_PATH
-
-set $(pwd)
-export TET_SUITE_ROOT=$1
-
-set $(date +%s)
-FILE_NAME_EXTENSION=$1
-
diff --git a/TC/build.sh b/TC/build.sh
deleted file mode 100755 (executable)
index ce8f642..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-. ./_export_env.sh                              # setting environment variables
-
-echo PATH=$PATH
-echo LD_LIBRARY_PATH=$LD_LIBRARY_PATH
-echo TET_ROOT=$TET_ROOT
-echo TET_SUITE_ROOT=$TET_SUITE_ROOT
-echo ARCH=$ARCH
-
-RESULT_DIR=results-$ARCH
-HTML_RESULT=$RESULT_DIR/build-tar-result-$FILE_NAME_EXTENSION.html
-JOURNAL_RESULT=$RESULT_DIR/build-tar-result-$FILE_NAME_EXTENSION.journal
-
-mkdir $RESULT_DIR
-
-tcc -c -p ./                                # executing tcc, with clean option (-c)
-tcc -b -j $JOURNAL_RESULT -p ./            # executing tcc to build test cases (-b)
-grw -c 3 -f chtml -o $HTML_RESULT $JOURNAL_RESULT  # reporting the result
-
diff --git a/TC/execute.sh b/TC/execute.sh
deleted file mode 100755 (executable)
index e1ed207..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-. ./_export_target_env.sh                    # setting environment variables
-
-echo PATH=$PATH
-echo LD_LIBRARY_PATH=$LD_LIBRARY_PATH
-echo TET_ROOT=$TET_ROOT
-echo TET_SUITE_ROOT=$TET_SUITE_ROOT
-echo ARCH=$ARCH
-
-RESULT_DIR=results-$ARCH
-HTML_RESULT=$RESULT_DIR/exec-tar-result-$FILE_NAME_EXTENSION.html
-JOURNAL_RESULT=$RESULT_DIR/exec-tar-result-$FILE_NAME_EXTENSION.journal
-
-mkdir $RESULT_DIR
-
-tcc -e -j $JOURNAL_RESULT -p ./             # executing tcc, with \96e option
-grw -c 3 -f chtml -o $HTML_RESULT $JOURNAL_RESULT # reporting the result
-
diff --git a/TC/making_new_tet_scen.py b/TC/making_new_tet_scen.py
deleted file mode 100755 (executable)
index 6c5b845..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/usr/bin/python
-
-#############################################
-# tet_scen  auto generator
-#
-# ** argv[1] = TC root
-#############################################
-
-import sys,string,os
-
-
-write_file = open("tet_scen", 'w')
-
-#
-# making new tet_scen
-#
-def making_tet_scen (filename):
-       #tmp_list = filename.strip().split('/')
-       n_filename = filename.replace(' ', '\\ ')
-       #print n_filename
-       #new_path = "/"+ sys.argv[1] +"/"+n_filename[2:-6]
-       new_path = "/"+n_filename[:-6]
-       #print new_path
-       file = open(filename, 'r')
-       lines = file.readlines()
-       for line in lines:
-               if len(line.strip()) > 1:
-                       list = line.strip().split('/')
-                       #print new_path + list[-1]
-                       write_file.write("\t"+new_path+list[-1]+"\n")
-
-#
-# usage()
-#
-def usage():
-       print(" ")
-       print("./making_new_tet_scen.py tc_root")
-       print("Put the Test Case's root directory.")
-       print("Do not include '/' at the end")
-       print(" ")
-
-#
-# main()
-#
-def main():
-       if len(sys.argv) < 2:
-               usage()
-               sys.exit(0)
-               
-       os.system('find '+ sys.argv[1] +' -name "tslist" > tslist.txt')
-       
-       #write_file = open("tetscen", w)
-       write_file.write("# auto generated tet_scen\n")
-       write_file.write("all\n")
-       write_file.write("\t\"Starting Full Test Suite\"\n")
-       
-       for file in open("tslist.txt", 'r'):
-               #print file.strip()
-               making_tet_scen(file.strip())
-                       
-       write_file.write("\t\"Completed Full Test Suite\"\n")
-       write_file.write("# EOF\n")
-       write_file.close()
-       print(" ")
-       print("==============================")
-       print("New tet_scen file is made~~~~")
-       print("==============================")
-       print(" ")
-main()
diff --git a/TC/msgTC/MapiControl/Makefile b/TC/msgTC/MapiControl/Makefile
deleted file mode 100755 (executable)
index 40d0ec2..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-###################################################
-# add your TestCase List Here
-#
-# e.g.,
-# TC1 = utc_frameworkName_apiName_func
-# TC2 = utc_ApplicationLib_recurGetDayOfWeek_func
-TC1 = utc_msg_open_msg_handle
-TC2 = utc_msg_close_msg_handle
-       
-###################################################
-# add your Package Config Info Here
-#
-# e.g.,
-# PKGS=calendar
-PKGS=msg-service
-
-LIBS  = `pkg-config --libs $(PKGS)` 
-LIBS +=$(TET_ROOT)/lib/tet3/tcm_s.o
-LIBS +=-L$(TET_ROOT)/lib/tet3 -ltcm_s
-LIBS +=-L$(TET_ROOT)/lib/tet3 -lapi_s
-
-INCS  =  -I. `pkg-config --cflags $(PKGS)`
-INCS  += -I$(TET_ROOT)/inc/tet3 
-
-CFLAGS = $(INCS)
-CFLAGS += -D_TETWARE_MODE
-#CC +=$(CFLAGS)
-LDFLAGS = $(LIBS)
-
-###################################################
-# Modify here 
-# depending on the Test Case you want to build
-# 
-# e.g.,
-# TCLIST = $(TC1) $(TC2)
-TCLIST = $(TC1) $(TC2)
-all :
-       for testcase in $(TCLIST) do\
-               $(CC) -o $$(testcase) $$(testcase).c  $(LDFLAGS) $(CFLAGS)
-       done
-
-clean :
-       rm -rf *~ *.o $(TCLIST)
-
-
-$(TC1) : 
-       $(CC) -o $(TC1) $(TC1).c  $(CFLAGS) $(LDFLAGS)
-
-
-$(TC2) :
-       $(CC) -o $(TC2) $(TC2).c  $(CFLAGS) $(LDFLAGS)
-
diff --git a/TC/msgTC/MapiControl/tslist b/TC/msgTC/MapiControl/tslist
deleted file mode 100755 (executable)
index b2d987c..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-utc_msg_open_msg_handle\r
-utc_msg_close_msg_handle
\ No newline at end of file
diff --git a/TC/msgTC/MapiControl/utc_msg_close_msg_handle.c b/TC/msgTC/MapiControl/utc_msg_close_msg_handle.c
deleted file mode 100755 (executable)
index 61a43de..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-
-#include "utc_msg_close_msg_handle.h"
-
-void startup(void)
-{
-}
-void cleanup(void)
-{
-}
-
-void utc_msg_close_msg_handle_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MSG_HANDLE_T msgHandle = NULL;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       err = msg_close_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_close_msg_handle_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MSG_HANDLE_T msgHandle = NULL;
-
-       err = msg_close_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiControl/utc_msg_close_msg_handle.h b/TC/msgTC/MapiControl/utc_msg_close_msg_handle.h
deleted file mode 100755 (executable)
index 0349166..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiControl.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_close_msg_handle_001(void);
- static void utc_msg_close_msg_handle_001(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_close_msg_handle_001,1},
-                       { utc_msg_close_msg_handle_001,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiControl/utc_msg_open_msg_handle.c b/TC/msgTC/MapiControl/utc_msg_open_msg_handle.c
deleted file mode 100755 (executable)
index c1169b8..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-
-#include "utc_msg_open_msg_handle.h"
-
-void startup(void)
-{
-}
-void cleanup(void)
-{
-}
-
-void utc_msg_open_msg_handle_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MSG_HANDLE_T msgHandle = NULL;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_printf("utc_msg_open_msg_handle_001 failed");
-               tet_result(TET_FAIL);
-       }
-       else
-       {
-               tet_printf("utc_msg_open_msg_handle_001 passed");
-               tet_result(TET_PASS);
-       }
-
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_open_msg_handle_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(NULL);
-       if (err != MSG_SUCCESS)
-       {
-               tet_printf("utc_msg_open_msg_handle_001 passed");
-               tet_result(TET_PASS);
-       }
-       else
-       {
-               tet_printf("utc_msg_open_msg_handle_001 failed");
-               tet_result(TET_FAIL);
-       }
-
-}
diff --git a/TC/msgTC/MapiControl/utc_msg_open_msg_handle.h b/TC/msgTC/MapiControl/utc_msg_open_msg_handle.h
deleted file mode 100755 (executable)
index 45dc31a..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiControl.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_open_msg_handle_001(void);
- static void utc_msg_open_msg_handle_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_open_msg_handle_001,1},
-                       { utc_msg_open_msg_handle_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/Makefile b/TC/msgTC/MapiMessage/Makefile
deleted file mode 100755 (executable)
index 5ceb348..0000000
+++ /dev/null
@@ -1,296 +0,0 @@
-###################################################
-# add your TestCase List Here
-#
-# e.g.,
-# TC1 = utc_frameworkName_apiName_func
-# TC2 = utc_ApplicationLib_recurGetDayOfWeek_func
-TC1 = utc_msg_add_address
-TC2 = utc_msg_get_time
-TC3 = utc_msg_new_message
-TC4 = utc_msg_mms_create_message
-TC5 = utc_msg_is_in_sim
-TC6 = utc_msg_release_message
-TC7 = utc_msg_get_address_count
-TC8 = utc_msg_is_mms
-TC9 = utc_msg_reset_address
-TC10 = utc_msg_get_dest_port
-TC11 = utc_msg_is_protected
-TC12 = utc_msg_set_direction_info
-TC13 = utc_msg_get_direction_info
-TC14 = utc_msg_is_read
-TC15 = utc_msg_set_encode_type
-TC16 = utc_msg_get_encode_type
-TC17 = utc_msg_is_sms
-TC18 = utc_msg_set_folder_id
-TC19 = utc_msg_get_folder_id
-TC10 = utc_msg_mms_add_attachment
-TC21 = utc_msg_set_message_id
-TC22 = utc_msg_get_ith_address
-TC23 = utc_msg_mms_add_media
-TC24 = utc_msg_set_message_type
-TC25 = utc_msg_get_ith_contact_id
-TC26 = utc_msg_mms_add_page
-TC27 = utc_msg_set_network_status
-TC28 = utc_msg_get_ith_name
-TC29 = utc_msg_mms_add_region
-TC30 = utc_msg_set_port
-TC31 = utc_msg_get_ith_recipient_type
-TC32 = utc_msg_mms_add_transition
-TC33 = utc_msg_set_priority_info
-TC34 = utc_msg_get_ith_thread_id
-TC35 = utc_msg_mms_destroy_message
-TC36 = utc_msg_set_protect_status
-TC37 = utc_msg_get_message_body_size
-TC38 = utc_msg_mms_get_attachment
-TC39 = utc_msg_set_read_status
-TC40 = utc_msg_get_message_id
-TC41 = utc_msg_mms_get_media
-TC42 = utc_msg_set_scheduled_time
-TC43 = utc_msg_get_message_type
-TC44 = utc_msg_mms_get_message_body
-TC45 = utc_msg_set_storage_id
-TC46 = utc_msg_get_network_status
-TC47 = utc_msg_mms_get_meta
-TC48 = utc_msg_set_subject
-TC49 = utc_msg_get_priority_info
-TC50 = utc_msg_mms_get_page
-TC51 = utc_msg_set_time
-TC52 = utc_msg_get_scheduled_time
-TC53 = utc_msg_mms_get_smil_region
-TC54 = utc_msg_sms_get_message_body
-TC55 = utc_msg_get_src_port
-TC56 = utc_msg_mms_get_transition
-TC57 = utc_msg_sms_set_message_body
-TC58 = utc_msg_get_storage_id
-TC59 = utc_msg_mms_set_message_body
-TC60 = utc_msg_get_subject
-TC61 = utc_msg_mms_set_rootlayout
-TC62 = utc_msg_mms_add_meta
-TC63 = utc_msg_get_dest_port
-
-
-###################################################
-# add your Package Config Info Here
-#
-# e.g.,
-# PKGS=calendar
-PKGS=msg-service
-
-LIBS  = `pkg-config --libs $(PKGS)`
-LIBS +=$(TET_ROOT)/lib/tet3/tcm_s.o
-LIBS +=-L$(TET_ROOT)/lib/tet3 -ltcm_s
-LIBS +=-L$(TET_ROOT)/lib/tet3 -lapi_s
-
-INCS  =  -I. `pkg-config --cflags $(PKGS)`
-INCS  += -I$(TET_ROOT)/inc/tet3
-
-CFLAGS = $(INCS)
-CFLAGS += -D_TETWARE_MODE
-#CC +=$(CFLAGS)
-LDFLAGS = $(LIBS)
-
-###################################################
-# Modify here
-# depending on the Test Case you want to build
-#
-# e.g.,
-# TCLIST = $(TC1) $(TC2)
-TCLIST = $(TC1) $(TC2) $(TC3) $(TC4) $(TC5) $(TC6) $(TC7) $(TC8) $(TC9) $(TC10) $(TC11) $(TC12) $(TC13) $(TC14) $(TC15) $(TC16) $(TC17) $(TC18) $(TC19) $(TC20) $(TC21) $(TC22) $(TC23) $(TC24) $(TC25) $(TC26) $(TC27) $(TC28) $(TC29) $(TC30) $(TC31) $(TC32) $(TC33) $(TC34) $(TC35) $(TC36) $(TC37) $(TC38) $(TC39) $(TC40) $(TC41) $(TC42) $(TC43) $(TC44) $(TC45) $(TC46) $(TC47) $(TC48) $(TC49) $(TC50) $(TC51) $(TC52) $(TC53) $(TC54) $(TC55) $(TC56) $(TC57) $(TC58) $(TC59) $(TC60) $(TC61) $(TC62) $(TC63)
-
-all :
-       for testcase in $(TCLIST) do\
-               $(CC) -o $$(testcase) $$(testcase).c $(CFLAGS) $(LDFLAGS)
-       done
-
-clean :
-       rm -rf *~ *.o $(TCLIST)
-
-
-$(TC1) :
-       $(CC) -o $(TC1) $(TC1).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC2) :
-       $(CC) -o $(TC2) $(TC2).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC3) :
-       $(CC) -o $(TC3) $(TC3).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC4) :
-       $(CC) -o $(TC4) $(TC4).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC5) :
-       $(CC) -o $(TC5) $(TC5).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC6) :
-       $(CC) -o $(TC6) $(TC6).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC7) :
-       $(CC) -o $(TC7) $(TC7).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC8) :
-       $(CC) -o $(TC8) $(TC8).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC9) :
-       $(CC) -o $(TC9) $(TC9).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC10) :
-       $(CC) -o $(TC10) $(TC10).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC11) :
-       $(CC) -o $(TC11) $(TC11).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC12) :
-       $(CC) -o $(TC12) $(TC12).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC13) :
-       $(CC) -o $(TC13) $(TC13).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC14) :
-       $(CC) -o $(TC14) $(TC14).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC15) :
-       $(CC) -o $(TC15) $(TC15).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC16) :
-       $(CC) -o $(TC16) $(TC16).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC17) :
-       $(CC) -o $(TC17) $(TC17).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC18) :
-       $(CC) -o $(TC18) $(TC18).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC19) :
-       $(CC) -o $(TC19) $(TC19).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC20) :
-       $(CC) -o $(TC20) $(TC20).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC21) :
-       $(CC) -o $(TC21) $(TC21).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC22) :
-       $(CC) -o $(TC22) $(TC22).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC23) :
-       $(CC) -o $(TC23) $(TC23).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC24) :
-       $(CC) -o $(TC24) $(TC24).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC25) :
-       $(CC) -o $(TC25) $(TC25).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC26) :
-       $(CC) -o $(TC26) $(TC26).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC27) :
-       $(CC) -o $(TC27) $(TC27).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC28) :
-       $(CC) -o $(TC28) $(TC28).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC29) :
-       $(CC) -o $(TC29) $(TC29).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC30) :
-       $(CC) -o $(TC30) $(TC30).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC31) :
-       $(CC) -o $(TC31) $(TC31).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC32) :
-       $(CC) -o $(TC32) $(TC32).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC33) :
-       $(CC) -o $(TC33) $(TC33).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC34) :
-       $(CC) -o $(TC34) $(TC34).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC35) :
-       $(CC) -o $(TC35) $(TC35).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC36) :
-       $(CC) -o $(TC36) $(TC36).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC37) :
-       $(CC) -o $(TC37) $(TC37).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC38) :
-       $(CC) -o $(TC38) $(TC38).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC39) :
-       $(CC) -o $(TC39) $(TC39).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC40) :
-       $(CC) -o $(TC40) $(TC40).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC41) :
-       $(CC) -o $(TC41) $(TC41).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC42) :
-       $(CC) -o $(TC42) $(TC42).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC43) :
-       $(CC) -o $(TC43) $(TC43).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC44) :
-       $(CC) -o $(TC44) $(TC44).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC45) :
-       $(CC) -o $(TC45) $(TC45).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC46) :
-       $(CC) -o $(TC46) $(TC46).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC47) :
-       $(CC) -o $(TC47) $(TC47).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC48) :
-       $(CC) -o $(TC48) $(TC48).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC49) :
-       $(CC) -o $(TC49) $(TC49).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC50) :
-       $(CC) -o $(TC50) $(TC50).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC51) :
-       $(CC) -o $(TC51) $(TC51).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC52) :
-       $(CC) -o $(TC52) $(TC52).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC53) :
-       $(CC) -o $(TC53) $(TC53).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC54) :
-       $(CC) -o $(TC54) $(TC54).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC55) :
-       $(CC) -o $(TC55) $(TC55).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC56) :
-       $(CC) -o $(TC56) $(TC56).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC57) :
-       $(CC) -o $(TC57) $(TC57).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC58) :
-       $(CC) -o $(TC58) $(TC58).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC59) :
-       $(CC) -o $(TC59) $(TC59).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC60) :
-       $(CC) -o $(TC60) $(TC60).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC61) :
-       $(CC) -o $(TC61) $(TC61).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC62) :
-       $(CC) -o $(TC62) $(TC62).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC63) :
-       $(CC) -o $(TC63) $(TC63).c  $(CFLAGS) $(LDFLAGS)
\ No newline at end of file
diff --git a/TC/msgTC/MapiMessage/tslist b/TC/msgTC/MapiMessage/tslist
deleted file mode 100755 (executable)
index 8127178..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-utc_msg_add_address\r
-utc_msg_get_time\r
-utc_msg_new_message\r
-utc_msg_mms_create_message\r
-utc_msg_is_in_sim\r
-utc_msg_release_message\r
-utc_msg_get_address_count\r
-utc_msg_is_mms\r
-utc_msg_reset_address\r
-utc_msg_get_dest_port\r
-utc_msg_is_protected\r
-utc_msg_set_direction_info\r
-utc_msg_get_direction_info\r
-utc_msg_is_read\r
-utc_msg_set_encode_type\r
-utc_msg_get_encode_type\r
-utc_msg_is_sms\r
-utc_msg_set_folder_id\r
-utc_msg_get_folder_id\r
-utc_msg_mms_add_attachment\r
-utc_msg_set_message_id\r
-utc_msg_get_ith_address\r
-utc_msg_mms_add_media\r
-utc_msg_set_message_type\r
-utc_msg_get_ith_contact_id\r
-utc_msg_mms_add_page\r
-utc_msg_set_network_status\r
-utc_msg_get_ith_name\r
-utc_msg_mms_add_region\r
-utc_msg_set_port\r
-utc_msg_get_ith_recipient_type\r
-utc_msg_mms_add_transition\r
-utc_msg_mms_add_meta\r
-utc_msg_set_priority_info\r
-utc_msg_get_ith_thread_id\r
-utc_msg_mms_destroy_message\r
-utc_msg_set_protect_status\r
-utc_msg_get_message_body_size\r
-utc_msg_mms_get_attachment\r
-utc_msg_set_read_status\r
-utc_msg_get_message_id\r
-utc_msg_mms_get_media\r
-utc_msg_set_scheduled_time\r
-utc_msg_get_message_type\r
-utc_msg_mms_get_message_body\r
-utc_msg_set_storage_id\r
-utc_msg_get_network_status\r
-utc_msg_mms_get_meta\r
-utc_msg_set_subject\r
-utc_msg_get_priority_info\r
-utc_msg_mms_get_page\r
-utc_msg_set_time\r
-utc_msg_get_scheduled_time\r
-utc_msg_mms_get_smil_region\r
-utc_msg_sms_get_message_body\r
-utc_msg_get_src_port\r
-utc_msg_mms_get_transition\r
-utc_msg_sms_set_message_body\r
-utc_msg_get_storage_id\r
-utc_msg_mms_set_message_body\r
-utc_msg_get_subject\r
-utc_msg_mms_set_rootlayout\r
diff --git a/TC/msgTC/MapiMessage/utc_msg_add_address.c b/TC/msgTC/MapiMessage/utc_msg_add_address.c
deleted file mode 100755 (executable)
index 2b26c61..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_add_address.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_add_address_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_add_address(msgInfo, "01030015078", MSG_RECIPIENTS_TYPE_TO);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_add_address_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_add_address(NULL, "01030015078", MSG_RECIPIENTS_TYPE_TO);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_add_address.h b/TC/msgTC/MapiMessage/utc_msg_add_address.h
deleted file mode 100755 (executable)
index 26e274b..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
-static void utc_msg_add_address_001(void);
-static void utc_msg_add_address_002(void);
-
-
-
-struct tet_testlist tet_testlist[] =
-{
-                       { utc_msg_add_address_001,1},
-                       { utc_msg_add_address_002,2},
-                       {NULL,0}
-};
diff --git a/TC/msgTC/MapiMessage/utc_msg_get_address_count.c b/TC/msgTC/MapiMessage/utc_msg_get_address_count.c
deleted file mode 100755 (executable)
index e4bdf2d..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_get_address_count.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_get_address_count_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_get_address_count(msgInfo);
-       if (err < MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_get_address_count_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_get_address_count(NULL);
-       if (err < MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_get_address_count.h b/TC/msgTC/MapiMessage/utc_msg_get_address_count.h
deleted file mode 100755 (executable)
index 2a4a5d1..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_get_address_count_001(void);
- static void utc_msg_get_address_count_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_get_address_count_001,1},
-                       { utc_msg_get_address_count_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_get_dest_port.c b/TC/msgTC/MapiMessage/utc_msg_get_dest_port.c
deleted file mode 100755 (executable)
index f062abc..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_get_dest_port.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_get_dest_port_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_get_dest_port(msgInfo);
-       if (err < MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_get_dest_port_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_get_dest_port(NULL);
-       if (err < MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_get_dest_port.h b/TC/msgTC/MapiMessage/utc_msg_get_dest_port.h
deleted file mode 100755 (executable)
index 9370812..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_get_dest_port_001(void);
- static void utc_msg_get_dest_port_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_get_dest_port_001,1},
-                       { utc_msg_get_dest_port_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_get_direction_info.c b/TC/msgTC/MapiMessage/utc_msg_get_direction_info.c
deleted file mode 100755 (executable)
index 4a26aeb..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_get_direction_info.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_get_direction_info_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_get_direction_info(msgInfo);
-       if (err < MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_get_direction_info_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_get_direction_info(NULL);
-       if (err < MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_get_direction_info.h b/TC/msgTC/MapiMessage/utc_msg_get_direction_info.h
deleted file mode 100755 (executable)
index 2326c3d..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_get_direction_info_001(void);
- static void utc_msg_get_direction_info_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_get_direction_info_001,1},
-                       { utc_msg_get_direction_info_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_get_encode_type.c b/TC/msgTC/MapiMessage/utc_msg_get_encode_type.c
deleted file mode 100755 (executable)
index 20d2743..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_get_encode_type.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_get_encode_type_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_get_encode_type(msgInfo);
-       if (err < MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_get_encode_type_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_get_encode_type(NULL);
-       if (err < MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_get_encode_type.h b/TC/msgTC/MapiMessage/utc_msg_get_encode_type.h
deleted file mode 100755 (executable)
index 463c5ee..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_get_encode_type_001(void);
- static void utc_msg_get_encode_type_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_get_encode_type_001,1},
-                       { utc_msg_get_encode_type_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_get_folder_id.c b/TC/msgTC/MapiMessage/utc_msg_get_folder_id.c
deleted file mode 100755 (executable)
index 8e3f605..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_get_folder_id.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_get_folder_id_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_get_folder_id(msgInfo);
-       if (err < MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_get_folder_id_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_get_folder_id(NULL);
-       if (err < MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_get_folder_id.h b/TC/msgTC/MapiMessage/utc_msg_get_folder_id.h
deleted file mode 100755 (executable)
index 4dd61cc..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_get_folder_id_001(void);
- static void utc_msg_get_folder_id_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_get_folder_id_001,1},
-                       { utc_msg_get_folder_id_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_get_ith_address.c b/TC/msgTC/MapiMessage/utc_msg_get_ith_address.c
deleted file mode 100755 (executable)
index c088bd9..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_get_ith_address.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-
-       msg_add_address(msgInfo, "01030015078", MSG_RECIPIENTS_TYPE_TO);
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_get_ith_address_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       char * address = NULL;
-
-       address = msg_get_ith_address(msgInfo, 0);
-       if (address == NULL)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_get_ith_address_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       char * address = NULL;
-
-       address = msg_get_ith_address(NULL, 0);
-       if (address == NULL)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_get_ith_address.h b/TC/msgTC/MapiMessage/utc_msg_get_ith_address.h
deleted file mode 100755 (executable)
index 2528b9c..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_get_ith_address_001(void);
- static void utc_msg_get_ith_address_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_get_ith_address_001,1},
-                       { utc_msg_get_ith_address_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_get_ith_contact_id.c b/TC/msgTC/MapiMessage/utc_msg_get_ith_contact_id.c
deleted file mode 100755 (executable)
index d067bbb..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_get_ith_contact_id.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-
-       msg_add_address(msgInfo, "01030015078", MSG_RECIPIENTS_TYPE_TO);
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_get_ith_contact_id_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_get_ith_contact_id(msgInfo, 0);
-       if (err < MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_get_ith_contact_id_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_get_ith_contact_id(NULL, 0);
-       if (err < MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_get_ith_contact_id.h b/TC/msgTC/MapiMessage/utc_msg_get_ith_contact_id.h
deleted file mode 100755 (executable)
index dfd8302..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_get_ith_contact_id_001(void);
- static void utc_msg_get_ith_contact_id_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_get_ith_contact_id_001,1},
-                       { utc_msg_get_ith_contact_id_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_get_ith_name.c b/TC/msgTC/MapiMessage/utc_msg_get_ith_name.c
deleted file mode 100755 (executable)
index 5878f21..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_get_ith_name.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-
-       msg_add_address(msgInfo, "01030015078", MSG_RECIPIENTS_TYPE_TO);
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_get_ith_name_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       char * address = NULL;
-
-       address = msg_get_ith_name(msgInfo, 0);
-       if (address == NULL)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_get_ith_name_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       char * address = NULL;
-
-       address = msg_get_ith_name(NULL, 0);
-       if (address == NULL)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_get_ith_name.h b/TC/msgTC/MapiMessage/utc_msg_get_ith_name.h
deleted file mode 100755 (executable)
index 00c2dee..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_get_ith_name_001(void);
- static void utc_msg_get_ith_name_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_get_ith_name_001,1},
-                       { utc_msg_get_ith_name_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_get_ith_recipient_type.c b/TC/msgTC/MapiMessage/utc_msg_get_ith_recipient_type.c
deleted file mode 100755 (executable)
index e607fe3..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_get_ith_recipient_type.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-
-       msg_add_address(msgInfo, "01030015078", MSG_RECIPIENTS_TYPE_TO);
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_get_ith_recipient_type_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_get_ith_recipient_type(msgInfo, 0);
-       if (err < MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_get_ith_recipient_type_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_get_ith_recipient_type(NULL, 0);
-       if (err < MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_get_ith_recipient_type.h b/TC/msgTC/MapiMessage/utc_msg_get_ith_recipient_type.h
deleted file mode 100755 (executable)
index 6c01dae..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_get_ith_recipient_type_001(void);
- static void utc_msg_get_ith_recipient_type_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_get_ith_recipient_type_001,1},
-                       { utc_msg_get_ith_recipient_type_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_get_ith_thread_id.c b/TC/msgTC/MapiMessage/utc_msg_get_ith_thread_id.c
deleted file mode 100755 (executable)
index ccb0e7c..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_get_ith_thread_id.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-
-       msg_add_address(msgInfo, "01030015078", MSG_RECIPIENTS_TYPE_TO);
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_get_ith_thread_id_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_get_ith_thread_id(msgInfo, 0);
-       if (err < MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_get_ith_thread_id_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_get_ith_thread_id(NULL, 0);
-       if (err < MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_get_ith_thread_id.h b/TC/msgTC/MapiMessage/utc_msg_get_ith_thread_id.h
deleted file mode 100755 (executable)
index fae0136..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_get_ith_thread_id_001(void);
- static void utc_msg_get_ith_thread_id_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_get_ith_thread_id_001,1},
-                       { utc_msg_get_ith_thread_id_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_get_message_body_size.c b/TC/msgTC/MapiMessage/utc_msg_get_message_body_size.c
deleted file mode 100755 (executable)
index 6c4cd75..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_get_message_body_size.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-
-       msg_sms_set_message_body(msgInfo, "test message", 12);
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_get_message_id_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_get_message_body_size(msgInfo);
-       if (err < MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_get_message_id_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_get_message_body_size(NULL);
-       if (err < MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_get_message_body_size.h b/TC/msgTC/MapiMessage/utc_msg_get_message_body_size.h
deleted file mode 100755 (executable)
index a9de554..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_get_message_id_001(void);
- static void utc_msg_get_message_id_001(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_get_message_id_001,1},
-                       { utc_msg_get_message_id_001,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_get_message_id.c b/TC/msgTC/MapiMessage/utc_msg_get_message_id.c
deleted file mode 100755 (executable)
index d8501e6..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_get_message_id.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_get_message_id_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_get_message_id(msgInfo);
-       if (err < MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_get_message_id_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_get_message_id(NULL);
-       if (err < MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_get_message_id.h b/TC/msgTC/MapiMessage/utc_msg_get_message_id.h
deleted file mode 100755 (executable)
index f8aa1b0..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_get_message_id_001(void);
- static void utc_msg_get_message_id_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_get_message_id_001,1},
-                       { utc_msg_get_message_id_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_get_message_type.c b/TC/msgTC/MapiMessage/utc_msg_get_message_type.c
deleted file mode 100755 (executable)
index 37d81e1..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_get_message_type.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_get_message_type_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_get_message_type(msgInfo);
-       if (err < MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_get_message_type_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_get_message_type(NULL);
-       if (err < MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_get_message_type.h b/TC/msgTC/MapiMessage/utc_msg_get_message_type.h
deleted file mode 100755 (executable)
index 3bc88dc..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_get_message_type_001(void);
- static void utc_msg_get_message_type_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_get_message_type_001,1},
-                       { utc_msg_get_message_type_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_get_network_status.c b/TC/msgTC/MapiMessage/utc_msg_get_network_status.c
deleted file mode 100755 (executable)
index e066953..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_get_network_status.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-
-       msg_set_network_status(msgInfo, MSG_NETWORK_SEND_SUCCESS);
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_get_network_status_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_get_network_status(msgInfo);
-       if (err < MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_get_network_status_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_get_network_status(NULL);
-       if (err < MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_get_network_status.h b/TC/msgTC/MapiMessage/utc_msg_get_network_status.h
deleted file mode 100755 (executable)
index 65a3baf..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_get_network_status_001(void);
- static void utc_msg_get_network_status_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_get_network_status_001,1},
-                       { utc_msg_get_network_status_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_get_priority_info.c b/TC/msgTC/MapiMessage/utc_msg_get_priority_info.c
deleted file mode 100755 (executable)
index 2d86631..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_get_priority_info.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_get_priority_info_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_get_priority_info(msgInfo);
-       if (err < MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_get_priority_info_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_get_priority_info(NULL);
-       if (err < MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_get_priority_info.h b/TC/msgTC/MapiMessage/utc_msg_get_priority_info.h
deleted file mode 100755 (executable)
index 3739886..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_get_priority_info_001(void);
- static void utc_msg_get_priority_info_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_get_priority_info_001,1},
-                       { utc_msg_get_priority_info_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_get_scheduled_time.c b/TC/msgTC/MapiMessage/utc_msg_get_scheduled_time.c
deleted file mode 100755 (executable)
index 6bc65fa..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_get_scheduled_time.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_get_scheduled_time_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       time_t scheduledTime = NULL;
-
-       scheduledTime = msg_get_scheduled_time(msgInfo);
-       if (scheduledTime == NULL)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_get_scheduled_time_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       time_t scheduledTime = NULL;
-
-       scheduledTime = msg_get_scheduled_time(NULL);
-       if (scheduledTime == NULL)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_get_scheduled_time.h b/TC/msgTC/MapiMessage/utc_msg_get_scheduled_time.h
deleted file mode 100755 (executable)
index d9a6530..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_get_scheduled_time_001(void);
- static void utc_msg_get_scheduled_time_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_get_scheduled_time_001,1},
-                       { utc_msg_get_scheduled_time_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_get_src_port.c b/TC/msgTC/MapiMessage/utc_msg_get_src_port.c
deleted file mode 100755 (executable)
index 9b58f14..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_get_src_port.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_get_src_port_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_get_src_port(msgInfo);
-       if (err < MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_get_src_port_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_get_src_port(NULL);
-       if (err < MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_get_src_port.h b/TC/msgTC/MapiMessage/utc_msg_get_src_port.h
deleted file mode 100755 (executable)
index fdaa744..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_get_src_port_001(void);
- static void utc_msg_get_src_port_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_get_src_port_001,1},
-                       { utc_msg_get_src_port_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_get_storage_id.c b/TC/msgTC/MapiMessage/utc_msg_get_storage_id.c
deleted file mode 100755 (executable)
index a581125..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_get_storage_id.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_get_storage_id_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_get_storage_id(msgInfo);
-       if (err < MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_get_storage_id_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_get_storage_id(NULL);
-       if (err < MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_get_storage_id.h b/TC/msgTC/MapiMessage/utc_msg_get_storage_id.h
deleted file mode 100755 (executable)
index 06f9aa9..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_get_storage_id_001(void);
- static void utc_msg_get_storage_id_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_get_storage_id_001,1},
-                       { utc_msg_get_storage_id_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_get_subject.c b/TC/msgTC/MapiMessage/utc_msg_get_subject.c
deleted file mode 100755 (executable)
index 47b6963..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_get_subject.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-
-       msg_set_subject(msgInfo, "test subject");
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_get_subject_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       char* subject = NULL;
-
-       subject = msg_get_subject(msgInfo);
-       if (subject == NULL)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_get_subject_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       char* subject = NULL;
-
-       subject = msg_get_subject(NULL);
-       if (subject == NULL)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_get_subject.h b/TC/msgTC/MapiMessage/utc_msg_get_subject.h
deleted file mode 100755 (executable)
index 32e738b..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_get_subject_001(void);
- static void utc_msg_get_subject_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_get_subject_001,1},
-                       { utc_msg_get_subject_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_get_time.c b/TC/msgTC/MapiMessage/utc_msg_get_time.c
deleted file mode 100755 (executable)
index 7030168..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_get_time.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-
-       time_t curTime = time(NULL);
-       msg_set_time(msgInfo, curTime);
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_get_time_001()
-{
-       time_t* curTime;
-
-       curTime = msg_get_time(msgInfo);
-       if (curTime == NULL)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_get_time_002()
-{
-       time_t* curTime;
-
-       curTime = msg_get_time(NULL);
-       if (curTime == NULL)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_get_time.h b/TC/msgTC/MapiMessage/utc_msg_get_time.h
deleted file mode 100755 (executable)
index 847115d..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_get_time_001(void);
- static void utc_msg_get_time_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_get_time_001,1},
-                       { utc_msg_get_time_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_is_in_sim.c b/TC/msgTC/MapiMessage/utc_msg_is_in_sim.c
deleted file mode 100755 (executable)
index c52189d..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_is_in_sim.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_is_in_sim_001()
-{
-       bool bIsInSim = false;
-
-       msg_set_storage_id(msgInfo, MSG_STORAGE_SIM);
-
-       bIsInSim = msg_is_in_sim(msgInfo);
-       if (!bIsInSim)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_is_in_sim_002()
-{
-       bool bIsInSim = false;
-
-       bIsInSim = msg_is_in_sim(NULL);
-       if (!bIsInSim)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_is_in_sim.h b/TC/msgTC/MapiMessage/utc_msg_is_in_sim.h
deleted file mode 100755 (executable)
index c7b01c1..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MsgStorageTypes.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_is_in_sim_001(void);
- static void utc_msg_is_in_sim_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_is_in_sim_001,1},
-                       { utc_msg_is_in_sim_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_is_mms.c b/TC/msgTC/MapiMessage/utc_msg_is_mms.c
deleted file mode 100755 (executable)
index 757479f..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_is_mms.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-
-       msg_set_message_type(msgInfo, MSG_TYPE_MMS);
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_is_mms_001()
-{
-       bool bIsMMS = true;
-
-       bIsMMS = msg_is_mms(msgInfo);
-       if (!bIsMMS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_is_mms_002()
-{
-       bool bIsMMS = true;
-
-       bIsMMS = msg_is_mms(NULL);
-       if (!bIsMMS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_is_mms.h b/TC/msgTC/MapiMessage/utc_msg_is_mms.h
deleted file mode 100755 (executable)
index 0085d3a..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_is_mms_001(void);
- static void utc_msg_is_mms_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_is_mms_001,1},
-                       { utc_msg_is_mms_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_is_protected.c b/TC/msgTC/MapiMessage/utc_msg_is_protected.c
deleted file mode 100755 (executable)
index 8a2a007..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_is_protected.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_is_protected_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_is_protected(msgInfo);
-       if (err < MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_is_protected_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_is_protected(NULL);
-       if (err <= MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_is_protected.h b/TC/msgTC/MapiMessage/utc_msg_is_protected.h
deleted file mode 100755 (executable)
index 3d1c896..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_is_protected_001(void);
- static void utc_msg_is_protected_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_is_protected_001,1},
-                       { utc_msg_is_protected_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_is_read.c b/TC/msgTC/MapiMessage/utc_msg_is_read.c
deleted file mode 100755 (executable)
index 3825c17..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_is_read.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_is_read_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_is_read(msgInfo);
-       if (err < MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_is_read_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_is_read(NULL);
-       if (err <= MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_is_read.h b/TC/msgTC/MapiMessage/utc_msg_is_read.h
deleted file mode 100755 (executable)
index 4dadde5..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_is_read_001(void);
- static void utc_msg_is_read_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_is_read_001,1},
-                       { utc_msg_is_read_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_is_sms.c b/TC/msgTC/MapiMessage/utc_msg_is_sms.c
deleted file mode 100755 (executable)
index 3b87c40..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_is_sms.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_is_sms_001()
-{
-       bool bIsSMS = false;
-
-       bIsSMS = msg_is_sms(msgInfo);
-       if (!bIsSMS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_is_sms_002()
-{
-       bool bIsSMS = false;
-
-       bIsSMS = msg_is_sms(NULL);
-       if (!bIsSMS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_is_sms.h b/TC/msgTC/MapiMessage/utc_msg_is_sms.h
deleted file mode 100755 (executable)
index bb45a0f..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_is_sms_001(void);
- static void utc_msg_is_sms_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_is_sms_001,1},
-                       { utc_msg_is_sms_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_mms_add_attachment.c b/TC/msgTC/MapiMessage/utc_msg_mms_add_attachment.c
deleted file mode 100755 (executable)
index 43f4c50..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_mms_add_attachment.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MMS_MESSAGE_DATA_S*     mms_data;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MMS_PAGE_S*     page[2];
-       MMS_MEDIA_S*    media[5];
-       MMS_ATTACH_S*   attachment[5];
-       int                             nSize;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-       mms_data = msg_mms_create_message();
-}
-void cleanup(void)
-{
-       msg_mms_destroy_message(mms_data);
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_mms_add_attachment_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MMS_ATTACH_S*   attach = NULL;
-
-       attach = msg_mms_add_attachment(mms_data, (char*)"/opt/etc/msg-service/P091120_104633.jpg");
-       if (attach == NULL)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_mms_add_attachment_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MMS_ATTACH_S*   attach = NULL;
-
-       attach = msg_mms_add_attachment(NULL, (char*)"/opt/etc/msg-service/P091120_104633.jpg");
-       if (attach == NULL)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_mms_add_attachment.h b/TC/msgTC/MapiMessage/utc_msg_mms_add_attachment.h
deleted file mode 100755 (executable)
index d7f95a0..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_mms_add_attachment_001(void);
- static void utc_msg_mms_add_attachment_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_mms_add_attachment_001,1},
-                       { utc_msg_mms_add_attachment_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_mms_add_media.c b/TC/msgTC/MapiMessage/utc_msg_mms_add_media.c
deleted file mode 100755 (executable)
index 7716fb9..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_mms_add_media.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MMS_MESSAGE_DATA_S*     mms_data;
-MMS_PAGE_S* page = NULL;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MMS_MEDIA_S*    media[5];
-       MMS_ATTACH_S*   attachment[5];
-       int                             nSize;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-       mms_data = msg_mms_create_message();
-
-       page = msg_mms_add_page(mms_data, 5440);
-}
-void cleanup(void)
-{
-       msg_mms_destroy_message(mms_data);
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_mms_add_media_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MMS_MEDIA_S*    media = NULL;
-
-       media = msg_mms_add_media(page, MMS_SMIL_MEDIA_IMG, "Image", (char*)"/opt/etc/msg-service/P091120_104633.jpg");
-       if (media == NULL)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_mms_add_media_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MMS_MEDIA_S*    media = NULL;
-
-       media = msg_mms_add_media(NULL, MMS_SMIL_MEDIA_IMG, "Image", (char*)"/opt/etc/msg-service/P091120_104633.jpg");
-       if (media == NULL)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_mms_add_media.h b/TC/msgTC/MapiMessage/utc_msg_mms_add_media.h
deleted file mode 100755 (executable)
index 4fdbedc..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_mms_add_media_001(void);
- static void utc_msg_mms_add_media_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_mms_add_media_001,1},
-                       { utc_msg_mms_add_media_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_mms_add_meta.c b/TC/msgTC/MapiMessage/utc_msg_mms_add_meta.c
deleted file mode 100755 (executable)
index 48955e0..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_mms_add_meta.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MMS_MESSAGE_DATA_S*     mms_data;
-MMS_SMIL_META meta;
-MMS_PAGE_S* page = NULL;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MMS_MEDIA_S*    media[5];
-       MMS_ATTACH_S*   attachment[5];
-       int                             nSize;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-       mms_data = msg_mms_create_message();
-
-       memset(&meta, 0x00, sizeof(MMS_SMIL_META));
-
-       page = msg_mms_add_page(mms_data, 5440);
-}
-void cleanup(void)
-{
-       msg_mms_destroy_message(mms_data);
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_mms_add_meta_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_mms_add_meta(mms_data, &meta);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_mms_add_meta_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MMS_MEDIA_S*    media = NULL;
-
-       err = msg_mms_add_meta(NULL, &meta);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_mms_add_meta.h b/TC/msgTC/MapiMessage/utc_msg_mms_add_meta.h
deleted file mode 100755 (executable)
index 0043839..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_mms_add_meta_001(void);
- static void utc_msg_mms_add_meta_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_mms_add_meta_001,1},
-                       { utc_msg_mms_add_meta_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_mms_add_page.c b/TC/msgTC/MapiMessage/utc_msg_mms_add_page.c
deleted file mode 100755 (executable)
index 80b1427..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_mms_add_page.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MMS_MESSAGE_DATA_S*     mms_data;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-       mms_data = msg_mms_create_message();
-}
-void cleanup(void)
-{
-       msg_mms_destroy_message(mms_data);
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_mms_set_message_body_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MMS_PAGE_S*             page;
-
-       page = msg_mms_add_page(mms_data, 5440);
-       if (page == NULL)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_mms_set_message_body_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MMS_PAGE_S*             page;
-
-       page = msg_mms_add_page(NULL, 5440);
-       if (page == NULL)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_mms_add_page.h b/TC/msgTC/MapiMessage/utc_msg_mms_add_page.h
deleted file mode 100755 (executable)
index 8c2da09..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_mms_set_message_body_001(void);
- static void utc_msg_mms_set_message_body_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_mms_set_message_body_001,1},
-                       { utc_msg_mms_set_message_body_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_mms_add_region.c b/TC/msgTC/MapiMessage/utc_msg_mms_add_region.c
deleted file mode 100755 (executable)
index ac744e9..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_mms_add_region.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MMS_MESSAGE_DATA_S*     mms_data;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MMS_PAGE_S*     page[2];
-       MMS_MEDIA_S*    media[5];
-       MMS_ATTACH_S*   attachment[5];
-       int                             nSize;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-       mms_data = msg_mms_create_message();
-}
-void cleanup(void)
-{
-       msg_mms_destroy_message(mms_data);
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_mms_add_region_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MMS_SMIL_REGION* region = NULL;
-
-       region = msg_mms_add_region(mms_data, "Image", 0, 50, 100, 50, 0xffffff);
-       if (region == NULL)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_mms_add_region_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MMS_SMIL_REGION* region = NULL;
-
-       region = msg_mms_add_region(NULL, "Image", 0, 50, 100, 50, 0xffffff);
-       if (region == NULL)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_mms_add_region.h b/TC/msgTC/MapiMessage/utc_msg_mms_add_region.h
deleted file mode 100755 (executable)
index 5d7f49f..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_mms_add_region_001(void);
- static void utc_msg_mms_add_region_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_mms_add_region_001,1},
-                       { utc_msg_mms_add_region_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_mms_add_transition.c b/TC/msgTC/MapiMessage/utc_msg_mms_add_transition.c
deleted file mode 100755 (executable)
index 11eeae6..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_mms_add_transition.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MMS_MESSAGE_DATA_S*     mms_data;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MMS_PAGE_S*     page[2];
-       MMS_MEDIA_S*    media[5];
-       MMS_ATTACH_S*   attachment[5];
-       int                             nSize;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-       mms_data = msg_mms_create_message();
-}
-void cleanup(void)
-{
-       msg_mms_destroy_message(mms_data);
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_mms_add_transition_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MMS_SMIL_TRANSITION transition;
-
-       memset(&transition, 0x00, sizeof(transition));
-
-       err = msg_mms_add_transition(mms_data, &transition);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_mms_add_transition_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MMS_SMIL_TRANSITION transition;
-
-       memset(&transition, 0x00, sizeof(transition));
-
-       err = msg_mms_add_transition(NULL, &transition);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_mms_add_transition.h b/TC/msgTC/MapiMessage/utc_msg_mms_add_transition.h
deleted file mode 100755 (executable)
index 12d547e..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_mms_add_transition_001(void);
- static void utc_msg_mms_add_transition_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_mms_add_transition_001,1},
-                       { utc_msg_mms_add_transition_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_mms_create_message.c b/TC/msgTC/MapiMessage/utc_msg_mms_create_message.c
deleted file mode 100755 (executable)
index 74360e0..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_mms_create_message.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MMS_PAGE_S*     page[2];
-       MMS_MEDIA_S*    media[5];
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_mms_create_message_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MMS_MESSAGE_DATA_S*      mms_data = NULL;
-
-       mms_data = msg_mms_create_message();
-       if (mms_data == NULL)
-       {
-               tet_result(TET_FAIL);
-               msg_mms_destroy_message(mms_data);
-               return;
-       }
-
-       tet_result(TET_PASS);
-       msg_mms_destroy_message(mms_data);
-}
-
-void utc_msg_mms_create_message_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MMS_MESSAGE_DATA_S*      mms_data = NULL;
-
-       //mms_data = msg_mms_create_message();
-       if (mms_data == NULL)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_mms_create_message.h b/TC/msgTC/MapiMessage/utc_msg_mms_create_message.h
deleted file mode 100755 (executable)
index 4f776f3..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_mms_create_message_001(void);
- static void utc_msg_mms_create_message_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_mms_create_message_001,1},
-                       { utc_msg_mms_create_message_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_mms_destroy_message.c b/TC/msgTC/MapiMessage/utc_msg_mms_destroy_message.c
deleted file mode 100755 (executable)
index a399ad3..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_mms_destroy_message.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MMS_MESSAGE_DATA_S*     mms_data;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MMS_PAGE_S*     page[2];
-       MMS_MEDIA_S*    media[5];
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-       mms_data = msg_mms_create_message();
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_mms_destroy_message_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_mms_destroy_message(mms_data);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_mms_destroy_message_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_mms_destroy_message(NULL);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_mms_destroy_message.h b/TC/msgTC/MapiMessage/utc_msg_mms_destroy_message.h
deleted file mode 100755 (executable)
index c36cda2..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_mms_destroy_message_001(void);
- static void utc_msg_mms_destroy_message_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_mms_destroy_message_001,1},
-                       { utc_msg_mms_destroy_message_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_mms_get_attachment.c b/TC/msgTC/MapiMessage/utc_msg_mms_get_attachment.c
deleted file mode 100755 (executable)
index e02d7ba..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_mms_get_attachment.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MMS_MESSAGE_DATA_S*     mms_data;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MMS_PAGE_S*     page[2];
-       MMS_MEDIA_S*    media[5];
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-       mms_data = msg_mms_create_message();
-
-       msg_mms_set_rootlayout(mms_data, 100, 100, 0xffffff);
-       msg_mms_add_region(mms_data, "Image", 0, 50, 100, 50, 0xffffff);
-       msg_mms_add_region(mms_data, "Text", 0, 0, 100, 50, 0xffffff);
-
-       //------------>  1st Slide Composing
-       page[0] = msg_mms_add_page(mms_data, 5440);
-
-       media[0] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_IMG, "Image", (char*)"/opt/etc/msg-service/P091120_104633.jpg");
-       media[1] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_AUDIO, NULL, (char*)"/opt/etc/msg-service/audio.amr");
-       media[2] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_TEXT, "Text", (char*)"/opt/etc/msg-service/Temp0_2.txt");
-       media[2]->sMedia.sText.nColor = 0x000000;
-       media[2]->sMedia.sText.nSize = MMS_SMIL_FONT_SIZE_NORMAL;
-       media[2]->sMedia.sText.bBold = true;
-
-       //------------>  2nd Slide Composing
-       page[1] = msg_mms_add_page(mms_data, 4544);
-
-       media[3] = msg_mms_add_media(page[1], MMS_SMIL_MEDIA_TEXT, "Text", (char*)"/opt/etc/msg-service/Temp1_0.txt");
-       media[3]->sMedia.sText.nColor = 0x000000;
-       media[3]->sMedia.sText.nSize = MMS_SMIL_FONT_SIZE_NORMAL;
-       media[3]->sMedia.sText.bItalic = true;
-       media[4] = msg_mms_add_media(page[1], MMS_SMIL_MEDIA_VIDEO, "Text", (char*)"/opt/etc/msg-service/V091120_104905.3gp");
-       strncpy(media[4]->szAlt, "Video Load Fail", MAX_SMIL_ALT_LEN-1);
-
-       msg_mms_add_attachment(mms_data, "/opt/etc/msg-service/Temp1_0.txt");
-
-}
-void cleanup(void)
-{
-       msg_mms_destroy_message(mms_data);
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_mms_get_attachment_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       MMS_ATTACH_S*   pAttach = msg_mms_get_attachment(mms_data, 0);
-       if (pAttach == NULL)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_mms_get_attachment_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       MMS_ATTACH_S*   pAttach = msg_mms_get_attachment(mms_data, -1);
-       if (pAttach == NULL)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_mms_get_attachment.h b/TC/msgTC/MapiMessage/utc_msg_mms_get_attachment.h
deleted file mode 100755 (executable)
index f8d658a..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_mms_get_attachment_001(void);
- static void utc_msg_mms_get_attachment_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_mms_get_attachment_001,1},
-                       { utc_msg_mms_get_attachment_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_mms_get_media.c b/TC/msgTC/MapiMessage/utc_msg_mms_get_media.c
deleted file mode 100755 (executable)
index 806a988..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_mms_get_media.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MMS_MESSAGE_DATA_S*     mms_data;
-MMS_PAGE_S*    page[2];
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MMS_MEDIA_S*    media[5];
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-       mms_data = msg_mms_create_message();
-
-       msg_mms_set_rootlayout(mms_data, 100, 100, 0xffffff);
-       msg_mms_add_region(mms_data, "Image", 0, 50, 100, 50, 0xffffff);
-       msg_mms_add_region(mms_data, "Text", 0, 0, 100, 50, 0xffffff);
-
-       //------------>  1st Slide Composing
-       page[0] = msg_mms_add_page(mms_data, 5440);
-
-       media[0] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_IMG, "Image", (char*)"/opt/etc/msg-service/P091120_104633.jpg");
-       media[1] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_AUDIO, NULL, (char*)"/opt/etc/msg-service/audio.amr");
-       media[2] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_TEXT, "Text", (char*)"/opt/etc/msg-service/Temp0_2.txt");
-       media[2]->sMedia.sText.nColor = 0x000000;
-       media[2]->sMedia.sText.nSize = MMS_SMIL_FONT_SIZE_NORMAL;
-       media[2]->sMedia.sText.bBold = true;
-
-       //------------>  2nd Slide Composing
-       page[1] = msg_mms_add_page(mms_data, 4544);
-
-       media[3] = msg_mms_add_media(page[1], MMS_SMIL_MEDIA_TEXT, "Text", (char*)"/opt/etc/msg-service/Temp1_0.txt");
-       media[3]->sMedia.sText.nColor = 0x000000;
-       media[3]->sMedia.sText.nSize = MMS_SMIL_FONT_SIZE_NORMAL;
-       media[3]->sMedia.sText.bItalic = true;
-       media[4] = msg_mms_add_media(page[1], MMS_SMIL_MEDIA_VIDEO, "Text", (char*)"/opt/etc/msg-service/V091120_104905.3gp");
-       strncpy(media[4]->szAlt, "Video Load Fail", MAX_SMIL_ALT_LEN-1);
-
-       msg_set_message_type(msgInfo, MSG_TYPE_MMS);
-
-}
-void cleanup(void)
-{
-       msg_mms_destroy_message(mms_data);
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_mms_get_media_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MMS_MEDIA_S* tmpMedia = NULL;
-
-       tmpMedia = msg_mms_get_media(page[0], 0);
-       if (tmpMedia == NULL)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_mms_get_media_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MMS_MEDIA_S* tmpMedia = NULL;
-
-       tmpMedia = msg_mms_get_media(page[0], -1);
-       if (tmpMedia == NULL)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_mms_get_media.h b/TC/msgTC/MapiMessage/utc_msg_mms_get_media.h
deleted file mode 100755 (executable)
index fc3f338..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_mms_get_media_001(void);
- static void utc_msg_mms_get_media_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_mms_get_media_001,1},
-                       { utc_msg_mms_get_media_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_mms_get_message_body.c b/TC/msgTC/MapiMessage/utc_msg_mms_get_message_body.c
deleted file mode 100755 (executable)
index e159279..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_mms_get_message_body.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MMS_MESSAGE_DATA_S*     mms_data;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MMS_PAGE_S*     page[2];
-       MMS_MEDIA_S*    media[5];
-       MMS_ATTACH_S*   attachment[5];
-       int                             nSize;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-
-       mms_data = msg_mms_create_message();
-
-       msg_mms_set_rootlayout(mms_data, 100, 100, 0xffffff);
-       msg_mms_add_region(mms_data, "Image", 0, 50, 100, 50, 0xffffff);
-       msg_mms_add_region(mms_data, "Text", 0, 0, 100, 50, 0xffffff);
-
-       //------------>  1st Slide Composing
-       page[0] = msg_mms_add_page(mms_data, 5440);
-
-       media[0] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_IMG, "Image", (char*)"/opt/etc/msg-service/P091120_104633.jpg");
-       media[1] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_AUDIO, NULL, (char*)"/opt/etc/msg-service/audio.amr");
-       media[2] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_TEXT, "Text", (char*)"/opt/etc/msg-service/Temp0_2.txt");
-       media[2]->sMedia.sText.nColor = 0x000000;
-       media[2]->sMedia.sText.nSize = MMS_SMIL_FONT_SIZE_NORMAL;
-       media[2]->sMedia.sText.bBold = true;
-
-       //------------>  2nd Slide Composing
-       page[1] = msg_mms_add_page(mms_data, 4544);
-
-       media[3] = msg_mms_add_media(page[1], MMS_SMIL_MEDIA_TEXT, "Text", (char*)"/opt/etc/msg-service/Temp1_0.txt");
-       media[3]->sMedia.sText.nColor = 0x000000;
-       media[3]->sMedia.sText.nSize = MMS_SMIL_FONT_SIZE_NORMAL;
-       media[3]->sMedia.sText.bItalic = true;
-       media[4] = msg_mms_add_media(page[1], MMS_SMIL_MEDIA_VIDEO, "Text", (char*)"/opt/etc/msg-service/V091120_104905.3gp");
-       strncpy(media[4]->szAlt, "Video Load Fail", MAX_SMIL_ALT_LEN-1);
-
-       msg_set_message_type(msgInfo, MSG_TYPE_MMS);
-
-       msg_mms_set_message_body(msgInfo, mms_data);
-
-}
-void cleanup(void)
-{
-       msg_mms_destroy_message(mms_data);
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_get_message_id_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MMS_MESSAGE_DATA_S body;
-
-       err = msg_mms_get_message_body(msgInfo, &body);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_get_message_id_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MMS_MESSAGE_DATA_S body;
-
-       err = msg_mms_get_message_body(NULL, &body);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_mms_get_message_body.h b/TC/msgTC/MapiMessage/utc_msg_mms_get_message_body.h
deleted file mode 100755 (executable)
index f8aa1b0..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_get_message_id_001(void);
- static void utc_msg_get_message_id_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_get_message_id_001,1},
-                       { utc_msg_get_message_id_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_mms_get_meta.c b/TC/msgTC/MapiMessage/utc_msg_mms_get_meta.c
deleted file mode 100755 (executable)
index 5baaf29..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_mms_get_meta.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MMS_MESSAGE_DATA_S*     mms_data;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MMS_PAGE_S*     page[2];
-       MMS_MEDIA_S*    media[5];
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-       mms_data = msg_mms_create_message();
-
-       msg_mms_set_rootlayout(mms_data, 100, 100, 0xffffff);
-       msg_mms_add_region(mms_data, "Image", 0, 50, 100, 50, 0xffffff);
-       msg_mms_add_region(mms_data, "Text", 0, 0, 100, 50, 0xffffff);
-
-       //------------>  1st Slide Composing
-       page[0] = msg_mms_add_page(mms_data, 5440);
-
-       media[0] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_IMG, "Image", (char*)"/opt/etc/msg-service/P091120_104633.jpg");
-       media[1] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_AUDIO, NULL, (char*)"/opt/etc/msg-service/audio.amr");
-       media[2] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_TEXT, "Text", (char*)"/opt/etc/msg-service/Temp0_2.txt");
-       media[2]->sMedia.sText.nColor = 0x000000;
-       media[2]->sMedia.sText.nSize = MMS_SMIL_FONT_SIZE_NORMAL;
-       media[2]->sMedia.sText.bBold = true;
-
-       //------------>  2nd Slide Composing
-       page[1] = msg_mms_add_page(mms_data, 4544);
-
-       media[3] = msg_mms_add_media(page[1], MMS_SMIL_MEDIA_TEXT, "Text", (char*)"/opt/etc/msg-service/Temp1_0.txt");
-       media[3]->sMedia.sText.nColor = 0x000000;
-       media[3]->sMedia.sText.nSize = MMS_SMIL_FONT_SIZE_NORMAL;
-       media[3]->sMedia.sText.bItalic = true;
-       media[4] = msg_mms_add_media(page[1], MMS_SMIL_MEDIA_VIDEO, "Text", (char*)"/opt/etc/msg-service/V091120_104905.3gp");
-       strncpy(media[4]->szAlt, "Video Load Fail", MAX_SMIL_ALT_LEN-1);
-
-       MMS_SMIL_META meta = {"id", "name", "content"};
-       msg_mms_add_meta(mms_data, &meta);
-
-}
-void cleanup(void)
-{
-       msg_mms_destroy_message(mms_data);
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_mms_get_meta_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       MMS_SMIL_META* pMeta = msg_mms_get_meta(mms_data, 0);
-       if(pMeta == NULL)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_mms_get_meta_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       MMS_SMIL_META* pMeta = msg_mms_get_meta(mms_data, -1);
-       if(pMeta == NULL)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_mms_get_meta.h b/TC/msgTC/MapiMessage/utc_msg_mms_get_meta.h
deleted file mode 100755 (executable)
index caba6d9..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_mms_get_meta_001(void);
- static void utc_msg_mms_get_meta_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_mms_get_meta_001,1},
-                       { utc_msg_mms_get_meta_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_mms_get_page.c b/TC/msgTC/MapiMessage/utc_msg_mms_get_page.c
deleted file mode 100755 (executable)
index f5924a4..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_mms_get_page.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MMS_MESSAGE_DATA_S*     mms_data;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MMS_PAGE_S*     page[2];
-       MMS_MEDIA_S*    media[5];
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-       mms_data = msg_mms_create_message();
-
-       msg_mms_set_rootlayout(mms_data, 100, 100, 0xffffff);
-       msg_mms_add_region(mms_data, "Image", 0, 50, 100, 50, 0xffffff);
-       msg_mms_add_region(mms_data, "Text", 0, 0, 100, 50, 0xffffff);
-
-       //------------>  1st Slide Composing
-       page[0] = msg_mms_add_page(mms_data, 5440);
-
-       media[0] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_IMG, "Image", (char*)"/opt/etc/msg-service/P091120_104633.jpg");
-       media[1] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_AUDIO, NULL, (char*)"/opt/etc/msg-service/audio.amr");
-       media[2] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_TEXT, "Text", (char*)"/opt/etc/msg-service/Temp0_2.txt");
-       media[2]->sMedia.sText.nColor = 0x000000;
-       media[2]->sMedia.sText.nSize = MMS_SMIL_FONT_SIZE_NORMAL;
-       media[2]->sMedia.sText.bBold = true;
-
-       //------------>  2nd Slide Composing
-       page[1] = msg_mms_add_page(mms_data, 4544);
-
-       media[3] = msg_mms_add_media(page[1], MMS_SMIL_MEDIA_TEXT, "Text", (char*)"/opt/etc/msg-service/Temp1_0.txt");
-       media[3]->sMedia.sText.nColor = 0x000000;
-       media[3]->sMedia.sText.nSize = MMS_SMIL_FONT_SIZE_NORMAL;
-       media[3]->sMedia.sText.bItalic = true;
-       media[4] = msg_mms_add_media(page[1], MMS_SMIL_MEDIA_VIDEO, "Text", (char*)"/opt/etc/msg-service/V091120_104905.3gp");
-       strncpy(media[4]->szAlt, "Video Load Fail", MAX_SMIL_ALT_LEN-1);
-}
-
-void cleanup(void)
-{
-       msg_mms_destroy_message(mms_data);
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_mms_get_page_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MMS_PAGE_S* tmpPage = NULL;
-       MMS_MESSAGE_DATA_S msgBody;
-
-       msg_mms_get_message_body(msgInfo, &msgBody);
-
-       tmpPage = msg_mms_get_page(mms_data, 0);
-       if (tmpPage == NULL)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_mms_get_page_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MMS_PAGE_S* tmpPage = NULL;
-       MMS_MESSAGE_DATA_S msgBody;
-
-       msg_mms_get_message_body(NULL, &msgBody);
-
-       tmpPage = msg_mms_get_page(mms_data, -1);
-       if (tmpPage == NULL)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_mms_get_page.h b/TC/msgTC/MapiMessage/utc_msg_mms_get_page.h
deleted file mode 100755 (executable)
index 045196c..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_mms_get_page_001(void);
- static void utc_msg_mms_get_page_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_mms_get_page_001,1},
-                       { utc_msg_mms_get_page_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_mms_get_smil_region.c b/TC/msgTC/MapiMessage/utc_msg_mms_get_smil_region.c
deleted file mode 100755 (executable)
index c799a8b..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_mms_get_smil_region.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MMS_MESSAGE_DATA_S*     mms_data;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MMS_PAGE_S*     page[2];
-       MMS_MEDIA_S*    media[5];
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-       mms_data = msg_mms_create_message();
-
-       msg_mms_set_rootlayout(mms_data, 100, 100, 0xffffff);
-       msg_mms_add_region(mms_data, "Image", 0, 50, 100, 50, 0xffffff);
-       msg_mms_add_region(mms_data, "Text", 0, 0, 100, 50, 0xffffff);
-
-       //------------>  1st Slide Composing
-       page[0] = msg_mms_add_page(mms_data, 5440);
-
-       media[0] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_IMG, "Image", (char*)"/opt/etc/msg-service/P091120_104633.jpg");
-       media[1] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_AUDIO, NULL, (char*)"/opt/etc/msg-service/audio.amr");
-       media[2] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_TEXT, "Text", (char*)"/opt/etc/msg-service/Temp0_2.txt");
-       media[2]->sMedia.sText.nColor = 0x000000;
-       media[2]->sMedia.sText.nSize = MMS_SMIL_FONT_SIZE_NORMAL;
-       media[2]->sMedia.sText.bBold = true;
-
-       //------------>  2nd Slide Composing
-       page[1] = msg_mms_add_page(mms_data, 4544);
-
-       media[3] = msg_mms_add_media(page[1], MMS_SMIL_MEDIA_TEXT, "Text", (char*)"/opt/etc/msg-service/Temp1_0.txt");
-       media[3]->sMedia.sText.nColor = 0x000000;
-       media[3]->sMedia.sText.nSize = MMS_SMIL_FONT_SIZE_NORMAL;
-       media[3]->sMedia.sText.bItalic = true;
-       media[4] = msg_mms_add_media(page[1], MMS_SMIL_MEDIA_VIDEO, "Text", (char*)"/opt/etc/msg-service/V091120_104905.3gp");
-       strncpy(media[4]->szAlt, "Video Load Fail", MAX_SMIL_ALT_LEN-1);
-}
-void cleanup(void)
-{
-       msg_mms_destroy_message(mms_data);
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_mms_get_smil_region_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       MMS_SMIL_REGION* pRegion = msg_mms_get_smil_region(mms_data, 0);
-       if (pRegion == NULL)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_mms_get_smil_region_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       MMS_SMIL_REGION* pRegion = msg_mms_get_smil_region(mms_data, -1);
-       if (pRegion == NULL)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_mms_get_smil_region.h b/TC/msgTC/MapiMessage/utc_msg_mms_get_smil_region.h
deleted file mode 100755 (executable)
index f7dbd19..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_mms_get_smil_region_001(void);
- static void utc_msg_mms_get_smil_region_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_mms_get_smil_region_001,1},
-                       { utc_msg_mms_get_smil_region_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_mms_get_transition.c b/TC/msgTC/MapiMessage/utc_msg_mms_get_transition.c
deleted file mode 100755 (executable)
index 7c03eeb..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_mms_get_transition.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MMS_MESSAGE_DATA_S*     mms_data;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MMS_PAGE_S*     page[2];
-       MMS_MEDIA_S*    media[5];
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-       mms_data = msg_mms_create_message();
-
-       msg_mms_set_rootlayout(mms_data, 100, 100, 0xffffff);
-       msg_mms_add_region(mms_data, "Image", 0, 50, 100, 50, 0xffffff);
-       msg_mms_add_region(mms_data, "Text", 0, 0, 100, 50, 0xffffff);
-
-       //------------>  1st Slide Composing
-       page[0] = msg_mms_add_page(mms_data, 5440);
-
-       media[0] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_IMG, "Image", (char*)"/opt/etc/msg-service/P091120_104633.jpg");
-       media[1] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_AUDIO, NULL, (char*)"/opt/etc/msg-service/audio.amr");
-       media[2] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_TEXT, "Text", (char*)"/opt/etc/msg-service/Temp0_2.txt");
-       media[2]->sMedia.sText.nColor = 0x000000;
-       media[2]->sMedia.sText.nSize = MMS_SMIL_FONT_SIZE_NORMAL;
-       media[2]->sMedia.sText.bBold = true;
-
-       //------------>  2nd Slide Composing
-       page[1] = msg_mms_add_page(mms_data, 4544);
-
-       media[3] = msg_mms_add_media(page[1], MMS_SMIL_MEDIA_TEXT, "Text", (char*)"/opt/etc/msg-service/Temp1_0.txt");
-       media[3]->sMedia.sText.nColor = 0x000000;
-       media[3]->sMedia.sText.nSize = MMS_SMIL_FONT_SIZE_NORMAL;
-       media[3]->sMedia.sText.bItalic = true;
-       media[4] = msg_mms_add_media(page[1], MMS_SMIL_MEDIA_VIDEO, "Text", (char*)"/opt/etc/msg-service/V091120_104905.3gp");
-       strncpy(media[4]->szAlt, "Video Load Fail", MAX_SMIL_ALT_LEN-1);
-
-       MMS_SMIL_TRANSITION transition;
-
-       memset(&transition, 0x00, sizeof(transition));
-
-       msg_mms_add_transition(mms_data, &transition);
-}
-void cleanup(void)
-{
-       msg_mms_destroy_message(mms_data);
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_mms_get_transition_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       MMS_SMIL_TRANSITION* pTrans = msg_mms_get_transition(mms_data, 0);
-       if (pTrans == NULL)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_mms_get_transition_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       MMS_SMIL_TRANSITION* pTrans = msg_mms_get_transition(mms_data, -1);
-       if (pTrans == NULL)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_mms_get_transition.h b/TC/msgTC/MapiMessage/utc_msg_mms_get_transition.h
deleted file mode 100755 (executable)
index 440f77a..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_mms_get_transition_001(void);
- static void utc_msg_mms_get_transition_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_mms_get_transition_001,1},
-                       { utc_msg_mms_get_transition_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_mms_set_message_body.c b/TC/msgTC/MapiMessage/utc_msg_mms_set_message_body.c
deleted file mode 100755 (executable)
index b1637e6..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_mms_set_message_body.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MMS_MESSAGE_DATA_S*     mms_data;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MMS_PAGE_S*     page[2];
-       MMS_MEDIA_S*    media[5];
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-       mms_data = msg_mms_create_message();
-
-       msg_mms_set_rootlayout(mms_data, 100, 100, 0xffffff);
-       msg_mms_add_region(mms_data, "Image", 0, 50, 100, 50, 0xffffff);
-       msg_mms_add_region(mms_data, "Text", 0, 0, 100, 50, 0xffffff);
-
-       //------------>  1st Slide Composing
-       page[0] = msg_mms_add_page(mms_data, 5440);
-
-       media[0] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_IMG, "Image", (char*)"/opt/etc/msg-service/P091120_104633.jpg");
-       media[1] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_AUDIO, NULL, (char*)"/opt/etc/msg-service/audio.amr");
-       media[2] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_TEXT, "Text", (char*)"/opt/etc/msg-service/Temp0_2.txt");
-       media[2]->sMedia.sText.nColor = 0x000000;
-       media[2]->sMedia.sText.nSize = MMS_SMIL_FONT_SIZE_NORMAL;
-       media[2]->sMedia.sText.bBold = true;
-
-       //------------>  2nd Slide Composing
-       page[1] = msg_mms_add_page(mms_data, 4544);
-
-       media[3] = msg_mms_add_media(page[1], MMS_SMIL_MEDIA_TEXT, "Text", (char*)"/opt/etc/msg-service/Temp1_0.txt");
-       media[3]->sMedia.sText.nColor = 0x000000;
-       media[3]->sMedia.sText.nSize = MMS_SMIL_FONT_SIZE_NORMAL;
-       media[3]->sMedia.sText.bItalic = true;
-       media[4] = msg_mms_add_media(page[1], MMS_SMIL_MEDIA_VIDEO, "Text", (char*)"/opt/etc/msg-service/V091120_104905.3gp");
-       strncpy(media[4]->szAlt, "Video Load Fail", MAX_SMIL_ALT_LEN-1);
-
-       msg_set_message_type(msgInfo, MSG_TYPE_MMS);
-}
-void cleanup(void)
-{
-       msg_mms_destroy_message(mms_data);
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_mms_set_message_body_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_mms_set_message_body(msgInfo, mms_data);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_mms_set_message_body_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_mms_set_message_body(NULL, mms_data);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_mms_set_message_body.h b/TC/msgTC/MapiMessage/utc_msg_mms_set_message_body.h
deleted file mode 100755 (executable)
index 4c8201b..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_mms_set_message_body_001(void);
- static void utc_msg_mms_set_message_body_002(void);
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_mms_set_message_body_001,1},
-                       { utc_msg_mms_set_message_body_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_mms_set_rootlayout.c b/TC/msgTC/MapiMessage/utc_msg_mms_set_rootlayout.c
deleted file mode 100755 (executable)
index f4c9372..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_mms_set_rootlayout.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MMS_MESSAGE_DATA_S*     mms_data;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MMS_PAGE_S*     page[2];
-       MMS_MEDIA_S*    media[5];
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-       mms_data = msg_mms_create_message();
-}
-void cleanup(void)
-{
-       msg_mms_destroy_message(mms_data);
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_mms_set_rootlayout_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       MMS_SMIL_ROOTLAYOUT* pLayout = msg_mms_set_rootlayout(mms_data, 100, 100, 0xffffff);
-       if (pLayout == NULL)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_mms_set_rootlayout_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       MMS_SMIL_ROOTLAYOUT* pLayout = msg_mms_set_rootlayout(NULL, 100, 100, 0xffffff);
-       if (pLayout == NULL)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_mms_set_rootlayout.h b/TC/msgTC/MapiMessage/utc_msg_mms_set_rootlayout.h
deleted file mode 100755 (executable)
index 9bd5632..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_mms_set_rootlayout_001(void);
- static void utc_msg_mms_set_rootlayout_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_mms_set_rootlayout_001,1},
-                       { utc_msg_mms_set_rootlayout_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_new_message.c b/TC/msgTC/MapiMessage/utc_msg_new_message.c
deleted file mode 100755 (executable)
index c233775..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_new_message.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_new_message_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       msgInfo = msg_new_message();
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_new_message_002()
-{
-       MSG_ERROR_T err = -1;
-
-       msgInfo = msg_new_message();
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_new_message.h b/TC/msgTC/MapiMessage/utc_msg_new_message.h
deleted file mode 100755 (executable)
index 9a9c81f..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
-static void utc_msg_new_message_001(void);
-static void utc_msg_new_message_002(void);
-
-
-
-struct tet_testlist tet_testlist[] =
-{
-                       { utc_msg_new_message_001,1},
-                       { utc_msg_new_message_002,2},
-                       {NULL,0}
-};
diff --git a/TC/msgTC/MapiMessage/utc_msg_release_message.c b/TC/msgTC/MapiMessage/utc_msg_release_message.c
deleted file mode 100755 (executable)
index af43669..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_release_message.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_release_message_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_release_message(msgInfo);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_release_message_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_release_message(NULL);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_release_message.h b/TC/msgTC/MapiMessage/utc_msg_release_message.h
deleted file mode 100755 (executable)
index f4d9a63..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_release_message_001(void);
- static void utc_msg_release_message_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_release_message_001,1},
-                       { utc_msg_release_message_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_reset_address.c b/TC/msgTC/MapiMessage/utc_msg_reset_address.c
deleted file mode 100755 (executable)
index a2cc4c2..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_reset_address.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_reset_address_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_reset_address(msgInfo);
-       if (err)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_reset_address_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_reset_address(NULL);
-       if (err)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_reset_address.h b/TC/msgTC/MapiMessage/utc_msg_reset_address.h
deleted file mode 100755 (executable)
index ba7d677..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_reset_address_001(void);
- static void utc_msg_reset_address_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_reset_address_001,1},
-                       { utc_msg_reset_address_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_set_direction_info.c b/TC/msgTC/MapiMessage/utc_msg_set_direction_info.c
deleted file mode 100755 (executable)
index 56e1c50..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_set_direction_info.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_set_direction_info_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_set_direction_info(msgInfo, MSG_DIRECTION_TYPE_MT);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_set_direction_info_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_set_direction_info(NULL, MSG_DIRECTION_TYPE_MT);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_set_direction_info.h b/TC/msgTC/MapiMessage/utc_msg_set_direction_info.h
deleted file mode 100755 (executable)
index 9e337bd..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_set_direction_info_001(void);
- static void utc_msg_set_direction_info_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_set_direction_info_001,1},
-                       { utc_msg_set_direction_info_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_set_encode_type.c b/TC/msgTC/MapiMessage/utc_msg_set_encode_type.c
deleted file mode 100755 (executable)
index 235136e..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_set_encode_type.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_set_encode_type_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_set_encode_type(msgInfo, MSG_ENCODE_GSM7BIT);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_set_encode_type_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_set_encode_type(NULL, MSG_ENCODE_GSM7BIT);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_set_encode_type.h b/TC/msgTC/MapiMessage/utc_msg_set_encode_type.h
deleted file mode 100755 (executable)
index 78ca9f6..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_set_encode_type_001(void);
- static void utc_msg_set_encode_type_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_set_encode_type_001,1},
-                       { utc_msg_set_encode_type_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_set_folder_id.c b/TC/msgTC/MapiMessage/utc_msg_set_folder_id.c
deleted file mode 100755 (executable)
index 4477be0..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_set_folder_id.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_set_folder_id_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_set_folder_id(msgInfo, MSG_INBOX_ID);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_set_folder_id_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_set_folder_id(NULL, MSG_INBOX_ID);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_set_folder_id.h b/TC/msgTC/MapiMessage/utc_msg_set_folder_id.h
deleted file mode 100755 (executable)
index 141ad03..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MsgStorageTypes.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_set_folder_id_001(void);
- static void utc_msg_set_folder_id_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_set_folder_id_001,1},
-                       { utc_msg_set_folder_id_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_set_message_id.c b/TC/msgTC/MapiMessage/utc_msg_set_message_id.c
deleted file mode 100755 (executable)
index c57a5c4..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_set_message_id.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_set_message_id_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_set_message_id(msgInfo, 1);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_set_message_id_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_set_message_id(NULL, 1);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_set_message_id.h b/TC/msgTC/MapiMessage/utc_msg_set_message_id.h
deleted file mode 100755 (executable)
index 5fc1f6f..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_set_message_id_001(void);
- static void utc_msg_set_message_id_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_set_message_id_001,1},
-                       { utc_msg_set_message_id_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_set_message_type.c b/TC/msgTC/MapiMessage/utc_msg_set_message_type.c
deleted file mode 100755 (executable)
index 6fcf782..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_set_message_type.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_set_message_type_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_set_message_type(msgInfo, MSG_TYPE_SMS);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_set_message_type_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_set_message_type(NULL, MSG_TYPE_SMS);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_set_message_type.h b/TC/msgTC/MapiMessage/utc_msg_set_message_type.h
deleted file mode 100755 (executable)
index 1b400d6..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_set_message_type_001(void);
- static void utc_msg_set_message_type_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_set_message_type_001,1},
-                       { utc_msg_set_message_type_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_set_network_status.c b/TC/msgTC/MapiMessage/utc_msg_set_network_status.c
deleted file mode 100755 (executable)
index 5cab121..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_set_network_status.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_set_network_status_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_set_network_status(msgInfo, MSG_NETWORK_SEND_SUCCESS);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_set_network_status_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_set_network_status(NULL, MSG_NETWORK_SEND_SUCCESS);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_set_network_status.h b/TC/msgTC/MapiMessage/utc_msg_set_network_status.h
deleted file mode 100755 (executable)
index 7418f95..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_set_network_status_001(void);
- static void utc_msg_set_network_status_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_set_network_status_001,1},
-                       { utc_msg_set_network_status_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_set_port.c b/TC/msgTC/MapiMessage/utc_msg_set_port.c
deleted file mode 100755 (executable)
index 4c90148..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_set_port.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_set_port_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_set_port(msgInfo, 656, 656);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_set_port_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_set_port(NULL, 656, 656);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_set_port.h b/TC/msgTC/MapiMessage/utc_msg_set_port.h
deleted file mode 100755 (executable)
index 3d71a1c..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_set_port_001(void);
- static void utc_msg_set_port_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_set_port_001,1},
-                       { utc_msg_set_port_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_set_priority_info.c b/TC/msgTC/MapiMessage/utc_msg_set_priority_info.c
deleted file mode 100755 (executable)
index 8d01de0..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_set_priority_info.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_set_priority_info_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_set_priority_info(msgInfo, MSG_MESSAGE_PRIORITY_NORMAL);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_set_priority_info_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_set_priority_info(NULL, MSG_MESSAGE_PRIORITY_NORMAL);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_set_priority_info.h b/TC/msgTC/MapiMessage/utc_msg_set_priority_info.h
deleted file mode 100755 (executable)
index b95c18d..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_set_priority_info_001(void);
- static void utc_msg_set_priority_info_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_set_priority_info_001,1},
-                       { utc_msg_set_priority_info_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_set_protect_status.c b/TC/msgTC/MapiMessage/utc_msg_set_protect_status.c
deleted file mode 100755 (executable)
index e69d84d..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_set_protect_status.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_set_protect_status_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_set_protect_status(msgInfo, true);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_set_protect_status_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_set_protect_status(NULL, true);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_set_protect_status.h b/TC/msgTC/MapiMessage/utc_msg_set_protect_status.h
deleted file mode 100755 (executable)
index b6e797a..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_set_protect_status_001(void);
- static void utc_msg_set_protect_status_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_set_protect_status_001,1},
-                       { utc_msg_set_protect_status_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_set_read_status.c b/TC/msgTC/MapiMessage/utc_msg_set_read_status.c
deleted file mode 100755 (executable)
index cd92d34..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_set_read_status.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_set_read_status_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_set_read_status(msgInfo, true);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_set_read_status_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_set_read_status(NULL, true);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_set_read_status.h b/TC/msgTC/MapiMessage/utc_msg_set_read_status.h
deleted file mode 100755 (executable)
index 89c9392..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_set_read_status_001(void);
- static void utc_msg_set_read_status_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_set_read_status_001,1},
-                       { utc_msg_set_read_status_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_set_scheduled_time.c b/TC/msgTC/MapiMessage/utc_msg_set_scheduled_time.c
deleted file mode 100755 (executable)
index 77c4b6e..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_set_scheduled_time.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_set_scheduled_time_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       time_t scheduledTime;
-       time(&scheduledTime);
-
-       err = msg_set_scheduled_time(msgInfo, scheduledTime);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_set_scheduled_time_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       time_t scheduledTime;
-       time(&scheduledTime);
-
-       err = msg_set_scheduled_time(NULL, scheduledTime);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_set_scheduled_time.h b/TC/msgTC/MapiMessage/utc_msg_set_scheduled_time.h
deleted file mode 100755 (executable)
index 8e0051c..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_set_scheduled_time_001(void);
- static void utc_msg_set_scheduled_time_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_set_scheduled_time_001,1},
-                       { utc_msg_set_scheduled_time_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_set_storage_id.c b/TC/msgTC/MapiMessage/utc_msg_set_storage_id.c
deleted file mode 100755 (executable)
index f835cbc..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_set_storage_id.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_set_storage_id_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_set_storage_id(msgInfo, MSG_STORAGE_PHONE);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_set_storage_id_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_set_storage_id(NULL, MSG_STORAGE_PHONE);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_set_storage_id.h b/TC/msgTC/MapiMessage/utc_msg_set_storage_id.h
deleted file mode 100755 (executable)
index 5942c72..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MsgStorageTypes.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_set_storage_id_001(void);
- static void utc_msg_set_storage_id_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_set_storage_id_001,1},
-                       { utc_msg_set_storage_id_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_set_subject.c b/TC/msgTC/MapiMessage/utc_msg_set_subject.c
deleted file mode 100755 (executable)
index 66eaac1..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_set_subject.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_set_subject_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_set_subject(msgInfo, "test subject");
-       if (err < MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_set_subject_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_set_subject(NULL, "test subject");
-       if (err < MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_set_subject.h b/TC/msgTC/MapiMessage/utc_msg_set_subject.h
deleted file mode 100755 (executable)
index 7485c75..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_set_subject_001(void);
- static void utc_msg_set_subject_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_set_subject_001,1},
-                       { utc_msg_set_subject_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_set_time.c b/TC/msgTC/MapiMessage/utc_msg_set_time.c
deleted file mode 100755 (executable)
index 884e4df..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_set_time.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_set_time_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       time_t curTime = time(NULL);
-
-       err = msg_set_time(msgInfo, curTime);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_set_time_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       time_t curTime = time(NULL);
-
-       err = msg_set_time(NULL, curTime);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_set_time.h b/TC/msgTC/MapiMessage/utc_msg_set_time.h
deleted file mode 100755 (executable)
index 1a6f132..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_set_time_001(void);
- static void utc_msg_set_time_002(void);
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_set_time_001,1},
-                       { utc_msg_set_time_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_sms_get_message_body.c b/TC/msgTC/MapiMessage/utc_msg_sms_get_message_body.c
deleted file mode 100755 (executable)
index bdb5e5d..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_sms_get_message_body.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-
-       msg_sms_set_message_body(msgInfo, "test message", 12);
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_sms_get_message_body_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       char * address = NULL;
-
-       address = msg_sms_get_message_body(msgInfo);
-       if (address == NULL)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_sms_get_message_body_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       char * address = NULL;
-
-       address = msg_sms_get_message_body(NULL);
-       if (address == NULL)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_sms_get_message_body.h b/TC/msgTC/MapiMessage/utc_msg_sms_get_message_body.h
deleted file mode 100755 (executable)
index 8756de0..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_sms_get_message_body_001(void);
- static void utc_msg_sms_get_message_body_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_sms_get_message_body_001,1},
-                       { utc_msg_sms_get_message_body_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiMessage/utc_msg_sms_set_message_body.c b/TC/msgTC/MapiMessage/utc_msg_sms_set_message_body.c
deleted file mode 100755 (executable)
index 4169921..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_sms_set_message_body.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_sms_set_message_body_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_sms_set_message_body(msgInfo, "test message", 12);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_sms_set_message_body_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_sms_set_message_body(NULL, "test message", 12);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiMessage/utc_msg_sms_set_message_body.h b/TC/msgTC/MapiMessage/utc_msg_sms_set_message_body.h
deleted file mode 100755 (executable)
index f2fdb2b..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_sms_set_message_body_001(void);
- static void utc_msg_sms_set_message_body_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_sms_set_message_body_001,1},
-                       { utc_msg_sms_set_message_body_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiSetting/Makefile b/TC/msgTC/MapiSetting/Makefile
deleted file mode 100755 (executable)
index 1be4616..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-###################################################
-# add your TestCase List Here
-#
-# e.g.,
-# TC1 = utc_frameworkName_apiName_func
-# TC2 = utc_ApplicationLib_recurGetDayOfWeek_func
-TC1 = utc_msg_get_config
-TC2 = utc_msg_set_config
-       
-###################################################
-# add your Package Config Info Here
-#
-# e.g.,
-# PKGS=calendar
-PKGS=msg-service
-
-LIBS  = `pkg-config --libs $(PKGS)` 
-LIBS +=$(TET_ROOT)/lib/tet3/tcm_s.o
-LIBS +=-L$(TET_ROOT)/lib/tet3 -ltcm_s
-LIBS +=-L$(TET_ROOT)/lib/tet3 -lapi_s
-
-INCS  =  -I. `pkg-config --cflags $(PKGS)`
-INCS  += -I$(TET_ROOT)/inc/tet3 
-
-CFLAGS = $(INCS)
-CFLAGS += -D_TETWARE_MODE
-#CC +=$(CFLAGS)
-LDFLAGS = $(LIBS)
-
-###################################################
-# Modify here 
-# depending on the Test Case you want to build
-# 
-# e.g.,
-# TCLIST = $(TC1) $(TC2)
-TCLIST = $(TC1) $(TC2) 
-all :
-       for testcase in $(TCLIST) do\
-               $(CC) -o $$(testcase) $$(testcase).c $(CFLAGS) $(LDFLAGS)
-       done
-
-clean :
-       rm -rf *~ *.o $(TCLIST)
-
-
-$(TC1) : 
-       $(CC) -o $(TC1) $(TC1).c  $(CFLAGS) $(LDFLAGS)
-
-
-$(TC2) : 
-       $(CC) -o $(TC2) $(TC2).c  $(CFLAGS) $(LDFLAGS)
diff --git a/TC/msgTC/MapiSetting/tslist b/TC/msgTC/MapiSetting/tslist
deleted file mode 100755 (executable)
index 00c37f8..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-utc_msg_get_config\r
-utc_msg_set_config
\ No newline at end of file
diff --git a/TC/msgTC/MapiSetting/utc_msg_get_config.c b/TC/msgTC/MapiSetting/utc_msg_get_config.c
deleted file mode 100755 (executable)
index b431a2c..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_get_config.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-MSG_SETTING_S setting;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       memset(&setting, 0x00, sizeof(MSG_OPTION_TYPE_T)+sizeof(MSG_GENERAL_OPT_S));
-
-       setting.type = MSG_GENERAL_OPT;
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_get_config_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_get_config(msgHandle, &setting);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_get_config_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_get_config(NULL, &setting);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiSetting/utc_msg_get_config.h b/TC/msgTC/MapiSetting/utc_msg_get_config.h
deleted file mode 100755 (executable)
index 30acbcf..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiSetting.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_get_config_001(void);
- static void utc_msg_get_config_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_get_config_001,1},
-                       { utc_msg_get_config_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiSetting/utc_msg_set_config.c b/TC/msgTC/MapiSetting/utc_msg_set_config.c
deleted file mode 100755 (executable)
index 1b1ab5d..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_set_config.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-MSG_SETTING_S setting;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       memset(&setting, 0x00, sizeof(MSG_OPTION_TYPE_T)+sizeof(MSG_GENERAL_OPT_S));
-
-       setting.type = MSG_GENERAL_OPT;
-
-       msg_get_config(msgHandle, &setting);
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_set_config_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_set_config(msgHandle, &setting);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_set_config_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_set_config(NULL, &setting);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiSetting/utc_msg_set_config.h b/TC/msgTC/MapiSetting/utc_msg_set_config.h
deleted file mode 100755 (executable)
index 71560ce..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiSetting.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
- static void utc_msg_set_config_001(void);
- static void utc_msg_set_config_002(void);
-
-
-
- struct tet_testlist tet_testlist[] =  {
-                       { utc_msg_set_config_001,1},
-                       { utc_msg_set_config_002,2},
-                       {NULL,0}
- };
diff --git a/TC/msgTC/MapiStorage/Makefile b/TC/msgTC/MapiStorage/Makefile
deleted file mode 100755 (executable)
index c2ce1d9..0000000
+++ /dev/null
@@ -1,195 +0,0 @@
-###################################################
-# add your TestCase List Here
-#
-# e.g.,
-# TC1 = utc_frameworkName_apiName_func
-# TC2 = utc_ApplicationLib_recurGetDayOfWeek_func
-TC1 = utc_msg_add_folder
-TC2 = utc_msg_add_message
-TC3 = utc_msg_get_conversation_view_list
-TC4 = utc_msg_add_syncml_message
-TC5 = utc_msg_get_folder_list
-TC7 = utc_msg_get_folder_view_list
-TC8 = utc_msg_get_mem_size
-TC9 = utc_msg_get_message
-TC10 = utc_msg_get_quick_panel_data
-TC11 = utc_msg_get_thread_view_list
-TC12 = utc_msg_move_msg_to_folder
-TC13 = utc_msg_move_msg_to_storage
-TC14 = utc_msg_release_folder_list
-TC15 = utc_msg_release_thread_view_list
-TC16 = utc_msg_reset_database
-TC17 = utc_msg_count_message
-TC19 = utc_msg_count_msg_by_contact
-TC20 = utc_msg_thread_view_get_address
-TC21 = utc_msg_count_msg_by_type
-TC22 = utc_msg_thread_view_get_contact_id
-TC23 = utc_msg_delete_all_msgs_in_folder
-TC24 = utc_msg_thread_view_get_data
-TC25 = utc_msg_delete_folder
-TC26 = utc_msg_thread_view_get_direction
-TC27 = utc_msg_delete_message
-TC28 = utc_msg_thread_view_get_image_path
-TC29 = utc_msg_delete_thread_message_list
-TC30 = utc_msg_thread_view_get_mms_cnt
-TC31 = utc_msg_thread_view_get_name
-TC32 = utc_msg_thread_view_get_sms_cnt
-TC33 = utc_msg_thread_view_get_thread_id
-TC34 = utc_msg_thread_view_get_time
-TC35 = utc_msg_thread_view_get_unread_cnt
-TC36 = utc_msg_update_folder
-TC37 = utc_msg_update_message
-TC38 = utc_msg_update_protected_status
-TC39 = utc_msg_update_read_status
-TC40 = utc_msg_generate_message
-       
-###################################################
-# add your Package Config Info Here
-#
-# e.g.,
-# PKGS=calendar
-PKGS=msg-service
-
-LIBS  = `pkg-config --libs $(PKGS)` 
-LIBS +=$(TET_ROOT)/lib/tet3/tcm_s.o
-LIBS +=-L$(TET_ROOT)/lib/tet3 -ltcm_s
-LIBS +=-L$(TET_ROOT)/lib/tet3 -lapi_s
-
-INCS  =  -I. `pkg-config --cflags $(PKGS)`
-INCS  += -I$(TET_ROOT)/inc/tet3 
-
-CFLAGS = $(INCS)
-CFLAGS += -D_TETWARE_MODE
-#CC +=$(CFLAGS)
-LDFLAGS = $(LIBS)
-
-###################################################
-# Modify here 
-# depending on the Test Case you want to build
-# 
-# e.g.,
-# TCLIST = $(TC1) $(TC2)
-TCLIST = $(TC1) $(TC2) $(TC3) $(TC4) $(TC5) $(TC7) $(TC8) $(TC9) $(TC10) $(TC11) $(TC12) $(TC13) $(TC14) $(TC15) $(TC16) $(TC17) $(TC19) $(TC20) $(TC21) $(TC22) $(TC23) $(TC24) $(TC25) $(TC26) $(TC27) $(TC28) $(TC29) $(TC30) $(TC31) $(TC32) $(TC33) $(TC34) $(TC35) $(TC36) $(TC37) $(TC38) $(TC39) $(TC40)
-all :
-       for testcase in $(TCLIST) do\
-               $(CC) -o $$(testcase) $$(testcase).c $(CFLAGS) $(LDFLAGS)
-       done
-
-clean :
-       rm -rf *~ *.o $(TCLIST)
-
-
-$(TC1) : 
-       $(CC) -o $(TC1) $(TC1).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC2) : 
-       $(CC) -o $(TC2) $(TC2).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC3) : 
-       $(CC) -o $(TC3) $(TC3).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC4) : 
-       $(CC) -o $(TC4) $(TC4).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC5) : 
-       $(CC) -o $(TC5) $(TC5).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC7) : 
-       $(CC) -o $(TC7) $(TC7).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC8) : 
-       $(CC) -o $(TC8) $(TC8).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC9) : 
-       $(CC) -o $(TC9) $(TC9).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC10) : 
-       $(CC) -o $(TC10) $(TC10).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC11) : 
-       $(CC) -o $(TC11) $(TC11).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC12) : 
-       $(CC) -o $(TC12) $(TC12).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC13) : 
-       $(CC) -o $(TC13) $(TC13).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC14) : 
-       $(CC) -o $(TC14) $(TC14).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC15) : 
-       $(CC) -o $(TC15) $(TC15).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC16) : 
-       $(CC) -o $(TC16) $(TC16).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC17) : 
-       $(CC) -o $(TC17) $(TC17).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC19) : 
-       $(CC) -o $(TC19) $(TC19).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC20) : 
-       $(CC) -o $(TC20) $(TC20).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC21) : 
-       $(CC) -o $(TC21) $(TC21).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC22) : 
-       $(CC) -o $(TC22) $(TC22).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC23) : 
-       $(CC) -o $(TC23) $(TC23).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC24) : 
-       $(CC) -o $(TC24) $(TC24).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC25) : 
-       $(CC) -o $(TC25) $(TC25).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC26) : 
-       $(CC) -o $(TC26) $(TC26).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC27) : 
-       $(CC) -o $(TC27) $(TC27).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC28) : 
-       $(CC) -o $(TC28) $(TC28).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC29) : 
-       $(CC) -o $(TC29) $(TC29).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC30) : 
-       $(CC) -o $(TC30) $(TC30).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC31) : 
-       $(CC) -o $(TC31) $(TC31).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC32) : 
-       $(CC) -o $(TC32) $(TC32).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC33) : 
-       $(CC) -o $(TC33) $(TC33).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC34) : 
-       $(CC) -o $(TC34) $(TC34).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC35) : 
-       $(CC) -o $(TC35) $(TC35).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC36) : 
-       $(CC) -o $(TC36) $(TC36).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC37) : 
-       $(CC) -o $(TC37) $(TC37).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC38) : 
-       $(CC) -o $(TC38) $(TC38).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC39) : 
-       $(CC) -o $(TC39) $(TC39).c  $(CFLAGS) $(LDFLAGS)
-
-$(TC40) : 
-       $(CC) -o $(TC40) $(TC40).c  $(CFLAGS) $(LDFLAGS)
diff --git a/TC/msgTC/MapiStorage/tslist b/TC/msgTC/MapiStorage/tslist
deleted file mode 100755 (executable)
index b515aea..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-utc_msg_add_folder                        \r
-utc_msg_add_message                       \r
-utc_msg_get_conversation_view_list\r
-utc_msg_add_syncml_message                \r
-utc_msg_get_folder_list\r
-utc_msg_backup_message                    \r
-utc_msg_get_folder_view_list\r
-utc_msg_get_mem_size\r
-utc_msg_get_message\r
-utc_msg_get_quick_panel_data\r
-utc_msg_get_thread_view_list\r
-utc_msg_move_msg_to_folder\r
-utc_msg_move_msg_to_storage\r
-utc_msg_release_folder_list\r
-utc_msg_release_thread_view_list\r
-utc_msg_reset_database\r
-utc_msg_generate_message   \r
-utc_msg_count_message                     \r
-utc_msg_restore_message\r
-utc_msg_count_msg_by_contact              \r
-utc_msg_thread_view_get_address\r
-utc_msg_count_msg_by_type                 \r
-utc_msg_thread_view_get_contact_id\r
-utc_msg_delete_all_msgs_in_folder         \r
-utc_msg_thread_view_get_data\r
-utc_msg_delete_folder                     \r
-utc_msg_thread_view_get_direction\r
-utc_msg_delete_message                    \r
-utc_msg_thread_view_get_image_path\r
-utc_msg_delete_thread_message_list        \r
-utc_msg_thread_view_get_mms_cnt\r
-utc_msg_thread_view_get_name\r
-utc_msg_thread_view_get_sms_cnt\r
-utc_msg_thread_view_get_thread_id\r
-utc_msg_thread_view_get_time\r
-utc_msg_thread_view_get_unread_cnt\r
-utc_msg_update_folder\r
-utc_msg_update_message\r
-utc_msg_update_protected_status\r
-utc_msg_update_read_status
\ No newline at end of file
diff --git a/TC/msgTC/MapiStorage/utc_msg_add_folder.c b/TC/msgTC/MapiStorage/utc_msg_add_folder.c
deleted file mode 100755 (executable)
index 0fd5791..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_add_folder.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MSG_SENDINGOPT_S sendOpt;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-
-       memset(&sendOpt, 0x00, sizeof(sendOpt));
-
-       sendOpt.bSetting = false;
-
-       msg_add_message(msgHandle, msgInfo, &sendOpt);
-
-       msg_set_message_id(msgInfo, 0);
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_add_folder_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MSG_FOLDER_INFO_S folderInfo;
-
-       memset(&folderInfo, 0x00, sizeof(folderInfo));
-
-       folderInfo.folderId = 10;
-       folderInfo.folderType = MSG_FOLDER_TYPE_USER_DEF;
-
-       strncpy(folderInfo.folderName, "Test folder", MAX_FOLDER_NAME_SIZE);
-
-       err = msg_add_folder(msgHandle, &folderInfo);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_add_folder_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MSG_FOLDER_INFO_S folderInfo;
-
-       memset(&folderInfo, 0x00, sizeof(folderInfo));
-
-       folderInfo.folderId = 10;
-       folderInfo.folderType = MSG_FOLDER_TYPE_USER_DEF;
-
-       strncpy(folderInfo.folderName, "Test folder", MAX_FOLDER_NAME_SIZE);
-
-       err = msg_add_folder(NULL, &folderInfo);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiStorage/utc_msg_add_folder.h b/TC/msgTC/MapiStorage/utc_msg_add_folder.h
deleted file mode 100755 (executable)
index 0859539..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MapiStorage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
-static void utc_msg_add_folder_001(void);
-static void utc_msg_add_folder_002(void);
-
-
-
-struct tet_testlist tet_testlist[] =
-{
-                       { utc_msg_add_folder_001,1},
-                       { utc_msg_add_folder_002,2},
-                       {NULL,0}
-};
diff --git a/TC/msgTC/MapiStorage/utc_msg_add_message.c b/TC/msgTC/MapiStorage/utc_msg_add_message.c
deleted file mode 100755 (executable)
index ab6bebf..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_add_message.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MSG_SENDINGOPT_S sendOpt;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-
-       memset(&sendOpt, 0x00, sizeof(sendOpt));
-
-       sendOpt.bSetting = false;
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_add_message_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_add_message(msgHandle, msgInfo, &sendOpt);
-       if (err < MSG_SUCCESS)
-       {
-               tet_printf("msg_add_message fail [%d]", err);
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_add_message_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_add_message(NULL, msgInfo, &sendOpt);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_printf("msg_add_message success [%d]", err);
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiStorage/utc_msg_add_message.h b/TC/msgTC/MapiStorage/utc_msg_add_message.h
deleted file mode 100755 (executable)
index 2ce5083..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MapiStorage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
-static void utc_msg_add_message_001(void);
-static void utc_msg_add_message_002(void);
-
-
-
-struct tet_testlist tet_testlist[] =
-{
-                       { utc_msg_add_message_001,1},
-                       { utc_msg_add_message_002,2},
-                       {NULL,0}
-};
diff --git a/TC/msgTC/MapiStorage/utc_msg_add_syncml_message.c b/TC/msgTC/MapiStorage/utc_msg_add_syncml_message.c
deleted file mode 100755 (executable)
index 8fc5131..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_add_syncml_message.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MSG_SYNCML_MESSAGE_S syncMLMsg;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-
-       memset(&syncMLMsg, 0x00, sizeof(MSG_SYNCML_MESSAGE_S));
-
-       syncMLMsg.extId = 11;
-       syncMLMsg.pinCode = 1111;
-
-       syncMLMsg.msg = msg_new_message();
-
-       msg_set_folder_id(syncMLMsg.msg, MSG_INBOX_ID);
-       msg_set_message_type(syncMLMsg.msg, MSG_TYPE_SMS_SYNCML);
-       msg_set_network_status(syncMLMsg.msg, MSG_NETWORK_RECEIVED);
-       msg_set_direction_info(syncMLMsg.msg, MSG_DIRECTION_TYPE_MT);
-
-       msg_add_address(syncMLMsg.msg, "+1004", MSG_RECIPIENTS_TYPE_TO);
-
-       char msg_body[]="SyncML Message";
-       msg_sms_set_message_body(syncMLMsg.msg, msg_body, strlen(msg_body));
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_add_syncml_message_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_add_syncml_message(msgHandle, &syncMLMsg);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_add_syncml_message_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_add_syncml_message(NULL, &syncMLMsg);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiStorage/utc_msg_add_syncml_message.h b/TC/msgTC/MapiStorage/utc_msg_add_syncml_message.h
deleted file mode 100755 (executable)
index ab23564..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MapiStorage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
-static void utc_msg_add_syncml_message_001(void);
-static void utc_msg_add_syncml_message_002(void);
-
-
-
-struct tet_testlist tet_testlist[] =
-{
-                       { utc_msg_add_syncml_message_001,1},
-                       { utc_msg_add_syncml_message_002,2},
-                       {NULL,0}
-};
diff --git a/TC/msgTC/MapiStorage/utc_msg_count_message.c b/TC/msgTC/MapiStorage/utc_msg_count_message.c
deleted file mode 100755 (executable)
index 31eb04a..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_count_message.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MSG_SENDINGOPT_S sendOpt;
-MSG_COUNT_INFO_S count_info;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-
-       memset(&sendOpt, 0x00, sizeof(sendOpt));
-       memset(&count_info, 0x00, sizeof(count_info));
-
-       sendOpt.bSetting = false;
-
-       msg_add_message(msgHandle, msgInfo, &sendOpt);
-
-       msg_set_message_id(msgInfo, 0);
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_count_message_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_count_message(msgHandle, MSG_DRAFT_ID, &count_info);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_count_message_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_count_message(NULL, MSG_DRAFT_ID, &count_info);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiStorage/utc_msg_count_message.h b/TC/msgTC/MapiStorage/utc_msg_count_message.h
deleted file mode 100755 (executable)
index f2ec68a..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MapiStorage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
-static void utc_msg_count_message_001(void);
-static void utc_msg_count_message_001(void);
-
-
-
-struct tet_testlist tet_testlist[] =
-{
-                       { utc_msg_count_message_001,1},
-                       { utc_msg_count_message_001,2},
-                       {NULL,0}
-};
diff --git a/TC/msgTC/MapiStorage/utc_msg_count_msg_by_contact.c b/TC/msgTC/MapiStorage/utc_msg_count_msg_by_contact.c
deleted file mode 100755 (executable)
index 0ef1233..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_count_msg_by_contact.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MSG_SENDINGOPT_S sendOpt;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-
-       memset(&sendOpt, 0x00, sizeof(sendOpt));
-
-       sendOpt.bSetting = false;
-
-       msg_add_message(msgHandle, msgInfo, &sendOpt);
-
-       msg_set_message_id(msgInfo, 0);
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_count_msg_by_contact_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MSG_THREAD_LIST_INDEX_S addr_info;
-       MSG_THREAD_COUNT_INFO_S msg_thread_count_list;
-
-       memset(&addr_info, 0x00, sizeof(addr_info));
-       memset(&msg_thread_count_list, 0x00, sizeof(msg_thread_count_list));
-
-       err = msg_count_msg_by_contact(msgHandle, &addr_info, &msg_thread_count_list);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_count_msg_by_contact_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MSG_THREAD_LIST_INDEX_S addr_info;
-       MSG_THREAD_COUNT_INFO_S msg_thread_count_list;
-
-       memset(&addr_info, 0x00, sizeof(addr_info));
-       memset(&msg_thread_count_list, 0x00, sizeof(msg_thread_count_list));
-
-       err = msg_count_msg_by_contact(NULL, &addr_info, &msg_thread_count_list);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiStorage/utc_msg_count_msg_by_contact.h b/TC/msgTC/MapiStorage/utc_msg_count_msg_by_contact.h
deleted file mode 100755 (executable)
index 24d8c97..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MapiStorage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
-static void utc_msg_count_msg_by_contact_001(void);
-static void utc_msg_count_msg_by_contact_002(void);
-
-
-
-struct tet_testlist tet_testlist[] =
-{
-                       { utc_msg_count_msg_by_contact_001,1},
-                       { utc_msg_count_msg_by_contact_002,2},
-                       {NULL,0}
-};
diff --git a/TC/msgTC/MapiStorage/utc_msg_count_msg_by_type.c b/TC/msgTC/MapiStorage/utc_msg_count_msg_by_type.c
deleted file mode 100755 (executable)
index 8fff138..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_count_msg_by_type.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MSG_SENDINGOPT_S sendOpt;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-
-       memset(&sendOpt, 0x00, sizeof(sendOpt));
-
-       sendOpt.bSetting = false;
-
-       msg_add_message(msgHandle, msgInfo, &sendOpt);
-
-       msg_set_message_id(msgInfo, 0);
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_update_message_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       int count = 0;
-
-       err = msg_count_msg_by_type(msgHandle, MSG_TYPE_SMS, &count);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_update_message_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       int count = 0;
-
-       err = msg_count_msg_by_type(NULL, MSG_TYPE_SMS, &count);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiStorage/utc_msg_count_msg_by_type.h b/TC/msgTC/MapiStorage/utc_msg_count_msg_by_type.h
deleted file mode 100755 (executable)
index 2eb70cc..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MapiStorage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
-static void utc_msg_update_message_001(void);
-static void utc_msg_update_message_002(void);
-
-
-
-struct tet_testlist tet_testlist[] =
-{
-                       { utc_msg_update_message_001,1},
-                       { utc_msg_update_message_002,2},
-                       {NULL,0}
-};
diff --git a/TC/msgTC/MapiStorage/utc_msg_delete_all_msgs_in_folder.c b/TC/msgTC/MapiStorage/utc_msg_delete_all_msgs_in_folder.c
deleted file mode 100755 (executable)
index 92e4931..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_delete_all_msgs_in_folder.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MSG_SENDINGOPT_S sendOpt;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-
-       memset(&sendOpt, 0x00, sizeof(sendOpt));
-
-       sendOpt.bSetting = false;
-
-       msg_add_message(msgHandle, msgInfo, &sendOpt);
-
-       msg_set_message_id(msgInfo, 0);
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_delete_all_msgs_in_folder_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_delete_all_msgs_in_folder(msgHandle, MSG_DRAFT_ID, true);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_delete_all_msgs_in_folder_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_delete_all_msgs_in_folder(NULL, MSG_DRAFT_ID, true);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiStorage/utc_msg_delete_all_msgs_in_folder.h b/TC/msgTC/MapiStorage/utc_msg_delete_all_msgs_in_folder.h
deleted file mode 100755 (executable)
index 13a43bb..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MapiStorage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
-static void utc_msg_delete_all_msgs_in_folder_001(void);
-static void utc_msg_delete_all_msgs_in_folder_002(void);
-
-
-
-struct tet_testlist tet_testlist[] =
-{
-                       { utc_msg_delete_all_msgs_in_folder_001,1},
-                       { utc_msg_delete_all_msgs_in_folder_002,2},
-                       {NULL,0}
-};
diff --git a/TC/msgTC/MapiStorage/utc_msg_delete_folder.c b/TC/msgTC/MapiStorage/utc_msg_delete_folder.c
deleted file mode 100755 (executable)
index 342308f..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_delete_folder.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MSG_SENDINGOPT_S sendOpt;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-
-       memset(&sendOpt, 0x00, sizeof(sendOpt));
-
-       sendOpt.bSetting = false;
-
-       msg_add_message(msgHandle, msgInfo, &sendOpt);
-
-       msg_set_message_id(msgInfo, 0);
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_delete_folder_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_delete_folder(msgHandle, 10);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_delete_folder_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_delete_folder(NULL, 10);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiStorage/utc_msg_delete_folder.h b/TC/msgTC/MapiStorage/utc_msg_delete_folder.h
deleted file mode 100755 (executable)
index 315faf2..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MapiStorage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
-static void utc_msg_delete_folder_001(void);
-static void utc_msg_delete_folder_002(void);
-
-
-
-struct tet_testlist tet_testlist[] =
-{
-                       { utc_msg_delete_folder_001,1},
-                       { utc_msg_delete_folder_002,2},
-                       {NULL,0}
-};
diff --git a/TC/msgTC/MapiStorage/utc_msg_delete_message.c b/TC/msgTC/MapiStorage/utc_msg_delete_message.c
deleted file mode 100755 (executable)
index c0acaa5..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_delete_message.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MSG_SENDINGOPT_S sendOpt;
-int msgId = 0;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MSG_LIST_S folder_list;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-
-       memset(&sendOpt, 0x00, sizeof(sendOpt));
-
-       sendOpt.bSetting = false;
-
-       msg_add_message(msgHandle, msgInfo, &sendOpt);
-
-       msg_set_message_id(msgInfo, 0);
-
-       msg_get_folder_view_list(msgHandle, MSG_DRAFT_ID, NULL, &folder_list);
-
-       msgId = msg_get_message_id(folder_list.msgInfo[0]);
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_delete_message_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_delete_message(msgHandle, msgId);
-       if (err != MSG_SUCCESS)
-       {
-               tet_printf("err is [%d]", err);
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_delete_message_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_delete_message(NULL, msgId);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiStorage/utc_msg_delete_message.h b/TC/msgTC/MapiStorage/utc_msg_delete_message.h
deleted file mode 100755 (executable)
index 7c473a9..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MapiStorage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
-static void utc_msg_delete_message_001(void);
-static void utc_msg_delete_message_002(void);
-
-
-
-struct tet_testlist tet_testlist[] =
-{
-                       { utc_msg_delete_message_001,1},
-                       { utc_msg_delete_message_002,2},
-                       {NULL,0}
-};
diff --git a/TC/msgTC/MapiStorage/utc_msg_delete_thread_message_list.c b/TC/msgTC/MapiStorage/utc_msg_delete_thread_message_list.c
deleted file mode 100755 (executable)
index e3030bd..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_delete_thread_message_list.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MSG_SENDINGOPT_S sendOpt;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-
-       memset(&sendOpt, 0x00, sizeof(sendOpt));
-
-       sendOpt.bSetting = false;
-
-       msg_add_message(msgHandle, msgInfo, &sendOpt);
-
-       msg_set_message_id(msgInfo, 0);
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_delete_thread_message_list_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_delete_thread_message_list(msgHandle, 0);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_delete_thread_message_list_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_delete_thread_message_list(NULL, 0);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiStorage/utc_msg_delete_thread_message_list.h b/TC/msgTC/MapiStorage/utc_msg_delete_thread_message_list.h
deleted file mode 100755 (executable)
index 882be33..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MapiStorage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
-static void utc_msg_delete_thread_message_list_001(void);
-static void utc_msg_delete_thread_message_list_002(void);
-
-
-
-struct tet_testlist tet_testlist[] =
-{
-                       { utc_msg_delete_thread_message_list_001,1},
-                       { utc_msg_delete_thread_message_list_002,2},
-                       {NULL,0}
-};
diff --git a/TC/msgTC/MapiStorage/utc_msg_generate_message.c b/TC/msgTC/MapiStorage/utc_msg_generate_message.c
deleted file mode 100755 (executable)
index 4a11c7e..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_generate_message.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MSG_SENDINGOPT_S sendOpt;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_generate_message_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_generate_message(msgHandle, MSG_TYPE_SMS, MSG_DRAFT_ID, 10);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_generate_message_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_generate_message(NULL, MSG_TYPE_SMS, MSG_DRAFT_ID, 10);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiStorage/utc_msg_generate_message.h b/TC/msgTC/MapiStorage/utc_msg_generate_message.h
deleted file mode 100755 (executable)
index a155a78..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MapiStorage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
-static void utc_msg_generate_message_001(void);
-static void utc_msg_generate_message_002(void);
-
-
-
-struct tet_testlist tet_testlist[] =
-{
-                       { utc_msg_generate_message_001,1},
-                       { utc_msg_generate_message_002,2},
-                       {NULL,0}
-};
diff --git a/TC/msgTC/MapiStorage/utc_msg_get_conversation_view_list.c b/TC/msgTC/MapiStorage/utc_msg_get_conversation_view_list.c
deleted file mode 100755 (executable)
index 5d3ebe8..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_get_conversation_view_list.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MSG_SENDINGOPT_S sendOpt;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-
-       memset(&sendOpt, 0x00, sizeof(sendOpt));
-
-       sendOpt.bSetting = false;
-
-       msg_add_message(msgHandle, msgInfo, &sendOpt);
-
-       msg_set_message_id(msgInfo, 0);
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_get_conversation_view_list_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MSG_LIST_S msg_conv_view_list;
-
-       memset(&msg_conv_view_list, 0x00, sizeof(msg_conv_view_list));
-
-       err = msg_get_conversation_view_list(msgHandle, 0, &msg_conv_view_list);
-       msg_release_message_list(&msg_conv_view_list);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_get_conversation_view_list_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MSG_LIST_S msg_conv_view_list;
-
-       memset(&msg_conv_view_list, 0x00, sizeof(msg_conv_view_list));
-
-       err = msg_get_conversation_view_list(NULL, 0, &msg_conv_view_list);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiStorage/utc_msg_get_conversation_view_list.h b/TC/msgTC/MapiStorage/utc_msg_get_conversation_view_list.h
deleted file mode 100755 (executable)
index 03bd68c..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MapiStorage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
-static void utc_msg_get_conversation_view_list_001(void);
-static void utc_msg_get_conversation_view_list_002(void);
-
-
-
-struct tet_testlist tet_testlist[] =
-{
-                       { utc_msg_get_conversation_view_list_001,1},
-                       { utc_msg_get_conversation_view_list_002,2},
-                       {NULL,0}
-};
diff --git a/TC/msgTC/MapiStorage/utc_msg_get_folder_list.c b/TC/msgTC/MapiStorage/utc_msg_get_folder_list.c
deleted file mode 100755 (executable)
index 013d0a1..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_get_folder_list.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MSG_SENDINGOPT_S sendOpt;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-
-       memset(&sendOpt, 0x00, sizeof(sendOpt));
-
-       sendOpt.bSetting = false;
-
-       msg_add_message(msgHandle, msgInfo, &sendOpt);
-
-       msg_set_message_id(msgInfo, 0);
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_get_folder_list_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MSG_FOLDER_LIST_S folder_list;
-
-       memset(&folder_list, 0x00, sizeof(folder_list));
-
-       err = msg_get_folder_list(msgHandle, &folder_list);
-       msg_release_folder_list(&folder_list);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_get_folder_list_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MSG_FOLDER_LIST_S folder_list;
-
-       memset(&folder_list, 0x00, sizeof(folder_list));
-
-       err = msg_get_folder_list(NULL, &folder_list);
-       msg_release_folder_list(&folder_list);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiStorage/utc_msg_get_folder_list.h b/TC/msgTC/MapiStorage/utc_msg_get_folder_list.h
deleted file mode 100755 (executable)
index d5ab1c6..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MapiStorage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
-static void utc_msg_get_folder_list_001(void);
-static void utc_msg_get_folder_list_002(void);
-
-
-
-struct tet_testlist tet_testlist[] =
-{
-                       { utc_msg_get_folder_list_001,1},
-                       { utc_msg_get_folder_list_002,2},
-                       {NULL,0}
-};
diff --git a/TC/msgTC/MapiStorage/utc_msg_get_folder_view_list.c b/TC/msgTC/MapiStorage/utc_msg_get_folder_view_list.c
deleted file mode 100755 (executable)
index 27385ea..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_get_folder_view_list.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MSG_SENDINGOPT_S sendOpt;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-
-       memset(&sendOpt, 0x00, sizeof(sendOpt));
-
-       sendOpt.bSetting = false;
-
-       msg_add_message(msgHandle, msgInfo, &sendOpt);
-
-       msg_set_message_id(msgInfo, 0);
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_get_folder_view_list_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MSG_SORT_RULE_S sort_rule;
-       MSG_LIST_S msg_folder_view_list;
-
-       memset(&sort_rule, 0x00, sizeof(sort_rule));
-       memset(&msg_folder_view_list, 0x00, sizeof(msg_folder_view_list));
-
-       err = msg_get_folder_view_list(msgHandle, MSG_DRAFT_ID, &sort_rule, &msg_folder_view_list);
-       msg_release_message_list(&msg_folder_view_list);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_get_folder_view_list_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MSG_SORT_RULE_S sort_rule;
-       MSG_LIST_S msg_folder_view_list;
-
-       memset(&sort_rule, 0x00, sizeof(sort_rule));
-       memset(&msg_folder_view_list, 0x00, sizeof(msg_folder_view_list));
-
-       err = msg_get_folder_view_list(NULL, MSG_DRAFT_ID, &sort_rule, &msg_folder_view_list);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiStorage/utc_msg_get_folder_view_list.h b/TC/msgTC/MapiStorage/utc_msg_get_folder_view_list.h
deleted file mode 100755 (executable)
index 1583443..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MapiStorage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
-static void utc_msg_get_folder_view_list_001(void);
-static void utc_msg_get_folder_view_list_002(void);
-
-
-
-struct tet_testlist tet_testlist[] =
-{
-                       { utc_msg_get_folder_view_list_001,1},
-                       { utc_msg_get_folder_view_list_002,2},
-                       {NULL,0}
-};
diff --git a/TC/msgTC/MapiStorage/utc_msg_get_mem_size.c b/TC/msgTC/MapiStorage/utc_msg_get_mem_size.c
deleted file mode 100755 (executable)
index b37bd32..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_get_mem_size.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MSG_SENDINGOPT_S sendOpt;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-
-       memset(&sendOpt, 0x00, sizeof(sendOpt));
-
-       sendOpt.bSetting = false;
-
-       msg_add_message(msgHandle, msgInfo, &sendOpt);
-
-       msg_set_message_id(msgInfo, 0);
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_get_mem_size_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       int memsize = 0;
-
-       err = msg_get_mem_size(msgHandle, &memsize);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_get_mem_size_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       int memsize = 0;
-
-       err = msg_get_mem_size(NULL, &memsize);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiStorage/utc_msg_get_mem_size.h b/TC/msgTC/MapiStorage/utc_msg_get_mem_size.h
deleted file mode 100755 (executable)
index 3240db4..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MapiStorage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
-static void utc_msg_get_mem_size_001(void);
-static void utc_msg_get_mem_size_002(void);
-
-
-
-struct tet_testlist tet_testlist[] =
-{
-                       { utc_msg_get_mem_size_001,1},
-                       { utc_msg_get_mem_size_002,2},
-                       {NULL,0}
-};
diff --git a/TC/msgTC/MapiStorage/utc_msg_get_message.c b/TC/msgTC/MapiStorage/utc_msg_get_message.c
deleted file mode 100755 (executable)
index c970350..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_get_message.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MSG_SENDINGOPT_S sendOpt;
-int msgId = 0;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MSG_LIST_S folder_list;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-
-       memset(&sendOpt, 0x00, sizeof(sendOpt));
-
-       sendOpt.bSetting = false;
-
-       msg_add_message(msgHandle, msgInfo, &sendOpt);
-
-       msg_set_message_id(msgInfo, 0);
-
-       msg_get_folder_view_list(msgHandle, MSG_DRAFT_ID, NULL, &folder_list);
-
-       msgId = msg_get_message_id(folder_list.msgInfo[0]);
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_get_message_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_get_message(msgHandle, msgId, msgInfo, &sendOpt);
-       if (err != MSG_SUCCESS)
-       {
-               tet_printf("err is [%d]", err);
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_get_message_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_get_message(NULL, msgId, msgInfo, &sendOpt);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiStorage/utc_msg_get_message.h b/TC/msgTC/MapiStorage/utc_msg_get_message.h
deleted file mode 100755 (executable)
index ca306f0..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MapiStorage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
-static void utc_msg_get_message_001(void);
-static void utc_msg_get_message_002(void);
-
-
-
-struct tet_testlist tet_testlist[] =
-{
-                       { utc_msg_get_message_001,1},
-                       { utc_msg_get_message_002,2},
-                       {NULL,0}
-};
diff --git a/TC/msgTC/MapiStorage/utc_msg_get_quick_panel_data.c b/TC/msgTC/MapiStorage/utc_msg_get_quick_panel_data.c
deleted file mode 100755 (executable)
index bdee02b..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_get_quick_panel_data.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MSG_SENDINGOPT_S sendOpt;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-
-       memset(&sendOpt, 0x00, sizeof(sendOpt));
-
-       sendOpt.bSetting = false;
-
-       msg_add_message(msgHandle, msgInfo, &sendOpt);
-
-       msg_set_message_id(msgInfo, 0);
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_get_quick_panel_data_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       //err = msg_get_quick_panel_data(msgHandle, MSG_QUICKPANEL_SMS, msgInfo);
-       if (err != MSG_SUCCESS)
-       {
-               tet_printf("err is [%d]", err);
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_get_quick_panel_data_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_get_quick_panel_data(NULL, MSG_QUICKPANEL_SMS, msgInfo);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiStorage/utc_msg_get_quick_panel_data.h b/TC/msgTC/MapiStorage/utc_msg_get_quick_panel_data.h
deleted file mode 100755 (executable)
index fb9eb92..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MapiStorage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
-static void utc_msg_get_quick_panel_data_001(void);
-static void utc_msg_get_quick_panel_data_002(void);
-
-
-
-struct tet_testlist tet_testlist[] =
-{
-                       { utc_msg_get_quick_panel_data_001,1},
-                       { utc_msg_get_quick_panel_data_002,2},
-                       {NULL,0}
-};
diff --git a/TC/msgTC/MapiStorage/utc_msg_get_thread_view_list.c b/TC/msgTC/MapiStorage/utc_msg_get_thread_view_list.c
deleted file mode 100755 (executable)
index 966f122..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_get_thread_view_list.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MSG_SENDINGOPT_S sendOpt;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-
-       memset(&sendOpt, 0x00, sizeof(sendOpt));
-
-       sendOpt.bSetting = false;
-
-       msg_add_message(msgHandle, msgInfo, &sendOpt);
-
-       msg_set_message_id(msgInfo, 0);
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_get_thread_view_list_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MSG_SORT_RULE_S sort_rule;
-       MSG_THREAD_VIEW_LIST_S msg_thread_view_list;
-
-       memset(&sort_rule, 0x00, sizeof(sort_rule));
-       memset(&msg_thread_view_list, 0x00, sizeof(msg_thread_view_list));
-
-       err = msg_get_thread_view_list(msgHandle, NULL, &msg_thread_view_list);
-       msg_release_thread_view_list(&msg_thread_view_list);
-       if (err != MSG_SUCCESS)
-       {
-               tet_printf("err is [%d]", err);
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_get_thread_view_list_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MSG_SORT_RULE_S sort_rule;
-       MSG_THREAD_VIEW_LIST_S msg_thread_view_list;
-
-       memset(&sort_rule, 0x00, sizeof(sort_rule));
-       memset(&msg_thread_view_list, 0x00, sizeof(msg_thread_view_list));
-
-       err = msg_get_thread_view_list(NULL, &sort_rule, &msg_thread_view_list);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiStorage/utc_msg_get_thread_view_list.h b/TC/msgTC/MapiStorage/utc_msg_get_thread_view_list.h
deleted file mode 100755 (executable)
index 202eb0a..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MapiStorage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
-static void utc_msg_get_thread_view_list_001(void);
-static void utc_msg_get_thread_view_list_002(void);
-
-
-
-struct tet_testlist tet_testlist[] =
-{
-                       { utc_msg_get_thread_view_list_001,1},
-                       { utc_msg_get_thread_view_list_002,2},
-                       {NULL,0}
-};
diff --git a/TC/msgTC/MapiStorage/utc_msg_move_msg_to_folder.c b/TC/msgTC/MapiStorage/utc_msg_move_msg_to_folder.c
deleted file mode 100755 (executable)
index cc8cf47..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_move_msg_to_folder.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MSG_SENDINGOPT_S sendOpt;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-
-       memset(&sendOpt, 0x00, sizeof(sendOpt));
-
-       sendOpt.bSetting = false;
-
-       msg_add_message(msgHandle, msgInfo, &sendOpt);
-
-       msg_set_message_id(msgInfo, 0);
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_move_msg_to_folder_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_move_msg_to_folder(msgHandle, 0, MSG_DRAFT_ID);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_move_msg_to_folder_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_move_msg_to_folder(NULL, 0, MSG_DRAFT_ID);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiStorage/utc_msg_move_msg_to_folder.h b/TC/msgTC/MapiStorage/utc_msg_move_msg_to_folder.h
deleted file mode 100755 (executable)
index 0094958..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MapiStorage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
-static void utc_msg_move_msg_to_folder_001(void);
-static void utc_msg_move_msg_to_folder_002(void);
-
-
-
-struct tet_testlist tet_testlist[] =
-{
-                       { utc_msg_move_msg_to_folder_001,1},
-                       { utc_msg_move_msg_to_folder_002,2},
-                       {NULL,0}
-};
diff --git a/TC/msgTC/MapiStorage/utc_msg_move_msg_to_storage.c b/TC/msgTC/MapiStorage/utc_msg_move_msg_to_storage.c
deleted file mode 100755 (executable)
index 14ed023..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_move_msg_to_storage.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MSG_SENDINGOPT_S sendOpt;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-
-       memset(&sendOpt, 0x00, sizeof(sendOpt));
-
-       sendOpt.bSetting = false;
-
-       msg_add_message(msgHandle, msgInfo, &sendOpt);
-
-       msg_set_message_id(msgInfo, 0);
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_move_msg_to_storage_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_update_message(msgHandle, msgInfo, &sendOpt);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_move_msg_to_storage_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_update_message(NULL, msgInfo, &sendOpt);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiStorage/utc_msg_move_msg_to_storage.h b/TC/msgTC/MapiStorage/utc_msg_move_msg_to_storage.h
deleted file mode 100755 (executable)
index 8e7d49d..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MapiStorage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
-static void utc_msg_move_msg_to_storage_001(void);
-static void utc_msg_move_msg_to_storage_002(void);
-
-
-
-struct tet_testlist tet_testlist[] =
-{
-                       { utc_msg_move_msg_to_storage_001,1},
-                       { utc_msg_move_msg_to_storage_002,2},
-                       {NULL,0}
-};
diff --git a/TC/msgTC/MapiStorage/utc_msg_release_folder_list.c b/TC/msgTC/MapiStorage/utc_msg_release_folder_list.c
deleted file mode 100755 (executable)
index 1bd42b5..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_release_folder_list.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MSG_SENDINGOPT_S sendOpt;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-
-       memset(&sendOpt, 0x00, sizeof(sendOpt));
-
-       sendOpt.bSetting = false;
-
-       msg_add_message(msgHandle, msgInfo, &sendOpt);
-
-       msg_set_message_id(msgInfo, 0);
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_release_folder_list_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MSG_FOLDER_LIST_S folder_list;
-
-       memset(&folder_list, 0x00, sizeof(folder_list));
-
-       msg_get_folder_list(msgHandle, &folder_list);
-       msg_release_folder_list(&folder_list);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_release_folder_list_002()
-{
-       MSG_ERROR_T err = -1;
-       MSG_FOLDER_LIST_S folder_list;
-
-       memset(&folder_list, 0x00, sizeof(folder_list));
-
-       //err = msg_get_folder_list(NULL, &folder_list);
-       //msg_release_folder_list(&folder_list);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiStorage/utc_msg_release_folder_list.h b/TC/msgTC/MapiStorage/utc_msg_release_folder_list.h
deleted file mode 100755 (executable)
index c863572..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MapiStorage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
-static void utc_msg_release_folder_list_001(void);
-static void utc_msg_release_folder_list_002(void);
-
-
-
-struct tet_testlist tet_testlist[] =
-{
-                       { utc_msg_release_folder_list_001,1},
-                       { utc_msg_release_folder_list_002,2},
-                       {NULL,0}
-};
diff --git a/TC/msgTC/MapiStorage/utc_msg_release_thread_view_list.c b/TC/msgTC/MapiStorage/utc_msg_release_thread_view_list.c
deleted file mode 100755 (executable)
index 8708f37..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_release_thread_view_list.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MSG_SENDINGOPT_S sendOpt;
-MSG_THREAD_VIEW_LIST_S msg_thread_view_list;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MSG_SORT_RULE_S sort_rule;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-
-       memset(&sendOpt, 0x00, sizeof(sendOpt));
-
-       sendOpt.bSetting = false;
-
-       msg_add_message(msgHandle, msgInfo, &sendOpt);
-
-       msg_set_message_id(msgInfo, 0);
-
-       memset(&msg_thread_view_list, 0x00, sizeof(msg_thread_view_list));
-       memset(&sort_rule, 0x00, sizeof(sort_rule));
-
-       msg_get_thread_view_list(msgHandle, NULL, &msg_thread_view_list);
-}
-void cleanup(void)
-{
-       msg_release_thread_view_list(&msg_thread_view_list);
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_release_thread_view_list_001()
-{
-       int err = MSG_SUCCESS;
-
-       //msg_release_thread_view_list(&msg_thread_view_list);
-       if (err < MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_release_thread_view_list_002()
-{
-       int err = -1;
-
-       //msg_release_thread_view_list(&msg_thread_view_list);
-       if (err < MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiStorage/utc_msg_release_thread_view_list.h b/TC/msgTC/MapiStorage/utc_msg_release_thread_view_list.h
deleted file mode 100755 (executable)
index 2186269..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MapiStorage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
-static void utc_msg_release_thread_view_list_001(void);
-static void utc_msg_release_thread_view_list_002(void);
-
-
-
-struct tet_testlist tet_testlist[] =
-{
-                       { utc_msg_release_thread_view_list_001,1},
-                       { utc_msg_release_thread_view_list_002,2},
-                       {NULL,0}
-};
diff --git a/TC/msgTC/MapiStorage/utc_msg_reset_database.c b/TC/msgTC/MapiStorage/utc_msg_reset_database.c
deleted file mode 100755 (executable)
index d4ae485..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_reset_database.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MSG_SENDINGOPT_S sendOpt;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-
-       memset(&sendOpt, 0x00, sizeof(sendOpt));
-
-       sendOpt.bSetting = false;
-
-       msg_add_message(msgHandle, msgInfo, &sendOpt);
-
-       msg_set_message_id(msgInfo, 0);
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_reset_database_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_reset_database(msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_reset_database_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_reset_database(NULL);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiStorage/utc_msg_reset_database.h b/TC/msgTC/MapiStorage/utc_msg_reset_database.h
deleted file mode 100755 (executable)
index 6e06586..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MapiStorage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
-static void utc_msg_reset_database_001(void);
-static void utc_msg_reset_database_002(void);
-
-
-
-struct tet_testlist tet_testlist[] =
-{
-                       { utc_msg_reset_database_001,1},
-                       { utc_msg_reset_database_002,2},
-                       {NULL,0}
-};
diff --git a/TC/msgTC/MapiStorage/utc_msg_thread_view_get_address.c b/TC/msgTC/MapiStorage/utc_msg_thread_view_get_address.c
deleted file mode 100755 (executable)
index eda8e45..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_thread_view_get_address.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MSG_SENDINGOPT_S sendOpt;
-MSG_THREAD_VIEW_LIST_S msg_thread_view_list;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MSG_SORT_RULE_S sort_rule;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-
-       memset(&sendOpt, 0x00, sizeof(sendOpt));
-
-       sendOpt.bSetting = false;
-
-       msg_add_message(msgHandle, msgInfo, &sendOpt);
-
-       msg_set_message_id(msgInfo, 0);
-
-       memset(&msg_thread_view_list, 0x00, sizeof(msg_thread_view_list));
-       memset(&sort_rule, 0x00, sizeof(sort_rule));
-
-       msg_get_thread_view_list(msgHandle, NULL, &msg_thread_view_list);
-}
-void cleanup(void)
-{
-       msg_release_thread_view_list(&msg_thread_view_list);
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_thread_view_get_address_001()
-{
-       int err = MSG_SUCCESS;
-       char* addr = NULL;
-
-       if(msg_thread_view_list.nCount == 0)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       addr = msg_thread_view_get_address(msg_thread_view_list.msgThreadInfo[0]);
-       if (addr == NULL)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_thread_view_get_address_002()
-{
-       int err = MSG_SUCCESS;
-       char* addr = NULL;
-
-       addr =  msg_thread_view_get_address(NULL);
-       if (addr == NULL)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiStorage/utc_msg_thread_view_get_address.h b/TC/msgTC/MapiStorage/utc_msg_thread_view_get_address.h
deleted file mode 100755 (executable)
index cdc7d89..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MapiStorage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
-static void utc_msg_thread_view_get_address_001(void);
-static void utc_msg_thread_view_get_address_002(void);
-
-
-
-struct tet_testlist tet_testlist[] =
-{
-                       { utc_msg_thread_view_get_address_001,1},
-                       { utc_msg_thread_view_get_address_002,2},
-                       {NULL,0}
-};
diff --git a/TC/msgTC/MapiStorage/utc_msg_thread_view_get_contact_id.c b/TC/msgTC/MapiStorage/utc_msg_thread_view_get_contact_id.c
deleted file mode 100755 (executable)
index 85c3953..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_thread_view_get_contact_id.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MSG_SENDINGOPT_S sendOpt;
-MSG_THREAD_VIEW_LIST_S msg_thread_view_list;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MSG_SORT_RULE_S sort_rule;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-
-       memset(&sendOpt, 0x00, sizeof(sendOpt));
-
-       sendOpt.bSetting = false;
-
-       msg_add_message(msgHandle, msgInfo, &sendOpt);
-
-       msg_set_message_id(msgInfo, 0);
-
-       memset(&msg_thread_view_list, 0x00, sizeof(msg_thread_view_list));
-       memset(&sort_rule, 0x00, sizeof(sort_rule));
-
-       msg_get_thread_view_list(msgHandle, NULL, &msg_thread_view_list);
-}
-void cleanup(void)
-{
-       msg_release_thread_view_list(&msg_thread_view_list);
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_thread_view_get_contact_id_001()
-{
-       int err = MSG_SUCCESS;
-
-       if(msg_thread_view_list.nCount == 0)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       err = msg_thread_view_get_contact_id(msg_thread_view_list.msgThreadInfo[0]);
-       if (err < MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_thread_view_get_contact_id_002()
-{
-       int err = MSG_SUCCESS;
-
-       err =  msg_thread_view_get_contact_id(NULL);
-       if (err < MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiStorage/utc_msg_thread_view_get_contact_id.h b/TC/msgTC/MapiStorage/utc_msg_thread_view_get_contact_id.h
deleted file mode 100755 (executable)
index 76f23dc..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MapiStorage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
-static void utc_msg_thread_view_get_contact_id_001(void);
-static void utc_msg_thread_view_get_contact_id_002(void);
-
-
-
-struct tet_testlist tet_testlist[] =
-{
-                       { utc_msg_thread_view_get_contact_id_001,1},
-                       { utc_msg_thread_view_get_contact_id_002,2},
-                       {NULL,0}
-};
diff --git a/TC/msgTC/MapiStorage/utc_msg_thread_view_get_data.c b/TC/msgTC/MapiStorage/utc_msg_thread_view_get_data.c
deleted file mode 100755 (executable)
index 84d2f11..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_thread_view_get_data.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MSG_SENDINGOPT_S sendOpt;
-MSG_THREAD_VIEW_LIST_S msg_thread_view_list;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MSG_SORT_RULE_S sort_rule;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-
-       memset(&sendOpt, 0x00, sizeof(sendOpt));
-
-       sendOpt.bSetting = false;
-
-       msg_add_message(msgHandle, msgInfo, &sendOpt);
-
-       msg_set_message_id(msgInfo, 0);
-
-       memset(&msg_thread_view_list, 0x00, sizeof(msg_thread_view_list));
-       memset(&sort_rule, 0x00, sizeof(sort_rule));
-
-       msg_get_thread_view_list(msgHandle, NULL, &msg_thread_view_list);
-}
-void cleanup(void)
-{
-       msg_release_thread_view_list(&msg_thread_view_list);
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_thread_view_get_data_001()
-{
-       int err = MSG_SUCCESS;
-       char* data = NULL;
-
-       if(msg_thread_view_list.nCount == 0)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       data = msg_thread_view_get_data(msg_thread_view_list.msgThreadInfo[0]);
-       if (data == NULL)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_thread_view_get_data_002()
-{
-       int err = MSG_SUCCESS;
-       char* data = NULL;
-
-       data =  msg_thread_view_get_data(NULL);
-       if (data == NULL)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiStorage/utc_msg_thread_view_get_data.h b/TC/msgTC/MapiStorage/utc_msg_thread_view_get_data.h
deleted file mode 100755 (executable)
index 8827b32..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MapiStorage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
-static void utc_msg_thread_view_get_data_001(void);
-static void utc_msg_thread_view_get_data_002(void);
-
-
-
-struct tet_testlist tet_testlist[] =
-{
-                       { utc_msg_thread_view_get_data_001,1},
-                       { utc_msg_thread_view_get_data_002,2},
-                       {NULL,0}
-};
diff --git a/TC/msgTC/MapiStorage/utc_msg_thread_view_get_direction.c b/TC/msgTC/MapiStorage/utc_msg_thread_view_get_direction.c
deleted file mode 100755 (executable)
index c6a1911..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_thread_view_get_direction.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MSG_SENDINGOPT_S sendOpt;
-MSG_THREAD_VIEW_LIST_S msg_thread_view_list;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MSG_SORT_RULE_S sort_rule;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-
-       memset(&sendOpt, 0x00, sizeof(sendOpt));
-
-       sendOpt.bSetting = false;
-
-       msg_add_message(msgHandle, msgInfo, &sendOpt);
-
-       msg_set_message_id(msgInfo, 0);
-
-       memset(&msg_thread_view_list, 0x00, sizeof(msg_thread_view_list));
-       memset(&sort_rule, 0x00, sizeof(sort_rule));
-
-       msg_get_thread_view_list(msgHandle, NULL, &msg_thread_view_list);
-}
-void cleanup(void)
-{
-       msg_release_thread_view_list(&msg_thread_view_list);
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_thread_view_get_direction_001()
-{
-       int err = MSG_SUCCESS;
-
-       if(msg_thread_view_list.nCount == 0)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       err = msg_thread_view_get_direction(msg_thread_view_list.msgThreadInfo[0]);
-       if (err < MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_thread_view_get_direction_002()
-{
-       int err = MSG_SUCCESS;
-
-       err =  msg_thread_view_get_direction(NULL);
-       if (err < MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiStorage/utc_msg_thread_view_get_direction.h b/TC/msgTC/MapiStorage/utc_msg_thread_view_get_direction.h
deleted file mode 100755 (executable)
index a6617e9..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MapiStorage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
-static void utc_msg_thread_view_get_direction_001(void);
-static void utc_msg_thread_view_get_direction_002(void);
-
-
-
-struct tet_testlist tet_testlist[] =
-{
-                       { utc_msg_thread_view_get_direction_001,1},
-                       { utc_msg_thread_view_get_direction_002,2},
-                       {NULL,0}
-};
diff --git a/TC/msgTC/MapiStorage/utc_msg_thread_view_get_image_path.c b/TC/msgTC/MapiStorage/utc_msg_thread_view_get_image_path.c
deleted file mode 100755 (executable)
index c69409f..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_thread_view_get_image_path.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MSG_SENDINGOPT_S sendOpt;
-MSG_THREAD_VIEW_LIST_S msg_thread_view_list;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MSG_SORT_RULE_S sort_rule;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-
-       memset(&sendOpt, 0x00, sizeof(sendOpt));
-
-       sendOpt.bSetting = false;
-
-       msg_add_message(msgHandle, msgInfo, &sendOpt);
-
-       msg_set_message_id(msgInfo, 0);
-
-       memset(&msg_thread_view_list, 0x00, sizeof(msg_thread_view_list));
-       memset(&sort_rule, 0x00, sizeof(sort_rule));
-
-       msg_get_thread_view_list(msgHandle, NULL, &msg_thread_view_list);
-}
-void cleanup(void)
-{
-       msg_release_thread_view_list(&msg_thread_view_list);
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_thread_view_get_image_path_001()
-{
-       int err = MSG_SUCCESS;
-       char* path = NULL;
-
-       if(msg_thread_view_list.nCount == 0)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       path = msg_thread_view_get_image_path(msg_thread_view_list.msgThreadInfo[0]);
-       if (path == NULL)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_thread_view_get_image_path_002()
-{
-       int err = MSG_SUCCESS;
-       char* path = NULL;
-
-       path =  msg_thread_view_get_image_path(NULL);
-       if (path == NULL)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiStorage/utc_msg_thread_view_get_image_path.h b/TC/msgTC/MapiStorage/utc_msg_thread_view_get_image_path.h
deleted file mode 100755 (executable)
index 9838046..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MapiStorage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
-static void utc_msg_thread_view_get_image_path_001(void);
-static void utc_msg_thread_view_get_image_path_002(void);
-
-
-
-struct tet_testlist tet_testlist[] =
-{
-                       { utc_msg_thread_view_get_image_path_001,1},
-                       { utc_msg_thread_view_get_image_path_002,2},
-                       {NULL,0}
-};
diff --git a/TC/msgTC/MapiStorage/utc_msg_thread_view_get_mms_cnt.c b/TC/msgTC/MapiStorage/utc_msg_thread_view_get_mms_cnt.c
deleted file mode 100755 (executable)
index 919942c..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_thread_view_get_mms_cnt.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MSG_SENDINGOPT_S sendOpt;
-MSG_THREAD_VIEW_LIST_S msg_thread_view_list;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MSG_SORT_RULE_S sort_rule;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-
-       memset(&sendOpt, 0x00, sizeof(sendOpt));
-
-       sendOpt.bSetting = false;
-
-       msg_add_message(msgHandle, msgInfo, &sendOpt);
-
-       msg_set_message_id(msgInfo, 0);
-
-       memset(&msg_thread_view_list, 0x00, sizeof(msg_thread_view_list));
-       memset(&sort_rule, 0x00, sizeof(sort_rule));
-
-       msg_get_thread_view_list(msgHandle, NULL, &msg_thread_view_list);
-}
-void cleanup(void)
-{
-       msg_release_thread_view_list(&msg_thread_view_list);
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_thread_view_get_mms_cnt_001()
-{
-       int err = MSG_SUCCESS;
-
-       if(msg_thread_view_list.nCount == 0)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       err = msg_thread_view_get_mms_cnt(msg_thread_view_list.msgThreadInfo[0]);
-       if (err < MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_thread_view_get_mms_cnt_002()
-{
-       int err = MSG_SUCCESS;
-
-       err =  msg_thread_view_get_mms_cnt(NULL);
-       if (err < MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiStorage/utc_msg_thread_view_get_mms_cnt.h b/TC/msgTC/MapiStorage/utc_msg_thread_view_get_mms_cnt.h
deleted file mode 100755 (executable)
index 6b1242b..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MapiStorage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
-static void utc_msg_thread_view_get_mms_cnt_001(void);
-static void utc_msg_thread_view_get_mms_cnt_002(void);
-
-
-
-struct tet_testlist tet_testlist[] =
-{
-                       { utc_msg_thread_view_get_mms_cnt_001,1},
-                       { utc_msg_thread_view_get_mms_cnt_002,2},
-                       {NULL,0}
-};
diff --git a/TC/msgTC/MapiStorage/utc_msg_thread_view_get_name.c b/TC/msgTC/MapiStorage/utc_msg_thread_view_get_name.c
deleted file mode 100755 (executable)
index 8ab0924..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_thread_view_get_name.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MSG_SENDINGOPT_S sendOpt;
-MSG_THREAD_VIEW_LIST_S msg_thread_view_list;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MSG_SORT_RULE_S sort_rule;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-
-       memset(&sendOpt, 0x00, sizeof(sendOpt));
-
-       sendOpt.bSetting = false;
-
-       msg_add_message(msgHandle, msgInfo, &sendOpt);
-
-       msg_set_message_id(msgInfo, 0);
-
-       memset(&msg_thread_view_list, 0x00, sizeof(msg_thread_view_list));
-       memset(&sort_rule, 0x00, sizeof(sort_rule));
-
-       msg_get_thread_view_list(msgHandle, NULL, &msg_thread_view_list);
-}
-void cleanup(void)
-{
-       msg_release_thread_view_list(&msg_thread_view_list);
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_thread_view_get_name_001()
-{
-       int err = MSG_SUCCESS;
-       char* name = NULL;
-
-       if(msg_thread_view_list.nCount == 0)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       name = msg_thread_view_get_name(msg_thread_view_list.msgThreadInfo[0]);
-       if (name == NULL)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_thread_view_get_name_002()
-{
-       int err = MSG_SUCCESS;
-       char* name = NULL;
-
-       name =  msg_thread_view_get_name(NULL);
-       if (name == NULL)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiStorage/utc_msg_thread_view_get_name.h b/TC/msgTC/MapiStorage/utc_msg_thread_view_get_name.h
deleted file mode 100755 (executable)
index 9ee322f..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MapiStorage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
-static void utc_msg_thread_view_get_name_001(void);
-static void utc_msg_thread_view_get_name_002(void);
-
-
-
-struct tet_testlist tet_testlist[] =
-{
-                       { utc_msg_thread_view_get_name_001,1},
-                       { utc_msg_thread_view_get_name_002,2},
-                       {NULL,0}
-};
diff --git a/TC/msgTC/MapiStorage/utc_msg_thread_view_get_sms_cnt.c b/TC/msgTC/MapiStorage/utc_msg_thread_view_get_sms_cnt.c
deleted file mode 100755 (executable)
index 7fec174..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_thread_view_get_sms_cnt.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MSG_SENDINGOPT_S sendOpt;
-MSG_THREAD_VIEW_LIST_S msg_thread_view_list;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MSG_SORT_RULE_S sort_rule;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-
-       memset(&sendOpt, 0x00, sizeof(sendOpt));
-
-       sendOpt.bSetting = false;
-
-       msg_add_message(msgHandle, msgInfo, &sendOpt);
-
-       msg_set_message_id(msgInfo, 0);
-
-       memset(&msg_thread_view_list, 0x00, sizeof(msg_thread_view_list));
-       memset(&sort_rule, 0x00, sizeof(sort_rule));
-
-       msg_get_thread_view_list(msgHandle, NULL, &msg_thread_view_list);
-}
-void cleanup(void)
-{
-       msg_release_thread_view_list(&msg_thread_view_list);
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_thread_view_get_sms_cnt_001()
-{
-       int err = MSG_SUCCESS;
-
-       if(msg_thread_view_list.nCount == 0)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       err = msg_thread_view_get_sms_cnt(msg_thread_view_list.msgThreadInfo[0]);
-       if (err < MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_thread_view_get_sms_cnt_002()
-{
-       int err = MSG_SUCCESS;
-
-       err =  msg_thread_view_get_sms_cnt(NULL);
-       if (err < MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiStorage/utc_msg_thread_view_get_sms_cnt.h b/TC/msgTC/MapiStorage/utc_msg_thread_view_get_sms_cnt.h
deleted file mode 100755 (executable)
index b678862..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MapiStorage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
-static void utc_msg_thread_view_get_sms_cnt_001(void);
-static void utc_msg_thread_view_get_sms_cnt_002(void);
-
-
-
-struct tet_testlist tet_testlist[] =
-{
-                       { utc_msg_thread_view_get_sms_cnt_001,1},
-                       { utc_msg_thread_view_get_sms_cnt_002,2},
-                       {NULL,0}
-};
diff --git a/TC/msgTC/MapiStorage/utc_msg_thread_view_get_thread_id.c b/TC/msgTC/MapiStorage/utc_msg_thread_view_get_thread_id.c
deleted file mode 100755 (executable)
index 75e4ac6..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_thread_view_get_thread_id.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MSG_SENDINGOPT_S sendOpt;
-MSG_THREAD_VIEW_LIST_S msg_thread_view_list;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MSG_SORT_RULE_S sort_rule;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-
-       memset(&sendOpt, 0x00, sizeof(sendOpt));
-
-       sendOpt.bSetting = false;
-
-       msg_add_message(msgHandle, msgInfo, &sendOpt);
-
-       msg_set_message_id(msgInfo, 0);
-
-       memset(&msg_thread_view_list, 0x00, sizeof(msg_thread_view_list));
-       memset(&sort_rule, 0x00, sizeof(sort_rule));
-
-       msg_get_thread_view_list(msgHandle, NULL, &msg_thread_view_list);
-}
-void cleanup(void)
-{
-       msg_release_thread_view_list(&msg_thread_view_list);
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_thread_view_get_thread_id_001()
-{
-       int err = MSG_SUCCESS;
-
-       if(msg_thread_view_list.nCount == 0)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       err = msg_thread_view_get_thread_id(msg_thread_view_list.msgThreadInfo[0]);
-       if (err < MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_thread_view_get_thread_id_002()
-{
-       int err = MSG_SUCCESS;
-
-       err =  msg_thread_view_get_thread_id(NULL);
-       if (err < MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiStorage/utc_msg_thread_view_get_thread_id.h b/TC/msgTC/MapiStorage/utc_msg_thread_view_get_thread_id.h
deleted file mode 100755 (executable)
index a1b3587..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MapiStorage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
-static void utc_msg_thread_view_get_thread_id_001(void);
-static void utc_msg_thread_view_get_thread_id_002(void);
-
-
-
-struct tet_testlist tet_testlist[] =
-{
-                       { utc_msg_thread_view_get_thread_id_001,1},
-                       { utc_msg_thread_view_get_thread_id_002,2},
-                       {NULL,0}
-};
diff --git a/TC/msgTC/MapiStorage/utc_msg_thread_view_get_time.c b/TC/msgTC/MapiStorage/utc_msg_thread_view_get_time.c
deleted file mode 100755 (executable)
index 2759293..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_thread_view_get_time.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MSG_SENDINGOPT_S sendOpt;
-MSG_THREAD_VIEW_LIST_S msg_thread_view_list;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MSG_SORT_RULE_S sort_rule;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-
-       memset(&sendOpt, 0x00, sizeof(sendOpt));
-
-       sendOpt.bSetting = false;
-
-       msg_add_message(msgHandle, msgInfo, &sendOpt);
-
-       msg_set_message_id(msgInfo, 0);
-
-       memset(&msg_thread_view_list, 0x00, sizeof(msg_thread_view_list));
-       memset(&sort_rule, 0x00, sizeof(sort_rule));
-
-       msg_get_thread_view_list(msgHandle, NULL, &msg_thread_view_list);
-}
-void cleanup(void)
-{
-       msg_release_thread_view_list(&msg_thread_view_list);
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_thread_view_get_time_001()
-{
-       int err = MSG_SUCCESS;
-       time_t* time = NULL;
-
-       if(msg_thread_view_list.nCount == 0)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       time = msg_thread_view_get_time(msg_thread_view_list.msgThreadInfo[0]);
-       if (time == NULL)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_thread_view_get_time_002()
-{
-       int err = MSG_SUCCESS;
-       time_t* time = NULL;
-
-       time =  msg_thread_view_get_time(NULL);
-       if (time == NULL)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiStorage/utc_msg_thread_view_get_time.h b/TC/msgTC/MapiStorage/utc_msg_thread_view_get_time.h
deleted file mode 100755 (executable)
index 8b5e190..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MapiStorage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
-static void utc_msg_thread_view_get_time_001(void);
-static void utc_msg_thread_view_get_time_002(void);
-
-
-
-struct tet_testlist tet_testlist[] =
-{
-                       { utc_msg_thread_view_get_time_001,1},
-                       { utc_msg_thread_view_get_time_002,2},
-                       {NULL,0}
-};
diff --git a/TC/msgTC/MapiStorage/utc_msg_thread_view_get_unread_cnt.c b/TC/msgTC/MapiStorage/utc_msg_thread_view_get_unread_cnt.c
deleted file mode 100755 (executable)
index d2d87d9..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_thread_view_get_unread_cnt.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MSG_SENDINGOPT_S sendOpt;
-MSG_THREAD_VIEW_LIST_S msg_thread_view_list;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MSG_SORT_RULE_S sort_rule;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-
-       memset(&sendOpt, 0x00, sizeof(sendOpt));
-
-       sendOpt.bSetting = false;
-
-       msg_add_message(msgHandle, msgInfo, &sendOpt);
-
-       msg_set_message_id(msgInfo, 0);
-
-       memset(&msg_thread_view_list, 0x00, sizeof(msg_thread_view_list));
-       memset(&sort_rule, 0x00, sizeof(sort_rule));
-
-       msg_get_thread_view_list(msgHandle, NULL, &msg_thread_view_list);
-}
-void cleanup(void)
-{
-       msg_release_thread_view_list(&msg_thread_view_list);
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_thread_view_get_unread_cnt_001()
-{
-       int err = MSG_SUCCESS;
-
-       if(msg_thread_view_list.nCount == 0)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       err = msg_thread_view_get_unread_cnt(msg_thread_view_list.msgThreadInfo[0]);
-       if (err < MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_thread_view_get_unread_cnt_002()
-{
-       int err = MSG_SUCCESS;
-
-       err =  msg_thread_view_get_unread_cnt(NULL);
-       if (err < MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiStorage/utc_msg_thread_view_get_unread_cnt.h b/TC/msgTC/MapiStorage/utc_msg_thread_view_get_unread_cnt.h
deleted file mode 100755 (executable)
index 0bc8c6b..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MapiStorage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
-static void utc_msg_thread_view_get_unread_cnt_001(void);
-static void utc_msg_thread_view_get_unread_cnt_002(void);
-
-
-
-struct tet_testlist tet_testlist[] =
-{
-                       { utc_msg_thread_view_get_unread_cnt_001,1},
-                       { utc_msg_thread_view_get_unread_cnt_002,2},
-                       {NULL,0}
-};
diff --git a/TC/msgTC/MapiStorage/utc_msg_update_folder.c b/TC/msgTC/MapiStorage/utc_msg_update_folder.c
deleted file mode 100755 (executable)
index de1bda3..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_update_folder.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MSG_SENDINGOPT_S sendOpt;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-
-       memset(&sendOpt, 0x00, sizeof(sendOpt));
-
-       sendOpt.bSetting = false;
-
-       msg_add_message(msgHandle, msgInfo, &sendOpt);
-
-       msg_set_message_id(msgInfo, 0);
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_update_folder_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MSG_FOLDER_INFO_S folderInfo;
-
-       memset(&folderInfo, 0x00, sizeof(folderInfo));
-
-       folderInfo.folderId = 0;
-       folderInfo.folderType = MSG_FOLDER_TYPE_USER_DEF;
-
-       strncpy(folderInfo.folderName, "Test folder", MAX_FOLDER_NAME_SIZE);
-
-       err = msg_update_folder(msgHandle, &folderInfo);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_update_folder_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MSG_FOLDER_INFO_S folderInfo;
-
-       memset(&folderInfo, 0x00, sizeof(folderInfo));
-
-       folderInfo.folderId = 0;
-       folderInfo.folderType = MSG_FOLDER_TYPE_USER_DEF;
-
-       strncpy(folderInfo.folderName, "Test folder", MAX_FOLDER_NAME_SIZE);
-
-       err = msg_update_folder(NULL, &folderInfo);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiStorage/utc_msg_update_folder.h b/TC/msgTC/MapiStorage/utc_msg_update_folder.h
deleted file mode 100755 (executable)
index 79d66de..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MapiStorage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
-static void utc_msg_update_folder_001(void);
-static void utc_msg_update_folder_002(void);
-
-
-
-struct tet_testlist tet_testlist[] =
-{
-                       { utc_msg_update_folder_001,1},
-                       { utc_msg_update_folder_002,2},
-                       {NULL,0}
-};
diff --git a/TC/msgTC/MapiStorage/utc_msg_update_message.c b/TC/msgTC/MapiStorage/utc_msg_update_message.c
deleted file mode 100755 (executable)
index 27cee62..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_update_message.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MSG_SENDINGOPT_S sendOpt;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-
-       memset(&sendOpt, 0x00, sizeof(sendOpt));
-
-       sendOpt.bSetting = false;
-
-       msg_add_message(msgHandle, msgInfo, &sendOpt);
-
-       msg_set_message_id(msgInfo, 0);
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_update_message_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_update_message(msgHandle, msgInfo, &sendOpt);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_update_message_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_update_message(NULL, msgInfo, &sendOpt);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiStorage/utc_msg_update_message.h b/TC/msgTC/MapiStorage/utc_msg_update_message.h
deleted file mode 100755 (executable)
index 2eb70cc..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MapiStorage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
-static void utc_msg_update_message_001(void);
-static void utc_msg_update_message_002(void);
-
-
-
-struct tet_testlist tet_testlist[] =
-{
-                       { utc_msg_update_message_001,1},
-                       { utc_msg_update_message_002,2},
-                       {NULL,0}
-};
diff --git a/TC/msgTC/MapiStorage/utc_msg_update_protected_status.c b/TC/msgTC/MapiStorage/utc_msg_update_protected_status.c
deleted file mode 100755 (executable)
index 94889f2..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_update_protected_status.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MSG_SENDINGOPT_S sendOpt;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-
-       memset(&sendOpt, 0x00, sizeof(sendOpt));
-
-       sendOpt.bSetting = false;
-
-       msg_add_message(msgHandle, msgInfo, &sendOpt);
-
-       msg_set_message_id(msgInfo, 0);
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_update_protected_status_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_update_protected_status(msgHandle, 0, true);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_update_protected_status_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_update_protected_status(NULL, 0, true);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiStorage/utc_msg_update_protected_status.h b/TC/msgTC/MapiStorage/utc_msg_update_protected_status.h
deleted file mode 100755 (executable)
index a53b18f..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MapiStorage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
-static void utc_msg_update_protected_status_001(void);
-static void utc_msg_update_protected_status_002(void);
-
-
-
-struct tet_testlist tet_testlist[] =
-{
-                       { utc_msg_update_protected_status_001,1},
-                       { utc_msg_update_protected_status_002,2},
-                       {NULL,0}
-};
diff --git a/TC/msgTC/MapiStorage/utc_msg_update_read_status.c b/TC/msgTC/MapiStorage/utc_msg_update_read_status.c
deleted file mode 100755 (executable)
index a529c4c..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_update_read_status.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MSG_SENDINGOPT_S sendOpt;
-int msgId = 0;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msgInfo = msg_new_message();
-
-       memset(&sendOpt, 0x00, sizeof(sendOpt));
-
-       sendOpt.bSetting = false;
-
-       msg_add_address(msgInfo, "01000000000", MSG_RECIPIENTS_TYPE_TO);
-
-       msgId = msg_add_message(msgHandle, msgInfo, &sendOpt);
-
-       tet_printf("msgId is [%d]", msgId);
-
-       //msg_get_folder_view_list(msgHandle, MSG_DRAFT_ID, NULL, &folder_list);
-
-       //msgId = msg_folder_view_get_message_id(folder_list.msgCommInfo[0]);
-
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_update_read_status_001()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_update_read_status(msgHandle, msgId, true);
-       if (err != MSG_SUCCESS)
-       {
-               tet_printf("err is [%d]", err);
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_update_read_status_002()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_update_read_status(NULL, msgId, true);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiStorage/utc_msg_update_read_status.h b/TC/msgTC/MapiStorage/utc_msg_update_read_status.h
deleted file mode 100755 (executable)
index 93b8af3..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MapiStorage.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
-static void utc_msg_update_read_status_001(void);
-static void utc_msg_update_read_status_002(void);
-
-
-
-struct tet_testlist tet_testlist[] =
-{
-                       { utc_msg_update_read_status_001,1},
-                       { utc_msg_update_read_status_002,2},
-                       {NULL,0}
-};
diff --git a/TC/msgTC/MapiTransport/Makefile b/TC/msgTC/MapiTransport/Makefile
deleted file mode 100755 (executable)
index 50ea736..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-###################################################
-# add your TestCase List Here
-#
-# e.g.,
-# TC1 = utc_frameworkName_apiName_func
-# TC2 = utc_ApplicationLib_recurGetDayOfWeek_func
-TC1 = utc_msg_mms_forward_message
-TC2 = utc_msg_reg_lbs_message_callback
-TC3 = utc_msg_sms_send
-TC4 = utc_msg_mms_reject_message
-TC5 = utc_msg_reg_mms_conf_message_callback
-TC6 = utc_msg_sms_send_message
-TC7 = utc_msg_mms_retrieve_message
-TC8 = utc_msg_reg_sent_status_callback
-TC9 = utc_msg_submit_req
-TC10 = utc_msg_mms_send_message
-TC11 = utc_msg_reg_sms_message_callback
-TC12 = utc_msg_mms_send_read_report
-TC13 = utc_msg_reg_syncml_message_callback
-
-       
-###################################################
-# add your Package Config Info Here
-#
-# e.g.,
-# PKGS=calendar
-PKGS=msg-service
-
-LIBS  = `pkg-config --libs $(PKGS)` 
-LIBS +=$(TET_ROOT)/lib/tet3/tcm_s.o
-LIBS +=-L$(TET_ROOT)/lib/tet3 -ltcm_s
-LIBS +=-L$(TET_ROOT)/lib/tet3 -lapi_s
-
-INCS  =  -I. `pkg-config --cflags $(PKGS)`
-INCS  += -I$(TET_ROOT)/inc/tet3 
-
-CFLAGS = $(INCS)
-CFLAGS += -D_TETWARE_MODE
-#CC +=$(CFLAGS)
-LDFLAGS = $(LIBS)
-
-###################################################
-# Modify here 
-# depending on the Test Case you want to build
-# 
-# e.g.,
-# TCLIST = $(TC1) $(TC2)
-TCLIST = $(TC1) $(TC2) $(TC3) $(TC4) $(TC5) $(TC6) $(TC7) $(TC8) $(TC9) $(TC10) $(TC11) $(TC12) $(TC13)
-all :
-       for testcase in $(TCLIST) do\
-               $(CC) -o $$(testcase) $$(testcase).c $(CFLAGS) $(LDFLAGS)
-       done
-
-clean :
-       rm -rf *~ *.o $(TCLIST)
-
-
-$(TC1) : 
-       $(CC) -o $(TC1) $(TC1).c  $(CFLAGS) $(LDFLAGS)
-
-
-$(TC2) : 
-       $(CC) -o $(TC2) $(TC2).c  $(CFLAGS) $(LDFLAGS)
-
-
-$(TC3) : 
-       $(CC) -o $(TC3) $(TC3).c  $(CFLAGS) $(LDFLAGS)
-
-
-$(TC4) : 
-       $(CC) -o $(TC4) $(TC4).c  $(CFLAGS) $(LDFLAGS)
-
-
-$(TC5) : 
-       $(CC) -o $(TC5) $(TC5).c  $(CFLAGS) $(LDFLAGS)
-
-
-$(TC6) : 
-       $(CC) -o $(TC6) $(TC6).c  $(CFLAGS) $(LDFLAGS)
-
-
-$(TC7) : 
-       $(CC) -o $(TC7) $(TC7).c  $(CFLAGS) $(LDFLAGS)
-
-
-$(TC8) : 
-       $(CC) -o $(TC8) $(TC8).c  $(CFLAGS) $(LDFLAGS)
-
-
-$(TC9) : 
-       $(CC) -o $(TC9) $(TC9).c  $(CFLAGS) $(LDFLAGS)
-
-
-$(TC10) : 
-       $(CC) -o $(TC10) $(TC10).c  $(CFLAGS) $(LDFLAGS)
-
-
-$(TC11) : 
-       $(CC) -o $(TC11) $(TC11).c  $(CFLAGS) $(LDFLAGS)
-
-
-$(TC12) : 
-       $(CC) -o $(TC12) $(TC12).c  $(CFLAGS) $(LDFLAGS)
-
-
-$(TC13) : 
-       $(CC) -o $(TC13) $(TC13).c  $(CFLAGS) $(LDFLAGS)
\ No newline at end of file
diff --git a/TC/msgTC/MapiTransport/tslist b/TC/msgTC/MapiTransport/tslist
deleted file mode 100755 (executable)
index 46d803f..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-utc_msg_mms_forward_message   \r
-utc_msg_reg_lbs_message_callback       \r
-utc_msg_sms_send\r
-utc_msg_mms_reject_message    \r
-utc_msg_reg_mms_conf_message_callback  \r
-utc_msg_sms_send_message\r
-utc_msg_mms_retrieve_message  \r
-utc_msg_reg_sent_status_callback       \r
-utc_msg_submit_req\r
-utc_msg_mms_send_message      \r
-utc_msg_reg_sms_message_callback\r
-utc_msg_mms_send_read_report  \r
-utc_msg_reg_syncml_message_callback\r
diff --git a/TC/msgTC/MapiTransport/utc_msg_mms_forward_message.c b/TC/msgTC/MapiTransport/utc_msg_mms_forward_message.c
deleted file mode 100755 (executable)
index 799719f..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_mms_forward_message.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MSG_SENDINGOPT_S sendOpt;
-
-void sentStatusCB(MSG_HANDLE_T Handle, MSG_SENT_STATUS_S *pStatus, void *pUserParam)
-{
-       return;
-}
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MMS_MESSAGE_DATA_S*      mms_data;
-       MMS_PAGE_S*     page[2];
-       MMS_MEDIA_S*    media[5];
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msg_reg_sent_status_callback(msgHandle, &sentStatusCB, (void*)"sent status callback");
-
-       msgInfo = msg_new_message();
-       mms_data = msg_mms_create_message();
-
-       msg_mms_set_rootlayout(mms_data, 100, 100, 0xffffff);
-       msg_mms_add_region(mms_data, "Image", 0, 50, 100, 50, 0xffffff);
-       msg_mms_add_region(mms_data, "Text", 0, 0, 100, 50, 0xffffff);
-
-       //------------>  1st Slide Composing
-       page[0] = msg_mms_add_page(mms_data, 5440);
-
-       media[0] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_IMG, "Image", (char*)"/opt/etc/msg-service/P091120_104633.jpg");
-       media[1] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_AUDIO, NULL, (char*)"/opt/etc/msg-service/audio.amr");
-       media[2] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_TEXT, "Text", (char*)"/opt/etc/msg-service/Temp0_2.txt");
-       media[2]->sMedia.sText.nColor = 0x000000;
-       media[2]->sMedia.sText.nSize = MMS_SMIL_FONT_SIZE_NORMAL;
-       media[2]->sMedia.sText.bBold = true;
-
-       //------------>  2nd Slide Composing
-       page[1] = msg_mms_add_page(mms_data, 4544);
-
-       media[3] = msg_mms_add_media(page[1], MMS_SMIL_MEDIA_TEXT, "Text", (char*)"/opt/etc/msg-service/Temp1_0.txt");
-       media[3]->sMedia.sText.nColor = 0x000000;
-       media[3]->sMedia.sText.nSize = MMS_SMIL_FONT_SIZE_NORMAL;
-       media[3]->sMedia.sText.bItalic = true;
-       media[4] = msg_mms_add_media(page[1], MMS_SMIL_MEDIA_VIDEO, "Text", (char*)"/opt/etc/msg-service/V091120_104905.3gp");
-       strncpy(media[4]->szAlt, "Video Load Fail", MAX_SMIL_ALT_LEN-1);
-
-       msg_set_message_type(msgInfo, MSG_TYPE_MMS);
-
-       msg_mms_set_message_body(msgInfo, mms_data);
-
-       msg_mms_destroy_message(mms_data);
-
-       msg_add_address(msgInfo, "01000000000", MSG_RECIPIENTS_TYPE_TO);
-
-       memset(&sendOpt, 0x00, sizeof(sendOpt));
-
-       sendOpt.bSetting = false;
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_mms_forward_message_001()
-{
-       int err = MSG_SUCCESS;
-       MSG_REQUEST_S req;
-
-       memset(&req, 0x00, sizeof(req));
-
-       req.msg = msgInfo;
-       req.sendOpt = sendOpt;
-
-       err = msg_mms_forward_message(msgHandle, &req);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_mms_forward_message_002()
-{
-       int err = MSG_SUCCESS;
-       MSG_REQUEST_S req;
-
-       memset(&req, 0x00, sizeof(req));
-
-       req.msg = msgInfo;
-       req.sendOpt = sendOpt;
-
-       err = msg_mms_forward_message(NULL, &req);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiTransport/utc_msg_mms_forward_message.h b/TC/msgTC/MapiTransport/utc_msg_mms_forward_message.h
deleted file mode 100755 (executable)
index fc4a885..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MapiTransport.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
-void sentStatusCB(MSG_HANDLE_T Handle, MSG_SENT_STATUS_S *pStatus, void *pUserParam);
-static void utc_msg_mms_forward_message_001(void);
-static void utc_msg_mms_forward_message_002(void);
-
-
-
-struct tet_testlist tet_testlist[] =
-{
-                       { utc_msg_mms_forward_message_001,1},
-                       { utc_msg_mms_forward_message_002,2},
-                       {NULL,0}
-};
diff --git a/TC/msgTC/MapiTransport/utc_msg_mms_reject_message.c b/TC/msgTC/MapiTransport/utc_msg_mms_reject_message.c
deleted file mode 100755 (executable)
index a48878a..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_mms_reject_message.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MSG_SENDINGOPT_S sendOpt;
-
-void sentStatusCB(MSG_HANDLE_T Handle, MSG_SENT_STATUS_S *pStatus, void *pUserParam)
-{
-       return;
-}
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MMS_MESSAGE_DATA_S*      mms_data;
-       MMS_PAGE_S*     page[2];
-       MMS_MEDIA_S*    media[5];
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msg_reg_sent_status_callback(msgHandle, &sentStatusCB, (void*)"sent status callback");
-
-       msgInfo = msg_new_message();
-       mms_data = msg_mms_create_message();
-
-       msg_mms_set_rootlayout(mms_data, 100, 100, 0xffffff);
-       msg_mms_add_region(mms_data, "Image", 0, 50, 100, 50, 0xffffff);
-       msg_mms_add_region(mms_data, "Text", 0, 0, 100, 50, 0xffffff);
-
-       //------------>  1st Slide Composing
-       page[0] = msg_mms_add_page(mms_data, 5440);
-
-       media[0] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_IMG, "Image", (char*)"/opt/etc/msg-service/P091120_104633.jpg");
-       media[1] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_AUDIO, NULL, (char*)"/opt/etc/msg-service/audio.amr");
-       media[2] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_TEXT, "Text", (char*)"/opt/etc/msg-service/Temp0_2.txt");
-       media[2]->sMedia.sText.nColor = 0x000000;
-       media[2]->sMedia.sText.nSize = MMS_SMIL_FONT_SIZE_NORMAL;
-       media[2]->sMedia.sText.bBold = true;
-
-       //------------>  2nd Slide Composing
-       page[1] = msg_mms_add_page(mms_data, 4544);
-
-       media[3] = msg_mms_add_media(page[1], MMS_SMIL_MEDIA_TEXT, "Text", (char*)"/opt/etc/msg-service/Temp1_0.txt");
-       media[3]->sMedia.sText.nColor = 0x000000;
-       media[3]->sMedia.sText.nSize = MMS_SMIL_FONT_SIZE_NORMAL;
-       media[3]->sMedia.sText.bItalic = true;
-       media[4] = msg_mms_add_media(page[1], MMS_SMIL_MEDIA_VIDEO, "Text", (char*)"/opt/etc/msg-service/V091120_104905.3gp");
-       strncpy(media[4]->szAlt, "Video Load Fail", MAX_SMIL_ALT_LEN-1);
-
-       msg_mms_set_message_body(msgInfo, mms_data);
-
-       msg_mms_destroy_message(mms_data);
-
-       msg_add_address(msgInfo, "01000000000", MSG_RECIPIENTS_TYPE_TO);
-
-       memset(&sendOpt, 0x00, sizeof(sendOpt));
-
-       sendOpt.bSetting = false;
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_mms_reject_message_001()
-{
-       int err = MSG_SUCCESS;
-       MSG_REQUEST_S req;
-
-       memset(&req, 0x00, sizeof(req));
-
-       req.msg = msgInfo;
-       req.sendOpt = sendOpt;
-
-       //err = msg_mms_reject_message(msgHandle, &req);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_mms_reject_message_002()
-{
-       int err = MSG_SUCCESS;
-       MSG_REQUEST_S req;
-
-       memset(&req, 0x00, sizeof(req));
-
-       req.msg = msgInfo;
-       req.sendOpt = sendOpt;
-
-       err = msg_mms_reject_message(NULL, &req);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiTransport/utc_msg_mms_reject_message.h b/TC/msgTC/MapiTransport/utc_msg_mms_reject_message.h
deleted file mode 100755 (executable)
index 456eae5..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MapiTransport.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
-void sentStatusCB(MSG_HANDLE_T Handle, MSG_SENT_STATUS_S *pStatus, void *pUserParam);
-static void utc_msg_mms_reject_message_001(void);
-static void utc_msg_mms_reject_message_002(void);
-
-
-
-struct tet_testlist tet_testlist[] =
-{
-                       { utc_msg_mms_reject_message_001,1},
-                       { utc_msg_mms_reject_message_002,2},
-                       {NULL,0}
-};
diff --git a/TC/msgTC/MapiTransport/utc_msg_mms_retrieve_message.c b/TC/msgTC/MapiTransport/utc_msg_mms_retrieve_message.c
deleted file mode 100755 (executable)
index 693931c..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_mms_retrieve_message.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MSG_SENDINGOPT_S sendOpt;
-
-void sentStatusCB(MSG_HANDLE_T Handle, MSG_SENT_STATUS_S *pStatus, void *pUserParam)
-{
-       return;
-}
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MMS_MESSAGE_DATA_S*      mms_data;
-       MMS_PAGE_S*     page[2];
-       MMS_MEDIA_S*    media[5];
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msg_reg_sent_status_callback(msgHandle, &sentStatusCB, (void*)"sent status callback");
-
-       msgInfo = msg_new_message();
-       mms_data = msg_mms_create_message();
-
-       msg_mms_set_rootlayout(mms_data, 100, 100, 0xffffff);
-       msg_mms_add_region(mms_data, "Image", 0, 50, 100, 50, 0xffffff);
-       msg_mms_add_region(mms_data, "Text", 0, 0, 100, 50, 0xffffff);
-
-       //------------>  1st Slide Composing
-       page[0] = msg_mms_add_page(mms_data, 5440);
-
-       media[0] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_IMG, "Image", (char*)"/opt/etc/msg-service/P091120_104633.jpg");
-       media[1] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_AUDIO, NULL, (char*)"/opt/etc/msg-service/audio.amr");
-       media[2] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_TEXT, "Text", (char*)"/opt/etc/msg-service/Temp0_2.txt");
-       media[2]->sMedia.sText.nColor = 0x000000;
-       media[2]->sMedia.sText.nSize = MMS_SMIL_FONT_SIZE_NORMAL;
-       media[2]->sMedia.sText.bBold = true;
-
-       //------------>  2nd Slide Composing
-       page[1] = msg_mms_add_page(mms_data, 4544);
-
-       media[3] = msg_mms_add_media(page[1], MMS_SMIL_MEDIA_TEXT, "Text", (char*)"/opt/etc/msg-service/Temp1_0.txt");
-       media[3]->sMedia.sText.nColor = 0x000000;
-       media[3]->sMedia.sText.nSize = MMS_SMIL_FONT_SIZE_NORMAL;
-       media[3]->sMedia.sText.bItalic = true;
-       media[4] = msg_mms_add_media(page[1], MMS_SMIL_MEDIA_VIDEO, "Text", (char*)"/opt/etc/msg-service/V091120_104905.3gp");
-       strncpy(media[4]->szAlt, "Video Load Fail", MAX_SMIL_ALT_LEN-1);
-
-       msg_mms_set_message_body(msgInfo, mms_data);
-
-       msg_mms_destroy_message(mms_data);
-
-       msg_add_address(msgInfo, "01000000000", MSG_RECIPIENTS_TYPE_TO);
-
-       memset(&sendOpt, 0x00, sizeof(sendOpt));
-
-       sendOpt.bSetting = false;
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_mms_retrieve_message_001()
-{
-       int err = MSG_SUCCESS;
-       MSG_REQUEST_S req;
-
-       memset(&req, 0x00, sizeof(req));
-
-       req.msg = msgInfo;
-       req.sendOpt = sendOpt;
-
-       //err = msg_mms_retrieve_message(msgHandle, &req);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_mms_retrieve_message_002()
-{
-       int err = MSG_SUCCESS;
-       MSG_REQUEST_S req;
-
-       memset(&req, 0x00, sizeof(req));
-
-       req.msg = msgInfo;
-       req.sendOpt = sendOpt;
-
-       err = msg_mms_retrieve_message(NULL, &req);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiTransport/utc_msg_mms_retrieve_message.h b/TC/msgTC/MapiTransport/utc_msg_mms_retrieve_message.h
deleted file mode 100755 (executable)
index 77ecfb4..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MapiTransport.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
-void sentStatusCB(MSG_HANDLE_T Handle, MSG_SENT_STATUS_S *pStatus, void *pUserParam);
-static void utc_msg_mms_retrieve_message_001(void);
-static void utc_msg_mms_retrieve_message_002(void);
-
-
-
-struct tet_testlist tet_testlist[] =
-{
-                       { utc_msg_mms_retrieve_message_001,1},
-                       { utc_msg_mms_retrieve_message_002,2},
-                       {NULL,0}
-};
diff --git a/TC/msgTC/MapiTransport/utc_msg_mms_send_message.c b/TC/msgTC/MapiTransport/utc_msg_mms_send_message.c
deleted file mode 100755 (executable)
index 6016f03..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_mms_send_message.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MSG_SENDINGOPT_S sendOpt;
-
-void sentStatusCB(MSG_HANDLE_T Handle, MSG_SENT_STATUS_S *pStatus, void *pUserParam)
-{
-       return;
-}
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MMS_MESSAGE_DATA_S*      mms_data;
-       MMS_PAGE_S*     page[2];
-       MMS_MEDIA_S*    media[5];
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msg_reg_sent_status_callback(msgHandle, &sentStatusCB, (void*)"sent status callback");
-
-       msgInfo = msg_new_message();
-       mms_data = msg_mms_create_message();
-
-       msg_mms_set_rootlayout(mms_data, 100, 100, 0xffffff);
-       msg_mms_add_region(mms_data, "Image", 0, 50, 100, 50, 0xffffff);
-       msg_mms_add_region(mms_data, "Text", 0, 0, 100, 50, 0xffffff);
-
-       //------------>  1st Slide Composing
-       page[0] = msg_mms_add_page(mms_data, 5440);
-
-       media[0] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_IMG, "Image", (char*)"/opt/etc/msg-service/P091120_104633.jpg");
-       media[1] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_AUDIO, NULL, (char*)"/opt/etc/msg-service/audio.amr");
-       media[2] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_TEXT, "Text", (char*)"/opt/etc/msg-service/Temp0_2.txt");
-       media[2]->sMedia.sText.nColor = 0x000000;
-       media[2]->sMedia.sText.nSize = MMS_SMIL_FONT_SIZE_NORMAL;
-       media[2]->sMedia.sText.bBold = true;
-
-       //------------>  2nd Slide Composing
-       page[1] = msg_mms_add_page(mms_data, 4544);
-
-       media[3] = msg_mms_add_media(page[1], MMS_SMIL_MEDIA_TEXT, "Text", (char*)"/opt/etc/msg-service/Temp1_0.txt");
-       media[3]->sMedia.sText.nColor = 0x000000;
-       media[3]->sMedia.sText.nSize = MMS_SMIL_FONT_SIZE_NORMAL;
-       media[3]->sMedia.sText.bItalic = true;
-       media[4] = msg_mms_add_media(page[1], MMS_SMIL_MEDIA_VIDEO, "Text", (char*)"/opt/etc/msg-service/V091120_104905.3gp");
-       strncpy(media[4]->szAlt, "Video Load Fail", MAX_SMIL_ALT_LEN-1);
-
-       msg_set_message_type(msgInfo, MSG_TYPE_MMS);
-
-       msg_mms_set_message_body(msgInfo, mms_data);
-
-       msg_mms_destroy_message(mms_data);
-
-       msg_add_address(msgInfo, "01000000000", MSG_RECIPIENTS_TYPE_TO);
-
-       memset(&sendOpt, 0x00, sizeof(sendOpt));
-
-       sendOpt.bSetting = false;
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_mms_send_message_001()
-{
-       int err = MSG_SUCCESS;
-       MSG_REQUEST_S req;
-
-       memset(&req, 0x00, sizeof(req));
-
-       req.msg = msgInfo;
-       req.sendOpt = sendOpt;
-
-       err = msg_mms_send_message(msgHandle, &req);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_mms_send_message_002()
-{
-       int err = MSG_SUCCESS;
-       MSG_REQUEST_S req;
-
-       memset(&req, 0x00, sizeof(req));
-
-       req.msg = msgInfo;
-       req.sendOpt = sendOpt;
-
-       err = msg_mms_send_message(NULL, &req);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiTransport/utc_msg_mms_send_message.h b/TC/msgTC/MapiTransport/utc_msg_mms_send_message.h
deleted file mode 100755 (executable)
index a4d1335..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MapiTransport.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
-void sentStatusCB(MSG_HANDLE_T Handle, MSG_SENT_STATUS_S *pStatus, void *pUserParam);
-static void utc_msg_mms_send_message_001(void);
-static void utc_msg_mms_send_message_001(void);
-
-
-
-struct tet_testlist tet_testlist[] =
-{
-                       { utc_msg_mms_send_message_001,1},
-                       { utc_msg_mms_send_message_001,2},
-                       {NULL,0}
-};
diff --git a/TC/msgTC/MapiTransport/utc_msg_mms_send_read_report.c b/TC/msgTC/MapiTransport/utc_msg_mms_send_read_report.c
deleted file mode 100755 (executable)
index f058f95..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_mms_send_read_report.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_mms_send_read_report_001()
-{
-       int err = MSG_SUCCESS;
-
-       //err = msg_mms_send_read_report(msgHandle, 0, MSG_READ_REPORT_IS_READ);
-       if (err != MSG_SUCCESS)
-       {
-               tet_printf("err is [%d]", err);
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_mms_send_read_report_002()
-{
-       int err = MSG_SUCCESS;
-
-       err = msg_mms_send_read_report(NULL, 0, MSG_READ_REPORT_IS_READ);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiTransport/utc_msg_mms_send_read_report.h b/TC/msgTC/MapiTransport/utc_msg_mms_send_read_report.h
deleted file mode 100755 (executable)
index 81a816d..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MapiTransport.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
-static void utc_msg_mms_send_read_report_001(void);
-static void utc_msg_mms_send_read_report_002(void);
-
-
-
-struct tet_testlist tet_testlist[] =
-{
-                       { utc_msg_mms_send_read_report_001,1},
-                       { utc_msg_mms_send_read_report_002,2},
-                       {NULL,0}
-};
diff --git a/TC/msgTC/MapiTransport/utc_msg_reg_lbs_message_callback.c b/TC/msgTC/MapiTransport/utc_msg_reg_lbs_message_callback.c
deleted file mode 100755 (executable)
index bae0855..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_reg_lbs_message_callback.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-
-void lbsCB(MSG_HANDLE_T hMsgHandle, const char* pPushHeader, const char* pPushBody, int pushBodyLen, void *pUserParam)
-{
-       return;
-}
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MSG_SORT_RULE_S sort_rule;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_reg_lbs_message_callback_001()
-{
-       int err = MSG_SUCCESS;
-
-       err = msg_reg_lbs_message_callback(msgHandle, &lbsCB, NULL);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_reg_lbs_message_callback_002()
-{
-       int err = MSG_SUCCESS;
-
-       err = msg_reg_lbs_message_callback(NULL, &lbsCB, NULL);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiTransport/utc_msg_reg_lbs_message_callback.h b/TC/msgTC/MapiTransport/utc_msg_reg_lbs_message_callback.h
deleted file mode 100755 (executable)
index 21c15cc..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MapiTransport.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
-void lbsCB(MSG_HANDLE_T hMsgHandle, const char* pPushHeader, const char* pPushBody, int pushBodyLen, void *pUserParam);
-static void utc_msg_reg_lbs_message_callback_001(void);
-static void utc_msg_reg_lbs_message_callback_002(void);
-
-
-
-struct tet_testlist tet_testlist[] =
-{
-                       { utc_msg_reg_lbs_message_callback_001,1},
-                       { utc_msg_reg_lbs_message_callback_002,2},
-                       {NULL,0}
-};
diff --git a/TC/msgTC/MapiTransport/utc_msg_reg_mms_conf_message_callback.c b/TC/msgTC/MapiTransport/utc_msg_reg_mms_conf_message_callback.c
deleted file mode 100755 (executable)
index 1210a8b..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_reg_mms_conf_message_callback.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-
-void incomingMmsConfCB(MSG_HANDLE_T Handle, msg_message_t msg, void *pUserParam)
-{
-       return;
-}
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MSG_SORT_RULE_S sort_rule;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_reg_mms_conf_message_callback_001()
-{
-       int err = MSG_SUCCESS;
-
-       err = msg_reg_mms_conf_message_callback(msgHandle, &incomingMmsConfCB, NULL, NULL);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_reg_mms_conf_message_callback_002()
-{
-       int err = MSG_SUCCESS;
-
-       err = msg_reg_mms_conf_message_callback(NULL, &incomingMmsConfCB, NULL, NULL);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiTransport/utc_msg_reg_mms_conf_message_callback.h b/TC/msgTC/MapiTransport/utc_msg_reg_mms_conf_message_callback.h
deleted file mode 100755 (executable)
index aca4584..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MapiTransport.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
-void incomingMmsConfCB(MSG_HANDLE_T Handle, msg_message_t msg, void *pUserParam);
-static void utc_msg_reg_mms_conf_message_callback_001(void);
-static void utc_msg_reg_mms_conf_message_callback_002(void);
-
-
-
-struct tet_testlist tet_testlist[] =
-{
-                       { utc_msg_reg_mms_conf_message_callback_001,1},
-                       { utc_msg_reg_mms_conf_message_callback_002,2},
-                       {NULL,0}
-};
diff --git a/TC/msgTC/MapiTransport/utc_msg_reg_sent_status_callback.c b/TC/msgTC/MapiTransport/utc_msg_reg_sent_status_callback.c
deleted file mode 100755 (executable)
index 61c6429..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_reg_sent_status_callback.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-
-void sentStatusCB(MSG_HANDLE_T Handle, MSG_SENT_STATUS_S *pStatus, void *pUserParam)
-{
-       return;
-}
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MSG_SORT_RULE_S sort_rule;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_reg_sent_status_callback_001()
-{
-       int err = MSG_SUCCESS;
-
-       err = msg_reg_sent_status_callback(msgHandle, &sentStatusCB, (void*)"sent status callback");
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_reg_sent_status_callback_002()
-{
-       int err = MSG_SUCCESS;
-
-       err = msg_reg_sent_status_callback(NULL, &sentStatusCB, (void*)"sent status callback");
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiTransport/utc_msg_reg_sent_status_callback.h b/TC/msgTC/MapiTransport/utc_msg_reg_sent_status_callback.h
deleted file mode 100755 (executable)
index 300a5b8..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MapiTransport.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
-void sentStatusCB(MSG_HANDLE_T Handle, MSG_SENT_STATUS_S *pStatus, void *pUserParam);
-static void utc_msg_reg_sent_status_callback_001(void);
-static void utc_msg_reg_sent_status_callback_002(void);
-
-
-
-struct tet_testlist tet_testlist[] =
-{
-                       { utc_msg_reg_sent_status_callback_001,1},
-                       { utc_msg_reg_sent_status_callback_002,2},
-                       {NULL,0}
-};
diff --git a/TC/msgTC/MapiTransport/utc_msg_reg_sms_message_callback.c b/TC/msgTC/MapiTransport/utc_msg_reg_sms_message_callback.c
deleted file mode 100755 (executable)
index ce8a0ce..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_reg_sms_message_callback.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-
-void incomingSmsCB(MSG_HANDLE_T Handle, msg_message_t msg, void *pUserParam)
-{
-       return;
-}
-
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MSG_SORT_RULE_S sort_rule;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_reg_sms_message_callback_001()
-{
-       int err = MSG_SUCCESS;
-
-       err = msg_reg_sms_message_callback(msgHandle, &incomingSmsCB, 0, (void*)"sms message callback");
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_reg_sms_message_callback_002()
-{
-       int err = MSG_SUCCESS;
-
-       err = msg_reg_sms_message_callback(NULL, &incomingSmsCB, 0, (void*)"sms message callback");
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiTransport/utc_msg_reg_sms_message_callback.h b/TC/msgTC/MapiTransport/utc_msg_reg_sms_message_callback.h
deleted file mode 100755 (executable)
index 644ccd9..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MapiTransport.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
-void incomingSmsCB(MSG_HANDLE_T Handle, msg_message_t msg, void *pUserParam);
-static void utc_msg_reg_sms_message_callback_001(void);
-static void utc_msg_reg_sms_message_callback_002(void);
-
-
-
-struct tet_testlist tet_testlist[] =
-{
-                       { utc_msg_reg_sms_message_callback_001,1},
-                       { utc_msg_reg_sms_message_callback_002,2},
-                       {NULL,0}
-};
diff --git a/TC/msgTC/MapiTransport/utc_msg_reg_syncml_message_callback.c b/TC/msgTC/MapiTransport/utc_msg_reg_syncml_message_callback.c
deleted file mode 100755 (executable)
index 1fa579f..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_reg_syncml_message_callback.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-
-void syncMLCB(MSG_HANDLE_T hMsgHandle, MSG_SYNCML_MESSAGE_TYPE_T msgType, const char* pPushHeader, int PushHeaderLen, const char* pPushBody, int PushBodyLen, void *pUserParam)
-{
-       return;
-}
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MSG_SORT_RULE_S sort_rule;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_reg_syncml_message_callback_001()
-{
-       int err = MSG_SUCCESS;
-
-       err = msg_reg_syncml_message_callback(msgHandle, &syncMLCB, NULL);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_reg_syncml_message_callback_002()
-{
-       int err = MSG_SUCCESS;
-
-       err = msg_reg_syncml_message_callback(NULL, &syncMLCB, NULL);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiTransport/utc_msg_reg_syncml_message_callback.h b/TC/msgTC/MapiTransport/utc_msg_reg_syncml_message_callback.h
deleted file mode 100755 (executable)
index c89c842..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MapiTransport.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
-void sentStatusCB(MSG_HANDLE_T Handle, MSG_SENT_STATUS_S *pStatus, void *pUserParam);
-static void utc_msg_reg_syncml_message_callback_001(void);
-static void utc_msg_reg_syncml_message_callback_002(void);
-
-
-
-struct tet_testlist tet_testlist[] =
-{
-                       { utc_msg_reg_syncml_message_callback_001,1},
-                       { utc_msg_reg_syncml_message_callback_002,2},
-                       {NULL,0}
-};
diff --git a/TC/msgTC/MapiTransport/utc_msg_sms_send.c b/TC/msgTC/MapiTransport/utc_msg_sms_send.c
deleted file mode 100755 (executable)
index 5496b9c..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_sms_send.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-
-void sentStatusCB(MSG_SENT_STATUS_S *pStatus, void *pUserParam)
-{
-       return;
-}
-
-void startup(void)
-{
-
-}
-void cleanup(void)
-{
-
-}
-
-void utc_msg_sms_send_001()
-{
-       int err = MSG_SUCCESS;
-
-       err = msg_sms_send("01000000000,01000000000", "1234567890", sentStatusCB, NULL);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_sms_send_002()
-{
-       int err = MSG_SUCCESS;
-
-       err = msg_sms_send(NULL, "1234567890", sentStatusCB, NULL);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiTransport/utc_msg_sms_send.h b/TC/msgTC/MapiTransport/utc_msg_sms_send.h
deleted file mode 100755 (executable)
index 9c76a4d..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MapiTransport.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
-void sentStatusCB(MSG_SENT_STATUS_S *pStatus, void *pUserParam);
-static void utc_msg_sms_send_001(void);
-static void utc_msg_sms_send_002(void);
-
-
-
-struct tet_testlist tet_testlist[] =
-{
-                       { utc_msg_sms_send_001,1},
-                       { utc_msg_sms_send_002,2},
-                       {NULL,0}
-};
diff --git a/TC/msgTC/MapiTransport/utc_msg_sms_send_message.c b/TC/msgTC/MapiTransport/utc_msg_sms_send_message.c
deleted file mode 100755 (executable)
index da1ead3..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_sms_send_message.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MSG_SENDINGOPT_S sendOpt;
-
-void sentStatusCB(MSG_HANDLE_T Handle, MSG_SENT_STATUS_S *pStatus, void *pUserParam)
-{
-       return;
-}
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MSG_SORT_RULE_S sort_rule;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msg_reg_sent_status_callback(msgHandle, &sentStatusCB, (void*)"sent status callback");
-
-       msgInfo = msg_new_message();
-
-       msg_set_message_type(msgInfo, MSG_TYPE_SMS);
-
-       msg_sms_set_message_body(msgInfo, "1234567890", 10);
-
-       msg_add_address(msgInfo, "01000000000", MSG_RECIPIENTS_TYPE_TO);
-
-       memset(&sendOpt, 0x00, sizeof(sendOpt));
-
-       sendOpt.bSetting = false;
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_sms_send_message_001()
-{
-       int err = MSG_SUCCESS;
-       MSG_REQUEST_S req;
-
-       memset(&req, 0x00, sizeof(req));
-
-       req.msg = msgInfo;
-       req.sendOpt = sendOpt;
-
-       err = msg_sms_send_message(msgHandle, &req);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_sms_send_message_002()
-{
-       int err = MSG_SUCCESS;
-       MSG_REQUEST_S req;
-
-       memset(&req, 0x00, sizeof(req));
-
-       req.msg = msgInfo;
-       req.sendOpt = sendOpt;
-
-       err = msg_sms_send_message(NULL, &req);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiTransport/utc_msg_sms_send_message.h b/TC/msgTC/MapiTransport/utc_msg_sms_send_message.h
deleted file mode 100755 (executable)
index aab36ca..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MapiTransport.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
-void sentStatusCB(MSG_HANDLE_T Handle, MSG_SENT_STATUS_S *pStatus, void *pUserParam);
-static void utc_msg_sms_send_message_001(void);
-static void utc_msg_sms_send_message_002(void);
-
-
-
-struct tet_testlist tet_testlist[] =
-{
-                       { utc_msg_sms_send_message_001,1},
-                       { utc_msg_sms_send_message_002,2},
-                       {NULL,0}
-};
diff --git a/TC/msgTC/MapiTransport/utc_msg_submit_req.c b/TC/msgTC/MapiTransport/utc_msg_submit_req.c
deleted file mode 100755 (executable)
index 723b3c7..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "utc_msg_submit_req.h"
-
-static MSG_HANDLE_T msgHandle = NULL;
-msg_message_t msgInfo;
-MSG_SENDINGOPT_S sendOpt;
-
-void sentStatusCB(MSG_HANDLE_T Handle, MSG_SENT_STATUS_S *pStatus, void *pUserParam)
-{
-       return;
-}
-
-void startup(void)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-       MSG_SORT_RULE_S sort_rule;
-
-       err = msg_open_msg_handle(&msgHandle);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       msg_reg_sent_status_callback(msgHandle, &sentStatusCB, (void*)"sent status callback");
-
-       msgInfo = msg_new_message();
-
-       msg_set_message_type(msgInfo, MSG_TYPE_SMS);
-
-       msg_sms_set_message_body(msgInfo, "1234567890", 10);
-
-       msg_add_address(msgInfo, "01000000000", MSG_RECIPIENTS_TYPE_TO);
-
-       memset(&sendOpt, 0x00, sizeof(sendOpt));
-
-       sendOpt.bSetting = false;
-}
-void cleanup(void)
-{
-       msg_close_msg_handle(&msgHandle);
-}
-
-void utc_msg_submit_req_001()
-{
-       int err = MSG_SUCCESS;
-       MSG_REQUEST_S req;
-
-       memset(&req, 0x00, sizeof(req));
-
-       req.msg = msgInfo;
-       req.sendOpt = sendOpt;
-
-       err = msg_submit_req(msgHandle, &req);
-       if (err != MSG_SUCCESS)
-       {
-               tet_printf("err is [%d]", err);
-               tet_result(TET_FAIL);
-               return;
-       }
-
-       tet_result(TET_PASS);
-}
-
-void utc_msg_submit_req_002()
-{
-       int err = MSG_SUCCESS;
-       MSG_REQUEST_S req;
-
-       memset(&req, 0x00, sizeof(req));
-
-       req.msg = msgInfo;
-       req.sendOpt = sendOpt;
-
-       err = msg_submit_req(NULL, &req);
-       if (err != MSG_SUCCESS)
-       {
-               tet_result(TET_PASS);
-               return;
-       }
-
-       tet_result(TET_FAIL);
-}
diff --git a/TC/msgTC/MapiTransport/utc_msg_submit_req.h b/TC/msgTC/MapiTransport/utc_msg_submit_req.h
deleted file mode 100755 (executable)
index 8f15484..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <tet_api.h>
-
-#include "MapiMessage.h"
-#include "MapiTransport.h"
-
-static void startup(), cleanup();
-void (*tet_startup) () = startup;
-void (*tet_cleanup) () = cleanup;
-
-void sentStatusCB(MSG_HANDLE_T Handle, MSG_SENT_STATUS_S *pStatus, void *pUserParam);
-static void utc_msg_submit_req_001(void);
-static void utc_msg_submit_req_002(void);
-
-
-
-struct tet_testlist tet_testlist[] =
-{
-                       { utc_msg_submit_req_001,1},
-                       { utc_msg_submit_req_002,2},
-                       {NULL,0}
-};
diff --git a/TC/tet_scen b/TC/tet_scen
deleted file mode 100755 (executable)
index 29ef78e..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-# auto generated tet_scen
-all
-       "Starting Full Test Suite"
-       /msgTC/MapiSetting/utc_msg_get_config
-       /msgTC/MapiSetting/utc_msg_set_config
-       /msgTC/MapiFilter/utc_msg_add_filter
-       /msgTC/MapiFilter/utc_msg_delete_filter
-       /msgTC/MapiFilter/utc_msg_get_filter_list
-       /msgTC/MapiFilter/utc_msg_update_filter
-       /msgTC/MapiStorage/utc_msg_add_folder
-       /msgTC/MapiStorage/utc_msg_add_message
-       /msgTC/MapiStorage/utc_msg_get_conversation_view_list
-       /msgTC/MapiStorage/utc_msg_add_syncml_message
-       /msgTC/MapiStorage/utc_msg_get_folder_list
-       /msgTC/MapiStorage/utc_msg_get_folder_view_list
-       /msgTC/MapiStorage/utc_msg_get_mem_size
-       /msgTC/MapiStorage/utc_msg_get_message
-       /msgTC/MapiStorage/utc_msg_get_quick_panel_data
-       /msgTC/MapiStorage/utc_msg_get_thread_view_list
-       /msgTC/MapiStorage/utc_msg_move_msg_to_folder
-       /msgTC/MapiStorage/utc_msg_move_msg_to_storage
-       /msgTC/MapiStorage/utc_msg_release_folder_list
-       /msgTC/MapiStorage/utc_msg_release_thread_view_list
-       /msgTC/MapiStorage/utc_msg_reset_database
-       /msgTC/MapiStorage/utc_msg_generate_message
-       /msgTC/MapiStorage/utc_msg_count_message
-       /msgTC/MapiStorage/utc_msg_count_msg_by_contact
-       /msgTC/MapiStorage/utc_msg_thread_view_get_address
-       /msgTC/MapiStorage/utc_msg_count_msg_by_type
-       /msgTC/MapiStorage/utc_msg_thread_view_get_contact_id
-       /msgTC/MapiStorage/utc_msg_delete_all_msgs_in_folder
-       /msgTC/MapiStorage/utc_msg_thread_view_get_data
-       /msgTC/MapiStorage/utc_msg_delete_folder
-       /msgTC/MapiStorage/utc_msg_thread_view_get_direction
-       /msgTC/MapiStorage/utc_msg_delete_message
-       /msgTC/MapiStorage/utc_msg_thread_view_get_image_path
-       /msgTC/MapiStorage/utc_msg_delete_thread_message_list
-       /msgTC/MapiStorage/utc_msg_thread_view_get_mms_cnt
-       /msgTC/MapiStorage/utc_msg_thread_view_get_name
-       /msgTC/MapiStorage/utc_msg_thread_view_get_sms_cnt
-       /msgTC/MapiStorage/utc_msg_thread_view_get_thread_id
-       /msgTC/MapiStorage/utc_msg_thread_view_get_time
-       /msgTC/MapiStorage/utc_msg_thread_view_get_unread_cnt
-       /msgTC/MapiStorage/utc_msg_update_folder
-       /msgTC/MapiStorage/utc_msg_update_message
-       /msgTC/MapiStorage/utc_msg_update_protected_status
-       /msgTC/MapiStorage/utc_msg_update_read_status
-       /msgTC/MapiControl/utc_msg_open_msg_handle
-       /msgTC/MapiControl/utc_msg_close_msg_handle
-       /msgTC/MapiTransport/utc_msg_mms_forward_message
-       /msgTC/MapiTransport/utc_msg_reg_lbs_message_callback
-       /msgTC/MapiTransport/utc_msg_sms_send
-       /msgTC/MapiTransport/utc_msg_mms_reject_message
-       /msgTC/MapiTransport/utc_msg_reg_mms_conf_message_callback
-       /msgTC/MapiTransport/utc_msg_sms_send_message
-       /msgTC/MapiTransport/utc_msg_mms_retrieve_message
-       /msgTC/MapiTransport/utc_msg_reg_sent_status_callback
-       /msgTC/MapiTransport/utc_msg_submit_req
-       /msgTC/MapiTransport/utc_msg_mms_send_message
-       /msgTC/MapiTransport/utc_msg_reg_sms_message_callback
-       /msgTC/MapiTransport/utc_msg_mms_send_read_report
-       /msgTC/MapiTransport/utc_msg_reg_syncml_message_callback
-       /msgTC/MapiMessage/utc_msg_add_address
-       /msgTC/MapiMessage/utc_msg_get_time
-       /msgTC/MapiMessage/utc_msg_new_message
-       /msgTC/MapiMessage/utc_msg_mms_create_message
-       /msgTC/MapiMessage/utc_msg_is_in_sim
-       /msgTC/MapiMessage/utc_msg_release_message
-       /msgTC/MapiMessage/utc_msg_get_address_count
-       /msgTC/MapiMessage/utc_msg_is_mms
-       /msgTC/MapiMessage/utc_msg_reset_address
-       /msgTC/MapiMessage/utc_msg_get_dest_port
-       /msgTC/MapiMessage/utc_msg_is_protected
-       /msgTC/MapiMessage/utc_msg_set_direction_info
-       /msgTC/MapiMessage/utc_msg_get_direction_info
-       /msgTC/MapiMessage/utc_msg_is_read
-       /msgTC/MapiMessage/utc_msg_set_encode_type
-       /msgTC/MapiMessage/utc_msg_get_encode_type
-       /msgTC/MapiMessage/utc_msg_is_sms
-       /msgTC/MapiMessage/utc_msg_set_folder_id
-       /msgTC/MapiMessage/utc_msg_get_folder_id
-       /msgTC/MapiMessage/utc_msg_mms_add_attachment
-       /msgTC/MapiMessage/utc_msg_set_message_id
-       /msgTC/MapiMessage/utc_msg_get_ith_address
-       /msgTC/MapiMessage/utc_msg_mms_add_media
-       /msgTC/MapiMessage/utc_msg_set_message_type
-       /msgTC/MapiMessage/utc_msg_get_ith_contact_id
-       /msgTC/MapiMessage/utc_msg_mms_add_page
-       /msgTC/MapiMessage/utc_msg_set_network_status
-       /msgTC/MapiMessage/utc_msg_get_ith_name
-       /msgTC/MapiMessage/utc_msg_mms_add_region
-       /msgTC/MapiMessage/utc_msg_set_port
-       /msgTC/MapiMessage/utc_msg_get_ith_recipient_type
-       /msgTC/MapiMessage/utc_msg_mms_add_transition
-       /msgTC/MapiMessage/utc_msg_mms_add_meta
-       /msgTC/MapiMessage/utc_msg_set_priority_info
-       /msgTC/MapiMessage/utc_msg_get_ith_thread_id
-       /msgTC/MapiMessage/utc_msg_mms_destroy_message
-       /msgTC/MapiMessage/utc_msg_set_protect_status
-       /msgTC/MapiMessage/utc_msg_get_message_body_size
-       /msgTC/MapiMessage/utc_msg_mms_get_attachment
-       /msgTC/MapiMessage/utc_msg_set_read_status
-       /msgTC/MapiMessage/utc_msg_get_message_id
-       /msgTC/MapiMessage/utc_msg_mms_get_media
-       /msgTC/MapiMessage/utc_msg_set_scheduled_time
-       /msgTC/MapiMessage/utc_msg_get_message_type
-       /msgTC/MapiMessage/utc_msg_mms_get_message_body
-       /msgTC/MapiMessage/utc_msg_set_storage_id
-       /msgTC/MapiMessage/utc_msg_get_network_status
-       /msgTC/MapiMessage/utc_msg_mms_get_meta
-       /msgTC/MapiMessage/utc_msg_set_subject
-       /msgTC/MapiMessage/utc_msg_get_priority_info
-       /msgTC/MapiMessage/utc_msg_mms_get_page
-       /msgTC/MapiMessage/utc_msg_set_time
-       /msgTC/MapiMessage/utc_msg_get_scheduled_time
-       /msgTC/MapiMessage/utc_msg_mms_get_smil_region
-       /msgTC/MapiMessage/utc_msg_sms_get_message_body
-       /msgTC/MapiMessage/utc_msg_get_src_port
-       /msgTC/MapiMessage/utc_msg_mms_get_transition
-       /msgTC/MapiMessage/utc_msg_sms_set_message_body
-       /msgTC/MapiMessage/utc_msg_get_storage_id
-       /msgTC/MapiMessage/utc_msg_mms_set_message_body
-       /msgTC/MapiMessage/utc_msg_get_subject
-       /msgTC/MapiMessage/utc_msg_mms_set_rootlayout
-       "Completed Full Test Suite"
-# EOF
diff --git a/TC/tetbuild.cfg b/TC/tetbuild.cfg
deleted file mode 100644 (file)
index f7eda55..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-TET_OUTPUT_CAPTURE=True # capture option for build operation checking
-TET_BUILD_TOOL=make # build with using make command
-TET_BUILD_FILE=-f Makefile # execution file (Makefile) for build
-TET_API_COMPLIANT=True # use TET API in Test Case ?
-TET_PASS_TC_NAME=True # report passed TC name in Journal file?
diff --git a/TC/tetclean.cfg b/TC/tetclean.cfg
deleted file mode 100644 (file)
index 7b613aa..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-TET_OUTPUT_CAPTURE=True # capture option
-TET_CLEAN_TOOL=make clean # clean tool
-TET_CLEAN_FILE=Makefile # file for clean
-TET_API_COMPLIANT=True # TET API useage 
-TET_PASS_TC_NAME=True # showing name , passed TC
diff --git a/TC/tetexec.cfg b/TC/tetexec.cfg
deleted file mode 100644 (file)
index ef3e452..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-TET_OUTPUT_CAPTURE=True # capturing execution or not
-TET_EXEC_TOOL=  # ex) exec : execution tool set up/ Optional
-TET_EXEC_FILE=   # ex) exectool : execution file/ Optional
-TET_API_COMPLIANT=True # Test case or Tool usesTET API?
-TET_PASS_TC_NAME=True # showing Passed TC name ?
diff --git a/TC/tslist.txt b/TC/tslist.txt
deleted file mode 100755 (executable)
index e592151..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-msgTC/MapiSetting/tslist
-msgTC/MapiStorage/tslist
-msgTC/MapiControl/tslist
-msgTC/MapiTransport/tslist
-msgTC/MapiMessage/tslist
diff --git a/config/.msg_service.db b/config/.msg_service.db
deleted file mode 100755 (executable)
index 1eeb234..0000000
Binary files a/config/.msg_service.db and /dev/null differ
diff --git a/config/.msg_service.db-journal b/config/.msg_service.db-journal
deleted file mode 100755 (executable)
index dd46069..0000000
Binary files a/config/.msg_service.db-journal and /dev/null differ
diff --git a/config/kdb-setting.sh b/config/kdb-setting.sh
deleted file mode 100755 (executable)
index 8358c02..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-vconftool set -t bool db/msg/general/keep_copy 1
-vconftool set -t int db/msg/general/alert_tone 0
-vconftool set -t bool db/msg/general/auto_erase 0
-
-vconftool set -t int db/msg/sms_send/dcs 3
-vconftool set -t int db/msg/network_mode 4
-vconftool set -t bool db/msg/sms_send/reply_path 0
-vconftool set -t bool db/msg/sms_send/delivery_report 0
-vconftool set -t int db/msg/sms_send/save_storage 1
-
-vconftool set -t int db/msg/mms_send/msg_class 0
-vconftool set -t int db/msg/mms_send/priority 1
-vconftool set -t int db/msg/mms_send/expiry 0
-vconftool set -t bool db/msg/mms_send/custom_delivery 0
-vconftool set -t bool db/msg/mms_send/sender_visibility 0
-vconftool set -t bool db/msg/mms_send/delivery_report 1
-vconftool set -t bool db/msg/mms_send/read_reply 1
-vconftool set -t bool db/msg/mms_send/keep_copy 0
-vconftool set -t bool db/msg/mms_send/body_replying 0
-vconftool set -t bool db/msg/mms_send/hide_recipients 0
-vconftool set -t bool db/msg/mms_send/report_allowed 1
-vconftool set -t int db/msg/mms_send/reply_charging 0
-vconftool set -t int db/msg/mms_send/reply_charging_deadline 0
-vconftool set -t int db/msg/mms_send/reply_charging_size 0
-vconftool set -t int db/msg/mms_send/delivery_time 0
-vconftool set -t int db/msg/mms_send/creation_mode 2
-
-vconftool set -t int db/msg/mms_recv/home_network 0
-vconftool set -t int db/msg/mms_recv/abroad_network 0
-vconftool set -t bool db/msg/mms_recv/read_receipt 1
-vconftool set -t bool db/msg/mms_recv/delivery_receipt 1
-vconftool set -t bool db/msg/mms_recv/reject_unknown 0
-vconftool set -t bool db/msg/mms_recv/reject_advertisement 0
-
-vconftool set -t bool db/msg/push_msg/recv_option 1
-vconftool set -t int db/msg/push_msg/service_load 1
-
-vconftool set -t bool db/msg/cb_msg/receive 0
-vconftool set -t bool db/msg/cb_msg/all_channel 0
-vconftool set -t int db/msg/cb_msg/max_sim_count 0
-vconftool set -t int db/msg/cb_msg/channel_count 0
-vconftool set -t bool db/msg/cb_msg/language/0 0
-vconftool set -t bool db/msg/cb_msg/language/1 0
-vconftool set -t bool db/msg/cb_msg/language/2 0
-vconftool set -t bool db/msg/cb_msg/language/3 0
-vconftool set -t bool db/msg/cb_msg/language/4 0
-vconftool set -t bool db/msg/cb_msg/language/5 0
-vconftool set -t bool db/msg/cb_msg/language/6 0
-vconftool set -t bool db/msg/cb_msg/language/7 0
-vconftool set -t bool db/msg/cb_msg/language/8 0
-vconftool set -t bool db/msg/cb_msg/language/9 0
-
-vconftool set -t int db/msg/size_opt/msg_size 300
-
diff --git a/debian/changelog b/debian/changelog
deleted file mode 100755 (executable)
index 039e295..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-msg-service (0.8.7-5) unstable; urgency=low
-
-  * Add #include <sys/stat.h> to support chmod related defines.
-  * Fix DRM content issue(unregistered mo content)
-  * Git : public/pkgs/m/msg-service
-  * Tag : msg-service_0.8.7-5
-
- -- Jaeyun Jeong <jyjeong@samsung.com>  Fri, 16 Mar 2012 17:54:21 +0900
\ No newline at end of file
diff --git a/debian/compat b/debian/compat
deleted file mode 100644 (file)
index 7ed6ff8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-5
diff --git a/debian/control b/debian/control
deleted file mode 100755 (executable)
index 61c0577..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-Source: msg-service
-Section: libs
-Priority: extra
-Maintainer: Jaeyun Jeong <jyjeong@samsung.com>, Sangkoo Kim <sangkoo.kim@samsung.com>, Seunghwan Lee <sh.cat.lee@samsung.com>, SoonMin Jung <sm0415.jung@samsung.com>, Jae-Young Lee <jy4710.lee@samsung.com>, KeeBum Kim <keebum.kim@samsung.com>
-Build-Depends: debhelper (>= 5), libnetwork-dev, libslp-setting-dev, libglib2.0-dev, libslp-tapi-dev, libslp-db-util-dev, libwbxml2-dev, libxml2-dev, libmm-player-dev, dlog-dev, libcontacts-service-dev, drm-client-dev, drm-trusted-dev, libslp-pm-dev, libmm-fileinfo-dev, libdevman-haptic-dev, libalarm-dev, capi-appfw-application-dev, libmm-session-sdk-dev, libmm-session-dev, libcurl-dev, libnotification-dev, libsecurity-server-client-dev, libmm-utility-dev, libsvi-dev, libmedia-thumbnail-dev
-Standards-Version: 0.1.0
-Homepage: N/A
-
-Package: libslp-msg-service-dev
-XB-Generate-Docs: yes
-Section: libdevel
-Architecture: any
-Depends: libslp-msg-service-0 (= ${Source-Version}), libglib2.0-dev
-Description: Messaging Framework Library (development)
-
-Package: libslp-msg-service-0
-Section: libs
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Description: Messaging Framework Library (Library)
-
-Package: msg-service-tools
-Section: utils
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, libslp-msg-service-0 (= ${Source-Version})
-Description: messaging server application
-
-Package: libslp-sms-plugin
-Section: libs
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, libslp-msg-service-0 (= ${Source-Version})
-Description: SMS Plugin Library
-
-Package: libslp-mms-plugin
-Section: libs
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, libslp-msg-service-0 (= ${Source-Version})
-Description: MMS Plugin Library
-
-Package: libslp-msg-service-0-dbg
-Section: debug
-Architecture: any
-Depends: libslp-msg-service-0 (= ${Source-Version}), msg-service-tools (= ${Source-Version}), ${shlibs:Depends}
-Description: Messaging Framework Library (unstripped)
diff --git a/debian/dirs b/debian/dirs
deleted file mode 100644 (file)
index ca882bb..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-usr/bin
-usr/sbin
diff --git a/debian/docs b/debian/docs
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/debian/libslp-mms-plugin.install.in b/debian/libslp-mms-plugin.install.in
deleted file mode 100755 (executable)
index 059a1a3..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-@PREFIX@/lib/libmsg_mms_language_pack.so
-@PREFIX@/lib/libmsg_mms_plugin.so
diff --git a/debian/libslp-msg-service-0.install.in b/debian/libslp-msg-service-0.install.in
deleted file mode 100755 (executable)
index fa9615e..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-@PREFIX@/lib/libmsg_utils.so
-@PREFIX@/lib/libmsg_plugin_manager.so
-@PREFIX@/lib/libmsg_framework_handler.so
-@PREFIX@/lib/libmsg_transaction_manager.so
-@PREFIX@/lib/libmsg_transaction_proxy.so
-@PREFIX@/lib/libmsg_mapi.so
-@PREFIX@/lib/libmsg_mapi.so.*
-@PREFIX@/share/msg-service/plugin.cfg
-etc/*
diff --git a/debian/libslp-msg-service-dev.install.in b/debian/libslp-msg-service-dev.install.in
deleted file mode 100755 (executable)
index 3683e76..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-@PREFIX@/include/msg-service/*.h
-@PREFIX@/lib/pkgconfig/*.pc
diff --git a/debian/libslp-sms-plugin.install.in b/debian/libslp-sms-plugin.install.in
deleted file mode 100755 (executable)
index b2d564e..0000000
+++ /dev/null
@@ -1 +0,0 @@
-@PREFIX@/lib/libmsg_sms_plugin.so
diff --git a/debian/msg-service-tools.install.in b/debian/msg-service-tools.install.in
deleted file mode 100755 (executable)
index 5962ca9..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-@PREFIX@/bin/*
-@PREFIX@/share/media/*
-@DATADIR@/etc/msg-service/*
-#@DATADIR@/dbspace/.msg_service.db
-#@DATADIR@/dbspace/.msg_service.db-journal
diff --git a/debian/msg-service-tools.postinst b/debian/msg-service-tools.postinst
deleted file mode 100755 (executable)
index 894e954..0000000
+++ /dev/null
@@ -1,208 +0,0 @@
-#!/bin/sh
-set -e
-# Automatically added by dh_makeshlibs
-if [ "$1" = "configure" ]; then
-       ldconfig
-fi
-# End automatically added section
-
-#. /etc/ipkg/functions
-
-#PATH=$PATH:/usr/bin
-#CURRENT_PATH=$PWD
-
-#cd /usr/bin
-
-#initDB
-#rm /opt/dbspace/.msg_service.db*
-
-if [ ! -f /opt/dbspace/.msg_service.db ]
-then
-       sqlite3 /opt/dbspace/.msg_service.db "PRAGMA journal_mode = PERSIST;
-
-       CREATE TABLE MSG_ADDRESS_TABLE(ADDRESS_ID INTEGER PRIMARY KEY, ADDRESS_TYPE INTEGER, RECIPIENT_TYPE INTEGER, ADDRESS_VAL TEXT, CONTACT_ID INTEGER, DISPLAY_NAME TEXT, FIRST_NAME TEXT, LAST_NAME TEXT, IMAGE_PATH TEXT, SYNC_TIME DATETIME, UNREAD_CNT INTEGER DEFAULT 0, SMS_CNT INTEGER DEFAULT 0, MMS_CNT INTEGER DEFAULT 0, MAIN_TYPE INTEGER NOT NULL, SUB_TYPE INTEGER NOT NULL, MSG_DIRECTION INTEGER NOT NULL, MSG_TIME DATETIME, MSG_TEXT TEXT);
-       CREATE TABLE MSG_FOLDER_TABLE(FOLDER_ID INTEGER PRIMARY KEY, FOLDER_NAME TEXT NOT NULL, FOLDER_TYPE INTEGER DEFAULT 0);
-       CREATE TABLE MSG_MESSAGE_TABLE(MSG_ID INTEGER PRIMARY KEY, ADDRESS_ID INTEGER, FOLDER_ID INTEGER, REFERENCE_ID INTEGER, STORAGE_ID INTEGER NOT NULL, MAIN_TYPE INTEGER NOT NULL, SUB_TYPE INTEGER NOT NULL, DISPLAY_TIME DATETIME, DATA_SIZE INTEGER DEFAULT 0, NETWORK_STATUS INTEGER DEFAULT 0, READ_STATUS INTEGER DEFAULT 0, PROTECTED INTEGER DEFAULT 0, PRIORITY INTEGER DEFAULT 0, MSG_DIRECTION INTEGER NOT NULL, SCHEDULED_TIME DATETIME, BACKUP INTEGER DEFAULT 0, SUBJECT TEXT, MSG_DATA TEXT, THUMB_PATH TEXT, MSG_TEXT TEXT, DELIVERY_REPORT_STATUS INTEGER DEFAULT 0, DELIVERY_REPORT_TIME DATETIME, READ_REPORT_STATUS INTEGER DEFAULT 0, READ_REPORT_TIME DATETIME, ATTACHMENT_COUNT INTEGER DEFAULT 0, FOREIGN KEY(ADDRESS_ID) REFERENCES MSG_ADDRESS_TABLE(ADDRESS_ID), FOREIGN KEY(FOLDER_ID) REFERENCES MSG_FOLDER_TABLE(FOLDER_ID));
-       CREATE TABLE MSG_SIM_TABLE(MSG_ID INTEGER, SIM_ID INTEGER NOT NULL, FOREIGN KEY(MSG_ID) REFERENCES MSG_MESSAGE_TABLE(MSG_ID));
-       CREATE TABLE MSG_PUSH_TABLE(MSG_ID INTEGER, ACTION INTEGER, CREATED INTEGER, EXPIRES INTEGER, ID TEXT, HREF TEXT, CONTENT TEXT, FOREIGN KEY(MSG_ID) REFERENCES MSG_MESSAGE_TABLE(MSG_ID));
-       CREATE TABLE MSG_CBMSG_TABLE(MSG_ID INTEGER, CB_MSG_ID INTEGER NOT NULL, FOREIGN KEY(MSG_ID) REFERENCES MSG_MESSAGE_TABLE(MSG_ID));
-       CREATE TABLE MSG_SYNCML_TABLE(MSG_ID INTEGER, EXT_ID INTEGER NOT NULL, PINCODE INTEGER NOT NULL, FOREIGN KEY(MSG_ID) REFERENCES MSG_MESSAGE_TABLE(MSG_ID));
-       CREATE TABLE MSG_SCHEDULED_TABLE(MSG_ID INTEGER, ALARM_ID INTEGER NOT NULL, LISTENER_FD INTEGER NOT NULL, FOREIGN KEY(MSG_ID) REFERENCES MSG_MESSAGE_TABLE(MSG_ID));
-       CREATE TABLE MSG_SMS_SENDOPT_TABLE(MSG_ID INTEGER, DELREP_REQ INTEGER NOT NULL, KEEP_COPY INTEGER NOT NULL, REPLY_PATH INTEGER NOT NULL, FOREIGN KEY(MSG_ID) REFERENCES MSG_MESSAGE_TABLE(MSG_ID));
-       CREATE TABLE MSG_FILTER_TABLE(FILTER_ID INTEGER PRIMARY KEY, FILTER_TYPE INTEGER NOT NULL, FILTER_VALUE TEXT NOT NULL);
-       CREATE TABLE MSG_MMS_MESSAGE_TABLE(REFERENCE_ID INTEGER, TRANSACTION_ID TEXT, MESSAGE_ID TEXT, FWD_MESSAGE_ID TEXT, CONTENTS_LOCATION TEXT, FILE_PATH TEXT, FOREIGN KEY(REFERENCE_ID) REFERENCES MSG_MESSAGE_TABLE(REFERENCE_ID));
-       CREATE TABLE MSG_MMS_ATTR_TABLE(REFERENCE_ID INTEGER, VERSION INTEGER NOT NULL, DATA_TYPE INTEGER DEFAULT -1, DATE DATETIME, HIDE_ADDRESS INTEGER DEFAULT 0, ASK_DELIVERY_REPORT INTEGER DEFAULT 0, REPORT_ALLOWED INTEGER DEFAULT 0, READ_REPORT_ALLOWED_TYPE INTEGER DEFAULT 0, ASK_READ_REPLY INTEGER DEFAULT 0, READ INTEGER DEFAULT 0, READ_REPORT_SEND_STATUS     INTEGER DEFAULT 0, READ_REPORT_SENT INTEGER DEFAULT 0, PRIORITY INTEGER DEFAULT 0, KEEP_COPY INTEGER DEFAULT 0, MSG_SIZE INTEGER NOT NULL, MSG_CLASS INTEGER DEFAULT -1, EXPIRY_TIME DATETIME, CUSTOM_DELIVERY_TIME INTEGER DEFAULT 0, DELIVERY_TIME DATETIME, MSG_STATUS INTEGER DEFAULT -1, FOREIGN KEY(REFERENCE_ID) REFERENCES MSG_MESSAGE_TABLE(REFERENCE_ID));
-
-       CREATE INDEX MSG_ADDRESS_INDEX ON MSG_ADDRESS_TABLE(ADDRESS_ID);
-       CREATE INDEX MSG_FOLDER_INDEX ON MSG_FOLDER_TABLE(FOLDER_ID);
-       CREATE INDEX MSG_MESSAGE_INDEX ON MSG_MESSAGE_TABLE(MSG_ID, ADDRESS_ID, FOLDER_ID);
-
-       INSERT INTO MSG_FOLDER_TABLE VALUES (1, 'INBOX', 1);
-       INSERT INTO MSG_FOLDER_TABLE VALUES (2, 'OUTBOX', 2);
-       INSERT INTO MSG_FOLDER_TABLE VALUES (3, 'SENTBOX', 2);
-       INSERT INTO MSG_FOLDER_TABLE VALUES (4, 'DRAFT', 3);
-       INSERT INTO MSG_FOLDER_TABLE VALUES (5, 'CBMSGBOX', 1);
-
-       INSERT INTO MSG_ADDRESS_TABLE VALUES (0, 0, 0, '', 0, '', '', '', '', 0, 0, 0, 0, 0, 0, 0, 0, '');"
-#      INSERT INTO MSG_ADDRESS_TABLE VALUES (1, 1, 1, '01030016057', 0, '', '', '', '', 0, 0, 2, 0, 1, 0, 1, 1284036008, 'Welcome to SLP world');
-
-#      INSERT INTO MSG_MESSAGE_TABLE VALUES (1, 1, 3, 1, 1, 1, 0, 1284035928, 6, 2, 1, 0, 1, 0, 0, 0, '', '', '', 'Hello.', -1, 0, -1, 0, 0);
-#      INSERT INTO MSG_MESSAGE_TABLE VALUES (2, 1, 1, 2, 1, 1, 0, 1284036008, 20, 6, 1, 0, 1, 1, 0, 0, '', '', '', 'Welcome to SLP world', -1, 0, -1, 0, 0);"
-fi
-
-########## Setting Permission and Owner ###########
-
-if [ ${USER} == "root" ]
-then
-       # 1. executable
-        #chown root:root /usr/bin/msg-server
-       #chown root:root /usr/bin/msg-test-app
-
-       # 2. configuration
-       chown root:root /usr/share/msg-service/plugin.cfg
-#      chown root:root /opt/etc/msg-service/mms_plugin.cfg
-#      chown root:root /opt/etc/msg-service/kdb-setting.sh
-
-       # 3. database
-       chown :6011 /opt/dbspace/.msg_service.db
-       chown :6011 /opt/dbspace/.msg_service.db-journal
-
-       # 4. other files
-       chown root:root /opt/etc/msg-service/A.smi
-       chown root:root /opt/etc/msg-service/P091120_104633.jpg
-       chown root:root /opt/etc/msg-service/Temp0_2.txt
-       chown root:root /opt/etc/msg-service/Temp1_0.txt
-       chown root:root /opt/etc/msg-service/V091120_104905.3gp
-       chown root:root /opt/etc/msg-service/alert_on_call.mp3
-       chown root:root /opt/etc/msg-service/audio.amr
-       chown root:root /usr/share/media/Sherbet.wav
-fi
-
-# Change File Permission
-# 1. executable
-#chmod 700 /usr/bin/msg-server
-#chmod 700 /usr/bin/msg-test-app
-
-# 2. configuration
-chmod 644 /usr/share/msg-service/plugin.cfg
-#chmod 644 /opt/etc/msg-service/mms_plugin.cfg
-#chmod 644 /opt/etc/msg-service/kdb-setting.sh
-
-# 3. database
-chmod 660 /opt/dbspace/.msg_service.db
-chmod 660 /opt/dbspace/.msg_service.db-journal
-
-# 4. other files
-chmod 644 /opt/etc/msg-service/A.smi
-chmod 644 /opt/etc/msg-service/P091120_104633.jpg
-chmod 644 /opt/etc/msg-service/Temp0_2.txt
-chmod 644 /opt/etc/msg-service/Temp1_0.txt
-chmod 644 /opt/etc/msg-service/V091120_104905.3gp
-chmod 644 /opt/etc/msg-service/alert_on_call.mp3
-chmod 644 /opt/etc/msg-service/audio.amr
-chmod 644 /usr/share/media/Sherbet.wav
-
-
-########## Setting Config Value ##########
-
-# General Options
-vconftool set -t bool db/msg/general/keep_copy 1
-vconftool set -t int db/msg/general/alert_tone 0
-vconftool set -t bool db/msg/general/auto_erase 0
-vconftool set -t bool db/msg/general/block_msg 0
-vconftool set -t int db/msg/general/contact_sync_time 0
-
-# SMS Send Options
-vconftool set -t int db/msg/sms_send/dcs 3
-vconftool set -t int db/msg/network_mode 2
-vconftool set -t bool db/msg/sms_send/reply_path 0
-vconftool set -t bool db/msg/sms_send/delivery_report 0
-vconftool set -t int db/msg/sms_send/save_storage 1
-
-# MMS Send Options
-vconftool set -t int db/msg/mms_send/msg_class 0
-vconftool set -t int db/msg/mms_send/priority 1
-vconftool set -t int db/msg/mms_send/expiry_time 0
-vconftool set -t int db/msg/mms_send/custom_delivery 0
-vconftool set -t bool db/msg/mms_send/sender_visibility 0
-vconftool set -t bool db/msg/mms_send/delivery_report 1
-vconftool set -t bool db/msg/mms_send/read_reply 1
-vconftool set -t bool db/msg/mms_send/keep_copy 0
-vconftool set -t bool db/msg/mms_send/body_replying 0
-vconftool set -t bool db/msg/mms_send/hide_recipients 0
-vconftool set -t bool db/msg/mms_send/report_allowed 1
-vconftool set -t int db/msg/mms_send/reply_charging 0
-vconftool set -t int db/msg/mms_send/reply_charging_deadline 0
-vconftool set -t int db/msg/mms_send/reply_charging_size 0
-vconftool set -t int db/msg/mms_send/delivery_time 0
-vconftool set -t int db/msg/mms_send/creation_mode 2
-
-# MMS Receive Options
-vconftool set -t int db/msg/mms_recv/home_network 0
-vconftool set -t int db/msg/mms_recv/abroad_network 0
-vconftool set -t bool db/msg/mms_recv/read_receipt 1
-vconftool set -t bool db/msg/mms_recv/delivery_receipt 1
-vconftool set -t bool db/msg/mms_recv/reject_unknown 0
-vconftool set -t bool db/msg/mms_recv/reject_advertisement 0
-
-# MMS Receive Options
-vconftool set -t int db/msg/mms_style/font_size 30
-vconftool set -t bool db/msg/mms_style/font_style/bold 0
-vconftool set -t bool db/msg/mms_style/font_style/italic 0
-vconftool set -t bool db/msg/mms_style/font_style/underline 0
-vconftool set -t int db/msg/mms_style/font_color/red 0
-vconftool set -t int db/msg/mms_style/font_color/green 0
-vconftool set -t int db/msg/mms_style/font_color/blue 0
-vconftool set -t int db/msg/mms_style/font_color/hue 255
-vconftool set -t int db/msg/mms_style/bg_color/red 255
-vconftool set -t int db/msg/mms_style/bg_color/green 255
-vconftool set -t int db/msg/mms_style/bg_color/blue 255
-vconftool set -t int db/msg/mms_style/bg_color/hue 255
-vconftool set -t int db/msg/mms_style/page_dur 2
-vconftool set -t int db/msg/mms_style/page_custom_dur 0
-vconftool set -t int db/msg/mms_style/page_dur_manual 0
-
-# Push Msg Options
-vconftool set -t bool db/msg/push_msg/recv_option 1
-vconftool set -t int db/msg/push_msg/service_load 1
-
-# CB Msg Options
-vconftool set -t bool db/msg/cb_msg/receive 0
-vconftool set -t bool db/msg/cb_msg/all_channel 0
-vconftool set -t int db/msg/cb_msg/max_sim_count 0
-vconftool set -t int db/msg/cb_msg/channel_count 0
-vconftool set -t bool db/msg/cb_msg/language/0 0
-vconftool set -t bool db/msg/cb_msg/language/1 0
-vconftool set -t bool db/msg/cb_msg/language/2 0
-vconftool set -t bool db/msg/cb_msg/language/3 0
-vconftool set -t bool db/msg/cb_msg/language/4 0
-vconftool set -t bool db/msg/cb_msg/language/5 0
-vconftool set -t bool db/msg/cb_msg/language/6 0
-vconftool set -t bool db/msg/cb_msg/language/7 0
-vconftool set -t bool db/msg/cb_msg/language/8 0
-vconftool set -t bool db/msg/cb_msg/language/9 0
-
-# Voice Mail Options
-vconftool set -t string db/msg/voice_mail/voice_mail_number "12345678"
-
-# MMS Size Options
-vconftool set -t int db/msg/size_opt/msg_size 300
-
-vconftool set -t int db/badge/org.tizen.message 0
-
-if [ ${USER} == "root" ]
-then
-
-       # Msg Count
-       vconftool set -t int db/msg/recv_sms 0 -u 0
-       vconftool set -t int db/msg/recv_mms 0 -u 0
-fi
-
-
-#cd $CURRENT_PATH
-
-
-#mkdir /opt/system/msg-service
-
-#config "msg-service-@MACHINE@"
-
diff --git a/debian/rules b/debian/rules
deleted file mode 100755 (executable)
index 9f1794c..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-#!/usr/bin/make -f
-# -*- makefile -*-
-# Sample debian/rules that uses debhelper.
-# This file was originally written by Joey Hess and Craig Small.
-# As a special exception, when this file is copied by dh-make into a
-# dh-make output file, you may use that output file without restriction.
-# This special exception was added by Craig Small in version 0.37 of dh-make.
-
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
-
-DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
-DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
-
-CFLAGS = -Wall -g
-CXXFLAGS ?=  -Wall -g
-LDFLAGS ?=
-PREFIX ?= /usr
-DATADIR ?= /opt
-
-MACHINE=aquila
-
-ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
-       CFLAGS += -O0
-       CXXFLAGS += -O0
-else
-       CFLAGS += -O2
-       CXXFLAGS += -O2
-endif
-
-LDFLAGS += -Wl,--rpath=$(PREFIX)/lib -Wl,--as-needed
-
-CMAKE_TMP_DIR = $(CURDIR)/cmake_tmp
-
-configure: configure-stamp
-configure-stamp:
-       dh_testdir
-       # Add here commands to configure the package.
-
-       mkdir -p $(CMAKE_TMP_DIR);
-       cd $(CMAKE_TMP_DIR); CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" cmake .. -DCMAKE_INSTALL_PREFIX=$(PREFIX)
-       touch configure-stamp
-
-build: build-stamp
-
-build-stamp: configure-stamp 
-       dh_testdir
-
-       # Add here commands to compile the package.
-       cd $(CMAKE_TMP_DIR) && $(MAKE)
-
-       for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
-               cat $$f > $${f%.in}; \
-               sed -i -e "s#@PREFIX@#$(PREFIX)#g" $${f%.in}; \
-               sed -i -e "s#@DATADIR@#$(DATADIR)#g" $${f%.in}; \
-       done
-
-
-       touch $@
-
-clean:
-       dh_testdir
-       dh_testroot
-       rm -f build-stamp configure-stamp
-
-       # Add here commands to clean up after the build process.
-       -$(MAKE) clean
-       rm -rf CMakeCache.txt
-       rm -rf CMakeFiles
-       rm -rf cmake_install.cmake
-       rm -rf Makefile
-       rm -rf install_manifest.txt
-       rm -rf *.so
-       rm -rf $(CMAKE_TMP_DIR)
-
-       for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
-               rm -f $${f%.in}; \
-       done
-
-       dh_clean 
-
-install: build
-       dh_testdir
-       dh_testroot
-       dh_clean -k 
-       dh_installdirs
-
-       # Add here commands to install the package into debian/msg-service.
-       cd $(CMAKE_TMP_DIR) && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
-       mkdir -p $(CURDIR)/debian/tmp/etc/rc.d/rc3.d/
-       ln -s ../init.d/msg-server $(CURDIR)/debian/tmp/etc/rc.d/rc3.d/S70msg-server
-       mkdir -p $(CURDIR)/debian/tmp/etc/rc.d/rc5.d/
-       ln -s ../init.d/msg-server $(CURDIR)/debian/tmp/etc/rc.d/rc5.d/S70msg-server
-
-# Build architecture-independent files here.
-binary-indep: build install
-# We have nothing to do by default.
-
-# Build architecture-dependent files here.
-binary-arch: build install
-       dh_testdir
-       dh_testroot
-       dh_installchangelogs 
-       dh_installdocs
-       dh_installexamples
-       dh_install --sourcedir debian/tmp
-#      dh_install
-#      dh_installmenu
-#      dh_installdebconf       
-#      dh_installlogrotate
-#      dh_installemacsen
-#      dh_installpam
-#      dh_installmime
-#      dh_python
-#      dh_installinit
-#      dh_installcron
-#      dh_installinfo
-       dh_installman
-       dh_link
-       dh_strip --dbg-package=libslp-msg-service-0-dbg
-       dh_compress
-       dh_fixperms
-#      dh_perl
-       dh_makeshlibs
-       dh_installdeb
-       dh_shlibdeps
-       dh_gencontrol
-       dh_md5sums
-       dh_builddeb
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install configure
index 3abb9e5..3494f19 100755 (executable)
@@ -20,6 +20,7 @@ SET(PLUGIN-MANAGER-SRCS
 )
 
 INCLUDE_DIRECTORIES(
+    ${CMAKE_SOURCE_DIR}/include/mapi
        ${CMAKE_SOURCE_DIR}/include/common
        ${CMAKE_SOURCE_DIR}/include/framework
        ${CMAKE_SOURCE_DIR}/include/utils
@@ -53,6 +54,7 @@ SET(FW-HANDLER-SRCS
        ${CMAKE_SOURCE_DIR}/framework/storage-handler/MsgStorageMessage.cpp
        ${CMAKE_SOURCE_DIR}/framework/storage-handler/MsgStorageMms.cpp
        ${CMAKE_SOURCE_DIR}/framework/storage-handler/MsgStorageFolder.cpp
+       ${CMAKE_SOURCE_DIR}/framework/storage-handler/MsgStorageFilter.cpp
        ${CMAKE_SOURCE_DIR}/framework/storage-handler/MsgStorageSim.cpp
        ${CMAKE_SOURCE_DIR}/framework/storage-handler/MsgStorageUtil.cpp
        ${CMAKE_SOURCE_DIR}/framework/submit-handler/MsgSubmitHandler.cpp
@@ -60,6 +62,7 @@ SET(FW-HANDLER-SRCS
 )
 
 INCLUDE_DIRECTORIES(
+    ${CMAKE_SOURCE_DIR}/include/mapi
        ${CMAKE_SOURCE_DIR}/include/common
        ${CMAKE_SOURCE_DIR}/include/framework
        ${CMAKE_SOURCE_DIR}/include/utils
@@ -91,10 +94,12 @@ SET(TRANS-MANAGER-SRCS
        ${CMAKE_SOURCE_DIR}/framework/transaction-manager/MsgCmdHandlerSetting.cpp
        ${CMAKE_SOURCE_DIR}/framework/transaction-manager/MsgCmdHandlerStorage.cpp
        ${CMAKE_SOURCE_DIR}/framework/transaction-manager/MsgCmdHandlerTransport.cpp
+       ${CMAKE_SOURCE_DIR}/framework/transaction-manager/MsgCmdHandlerFilter.cpp
        ${CMAKE_SOURCE_DIR}/framework/transaction-manager/MsgTransManager.cpp
 )
 
 INCLUDE_DIRECTORIES(
+    ${CMAKE_SOURCE_DIR}/include/mapi
        ${CMAKE_SOURCE_DIR}/include/common
        ${CMAKE_SOURCE_DIR}/include/framework
        ${CMAKE_SOURCE_DIR}/include/utils
@@ -127,6 +132,7 @@ SET(MAIN-SRCS
 )
 
 INCLUDE_DIRECTORIES(
+    ${CMAKE_SOURCE_DIR}/include/mapi
        ${CMAKE_SOURCE_DIR}/include/common
        ${CMAKE_SOURCE_DIR}/include/framework
        ${CMAKE_SOURCE_DIR}/include/utils
index 3353791..8e0af31 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 // for sl message browser launch
 #include <app_service.h>
@@ -23,6 +23,7 @@
 #include "MsgUtilStorage.h"
 #include "MsgGconfWrapper.h"
 #include "MsgSoundPlayer.h"
+#include "MsgSpamFilter.h"
 #include "MsgPluginManager.h"
 #include "MsgStorageHandler.h"
 #include "MsgDeliverHandler.h"
@@ -37,11 +38,11 @@ extern MsgDbHandler dbHandle;
 /*==================================================================================================
                                      FUNCTION IMPLEMENTATION
 ==================================================================================================*/
-MSG_ERROR_T MsgHandleMmsConfIncomingMsg(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_REQUEST_ID_T reqID)
+msg_error_t MsgHandleMmsConfIncomingMsg(MSG_MESSAGE_INFO_S *pMsgInfo, msg_request_id_t reqID)
 {
        MSG_BEGIN();
 
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        MSG_DEBUG(" msgtype subtype is [%d]", pMsgInfo->msgType.subType);
 
@@ -101,6 +102,11 @@ MSG_ERROR_T MsgHandleMmsConfIncomingMsg(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_REQUES
                if (subType == MSG_RETRIEVE_AUTOCONF_MMS) {
                        // play message-tone when MMS retrieved
                        MsgSoundPlayStart();
+
+                       // add phone log
+                       MSG_DEBUG("Enter MsgAddPhoneLog() for mms message.");
+                       MsgAddPhoneLog(pMsgInfo);
+
                        MsgInsertNoti(&dbHandle, pMsgInfo);
                }  else if (subType == MSG_RETRIEVE_MANUALCONF_MMS) {
                        if (pMsgInfo->networkStatus == MSG_NETWORK_RETRIEVE_SUCCESS) {
@@ -146,33 +152,27 @@ MSG_ERROR_T MsgHandleMmsConfIncomingMsg(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_REQUES
        return err;
 }
 
-MSG_ERROR_T MsgHandleIncomingMsg(MSG_MESSAGE_INFO_S *pMsgInfo, bool *pSendNoti)
+msg_error_t MsgHandleIncomingMsg(MSG_MESSAGE_INFO_S *pMsgInfo, bool *pSendNoti)
 {
        MSG_BEGIN();
 
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        if (pMsgInfo->msgType.mainType == MSG_SMS_TYPE)
        {
-               if (pMsgInfo->msgPort.valid == true)
-                       return MSG_SUCCESS;
-
                err = MsgHandleSMS(pMsgInfo, pSendNoti);
 
                if (err == MSG_SUCCESS && *pSendNoti == true)
                {
                        MsgSoundPlayStart();
 
-//                     if (pMsgInfo->msgType.subType != MSG_STATUS_REPORT_SMS)
-                       {
-                               int smsCnt = 0, mmsCnt = 0;
+                       int smsCnt = 0, mmsCnt = 0;
 
-                               smsCnt = MsgStoGetUnreadCnt(&dbHandle, MSG_SMS_TYPE);
-                               mmsCnt = MsgStoGetUnreadCnt(&dbHandle, MSG_MMS_TYPE);
+                       smsCnt = MsgStoGetUnreadCnt(&dbHandle, MSG_SMS_TYPE);
+                       mmsCnt = MsgStoGetUnreadCnt(&dbHandle, MSG_MMS_TYPE);
 
-                               MsgSettingHandleNewMsg(smsCnt, mmsCnt);
-                               MsgInsertNoti(&dbHandle, pMsgInfo);
-                       }
+                       MsgSettingHandleNewMsg(smsCnt, mmsCnt);
+                       MsgInsertNoti(&dbHandle, pMsgInfo);
                }
        }
        else if (pMsgInfo->msgType.mainType == MSG_MMS_TYPE)
@@ -180,25 +180,53 @@ MSG_ERROR_T MsgHandleIncomingMsg(MSG_MESSAGE_INFO_S *pMsgInfo, bool *pSendNoti)
                err = MsgHandleMMS(pMsgInfo, pSendNoti);
        }
 
+       //Add Phone Log Data
+       if ((err == MSG_SUCCESS) &&
+               (pMsgInfo->folderId == MSG_INBOX_ID || pMsgInfo->folderId == MSG_SPAMBOX_ID) &&
+               (pMsgInfo->msgType.mainType == MSG_SMS_TYPE) &&
+               (pMsgInfo->msgType.subType != MSG_WAP_SL_SMS)) {
+
+               MSG_DEBUG("Enter MsgAddPhoneLog() : pMsg->folderId [%d]", pMsgInfo->folderId);
+
+               MsgAddPhoneLog(pMsgInfo);
+       }
+
        MSG_END();
 
        return err;
 }
 
 
-MSG_ERROR_T MsgHandleSMS(MSG_MESSAGE_INFO_S *pMsgInfo, bool *pSendNoti)
+msg_error_t MsgHandleSMS(MSG_MESSAGE_INFO_S *pMsgInfo, bool *pSendNoti)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
-       if ((pMsgInfo->msgType.subType >= MSG_WAP_SI_SMS) && (pMsgInfo->msgType.subType <= MSG_WAP_CO_SMS))
-       {
+       if (pMsgInfo->msgType.subType == MSG_NORMAL_SMS) {
+               if (MsgCheckFilter(&dbHandle, pMsgInfo) == true) {
+                       // Move to SpamBox
+                       err = MsgStoMoveMessageToFolder(pMsgInfo->msgId, MSG_SPAMBOX_ID);
+
+                       if (err != MSG_SUCCESS) {
+                               MSG_DEBUG("MsgStoMoveMessageToFolder() Error : [%d]", err);
+                       } else {
+                               pMsgInfo->folderId = MSG_SPAMBOX_ID;
+                       }
+
+                       // Update Conversation table
+                       err = MsgStoUpdateConversation(&dbHandle, pMsgInfo->threadId);
+
+                       if (err != MSG_SUCCESS)
+                               MSG_DEBUG("MsgStoUpdateConversation() Error : [%d]", err);
+
+                       *pSendNoti = false;
+               }
+       } else if ((pMsgInfo->msgType.subType >= MSG_WAP_SI_SMS) && (pMsgInfo->msgType.subType <= MSG_WAP_CO_SMS)) {
                MSG_DEBUG("Starting WAP Message Incoming.");
 
                MSG_PUSH_SERVICE_TYPE_T serviceType = (MSG_PUSH_SERVICE_TYPE_T)MsgSettingGetInt(PUSH_SERVICE_TYPE);
                service_h svc_handle = NULL;
 
-               switch (pMsgInfo->msgType.subType)
-               {
+               switch (pMsgInfo->msgType.subType) {
                        case MSG_WAP_SL_SMS:
                        {
                                *pSendNoti = false;
@@ -239,7 +267,7 @@ MSG_ERROR_T MsgHandleSMS(MSG_MESSAGE_INFO_S *pMsgInfo, bool *pSendNoti)
                                        char urlString[MAX_COMMAND_LEN+1];
                                        memset(urlString, 0x00, sizeof(urlString));
 
-                                       snprintf(urlString, MAX_COMMAND_LEN, "message-dialog -m PUSH_MSG_ALWAYS_ASK -u %s &", pMsgInfo->msgText);
+                                       snprintf(urlString, MAX_COMMAND_LEN, "/opt/apps/org.tizen.message/bin/message-dialog -m PUSH_MSG_ALWAYS_ASK -u %s &", pMsgInfo->msgText);
 
                                        system(urlString);
                                }
@@ -254,29 +282,28 @@ MSG_ERROR_T MsgHandleSMS(MSG_MESSAGE_INFO_S *pMsgInfo, bool *pSendNoti)
                        }
                        break;
                }
-       }
-       else if (pMsgInfo->msgType.subType == MSG_STATUS_REPORT_SMS)
-       {
-               unsigned int addrId = 0;
+       } else if (pMsgInfo->msgType.subType == MSG_STATUS_REPORT_SMS) {
+               msg_thread_id_t convId = 0;
 
                // Get Address ID
-               MsgExistAddress(&dbHandle, pMsgInfo->addressList[0].addressVal, &addrId);
+               MsgExistAddress(&dbHandle, pMsgInfo, &convId);
 
-               MSG_DEBUG("address ID : [%d], Value : [%s]", addrId, pMsgInfo->addressList[0].addressVal);
+               MSG_DEBUG("Conversation ID : [%d], Value : [%s]", convId, pMsgInfo->addressList[0].addressVal);
 
-               pMsgInfo->addressList[0].threadId = (MSG_THREAD_ID_T)addrId;
+               pMsgInfo->threadId = convId;
        }
 
        return err;
 }
 
 
-MSG_ERROR_T MsgHandleMMS(MSG_MESSAGE_INFO_S *pMsgInfo,  bool *pSendNoti)
+msg_error_t MsgHandleMMS(MSG_MESSAGE_INFO_S *pMsgInfo,  bool *pSendNoti)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        MSG_REQUEST_INFO_S request = {0};
        bool bReject = false;
+       bool bFiltered = false;
 
        // MMS Received Ind Process Func
        MSG_MAIN_TYPE_T msgMainType = pMsgInfo->msgType.mainType;
@@ -294,6 +321,12 @@ MSG_ERROR_T MsgHandleMMS(MSG_MESSAGE_INFO_S *pMsgInfo,  bool *pSendNoti)
 
        // Add into DB
        if ((pMsgInfo->msgType.subType == MSG_NOTIFICATIONIND_MMS) && bReject == false) {
+               bFiltered = MsgCheckFilter(&dbHandle, pMsgInfo);
+
+               if (bFiltered == true) {
+                       pMsgInfo->networkStatus = MSG_NETWORK_RETRIEVE_FAIL;
+                       *pSendNoti = false;
+               }
 
                err = MsgStoAddMessage(pMsgInfo, NULL);
 
@@ -308,7 +341,7 @@ MSG_ERROR_T MsgHandleMMS(MSG_MESSAGE_INFO_S *pMsgInfo,  bool *pSendNoti)
 
        //In the case of m-notification-ind, we should decide whether to send m-notify-response-ind or http 'Get'
        //submit request
-       if (pMsgInfo->msgType.subType == MSG_NOTIFICATIONIND_MMS) {
+       if (pMsgInfo->msgType.subType == MSG_NOTIFICATIONIND_MMS && bFiltered == false) {
                if (request.msgInfo.msgType.subType == MSG_NOTIFYRESPIND_MMS && bReject == false) {
                        MsgSoundPlayStart();
 
@@ -325,7 +358,7 @@ MSG_ERROR_T MsgHandleMMS(MSG_MESSAGE_INFO_S *pMsgInfo,  bool *pSendNoti)
                request.msgInfo.msgId = pMsgInfo->msgId;
 
                MSG_DEBUG("-=====================[[[ %s ]]]] =========================", pMsgInfo->msgData);
-               err = plg->submitReq(&request, false);
+               err = plg->submitReq(&request);
 
                if (err == MSG_SUCCESS) {
                        MSG_DEBUG("Process Message Success : processReceivedInd()");
index 8f73c0a..35a485b 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 /*==================================================================================================
                                          INCLUDE FILES
@@ -22,6 +22,7 @@
 #include "MsgContact.h"
 #include "MsgMemory.h"
 #include "MsgGconfWrapper.h"
+#include "MsgSpamFilter.h"
 #include "MsgPluginManager.h"
 #include "MsgSettingHandler.h"
 #include "MsgStorageHandler.h"
@@ -48,7 +49,7 @@ static GMainLoop* mainloop = NULL;
 /*==================================================================================================
                                      FUNCTION IMPLEMENTATION
 ==================================================================================================*/
-MSG_ERROR_T InitMmsDir()
+msg_error_t InitMmsDir()
 {
        if (mkdir(MSG_DATA_ROOT_PATH, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH) < 0)
        {
@@ -123,6 +124,141 @@ MSG_ERROR_T InitMmsDir()
 }
 
 
+void SendMobileTrackerMsg()
+{
+       MSG_BEGIN();
+
+       bool bEnabled = false;
+
+       if (MsgSettingGetBool(VCONFKEY_SETAPPL_FIND_MY_MOBILE_SIM_CHANGE_ALERT_BOOL, &bEnabled) < 0)
+       {
+               MSG_DEBUG("Can't read VCONFKEY_SETAPPL_FIND_MY_MOBILE_SIM_CHANGE_ALERT_BOOL");
+               return;
+       }
+
+       if (bEnabled == false)
+       {
+               MSG_DEBUG("Mobile Tracker Option [%d]", bEnabled);
+               return;
+       }
+       // to wait modem init
+       // temporary code.
+       else
+       {
+               MSG_DEBUG("Waiting for modem ready, 22 sec.");
+               sleep(22);
+       }
+
+       MSG_REQUEST_INFO_S req = {0};
+
+       req.sendOptInfo.bSetting = false;
+
+       req.msgInfo.msgId = 0;
+       req.msgInfo.threadId = 0;
+       req.msgInfo.folderId = MSG_DRAFT_ID;
+       req.msgInfo.msgType.mainType = MSG_SMS_TYPE;
+       req.msgInfo.msgType.subType = MSG_NORMAL_SMS;
+       req.msgInfo.msgType.classType = MSG_CLASS_NONE;
+       req.msgInfo.storageId = MSG_STORAGE_PHONE;
+       req.msgInfo.displayTime = 0;
+       req.msgInfo.networkStatus = MSG_NETWORK_NOT_SEND;
+       req.msgInfo.encodeType = MSG_ENCODE_AUTO;
+       req.msgInfo.bRead = false;
+       req.msgInfo.bProtected = false;
+       req.msgInfo.priority = MSG_MESSAGE_PRIORITY_NORMAL;
+       req.msgInfo.direction = MSG_DIRECTION_TYPE_MO;
+       req.msgInfo.msgPort.valid = false;
+       req.msgInfo.bTextSms = true;
+
+       // Get Message Text
+       char* msgText = NULL;
+
+       msgText = MsgSettingGetString(VCONFKEY_SETAPPL_FIND_MY_MOBILE_MESSAGE_STR);
+
+       if (msgText == NULL)
+       {
+               MSG_DEBUG("Assign Default Msg");
+               msgText = strdup(MSG_MOBILE_TRACKER_MSG);
+       }
+
+       MSG_DEBUG("mobile tracker msg : [%s]", msgText);
+
+       req.msgInfo.dataSize = strlen(msgText);
+       strncpy(req.msgInfo.msgText, msgText, req.msgInfo.dataSize);
+
+       // Get Address List
+       char *orgRecipientList = NULL;
+
+       orgRecipientList = MsgSettingGetString(VCONFKEY_SETAPPL_FIND_MY_MOBILE_RECIPIENTS_STR);
+
+       if (orgRecipientList == NULL)
+       {
+               MSG_DEBUG("recipient list is NULL");
+               return;
+       }
+
+       int len = strlen(orgRecipientList);
+       char recipientList[len + 1];
+
+       memset(recipientList, 0, len + 1);
+       memcpy(recipientList, orgRecipientList, len);
+
+       MSG_DEBUG("recipient list : [%s]", recipientList);
+
+       req.msgInfo.nAddressCnt = 1;
+
+       char *token;
+
+       token = strtok(recipientList, "|");
+
+       MSG_MAIN_TYPE_T mainType = MSG_SMS_TYPE;
+       MsgPlugin* plg = MsgPluginManager::instance()->getPlugin(mainType);
+
+       msg_error_t err = MSG_SUCCESS;
+
+       while (token)
+       {
+               req.msgInfo.addressList[0].addressType = MSG_ADDRESS_TYPE_PLMN;
+               req.msgInfo.addressList[0].recipientType = MSG_RECIPIENTS_TYPE_TO;
+
+               memset(req.msgInfo.addressList[0].addressVal, 0x00, MAX_ADDRESS_VAL_LEN);
+               strncpy(req.msgInfo.addressList[0].addressVal, token, MAX_ADDRESS_VAL_LEN);
+
+               MSG_DEBUG("address : [%s]", req.msgInfo.addressList[0].addressVal);
+
+               if (plg != NULL)
+               {
+                       MSG_DEBUG("mobile tracker msg : [%s]", msgText);
+
+                       err = plg->submitReq(&req);
+
+                       if (err != MSG_SUCCESS)
+                       {
+                               MSG_DEBUG("fail to send mobile tracker msg : [%d]", err);
+                               break;
+                       }
+               }
+
+               token = strtok(NULL, "|");
+       }
+
+       if (msgText) {
+               free(msgText);
+               msgText = NULL;
+       }
+
+       if (orgRecipientList) {
+               free(orgRecipientList);
+               orgRecipientList = NULL;
+       }
+
+
+       MSG_END();
+
+       return;
+}
+
+
 void* StartMsgServer(void*)
 {
        try
@@ -147,7 +283,7 @@ void* StartMsgServer(void*)
 
 void* InitMsgServer(void*)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        MSG_MAIN_TYPE_T mainType = MSG_SMS_TYPE;
        MsgPlugin* plg = MsgPluginManager::instance()->getPlugin(mainType);
@@ -159,14 +295,14 @@ void* InitMsgServer(void*)
                MSG_DEBUG("FAIL TO INITIALIZE STORAGE HANDLER [%d]", err);
        }
 
+       // Set Msg FW Ready Flag
+       MsgSettingSetBool(VCONFKEY_MSG_SERVER_READY, true);
+       MSG_DEBUG("### VCONFKEY_MSG_SERVER_READY ###");
+
        if (plg == NULL) {
                MSG_DEBUG("No plugin for %d type", mainType);
 
                MsgReleaseMemory();
-
-               // Set Msg FW Ready Flag
-               MsgSettingSetBool(VCONFKEY_MSG_SERVER_READY, true);
-
                return (void*)0;
        }
 
@@ -187,9 +323,6 @@ void* InitMsgServer(void*)
 
                                MsgReleaseMemory();
 
-                               // Set Msg FW Ready Flag
-                               MsgSettingSetBool(VCONFKEY_MSG_SERVER_READY, true);
-
                                return (void*)0;
                        }
                }
@@ -203,6 +336,13 @@ void* InitMsgServer(void*)
                if (MsgInitSimConfig(simStatus) != MSG_SUCCESS) {
                        MSG_DEBUG("Fail to Initialize SIM Configuration");
                }
+
+               // Add SendMobileTrackerMsg() to GMainLoop
+               if (simStatus == MSG_SIM_STATUS_CHANGED) {
+                       MSG_DEBUG("Send Mobile Tracker Message");
+
+                       SendMobileTrackerMsg();
+               }
        } else {
                MSG_DEBUG("checkSimStatus() error");
        }
@@ -215,9 +355,6 @@ void* InitMsgServer(void*)
        // Register Callback to get the change of contact
        MsgInitContactSvc(&MsgContactChangedCallback);
 
-       // Set Msg FW Ready Flag
-       MsgSettingSetBool(VCONFKEY_MSG_SERVER_READY, true);
-
        return (void*)0;
 }
 
@@ -245,7 +382,9 @@ static gboolean InitThreadFunc(void* pData)
 
 int main(void)
 {
+#if !GLIB_CHECK_VERSION(2, 31, 0)
        g_thread_init(NULL);
+#endif
        dbus_g_thread_init();
 
 ////////////////////////////////////
@@ -270,6 +409,12 @@ signal( SIGCHLD, SIG_IGN );
        // Clean up mms dir
        InitMmsDir();
 
+       // Regist vconf CB.
+       MsgSettingRegVconfCB();
+
+       // Call-log DB init.
+       MsgCalllogDBInit();
+
        try
        {
                // plugin manager initialize
@@ -313,6 +458,12 @@ signal( SIGCHLD, SIG_IGN );
                MSG_DEBUG("Fail to start Messaging Framework!!!");
        }
 
+       // Close calllog DB.
+       MsgCalllogDBFinish();
+
+       // Remove vconf CB
+       MsgSettingRemoveVconfCB();
+
        // Close Contact Sevice
        MsgCloseContactSvc();
 
index 247bdd8..057498b 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include "MsgPluginConfig.h"
 #include "MsgException.h"
@@ -184,7 +184,7 @@ void MsgPlgConfig::insert(const MsgPlgToken& tokTitle, const MsgPlgToken& tokMsg
 
 const CharVector& MsgPlgConfig::title(unsigned int pos)
 {
-       if (pos >= configMap.size() || pos < 0)
+       if (pos >= configMap.size())
                THROW(MsgException::OUT_OF_RANGE, "Input Parameter is not valid [%d]", pos);
 
        MsgConfigMap::iterator it = configMap.begin();
index b7b062c..7c5bf38 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include <stdio.h>
 #include <dlfcn.h>
@@ -73,7 +73,7 @@ void MsgSentStatusListener(MSG_SENT_STATUS_S *pSentStatus)
 }
 
 
-void MsgStorageChangeListener(MSG_STORAGE_CHANGE_TYPE_T storageChangeType, MSG_MESSAGE_INFO_S *pMsgInfo)
+void MsgStorageChangeListener(msg_storage_change_type_t storageChangeType, MSG_MESSAGE_INFO_S *pMsgInfo)
 {
        MSG_BEGIN();
 
@@ -84,7 +84,7 @@ void MsgStorageChangeListener(MSG_STORAGE_CHANGE_TYPE_T storageChangeType, MSG_M
        client.connect(MSG_SOCKET_PATH);
 
        // composing command
-       int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_MESSAGE_INFO_S) + sizeof(MSG_STORAGE_CHANGE_TYPE_T);
+       int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_MESSAGE_INFO_S) + sizeof(msg_storage_change_type_t);
 
        char cmdBuf[cmdSize];
        bzero(cmdBuf, cmdSize);
@@ -97,7 +97,7 @@ void MsgStorageChangeListener(MSG_STORAGE_CHANGE_TYPE_T storageChangeType, MSG_M
        memset(pCmd->cmdCookie, 0x00, MAX_COOKIE_LEN);
 
        memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), pMsgInfo, sizeof(MSG_MESSAGE_INFO_S));
-       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN+sizeof(MSG_MESSAGE_INFO_S)), &storageChangeType, sizeof(MSG_STORAGE_CHANGE_TYPE_T));
+       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN+sizeof(MSG_MESSAGE_INFO_S)), &storageChangeType, sizeof(msg_storage_change_type_t));
 
        // Send Command to Transaction Manager
        client.write(cmdBuf, cmdSize);
@@ -117,7 +117,7 @@ void MsgStorageChangeListener(MSG_STORAGE_CHANGE_TYPE_T storageChangeType, MSG_M
 }
 
 
-MSG_ERROR_T MsgIncomingMessageListener(MSG_MESSAGE_INFO_S *pMsg)
+msg_error_t MsgIncomingMessageListener(MSG_MESSAGE_INFO_S *pMsg)
 {
        MSG_BEGIN();
 
@@ -175,7 +175,7 @@ MSG_ERROR_T MsgIncomingMessageListener(MSG_MESSAGE_INFO_S *pMsg)
 }
 
 
-MSG_ERROR_T MsgIncomingSyncMLMessageListener(MSG_SYNCML_MESSAGE_DATA_S *pSyncMLData)
+msg_error_t MsgIncomingSyncMLMessageListener(MSG_SYNCML_MESSAGE_DATA_S *pSyncMLData)
 {
        MSG_BEGIN();
 
@@ -224,7 +224,7 @@ MSG_ERROR_T MsgIncomingSyncMLMessageListener(MSG_SYNCML_MESSAGE_DATA_S *pSyncMLD
 }
 
 
-MSG_ERROR_T MsgIncomingLBSMessageListener(MSG_LBS_MESSAGE_DATA_S *pLBSData)
+msg_error_t MsgIncomingLBSMessageListener(MSG_LBS_MESSAGE_DATA_S *pLBSData)
 {
        MSG_BEGIN();
 
@@ -273,7 +273,7 @@ MSG_ERROR_T MsgIncomingLBSMessageListener(MSG_LBS_MESSAGE_DATA_S *pLBSData)
 }
 
 
-MSG_ERROR_T MsgInitSimBySatListener()
+msg_error_t MsgInitSimBySatListener()
 {
        MSG_BEGIN();
 
@@ -316,7 +316,7 @@ MSG_ERROR_T MsgInitSimBySatListener()
 }
 
 /* MMS_Incoming_listener */
-MSG_ERROR_T MsgMmsConfIncomingListener(MSG_MESSAGE_INFO_S *pMsg, MSG_REQUEST_ID_T *pReqId)
+msg_error_t MsgMmsConfIncomingListener(MSG_MESSAGE_INFO_S *pMsg, msg_request_id_t *pReqId)
 {
        MSG_BEGIN();
        MSG_DEBUG("pMsg = %s, pReqId = %d ", pMsg->msgData, *pReqId);
@@ -326,7 +326,7 @@ MSG_ERROR_T MsgMmsConfIncomingListener(MSG_MESSAGE_INFO_S *pMsg, MSG_REQUEST_ID_
        client.connect(MSG_SOCKET_PATH);
 
        // composing command
-       int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_MESSAGE_INFO_S) + sizeof(MSG_REQUEST_ID_T); // cmd type, MSG_MESSAGE_INFO_S, MSG_REQUEST_ID_T
+       int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_MESSAGE_INFO_S) + sizeof(msg_request_id_t); // cmd type, MSG_MESSAGE_INFO_S, msg_request_id_t
        MSG_DEBUG("cmdSize : %d", cmdSize);
 
        char cmdBuf[cmdSize];
@@ -341,7 +341,7 @@ MSG_ERROR_T MsgMmsConfIncomingListener(MSG_MESSAGE_INFO_S *pMsg, MSG_REQUEST_ID_
 
        // cmd data
        memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), pMsg, sizeof(MSG_MESSAGE_INFO_S));
-       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN+sizeof(MSG_MESSAGE_INFO_S)), pReqId, sizeof(MSG_REQUEST_ID_T));
+       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN+sizeof(MSG_MESSAGE_INFO_S)), pReqId, sizeof(msg_request_id_t));
 
        // Send Command to Messaging FW
        client.write(cmdBuf, cmdSize);
@@ -390,9 +390,9 @@ MsgPlugin::MsgPlugin(MSG_MAIN_TYPE_T mainType, const char *libPath): mSupportedM
        dlerror();
 
        // assign the c function pointers
-       MSG_ERROR_T(*pFunc)(MSG_PLUGIN_HANDLER_S*) = NULL;
+       msg_error_t(*pFunc)(MSG_PLUGIN_HANDLER_S*) = NULL;
 
-       pFunc = (MSG_ERROR_T(*)(MSG_PLUGIN_HANDLER_S*))dlsym(libHandle, "MsgPlgCreateHandle");
+       pFunc = (msg_error_t(*)(MSG_PLUGIN_HANDLER_S*))dlsym(libHandle, "MsgPlgCreateHandle");
 
        char *error = dlerror();
 
@@ -429,7 +429,7 @@ MsgPlugin::~MsgPlugin()
 }
 
 
-MSG_ERROR_T MsgPlugin::initialize()
+msg_error_t MsgPlugin::initialize()
 {
        if ( mPlgHandler.pfInitialize != NULL)
                return mPlgHandler.pfInitialize();
@@ -445,16 +445,16 @@ void MsgPlugin::finalize()
 }
 
 
-MSG_ERROR_T MsgPlugin::submitReq(MSG_REQUEST_INFO_S *pReqInfo, bool bReqCb)
+msg_error_t MsgPlugin::submitReq(MSG_REQUEST_INFO_S *pReqInfo)
 {
        if (mPlgHandler.pfSubmitRequest != NULL)
-               return mPlgHandler.pfSubmitRequest(pReqInfo, bReqCb);
+               return mPlgHandler.pfSubmitRequest(pReqInfo);
        else
                return MSG_ERR_INVALID_PLUGIN_HANDLE;
 }
 
 
-MSG_ERROR_T MsgPlugin::registerListener(MSG_PLUGIN_LISTENER_S *pListener)
+msg_error_t MsgPlugin::registerListener(MSG_PLUGIN_LISTENER_S *pListener)
 {
        if (mPlgHandler.pfRegisterListener != NULL)
                return mPlgHandler.pfRegisterListener(pListener);
@@ -463,7 +463,7 @@ MSG_ERROR_T MsgPlugin::registerListener(MSG_PLUGIN_LISTENER_S *pListener)
 }
 
 
-MSG_ERROR_T MsgPlugin::checkSimStatus(MSG_SIM_STATUS_T *pStatus)
+msg_error_t MsgPlugin::checkSimStatus(MSG_SIM_STATUS_T *pStatus)
 {
        if (mPlgHandler.pfRegisterListener != NULL)
                return mPlgHandler.pfCheckSimStatus(pStatus);
@@ -472,7 +472,7 @@ MSG_ERROR_T MsgPlugin::checkSimStatus(MSG_SIM_STATUS_T *pStatus)
 }
 
 
-MSG_ERROR_T MsgPlugin::checkDeviceStatus()
+msg_error_t MsgPlugin::checkDeviceStatus()
 {
        if (mPlgHandler.pfRegisterListener != NULL)
                return mPlgHandler.pfCheckDeviceStatus();
@@ -481,7 +481,7 @@ MSG_ERROR_T MsgPlugin::checkDeviceStatus()
 }
 
 
-MSG_ERROR_T MsgPlugin::initSimMessage()
+msg_error_t MsgPlugin::initSimMessage()
 {
        if (mPlgHandler.pfInitSimMessage != NULL)
                return mPlgHandler.pfInitSimMessage();
@@ -490,7 +490,7 @@ MSG_ERROR_T MsgPlugin::initSimMessage()
 }
 
 
-MSG_ERROR_T MsgPlugin::saveSimMessage(MSG_MESSAGE_INFO_S *pMsgInfo, SMS_SIM_ID_LIST_S *pSimIdList)
+msg_error_t MsgPlugin::saveSimMessage(MSG_MESSAGE_INFO_S *pMsgInfo, SMS_SIM_ID_LIST_S *pSimIdList)
 {
        if (mPlgHandler.pfSaveSimMessage != NULL)
                return mPlgHandler.pfSaveSimMessage(pMsgInfo, pSimIdList);
@@ -499,7 +499,7 @@ MSG_ERROR_T MsgPlugin::saveSimMessage(MSG_MESSAGE_INFO_S *pMsgInfo, SMS_SIM_ID_L
 }
 
 
-MSG_ERROR_T MsgPlugin::deleteSimMessage(MSG_SIM_ID_T SimMsgId)
+msg_error_t MsgPlugin::deleteSimMessage(msg_sim_id_t SimMsgId)
 {
        if (mPlgHandler.pfDeleteSimMessage != NULL)
                return mPlgHandler.pfDeleteSimMessage(SimMsgId);
@@ -508,7 +508,7 @@ MSG_ERROR_T MsgPlugin::deleteSimMessage(MSG_SIM_ID_T SimMsgId)
 }
 
 
-MSG_ERROR_T MsgPlugin::setReadStatus(MSG_SIM_ID_T SimMsgId)
+msg_error_t MsgPlugin::setReadStatus(msg_sim_id_t SimMsgId)
 {
        if (mPlgHandler.pfSetReadStatus != NULL)
                return mPlgHandler.pfSetReadStatus(SimMsgId);
@@ -517,7 +517,7 @@ MSG_ERROR_T MsgPlugin::setReadStatus(MSG_SIM_ID_T SimMsgId)
 }
 
 
-MSG_ERROR_T MsgPlugin::setMemoryStatus(MSG_ERROR_T Error)
+msg_error_t MsgPlugin::setMemoryStatus(msg_error_t Error)
 {
        if (mPlgHandler.pfSetMemoryStatus != NULL)
                return mPlgHandler.pfSetMemoryStatus(Error);
@@ -526,7 +526,7 @@ MSG_ERROR_T MsgPlugin::setMemoryStatus(MSG_ERROR_T Error)
 }
 
 
-MSG_ERROR_T MsgPlugin::initConfigData(MSG_SIM_STATUS_T SimStatus)
+msg_error_t MsgPlugin::initConfigData(MSG_SIM_STATUS_T SimStatus)
 {
        if (mPlgHandler.pfInitConfigData != NULL)
                return mPlgHandler.pfInitConfigData(SimStatus);
@@ -535,7 +535,7 @@ MSG_ERROR_T MsgPlugin::initConfigData(MSG_SIM_STATUS_T SimStatus)
 }
 
 
-MSG_ERROR_T MsgPlugin::setConfigData(const MSG_SETTING_S *pSetting)
+msg_error_t MsgPlugin::setConfigData(const MSG_SETTING_S *pSetting)
 {
        if (mPlgHandler.pfSetConfigData != NULL)
                return mPlgHandler.pfSetConfigData(pSetting);
@@ -544,7 +544,7 @@ MSG_ERROR_T MsgPlugin::setConfigData(const MSG_SETTING_S *pSetting)
 }
 
 
-MSG_ERROR_T MsgPlugin::getConfigData(MSG_SETTING_S *pSetting)
+msg_error_t MsgPlugin::getConfigData(MSG_SETTING_S *pSetting)
 {
        if (mPlgHandler.pfGetConfigData != NULL)
                return mPlgHandler.pfGetConfigData(pSetting);
@@ -552,7 +552,7 @@ MSG_ERROR_T MsgPlugin::getConfigData(MSG_SETTING_S *pSetting)
                return MSG_ERR_INVALID_PLUGIN_HANDLE;
 }
 
-MSG_ERROR_T MsgPlugin::addMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S *pSendOptInfo, char *pFileData)
+msg_error_t MsgPlugin::addMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S *pSendOptInfo, char *pFileData)
 {
        if (mPlgHandler.pfAddMessage != NULL) {
                return mPlgHandler.pfAddMessage(pMsgInfo, pSendOptInfo, pFileData);
@@ -561,7 +561,7 @@ MSG_ERROR_T MsgPlugin::addMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_I
        }
 }
 
-MSG_ERROR_T MsgPlugin::updateMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S *pSendOptInfo, char *pFileData)
+msg_error_t MsgPlugin::updateMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S *pSendOptInfo, char *pFileData)
 {
        if (mPlgHandler.pfUpdateMessage != NULL) {
                return mPlgHandler.pfUpdateMessage(pMsgInfo, pSendOptInfo, pFileData);
@@ -571,7 +571,7 @@ MSG_ERROR_T MsgPlugin::updateMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOP
 }
 
 
-MSG_ERROR_T MsgPlugin::processReceivedInd(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_REQUEST_INFO_S *pRequest, bool *bReject)
+msg_error_t MsgPlugin::processReceivedInd(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_REQUEST_INFO_S *pRequest, bool *bReject)
 {
        if (mPlgHandler.pfProcessReceivedInd != NULL) {
                return mPlgHandler.pfProcessReceivedInd(pMsgInfo, pRequest, bReject);
@@ -581,7 +581,7 @@ MSG_ERROR_T MsgPlugin::processReceivedInd(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_REQU
 }
 
 
-MSG_ERROR_T MsgPlugin::getMmsMessage(MSG_MESSAGE_INFO_S *pMsg, MSG_SENDINGOPT_INFO_S *pSendOptInfo,  MMS_MESSAGE_DATA_S *pMmsMsg, char **pDestMsg)
+msg_error_t MsgPlugin::getMmsMessage(MSG_MESSAGE_INFO_S *pMsg, MSG_SENDINGOPT_INFO_S *pSendOptInfo,  MMS_MESSAGE_DATA_S *pMmsMsg, char **pDestMsg)
 {
        if (mPlgHandler.pfGetMmsMessage != NULL) {
                return mPlgHandler.pfGetMmsMessage(pMsg, pSendOptInfo, pMmsMsg, pDestMsg);
@@ -591,7 +591,7 @@ MSG_ERROR_T MsgPlugin::getMmsMessage(MSG_MESSAGE_INFO_S *pMsg, MSG_SENDINGOPT_IN
 }
 
 
-MSG_ERROR_T MsgPlugin::updateRejectStatus(MSG_MESSAGE_INFO_S *pMsgInfo)
+msg_error_t MsgPlugin::updateRejectStatus(MSG_MESSAGE_INFO_S *pMsgInfo)
 {
        if (mPlgHandler.pfUpdateRejectStatus != NULL) {
                return mPlgHandler.pfUpdateRejectStatus(pMsgInfo);
@@ -601,7 +601,7 @@ MSG_ERROR_T MsgPlugin::updateRejectStatus(MSG_MESSAGE_INFO_S *pMsgInfo)
 }
 
 
-MSG_ERROR_T MsgPlugin::composeReadReport(MSG_MESSAGE_INFO_S *pMsgInfo)
+msg_error_t MsgPlugin::composeReadReport(MSG_MESSAGE_INFO_S *pMsgInfo)
 {
        if (mPlgHandler.pfComposeReadReport != NULL) {
                return mPlgHandler.pfComposeReadReport(pMsgInfo);
@@ -611,7 +611,7 @@ MSG_ERROR_T MsgPlugin::composeReadReport(MSG_MESSAGE_INFO_S *pMsgInfo)
 }
 
 
-MSG_ERROR_T MsgPlugin::restoreMsg(MSG_MESSAGE_INFO_S *pMsgInfo, char* pRecvBody, int rcvdBodyLen, char* filePath)
+msg_error_t MsgPlugin::restoreMsg(MSG_MESSAGE_INFO_S *pMsgInfo, char* pRecvBody, int rcvdBodyLen, char* filePath)
 {
        if (mPlgHandler.pfRestoreMsg != NULL)
                return mPlgHandler.pfRestoreMsg(pMsgInfo,pRecvBody, rcvdBodyLen, filePath);
index 746da31..ee403aa 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include "MsgDebug.h"
 #include "MsgPluginManager.h"
 
 #define DEF_BUF_LEN    128
 
+/*==================================================================================================
+                                                               STATIC FUNCTION PROTOTYPES
+==================================================================================================*/
+static char* msg_clean_country_code(char *src);
+static char* msg_normalize_number(char *src);
 
 /*==================================================================================================
                                      FUNCTION IMPLEMENTATION
 ==================================================================================================*/
-MSG_ERROR_T MsgInitSimConfig(MSG_SIM_STATUS_T SimStatus)
+msg_error_t MsgInitSimConfig(MSG_SIM_STATUS_T SimStatus)
 {
        MSG_DEBUG("Start to initialize SIM Configuration");
 
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        if (SimStatus != MSG_SIM_STATUS_NOT_FOUND)
        {
@@ -53,9 +58,19 @@ MSG_ERROR_T MsgInitSimConfig(MSG_SIM_STATUS_T SimStatus)
 }
 
 
-MSG_ERROR_T MsgSetConfigData(const MSG_SETTING_S *pSetting)
+msg_error_t MsgSetConfigData(const MSG_SETTING_S *pSetting)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
+
+#ifdef USE_GCONF
+       err = MsgGconfGetClient();
+
+       if (err != MSG_SUCCESS)
+       {
+               MSG_DEBUG("Get GConf Client Error");
+               return MSG_ERR_NULL_POINTER;
+       }
+#endif
 
        MSG_DEBUG("Setting Type : %d", pSetting->type);
 
@@ -63,85 +78,119 @@ MSG_ERROR_T MsgSetConfigData(const MSG_SETTING_S *pSetting)
        {
                case MSG_GENERAL_OPT :
                        err = MsgSetGeneralOpt(pSetting);
-               break;
+                       break;
                case MSG_SMS_SENDOPT :
                        err = MsgSetSMSSendOpt(pSetting);
-               break;
+                       break;
                case MSG_SMSC_LIST :
                        err = MsgSetSMSCList(pSetting, true);
-               break;
+                       break;
                case MSG_MMS_SENDOPT :
                        err = MsgSetMMSSendOpt(pSetting);
-               break;
+                       break;
                case MSG_MMS_RECVOPT :
                        err = MsgSetMMSRecvOpt(pSetting);
-               break;
+                       break;
                case MSG_MMS_STYLEOPT :
                        err = MsgSetMMSStyleOpt(pSetting);
-               break;
+                       break;
                case MSG_PUSHMSG_OPT :
                        err = MsgSetPushMsgOpt(pSetting);
-               break;
+                       break;
                case MSG_CBMSG_OPT :
                        err = MsgSetCBMsgOpt(pSetting, true);
-               break;
+                       break;
                case MSG_VOICEMAIL_OPT :
                        err = MsgSetVoiceMailOpt(pSetting);
-               break;
+                       break;
                case MSG_MSGSIZE_OPT:
                        err = MsgSetMsgSizeOpt(pSetting);
+                       break;
                default :
-               break;
+                       break;
        }
 
+#ifdef USE_GCONF
+       MsgGconfUnrefClient();
+#endif
+
        return err;
 }
 
 
-MSG_ERROR_T MsgGetConfigData(MSG_SETTING_S *pSetting)
+msg_error_t MsgGetConfigData(MSG_SETTING_S *pSetting)
 {
+#ifdef USE_GCONF
+       msg_error_t err = MsgGconfGetClient();
+
+       if (err != MSG_SUCCESS)
+       {
+               MSG_DEBUG("Get GConf Client Error");
+               return MSG_ERR_NULL_POINTER;
+       }
+#endif
+
+       // Check SIM is present or not
+       MSG_SIM_STATUS_T simStatus = (MSG_SIM_STATUS_T)MsgSettingGetInt(MSG_SIM_CHANGED);
+
        switch (pSetting->type)
        {
                case MSG_GENERAL_OPT :
                        MsgGetGeneralOpt(pSetting);
-               break;
+                       break;
                case MSG_SMS_SENDOPT :
                        MsgGetSMSSendOpt(pSetting);
-               break;
+                       break;
                case MSG_SMSC_LIST :
+               {
+                       if (simStatus == MSG_SIM_STATUS_NOT_FOUND) {
+                               MSG_DEBUG("SIM is not present..");
+                               return MSG_ERR_NO_SIM;
+                       }
                        MsgGetSMSCList(pSetting);
+               }
                break;
                case MSG_MMS_SENDOPT :
                        MsgGetMMSSendOpt(pSetting);
-               break;
+                       break;
                case MSG_MMS_RECVOPT :
                        MsgGetMMSRecvOpt(pSetting);
-               break;
+                       break;
                case MSG_MMS_STYLEOPT :
                        MsgGetMMSStyleOpt(pSetting);
-               break;
+                       break;
                case MSG_PUSHMSG_OPT :
                        MsgGetPushMsgOpt(pSetting);
-               break;
+                       break;
                case MSG_CBMSG_OPT :
+               {
+                       if (simStatus == MSG_SIM_STATUS_NOT_FOUND) {
+                               MSG_DEBUG("SIM is not present..");
+                               return MSG_ERR_NO_SIM;
+                       }
                        MsgGetCBMsgOpt(pSetting);
+               }
                break;
                case MSG_VOICEMAIL_OPT :
                        MsgGetVoiceMailOpt(pSetting);
-               break;
+                       break;
                case MSG_MSGSIZE_OPT :
                        MsgGetMsgSizeOpt(pSetting);
-               break;
+                       break;
 
                default :
-               break;
+                       break;
        }
 
+#ifdef USE_GCONF
+       MsgGconfUnrefClient();
+#endif
+
        return MSG_SUCCESS;
 }
 
 
-MSG_ERROR_T MsgSetGeneralOpt(const MSG_SETTING_S *pSetting)
+msg_error_t MsgSetGeneralOpt(const MSG_SETTING_S *pSetting)
 {
        MSG_GENERAL_OPT_S generalOpt;
        bool bValue = false;
@@ -168,7 +217,7 @@ MSG_ERROR_T MsgSetGeneralOpt(const MSG_SETTING_S *pSetting)
 }
 
 
-MSG_ERROR_T MsgSetSMSSendOpt(const MSG_SETTING_S *pSetting)
+msg_error_t MsgSetSMSSendOpt(const MSG_SETTING_S *pSetting)
 {
        MSG_SMS_SENDOPT_S sendOpt;
        int iValue = 0;
@@ -220,9 +269,9 @@ MSG_ERROR_T MsgSetSMSSendOpt(const MSG_SETTING_S *pSetting)
 }
 
 
-MSG_ERROR_T MsgSetSMSCList(const MSG_SETTING_S *pSetting, bool bSetSim)
+msg_error_t MsgSetSMSCList(const MSG_SETTING_S *pSetting, bool bSetSim)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        for (int index = 0; index < pSetting->option.smscList.totalCnt; index++)
        {
@@ -240,7 +289,7 @@ MSG_ERROR_T MsgSetSMSCList(const MSG_SETTING_S *pSetting, bool bSetSim)
                if (err != MSG_SUCCESS)
                {
                        MSG_DEBUG("Error to set config data in sim [%d]", err);
-                       return MSG_ERR_SET_SIM_SET;
+                       return err;
                }
        }
 
@@ -320,7 +369,7 @@ MSG_ERROR_T MsgSetSMSCList(const MSG_SETTING_S *pSetting, bool bSetSim)
 }
 
 
-MSG_ERROR_T MsgSetMMSSendOpt(const MSG_SETTING_S *pSetting)
+msg_error_t MsgSetMMSSendOpt(const MSG_SETTING_S *pSetting)
 {
        MSG_MMS_SENDOPT_S sendOpt;
        int iValue = 0;
@@ -445,7 +494,7 @@ MSG_ERROR_T MsgSetMMSSendOpt(const MSG_SETTING_S *pSetting)
 }
 
 
-MSG_ERROR_T MsgSetMMSRecvOpt(const MSG_SETTING_S *pSetting)
+msg_error_t MsgSetMMSRecvOpt(const MSG_SETTING_S *pSetting)
 {
        MSG_MMS_RECVOPT_S recvOpt;
        int iValue = 0;
@@ -505,7 +554,7 @@ MSG_ERROR_T MsgSetMMSRecvOpt(const MSG_SETTING_S *pSetting)
 }
 
 
-MSG_ERROR_T MsgSetMMSStyleOpt(const MSG_SETTING_S *pSetting)
+msg_error_t MsgSetMMSStyleOpt(const MSG_SETTING_S *pSetting)
 {
        MSG_MMS_STYLEOPT_S styleOpt;
        int iValue = 0;
@@ -636,7 +685,7 @@ MSG_ERROR_T MsgSetMMSStyleOpt(const MSG_SETTING_S *pSetting)
        return MSG_SUCCESS;
 }
 
-MSG_ERROR_T MsgSetPushMsgOpt(const MSG_SETTING_S *pSetting)
+msg_error_t MsgSetPushMsgOpt(const MSG_SETTING_S *pSetting)
 {
        MSG_PUSHMSG_OPT_S pushOpt;
        int iValue = 0;
@@ -664,9 +713,9 @@ MSG_ERROR_T MsgSetPushMsgOpt(const MSG_SETTING_S *pSetting)
 }
 
 
-MSG_ERROR_T MsgSetCBMsgOpt(const MSG_SETTING_S *pSetting, bool bSetSim)
+msg_error_t MsgSetCBMsgOpt(const MSG_SETTING_S *pSetting, bool bSetSim)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        MSG_CBMSG_OPT_S cbOpt;
        int iValue = 0;
@@ -674,20 +723,18 @@ MSG_ERROR_T MsgSetCBMsgOpt(const MSG_SETTING_S *pSetting, bool bSetSim)
 
        memcpy(&cbOpt, &(pSetting->option.cbMsgOpt), sizeof(MSG_CBMSG_OPT_S));
 
-       if (bSetSim == true)
-       {
+       if (bSetSim == true) {
                cbOpt.maxSimCnt = MsgSettingGetInt(CB_MAX_SIM_COUNT);
 
-               if (cbOpt.channelData.channelCnt > cbOpt.maxSimCnt)
-               {
+               if (cbOpt.channelData.channelCnt > cbOpt.maxSimCnt) {
                        MSG_DEBUG("Channel Count is over Max SIM Count [%d]", cbOpt.channelData.channelCnt);
                        return MSG_ERR_SET_SIM_SET;
                }
 
-               if (MsgSetConfigInSim(pSetting) != MSG_SUCCESS)
-               {
+               err = MsgSetConfigInSim(pSetting);
+               if (err != MSG_SUCCESS) {
                        MSG_DEBUG("Error to set config data in sim [%d]", err);
-                       return MSG_ERR_SET_SIM_SET;
+                       return err;
                }
        }
 
@@ -763,8 +810,7 @@ MSG_ERROR_T MsgSetCBMsgOpt(const MSG_SETTING_S *pSetting, bool bSetSim)
        return err;
 }
 
-
-MSG_ERROR_T MsgSetVoiceMailOpt(const MSG_SETTING_S *pSetting)
+msg_error_t MsgSetVoiceMailOpt(const MSG_SETTING_S *pSetting)
 {
        MSG_VOICEMAIL_OPT_S voiceMailOpt;
        char *pValue = NULL;
@@ -796,7 +842,7 @@ MSG_ERROR_T MsgSetVoiceMailOpt(const MSG_SETTING_S *pSetting)
 }
 
 
-MSG_ERROR_T MsgSetMsgSizeOpt(const MSG_SETTING_S *pSetting)
+msg_error_t MsgSetMsgSizeOpt(const MSG_SETTING_S *pSetting)
 {
        MSG_MSGSIZE_OPT_S msgSizeOpt;
        int iValue = 0;
@@ -827,7 +873,7 @@ void MsgGetSMSSendOpt(MSG_SETTING_S *pSetting)
 {
        memset(&(pSetting->option.smsSendOpt), 0x00, sizeof(MSG_SMS_SENDOPT_S));
 
-       pSetting->option.smsSendOpt.dcs = (MSG_ENCODE_TYPE_T)MsgSettingGetInt(SMS_SEND_DCS);
+       pSetting->option.smsSendOpt.dcs = (msg_encode_type_t)MsgSettingGetInt(SMS_SEND_DCS);
 
        pSetting->option.smsSendOpt.netMode = (MSG_SMS_NETWORK_MODE_T)MsgSettingGetInt(SMS_SEND_NETWORK_MODE);
 
@@ -905,7 +951,7 @@ void MsgGetMMSSendOpt(MSG_SETTING_S *pSetting)
 
        pSetting->option.mmsSendOpt.msgClass = (MSG_MMS_MSG_CLASS_TYPE_T)MsgSettingGetInt(MMS_SEND_MSG_CLASS);
 
-       pSetting->option.mmsSendOpt.priority = (MSG_PRIORITY_TYPE_T)MsgSettingGetInt(MMS_SEND_PRIORITY);
+       pSetting->option.mmsSendOpt.priority = (msg_priority_type_t)MsgSettingGetInt(MMS_SEND_PRIORITY);
 
        pSetting->option.mmsSendOpt.expiryTime = (MSG_MMS_EXPIRY_TIME_T)MsgSettingGetInt(MMS_SEND_EXPIRY_TIME);
 
@@ -1044,47 +1090,227 @@ void MsgGetCBMsgOpt(MSG_SETTING_S *pSetting)
        }
 }
 
-
 void MsgGetVoiceMailOpt(MSG_SETTING_S *pSetting)
 {
-       char *tmpValue = NULL;
+        char *tmpValue = NULL;
 
-       memset(&(pSetting->option.voiceMailOpt), 0x00, sizeof(MSG_VOICEMAIL_OPT_S));
+        memset(&(pSetting->option.voiceMailOpt), 0x00, sizeof(MSG_VOICEMAIL_OPT_S));
 
-       tmpValue = MsgSettingGetString(VOICEMAIL_NUMBER);
-       if (tmpValue != NULL) {
-               strncpy(pSetting->option.voiceMailOpt.mailNumber, tmpValue, MAX_PHONE_NUMBER_LEN);
-               free(tmpValue);
-               tmpValue = NULL;
-       }
+        tmpValue = MsgSettingGetString(VOICEMAIL_NUMBER);
+        if (tmpValue != NULL) {
+                strncpy(pSetting->option.voiceMailOpt.mailNumber, tmpValue, MAX_PHONE_NUMBER_LEN);
+                free(tmpValue);
+                tmpValue = NULL;
+        }
 }
 
 
 void MsgGetMsgSizeOpt(MSG_SETTING_S *pSetting)
 {
-       memset(&(pSetting->option.msgSizeOpt), 0x00, sizeof(MSG_MSGSIZE_OPT_S));
+        memset(&(pSetting->option.msgSizeOpt), 0x00, sizeof(MSG_MSGSIZE_OPT_S));
 
-       pSetting->option.msgSizeOpt.nMsgSize = MsgSettingGetInt(MSGSIZE_OPTION);
+        pSetting->option.msgSizeOpt.nMsgSize = MsgSettingGetInt(MSGSIZE_OPTION);
 }
 
 
-MSG_ERROR_T MsgSetConfigInSim(const MSG_SETTING_S *pSetting)
+msg_error_t MsgSetConfigInSim(const MSG_SETTING_S *pSetting)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+        msg_error_t err = MSG_SUCCESS;
 
-       MsgPlugin* plg = MsgPluginManager::instance()->getPlugin(MSG_SMS_TYPE);
+        MsgPlugin* plg = MsgPluginManager::instance()->getPlugin(MSG_SMS_TYPE);
 
-       // Get Setting Data from SIM
-       if (plg != NULL)
-               err = plg->setConfigData(pSetting);
-       else
-               err = MSG_ERR_NULL_POINTER;
+        // Get Setting Data from SIM
+        if (plg != NULL)
+                err = plg->setConfigData(pSetting);
+        else
+                err = MSG_ERR_NULL_POINTER;
 
-       if (err != MSG_SUCCESS)
+        if (err != MSG_SUCCESS)
+        {
+                MSG_DEBUG("Error. Error code is %d.", err);
+                return err;
+        }
+
+        return err;
+}
+
+static char* msg_clean_country_code(char *src)
+{
+       int ret = 1;
+
+       switch (src[ret++]-'0')
        {
-               MSG_DEBUG("Error. Error code is %d.", err);
-               return err;
+               case 1:
+               case 7:
+                       break;
+               case 2:
+                       switch (src[ret++]-'0')
+                       {
+                               case 0:
+                               case 7:
+                                       break;
+                               case 1:
+                               case 2:
+                               case 3:
+                               case 4:
+                               case 5:
+                               case 6:
+                               case 8:
+                               case 9:
+                                       ret += 1;
+                                       break;
+                               default:
+                                       MSG_DEBUG("The parameter(src:%s) has invalid character set", src);
+                                       break;
+                       }
+                       break;
+               case 3:
+                       switch (src[ret++]-'0')
+                       {
+                               case 0:
+                               case 1:
+                               case 2:
+                               case 3:
+                               case 4:
+                               case 6:
+                               case 9:
+                                       break;
+                               case 5:
+                               case 7:
+                               case 8:
+                                       ret += 1;
+                                       break;
+                               default:
+                                       MSG_DEBUG("The parameter(src:%s) has invalid character set", src);
+                                       break;
+                       }
+                       break;
+               case 4:
+                       switch (src[ret++]-'0')
+                       {
+                               case 0:
+                               case 1:
+                               case 3:
+                               case 4:
+                               case 5:
+                               case 6:
+                               case 7:
+                               case 8:
+                               case 9:
+                                       break;
+                               case 2:
+                                       ret += 1;
+                                       break;
+                               default:
+                                       MSG_DEBUG("The parameter(src:%s) has invalid character set", src);
+                                       break;
+                       }
+                       break;
+               case 5:
+                       switch (src[ret++]-'0')
+                       {
+                               case 1:
+                               case 2:
+                               case 3:
+                               case 4:
+                               case 5:
+                               case 6:
+                               case 7:
+                               case 8:
+                                       break;
+                               case 0:
+                               case 9:
+                                       ret += 1;
+                                       break;
+                               default:
+                                       MSG_DEBUG("The parameter(src:%s) has invalid character set", src);
+                                       break;
+                       }
+                       break;
+               case 6:
+                       switch (src[ret++]-'0')
+                       {
+                               case 0:
+                               case 1:
+                               case 2:
+                               case 3:
+                               case 4:
+                               case 5:
+                               case 6:
+                                       break;
+                               case 7:
+                               case 8:
+                               case 9:
+                                       ret += 1;
+                                       break;
+                               default:
+                                       MSG_DEBUG("The parameter(src:%s) has invalid character set", src);
+                                       break;
+                       }
+                       break;
+               case 8:
+                       switch (src[ret++]-'0')
+                       {
+                               case 1:
+                               case 2:
+                               case 4:
+                               case 6:
+                                       break;
+                               case 0:
+                               case 3:
+                               case 5:
+                               case 7:
+                               case 8:
+                               case 9:
+                                       ret += 1;
+                                       break;
+                               default:
+                                       MSG_DEBUG("The parameter(src:%s) has invalid character set", src);
+                                       break;
+                       }
+                       break;
+               case 9:
+                       switch (src[ret++]-'0')
+                       {
+                               case 0:
+                               case 1:
+                               case 2:
+                               case 3:
+                               case 4:
+                               case 5:
+                               case 8:
+                                       break;
+                               case 6:
+                               case 7:
+                               case 9:
+                                       ret += 1;
+                                       break;
+                               default:
+                                       MSG_DEBUG("The parameter(src:%s) has invalid character set", src);
+                                       break;
+                       }
+                       break;
+               case 0:
+               default:
+                       MSG_DEBUG("The parameter(src:%s) has invalid character set", src);
+                       return src;
        }
 
-       return err;
+       return &src[ret];
+}
+
+static char* msg_normalize_number(char *src)
+{
+       char *normalized_number;
+
+       if ('+' == src[0])
+               normalized_number = msg_clean_country_code(src);
+       else if ('0' == src[0])
+               normalized_number = src+1;
+       else
+               normalized_number = src;
+
+       MSG_DEBUG("src = %s, normalized = %s", src, normalized_number);
+
+       return normalized_number;
 }
diff --git a/framework/storage-handler/MsgStorageFilter.cpp b/framework/storage-handler/MsgStorageFilter.cpp
new file mode 100755 (executable)
index 0000000..4e15eec
--- /dev/null
@@ -0,0 +1,265 @@
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#include "MsgDebug.h"
+#include "MsgSqliteWrapper.h"
+#include "MsgStorageHandler.h"
+
+
+/*==================================================================================================
+                                     VARIABLES
+==================================================================================================*/
+extern MsgDbHandler dbHandle;
+
+
+/*==================================================================================================
+                                     FUNCTION IMPLEMENTATION
+==================================================================================================*/
+msg_error_t MsgStoCheckDuplicatedFilter(const MSG_FILTER_S *pFilter)
+{
+       MSG_BEGIN();
+
+       msg_error_t err = MSG_SUCCESS;
+       int rowCnt = 0;
+
+       char sqlQuery[MAX_QUERY_LEN+1];
+
+       memset(sqlQuery, 0x00, sizeof(sqlQuery));
+
+       if (pFilter->filterType == MSG_FILTER_BY_ADDRESS) {
+               if (strlen(pFilter->filterValue) > VALID_ADDRESS_LEN) {
+                       char newNumber[VALID_ADDRESS_LEN+1];
+                       memset(newNumber, 0x00, sizeof(newNumber));
+
+                       int overLen = 0, i = 0;
+
+                       overLen = strlen(pFilter->filterValue) - VALID_ADDRESS_LEN;
+
+                       for (i = 0; i < VALID_ADDRESS_LEN; i++)
+                               newNumber[i] = pFilter->filterValue[i+overLen];
+
+                       newNumber[i] = '\0';
+
+                       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT FILTER_ID FROM %s \
+                                       WHERE FILTER_TYPE = %d AND FILTER_VALUE LIKE '%%%s';",
+                                       MSGFW_FILTER_TABLE_NAME, MSG_FILTER_BY_ADDRESS, newNumber);
+               } else {
+                       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT FILTER_ID FROM %s \
+                                       WHERE FILTER_TYPE = %d AND FILTER_VALUE = '%s';",
+                                       MSGFW_FILTER_TABLE_NAME, MSG_FILTER_BY_ADDRESS, pFilter->filterValue);
+               }
+       } else {
+               snprintf(sqlQuery, sizeof(sqlQuery), "SELECT FILTER_VALUE FROM %s WHERE FILTER_TYPE = %d AND FILTER_VALUE like '%s';",
+                               MSGFW_FILTER_TABLE_NAME, MSG_FILTER_BY_SUBJECT, pFilter->filterValue);
+       }
+
+       MSG_DEBUG("sql : %s", sqlQuery);
+
+       err = dbHandle.getTable(sqlQuery, &rowCnt);
+
+       if (err == MSG_SUCCESS)
+               err = MSG_ERR_FILTER_DUPLICATED;
+       else if (err == MSG_ERR_DB_NORECORD)
+               err = MSG_SUCCESS;
+
+       dbHandle.freeTable();
+
+       MSG_END();
+       return err;
+}
+
+
+msg_error_t MsgStoAddFilter(const MSG_FILTER_S *pFilter)
+{
+       MSG_BEGIN();
+
+       msg_error_t err = MSG_SUCCESS;
+
+       //check duplication
+       err = MsgStoCheckDuplicatedFilter(pFilter);
+
+       if (err != MSG_SUCCESS) {
+               MSG_DEBUG("Filter is duplicated : [%d]", err);
+               return err;
+       }
+
+       unsigned int rowId = 0;
+
+       char sqlQuery[MAX_QUERY_LEN+1];
+
+       err = dbHandle.getRowId(MSGFW_FILTER_TABLE_NAME, &rowId);
+
+       if (err != MSG_SUCCESS)
+               return err;
+
+       // Add Filter
+       memset(sqlQuery, 0x00, sizeof(sqlQuery));
+
+       snprintf(sqlQuery, sizeof(sqlQuery), "INSERT INTO %s VALUES (%d, %d, ?);",
+                       MSGFW_FILTER_TABLE_NAME, rowId, pFilter->filterType);
+
+       MSG_DEBUG("sql : %s", sqlQuery);
+
+       if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS)
+               return MSG_ERR_DB_EXEC;
+
+       dbHandle.bindText(pFilter->filterValue, 1);
+
+       if (dbHandle.stepQuery() != MSG_ERR_DB_DONE) {
+               dbHandle.finalizeQuery();
+               return MSG_ERR_DB_EXEC;
+       }
+
+       dbHandle.finalizeQuery();
+
+       MSG_END();
+
+       return MSG_SUCCESS;
+}
+
+
+msg_error_t MsgStoUpdateFilter(const MSG_FILTER_S *pFilter)
+{
+       MSG_BEGIN();
+
+       msg_error_t err = MSG_SUCCESS;
+
+       //check duplication
+       err = MsgStoCheckDuplicatedFilter(pFilter);
+
+       if (err != MSG_SUCCESS) {
+               MSG_DEBUG("Filter is duplicated : [%d]", err);
+               return err;
+       }
+
+       char sqlQuery[MAX_QUERY_LEN+1];
+
+       // Update Filter
+       memset(sqlQuery, 0x00, sizeof(sqlQuery));
+
+       snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET FILTER_TYPE = %d, FILTER_VALUE = ? WHERE FILTER_ID = %d;",
+                       MSGFW_FILTER_TABLE_NAME, pFilter->filterType, pFilter->filterId);
+
+       if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS)
+               return MSG_ERR_DB_PREPARE;
+
+       dbHandle.bindText(pFilter->filterValue, 1);
+
+       if (dbHandle.stepQuery() != MSG_ERR_DB_DONE) {
+               dbHandle.finalizeQuery();
+               return MSG_ERR_DB_EXEC;
+       }
+
+       dbHandle.finalizeQuery();
+
+       MSG_END();
+
+       return MSG_SUCCESS;
+}
+
+
+msg_error_t MsgStoDeleteFilter(msg_filter_id_t filterId)
+{
+       MSG_BEGIN();
+
+       char sqlQuery[MAX_QUERY_LEN+1];
+
+       dbHandle.beginTrans();
+
+       memset(sqlQuery, 0x00, sizeof(sqlQuery));
+
+       snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE FILTER_ID = %d;",
+                       MSGFW_FILTER_TABLE_NAME, filterId);
+
+       // Delete Filter
+       if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS) {
+               dbHandle.endTrans(false);
+               return MSG_ERR_DB_EXEC;
+       }
+
+       dbHandle.endTrans(true);
+
+       MSG_END();
+
+       return MSG_SUCCESS;
+}
+
+
+msg_error_t MsgStoGetFilterList(msg_struct_list_s *pFilterList)
+{
+       MSG_BEGIN();
+
+       if (pFilterList == NULL) {
+               MSG_DEBUG("pFilterList is NULL");
+               return MSG_ERR_NULL_POINTER;
+       }
+
+       int rowCnt = 0, index = 3;
+
+       char sqlQuery[MAX_QUERY_LEN+1];
+
+       // Get filters from DB
+       memset(sqlQuery, 0x00, sizeof(sqlQuery));
+
+       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT FILTER_ID, FILTER_TYPE, FILTER_VALUE FROM %s;",
+                       MSGFW_FILTER_TABLE_NAME);
+
+       msg_error_t err = MSG_SUCCESS;
+
+       err = dbHandle.getTable(sqlQuery, &rowCnt);
+
+       if (err == MSG_ERR_DB_NORECORD) {
+               pFilterList->nCount = 0;
+               pFilterList->msg_struct_info = NULL;
+
+               dbHandle.freeTable();
+
+               return MSG_SUCCESS;
+       } else if (err != MSG_SUCCESS) {
+               dbHandle.freeTable();
+               return err;
+       }
+
+       pFilterList->nCount = rowCnt;
+
+       MSG_DEBUG("pMsgCommInfoList->nCount [%d]", pFilterList->nCount);
+
+       pFilterList->msg_struct_info = (msg_struct_t *)new char[sizeof(MSG_FILTER_S *)*rowCnt];
+
+       msg_struct_s* pTmp = NULL;
+
+       for (int i = 0; i < rowCnt; i++)
+       {
+               pFilterList->msg_struct_info[i] = (msg_struct_t)new char[sizeof(msg_struct_s)];
+
+               pTmp = (msg_struct_s *)pFilterList->msg_struct_info[i];
+               pTmp->type = MSG_STRUCT_FILTER;
+               pTmp->data = new char [sizeof(MSG_FILTER_S)];
+               MSG_FILTER_S *pFilter = (MSG_FILTER_S *)pTmp->data;
+               memset(pFilter, 0x00, sizeof(MSG_FILTER_S));
+               pFilter->filterId = dbHandle.getColumnToInt(index++);
+               pFilter->filterType = dbHandle.getColumnToInt(index++);
+               memset(pFilter->filterValue, 0x00, sizeof(pFilter->filterValue));
+               dbHandle.getColumnToString(index++, MAX_FILTER_VALUE_LEN, pFilter->filterValue);
+       }
+
+
+       dbHandle.freeTable();
+
+       MSG_END();
+
+       return MSG_SUCCESS;
+}
index f2e7114..841859e 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include "MsgDebug.h"
 #include "MsgUtilStorage.h"
@@ -29,9 +29,9 @@ extern MsgDbHandler dbHandle;
 /*==================================================================================================
                                      FUNCTION IMPLEMENTATION
 ==================================================================================================*/
-MSG_ERROR_T MsgStoAddFolder(const MSG_FOLDER_INFO_S *pFolderInfo)
+msg_error_t MsgStoAddFolder(const MSG_FOLDER_INFO_S *pFolderInfo)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        unsigned int rowId = 0;
 
@@ -45,7 +45,7 @@ MSG_ERROR_T MsgStoAddFolder(const MSG_FOLDER_INFO_S *pFolderInfo)
        // Add Folder
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
        snprintf(sqlQuery, sizeof(sqlQuery), "INSERT INTO %s VALUES (%d, '%s', %d);",
-                               MSGFW_FOLDER_TABLE_NAME, rowId, pFolderInfo->folderName, pFolderInfo->folderType);
+                       MSGFW_FOLDER_TABLE_NAME, rowId, pFolderInfo->folderName, pFolderInfo->folderType);
 
        if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS)
                return MSG_ERR_DB_EXEC;
@@ -54,14 +54,14 @@ MSG_ERROR_T MsgStoAddFolder(const MSG_FOLDER_INFO_S *pFolderInfo)
 }
 
 
-MSG_ERROR_T MsgStoUpdateFolder(const MSG_FOLDER_INFO_S *pFolderInfo)
+msg_error_t MsgStoUpdateFolder(const MSG_FOLDER_INFO_S *pFolderInfo)
 {
        char sqlQuery[MAX_QUERY_LEN+1];
 
        // Update Folder
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
        snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET FOLDER_NAME = '%s', FOLDER_TYPE = %d WHERE FOLDER_ID = %d;",
-                               MSGFW_FOLDER_TABLE_NAME, pFolderInfo->folderName, pFolderInfo->folderType, pFolderInfo->folderId);
+                       MSGFW_FOLDER_TABLE_NAME, pFolderInfo->folderName, pFolderInfo->folderType, pFolderInfo->folderId);
 
        if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS)
                return MSG_ERR_DB_EXEC;
@@ -70,7 +70,7 @@ MSG_ERROR_T MsgStoUpdateFolder(const MSG_FOLDER_INFO_S *pFolderInfo)
 }
 
 
-MSG_ERROR_T MsgStoDeleteFolder(const MSG_FOLDER_ID_T FolderId)
+msg_error_t MsgStoDeleteFolder(const msg_folder_id_t folderId)
 {
        char sqlQuery[MAX_QUERY_LEN+1];
 
@@ -78,29 +78,26 @@ MSG_ERROR_T MsgStoDeleteFolder(const MSG_FOLDER_ID_T FolderId)
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
        snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE FOLDER_ID = %d;",
-                                       MSGFW_MESSAGE_TABLE_NAME, FolderId);
+                       MSGFW_MESSAGE_TABLE_NAME, folderId);
 
        // Delete Message in the folder from msg table
-       if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS)
-       {
+       if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS) {
                dbHandle.endTrans(false);
                return MSG_ERR_DB_EXEC;
        }
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
        snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE FOLDER_ID = %d;",
-                                       MSGFW_FOLDER_TABLE_NAME, FolderId);
+                       MSGFW_FOLDER_TABLE_NAME, folderId);
 
        // Delete Message in the folder from msg table
-       if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS)
-       {
+       if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS) {
                dbHandle.endTrans(false);
                return MSG_ERR_DB_EXEC;
        }
 
-       // Clear Address table
-       if (MsgStoClearAddressTable(&dbHandle) != MSG_SUCCESS)
-       {
+       // Clear Conversation table
+       if (MsgStoClearConversationTable(&dbHandle) != MSG_SUCCESS) {
                dbHandle.endTrans(false);
                return MSG_ERR_DB_EXEC;
        }
@@ -111,10 +108,9 @@ MSG_ERROR_T MsgStoDeleteFolder(const MSG_FOLDER_ID_T FolderId)
 }
 
 
-MSG_ERROR_T MsgStoGetFolderList(MSG_FOLDER_LIST_S *pFolderList)
+msg_error_t MsgStoGetFolderList(msg_struct_list_s *pFolderList)
 {
-       if (pFolderList == NULL)
-       {
+       if (pFolderList == NULL) {
                MSG_DEBUG("pFolderList is NULL");
                return MSG_ERR_NULL_POINTER;
        }
@@ -126,10 +122,9 @@ MSG_ERROR_T MsgStoGetFolderList(MSG_FOLDER_LIST_S *pFolderList)
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
        snprintf(sqlQuery, sizeof(sqlQuery), "SELECT FOLDER_ID, FOLDER_TYPE, FOLDER_NAME FROM %s;",
-               MSGFW_FOLDER_TABLE_NAME);
+                       MSGFW_FOLDER_TABLE_NAME);
 
-       if (dbHandle.getTable(sqlQuery, &rowCnt) != MSG_SUCCESS)
-       {
+       if (dbHandle.getTable(sqlQuery, &rowCnt) != MSG_SUCCESS) {
                dbHandle.freeTable();
                return MSG_ERR_DB_GETTABLE;
        }
@@ -138,24 +133,29 @@ MSG_ERROR_T MsgStoGetFolderList(MSG_FOLDER_LIST_S *pFolderList)
 
        MSG_DEBUG("pFolderList->nCount [%d]", pFolderList->nCount);
 
-       pFolderList->folderInfo = (MSG_FOLDER_INFO_S*)new char[sizeof(MSG_FOLDER_INFO_S)*rowCnt];
+       pFolderList->msg_struct_info = (msg_struct_t *)new char[sizeof(MSG_FOLDER_INFO_S *)*rowCnt];
 
-       MSG_FOLDER_INFO_S* pTmp = pFolderList->folderInfo;
+       msg_struct_s* pTmp = NULL;
 
        for (int i = 0; i < rowCnt; i++)
        {
-               pTmp->folderId = dbHandle.getColumnToInt(index++);
+               pFolderList->msg_struct_info[i] = (msg_struct_t)new char[sizeof(msg_struct_s)];
+               pTmp = (msg_struct_s *)pFolderList->msg_struct_info[i];
+               pTmp->type = MSG_STRUCT_FOLDER_INFO;
+               pTmp->data = new char[sizeof(MSG_FOLDER_INFO_S)];
+               MSG_FOLDER_INFO_S * pFolder = (MSG_FOLDER_INFO_S *)pTmp->data;
+               memset(pFolder, 0x00, sizeof(MSG_FOLDER_INFO_S));
 
-               pTmp->folderType = dbHandle.getColumnToInt(index++);
+               pFolder->folderId = dbHandle.getColumnToInt(index++);
 
-               memset(pTmp->folderName, 0x00, sizeof(pTmp->folderName));
-               dbHandle.getColumnToString(index++, MAX_FOLDER_NAME_SIZE, pTmp->folderName);
+               pFolder->folderType = dbHandle.getColumnToInt(index++);
+
+               memset(pFolder->folderName, 0x00, sizeof(pFolder->folderName));
+               dbHandle.getColumnToString(index++, MAX_FOLDER_NAME_SIZE, pFolder->folderName);
 
-               pTmp++;
        }
 
        dbHandle.freeTable();
 
        return MSG_SUCCESS;
 }
-
index e6a8f23..944f234 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -38,16 +38,15 @@ MsgDbHandler dbHandle;
 /*==================================================================================================
                                      FUNCTION IMPLEMENTATION
 ==================================================================================================*/
-MSG_ERROR_T MsgStoConnectDB()
+msg_error_t MsgStoConnectDB()
 {
        return MSG_SUCCESS;
 }
 
 
-MSG_ERROR_T MsgStoDisconnectDB()
+msg_error_t MsgStoDisconnectDB()
 {
-       if (dbHandle.disconnect() != MSG_SUCCESS)
-       {
+       if (dbHandle.disconnect() != MSG_SUCCESS) {
                MSG_DEBUG("DB Disconnect Fail");
                return MSG_ERR_DB_DISCONNECT;
        }
@@ -58,13 +57,15 @@ MSG_ERROR_T MsgStoDisconnectDB()
 }
 
 
-MSG_ERROR_T MsgStoInitDB(bool bSimChanged)
+msg_error_t MsgStoInitDB(bool bSimChanged)
 {
        MSG_BEGIN();
 
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
 #ifdef MSG_DB_CREATE
+       if (MsgCreateConversationTable() != MSG_SUCCESS)
+               return MSG_ERR_DB_STORAGE_INIT;
        if (MsgCreateAddressTable() != MSG_SUCCESS)
                return MSG_ERR_DB_STORAGE_INIT;
        if (MsgCreateFolderTable() != MSG_SUCCESS)
@@ -79,27 +80,21 @@ MSG_ERROR_T MsgStoInitDB(bool bSimChanged)
                return MSG_ERR_DB_STORAGE_INIT;
        if (MsgCreateSyncMLMessageTable() != MSG_SUCCESS)
                return MSG_ERR_DB_STORAGE_INIT;
-       if (MsgCreateScheduledMessageTable() != MSG_SUCCESS)
-               return MSG_ERR_DB_STORAGE_INIT;
        if (MsgCreateSmsSendOptTable() != MSG_SUCCESS)
                return MSG_ERR_DB_STORAGE_INIT;
        if (MsgCreateFilterTable() != MSG_SUCCESS)
                return MSG_ERR_DB_STORAGE_INIT;
-       if (MsgCreateMmsMsgTable() != MSG_SUCCESS)
-               return MSG_ERR_DB_STORAGE_INIT;
-       if (MsgCreateMmsAttributeTable() != MSG_SUCCESS)
+       if (MsgCreateMmsTable() != MSG_SUCCESS)
                return MSG_ERR_DB_STORAGE_INIT;
 
        // Add Default Folders
-       if (MsgAddDefaultFolders() != MSG_SUCCESS)
-       {
+       if (MsgAddDefaultFolders() != MSG_SUCCESS) {
                MSG_DEBUG("Add Default Folders Fail");
                return MSG_ERR_DB_STORAGE_INIT;
        }
 
        // Add Default Address
-       if (MsgAddDefaultAddress() != MSG_SUCCESS)
-       {
+       if (MsgAddDefaultAddress() != MSG_SUCCESS) {
                MSG_DEBUG("Add Default Address Fail");
                return MSG_ERR_DB_STORAGE_INIT;
        }
@@ -131,303 +126,291 @@ MSG_ERROR_T MsgStoInitDB(bool bSimChanged)
 }
 
 
-MSG_ERROR_T MsgCreateAddressTable()
+msg_error_t MsgCreateConversationTable()
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        char sqlQuery[MAX_QUERY_LEN+1];
 
-       if (!dbHandle.checkTableExist(MSGFW_ADDRESS_TABLE_NAME))
-       {
+       if (!dbHandle.checkTableExist(MSGFW_ADDRESS_TABLE_NAME)) {
                memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
                snprintf(sqlQuery, sizeof(sqlQuery),
-                                               "CREATE TABLE %s ( \
-                                                 ADDRESS_ID INTEGER PRIMARY KEY, \
-                                                 ADDRESS_TYPE INTEGER, \
-                                                 RECIPIENT_TYPE INTEGER, \
-                                                 ADDRESS_VAL TEXT, \
-                                                 CONTACT_ID INTEGER, \
-                                                 DISPLAY_NAME TEXT, \
-                                                 FIRST_NAME TEXT, \
-                                                 LAST_NAME TEXT, \
-                                                 IMAGE_PATH TEXT, \
-                                                 SYNC_TIME DATETIME, \
-                                                 UNREAD_CNT INTEGER DEFAULT 0, \
-                                                 SMS_CNT INTEGER DEFAULT 0, \
-                                                 MMS_CNT INTEGER DEFAULT 0, \
-                                                 MAIN_TYPE INTEGER NOT NULL, \
-                                                 SUB_TYPE INTEGER NOT NULL, \
-                                                 MSG_DIRECTION INTEGER NOT NULL, \
-                                                 MSG_TIME DATETIME, \
-                                                 MSG_TEXT TEXT);",
-                                               MSGFW_ADDRESS_TABLE_NAME);
+                               "CREATE TABLE %s ( \
+                               CONV_ID INTEGER NOT NULL , \
+                               UNREAD_CNT INTEGER DEFAULT 0 , \
+                               SMS_CNT INTEGER DEFAULT 0 , \
+                               MMS_CNT INTEGER DEFAULT 0 , \
+                               MAIN_TYPE INTEGER NOT NULL , \
+                               SUB_TYPE INTEGER NOT NULL , \
+                               MSG_DIRECTION INTEGER NOT NULL , \
+                               DISPLAY_TIME INTEGER , \
+                               DISPLAY_NAME TEXT , \
+                               MSG_TEXT TEXT );",
+                               MSGFW_CONVERSATION_TABLE_NAME);
 
                err = dbHandle.execQuery(sqlQuery);
 
                if (err == MSG_SUCCESS)
-                       MSG_DEBUG("SUCCESS : create %s.", MSGFW_ADDRESS_TABLE_NAME);
+                       MSG_DEBUG("SUCCESS : create %s.", MSGFW_CONVERSATION_TABLE_NAME);
                else
-                       MSG_DEBUG("FAIL : create %s [%d].", MSGFW_ADDRESS_TABLE_NAME, err);
+                       MSG_DEBUG("FAIL : create %s [%d].", MSGFW_CONVERSATION_TABLE_NAME, err);
        }
 
        return err;
 }
 
 
-MSG_ERROR_T MsgCreateFolderTable()
+msg_error_t MsgCreateAddressTable()
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        char sqlQuery[MAX_QUERY_LEN+1];
 
-       if (!dbHandle.checkTableExist(MSGFW_FOLDER_TABLE_NAME))
-       {
+       if (!dbHandle.checkTableExist(MSGFW_ADDRESS_TABLE_NAME)) {
                memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
                snprintf(sqlQuery, sizeof(sqlQuery),
-                                               "CREATE TABLE %s ( \
-                                                 FOLDER_ID INTEGER PRIMARY KEY, \
-                                                 FOLDER_NAME TEXT NOT NULL, \
-                                                 FOLDER_TYPE INTEGER DEFAULT 0);",
-                                                 MSGFW_FOLDER_TABLE_NAME);
+                               "CREATE TABLE %s ( \
+                               ADDRESS_ID INTEGER PRIMARY KEY , \
+                               CONV_ID INTEGER  NOT NULL , \
+                               ADDRESS_TYPE INTEGER , \
+                               RECIPIENT_TYPE INTEGER , \
+                               ADDRESS_VAL TEXT , \
+                               CONTACT_ID INTEGER , \
+                               DISPLAY_NAME TEXT , \
+                               FIRST_NAME TEXT , \
+                               LAST_NAME TEXT , \
+                               IMAGE_PATH TEXT , \
+                               SYNC_TIME DATETIME , \
+                               FOREIGN KEY(CONV_ID) REFERENCES %s (CONV_ID) );",
+                               MSGFW_ADDRESS_TABLE_NAME, MSGFW_CONVERSATION_TABLE_NAME);
 
                err = dbHandle.execQuery(sqlQuery);
 
                if (err == MSG_SUCCESS)
-                       MSG_DEBUG("SUCCESS : create %s.", MSGFW_FOLDER_TABLE_NAME);
+                       MSG_DEBUG("SUCCESS : create %s.", MSGFW_ADDRESS_TABLE_NAME);
                else
-                       MSG_DEBUG("FAIL : create %s [%d].", MSGFW_FOLDER_TABLE_NAME, err);
+                       MSG_DEBUG("FAIL : create %s [%d].", MSGFW_ADDRESS_TABLE_NAME, err);
        }
 
        return err;
 }
 
 
-MSG_ERROR_T MsgCreateMsgTable()
+msg_error_t MsgCreateFolderTable()
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        char sqlQuery[MAX_QUERY_LEN+1];
 
-       if (!dbHandle.checkTableExist(MSGFW_MESSAGE_TABLE_NAME))
-       {
+       if (!dbHandle.checkTableExist(MSGFW_FOLDER_TABLE_NAME)) {
                memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
                snprintf(sqlQuery, sizeof(sqlQuery),
-                                               "CREATE TABLE %s ( \
-                                                 MSG_ID INTEGER PRIMARY KEY, \
-                                                 ADDRESS_ID INTEGER, \
-                                                 FOLDER_ID INTEGER, \
-                                                 REFERENCE_ID INTEGER, \
-                                                 STORAGE_ID INTEGER NOT NULL, \
-                                                 MAIN_TYPE INTEGER NOT NULL, \
-                                                 SUB_TYPE INTEGER NOT NULL, \
-                                                 DISPLAY_TIME DATETIME, \
-                                                 DATA_SIZE INTEGER DEFAULT 0, \
-                                                 NETWORK_STATUS INTEGER DEFAULT 0, \
-                                                 READ_STATUS INTEGER DEFAULT 0, \
-                                                 PROTECTED INTEGER DEFAULT 0, \
-                                                 PRIORITY INTEGER DEFAULT 0, \
-                                                 MSG_DIRECTION INTEGER NOT NULL, \
-                                                 SCHEDULED_TIME DATETIME, \
-                                                 BACKUP INTEGER DEFAULT 0, \
-                                                 SUBJECT TEXT, \
-                                                 MSG_DATA TEXT, \
-                                                 THUMB_PATH TEXT, \
-                                                 MSG_TEXT TEXT, \
-                                                 DELIVERY_REPORT_STATUS INTEGER DEFAULT 0, \
-                                                 DELIVERY_REPORT_TIME DATETIME, \
-                                                 READ_REPORT_STATUS INTEGER DEFAULT 0, \
-                                                 READ_REPORT_TIME DATETIME, \
-                                                 ATTACHMENT_COUNT INTEGER DEFAULT 0, \
-                                                 FOREIGN KEY(ADDRESS_ID) REFERENCES %s(ADDRESS_ID), \
-                                                 FOREIGN KEY(FOLDER_ID) REFERENCES %s(FOLDER_ID) \
-                                                 );",
-                                                 MSGFW_MESSAGE_TABLE_NAME, MSGFW_ADDRESS_TABLE_NAME, MSGFW_FOLDER_TABLE_NAME);
+                               "CREATE TABLE %s ( \
+                               FOLDER_ID INTEGER PRIMARY KEY, \
+                               FOLDER_NAME TEXT NOT NULL, \
+                               FOLDER_TYPE INTEGER DEFAULT 0 );",
+                               MSGFW_FOLDER_TABLE_NAME);
 
                err = dbHandle.execQuery(sqlQuery);
 
                if (err == MSG_SUCCESS)
-                       MSG_DEBUG("SUCCESS : create %s.", MSGFW_MESSAGE_TABLE_NAME);
+                       MSG_DEBUG("SUCCESS : create %s.", MSGFW_FOLDER_TABLE_NAME);
                else
-                       MSG_DEBUG("FAIL : create %s [%d].", MSGFW_MESSAGE_TABLE_NAME, err);
+                       MSG_DEBUG("FAIL : create %s [%d].", MSGFW_FOLDER_TABLE_NAME, err);
        }
 
        return err;
 }
 
 
-MSG_ERROR_T MsgCreateSimMessageTable()
+msg_error_t MsgCreateMsgTable()
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        char sqlQuery[MAX_QUERY_LEN+1];
 
-       if (!dbHandle.checkTableExist(MSGFW_SIM_MSG_TABLE_NAME))
-       {
+       if (!dbHandle.checkTableExist(MSGFW_MESSAGE_TABLE_NAME)) {
                memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
                snprintf(sqlQuery, sizeof(sqlQuery),
-                                               "CREATE TABLE %s ( \
-                                                 MSG_ID INTEGER, \
-                                                 SIM_ID INTEGER NOT NULL, \
-                                                 FOREIGN KEY(MSG_ID) REFERENCES %s(MSG_ID));",
-                                                 MSGFW_SIM_MSG_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME);
+                               "CREATE TABLE %s ( \
+                               MSG_ID INTEGER PRIMARY KEY , \
+                               CONV_ID INTEGER NOT NULL , \
+                               FOLDER_ID INTEGER NOT NULL , \
+                               STORAGE_ID INTEGER NOT NULL , \
+                               MAIN_TYPE INTEGER NOT NULL , \
+                               SUB_TYPE INTEGER NOT NULL , \
+                               DISPLAY_TIME DATETIME , \
+                               DATA_SIZE INTEGER DEFAULT 0 , \
+                               NETWORK_STATUS INTEGER DEFAULT 0 , \
+                               READ_STATUS INTEGER DEFAULT 0 , \
+                               PROTECTED INTEGER DEFAULT 0 , \
+                               PRIORITY INTEGER DEFAULT 0 , \
+                               MSG_DIRECTION INTEGER NOT NULL , \
+                               SCHEDULED_TIME DATETIME , \
+                               BACKUP INTEGER DEFAULT 0 , \
+                               SUBJECT TEXT , \
+                               MSG_DATA TEXT , \
+                               THUMB_PATH TEXT , \
+                               MSG_TEXT TEXT , \
+                               DELIVERY_REPORT_STATUS INTEGER DEFAULT 0 , \
+                               DELIVERY_REPORT_TIME DATETIME , \
+                               READ_REPORT_STATUS INTEGER DEFAULT 0 , \
+                               READ_REPORT_TIME DATETIME , \
+                               ATTACHMENT_COUNT INTEGER DEFAULT 0 , \
+                               FOREIGN KEY(CONV_ID) REFERENCES %s (CONV_ID) , \
+                               FOREIGN KEY(FOLDER_ID) REFERENCES %s (FOLDER_ID) );",
+                               MSGFW_MESSAGE_TABLE_NAME, MSGFW_CONVERSATION_TABLE_NAME, MSGFW_FOLDER_TABLE_NAME);
 
                err = dbHandle.execQuery(sqlQuery);
 
                if (err == MSG_SUCCESS)
-                       MSG_DEBUG("SUCCESS : create %s.", MSGFW_SIM_MSG_TABLE_NAME);
+                       MSG_DEBUG("SUCCESS : create %s.", MSGFW_MESSAGE_TABLE_NAME);
                else
-                       MSG_DEBUG("FAIL : create %s [%d].", MSGFW_SIM_MSG_TABLE_NAME, err);
+                       MSG_DEBUG("FAIL : create %s [%d].", MSGFW_MESSAGE_TABLE_NAME, err);
        }
 
        return err;
 }
 
 
-MSG_ERROR_T MsgCreateWAPMessageTable()
+msg_error_t MsgCreateSimMessageTable()
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        char sqlQuery[MAX_QUERY_LEN+1];
 
-       if (!dbHandle.checkTableExist(MSGFW_PUSH_MSG_TABLE_NAME))
-       {
+       if (!dbHandle.checkTableExist(MSGFW_SIM_MSG_TABLE_NAME)) {
                memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
                snprintf(sqlQuery, sizeof(sqlQuery),
-                                               "CREATE TABLE %s ( \
-                                                 MSG_ID INTEGER, \
-                                                 ACTION INTEGER, \
-                                                 CREATED INTEGER, \
-                                                 EXPIRES INTEGER, \
-                                                 ID TEXT, \
-                                                 HREF TEXT, \
-                                                 CONTENT TEXT, \
-                                                 FOREIGN KEY(MSG_ID) REFERENCES %s(MSG_ID));",
-                                                 MSGFW_PUSH_MSG_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME);
+                               "CREATE TABLE %s ( \
+                               MSG_ID INTEGER , \
+                               SIM_ID INTEGER NOT NULL , \
+                               FOREIGN KEY(MSG_ID) REFERENCES %s (MSG_ID) );",
+                               MSGFW_SIM_MSG_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME);
 
                err = dbHandle.execQuery(sqlQuery);
 
                if (err == MSG_SUCCESS)
-                       MSG_DEBUG("SUCCESS : create %s.", MSGFW_PUSH_MSG_TABLE_NAME);
+                       MSG_DEBUG("SUCCESS : create %s.", MSGFW_SIM_MSG_TABLE_NAME);
                else
-                       MSG_DEBUG("FAIL : create %s [%d].", MSGFW_PUSH_MSG_TABLE_NAME, err);
+                       MSG_DEBUG("FAIL : create %s [%d].", MSGFW_SIM_MSG_TABLE_NAME, err);
        }
 
        return err;
 }
 
 
-MSG_ERROR_T MsgCreateCBMessageTable()
+msg_error_t MsgCreateWAPMessageTable()
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        char sqlQuery[MAX_QUERY_LEN+1];
 
-       if (!dbHandle.checkTableExist(MSGFW_CB_MSG_TABLE_NAME))
-       {
+       if (!dbHandle.checkTableExist(MSGFW_PUSH_MSG_TABLE_NAME)) {
                memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
                snprintf(sqlQuery, sizeof(sqlQuery),
-                                               "CREATE TABLE %s ( \
-                                                 MSG_ID INTEGER, \
-                                                 CB_MSG_ID INTEGER NOT NULL, \
-                                                 FOREIGN KEY(MSG_ID) REFERENCES %s(MSG_ID));",
-                                                 MSGFW_CB_MSG_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME);
+                               "CREATE TABLE %s ( \
+                               MSG_ID INTEGER , \
+                               ACTION INTEGER , \
+                               CREATED INTEGER , \
+                               EXPIRES INTEGER , \
+                               ID TEXT , \
+                               HREF TEXT , \
+                               CONTENT TEXT , \
+                               FOREIGN KEY(MSG_ID) REFERENCES %s(MSG_ID) );",
+                               MSGFW_PUSH_MSG_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME);
 
                err = dbHandle.execQuery(sqlQuery);
 
                if (err == MSG_SUCCESS)
-                       MSG_DEBUG("SUCCESS : create %s.", MSGFW_CB_MSG_TABLE_NAME);
+                       MSG_DEBUG("SUCCESS : create %s.", MSGFW_PUSH_MSG_TABLE_NAME);
                else
-                       MSG_DEBUG("FAIL : create %s [%d].", MSGFW_CB_MSG_TABLE_NAME, err);
+                       MSG_DEBUG("FAIL : create %s [%d].", MSGFW_PUSH_MSG_TABLE_NAME, err);
        }
 
        return err;
 }
 
 
-MSG_ERROR_T MsgCreateSyncMLMessageTable()
+msg_error_t MsgCreateCBMessageTable()
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        char sqlQuery[MAX_QUERY_LEN+1];
 
-       if (!dbHandle.checkTableExist(MSGFW_SYNCML_MSG_TABLE_NAME))
-       {
+       if (!dbHandle.checkTableExist(MSGFW_CB_MSG_TABLE_NAME)) {
                memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
                snprintf(sqlQuery, sizeof(sqlQuery),
-                                               "CREATE TABLE %s ( \
-                                                 MSG_ID INTEGER, \
-                                                 EXT_ID INTEGER NOT NULL, \
-                                                 PINCODE INTEGER NOT NULL, \
-                                                 FOREIGN KEY(MSG_ID) REFERENCES %s(MSG_ID));",
-                                                 MSGFW_SYNCML_MSG_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME);
+                               "CREATE TABLE %s ( \
+                               MSG_ID INTEGER , \
+                               CB_MSG_ID INTEGER NOT NULL , \
+                               FOREIGN KEY(MSG_ID) REFERENCES %s (MSG_ID) );",
+                               MSGFW_CB_MSG_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME);
 
                err = dbHandle.execQuery(sqlQuery);
 
                if (err == MSG_SUCCESS)
-                       MSG_DEBUG("SUCCESS : create %s.", MSGFW_SYNCML_MSG_TABLE_NAME);
+                       MSG_DEBUG("SUCCESS : create %s.", MSGFW_CB_MSG_TABLE_NAME);
                else
-                       MSG_DEBUG("FAIL : create %s [%d].", MSGFW_SYNCML_MSG_TABLE_NAME, err);
+                       MSG_DEBUG("FAIL : create %s [%d].", MSGFW_CB_MSG_TABLE_NAME, err);
        }
 
        return err;
 }
 
 
-MSG_ERROR_T MsgCreateScheduledMessageTable()
+msg_error_t MsgCreateSyncMLMessageTable()
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        char sqlQuery[MAX_QUERY_LEN+1];
 
-       if (!dbHandle.checkTableExist(MSGFW_SCHEDULED_MSG_TABLE_NAME))
-       {
+       if (!dbHandle.checkTableExist(MSGFW_SYNCML_MSG_TABLE_NAME)) {
                memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
                snprintf(sqlQuery, sizeof(sqlQuery),
-                                               "CREATE TABLE %s ( \
-                                                 MSG_ID INTEGER, \
-                                                 ALARM_ID INTEGER NOT NULL, \
-                                                 LISTENER_FD INTEGER NOT NULL, \
-                                                 FOREIGN KEY(MSG_ID) REFERENCES %s(MSG_ID));",
-                                                 MSGFW_SCHEDULED_MSG_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME);
+                               "CREATE TABLE %s ( \
+                               MSG_ID INTEGER , \
+                               EXT_ID INTEGER NOT NULL , \
+                               PINCODE INTEGER NOT NULL , \
+                               FOREIGN KEY(MSG_ID) REFERENCES %s(MSG_ID) );",
+                               MSGFW_SYNCML_MSG_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME);
 
                err = dbHandle.execQuery(sqlQuery);
 
                if (err == MSG_SUCCESS)
-                       MSG_DEBUG("SUCCESS : create %s.", MSGFW_SCHEDULED_MSG_TABLE_NAME);
+                       MSG_DEBUG("SUCCESS : create %s.", MSGFW_SYNCML_MSG_TABLE_NAME);
                else
-                       MSG_DEBUG("FAIL : create %s [%d].", MSGFW_SCHEDULED_MSG_TABLE_NAME, err);
+                       MSG_DEBUG("FAIL : create %s [%d].", MSGFW_SYNCML_MSG_TABLE_NAME, err);
        }
 
        return err;
 }
 
-
-MSG_ERROR_T MsgCreateSmsSendOptTable()
+msg_error_t MsgCreateSmsSendOptTable()
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        char sqlQuery[MAX_QUERY_LEN+1];
 
-       if (!dbHandle.checkTableExist(MSGFW_SMS_SENDOPT_TABLE_NAME))
-       {
+       if (!dbHandle.checkTableExist(MSGFW_SMS_SENDOPT_TABLE_NAME)) {
                memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
                snprintf(sqlQuery, sizeof(sqlQuery),
-                                               "CREATE TABLE %s ( \
-                                                 MSG_ID INTEGER, \
-                                                 DELREP_REQ INTEGER NOT NULL, \
-                                                 KEEP_COPY INTEGER NOT NULL, \
-                                                 REPLY_PATH INTEGER NOT NULL, \
-                                                 FOREIGN KEY(MSG_ID) REFERENCES %s(MSG_ID));",
-                                                 MSGFW_SMS_SENDOPT_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME);
+                               "CREATE TABLE %s ( \
+                               MSG_ID INTEGER , \
+                               DELREP_REQ INTEGER NOT NULL , \
+                               KEEP_COPY INTEGER NOT NULL , \
+                               REPLY_PATH INTEGER NOT NULL , \
+                               FOREIGN KEY(MSG_ID) REFERENCES %s (MSG_ID) );",
+                               MSGFW_SMS_SENDOPT_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME);
 
                err = dbHandle.execQuery(sqlQuery);
 
@@ -441,22 +424,21 @@ MSG_ERROR_T MsgCreateSmsSendOptTable()
 }
 
 
-MSG_ERROR_T MsgCreateFilterTable()
+msg_error_t MsgCreateFilterTable()
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        char sqlQuery[MAX_QUERY_LEN+1];
 
-       if (!dbHandle.checkTableExist(MSGFW_FILTER_TABLE_NAME))
-       {
+       if (!dbHandle.checkTableExist(MSGFW_FILTER_TABLE_NAME)) {
                memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
                snprintf(sqlQuery, sizeof(sqlQuery),
-                                               "CREATE TABLE %s ( \
-                                                 FILTER_ID INTEGER PRIMARY KEY, \
-                                                 FILTER_TYPE INTEGER NOT NULL, \
-                                                 FILTER_VALUE TEXT NOT NULL);",
-                                                 MSGFW_FILTER_TABLE_NAME);
+                               "CREATE TABLE %s ( \
+                               FILTER_ID INTEGER PRIMARY KEY , \
+                               FILTER_TYPE INTEGER NOT NULL , \
+                               FILTER_VALUE TEXT NOT NULL );",
+                               MSGFW_FILTER_TABLE_NAME);
 
                err = dbHandle.execQuery(sqlQuery);
 
@@ -470,26 +452,44 @@ MSG_ERROR_T MsgCreateFilterTable()
 }
 
 
-MSG_ERROR_T MsgCreateMmsMsgTable()
+msg_error_t MsgCreateMmsTable()
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        char sqlQuery[MAX_QUERY_LEN+1];
 
-       if (!dbHandle.checkTableExist(MMS_PLUGIN_MESSAGE_TABLE_NAME))
-       {
+       if (!dbHandle.checkTableExist(MMS_PLUGIN_MESSAGE_TABLE_NAME)) {
                memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
                snprintf(sqlQuery, sizeof(sqlQuery),
-                                               "CREATE TABLE %s ( \
-                                                 MSG_ID INTEGER, \
-                                                 TRANSACTION_ID TEXT, \
-                                                 MESSAGE_ID TEXT, \
-                                                 FWD_MESSAGE_ID TEXT, \
-                                                 CONTENTS_LOCATION TEXT, \
-                                                 FILE_PATH TEXT, \
-                                                 FOREIGN KEY(MSG_ID) REFERENCES %s(MSG_ID));",
-                                                 MMS_PLUGIN_MESSAGE_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME);
+                               "CREATE TABLE %s ( \
+                               MSG_ID INTEGER , \
+                               TRANSACTION_ID TEXT , \
+                               MESSAGE_ID TEXT , \
+                               FWD_MESSAGE_ID TEXT , \
+                               CONTENTS_LOCATION TEXT , \
+                               FILE_PATH TEXT , \
+                               VERSION INTEGER NOT NULL , \
+                               DATA_TYPE INTEGER DEFAULT -1 , \
+                               DATE DATETIME , \
+                               HIDE_ADDRESS INTEGER DEFAULT 0 , \
+                               ASK_DELIVERY_REPORT INTEGER DEFAULT 0 , \
+                               REPORT_ALLOWED INTEGER DEFAULT 0 , \
+                               READ_REPORT_ALLOWED_TYPE INTEGER DEFAULT 0 , \
+                               ASK_READ_REPLY INTEGER DEFAULT 0 , \
+                               READ INTEGER DEFAULT 0 , \
+                               READ_REPORT_SEND_STATUS INTEGER DEFAULT 0 , \
+                               READ_REPORT_SENT INTEGER DEFAULT 0 , \
+                               PRIORITY INTEGER DEFAULT 0 , \
+                               KEEP_COPY INTEGER DEFAULT 0 , \
+                               MSG_SIZE INTEGER NOT NULL , \
+                               MSG_CLASS INTEGER DEFAULT -1 , \
+                               EXPIRY_TIME DATETIME , \
+                               CUSTOM_DELIVERY_TIME INTEGER DEFAULT 0 , \
+                               DELIVERY_TIME DATETIME , \
+                               MSG_STATUS INTEGER DEFAULT -1 , \
+                               FOREIGN KEY(MSG_ID) REFERENCES %s (MSG_ID) );",
+                               MMS_PLUGIN_MESSAGE_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME);
 
                err = dbHandle.execQuery(sqlQuery);
 
@@ -503,54 +503,7 @@ MSG_ERROR_T MsgCreateMmsMsgTable()
 }
 
 
-MSG_ERROR_T MsgCreateMmsAttributeTable()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       char sqlQuery[MAX_QUERY_LEN+1];
-
-       if (!dbHandle.checkTableExist(MMS_PLUGIN_ATTRIBUTE_TABLE_NAME))
-       {
-               memset(sqlQuery, 0x00, sizeof(sqlQuery));
-
-               snprintf(sqlQuery, sizeof(sqlQuery),
-                                               "CREATE TABLE %s ( \
-                                                MSG_ID INTEGER, \
-                                                VERSION INTEGER NOT NULL, \
-                                                DATA_TYPE INTEGER DEFAULT -1, \
-                                                DATE DATETIME, \
-                                                HIDE_ADDRESS INTEGER DEFAULT 0, \
-                                                ASK_DELIVERY_REPORT INTEGER DEFAULT 0, \
-                                                REPORT_ALLOWED INTEGER DEFAULT 0, \
-                                                READ_REPORT_ALLOWED_TYPE INTEGER DEFAULT 0, \
-                                                ASK_READ_REPLY INTEGER DEFAULT 0, \
-                                                READ INTEGER DEFAULT 0, \
-                                                READ_REPORT_SEND_STATUS        INTEGER DEFAULT 0, \
-                                                READ_REPORT_SENT INTEGER DEFAULT 0, \
-                                                PRIORITY INTEGER DEFAULT 0, \
-                                                KEEP_COPY INTEGER DEFAULT 0, \
-                                                MSG_SIZE INTEGER NOT NULL, \
-                                                MSG_CLASS INTEGER DEFAULT -1, \
-                                                EXPIRY_TIME DATETIME, \
-                                                CUSTOM_DELIVERY_TIME INTEGER DEFAULT 0, \
-                                                DELIVERY_TIME DATETIME, \
-                                                MSG_STATUS INTEGER DEFAULT -1, \
-                                                FOREIGN KEY(MSG_ID) REFERENCES %s(MSG_ID));",
-                                                MMS_PLUGIN_ATTRIBUTE_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME);
-
-               err = dbHandle.execQuery(sqlQuery);
-
-               if (err == MSG_SUCCESS)
-                       MSG_DEBUG("SUCCESS : create %s.", MMS_PLUGIN_ATTRIBUTE_TABLE_NAME);
-               else
-                       MSG_DEBUG("FAIL : create %s [%d].", MMS_PLUGIN_ATTRIBUTE_TABLE_NAME, err);
-       }
-
-       return err;
-}
-
-
-MSG_ERROR_T MsgAddDefaultFolders()
+msg_error_t MsgAddDefaultFolders()
 {
        int nRowCnt = 0;
        int nResult = 0;
@@ -560,10 +513,9 @@ MSG_ERROR_T MsgAddDefaultFolders()
        // INBOX
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
        snprintf(sqlQuery, sizeof(sqlQuery), "SELECT COUNT(*) FROM %s WHERE FOLDER_ID = %d;",
-                                       MSGFW_FOLDER_TABLE_NAME, MSG_INBOX_ID);
+                       MSGFW_FOLDER_TABLE_NAME, MSG_INBOX_ID);
 
-       if (dbHandle.getTable(sqlQuery, &nRowCnt) != MSG_SUCCESS)
-       {
+       if (dbHandle.getTable(sqlQuery, &nRowCnt) != MSG_SUCCESS) {
                dbHandle.freeTable();
                return MSG_ERR_DB_GETTABLE;
        }
@@ -572,11 +524,10 @@ MSG_ERROR_T MsgAddDefaultFolders()
 
        dbHandle.freeTable();
 
-       if (nResult == 0)
-       {
+       if (nResult == 0) {
                memset(sqlQuery, 0x00, sizeof(sqlQuery));
                snprintf(sqlQuery, sizeof(sqlQuery), "INSERT INTO %s VALUES (%d, 'INBOX', %d);",
-                                       MSGFW_FOLDER_TABLE_NAME, MSG_INBOX_ID, MSG_FOLDER_TYPE_INBOX);
+                               MSGFW_FOLDER_TABLE_NAME, MSG_INBOX_ID, MSG_FOLDER_TYPE_INBOX);
 
                if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS)
                        return MSG_ERR_DB_EXEC;
@@ -585,10 +536,9 @@ MSG_ERROR_T MsgAddDefaultFolders()
        // OUTBOX
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
        snprintf(sqlQuery, sizeof(sqlQuery), "SELECT COUNT(*) FROM %s WHERE FOLDER_ID = %d;",
-                                       MSGFW_FOLDER_TABLE_NAME, MSG_OUTBOX_ID);
+                       MSGFW_FOLDER_TABLE_NAME, MSG_OUTBOX_ID);
 
-       if (dbHandle.getTable(sqlQuery, &nRowCnt) != MSG_SUCCESS)
-       {
+       if (dbHandle.getTable(sqlQuery, &nRowCnt) != MSG_SUCCESS) {
                dbHandle.freeTable();
                return MSG_ERR_DB_GETTABLE;
        }
@@ -597,11 +547,10 @@ MSG_ERROR_T MsgAddDefaultFolders()
 
        dbHandle.freeTable();
 
-       if (nResult == 0)
-       {
+       if (nResult == 0) {
                memset(sqlQuery, 0x00, sizeof(sqlQuery));
                snprintf(sqlQuery, sizeof(sqlQuery), "INSERT INTO %s VALUES (%d, 'OUTBOX', %d);",
-                                       MSGFW_FOLDER_TABLE_NAME, MSG_OUTBOX_ID, MSG_FOLDER_TYPE_OUTBOX);
+                               MSGFW_FOLDER_TABLE_NAME, MSG_OUTBOX_ID, MSG_FOLDER_TYPE_OUTBOX);
 
                if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS)
                        return MSG_ERR_DB_EXEC;
@@ -610,10 +559,9 @@ MSG_ERROR_T MsgAddDefaultFolders()
        // SENTBOX
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
        snprintf(sqlQuery, sizeof(sqlQuery), "SELECT COUNT(*) FROM %s WHERE FOLDER_ID = %d;",
-                                       MSGFW_FOLDER_TABLE_NAME, MSG_SENTBOX_ID);
+                       MSGFW_FOLDER_TABLE_NAME, MSG_SENTBOX_ID);
 
-       if (dbHandle.getTable(sqlQuery, &nRowCnt) != MSG_SUCCESS)
-       {
+       if (dbHandle.getTable(sqlQuery, &nRowCnt) != MSG_SUCCESS) {
                dbHandle.freeTable();
                return MSG_ERR_DB_GETTABLE;
        }
@@ -622,11 +570,10 @@ MSG_ERROR_T MsgAddDefaultFolders()
 
        dbHandle.freeTable();
 
-       if (nResult == 0)
-       {
+       if (nResult == 0) {
                memset(sqlQuery, 0x00, sizeof(sqlQuery));
                snprintf(sqlQuery, sizeof(sqlQuery), "INSERT INTO %s VALUES (%d, 'SENTBOX', %d);",
-                                       MSGFW_FOLDER_TABLE_NAME, MSG_SENTBOX_ID, MSG_FOLDER_TYPE_OUTBOX);
+                               MSGFW_FOLDER_TABLE_NAME, MSG_SENTBOX_ID, MSG_FOLDER_TYPE_OUTBOX);
 
                if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS)
                        return MSG_ERR_DB_EXEC;
@@ -635,10 +582,9 @@ MSG_ERROR_T MsgAddDefaultFolders()
        // DRAFT
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
        snprintf(sqlQuery, sizeof(sqlQuery), "SELECT COUNT(*) FROM %s WHERE FOLDER_ID = %d;",
-                                       MSGFW_FOLDER_TABLE_NAME, MSG_DRAFT_ID);
+                       MSGFW_FOLDER_TABLE_NAME, MSG_DRAFT_ID);
 
-       if (dbHandle.getTable(sqlQuery, &nRowCnt) != MSG_SUCCESS)
-       {
+       if (dbHandle.getTable(sqlQuery, &nRowCnt) != MSG_SUCCESS) {
                dbHandle.freeTable();
                return MSG_ERR_DB_GETTABLE;
        }
@@ -647,11 +593,10 @@ MSG_ERROR_T MsgAddDefaultFolders()
 
        dbHandle.freeTable();
 
-       if (nResult == 0)
-       {
+       if (nResult == 0) {
                memset(sqlQuery, 0x00, sizeof(sqlQuery));
                snprintf(sqlQuery, sizeof(sqlQuery), "INSERT INTO %s VALUES (%d, 'DRAFT', %d);",
-                                       MSGFW_FOLDER_TABLE_NAME, MSG_DRAFT_ID, MSG_FOLDER_TYPE_DRAFT);
+                               MSGFW_FOLDER_TABLE_NAME, MSG_DRAFT_ID, MSG_FOLDER_TYPE_DRAFT);
 
                if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS)
                        return MSG_ERR_DB_EXEC;
@@ -660,10 +605,9 @@ MSG_ERROR_T MsgAddDefaultFolders()
        // CBMSGBOX
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
        snprintf(sqlQuery, sizeof(sqlQuery), "SELECT COUNT(*) FROM %s WHERE FOLDER_ID = %d;",
-                                       MSGFW_FOLDER_TABLE_NAME, MSG_CBMSGBOX_ID);
+                       MSGFW_FOLDER_TABLE_NAME, MSG_CBMSGBOX_ID);
 
-       if (dbHandle.getTable(sqlQuery, &nRowCnt) != MSG_SUCCESS)
-       {
+       if (dbHandle.getTable(sqlQuery, &nRowCnt) != MSG_SUCCESS) {
                dbHandle.freeTable();
                return MSG_ERR_DB_GETTABLE;
        }
@@ -672,11 +616,79 @@ MSG_ERROR_T MsgAddDefaultFolders()
 
        dbHandle.freeTable();
 
-       if (nResult == 0)
-       {
+       if (nResult == 0) {
                memset(sqlQuery, 0x00, sizeof(sqlQuery));
                snprintf(sqlQuery, sizeof(sqlQuery), "INSERT INTO %s VALUES (%d, 'CBMSGBOX', %d);",
-                                       MSGFW_FOLDER_TABLE_NAME, MSG_CBMSGBOX_ID, MSG_FOLDER_TYPE_INBOX);
+                               MSGFW_FOLDER_TABLE_NAME, MSG_CBMSGBOX_ID, MSG_FOLDER_TYPE_INBOX);
+
+               if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS)
+                       return MSG_ERR_DB_EXEC;
+       }
+
+       // SPAMBOX
+       memset(sqlQuery, 0x00, sizeof(sqlQuery));
+       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT COUNT(*) FROM %s WHERE FOLDER_ID = %d;",
+                       MSGFW_FOLDER_TABLE_NAME, MSG_SPAMBOX_ID);
+
+       if (dbHandle.getTable(sqlQuery, &nRowCnt) != MSG_SUCCESS) {
+               dbHandle.freeTable();
+               return MSG_ERR_DB_GETTABLE;
+       }
+
+       nResult = dbHandle.getColumnToInt(1);
+
+       dbHandle.freeTable();
+
+       if (nResult == 0) {
+               memset(sqlQuery, 0x00, sizeof(sqlQuery));
+               snprintf(sqlQuery, sizeof(sqlQuery), "INSERT INTO %s VALUES (%d, 'SPAMBOX', %d);",
+                               MSGFW_FOLDER_TABLE_NAME, MSG_SPAMBOX_ID, MSG_FOLDER_TYPE_SPAMBOX);
+
+               if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS)
+                       return MSG_ERR_DB_EXEC;
+       }
+
+       // SMS TEMPLATE
+       memset(sqlQuery, 0x00, sizeof(sqlQuery));
+       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT COUNT(*) FROM %s WHERE FOLDER_ID = %d;",
+                       MSGFW_FOLDER_TABLE_NAME, MSG_SMS_TEMPLATE_ID);
+
+       if (dbHandle.getTable(sqlQuery, &nRowCnt) != MSG_SUCCESS) {
+               dbHandle.freeTable();
+               return MSG_ERR_DB_GETTABLE;
+       }
+
+       nResult = dbHandle.getColumnToInt(1);
+
+       dbHandle.freeTable();
+
+       if (nResult == 0) {
+               memset(sqlQuery, 0x00, sizeof(sqlQuery));
+               snprintf(sqlQuery, sizeof(sqlQuery), "INSERT INTO %s VALUES (%d, 'SMS TEMPLATE', %d);",
+                               MSGFW_FOLDER_TABLE_NAME, MSG_SMS_TEMPLATE_ID, MSG_FOLDER_TYPE_TEMPLATE);
+
+               if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS)
+                       return MSG_ERR_DB_EXEC;
+       }
+
+       // MMS TEMPLATE
+       memset(sqlQuery, 0x00, sizeof(sqlQuery));
+       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT COUNT(*) FROM %s WHERE FOLDER_ID = %d;",
+                       MSGFW_FOLDER_TABLE_NAME, MSG_MMS_TEMPLATE_ID);
+
+       if (dbHandle.getTable(sqlQuery, &nRowCnt) != MSG_SUCCESS) {
+               dbHandle.freeTable();
+               return MSG_ERR_DB_GETTABLE;
+       }
+
+       nResult = dbHandle.getColumnToInt(1);
+
+       dbHandle.freeTable();
+
+       if (nResult == 0) {
+               memset(sqlQuery, 0x00, sizeof(sqlQuery));
+               snprintf(sqlQuery, sizeof(sqlQuery), "INSERT INTO %s VALUES (%d, 'MMS TEMPLATE', %d);",
+                               MSGFW_FOLDER_TABLE_NAME, MSG_MMS_TEMPLATE_ID, MSG_FOLDER_TYPE_TEMPLATE);
 
                if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS)
                        return MSG_ERR_DB_EXEC;
@@ -686,7 +698,7 @@ MSG_ERROR_T MsgAddDefaultFolders()
 }
 
 
-MSG_ERROR_T MsgAddDefaultAddress()
+msg_error_t MsgAddDefaultAddress()
 {
        MSG_BEGIN();
 
@@ -696,10 +708,9 @@ MSG_ERROR_T MsgAddDefaultAddress()
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
        snprintf(sqlQuery, sizeof(sqlQuery), "SELECT COUNT(*) FROM %s WHERE ADDRESS_ID = 0;",
-                                       MSGFW_ADDRESS_TABLE_NAME);
+                       MSGFW_ADDRESS_TABLE_NAME);
 
-       if (dbHandle.getTable(sqlQuery, &nRowCnt) != MSG_SUCCESS)
-       {
+       if (dbHandle.getTable(sqlQuery, &nRowCnt) != MSG_SUCCESS) {
                dbHandle.freeTable();
                return MSG_ERR_DB_GETTABLE;
        }
@@ -708,11 +719,10 @@ MSG_ERROR_T MsgAddDefaultAddress()
 
        dbHandle.freeTable();
 
-       if (nResult == 0)
-       {
+       if (nResult == 0) {
                memset(sqlQuery, 0x00, sizeof(sqlQuery));
                snprintf(sqlQuery, sizeof(sqlQuery), "INSERT INTO %s VALUES (0, 0, 0, '', 0, '', '', '', '', 0, 0, 0, 0, 0, 0, 0, 0, '');",
-                                       MSGFW_ADDRESS_TABLE_NAME);
+                               MSGFW_ADDRESS_TABLE_NAME);
 
                MSG_DEBUG("%s", sqlQuery);
 
@@ -726,16 +736,16 @@ MSG_ERROR_T MsgAddDefaultAddress()
 }
 
 
-MSG_ERROR_T MsgStoResetDatabase()
+msg_error_t MsgStoResetDatabase()
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        char sqlQuery[MAX_QUERY_LEN+1];
 
        const char* tableList[] = {MSGFW_FOLDER_TABLE_NAME, MSGFW_FILTER_TABLE_NAME,
-                                               MSGFW_PUSH_MSG_TABLE_NAME, MSGFW_CB_MSG_TABLE_NAME,
-                                               MMS_PLUGIN_MESSAGE_TABLE_NAME, MMS_PLUGIN_ATTRIBUTE_TABLE_NAME,
-                                               MSGFW_SYNCML_MSG_TABLE_NAME, MSGFW_SCHEDULED_MSG_TABLE_NAME, MSGFW_SMS_SENDOPT_TABLE_NAME};
+                       MSGFW_PUSH_MSG_TABLE_NAME, MSGFW_CB_MSG_TABLE_NAME,
+                       MMS_PLUGIN_MESSAGE_TABLE_NAME, MSGFW_SYNCML_MSG_TABLE_NAME,
+                       MSGFW_SMS_SENDOPT_TABLE_NAME};
 
        int listCnt = sizeof(tableList)/sizeof(char*);
 
@@ -747,8 +757,7 @@ MSG_ERROR_T MsgStoResetDatabase()
                memset(sqlQuery, 0x00, sizeof(sqlQuery));
                snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s;", tableList[i]);
 
-               if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS)
-               {
+               if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS) {
                        dbHandle.endTrans(false);
                        return MSG_ERR_DB_EXEC;
                }
@@ -759,32 +768,28 @@ MSG_ERROR_T MsgStoResetDatabase()
        snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE STORAGE_ID <> %d;",
                        MSGFW_MESSAGE_TABLE_NAME, MSG_STORAGE_SIM);
 
-       if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS)
-       {
+       if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS) {
                dbHandle.endTrans(false);
                return MSG_ERR_DB_EXEC;
        }
 
-       // Delete Address Table
-       err = MsgStoClearAddressTable(&dbHandle);
+       // Delete Conversation Table
+       err = MsgStoClearConversationTable(&dbHandle);
 
-       if (err != MSG_SUCCESS)
-       {
+       if (err != MSG_SUCCESS) {
                dbHandle.endTrans(false);
                return err;
        }
 
        // Add Default Folders
-       if (MsgAddDefaultFolders() != MSG_SUCCESS)
-       {
+       if (MsgAddDefaultFolders() != MSG_SUCCESS) {
                MSG_DEBUG("Add Default Folders Fail");
                dbHandle.endTrans(false);
                return MSG_ERR_DB_STORAGE_INIT;
        }
 
        // Add Default Address
-       if (MsgAddDefaultAddress() != MSG_SUCCESS)
-       {
+       if (MsgAddDefaultAddress() != MSG_SUCCESS) {
                MSG_DEBUG("Add Default Address Fail");
                dbHandle.endTrans(false);
                return MSG_ERR_DB_STORAGE_INIT;
@@ -797,18 +802,63 @@ MSG_ERROR_T MsgStoResetDatabase()
        MsgRmRf((char*)MSG_SMIL_FILE_PATH);
 
        // Reset SMS Count
-       if (MsgSettingSetIndicator(0, 0) != MSG_SUCCESS)
-       {
+       if (MsgSettingSetIndicator(0, 0) != MSG_SUCCESS) {
                MSG_DEBUG("MsgSettingSetIndicator() FAILED");
                return MSG_ERR_SET_SETTING;
        }
 
        // Reset MMS Count
-       if (MsgSettingSetIndicator(0, 0) != MSG_SUCCESS)
-       {
+       if (MsgSettingSetIndicator(0, 0) != MSG_SUCCESS) {
                MSG_DEBUG("MsgSettingSetIndicator() FAILED");
                return MSG_ERR_SET_SETTING;
        }
 
        return MSG_SUCCESS;
 }
+
+
+msg_error_t MsgStoBackupMessage()
+{
+       return MSG_SUCCESS;
+}
+
+msg_error_t MsgStoUpdateMms(MSG_MESSAGE_INFO_S *pMsg)
+{
+       char sqlQuery[MAX_QUERY_LEN+1];
+
+       if (pMsg->msgType.subType == MSG_SENDCONF_MMS) {
+               memset(sqlQuery, 0x00, sizeof(sqlQuery));
+
+               dbHandle.beginTrans();
+               snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET THUMB_PATH = ?, MSG_TEXT = ? WHERE MSG_ID = %d;",
+                               MSGFW_MESSAGE_TABLE_NAME, pMsg->msgId);
+
+               if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS) {
+                       dbHandle.endTrans(false);
+                       return MSG_ERR_DB_EXEC;
+               }
+
+
+               dbHandle.bindText(pMsg->thumbPath, 1);
+               dbHandle.bindText(pMsg->msgText, 2);
+               MSG_DEBUG("thumbPath = %s , msgText = %s" , pMsg->thumbPath, pMsg->msgText);
+               MSG_DEBUG("%s", sqlQuery);
+
+               if (dbHandle.stepQuery() != MSG_ERR_DB_DONE) {
+                       dbHandle.finalizeQuery();
+                       dbHandle.endTrans(false);
+                       return MSG_ERR_DB_EXEC;
+               }
+
+               dbHandle.finalizeQuery();
+               dbHandle.endTrans(true);
+       } else {
+               MsgStoUpdateMMSMessage(pMsg);
+       }
+       return MSG_SUCCESS;
+}
+
+msg_error_t MsgStoRestoreMessage()
+{
+       return MSG_SUCCESS;
+}
index 629d207..6630f54 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include <stdio.h>
 #include <string.h>
@@ -44,8 +44,6 @@ using namespace std;
 ==================================================================================================*/
 extern MsgDbHandler dbHandle;
 
-static unsigned int refId = 0;
-
 Mutex delNotiMx;
 CndVar delNoticv;
 bool delNotiRunning = false;
@@ -62,7 +60,7 @@ static gboolean startToDeleteNoti(void *pVoid)
 {
        MSG_BEGIN();
 
-       MSG_MSGID_LIST_S *pMsgIdList = (MSG_MSGID_LIST_S *)pVoid;
+       msg_id_list_s *pMsgIdList = (msg_id_list_s *)pVoid;
 
        MSG_DEBUG("pMsgIdList->nCount [%d]", pMsgIdList->nCount);
 
@@ -102,6 +100,60 @@ static gboolean startToDeleteNoti(void *pVoid)
 }
 
 
+static gboolean startToDeletePhoneLog(void *pVoid)
+{
+       MSG_BEGIN();
+
+       msg_id_list_s *pMsgIdList = (msg_id_list_s *)pVoid;
+
+       MSG_DEBUG("pMsgIdList->nCount [%d]", pMsgIdList->nCount);
+
+       delLogMx.lock();
+
+       while (delLogRunning){
+               delLogcv.wait(delLogMx.pMutex());
+       }
+
+       delLogRunning = true;
+
+       int transBegin = MsgContactSVCBeginTrans();
+
+       for (int i = 0; i < pMsgIdList->nCount; i++) {
+               if (transBegin == 0)
+                       MsgDeletePhoneLog(pMsgIdList->msgIdList[i]);
+
+               /** sleep for moment */
+               if ((i%100 == 0) && (i!=0)) {
+                       if (transBegin == 0) {
+                               MsgContactSVCEndTrans(true);
+                               usleep(70000);
+                       }
+                       transBegin = MsgContactSVCBeginTrans();
+               }
+       }
+
+       if (transBegin == 0)
+               MsgContactSVCEndTrans(true);
+
+       delLogRunning = false;
+
+       delLogcv.signal();
+       delLogMx.unlock();
+
+       // memory free
+       if (pMsgIdList != NULL) {
+               //free peer info list
+               if (pMsgIdList->msgIdList != NULL)
+                       delete [] pMsgIdList->msgIdList;
+
+               delete [] pMsgIdList;
+       }
+
+       MSG_END();
+
+       return FALSE;
+}
+
 static gboolean updateUnreadMsgCount(void *pVoid)
 {
        MSG_BEGIN();
@@ -123,29 +175,48 @@ static gboolean updateUnreadMsgCount(void *pVoid)
 /*==================================================================================================
                                      FUNCTION IMPLEMENTATION
 ==================================================================================================*/
-MSG_ERROR_T MsgStoAddMessage(MSG_MESSAGE_INFO_S *pMsg, MSG_SENDINGOPT_INFO_S *pSendOptInfo, int addrIdx)
+msg_error_t MsgStoAddMessage(MSG_MESSAGE_INFO_S *pMsg, MSG_SENDINGOPT_INFO_S *pSendOptInfo)
 {
        MSG_BEGIN();
 
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        unsigned int rowId = 0;
-       unsigned int addrId = 0;
+       msg_thread_id_t convId = 0;
 
        char sqlQuery[MAX_QUERY_LEN+1];
 
        dbHandle.beginTrans();
 
        if (pMsg->nAddressCnt > 0) {
-               err = MsgStoAddAddress(&dbHandle, &(pMsg->addressList[addrIdx]), &addrId);
+               err = MsgStoAddAddress(&dbHandle, pMsg, &convId);
 
                if (err != MSG_SUCCESS) {
                        dbHandle.endTrans(false);
                        return err;
                }
 
-               pMsg->addressList[addrIdx].threadId = (MSG_THREAD_ID_T)addrId;
+               pMsg->threadId = convId;
+       }
+
+
+       ///////// temporary code for draft message in conversation view.
+       if(convId > 0 && pMsg->folderId == MSG_DRAFT_ID) {
+               memset(sqlQuery, 0x00, sizeof(sqlQuery));
+
+               snprintf(sqlQuery, sizeof(sqlQuery),
+                               "DELETE FROM %s WHERE CONV_ID = %d AND FOLDER_ID = %d;",
+                               MSGFW_MESSAGE_TABLE_NAME, convId, MSG_DRAFT_ID);
+
+               MSG_DEBUG("sqlQuery [%s]", sqlQuery);
+
+               err = dbHandle.execQuery(sqlQuery);
+
+               if (err != MSG_SUCCESS) {
+                       MSG_DEBUG("fail to delete draft messages.");
+               }
        }
+       ////////
 
        err = dbHandle.getRowId(MSGFW_MESSAGE_TABLE_NAME, &rowId);
 
@@ -154,12 +225,7 @@ MSG_ERROR_T MsgStoAddMessage(MSG_MESSAGE_INFO_S *pMsg, MSG_SENDINGOPT_INFO_S *pS
                return err;
        }
 
-       pMsg->msgId = (MSG_MESSAGE_ID_T)rowId;
-
-       if (addrIdx == 0)
-               refId = pMsg->msgId;
-
-       pMsg->referenceId = refId;
+       pMsg->msgId = (msg_message_id_t)rowId;
 
        int fileSize = 0;
 
@@ -178,10 +244,10 @@ MSG_ERROR_T MsgStoAddMessage(MSG_MESSAGE_INFO_S *pMsg, MSG_SENDINGOPT_INFO_S *pS
        // Add Message
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
-       snprintf(sqlQuery, sizeof(sqlQuery), "INSERT INTO %s VALUES (%d, %d, %d, %d, %d, %d, %d, %ld, %d, %d, %d, %d, %d, %d, %ld, %d, ?, ?, ?, ?, %d, 0, %d, 0, 0);",
-                               MSGFW_MESSAGE_TABLE_NAME, rowId, addrId, pMsg->folderId, pMsg->referenceId, pMsg->storageId, pMsg->msgType.mainType, pMsg->msgType.subType,
-                               pMsg->displayTime, pMsg->dataSize, pMsg->networkStatus, pMsg->bRead, pMsg->bProtected, pMsg->priority, pMsg->direction,
-                               pMsg->scheduledTime, pMsg->bBackup, MSG_DELIVERY_REPORT_NONE, MSG_READ_REPORT_NONE);
+       snprintf(sqlQuery, sizeof(sqlQuery), "INSERT INTO %s VALUES (%d, %d, %d, %d, %d, %d, %ld, %d, %d, %d, %d, %d, %d, %ld, %d, ?, ?, ?, ?, %d, 0, %d, 0, 0);",
+                       MSGFW_MESSAGE_TABLE_NAME, rowId, convId, pMsg->folderId, pMsg->storageId, pMsg->msgType.mainType, pMsg->msgType.subType,
+                       pMsg->displayTime, pMsg->dataSize, pMsg->networkStatus, pMsg->bRead, pMsg->bProtected, pMsg->priority, pMsg->direction,
+                       0, pMsg->bBackup, MSG_DELIVERY_REPORT_NONE, MSG_READ_REPORT_NONE);
 
        MSG_DEBUG("QUERY : %s", sqlQuery);
 
@@ -210,7 +276,7 @@ MSG_ERROR_T MsgStoAddMessage(MSG_MESSAGE_INFO_S *pMsg, MSG_SENDINGOPT_INFO_S *pS
        dbHandle.finalizeQuery();
 
        if (pMsg->msgType.subType != MSG_SENDREQ_MMS) {
-               err = MsgStoUpdateAddress(&dbHandle, addrId);
+               err = MsgStoUpdateConversation(&dbHandle, convId);
 
                if (err != MSG_SUCCESS) {
                        dbHandle.endTrans(false);
@@ -260,18 +326,18 @@ MSG_ERROR_T MsgStoAddMessage(MSG_MESSAGE_INFO_S *pMsg, MSG_SENDINGOPT_INFO_S *pS
 }
 
 
-MSG_ERROR_T MsgStoUpdateMessage(MSG_MESSAGE_INFO_S *pMsg, MSG_SENDINGOPT_INFO_S *pSendOptInfo, int addrIdx)
+msg_error_t MsgStoUpdateMessage(MSG_MESSAGE_INFO_S *pMsg, MSG_SENDINGOPT_INFO_S *pSendOptInfo)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        char sqlQuery[MAX_QUERY_LEN+1];
 
-       unsigned int addrId = 0;
+       msg_thread_id_t convId = 0;
 
        dbHandle.beginTrans();
 
        if (pMsg->nAddressCnt > 0) {
-               err = MsgStoAddAddress(&dbHandle, &(pMsg->addressList[addrIdx]), &addrId);
+               err = MsgStoAddAddress(&dbHandle, pMsg, &convId);
 
                if (err != MSG_SUCCESS) {
                        dbHandle.endTrans(false);
@@ -315,7 +381,7 @@ MSG_ERROR_T MsgStoUpdateMessage(MSG_MESSAGE_INFO_S *pMsg, MSG_SENDINGOPT_INFO_S
                                        pSendOptInfo->option.mmsSendOptInfo.deliveryTime.time = (unsigned int)deliveryTime;
                                }
 
-                               pSendOptInfo->option.mmsSendOptInfo.priority = (MSG_PRIORITY_TYPE_T)MsgSettingGetInt(MMS_SEND_PRIORITY);
+                               pSendOptInfo->option.mmsSendOptInfo.priority = (msg_priority_type_t)MsgSettingGetInt(MMS_SEND_PRIORITY);
                        }
                }
        }
@@ -323,12 +389,12 @@ MSG_ERROR_T MsgStoUpdateMessage(MSG_MESSAGE_INFO_S *pMsg, MSG_SENDINGOPT_INFO_S
        // Update Message
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
-       snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET ADDRESS_ID = %d, FOLDER_ID = %d, STORAGE_ID = %d, MAIN_TYPE = %d, SUB_TYPE = %d, \
-                                                               DISPLAY_TIME = %lu, DATA_SIZE = %d, NETWORK_STATUS = %d, READ_STATUS = %d, \
-                                                               PROTECTED = %d, PRIORITY = %d, MSG_DIRECTION = %d, SCHEDULED_TIME = %lu, BACKUP = %d, SUBJECT = ?, MSG_DATA = ?, THUMB_PATH = ?, MSG_TEXT = ? \
-                                                               WHERE MSG_ID = %d;",
-                       MSGFW_MESSAGE_TABLE_NAME, addrId, pMsg->folderId, pMsg->storageId, pMsg->msgType.mainType, pMsg->msgType.subType, pMsg->displayTime, pMsg->dataSize,
-                       pMsg->networkStatus, pMsg->bRead, pMsg->bProtected, pMsg->priority, pMsg->direction, pMsg->scheduledTime, pMsg->bBackup, pMsg->msgId);
+       snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET CONV_ID = %d, FOLDER_ID = %d, STORAGE_ID = %d, MAIN_TYPE = %d, SUB_TYPE = %d, \
+                       DISPLAY_TIME = %lu, DATA_SIZE = %d, NETWORK_STATUS = %d, READ_STATUS = %d, PROTECTED = %d, PRIORITY = %d, MSG_DIRECTION = %d, \
+                       BACKUP = %d, SUBJECT = ?, MSG_DATA = ?, THUMB_PATH = ?, MSG_TEXT = ? \
+                       WHERE MSG_ID = %d;",
+                       MSGFW_MESSAGE_TABLE_NAME, convId, pMsg->folderId, pMsg->storageId, pMsg->msgType.mainType, pMsg->msgType.subType, pMsg->displayTime, pMsg->dataSize,
+                       pMsg->networkStatus, pMsg->bRead, pMsg->bProtected, pMsg->priority, pMsg->direction, pMsg->bBackup, pMsg->msgId);
 
        if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS) {
                dbHandle.endTrans(false);
@@ -359,9 +425,11 @@ MSG_ERROR_T MsgStoUpdateMessage(MSG_MESSAGE_INFO_S *pMsg, MSG_SENDINGOPT_INFO_S
        if (pMsg->msgType.mainType == MSG_SMS_TYPE && pSendOptInfo != NULL) {
                if (pSendOptInfo->bSetting == true) {
                        memset(sqlQuery, 0x00, sizeof(sqlQuery));
-                       snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET DELREP_REQ = %d, KEEP_COPY = %d, REPLY_PATH = %d \
-                                                                               WHERE MSG_ID = %d;",
-                                       MSGFW_SMS_SENDOPT_TABLE_NAME, pSendOptInfo->bDeliverReq, pSendOptInfo->bKeepCopy, pSendOptInfo->option.smsSendOptInfo.bReplyPath, pMsg->msgId);
+                       snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET \
+                                       DELREP_REQ = %d, KEEP_COPY = %d, REPLY_PATH = %d \
+                                       WHERE MSG_ID = %d;",
+                                       MSGFW_SMS_SENDOPT_TABLE_NAME, pSendOptInfo->bDeliverReq,
+                                       pSendOptInfo->bKeepCopy, pSendOptInfo->option.smsSendOptInfo.bReplyPath, pMsg->msgId);
 
                        if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS) {
                                dbHandle.endTrans(false);
@@ -379,14 +447,14 @@ MSG_ERROR_T MsgStoUpdateMessage(MSG_MESSAGE_INFO_S *pMsg, MSG_SENDINGOPT_INFO_S
                }
        }
 
-       err = MsgStoUpdateAddress(&dbHandle, addrId);
+       err = MsgStoUpdateConversation(&dbHandle, convId);
 
        if (err != MSG_SUCCESS) {
                dbHandle.endTrans(false);
                return MSG_ERR_STORAGE_ERROR;
        }
 
-       err = MsgStoClearAddressTable(&dbHandle);
+       err = MsgStoClearConversationTable(&dbHandle);
 
        if (err != MSG_SUCCESS) {
                dbHandle.endTrans(false);
@@ -399,23 +467,21 @@ MSG_ERROR_T MsgStoUpdateMessage(MSG_MESSAGE_INFO_S *pMsg, MSG_SENDINGOPT_INFO_S
 }
 
 
-MSG_ERROR_T MsgStoUpdateReadStatus(MSG_MESSAGE_ID_T MsgId, bool bRead)
+msg_error_t MsgStoUpdateReadStatus(msg_message_id_t msgId, bool bRead)
 {
        char sqlQuery[MAX_QUERY_LEN+1];
 
-       MSG_STORAGE_ID_T storageId;
+       msg_storage_id_t storageId;
 
-       if (MsgStoSetReadStatus(&dbHandle, MsgId, bRead) != MSG_SUCCESS) {
-               MSG_DEBUG("MsgStoUpdateAddress() Error");
+       if (MsgStoSetReadStatus(&dbHandle, msgId, bRead) != MSG_SUCCESS) {
+               MSG_DEBUG("MsgStoSetReadStatus() Error");
                return MSG_ERR_STORAGE_ERROR;
        }
 
        // Get STORAGE_ID
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
-       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT STORAGE_ID \
-                                       FROM %s \
-                                    WHERE MSG_ID = %d;",
-                       MSGFW_MESSAGE_TABLE_NAME, MsgId);
+       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT STORAGE_ID FROM %s WHERE MSG_ID = %d;",
+                       MSGFW_MESSAGE_TABLE_NAME, msgId);
 
        if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS)
                return MSG_ERR_DB_PREPARE;
@@ -443,12 +509,12 @@ MSG_ERROR_T MsgStoUpdateReadStatus(MSG_MESSAGE_ID_T MsgId, bool bRead)
                // Get SIM Msg ID
                memset(sqlQuery, 0x00, sizeof(sqlQuery));
                snprintf(sqlQuery, sizeof(sqlQuery), "SELECT SIM_ID FROM %s WHERE MSG_ID = %d;",
-                                               MSGFW_SIM_MSG_TABLE_NAME, MsgId);
+                               MSGFW_SIM_MSG_TABLE_NAME, msgId);
 
                if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS)
                        return MSG_ERR_DB_PREPARE;
 
-               MSG_SIM_ID_T simId;
+               msg_sim_id_t simId;
 
                while (dbHandle.stepQuery() == MSG_ERR_DB_ROW) {
                        simId = dbHandle.columnInt(0);
@@ -466,27 +532,25 @@ MSG_ERROR_T MsgStoUpdateReadStatus(MSG_MESSAGE_ID_T MsgId, bool bRead)
 }
 
 
-MSG_ERROR_T MsgStoUpdateThreadReadStatus(MSG_THREAD_ID_T ThreadId)
+msg_error_t MsgStoUpdateThreadReadStatus(msg_thread_id_t threadId)
 {
        MSG_BEGIN();
 
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        int rowCnt = 0;
        int index = 1;
-       MSG_MSGID_LIST_S *pUnreadMsgIdList = NULL;
+       msg_id_list_s *pUnreadMsgIdList = NULL;
 
-       pUnreadMsgIdList = (MSG_MSGID_LIST_S *)new char[sizeof(MSG_MSGID_LIST_S)];
-       memset(pUnreadMsgIdList, 0x00, sizeof(MSG_MSGID_LIST_S));
+       pUnreadMsgIdList = (msg_id_list_s *)new char[sizeof(msg_id_list_s)];
+       memset(pUnreadMsgIdList, 0x00, sizeof(msg_id_list_s));
 
        char sqlQuery[MAX_QUERY_LEN+1];
 
        // Get MSG_ID List
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
-       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT MSG_ID \
-                                               FROM %s A \
-                                               WHERE ADDRESS_ID = %d AND READ_STATUS = 0;",
-                                       MSGFW_MESSAGE_TABLE_NAME, ThreadId);
+       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT MSG_ID FROM %s A WHERE CONV_ID = %d AND READ_STATUS = 0;",
+                       MSGFW_MESSAGE_TABLE_NAME, threadId);
 
        err = dbHandle.getTable(sqlQuery, &rowCnt);
 
@@ -499,7 +563,7 @@ MSG_ERROR_T MsgStoUpdateThreadReadStatus(MSG_THREAD_ID_T ThreadId)
 
        MSG_DEBUG("unreadMsgIdList.nCount [%d]", pUnreadMsgIdList->nCount);
 
-       pUnreadMsgIdList->msgIdList = (MSG_MESSAGE_ID_T *)new char[sizeof(MSG_MESSAGE_ID_T) * rowCnt];
+       pUnreadMsgIdList->msgIdList = (msg_message_id_t *)new char[sizeof(msg_message_id_t) * rowCnt];
 
        for (int i = 0; i < rowCnt; i++)
                pUnreadMsgIdList->msgIdList[i] = dbHandle.getColumnToInt(index++);
@@ -509,10 +573,9 @@ MSG_ERROR_T MsgStoUpdateThreadReadStatus(MSG_THREAD_ID_T ThreadId)
 
        // Get sim MSG_ID
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
-       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT MSG_ID \
-                                       FROM %s A \
-                                    WHERE ADDRESS_ID = %d AND READ_STATUS = 0 AND STORAGE_ID = %d;",
-                               MSGFW_MESSAGE_TABLE_NAME, ThreadId, MSG_STORAGE_SIM);
+       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT MSG_ID FROM %s A \
+                       WHERE CONV_ID = %d AND READ_STATUS = 0 AND STORAGE_ID = %d;",
+                       MSGFW_MESSAGE_TABLE_NAME, threadId, MSG_STORAGE_SIM);
 
        rowCnt = 0;
        err = dbHandle.getTable(sqlQuery, &rowCnt);
@@ -531,15 +594,15 @@ MSG_ERROR_T MsgStoUpdateThreadReadStatus(MSG_THREAD_ID_T ThreadId)
        // set read status
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
        snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET READ_STATUS = %d \
-                                       WHERE ADDRESS_ID = %d AND READ_STATUS = 0;",
-                                       MSGFW_MESSAGE_TABLE_NAME, 1, ThreadId);
+                       WHERE CONV_ID = %d AND READ_STATUS = 0;",
+                       MSGFW_MESSAGE_TABLE_NAME, 1, threadId);
 
        if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS)
                return MSG_ERR_DB_EXEC;
 
 
-       if (MsgStoUpdateAddress(&dbHandle, ThreadId) != MSG_SUCCESS) {
-               MSG_DEBUG("MsgStoUpdateAddress() Error");
+       if (MsgStoUpdateConversation(&dbHandle, threadId) != MSG_SUCCESS) {
+               MSG_DEBUG("MsgStoUpdateConversation() Error");
                return MSG_ERR_STORAGE_ERROR;
        }
 
@@ -567,13 +630,13 @@ MSG_ERROR_T MsgStoUpdateThreadReadStatus(MSG_THREAD_ID_T ThreadId)
 }
 
 
-MSG_ERROR_T MsgStoUpdateProtectedStatus(MSG_MESSAGE_ID_T MsgId, bool bProtected)
+msg_error_t MsgStoUpdateProtectedStatus(msg_message_id_t msgId, bool bProtected)
 {
        char sqlQuery[MAX_QUERY_LEN+1];
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
        snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET PROTECTED = %d WHERE MSG_ID = %d;",
-                                       MSGFW_MESSAGE_TABLE_NAME, (int)bProtected, MsgId);
+                       MSGFW_MESSAGE_TABLE_NAME, (int)bProtected, msgId);
 
        if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS)
                return MSG_ERR_DB_EXEC;
@@ -582,33 +645,32 @@ MSG_ERROR_T MsgStoUpdateProtectedStatus(MSG_MESSAGE_ID_T MsgId, bool bProtected)
 }
 
 
-MSG_ERROR_T MsgStoDeleteMessage(MSG_MESSAGE_ID_T MsgId, bool bCheckIndication)
+msg_error_t MsgStoDeleteMessage(msg_message_id_t msgId, bool bCheckIndication)
 {
        MSG_BEGIN();
 
-       MSG_DEBUG("Msg Id : %d", MsgId);
+       MSG_DEBUG("Msg Id : %d", msgId);
 
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        char sqlQuery[MAX_QUERY_LEN+1];
 
        // Get SUB_TYPE, STORAGE_ID
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
-       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT A.MAIN_TYPE, A.SUB_TYPE, A.FOLDER_ID, A.STORAGE_ID, A.READ_STATUS, B.CONTACT_ID, B.ADDRESS_ID \
-                                       FROM %s A, %s B \
-                                    WHERE A.MSG_ID = %d AND A.ADDRESS_ID = B.ADDRESS_ID;",
-                       MSGFW_MESSAGE_TABLE_NAME, MSGFW_ADDRESS_TABLE_NAME, MsgId);
+       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT A.MAIN_TYPE, A.SUB_TYPE, A.FOLDER_ID, A.STORAGE_ID, A.READ_STATUS, B.CONV_ID \
+                       FROM %s A, %s B WHERE A.MSG_ID = %d AND A.CONV_ID = B.CONV_ID;",
+                       MSGFW_MESSAGE_TABLE_NAME, MSGFW_CONVERSATION_TABLE_NAME, msgId);
 
-       if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS)
+       if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS) {
+               MSG_DEBUG("Query Failed [%s]", sqlQuery);
                return MSG_ERR_DB_PREPARE;
+       }
 
        MSG_MESSAGE_TYPE_S msgType;
-       MSG_FOLDER_ID_T folderId;
-       MSG_STORAGE_ID_T storageId;
-       MSG_CONTACT_ID_T contactId;
-
+       msg_folder_id_t folderId;
+       msg_storage_id_t storageId;
+       msg_thread_id_t convId;
        bool bRead;
-       unsigned int addrId;
 
        if (dbHandle.stepQuery() == MSG_ERR_DB_ROW) {
                msgType.mainType = dbHandle.columnInt(0);
@@ -616,10 +678,9 @@ MSG_ERROR_T MsgStoDeleteMessage(MSG_MESSAGE_ID_T MsgId, bool bCheckIndication)
                folderId = dbHandle.columnInt(2);
                storageId = dbHandle.columnInt(3);
                bRead = dbHandle.columnInt(4);
-               contactId = dbHandle.columnInt(5);
-               addrId = dbHandle.columnInt(6);
+               convId = dbHandle.columnInt(5);
 
-               MSG_DEBUG("Main Type:[%d] SubType:[%d] FolderId:[%d] StorageId:[%d] ContactId:[%d] AddressId:[%d]", msgType.mainType, msgType.subType, folderId, storageId, contactId, addrId);
+               MSG_DEBUG("Main Type:[%d] SubType:[%d] FolderId:[%d] StorageId:[%d] ConversationId:[%d]", msgType.mainType, msgType.subType, folderId, storageId, convId);
        } else {
                MSG_DEBUG("MsgStepQuery() Error [%s]", sqlQuery);
 
@@ -644,11 +705,12 @@ MSG_ERROR_T MsgStoDeleteMessage(MSG_MESSAGE_ID_T MsgId, bool bCheckIndication)
        if (storageId == MSG_STORAGE_SIM) {
                // get sim message id
                memset(sqlQuery, 0x00, sizeof(sqlQuery));
-               snprintf(sqlQuery, sizeof(sqlQuery), "SELECT SIM_ID FROM %s WHERE MSG_ID = %d;", MSGFW_SIM_MSG_TABLE_NAME, MsgId);
+               snprintf(sqlQuery, sizeof(sqlQuery), "SELECT SIM_ID FROM %s WHERE MSG_ID = %d;",
+                               MSGFW_SIM_MSG_TABLE_NAME, msgId);
 
                MSG_DEBUG("sqlQuery is [%s]", sqlQuery);
 
-               MSG_SIM_ID_T simMsgId;
+               msg_sim_id_t simMsgId;
 
                if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS) {
                        dbHandle.endTrans(false);
@@ -682,18 +744,11 @@ MSG_ERROR_T MsgStoDeleteMessage(MSG_MESSAGE_ID_T MsgId, bool bCheckIndication)
                dbHandle.finalizeQuery();
        }
 
-       memset(sqlQuery, 0x00, sizeof(sqlQuery));
-       snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;", MSGFW_SCHEDULED_MSG_TABLE_NAME, MsgId);
-
-       // Delete Message from scheduled msg table
-       if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS) {
-               dbHandle.endTrans(false);
-               return MSG_ERR_DB_EXEC;
-       }
-
+       /* each type has to be handled in plug in ? */
        if (msgType.mainType == MSG_SMS_TYPE) {
                memset(sqlQuery, 0x00, sizeof(sqlQuery));
-               snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;", MSGFW_SMS_SENDOPT_TABLE_NAME, MsgId);
+               snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;",
+                               MSGFW_SMS_SENDOPT_TABLE_NAME, msgId);
 
                // Delete SMS Send Option
                if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS) {
@@ -703,7 +758,8 @@ MSG_ERROR_T MsgStoDeleteMessage(MSG_MESSAGE_ID_T MsgId, bool bCheckIndication)
 
                if (msgType.subType == MSG_CB_SMS || msgType.subType == MSG_JAVACB_SMS) {
                        memset(sqlQuery, 0x00, sizeof(sqlQuery));
-                       snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;", MSGFW_CB_MSG_TABLE_NAME, MsgId);
+                       snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;",
+                                       MSGFW_CB_MSG_TABLE_NAME, msgId);
 
                        // Delete Push Message from push table
                        if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS) {
@@ -712,7 +768,8 @@ MSG_ERROR_T MsgStoDeleteMessage(MSG_MESSAGE_ID_T MsgId, bool bCheckIndication)
                        }
                } else if (msgType.subType >= MSG_WAP_SI_SMS && msgType.subType <= MSG_WAP_CO_SMS) {
                        memset(sqlQuery, 0x00, sizeof(sqlQuery));
-                       snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;", MSGFW_PUSH_MSG_TABLE_NAME, MsgId);
+                       snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;",
+                                       MSGFW_PUSH_MSG_TABLE_NAME, msgId);
 
                        // Delete Push Message from push table
                        if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS) {
@@ -721,7 +778,8 @@ MSG_ERROR_T MsgStoDeleteMessage(MSG_MESSAGE_ID_T MsgId, bool bCheckIndication)
                        }
                } else if (msgType.subType == MSG_SYNCML_CP) {
                        memset(sqlQuery, 0x00, sizeof(sqlQuery));
-                       snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;", MSGFW_SYNCML_MSG_TABLE_NAME, MsgId);
+                       snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;",
+                                       MSGFW_SYNCML_MSG_TABLE_NAME, msgId);
 
                        // Delete SyncML Message from syncML table
                        if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS) {
@@ -730,93 +788,66 @@ MSG_ERROR_T MsgStoDeleteMessage(MSG_MESSAGE_ID_T MsgId, bool bCheckIndication)
                        }
                }
        } else if (msgType.mainType == MSG_MMS_TYPE) {
-               //get multiple recipient message count
-               memset(sqlQuery, 0x00, sizeof(sqlQuery));
-               snprintf(sqlQuery, sizeof(sqlQuery), "SELECT MSG_ID FROM %s WHERE REFERENCE_ID IN \
-                                                                       (SELECT REFERENCE_ID FROM %s WHERE MSG_ID = %d);",
-                                               MSGFW_MESSAGE_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME, MsgId);
 
-               int rowCnt = 0;
+               char filePath[MSG_FILEPATH_LEN_MAX] = {0,};
+               char thumbnailpath[MSG_FILEPATH_LEN_MAX] = {0,};
+               char dirPath[MSG_FILEPATH_LEN_MAX]= {0,};
 
-               err = dbHandle.getTable(sqlQuery, &rowCnt);
+               memset(sqlQuery, 0x00, sizeof(sqlQuery));
+               snprintf(sqlQuery, sizeof(sqlQuery), "SELECT FILE_PATH FROM %s WHERE MSG_ID = %d;",
+                               MMS_PLUGIN_MESSAGE_TABLE_NAME, msgId);
 
-               if (err != MSG_SUCCESS) {
-                       dbHandle.freeTable();
-                       return err;
+               if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS) {
+                       dbHandle.endTrans(false);
+                       return MSG_ERR_DB_PREPARE;
                }
 
-               dbHandle.freeTable();
-               MSG_DEBUG("rowCnt = %d", rowCnt);
-
-               if (rowCnt == 1) {
-                       char filePath[MSG_FILEPATH_LEN_MAX] = {0,};
-                       char thumbnailpath[MSG_FILEPATH_LEN_MAX] = {0,};
-                       char dirPath[MSG_FILEPATH_LEN_MAX]= {0,};
-
-                       memset(sqlQuery, 0x00, sizeof(sqlQuery));
-                       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT FILE_PATH FROM %s WHERE REFERENCE_ID IN \
-                                                                       (SELECT REFERENCE_ID FROM %s WHERE MSG_ID = %d);",
-                                                               MMS_PLUGIN_MESSAGE_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME, MsgId);
-
-                       if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS) {
-                               dbHandle.endTrans(false);
-                               return MSG_ERR_DB_PREPARE;
-                       }
+               if (dbHandle.stepQuery() == MSG_ERR_DB_ROW) {
+                       strncpy(filePath, (char *)dbHandle.columnText(0), MSG_FILEPATH_LEN_MAX);
 
-                       if (dbHandle.stepQuery() == MSG_ERR_DB_ROW) {
-                               strncpy(filePath, (char *)dbHandle.columnText(0), MSG_FILEPATH_LEN_MAX);
+                       snprintf(dirPath, MSG_FILEPATH_LEN_MAX, "%s.dir", filePath);
 
-                               snprintf(dirPath, MSG_FILEPATH_LEN_MAX, "%s.dir", filePath);
+                       if (remove(filePath) == -1)
+                               MSG_DEBUG("Fail to delete file [%s]", filePath);
+                       else
+                               MSG_DEBUG("Success to delete file [%s]", filePath);
 
-                               if (remove(filePath) == -1)
-                                       MSG_DEBUG("Fail to delete file [%s]", filePath);
-                               else
-                                       MSG_DEBUG("Success to delete file [%s]", filePath);
+                       MsgRmRf(dirPath);
 
-                               MsgRmRf(dirPath);
-                               rmdir(dirPath);
+                       rmdir(dirPath);
 
-                               // remove thumbnail file
-                               char *fileName = NULL;
-                               fileName = strrchr(filePath, '/');
+                       // remove thumbnail file
+                       char *fileName = NULL;
+                       fileName = strrchr(filePath, '/');
 
-                               snprintf(thumbnailpath, MSG_FILEPATH_LEN_MAX, MSG_THUMBNAIL_PATH"%s.jpg", fileName+1);
-                               if(remove(thumbnailpath) == -1)
-                                       MSG_DEBUG("Fail to delete thumbnail [%s]", thumbnailpath);
-                               else
-                                       MSG_DEBUG("Success to delete thumbnail [%s]", thumbnailpath);
-                       } else {
-                               MSG_DEBUG("MsgStepQuery() Error [%s]", sqlQuery);
-                               dbHandle.finalizeQuery();
-                               dbHandle.endTrans(false);
-                               return MSG_ERR_DB_STEP;
-                       }
+                       snprintf(thumbnailpath, MSG_FILEPATH_LEN_MAX, MSG_THUMBNAIL_PATH"%s.jpg", fileName+1);
+                       if(remove(thumbnailpath) == -1)
+                               MSG_DEBUG("Fail to delete thumbnail [%s]", thumbnailpath);
+                       else
+                               MSG_DEBUG("Success to delete thumbnail [%s]", thumbnailpath);
 
+               } else {
+                       MSG_DEBUG("MsgStepQuery() Error [%s]", sqlQuery);
                        dbHandle.finalizeQuery();
+                       dbHandle.endTrans(false);
+                       return MSG_ERR_DB_STEP;
+               }
 
-                       const char *tableList[] = {MMS_PLUGIN_MESSAGE_TABLE_NAME, MMS_PLUGIN_ATTRIBUTE_TABLE_NAME};
-
-                       int listCnt = sizeof(tableList)/sizeof(char *);
+               dbHandle.finalizeQuery();
 
-                       for (int i = 0; i < listCnt; i++) {
-                               memset(sqlQuery, 0x00, sizeof(sqlQuery));
-                               snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE REFERENCE_ID IN \
-                                                                       (SELECT REFERENCE_ID FROM %s WHERE MSG_ID = %d);",
-                                                                               tableList[i], MSGFW_MESSAGE_TABLE_NAME, MsgId);
+               memset(sqlQuery, 0x00, sizeof(sqlQuery));
+               snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;",
+                               MMS_PLUGIN_MESSAGE_TABLE_NAME, msgId);
 
-                               // Delete Data from MMS table
-                               if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS) {
-                                       dbHandle.endTrans(false);
-                                       return MSG_ERR_DB_EXEC;
-                               }
-                       }
-               } else {
-                       MSG_DEBUG("There is more multi-recipient mms. MMS DB table is not destroyed");
+               // Delete Data from MMS table
+               if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS) {
+                       dbHandle.endTrans(false);
+                       return MSG_ERR_DB_EXEC;
                }
        }
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
-       snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;", MSGFW_MESSAGE_TABLE_NAME, MsgId);
+       snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;", MSGFW_MESSAGE_TABLE_NAME, msgId);
 
        // Delete Message from msg table
        if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS) {
@@ -824,14 +855,14 @@ MSG_ERROR_T MsgStoDeleteMessage(MSG_MESSAGE_ID_T MsgId, bool bCheckIndication)
                return MSG_ERR_DB_EXEC;
        }
 
-       // Clear Address table
-       if (MsgStoClearAddressTable(&dbHandle) != MSG_SUCCESS) {
+       // Clear Conversation table
+       if (MsgStoClearConversationTable(&dbHandle) != MSG_SUCCESS) {
                dbHandle.endTrans(false);
                return MSG_ERR_DB_EXEC;
        }
 
-       // Update Address Info.
-       if (MsgStoUpdateAddress(&dbHandle, addrId) != MSG_SUCCESS) {
+       // Update conversation table.
+       if (MsgStoUpdateConversation(&dbHandle, convId) != MSG_SUCCESS) {
                dbHandle.endTrans(false);
                return MSG_ERR_STORAGE_ERROR;
        }
@@ -860,37 +891,36 @@ MSG_ERROR_T MsgStoDeleteMessage(MSG_MESSAGE_ID_T MsgId, bool bCheckIndication)
 
                MsgSettingSetIndicator(smsCnt, mmsCnt);
 
-               MsgDeleteNotiByMsgId(MsgId);
+               MsgDeleteNotiByMsgId(msgId);
        }
 
+       //Delete phone log
+       MsgDeletePhoneLog(msgId);
+
        return MSG_SUCCESS;
 }
 
 
-MSG_ERROR_T MsgStoDeleteAllMessageInFolder(MSG_FOLDER_ID_T FolderId, bool bOnlyDB, MSG_MSGID_LIST_S *pMsgIdList)
+msg_error_t MsgStoDeleteAllMessageInFolder(msg_folder_id_t folderId, bool bOnlyDB, msg_id_list_s *pMsgIdList)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        char sqlQuery[MAX_QUERY_LEN+1];
 
-       queue<MSG_THREAD_ID_T> threadList;
+       queue<msg_thread_id_t> threadList;
 
        const char *tableList[] = {MSGFW_PUSH_MSG_TABLE_NAME, MSGFW_CB_MSG_TABLE_NAME,
-                                               MSGFW_SYNCML_MSG_TABLE_NAME, MSGFW_SCHEDULED_MSG_TABLE_NAME,
-                                               MSGFW_SMS_SENDOPT_TABLE_NAME, MMS_PLUGIN_MESSAGE_TABLE_NAME,
-                                               MSGFW_MESSAGE_TABLE_NAME};
+                                               MSGFW_SYNCML_MSG_TABLE_NAME, MSGFW_SMS_SENDOPT_TABLE_NAME, 
+                                               MMS_PLUGIN_MESSAGE_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME};
 
        int listCnt = sizeof(tableList)/sizeof(char *);
        int rowCnt = 0;
 
-       // Get Address ID in Folder
+       // Get conversation ID from Folder
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
-       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT DISTINCT(B.ADDRESS_ID) \
-                                       FROM %s A, %s B \
-                                    WHERE A.ADDRESS_ID = B.ADDRESS_ID \
-                                         AND A.FOLDER_ID = %d",
-                       MSGFW_MESSAGE_TABLE_NAME, MSGFW_ADDRESS_TABLE_NAME, FolderId);
+       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT DISTINCT(CONV_ID) FROM %s WHERE FOLDER_ID = %d",
+                       MSGFW_MESSAGE_TABLE_NAME, folderId);
 
        err = dbHandle.getTable(sqlQuery, &rowCnt);
 
@@ -909,19 +939,19 @@ MSG_ERROR_T MsgStoDeleteAllMessageInFolder(MSG_FOLDER_ID_T FolderId, bool bOnlyD
 
        for (int i = 1; i <= rowCnt; i++) {
                MSG_DEBUG("thread ID : %d", dbHandle.getColumnToInt(i));
-               threadList.push((MSG_THREAD_ID_T)dbHandle.getColumnToInt(i));
+               threadList.push((msg_thread_id_t)dbHandle.getColumnToInt(i));
        }
 
        dbHandle.freeTable();
 
        /*** Get msg id list **/
-       MSG_MSGID_LIST_S *pToDeleteMsgIdList = NULL;
-       pToDeleteMsgIdList = (MSG_MSGID_LIST_S *)new char[sizeof(MSG_MSGID_LIST_S)];
-       memset(pToDeleteMsgIdList, 0x00, sizeof(MSG_MSGID_LIST_S));
+       msg_id_list_s *pToDeleteMsgIdList = NULL;
+       pToDeleteMsgIdList = (msg_id_list_s *)new char[sizeof(msg_id_list_s)];
+       memset(pToDeleteMsgIdList, 0x00, sizeof(msg_id_list_s));
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
        snprintf(sqlQuery, sizeof(sqlQuery), "SELECT MSG_ID FROM %s WHERE FOLDER_ID = %d",
-                       MSGFW_MESSAGE_TABLE_NAME, FolderId);
+                       MSGFW_MESSAGE_TABLE_NAME, folderId);
 
        rowCnt = 0;
        int index = 1;
@@ -947,7 +977,7 @@ MSG_ERROR_T MsgStoDeleteAllMessageInFolder(MSG_FOLDER_ID_T FolderId, bool bOnlyD
 
        MSG_DEBUG("pToDeleteMsgIdList->nCount [%d]", pToDeleteMsgIdList->nCount);
 
-       pToDeleteMsgIdList->msgIdList = (MSG_MESSAGE_ID_T *)new char[sizeof(MSG_MESSAGE_ID_T) * rowCnt];
+       pToDeleteMsgIdList->msgIdList = (msg_message_id_t *)new char[sizeof(msg_message_id_t) * rowCnt];
 
        for (int i = 0; i < rowCnt; i++)
                pToDeleteMsgIdList->msgIdList[i] = dbHandle.getColumnToInt(index++);
@@ -956,12 +986,11 @@ MSG_ERROR_T MsgStoDeleteAllMessageInFolder(MSG_FOLDER_ID_T FolderId, bool bOnlyD
        /*** **/
 
        /*** Delete Sim Message In Folder **/
-       if (FolderId >= MSG_INBOX_ID) {
+       if (folderId >= MSG_INBOX_ID) {
                memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
-               snprintf(sqlQuery, sizeof(sqlQuery), "SELECT MSG_ID FROM %s \
-                                            WHERE FOLDER_ID = %d AND STORAGE_ID = %d",
-                               MSGFW_MESSAGE_TABLE_NAME, FolderId, MSG_STORAGE_SIM);
+               snprintf(sqlQuery, sizeof(sqlQuery), "SELECT MSG_ID FROM %s WHERE FOLDER_ID = %d AND STORAGE_ID = %d",
+                               MSGFW_MESSAGE_TABLE_NAME, folderId, MSG_STORAGE_SIM);
 
                MSG_DEBUG("sql query is %s.", sqlQuery);
 
@@ -985,6 +1014,9 @@ MSG_ERROR_T MsgStoDeleteAllMessageInFolder(MSG_FOLDER_ID_T FolderId, bool bOnlyD
 
                                goto FREE_MEMORY;
                        }
+
+                       //Delete phone log
+                       MsgDeletePhoneLog(dbHandle.getColumnToInt(i));
                }
 
                dbHandle.freeTable();
@@ -994,16 +1026,18 @@ MSG_ERROR_T MsgStoDeleteAllMessageInFolder(MSG_FOLDER_ID_T FolderId, bool bOnlyD
 
        for (int i = 0; i < listCnt; i++) {
                if (!strcmp(tableList[i], MMS_PLUGIN_MESSAGE_TABLE_NAME)) {
-                       //MMS_PLUGIN_MESSAGE_TABLE and MMS_PLUGIN_ATTRIBUTE_TABLE will be updated together
+
                        int rowCnt = 0;
-                       int msgCnt = 0;
-                       int index = 2;
+
+                       char filePath[MSG_FILEPATH_LEN_MAX] = {0,};
+                       char dirPath[MSG_FILEPATH_LEN_MAX] = {0,};
+                       char thumbnailPath[MSG_FILEPATH_LEN_MAX] = {0,};
 
                        //get mms msg id list
                        memset(sqlQuery, 0x00, sizeof(sqlQuery));
-                       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT MSG_ID, REFERENCE_ID FROM %s \
-                                                               WHERE FOLDER_ID = %d AND MAIN_TYPE = %d",
-                                                               MSGFW_MESSAGE_TABLE_NAME, FolderId, MSG_MMS_TYPE);
+                       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT B.FILE_PATH FROM %s A, %s B \
+                                       WHERE A.FOLDER_ID = %d AND A.MAIN_TYPE = %d AND A.MSG_ID = B.MSG_ID",
+                                       MSGFW_MESSAGE_TABLE_NAME, MMS_PLUGIN_MESSAGE_TABLE_NAME, folderId, MSG_MMS_TYPE);
 
                        MSG_DEBUG("sqlQuery [%s]", sqlQuery);
 
@@ -1020,150 +1054,58 @@ MSG_ERROR_T MsgStoDeleteAllMessageInFolder(MSG_FOLDER_ID_T FolderId, bool bOnlyD
                        }
 
                        for (int i = 1; i <= rowCnt; i++) {
-                               int msgId = 0;
-                               int refId = 0;
-
-                               msgId = dbHandle.getColumnToInt(index++);
-                               refId = dbHandle.getColumnToInt(index++);
-
-                               //get multiple recipient message count
-                               memset(sqlQuery, 0x00, sizeof(sqlQuery));
-                               snprintf(sqlQuery, sizeof(sqlQuery), "SELECT COUNT(MSG_ID) FROM %s WHERE REFERENCE_ID = %d;",
-                                                               MSGFW_MESSAGE_TABLE_NAME, refId);
-
-                               if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS) {
-                                       dbHandle.freeTable();
-                                       dbHandle.endTrans(false);
-                                       err = MSG_ERR_DB_PREPARE;
-
-                                       goto FREE_MEMORY;
-                               }
-
-                               msgCnt = 0;
-
-                               if (dbHandle.stepQuery() == MSG_ERR_DB_ROW) {
-                                       msgCnt = dbHandle.columnInt(0);
-                               } else {
-                                       dbHandle.finalizeQuery();
-                                       dbHandle.freeTable();
-                                       dbHandle.endTrans(false);
-                                       err = MSG_ERR_DB_STEP;
-
-                                       goto FREE_MEMORY;
-                               }
-
-                               dbHandle.finalizeQuery();
-
-                               //delete mms raw file and db(mms_table and mms_attr_table) data
-                               if (msgCnt == 1) {
-                                       char filePath[MSG_FILEPATH_LEN_MAX] = {0,};
-                                       char dirPath[MSG_FILEPATH_LEN_MAX] = {0,};
-                                       char thumbnailPath[MSG_FILEPATH_LEN_MAX] = {0,};
-
-                                       //get raw file_path
-                                       memset(sqlQuery, 0x00, sizeof(sqlQuery));
-                                       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT FILE_PATH FROM %s WHERE REFERENCE_ID = %d;",
-                                                                               MMS_PLUGIN_MESSAGE_TABLE_NAME, refId);
-
-                                       MSG_DEBUG("sqlQuery [%s]", sqlQuery);
-                                       if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS) {
-                                               dbHandle.freeTable();
-                                               dbHandle.endTrans(false);
-                                               err = MSG_ERR_DB_PREPARE;
-
-                                               goto FREE_MEMORY;
-                                       }
-
-                                       if (dbHandle.stepQuery() == MSG_ERR_DB_ROW) {
-                                               strncpy(filePath, (char *)dbHandle.columnText(0), MSG_FILEPATH_LEN_MAX);
-                                       } else {
-                                               dbHandle.finalizeQuery();
-                                               dbHandle.freeTable();
-                                               dbHandle.endTrans(false);
-                                               err = MSG_ERR_DB_STEP;
-
-                                               goto FREE_MEMORY;
-                                       }
-
-                                       dbHandle.finalizeQuery();
-
-                                       MSG_DEBUG("filePath [%s]", filePath);
 
-                                       //delete raw file
-                                       snprintf(dirPath, sizeof(dirPath), "%s.dir", filePath);
+                               memset(filePath, 0x00, sizeof(filePath));
+                               dbHandle.getColumnToString(i, MSG_FILEPATH_LEN_MAX, filePath);
 
-                                       if (remove(filePath) == -1)
-                                               MSG_DEBUG("Fail to delete file [%s]", filePath);
-                                       else
-                                               MSG_DEBUG("Success to delete file [%s]", filePath);
+                               MSG_DEBUG("filePath [%s]", filePath);
 
-                                       MsgRmRf(dirPath);
-                                       rmdir(dirPath);
-                                       // delete thumbanil
+                               //delete raw file
+                               snprintf(dirPath, sizeof(dirPath), "%s.dir", filePath);
 
-                                       char *fileName = NULL;
-                                       fileName = strrchr(filePath, '/');
-
-                                       snprintf(thumbnailPath, sizeof(thumbnailPath), MSG_THUMBNAIL_PATH"%s.jpg", fileName+1);
-
-                                       if (remove(thumbnailPath) == -1)
-                                               MSG_DEBUG("Fail to delete thumbnail [%s]", thumbnailPath);
-                                       else
-                                               MSG_DEBUG("Success to delete thumbnail [%s]", thumbnailPath);
+                               if (remove(filePath) == -1)
+                                       MSG_DEBUG("Fail to delete file [%s]", filePath);
+                               else
+                                       MSG_DEBUG("Success to delete file [%s]", filePath);
 
-                                       //delete MMS_PLUGIN_MESSAGE_TABLE_NAME table data
-                                       memset(sqlQuery, 0x00, sizeof(sqlQuery));
-                                       snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE REFERENCE_ID = %d;",
-                                                                               MMS_PLUGIN_MESSAGE_TABLE_NAME, refId);
+                               MsgRmRf(dirPath);
 
-                                       if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS) {
-                                               MSG_DEBUG("sqlQuery [%s]", sqlQuery);
-                                               dbHandle.freeTable();
-                                               dbHandle.endTrans(false);
-                                               err = MSG_ERR_DB_EXEC;
+                               rmdir(dirPath);
+                               // delete thumbnail
 
-                                               goto FREE_MEMORY;
-                                       }
+                               char *fileName = NULL;
+                               fileName = strrchr(filePath, '/');
 
-                                       //delete  MMS_PLUGIN_ATTRIBUTE_TABLE_NAME table data
-                                       memset(sqlQuery, 0x00, sizeof(sqlQuery));
-                                       snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE REFERENCE_ID = %d;",
-                                                                               MMS_PLUGIN_ATTRIBUTE_TABLE_NAME, refId);
+                               snprintf(thumbnailPath, sizeof(thumbnailPath), MSG_THUMBNAIL_PATH"%s.jpg", fileName+1);
 
-                                       if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS) {
-                                               MSG_DEBUG("sqlQuery [%s]", sqlQuery);
-                                               dbHandle.freeTable();
-                                               dbHandle.endTrans(false);
-                                               err = MSG_ERR_DB_EXEC;
+                               if (remove(thumbnailPath) == -1)
+                                       MSG_DEBUG("Fail to delete thumbnail [%s]", thumbnailPath);
+                               else
+                                       MSG_DEBUG("Success to delete thumbnail [%s]", thumbnailPath);
 
-                                               goto FREE_MEMORY;
-                                       }
-                               } else {
-                                       MSG_DEBUG("There is remained multi-recipient mms for this msg = %d", msgId);
-                               }
                        }
 
                        dbHandle.freeTable();
-               } else {
-                       memset(sqlQuery, 0x00, sizeof(sqlQuery));
+               }
 
-                       snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID IN \
-                                                               (SELECT MSG_ID FROM %s WHERE FOLDER_ID = %d);",
-                                                               tableList[i], MSGFW_MESSAGE_TABLE_NAME, FolderId);
+               memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
-                       // Delete Message in specific folder from table
-                       if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS) {
-                               MSG_DEBUG("sqlQuery [%s]", sqlQuery);
-                               dbHandle.endTrans(false);
-                               err = MSG_ERR_DB_EXEC;
+               snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID IN \
+                               (SELECT MSG_ID FROM %s WHERE FOLDER_ID = %d);",
+                               tableList[i], MSGFW_MESSAGE_TABLE_NAME, folderId);
 
-                               goto FREE_MEMORY;
-                       }
+               // Delete Message in specific folder from table
+               if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS) {
+                       MSG_DEBUG("sqlQuery [%s]", sqlQuery);
+                       dbHandle.endTrans(false);
+                       err = MSG_ERR_DB_EXEC;
+
+                       goto FREE_MEMORY;
                }
        }
 
-       // Clear Address table
-       if (MsgStoClearAddressTable(&dbHandle) != MSG_SUCCESS) {
+       // Clear Conversation table
+       if (MsgStoClearConversationTable(&dbHandle) != MSG_SUCCESS) {
                dbHandle.endTrans(false);
                err = MSG_ERR_DB_EXEC;
 
@@ -1172,7 +1114,7 @@ MSG_ERROR_T MsgStoDeleteAllMessageInFolder(MSG_FOLDER_ID_T FolderId, bool bOnlyD
 
        // Update Address
        while (!threadList.empty()) {
-               err = MsgStoUpdateAddress(&dbHandle, threadList.front());
+               err = MsgStoUpdateConversation(&dbHandle, threadList.front());
 
                threadList.pop();
 
@@ -1185,7 +1127,7 @@ MSG_ERROR_T MsgStoDeleteAllMessageInFolder(MSG_FOLDER_ID_T FolderId, bool bOnlyD
 
        dbHandle.endTrans(true);
 
-       if (FolderId == MSG_INBOX_ID) {
+       if (folderId == MSG_INBOX_ID) {
                int smsCnt = 0;
                int mmsCnt = 0;
 
@@ -1199,15 +1141,24 @@ MSG_ERROR_T MsgStoDeleteAllMessageInFolder(MSG_FOLDER_ID_T FolderId, bool bOnlyD
        if (pMsgIdList != NULL && pToDeleteMsgIdList->nCount > 0) {
                pMsgIdList->nCount = pToDeleteMsgIdList->nCount;
 
-               pMsgIdList->msgIdList = (MSG_MESSAGE_ID_T *)new char[sizeof(MSG_MESSAGE_ID_T)*pToDeleteMsgIdList->nCount];
-               memcpy(pMsgIdList->msgIdList, pToDeleteMsgIdList->msgIdList, sizeof(MSG_MESSAGE_ID_T)*pToDeleteMsgIdList->nCount);
+               pMsgIdList->msgIdList = (msg_message_id_t *)new char[sizeof(msg_message_id_t)*pToDeleteMsgIdList->nCount];
+               memcpy(pMsgIdList->msgIdList, pToDeleteMsgIdList->msgIdList, sizeof(msg_message_id_t)*pToDeleteMsgIdList->nCount);
        }
 /*** **/
 
-/*** Create thread  for noti delete. **/
+/*** Create thread  for noti and phone log delete. **/
        if (!bOnlyDB) {
                if (pToDeleteMsgIdList->nCount > 0) {
 
+                       msg_id_list_s *pToDeleteMsgIdListCpy = NULL;
+                       pToDeleteMsgIdListCpy = (msg_id_list_s *)new char[sizeof(msg_id_list_s)];
+                       memset(pToDeleteMsgIdListCpy, 0x00, sizeof(msg_id_list_s));
+
+                       pToDeleteMsgIdListCpy->nCount = pToDeleteMsgIdList->nCount;
+
+                       pToDeleteMsgIdListCpy->msgIdList = (msg_message_id_t *)new char[sizeof(msg_message_id_t)*pToDeleteMsgIdList->nCount];
+                       memcpy(pToDeleteMsgIdListCpy->msgIdList, pToDeleteMsgIdList->msgIdList, sizeof(msg_message_id_t)*pToDeleteMsgIdList->nCount);
+
                        if (g_idle_add(startToDeleteNoti, (void *)pToDeleteMsgIdList) == 0) {
                                MSG_DEBUG("startToDeleteNoti not invoked: %s", strerror(errno));
                                // memory free
@@ -1220,6 +1171,19 @@ MSG_ERROR_T MsgStoDeleteAllMessageInFolder(MSG_FOLDER_ID_T FolderId, bool bOnlyD
                                }
                                err = MSG_ERR_UNKNOWN;
                        }
+
+                       if (g_idle_add(startToDeletePhoneLog, (void *)pToDeleteMsgIdListCpy) == 0) {
+                               MSG_DEBUG("startToDeletePhoneLog not invoked: %s", strerror(errno));
+                               // memory free
+                               if (pToDeleteMsgIdListCpy != NULL) {
+                                       //free peer info list
+                                       if (pToDeleteMsgIdListCpy->msgIdList != NULL)
+                                               delete [] pToDeleteMsgIdListCpy->msgIdList;
+
+                                       delete [] pToDeleteMsgIdListCpy;
+                               }
+                               err = MSG_ERR_UNKNOWN;
+                       }
                }
        }
 /*** **/
@@ -1248,70 +1212,68 @@ FREE_MEMORY:
 }
 
 
-MSG_ERROR_T MsgStoMoveMessageToFolder(MSG_MESSAGE_ID_T MsgId, MSG_FOLDER_ID_T DestFolderId)
+msg_error_t MsgStoMoveMessageToFolder(msg_message_id_t msgId, msg_folder_id_t destFolderId)
 {
        MSG_MESSAGE_TYPE_S msgType;
+       msg_thread_id_t convId;
 
-       MsgStoGetMsgType(MsgId, &msgType);
+       MsgStoGetMsgType(msgId, &msgType);
 
        char sqlQuery[MAX_QUERY_LEN+1];
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
-       if (msgType.mainType == MSG_SMS_TYPE) {
-               snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET FOLDER_ID = %d WHERE MSG_ID = %d;",
-                                       MSGFW_MESSAGE_TABLE_NAME, DestFolderId, MsgId);
-       } else {
-               snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET FOLDER_ID = %d WHERE REFERENCE_ID = %d;",
-                                       MSGFW_MESSAGE_TABLE_NAME, DestFolderId, MsgId);
-       }
+       if (msgType.mainType == MSG_SMS_TYPE)
+               snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET FOLDER_ID = %d WHERE MSG_ID = %d;", MSGFW_MESSAGE_TABLE_NAME, destFolderId, msgId);
+       else
+               snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET FOLDER_ID = %d WHERE MSG_ID = %d;", MSGFW_MESSAGE_TABLE_NAME, destFolderId, msgId);
 
        if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS)
                return MSG_ERR_DB_EXEC;
 
-       unsigned int addrId = 0;
-       /* get address id */
+       /* get conversation id */
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
-       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT ADDRESS_ID FROM %s WHERE MSG_ID = %d;",
-                                                       MSGFW_MESSAGE_TABLE_NAME, MsgId);
+       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT CONV_ID FROM %s WHERE MSG_ID = %d;",
+                                                       MSGFW_MESSAGE_TABLE_NAME, msgId);
 
        if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS)
                return MSG_ERR_DB_PREPARE;
 
-       if (dbHandle.stepQuery() == MSG_ERR_DB_ROW) {
-               addrId = dbHandle.columnInt(0);
-       }
-       MSG_DEBUG("addrId : %d",  addrId);
+       if (dbHandle.stepQuery() == MSG_ERR_DB_ROW)
+               convId = dbHandle.columnInt(0);
+
+       MSG_DEBUG("convId : %d",  convId);
 
        dbHandle.finalizeQuery();
 
-       /* update address table */
-       MsgStoUpdateAddress(&dbHandle, addrId);
+       /* update conversation table */
+       MsgStoUpdateConversation(&dbHandle, convId);
 
        return MSG_SUCCESS;
 }
 
 
-MSG_ERROR_T MsgStoMoveMessageToStorage(MSG_MESSAGE_ID_T MsgId, MSG_STORAGE_ID_T DestStorageId)
+msg_error_t MsgStoMoveMessageToStorage(msg_message_id_t msgId, msg_storage_id_t destStorageId)
 {
        MSG_BEGIN();
 
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        char sqlQuery[MAX_QUERY_LEN+1];
 
-       MSG_DEBUG("MsgId : %d, DestStorageId : %d", MsgId, DestStorageId);
+       MSG_DEBUG("msgId : %d, destStorageId : %d", msgId, destStorageId);
 
-       switch (DestStorageId) {
+       switch (destStorageId) {
        case MSG_STORAGE_SIM : // Move message to sim card
                {
                        MSG_MESSAGE_INFO_S msgInfo;
                        SMS_SIM_ID_LIST_S simIdList;
 
+                       memset(&msgInfo, 0x00, sizeof(MSG_MESSAGE_INFO_S));
                        memset(&simIdList, 0x00, sizeof(SMS_SIM_ID_LIST_S));
 
-                       if ((err = MsgStoGetMessage(MsgId, &msgInfo, NULL)) != MSG_SUCCESS)
+                       if ((err = MsgStoGetMessage(msgId, &msgInfo, NULL)) != MSG_SUCCESS)
                                return err;
 
                        MsgPlugin *plg = MsgPluginManager::instance()->getPlugin(MSG_SMS_TYPE);
@@ -1323,7 +1285,7 @@ MSG_ERROR_T MsgStoMoveMessageToStorage(MSG_MESSAGE_ID_T MsgId, MSG_STORAGE_ID_T
 
                        memset(sqlQuery, 0x00, sizeof(sqlQuery));
                        snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET STORAGE_ID = %d WHERE MSG_ID = %d;",
-                               MSGFW_MESSAGE_TABLE_NAME, DestStorageId, MsgId);
+                                       MSGFW_MESSAGE_TABLE_NAME, destStorageId, msgId);
 
                        if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS) {
                                dbHandle.endTrans(false);
@@ -1333,7 +1295,7 @@ MSG_ERROR_T MsgStoMoveMessageToStorage(MSG_MESSAGE_ID_T MsgId, MSG_STORAGE_ID_T
                        for (unsigned int i = 0; i < simIdList.count; i++) {
                                memset(sqlQuery, 0x00, sizeof(sqlQuery));
                                snprintf(sqlQuery, sizeof(sqlQuery), "INSERT INTO %s VALUES (%d, %d);",
-                                                               MSGFW_SIM_MSG_TABLE_NAME, MsgId, simIdList.simId[i]);
+                                               MSGFW_SIM_MSG_TABLE_NAME, msgId, simIdList.simId[i]);
 
                                if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS) {
                                        dbHandle.endTrans(false);
@@ -1352,7 +1314,7 @@ MSG_ERROR_T MsgStoMoveMessageToStorage(MSG_MESSAGE_ID_T MsgId, MSG_STORAGE_ID_T
 
                        memset(sqlQuery, 0x00, sizeof(sqlQuery));
                        snprintf(sqlQuery, sizeof(sqlQuery), "SELECT STORAGE_ID FROM %s WHERE MSG_ID = %d;",
-                                       MSGFW_MESSAGE_TABLE_NAME, MsgId);
+                                       MSGFW_MESSAGE_TABLE_NAME, msgId);
 
                        err = dbHandle.getTable(sqlQuery, &rowCnt);
 
@@ -1369,13 +1331,13 @@ MSG_ERROR_T MsgStoMoveMessageToStorage(MSG_MESSAGE_ID_T MsgId, MSG_STORAGE_ID_T
                        dbHandle.freeTable();
 
                        if (bSimMsg == true) {
-                               MSG_SIM_ID_T simMsgId;
+                               msg_sim_id_t simMsgId;
 
                                // get sim message id
                                memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
                                snprintf(sqlQuery, sizeof(sqlQuery), "SELECT SIM_ID FROM %s WHERE MSG_ID = %d;",
-                                       MSGFW_SIM_MSG_TABLE_NAME, MsgId);
+                                               MSGFW_SIM_MSG_TABLE_NAME, msgId);
 
                                MSG_DEBUG("sqlQuery is %s.", sqlQuery);
 
@@ -1407,7 +1369,8 @@ MSG_ERROR_T MsgStoMoveMessageToStorage(MSG_MESSAGE_ID_T MsgId, MSG_STORAGE_ID_T
                                //Delete Messages in SIM Msg table
                                memset(sqlQuery, 0x00, sizeof(sqlQuery));
                                snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;",
-                                                       MSGFW_SIM_MSG_TABLE_NAME, MsgId);
+                                               MSGFW_SIM_MSG_TABLE_NAME, msgId);
+
                                MSG_DEBUG("sqlQuery is %s.", sqlQuery);
 
                                if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS) {
@@ -1418,7 +1381,7 @@ MSG_ERROR_T MsgStoMoveMessageToStorage(MSG_MESSAGE_ID_T MsgId, MSG_STORAGE_ID_T
                                //Move storage id
                                memset(sqlQuery, 0x00, sizeof(sqlQuery));
                                snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET STORAGE_ID = %d WHERE MSG_ID = %d;",
-                                       MSGFW_MESSAGE_TABLE_NAME, DestStorageId, MsgId);
+                                               MSGFW_MESSAGE_TABLE_NAME, destStorageId, msgId);
 
                                if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS) {
                                        dbHandle.endTrans(false);
@@ -1434,7 +1397,7 @@ MSG_ERROR_T MsgStoMoveMessageToStorage(MSG_MESSAGE_ID_T MsgId, MSG_STORAGE_ID_T
 }
 
 
-MSG_ERROR_T MsgStoCountMessage(MSG_FOLDER_ID_T FolderId, MSG_COUNT_INFO_S *pCountInfo)
+msg_error_t MsgStoCountMessage(msg_folder_id_t folderId, MSG_COUNT_INFO_S *pCountInfo)
 {
        if (pCountInfo == NULL) {
                MSG_DEBUG("pCountInfo is NULL");
@@ -1445,13 +1408,13 @@ MSG_ERROR_T MsgStoCountMessage(MSG_FOLDER_ID_T FolderId, MSG_COUNT_INFO_S *pCoun
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
        snprintf(sqlQuery, sizeof(sqlQuery), "SELECT COUNT(MSG_ID) FROM %s WHERE FOLDER_ID = %d AND READ_STATUS = 1 \
-                                                                   UNION ALL SELECT COUNT(MSG_ID) FROM %s WHERE FOLDER_ID = %d AND READ_STATUS = 0 \
-                                                                   UNION ALL SELECT COUNT(MSG_ID) FROM %s WHERE FOLDER_ID = %d AND MAIN_TYPE = %d \
-                                                                   UNION ALL SELECT COUNT(MSG_ID) FROM %s WHERE FOLDER_ID = %d AND MAIN_TYPE = %d ;",
-                                                       MSGFW_MESSAGE_TABLE_NAME, FolderId,
-                                                       MSGFW_MESSAGE_TABLE_NAME, FolderId,
-                                                       MSGFW_MESSAGE_TABLE_NAME, FolderId, MSG_SMS_TYPE,
-                                                       MSGFW_MESSAGE_TABLE_NAME, FolderId, MSG_MMS_TYPE);
+                       UNION ALL SELECT COUNT(MSG_ID) FROM %s WHERE FOLDER_ID = %d AND READ_STATUS = 0 \
+                       UNION ALL SELECT COUNT(MSG_ID) FROM %s WHERE FOLDER_ID = %d AND MAIN_TYPE = %d \
+                       UNION ALL SELECT COUNT(MSG_ID) FROM %s WHERE FOLDER_ID = %d AND MAIN_TYPE = %d;",
+                       MSGFW_MESSAGE_TABLE_NAME, folderId,
+                       MSGFW_MESSAGE_TABLE_NAME, folderId,
+                       MSGFW_MESSAGE_TABLE_NAME, folderId, MSG_SMS_TYPE,
+                       MSGFW_MESSAGE_TABLE_NAME, folderId, MSG_MMS_TYPE);
 
        if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS)
                return MSG_ERR_DB_PREPARE;
@@ -1490,7 +1453,7 @@ MSG_ERROR_T MsgStoCountMessage(MSG_FOLDER_ID_T FolderId, MSG_COUNT_INFO_S *pCoun
 }
 
 
-MSG_ERROR_T MsgStoCountMsgByType(const MSG_MESSAGE_TYPE_S *pMsgType, int *pMsgCount)
+msg_error_t MsgStoCountMsgByType(const MSG_MESSAGE_TYPE_S *pMsgType, int *pMsgCount)
 {
        if (pMsgType == NULL) {
                MSG_DEBUG("pMsgType is NULL");
@@ -1501,19 +1464,20 @@ MSG_ERROR_T MsgStoCountMsgByType(const MSG_MESSAGE_TYPE_S *pMsgType, int *pMsgCo
 
        char sqlQuery[MAX_QUERY_LEN+1];
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
+
        // SMS
        if ((pMsgType->mainType == MSG_SMS_TYPE) &&
-               (pMsgType->subType == MSG_NORMAL_SMS || pMsgType->subType == MSG_STATUS_REPORT_SMS || pMsgType->subType == MSG_CONCAT_SIM_SMS)) {
+                       (pMsgType->subType == MSG_NORMAL_SMS || pMsgType->subType == MSG_STATUS_REPORT_SMS || pMsgType->subType == MSG_CONCAT_SIM_SMS)) {
                snprintf(sqlQuery, sizeof(sqlQuery), "SELECT COUNT(MSG_ID) FROM %s WHERE MAIN_TYPE = %d AND SUB_TYPE IN (%d, %d, %d);",
                                MSGFW_MESSAGE_TABLE_NAME, pMsgType->mainType, MSG_NORMAL_SMS, MSG_STATUS_REPORT_SMS, MSG_CONCAT_SIM_SMS);
        } else if ((pMsgType->mainType == MSG_SMS_TYPE) &&
-                               (pMsgType->subType == MSG_WAP_SI_SMS || pMsgType->subType == MSG_WAP_SL_SMS)) {
-        // PUSH
+                       (pMsgType->subType == MSG_WAP_SI_SMS || pMsgType->subType == MSG_WAP_SL_SMS)) {
+               // PUSH
                snprintf(sqlQuery, sizeof(sqlQuery), "SELECT COUNT(MSG_ID) FROM %s WHERE MAIN_TYPE = %d AND SUB_TYPE IN (%d, %d);",
                                MSGFW_MESSAGE_TABLE_NAME, pMsgType->mainType, MSG_WAP_SI_SMS, MSG_WAP_SL_SMS);
        } else if ((pMsgType->mainType == MSG_MMS_TYPE) &&
-                               (pMsgType->subType == MSG_SENDREQ_MMS || pMsgType->subType == MSG_SENDCONF_MMS || pMsgType->subType == MSG_RETRIEVE_AUTOCONF_MMS || pMsgType->subType == MSG_RETRIEVE_MANUALCONF_MMS)) {
-        // MMS
+                       (pMsgType->subType == MSG_SENDREQ_MMS || pMsgType->subType == MSG_SENDCONF_MMS || pMsgType->subType == MSG_RETRIEVE_AUTOCONF_MMS || pMsgType->subType == MSG_RETRIEVE_MANUALCONF_MMS)) {
+               // MMS
                snprintf(sqlQuery, sizeof(sqlQuery), "SELECT COUNT(MSG_ID) FROM %s WHERE MAIN_TYPE = %d AND SUB_TYPE IN (%d, %d, %d, %d);",
                                MSGFW_MESSAGE_TABLE_NAME, pMsgType->mainType, MSG_SENDREQ_MMS, MSG_SENDCONF_MMS, MSG_RETRIEVE_AUTOCONF_MMS, MSG_RETRIEVE_MANUALCONF_MMS);
        } else {
@@ -1536,46 +1500,39 @@ MSG_ERROR_T MsgStoCountMsgByType(const MSG_MESSAGE_TYPE_S *pMsgType, int *pMsgCo
 }
 
 
-MSG_ERROR_T MsgStoGetMessage(MSG_MESSAGE_ID_T MsgId, MSG_MESSAGE_INFO_S *pMsg, MSG_SENDINGOPT_INFO_S *pSendOptInfo)
+msg_error_t MsgStoGetMessage(msg_message_id_t msgId, MSG_MESSAGE_INFO_S *pMsg, MSG_SENDINGOPT_INFO_S *pSendOptInfo)
 {
        char sqlQuery[MAX_QUERY_LEN+1];
 
-       unsigned int addrId = 0;
-
-       char firstName[MAX_DISPLAY_NAME_LEN+1], lastName[MAX_DISPLAY_NAME_LEN+1];
-
-       memset(firstName, 0x00, sizeof(firstName));
-       memset(lastName, 0x00, sizeof(lastName));
+       int order = MsgGetContactNameOrder();
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
-       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT A.MSG_ID, A.ADDRESS_ID, A.FOLDER_ID, A.REFERENCE_ID, A.STORAGE_ID, A.MAIN_TYPE, A.SUB_TYPE, A.DISPLAY_TIME, A.DATA_SIZE, \
-                                                 A.NETWORK_STATUS, A.READ_STATUS, A.PROTECTED, A.BACKUP, A.PRIORITY, A.MSG_DIRECTION, A.SCHEDULED_TIME, A.SUBJECT, A.MSG_TEXT, \
-                                                 B.ADDRESS_TYPE, B.RECIPIENT_TYPE, B.CONTACT_ID, B.ADDRESS_VAL, B.DISPLAY_NAME, B.FIRST_NAME, B.LAST_NAME, A.THUMB_PATH \
-                                       FROM %s A, %s B WHERE A.MSG_ID = %d AND A.ADDRESS_ID = B.ADDRESS_ID;",
-                                       MSGFW_MESSAGE_TABLE_NAME, MSGFW_ADDRESS_TABLE_NAME, MsgId);
+       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT MSG_ID, CONV_ID, FOLDER_ID, STORAGE_ID, MAIN_TYPE, \
+                       SUB_TYPE, DISPLAY_TIME, DATA_SIZE, NETWORK_STATUS, READ_STATUS, PROTECTED, \
+                       BACKUP, PRIORITY, MSG_DIRECTION, SCHEDULED_TIME, SUBJECT, MSG_TEXT, THUMB_PATH \
+                       FROM %s WHERE MSG_ID = %d;",
+                       MSGFW_MESSAGE_TABLE_NAME, msgId);
 
        if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS)
                return MSG_ERR_DB_PREPARE;
 
        if (dbHandle.stepQuery() == MSG_ERR_DB_ROW) {
                pMsg->msgId = dbHandle.columnInt(0);
-               addrId = dbHandle.columnInt(1);
+               pMsg->threadId = dbHandle.columnInt(1);
                pMsg->folderId = dbHandle.columnInt(2);
-               pMsg->referenceId = dbHandle.columnInt(3);
-               pMsg->storageId = dbHandle.columnInt(4);
-               pMsg->msgType.mainType = dbHandle.columnInt(5);
-               pMsg->msgType.subType = dbHandle.columnInt(6);
-               pMsg->displayTime = (time_t)dbHandle.columnInt(7);
-               pMsg->dataSize = dbHandle.columnInt(8);
-               pMsg->networkStatus = dbHandle.columnInt(9);
-               pMsg->bRead = dbHandle.columnInt(10);
-               pMsg->bProtected = dbHandle.columnInt(11);
-               pMsg->bBackup = dbHandle.columnInt(12);
-               pMsg->priority = dbHandle.columnInt(13);
-               pMsg->direction= dbHandle.columnInt(14);
-               pMsg->scheduledTime = (time_t)dbHandle.columnInt(15);
-
-               strncpy(pMsg->subject, (char *)dbHandle.columnText(16), MAX_SUBJECT_LEN);
+               pMsg->storageId = dbHandle.columnInt(3);
+               pMsg->msgType.mainType = dbHandle.columnInt(4);
+               pMsg->msgType.subType = dbHandle.columnInt(5);
+               pMsg->displayTime = (time_t)dbHandle.columnInt(6);
+               pMsg->dataSize = dbHandle.columnInt(7);
+               pMsg->networkStatus = dbHandle.columnInt(8);
+               pMsg->bRead = dbHandle.columnInt(9);
+               pMsg->bProtected = dbHandle.columnInt(10);
+               pMsg->bBackup = dbHandle.columnInt(11);
+               pMsg->priority = dbHandle.columnInt(12);
+               pMsg->direction= dbHandle.columnInt(13);
+
+               strncpy(pMsg->subject, (char *)dbHandle.columnText(15), MAX_SUBJECT_LEN);
 
                /* Temp_File_Handling */
                if (pMsg->msgType.mainType == MSG_SMS_TYPE || pMsg->msgType.subType == MSG_NOTIFICATIONIND_MMS) {
@@ -1583,7 +1540,7 @@ MSG_ERROR_T MsgStoGetMessage(MSG_MESSAGE_ID_T MsgId, MSG_MESSAGE_INFO_S *pMsg, M
                                char msgData[pMsg->dataSize+1];
                                memset(msgData, 0x00, sizeof(msgData));
 
-                               strncpy(msgData, (char *)dbHandle.columnText(17), pMsg->dataSize);
+                               strncpy(msgData, (char *)dbHandle.columnText(16), pMsg->dataSize);
 
                                // Save Message Data into File
                                char fileName[MAX_COMMON_INFO_SIZE+1];
@@ -1606,7 +1563,7 @@ MSG_ERROR_T MsgStoGetMessage(MSG_MESSAGE_ID_T MsgId, MSG_MESSAGE_INFO_S *pMsg, M
                                pMsg->bTextSms = false;
                        } else {
                                memset(pMsg->msgText, 0x00, sizeof(pMsg->msgText));
-                               strncpy(pMsg->msgText, (char *)dbHandle.columnText(17), pMsg->dataSize);
+                               strncpy(pMsg->msgText, (char *)dbHandle.columnText(16), pMsg->dataSize);
 
                                // For WAP PUSH SI Message
                                if (pMsg->msgType.subType == MSG_WAP_SI_SMS) {
@@ -1619,59 +1576,13 @@ MSG_ERROR_T MsgStoGetMessage(MSG_MESSAGE_ID_T MsgId, MSG_MESSAGE_INFO_S *pMsg, M
                                pMsg->bTextSms = true;
                        }
                } else {
-                       if (dbHandle.columnText(17) != NULL)
-                               strncpy(pMsg->msgText, (char *)dbHandle.columnText(17), MAX_MSG_TEXT_LEN);
-               }
-
-               if (addrId > 0)
-                       pMsg->nAddressCnt = 1;
-               else
-                       pMsg->nAddressCnt = 0;
-
-               pMsg->addressList[0].threadId = addrId;
-               pMsg->addressList[0].addressType = dbHandle.columnInt(18);
-               pMsg->addressList[0].recipientType = dbHandle.columnInt(19);
-               pMsg->addressList[0].contactId = dbHandle.columnInt(20);
-
-               if (dbHandle.columnText(21) != NULL)
-                       strncpy(pMsg->addressList[0].addressVal, (char *)dbHandle.columnText(21), MAX_ADDRESS_VAL_LEN);
-
-               if (dbHandle.columnText(22) != NULL && ((char *)dbHandle.columnText(22))[0]!='\0') {
-                       MSG_DEBUG("displayName  : [%s]", dbHandle.columnText(22));
-                       strncpy(pMsg->addressList[0].displayName, (char *)dbHandle.columnText(22), MAX_DISPLAY_NAME_LEN);
-               } else {
-                       if (dbHandle.columnText(23) != NULL)
-                               strncpy(firstName, (char *)dbHandle.columnText(23), MAX_DISPLAY_NAME_LEN);
-
-                       if (dbHandle.columnText(24) != NULL)
-                               strncpy(lastName, (char *)dbHandle.columnText(24), MAX_DISPLAY_NAME_LEN);
-
-                       int order = MsgGetContactNameOrder();
-
-                       if (order == 0) {
-                               if (strlen(firstName) > 0) {
-                                       strncpy(pMsg->addressList[0].displayName, firstName, MAX_DISPLAY_NAME_LEN);
-                               }
-
-                               if (strlen(lastName) > 0) {
-                                       strncat(pMsg->addressList[0].displayName, " ", MAX_DISPLAY_NAME_LEN-strlen(pMsg->addressList[0].displayName));
-                                       strncat(pMsg->addressList[0].displayName, lastName, MAX_DISPLAY_NAME_LEN-strlen(pMsg->addressList[0].displayName));
-                               }
-                       } else if (order == 1) {
-                               if (strlen(lastName) > 0) {
-                                       strncpy(pMsg->addressList[0].displayName, lastName, MAX_DISPLAY_NAME_LEN);
-                                       strncat(pMsg->addressList[0].displayName, " ", MAX_DISPLAY_NAME_LEN-strlen(pMsg->addressList[0].displayName));
-                               }
-
-                               if (strlen(firstName) > 0) {
-                                       strncat(pMsg->addressList[0].displayName, firstName, MAX_DISPLAY_NAME_LEN-strlen(pMsg->addressList[0].displayName));
-                               }
-                       }
+                       if (dbHandle.columnText(16) != NULL)
+                               strncpy(pMsg->msgText, (char *)dbHandle.columnText(16), MAX_MSG_TEXT_LEN);
                }
 
                // thumbnail path
-               if (dbHandle.columnText(25)!=NULL && ((char *)dbHandle.columnText(25))[0] != '\0') {
-                       strncpy(pMsg->thumbPath, (char *)dbHandle.columnText(25), MSG_FILEPATH_LEN_MAX);
+               if (dbHandle.columnText(17)!=NULL && ((char *)dbHandle.columnText(17))[0] != '\0') {
+                       strncpy(pMsg->thumbPath, (char *)dbHandle.columnText(17), MSG_FILEPATH_LEN_MAX);
                        MSG_DEBUG("pMsg->thumbPath : [%s]", pMsg->thumbPath);
                }
        } else {
@@ -1682,11 +1593,15 @@ MSG_ERROR_T MsgStoGetMessage(MSG_MESSAGE_ID_T MsgId, MSG_MESSAGE_INFO_S *pMsg, M
 
        dbHandle.finalizeQuery();
 
+
+       // get address information.
+       MsgStoGetAddressByMsgId(&dbHandle, pMsg->msgId, order, &pMsg->nAddressCnt, pMsg->addressList);
+
        // Get MMS body if it is MMS.
-       if ((pMsg->networkStatus == MSG_NETWORK_RETRIEVE_SUCCESS && (pMsg->msgType.subType == MSG_RETRIEVE_AUTOCONF_MMS || pMsg->msgType.subType == MSG_RETRIEVE_MANUALCONF_MMS)) ||
-               pMsg->msgType.subType == MSG_SENDREQ_MMS ||
-               pMsg->msgType.subType == MSG_SENDCONF_MMS) {
-               MSG_ERROR_T err = MSG_SUCCESS;
+       if ((pMsg->networkStatus == MSG_NETWORK_RETRIEVE_SUCCESS &&
+                       (pMsg->msgType.subType == MSG_RETRIEVE_AUTOCONF_MMS || pMsg->msgType.subType == MSG_RETRIEVE_MANUALCONF_MMS)) ||
+                       pMsg->msgType.subType == MSG_SENDREQ_MMS || pMsg->msgType.subType == MSG_SENDCONF_MMS) {
+               msg_error_t err = MSG_SUCCESS;
                MMS_MESSAGE_DATA_S      mmsMsg;
                char *pDestMsg = NULL;
 
@@ -1742,15 +1657,14 @@ MSG_ERROR_T MsgStoGetMessage(MSG_MESSAGE_ID_T MsgId, MSG_MESSAGE_INFO_S *pMsg, M
        }
 
        // Get SMS Sending Options
-       if (pMsg->msgType.mainType == MSG_SMS_TYPE && pSendOptInfo != NULL) {
+       if (pMsg->msgType.mainType == MSG_SMS_TYPE && pSendOptInfo != NULL)
                MsgStoGetSmsSendOpt(pMsg->msgId, pSendOptInfo);
-       }
 
        return MSG_SUCCESS;
 }
 
 
-MSG_ERROR_T MsgStoGetFolderViewList(MSG_FOLDER_ID_T FolderId, const MSG_SORT_RULE_S *pSortRule, MSG_LIST_S *pMsgFolderViewList)
+msg_error_t MsgStoGetFolderViewList(msg_folder_id_t folderId, const MSG_SORT_RULE_S *pSortRule, msg_struct_list_s *pMsgFolderViewList)
 {
        if (pMsgFolderViewList == NULL) {
                MSG_DEBUG("pMsgFolderViewList is NULL");
@@ -1758,49 +1672,41 @@ MSG_ERROR_T MsgStoGetFolderViewList(MSG_FOLDER_ID_T FolderId, const MSG_SORT_RUL
        }
 
        int rowCnt = 0;
-       int index = 27; // numbers of index
+       int index = 19; // numbers of index
 
-       unsigned int addrId = 0;
 
        char sqlQuery[MAX_QUERY_LEN+1];
        char sqlSort[64];
-       char firstName[MAX_DISPLAY_NAME_LEN+1], lastName[MAX_DISPLAY_NAME_LEN+1];
-       char displayName[MAX_DISPLAY_NAME_LEN+1];
+
        // Get Name Order
        int order = MsgGetContactNameOrder();
 
        // Get Message In Folder
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
-       if (FolderId == MSG_ALLBOX_ID) {
-               snprintf(sqlQuery, sizeof(sqlQuery), "SELECT A.MSG_ID, A.ADDRESS_ID, A.FOLDER_ID, A.REFERENCE_ID, A.STORAGE_ID, A.MAIN_TYPE, A.SUB_TYPE, \
-                                                       A.DISPLAY_TIME, A.DATA_SIZE, A.NETWORK_STATUS, A.READ_STATUS, A.PROTECTED, A.BACKUP, A.PRIORITY, \
-                                                       A.MSG_DIRECTION, A.SCHEDULED_TIME, A.SUBJECT, A.MSG_TEXT, B.ADDRESS_TYPE, B.RECIPIENT_TYPE, \
-                                                       B.CONTACT_ID, B.ADDRESS_VAL, B.DISPLAY_NAME, B.FIRST_NAME, B.LAST_NAME, A.ATTACHMENT_COUNT, A.THUMB_PATH \
-                                                               FROM %s A, %s B \
-                                                            WHERE A.ADDRESS_ID = B.ADDRESS_ID \
-                                                                 AND A.FOLDER_ID < %d ",
-                                               MSGFW_MESSAGE_TABLE_NAME, MSGFW_ADDRESS_TABLE_NAME, MSG_CBMSGBOX_ID);
+       if (folderId == MSG_ALLBOX_ID) {
+               snprintf(sqlQuery, sizeof(sqlQuery), "SELECT MSG_ID, CONV_ID, FOLDER_ID, STORAGE_ID, MAIN_TYPE, SUB_TYPE, \
+                               DISPLAY_TIME, DATA_SIZE, NETWORK_STATUS, READ_STATUS, PROTECTED, BACKUP, PRIORITY, \
+                               MSG_DIRECTION, SCHEDULED_TIME, SUBJECT, MSG_TEXT, ATTACHMENT_COUNT, THUMB_PATH \
+                               FROM %s WHERE FOLDER_ID < %d ",
+                               MSGFW_MESSAGE_TABLE_NAME, MSG_SPAMBOX_ID);
        } else {
-               snprintf(sqlQuery, sizeof(sqlQuery), "SELECT A.MSG_ID, A.ADDRESS_ID, A.FOLDER_ID, A.REFERENCE_ID, A.STORAGE_ID, A.MAIN_TYPE, A.SUB_TYPE, \
-                                                       A.DISPLAY_TIME, A.DATA_SIZE, A.NETWORK_STATUS, A.READ_STATUS, A.PROTECTED, A.BACKUP, A.PRIORITY, \
-                                                       A.MSG_DIRECTION, A.SCHEDULED_TIME, A.SUBJECT, A.MSG_TEXT, B.ADDRESS_TYPE, B.RECIPIENT_TYPE, \
-                                                       B.CONTACT_ID, B.ADDRESS_VAL, B.DISPLAY_NAME, B.FIRST_NAME, B.LAST_NAME, A.ATTACHMENT_COUNT, A.THUMB_PATH \
-                                                               FROM %s A, %s B \
-                                                            WHERE A.ADDRESS_ID = B.ADDRESS_ID \
-                                                                 AND A.FOLDER_ID = %d ",
-                                               MSGFW_MESSAGE_TABLE_NAME, MSGFW_ADDRESS_TABLE_NAME, FolderId);
+               snprintf(sqlQuery, sizeof(sqlQuery), "SELECT MSG_ID, CONV_ID, FOLDER_ID, STORAGE_ID, MAIN_TYPE, SUB_TYPE, \
+                               DISPLAY_TIME, DATA_SIZE, NETWORK_STATUS, READ_STATUS, PROTECTED, BACKUP, PRIORITY, \
+                               MSG_DIRECTION, SCHEDULED_TIME, SUBJECT, MSG_TEXT, ATTACHMENT_COUNT, THUMB_PATH \
+                               FROM %s WHERE FOLDER_ID = %d ",
+                               MSGFW_MESSAGE_TABLE_NAME, folderId);
        }
 
        memset(sqlSort, 0x00, sizeof(sqlSort));
        MsgMakeSortRule(pSortRule, sqlSort);
        strncat(sqlQuery, sqlSort, strlen(sqlSort));
 
-       MSG_ERROR_T  err = dbHandle.getTable(sqlQuery, &rowCnt);
+       msg_error_t  err = dbHandle.getTable(sqlQuery, &rowCnt);
 
        if (err == MSG_ERR_DB_NORECORD) {
                pMsgFolderViewList->nCount = 0;
-               pMsgFolderViewList->msgInfo = NULL;
+               pMsgFolderViewList->msg_struct_info = NULL;
 
                dbHandle.freeTable();
 
@@ -1815,27 +1721,30 @@ MSG_ERROR_T MsgStoGetFolderViewList(MSG_FOLDER_ID_T FolderId, const MSG_SORT_RUL
 
        MSG_DEBUG("pMsgCommInfoList->nCount [%d]", pMsgFolderViewList->nCount);
 
-       pMsgFolderViewList->msgInfo = (msg_message_t *)new char[sizeof(MSG_MESSAGE_S *) * rowCnt];
+       pMsgFolderViewList->msg_struct_info = (msg_struct_t *)new char[sizeof(msg_struct_t) * rowCnt];
 
-       MSG_MESSAGE_S *pTmp = NULL;
+       msg_struct_s *msg = NULL;
+       MSG_MESSAGE_HIDDEN_S *pTmp = NULL;
 
        for (int i = 0; i < rowCnt; i++) {
-               pMsgFolderViewList->msgInfo[i] = (msg_message_t)new char[sizeof(MSG_MESSAGE_S)];
+               pMsgFolderViewList->msg_struct_info[i] = (msg_struct_t)new char[sizeof(msg_struct_s)];;
 
-               pTmp = (MSG_MESSAGE_S *)pMsgFolderViewList->msgInfo[i];
+               msg = (msg_struct_s *)pMsgFolderViewList->msg_struct_info[i];
 
-               memset(pTmp, 0x00, sizeof(pTmp));
+               msg->type = MSG_STRUCT_MESSAGE_INFO;
+               msg->data = new char[sizeof(MSG_MESSAGE_HIDDEN_S)];
+
+               pTmp = (MSG_MESSAGE_HIDDEN_S *)msg->data;
 
                pTmp->pData = NULL;
                pTmp->pMmsData = NULL;
 
                pTmp->msgId = dbHandle.getColumnToInt(index++);
-               addrId = dbHandle.getColumnToInt(index++);
+               pTmp->threadId = dbHandle.getColumnToInt(index++);
                pTmp->folderId = dbHandle.getColumnToInt(index++);
-               pTmp->referenceId = dbHandle.getColumnToInt(index++);
                pTmp->storageId = dbHandle.getColumnToInt(index++);
-               pTmp->msgType.mainType = dbHandle.getColumnToInt(index++);
-               pTmp->msgType.subType = dbHandle.getColumnToInt(index++);
+               pTmp->mainType = dbHandle.getColumnToInt(index++);
+               pTmp->subType = dbHandle.getColumnToInt(index++);
                pTmp->displayTime = (time_t)dbHandle.getColumnToInt(index++);
                pTmp->dataSize = dbHandle.getColumnToInt(index++);
                pTmp->networkStatus = dbHandle.getColumnToInt(index++);
@@ -1844,12 +1753,12 @@ MSG_ERROR_T MsgStoGetFolderViewList(MSG_FOLDER_ID_T FolderId, const MSG_SORT_RUL
                pTmp->bBackup = dbHandle.getColumnToInt(index++);
                pTmp->priority = dbHandle.getColumnToInt(index++);
                pTmp->direction= dbHandle.getColumnToInt(index++);
-               pTmp->scheduledTime = (time_t)dbHandle.getColumnToInt(index++);
+               index++; // This field is reserved.
 
                dbHandle.getColumnToString(index++, MAX_SUBJECT_LEN, pTmp->subject);
 
-               if (pTmp->msgType.mainType == MSG_MMS_TYPE &&
-                       (pTmp->networkStatus == MSG_NETWORK_RETRIEVING || pTmp->networkStatus == MSG_NETWORK_RETRIEVE_FAIL || pTmp->msgType.subType == MSG_NOTIFICATIONIND_MMS)) {
+               if (pTmp->mainType == MSG_MMS_TYPE &&
+                       (pTmp->networkStatus == MSG_NETWORK_RETRIEVING || pTmp->networkStatus == MSG_NETWORK_RETRIEVE_FAIL || pTmp->subType == MSG_NOTIFICATIONIND_MMS)) {
                        pTmp->pData = NULL;
                        index++;
                } else {
@@ -1859,78 +1768,39 @@ MSG_ERROR_T MsgStoGetFolderViewList(MSG_FOLDER_ID_T FolderId, const MSG_SORT_RUL
                        dbHandle.getColumnToString(index++, pTmp->dataSize+1, (char *)pTmp->pData);
                }
 
-               if (addrId > 0)
-                       pTmp->nAddressCnt = 1;
-               else
-                       pTmp->nAddressCnt = 0;
-
-               pTmp->addressList[0].threadId = addrId;
-               pTmp->addressList[0].addressType = dbHandle.getColumnToInt(index++);
-               pTmp->addressList[0].recipientType = dbHandle.getColumnToInt(index++);
-               pTmp->addressList[0].contactId = dbHandle.getColumnToInt(index++);
+               // get address information from db.
+               msg_struct_list_s *addr_list = (msg_struct_list_s *)new msg_struct_list_s;
 
-               dbHandle.getColumnToString(index++, MAX_ADDRESS_VAL_LEN, pTmp->addressList[0].addressVal);
+               MsgStoGetAddressByMsgId(&dbHandle, pTmp->msgId, order, addr_list);
 
-               memset(displayName, 0x00, sizeof(displayName));
-               dbHandle.getColumnToString(index++, MAX_DISPLAY_NAME_LEN, displayName);
+               pTmp->addr_list = addr_list;
 
-               memset(firstName, 0x00, sizeof(firstName));
-               dbHandle.getColumnToString(index++, MAX_DISPLAY_NAME_LEN, firstName);
+               pTmp->attachCount = dbHandle.getColumnToInt(index++);
 
-               memset(lastName, 0x00, sizeof(lastName));
-               dbHandle.getColumnToString(index++, MAX_DISPLAY_NAME_LEN, lastName);
+               dbHandle.getColumnToString(index++, MSG_FILEPATH_LEN_MAX, pTmp->thumbPath);
+       }
 
+       dbHandle.freeTable();
 
-               if (strlen(displayName) <= 0) {
-                       if (order == 0) {
-                               if (firstName[0] != '\0') {
-                                       strncpy(displayName, firstName, MAX_DISPLAY_NAME_LEN);
-                               }
+       return MSG_SUCCESS;
+}
 
-                               if (lastName[0] != '\0') {
-                                       strncat(displayName, " ", MAX_DISPLAY_NAME_LEN-strlen(displayName));
-                                       strncat(displayName, lastName, MAX_DISPLAY_NAME_LEN-strlen(displayName));
-                               }
-                       } else if (order == 1) {
-                               if (lastName[0] != '\0') {
-                                       strncpy(displayName, lastName, MAX_DISPLAY_NAME_LEN);
-                                       strncat(displayName, " ", MAX_DISPLAY_NAME_LEN-strlen(displayName));
-                               }
 
-                               if (firstName[0] != '\0') {
-                                       strncat(displayName, firstName, MAX_DISPLAY_NAME_LEN-strlen(displayName));
-                               }
-                       }
-               }
-
-               strncpy(pTmp->addressList[0].displayName, displayName, MAX_DISPLAY_NAME_LEN);
-
-               pTmp->attachCount = dbHandle.getColumnToInt(index++);
-
-               dbHandle.getColumnToString(index++, MSG_FILEPATH_LEN_MAX, pTmp->thumbPath);
-       }
-
-       dbHandle.freeTable();
-
-       return MSG_SUCCESS;
-}
-
-
-MSG_ERROR_T MsgStoAddSyncMLMessage(MSG_MESSAGE_INFO_S *pMsgInfo, int ExtId, int PinCode)
+msg_error_t MsgStoAddSyncMLMessage(MSG_MESSAGE_INFO_S *pMsgInfo, int extId, int pinCode)
 {
        MSG_BEGIN();
 
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        char sqlQuery[MAX_QUERY_LEN+1];
 
        unsigned int rowId = 0;
-       unsigned int addrId = 0;
+       msg_thread_id_t convId = 0;
 
        dbHandle.beginTrans();
 
        if (pMsgInfo->nAddressCnt > 0) {
-               err = MsgStoAddAddress(&dbHandle, &(pMsgInfo->addressList[0]), &addrId);
+               err = MsgStoAddAddress(&dbHandle, pMsgInfo, &convId);
 
                if (err != MSG_SUCCESS) {
                        dbHandle.endTrans(false);
@@ -1939,7 +1809,8 @@ MSG_ERROR_T MsgStoAddSyncMLMessage(MSG_MESSAGE_INFO_S *pMsgInfo, int ExtId, int
        }
 
        // Add Message Table
-       rowId = MsgStoAddMessageTable(&dbHandle, pMsgInfo, addrId);
+       pMsgInfo->threadId = convId;
+       rowId = MsgStoAddMessageTable(&dbHandle, pMsgInfo);
 
        if (rowId <= 0) {
                dbHandle.endTrans(false);
@@ -1948,22 +1819,21 @@ MSG_ERROR_T MsgStoAddSyncMLMessage(MSG_MESSAGE_INFO_S *pMsgInfo, int ExtId, int
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
        snprintf(sqlQuery, sizeof(sqlQuery), "INSERT INTO %s VALUES (%d, %d, %d);",
-                                       MSGFW_SYNCML_MSG_TABLE_NAME, rowId, ExtId, PinCode);
+                       MSGFW_SYNCML_MSG_TABLE_NAME, rowId, extId, pinCode);
 
        if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS) {
                dbHandle.endTrans(false);
                return MSG_ERR_DB_EXEC;
        }
 
-       if (MsgStoUpdateAddress(&dbHandle, addrId) != MSG_SUCCESS) {
+       if (MsgStoUpdateConversation(&dbHandle, convId) != MSG_SUCCESS) {
                dbHandle.endTrans(false);
                return MSG_ERR_STORAGE_ERROR;
        }
 
        dbHandle.endTrans(true);
 
-       pMsgInfo->msgId = (MSG_MESSAGE_ID_T)rowId;
-       pMsgInfo->referenceId = (MSG_REFERENCE_ID_T)rowId;
+       pMsgInfo->msgId = (msg_message_id_t)rowId;
 
        MsgSoundPlayStart();
 
@@ -1983,14 +1853,14 @@ MSG_ERROR_T MsgStoAddSyncMLMessage(MSG_MESSAGE_INFO_S *pMsgInfo, int ExtId, int
 }
 
 
-MSG_ERROR_T MsgStoGetMsgType(MSG_MESSAGE_ID_T msgId, MSG_MESSAGE_TYPE_S *pMsgType)
+msg_error_t MsgStoGetMsgType(msg_message_id_t msgId, MSG_MESSAGE_TYPE_S *pMsgType)
 {
        char sqlQuery[MAX_QUERY_LEN+1];
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
        snprintf(sqlQuery, sizeof(sqlQuery), "SELECT MAIN_TYPE, SUB_TYPE FROM %s WHERE MSG_ID = %d;",
-                                                       MSGFW_MESSAGE_TABLE_NAME, msgId);
+                       MSGFW_MESSAGE_TABLE_NAME, msgId);
 
        if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS)
                return MSG_ERR_DB_PREPARE;
@@ -2006,36 +1876,36 @@ MSG_ERROR_T MsgStoGetMsgType(MSG_MESSAGE_ID_T msgId, MSG_MESSAGE_TYPE_S *pMsgTyp
 }
 
 
-MSG_ERROR_T MsgStoGetQuickPanelData(MSG_QUICKPANEL_TYPE_T Type, MSG_MESSAGE_INFO_S *pMsg)
+msg_error_t MsgStoGetQuickPanelData(msg_quickpanel_type_t QPtype, MSG_MESSAGE_INFO_S *pMsg)
 {
-       MSG_ERROR_T     err = MSG_SUCCESS;
+       msg_error_t     err = MSG_SUCCESS;
 
        char sqlQuery[MAX_QUERY_LEN+1];
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
-       if (Type == MSG_QUICKPANEL_SMS) {
+       if (QPtype == MSG_QUICKPANEL_SMS) {
                snprintf(sqlQuery, sizeof(sqlQuery), "SELECT MSG_ID FROM %s WHERE FOLDER_ID = %d AND MAIN_TYPE = %d AND SUB_TYPE = %d AND READ_STATUS = 0 ORDER BY DISPLAY_TIME DESC;",
-                       MSGFW_MESSAGE_TABLE_NAME, MSG_INBOX_ID, MSG_SMS_TYPE, MSG_NORMAL_SMS);
-       } else if (Type == MSG_QUICKPANEL_MMS) {
+                               MSGFW_MESSAGE_TABLE_NAME, MSG_INBOX_ID, MSG_SMS_TYPE, MSG_NORMAL_SMS);
+       } else if (QPtype == MSG_QUICKPANEL_MMS) {
                snprintf(sqlQuery, sizeof(sqlQuery), "SELECT MSG_ID FROM %s WHERE FOLDER_ID = %d AND MAIN_TYPE = %d AND SUB_TYPE IN (%d, %d) AND READ_STATUS = 0 ORDER BY DISPLAY_TIME DESC;",
-                       MSGFW_MESSAGE_TABLE_NAME, MSG_INBOX_ID, MSG_MMS_TYPE, MSG_RETRIEVE_AUTOCONF_MMS, MSG_RETRIEVE_MANUALCONF_MMS);
-       } else if (Type == MSG_QUICKPANEL_DELIVER_REP) {
+                               MSGFW_MESSAGE_TABLE_NAME, MSG_INBOX_ID, MSG_MMS_TYPE, MSG_RETRIEVE_AUTOCONF_MMS, MSG_RETRIEVE_MANUALCONF_MMS);
+       } else if (QPtype == MSG_QUICKPANEL_DELIVER_REP) {
                snprintf(sqlQuery, sizeof(sqlQuery), "SELECT MSG_ID FROM %s WHERE SUB_TYPE IN (%d, %d) AND READ_STATUS = 0 ORDER BY DISPLAY_TIME DESC;",
-                       MSGFW_MESSAGE_TABLE_NAME, MSG_STATUS_REPORT_SMS, MSG_DELIVERYIND_MMS);
-       } else if (Type == MSG_QUICKPANEL_READ_REP) {
+                               MSGFW_MESSAGE_TABLE_NAME, MSG_STATUS_REPORT_SMS, MSG_DELIVERYIND_MMS);
+       } else if (QPtype == MSG_QUICKPANEL_READ_REP) {
                snprintf(sqlQuery, sizeof(sqlQuery), "SELECT MSG_ID FROM %s WHERE MAIN_TYPE = %d AND SUB_TYPE = %d AND READ_STATUS = 0 ORDER BY DISPLAY_TIME DESC;",
-                       MSGFW_MESSAGE_TABLE_NAME, MSG_MMS_TYPE, MSG_READORGIND_MMS);
-       } else if (Type == MSG_QUICKPANEL_VOICEMAIL) {
+                               MSGFW_MESSAGE_TABLE_NAME, MSG_MMS_TYPE, MSG_READORGIND_MMS);
+       } else if (QPtype == MSG_QUICKPANEL_VOICEMAIL) {
                snprintf(sqlQuery, sizeof(sqlQuery), "SELECT MSG_ID FROM %s WHERE FOLDER_ID = %d AND MAIN_TYPE = %d AND SUB_TYPE = %d AND READ_STATUS = 0 ORDER BY DISPLAY_TIME DESC;",
-                       MSGFW_MESSAGE_TABLE_NAME, MSG_INBOX_ID, MSG_SMS_TYPE, MSG_MWI_VOICE_SMS);
-       } else if (Type == MSG_QUICKPANEL_MMS_NOTI) {
+                               MSGFW_MESSAGE_TABLE_NAME, MSG_INBOX_ID, MSG_SMS_TYPE, MSG_MWI_VOICE_SMS);
+       } else if (QPtype == MSG_QUICKPANEL_MMS_NOTI) {
                snprintf(sqlQuery, sizeof(sqlQuery), "SELECT MSG_ID FROM %s WHERE FOLDER_ID = %d AND MAIN_TYPE = %d AND SUB_TYPE = %d AND READ_STATUS = 0 ORDER BY DISPLAY_TIME DESC;",
-                       MSGFW_MESSAGE_TABLE_NAME, MSG_INBOX_ID, MSG_MMS_TYPE, MSG_NOTIFICATIONIND_MMS);
+                               MSGFW_MESSAGE_TABLE_NAME, MSG_INBOX_ID, MSG_MMS_TYPE, MSG_NOTIFICATIONIND_MMS);
        }
 
        // Get Message ID
-       MSG_MESSAGE_ID_T msgId;
+       msg_message_id_t msgId;
 
        if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS)
                return MSG_ERR_DB_PREPARE;
@@ -2056,117 +1926,73 @@ MSG_ERROR_T MsgStoGetQuickPanelData(MSG_QUICKPANEL_TYPE_T Type, MSG_MESSAGE_INFO
 }
 
 
-MSG_ERROR_T MsgStoGetThreadViewList(const MSG_SORT_RULE_S *pSortRule, MSG_THREAD_VIEW_LIST_S *pThreadViewList)
+msg_error_t MsgStoGetThreadViewList(const MSG_SORT_RULE_S *pSortRule, msg_struct_list_s *pThreadViewList)
 {
        pThreadViewList->nCount = 0;
-       pThreadViewList->msgThreadInfo = NULL;
+       pThreadViewList->msg_struct_info = NULL;
 
        int rowCnt = 0;
-       int index = 15; // numbers of index
+       int index = 10; // numbers of index
 
        char sqlQuery[MAX_QUERY_LEN+1];
-       char sqlSort[64];
-
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
-       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT ADDRESS_ID, CONTACT_ID, ADDRESS_VAL, \
-                       DISPLAY_NAME, FIRST_NAME, LAST_NAME, IMAGE_PATH, \
-                       UNREAD_CNT, SMS_CNT, MMS_CNT, MAIN_TYPE, SUB_TYPE, \
-                       MSG_DIRECTION, MSG_TIME, MSG_TEXT \
-                       FROM %s \
-                       WHERE ADDRESS_ID <> 0 AND (SMS_CNT > 0 OR MMS_CNT > 0) ",
-                       MSGFW_ADDRESS_TABLE_NAME);
+       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT CONV_ID, UNREAD_CNT, SMS_CNT, MMS_CNT, \
+                       MAIN_TYPE, SUB_TYPE, MSG_DIRECTION, DISPLAY_TIME, DISPLAY_NAME, MSG_TEXT \
+                       FROM %s WHERE SMS_CNT > 0 OR MMS_CNT > 0 ORDER BY DISPLAY_TIME DESC;",
+                       MSGFW_CONVERSATION_TABLE_NAME);
 
-       memset(sqlSort, 0x00, sizeof(sqlSort));
-       MsgMakeSortRule(pSortRule, sqlSort);
-       strncat(sqlQuery, sqlSort, sizeof(sqlQuery) - strlen(sqlQuery) - 1);
-
-       MSG_ERROR_T  err = dbHandle.getTable(sqlQuery, &rowCnt);
+       msg_error_t  err = dbHandle.getTable(sqlQuery, &rowCnt);
 
        if (err == MSG_ERR_DB_NORECORD) {
                dbHandle.freeTable();
-
                return MSG_SUCCESS;
        } else if (err != MSG_SUCCESS) {
                MSG_DEBUG("%s", sqlQuery);
-
                dbHandle.freeTable();
-
                return err;
        }
 
-       char firstName[MAX_THREAD_NAME_LEN+1];
-       char lastName[MAX_THREAD_NAME_LEN+1];
-       char displayName[MAX_DISPLAY_NAME_LEN+1];
-
-       int order = MsgGetContactNameOrder();
+       if (rowCnt < 1) {
+               MSG_DEBUG("rowCnt is %d", rowCnt);
+               dbHandle.freeTable();
+               return err;
+       }
 
        pThreadViewList->nCount = rowCnt;
 
        MSG_DEBUG("pThreadViewList->nCount [%d]", pThreadViewList->nCount);
 
-       pThreadViewList->msgThreadInfo = (msg_thread_view_t *)new char[sizeof(MSG_THREAD_VIEW_S *)*rowCnt];
+       pThreadViewList->msg_struct_info = (msg_struct_t *)new char[sizeof(msg_struct_t)*rowCnt];
 
        MSG_THREAD_VIEW_S *pTmp = NULL;
+       msg_struct_s *thread_t = NULL;
 
        for (int i = 0; i < rowCnt; i++) {
-               pThreadViewList->msgThreadInfo[i] = (msg_thread_view_t)new char[sizeof(MSG_THREAD_VIEW_S)];
-
-               pTmp = (MSG_THREAD_VIEW_S *)pThreadViewList->msgThreadInfo[i];
-
-               pTmp->threadId = dbHandle.getColumnToInt(index++);
-               pTmp->contactId = dbHandle.getColumnToInt(index++);
-
-               memset(pTmp->threadAddr, 0x00, sizeof(pTmp->threadAddr));
-               dbHandle.getColumnToString(index++, MAX_THREAD_ADDR_LEN, pTmp->threadAddr);
-
-               memset(displayName, 0x00, sizeof(displayName));
-               dbHandle.getColumnToString(index++, MAX_THREAD_NAME_LEN, displayName);
-
-               memset(firstName, 0x00, sizeof(firstName));
-               dbHandle.getColumnToString(index++, MAX_THREAD_NAME_LEN, firstName);
-
-               memset(lastName, 0x00, sizeof(lastName));
-               dbHandle.getColumnToString(index++, MAX_THREAD_NAME_LEN, lastName);
-
-               if (strlen(displayName) <= 0) {
-                       if (order == 0) {
-                               if (firstName[0] != '\0') {
-                                       strncpy(displayName, firstName, MAX_DISPLAY_NAME_LEN);
-                               }
-
-                               if (lastName[0] != '\0') {
-                                       strncat(displayName, " ", MAX_DISPLAY_NAME_LEN-strlen(displayName));
-                                       strncat(displayName, lastName, MAX_DISPLAY_NAME_LEN-strlen(displayName));
-                               }
-                       } else if (order == 1) {
-                               if (lastName[0] != '\0') {
-                                       strncpy(displayName, lastName, MAX_DISPLAY_NAME_LEN);
-                                       strncat(displayName, " ", MAX_DISPLAY_NAME_LEN-strlen(displayName));
-                               }
+               thread_t = (msg_struct_s *)new msg_struct_s;
+               pThreadViewList->msg_struct_info[i] = (msg_struct_t)thread_t;
 
-                               if (firstName[0] != '\0') {
-                                       strncat(displayName, firstName, MAX_DISPLAY_NAME_LEN-strlen(displayName));
-                               }
-                       }
-               }
+               thread_t->type = MSG_STRUCT_THREAD_INFO;
+               thread_t->data = new MSG_THREAD_VIEW_S;
 
-               memset(pTmp->threadName, 0x00, sizeof(pTmp->threadName));
-               strncpy(pTmp->threadName, displayName, MAX_THREAD_NAME_LEN);
+               pTmp = (MSG_THREAD_VIEW_S *)thread_t->data;
+               memset(pTmp, 0x00, sizeof(MSG_THREAD_VIEW_S));
 
-               memset(pTmp->threadImagePath, 0x00, sizeof(pTmp->threadImagePath));
-               dbHandle.getColumnToString(index++, MAX_IMAGE_PATH_LEN, pTmp->threadImagePath);
+               pTmp->threadId = dbHandle.getColumnToInt(index++);
 
                pTmp->unreadCnt = dbHandle.getColumnToInt(index++);
                pTmp->smsCnt = dbHandle.getColumnToInt(index++);
                pTmp->mmsCnt = dbHandle.getColumnToInt(index++);
 
-               pTmp->threadType.mainType = dbHandle.getColumnToInt(index++);
-               pTmp->threadType.subType = dbHandle.getColumnToInt(index++);
+               pTmp->mainType = dbHandle.getColumnToInt(index++);
+               pTmp->subType = dbHandle.getColumnToInt(index++);
 
                pTmp->direction = dbHandle.getColumnToInt(index++);
                pTmp->threadTime = (time_t)dbHandle.getColumnToInt(index++);
 
+               memset(pTmp->threadName, 0x00, sizeof(pTmp->threadName));
+               dbHandle.getColumnToString(index++, MAX_THREAD_NAME_LEN, pTmp->threadName);
+
                memset(pTmp->threadData, 0x00, sizeof(pTmp->threadData));
                dbHandle.getColumnToString(index++, MAX_THREAD_DATA_LEN, pTmp->threadData);
        }
@@ -2177,31 +2003,30 @@ MSG_ERROR_T MsgStoGetThreadViewList(const MSG_SORT_RULE_S *pSortRule, MSG_THREAD
 }
 
 
-MSG_ERROR_T MsgStoGetConversationViewList(MSG_THREAD_ID_T ThreadId, MSG_LIST_S *pConvViewList)
+msg_error_t MsgStoGetConversationViewList(msg_thread_id_t threadId, msg_struct_list_s *pConvViewList)
 {
        MSG_BEGIN();
 
        pConvViewList->nCount = 0;
-       pConvViewList->msgInfo = NULL;
+       pConvViewList->msg_struct_info = NULL;
 
        int rowCnt = 0;
-       int index = 20; /** numbers of index */
-
-       unsigned int addrId = 0;
-
+       int index = 19; /** numbers of index */
+       int order = 0;
        char sqlQuery[MAX_QUERY_LEN+1];
 
+       // get address information.
+       order = MsgGetContactNameOrder();
+
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
-       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT MSG_ID, ADDRESS_ID, FOLDER_ID, REFERENCE_ID, STORAGE_ID, MAIN_TYPE, SUB_TYPE, \
-                                                       DISPLAY_TIME, DATA_SIZE, NETWORK_STATUS, READ_STATUS, PROTECTED, BACKUP, PRIORITY, \
-                                                       MSG_DIRECTION, SCHEDULED_TIME, SUBJECT, MSG_TEXT, ATTACHMENT_COUNT, THUMB_PATH \
-                                                       FROM %s \
-                                                       WHERE ADDRESS_ID = %d AND FOLDER_ID > %d AND FOLDER_ID < %d \
-                                                       ORDER BY DISPLAY_TIME, MSG_ID ASC;",
-                                       MSGFW_MESSAGE_TABLE_NAME, ThreadId, MSG_ALLBOX_ID, MSG_CBMSGBOX_ID);
+       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT MSG_ID, CONV_ID, FOLDER_ID, STORAGE_ID, MAIN_TYPE, SUB_TYPE, \
+                       DISPLAY_TIME, DATA_SIZE, NETWORK_STATUS, READ_STATUS, PROTECTED, BACKUP, PRIORITY, \
+                       MSG_DIRECTION, SCHEDULED_TIME, SUBJECT, MSG_TEXT, ATTACHMENT_COUNT, THUMB_PATH \
+                       FROM %s WHERE CONV_ID = %d AND FOLDER_ID > %d AND FOLDER_ID < %d ORDER BY DISPLAY_TIME, MSG_ID ASC;",
+                       MSGFW_MESSAGE_TABLE_NAME, threadId, MSG_ALLBOX_ID, MSG_SPAMBOX_ID);
 
-       MSG_ERROR_T err = dbHandle.getTable(sqlQuery, &rowCnt);
+       msg_error_t err = dbHandle.getTable(sqlQuery, &rowCnt);
 
        if (err == MSG_ERR_DB_NORECORD) {
                dbHandle.freeTable();
@@ -2216,27 +2041,30 @@ MSG_ERROR_T MsgStoGetConversationViewList(MSG_THREAD_ID_T ThreadId, MSG_LIST_S *
 
        MSG_DEBUG("pConvViewList->nCount [%d]", pConvViewList->nCount);
 
-       pConvViewList->msgInfo = (msg_message_t *)new char[sizeof(MSG_MESSAGE_S *) * rowCnt];
+       pConvViewList->msg_struct_info = (msg_struct_t *)new char[sizeof(msg_struct_t) * rowCnt];
 
-       MSG_MESSAGE_S *pTmp = NULL;
+       msg_struct_s *msg = NULL;
+       MSG_MESSAGE_HIDDEN_S *pTmp = NULL;
 
        for (int i = 0; i < rowCnt; i++) {
-               pConvViewList->msgInfo[i] = (msg_message_t)new char[sizeof(MSG_MESSAGE_S)];
+               pConvViewList->msg_struct_info[i] = (msg_struct_t)new char[sizeof(msg_struct_s)];;
+
+               msg = (msg_struct_s *)pConvViewList->msg_struct_info[i];
 
-               pTmp = (MSG_MESSAGE_S *)pConvViewList->msgInfo[i];
+               msg->type = MSG_STRUCT_MESSAGE_INFO;
+               msg->data = new char[sizeof(MSG_MESSAGE_HIDDEN_S)];
 
-               memset(pTmp, 0x00, sizeof(pTmp));
+               pTmp = (MSG_MESSAGE_HIDDEN_S *)msg->data;
 
                pTmp->pData = NULL;
                pTmp->pMmsData = NULL;
 
                pTmp->msgId = dbHandle.getColumnToInt(index++);
-               addrId = dbHandle.getColumnToInt(index++);
+               pTmp->threadId = dbHandle.getColumnToInt(index++);
                pTmp->folderId = dbHandle.getColumnToInt(index++);
-               pTmp->referenceId = dbHandle.getColumnToInt(index++);
                pTmp->storageId = dbHandle.getColumnToInt(index++);
-               pTmp->msgType.mainType = dbHandle.getColumnToInt(index++);
-               pTmp->msgType.subType = dbHandle.getColumnToInt(index++);
+               pTmp->mainType = dbHandle.getColumnToInt(index++);
+               pTmp->subType = dbHandle.getColumnToInt(index++);
                pTmp->displayTime = (time_t)dbHandle.getColumnToInt(index++);
                pTmp->dataSize = dbHandle.getColumnToInt(index++);
                pTmp->networkStatus = dbHandle.getColumnToInt(index++);
@@ -2245,12 +2073,12 @@ MSG_ERROR_T MsgStoGetConversationViewList(MSG_THREAD_ID_T ThreadId, MSG_LIST_S *
                pTmp->bBackup = dbHandle.getColumnToInt(index++);
                pTmp->priority = dbHandle.getColumnToInt(index++);
                pTmp->direction = dbHandle.getColumnToInt(index++);
-               pTmp->scheduledTime = (time_t)dbHandle.getColumnToInt(index++);
+               index++; // This field is reserved.
 
                dbHandle.getColumnToString(index++, MAX_SUBJECT_LEN, pTmp->subject);
 
-               if (pTmp->msgType.mainType == MSG_MMS_TYPE &&
-                       (pTmp->networkStatus == MSG_NETWORK_RETRIEVING || pTmp->networkStatus == MSG_NETWORK_RETRIEVE_FAIL || pTmp->msgType.subType == MSG_NOTIFICATIONIND_MMS)) {
+               if (pTmp->mainType == MSG_MMS_TYPE &&
+                       (pTmp->networkStatus == MSG_NETWORK_RETRIEVING || pTmp->networkStatus == MSG_NETWORK_RETRIEVE_FAIL || pTmp->subType == MSG_NOTIFICATIONIND_MMS)) {
                        pTmp->pData = NULL;
                        index++;
                } else {
@@ -2264,6 +2092,14 @@ MSG_ERROR_T MsgStoGetConversationViewList(MSG_THREAD_ID_T ThreadId, MSG_LIST_S *
 
                dbHandle.getColumnToString(index++, MSG_FILEPATH_LEN_MAX, pTmp->thumbPath);
 
+               // set address list handle.
+               msg_struct_list_s *addrlist = (msg_struct_list_s *)new msg_struct_list_s;
+               memset(addrlist, 0x00, sizeof(msg_struct_list_s));
+               MsgDbHandler dbHandleForInner;
+               MsgStoGetAddressByConvId(&dbHandleForInner, threadId, order, addrlist);
+
+               pTmp->addr_list = addrlist;
+
        }
 
        dbHandle.freeTable();
@@ -2274,13 +2110,13 @@ MSG_ERROR_T MsgStoGetConversationViewList(MSG_THREAD_ID_T ThreadId, MSG_LIST_S *
 }
 
 
-MSG_ERROR_T MsgStoDeleteThreadMessageList(MSG_THREAD_ID_T ThreadId, MSG_MSGID_LIST_S *pMsgIdList)
+msg_error_t MsgStoDeleteThreadMessageList(msg_thread_id_t threadId, msg_id_list_s *pMsgIdList)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        char sqlQuery[MAX_QUERY_LEN+1];
        /*** Get msg id list **/
-       MSG_MSGID_LIST_S *pToDeleteMsgIdList = NULL;
+       msg_id_list_s *pToDeleteMsgIdList = NULL;
 
        int rowCnt = 0;
        int index = 1;
@@ -2289,18 +2125,16 @@ MSG_ERROR_T MsgStoDeleteThreadMessageList(MSG_THREAD_ID_T ThreadId, MSG_MSGID_LI
        int mmsCnt = 0;
 
        const char *tableList[] = {MSGFW_PUSH_MSG_TABLE_NAME, MSGFW_CB_MSG_TABLE_NAME,
-                                       MSGFW_SYNCML_MSG_TABLE_NAME, MSGFW_SCHEDULED_MSG_TABLE_NAME,
-                                       MSGFW_SMS_SENDOPT_TABLE_NAME, MMS_PLUGIN_MESSAGE_TABLE_NAME,
-                                       MSGFW_MESSAGE_TABLE_NAME};
+                       MSGFW_SYNCML_MSG_TABLE_NAME, MSGFW_SMS_SENDOPT_TABLE_NAME, 
+                       MMS_PLUGIN_MESSAGE_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME};
 
        int listCnt = sizeof(tableList)/sizeof(char *);
 
-       pToDeleteMsgIdList = (MSG_MSGID_LIST_S *)new char[sizeof(MSG_MSGID_LIST_S)];
-       memset(pToDeleteMsgIdList, 0x00, sizeof(MSG_MSGID_LIST_S));
+       pToDeleteMsgIdList = (msg_id_list_s *)new char[sizeof(msg_id_list_s)];
+       memset(pToDeleteMsgIdList, 0x00, sizeof(msg_id_list_s));
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
-       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT MSG_ID FROM %s WHERE ADDRESS_ID = %d",
-                       MSGFW_MESSAGE_TABLE_NAME, ThreadId);
+       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT MSG_ID FROM %s WHERE CONV_ID = %d", MSGFW_MESSAGE_TABLE_NAME, threadId);
 
        err = dbHandle.getTable(sqlQuery, &rowCnt);
 
@@ -2323,7 +2157,7 @@ MSG_ERROR_T MsgStoDeleteThreadMessageList(MSG_THREAD_ID_T ThreadId, MSG_MSGID_LI
 
        MSG_DEBUG("pToDeleteMsgIdList->nCount [%d]", pToDeleteMsgIdList->nCount);
 
-       pToDeleteMsgIdList->msgIdList = (MSG_MESSAGE_ID_T *)new char[sizeof(MSG_MESSAGE_ID_T) * rowCnt];
+       pToDeleteMsgIdList->msgIdList = (msg_message_id_t *)new char[sizeof(msg_message_id_t) * rowCnt];
 
        for (int i = 0; i < rowCnt; i++)
                pToDeleteMsgIdList->msgIdList[i] = dbHandle.getColumnToInt(index++);
@@ -2334,11 +2168,8 @@ MSG_ERROR_T MsgStoDeleteThreadMessageList(MSG_THREAD_ID_T ThreadId, MSG_MSGID_LI
        /*** Delete Sim Message **/
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
-       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT MSG_ID \
-                                       FROM %s \
-                                    WHERE ADDRESS_ID = %d \
-                                         AND STORAGE_ID = %d",
-                       MSGFW_MESSAGE_TABLE_NAME, ThreadId, MSG_STORAGE_SIM);
+       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT MSG_ID FROM %s WHERE CONV_ID = %d AND STORAGE_ID = %d",
+                       MSGFW_MESSAGE_TABLE_NAME, threadId, MSG_STORAGE_SIM);
 
        rowCnt = 0;
 
@@ -2371,16 +2202,14 @@ MSG_ERROR_T MsgStoDeleteThreadMessageList(MSG_THREAD_ID_T ThreadId, MSG_MSGID_LI
 
        for (int i = 0; i < listCnt; i++) {
                if (!strcmp(tableList[i], MMS_PLUGIN_MESSAGE_TABLE_NAME)) {
-                       //MMS_PLUGIN_MESSAGE_TABLE_NAME and MMS_PLUGIN_ATTRIBUTE_TABLE_NAME will be updated together
+
                        int rowCnt = 0;
-                       int msgCnt = 0;
-                       int index = 2;
 
                        //get mms msg id list
                        memset(sqlQuery, 0x00, sizeof(sqlQuery));
-                       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT MSG_ID, REFERENCE_ID FROM %s \
-                                                               WHERE ADDRESS_ID = %d AND MAIN_TYPE = %d",
-                                                               MSGFW_MESSAGE_TABLE_NAME, ThreadId, MSG_MMS_TYPE);
+                       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT FILE_PATH FROM %s A, %s B\
+                                       WHERE A.CONV_ID = %d AND A.MAIN_TYPE = %d AND A.MSG_ID = B.MSG_ID;",
+                                       MSGFW_MESSAGE_TABLE_NAME, MMS_PLUGIN_MESSAGE_TABLE_NAME, threadId, MSG_MMS_TYPE);
 
                        err = dbHandle.getTable(sqlQuery, &rowCnt);
                        MSG_DEBUG("rowCnt %d", rowCnt);
@@ -2395,155 +2224,49 @@ MSG_ERROR_T MsgStoDeleteThreadMessageList(MSG_THREAD_ID_T ThreadId, MSG_MSGID_LI
                        }
 
                        for (int i = 1; i <= rowCnt; i++) {
-                               int msgId = 0;
-                               int refId = 0;
-
-                               msgId = dbHandle.getColumnToInt(index++);
-                               refId = dbHandle.getColumnToInt(index++);
-
-                               //get multiple recipient message count
-                               memset(sqlQuery, 0x00, sizeof(sqlQuery));
-                               snprintf(sqlQuery, sizeof(sqlQuery), "SELECT COUNT(MSG_ID) FROM %s WHERE REFERENCE_ID = %d;",
-                                                               MSGFW_MESSAGE_TABLE_NAME, refId);
-
-                               if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS) {
-                                       dbHandle.freeTable();
-                                       dbHandle.endTrans(false);
-                                       err = MSG_ERR_DB_PREPARE;
-
-                                       goto FREE_MEMORY;
-                               }
-
-                               msgCnt = 0;
-
-                               if (dbHandle.stepQuery() == MSG_ERR_DB_ROW) {
-                                       msgCnt = dbHandle.columnInt(0);
-                               } else {
-                                       dbHandle.finalizeQuery();
-                                       dbHandle.freeTable();
-                                       dbHandle.endTrans(false);
-                                       err = MSG_ERR_DB_STEP;
-
-                                       goto FREE_MEMORY;
-                               }
-
-                               dbHandle.finalizeQuery();
-
-                               //delete mms raw file and db(mms_table and mms_attr_table) data
-                               if (msgCnt == 1) {
-                                       char filePath[MSG_FILEPATH_LEN_MAX] = {0,};
-                                       char dirPath[MSG_FILEPATH_LEN_MAX] = {0,};
-                                       char thumbnailPath[MSG_FILEPATH_LEN_MAX] = {0,};
-
-                                       //get raw file_path
-                                       memset(sqlQuery, 0x00, sizeof(sqlQuery));
-                                       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT FILE_PATH FROM %s WHERE REFERENCE_ID = %d;",
-                                                                               MMS_PLUGIN_MESSAGE_TABLE_NAME, refId);
-
-                                       if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS) {
-                                               dbHandle.freeTable();
-                                               dbHandle.endTrans(false);
-                                               err = MSG_ERR_DB_PREPARE;
-
-                                               goto FREE_MEMORY;
-                                       }
-
-                                       if (dbHandle.stepQuery() == MSG_ERR_DB_ROW) {
-                                               strncpy(filePath, (char *)dbHandle.columnText(0), MSG_FILEPATH_LEN_MAX);
-                                       } else {
-                                               dbHandle.finalizeQuery();
-                                               dbHandle.freeTable();
-                                               dbHandle.endTrans(false);
-                                               err = MSG_ERR_DB_STEP;
-
-                                               goto FREE_MEMORY;
-                                       }
-
-                                       dbHandle.finalizeQuery();
-
-                                       MSG_DEBUG("filePath [%s]", filePath);
-
-                                       //delete raw file
-                                       snprintf(dirPath, sizeof(dirPath), "%s.dir", filePath);
 
-                                       if (remove(filePath) == -1)
-                                               MSG_DEBUG("Fail to delete file [%s]", filePath);
-                                       else
-                                               MSG_DEBUG("Success to delete file [%s]", filePath);
+                               char filePath[MSG_FILEPATH_LEN_MAX] = {0,};
+                               char dirPath[MSG_FILEPATH_LEN_MAX] = {0,};
+                               char thumbnailPath[MSG_FILEPATH_LEN_MAX] = {0,};
 
-                                       MsgRmRf(dirPath);
-                                       // remove directory also
-                                       rmdir(dirPath);
+                               dbHandle.getColumnToString(i, MSG_FILEPATH_LEN_MAX, filePath);
 
-                                       // delete thumbnail
-                                       char *fileName = NULL;
-                                       fileName = strrchr(filePath, '/');
+                               MSG_DEBUG("filePath [%s]", filePath);
 
-                                       snprintf(thumbnailPath, sizeof(thumbnailPath), MSG_THUMBNAIL_PATH"%s.jpg", fileName+1);
+                               //delete raw file
+                               snprintf(dirPath, sizeof(dirPath), "%s.dir", filePath);
 
-                                       if (remove(thumbnailPath) == -1)
-                                               MSG_DEBUG("Fail to delete thumbnail [%s]", thumbnailPath);
-                                       else
-                                               MSG_DEBUG("Success to delete thumbnail [%s]", thumbnailPath);
-
-                                       //delete MMS_PLUGIN_MESSAGE_TABLE_NAME table data
-                                       memset(sqlQuery, 0x00, sizeof(sqlQuery));
-                                       snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE REFERENCE_ID = %d;",
-                                                                               MMS_PLUGIN_MESSAGE_TABLE_NAME, refId);
+                               if (remove(filePath) == -1)
+                                       MSG_DEBUG("Fail to delete file [%s]", filePath);
+                               else
+                                       MSG_DEBUG("Success to delete file [%s]", filePath);
 
-                                       if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS) {
-                                               MSG_DEBUG("sqlQuery [%s]", sqlQuery);
-                                               dbHandle.freeTable();
-                                               dbHandle.endTrans(false);
-                                               err = MSG_ERR_DB_EXEC;
+                               MsgRmRf(dirPath);
 
-                                               goto FREE_MEMORY;
-                                       }
+                               // remove directory also
+                               rmdir(dirPath);
 
-                                       //delete  MMS_PLUGIN_ATTRIBUTE_TABLE_NAME table data
-                                       memset(sqlQuery, 0x00, sizeof(sqlQuery));
-                                       snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE REFERENCE_ID = %d;",
-                                                                               MMS_PLUGIN_ATTRIBUTE_TABLE_NAME, refId);
+                               // delete thumbnail
+                               char *fileName = NULL;
+                               fileName = strrchr(filePath, '/');
 
-                                       if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS) {
-                                               MSG_DEBUG("sqlQuery [%s]", sqlQuery);
-                                               dbHandle.freeTable();
-                                               dbHandle.endTrans(false);
-                                               err = MSG_ERR_DB_EXEC;
+                               snprintf(thumbnailPath, sizeof(thumbnailPath), MSG_THUMBNAIL_PATH"%s.jpg", fileName+1);
 
-                                               goto FREE_MEMORY;
-                                       }
-                               } else {
-                                       MSG_DEBUG("There is remained multi-recipient mms for this msg = %d", msgId);
-                               }
+                               if (remove(thumbnailPath) == -1)
+                                       MSG_DEBUG("Fail to delete thumbnail [%s]", thumbnailPath);
+                               else
+                                       MSG_DEBUG("Success to delete thumbnail [%s]", thumbnailPath);
                        }
 
                        dbHandle.freeTable();
-               } else {
-                       memset(sqlQuery, 0x00, sizeof(sqlQuery));
-                       snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID IN \
-                                                                       (SELECT MSG_ID FROM %s WHERE ADDRESS_ID = %d);",
-                                                                       tableList[i], MSGFW_MESSAGE_TABLE_NAME, ThreadId);
-
-                       // Delete Message in specific folder from table
-                       if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS) {
-                               MSG_DEBUG("sqlQuery [%s]", sqlQuery);
-                               dbHandle.endTrans(false);
-                               err = MSG_ERR_DB_EXEC;
-
-                               goto FREE_MEMORY;
-                       }
                }
-       }
-
-       // Delete Address table
-       memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
-       if (ThreadId > 0) {
-               snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s \
-                                            WHERE ADDRESS_ID = %d;",
-                                       MSGFW_ADDRESS_TABLE_NAME, ThreadId);
+               memset(sqlQuery, 0x00, sizeof(sqlQuery));
+               snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID IN \
+                               (SELECT MSG_ID FROM %s WHERE CONV_ID = %d);",
+                               tableList[i], MSGFW_MESSAGE_TABLE_NAME, threadId);
 
+               // Delete Message in specific folder from table
                if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS) {
                        MSG_DEBUG("sqlQuery [%s]", sqlQuery);
                        dbHandle.endTrans(false);
@@ -2553,6 +2276,14 @@ MSG_ERROR_T MsgStoDeleteThreadMessageList(MSG_THREAD_ID_T ThreadId, MSG_MSGID_LI
                }
        }
 
+       // Clear Conversation table
+       if (MsgStoClearConversationTable(&dbHandle) != MSG_SUCCESS) {
+               dbHandle.endTrans(false);
+               err = MSG_ERR_DB_EXEC;
+
+               goto FREE_MEMORY;
+       }
+
        dbHandle.endTrans(true);
 
        MSG_MESSAGE_TYPE_S msgType;
@@ -2587,13 +2318,22 @@ MSG_ERROR_T MsgStoDeleteThreadMessageList(MSG_THREAD_ID_T ThreadId, MSG_MSGID_LI
        if (pMsgIdList != NULL && pToDeleteMsgIdList->nCount > 0) {
                pMsgIdList->nCount = pToDeleteMsgIdList->nCount;
 
-               pMsgIdList->msgIdList = (MSG_MESSAGE_ID_T *)new char[sizeof(MSG_MESSAGE_ID_T)*pToDeleteMsgIdList->nCount];
-               memcpy(pMsgIdList->msgIdList, pToDeleteMsgIdList->msgIdList, sizeof(MSG_MESSAGE_ID_T)*pToDeleteMsgIdList->nCount);
+               pMsgIdList->msgIdList = (msg_message_id_t *)new char[sizeof(msg_message_id_t)*pToDeleteMsgIdList->nCount];
+               memcpy(pMsgIdList->msgIdList, pToDeleteMsgIdList->msgIdList, sizeof(msg_message_id_t)*pToDeleteMsgIdList->nCount);
        }
 /*** **/
 
-       /*** Create thread  for noti delete. **/
+       /*** Create thread  for noti and phone log delete. **/
        if (pToDeleteMsgIdList->nCount > 0) {
+               msg_id_list_s *pToDeleteMsgIdListCpy = NULL;
+               pToDeleteMsgIdListCpy = (msg_id_list_s *)new char[sizeof(msg_id_list_s)];
+               memset(pToDeleteMsgIdListCpy, 0x00, sizeof(msg_id_list_s));
+
+               pToDeleteMsgIdListCpy->nCount = pToDeleteMsgIdList->nCount;
+
+               pToDeleteMsgIdListCpy->msgIdList = (msg_message_id_t *)new char[sizeof(msg_message_id_t)*pToDeleteMsgIdList->nCount];
+               memcpy(pToDeleteMsgIdListCpy->msgIdList, pToDeleteMsgIdList->msgIdList, sizeof(msg_message_id_t)*pToDeleteMsgIdList->nCount);
+
                if (g_idle_add(startToDeleteNoti, (void *)pToDeleteMsgIdList) == 0) {
                        MSG_DEBUG("startToDeleteNoti not invoked: %s", strerror(errno));
                        // memory free
@@ -2606,6 +2346,19 @@ MSG_ERROR_T MsgStoDeleteThreadMessageList(MSG_THREAD_ID_T ThreadId, MSG_MSGID_LI
                        }
                        err = MSG_ERR_UNKNOWN;
                }
+
+               if (g_idle_add(startToDeletePhoneLog, (void *)pToDeleteMsgIdListCpy) == 0) {
+                       MSG_DEBUG("startToDeletePhoneLog not invoked: %s", strerror(errno));
+                       // memory free
+                       if (pToDeleteMsgIdListCpy != NULL) {
+                               //free peer info list
+                               if (pToDeleteMsgIdListCpy->msgIdList != NULL)
+                                       delete [] pToDeleteMsgIdListCpy->msgIdList;
+
+                               delete [] pToDeleteMsgIdListCpy;
+                       }
+                       err = MSG_ERR_UNKNOWN;
+               }
        }
        /*** **/
 
@@ -2626,11 +2379,10 @@ FREE_MEMORY:
        }
 
        return err;
-
 }
 
 
-MSG_ERROR_T MsgStoCountMsgByContact(const MSG_THREAD_LIST_INDEX_S *pAddrInfo, MSG_THREAD_COUNT_INFO_S *pThreadCountInfo)
+msg_error_t MsgStoCountMsgByContact(const MSG_THREAD_LIST_INDEX_S *pAddrInfo, MSG_THREAD_COUNT_INFO_S *pThreadCountInfo)
 {
        char sqlQuery[MAX_QUERY_LEN+1];
 
@@ -2638,20 +2390,18 @@ MSG_ERROR_T MsgStoCountMsgByContact(const MSG_THREAD_LIST_INDEX_S *pAddrInfo, MS
 
        if (pAddrInfo->contactId > 0) {
                snprintf(sqlQuery, sizeof(sqlQuery), "SELECT COUNT(*) AS TOTAL, \
-                                               SUM(CASE WHEN READ_STATUS=0 AND FOLDER_ID=%d THEN 1 ELSE 0 END), \
-                                               SUM(CASE WHEN MAIN_TYPE=%d THEN 1 ELSE 0 END), \
-                                               SUM(CASE WHEN MAIN_TYPE=%d THEN 1 ELSE 0 END) \
-                                               FROM (SELECT * FROM %s A  JOIN %s B ON A.ADDRESS_ID = B.ADDRESS_ID WHERE B.CONTACT_ID = %d)",
-                                       MSG_INBOX_ID, MSG_SMS_TYPE, MSG_MMS_TYPE,
-                                       MSGFW_MESSAGE_TABLE_NAME, MSGFW_ADDRESS_TABLE_NAME, pAddrInfo->contactId);
+                               SUM(CASE WHEN READ_STATUS=0 AND FOLDER_ID=%d THEN 1 ELSE 0 END), \
+                               SUM(CASE WHEN MAIN_TYPE=%d THEN 1 ELSE 0 END), \
+                               SUM(CASE WHEN MAIN_TYPE=%d THEN 1 ELSE 0 END) \
+                               FROM (SELECT * FROM %s A  JOIN %s B ON A.ADDRESS_ID = B.ADDRESS_ID WHERE B.CONTACT_ID = %d)",
+                               MSG_INBOX_ID, MSG_SMS_TYPE, MSG_MMS_TYPE, MSGFW_MESSAGE_TABLE_NAME, MSGFW_ADDRESS_TABLE_NAME, pAddrInfo->contactId);
        } else {
                snprintf(sqlQuery, sizeof(sqlQuery), "SELECT COUNT(*) AS TOTAL, \
-                                               SUM(CASE WHEN READ_STATUS=0 AND FOLDER_ID=%d THEN 1 ELSE 0 END), \
-                                               SUM(CASE WHEN MAIN_TYPE=%d THEN 1 ELSE 0 END), \
-                                               SUM(CASE WHEN MAIN_TYPE=%d THEN 1 ELSE 0 END) \
-                                               FROM (SELECT * FROM %s A  JOIN %s B ON A.ADDRESS_ID = B.ADDRESS_ID WHERE B.ADDRESS_VAL = '%s')",
-                                       MSG_INBOX_ID, MSG_SMS_TYPE, MSG_MMS_TYPE,
-                                       MSGFW_MESSAGE_TABLE_NAME, MSGFW_ADDRESS_TABLE_NAME, pAddrInfo->msgAddrInfo.addressVal);
+                               SUM(CASE WHEN READ_STATUS=0 AND FOLDER_ID=%d THEN 1 ELSE 0 END), \
+                               SUM(CASE WHEN MAIN_TYPE=%d THEN 1 ELSE 0 END), \
+                               SUM(CASE WHEN MAIN_TYPE=%d THEN 1 ELSE 0 END) \
+                               FROM (SELECT * FROM %s A  JOIN %s B ON A.ADDRESS_ID = B.ADDRESS_ID WHERE B.ADDRESS_VAL = '%s')",
+                               MSG_INBOX_ID, MSG_SMS_TYPE, MSG_MMS_TYPE, MSGFW_MESSAGE_TABLE_NAME, MSGFW_ADDRESS_TABLE_NAME, pAddrInfo->msgAddrInfo.addressVal);
        }
 
        if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS)
@@ -2673,29 +2423,22 @@ MSG_ERROR_T MsgStoCountMsgByContact(const MSG_THREAD_LIST_INDEX_S *pAddrInfo, MS
 }
 
 
-MSG_ERROR_T MsgStoSearchMessage(const char *pSearchString, MSG_THREAD_VIEW_LIST_S *pThreadViewList)
+msg_error_t MsgStoSearchMessage(const char *pSearchString, msg_struct_list_s *pThreadViewList)
 {
        if (!pSearchString)
                return MSG_ERR_NULL_POINTER;
 
        // Clear Out Parameter
        pThreadViewList->nCount = 0;
-       pThreadViewList->msgThreadInfo = NULL;
+       pThreadViewList->msg_struct_info = NULL;
 
-       tr1::unordered_set<MSG_THREAD_ID_T> IdList;
+       tr1::unordered_set<msg_thread_id_t> IdList;
        queue<MSG_THREAD_VIEW_S> searchList;
 
        MSG_THREAD_VIEW_S threadView;
 
        char sqlQuery[MAX_QUERY_LEN+1];
 
-       char firstName[MAX_DISPLAY_NAME_LEN+1];
-       char lastName[MAX_DISPLAY_NAME_LEN+1];
-       char displayName[MAX_DISPLAY_NAME_LEN+1];
-
-       // Get Name Order
-       int order = MsgGetContactNameOrder();
-
        // Replace string for '%' and '_' character
        char *ext1_str = NULL;
        char *ext2_str = NULL;
@@ -2706,22 +2449,20 @@ MSG_ERROR_T MsgStoSearchMessage(const char *pSearchString, MSG_THREAD_VIEW_LIST_
        // Search - Address, Name
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
-       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT A.ADDRESS_ID, A.CONTACT_ID, A.ADDRESS_VAL, \
-                                               A.DISPLAY_NAME, A.FIRST_NAME, A.LAST_NAME, A.IMAGE_PATH, \
-                                               A.UNREAD_CNT, A.SMS_CNT, A.MMS_CNT, \
-                                               A.MSG_DIRECTION, B.DISPLAY_TIME, B.MSG_TEXT \
-                                               FROM %s A, %s B \
-                                       WHERE A.ADDRESS_ID = B.ADDRESS_ID AND A.ADDRESS_ID <> 0 \
-                                               AND B.FOLDER_ID > 0 AND B.FOLDER_ID < %d \
-                                               AND ( B.MSG_TEXT LIKE '%%%s%%' ESCAPE '\\' \
-                                               OR B.SUBJECT LIKE '%%%s%%' ESCAPE '\\' \
-                                               OR A.ADDRESS_VAL LIKE '%%%s%%' ESCAPE '\\' \
-                                               OR A.DISPLAY_NAME LIKE '%%%s%%' ESCAPE '\\' \
-                                               OR A.FIRST_NAME LIKE '%%%s%%' ESCAPE '\\' \
-                                               OR A.LAST_NAME LIKE '%%%s%%' ESCAPE '\\') \
-                                       ORDER BY B.DISPLAY_TIME DESC;",
-                                               MSGFW_ADDRESS_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME, MSG_CBMSGBOX_ID,
-                                               ext2_str, ext2_str, ext2_str, ext2_str, ext2_str, ext2_str);
+       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT C.CONV_ID, C.UNREAD_CNT, C.SMS_CNT, C.MMS_CNT, C.DISPLAY_NAME, \
+                       B.MAIN_TYPE, B.SUB_TYPE, B.MSG_DIRECTION, B.DISPLAY_TIME, B.MSG_TEXT \
+                       FROM %s A, %s B, %s C \
+                       WHERE A.CONV_ID = B.CONV_ID AND B.FOLDER_ID > 0 AND B.FOLDER_ID < %d \
+                       AND ( B.MSG_TEXT LIKE '%%%s%%' ESCAPE '\\' \
+                       OR B.SUBJECT LIKE '%%%s%%' ESCAPE '\\' \
+                       OR A.ADDRESS_VAL LIKE '%%%s%%' ESCAPE '\\' \
+                       OR A.DISPLAY_NAME LIKE '%%%s%%' ESCAPE '\\' \
+                       OR A.FIRST_NAME LIKE '%%%s%%' ESCAPE '\\' \
+                       OR A.LAST_NAME LIKE '%%%s%%' ESCAPE '\\' ) \
+                       AND A.CONV_ID = C.CONV_ID \
+                       ORDER BY B.DISPLAY_TIME DESC;",
+                       MSGFW_ADDRESS_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME, MSGFW_CONVERSATION_TABLE_NAME,
+                       MSG_SPAMBOX_ID, ext2_str, ext2_str, ext2_str, ext2_str, ext2_str, ext2_str);
 
 
        if (ext1_str) {
@@ -2734,63 +2475,32 @@ MSG_ERROR_T MsgStoSearchMessage(const char *pSearchString, MSG_THREAD_VIEW_LIST_
                ext2_str = NULL;
        }
 
-       if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS)
+       MSG_DEBUG("[%s]", sqlQuery);
+
+       if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS) {
+               MSG_DEBUG("Prepare query fail. [%s]", sqlQuery);
                return MSG_ERR_DB_PREPARE;
+       }
 
        while (dbHandle.stepQuery() == MSG_ERR_DB_ROW) {
                memset(&threadView, 0x00, sizeof(threadView));
 
                threadView.threadId = dbHandle.columnInt(0);
-               threadView.contactId = dbHandle.columnInt(1);
-
-               memset(threadView.threadAddr, 0x00, sizeof(threadView.threadAddr));
-               strncpy(threadView.threadAddr, (char *)dbHandle.columnText(2), MAX_THREAD_ADDR_LEN);
-
-               memset(displayName, 0x00, sizeof(displayName));
-               strncpy(displayName, (char *)dbHandle.columnText(3), MAX_DISPLAY_NAME_LEN);
-
-               memset(firstName, 0x00, sizeof(firstName));
-               strncpy(firstName, (char *)dbHandle.columnText(4), MAX_DISPLAY_NAME_LEN);
-
-               memset(lastName, 0x00, sizeof(lastName));
-               strncpy(lastName, (char *)dbHandle.columnText(5), MAX_DISPLAY_NAME_LEN);
-
-               if (strlen(displayName) <= 0) {
-                       if (order == 0) {
-                               if (firstName[0] != '\0') {
-                                       strncpy(displayName, firstName, MAX_DISPLAY_NAME_LEN);
-                               }
-
-                               if (lastName[0] != '\0') {
-                                       strncat(displayName, " ", MAX_DISPLAY_NAME_LEN-strlen(displayName));
-                                       strncat(displayName, lastName, MAX_DISPLAY_NAME_LEN-strlen(displayName));
-                               }
-                       } else if (order == 1) {
-                               if (lastName[0] != '\0') {
-                                       strncpy(displayName, lastName, MAX_DISPLAY_NAME_LEN);
-                                       strncat(displayName, " ", MAX_DISPLAY_NAME_LEN-strlen(displayName));
-                               }
-
-                               if (firstName[0] != '\0') {
-                                       strncat(displayName, firstName, MAX_DISPLAY_NAME_LEN-strlen(displayName));
-                               }
-                       }
-               }
-
-               strncpy(threadView.threadName, displayName, MAX_THREAD_NAME_LEN);
+               threadView.unreadCnt = dbHandle.columnInt(1);
+               threadView.smsCnt = dbHandle.columnInt(2);
+               threadView.mmsCnt = dbHandle.columnInt(3);
 
-               strncpy(threadView.threadImagePath, (char *)dbHandle.columnText(6), MAX_IMAGE_PATH_LEN);
+               strncpy(threadView.threadName, (char *)dbHandle.columnText(4), MAX_THREAD_NAME_LEN);
 
-               threadView.unreadCnt = dbHandle.columnInt(7);
-               threadView.smsCnt = dbHandle.columnInt(8);
-               threadView.mmsCnt = dbHandle.columnInt(9);
+               threadView.mainType = dbHandle.columnInt(5);
+               threadView.subType = dbHandle.columnInt(6);
 
-               threadView.direction = dbHandle.columnInt(10);
-               threadView.threadTime = (time_t)dbHandle.columnInt(11);
+               threadView.direction = dbHandle.columnInt(7);
+               threadView.threadTime = (time_t)dbHandle.columnInt(8);
 
-               strncpy(threadView.threadData, (char *)dbHandle.columnText(12), MAX_THREAD_DATA_LEN);
+               strncpy(threadView.threadData, (char *)dbHandle.columnText(9), MAX_THREAD_DATA_LEN);
 
-               tr1::unordered_set<MSG_THREAD_ID_T>::iterator it;
+               tr1::unordered_set<msg_thread_id_t>::iterator it;
 
                it = IdList.find(threadView.threadId);
 
@@ -2805,16 +2515,22 @@ MSG_ERROR_T MsgStoSearchMessage(const char *pSearchString, MSG_THREAD_VIEW_LIST_
 
        // Add data to Out Parameter
        pThreadViewList->nCount = searchList.size();
-       pThreadViewList->msgThreadInfo = (msg_thread_view_t *)new char[sizeof(MSG_THREAD_VIEW_S *) * searchList.size()];
+       pThreadViewList->msg_struct_info = (msg_struct_t *)new char[sizeof(msg_struct_t) * searchList.size()];
 
        MSG_THREAD_VIEW_S *pTmp = NULL;
+       msg_struct_s *thread_t = NULL;
 
        int index = 0;
 
        while (!searchList.empty()) {
-               pThreadViewList->msgThreadInfo[index] = (msg_thread_view_t)new char[sizeof(MSG_THREAD_VIEW_S)];
+               thread_t = (msg_struct_s *)new msg_struct_s;
+               pThreadViewList->msg_struct_info[index] = (msg_struct_t)thread_t;
 
-               pTmp = (MSG_THREAD_VIEW_S *)pThreadViewList->msgThreadInfo[index];
+               thread_t->type = MSG_STRUCT_THREAD_INFO;
+               thread_t->data = new MSG_THREAD_VIEW_S;
+
+               pTmp = (MSG_THREAD_VIEW_S *)thread_t->data;
+               memset(pTmp, 0x00, sizeof(MSG_THREAD_VIEW_S));
 
                memcpy(pTmp, &(searchList.front()), sizeof(MSG_THREAD_VIEW_S));
 
@@ -2827,16 +2543,14 @@ MSG_ERROR_T MsgStoSearchMessage(const char *pSearchString, MSG_THREAD_VIEW_LIST_
 }
 
 
-MSG_ERROR_T MsgStoSearchMessage(const MSG_SEARCH_CONDITION_S *pSearchCon, int offset, int limit, MSG_LIST_S *pMsgList)
+msg_error_t MsgStoSearchMessage(const MSG_SEARCH_CONDITION_S *pSearchCon, int offset, int limit, msg_struct_list_s *pMsgList)
 {
        // Clear Out Parameter
        pMsgList->nCount = 0;
-       pMsgList->msgInfo = NULL;
+       pMsgList->msg_struct_info = NULL;
 
        int rowCnt = 0;
-       int index = 27; // numbers of index
-
-       unsigned int addrId = 0;
+       int index = 26; // numbers of index
 
        char sqlQuery[MAX_QUERY_LEN+1];
        char sqlQuerySubset[(MAX_QUERY_LEN/5)+1];
@@ -2852,13 +2566,13 @@ MSG_ERROR_T MsgStoSearchMessage(const MSG_SEARCH_CONDITION_S *pSearchCon, int of
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
-       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT A.MSG_ID, A.ADDRESS_ID, A.FOLDER_ID, A.REFERENCE_ID, A.STORAGE_ID, A.MAIN_TYPE, A.SUB_TYPE, \
-                                                       A.DISPLAY_TIME, A.DATA_SIZE, A.NETWORK_STATUS, A.READ_STATUS, A.PROTECTED, A.BACKUP, A.PRIORITY, \
-                                                       A.MSG_DIRECTION, A.SCHEDULED_TIME, A.SUBJECT, A.MSG_TEXT, B.ADDRESS_TYPE, B.RECIPIENT_TYPE, \
-                                                       B.CONTACT_ID, B.ADDRESS_VAL, B.DISPLAY_NAME, B.FIRST_NAME, B.LAST_NAME, A.ATTACHMENT_COUNT, A.THUMB_PATH \
-                                                       FROM %s A, %s B \
-                                                       WHERE A.ADDRESS_ID = B.ADDRESS_ID AND B.ADDRESS_ID <> 0 ",
-                                                       MSGFW_MESSAGE_TABLE_NAME, MSGFW_ADDRESS_TABLE_NAME);
+       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT A.MSG_ID, A.CONV_ID, A.FOLDER_ID, A.STORAGE_ID, A.MAIN_TYPE, A.SUB_TYPE, \
+                       A.DISPLAY_TIME, A.DATA_SIZE, A.NETWORK_STATUS, A.READ_STATUS, A.PROTECTED, A.BACKUP, A.PRIORITY, \
+                       A.MSG_DIRECTION, A.SCHEDULED_TIME, A.SUBJECT, A.MSG_TEXT, B.ADDRESS_TYPE, B.RECIPIENT_TYPE, \
+                       B.CONTACT_ID, B.ADDRESS_VAL, B.DISPLAY_NAME, B.FIRST_NAME, B.LAST_NAME, A.ATTACHMENT_COUNT, A.THUMB_PATH \
+                       FROM %s A, %s B \
+                       WHERE A.CONV_ID = B.CONV_ID AND B.ADDRESS_ID <> 0 ",
+                       MSGFW_MESSAGE_TABLE_NAME, MSGFW_ADDRESS_TABLE_NAME);
 
        //// folder
        memset(sqlQuerySubset, 0x00, sizeof(sqlQuerySubset));
@@ -2899,6 +2613,7 @@ MSG_ERROR_T MsgStoSearchMessage(const MSG_SEARCH_CONDITION_S *pSearchCon, int of
 
                default:
                        MSG_DEBUG("msg type is not set.");
+                       break;
        }
 
        strncat(sqlQuery, sqlQuerySubset, MAX_QUERY_LEN-strlen(sqlQuery));
@@ -2912,12 +2627,12 @@ MSG_ERROR_T MsgStoSearchMessage(const MSG_SEARCH_CONDITION_S *pSearchCon, int of
 
                memset(sqlQuerySubset, 0x00, sizeof(sqlQuerySubset));
                snprintf(sqlQuerySubset, sizeof(sqlQuerySubset), "AND ( A.MSG_TEXT LIKE '%%%s%%' ESCAPE '\\' \
-                                                               OR A.SUBJECT LIKE '%%%s%%' ESCAPE '\\' \
-                                                               OR B.ADDRESS_VAL LIKE '%%%s%%' ESCAPE '\\' \
-                                                               OR B.DISPLAY_NAME LIKE '%%%s%%' ESCAPE '\\' \
-                                                               OR B.FIRST_NAME LIKE '%%%s%%' ESCAPE '\\' \
-                                                               OR B.LAST_NAME LIKE '%%%s%%' ESCAPE '\\') ",
-                                                               ext2_str, ext2_str, ext2_str, ext2_str, ext2_str, ext2_str);
+                               OR A.SUBJECT LIKE '%%%s%%' ESCAPE '\\' \
+                               OR B.ADDRESS_VAL LIKE '%%%s%%' ESCAPE '\\' \
+                               OR B.DISPLAY_NAME LIKE '%%%s%%' ESCAPE '\\' \
+                               OR B.FIRST_NAME LIKE '%%%s%%' ESCAPE '\\' \
+                               OR B.LAST_NAME LIKE '%%%s%%' ESCAPE '\\') ",
+                               ext2_str, ext2_str, ext2_str, ext2_str, ext2_str, ext2_str);
                strncat(sqlQuery, sqlQuerySubset, MAX_QUERY_LEN-strlen(sqlQuery));
 
                if (ext1_str) {
@@ -2939,7 +2654,7 @@ MSG_ERROR_T MsgStoSearchMessage(const MSG_SEARCH_CONDITION_S *pSearchCon, int of
                ext2_str = MsgStoReplaceString(ext1_str, "%", "\\%");
 
                memset(sqlQuerySubset, 0x00, sizeof(sqlQuerySubset));
-               snprintf(sqlQuerySubset, sizeof(sqlQuerySubset), "AND B.ADDRESS_VAL LIKE '%%%s%%' ESCAPE '\\'", ext2_str);
+               snprintf(sqlQuerySubset, sizeof(sqlQuerySubset), "AND B.ADDRESS_VAL LIKE '%%%s%%' ESCAPE '\\' ", ext2_str);
                strncat(sqlQuery, sqlQuerySubset, MAX_QUERY_LEN-strlen(sqlQuery));
 
                if (ext1_str) {
@@ -2963,14 +2678,14 @@ MSG_ERROR_T MsgStoSearchMessage(const MSG_SEARCH_CONDITION_S *pSearchCon, int of
 
        strncat(sqlQuery, sqlQuerySubset, MAX_QUERY_LEN-strlen(sqlQuery));
 
-       MSG_ERROR_T err = dbHandle.getTable(sqlQuery, &rowCnt);
+       msg_error_t err = dbHandle.getTable(sqlQuery, &rowCnt);
 
        if (err == MSG_ERR_DB_NORECORD) {
                dbHandle.freeTable();
 
                return MSG_SUCCESS;
        } else if (err != MSG_SUCCESS) {
-               MSG_DEBUG("%s", sqlQuery);
+               MSG_DEBUG("Get table fail. [%s]", sqlQuery);
 
                dbHandle.freeTable();
 
@@ -2981,27 +2696,32 @@ MSG_ERROR_T MsgStoSearchMessage(const MSG_SEARCH_CONDITION_S *pSearchCon, int of
 
        MSG_DEBUG("pMsgList->nCount [%d]", pMsgList->nCount);
 
-       pMsgList->msgInfo = (msg_message_t *)new char[sizeof(MSG_MESSAGE_S *) * rowCnt];
+       pMsgList->msg_struct_info = (msg_struct_t *)new char[sizeof(msg_struct_t) * rowCnt];
 
-       MSG_MESSAGE_S *pTmp = NULL;
+       MSG_MESSAGE_HIDDEN_S *pTmp = NULL;
+       msg_struct_s *msg = NULL;
 
        for (int i = 0; i < rowCnt; i++) {
-               pMsgList->msgInfo[i] = (msg_message_t)new char[sizeof(MSG_MESSAGE_S)];
+               pMsgList->msg_struct_info[i] = (msg_struct_t)new msg_struct_s;
+
+               msg = (msg_struct_s *)pMsgList->msg_struct_info[i];
 
-               pTmp = (MSG_MESSAGE_S *)pMsgList->msgInfo[i];
+               msg->type = MSG_STRUCT_MESSAGE_INFO;
+               msg->data = (int *)new char[sizeof(MSG_MESSAGE_HIDDEN_S)];
 
-               memset(pTmp, 0x00, sizeof(pTmp));
+               pTmp = (MSG_MESSAGE_HIDDEN_S *)msg->data;
+
+               memset(pTmp, 0x00, sizeof(MSG_MESSAGE_HIDDEN_S));
 
                pTmp->pData = NULL;
                pTmp->pMmsData = NULL;
 
                pTmp->msgId = dbHandle.getColumnToInt(index++);
-               addrId = dbHandle.getColumnToInt(index++);
+               pTmp->threadId = dbHandle.getColumnToInt(index++);
                pTmp->folderId = dbHandle.getColumnToInt(index++);
-               pTmp->referenceId = dbHandle.getColumnToInt(index++);
                pTmp->storageId = dbHandle.getColumnToInt(index++);
-               pTmp->msgType.mainType = dbHandle.getColumnToInt(index++);
-               pTmp->msgType.subType = dbHandle.getColumnToInt(index++);
+               pTmp->mainType = dbHandle.getColumnToInt(index++);
+               pTmp->subType = dbHandle.getColumnToInt(index++);
                pTmp->displayTime = (time_t)dbHandle.getColumnToInt(index++);
                pTmp->dataSize = dbHandle.getColumnToInt(index++);
                pTmp->networkStatus = dbHandle.getColumnToInt(index++);
@@ -3010,12 +2730,12 @@ MSG_ERROR_T MsgStoSearchMessage(const MSG_SEARCH_CONDITION_S *pSearchCon, int of
                pTmp->bBackup = dbHandle.getColumnToInt(index++);
                pTmp->priority = dbHandle.getColumnToInt(index++);
                pTmp->direction= dbHandle.getColumnToInt(index++);
-               pTmp->scheduledTime = (time_t)dbHandle.getColumnToInt(index++);
+               index++; // This field is reserved.
 
                dbHandle.getColumnToString(index++, MAX_SUBJECT_LEN, pTmp->subject);
 
-               if (pTmp->msgType.mainType == MSG_MMS_TYPE &&
-                       (pTmp->networkStatus == MSG_NETWORK_RETRIEVING || pTmp->networkStatus == MSG_NETWORK_RETRIEVE_FAIL || pTmp->msgType.subType == MSG_NOTIFICATIONIND_MMS)) {
+               if (pTmp->mainType == MSG_MMS_TYPE &&
+                       (pTmp->networkStatus == MSG_NETWORK_RETRIEVING || pTmp->networkStatus == MSG_NETWORK_RETRIEVE_FAIL || pTmp->subType == MSG_NOTIFICATIONIND_MMS)) {
                        pTmp->pData = NULL;
                        index++;
                } else {
@@ -3026,17 +2746,32 @@ MSG_ERROR_T MsgStoSearchMessage(const MSG_SEARCH_CONDITION_S *pSearchCon, int of
                        dbHandle.getColumnToString(index++, pTmp->dataSize+1, (char *)pTmp->pData);
                }
 
-               if (addrId > 0)
-                       pTmp->nAddressCnt = 1;
-               else
-                       pTmp->nAddressCnt = 0;
+               msg_struct_list_s *addr_list = (msg_struct_list_s *)new msg_struct_list_s;
+               msg_struct_s *addr_info = NULL;
+               MSG_ADDRESS_INFO_S *address = NULL;
+
+               addr_list->nCount = 1;
+               addr_list->msg_struct_info = (msg_struct_t *)new char[sizeof(msg_struct_t *)*MAX_TO_ADDRESS_CNT];
 
-               pTmp->addressList[0].threadId = addrId;
-               pTmp->addressList[0].addressType = dbHandle.getColumnToInt(index++);
-               pTmp->addressList[0].recipientType = dbHandle.getColumnToInt(index++);
-               pTmp->addressList[0].contactId = dbHandle.getColumnToInt(index++);
+               msg_struct_s *pTmpAddr = NULL;
 
-               dbHandle.getColumnToString(index++, MAX_ADDRESS_VAL_LEN, pTmp->addressList[0].addressVal);
+               for (int i = 0; i < MAX_TO_ADDRESS_CNT; i++) {
+                       addr_list->msg_struct_info[i] = (msg_struct_t)new char[sizeof(msg_struct_s)];
+                       pTmpAddr = (msg_struct_s *)addr_list->msg_struct_info[i];
+                       pTmpAddr->type = MSG_STRUCT_ADDRESS_INFO;
+                       pTmpAddr->data = new MSG_ADDRESS_INFO_S;
+                       memset(pTmpAddr->data, 0x00, sizeof(MSG_ADDRESS_INFO_S));
+
+                       addr_list->msg_struct_info[i] = (msg_struct_t)pTmpAddr;
+               }
+
+               addr_info = (msg_struct_s *)addr_list->msg_struct_info[0];
+               address = (MSG_ADDRESS_INFO_S *)addr_info->data;
+               address->addressType = dbHandle.getColumnToInt(index++);
+               address->recipientType = dbHandle.getColumnToInt(index++);
+               address->contactId = dbHandle.getColumnToInt(index++);
+
+               dbHandle.getColumnToString(index++, MAX_ADDRESS_VAL_LEN, address->addressVal);
 
                memset(displayName, 0x00, sizeof(displayName));
                dbHandle.getColumnToString(index++, MAX_DISPLAY_NAME_LEN, displayName);
@@ -3069,7 +2804,9 @@ MSG_ERROR_T MsgStoSearchMessage(const MSG_SEARCH_CONDITION_S *pSearchCon, int of
                        }
                }
 
-               strncpy(pTmp->addressList[0].displayName, displayName, MAX_DISPLAY_NAME_LEN);
+               strncpy(address->displayName, displayName, MAX_DISPLAY_NAME_LEN);
+
+               pTmp->addr_list = addr_list;
 
                pTmp->attachCount = dbHandle.getColumnToInt(index++);
 
@@ -3082,56 +2819,6 @@ MSG_ERROR_T MsgStoSearchMessage(const MSG_SEARCH_CONDITION_S *pSearchCon, int of
 }
 
 
-
-MSG_ERROR_T MsgStoGetMsgIdList(MSG_REFERENCE_ID_T RefId, MSG_MSGID_LIST_S *pMsgIdList)
-{
-       // Clear Out Parameter
-       pMsgIdList->nCount = 0;
-       pMsgIdList->msgIdList = NULL;
-
-       int rowCnt = 0;
-       int index = 1; // numbers of index
-
-       char sqlQuery[MAX_QUERY_LEN+1];
-
-       // Search - Address, Name
-       memset(sqlQuery, 0x00, sizeof(sqlQuery));
-
-       snprintf(sqlQuery, sizeof(sqlQuery),
-               "SELECT MSG_ID \
-                                       FROM %s \
-                                    WHERE REFERENCE_ID = %d \
-                                     ORDER BY MSG_ID ASC;",
-                                     MSGFW_MESSAGE_TABLE_NAME, RefId);
-
-       MSG_ERROR_T err = dbHandle.getTable(sqlQuery, &rowCnt);
-
-       if (err != MSG_SUCCESS) {
-               MSG_DEBUG("%s", sqlQuery);
-
-               dbHandle.freeTable();
-
-               return err;
-       }
-
-       pMsgIdList->nCount = rowCnt;
-
-       MSG_DEBUG("pMsgIdList->nCount [%d]", pMsgIdList->nCount);
-
-       pMsgIdList->msgIdList = (MSG_MESSAGE_ID_T *)new char[sizeof(MSG_MESSAGE_ID_T *) * rowCnt];
-
-       for (int i = 0; i < rowCnt; i++) {
-               pMsgIdList->msgIdList[i] = (MSG_MESSAGE_ID_T)new char[sizeof(MSG_MESSAGE_ID_T)];
-
-               pMsgIdList->msgIdList[i] = dbHandle.getColumnToInt(index++);
-       }
-
-       dbHandle.freeTable();
-
-       return MSG_SUCCESS;
-}
-
-
 void MsgConvertNumber(const char *pSrcNum, char *pDestNum)
 {
        int overLen = 0;
@@ -3146,11 +2833,11 @@ void MsgConvertNumber(const char *pSrcNum, char *pDestNum)
 }
 
 
-MSG_ERROR_T MsgStoGetRejectMsgList(const char *pNumber, MSG_REJECT_MSG_LIST_S *pRejectMsgList)
+msg_error_t MsgStoGetRejectMsgList(const char *pNumber, msg_struct_list_s *pRejectMsgList)
 {
        // Clear Out Parameter
        pRejectMsgList->nCount = 0;
-       pRejectMsgList->rejectMsgInfo = NULL;
+       pRejectMsgList->msg_struct_info = NULL;
 
        int rowCnt = 0;
        int index = 3; // numbers of index
@@ -3164,35 +2851,28 @@ MSG_ERROR_T MsgStoGetRejectMsgList(const char *pNumber, MSG_REJECT_MSG_LIST_S *p
                char phoneNumber[MAX_PRECONFIG_NUM+1];
                memset(phoneNumber, 0x00, sizeof(phoneNumber));
 
-               if (strlen(pNumber) > MAX_PRECONFIG_NUM) {
+               if (strlen(pNumber) > MAX_PRECONFIG_NUM)
                        MsgConvertNumber(pNumber, phoneNumber);
-               } else {
+               else
                        strncpy(phoneNumber, pNumber, MAX_PRECONFIG_NUM);
-               }
 
-               snprintf(sqlQuery, sizeof(sqlQuery),
-                       "SELECT B.MSG_ID, B.MSG_TEXT, B.DISPLAY_TIME \
-                                               FROM %s A, %s B \
-                                            WHERE A.ADDRESS_ID = B.ADDRESS_ID \
-                                                 AND B.MAIN_TYPE = %d \
-                                                 AND B.SUB_TYPE = %d \
-                                                 AND A.ADDRESS_VAL LIKE '%%%s' \
-                                             ORDER BY B.DISPLAY_TIME DESC;",
-                                             MSGFW_ADDRESS_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME,
-                                             MSG_SMS_TYPE, MSG_REJECT_SMS, phoneNumber);
+               snprintf(sqlQuery, sizeof(sqlQuery), "SELECT B.MSG_ID, B.MSG_TEXT, B.DISPLAY_TIME \
+                               FROM %s A, %s B \
+                               WHERE A.CONV_ID = B.CONV_ID AND B.MAIN_TYPE = %d \
+                               AND B.SUB_TYPE = %d AND A.ADDRESS_VAL LIKE '%%%s' \
+                               ORDER BY B.DISPLAY_TIME DESC;",
+                               MSGFW_ADDRESS_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME,
+                               MSG_SMS_TYPE, MSG_REJECT_SMS, phoneNumber);
        } else {
-               snprintf(sqlQuery, sizeof(sqlQuery),
-                       "SELECT B.MSG_ID, B.MSG_TEXT, B.DISPLAY_TIME \
-                                               FROM %s A, %s B \
-                                            WHERE A.ADDRESS_ID = B.ADDRESS_ID \
-                                                 AND B.MAIN_TYPE = %d \
-                                                 AND B.SUB_TYPE = %d \
-                                             ORDER BY B.DISPLAY_TIME DESC;",
-                                             MSGFW_ADDRESS_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME,
-                                             MSG_SMS_TYPE, MSG_REJECT_SMS);
+               snprintf(sqlQuery, sizeof(sqlQuery), "SELECT B.MSG_ID, B.MSG_TEXT, B.DISPLAY_TIME \
+                               FROM %s A, %s B \
+                               WHERE A.CONV_ID = B.CONV_ID AND B.MAIN_TYPE = %d AND B.SUB_TYPE = %d \
+                               ORDER BY B.DISPLAY_TIME DESC;",
+                               MSGFW_ADDRESS_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME,
+                               MSG_SMS_TYPE, MSG_REJECT_SMS);
        }
 
-       MSG_ERROR_T  err = dbHandle.getTable(sqlQuery, &rowCnt);
+       msg_error_t  err = dbHandle.getTable(sqlQuery, &rowCnt);
 
        if (err != MSG_SUCCESS) {
                MSG_DEBUG("%s", sqlQuery);
@@ -3206,19 +2886,24 @@ MSG_ERROR_T MsgStoGetRejectMsgList(const char *pNumber, MSG_REJECT_MSG_LIST_S *p
 
        MSG_DEBUG("pRejectMsgList->nCount [%d]", pRejectMsgList->nCount);
 
-       pRejectMsgList->rejectMsgInfo = (MSG_REJECT_MSG_INFO_S *)new char[sizeof(MSG_REJECT_MSG_INFO_S)*rowCnt];
+       pRejectMsgList->msg_struct_info = (msg_struct_t *)new char[sizeof(MSG_REJECT_MSG_INFO_S *)*rowCnt];
 
-       MSG_REJECT_MSG_INFO_S *pTmp = pRejectMsgList->rejectMsgInfo;
+       msg_struct_s* pTmp = NULL;
 
        for (int i = 0; i < rowCnt; i++) {
-               pTmp->msgId = dbHandle.getColumnToInt(index++);
+               pRejectMsgList->msg_struct_info[i] = (msg_struct_t)new char[sizeof(msg_struct_s)];
 
-               memset(pTmp->msgText, 0x00, sizeof(pTmp->msgText));
-               dbHandle.getColumnToString(index++, MAX_MSG_TEXT_LEN, pTmp->msgText);
+               pTmp = (msg_struct_s *)pRejectMsgList->msg_struct_info[i];
+               pTmp->type = MSG_STRUCT_REJECT_MSG_INFO;
+               pTmp->data = new char[sizeof(MSG_FOLDER_INFO_S)];
+               MSG_REJECT_MSG_INFO_S * pMsg = (MSG_REJECT_MSG_INFO_S *)pTmp->data;
+               memset(pMsg, 0x00, sizeof(MSG_REJECT_MSG_INFO_S));
 
-               pTmp->displayTime = (time_t)dbHandle.getColumnToInt(index++);
+               pMsg->msgId = dbHandle.getColumnToInt(index++);
+               memset(pMsg->msgText, 0x00, sizeof(pMsg->msgText));
+               dbHandle.getColumnToString(index++, MAX_MSG_TEXT_LEN, pMsg->msgText);
 
-               pTmp++;
+               pMsg->displayTime = (time_t)dbHandle.getColumnToInt(index++);
        }
 
        dbHandle.freeTable();
@@ -3227,14 +2912,14 @@ MSG_ERROR_T MsgStoGetRejectMsgList(const char *pNumber, MSG_REJECT_MSG_LIST_S *p
 }
 
 
-MSG_ERROR_T MsgStoGetSyncMLExtId(MSG_MESSAGE_ID_T msgId, int *extId)
+msg_error_t MsgStoGetSyncMLExtId(msg_message_id_t msgId, int *extId)
 {
        char sqlQuery[MAX_QUERY_LEN+1];
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
        snprintf(sqlQuery, sizeof(sqlQuery), "SELECT EXT_ID FROM %s WHERE MSG_ID = %d;",
-                               MSGFW_SYNCML_MSG_TABLE_NAME, msgId);
+                       MSGFW_SYNCML_MSG_TABLE_NAME, msgId);
 
        if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS)
                return MSG_ERR_DB_PREPARE;
@@ -3252,23 +2937,23 @@ MSG_ERROR_T MsgStoGetSyncMLExtId(MSG_MESSAGE_ID_T msgId, int *extId)
 }
 
 
-MSG_ERROR_T MsgStoGetReportStatus(MSG_MESSAGE_ID_T msgId, MSG_REPORT_STATUS_INFO_S *pReportStatus)
+msg_error_t MsgStoGetReportStatus(msg_message_id_t msgId, MSG_REPORT_STATUS_INFO_S *pReportStatus)
 {
        char sqlQuery[MAX_QUERY_LEN+1];
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
-       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT DELIVERY_REPORT_STATUS, DELIVERY_REPORT_TIME, READ_REPORT_STATUS, READ_REPORT_TIME \
-                                                                       FROM %s WHERE MSG_ID = %d;",
-                                                       MSGFW_MESSAGE_TABLE_NAME, msgId);
+       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT DELIVERY_REPORT_STATUS, \
+                       DELIVERY_REPORT_TIME, READ_REPORT_STATUS, READ_REPORT_TIME \
+                       FROM %s WHERE MSG_ID = %d;", MSGFW_MESSAGE_TABLE_NAME, msgId);
 
        if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS)
                return MSG_ERR_DB_PREPARE;
 
        if (dbHandle.stepQuery() == MSG_ERR_DB_ROW) {
-               pReportStatus->deliveryStatus = (MSG_DELIVERY_REPORT_STATUS_T)dbHandle.columnInt(0);
+               pReportStatus->deliveryStatus = (msg_delivery_report_status_t)dbHandle.columnInt(0);
                pReportStatus->deliveryStatusTime = (time_t)dbHandle.columnInt(1);
-               pReportStatus->readStatus = (MSG_READ_REPORT_STATUS_T)dbHandle.columnInt(2);
+               pReportStatus->readStatus = (msg_read_report_status_t)dbHandle.columnInt(2);
                pReportStatus->readStatusTime = (time_t)dbHandle.columnInt(3);
        }
 
@@ -3278,7 +2963,23 @@ MSG_ERROR_T MsgStoGetReportStatus(MSG_MESSAGE_ID_T msgId, MSG_REPORT_STATUS_INFO
 }
 
 
-MSG_ERROR_T MsgStoGetThreadUnreadCnt(MSG_THREAD_ID_T ThreadId, int *cnt)
+msg_error_t MsgStoGetThreadIdByAddress(const MSG_MESSAGE_INFO_S *pMsg, msg_thread_id_t *pThreadId)
+{
+       if(pMsg->nAddressCnt > 0) {
+               if (MsgExistAddress(&dbHandle, pMsg, pThreadId) == true) {
+                       MSG_DEBUG("Conversation ID : [%d]", *pThreadId);
+               } else {
+                       *pThreadId = 0;
+                       return MSG_ERR_STORAGE_ERROR;
+               }
+       } else {
+               *pThreadId = 0;
+       }
+       return MSG_SUCCESS;
+}
+
+
+msg_error_t MsgStoGetThreadUnreadCnt(msg_thread_id_t threadId, int *cnt)
 {
        MSG_BEGIN();
 
@@ -3292,8 +2993,7 @@ MSG_ERROR_T MsgStoGetThreadUnreadCnt(MSG_THREAD_ID_T ThreadId, int *cnt)
        // Get MSG_ID
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
        snprintf(sqlQuery, sizeof(sqlQuery), "SELECT COUNT(MSG_ID) FROM %s A \
-                                    WHERE ADDRESS_ID = %d AND READ_STATUS = 0;",
-                               MSGFW_MESSAGE_TABLE_NAME, ThreadId);
+                       WHERE CONV_ID = %d AND READ_STATUS = 0;", MSGFW_MESSAGE_TABLE_NAME, threadId);
 
        if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS)
                return MSG_ERR_DB_PREPARE;
@@ -3311,3 +3011,247 @@ MSG_ERROR_T MsgStoGetThreadUnreadCnt(MSG_THREAD_ID_T ThreadId, int *cnt)
        return MSG_SUCCESS;
 }
 
+
+msg_error_t MsgStoGetAddressList(const msg_thread_id_t threadId, msg_struct_list_s *pAddrList)
+{
+       msg_error_t err = MSG_SUCCESS;
+
+       int order = MsgGetContactNameOrder();
+
+       err = MsgStoGetAddressByConvId(&dbHandle, threadId, order, pAddrList);
+
+       return err;
+}
+
+
+msg_error_t MsgStoGetThreadInfo(msg_thread_id_t threadId, MSG_THREAD_VIEW_S *pThreadInfo)
+{
+       MSG_BEGIN();
+
+       int rowCnt;
+       int index = 10; // numbers of index
+
+       char sqlQuery[MAX_QUERY_LEN+1];
+       memset(sqlQuery, 0x00, sizeof(sqlQuery));
+
+       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT CONV_ID, UNREAD_CNT, SMS_CNT, MMS_CNT, \
+                       MAIN_TYPE, SUB_TYPE, MSG_DIRECTION, DISPLAY_TIME, DISPLAY_NAME, MSG_TEXT \
+                       FROM %s WHERE CONV_ID = %d;",
+                       MSGFW_CONVERSATION_TABLE_NAME, threadId);
+
+       msg_error_t  err = dbHandle.getTable(sqlQuery, &rowCnt);
+
+       if (err == MSG_ERR_DB_NORECORD) {
+               dbHandle.freeTable();
+               return MSG_SUCCESS;
+       } else if (err != MSG_SUCCESS) {
+               MSG_DEBUG("%s", sqlQuery);
+               dbHandle.freeTable();
+               return err;
+       }
+
+       if (rowCnt < 1) {
+               MSG_DEBUG("rowCnt is %d", rowCnt);
+               dbHandle.freeTable();
+               return err;
+       } else {
+               pThreadInfo->threadId = dbHandle.getColumnToInt(index++);
+
+               pThreadInfo->unreadCnt = dbHandle.getColumnToInt(index++);
+               pThreadInfo->smsCnt = dbHandle.getColumnToInt(index++);
+               pThreadInfo->mmsCnt = dbHandle.getColumnToInt(index++);
+
+               pThreadInfo->mainType = dbHandle.getColumnToInt(index++);
+               pThreadInfo->subType = dbHandle.getColumnToInt(index++);
+
+               pThreadInfo->direction = dbHandle.getColumnToInt(index++);
+               pThreadInfo->threadTime = (time_t)dbHandle.getColumnToInt(index++);
+
+               memset(pThreadInfo->threadName, 0x00, sizeof(pThreadInfo->threadName));
+               dbHandle.getColumnToString(index++, MAX_THREAD_NAME_LEN, pThreadInfo->threadName);
+
+               memset(pThreadInfo->threadData, 0x00, sizeof(pThreadInfo->threadData));
+               dbHandle.getColumnToString(index++, MAX_THREAD_DATA_LEN, pThreadInfo->threadData);
+       }
+
+       dbHandle.freeTable();
+
+       MSG_END();
+
+       return MSG_SUCCESS;
+}
+
+
+msg_error_t MsgStoGetMessageList(msg_folder_id_t folderId, msg_thread_id_t threadId, msg_message_type_t msgType, msg_storage_id_t storageId, msg_struct_list_s *pMsgList)
+{
+       // Clear Out Parameter
+       pMsgList->nCount = 0;
+       pMsgList->msg_struct_info = NULL;
+
+       int rowCnt = 0;
+       int index = 19; // numbers of index
+
+       char sqlQuery[MAX_QUERY_LEN+1];
+       char sqlQuerySubset[(MAX_QUERY_LEN/5)+1];
+
+       // Get Name Order
+       int order = MsgGetContactNameOrder();
+
+       memset(sqlQuery, 0x00, sizeof(sqlQuery));
+
+       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT MSG_ID, CONV_ID, FOLDER_ID, STORAGE_ID, MAIN_TYPE, SUB_TYPE, \
+                       DISPLAY_TIME, DATA_SIZE, NETWORK_STATUS, READ_STATUS, PROTECTED, BACKUP, PRIORITY, \
+                       MSG_DIRECTION, SCHEDULED_TIME, SUBJECT, MSG_TEXT, ATTACHMENT_COUNT, THUMB_PATH \
+                       FROM %s WHERE ", MSGFW_MESSAGE_TABLE_NAME);
+
+
+       //// folder
+       memset(sqlQuerySubset, 0x00, sizeof(sqlQuerySubset));
+
+       if (folderId == MSG_ALLBOX_ID)
+               snprintf(sqlQuerySubset, sizeof(sqlQuerySubset), "FOLDER_ID > 0 AND FOLDER_ID < %d ", MSG_CBMSGBOX_ID);
+       else if (folderId == MSG_IOSBOX_ID)
+               snprintf(sqlQuerySubset, sizeof(sqlQuerySubset), "FOLDER_ID > 0 AND FOLDER_ID < %d ", MSG_DRAFT_ID);
+       else
+               snprintf(sqlQuerySubset, sizeof(sqlQuerySubset), "FOLDER_ID = %d ", folderId);
+
+       strncat(sqlQuery, sqlQuerySubset, MAX_QUERY_LEN-strlen(sqlQuery));
+
+
+       //// thread
+       memset(sqlQuerySubset, 0x00, sizeof(sqlQuerySubset));
+
+       if (threadId > 0)
+               snprintf(sqlQuerySubset, sizeof(sqlQuerySubset), "AND CONV_ID = %d ", threadId);
+
+       strncat(sqlQuery, sqlQuerySubset, MAX_QUERY_LEN-strlen(sqlQuery));
+
+
+       //// msg type
+       memset(sqlQuerySubset, 0x00, sizeof(sqlQuerySubset));
+
+       switch (msgType) {
+               case MSG_TYPE_SMS:
+                       snprintf(sqlQuerySubset, sizeof(sqlQuerySubset), "AND MAIN_TYPE = %d AND SUB_TYPE = %d ", MSG_SMS_TYPE, MSG_NORMAL_SMS);
+                       break;
+
+               case MSG_TYPE_MMS:
+                       snprintf(sqlQuerySubset, sizeof(sqlQuerySubset), "AND MAIN_TYPE = %d ", MSG_MMS_TYPE);
+                       break;
+
+               case MSG_TYPE_MMS_JAVA:
+                       snprintf(sqlQuerySubset, sizeof(sqlQuerySubset), "AND MAIN_TYPE = %d AND SUB_TYPE = %d ", MSG_MMS_TYPE, MSG_SENDREQ_JAVA_MMS);
+                       break;
+
+               case MSG_TYPE_SMS_SYNCML:
+                       snprintf(sqlQuerySubset, sizeof(sqlQuerySubset), "AND MAIN_TYPE = %d AND SUB_TYPE = %d ", MSG_SMS_TYPE, MSG_SYNCML_CP);
+                       break;
+
+               case MSG_TYPE_SMS_REJECT:
+                       snprintf(sqlQuerySubset, sizeof(sqlQuerySubset), "AND MAIN_TYPE = %d AND SUB_TYPE = %d ", MSG_SMS_TYPE, MSG_REJECT_SMS);
+                       break;
+
+               default:
+                       MSG_DEBUG("msg type is not set.");
+       }
+
+       strncat(sqlQuery, sqlQuerySubset, MAX_QUERY_LEN-strlen(sqlQuery));
+
+       //// storage
+       memset(sqlQuerySubset, 0x00, sizeof(sqlQuerySubset));
+
+       if (storageId > MSG_STORAGE_UNKNOWN)
+               snprintf(sqlQuerySubset, sizeof(sqlQuerySubset), "AND STORAGE_ID = %d ", storageId);
+
+       strncat(sqlQuery, sqlQuerySubset, MAX_QUERY_LEN-strlen(sqlQuery));
+
+
+       /// order
+       memset(sqlQuerySubset, 0x00, sizeof(sqlQuerySubset));
+       snprintf(sqlQuerySubset, sizeof(sqlQuerySubset), "ORDER BY DISPLAY_TIME DESC;");
+
+       strncat(sqlQuery, sqlQuerySubset, MAX_QUERY_LEN-strlen(sqlQuery));
+
+       msg_error_t err = dbHandle.getTable(sqlQuery, &rowCnt);
+
+       if (err == MSG_ERR_DB_NORECORD) {
+               dbHandle.freeTable();
+
+               return MSG_SUCCESS;
+       } else if (err != MSG_SUCCESS) {
+               MSG_DEBUG("Get table fail. [%s]", sqlQuery);
+
+               dbHandle.freeTable();
+
+               return err;
+       }
+
+       pMsgList->nCount = rowCnt;
+
+       MSG_DEBUG("pMsgList->nCount [%d]", pMsgList->nCount);
+
+       pMsgList->msg_struct_info = (msg_struct_t *)new char[sizeof(msg_struct_t) * rowCnt];
+
+       MSG_MESSAGE_HIDDEN_S *pTmp = NULL;
+       msg_struct_s *msg = NULL;
+
+       for (int i = 0; i < rowCnt; i++) {
+               pMsgList->msg_struct_info[i] = (msg_struct_t)new msg_struct_s;
+
+               msg = (msg_struct_s *)pMsgList->msg_struct_info[i];
+
+               msg->type = MSG_STRUCT_MESSAGE_INFO;
+               msg->data = (int *)new char[sizeof(MSG_MESSAGE_HIDDEN_S)];
+
+               pTmp = (MSG_MESSAGE_HIDDEN_S *)msg->data;
+
+               memset(pTmp, 0x00, sizeof(MSG_MESSAGE_HIDDEN_S));
+
+               pTmp->pData = NULL;
+               pTmp->pMmsData = NULL;
+
+               pTmp->msgId = dbHandle.getColumnToInt(index++);
+               pTmp->threadId = dbHandle.getColumnToInt(index++);
+               pTmp->folderId = dbHandle.getColumnToInt(index++);
+               pTmp->storageId = dbHandle.getColumnToInt(index++);
+               pTmp->mainType = dbHandle.getColumnToInt(index++);
+               pTmp->subType = dbHandle.getColumnToInt(index++);
+               pTmp->displayTime = (time_t)dbHandle.getColumnToInt(index++);
+               pTmp->dataSize = dbHandle.getColumnToInt(index++);
+               pTmp->networkStatus = dbHandle.getColumnToInt(index++);
+               pTmp->bRead = dbHandle.getColumnToInt(index++);
+               pTmp->bProtected = dbHandle.getColumnToInt(index++);
+               pTmp->bBackup = dbHandle.getColumnToInt(index++);
+               pTmp->priority = dbHandle.getColumnToInt(index++);
+               pTmp->direction = dbHandle.getColumnToInt(index++);
+               index++; // This field is reserved.
+
+               dbHandle.getColumnToString(index++, MAX_SUBJECT_LEN, pTmp->subject);
+
+               if (pTmp->mainType == MSG_MMS_TYPE &&
+                       (pTmp->networkStatus == MSG_NETWORK_RETRIEVING || pTmp->networkStatus == MSG_NETWORK_RETRIEVE_FAIL || pTmp->subType == MSG_NOTIFICATIONIND_MMS)) {
+                       pTmp->pData = NULL;
+                       index++;
+               } else {
+                       pTmp->pData = (void *)new char[pTmp->dataSize+2];
+                       memset(pTmp->pData, 0x00, pTmp->dataSize+2);
+
+                       dbHandle.getColumnToString(index++, pTmp->dataSize+1, (char *)pTmp->pData);
+               }
+
+               pTmp->attachCount = dbHandle.getColumnToInt(index++);
+
+               dbHandle.getColumnToString(index++, MSG_FILEPATH_LEN_MAX, pTmp->thumbPath);
+
+               // add address information.
+               order = MsgGetContactNameOrder();
+
+               msg_struct_list_s *addr_list = (msg_struct_list_s *)new msg_struct_list_s;
+               MsgStoGetAddressByMsgId(&dbHandle, pTmp->msgId, order, addr_list);
+
+               pTmp->addr_list = addr_list;
+       }
+       dbHandle.freeTable();
+
+       return MSG_SUCCESS;
+}
index 8bb5eb2..dd2f5c0 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include "MsgDebug.h"
 #include "MsgCppTypes.h"
@@ -32,14 +32,14 @@ extern MsgDbHandler dbHandle;
 /*==================================================================================================
                                      FUNCTION IMPLEMENTATION
 ==================================================================================================*/
-MSG_ERROR_T MsgStoGetText(MSG_MESSAGE_ID_T MsgId, char *pSubject, char *pMsgText)
+msg_error_t MsgStoGetText(msg_message_id_t msgId, char *pSubject, char *pMsgText)
 {
        char sqlQuery[MAX_QUERY_LEN+1];
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
        snprintf(sqlQuery, sizeof(sqlQuery), "SELECT SUBJECT, MSG_TEXT FROM %s WHERE MSG_ID = %d;",
-                                       MSGFW_MESSAGE_TABLE_NAME, MsgId);
+                       MSGFW_MESSAGE_TABLE_NAME, msgId);
 
        if(dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS)
                return MSG_ERR_DB_PREPARE;
@@ -66,68 +66,65 @@ MSG_ERROR_T MsgStoGetText(MSG_MESSAGE_ID_T MsgId, char *pSubject, char *pMsgText
 
 
 
-MSG_ERROR_T MsgStoUpdateMMSMessage(MSG_MESSAGE_INFO_S *pMsg)
+msg_error_t MsgStoUpdateMMSMessage(MSG_MESSAGE_INFO_S *pMsg)
 {
        MSG_BEGIN();
 
-       MSG_ERROR_T err = MSG_SUCCESS;
-       int rowCnt = 0;
        char sqlQuery[MAX_QUERY_LEN+1];
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
        dbHandle.beginTrans();
 
-       if(pMsg->msgType.subType == MSG_RETRIEVE_AUTOCONF_MMS || pMsg->msgType.subType == MSG_RETRIEVE_MANUALCONF_MMS)
-       {
-               if( pMsg->networkStatus == MSG_NETWORK_RETRIEVE_SUCCESS )
-               {
+       if(pMsg->msgType.subType == MSG_RETRIEVE_AUTOCONF_MMS || pMsg->msgType.subType == MSG_RETRIEVE_MANUALCONF_MMS) {
+               if( pMsg->networkStatus == MSG_NETWORK_RETRIEVE_SUCCESS ) {
                        snprintf(sqlQuery, sizeof(sqlQuery),
-                               "UPDATE %s SET MAIN_TYPE = %d, SUB_TYPE = %d, DISPLAY_TIME = %lu, SUBJECT = ?, NETWORK_STATUS = %d, MSG_TEXT = ?, THUMB_PATH = '%s', DATA_SIZE = %d WHERE REFERENCE_ID = %d;",
+                                       "UPDATE %s SET MAIN_TYPE = %d, SUB_TYPE = %d, DISPLAY_TIME = %lu, SUBJECT = ?, NETWORK_STATUS = %d, MSG_TEXT = ?, THUMB_PATH = '%s', DATA_SIZE = %d WHERE MSG_ID = %d;",
                                        MSGFW_MESSAGE_TABLE_NAME, pMsg->msgType.mainType, pMsg->msgType.subType, pMsg->displayTime, pMsg->networkStatus, pMsg->thumbPath,  pMsg->dataSize, pMsg->msgId);
 
-                       if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS)
+                       if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS) {
+                               dbHandle.endTrans(false);
                                return MSG_ERR_DB_PREPARE;
+                       }
 
                        dbHandle.bindText(pMsg->subject, 1);
                        dbHandle.bindText(pMsg->msgText, 2);
-               }
-               else if( pMsg->networkStatus == MSG_NETWORK_RETRIEVE_FAIL)
-               {
+               } else if( pMsg->networkStatus == MSG_NETWORK_RETRIEVE_FAIL) {
                        snprintf(sqlQuery, sizeof(sqlQuery),
-                               "UPDATE %s SET MAIN_TYPE = %d, SUB_TYPE = %d, SUBJECT = ?, NETWORK_STATUS = %d, MSG_TEXT = ?, THUMB_PATH = '%s' WHERE REFERENCE_ID = %d;",
+                                       "UPDATE %s SET MAIN_TYPE = %d, SUB_TYPE = %d, SUBJECT = ?, NETWORK_STATUS = %d, MSG_TEXT = ?, THUMB_PATH = '%s' WHERE MSG_ID = %d;",
                                        MSGFW_MESSAGE_TABLE_NAME, pMsg->msgType.mainType, pMsg->msgType.subType, pMsg->networkStatus, pMsg->thumbPath,  pMsg->msgId);
 
-                       if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS)
+                       if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS) {
+                               dbHandle.endTrans(false);
                                return MSG_ERR_DB_PREPARE;
+                       }
 
                        dbHandle.bindText(pMsg->subject, 1);
                        dbHandle.bindText(pMsg->msgText, 2);
                }
-       }
-       else if (pMsg->msgType.subType == MSG_SENDREQ_MMS)
-       {
+       } else if (pMsg->msgType.subType == MSG_SENDREQ_MMS) {
                snprintf(sqlQuery, sizeof(sqlQuery),
-                       "UPDATE %s SET MSG_DATA = '%s', MSG_TEXT = ?, THUMB_PATH = '%s' WHERE REFERENCE_ID = %d;",
-                               MSGFW_MESSAGE_TABLE_NAME, pMsg->msgData, pMsg->thumbPath, pMsg->referenceId);
+                               "UPDATE %s SET MSG_DATA = '%s', MSG_TEXT = ?, THUMB_PATH = '%s' WHERE MSG_ID = %d;",
+                               MSGFW_MESSAGE_TABLE_NAME, pMsg->msgData, pMsg->thumbPath, pMsg->msgId);
 
-               if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS)
+               if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS) {
+                       dbHandle.endTrans(false);
                        return MSG_ERR_DB_PREPARE;
+               }
 
                dbHandle.bindText(pMsg->msgText, 1);
-       }
-       else
-       {
+       } else {
                snprintf(sqlQuery, sizeof(sqlQuery),
-                       "UPDATE %s SET MAIN_TYPE = %d, SUB_TYPE = %d, FOLDER_ID = %d, NETWORK_STATUS = %d WHERE REFERENCE_ID = %d;",
-                                               MSGFW_MESSAGE_TABLE_NAME, pMsg->msgType.mainType, pMsg->msgType.subType, pMsg->folderId, pMsg->networkStatus, pMsg->msgId);
+                               "UPDATE %s SET MAIN_TYPE = %d, SUB_TYPE = %d, FOLDER_ID = %d, NETWORK_STATUS = %d WHERE MSG_ID = %d;",
+                               MSGFW_MESSAGE_TABLE_NAME, pMsg->msgType.mainType, pMsg->msgType.subType, pMsg->folderId, pMsg->networkStatus, pMsg->msgId);
 
-               if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS)
+               if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS) {
+                       dbHandle.endTrans(false);
                        return MSG_ERR_DB_PREPARE;
+               }
        }
 
-       if (dbHandle.stepQuery() != MSG_ERR_DB_DONE)
-       {
+       if (dbHandle.stepQuery() != MSG_ERR_DB_DONE) {
                dbHandle.finalizeQuery();
                dbHandle.endTrans(false);
                MSG_DEBUG("Update MMS Message. Fail [%s]", sqlQuery);
@@ -136,75 +133,41 @@ MSG_ERROR_T MsgStoUpdateMMSMessage(MSG_MESSAGE_INFO_S *pMsg)
 
        dbHandle.finalizeQuery();
 
-       unsigned int addrId = 0;
-
-       memset(sqlQuery, 0x00, sizeof(sqlQuery));
+       msg_thread_id_t convId = 0;
+       int row = 0;
 
        // Get SUB_TYPE, STORAGE_ID
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
-       snprintf(sqlQuery, sizeof(sqlQuery),
-               "SELECT ADDRESS_ID \
-                                       FROM %s \
-                                    WHERE MSG_ID = %d;",
-                               MSGFW_MESSAGE_TABLE_NAME, pMsg->msgId);
+       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT CONV_ID FROM %s WHERE MSG_ID = %d;",
+                       MSGFW_MESSAGE_TABLE_NAME, pMsg->msgId);
 
-       if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS)
-       {
+       if (dbHandle.getTable(sqlQuery, &row) != MSG_SUCCESS) {
+               dbHandle.freeTable();
                dbHandle.endTrans(false);
                return MSG_ERR_DB_PREPARE;
        }
 
-       if (dbHandle.stepQuery() == MSG_ERR_DB_ROW)
-       {
-               addrId = dbHandle.columnInt(0);
-
-               MSG_DEBUG("AddressId:[%d]", addrId);
-       }
-       else
-       {
-               MSG_DEBUG("MsgStepQuery() Error [%s]", sqlQuery);
-               dbHandle.finalizeQuery();
-               dbHandle.endTrans(false);
-               return MSG_ERR_DB_STEP;
-       }
-
-       dbHandle.finalizeQuery();
-
-       memset(sqlQuery, 0x00, sizeof(sqlQuery));
-       snprintf(sqlQuery, sizeof(sqlQuery),
-               "SELECT ADDRESS_ID \
-                                       FROM %s \
-                                    WHERE REFERENCE_ID = %d;",
-                               MSGFW_MESSAGE_TABLE_NAME, pMsg->msgId);
-
-       err = dbHandle.getTable(sqlQuery, &rowCnt);
-
-       if (err != MSG_SUCCESS && err != MSG_ERR_DB_NORECORD)
-       {
-               MSG_DEBUG("Failed to Get Table");
-
-               dbHandle.freeTable();
-               dbHandle.endTrans(false);
-
-               return MSG_ERR_STORAGE_ERROR;
-       }
+       if (row > 0) {
+               convId = dbHandle.getColumnToInt(1);
 
-       for (int i = 1; i <= rowCnt; i++)
-       {
-               addrId = dbHandle.getColumnToInt(i);
+               MSG_DEBUG("Conversation id:[%d]", convId);
 
-               if (MsgStoUpdateAddress(&dbHandle, addrId) != MSG_SUCCESS)
-               {
-                       MSG_DEBUG("MsgStoUpdateAddress() Error");
+               if (MsgStoUpdateConversation(&dbHandle, convId) != MSG_SUCCESS) {
+                       MSG_DEBUG("MsgStoUpdateConversation() Error");
                        dbHandle.freeTable();
                        dbHandle.endTrans(false);
 
                        return MSG_ERR_STORAGE_ERROR;
                }
+
+       } else {
+               MSG_DEBUG("MsgStepQuery() Error [%s]", sqlQuery);
+               dbHandle.freeTable();
+               dbHandle.endTrans(false);
+               return MSG_ERR_DB_STEP;
        }
 
        dbHandle.freeTable();
-
        dbHandle.endTrans(true);
 
        MSG_END();
@@ -213,34 +176,27 @@ MSG_ERROR_T MsgStoUpdateMMSMessage(MSG_MESSAGE_INFO_S *pMsg)
 }
 
 
-MSG_ERROR_T MsgStoGetContentLocation(MSG_MESSAGE_INFO_S* pMsgInfo)
+msg_error_t MsgStoGetContentLocation(MSG_MESSAGE_INFO_S* pMsgInfo)
 {
        char sqlQuery[MAX_QUERY_LEN+1];
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
-       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT CONTENTS_LOCATION FROM %s WHERE REFERENCE_ID IN \
-                                               (SELECT REFERENCE_ID FROM %s WHERE MSG_ID = %d);",
-                                               MMS_PLUGIN_MESSAGE_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME, pMsgInfo->msgId);
+       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT CONTENTS_LOCATION FROM %s WHERE MSG_ID = %d;",
+                       MMS_PLUGIN_MESSAGE_TABLE_NAME, pMsgInfo->msgId);
 
        if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS)
                return MSG_ERR_DB_PREPARE;
 
-       if (dbHandle.stepQuery() == MSG_ERR_DB_ROW)
-       {
-               if (dbHandle.columnText(0) != NULL)
-               {
+       if (dbHandle.stepQuery() == MSG_ERR_DB_ROW) {
+               if (dbHandle.columnText(0) != NULL) {
                        strncpy(pMsgInfo->msgData, (char*)dbHandle.columnText(0), MAX_MSG_DATA_LEN);
                        pMsgInfo->dataSize = strlen(pMsgInfo->msgData);
-               }
-               else
-               {
+               } else {
                        dbHandle.finalizeQuery();
                        return MSG_ERR_DB_NORECORD;
                }
-       }
-       else
-       {
+       } else {
                dbHandle.finalizeQuery();
                return MSG_ERR_DB_STEP;
        }
@@ -251,7 +207,7 @@ MSG_ERROR_T MsgStoGetContentLocation(MSG_MESSAGE_INFO_S* pMsgInfo)
 }
 
 
-MSG_ERROR_T MsgStoSetReadReportSendStatus(MSG_MESSAGE_ID_T msgId, int readReportSendStatus)
+msg_error_t MsgStoSetReadReportSendStatus(msg_message_id_t msgId, int readReportSendStatus)
 {
        bool bReadReportSent = false;
 
@@ -264,10 +220,8 @@ MSG_ERROR_T MsgStoSetReadReportSendStatus(MSG_MESSAGE_ID_T msgId, int readReport
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
-       snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET READ_REPORT_SEND_STATUS = %d, READ_REPORT_SENT = %d WHERE REFERENCE_ID IN \
-                                       (SELECT REFERENCE_ID FROM %s WHERE MSG_ID = %d);",
-                                       MMS_PLUGIN_ATTRIBUTE_TABLE_NAME, (MmsRecvReadReportSendStatus)readReportSendStatus, (int)bReadReportSent,
-                                       MSGFW_MESSAGE_TABLE_NAME, msgId);
+       snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET READ_REPORT_SEND_STATUS = %d, READ_REPORT_SENT = %d WHERE MSG_ID = %d;",
+                       MMS_PLUGIN_MESSAGE_TABLE_NAME, (MmsRecvReadReportSendStatus)readReportSendStatus, (int)bReadReportSent, msgId);
 
        if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS)
                return MSG_ERR_DB_EXEC;
@@ -276,34 +230,21 @@ MSG_ERROR_T MsgStoSetReadReportSendStatus(MSG_MESSAGE_ID_T msgId, int readReport
 }
 
 
-MSG_ERROR_T MsgStoGetOrgAddressList(MSG_MESSAGE_INFO_S *pMsg)
+msg_error_t MsgStoGetOrgAddressList(MSG_MESSAGE_INFO_S *pMsg)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
        char sqlQuery[MAX_QUERY_LEN+1];
-       int referenceId = 0;
        int rowCnt = 0;
        int index = 3;
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
-       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT REFERENCE_ID FROM %s WHERE MSG_ID = %d;", MSGFW_MESSAGE_TABLE_NAME, pMsg->msgId);
-
-       if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS)
-               return MSG_ERR_DB_PREPARE;
-
-       if (dbHandle.stepQuery() == MSG_ERR_DB_ROW)
-               referenceId = dbHandle.columnInt(0);
-
-       dbHandle.finalizeQuery();
-
-       memset(sqlQuery, 0x00, sizeof(sqlQuery));
-       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT ADDRESS_TYPE, RECIPIENT_TYPE, ADDRESS_VAL FROM %s WHERE ADDRESS_ID IN \
-                               (SELECT ADDRESS_ID FROM %s WHERE REFERENCE_ID = %d);",
-                               MSGFW_ADDRESS_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME, referenceId);
+       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT A.ADDRESS_TYPE, A.RECIPIENT_TYPE, A.ADDRESS_VAL FROM %s A, %s B \
+                       WHERE A.CONV_ID = B.CONV_ID AND B.MSG_ID = %d;",
+                       MSGFW_ADDRESS_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME, pMsg->msgId);
 
        err = dbHandle.getTable(sqlQuery, &rowCnt);
 
-       if (err != MSG_SUCCESS && err != MSG_ERR_DB_NORECORD)
-       {
+       if (err != MSG_SUCCESS && err != MSG_ERR_DB_NORECORD) {
                dbHandle.freeTable();
                return err;
        }
@@ -323,24 +264,21 @@ MSG_ERROR_T MsgStoGetOrgAddressList(MSG_MESSAGE_INFO_S *pMsg)
 }
 
 
-MSG_ERROR_T MsgStoGetSubject(MSG_MESSAGE_ID_T MsgId, char *pSubject)
+msg_error_t MsgStoGetSubject(msg_message_id_t msgId, char *pSubject)
 {
        char sqlQuery[MAX_QUERY_LEN+1];
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
        snprintf(sqlQuery, sizeof(sqlQuery), "SELECT SUBJECT FROM %s WHERE MSG_ID = %d;",
-                               MSGFW_MESSAGE_TABLE_NAME, MsgId);
+                       MSGFW_MESSAGE_TABLE_NAME, msgId);
 
        if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS)
                return MSG_ERR_DB_PREPARE;
 
-       if (dbHandle.stepQuery() == MSG_ERR_DB_ROW)
-       {
+       if (dbHandle.stepQuery() == MSG_ERR_DB_ROW) {
                strncpy(pSubject, (char*)dbHandle.columnText(0), MAX_SUBJECT_LEN);
-       }
-       else
-       {
+       } else {
                dbHandle.finalizeQuery();
                return MSG_ERR_DB_STEP;
        }
@@ -351,34 +289,30 @@ MSG_ERROR_T MsgStoGetSubject(MSG_MESSAGE_ID_T MsgId, char *pSubject)
 }
 
 
-MSG_ERROR_T MsgStoUpdateNetworkStatus(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_NETWORK_STATUS_T Status)
+msg_error_t MsgStoUpdateNetworkStatus(MSG_MESSAGE_INFO_S *pMsgInfo, msg_network_status_t status)
 {
        MSG_BEGIN();
 
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        char sqlQuery[MAX_QUERY_LEN+1];
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
-       snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET NETWORK_STATUS = %d WHERE REFERENCE_ID IN \
-                                               (SELECT REFERENCE_ID FROM %s WHERE MSG_ID = %d);",
-                                               MSGFW_MESSAGE_TABLE_NAME, Status,
-                                               MSGFW_MESSAGE_TABLE_NAME, pMsgInfo->msgId);
+       snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET NETWORK_STATUS = %d WHERE MSG_ID = %d;",
+                       MSGFW_MESSAGE_TABLE_NAME, status, pMsgInfo->msgId);
 
        if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS)
                return MSG_ERR_DB_EXEC;
 
        MSG_END();
-
        return err;
 }
 
 
-MSG_ERROR_T MsgStoGetRecipientList(MSG_MESSAGE_ID_T msgId, MSG_RECIPIENTS_LIST_S *pRecipientList)
+msg_error_t MsgStoGetRecipientList(msg_message_id_t msgId, MSG_RECIPIENTS_LIST_S *pRecipientList)
 {
-       if (pRecipientList == NULL)
-       {
+       if (pRecipientList == NULL) {
                MSG_DEBUG("pRecipientList is NULL");
                return MSG_ERR_NULL_POINTER;
        }
@@ -389,15 +323,12 @@ MSG_ERROR_T MsgStoGetRecipientList(MSG_MESSAGE_ID_T msgId, MSG_RECIPIENTS_LIST_S
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
-       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT B.ADDRESS_TYPE, B.RECIPIENT_TYPE, B.ADDRESS_VAL, B.CONTACT_ID, \
-                                       B.DISPLAY_NAME, B.FIRST_NAME, B.LAST_NAME \
-                                       FROM %s A, %s B \
-                                    WHERE A.MSG_ID = %d \
-                                         AND A.ADDRESS_ID = B.ADDRESS_ID;",
-                               MSGFW_MESSAGE_TABLE_NAME, MSGFW_ADDRESS_TABLE_NAME, msgId);
+       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT B.ADDRESS_TYPE, B.RECIPIENT_TYPE, \
+                       B.ADDRESS_VAL, B.CONTACT_ID, B.DISPLAY_NAME, B.FIRST_NAME, B.LAST_NAME \
+                       FROM %s A, %s B WHERE A.MSG_ID = %d AND A.CONV_ID = B.CONV_ID;",
+                       MSGFW_MESSAGE_TABLE_NAME, MSGFW_ADDRESS_TABLE_NAME, msgId);
 
-       if (dbHandle.getTable(sqlQuery, &rowCnt) != MSG_SUCCESS)
-       {
+       if (dbHandle.getTable(sqlQuery, &rowCnt) != MSG_SUCCESS) {
                dbHandle.freeTable();
                return MSG_ERR_DB_GETTABLE;
        }
@@ -417,8 +348,6 @@ MSG_ERROR_T MsgStoGetRecipientList(MSG_MESSAGE_ID_T msgId, MSG_RECIPIENTS_LIST_S
 
        for (int i = 0; i < rowCnt; i++)
        {
-               pTmp->threadId = 0;
-
                pTmp->addressType = dbHandle.getColumnToInt(index++);
                pTmp->recipientType= dbHandle.getColumnToInt(index++);
 
@@ -436,33 +365,23 @@ MSG_ERROR_T MsgStoGetRecipientList(MSG_MESSAGE_ID_T msgId, MSG_RECIPIENTS_LIST_S
                memset(lastName, 0x00, sizeof(lastName));
                dbHandle.getColumnToString(index++, MAX_THREAD_NAME_LEN, lastName);
 
-               if (strlen(displayName) <= 0)
-               {
-                       if (order == 0)
-                       {
+               if (strlen(displayName) <= 0) {
+                       if (order == 0) {
                                if (firstName[0] != '\0')
-                               {
                                        strncpy(displayName, firstName, MAX_DISPLAY_NAME_LEN);
-                               }
 
-                               if (lastName[0] != '\0')
-                               {
+                               if (lastName[0] != '\0') {
                                        strncat(displayName, " ", MAX_DISPLAY_NAME_LEN-strlen(displayName));
                                        strncat(displayName, lastName, MAX_DISPLAY_NAME_LEN-strlen(displayName));
                                }
-                       }
-                       else if (order == 1)
-                       {
-                               if (lastName[0] != '\0')
-                               {
+                       } else if (order == 1) {
+                               if (lastName[0] != '\0') {
                                        strncpy(displayName, lastName, MAX_DISPLAY_NAME_LEN);
                                        strncat(displayName, " ", MAX_DISPLAY_NAME_LEN-strlen(displayName));
                                }
 
                                if (firstName[0] != '\0')
-                               {
                                        strncat(displayName, firstName, MAX_DISPLAY_NAME_LEN-strlen(displayName));
-                               }
                        }
                }
 
@@ -478,24 +397,21 @@ MSG_ERROR_T MsgStoGetRecipientList(MSG_MESSAGE_ID_T msgId, MSG_RECIPIENTS_LIST_S
 }
 
 
-MSG_ERROR_T MsgStoGetReadStatus(MSG_MESSAGE_ID_T MsgId, bool *pReadStatus)
+msg_error_t MsgStoGetReadStatus(msg_message_id_t msgId, bool *pReadStatus)
 {
        char sqlQuery[MAX_QUERY_LEN+1];
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
        snprintf(sqlQuery, sizeof(sqlQuery), "SELECT READ_STATUS FROM %s WHERE MSG_ID = %d;",
-                                                       MSGFW_MESSAGE_TABLE_NAME, MsgId);
+                       MSGFW_MESSAGE_TABLE_NAME, msgId);
 
        if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS)
                return MSG_ERR_DB_PREPARE;
 
-       if (dbHandle.stepQuery() == MSG_ERR_DB_ROW)
-       {
+       if (dbHandle.stepQuery() == MSG_ERR_DB_ROW) {
                *pReadStatus = (bool)dbHandle.columnInt(0);
-       }
-       else
-       {
+       } else {
                dbHandle.finalizeQuery();
                return MSG_ERR_DB_STEP;
        }
@@ -506,27 +422,26 @@ MSG_ERROR_T MsgStoGetReadStatus(MSG_MESSAGE_ID_T MsgId, bool *pReadStatus)
 }
 
 
-MSG_ERROR_T MsgStoGetAddrInfo(MSG_MESSAGE_ID_T MsgId, MSG_ADDRESS_INFO_S *pAddrInfo)
+msg_error_t MsgStoGetAddrInfo(msg_message_id_t msgId, MSG_ADDRESS_INFO_S *pAddrInfo)
 {
        char sqlQuery[MAX_QUERY_LEN+1];
 
        // Add Address
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
-       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT A.ADDRESS_ID, A.ADDRESS_TYPE, A.RECIPIENT_TYPE, A.CONTACT_ID, A.ADDRESS_VAL \
-                                       FROM %s A, %s B WHERE A.ADDRESS_ID = B.ADDRESS_ID AND B.MSG_ID = %d;",
-                                       MSGFW_ADDRESS_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME, MsgId);
+       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT A.ADDRESS_TYPE, A.RECIPIENT_TYPE, A.CONTACT_ID, A.ADDRESS_VAL \
+                       FROM %s A, %s B WHERE A.CONV_ID = B.CONV_ID AND B.MSG_ID = %d;",
+                       MSGFW_ADDRESS_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME, msgId);
 
        if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS)
                return MSG_ERR_DB_PREPARE;
 
        if (dbHandle.stepQuery() == MSG_ERR_DB_ROW) {
-               pAddrInfo->threadId = dbHandle.columnInt(0);
-               pAddrInfo->addressType = dbHandle.columnInt(1);
-               pAddrInfo->recipientType = dbHandle.columnInt(2);
-               pAddrInfo->contactId = dbHandle.columnInt(3);
+               pAddrInfo->addressType = dbHandle.columnInt(0);
+               pAddrInfo->recipientType = dbHandle.columnInt(1);
+               pAddrInfo->contactId = dbHandle.columnInt(2);
 
-               strncpy(pAddrInfo->addressVal, (char*)dbHandle.columnText(4), MAX_ADDRESS_VAL_LEN);
+               strncpy(pAddrInfo->addressVal, (char*)dbHandle.columnText(3), MAX_ADDRESS_VAL_LEN);
        } else {
                dbHandle.finalizeQuery();
                return MSG_ERR_DB_STEP;
@@ -536,4 +451,3 @@ MSG_ERROR_T MsgStoGetAddrInfo(MSG_MESSAGE_ID_T MsgId, MSG_ADDRESS_INFO_S *pAddrI
 
        return MSG_SUCCESS;
 }
-
index c3f114b..7e1895e 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include <queue>
 
@@ -37,30 +37,26 @@ extern MsgDbHandler dbHandle;
 /*==================================================================================================
                                      FUNCTION IMPLEMENTATION
 ==================================================================================================*/
-MSG_ERROR_T MsgInitSimMessage(MSG_SIM_STATUS_T SimStatus)
+msg_error_t MsgInitSimMessage(MSG_SIM_STATUS_T SimStatus)
 {
        MSG_DEBUG("Start SIM Message Initialization");
 
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        // Set SIM count of vconf to 0
-       if (MsgSettingSetInt(SIM_USED_COUNT, 0) != MSG_SUCCESS)
-       {
+       if (MsgSettingSetInt(SIM_USED_COUNT, 0) != MSG_SUCCESS) {
                MSG_DEBUG("Error to set config data [%s]", SIM_USED_COUNT);
        }
 
-       if (MsgSettingSetInt(SIM_TOTAL_COUNT, 0) != MSG_SUCCESS)
-       {
+       if (MsgSettingSetInt(SIM_TOTAL_COUNT, 0) != MSG_SUCCESS) {
                MSG_DEBUG("Error to set config data [%s]", SIM_TOTAL_COUNT);
        }
 
-       if (SimStatus != MSG_SIM_STATUS_NOT_FOUND)
-       {
+       if (SimStatus != MSG_SIM_STATUS_NOT_FOUND) {
                MSG_MAIN_TYPE_T mainType = MSG_SMS_TYPE;
                MsgPlugin* plg = MsgPluginManager::instance()->getPlugin(mainType);
 
-               if (plg == NULL)
-               {
+               if (plg == NULL) {
                        MSG_DEBUG("No plugin for %d type", mainType);
                        return MSG_ERR_INVALID_PLUGIN_HANDLE;
                }
@@ -75,37 +71,32 @@ MSG_ERROR_T MsgInitSimMessage(MSG_SIM_STATUS_T SimStatus)
 }
 
 
-MSG_ERROR_T MsgStoClearSimMessageInDB()
+msg_error_t MsgStoClearSimMessageInDB()
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        char sqlQuery[MAX_QUERY_LEN+1];
 
-       queue<MSG_THREAD_ID_T> threadList;
+       queue<msg_thread_id_t> threadList;
 
        // Get Address ID of SIM Message
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
-       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT DISTINCT(B.ADDRESS_ID) \
-                                       FROM %s A, %s B \
-                                    WHERE A.ADDRESS_ID = B.ADDRESS_ID \
-                                         AND A.STORAGE_ID = %d",
-                       MSGFW_MESSAGE_TABLE_NAME, MSGFW_ADDRESS_TABLE_NAME, MSG_STORAGE_SIM);
+       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT DISTINCT(CONV_ID) FROM %s WHERE STORAGE_ID = %d",
+                       MSGFW_MESSAGE_TABLE_NAME, MSG_STORAGE_SIM);
 
        int rowCnt = 0;
 
        err = dbHandle.getTable(sqlQuery, &rowCnt);
 
-       if (err != MSG_SUCCESS && err != MSG_ERR_DB_NORECORD)
-       {
+       if (err != MSG_SUCCESS && err != MSG_ERR_DB_NORECORD) {
                MSG_DEBUG("sql query is %s.", sqlQuery);
 
                dbHandle.freeTable();
                return err;
        }
 
-       if (rowCnt <= 0)
-       {
+       if (rowCnt <= 0) {
                dbHandle.freeTable();
                return MSG_SUCCESS;
        }
@@ -113,7 +104,7 @@ MSG_ERROR_T MsgStoClearSimMessageInDB()
        for (int i = 1; i <= rowCnt; i++)
        {
                MSG_DEBUG("thread ID : %d", dbHandle.getColumnToInt(i));
-               threadList.push((MSG_THREAD_ID_T)dbHandle.getColumnToInt(i));
+               threadList.push((msg_thread_id_t)dbHandle.getColumnToInt(i));
        }
 
        dbHandle.freeTable();
@@ -129,20 +120,18 @@ MSG_ERROR_T MsgStoClearSimMessageInDB()
                memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
                snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID IN \
-                                                                               (SELECT MSG_ID FROM %s WHERE STORAGE_ID = %d);",
-                                               tableList[i], MSGFW_MESSAGE_TABLE_NAME, MSG_STORAGE_SIM);
+                               (SELECT MSG_ID FROM %s WHERE STORAGE_ID = %d);",
+                               tableList[i], MSGFW_MESSAGE_TABLE_NAME, MSG_STORAGE_SIM);
 
                // Delete SIM Message in tables
-               if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS)
-               {
+               if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS) {
                        dbHandle.endTrans(false);
                        return MSG_ERR_DB_EXEC;
                }
        }
 
-       // Clear Address table
-       if (MsgStoClearAddressTable(&dbHandle) != MSG_SUCCESS)
-       {
+       // Clear Conversation table
+       if (MsgStoClearConversationTable(&dbHandle) != MSG_SUCCESS) {
                dbHandle.endTrans(false);
                return MSG_ERR_DB_EXEC;
        }
@@ -150,12 +139,11 @@ MSG_ERROR_T MsgStoClearSimMessageInDB()
        // Update Address
        while (!threadList.empty())
        {
-               err = MsgStoUpdateAddress(&dbHandle, threadList.front());
+               err = MsgStoUpdateConversation(&dbHandle, threadList.front());
 
                threadList.pop();
 
-               if (err != MSG_SUCCESS)
-               {
+               if (err != MSG_SUCCESS) {
                        dbHandle.endTrans(false);
                        return err;
                }
index 3899308..52fa76f 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include <stdio.h>
 #include <string.h>
@@ -39,7 +39,7 @@ extern MsgDbHandler dbHandle;
 /*==================================================================================================
                                      FUNCTION IMPLEMENTATION
 ==================================================================================================*/
-MSG_ERROR_T MsgMakeSortRule(const MSG_SORT_RULE_S *pSortRule, char *pSqlSort)
+msg_error_t MsgMakeSortRule(const MSG_SORT_RULE_S *pSortRule, char *pSqlSort)
 {
        char sql[128];
        char order[6];
@@ -69,13 +69,13 @@ MSG_ERROR_T MsgMakeSortRule(const MSG_SORT_RULE_S *pSortRule, char *pSqlSort)
                                snprintf(sql, sizeof(sql), "ORDER BY B.LAST_NAME %s, B.FIRST_NAME %s, B.ADDRESS_VAL, A.DISPLAY_TIME DESC;", order, order);
                        break;
                case MSG_SORT_BY_DISPLAY_TIME :
-                       snprintf(sql, sizeof(sql), "ORDER BY A.DISPLAY_TIME %s;", order);
+                       snprintf(sql, sizeof(sql), "ORDER BY DISPLAY_TIME %s;", order);
                        break;
                case MSG_SORT_BY_MSG_TYPE :
-                       snprintf(sql, sizeof(sql), "ORDER BY A.MAIN_TYPE %s, A.DISPLAY_TIME DESC;", order);
+                       snprintf(sql, sizeof(sql), "ORDER BY MAIN_TYPE %s, DISPLAY_TIME DESC;", order);
                        break;
                case MSG_SORT_BY_READ_STATUS :
-                       snprintf(sql, sizeof(sql), "ORDER BY A.READ_STATUS %s, A.DISPLAY_TIME DESC;", order);
+                       snprintf(sql, sizeof(sql), "ORDER BY READ_STATUS %s, DISPLAY_TIME DESC;", order);
                        break;
                case MSG_SORT_BY_STORAGE_TYPE :
                        snprintf(sql, sizeof(sql), "ORDER BY A.STORAGE_ID %s, A.DISPLAY_TIME DESC;", order);
@@ -103,27 +103,24 @@ MSG_ERROR_T MsgMakeSortRule(const MSG_SORT_RULE_S *pSortRule, char *pSqlSort)
 }
 
 
-MSG_ERROR_T MsgStoGetSmsSendOpt(MSG_MESSAGE_ID_T MsgId, MSG_SENDINGOPT_INFO_S* pSendOpt)
+msg_error_t MsgStoGetSmsSendOpt(msg_message_id_t msgId, MSG_SENDINGOPT_INFO_S* pSendOpt)
 {
        char sqlQuery[MAX_QUERY_LEN+1];
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
        snprintf(sqlQuery, sizeof(sqlQuery), "SELECT DELREP_REQ, KEEP_COPY, REPLY_PATH FROM %s WHERE MSG_ID = %d;",
-                               MSGFW_SMS_SENDOPT_TABLE_NAME, MsgId);
+                       MSGFW_SMS_SENDOPT_TABLE_NAME, msgId);
 
        if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS)
                return MSG_ERR_DB_PREPARE;
 
-       if (dbHandle.stepQuery() == MSG_ERR_DB_ROW)
-       {
+       if (dbHandle.stepQuery() == MSG_ERR_DB_ROW) {
                pSendOpt->bSetting = true;
                pSendOpt->bDeliverReq = (bool)dbHandle.columnInt(0);
                pSendOpt->bKeepCopy = (bool)dbHandle.columnInt(1);
                pSendOpt->option.smsSendOptInfo.bReplyPath = (bool)dbHandle.columnInt(2);
-       }
-       else
-       {
+       } else {
                dbHandle.finalizeQuery();
                return MSG_ERR_DB_STEP;
        }
@@ -134,29 +131,26 @@ MSG_ERROR_T MsgStoGetSmsSendOpt(MSG_MESSAGE_ID_T MsgId, MSG_SENDINGOPT_INFO_S* p
 }
 
 
-MSG_ERROR_T MsgStoGetMmsSendOpt(MSG_MESSAGE_ID_T MsgId, MSG_SENDINGOPT_INFO_S* pSendOpt)
+msg_error_t MsgStoGetMmsSendOpt(msg_message_id_t msgId, MSG_SENDINGOPT_INFO_S* pSendOpt)
 {
        char sqlQuery[MAX_QUERY_LEN+1];
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
        snprintf(sqlQuery, sizeof(sqlQuery), "SELECT ASK_DELIVERY_REPORT, KEEP_COPY, ASK_READ_REPLY, EXPIRY_TIME, PRIORITY FROM %s WHERE MSG_ID = %d;",
-                               MMS_PLUGIN_ATTRIBUTE_TABLE_NAME, MsgId);
+                       MMS_PLUGIN_MESSAGE_TABLE_NAME, msgId);
 
        if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS)
                return MSG_ERR_DB_PREPARE;
 
-       if (dbHandle.stepQuery() == MSG_ERR_DB_ROW)
-       {
+       if (dbHandle.stepQuery() == MSG_ERR_DB_ROW) {
                pSendOpt->bSetting = true;
                pSendOpt->bDeliverReq = (bool)dbHandle.columnInt(0);
                pSendOpt->bKeepCopy = (bool)dbHandle.columnInt(1);
                pSendOpt->option.mmsSendOptInfo.bReadReq = (bool)dbHandle.columnInt(2);
                pSendOpt->option.mmsSendOptInfo.expiryTime.time = (unsigned int)dbHandle.columnInt(3);
-               pSendOpt->option.mmsSendOptInfo.priority = (MSG_PRIORITY_TYPE_T)dbHandle.columnInt(4);
-       }
-       else
-       {
+               pSendOpt->option.mmsSendOptInfo.priority = (msg_priority_type_t)dbHandle.columnInt(4);
+       } else {
                dbHandle.finalizeQuery();
                return MSG_ERR_DB_STEP;
        }
@@ -166,92 +160,9 @@ MSG_ERROR_T MsgStoGetMmsSendOpt(MSG_MESSAGE_ID_T MsgId, MSG_SENDINGOPT_INFO_S* p
        return MSG_SUCCESS;
 }
 
-
-MSG_ERROR_T MsgStoAddScheduledMessage(MSG_MESSAGE_ID_T MsgID, int AlarmId, int ListenerFd)
+bool MsgStoCheckSyncMLMsgInThread(msg_thread_id_t threadId)
 {
-       char sqlQuery[MAX_QUERY_LEN+1];
-
-       memset(sqlQuery, 0x00, sizeof(sqlQuery));
-
-       snprintf(sqlQuery, sizeof(sqlQuery), "INSERT INTO %s VALUES (%d, %d, %d);",
-                               MSGFW_SCHEDULED_MSG_TABLE_NAME, MsgID, AlarmId, ListenerFd);
-
-       if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS)
-       {
-               return MSG_ERR_DB_EXEC;
-       }
-
-       if (dbHandle.stepQuery() != MSG_ERR_DB_DONE)
-       {
-               return MSG_ERR_DB_EXEC;
-       }
-
-       dbHandle.finalizeQuery();
-
-       return MSG_SUCCESS;
-}
-
-
-MSG_ERROR_T MsgStoDeleteScheduledMessage(MSG_MESSAGE_ID_T MsgId)
-{
-       char sqlQuery[MAX_QUERY_LEN+1];
-
-       memset(sqlQuery, 0x00, sizeof(sqlQuery));
-
-       snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;",
-                               MSGFW_SCHEDULED_MSG_TABLE_NAME, MsgId);
-
-       if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS)
-       {
-               MSG_DEBUG("Delete Scheduled Msg Fail!!");
-               return MSG_ERR_DB_EXEC;
-       }
-
-       return MSG_SUCCESS;
-}
-
-
-MSG_ERROR_T MsgStoGetScheduledMessage(int AlarmId, MSG_REQUEST_INFO_S *pReqInfo, int *pListenerFd)
-{
-       MSG_BEGIN();
-
-       MSG_ERROR_T     err = MSG_SUCCESS;
-
-       char sqlQuery[MAX_QUERY_LEN+1];
-
-       memset(sqlQuery, 0x00, sizeof(sqlQuery));
-
-       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT MSG_ID, LISTENER_FD FROM %s WHERE ALARM_ID = %d;",
-                               MSGFW_SCHEDULED_MSG_TABLE_NAME, AlarmId);
-
-       if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS)
-               return MSG_ERR_DB_PREPARE;
-
-       if (dbHandle.stepQuery() == MSG_ERR_DB_ROW)
-       {
-               pReqInfo->msgInfo.msgId = dbHandle.columnInt(0);
-               *pListenerFd = dbHandle.columnInt(1);
-       }
-
-       dbHandle.finalizeQuery();
-
-       err = MsgStoGetMessage(pReqInfo->msgInfo.msgId, &(pReqInfo->msgInfo), &(pReqInfo->sendOptInfo));
-
-       if (err != MSG_SUCCESS)
-       {
-               MSG_DEBUG("MsgStoGetMessage() Error!! [%d]", err);
-               return err;
-       }
-
-       MSG_END();
-
-       return MSG_SUCCESS;
-}
-
-
-bool MsgStoCheckSyncMLMsgInThread(MSG_THREAD_ID_T threadId)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
        int rowCnt = 0;
        bool isSyncMLMsg = false;
 
@@ -259,8 +170,8 @@ bool MsgStoCheckSyncMLMsgInThread(MSG_THREAD_ID_T threadId)
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
-       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT MSG_ID FROM %s WHERE SUB_TYPE = %d AND ADDRESS_ID = %d;",
-                               MSGFW_MESSAGE_TABLE_NAME, MSG_SYNCML_CP, threadId);
+       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT MSG_ID FROM %s WHERE SUB_TYPE = %d AND CONV_ID = %d;",
+                       MSGFW_MESSAGE_TABLE_NAME, MSG_SYNCML_CP, threadId);
 
        MSG_DEBUG("sqlQuery [%s]", sqlQuery);
 
@@ -276,7 +187,7 @@ bool MsgStoCheckSyncMLMsgInThread(MSG_THREAD_ID_T threadId)
 }
 
 
-MSG_ERROR_T MsgStoResetNetworkStatus()
+msg_error_t MsgStoResetNetworkStatus()
 {
        MSG_BEGIN();
 
@@ -285,9 +196,9 @@ MSG_ERROR_T MsgStoResetNetworkStatus()
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
        snprintf(sqlQuery, sizeof(sqlQuery),
-               "UPDATE %s SET NETWORK_STATUS = %d WHERE NETWORK_STATUS = %d; UPDATE %s SET NETWORK_STATUS = %d WHERE NETWORK_STATUS = %d;"
-               , MSGFW_MESSAGE_TABLE_NAME, MSG_NETWORK_SEND_FAIL, MSG_NETWORK_SENDING
-               , MSGFW_MESSAGE_TABLE_NAME, MSG_NETWORK_RETRIEVE_FAIL, MSG_NETWORK_RETRIEVING);
+                       "UPDATE %s SET NETWORK_STATUS = %d WHERE NETWORK_STATUS = %d; UPDATE %s SET NETWORK_STATUS = %d WHERE NETWORK_STATUS = %d;",
+                       MSGFW_MESSAGE_TABLE_NAME, MSG_NETWORK_SEND_FAIL, MSG_NETWORK_SENDING,
+                       MSGFW_MESSAGE_TABLE_NAME, MSG_NETWORK_RETRIEVE_FAIL, MSG_NETWORK_RETRIEVING);
 
        if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS)
                return MSG_ERR_DB_EXEC;
@@ -298,13 +209,13 @@ MSG_ERROR_T MsgStoResetNetworkStatus()
 }
 
 
-MSG_ERROR_T MsgStoCleanAbnormalMmsData()
+msg_error_t MsgStoCleanAbnormalMmsData()
 {
        MSG_BEGIN();
 
        int rowCnt = 0, index = 2; // numbers of index
 
-       MSG_MESSAGE_ID_T msgId;
+       msg_message_id_t msgId;
 
        char sqlQuery[MAX_QUERY_LEN+1];
        char    filePath[MSG_FILEPATH_LEN_MAX];
@@ -312,22 +223,16 @@ MSG_ERROR_T MsgStoCleanAbnormalMmsData()
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
        snprintf(sqlQuery, sizeof(sqlQuery), "SELECT A.MSG_ID, A.FILE_PATH FROM %s A, %s B WHERE A.MSG_ID = B.MSG_ID AND (B.SUB_TYPE = %d OR B.SUB_TYPE = %d OR B.SUB_TYPE = %d);",
-               MMS_PLUGIN_MESSAGE_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME, MSG_SENDCONF_MMS, MSG_RETRIEVE_AUTOCONF_MMS, MSG_RETRIEVE_MANUALCONF_MMS);
+                       MMS_PLUGIN_MESSAGE_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME, MSG_SENDCONF_MMS, MSG_RETRIEVE_AUTOCONF_MMS, MSG_RETRIEVE_MANUALCONF_MMS);
 
-       MSG_ERROR_T  err = dbHandle.getTable(sqlQuery, &rowCnt);
+       msg_error_t  err = dbHandle.getTable(sqlQuery, &rowCnt);
 
-       if (err == MSG_ERR_DB_NORECORD)
-       {
+       if (err == MSG_ERR_DB_NORECORD) {
                dbHandle.freeTable();
-
                return MSG_SUCCESS;
-       }
-       else if (err != MSG_SUCCESS)
-       {
+       } else if (err != MSG_SUCCESS) {
                MSG_DEBUG("%s", sqlQuery);
-
                dbHandle.freeTable();
-
                return err;
        }
 
@@ -340,12 +245,11 @@ MSG_ERROR_T MsgStoCleanAbnormalMmsData()
 
                dbHandle.getColumnToString(index++, MSG_FILEPATH_LEN_MAX, filePath);
 
-               if(strlen(filePath) > 1)
-               {
+               if(strlen(filePath) > 1) {
                        MSG_DEBUG("strlen(filePath) [%d]", strlen(filePath));
                        MSG_DEBUG("filePath [%s]", filePath);
-                       if(MsgGetFileSize(filePath) < 0)
-                       {
+
+                       if(MsgGetFileSize(filePath) < 0) {
                                // abnormal mms message
                                MSG_DEBUG("abnormal mms message [%d]", msgId);
 
@@ -362,7 +266,7 @@ MSG_ERROR_T MsgStoCleanAbnormalMmsData()
        return MSG_SUCCESS;
 }
 
-MSG_ERROR_T MsgStoCheckReadReportStatus(MSG_MESSAGE_ID_T msgId)
+msg_error_t MsgStoCheckReadReportStatus(msg_message_id_t msgId)
 {
        MSG_BEGIN();
 
index 2c45925..3fde433 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include <stdio.h>
 #include <string.h>
@@ -29,9 +29,9 @@
 /*==================================================================================================
                                      FUNCTION IMPLEMENTATION
 ==================================================================================================*/
-MSG_ERROR_T MsgSubmitReq(MSG_REQUEST_INFO_S *pReqInfo, bool bScheduled)
+msg_error_t MsgSubmitReq(MSG_REQUEST_INFO_S *pReqInfo, bool bScheduled)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        static int reqId = 1;
 
@@ -64,79 +64,42 @@ MSG_ERROR_T MsgSubmitReq(MSG_REQUEST_INFO_S *pReqInfo, bool bScheduled)
                MSG_DEBUG("==== priority = [%d] ====", pReqInfo->sendOptInfo.option.mmsSendOptInfo.priority);
                MSG_DEBUG("==== expiryTime = [%d] ====", pReqInfo->sendOptInfo.option.mmsSendOptInfo.expiryTime.time);
 
-               err = MsgSubmitReqMMS(pReqInfo, bScheduled);
+               err = MsgSubmitReqMMS(pReqInfo);
        }
 
        return err;
 }
 
 
-MSG_ERROR_T MsgSubmitReqSMS(MSG_REQUEST_INFO_S *pReqInfo)
+msg_error_t MsgSubmitReqSMS(MSG_REQUEST_INFO_S *pReqInfo)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        // submit request based on msgType;
        MSG_MAIN_TYPE_T mainType = pReqInfo->msgInfo.msgType.mainType;
        MsgPlugin* plg = MsgPluginManager::instance()->getPlugin(mainType);
 
        if (plg == NULL)
-       {
                THROW(MsgException::PLUGIN_ERROR, "No plugin for %d type", mainType);
-       }
-
-       MSG_REQUEST_INFO_S tmpInfo = {};
-
-       bool bReqSentStatus = false;
-
-       for (int i = 0; i < pReqInfo->msgInfo.nAddressCnt; i++)
-       {
-               MsgCopyReqInfo(pReqInfo, i, &tmpInfo);
-
-               // If MSG ID > 0 -> MSG in DRAFT
-               // Move Folder to OUTBOX
-               if (pReqInfo->msgInfo.msgPort.valid == false)
-               {
-                       pReqInfo->msgInfo.folderId = MSG_OUTBOX_ID;
-
-                       if (pReqInfo->msgInfo.msgId > 0 && (pReqInfo->msgInfo.folderId == MSG_DRAFT_ID || pReqInfo->msgInfo.folderId == MSG_OUTBOX_ID))
-                       {
-                               err = MsgStoUpdateMessage(&(tmpInfo.msgInfo), &(tmpInfo.sendOptInfo));
-                       }
 
-                       if (err != MSG_SUCCESS)
-                       {
-                               MSG_DEBUG("MsgStoUpdateMessage() Fail");
-                               continue;
-                       }
-               }
-
-               if (i == (pReqInfo->msgInfo.nAddressCnt -1))
-               {
-                       // Request Sent Status Callback
-                       bReqSentStatus = true;
-               }
-
-               err = plg->submitReq(&tmpInfo, bReqSentStatus);
-
-               if (err != MSG_SUCCESS)
-               {
-                       break;
-               }
+       // If MSG ID > 0 -> MSG in DRAFT
+       // Move Folder to OUTBOX
+       if (pReqInfo->msgInfo.msgPort.valid == false) {
+               pReqInfo->msgInfo.folderId = MSG_OUTBOX_ID;
 
-               if (i == (pReqInfo->msgInfo.nAddressCnt -1))
-               {
-                       // Copy MSG ID
-                       pReqInfo->msgInfo.msgId = tmpInfo.msgInfo.msgId;
-               }
+               if (pReqInfo->msgInfo.msgId > 0 && (pReqInfo->msgInfo.folderId == MSG_DRAFT_ID || pReqInfo->msgInfo.folderId == MSG_OUTBOX_ID))
+                       err = MsgStoUpdateMessage(&(pReqInfo->msgInfo), &(pReqInfo->sendOptInfo));
        }
 
+       err = plg->submitReq(pReqInfo);
+
        return err;
 }
 
 
-MSG_ERROR_T MsgSubmitReqMMS(MSG_REQUEST_INFO_S *pReqInfo, bool bScheduled)
+msg_error_t MsgSubmitReqMMS(MSG_REQUEST_INFO_S *pReqInfo)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        MSG_RECIPIENTS_LIST_S pRecipientList;
 
@@ -154,115 +117,105 @@ MSG_ERROR_T MsgSubmitReqMMS(MSG_REQUEST_INFO_S *pReqInfo, bool bScheduled)
        //      If MSG ID > 0 -> MSG in DRAFT
        // Move Folder to OUTBOX
        /* reject_msg_support */
-       if(!bScheduled)
-       {
-               if(pReqInfo->msgInfo.msgType.subType == MSG_SENDREQ_JAVA_MMS)
-               {
-                       char fileName[MAX_COMMON_INFO_SIZE+1] = {0};
+       MSG_DEBUG("Not scheduled MMS, pReqInfo->msgInfo.msgType.subType [%d]", pReqInfo->msgInfo.msgType.subType);
 
-                       // copy whole of MMS PDU filepath to msgData
-                       strncpy(fileName, pReqInfo->msgInfo.msgData, MAX_COMMON_INFO_SIZE);
-                       memset(pReqInfo->msgInfo.msgData, 0x00, MAX_MSG_DATA_LEN+1);
-                       snprintf(pReqInfo->msgInfo.msgData, MAX_MSG_DATA_LEN+1, MSG_IPC_DATA_PATH"%s", fileName);
+       if(pReqInfo->msgInfo.msgType.subType == MSG_SENDREQ_JAVA_MMS)
+       {
+               char fileName[MAX_COMMON_INFO_SIZE+1] = {0};
 
-                       MSG_DEBUG("JAVA MMS PDU filepath:%s", pReqInfo->msgInfo.msgData);
+               // copy whole of MMS PDU filepath to msgData
+               strncpy(fileName, pReqInfo->msgInfo.msgData, MAX_COMMON_INFO_SIZE);
+               memset(pReqInfo->msgInfo.msgData, 0x00, MAX_MSG_DATA_LEN+1);
+               snprintf(pReqInfo->msgInfo.msgData, MAX_MSG_DATA_LEN+1, MSG_IPC_DATA_PATH"%s", fileName);
 
-                       // submit request
-                       plg->submitReq(pReqInfo, false);
+               MSG_DEBUG("JAVA MMS PDU filepath:%s", pReqInfo->msgInfo.msgData);
 
-                       if(err != MSG_SUCCESS)
-                       {
-                               MSG_DEBUG("Update Network Status : [%d]", err);
-                               MsgStoUpdateNetworkStatus(&(pReqInfo->msgInfo),MSG_NETWORK_SEND_FAIL);
-                       }
+               // submit request
+               plg->submitReq(pReqInfo);
 
-                       return err;
+               if(err != MSG_SUCCESS)
+               {
+                       MSG_DEBUG("Update Network Status : [%d]", err);
+                       MsgStoUpdateNetworkStatus(&(pReqInfo->msgInfo),MSG_NETWORK_SEND_FAIL);
                }
-               else if((pReqInfo->msgInfo.msgType.subType == MSG_SENDREQ_MMS) || (pReqInfo->msgInfo.msgType.subType == MSG_FORWARD_MMS))
+
+               return err;
+       }
+       else if((pReqInfo->msgInfo.msgType.subType == MSG_SENDREQ_MMS) || (pReqInfo->msgInfo.msgType.subType == MSG_FORWARD_MMS))
+       {
+               // update address list in the ase of existing message
+               if(pReqInfo->msgInfo.msgId > 0)
                {
-                       // update address list in the ase of existing message
-                       if(pReqInfo->msgInfo.msgId > 0)
-                       {
-                               err = MsgStoGetOrgAddressList(&(pReqInfo->msgInfo));
+                       err = MsgStoGetOrgAddressList(&(pReqInfo->msgInfo));
 
-                               if(err != MSG_SUCCESS)
-                                       MSG_DEBUG("[WARNING]MsgStoGetOrgAddressList returned not a MSG_SUCCESS");
-                       }
+                       if(err != MSG_SUCCESS)
+                               MSG_DEBUG("[WARNING]MsgStoGetOrgAddressList returned not a MSG_SUCCESS");
+               }
 
-                       if(pReqInfo->msgInfo.msgId > 0 && (pReqInfo->msgInfo.folderId == MSG_DRAFT_ID || pReqInfo->msgInfo.folderId == MSG_OUTBOX_ID)) {
-                               MSG_ADDRESS_INFO_S addrInfo = {0,};
-                               int addrIdx = 0;
+               if(pReqInfo->msgInfo.msgId > 0 && (pReqInfo->msgInfo.folderId == MSG_DRAFT_ID || pReqInfo->msgInfo.folderId == MSG_OUTBOX_ID)) {
+                       MSG_ADDRESS_INFO_S addrInfo = {0,};
+                       int addrIdx = 0;
 
-                               err = MsgStoGetAddrInfo(pReqInfo->msgInfo.msgId, &addrInfo);
+                       err = MsgStoGetAddrInfo(pReqInfo->msgInfo.msgId, &addrInfo);
 
-                               if (err == MSG_SUCCESS) {
-                                       for (int i = 0; i < pReqInfo->msgInfo.nAddressCnt; i++) {
-                                               //if (pReqInfo->msgInfo.addressList[i].threadId == addrInfo.threadId) {
-                                               if (!strcmp(pReqInfo->msgInfo.addressList[i].addressVal, addrInfo.addressVal)) {
-                                                       addrIdx = i;
-                                                       MSG_DEBUG("addrIdx = %d, address = [%s]", addrIdx, pReqInfo->msgInfo.addressList[i].addressVal);
-                                                       break;
-                                               }
+                       if (err == MSG_SUCCESS) {
+                               for (int i = 0; i < pReqInfo->msgInfo.nAddressCnt; i++) {
+                                       //if (pReqInfo->msgInfo.addressList[i].threadId == addrInfo.threadId) {
+                                       if (!strcmp(pReqInfo->msgInfo.addressList[i].addressVal, addrInfo.addressVal)) {
+                                               addrIdx = i;
+                                               MSG_DEBUG("addrIdx = %d, address = [%s]", addrIdx, pReqInfo->msgInfo.addressList[i].addressVal);
+                                               break;
                                        }
-                               } else {
-                                       MSG_DEBUG("[Error]MsgStoGetAddrInfo is failed");
                                }
-
-                               pReqInfo->msgInfo.folderId = MSG_OUTBOX_ID;
-                               err = MsgStoUpdateMessage(&(pReqInfo->msgInfo), &(pReqInfo->sendOptInfo), addrIdx);
-
-                               MsgStoUpdateNetworkStatus(&(pReqInfo->msgInfo), pReqInfo->msgInfo.networkStatus);
                        } else {
-                               //new message case
-                               MSG_DEBUG("New Message");
-                               for(int i = 0; i < pReqInfo->msgInfo.nAddressCnt; i++) {
-                                       pReqInfo->msgInfo.folderId = MSG_OUTBOX_ID;
-                                       err = MsgStoAddMessage(&(pReqInfo->msgInfo), &(pReqInfo->sendOptInfo), i);
-                                       //pReqInfo->msgInfo.msgId = 0;
-                               }
-
-                               if (pReqInfo->msgInfo.msgId != pReqInfo->msgInfo.referenceId) {
-                                       MSG_DEBUG("Add Multi-recipient Message");
-                                       //multi-recipient mms case
-                                       pReqInfo->msgInfo.msgId = pReqInfo->msgInfo.referenceId;
-                               }
+                               MSG_DEBUG("[Error]MsgStoGetAddrInfo is failed");
                        }
-               //      pReqInfo->msgInfo.msgId = pReqInfo->msgInfo.referenceId;
+
+                       pReqInfo->msgInfo.folderId = MSG_OUTBOX_ID;
+                       err = MsgStoUpdateMessage(&(pReqInfo->msgInfo), &(pReqInfo->sendOptInfo));
+
+                       MsgStoUpdateNetworkStatus(&(pReqInfo->msgInfo), pReqInfo->msgInfo.networkStatus);
+               } else {
+                       //new message case
+                       MSG_DEBUG("New Message");
+                       pReqInfo->msgInfo.folderId = MSG_OUTBOX_ID;
+                       err = MsgStoAddMessage(&(pReqInfo->msgInfo), &(pReqInfo->sendOptInfo));
+                       //pReqInfo->msgInfo.msgId = 0;
                }
-               else if(pReqInfo->msgInfo.msgType.subType == MSG_READREPLY_MMS)
-               {
-                       err = MsgStoCheckReadReportStatus(pReqInfo->msgInfo.msgId);
-                       if(err != MSG_SUCCESS)
-                               return err;
+       }
+       else if(pReqInfo->msgInfo.msgType.subType == MSG_READREPLY_MMS)
+       {
+               err = MsgStoCheckReadReportStatus(pReqInfo->msgInfo.msgId);
+               if(err != MSG_SUCCESS)
+                       return err;
 
-                       err = MsgStoGetRecipientList(pReqInfo->msgInfo.msgId, &pRecipientList);
-                       if(err != MSG_SUCCESS)
-                               return MSG_ERR_PLUGIN_STORAGE;
+               err = MsgStoGetRecipientList(pReqInfo->msgInfo.msgId, &pRecipientList);
+               if(err != MSG_SUCCESS)
+                       return MSG_ERR_PLUGIN_STORAGE;
 
-                       pReqInfo->msgInfo.nAddressCnt = pRecipientList.recipientCnt;
+               pReqInfo->msgInfo.nAddressCnt = pRecipientList.recipientCnt;
 
-                       for(int i = 0; i < pRecipientList.recipientCnt; i++)
-                       {
-                               pReqInfo->msgInfo.addressList[i].addressType = pRecipientList.recipientAddr[i].addressType;
-                               pReqInfo->msgInfo.addressList[i].recipientType = MSG_RECIPIENTS_TYPE_TO;
-                               pReqInfo->msgInfo.addressList[i].contactId = pRecipientList.recipientAddr[i].contactId;
-                               strncpy(pReqInfo->msgInfo.addressList[i].addressVal, pRecipientList.recipientAddr[i].addressVal, MAX_ADDRESS_VAL_LEN);
-                       }
+               for(int i = 0; i < pRecipientList.recipientCnt; i++)
+               {
+                       pReqInfo->msgInfo.addressList[i].addressType = pRecipientList.recipientAddr[i].addressType;
+                       pReqInfo->msgInfo.addressList[i].recipientType = MSG_RECIPIENTS_TYPE_TO;
+                       pReqInfo->msgInfo.addressList[i].contactId = pRecipientList.recipientAddr[i].contactId;
+                       strncpy(pReqInfo->msgInfo.addressList[i].addressVal, pRecipientList.recipientAddr[i].addressVal, MAX_ADDRESS_VAL_LEN);
+               }
 
-                       char subject[MAX_SUBJECT_LEN+1];
+               char subject[MAX_SUBJECT_LEN+1];
 
-                       err = MsgStoGetSubject(pReqInfo->msgInfo.msgId, subject);
-                       if(err != MSG_SUCCESS)
-                               MSG_DEBUG("Getting subject returned not a MSG_SUCCESS");
+               err = MsgStoGetSubject(pReqInfo->msgInfo.msgId, subject);
+               if(err != MSG_SUCCESS)
+                       MSG_DEBUG("Getting subject returned not a MSG_SUCCESS");
 
-                       strncpy(pReqInfo->msgInfo.subject, subject, MAX_SUBJECT_LEN);
+               strncpy(pReqInfo->msgInfo.subject, subject, MAX_SUBJECT_LEN);
 
-                       err = plg->composeReadReport(&(pReqInfo->msgInfo));
-               }
-               else if(pReqInfo->msgInfo.msgType.subType == MSG_RETRIEVE_MMS)
-               {
-                       MsgStoUpdateNetworkStatus(&(pReqInfo->msgInfo), pReqInfo->msgInfo.networkStatus);
-               }
+               err = plg->composeReadReport(&(pReqInfo->msgInfo));
+       }
+       else if(pReqInfo->msgInfo.msgType.subType == MSG_RETRIEVE_MMS)
+       {
+               MsgStoUpdateNetworkStatus(&(pReqInfo->msgInfo), pReqInfo->msgInfo.networkStatus);
        }
 
        /* reject_msg_support */
@@ -279,13 +232,11 @@ MSG_ERROR_T MsgSubmitReqMMS(MSG_REQUEST_INFO_S *pReqInfo, bool bScheduled)
                case MSG_FORWARD_MMS:
                        MsgDeleteFile(pReqInfo->msgInfo.msgData);
                        memset(pReqInfo->msgInfo.msgData, 0x00, MAX_MSG_DATA_LEN+1);
-                       snprintf(pReqInfo->msgInfo.msgData, MAX_MSG_DATA_LEN+1, MSG_DATA_PATH"%d.mms", pReqInfo->msgInfo.referenceId);
+                       snprintf(pReqInfo->msgInfo.msgData, MAX_MSG_DATA_LEN+1, MSG_DATA_PATH"%d.mms", pReqInfo->msgInfo.msgId);
                        break;
 
                case MSG_READREPLY_MMS:
                case MSG_READRECIND_MMS:
-                       memset(pReqInfo->msgInfo.msgData, 0x00, MAX_MSG_DATA_LEN+1);
-                       snprintf(pReqInfo->msgInfo.msgData, MAX_MSG_DATA_LEN+1, MSG_DATA_PATH"%d.mms", pReqInfo->msgInfo.msgId);
                        break;
                default:
                        break;
@@ -311,7 +262,7 @@ MSG_ERROR_T MsgSubmitReqMMS(MSG_REQUEST_INFO_S *pReqInfo, bool bScheduled)
        }
 
        if(err == MSG_SUCCESS)
-               err = plg->submitReq(pReqInfo, false);
+               err = plg->submitReq(pReqInfo);
 
        if(err == MSG_SUCCESS && ( pReqInfo->msgInfo.msgType.subType == MSG_READREPLY_MMS || pReqInfo->msgInfo.msgType.subType == MSG_READRECIND_MMS ))
                MsgStoSetReadReportSendStatus(pReqInfo->msgInfo.msgId, MMS_RECEIVE_READ_REPORT_SENT);
@@ -329,20 +280,36 @@ MSG_ERROR_T MsgSubmitReqMMS(MSG_REQUEST_INFO_S *pReqInfo, bool bScheduled)
 }
 
 
-MSG_ERROR_T MsgCancelReq(MSG_REQUEST_ID_T reqId)
+msg_error_t MsgCancelReq(msg_request_id_t reqId)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        return err;
 }
 
 
-MSG_ERROR_T MsgUpdateSentMsg(MSG_MESSAGE_ID_T MsgId, MSG_NETWORK_STATUS_T Status)
+msg_error_t MsgUpdateSentMsg(msg_message_id_t MsgId, msg_network_status_t Status)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        bool bKeepCopy = true;
 
+#ifdef MSG_MMS_KEEPCOPY
+       MSG_SENDINGOPT_INFO_S sendOpt = {};
+
+       if (msgType.mainType == MSG_MMS_TYPE)
+       {
+               if (MsgStoGetMmsSendOpt(MsgId, &sendOpt) == MSG_SUCCESS)
+               {
+                       bKeepCopy = sendOpt.bKeepCopy;
+               }
+               else
+               {
+                       ret = MsgSettingGetBool(MSG_KEEP_COPY, &bKeepCopy);
+               }
+       }
+#endif
+
        // Move Msg to SENTBOX
        if (Status == MSG_NETWORK_SEND_SUCCESS)
        {
@@ -368,9 +335,10 @@ void MsgCopyReqInfo(MSG_REQUEST_INFO_S *pSrc, int addrIdx, MSG_REQUEST_INFO_S *p
 
        // Copy Msg Info
        pDest->msgInfo.msgId = pSrc->msgInfo.msgId;
-       pDest->msgInfo.folderId = pSrc->msgInfo.folderId;
 
-       pDest->msgInfo.referenceId = pSrc->msgInfo.referenceId;
+       pDest->msgInfo.threadId = pSrc->msgInfo.threadId;
+
+       pDest->msgInfo.folderId = pSrc->msgInfo.folderId;
 
        pDest->msgInfo.msgType.mainType = pSrc->msgInfo.msgType.mainType;
        pDest->msgInfo.msgType.subType = pSrc->msgInfo.msgType.subType;
@@ -380,7 +348,6 @@ void MsgCopyReqInfo(MSG_REQUEST_INFO_S *pSrc, int addrIdx, MSG_REQUEST_INFO_S *p
 
        pDest->msgInfo.nAddressCnt = 1;
 
-       pDest->msgInfo.addressList[0].threadId = pSrc->msgInfo.addressList[addrIdx].threadId;
        pDest->msgInfo.addressList[0].addressType = pSrc->msgInfo.addressList[addrIdx].addressType;
        pDest->msgInfo.addressList[0].recipientType = pSrc->msgInfo.addressList[addrIdx].recipientType;
        pDest->msgInfo.addressList[0].contactId = pSrc->msgInfo.addressList[addrIdx].contactId;
@@ -390,7 +357,6 @@ void MsgCopyReqInfo(MSG_REQUEST_INFO_S *pSrc, int addrIdx, MSG_REQUEST_INFO_S *p
        strncpy(pDest->msgInfo.replyAddress, pSrc->msgInfo.replyAddress, MAX_PHONE_NUMBER_LEN);
        strncpy(pDest->msgInfo.subject, pSrc->msgInfo.subject, MAX_SUBJECT_LEN);
 
-       pDest->msgInfo.scheduledTime = pSrc->msgInfo.scheduledTime;
        pDest->msgInfo.displayTime = pSrc->msgInfo.displayTime;
        pDest->msgInfo.networkStatus = pSrc->msgInfo.networkStatus;
        pDest->msgInfo.encodeType = pSrc->msgInfo.encodeType;
diff --git a/framework/transaction-manager/MsgCmdHandlerFilter.cpp b/framework/transaction-manager/MsgCmdHandlerFilter.cpp
new file mode 100755 (executable)
index 0000000..7034931
--- /dev/null
@@ -0,0 +1,209 @@
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#include "MsgDebug.h"
+#include "MsgUtilFunction.h"
+#include "MsgCppTypes.h"
+#include "MsgSpamFilter.h"
+#include "MsgStorageHandler.h"
+#include "MsgCmdHandler.h"
+
+
+/*==================================================================================================
+                                     FUNCTION IMPLEMENTATION
+==================================================================================================*/
+int MsgAddFilterHandler(const MSG_CMD_S *pCmd, char **ppEvent)
+{
+       msg_error_t err = MSG_SUCCESS;
+
+       int eventSize = 0;
+
+       // Get Filter Structure
+       MSG_FILTER_S* pFilter = (MSG_FILTER_S*)pCmd->cmdData;
+
+       // Add Filter
+       err = MsgStoAddFilter(pFilter);
+
+       if (err == MSG_SUCCESS)
+       {
+               MSG_DEBUG("Command Handle Success : MsgStoAddFilter()");
+       }
+       else
+       {
+               MSG_DEBUG("Command Handle Fail : MsgStoAddFilter()");
+       }
+
+       // Make Event Data
+       eventSize = MsgMakeEvent(NULL, 0, MSG_EVENT_ADD_FILTER, err, (void**)ppEvent);
+
+       return eventSize;
+}
+
+
+int MsgUpdateFilterHandler(const MSG_CMD_S *pCmd, char **ppEvent)
+{
+       msg_error_t err = MSG_SUCCESS;
+
+       int eventSize = 0;
+
+       // Get Filter Structure
+       MSG_FILTER_S* pFilter = (MSG_FILTER_S*)pCmd->cmdData;
+
+       // Update Filter
+       err = MsgStoUpdateFilter(pFilter);
+
+       if (err == MSG_SUCCESS)
+       {
+               MSG_DEBUG("Command Handle Success : MsgStoUpdateFilter()");
+       }
+       else
+       {
+               MSG_DEBUG("Command Handle Fail : MsgStoUpdateFilter()");
+       }
+
+       // Make Event Data
+       eventSize = MsgMakeEvent(NULL, 0, MSG_EVENT_UPDATE_FILTER, err, (void**)ppEvent);
+
+       return eventSize;
+}
+
+
+int MsgDeleteFilterHandler(const MSG_CMD_S *pCmd, char **ppEvent)
+{
+       msg_error_t err = MSG_SUCCESS;
+
+       int eventSize = 0;
+
+       // Get Filter Structure
+       msg_filter_id_t  *pFilterId = (msg_filter_id_t *)pCmd->cmdData;
+
+       MSG_DEBUG("Delete Filter id : %d", *pFilterId);
+
+       // Delete Filter
+       err = MsgStoDeleteFilter(*pFilterId);
+
+       if (err == MSG_SUCCESS)
+       {
+               MSG_DEBUG("Command Handle Success : MsgStoDeleteFilter()");
+       }
+       else
+       {
+               MSG_DEBUG("Command Handle Fail : MsgStoDeleteFilter()");
+       }
+
+       // Make Event Data
+       eventSize = MsgMakeEvent(NULL, 0, MSG_EVENT_DELETE_FILTER, err, (void**)ppEvent);
+
+       return eventSize;
+}
+
+
+int MsgGetFilterListHandler(const MSG_CMD_S *pCmd, char **ppEvent)
+{
+       msg_error_t err = MSG_SUCCESS;
+
+       char* encodedData = NULL;
+       AutoPtr<char> buf(&encodedData);
+
+       int dataSize = 0, eventSize = 0;
+
+       // Get Filter List
+       msg_struct_list_s filterList;
+
+       err = MsgStoGetFilterList(&filterList);
+
+       if (err == MSG_SUCCESS)
+       {
+               MSG_DEBUG("Command Handle Success : MsgStoGetFilterList()");
+
+               // Encoding Filter List Data
+               dataSize = MsgEncodeFilterList(&filterList, &encodedData);
+
+               delete [] filterList.msg_struct_info;
+       }
+       else
+       {
+               MSG_DEBUG("Command Handle Fail : MsgStoGetFilterList()");
+       }
+
+       // Make Event Data
+       eventSize = MsgMakeEvent(encodedData, dataSize, MSG_EVENT_GET_FILTERLIST, err, (void**)ppEvent);
+
+       return eventSize;
+}
+
+
+int MsgSetFilterOperationHandler(const MSG_CMD_S *pCmd, char **ppEvent)
+{
+       msg_error_t err = MSG_SUCCESS;
+
+       int eventSize = 0;
+
+       // Get Filter Flag
+       bool setFlag = false;
+
+       memcpy(&setFlag, pCmd->cmdData, sizeof(bool));
+
+       // Add Filter
+       err = MsgSetFilterOperation(setFlag);
+
+       if (err == MSG_SUCCESS)
+       {
+               MSG_DEBUG("Command Handle Success : MsgSetFilterOperation()");
+       }
+       else
+       {
+               MSG_DEBUG("Command Handle Fail : MsgSetFilterOperation()");
+       }
+
+       // Make Event Data
+       eventSize = MsgMakeEvent(NULL, 0, MSG_EVENT_SET_FILTER_OPERATION, err, (void**)ppEvent);
+
+       return eventSize;
+}
+
+
+int MsgGetFilterOperationHandler(const MSG_CMD_S *pCmd, char **ppEvent)
+{
+       msg_error_t err = MSG_SUCCESS;
+
+       char* encodedData = NULL;
+       AutoPtr<char> buf(&encodedData);
+
+       int dataSize = 0, eventSize = 0;
+
+       // Get Filter List
+       bool setFlag = false;
+
+       err = MsgGetFilterOperation(&setFlag);
+
+       if (err == MSG_SUCCESS)
+       {
+               MSG_DEBUG("Command Handle Success : MsgGetFilterOperation()");
+
+               // Encoding Filter List Data
+               dataSize = MsgEncodeFilterFlag(&setFlag, &encodedData);
+       }
+       else
+       {
+               MSG_DEBUG("Command Handle Fail : MsgFilterGetFilterList()");
+       }
+
+       // Make Event Data
+       eventSize = MsgMakeEvent(encodedData, dataSize, MSG_EVENT_GET_FILTER_OPERATION, err, (void**)ppEvent);
+
+       return eventSize;
+}
index bec9b09..5304c11 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include "MsgDebug.h"
 #include "MsgCmdHandler.h"
 ==================================================================================================*/
 int MsgSetConfigHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        int eventSize = 0;
+       int eventType = -1;
 
        // Get Setting Structure
        MSG_SETTING_S* pSetting = (MSG_SETTING_S*)pCmd->cmdData;
@@ -46,7 +47,39 @@ int MsgSetConfigHandler(const MSG_CMD_S *pCmd, char **ppEvent)
        }
 
        // Make Event Data
-       eventSize = MsgMakeEvent(NULL, 0, MSG_EVENT_SET_CONFIG, err, (void**)ppEvent);
+       switch (pCmd->cmdType) {
+       case MSG_CMD_SET_SMSC_OPT :
+               eventType = MSG_EVENT_SET_SMSC_OPT;
+               break;
+       case MSG_CMD_SET_CB_OPT :
+               eventType = MSG_EVENT_SET_CB_OPT;
+               break;
+       case MSG_CMD_SET_SMS_SEND_OPT :
+               eventType = MSG_EVENT_SET_SMS_SEND_OPT;
+               break;
+       case MSG_CMD_SET_MMS_SEND_OPT :
+               eventType = MSG_EVENT_SET_MMS_SEND_OPT;
+               break;
+       case MSG_CMD_SET_MMS_RECV_OPT :
+               eventType = MSG_EVENT_SET_MMS_RECV_OPT;
+               break;
+       case MSG_CMD_SET_PUSH_MSG_OPT :
+               eventType = MSG_EVENT_SET_PUSH_MSG_OPT;
+               break;
+       case MSG_CMD_SET_VOICE_MSG_OPT :
+               eventType = MSG_EVENT_SET_VOICE_MSG_OPT;
+               break;
+       case MSG_CMD_SET_GENERAL_MSG_OPT :
+               eventType = MSG_EVENT_SET_GENERAL_MSG_OPT;
+               break;
+       case MSG_CMD_SET_MSG_SIZE_OPT :
+                       eventType = MSG_EVENT_SET_MSG_SIZE_OPT;
+                       break;
+       default :
+               break;
+       }
+
+       eventSize = MsgMakeEvent(NULL, 0, eventType, err, (void**)ppEvent);
 
        return eventSize;
 }
@@ -54,12 +87,14 @@ int MsgSetConfigHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 
 int MsgGetConfigHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        char* encodedData = NULL;
        AutoPtr<char> buf(&encodedData);
 
-       int dataSize = 0, eventSize = 0;
+       int dataSize = 0;
+       int eventSize = 0;
+       int eventType = -1;
 
        // Get Option Type
        MSG_OPTION_TYPE_T* type = (MSG_OPTION_TYPE_T*)pCmd->cmdData;
@@ -75,17 +110,120 @@ int MsgGetConfigHandler(const MSG_CMD_S *pCmd, char **ppEvent)
                MSG_DEBUG("Command Handle Success : MsgGetConfigData()");
 
                // Encoding Config Data
-               dataSize = MsgEncodeSetting(&setting, &encodedData);
-       }
-       else
-       {
+               switch (setting.type)
+                       {
+                               case MSG_GENERAL_OPT :
+                                       dataSize += sizeof(MSG_GENERAL_OPT_S);
+                                       break;
+                               case MSG_SMS_SENDOPT :
+                                       dataSize += sizeof(MSG_SMS_SENDOPT_S);
+                                       break;
+                               case MSG_SMSC_LIST :
+                                       dataSize += sizeof(MSG_SMSC_LIST_S);
+                                       break;
+                               case MSG_MMS_SENDOPT :
+                                       dataSize += sizeof(MSG_MMS_SENDOPT_S);
+                                       break;
+                               case MSG_MMS_RECVOPT :
+                                       dataSize += sizeof(MSG_MMS_RECVOPT_S);
+                                       break;
+                               case MSG_MMS_STYLEOPT :
+                                       dataSize += sizeof(MSG_MMS_STYLEOPT_S);
+                                       break;
+                               case MSG_PUSHMSG_OPT :
+                                       dataSize += sizeof(MSG_PUSHMSG_OPT_S);
+                                       break;
+                               case MSG_CBMSG_OPT :
+                                       dataSize += sizeof(MSG_CBMSG_OPT_S);
+                                       break;
+                               case MSG_VOICEMAIL_OPT :
+                                       dataSize += sizeof(MSG_VOICEMAIL_OPT_S);
+                                       break;
+                               case MSG_MSGSIZE_OPT :
+                                       dataSize += sizeof(MSG_MSGSIZE_OPT_S);
+                                       break;
+                               default:
+                                       break;
+                       }
+
+                       encodedData = (char*)new char[dataSize];
+                       void* p = (void*)encodedData;
+
+                       switch (setting.type)
+                       {
+                       case MSG_GENERAL_OPT :
+                               memcpy(p, &(setting.option.generalOpt), dataSize);
+                               break;
+                       case MSG_SMS_SENDOPT :
+                               memcpy(p, &(setting.option.smsSendOpt), dataSize);
+                               break;
+                       case MSG_SMSC_LIST :
+                               memcpy(p, &(setting.option.smscList), dataSize);
+                               break;
+                       case MSG_MMS_SENDOPT :
+                               memcpy(p, &(setting.option.mmsSendOpt), dataSize);
+                               break;
+                       case MSG_MMS_RECVOPT :
+                               memcpy(p, &(setting.option.mmsRecvOpt), dataSize);
+                               break;
+                       case MSG_MMS_STYLEOPT :
+                               memcpy(p, &(setting.option.mmsStyleOpt), dataSize);
+                               break;
+                       case MSG_PUSHMSG_OPT :
+                               memcpy(p, &(setting.option.pushMsgOpt), dataSize);
+                               break;
+                       case MSG_CBMSG_OPT :
+                               memcpy(p, &(setting.option.cbMsgOpt), dataSize);
+                               break;
+                       case MSG_VOICEMAIL_OPT :
+                               memcpy(p, &(setting.option.voiceMailOpt), dataSize);
+                               break;
+                       case MSG_MSGSIZE_OPT :
+                               memcpy(p, &(setting.option.msgSizeOpt), dataSize);
+                               break;
+                       default:
+                               break;
+                       }
+       } else {
                MSG_DEBUG("Command Handle Fail : MsgGetConfigData()");
        }
 
        MSG_DEBUG("dataSize [%d]", dataSize);
 
+       switch (pCmd->cmdType) {
+       case MSG_CMD_GET_SMSC_OPT :
+               eventType = MSG_EVENT_GET_SMSC_OPT;
+               break;
+       case MSG_CMD_GET_CB_OPT :
+               eventType = MSG_EVENT_GET_CB_OPT;
+               break;
+       case MSG_CMD_GET_SMS_SEND_OPT :
+               eventType = MSG_EVENT_GET_SMS_SEND_OPT;
+               break;
+       case MSG_CMD_GET_MMS_SEND_OPT :
+               eventType = MSG_EVENT_GET_MMS_SEND_OPT;
+               break;
+       case MSG_CMD_GET_MMS_RECV_OPT :
+               eventType = MSG_EVENT_GET_MMS_RECV_OPT;
+               break;
+       case MSG_CMD_GET_PUSH_MSG_OPT :
+               eventType = MSG_EVENT_GET_PUSH_MSG_OPT;
+               break;
+       case MSG_CMD_GET_VOICE_MSG_OPT :
+               eventType = MSG_EVENT_GET_VOICE_MSG_OPT;
+               break;
+       case MSG_CMD_GET_GENERAL_MSG_OPT :
+               eventType = MSG_EVENT_GET_GENERAL_MSG_OPT;
+               break;
+       case MSG_CMD_GET_MSG_SIZE_OPT :
+                       eventType = MSG_EVENT_GET_MSG_SIZE_OPT;
+               break;
+       default :
+               break;
+       }
+
        // Make Event Data
-       eventSize = MsgMakeEvent(encodedData, dataSize, MSG_EVENT_GET_CONFIG, err, (void**)ppEvent);
+       eventSize = MsgMakeEvent(encodedData, dataSize, eventType, err, (void**)ppEvent);
 
        return eventSize;
 }
index f136b8d..a661a90 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include <stdlib.h>
 
@@ -20,6 +20,7 @@
 #include "MsgUtilFile.h"
 #include "MsgException.h"
 #include "MsgCppTypes.h"
+//#include "MsgSoundPlayer.h"
 #include "MsgUtilFunction.h"
 #include "MsgStorageHandler.h"
 #include "MsgPluginManager.h"
@@ -32,7 +33,7 @@
 ==================================================================================================*/
 int MsgAddMessageHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        char* encodedData = NULL;
        AutoPtr<char> buf(&encodedData);
@@ -45,54 +46,26 @@ int MsgAddMessageHandler(const MSG_CMD_S *pCmd, char **ppEvent)
        // Get Sending Option
        MSG_SENDINGOPT_INFO_S* pSendOptInfo = (MSG_SENDINGOPT_INFO_S*)(pCmd->cmdData + sizeof(MSG_MESSAGE_INFO_S));
 
-       // Add Message with address
-       for (int i = 0; i < pMsgInfo->nAddressCnt; i++)
-       {
-               err = MsgStoAddMessage(pMsgInfo, pSendOptInfo, i);
-
-               if (err == MSG_SUCCESS)
-               {
-                       MSG_DEBUG("Command Handle Success : MsgStoAddMessage()");
-
-                       // Get First Msg Id
-                       if (i == 0)
-                       {
-                               // Encoding Message ID
-                               dataSize = MsgEncodeMsgId(&(pMsgInfo->msgId), &encodedData);
-                       }
-               }
-               else
-               {
-                       MSG_DEBUG("Command Handle Fail : MsgStoAddMessage()");
-               }
-       }
-
-       // Add Message without address
-       if (pMsgInfo->nAddressCnt == 0)
-       {
-               err = MsgStoAddMessage(pMsgInfo, pSendOptInfo);
+       // Add Message
+       err = MsgStoAddMessage(pMsgInfo, pSendOptInfo);
 
-               if (err == MSG_SUCCESS)
-               {
+       if (err == MSG_SUCCESS) {
                        MSG_DEBUG("Command Handle Success : MsgStoAddMessage()");
 
                        // Encoding Message ID
                        dataSize = MsgEncodeMsgId(&(pMsgInfo->msgId), &encodedData);
-               }
-               else
-               {
+               } else {
                        MSG_DEBUG("Command Handle Fail : MsgStoAddMessage()");
                }
-       }
 
        // Delete Temp File for Message Data
        if (pMsgInfo->bTextSms == false)
                MsgDeleteFile(pMsgInfo->msgData); //ipc
 
        //storage change CB
-       MSG_MSGID_LIST_S msgIdList;
-       MSG_MESSAGE_ID_T msgIds[1];
-       memset(&msgIdList, 0x00, sizeof(MSG_MSGID_LIST_S));
+       msg_id_list_s msgIdList;
+       msg_message_id_t msgIds[1];
+       memset(&msgIdList, 0x00, sizeof(msg_id_list_s));
 
        msgIdList.nCount = 1;
        msgIds[0] = pMsgInfo->msgId;
@@ -109,7 +82,7 @@ int MsgAddMessageHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 
 int MsgAddSyncMLMessageHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        int eventSize = 0;
 
@@ -131,9 +104,9 @@ int MsgAddSyncMLMessageHandler(const MSG_CMD_S *pCmd, char **ppEvent)
                // broadcast to listener threads, here
                MsgTransactionManager::instance()->broadcastIncomingMsgCB(err, &msgInfo);
                //storage change CB
-               MSG_MSGID_LIST_S msgIdList;
-               MSG_MESSAGE_ID_T msgIds[1];
-               memset(&msgIdList, 0x00, sizeof(MSG_MSGID_LIST_S));
+               msg_id_list_s msgIdList;
+               msg_message_id_t msgIds[1];
+               memset(&msgIdList, 0x00, sizeof(msg_id_list_s));
 
                msgIdList.nCount = 1;
                msgIds[0] = msgInfo.msgId;
@@ -155,7 +128,7 @@ int MsgAddSyncMLMessageHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 
 int MsgUpdateMessageHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        int eventSize = 0;
 
@@ -178,9 +151,9 @@ int MsgUpdateMessageHandler(const MSG_CMD_S *pCmd, char **ppEvent)
                MsgDeleteFile(pMsgInfo->msgData); //ipc
 
        //storage change CB
-       MSG_MSGID_LIST_S msgIdList;
-       MSG_MESSAGE_ID_T msgIds[1];
-       memset(&msgIdList, 0x00, sizeof(MSG_MSGID_LIST_S));
+       msg_id_list_s msgIdList;
+       msg_message_id_t msgIds[1];
+       memset(&msgIdList, 0x00, sizeof(msg_id_list_s));
 
        msgIdList.nCount = 1;
        msgIds[0] = pMsgInfo->msgId;
@@ -197,15 +170,15 @@ int MsgUpdateMessageHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 
 int MsgUpdateReadStatusHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        int eventSize = 0;
 
-       MSG_MESSAGE_ID_T msgId;
+       msg_message_id_t msgId;
        bool readStatus;
 
-       memcpy(&msgId, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), sizeof(MSG_MESSAGE_ID_T));
-       memcpy(&readStatus, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN+sizeof(MSG_MESSAGE_ID_T)), sizeof(bool));
+       memcpy(&msgId, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), sizeof(msg_message_id_t));
+       memcpy(&readStatus, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN+sizeof(msg_message_id_t)), sizeof(bool));
 
        // Update Read Status
        err = MsgStoUpdateReadStatus(msgId, readStatus);
@@ -228,14 +201,14 @@ int MsgUpdateReadStatusHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 
 int MsgUpdateThreadReadStatusHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        int eventSize = 0;
 
-       MSG_THREAD_ID_T threadId;
+       msg_thread_id_t threadId;
        int unReadCnt = 0;
 
-       memcpy(&threadId, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), sizeof(MSG_THREAD_ID_T));
+       memcpy(&threadId, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), sizeof(msg_thread_id_t));
 
        MsgStoGetThreadUnreadCnt(threadId, &unReadCnt);
 
@@ -261,15 +234,15 @@ int MsgUpdateThreadReadStatusHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 
 int MsgUpdateProtectedStatusHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        int eventSize = 0;
 
-       MSG_MESSAGE_ID_T msgId;
+       msg_message_id_t msgId;
        bool protectedStatus;
 
-       memcpy(&msgId, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), sizeof(MSG_MESSAGE_ID_T));
-       memcpy(&protectedStatus, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN+sizeof(MSG_MESSAGE_ID_T)), sizeof(bool));
+       memcpy(&msgId, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), sizeof(msg_message_id_t));
+       memcpy(&protectedStatus, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN+sizeof(msg_message_id_t)), sizeof(bool));
 
        // Update Protected Status
        err = MsgStoUpdateProtectedStatus(msgId, protectedStatus);
@@ -292,13 +265,13 @@ int MsgUpdateProtectedStatusHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 
 int MsgDeleteMessageHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        int eventSize = 0;
 
        int extId = 0;
 
-       MSG_MESSAGE_ID_T* msgId = (MSG_MESSAGE_ID_T*)pCmd->cmdData;
+       msg_message_id_t* msgId = (msg_message_id_t*)pCmd->cmdData;
 
        MsgStoGetSyncMLExtId(*msgId, &extId);
 
@@ -313,9 +286,9 @@ int MsgDeleteMessageHandler(const MSG_CMD_S *pCmd, char **ppEvent)
                        MsgTransactionManager::instance()->broadcastSyncMLMsgOperationCB(err, -1, extId);
                }
 
-               MSG_MSGID_LIST_S msgIdList;
-               MSG_MESSAGE_ID_T msgIds[1];
-               memset(&msgIdList, 0x00, sizeof(MSG_MSGID_LIST_S));
+               msg_id_list_s msgIdList;
+               msg_message_id_t msgIds[1];
+               memset(&msgIdList, 0x00, sizeof(msg_id_list_s));
 
                msgIdList.nCount = 1;
                msgIds[0] = *msgId;
@@ -335,18 +308,18 @@ int MsgDeleteMessageHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 
 int MsgDeleteAllMessageInFolderHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        int eventSize = 0;
 
-       MSG_FOLDER_ID_T* folderId = (MSG_FOLDER_ID_T*)pCmd->cmdData;
+       msg_folder_id_t* folderId = (msg_folder_id_t*)pCmd->cmdData;
 
        bool bOnlyDB;
-       memcpy(&bOnlyDB, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN+sizeof(MSG_FOLDER_ID_T)), sizeof(bool));
+       memcpy(&bOnlyDB, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN+sizeof(msg_folder_id_t)), sizeof(bool));
 
 
-       MSG_MSGID_LIST_S msgIdList;
-       memset(&msgIdList, 0x00, sizeof(MSG_MSGID_LIST_S));
+       msg_id_list_s msgIdList;
+       memset(&msgIdList, 0x00, sizeof(msg_id_list_s));
 
        // Delete Message
        err = MsgStoDeleteAllMessageInFolder(*folderId, bOnlyDB, &msgIdList);
@@ -370,15 +343,15 @@ int MsgDeleteAllMessageInFolderHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 
 int MsgMoveMessageToFolderHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        int eventSize = 0;
 
-       MSG_MESSAGE_ID_T msgId;
-       MSG_FOLDER_ID_T folderId;
+       msg_message_id_t msgId;
+       msg_folder_id_t folderId;
 
-       memcpy(&msgId, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), sizeof(MSG_MESSAGE_ID_T));
-       memcpy(&folderId, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN+sizeof(MSG_MESSAGE_ID_T)), sizeof(MSG_FOLDER_ID_T));
+       memcpy(&msgId, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), sizeof(msg_message_id_t));
+       memcpy(&folderId, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN+sizeof(msg_message_id_t)), sizeof(msg_folder_id_t));
 
        // Move Message
        err = MsgStoMoveMessageToFolder(msgId, folderId);
@@ -386,9 +359,9 @@ int MsgMoveMessageToFolderHandler(const MSG_CMD_S *pCmd, char **ppEvent)
        if (err == MSG_SUCCESS) {
                MSG_DEBUG("Command Handle Success : MsgStoMoveMessageToFolder()");
 
-               MSG_MSGID_LIST_S msgIdList;
-               MSG_MESSAGE_ID_T msgIds[1];
-               memset(&msgIdList, 0x00, sizeof(MSG_MSGID_LIST_S));
+               msg_id_list_s msgIdList;
+               msg_message_id_t msgIds[1];
+               memset(&msgIdList, 0x00, sizeof(msg_id_list_s));
 
                msgIdList.nCount = 1;
                msgIds[0] = msgId;
@@ -408,15 +381,15 @@ int MsgMoveMessageToFolderHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 
 int MsgMoveMessageToStorageHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        int eventSize = 0;
 
-       MSG_MESSAGE_ID_T msgId;
-       MSG_STORAGE_ID_T storageId;
+       msg_message_id_t msgId;
+       msg_storage_id_t storageId;
 
-       memcpy(&msgId, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), sizeof(MSG_MESSAGE_ID_T));
-       memcpy(&storageId, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN+sizeof(MSG_MESSAGE_ID_T)), sizeof(MSG_STORAGE_ID_T));
+       memcpy(&msgId, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), sizeof(msg_message_id_t));
+       memcpy(&storageId, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN+sizeof(msg_message_id_t)), sizeof(msg_storage_id_t));
 
        // Move Message
        err = MsgStoMoveMessageToStorage(msgId, storageId);
@@ -439,7 +412,7 @@ int MsgMoveMessageToStorageHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 
 int MsgCountMessageHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        char* encodedData = NULL;
        AutoPtr<char> buf(&encodedData);
@@ -447,7 +420,7 @@ int MsgCountMessageHandler(const MSG_CMD_S *pCmd, char **ppEvent)
        int dataSize = 0, eventSize = 0;
 
        // Get Folder ID
-       MSG_FOLDER_ID_T* folderId = (MSG_FOLDER_ID_T*)pCmd->cmdData;
+       msg_folder_id_t* folderId = (msg_folder_id_t*)pCmd->cmdData;
 
        // Get Message Count
        MSG_COUNT_INFO_S countInfo;
@@ -475,7 +448,7 @@ int MsgCountMessageHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 
 int MsgCountMsgByTypeHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        char* encodedData = NULL;
        AutoPtr<char> buf(&encodedData);
@@ -511,10 +484,10 @@ int MsgCountMsgByTypeHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 
 int MsgGetMessageHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        // Get Message ID
-       MSG_MESSAGE_ID_T* msgId = (MSG_MESSAGE_ID_T*)pCmd->cmdData;
+       msg_message_id_t* msgId = (msg_message_id_t*)pCmd->cmdData;
 
        char* encodedData = NULL;
        AutoPtr<char> buf(&encodedData);
@@ -553,14 +526,14 @@ int MsgGetMessageHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 
 int MsgGetFolderViewListHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        // Get Folder ID
-       MSG_FOLDER_ID_T folderId;
+       msg_folder_id_t folderId;
        MSG_SORT_RULE_S sortRule;
 
-       memcpy(&folderId, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), sizeof(MSG_FOLDER_ID_T));
-       memcpy(&sortRule, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN+sizeof(MSG_FOLDER_ID_T)), sizeof(MSG_SORT_RULE_S));
+       memcpy(&folderId, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), sizeof(msg_folder_id_t));
+       memcpy(&sortRule, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN+sizeof(msg_folder_id_t)), sizeof(MSG_SORT_RULE_S));
 
        char* encodedData = NULL;
        AutoPtr<char> buf(&encodedData);
@@ -568,7 +541,7 @@ int MsgGetFolderViewListHandler(const MSG_CMD_S *pCmd, char **ppEvent)
        int dataSize = 0, eventSize = 0;
 
        // Get Message Common Info
-       MSG_LIST_S folderViewList;
+       msg_struct_list_s folderViewList;
 
        err = MsgStoGetFolderViewList(folderId, &sortRule, &folderViewList);
 
@@ -577,14 +550,14 @@ int MsgGetFolderViewListHandler(const MSG_CMD_S *pCmd, char **ppEvent)
                MSG_DEBUG("Command Handle Success : MsgStoGetFolderViewList()");
 
                // Encoding Folder View List Data
-               dataSize = MsgEncodeFolderViewList(&folderViewList, &encodedData);
+//             dataSize = MsgEncodeFolderViewList(&folderViewList, &encodedData);
 
                MSG_DEBUG("dataSize [%d]", dataSize);
 
-               if (folderViewList.msgInfo != NULL)
+               if (folderViewList.msg_struct_info != NULL)
                {
-                       delete [] folderViewList.msgInfo;
-                       folderViewList.msgInfo = NULL;
+                       delete [] folderViewList.msg_struct_info;
+                       folderViewList.msg_struct_info = NULL;
                }
        }
        else
@@ -602,7 +575,7 @@ int MsgGetFolderViewListHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 
 int MsgAddFolderHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        int eventSize = 0;
 
@@ -630,7 +603,7 @@ int MsgAddFolderHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 
 int MsgUpdateFolderHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        int eventSize = 0;
 
@@ -658,12 +631,12 @@ int MsgUpdateFolderHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 
 int MsgDeleteFolderHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        int eventSize = 0;
 
        // Get Folder Info
-       MSG_FOLDER_ID_T* pFolderInfo = (MSG_FOLDER_ID_T*)pCmd->cmdData;
+       msg_folder_id_t* pFolderInfo = (msg_folder_id_t*)pCmd->cmdData;
 
        // Delete Folder
        err = MsgStoDeleteFolder(*pFolderInfo);
@@ -686,7 +659,7 @@ int MsgDeleteFolderHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 
 int MsgGetFolderListHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        char* encodedData = NULL;
        AutoPtr<char> buf(&encodedData);
@@ -694,7 +667,7 @@ int MsgGetFolderListHandler(const MSG_CMD_S *pCmd, char **ppEvent)
        int dataSize = 0, eventSize = 0;
 
        // Get Storage List
-       MSG_FOLDER_LIST_S folderList;
+       msg_struct_list_s folderList;
 
        err = MsgStoGetFolderList(&folderList);
 
@@ -705,7 +678,7 @@ int MsgGetFolderListHandler(const MSG_CMD_S *pCmd, char **ppEvent)
                // Encoding Folder List Data
                dataSize = MsgEncodeFolderList(&folderList, &encodedData);
 
-               delete [] folderList.folderInfo;
+               delete [] folderList.msg_struct_info;
        }
        else
        {
@@ -721,7 +694,7 @@ int MsgGetFolderListHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 
 int MsgInitSimBySatHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        int eventSize = 0;
 
@@ -737,7 +710,7 @@ int MsgInitSimBySatHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 
 int MsgGetMsgTypeHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        char* encodedData = NULL;
        AutoPtr<char> buf(&encodedData);
@@ -746,9 +719,9 @@ int MsgGetMsgTypeHandler(const MSG_CMD_S *pCmd, char **ppEvent)
        int dataSize = 0, eventSize = 0;
 
        // Get Message ID
-       MSG_MESSAGE_ID_T msgId;
+       msg_message_id_t msgId;
 
-       memcpy(&msgId, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), sizeof(MSG_MESSAGE_ID_T));
+       memcpy(&msgId, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), sizeof(msg_message_id_t));
 
        // Get Msg Type
        MSG_MESSAGE_TYPE_S msgType;
@@ -777,7 +750,7 @@ int MsgGetMsgTypeHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 
 int MsgGetThreadViewListHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        MSG_SORT_RULE_S sortRule = {0};
 
@@ -789,7 +762,7 @@ int MsgGetThreadViewListHandler(const MSG_CMD_S *pCmd, char **ppEvent)
        int dataSize = 0, eventSize = 0;
 
        // Get Thread View List
-       MSG_THREAD_VIEW_LIST_S msgThreadViewList;
+       msg_struct_list_s msgThreadViewList;
 
        err = MsgStoGetThreadViewList(&sortRule, &msgThreadViewList);
 
@@ -802,10 +775,10 @@ int MsgGetThreadViewListHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 
                MSG_DEBUG("dataSize [%d]", dataSize);
 
-               if (msgThreadViewList.msgThreadInfo != NULL)
+               if (msgThreadViewList.msg_struct_info != NULL)
                {
-                       delete [] msgThreadViewList.msgThreadInfo;
-                       msgThreadViewList.msgThreadInfo = NULL;
+                       delete [] msgThreadViewList.msg_struct_info;
+                       msgThreadViewList.msg_struct_info = NULL;
                }
        }
        else
@@ -823,18 +796,18 @@ int MsgGetThreadViewListHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 
 int MsgGetConversationViewListHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
-       MSG_THREAD_ID_T threadId;
+       msg_thread_id_t threadId;
 
-       memcpy(&threadId, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), sizeof(MSG_THREAD_ID_T));
+       memcpy(&threadId, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), sizeof(msg_thread_id_t));
 
        char* encodedData = NULL;
        AutoPtr<char> buf(&encodedData);
 
        int dataSize = 0, eventSize = 0;
 
-       MSG_LIST_S convViewList;
+       msg_struct_list_s convViewList;
 
        err = MsgStoGetConversationViewList(threadId, &convViewList);
 
@@ -847,10 +820,10 @@ int MsgGetConversationViewListHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 
                MSG_DEBUG("dataSize [%d]", dataSize);
 
-               if (convViewList.msgInfo != NULL)
+               if (convViewList.msg_struct_info != NULL)
                {
-                       delete [] convViewList.msgInfo;
-                       convViewList.msgInfo = NULL;
+                       delete [] convViewList.msg_struct_info;
+                       convViewList.msg_struct_info = NULL;
                }
        }
        else
@@ -867,19 +840,19 @@ int MsgGetConversationViewListHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 
 int MsgDeleteThreadMessageListHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
-       MSG_THREAD_ID_T threadId;
+       msg_thread_id_t threadId;
        bool isSyncMLMsg = false;
 
-       memcpy(&threadId, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), sizeof(MSG_THREAD_ID_T));
+       memcpy(&threadId, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), sizeof(msg_thread_id_t));
 
        int eventSize = 0;
 
        isSyncMLMsg = MsgStoCheckSyncMLMsgInThread(threadId);
 
-       MSG_MSGID_LIST_S msgIdList;
-       memset(&msgIdList, 0x00, sizeof(MSG_MSGID_LIST_S));
+       msg_id_list_s msgIdList;
+       memset(&msgIdList, 0x00, sizeof(msg_id_list_s));
 
        err = MsgStoDeleteThreadMessageList(threadId, &msgIdList);
 
@@ -909,7 +882,7 @@ int MsgDeleteThreadMessageListHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 
 int MsgCountMsgByContactHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        // Get From address
        MSG_THREAD_LIST_INDEX_S addrInfo;
@@ -949,10 +922,10 @@ int MsgCountMsgByContactHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 
 int MsgGetQuickPanelDataHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        // Get Message ID
-       MSG_QUICKPANEL_TYPE_T* type = (MSG_QUICKPANEL_TYPE_T*)pCmd->cmdData;
+       msg_quickpanel_type_t* type = (msg_quickpanel_type_t*)pCmd->cmdData;
 
        char* encodedData = NULL;
        AutoPtr<char> buf(&encodedData);
@@ -987,7 +960,7 @@ int MsgGetQuickPanelDataHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 
 int MsgResetDatabaseHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        int eventSize = 0;
 
@@ -1008,7 +981,7 @@ int MsgResetDatabaseHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 
 int MsgGetMemSizeHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        char* encodedData = NULL;
        AutoPtr<char> buf(&encodedData);
@@ -1029,12 +1002,53 @@ int MsgGetMemSizeHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 }
 
 
+int MsgBackupMessageHandler(const MSG_CMD_S *pCmd, char **ppEvent)
+{
+       msg_error_t err = MSG_SUCCESS;
+
+       int eventSize = 0;
+
+       err = MsgStoBackupMessage();
+
+       if (err == MSG_SUCCESS)
+               MSG_DEBUG("Command Handle Success : MsgBackupMessageHandler()");
+       else
+               MSG_DEBUG("Command Handle Fail : MsgBackupMessageHandler()");
+
+       // Make Event Data
+       eventSize = MsgMakeEvent(NULL, 0, MSG_EVENT_BACKUP_MESSAGE, err, (void**)ppEvent);
+
+       return eventSize;
+}
+
+
+int MsgRestoreMessageHandler(const MSG_CMD_S *pCmd, char **ppEvent)
+{
+       msg_error_t err = MSG_SUCCESS;
+
+       int eventSize = 0;
+
+       // Reset DB
+       err = MsgStoRestoreMessage();
+
+       if (err == MSG_SUCCESS)
+               MSG_DEBUG("Command Handle Success : MsgStoRestoreMessage()");
+       else
+               MSG_DEBUG("Command Handle Fail : MsgStoRestoreMessage()");
+
+       // Make Event Data
+       eventSize = MsgMakeEvent(NULL, 0, MSG_EVENT_RESTORE_MESSAGE, err, (void**)ppEvent);
+
+       return eventSize;
+}
+
+
 int MsgGetReportStatusHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        // Get Message ID
-       MSG_MESSAGE_ID_T* msgId = (MSG_MESSAGE_ID_T*)pCmd->cmdData;
+       msg_message_id_t* msgId = (msg_message_id_t*)pCmd->cmdData;
 
        char* encodedData = NULL;
        AutoPtr<char> buf(&encodedData);
@@ -1064,3 +1078,81 @@ int MsgGetReportStatusHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 
        return eventSize;
 }
+
+
+int MsgGetThreadIdByAddressHandler(const MSG_CMD_S *pCmd, char **ppEvent)
+{
+       msg_error_t err = MSG_SUCCESS;
+
+       MSG_MESSAGE_INFO_S msgInfo;
+       memset(&msgInfo, 0x00, sizeof(MSG_MESSAGE_INFO_S));
+
+       int *addrCnt = (int *)pCmd->cmdData;
+       MSG_DEBUG("*addrCnt [%d]", *addrCnt);
+
+       msgInfo.nAddressCnt = *addrCnt;
+       for(int i=0; i<(*addrCnt); i++)
+               memcpy(&msgInfo.addressList[i], (MSG_ADDRESS_INFO_S *)(pCmd->cmdData+sizeof(int)+(sizeof(MSG_ADDRESS_INFO_S)*i)), sizeof(MSG_ADDRESS_INFO_S));
+
+       char* encodedData = NULL;
+       AutoPtr<char> buf(&encodedData);
+
+       int dataSize = 0, eventSize = 0;
+
+       msg_thread_id_t threadId;
+
+       err = MsgStoGetThreadIdByAddress(&msgInfo, &threadId);
+
+       if (err == MSG_SUCCESS)
+       {
+               MSG_DEBUG("threadId [%d]", threadId);
+               MSG_DEBUG("Command Handle Success : MsgGetThreadIdByAddressHandler()");
+
+               // Encoding threadId Data
+               dataSize = MsgEncodeThreadId(&threadId, &encodedData);
+       }
+       else
+       {
+               MSG_DEBUG("Command Handle Fail : MsgGetThreadIdByAddressHandler()");
+       }
+
+       // Make Event Data
+       eventSize = MsgMakeEvent(encodedData, dataSize, MSG_EVENT_GET_THREAD_ID_BY_ADDRESS, err, (void**)ppEvent);
+
+       return eventSize;
+}
+
+
+int MsgGetThreadInfoHandler(const MSG_CMD_S *pCmd, char **ppEvent)
+{
+       msg_error_t err = MSG_SUCCESS;
+
+       char* encodedData = NULL;
+       AutoPtr<char> buf(&encodedData);
+
+       int dataSize = 0;
+       int eventSize = 0;
+
+       msg_thread_id_t threadId;
+
+       memcpy(&threadId, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), sizeof(msg_thread_id_t));
+
+       MSG_THREAD_VIEW_S threadInfo;
+       memset(&threadInfo, 0x00, sizeof(threadInfo));
+
+       err = MsgStoGetThreadInfo(threadId, &threadInfo);
+
+       if (err == MSG_SUCCESS) {
+               MSG_DEBUG("Command Handle Success : MsgStoGetThreadInfo()");
+
+               // Encoding thread Info Data
+               dataSize = MsgEncodeThreadInfo(&threadInfo, &encodedData);
+       } else {
+               MSG_DEBUG("Command Handle Fail : MsgStoGetThreadInfo()");
+       }
+
+       // Make Event Data
+       eventSize = MsgMakeEvent(encodedData, dataSize, MSG_EVENT_GET_THREAD_INFO, err, (void**)ppEvent);
+
+       return eventSize;
+}
index 371821c..113e6ff 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include <time.h>
 
 #include "MsgPluginManager.h"
 #include "MsgCmdHandler.h"
 
+#include <alarm.h>
 
 /*==================================================================================================
                                      FUNCTION IMPLEMENTATION
 ==================================================================================================*/
 int MsgSubmitReqHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
        bool bNewMsg = true;
 
        int eventSize = 0;
@@ -74,7 +75,7 @@ int MsgSubmitReqHandler(const MSG_CMD_S *pCmd, char **ppEvent)
                // Retrieve MMS shall not be kept in sentMsg
                if ((reqInfo.msgInfo.msgType.subType == MSG_SENDREQ_MMS) ||
                        (reqInfo.msgInfo.msgType.subType == MSG_FORWARD_MMS) ||
-                       (reqInfo.msgInfo.msgType.subType == MSG_SENDREQ_JAVA_MMS))
+                       (reqInfo.msgInfo.msgType.subType == MSG_SENDREQ_JAVA_MMS))
                MsgTransactionManager::instance()->insertSentMsg(reqId, &proxyInfo);
        }
 
@@ -101,14 +102,13 @@ int MsgSubmitReqHandler(const MSG_CMD_S *pCmd, char **ppEvent)
        if(((reqInfo.msgInfo.msgType.subType == MSG_NOTIFYRESPIND_MMS) &&
                 (reqInfo.msgInfo.msgType.mainType == MSG_MMS_TYPE)))
                err = MsgStoDeleteMessage(reqInfo.msgInfo.msgId, true);
-       /* reject_msg_support */
 
        /** send storage CB */
-       if (err == MSG_SUCCESS && bNewMsg && reqInfo.msgInfo.msgPort.valid == false) {
+       if ((err == MSG_SUCCESS || err != MSG_ERR_PLUGIN_STORAGE) && bNewMsg && reqInfo.msgInfo.msgPort.valid == false) {
 
-               MSG_MSGID_LIST_S msgIdList;
-               MSG_MESSAGE_ID_T msgIds[1];
-               memset(&msgIdList, 0x00, sizeof(MSG_MSGID_LIST_S));
+               msg_id_list_s msgIdList;
+               msg_message_id_t msgIds[1];
+               memset(&msgIdList, 0x00, sizeof(msg_id_list_s));
 
                msgIdList.nCount = 1;
                msgIds[0] = reqInfo.msgInfo.msgId;
@@ -122,12 +122,12 @@ int MsgSubmitReqHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 
 int MsgCancelReqHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        int eventSize = 0;
 
        // Get Request ID
-       MSG_REQUEST_ID_T* reqId = (MSG_REQUEST_ID_T*)pCmd->cmdData;
+       msg_request_id_t* reqId = (msg_request_id_t*)pCmd->cmdData;
 
        // Cancel Request
        err = MsgCancelReq(*reqId);
@@ -316,9 +316,6 @@ int MsgSentStatusHandler(const MSG_CMD_S *pCmd, char **ppEvent)
                // just making data which will be passed to plugin. it indicates "handling evt success"
                MsgTransactionManager::instance()->delProxyInfo(pStatus->reqId);
 
-               //in case of scheduled message sending, scheduled msg table should be updated.
-               MsgStoDeleteScheduledMessage(prxInfo->sentMsgId);
-
                return MsgMakeEvent(NULL, 0, MSG_EVENT_PLG_SENT_STATUS_CNF, MSG_SUCCESS, (void**)ppEvent);
        }
 
@@ -344,7 +341,7 @@ int MsgIncomingMsgHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 {
        MSG_BEGIN();
 
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
        int eventSize = 0;
        bool sendNoti = true;
 
@@ -362,9 +359,9 @@ int MsgIncomingMsgHandler(const MSG_CMD_S *pCmd, char **ppEvent)
        err = MsgHandleIncomingMsg(&msgInfo, &sendNoti);
 
        // broadcast to listener threads, here
-       MSG_MSGID_LIST_S msgIdList;
-       MSG_MESSAGE_ID_T msgIds[1];
-       memset(&msgIdList, 0x00, sizeof(MSG_MSGID_LIST_S));
+       msg_id_list_s msgIdList;
+       msg_message_id_t msgIds[1];
+       memset(&msgIdList, 0x00, sizeof(msg_id_list_s));
 
        msgIdList.nCount = 1;
        msgIds[0] = msgInfo.msgId;
@@ -373,6 +370,8 @@ int MsgIncomingMsgHandler(const MSG_CMD_S *pCmd, char **ppEvent)
        if (sendNoti == true) {
                MsgTransactionManager::instance()->broadcastIncomingMsgCB(err, &msgInfo);
                MsgTransactionManager::instance()->broadcastStorageChangeCB(err, MSG_STORAGE_CHANGE_INSERT, &msgIdList);
+       } else if (msgInfo.folderId == MSG_SPAMBOX_ID) {
+               MsgTransactionManager::instance()->broadcastStorageChangeCB(err, MSG_STORAGE_CHANGE_INSERT, &msgIdList);
        }
 
        eventSize = MsgMakeEvent(NULL, 0, MSG_EVENT_PLG_INCOMING_MSG_IND, err, (void**)ppEvent);
@@ -385,22 +384,22 @@ int MsgIncomingMsgHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 int MsgIncomingMMSConfMsgHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 {
        MSG_BEGIN();
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
        int eventsize = 0;
 
        MSG_MESSAGE_INFO_S msgInfo = {0};
-       MSG_REQUEST_ID_T reqID;
+       msg_request_id_t reqID;
 
        memcpy(&msgInfo, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), sizeof(MSG_MESSAGE_INFO_S));
-       memcpy(&reqID, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN+sizeof(MSG_MESSAGE_INFO_S)), sizeof(MSG_REQUEST_ID_T));
+       memcpy(&reqID, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN+sizeof(MSG_MESSAGE_INFO_S)), sizeof(msg_request_id_t));
 
        MSG_DEBUG(" pMsg = %s, pReqId = %d ", msgInfo.msgData, reqID);
        MSG_DEBUG(" msgtype subtype is [%d]", msgInfo.msgType.subType);
 
        // For Storage change callback
-       MSG_MSGID_LIST_S msgIdList;
-       MSG_MESSAGE_ID_T msgIds[1];
-       memset(&msgIdList, 0x00, sizeof(MSG_MSGID_LIST_S));
+       msg_id_list_s msgIdList;
+       msg_message_id_t msgIds[1];
+       memset(&msgIdList, 0x00, sizeof(msg_id_list_s));
 
        msgIdList.nCount = 1;
        msgIds[0] = msgInfo.msgId;
@@ -441,34 +440,36 @@ int MsgIncomingMMSConfMsgHandler(const MSG_CMD_S *pCmd, char **ppEvent)
                MSG_PROXY_INFO_S* prxInfo = MsgTransactionManager::instance()->getProxyInfo(reqID);
 
                // when no sent status cb is found (in case of mobile tracker)
-               if (!prxInfo)
-                       return MsgMakeEvent(NULL, 0, MSG_EVENT_PLG_SENT_STATUS_CNF, MSG_SUCCESS, (void**)ppEvent);
-
-               // No need to update javaMMS sent messages
-               javamms_list& listenerList = MsgTransactionManager::instance()->getJavaMMSList();
-               javamms_list::iterator it = listenerList.begin();
-
-               MSG_DEBUG("listenerList size:%d ",listenerList.size());
-
-               if (msgInfo.networkStatus == MSG_NETWORK_SEND_FAIL && msgInfo.msgType.subType == MSG_SENDREQ_MMS) {
-                       for ( ; it != listenerList.end() ; it++) {
-                               if (strstr(it->pduFileName,"JAVA")) {
-                                       MSG_DEBUG("JAVA MMS fileName:%s", it->pduFileName);
-                                       MsgDeleteFile(it->pduFileName);         // ipc
-                                       listenerList.erase(it);
-                                       goto __BYPASS_UPDATE;
-                               }
-                       }
+               if (!prxInfo) {
+                       MSG_DEBUG("prxInfo is NULL");
+                       eventsize = MsgMakeEvent(NULL, 0, MSG_EVENT_PLG_SENT_STATUS_CNF, MSG_SUCCESS, (void**)ppEvent);
                } else {
-                       //msgData has MMS_RECV_DATA_S
-                       MMS_RECV_DATA_S* pMmsRecvData = (MMS_RECV_DATA_S*)msgInfo.msgData;
-
-                       for ( ; it != listenerList.end() ; it++) {
-                               if(!strcmp(it->id, pMmsRecvData->szTrID)) {
-                                       MSG_DEBUG("find sent JAVA MMS message trId:%s from listener list trId:%s",pMmsRecvData->szTrID, it->id);
-                                       MsgDeleteFile(it->pduFileName); // ipc
-                                       listenerList.erase(it);
-                                       goto __BYPASS_UPDATE;
+                       // No need to update javaMMS sent messages
+                       javamms_list& listenerList = MsgTransactionManager::instance()->getJavaMMSList();
+                       javamms_list::iterator it = listenerList.begin();
+
+                       MSG_DEBUG("listenerList size:%d ",listenerList.size());
+
+                       if (msgInfo.networkStatus == MSG_NETWORK_SEND_FAIL && msgInfo.msgType.subType == MSG_SENDREQ_MMS) {
+                               for ( ; it != listenerList.end() ; it++) {
+                                       if (strstr(it->pduFileName, "JAVA")) {
+                                               MSG_DEBUG("JAVA MMS fileName:%s", it->pduFileName);
+                                               MsgDeleteFile(it->pduFileName);         // ipc
+                                               listenerList.erase(it);
+                                               goto __BYPASS_UPDATE;
+                                       }
+                               }
+                       } else {
+                               //msgData has MMS_RECV_DATA_S
+                               MMS_RECV_DATA_S* pMmsRecvData = (MMS_RECV_DATA_S*)msgInfo.msgData;
+
+                               for ( ; it != listenerList.end() ; it++) {
+                                       if(!strcmp(it->id, pMmsRecvData->szTrID)) {
+                                               MSG_DEBUG("find sent JAVA MMS message trId:%s from listener list trId:%s",pMmsRecvData->szTrID, it->id);
+                                               MsgDeleteFile(it->pduFileName); // ipc
+                                               listenerList.erase(it);
+                                               goto __BYPASS_UPDATE;
+                                       }
                                }
                        }
                }
@@ -485,31 +486,33 @@ __BYPASS_UPDATE:
                } else {
                        MSG_DEBUG("message-dialog: send success");
                        MsgInsertTicker("Multimedia message sent.", MULTIMEDIA_MESSAGE_SENT);
-               }
 
-               if (prxInfo->handleAddr == 0) {
-                       // just making data which will be passed to plugin. it indicates "handling evt success"
-                       MsgTransactionManager::instance()->delProxyInfo(reqID);
+                       MSG_DEBUG("Enter MsgAddPhoneLog() : msgInfo.addressList[0].addressVal [%s]", msgInfo.addressList[0].addressVal);
+                       MsgAddPhoneLog(&msgInfo);
+               }
 
-                       //in case of scheduled message sending, scheduled msg table should be updated.
-                       MsgStoDeleteScheduledMessage(prxInfo->sentMsgId);
+               if (prxInfo) {
+                       if (prxInfo->handleAddr == 0) {
+                               // just making data which will be passed to plugin. it indicates "handling evt success"
+                               MsgTransactionManager::instance()->delProxyInfo(reqID);
 
-                       return MsgMakeEvent(NULL, 0, MSG_EVENT_PLG_SENT_STATUS_CNF, MSG_SUCCESS, (void**)ppEvent);
-               }
+                               return MsgMakeEvent(NULL, 0, MSG_EVENT_PLG_SENT_STATUS_CNF, MSG_SUCCESS, (void**)ppEvent);
+                       }
 
-               unsigned int ret[3] = {0}; //3// reqid, status, object
+                       unsigned int ret[3] = {0}; //3// reqid, status, object
 
-               ret[0] = reqID;
-               ret[1] = msgInfo.networkStatus;
-               ret[2] = prxInfo->handleAddr;
+                       ret[0] = reqID;
+                       ret[1] = msgInfo.networkStatus;
+                       ret[2] = prxInfo->handleAddr;
 
-               // Make Event Data for APP
-               eventsize = MsgMakeEvent(ret, sizeof(ret), MSG_EVENT_PLG_SENT_STATUS_CNF, MSG_SUCCESS, (void**)ppEvent);
+                       // Make Event Data for APP
+                       eventsize = MsgMakeEvent(ret, sizeof(ret), MSG_EVENT_PLG_SENT_STATUS_CNF, MSG_SUCCESS, (void**)ppEvent);
 
-               // Send to listener thread, here
-               MsgTransactionManager::instance()->write(prxInfo->listenerFd, *ppEvent, eventsize);
+                       // Send to listener thread, here
+                       MsgTransactionManager::instance()->write(prxInfo->listenerFd, *ppEvent, eventsize);
 
-               MsgTransactionManager::instance()->delProxyInfo(reqID);
+                       MsgTransactionManager::instance()->delProxyInfo(reqID);
+               }
 
                msgInfo.bTextSms = true;
                MsgTransactionManager::instance()->broadcastStorageChangeCB(MSG_SUCCESS, MSG_STORAGE_CHANGE_UPDATE, &msgIdList);
@@ -570,14 +573,14 @@ int MsgIncomingLBSMsgHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 
 int MsgSyncMLMsgOperationHandler(const MSG_CMD_S *pCmd, char **ppEvent)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        char* encodedData = NULL;
        AutoPtr<char> buf(&encodedData);
 
        int eventSize = 0;
 
-       MSG_MESSAGE_ID_T msgId = 0;
+       msg_message_id_t msgId = 0;
        int extId = 0;
 
        // input check
@@ -585,8 +588,8 @@ int MsgSyncMLMsgOperationHandler(const MSG_CMD_S *pCmd, char **ppEvent)
                THROW(MsgException::INVALID_PARAM, "pCmd or ppEvent is null");
 
        // Get Data
-       memcpy(&msgId, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), sizeof(MSG_MESSAGE_ID_T));
-       memcpy(&extId, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN+sizeof(MSG_MESSAGE_ID_T)), sizeof(int));
+       memcpy(&msgId, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), sizeof(msg_message_id_t));
+       memcpy(&extId, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN+sizeof(msg_message_id_t)), sizeof(int));
 
        err = MsgStoGetSyncMLExtId(msgId, &extId);
 
@@ -615,13 +618,13 @@ int MsgStorageChangeHandler(const MSG_CMD_S *pCmd, char **ppEvent)
        if (!pCmd || !ppEvent)
                THROW(MsgException::INVALID_PARAM, "pCmd or ppEvent is null");
 
-       MSG_STORAGE_CHANGE_TYPE_T storageChangeType;
+       msg_storage_change_type_t storageChangeType;
 
        MSG_MESSAGE_INFO_S msgInfo;
        memset(&msgInfo, 0x00, sizeof(MSG_MESSAGE_INFO_S));
 
        memcpy(&msgInfo, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), sizeof(MSG_MESSAGE_INFO_S));
-       memcpy(&storageChangeType, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN+sizeof(MSG_MESSAGE_INFO_S)), sizeof(MSG_STORAGE_CHANGE_TYPE_T));
+       memcpy(&storageChangeType, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN+sizeof(MSG_MESSAGE_INFO_S)), sizeof(msg_storage_change_type_t));
 
        char* encodedData = NULL;
        AutoPtr<char> buf(&encodedData);
@@ -631,9 +634,9 @@ int MsgStorageChangeHandler(const MSG_CMD_S *pCmd, char **ppEvent)
        MSG_DEBUG("storageChangeType : [%d], msg Id : [%d]", storageChangeType, msgInfo.msgId);
 
        // broadcast to listener threads, here
-       MSG_MSGID_LIST_S msgIdList;
-       MSG_MESSAGE_ID_T msgIds[1];
-       memset(&msgIdList, 0x00, sizeof(MSG_MSGID_LIST_S));
+       msg_id_list_s msgIdList;
+       msg_message_id_t msgIds[1];
+       memset(&msgIdList, 0x00, sizeof(msg_id_list_s));
 
        msgIdList.nCount = 1;
        msgIds[0] = msgInfo.msgId;
index 5c615ec..6e23018 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include <errno.h>
 #include <stdlib.h>
@@ -40,8 +40,8 @@
 ==================================================================================================*/
 void MsgContactChangedCallback()
 {
-       MSG_MSGID_LIST_S msgIdList;
-       memset(&msgIdList, 0x00, sizeof(MSG_MSGID_LIST_S));
+       msg_id_list_s msgIdList;
+       memset(&msgIdList, 0x00, sizeof(msg_id_list_s));
 
        MsgTransactionManager::instance()->broadcastStorageChangeCB(MSG_SUCCESS, MSG_STORAGE_CHANGE_CONTACT, &msgIdList);
 }
@@ -87,8 +87,13 @@ MsgTransactionManager::MsgTransactionManager() : running(false), mx(), cv()
        handlerMap[MSG_CMD_DELETE_FOLDER]               = &MsgDeleteFolderHandler;
        handlerMap[MSG_CMD_GET_FOLDERLIST]              = &MsgGetFolderListHandler;
 
-       handlerMap[MSG_CMD_SET_CONFIG]                  = &MsgSetConfigHandler;
-       handlerMap[MSG_CMD_GET_CONFIG]                  = &MsgGetConfigHandler;
+       handlerMap[MSG_CMD_ADD_FILTER]                  = &MsgAddFilterHandler;
+       handlerMap[MSG_CMD_UPDATE_FILTER]                       = &MsgUpdateFilterHandler;
+       handlerMap[MSG_CMD_DELETE_FILTER]               = &MsgDeleteFilterHandler;
+       handlerMap[MSG_CMD_GET_FILTERLIST]              = &MsgGetFilterListHandler;
+       handlerMap[MSG_CMD_SET_FILTER_OPERATION]        = &MsgSetFilterOperationHandler;
+       handlerMap[MSG_CMD_GET_FILTER_OPERATION]        = &MsgGetFilterOperationHandler;
+
        handlerMap[MSG_CMD_GET_MSG_TYPE]                        = &MsgGetMsgTypeHandler;
 
        handlerMap[MSG_CMD_SUBMIT_REQ]                  = &MsgSubmitReqHandler;
@@ -107,7 +112,7 @@ MsgTransactionManager::MsgTransactionManager() : running(false), mx(), cv()
        handlerMap[MSG_CMD_PLG_INCOMING_MSG_IND]        = &MsgIncomingMsgHandler;
        handlerMap[MSG_CMD_PLG_INCOMING_MMS_CONF]       = &MsgIncomingMMSConfMsgHandler;
 
-        handlerMap[MSG_CMD_PLG_INCOMING_SYNCML_IND] = &MsgIncomingSyncMLMsgHandler;
+       handlerMap[MSG_CMD_PLG_INCOMING_SYNCML_IND] = &MsgIncomingSyncMLMsgHandler;
        handlerMap[MSG_CMD_PLG_INCOMING_LBS_IND] = &MsgIncomingLBSMsgHandler;
        handlerMap[MSG_CMD_PLG_INIT_SIM_BY_SAT] = &MsgInitSimBySatHandler;
 
@@ -121,15 +126,42 @@ MsgTransactionManager::MsgTransactionManager() : running(false), mx(), cv()
        handlerMap[MSG_CMD_RESET_DB]    = &MsgResetDatabaseHandler;
        handlerMap[MSG_CMD_GET_MEMSIZE]         = &MsgGetMemSizeHandler;
 
+       handlerMap[MSG_CMD_BACKUP_MESSAGE]      = &MsgBackupMessageHandler;
+       handlerMap[MSG_CMD_RESTORE_MESSAGE] = &MsgRestoreMessageHandler;
+
        handlerMap[MSG_CMD_UPDATE_THREAD_READ] = &MsgUpdateThreadReadStatusHandler;
 
        handlerMap[MSG_CMD_SYNCML_OPERATION] = &MsgSyncMLMsgOperationHandler;
        handlerMap[MSG_CMD_GET_REPORT_STATUS]                   = &MsgGetReportStatusHandler;
+
+       handlerMap[MSG_CMD_GET_THREAD_ID_BY_ADDRESS] = &MsgGetThreadIdByAddressHandler;
+       handlerMap[MSG_CMD_GET_THREAD_INFO] = &MsgGetThreadInfoHandler;
+
+       handlerMap[MSG_CMD_GET_SMSC_OPT] = &MsgGetConfigHandler;
+       handlerMap[MSG_CMD_GET_CB_OPT] = &MsgGetConfigHandler;
+       handlerMap[MSG_CMD_GET_SMS_SEND_OPT] = &MsgGetConfigHandler;
+       handlerMap[MSG_CMD_GET_MMS_SEND_OPT] = &MsgGetConfigHandler;
+       handlerMap[MSG_CMD_GET_MMS_RECV_OPT] = &MsgGetConfigHandler;
+       handlerMap[MSG_CMD_GET_PUSH_MSG_OPT] = &MsgGetConfigHandler;
+       handlerMap[MSG_CMD_GET_VOICE_MSG_OPT] = &MsgGetConfigHandler;
+       handlerMap[MSG_CMD_GET_GENERAL_MSG_OPT] = &MsgGetConfigHandler;
+       handlerMap[MSG_CMD_GET_MSG_SIZE_OPT] = &MsgGetConfigHandler;
+
+       handlerMap[MSG_CMD_SET_SMSC_OPT] = &MsgSetConfigHandler;
+       handlerMap[MSG_CMD_SET_CB_OPT] = &MsgSetConfigHandler;
+       handlerMap[MSG_CMD_SET_SMS_SEND_OPT] = &MsgSetConfigHandler;
+       handlerMap[MSG_CMD_SET_MMS_SEND_OPT] = &MsgSetConfigHandler;
+       handlerMap[MSG_CMD_SET_MMS_RECV_OPT] = &MsgSetConfigHandler;
+       handlerMap[MSG_CMD_SET_PUSH_MSG_OPT] = &MsgSetConfigHandler;
+       handlerMap[MSG_CMD_SET_VOICE_MSG_OPT] = &MsgSetConfigHandler;
+       handlerMap[MSG_CMD_SET_GENERAL_MSG_OPT] = &MsgSetConfigHandler;
+       handlerMap[MSG_CMD_SET_MSG_SIZE_OPT] = &MsgSetConfigHandler;
 }
 
 
 MsgTransactionManager::~MsgTransactionManager()
 {
+//     pthread_cond_init(&retCV, NULL); // = PTHREAD_COND_INITIALIZER;
 
 }
 
@@ -224,6 +256,7 @@ MSG_PROXY_INFO_S* MsgTransactionManager::getProxyInfo(int reqId)
 
        if (it == sentMsgMap.end())
        {
+               //THROW(MsgException::SENT_STATUS_ERROR, "No submit request for %d", reqId);
                MSG_DEBUG("No sent status cb found (exception: mobile tracker)");
                return NULL;
        }
@@ -452,6 +485,8 @@ bool MsgTransactionManager::checkPrivilege(MSG_CMD_TYPE_T CmdType, const char *p
 
        MSG_DEBUG("cookie size : [%d]", cookieSize);
 
+//     char cookie[MAX_COOKIE_LEN];
+
        // Get GID
        if (CmdType == MSG_CMD_REG_INCOMING_SYNCML_MSG_CB)
        {
@@ -657,7 +692,7 @@ javamms_list& MsgTransactionManager::getJavaMMSList()
 }
 
 
-void MsgTransactionManager::broadcastIncomingMsgCB(const MSG_ERROR_T err, const MSG_MESSAGE_INFO_S *msgInfo)
+void MsgTransactionManager::broadcastIncomingMsgCB(const msg_error_t err, const MSG_MESSAGE_INFO_S *msgInfo)
 {
        MSG_BEGIN();
 
@@ -690,7 +725,7 @@ void MsgTransactionManager::broadcastIncomingMsgCB(const MSG_ERROR_T err, const
 }
 
 
-void MsgTransactionManager::broadcastMMSConfCB(const MSG_ERROR_T err, const MSG_MESSAGE_INFO_S *msgInfo, const MMS_RECV_DATA_S *mmsRecvData)
+void MsgTransactionManager::broadcastMMSConfCB(const msg_error_t err, const MSG_MESSAGE_INFO_S *msgInfo, const MMS_RECV_DATA_S *mmsRecvData)
 {
        MSG_BEGIN();
 
@@ -728,7 +763,7 @@ void MsgTransactionManager::broadcastMMSConfCB(const MSG_ERROR_T err, const MSG_
 }
 
 
-void MsgTransactionManager::broadcastSyncMLMsgCB(const MSG_ERROR_T err, const MSG_SYNCML_MESSAGE_DATA_S *syncMLData)
+void MsgTransactionManager::broadcastSyncMLMsgCB(const msg_error_t err, const MSG_SYNCML_MESSAGE_DATA_S *syncMLData)
 {
        MSG_BEGIN();
 
@@ -749,7 +784,7 @@ void MsgTransactionManager::broadcastSyncMLMsgCB(const MSG_ERROR_T err, const MS
 }
 
 
-void MsgTransactionManager::broadcastLBSMsgCB(const MSG_ERROR_T err, const MSG_LBS_MESSAGE_DATA_S *lbsData)
+void MsgTransactionManager::broadcastLBSMsgCB(const msg_error_t err, const MSG_LBS_MESSAGE_DATA_S *lbsData)
 {
        MSG_BEGIN();
 
@@ -770,7 +805,7 @@ void MsgTransactionManager::broadcastLBSMsgCB(const MSG_ERROR_T err, const MSG_L
 }
 
 
-void MsgTransactionManager::broadcastSyncMLMsgOperationCB(const MSG_ERROR_T err, const int msgId, const int extId)
+void MsgTransactionManager::broadcastSyncMLMsgOperationCB(const msg_error_t err, const int msgId, const int extId)
 {
        MSG_BEGIN();
 
@@ -797,7 +832,7 @@ void MsgTransactionManager::broadcastSyncMLMsgOperationCB(const MSG_ERROR_T err,
 }
 
 
-void MsgTransactionManager::broadcastStorageChangeCB(const MSG_ERROR_T err, const MSG_STORAGE_CHANGE_TYPE_T storageChangeType, const MSG_MSGID_LIST_S *pMsgIdList)
+void MsgTransactionManager::broadcastStorageChangeCB(const msg_error_t err, const msg_storage_change_type_t storageChangeType, const msg_id_list_s *pMsgIdList)
 {
        MSG_BEGIN();
 
index b56839a..4439c7b 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef MSG_CMD_TYPES_H
 #define MSG_CMD_TYPES_H
@@ -51,7 +51,7 @@ typedef struct _MSG_CMD_S
 typedef struct _MSG_EVENT_S
 {
        MSG_EVENT_TYPE_T        eventType;
-       MSG_ERROR_T                     result;
+       msg_error_t                     result;
        char                                    data[2];
 } MSG_EVENT_S;
 
@@ -68,7 +68,6 @@ enum _MSG_CMD_TYPE_E
        MSG_CMD_ADD_MSG,
        MSG_CMD_ADD_SYNCML_MSG,
 
-// 05
        MSG_CMD_UPDATE_MSG,
        MSG_CMD_UPDATE_READ,
        MSG_CMD_UPDATE_PROTECTED,
@@ -82,58 +81,84 @@ enum _MSG_CMD_TYPE_E
        MSG_CMD_GET_MSG,
        MSG_CMD_GET_FOLDERVIEWLIST,
 
-// 15
        MSG_CMD_ADD_FOLDER,
        MSG_CMD_UPDATE_FOLDER,
        MSG_CMD_DELETE_FOLDER,
        MSG_CMD_GET_FOLDERLIST,
-       MSG_CMD_SET_CONFIG,
+       MSG_CMD_ADD_FILTER,
 
 // 20
-       MSG_CMD_GET_CONFIG,
+       MSG_CMD_UPDATE_FILTER,
+       MSG_CMD_DELETE_FILTER,
+       MSG_CMD_GET_FILTERLIST,
+       MSG_CMD_SET_FILTER_OPERATION,
+       MSG_CMD_GET_FILTER_OPERATION,
+
        MSG_CMD_GET_MSG_TYPE,
        MSG_CMD_SUBMIT_REQ,
        MSG_CMD_CANCEL_REQ,
        MSG_CMD_REG_SENT_STATUS_CB,
-
-// 25
        MSG_CMD_REG_STORAGE_CHANGE_CB,
+
+// 30
        MSG_CMD_REG_INCOMING_MSG_CB,
        MSG_CMD_REG_INCOMING_MMS_CONF_MSG_CB,
        MSG_CMD_REG_INCOMING_SYNCML_MSG_CB,
        MSG_CMD_REG_INCOMING_LBS_MSG_CB,
-
-// 30
        MSG_CMD_PLG_SENT_STATUS_CNF,
+
        MSG_CMD_PLG_STORAGE_CHANGE_IND,
        MSG_CMD_PLG_INCOMING_MSG_IND,
        MSG_CMD_PLG_INCOMING_MMS_CONF,
        MSG_CMD_PLG_INCOMING_SYNCML_IND,
-
-// 35
        MSG_CMD_PLG_INCOMING_LBS_IND,
+
+// 40
        MSG_CMD_PLG_INIT_SIM_BY_SAT,
        MSG_CMD_GET_THREADVIEWLIST,
        MSG_CMD_GET_CONVERSATIONVIEWLIST,
        MSG_CMD_DELETE_THREADMESSAGELIST,
-
-// 40
        MSG_CMD_GET_CONTACT_COUNT,
+
        MSG_CMD_GET_QUICKPANEL_DATA,
        MSG_CMD_COUNT_BY_MSGTYPE,
        MSG_CMD_RESET_DB,
        MSG_CMD_GET_MEMSIZE,
-
-// 45
        MSG_CMD_BACKUP_MESSAGE,
+
+// 50
        MSG_CMD_RESTORE_MESSAGE,
        MSG_CMD_UPDATE_THREAD_READ,
        MSG_CMD_REG_SYNCML_MSG_OPERATION_CB,
        MSG_CMD_SYNCML_OPERATION,
-
-// 50
        MSG_CMD_GET_REPORT_STATUS,
 
+       MSG_CMD_GET_THREAD_ID_BY_ADDRESS,
+       MSG_CMD_GET_THREAD_INFO,
+       MSG_CMD_GET_SMSC_OPT,
+       MSG_CMD_GET_CB_OPT,
+       MSG_CMD_GET_SMS_SEND_OPT,
+
+// 60
+       MSG_CMD_GET_MMS_SEND_OPT,
+       MSG_CMD_GET_MMS_RECV_OPT,
+       MSG_CMD_GET_PUSH_MSG_OPT,
+       MSG_CMD_GET_VOICE_MSG_OPT,
+       MSG_CMD_GET_GENERAL_MSG_OPT,
+
+       MSG_CMD_GET_MSG_SIZE_OPT,
+       MSG_CMD_SET_SMSC_OPT,
+       MSG_CMD_SET_CB_OPT,
+       MSG_CMD_SET_SMS_SEND_OPT,
+       MSG_CMD_SET_MMS_SEND_OPT,
+
+// 70
+       MSG_CMD_SET_MMS_RECV_OPT,
+       MSG_CMD_SET_PUSH_MSG_OPT,
+       MSG_CMD_SET_VOICE_MSG_OPT,
+       MSG_CMD_SET_GENERAL_MSG_OPT,
+       MSG_CMD_SET_MSG_SIZE_OPT,
+
 // end of MSG_CMD; new CMD should be defined before MSG_CMD_NUM
        MSG_CMD_NUM
 };
@@ -147,7 +172,6 @@ enum _MSG_EVENT_TYPE_E
        MSG_EVENT_ADD_MSG,
        MSG_EVENT_ADD_SYNCML_MSG,
 
-// 5
        MSG_EVENT_UPDATE_MSG,
        MSG_EVENT_UPDATE_READ,
        MSG_EVENT_UPDATE_PROTECTED,
@@ -161,58 +185,84 @@ enum _MSG_EVENT_TYPE_E
        MSG_EVENT_GET_MSG,
        MSG_EVENT_GET_FOLDERVIEWLIST,
 
-// 15
        MSG_EVENT_ADD_FOLDER,
        MSG_EVENT_UPDATE_FOLDER,
        MSG_EVENT_DELETE_FOLDER,
        MSG_EVENT_GET_FOLDERLIST,
-       MSG_EVENT_SET_CONFIG,
+       MSG_EVENT_ADD_FILTER,
 
 // 20
-       MSG_EVENT_GET_CONFIG,
+       MSG_EVENT_UPDATE_FILTER,
+       MSG_EVENT_DELETE_FILTER,
+       MSG_EVENT_GET_FILTERLIST,
+       MSG_EVENT_SET_FILTER_OPERATION,
+       MSG_EVENT_GET_FILTER_OPERATION,
+
        MSG_EVENT_GET_MSG_TYPE,
        MSG_EVENT_SUBMIT_REQ,
        MSG_EVENT_CANCEL_REQ,
        MSG_EVENT_REG_SENT_STATUS_CB,
-
-// 25
        MSG_EVENT_REG_INCOMING_MSG_CB,
+
+// 30
        MSG_EVENT_REG_INCOMING_MMS_CONF_MSG_CB,
        MSG_EVENT_REG_INCOMING_SYNCML_MSG_CB,
        MSG_EVENT_REG_INCOMING_LBS_MSG_CB,
        MSG_EVENT_REG_STORAGE_CHANGE_CB,
-
-// 30
        MSG_EVENT_PLG_SENT_STATUS_CNF,
+
        MSG_EVENT_PLG_STORAGE_CHANGE_IND,
        MSG_EVENT_PLG_INCOMING_MSG_IND,
        MSG_EVENT_PLG_INCOMING_MMS_CONF,
        MSG_EVENT_PLG_INCOMING_SYNCML_MSG_IND,
-
-// 35
        MSG_EVENT_PLG_INCOMING_LBS_MSG_IND,
+
+// 40
        MSG_EVENT_PLG_INIT_SIM_BY_SAT,
        MSG_EVENT_GET_THREADVIEWLIST,
        MSG_EVENT_GET_CONVERSATIONVIEWLIST,
        MSG_EVENT_DELETE_THREADMESSAGELIST,
-
-// 40
        MSG_EVENT_GET_CONTACT_COUNT,
+
        MSG_EVENT_GET_QUICKPANEL_DATA,
        MSG_EVENT_COUNT_BY_MSGTYPE,
        MSG_EVENT_RESET_DB,
        MSG_EVENT_GET_MEMSIZE,
+       MSG_EVENT_BACKUP_MESSAGE,
 
-// 45
-       MSG_EVENT_BACKUP_MESSAGE, 
-       MSG_EVENT_RESTORE_MESSAGE, 
+// 50
+       MSG_EVENT_RESTORE_MESSAGE,
        MSG_EVENT_UPDATE_THREAD_READ,
        MSG_EVENT_REG_SYNCML_MSG_OPERATION_CB,
        MSG_EVENT_SYNCML_OPERATION,
-
-// 50
        MSG_EVENT_GET_REPORT_STATUS,
 
+       MSG_EVENT_GET_THREAD_ID_BY_ADDRESS,
+       MSG_EVENT_GET_THREAD_INFO,
+       MSG_EVENT_GET_SMSC_OPT,
+       MSG_EVENT_GET_CB_OPT,
+       MSG_EVENT_GET_SMS_SEND_OPT,
+
+// 60
+       MSG_EVENT_GET_MMS_SEND_OPT,
+       MSG_EVENT_GET_MMS_RECV_OPT,
+       MSG_EVENT_GET_PUSH_MSG_OPT,
+       MSG_EVENT_GET_VOICE_MSG_OPT,
+       MSG_EVENT_GET_GENERAL_MSG_OPT,
+
+       MSG_EVENT_GET_MSG_SIZE_OPT,
+       MSG_EVENT_SET_SMSC_OPT,
+       MSG_EVENT_SET_CB_OPT,
+       MSG_EVENT_SET_SMS_SEND_OPT,
+       MSG_EVENT_SET_MMS_SEND_OPT,
+
+// 70
+       MSG_EVENT_SET_MMS_RECV_OPT,
+       MSG_EVENT_SET_PUSH_MSG_OPT,
+       MSG_EVENT_SET_VOICE_MSG_OPT,
+       MSG_EVENT_SET_GENERAL_MSG_OPT,
+       MSG_EVENT_SET_MSG_SIZE_OPT,
+
 // end of MSG_EVENT; new EVENT should be defined before MSG_EVENT_NUM
        MSG_EVENT_NUM
 };
index ec4d34d..04fbd80 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef __MSG_CPP_TYPES_H__
 #define __MSG_CPP_TYPES_H__
diff --git a/include/common/MsgFilterTypes.h b/include/common/MsgFilterTypes.h
new file mode 100755 (executable)
index 0000000..047f0b1
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#ifndef MSG_FILTER_TYPES_H
+#define MSG_FILTER_TYPES_H
+
+/**
+ *     @file           MsgFilterTypes.h
+ *     @brief          Defines filter types of messaging framework
+ *     @version        1.0
+ */
+
+/**
+ *     @section                Introduction
+ *     - Introduction : Overview on Messaging Filter Types
+ *     @section                Program
+ *     - Program : Messaging Filter Types Reference
+ */
+
+/*==================================================================================================
+                                         INCLUDE FILES
+==================================================================================================*/
+
+#include "MsgTypes.h"
+
+/**
+ *     @ingroup                MESSAGING_FRAMEWORK
+ *     @defgroup       MESSAGING_FILTER_TYPES  Messaging Filter Types
+ *     @{
+ */
+
+/*==================================================================================================
+                                         STRUCTURES
+==================================================================================================*/
+
+/**
+ *     @brief  Represents filter informatioin. \n
+ *     It represents the basic filter unit.
+ */
+typedef struct
+{
+       msg_filter_id_t                 filterId;                       /**< Indicates the filter ID. */
+       msg_filter_type_t               filterType;             /**< Indicates the filter type. */
+       char                                            filterValue[MAX_FILTER_VALUE_LEN+1];    /**< The value of a filter. */
+} MSG_FILTER_S;
+
+
+/**
+ *     @}
+ */
+
+#endif // MSG_FILTER_TYPES_H
+
index dc17581..72722bc 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef MSG_INTERNAL_TYPES_H
 #define MSG_INTERNAL_TYPES_H
 ==================================================================================================*/
 #include "MsgMmsTypes.h"
 
+
 /*==================================================================================================
                                     DEFINES
 ==================================================================================================*/
 #define MSG_DATA_ROOT_PATH             "/opt/data/msg-service/"
-#define MSG_DATA_PATH                  MSG_DATA_ROOT_PATH"msgdata/"
+#define MSG_DATA_PATH                          MSG_DATA_ROOT_PATH"msgdata/"
 #define MSG_SMIL_FILE_PATH             MSG_DATA_ROOT_PATH"smildata/"
-#define MSG_IPC_DATA_PATH              MSG_DATA_ROOT_PATH"ipcdata/"
+#define MSG_IPC_DATA_PATH                      MSG_DATA_ROOT_PATH"ipcdata/"
 #define MSG_THUMBNAIL_PATH             MSG_DATA_PATH"thumbnails/"
 #define MAX_FULL_PATH_SIZE             320     // max length for internal file path
 #define VALID_ADDRESS_LEN              8
 #define MAX_THREAD_NAME_LEN    195
 #define MAX_THREAD_DATA_LEN    128
 
-#define SMS_MINIMUM_SPACE              (3 * 1024)
-#define MMS_MINIMUM_SPACE              (600 * 1024)
+#define SMS_MINIMUM_SPACE      (3 * 1024)
+#define MMS_MINIMUM_SPACE      (600 * 1024)
 
 /*vconf keys*/
-#define MSG_SIM_CHANGED                "memory/msg/sim_changed"
+#define MSG_SIM_IMSI                   "memory/private/msg-service/sim_imsi"
+#define MSG_SIM_CHANGED        "memory/private/msg-service/sim_changed"
+
 
-#define DEFAULT_SETTING_PATH                   "db/msg"
+#define DEFAULT_SETTING_PATH                           "db/private/msg-service"
 
 #define DEFAULT_GENERAL_OPT_PATH               DEFAULT_SETTING_PATH"/general"
 #define DEFAULT_SMS_SEND_OPT_PATH      DEFAULT_SETTING_PATH"/sms_send"
-#define DEFAULT_SMSC_INFO_PATH                 DEFAULT_SETTING_PATH"/smsc"
+#define DEFAULT_SMSC_INFO_PATH                 DEFAULT_SETTING_PATH"/smsc"
 #define DEFAULT_MMS_SEND_OPT_PATH      DEFAULT_SETTING_PATH"/mms_send"
 #define DEFAULT_MMS_RECV_OPT_PATH      DEFAULT_SETTING_PATH"/mms_recv"
 #define DEFAULT_MMS_STYLE_OPT_PATH     DEFAULT_SETTING_PATH"/mms_style"
 #define DEFAULT_CB_MSG_OPT_PATH                DEFAULT_SETTING_PATH"/cb_msg"
 #define DEFAULT_VOICE_MAIL_OPT_PATH    DEFAULT_SETTING_PATH"/voice_mail"
 #define DEFAULT_MSGSIZE_OPT_PATH               DEFAULT_SETTING_PATH"/size_opt"
-#define DEFAULT_SIM_COUNT_PATH         DEFAULT_SETTING_PATH"/sim_count"
+#define DEFAULT_SIM_COUNT_PATH                 DEFAULT_SETTING_PATH"/sim_count"
 
-#define MSG_KEEP_COPY                                  DEFAULT_GENERAL_OPT_PATH"/keep_copy"
-#define MSG_ALERT_TONE                                 VCONFKEY_SETAPPL_NOTI_MSG_ALERT_REP_TYPE_INT
-#define MSG_AUTO_ERASE                                 DEFAULT_GENERAL_OPT_PATH"/auto_erase"
-#define MSG_BLOCK_MESSAGE                              DEFAULT_GENERAL_OPT_PATH"/block_msg"
+#define MSG_KEEP_COPY                          DEFAULT_GENERAL_OPT_PATH"/keep_copy"
+#define MSG_ALERT_TONE                         VCONFKEY_SETAPPL_NOTI_MSG_ALERT_REP_TYPE_INT
+#define MSG_AUTO_ERASE                         DEFAULT_GENERAL_OPT_PATH"/auto_erase"
+#define MSG_BLOCK_MESSAGE              DEFAULT_GENERAL_OPT_PATH"/block_msg"
 #define CONTACT_SYNC_TIME              DEFAULT_GENERAL_OPT_PATH"/contact_sync_time"
 
-#define SMS_SEND_DCS                                   DEFAULT_SMS_SEND_OPT_PATH"/dcs"
-#define SMS_SEND_NETWORK_MODE          VCONFKEY_MESSAGE_NETWORK_MODE
+#define SMS_SEND_DCS                                                   DEFAULT_SMS_SEND_OPT_PATH"/dcs"
+#define SMS_SEND_NETWORK_MODE  VCONFKEY_MESSAGE_NETWORK_MODE
 #define SMS_SEND_REPLY_PATH                    DEFAULT_SMS_SEND_OPT_PATH"/reply_path"
-#define SMS_SEND_DELIVERY_REPORT               DEFAULT_SMS_SEND_OPT_PATH"/delivery_report"
-#define SMS_SEND_SAVE_STORAGE                  DEFAULT_SMS_SEND_OPT_PATH"/save_storage"
+#define SMS_SEND_DELIVERY_REPORT       DEFAULT_SMS_SEND_OPT_PATH"/delivery_report"
+#define SMS_SEND_SAVE_STORAGE          DEFAULT_SMS_SEND_OPT_PATH"/save_storage"
 
-#define SMSC_TOTAL_COUNT                               DEFAULT_SMSC_INFO_PATH"/total_count"
-#define SMSC_SELECTED                                  DEFAULT_SMSC_INFO_PATH"/selected"
+#define SMSC_TOTAL_COUNT               DEFAULT_SMSC_INFO_PATH"/total_count"
+#define SMSC_SELECTED                  DEFAULT_SMSC_INFO_PATH"/selected"
 #define SMSC_PID                                               DEFAULT_SMSC_INFO_PATH"/pid"
-#define SMSC_VAL_PERIOD                                DEFAULT_SMSC_INFO_PATH"/val_period"
-#define SMSC_NAME                                              DEFAULT_SMSC_INFO_PATH"/name"
+#define SMSC_VAL_PERIOD                DEFAULT_SMSC_INFO_PATH"/val_period"
+#define SMSC_NAME                                      DEFAULT_SMSC_INFO_PATH"/name"
 #define SMSC_TON                                               DEFAULT_SMSC_INFO_PATH"/ton"
 #define SMSC_NPI                                               DEFAULT_SMSC_INFO_PATH"/npi"
-#define SMSC_ADDRESS                                   DEFAULT_SMSC_INFO_PATH"/address"
+#define SMSC_ADDRESS                           DEFAULT_SMSC_INFO_PATH"/address"
 
-#define MMS_SEND_MSG_CLASS                                     DEFAULT_MMS_SEND_OPT_PATH"/msg_class"
-#define MMS_SEND_PRIORITY                                              DEFAULT_MMS_SEND_OPT_PATH"/priority"
-#define MMS_SEND_EXPIRY_TIME                                   DEFAULT_MMS_SEND_OPT_PATH"/expiry_time"
+#define MMS_SEND_MSG_CLASS                                                     DEFAULT_MMS_SEND_OPT_PATH"/msg_class"
+#define MMS_SEND_PRIORITY                                                              DEFAULT_MMS_SEND_OPT_PATH"/priority"
+#define MMS_SEND_EXPIRY_TIME                                                   DEFAULT_MMS_SEND_OPT_PATH"/expiry_time"
 #define MMS_SEND_CUSTOM_DELIVERY                               DEFAULT_MMS_SEND_OPT_PATH"/custom_delivery"
-#define MMS_SEND_DELIVERY_TIME                         DEFAULT_MMS_SEND_OPT_PATH"/delivery_time"
-#define MMS_SEND_SENDER_VISIBILITY                     DEFAULT_MMS_SEND_OPT_PATH"/sender_visibility"
-#define MMS_SEND_DELIVERY_REPORT                               DEFAULT_MMS_SEND_OPT_PATH"/delivery_report"
-#define MMS_SEND_READ_REPLY                                    DEFAULT_MMS_SEND_OPT_PATH"/read_reply"
-#define MMS_SEND_KEEP_COPY                                     DEFAULT_MMS_SEND_OPT_PATH"/keep_copy"
-#define MMS_SEND_BODY_REPLYING                         DEFAULT_MMS_SEND_OPT_PATH"/body_replying"
-#define MMS_SEND_HIDE_RECIPIENTS                               DEFAULT_MMS_SEND_OPT_PATH"/hide_recipients"
+#define MMS_SEND_DELIVERY_TIME                                         DEFAULT_MMS_SEND_OPT_PATH"/delivery_time"
+#define MMS_SEND_SENDER_VISIBILITY                             DEFAULT_MMS_SEND_OPT_PATH"/sender_visibility"
+#define MMS_SEND_DELIVERY_REPORT                                       DEFAULT_MMS_SEND_OPT_PATH"/delivery_report"
+#define MMS_SEND_READ_REPLY                                                    DEFAULT_MMS_SEND_OPT_PATH"/read_reply"
+#define MMS_SEND_KEEP_COPY                                                     DEFAULT_MMS_SEND_OPT_PATH"/keep_copy"
+#define MMS_SEND_BODY_REPLYING                                         DEFAULT_MMS_SEND_OPT_PATH"/body_replying"
+#define MMS_SEND_HIDE_RECIPIENTS                                       DEFAULT_MMS_SEND_OPT_PATH"/hide_recipients"
 #define MMS_SEND_REPORT_ALLOWED                                DEFAULT_MMS_SEND_OPT_PATH"/report_allowed"
-#define MMS_SEND_REPLY_CHARGING                                DEFAULT_MMS_SEND_OPT_PATH"/reply_charging"
+#define MMS_SEND_REPLY_CHARGING                                        DEFAULT_MMS_SEND_OPT_PATH"/reply_charging"
 #define MMS_SEND_REPLY_CHARGING_DEADLINE       DEFAULT_MMS_SEND_OPT_PATH"/reply_charging_deadline"
 #define MMS_SEND_REPLY_CHARGING_SIZE                   DEFAULT_MMS_SEND_OPT_PATH"/reply_charging_size"
-#define MMS_SEND_CREATION_MODE                         DEFAULT_MMS_SEND_OPT_PATH"/creation_mode"
+#define MMS_SEND_CREATION_MODE                                 DEFAULT_MMS_SEND_OPT_PATH"/creation_mode"
 
 #define MMS_RECV_HOME_NETWORK          DEFAULT_MMS_RECV_OPT_PATH"/home_network"
-#define MMS_RECV_ABROAD_NETWORK                DEFAULT_MMS_RECV_OPT_PATH"/abroad_network"
+#define MMS_RECV_ABROAD_NETWORK        DEFAULT_MMS_RECV_OPT_PATH"/abroad_network"
 #define MMS_RECV_READ_RECEIPT                  DEFAULT_MMS_RECV_OPT_PATH"/read_receipt"
-#define MMS_RECV_DELIVERY_RECEIPT              DEFAULT_MMS_RECV_OPT_PATH"/delivery_receipt"
+#define MMS_RECV_DELIVERY_RECEIPT      DEFAULT_MMS_RECV_OPT_PATH"/delivery_receipt"
 #define MMS_RECV_REJECT_UNKNOWN                DEFAULT_MMS_RECV_OPT_PATH"/reject_unknown"
-#define MMS_RECV_REJECT_ADVERTISE              DEFAULT_MMS_RECV_OPT_PATH"/reject_advertisement"
+#define MMS_RECV_REJECT_ADVERTISE      DEFAULT_MMS_RECV_OPT_PATH"/reject_advertisement"
 
-#define MMS_STYLE_FONT_SIZE                            DEFAULT_MMS_STYLE_OPT_PATH"/font_size"
-#define MMS_STYLE_FONT_STYLE_BOLD              DEFAULT_MMS_STYLE_OPT_PATH"/font_style/bold"
-#define MMS_STYLE_FONT_STYLE_ITALIC            DEFAULT_MMS_STYLE_OPT_PATH"/font_style/italic"
+#define MMS_STYLE_FONT_SIZE                                                    DEFAULT_MMS_STYLE_OPT_PATH"/font_size"
+#define MMS_STYLE_FONT_STYLE_BOLD                      DEFAULT_MMS_STYLE_OPT_PATH"/font_style/bold"
+#define MMS_STYLE_FONT_STYLE_ITALIC                    DEFAULT_MMS_STYLE_OPT_PATH"/font_style/italic"
 #define MMS_STYLE_FONT_STYLE_UNDERLINE DEFAULT_MMS_STYLE_OPT_PATH"/font_style/underline"
 #define MMS_STYLE_FONT_COLOR_RED                       DEFAULT_MMS_STYLE_OPT_PATH"/font_color/red"
 #define MMS_STYLE_FONT_COLOR_GREEN             DEFAULT_MMS_STYLE_OPT_PATH"/font_color/green"
-#define MMS_STYLE_FONT_COLOR_BLUE              DEFAULT_MMS_STYLE_OPT_PATH"/font_color/blue"
+#define MMS_STYLE_FONT_COLOR_BLUE                      DEFAULT_MMS_STYLE_OPT_PATH"/font_color/blue"
 #define MMS_STYLE_FONT_COLOR_HUE                       DEFAULT_MMS_STYLE_OPT_PATH"/font_color/hue"
-#define MMS_STYLE_BG_COLOR_RED                 DEFAULT_MMS_STYLE_OPT_PATH"/bg_color/red"
+#define MMS_STYLE_BG_COLOR_RED                         DEFAULT_MMS_STYLE_OPT_PATH"/bg_color/red"
 #define MMS_STYLE_BG_COLOR_GREEN                       DEFAULT_MMS_STYLE_OPT_PATH"/bg_color/green"
-#define MMS_STYLE_BG_COLOR_BLUE                        DEFAULT_MMS_STYLE_OPT_PATH"/bg_color/blue"
-#define MMS_STYLE_BG_COLOR_HUE                 DEFAULT_MMS_STYLE_OPT_PATH"/bg_color/hue"
-#define MMS_STYLE_PAGE_DUR                             DEFAULT_MMS_STYLE_OPT_PATH"/page_dur"
-#define MMS_STYLE_PAGE_CUSTOM_DUR              DEFAULT_MMS_STYLE_OPT_PATH"/page_custom_dur"
-#define MMS_STYLE_PAGE_DUR_MANUAL              DEFAULT_MMS_STYLE_OPT_PATH"/page_dur_manual"
+#define MMS_STYLE_BG_COLOR_BLUE                                DEFAULT_MMS_STYLE_OPT_PATH"/bg_color/blue"
+#define MMS_STYLE_BG_COLOR_HUE                         DEFAULT_MMS_STYLE_OPT_PATH"/bg_color/hue"
+#define MMS_STYLE_PAGE_DUR                                                     DEFAULT_MMS_STYLE_OPT_PATH"/page_dur"
+#define MMS_STYLE_PAGE_CUSTOM_DUR                      DEFAULT_MMS_STYLE_OPT_PATH"/page_custom_dur"
+#define MMS_STYLE_PAGE_DUR_MANUAL                      DEFAULT_MMS_STYLE_OPT_PATH"/page_dur_manual"
 
 #define PUSH_RECV_OPTION                               DEFAULT_PUSH_MSG_OPT_PATH"/recv_option"
 #define PUSH_SERVICE_TYPE                              DEFAULT_PUSH_MSG_OPT_PATH"/service_load"
 
 #define CB_RECEIVE                                             DEFAULT_CB_MSG_OPT_PATH"/receive"
-#define CB_ALL_CHANNEL                                 DEFAULT_CB_MSG_OPT_PATH"/all_channel"
-#define CB_MAX_SIM_COUNT                               DEFAULT_CB_MSG_OPT_PATH"/max_sim_count"
-#define CB_CHANNEL_COUNT                               DEFAULT_CB_MSG_OPT_PATH"/channel_count"
-#define CB_CHANNEL_ACTIVATE                    DEFAULT_CB_MSG_OPT_PATH"/channel_activate"
+#define CB_ALL_CHANNEL                         DEFAULT_CB_MSG_OPT_PATH"/all_channel"
+#define CB_MAX_SIM_COUNT                       DEFAULT_CB_MSG_OPT_PATH"/max_sim_count"
+#define CB_CHANNEL_COUNT                       DEFAULT_CB_MSG_OPT_PATH"/channel_count"
+#define CB_CHANNEL_ACTIVATE            DEFAULT_CB_MSG_OPT_PATH"/channel_activate"
 #define CB_CHANNEL_ID                                  DEFAULT_CB_MSG_OPT_PATH"/channel_id"
-#define CB_CHANNEL_NAME                                DEFAULT_CB_MSG_OPT_PATH"/channel_name"
+#define CB_CHANNEL_NAME                        DEFAULT_CB_MSG_OPT_PATH"/channel_name"
 #define CB_LANGUAGE                                    DEFAULT_CB_MSG_OPT_PATH"/language"
 
 #define VOICEMAIL_NUMBER                               DEFAULT_VOICE_MAIL_OPT_PATH"/voice_mail_number"
@@ -198,109 +201,80 @@ typedef struct
  */
 typedef struct
 {
-       MSG_MESSAGE_ID_T                msgId;                  /**< Indicates the message ID of this message. */
-       MSG_FOLDER_ID_T                 folderId;                       /**< Indicates the folder ID. */
-       MSG_REFERENCE_ID_T              referenceId;            /**< Indicates group message of messages that is sent together. */
-       MSG_MESSAGE_TYPE_S              msgType;                /**< Indicates the message type such as SMS and MMS */
-       MSG_STORAGE_ID_T                storageId;              /**< Indicates where the message is saved. */
-       int                                             nAddressCnt;    /**< Indicates the count of addresses. */
-       MSG_ADDRESS_INFO_S              addressList[MAX_TO_ADDRESS_CNT];        /**< Indicates the address information list. */
-       char                                            replyAddress[MAX_PHONE_NUMBER_LEN+1];           /**< Indicates the reply address. */
-       char                                            subject[MAX_SUBJECT_LEN+1];                     /**< Indicates the message subject. */
-       time_t                                  displayTime;            /**< Indicates the display time related to the specific operation. */
-       MSG_NETWORK_STATUS_T    networkStatus;  /**< Indicates the network status of the message. */
-       MSG_ENCODE_TYPE_T               encodeType;             /**< Indicates the string encoding type. */
-       bool                                            bRead;                  /**< Indicates whether the message is read or not. */
-       bool                                            bProtected;             /**< Indicates whether the message is protected or not. */
-       bool                                            bBackup;                /**< Indicates whether the message was restored from PC. */
-       MSG_PRIORITY_TYPE_T             priority;                       /**< Indicates the priority of the message. */
-       MSG_DIRECTION_TYPE_T            direction;              /**< Indicates whether the message is MO or MT (affecting address). */
-       MSG_PORT_INFO_S                 msgPort;                /**< Indicates the port number information. */
-       bool                                            bTextSms;               /**< Indicates whether the message is just a text message or not. */
-       size_t                                  dataSize;               /**< Indicates the data size. The unit is byte. */
-       char                                            msgData[MAX_MSG_DATA_LEN+1];            /**< Indicates the message payload information as a body. */
-       char                                            msgText[MAX_MSG_TEXT_LEN+1];
-       char                                            thumbPath[MSG_FILEPATH_LEN_MAX];
-       time_t                                  scheduledTime;  /**< Indicates the time to send scheduled message. */
+       msg_message_id_t                        msgId;                                                                                                                          /**< Indicates the message ID of this message. */
+       msg_thread_id_t                         threadId;                                                                                                                       /**< Indicates the thread ID. */
+       msg_folder_id_t                         folderId;                                                                                                                       /**< Indicates the folder ID. */
+       MSG_MESSAGE_TYPE_S              msgType;                                                                                                                        /**< Indicates the message type such as SMS and MMS */
+       msg_storage_id_t                        storageId;                                                                                                                      /**< Indicates where the message is saved. */
+       int                                                                             nAddressCnt;                                                                                                    /**< Indicates the count of addresses. */
+       MSG_ADDRESS_INFO_S              addressList[MAX_TO_ADDRESS_CNT];                                /**< Indicates the address information list. */
+       char                                                                            replyAddress[MAX_PHONE_NUMBER_LEN+1];   /**< Indicates the reply address. */
+       char                                                                            subject[MAX_SUBJECT_LEN+1];                                             /**< Indicates the message subject. */
+       time_t                                                                  displayTime;                                                                                                    /**< Indicates the display time related to the specific operation. */
+       msg_network_status_t    networkStatus;                                                                                                  /**< Indicates the network status of the message. */
+       msg_encode_type_t               encodeType;                                                                                                     /**< Indicates the string encoding type. */
+       bool                                                                            bRead;                                                                                                                          /**< Indicates whether the message is read or not. */
+       bool                                                                            bProtected;                                                                                                             /**< Indicates whether the message is protected or not. */
+       bool                                                                            bBackup;                                                                                                                        /**< Indicates whether the message was restored from PC. */
+       msg_priority_type_t             priority;                                                                                                                       /**< Indicates the priority of the message. */
+       msg_direction_type_t    direction;                                                                                                                      /**< Indicates whether the message is MO or MT (affecting address). */
+       MSG_PORT_INFO_S                         msgPort;                                                                                                                        /**< Indicates the port number information. */
+       bool                                                                            bTextSms;                                                                                                               /**< Indicates whether the message is just a text message or not. */
+       size_t                                                                  dataSize;                                                                                                                       /**< Indicates the data size. The unit is byte. */
+       char                                                                            msgData[MAX_MSG_DATA_LEN+1];                                    /**< Indicates the message payload information as a body. */
+       char                                                                            msgText[MAX_MSG_TEXT_LEN+1];
+       char                                                                            thumbPath[MSG_FILEPATH_LEN_MAX];
 } MSG_MESSAGE_INFO_S;
 
-
 typedef struct
 {
-       MSG_MESSAGE_ID_T                msgId;                  /**< Indicates the message ID of this message. */
-       MSG_FOLDER_ID_T                 folderId;               /**< Indicates the folder ID. see enum _MSG_FOLDER_TYPE_E */
-       MSG_REFERENCE_ID_T              referenceId;            /**< Indicates group message of messages that is sent together. */
-       MSG_MESSAGE_TYPE_S              msgType;                /**< Indicates the message type either of SMS or MMS */
-       MSG_STORAGE_ID_T                storageId;              /**< Indicates where the message is saved. see enum _MSG_FOLDER_TYPE_E*/
-       int                                             nAddressCnt;    /**< Indicates the count of addresses. */
-       MSG_ADDRESS_INFO_S              addressList[MAX_TO_ADDRESS_CNT];                /**< Indicates the address information list. */
-       char                                            replyAddress[MAX_PHONE_NUMBER_LEN+1];           /**< Indicates the reply address. */
-       char                                            subject[MAX_SUBJECT_LEN+1];                     /**< Indicates the message subject. */
-       time_t                                  displayTime;    /**< Indicates the display time related to the specific operation. */
-       time_t                                  scheduledTime;  /**< Indicates the time to send scheduled message. */
-       MSG_NETWORK_STATUS_T    networkStatus;  /**< Indicates the network status of the message. */
-       MSG_ENCODE_TYPE_T               encodeType;             /**< Indicates the string encoding type. */
-       bool                                            bRead;                  /**< Indicates whether the message is read or not. */
-       bool                                            bProtected;     /**< Indicates whether the message is protected or not. */
-       bool                                            bBackup;                /**< Indicates whether the message was restored from PC. */
-       MSG_PRIORITY_TYPE_T             priority;               /**< Indicates the priority of the message. */
-       MSG_DIRECTION_TYPE_T            direction;              /**< Indicates whether the message is MO or MT, affecting address. */
-       MSG_PORT_INFO_S                 msgPort;                /**< Indicates the port number information. */
-       int                                             attachCount;            /**< Indicates the count of attached files in mms. */
-       char                                            thumbPath[MSG_FILEPATH_LEN_MAX];
-       size_t                                  dataSize;               /**< Indicates the data size. The unit is byte. */
-       void                                            *pData;                 /**< Indicates the message payload information as a body. default character encoding is UTF-8*/
-       void                                            *pMmsData;                      /**< Indicates the message payload information as a body. default character encoding is UTF-8*/
-} MSG_MESSAGE_S;
-
+       msg_message_id_t                msgId;                                                                  /**< Indicates the message ID of this message. */
+       msg_thread_id_t                 threadId;                                                               /**< Indicates the thread ID. */
+       msg_folder_id_t                 folderId;                                                               /**< Indicates the folder ID. see enum _MSG_FOLDER_TYPE_E */
+       MSG_MAIN_TYPE_T                 mainType;                                                               /**< Message main type. See enum _MSG_MAIN_TYPE_E */
+       MSG_SUB_TYPE_T                  subType;                                                                /**< Message sub type. See enum _MSG_SUB_TYPE_E */
+       MSG_CLASS_TYPE_T                classType;                                                              /**< Message class type. See enum _MSG_CLASS_TYPE_E */
+       msg_storage_id_t                storageId;                                                              /**< Indicates where the message is saved. see enum _MSG_FOLDER_TYPE_E*/
+       msg_struct_list_s               *addr_list;
+       char                                    replyAddress[MAX_PHONE_NUMBER_LEN+1];   /**< Indicates the reply address. */
+       char                                    subject[MAX_SUBJECT_LEN+1];                             /**< Indicates the message subject. */
+       time_t                                  displayTime;                                                    /**< Indicates the display time related to the specific operation. */
+       msg_network_status_t    networkStatus;                                                  /**< Indicates the network status of the message. */
+       msg_encode_type_t               encodeType;                                                             /**< Indicates the string encoding type. */
+       bool                                    bRead;                                                                  /**< Indicates whether the message is read or not. */
+       bool                                    bProtected;                                                             /**< Indicates whether the message is protected or not. */
+       bool                                    bBackup;                                                                /**< Indicates whether the message was restored from PC. */
+       msg_priority_type_t             priority;                                                               /**< Indicates the priority of the message. */
+       msg_direction_type_t    direction;                                                              /**< Indicates whether the message is MO or MT, affecting address. */
+       bool                                    bPortValid;                                                                     /**< Indicates whether port information is used or not. */
+       unsigned short                  dstPort;                                                                /**< Recipient port number, not greater than 16 bit */
+       unsigned short                  srcPort;                                                                /**< Sender port number, not greater than 16 bit */
+       int                                             attachCount;                                                    /**< Indicates the count of attached files in mms. */
+       char                                    thumbPath[MSG_FILEPATH_LEN_MAX];
+       size_t                                  dataSize;                                                               /**< Indicates the data size. The unit is byte. */
+       void                                    *pData;                                                                 /**< Indicates the message payload information as a body. default character encoding is UTF-8*/
+       void                                    *pMmsData;                                                              /**< Indicates the message payload information as a body. default character encoding is UTF-8*/
+} MSG_MESSAGE_HIDDEN_S;
 
 /**
  *     @brief  Represents message information for thread view.
  */
 typedef struct
 {
-       MSG_THREAD_ID_T                 threadId;                                                       /**< Indicates the thread ID of this peer. */
-       char                                            threadAddr[MAX_THREAD_ADDR_LEN+1];      /**< Indicates the address of this peer. > */
-       char                                            threadName[MAX_THREAD_NAME_LEN+1];      /**< Indicates the name of this peer. > */
-       char                                            threadImagePath[MAX_IMAGE_PATH_LEN+1];  /**< Indicates the image path of this peer */
-       MSG_MESSAGE_TYPE_S              threadType;                                                     /**< Indicates the latest msg type. */
-       char                                            threadData[MAX_THREAD_DATA_LEN+1];      /**< Indicates the latest msg data. */
-       time_t                                  threadTime;                                                     /**< Indicates the latest msg time. */
-       MSG_DIRECTION_TYPE_T            direction;                                                              /**< Indicates whether the message is MO or MT (affecting address). */
-
-       MSG_CONTACT_ID_T                contactId;                                                      /**< Indicates the unique contact ID. */
-
-       int                                             unreadCnt;      /**< Indicates the unread messages from the Peer. */
-       int                                             smsCnt;         /**< Indicates the SMS messages from the Peer. */
-       int                                             mmsCnt;         /**< Indicates the MMS messages from the Peer. */
+       msg_thread_id_t                 threadId;                                                                                                                       /**< Indicates the thread ID of this peer. */
+       char                                    threadName[MAX_THREAD_NAME_LEN+1];              /**< Indicates the name of this peer. > */
+       MSG_MAIN_TYPE_T                 mainType;                                                               /**< Indicates the latest msg main type. */
+       MSG_SUB_TYPE_T                  subType;                                                                /**< Indicates the latest msg sub type. */
+       char                                    threadData[MAX_THREAD_DATA_LEN+1];              /**< Indicates the latest msg data. */
+       time_t                                  threadTime;                                                                                                             /**< Indicates the latest msg time. */
+       msg_direction_type_t    direction;                                                                                                                      /**< Indicates whether the message is MO or MT (affecting address). */
+       int                                             unreadCnt;                                                                                                              /**< Indicates the unread messages from the Peer. */
+       int                                             smsCnt;                                                                                                                 /**< Indicates the SMS messages from the Peer. */
+       int                                             mmsCnt;                                                                                                                 /**< Indicates the MMS messages from the Peer. */
 } MSG_THREAD_VIEW_S;
 
 
 /**
- *     @brief  Represents message information for conversation view.
- */
-typedef struct
-{
-       MSG_MESSAGE_ID_T                                msgId;                                                                  /**< Indicates the message ID of this message. */
-       MSG_MESSAGE_TYPE_S                              msgType;                                                                /**< Indicates the message type such as SMS, MMS, and Email. */
-       MSG_STORAGE_ID_T                                storageId;                                                              /**< Indicates where the message is saved. */
-       time_t                                                  displayTime;                                                            /**< Indicates the display time related to the specific operation. */   //MAX_DISPLAY_TIME_LEN
-       char                                                            subject[MAX_SUBJECT_LEN+1];                             /**< Indicates the message subject. */
-       MSG_NETWORK_STATUS_T                    networkStatus;                                                  /**< Indicates the network status of the message. */
-       bool                                                            bRead;                                                                  /**< Indicates whether the message is read or not. */
-       bool                                                            bProtected;                                                             /**< Indicates whether the message is protected or not. */
-       MSG_DIRECTION_TYPE_T                    direction;                                                              /**< Indicates whether the message is MO or MT, affecting address. */
-       char                                                            thumbNailPath[MSG_FILEPATH_LEN_MAX];    /**< Indicates the MMS media thumbnail path.*/
-       char                                                            msgText[MAX_MSG_TEXT_LEN+1];                    /**< Indicates the message payload information as a body. */
-       MSG_DELIVERY_REPORT_STATUS_T    deliveryStatus;                                                 /**< Indicates the message ID of this message. */
-       time_t                                                  deliveryStatusTime;                                             /**< Indicates the display time related to the specific operation. */   //MAX_DISPLAY_TIME_LEN
-       MSG_READ_REPORT_STATUS_T                readStatus;                                                             /**< Indicates the message ID of this message. */
-       time_t                                                  readStatusTime;                                                 /**< Indicates the display time related to the specific operation. */   //MAX_DISPLAY_TIME_LEN
-       int                                                             attachCount;                                                    /**< Indicates the count of attached files in mms. */
-} MSG_CONV_VIEW_S;
-
-
-/**
  *     @brief  Represents sim message informatioin list.
  */
 typedef struct
@@ -318,7 +292,7 @@ typedef struct
  */
 typedef struct
 {
-       MSG_REQUEST_ID_T                reqId;          /**< Indicates the request ID, which is unique.
+       msg_request_id_t                reqId;          /**< Indicates the request ID, which is unique.
                                                                                When applications submit a request to the framework, this value will be set by the framework. */
        MSG_MESSAGE_INFO_S              msgInfo;        /**< Indicates the message structure to be sent by applications. */
        MSG_SENDINGOPT_INFO_S   sendOptInfo;
@@ -333,7 +307,7 @@ typedef struct
 {
        int                                             listenerFd;             /**< Rx fd for status cnf */
        unsigned int                    handleAddr;             /**< Handle address for status cnf */
-       MSG_MESSAGE_ID_T                sentMsgId;              /**< The ID of a sent message for updating message status */
+       msg_message_id_t                sentMsgId;              /**< The ID of a sent message for updating message status */
 } MSG_PROXY_INFO_S;
 
 
@@ -482,21 +456,6 @@ enum _MSG_SUB_TYPE_E
        MSG_SENDREQ_JAVA_MMS,                   /**< MMS Send Request message for JAVA MMS */
 };
 
-
-/**
- *     @brief  Represents the values of a message class type. \n
- *     This enum is used as the value of MSG_CLASS_TYPE_T.
- */
-enum _MSG_CLASS_TYPE_E
-{
-       MSG_CLASS_0 = 0,                /**< Immediately presented on the recipient device display */
-       MSG_CLASS_1,                    /**< Stored in the mobile equipment or SIM (depending on memory availability) */
-       MSG_CLASS_2,                    /**< Stored in SIM */
-       MSG_CLASS_3,                    /**< Transferred to the terminal equipment (such as PDA or PC) which is connected to the mobile equipment */
-       MSG_CLASS_NONE,
-};
-
-
 /**
  *     @brief  Represents the values of a message transaction type. \n
  *     This enum is used as the value of MSG_MMS_TRANSACTION_TYPE_T.
index 2f61f47..df41c2d 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef MSG_MMS_TYPES_H
 #define MSG_MMS_TYPES_H
  *     @{
  */
 
-/*==================================================================================================
-                                                                       DEFINES
-==================================================================================================*/
-
-/**
- *     @brief  Defines the enabled MMS version
- */
-#define        MMS_V1_2                                                                // MMS Version : MMS_V1_0 / MMS_V1_1 / MMS_V1_2
-
-/**
- *     @brief  Defines the enabled DRM support
- */
-#define        __SUPPORT_DRM__
-
-/**
- *     @brief  Defines the enabled JAVA MMS Application Id
- */
-#define FEATURE_JAVA_MMS
-
-/**
- *     @brief  Defines the maximum file name length
- */
-#define        MSG_FILENAME_LEN_MAX            255
-
-/**
- *     @brief  Defines the maximum message id length
- */
-#define        MSG_MSG_ID_LEN                  100
-
-/**
- *     @brief  Defines the maximum in transition id length
- */
-#define MAX_SMIL_TRANSIN_ID            100
-
-/**
- *     @brief  Defines the maximum out transition id length
- */
-#define MAX_SMIL_TRANSOUT_ID   100
-
-/**
- *     @brief  Defines the maximum region id length
- */
-#define        MAX_SMIL_REGION_ID              151
-
-/**
- *     @brief  Defines the maximum transition id length
- */
-#define MAX_SMIL_TRANSITION_ID         151
-
-/**
- *     @brief  Defines the maximum meta id length
- */
-#define MAX_SMIL_META_ID               151
-
-/**
- *     @brief  Defines the maximum meta name length
- */
-#define MAX_SMIL_META_NAME             100
-
-/**
- *     @brief  Defines the maximum meta content length
- */
-#define MAX_SMIL_META_CONTENT          255
-
-/**
- *     @brief  Defines the maximum fit size
- */
-#define        MAX_SMIL_FIT_SIZE               31
-
-/**
- *     @brief  Defines the maximum pages in a MMS
- */
-#define        MMS_PAGE_MAX                    20
-
-/**
- *     @brief  Defines the maximum media in a MMS
- */
-#define        MMS_MEDIA_MAX                   60
-
-/**
- *     @brief  Defines the maximum alternate text length
- */
-#define        MAX_SMIL_ALT_LEN                255
-
-
-//font size
-/**
- *     @brief  Defines the small font size
- */
-#define        MMS_SMIL_FONT_SIZE_SMALL                24
-
-/**
- *     @brief  Defines the normal font size
- */
-#define        MMS_SMIL_FONT_SIZE_NORMAL               30
-
-/**
- *     @brief  Defines the large font size
- */
-#define        MMS_SMIL_FONT_SIZE_LARGE                36
-
-//#ifdef MMS_SMIL_ANIMATE
-#define MAX_SMIL_ANIMATE_ATTRIBUTE_NAME 100
-#define MAX_SMIL_ANIMATE_ATTRIBUTE_TYPE 100
-#define MAX_SMIL_ANIMATE_TARGET_ELEMENT 100
-#define MAX_SMIL_ANIMATE_CALC_MODE 100
-//#endif
-
-//#ifdef FEATURE_JAVA_MMS
-#define MAX_MMS_JAVA_APPID_LEN 32
-//#endif
-
-#define CONV_THUMB_WIDTH       250
-#define CONV_THUMB_HEIGHT 170
-
-#define MMS_TR_ID_LEN          40
-#define MMS_MSG_ID_LEN         40
-#define MMS_LOCATION_LEN       100
 
 /*==================================================================================================
-                                         ENUMS
+                                         STRUCTURES
 ==================================================================================================*/
 
 /**
- *     @brief  Represents the values of a mime type.
- */
-typedef enum   _MimeType
-{
-       // 0
-       MIME_ASTERISK                                                                                   = 0x0000, /**< Indicates the valid default mime type  */
-
-       // 1
-       MIME_APPLICATION_XML                                                                    = 0x1000, /**< Indicates the application xml type */
-       MIME_APPLICATION_WML_XML                                                        = 0x1001,       /**< Indicates the application wml xml type  */
-       MIME_APPLICATION_XHTML_XML                                                      = 0x1002,       /**< Indicates the application xhtml xml type  */
-       MIME_APPLICATION_JAVA_VM                                                                = 0x1003, /**< Indicates the application java vm type */
-       MIME_APPLICATION_SMIL                                                           = 0x1004, /**< Indicates the application smil  type */
-       MIME_APPLICATION_JAVA_ARCHIVE                                           = 0x1005, /**< Indicates the application java archive type */
-       MIME_APPLICATION_JAVA                                                           = 0x1006, /**< Indicates the application java  type */
-       MIME_APPLICATION_OCTET_STREAM                                           = 0x1007, /**< Indicates the application octect stream type */
-       MIME_APPLICATION_STUDIOM                                                        = 0x1008, /**< Indicates the application studiom type */
-       MIME_APPLICATION_FUNMEDIA                                                       = 0x1009, /**< Indicates the application fun media type */
-       MIME_APPLICATION_MSWORD                                                         = 0x100a,       /**< Indicates the application ms word type */
-       MIME_APPLICATION_PDF                                                                    = 0x100b, /**< Indicates the application pdf type */
-       MIME_APPLICATION_SDP                                                                    = 0x100c,  /**< Indicates the application sdp type */
-       MIME_APPLICATION_RAM                                                                    = 0x100d, /**< Indicates the application ram type */
-       MIME_APPLICATION_ASTERIC                                                                = 0x100e, /**< Indicates the application as main type and generic sub type */
-
-       // 16
-       MIME_APPLICATION_VND_WAP_XHTMLXML                                       = 0x1100, /**< Indicates the application wap xhtml xml type */
-       MIME_APPLICATION_VND_WAP_WMLC                                           = 0x1101,  /**< Indicates the application wap wmlc type */
-       MIME_APPLICATION_VND_WAP_WMLSCRIPTC                             = 0x1102,  /**< Indicates the application wap wmlscrpitc type */
-       MIME_APPLICATION_VND_WAP_WTA_EVENTC                             = 0x1103, /**< Indicates the application wap  wta event type */
-       MIME_APPLICATION_VND_WAP_UAPROF                                 = 0x1104, /**< Indicates the application wap uaprof type */
-       MIME_APPLICATION_VND_WAP_SIC                                            = 0x1105,  /**< Indicates the application wap sic type */
-       MIME_APPLICATION_VND_WAP_SLC                                            = 0x1106, /**< Indicates the application wap slc type */
-       MIME_APPLICATION_VND_WAP_COC                                            = 0x1107, /**< Indicates the application wap coc type */
-       MIME_APPLICATION_VND_WAP_SIA                                            = 0x1108, /**< Indicates the application wap sia type */
-       MIME_APPLICATION_VND_WAP_CONNECTIVITY_WBXML             = 0x1109,  /**< Indicates the application wap connectivity wbxml type */
-       MIME_APPLICATION_VND_WAP_MULTIPART_FORM_DATA    = 0x110a, /**< Indicates the application wap multipart data type */
-       MIME_APPLICATION_VND_WAP_MULTIPART_BYTERANGES   = 0x110b, /**< Indicates the application wap multipart byte type */
-       MIME_APPLICATION_VND_WAP_MULTIPART_MIXED                        = 0x110c,  /**< Indicates the application wap multipart mixed type */
-       MIME_APPLICATION_VND_WAP_MULTIPART_RELATED              = 0x110d,  /**< Indicates the application wap multipart related type */
-       MIME_APPLICATION_VND_WAP_MULTIPART_ALTERNATIVE  = 0x110e,  /**< Indicates the application wap  multipart alternative type */
-       MIME_APPLICATION_VND_WAP_MULTIPART_ASTERIC              = 0x110f, /**< Indicates the application wap mulitpart as main type and generic sub type */
-       MIME_APPLICATION_VND_WAP_WBXML                                  = 0x1110, /**< Indicates the application wap wbxml type */
-       MIME_APPLICATION_VND_OMA_DD_XML                                 = 0x1111, /**< Indicates the application oma dd xml type */
-       MIME_APPLICATION_VND_OMA_DRM_MESSAGE                            = 0x1112,  /**< Indicates the application oma drm message type */
-       MIME_APPLICATION_VND_OMA_DRM_CONTENT                            = 0x1113, /**< Indicates the application oma drm content type */
-       MIME_APPLICATION_VND_OMA_DRM_RIGHTS_XML                 = 0x1114, /**< Indicates the application oma drm rights xml type */
-       MIME_APPLICATION_VND_OMA_DRM_RIGHTS_WBXML               = 0x1115,  /**< Indicates the application oma drm rights wbxml type */
-       MIME_APPLICATION_VND_OMA_DRM_RO_XML                             = 0x1116, /**< Indicates the application oma drm ro xml type */
-       MIME_APPLICATION_VND_OMA_DRM_DCF                                        = 0x1117, /**< Indicates the application oma drm dcf type */
-       MIME_APPLICATION_VND_OMA_ROAPPDU_XML                            = 0x1118,  /**< Indicates the application oma roap pdu xml type */
-       MIME_APPLICATION_VND_OMA_ROAPTRIGGER_XML                        = 0x1119,       /**< Indicates the application oma roap trigger xml  type */
-       MIME_APPLICATION_VND_SMAF                                                       = 0x111a,  /**< Indicates the application smaf type */
-       MIME_APPLICATION_VND_RN_REALMEDIA                                       = 0x111b,  /**< Indicates the application rn real media type */
-       MIME_APPLICATION_VND_SUN_J2ME_JAVA_ARCHIVE              = 0x111c,  /**< Indicates the application j2me java archive type */
-       MIME_APPLICATION_VND_EXCEL                                                      = 0x111e,  /**< Indicates the application excel type */
-       MIME_APPLICATION_VND_POWERPOINT                                 = 0x111f,  /**< Indicates the application power point type */
-       MIME_APPLICATION_VND_MSWORD                                             = 0x1120,        /**< Indicates the application ms word type */
-
-       // 49
-       MIME_APPLICATION_X_HDMLC                                                        = 0x1200, /**< Indicates the application x hdmlc type */
-       MIME_APPLICATION_X_X968_USERCERT                                        = 0x1201, /**< Indicates the application x x968 user certified type */
-       MIME_APPLICATION_X_WWW_FORM_URLENCODED                  = 0x1202, /**< Indicates the application x www form url encoded type */
-       MIME_APPLICATION_X_SMAF                                                         = 0x1203, /**< Indicates the application x smaf type */
-       MIME_APPLICATION_X_FLASH                                                                = 0x1204, /**< Indicates the application x flash type */
-       MIME_APPLICATION_X_EXCEL                                                                = 0x1205, /**< Indicates the application x excel type */
-       MIME_APPLICATION_X_POWERPOINT                                           = 0x1206, /**< Indicates the application x power point type */
-
-       // 56
-       MIME_AUDIO_BASIC                                                                                = 0x2000, /**< Indicates the audio basic type  */
-       MIME_AUDIO_MPEG                                                                         = 0x2001, /**< Indicates the audio mpeg type  */
-       MIME_AUDIO_MP3                                                                          = 0x2002, /**< Indicates the audio mp3 type  */
-       MIME_AUDIO_MPG3                                                                         = 0x2003,  /**< Indicates the audio mpg3 type  */
-       MIME_AUDIO_MPEG3                                                                                = 0x2004, /**< Indicates the audio mpeg3 type  */
-       MIME_AUDIO_MPG                                                                          = 0x2005, /**< Indicates the audio mpg type  */
-       MIME_AUDIO_AAC                                                                          = 0x2006, /**< Indicates the audio aac type  */
-       MIME_AUDIO_G72                                                                          = 0x2007, /**< Indicates the audio g72 type  */
-       MIME_AUDIO_AMR                                                                          = 0x2008, /**< Indicates the audio amr type  */
-       MIME_AUDIO_AMR_WB                                                                       = 0x2009, /**< Indicates the audio amr wb type  */
-       MIME_AUDIO_MMF                                                                          = 0x200a, /**< Indicates the audio mmf type  */
-       MIME_AUDIO_SMAF                                                                         = 0x200b, /**< Indicates the audio smaf type  */
-       MIME_AUDIO_IMELODY                                                                      = 0x200c, /**< Indicates the audio imelody type  */
-       MIME_AUDIO_IMELODY2                                                                     = 0x200d, /**< Indicates the audio imelody2 type  */
-       MIME_AUDIO_MELODY                                                                       = 0x200e, /**< Indicates the audio melody type  */
-       MIME_AUDIO_MID                                                                          = 0x200f, /**< Indicates the audio mid type  */
-       MIME_AUDIO_MIDI                                                                         = 0x2010, /**< Indicates the audio midi type  */
-       MIME_AUDIO_SP_MIDI                                                                      = 0x2011, /**< Indicates the audio sp midi type  */
-       MIME_AUDIO_WAVE                                                                         = 0x2012, /**< Indicates the audio wave type  */
-       MIME_AUDIO_WAV                                                                          = 0x2013, /**< Indicates the audio wav type  */
-       MIME_AUDIO_3GPP                                                                         = 0x2014, /**< Indicates the audio 3gpp type  */
-       MIME_AUDIO_MP4                                                                          = 0x2015, /**< Indicates the audio mp4 type  */
-       MIME_AUDIO_MP4A_LATM                                                            = 0x2016, /**< Indicates the audio mp4 latm type  */
-       MIME_AUDIO_M4A                                                                          = 0x2017, /**< Indicates the audio m4a type  */
-       MIME_AUDIO_MPEG4                                                                                = 0x2018, /**< Indicates the audio mpeg4 type  */
-       MIME_AUDIO_WMA                                                                          = 0x2019, /**< Indicates the audio wma type  */
-       MIME_AUDIO_XMF                                                                          = 0x201a, /**< Indicates the audio xmf type  */
-       MIME_AUDIO_IMY                                                                          = 0x201b, /**< Indicates the audio imy type  */
-       MIME_AUDIO_MOBILE_XMF                                                           = 0x201c, /**< Indicates the audio mobile xmf type  */
-
-       //85
-       MIME_AUDIO_VND_RN_REALAUDIO                                             = 0x2100, /**< Indicates the audio rn real audio type  */
-
-       // 86
-       MIME_AUDIO_X_MPEG                                                                       = 0x2200, /**< Indicates the audio x mpeg type  */
-       MIME_AUDIO_X_MP3                                                                                = 0x2201, /**< Indicates the audio x mp3 type  */
-       MIME_AUDIO_X_MPEG3                                                                      = 0x2202,    /**< Indicates the audio x mpeg3 type  */
-       MIME_AUDIO_X_MPG                                                                                = 0x2203, /**< Indicates the audio x mpg type  */
-       MIME_AUDIO_X_AMR                                                                                = 0x2204, /**< Indicates the audio x amr type  */
-       MIME_AUDIO_X_MMF                                                                                = 0x2205, /**< Indicates the audio x mmf type  */
-       MIME_AUDIO_X_SMAF                                                                       = 0x2206, /**< Indicates the audio x smaf type  */
-       MIME_AUDIO_X_IMELODY                                                                    = 0x2207, /**< Indicates the audio x imelody type  */
-       MIME_AUDIO_X_MIDI                                                                               = 0x2208, /**< Indicates the audio x midi type  */
-       MIME_AUDIO_X_MPEGAUDIO                                                          = 0x2209, /**< Indicates the audio x mpeg  type  */
-       MIME_AUDIO_X_PN_REALAUDIO                                                       = 0x220a, /**< Indicates the audio x pn real audio type  */
-       MIME_AUDIO_X_PN_MULTIRATE_REALAUDIO                             = 0x220b, /**< Indicates the audio x pn multirate real audio  type  */
-       MIME_AUDIO_X_PN_MULTIRATE_REALAUDIO_LIVE                        = 0x220c, /**< Indicates the audio x pn multirate real audio live type  */
-       MIME_AUDIO_X_WAVE                                                                       = 0x220d, /**< Indicates the audio x wave  type  */
-       MIME_AUDIO_X_WAV                                                                                = 0x220e, /**< Indicates the audio x wav  type  */
-       MIME_AUDIO_X_MS_WMA                                                                     = 0x220f, /**< Indicates the audio ms wma type  */
-       MIME_AUDIO_X_MID                                                                                = 0x2210, /**< Indicates the audio mid type  */
-       MIME_AUDIO_X_MS_ASF                                                                     = 0x2211, /**< Indicates the audio ms asf  type  */
-       MIME_AUDIO_X_XMF                                                                                = 0x2212, /**< Indicates the audio x xmf  type  */
-
-       // 105
-       MIME_IMAGE_GIF                                                                          = 0x3000, /**< Indicates the image gif type  */
-       MIME_IMAGE_JPEG                                                                         = 0x3001, /**< Indicates the image jpeg type  */
-       MIME_IMAGE_JPG                                                                          = 0x3002, /**< Indicates the image jpg type  */
-       MIME_IMAGE_TIFF                                                                         = 0x3003, /**< Indicates the image tiff type  */
-       MIME_IMAGE_TIF                                                                          = 0x3004, /**< Indicates the image tif type  */
-       MIME_IMAGE_PNG                                                                          = 0x3005, /**< Indicates the image png type  */
-       MIME_IMAGE_WBMP                                                                         = 0x3006, /**< Indicates the image wbmp type  */
-       MIME_IMAGE_PJPEG                                                                                = 0x3007, /**< Indicates the image pjpeg type  */
-       MIME_IMAGE_BMP                                                                          = 0x3008, /**< Indicates the image bmp type  */
-       MIME_IMAGE_SVG                                                                          = 0x3009, /**< Indicates the image svg type  */
-       MIME_IMAGE_SVG1                                                                         = 0x300a, /**< Indicates the image svg1 type  */
-
-       // 116
-       MIME_IMAGE_VND_WAP_WBMP                                                 = 0x3100,  /**< Indicates the image vnd wap wbmp type  */
-
-       // 119
-       MIME_IMAGE_X_BMP                                                                                = 0x3200, /**< Indicates the image x bmp type  */
-
-       // 120
-       MIME_MESSAGE_RFC822                                                                     = 0x4000,  /**< Indicates the message rfc822 type  */
-
-       // 121
-       MIME_MULTIPART_MIXED                                                                    = 0x5000,  /**< Indicates the multipart mixed type  */
-       MIME_MULTIPART_RELATED                                                          = 0x5001, /**< Indicates the multipart related type  */
-       MIME_MULTIPART_ALTERNATIVE                                                      = 0x5002, /**< Indicates the multipart alternative type  */
-       MIME_MULTIPART_FORM_DATA                                                        = 0x5003, /**< Indicates the multipart form data type  */
-       MIME_MULTIPART_BYTERANGE                                                        = 0x5004, /**< Indicates the multipart byte range type  */
-       MIME_MULTIPART_REPORT                                                           = 0x5005, /**< Indicates the multipart report type  */
-       MIME_MULTIPART_VOICE_MESSAGE                                            = 0x5006, /**< Indicates the multipart voice message type  */
-
-       // 128
-       MIME_TEXT_TXT                                                                                   = 0x6000, /**< Indicates the text txt type  */
-       MIME_TEXT_HTML                                                                          = 0x6001, /**< Indicates the text html type  */
-       MIME_TEXT_PLAIN                                                                         = 0x6002,  /**< Indicates the text plain type  */
-       MIME_TEXT_CSS                                                                                   = 0x6003,  /**< Indicates the text css type  */
-       MIME_TEXT_XML                                                                                   = 0x6004,  /**< Indicates the text xml type  */
-       MIME_TEXT_IMELODY                                                                               = 0x6005,  /**< Indicates the text imelody type  */
-
-       // 134
-       MIME_TEXT_VND_WAP_WMLSCRIPT                                             = 0x6100, /**< Indicates the text wap wmlscript  type  */
-       MIME_TEXT_VND_WAP_WML                                                           = 0x6101, /**< Indicates the text wap wml  type  */
-       MIME_TEXT_VND_WAP_WTA_EVENT                                             = 0x6102, /**< Indicates the text wap wta event  type  */
-       MIME_TEXT_VND_WAP_CONNECTIVITY_XML                              = 0x6103, /**< Indicates the text wap connectivity xml  type  */
-       MIME_TEXT_VND_WAP_SI                                                                    = 0x6104,  /**< Indicates the text wap si  type  */
-       MIME_TEXT_VND_WAP_SL                                                            = 0x6105, /**< Indicates the text wap sl  type  */
-       MIME_TEXT_VND_WAP_CO                                                            = 0x6106, /**< Indicates the text wap co  type  */
-       MIME_TEXT_VND_SUN_J2ME_APP_DESCRIPTOR                           = 0x6107, /**< Indicates the text sun j2me type  */
-
-       // 142
-       MIME_TEXT_X_HDML                                                                                = 0x6200, /**< Indicates the x html  type  */
-       MIME_TEXT_X_VCALENDAR                                                           = 0x6201,  /**< Indicates the x calendar  type  */
-       MIME_TEXT_X_VCARD                                                                       = 0x6202, /**< Indicates the x vcard  type  */
-       MIME_TEXT_X_IMELODY                                                                     = 0x6203, /**< Indicates the x imelody  type  */
-       MIME_TEXT_X_IMELODY2                                                                    = 0x6204, /**< Indicates the x imelody2  type  */
-       MIME_TEXT_X_VNOTE                                                                       = 0x6205,  /**< Indicates the x vnote  type  */
-
-       // 148
-       MIME_VIDEO_MPEG4                                                                                = 0x7000, /**< Indicates the mpeg4  type  */
-       MIME_VIDEO_MP4                                                                          = 0x7001, /**< Indicates the mp4  type  */
-       MIME_VIDEO_H263                                                                         = 0x7002, /**< Indicates the h263  type  */
-       MIME_VIDEO_3GPP                                                                         = 0x7003, /**< Indicates the 3gpp  type  */
-       MIME_VIDEO_3GP                                                                          = 0x7004, /**< Indicates the 3gp  type  */
-       MIME_VIDEO_AVI                                                                          = 0x7005, /**< Indicates the avi  type  */
-       MIME_VIDEO_SDP                                                                          = 0x7006, /**< Indicates the sdp  type  */
-       MIME_VIDEO_MP4_ES                                                                       = 0x7007, /**< Indicates the mp4 es  type  */
-       MIME_VIDEO_MPEG                                                                         = 0x7008, /**< Indicates the mpeg  type  */
-
-       // 157
-       MIME_VIDEO_VND_RN_REALVIDEO                                                     = 0x7100, /**< Indicates the pn real video type  */
-       MIME_VIDEO_VND_RN_REALMEDIA                                                     = 0x7101, /**< Indicates the pn multi rate real media type  */
-
-       // 159
-       MIME_VIDEO_X_MP4                                                                                = 0x7200, /**< Indicates the video x mp4 type  */
-       MIME_VIDEO_X_PV_MP4                                                                     = 0x7201, /**< Indicates the video x pv mp4 type  */
-       MIME_VIDEO_X_PN_REALVIDEO                                                       = 0x7202, /**< Indicates the x pn real video type  */
-       MIME_VIDEO_X_PN_MULTIRATE_REALVIDEO                             = 0x7203, /**< Indicates the x pn multi rate real video type  */
-       MIME_VIDEO_X_MS_WMV                                                                     = 0x7204, /**< Indicates the x ms wmv type  */
-       MIME_VIDEO_X_MS_ASF                                                                     = 0x7205, /**< Indicates the x ms asf type  */
-       MIME_VIDEO_X_PV_PVX                                                                     = 0x7206, /**< Indicates the x pv pvx type  */
-
-       MIME_TYPE_VALUE_MAX                                                                     = 0x7207,               /**< Indicates the maximum mime type  */
-       MIME_UNKNOWN                                                                                    = 0xffff        /**< Indicates the unknown mime type  */
-
-} MimeType;
-
-/**
- *     @brief  Represents the values of a DRM type.
- */
-//#ifdef __SUPPORT_DRM__
-typedef enum
-{
-       MSG_DRM_TYPE_NONE       = 0, /**< Indicates the drm type none */
-       MSG_DRM_TYPE_FL         = 1, /**< Indicates the forward lock */         /* 2004-07-09: forwardLock type */
-       MSG_DRM_TYPE_CD         = 2, /**< Indicates the combined delivery */    /* 2004-07-09: combined delivery type */
-       MSG_DRM_TYPE_SD         = 3, /**< Indicates the separate delivery */    /* 2004-07-09: seperate delivery type */
-       MSG_DRM_TYPE_SSD        = 4     /**< Indicates the special separate delivery */ // 2005-02-28: add Special Sperate Delivery
-}MsgDrmType;
-//#endif
-
-/**
- *     @brief  Represents the values of a SMIL region type.
- */
-typedef enum _REGION_FIT_TYPE_T
-{
-       MMSUI_IMAGE_REGION_FIT_HIDDEN,   /**< Indicates the hidden fit type */
-       MMSUI_IMAGE_REGION_FIT_MEET,     /**< Indicates the meet fit type */
-}REGION_FIT_TYPE_T;
-
-
-/**
- *     @brief  Represents the values of a SMIL media type.
- */
-typedef enum
-{
-       MMS_SMIL_MEDIA_INVALID = 0, /**< Indicates the invalid media type */
-       MMS_SMIL_MEDIA_IMG,                     /**< Indicates the image media */
-       MMS_SMIL_MEDIA_AUDIO,           /**< Indicates the audio media */
-       MMS_SMIL_MEDIA_VIDEO,           /**< Indicates the video media */
-       MMS_SMIL_MEDIA_TEXT,            /**< Indicates the text media */
-       MMS_SMIL_MEDIA_ANIMATE,         /**< Indicates the animation media */
-       MMS_SMIL_MEDIA_IMG_OR_VIDEO     , /**< Indicates the image or video media */
-       MMS_SMIL_MEDIA_MAX = 0xffffffff,        /**< Indicates the maximum media type */
-}MmsSmilMediaType;
-
-/**
- *     @brief  Represents the values of a SMIL transition type.
- */
-typedef enum
-{
-       MMS_SMIL_TRANS_NONE = 0,                /**< Indicates the transition type none */                      /* default */
-       MMS_SMIL_TRANS_SLIDEWIPE = 1,   /**< Indicates the slide wipe transition */
-       MMS_SMIL_TRANS_BARWIPE = 2,             /**< Indicates the bar wipe transition */
-       MMS_SMIL_TRANS_BARNDOORWIPE = 3, /**< Indicates the bar and door wipe transition */
-       MMS_SMIL_TRANS_FADE = 4,                /**< Indicates the fade transition */
-       MMS_SMIL_TRANS_RANDOMBLOCK = 5, /**< Indicates the random block transition */
-       MMS_SMIL_TRANS_ZOOMIN = 6,              /**< Indicates the zoom in transition */
-       MMS_SMIL_TRANS_IRISWIPE = 7,    /**< Indicates the iris wipe transition */
-       MMS_SMIL_TRANS_BOXWIPE = 8,             /**< Indicates the box wipe transition */
-       MMS_SMIL_TRANS_FOURBOXWIPE = 9, /**< Indicates the four box wipe transition */
-       MMS_SMIL_TRANS_PUSHWIPE  =10,   /**< Indicates the push wipe transition */
-       MMS_SMIL_TRANS_ELLIPSEWIPE  = 11 /**< Indicates the ellipse wipe transition */
-}MmsSmilTransType;
-
-/**
- *     @brief  Represents the values of a SMIL transition sub type.
- */
-typedef enum
-{
-       MMS_SMIL_TRANS_SUB_NONE = 0,    /**< Indicates the transition sub type none */
-       MMS_SMIL_TRANS_SUB_FROM_LEFT = 1,       /**< Indicates the from left transition */      /* slideWipe's default */
-       MMS_SMIL_TRANS_SUB_FROM_TOP = 2,        /**< Indicates the from top transition */
-       MMS_SMIL_TRANS_SUB_FROM_BOTTOM = 3,     /**< Indicates the from bottom transition */
-       MMS_SMIL_TRANS_SUB_TOP_TO_BOTTOM = 4, /**< Indicates the from top to bottom transition */                       /* barWipe's default */
-       MMS_SMIL_TRANS_SUB_BOTTOM_TO_TOP = 5, /**< Indicates the from bottom to top transition */
-       MMS_SMIL_TRANS_SUB_HORIZONTAL = 6,      /**< Indicates the horizontal transition */             /* barDoorWipe's default */
-    MMS_SMIL_TRANS_SUB_FROM_RIGHT = 7, /**< Indicates the from right transition */
-    MMS_SMIL_TRANS_SUB_VERTICAL = 8 /**< Indicates the vertical transition */
-}MmsSmilTransSubType;
-
-/**
- *     @brief  Represents the values of a text font type.
- */
-typedef enum
-{
-       MMS_SMIL_FONT_TYPE_NONE = 0, /**< Indicates the font type none */
-       MMS_SMIL_FONT_TYPE_NORMAL = 1, /**< Indicates the font type normal */
-       MMS_SMIL_FONT_TYPE_ITALIC = 2, /**< Indicates the font type italic */
-       MMS_SMIL_FONT_TYPE_BOLD = 3, /**< Indicates the font type bold */
-       MMS_SMIL_FONT_TYPE_UNDERLINE = 4 /**< Indicates the font type underline */
-}MmsSmilFontType;
-
-/**
- *     @brief  Represents the values of a MMS text direction.
- */
-typedef enum   _MmsTextDir{
-       MMS_TEXT_DIRECTION_INVALID = -1, /**< Indicates the invalid direction */
-       MMS_TEXT_DIRECTION_RIGHT = 0,   /**< Indicates the right direction */
-       MMS_TEXT_DIRECTION_DOWN,                /**< Indicates the down direction */            // supported to GC
-} MmsTextDirection;
-
-/**
- *     @brief  Represents the values of MMS Read Report Sent Status.
- */
-typedef enum
-{
-       MMS_RECEIVE_READ_REPORT_NO_SEND,        // didn't send yet
-       MMS_RECEIVE_READ_REPORT_MUST_SEND,      // didn't send yet but will send
-       MMS_RECEIVE_READ_REPORT_SENT,           // sent
-       MMS_RECEIVE_READ_REPORT_NO_SENT,        // required but, didn't send by user's choice
-} MmsRecvReadReportSendStatus ;
-
-/**
  *     @brief  Represents text information.
  */
 typedef struct  {
@@ -499,7 +66,6 @@ typedef struct  {
        bool                    bItalic;                /**< Indicates whether the text is Italic */
        bool                    bReverse;       /**< Indicates whether the text is reversed */
        MmsTextDirection        nDirection; /**< Indicates the text direction type. see enum MmsTextDirection */
-       //MmsSmilFontType       nFont;  /**< Indicates the text font type. see enum MmsSmilFontType */
        int                             nSize;  /**< Indicates the font size */
        int                             nColor; /**< Indicates the font color */
 }MmsSmilText;
@@ -607,10 +173,10 @@ typedef struct
  */
 typedef struct
 {
-       char                                    szID[MAX_SMIL_TRANSITION_ID];   /**< Indicates the ID of transition information */
-       MmsSmilTransType                nType;                                  /**< Indicates the transition type. see enum MmsSmilTransType */
+       char                    szID[MAX_SMIL_TRANSITION_ID];   /**< Indicates the ID of transition information */
+       MmsSmilTransType        nType;                                  /**< Indicates the transition type. see enum MmsSmilTransType */
        MmsSmilTransSubType     nSubType;                               /**< Indicates the transition sub type. see enum MmsSmilTransSubType */
-       int                                     nDur;                                   /**< Indicates the transition duration */
+       int                     nDur;                                   /**< Indicates the transition duration */
 }MMS_SMIL_TRANSITION;
 
 
index 8f33e89..efdf960 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
  /**
  *     @file           MsgPluginInterface.h
@@ -86,7 +86,7 @@ typedef struct _MSG_PLUGIN_LISTENER_S MSG_PLUGIN_LISTENER_S;
  *
  * \param input - handle is Message handle.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS                                       Success in operation.
  * - MSG_ERR_NULL_POINTER              Plug-in handle is invalid.
  *
@@ -101,7 +101,7 @@ typedef struct _MSG_PLUGIN_LISTENER_S MSG_PLUGIN_LISTENER_S;
  *
  */
 /*================================================================================================*/
-MSG_ERROR_T MsgPlgCreateHandle(MSG_PLUGIN_HANDLER_S *pPluginHandle);
+msg_error_t MsgPlgCreateHandle(MSG_PLUGIN_HANDLER_S *pPluginHandle);
 
 
  /**
@@ -127,7 +127,7 @@ MSG_ERROR_T MsgPlgCreateHandle(MSG_PLUGIN_HANDLER_S *pPluginHandle);
  *
  * \param input - handle is Message handle.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS                                       Success in operation.
  * - MSG_ERR_NULL_POINTER              Plug-in handle is invalid.
  *
@@ -142,7 +142,7 @@ MSG_ERROR_T MsgPlgCreateHandle(MSG_PLUGIN_HANDLER_S *pPluginHandle);
  *
  */
 /*================================================================================================*/
-MSG_ERROR_T MsgPlgDestroyHandle(MSG_PLUGIN_HANDLER_S *pPluginHandle);
+msg_error_t MsgPlgDestroyHandle(MSG_PLUGIN_HANDLER_S *pPluginHandle);
 
 
 
@@ -170,7 +170,7 @@ MSG_ERROR_T MsgPlgDestroyHandle(MSG_PLUGIN_HANDLER_S *pPluginHandle);
  * \par Important notes:
  *     This function MUST be implement by plug-ins..
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS                                       Success in operation.
  * - MSG_ERR_PLUGIN_REGEVENT   Plug-in's error during operations.
  *
@@ -185,7 +185,7 @@ MSG_ERROR_T MsgPlgDestroyHandle(MSG_PLUGIN_HANDLER_S *pPluginHandle);
  *
  */
 /*================================================================================================*/
-typedef MSG_ERROR_T (*MsgPlgInitialize)();
+typedef msg_error_t (*MsgPlgInitialize)();
 
 
  /**
@@ -212,7 +212,7 @@ typedef MSG_ERROR_T (*MsgPlgInitialize)();
  *
  * \param input - handle is Message handle.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS                                       Success in operation.
  * - MSG_ERR_NULL_POINTER              Plug-in handle is invalid.
  *
@@ -227,7 +227,7 @@ typedef MSG_ERROR_T (*MsgPlgInitialize)();
  *
  */
 /*================================================================================================*/
-typedef MSG_ERROR_T (*MsgPlgFinalize)();
+typedef msg_error_t (*MsgPlgFinalize)();
 
 
  /**
@@ -254,7 +254,7 @@ typedef MSG_ERROR_T (*MsgPlgFinalize)();
  *
  * \param input - listener is callback listeners.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS                                       Success in operation.
  *
  * \par Prospective clients:
@@ -268,7 +268,7 @@ typedef MSG_ERROR_T (*MsgPlgFinalize)();
  *
  */
 /*================================================================================================*/
-typedef MSG_ERROR_T (*MsgPlgRegisterListener)(MSG_PLUGIN_LISTENER_S *pListener);
+typedef msg_error_t (*MsgPlgRegisterListener)(MSG_PLUGIN_LISTENER_S *pListener);
 
 
  /**
@@ -294,7 +294,7 @@ typedef MSG_ERROR_T (*MsgPlgRegisterListener)(MSG_PLUGIN_LISTENER_S *pListener);
  *
  * \param output - bChanged is a boolean type value which shows sim card status.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS                                       Success in operation.
  *
  * \par Prospective clients:
@@ -308,7 +308,7 @@ typedef MSG_ERROR_T (*MsgPlgRegisterListener)(MSG_PLUGIN_LISTENER_S *pListener);
  *
  */
 /*================================================================================================*/
-typedef MSG_ERROR_T (*MsgPlgCheckSimStatus)(MSG_SIM_STATUS_T *pStatus);
+typedef msg_error_t (*MsgPlgCheckSimStatus)(MSG_SIM_STATUS_T *pStatus);
 
 
  /**
@@ -335,7 +335,7 @@ typedef MSG_ERROR_T (*MsgPlgCheckSimStatus)(MSG_SIM_STATUS_T *pStatus);
  *
  * \param input - handle is Message handle.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS                                       Success in operation.
  * - MSG_ERR_NULL_POINTER              Plug-in handle is invalid.
  *
@@ -350,7 +350,7 @@ typedef MSG_ERROR_T (*MsgPlgCheckSimStatus)(MSG_SIM_STATUS_T *pStatus);
  *
  */
 /*================================================================================================*/
-typedef MSG_ERROR_T (*MsgPlgCheckDeviceStatus)();
+typedef msg_error_t (*MsgPlgCheckDeviceStatus)();
 
 
 // Transport API
@@ -377,9 +377,8 @@ typedef MSG_ERROR_T (*MsgPlgCheckDeviceStatus)();
  *     This function MUST be implement by plug-ins.
  *
  * \param input - pReqInfo is message data to send.
- * \param input - bReqCb shows callback is required.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS                                       Success in operation.
  * - MSG_ERR_PLUGIN_TRANSPORT  Exception is occured in plug-in.
  *
@@ -394,7 +393,7 @@ typedef MSG_ERROR_T (*MsgPlgCheckDeviceStatus)();
  *
  */
 /*================================================================================================*/
-typedef MSG_ERROR_T (*MsgPlgSubmitRequest)(MSG_REQUEST_INFO_S *pReqInfo, bool bReqCb);
+typedef msg_error_t (*MsgPlgSubmitRequest)(MSG_REQUEST_INFO_S *pReqInfo);
 
 
 // Storage API
@@ -423,7 +422,7 @@ typedef MSG_ERROR_T (*MsgPlgSubmitRequest)(MSG_REQUEST_INFO_S *pReqInfo, bool bR
  * \param input - pMsgInfo is the information of message.
  * \param output - pSimIdList is the list of messages saved in SIM card.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS                                               Success in operation.
  * - MSG_ERR_PLUGIN_SIM_MSG_FULL       SIM card's capacity for SMS message is full.
  * - MSG_ERR_PLUGIN_STORAGE            Exception is occured in plug-in.
@@ -439,7 +438,7 @@ typedef MSG_ERROR_T (*MsgPlgSubmitRequest)(MSG_REQUEST_INFO_S *pReqInfo, bool bR
  *
  */
 /*================================================================================================*/
-typedef MSG_ERROR_T (*MsgPlgInitSimMessage)();
+typedef msg_error_t (*MsgPlgInitSimMessage)();
 
 
 // Storage API
@@ -468,7 +467,7 @@ typedef MSG_ERROR_T (*MsgPlgInitSimMessage)();
  * \param input - pMsgInfo is the information of message.
  * \param output - pSimIdList is the list of messages saved in SIM card.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS                                               Success in operation.
  * - MSG_ERR_PLUGIN_SIM_MSG_FULL       SIM card's capacity for SMS message is full.
  * - MSG_ERR_PLUGIN_STORAGE            Exception is occured in plug-in.
@@ -484,7 +483,7 @@ typedef MSG_ERROR_T (*MsgPlgInitSimMessage)();
  *
  */
 /*================================================================================================*/
-typedef MSG_ERROR_T (*MsgPlgSaveSimMessage)(const MSG_MESSAGE_INFO_S *pMsgInfo, SMS_SIM_ID_LIST_S *pSimIdList);
+typedef msg_error_t (*MsgPlgSaveSimMessage)(const MSG_MESSAGE_INFO_S *pMsgInfo, SMS_SIM_ID_LIST_S *pSimIdList);
 
 
  /**
@@ -510,7 +509,7 @@ typedef MSG_ERROR_T (*MsgPlgSaveSimMessage)(const MSG_MESSAGE_INFO_S *pMsgInfo,
  *
  * \param input - SimMsgId is the index of the message to delete.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS                                               Success in operation.
  * - MSG_ERR_PLUGIN_STORAGE            Exception is occured in plug-in.
  *
@@ -525,7 +524,7 @@ typedef MSG_ERROR_T (*MsgPlgSaveSimMessage)(const MSG_MESSAGE_INFO_S *pMsgInfo,
  *
  */
 /*================================================================================================*/
-typedef MSG_ERROR_T (*MsgPlgDeleteSimMessage)(MSG_SIM_ID_T SimMsgId);
+typedef msg_error_t (*MsgPlgDeleteSimMessage)(msg_sim_id_t SimMsgId);
 
 
  /**
@@ -551,7 +550,7 @@ typedef MSG_ERROR_T (*MsgPlgDeleteSimMessage)(MSG_SIM_ID_T SimMsgId);
  *
  * \param input - SimMsgId is the index of the message to set read status.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS                                               Success in operation.
  * - MSG_ERR_PLUGIN_STORAGE            Exception is occured in plug-in.
  *
@@ -566,7 +565,7 @@ typedef MSG_ERROR_T (*MsgPlgDeleteSimMessage)(MSG_SIM_ID_T SimMsgId);
  *
  */
 /*================================================================================================*/
-typedef MSG_ERROR_T (*MsgPlgSetReadStatus)(MSG_SIM_ID_T SimMsgId);
+typedef msg_error_t (*MsgPlgSetReadStatus)(msg_sim_id_t SimMsgId);
 
 
  /**
@@ -592,7 +591,7 @@ typedef MSG_ERROR_T (*MsgPlgSetReadStatus)(MSG_SIM_ID_T SimMsgId);
  *
  * \param input - SimMsgId is the index of the message to set read status.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS                                               Success in operation.
  * - MSG_ERR_PLUGIN_STORAGE            Exception is occured in plug-in.
  *
@@ -607,7 +606,7 @@ typedef MSG_ERROR_T (*MsgPlgSetReadStatus)(MSG_SIM_ID_T SimMsgId);
  *
  */
 /*================================================================================================*/
-typedef MSG_ERROR_T (*MsgPlgSetMemoryStatus)(MSG_ERROR_T Error);
+typedef msg_error_t (*MsgPlgSetMemoryStatus)(msg_error_t Error);
 
 
 // Setting API
@@ -635,7 +634,7 @@ typedef MSG_ERROR_T (*MsgPlgSetMemoryStatus)(MSG_ERROR_T Error);
  *
  * \param input - pSetting is information of configuration.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS                                       Success in operation.
  * - MSG_ERR_PLUGIN_SETTING            Exception is occured in plug-in.
  *
@@ -650,7 +649,7 @@ typedef MSG_ERROR_T (*MsgPlgSetMemoryStatus)(MSG_ERROR_T Error);
  *
  */
 /*================================================================================================*/
-typedef MSG_ERROR_T (*MsgPlgInitConfigData)(MSG_SIM_STATUS_T SimStatus);
+typedef msg_error_t (*MsgPlgInitConfigData)(MSG_SIM_STATUS_T SimStatus);
 
 
 // Setting API
@@ -678,7 +677,7 @@ typedef MSG_ERROR_T (*MsgPlgInitConfigData)(MSG_SIM_STATUS_T SimStatus);
  *
  * \param input - pSetting is information of configuration.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS                                       Success in operation.
  * - MSG_ERR_PLUGIN_SETTING            Exception is occured in plug-in.
  *
@@ -693,7 +692,7 @@ typedef MSG_ERROR_T (*MsgPlgInitConfigData)(MSG_SIM_STATUS_T SimStatus);
  *
  */
 /*================================================================================================*/
-typedef MSG_ERROR_T (*MsgPlgSetConfigData)(const MSG_SETTING_S *pSetting);
+typedef msg_error_t (*MsgPlgSetConfigData)(const MSG_SETTING_S *pSetting);
 
 
  /**
@@ -720,7 +719,7 @@ typedef MSG_ERROR_T (*MsgPlgSetConfigData)(const MSG_SETTING_S *pSetting);
  *
  * \param input - pSetting is information of configuration.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS                                       Success in operation.
  * - MSG_ERR_PLUGIN_SETTING            Exception is occured in plug-in.
  *
@@ -735,7 +734,7 @@ typedef MSG_ERROR_T (*MsgPlgSetConfigData)(const MSG_SETTING_S *pSetting);
  *
  */
 /*================================================================================================*/
-typedef MSG_ERROR_T (*MsgPlgGetConfigData)(MSG_SETTING_S *pSetting);
+typedef msg_error_t (*MsgPlgGetConfigData)(MSG_SETTING_S *pSetting);
 
 // MMS API
 /**
@@ -764,7 +763,7 @@ typedef MSG_ERROR_T (*MsgPlgGetConfigData)(MSG_SETTING_S *pSetting);
 * \param input - pSendOptInfo is information of sending option.
 * \param output - pFileData is the file path of saved MMS message.
 *
-* \return Return Type (int(MSG_ERROR_T)) \n
+* \return Return Type (int(msg_error_t)) \n
 * - MSG_SUCCESS                                          Success in operation.
 * - MSG_ERR_PLUGIN_TRANSPORT   Exception is occured in plug-in.
 *
@@ -779,7 +778,7 @@ typedef MSG_ERROR_T (*MsgPlgGetConfigData)(MSG_SETTING_S *pSetting);
 *
 */
 /*================================================================================================*/
-typedef MSG_ERROR_T (*MsgPlgAddMessage)(MSG_MESSAGE_INFO_S *pMsgInfo,  MSG_SENDINGOPT_INFO_S* pSendOptInfo, char* pFileData);
+typedef msg_error_t (*MsgPlgAddMessage)(MSG_MESSAGE_INFO_S *pMsgInfo,  MSG_SENDINGOPT_INFO_S* pSendOptInfo, char* pFileData);
 
 
 /**
@@ -807,7 +806,7 @@ typedef MSG_ERROR_T (*MsgPlgAddMessage)(MSG_MESSAGE_INFO_S *pMsgInfo,  MSG_SENDI
 * \param input - pRequest is information of request options.
 * \param output - bRejects shows the reject status.
 *
-* \return Return Type (int(MSG_ERROR_T)) \n
+* \return Return Type (int(msg_error_t)) \n
 * - MSG_SUCCESS                                          Success in operation.
 * - MSG_ERR_PLUGIN_TRANSPORT   Exception is occured in plug-in.
 *
@@ -822,7 +821,7 @@ typedef MSG_ERROR_T (*MsgPlgAddMessage)(MSG_MESSAGE_INFO_S *pMsgInfo,  MSG_SENDI
 *
 */
 /*================================================================================================*/
-typedef MSG_ERROR_T (*MsgPlgProcessReceivedInd)(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_REQUEST_INFO_S* pRequest, bool* bReject);
+typedef msg_error_t (*MsgPlgProcessReceivedInd)(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_REQUEST_INFO_S* pRequest, bool* bReject);
 
 
 /**
@@ -851,7 +850,7 @@ typedef MSG_ERROR_T (*MsgPlgProcessReceivedInd)(MSG_MESSAGE_INFO_S *pMsgInfo, MS
 * \param input - pSendOptInfo is information of sending option.
 * \param output - pFileData is the file path of saved MMS message.
 *
-* \return Return Type (int(MSG_ERROR_T)) \n
+* \return Return Type (int(msg_error_t)) \n
 * - MSG_SUCCESS                                          Success in operation.
 * - MSG_ERR_PLUGIN_TRANSPORT   Exception is occured in plug-in.
 *
@@ -866,7 +865,7 @@ typedef MSG_ERROR_T (*MsgPlgProcessReceivedInd)(MSG_MESSAGE_INFO_S *pMsgInfo, MS
 *
 */
 /*================================================================================================*/
-typedef MSG_ERROR_T (*MsgPlgUpdateMessage)(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S* pSendOptInfo, char* pFileData);
+typedef msg_error_t (*MsgPlgUpdateMessage)(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S* pSendOptInfo, char* pFileData);
 
 
 /**
@@ -895,7 +894,7 @@ typedef MSG_ERROR_T (*MsgPlgUpdateMessage)(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SEN
 * \param output - pMmsMsg is information of MMS messages detail data.
 * \param output - pDestMsg is file path of MMS message.
 *
-* \return Return Type (int(MSG_ERROR_T)) \n
+* \return Return Type (int(msg_error_t)) \n
 * - MSG_SUCCESS                                          Success in operation.
 * - MSG_ERR_PLUGIN_TRANSPORT   Exception is occured in plug-in.
 *
@@ -910,7 +909,7 @@ typedef MSG_ERROR_T (*MsgPlgUpdateMessage)(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SEN
 *
 */
 /*================================================================================================*/
-typedef MSG_ERROR_T (*MsgPlgGetMmsMessage)(MSG_MESSAGE_INFO_S* pMsg,   MSG_SENDINGOPT_INFO_S* pSendOptInfo, MMS_MESSAGE_DATA_S* pMmsMsg, char** pDestMsg);
+typedef msg_error_t (*MsgPlgGetMmsMessage)(MSG_MESSAGE_INFO_S* pMsg,   MSG_SENDINGOPT_INFO_S* pSendOptInfo, MMS_MESSAGE_DATA_S* pMmsMsg, char** pDestMsg);
 
 
 /**
@@ -936,7 +935,7 @@ typedef MSG_ERROR_T (*MsgPlgGetMmsMessage)(MSG_MESSAGE_INFO_S* pMsg,        MSG_SENDING
 *
 * \param input - pMsgInfo is information of MMS message.
 *
-* \return Return Type (int(MSG_ERROR_T)) \n
+* \return Return Type (int(msg_error_t)) \n
 * - MSG_SUCCESS                                          Success in operation.
 * - MSG_ERR_PLUGIN_TRANSPORT   Exception is occured in plug-in.
 *
@@ -951,7 +950,7 @@ typedef MSG_ERROR_T (*MsgPlgGetMmsMessage)(MSG_MESSAGE_INFO_S* pMsg,        MSG_SENDING
 *
 */
 /*================================================================================================*/
-typedef MSG_ERROR_T (*MsgPlgUpdateRejectStatus)(MSG_MESSAGE_INFO_S *pMsgInfo);
+typedef msg_error_t (*MsgPlgUpdateRejectStatus)(MSG_MESSAGE_INFO_S *pMsgInfo);
 
 
 /**
@@ -978,7 +977,7 @@ typedef MSG_ERROR_T (*MsgPlgUpdateRejectStatus)(MSG_MESSAGE_INFO_S *pMsgInfo);
 *
 * \param input - pMsgInfo is information of MMS message.
 *
-* \return Return Type (int(MSG_ERROR_T)) \n
+* \return Return Type (int(msg_error_t)) \n
 * - MSG_SUCCESS                                          Success in operation.
 * - MSG_ERR_PLUGIN_TRANSPORT   Exception is occured in plug-in.
 *
@@ -993,7 +992,7 @@ typedef MSG_ERROR_T (*MsgPlgUpdateRejectStatus)(MSG_MESSAGE_INFO_S *pMsgInfo);
 *
 */
 /*================================================================================================*/
-typedef MSG_ERROR_T (*MsgPlgComposeReadReport)(MSG_MESSAGE_INFO_S *pMsgInfo);
+typedef msg_error_t (*MsgPlgComposeReadReport)(MSG_MESSAGE_INFO_S *pMsgInfo);
 
  /**
 
@@ -1019,7 +1018,7 @@ typedef MSG_ERROR_T (*MsgPlgComposeReadReport)(MSG_MESSAGE_INFO_S *pMsgInfo);
  *
  * \param input - pMsgInfo is information of MMS message.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS                                       Success in operation.
  * - MSG_ERR_PLUGIN_TRANSPORT  Exception is occured in plug-in.
  *
@@ -1034,17 +1033,17 @@ typedef MSG_ERROR_T (*MsgPlgComposeReadReport)(MSG_MESSAGE_INFO_S *pMsgInfo);
  *
  */
 /*================================================================================================*/
-typedef MSG_ERROR_T (*MsgPlgRestoreMsg)(MSG_MESSAGE_INFO_S *pMsg, char* pRcvdBody, int rcvdBodyLen, char* filePath);
+typedef msg_error_t (*MsgPlgRestoreMsg)(MSG_MESSAGE_INFO_S *pMsg, char* pRcvdBody, int rcvdBodyLen, char* filePath);
 
 
 // framework defined callbacks.
 typedef void (*MsgPlgOnSentStatus)(MSG_SENT_STATUS_S *pSentStatus);
-typedef void (*MsgPlgOnStorageChange)(MSG_STORAGE_CHANGE_TYPE_T storageChangeType, MSG_MESSAGE_INFO_S *pMsgInfo);
-typedef MSG_ERROR_T (*MsgPlgOnMsgIncoming)(MSG_MESSAGE_INFO_S *pMsgInfo);
-typedef MSG_ERROR_T (*MsgPlgOnInitSimBySat)(void);
-typedef MSG_ERROR_T (*MsgPlgOnSyncMLMsgIncoming)(MSG_SYNCML_MESSAGE_DATA_S *pSyncMLData);
-typedef MSG_ERROR_T (*MsgPlgOnLBSMsgIncoming)(MSG_LBS_MESSAGE_DATA_S *pLBSData);
-typedef MSG_ERROR_T (*MsgPlgOnMmsConfIncoming)(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_REQUEST_ID_T *pRequest);
+typedef void (*MsgPlgOnStorageChange)(msg_storage_change_type_t storageChangeType, MSG_MESSAGE_INFO_S *pMsgInfo);
+typedef msg_error_t (*MsgPlgOnMsgIncoming)(MSG_MESSAGE_INFO_S *pMsgInfo);
+typedef msg_error_t (*MsgPlgOnInitSimBySat)(void);
+typedef msg_error_t (*MsgPlgOnSyncMLMsgIncoming)(MSG_SYNCML_MESSAGE_DATA_S *pSyncMLData);
+typedef msg_error_t (*MsgPlgOnLBSMsgIncoming)(MSG_LBS_MESSAGE_DATA_S *pLBSData);
+typedef msg_error_t (*MsgPlgOnMmsConfIncoming)(MSG_MESSAGE_INFO_S *pMsgInfo, msg_request_id_t *pRequest);
 
 
 /*==================================================================================================
index c973056..3869ddc 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef __MsgThdSafeQ_H__
 #define __MsgThdSafeQ_H__
index f1f273f..b42b6e2 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef MSG_SETTING_TYPES_H
 #define MSG_SETTING_TYPES_H
  */
 
 /*==================================================================================================
-                                         DEFINES
-==================================================================================================*/
-#define SMSC_NAME_MAX                  127             /* Max SMSC Name Length */
-#define SMSC_ADDR_MAX                  20              /* Max SMSC Adress Length  */
-#define SMSC_LIST_MAX                  5               /* Max List Count of SMSC */
-#define CB_CHANNEL_NAME_MAX    32              /* cb channel name max size */
-#define CB_CHANNEL_MAX                 30              /* cb channel max count */
-#define CB_LANG_TYPE_MAX               10
-
-/*==================================================================================================
                                          TYPES
 ==================================================================================================*/
 
@@ -220,6 +210,24 @@ typedef struct
        MSG_SMSC_ADDRESS_S              smscAddr;                                       /**< SMSC address structure */
 } MSG_SMSC_DATA_S;
 
+/**
+ *     @brief  Represents an SMSC list.
+ */
+typedef struct
+{
+       int                                             selected;                                                       /**< Selected SMSC index */
+       int                                             totalCnt;                                                       /**< The count of total SMSC addresses */
+       MSG_SMSC_DATA_S                 smscData[SMSC_LIST_MAX];                        /**< SMSC data information list*/
+}MSG_SMSC_LIST_S;
+
+/**
+ *     @brief  Represents an SMSC list.
+ */
+typedef struct
+{
+       int                                             selected;                               /**< Selected SMSC index */
+       msg_struct_list_s               *smsc_list;                             /**< SMSC data information list*/
+}MSG_SMSC_LIST_HIDDEN_S;
 
 /**
  *     @brief  Represents the information of a cell broadcasting channel.
@@ -241,7 +249,6 @@ typedef struct
        MSG_CB_CHANNEL_INFO_S   channelInfo[CB_CHANNEL_MAX];    /**< The structure of CB channel information */
 } MSG_CB_CHANNEL_S;
 
-
 /**
  *     @brief  Represents an general option.
  */
@@ -258,7 +265,7 @@ typedef struct
  */
 typedef struct
 {
-       MSG_ENCODE_TYPE_T                       dcs;                                    /**< Indicates the string encoding type. */
+       msg_encode_type_t                       dcs;                                    /**< Indicates the string encoding type. */
        MSG_SMS_NETWORK_MODE_T  netMode;                                /**< Indicates the network mode (CS/PS) to send SMS. */
        bool                                                    bReplyPath;                     /**< Indicates whether the SMS reply path is set or not. */
        bool                                                    bDeliveryReport;                /**< Indicates whether the SMS delivery report will be sent or not. */
@@ -267,23 +274,12 @@ typedef struct
 
 
 /**
- *     @brief  Represents an SMSC list.
- */
-typedef struct
-{
-       int                                             selected;                                                       /**< Selected SMSC index */
-       int                                             totalCnt;                                                       /**< The count of total SMSC addresses */
-       MSG_SMSC_DATA_S                 smscData[SMSC_LIST_MAX];                        /**< SMSC data information list*/
-}MSG_SMSC_LIST_S;
-
-
-/**
  *     @brief  Represents an MMS send option.
  */
 typedef struct
 {
        MSG_MMS_MSG_CLASS_TYPE_T        msgClass;
-       MSG_PRIORITY_TYPE_T                     priority;                               /**< Indicates the priority of the message. */
+       msg_priority_type_t                     priority;                               /**< Indicates the priority of the message. */
        MSG_MMS_EXPIRY_TIME_T           expiryTime;                     /**< Indicates the time when the message is to be removed from the MMSC. */
        MSG_MMS_DELIVERY_TIME_T         deliveryTime;                   /**< Indicates the message transmission time which is set in the MMSC. */
        unsigned int                                    customDeliveryTime;     /**< Indicates the message transmission time which is set in the MMSC. */
@@ -309,6 +305,7 @@ typedef struct
 {
        MSG_MMS_HOME_RETRIEVE_TYPE_T            homeNetwork;    /**< Indicates the retrieve type for MMS home network. */
        MSG_MMS_ABROAD_RETRIEVE_TYPE_T  abroadNetwok;   /**< Indicates the retrieve type for MMS abroad network. */
+//     MSG_MMS_SEND_READ_REPORT_T              readReceipt;    /**< Indicates whether the read report will be sent or not. */
        bool                            readReceipt;                                    /**< Indicates whether the read report will be sent or not. */
        bool                            bDeliveryReceipt;                       /**< Indicates whether the delivery report will be sent or not. */
        bool                            bRejectUnknown;                 /**< Indicates whether unknown addresses are rejected or not. */
@@ -361,6 +358,14 @@ typedef struct
        bool                                    bLanguage[CB_LANG_TYPE_MAX];            /**< Indicates whether the language name of a cell broadcasting message is set or not. */
 } MSG_CBMSG_OPT_S;
 
+typedef struct
+{
+       bool                                    bReceive;               /**< Indicates whether the CB message is received or not. */
+       bool                                    bAllChannel;            /**< Indicates whether All Channel's CB message is received or not. */
+       int                                     maxSimCnt;              /**< Indicates the number of channels which can be stored in SIM. */
+       msg_struct_list_s       *channelData;           /**< Indicates the cell broadcasting channel information. */
+       bool                                    bLanguage[CB_LANG_TYPE_MAX];            /**< Indicates whether the language name of a cell broadcasting message is set or not. */
+} MSG_CBMSG_OPT_HIDDEN_S;
 
 /**
  *     @brief  Represents a voice mail number option.
@@ -403,266 +408,6 @@ typedef struct
 }MSG_SETTING_S;
 
 
-/*==================================================================================================
-                                         ENUMS
-==================================================================================================*/
-
-/**
- *     @brief  Represents the values of an option type. \n
- *     This enum is used as the value of MSG_OPTION_TYPE_T.
- */
-enum _MSG_OPTION_TYPE_E
-{
-       MSG_GENERAL_OPT,                        /**< General option */
-       MSG_SMS_SENDOPT,                        /**< SMS send option */
-       MSG_SMSC_LIST,                          /**< SMSC list option */
-       MSG_MMS_SENDOPT,                        /**< MMS send option */
-       MSG_MMS_RECVOPT,                        /**< MMS receive option */
-       MSG_MMS_CLASSOPT,                       /**< MMS class option such as personal, advertisement, and informational */
-       MSG_MMS_STYLEOPT,                       /**< MMS style option */
-       MSG_PUSHMSG_OPT,                        /**< Push message option */
-       MSG_CBMSG_OPT,                  /**< Cell broadcasting message option */
-       MSG_VOICEMAIL_OPT,                      /**< Voice mail option */
-       MSG_MSGSIZE_OPT,                        /**< Message size option */
-};
-
-
-/**
- *     @brief  Represents the values of an SMS network mode. \n
- *     This enum is used as the value of MSG_SMS_NETWORK_MODE_T.
- */
-enum _MSG_SMS_NETWORK_MODE_E
-{
-       MSG_SMS_NETWORK_PS_ONLY = 0x01,         /**< Packet switched */
-       MSG_SMS_NETWORK_CS_ONLY = 0x02,         /**< Circuit switched */
-       MSG_SMS_NETWORK_PS_FIRST = 0x03,                /**< Packet switching preferred */
-};
-
-
-/**
- *     @brief  Represents the value of period of playing alert tone. \n
- *     The values for this type SHOULD be in MSG_ALERT_TONE_T.
- */
-enum _MSG_ALERT_TONE_E
-{
-       MSG_ALERT_TONE_ONCE,
-       MSG_ALERT_TONE_2MINS,
-       MSG_ALERT_TONE_5MINS,
-       MSG_ALERT_TONE_10MINS,
-};
-
-
-/**
- *     @brief  Represents the value of a default storage to save SMS. \n
- *     The values for this type SHOULD be in MSG_SMS_SAVE_STORAGE_T.
- */
-enum _MSG_SMS_SAVE_STORAGE_E
-{
-       MSG_SMS_SAVE_STORAGE_SIM,
-       MSG_SMS_SAVE_STORAGE_PHONE,
-};
-
-
-/**
- *     @brief  Represents the values of the type of number for SMS center address. \n
- *     This enum is used as the value of MSG_SMS_TON_T.
- */
-enum _MSG_SMS_TON_E
-{
-       MSG_TON_UNKNOWN = 0,                    /**< Unknown */
-       MSG_TON_INTERNATIONAL,          /**< International */
-       MSG_TON_NATIONAL,                               /**< National */
-       MSG_TON_NETWORK,                                /**< Network */
-       MSG_TON_SUBSCRIBER,                     /**< Subscriber */
-       MSG_TON_ALPHANUMERIC,           /**< Alpha numeric */
-       MSG_TON_ABBREVIATED,                    /**< Abbreviated */
-       MSG_TON_RESERVE,                                /**< Reserve */
-};
-
-
-/**
- *     @brief  Represents the values of the numbering plan ID for SMS center address. \n
- *     This enum is used as the value of MSG_SMS_NPI_T.
- */
-enum _MSG_SMS_NPI_E
-{
-       MSG_NPI_UNKNOWN = 0,                    /**< Unknown */
-       MSG_NPI_ISDN = 1,                               /**< ISDN */
-       MSG_NPI_DATA = 3,                               /**< Data */
-       MSG_NPI_TELEX = 4,                              /**< Telex */
-       MSG_NPI_SMSC = 5,                               /**< SMSC */
-       MSG_NPI_NATIONAL = 8,                   /**< National */
-       MSG_NPI_PRIVATE = 9,                    /**< Private */
-       MSG_NPI_IDENTIFICATION_ERMES = 10,              /**< Identification ermes */
-       MSG_NPI_IDENTIFICATION_RESERVED = 0xF           /**< Identification reserved */
-};
-
-
-/**
- *     @brief  Represents the values of the protocol ID for SMS center address. \n
- *     This enum is used as the value of MSG_SMS_PID_T.
- */
-enum  _MSG_SMS_PID_E
-{
-       MSG_PID_NONE,           /**< None */
-       MSG_PID_TEXT,           /**< Text */
-       MSG_PID_VOICE,          /**< Voice */
-       MSG_PID_FAX,            /**< Fax */
-       MSG_PID_X400,           /**< X400 */
-       MSG_PID_ERMES,          /**< Ermes */
-       MSG_PID_EMAIL,          /**< Email */
-       MSG_PID_MAX             /**< Default */
-};
-
-
-/**
- *     @brief  Represents the values of the Validity Period for SMS center. \n
- *     This enum is used as the value of MSG_VAL_PERIOD_T.
- */
-enum  _MSG_VAL_PERIOD_E
-{
-       MSG_VAL_1DAY = 167,
-       MSG_VAL_2DAYS = 168,
-       MSG_VAL_1WEEK = 173,
-       MSG_VAL_2WEEKS = 180,
-       MSG_VAL_MAXIMUM = 255,
-};
-
-
-enum  _MSG_MMS_EXPIRY_TIME_E
-{
-       MSG_EXPIRY_TIME_MAXIMUM = 0,
-       MSG_EXPIRY_TIME_1DAY = 86400,
-       MSG_EXPIRY_TIME_2DAYS = 2*86400,
-       MSG_EXPIRY_TIME_1WEEK = 604800,
-       MSG_EXPIRY_TIME_2WEEKS = 2*604800,
-};
-
-
-enum  _MSG_MMS_DELIVERY_TIME_E
-{
-       MSG_DELIVERY_TIME_IMMEDIATLY = 0,
-       MSG_DELIVERY_TIME_1HOUR = 3600,
-       MSG_DELIVERY_TIME_1DAY = 86400,
-       MSG_DELIVERY_TIME_1WEEK = 604800,
-       MSG_DELIVERY_TIME_CUSTOM
-};
-
-
-enum _MSG_MMS_MSG_CLASS_TYPE_E
-{
-       MSG_CLASS_PERSONAL,                     /**<Personal message class*/
-       MSG_CLASS_ADVERTISEMENT,                /**<Advertisement message class*/
-       MSG_CLASS_INFORMATIONAL,                /**<Informational message class */
-       MSG_CLASS_AUTO,                         /**<Automatic */
-       MSG_CLASS_MAX                                   /**< */
-};
-
-
-enum _MSG_MMS_REPLY_CHARGING_TYPE_E
-{
-       MSG_REPLY_CHARGING_NONE,                                        /**<Reply-Charging none */
-       MSG_REPLY_CHARGING_REQUESTED,                           /**<Reply-Charging requested */
-       MSG_REPLY_CHARGING_REQUESTED_TEXT_ONLY, /**<Reply-Charging requested text-only */
-       MSG_REPLY_CHARGING_ACCEPTED,                            /**<Reply-Charging accepted */
-       MSG_REPLY_CHARGING_ACCEPTED_TEXT_ONLY,  /**<Reply-Charging accepted text-only */
-       MSG_REPLY_CHARGING_MAX
-};
-
-
-enum _MSG_MMS_CREATION_MODE_E
-{
-       MSG_CREATION_MODE_RESTRICTED,
-       MSG_CREATION_MODE_WARNING,
-       MSG_CREATION_MODE_FREE
-};
-
-
-/**
- *     @brief  Represents the values of the retrieve type for MMS home network. \n
- *     This enum is used as the value of MSG_MMS_HOME_RETRIEVE_TYPE_T.
- */
-enum _MSG_MMS_HOME_RETRIEVE_TYPE_E
-{
-       MSG_HOME_AUTO_DOWNLOAD,         /**< Home auto download */
-       MSG_HOME_MANUAL,                                        /**< Home manual */
-       MSG_HOME_RESTRICTED,                            /**< Home restricted */
-       MSG_HOME_REJECT,                                        /**< Home reject */
-       MSG_HOME_MAX                                            /**< Default */
-};
-
-
-/**
- *     @brief  Represents the values of the retrieve type for MMS abroad network. \n
- *     This enum is used as the value of MSG_MMS_ABROAD_RETRIEVE_TYPE_T.
- */
-enum _MSG_MMS_ABROAD_RETRIEVE_TYPE_E
-{
-       MSG_ABROAD_AUTO_DOWNLOAD,       /**< Abroad auto download */
-       MSG_ABROAD_MANUAL,                      /**< Abroad manual */
-       MSG_ABROAD_RESTRICTED,          /**< Abroad restricted */
-       MSG_ABROAD_REJECT,                      /**< Abroad reject */
-       MSG_ABROAD_MAX                          /**< Default */
-};
-
-
-/**
- *     @brief  Represents the values of the frequency of sending MMS read report. \n
- *     This enum is used as the value of MSG_MMS_SEND_READ_REPORT_T.
- */
-enum _MSG_MMS_SEND_READ_REPORT_E
-{
-       MSG_SEND_READ_REPORT_ALWAYS,    /**< Read report always */
-       MSG_SEND_READ_REPORT_NEVER,             /**< Read report never */
-       MSG_SEND_READ_REPORT_REQUEST,   /**< Read report request */
-       MSG_SEND_READ_REPORT_MAX                /**< Default */
-};
-
-
-/**
- *     @brief  Represents the values of the service type for a push message. \n
- *     This enum is used as the value of MSG_PUSH_SERVICE_TYPE_T.
- */
-enum _MSG_PUSH_SERVICE_TYPE_E
-{
-       MSG_PUSH_SERVICE_ALWAYS,        /**< Push message service always */
-       MSG_PUSH_SERVICE_PROMPT,                /**< Push message service prompt */
-       MSG_PUSH_SERVICE_NEVER,         /**< Push message service never */
-};
-
-
-/**
- *     @brief  Represents the values of the language type for a cell broadcasting message. \n
- *     This enum is used as the value of MSG_CB_LANGUAGE_TYPE_T.
- */
-enum _MSG_CB_LANGUAGE_TYPE_E
-{
-       MSG_CBLANG_TYPE_ALL,                    /**< CB check all */
-       MSG_CBLANG_TYPE_ENG,                    /**< CB message English  */
-       MSG_CBLANG_TYPE_GER,                    /**< CB message Germany */
-       MSG_CBLANG_TYPE_FRE,                    /**< CB message France */
-       MSG_CBLANG_TYPE_ITA,                    /**< CB message Italy */
-       MSG_CBLANG_TYPE_NED,                    /**< CB message Netherland */
-       MSG_CBLANG_TYPE_SPA,                    /**< CB message Spain */
-       MSG_CBLANG_TYPE_POR,                    /**< CB message Portugal */
-       MSG_CBLANG_TYPE_SWE,                    /**< CB message Sweden */
-       MSG_CBLANG_TYPE_TUR,                    /**< CB message Turkey */
-       MSG_CBLANG_TYPE_MAX                     /**< Default */
-};
-
-
-/**
- *     @brief  Represents the values of SIM status. \n
- *     This enum is used as the value of MSG_SIM_STATUS_T.
- */
-enum _MSG_SIM_STATUS_E
-{
-       MSG_SIM_STATUS_NORMAL = 0,
-       MSG_SIM_STATUS_CHANGED,
-       MSG_SIM_STATUS_NOT_FOUND,
-};
-
-
 /**
  *     @}
  */
index 8228b9f..aef5f1e 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef MSG_STORAGE_TYPES_H
 #define MSG_STORAGE_TYPES_H
@@ -39,6 +39,8 @@
 
 #include "MsgTypes.h"
 
+#include "msg_storage_types.h"
+
 
 /**
  *     @ingroup                MESSAGING_FRAMEWORK
 /*==================================================================================================
                                     DEFINES
 ==================================================================================================*/
-#define MAX_FOLDER_NAME_SIZE           20
-#define MAX_SEGMENT_NUM                        12
-
-
-/*==================================================================================================
-                                         TYPES
-==================================================================================================*/
-
-/**
- *     @brief  Represents a folder type. \n
- *     The values for this type SHOULD be in _MSG_FOLDER_TYPE_E.
- */
-typedef unsigned char MSG_FOLDER_TYPE_T;
-
-
-/**
- *     @brief  Represents a sort type. \n
- *     The values for this type SHOULD be in \ref _MSG_SORT_TYPE_E.
- */
-typedef unsigned char MSG_SORT_TYPE_T;
-
-
-/**
- *     @brief  Represents a Saved SIM message ID.
- */
-typedef signed short MSG_SIM_ID_T;
-
-
-/**
- *     @brief  Represents a message type for quick panel. \n
- *     The values for this type SHOULD be in \ref _MSG_QUICKPANEL_TYPE_E.
- */
-typedef unsigned char MSG_QUICKPANEL_TYPE_T;
-
-
-/**
- *     @brief  Represents a storage change CB type. \n
- *     The values for this type SHOULD be in \ref _MSG_STORAGE_CHANGE_TYPE_E.
- */
-typedef unsigned char MSG_STORAGE_CHANGE_TYPE_T;
+#define MAX_SEGMENT_NUM                        15
 
 
 /*==================================================================================================
                                          STRUCTURES
 ==================================================================================================*/
+
 /**
  *     @brief  Represents the count of read/unread messages.
  */
@@ -107,83 +71,33 @@ typedef struct
 
 
 /**
- *     @brief  Represents message thread view information list.
- */
-typedef struct
-{
-       int                                     nCount;                         /**< The count of message thread informatioin */
-       msg_thread_view_t       *msgThreadInfo;         /**< The pointer to message thread informatioin */
-} MSG_THREAD_VIEW_LIST_S;
-
-
-/**
- *     @brief  Represents message information list.
- */
-typedef struct
-{
-       int                                     nCount;                         /**< The count of message informatioin */
-       msg_message_t           *msgInfo;               /**< The pointer to message informatioin */
-}MSG_LIST_S;
-
-
-/**
- *     @brief  Represents message id list.
- */
-typedef struct
-{
-       int                                     nCount;                         /**< The count of message id informatioin */
-       MSG_MESSAGE_ID_T        *msgIdList;                     /**< The pointer to message id informatioin */
-}MSG_MSGID_LIST_S;
-
-
-/**
  *     @brief  Represents a reject message information.
  */
 typedef struct
 {
-       MSG_MESSAGE_ID_T                msgId;                  /**< Indicates the unique message ID. */
+       msg_message_id_t                msgId;                  /**< Indicates the unique message ID. */
        char                                            msgText[MAX_MSG_TEXT_LEN+1];    /**< Indicates the message text. */
        time_t                                  displayTime;
 } MSG_REJECT_MSG_INFO_S;
 
 
 /**
- *     @brief  Represents reject message list.
- */
-typedef struct
-{
-       int                                             nCount;                         /**< The count of reject message informatioin */
-       MSG_REJECT_MSG_INFO_S   *rejectMsgInfo;         /**< The pointer to reject message informatioin */
-}MSG_REJECT_MSG_LIST_S;
-
-
-/**
  *     @brief  Represents folder information.
  */
 typedef struct
 {
-       MSG_FOLDER_ID_T         folderId;                       /**< Indicates the unique folder ID. */
+       msg_folder_id_t         folderId;                       /**< Indicates the unique folder ID. */
        char                            folderName[MAX_FOLDER_NAME_SIZE+1];     /**< Indicates the name of the folder. */
-       MSG_FOLDER_TYPE_T       folderType;             /**< Indicates the folder type. */
+       msg_folder_type_t       folderType;             /**< Indicates the folder type. */
 } MSG_FOLDER_INFO_S;
 
 
 /**
- *     @brief  Represents a folder list.
- */
-typedef struct
-{
-       int                                     nCount;                 /**< The count of folder information */
-       MSG_FOLDER_INFO_S       *folderInfo;            /**< The pointer to folder information */
-} MSG_FOLDER_LIST_S;
-
-
-/**
  *     @brief  Represents contact information.
  */
 typedef struct
 {
-       MSG_CONTACT_ID_T        contactId;                                                      /**< Indicates the unique contact ID. */
+       msg_contact_id_t        contactId;                                                      /**< Indicates the unique contact ID. */
        char                            displayName[MAX_DISPLAY_NAME_LEN+1];    /**< Indicates the display name of contact. */
        char                            firstName[MAX_DISPLAY_NAME_LEN+1];              /**< Indicates the first name of contact. */
        char                            lastName[MAX_DISPLAY_NAME_LEN+1];               /**< Indicates the last name of contact. */
@@ -198,7 +112,7 @@ typedef struct
  */
 typedef struct
 {
-       MSG_SORT_TYPE_T sortType;               /**< Indicates the sort type */
+       msg_sort_type_t sortType;               /**< Indicates the sort type */
        bool                                    bAscending;             /**< Indicates the sort order which is ascending or descending */
 }MSG_SORT_RULE_S;
 
@@ -209,7 +123,7 @@ typedef struct
 typedef struct
 {
        unsigned int            count;                                                                          /**< The total number of SIM Msg ID*/
-       MSG_SIM_ID_T    simId[MAX_SEGMENT_NUM];                                         /**< The SIM Msg ID List */
+       msg_sim_id_t    simId[MAX_SEGMENT_NUM];                                         /**< The SIM Msg ID List */
 } SMS_SIM_ID_LIST_S;
 
 
@@ -228,140 +142,13 @@ typedef struct
  */
 typedef struct
 {
-       MSG_FOLDER_ID_T         folderId;
-       MSG_MESSAGE_TYPE_T              msgType;
+       msg_folder_id_t         folderId;
+       msg_message_type_t              msgType;
        char                                            *pAddressVal;
        char                                            *pSearchVal;
        int                                             reserved;
 } MSG_SEARCH_CONDITION_S;
 
 
-/** @brief     Prototype of the function that will be called when the database of message framework is changed.
- *     Applications SHOULD implement this callback function and register it into Message handle.
- *     For how to register this callback function, please refer to msg_reg_storage_change_callback.
- *     The callback function runs in the application process, not in the framework process.
- *     @param[in]      handle is Message handle.
- *     @param[in]      user_param is a pointer to user data.
- *     @return void
- */
-typedef void (*msg_storage_change_cb)(MSG_HANDLE_T handle, MSG_STORAGE_CHANGE_TYPE_T storageChangeType, MSG_MSGID_LIST_S *pMsgIdList, void *user_param);
-
-
-/*==================================================================================================
-                                         ENUMS
-==================================================================================================*/
-
-/**
- *     @brief  Represents the values of a storage type. \n
- *     This enum is used as the value of MSG_STORAGE_ID_T.
- */
-enum _MSG_STORAGE_ID_E
-{
-       MSG_STORAGE_UNKNOWN = 0,                /**< Storage Id is unknown. */
-       MSG_STORAGE_PHONE,                      /**< Storage Id is Phone. */
-       MSG_STORAGE_SIM,                                /**< Storage Id is SIM card. */
-};
-
-
-/**
- *     @brief  Represents the values of a storage type. \n
- *     This enum is used as the value of MSG_FOLDER_ID_T.
- */
-enum _MSG_FOLDER_ID_E
-{
-       MSG_IOSBOX_ID = -1,                     /**< Indicates INBOX, OUTBOX and SENTBOX group folder id. (Only for search option.) */
-       MSG_ALLBOX_ID = 0,                              /**< Indicates INBOX, OUTBOX, SENTBOX and DRAFTBOX group folder id. (Only for search option.) */
-       MSG_INBOX_ID = 1,
-       MSG_OUTBOX_ID = 2,
-       MSG_SENTBOX_ID = 3,
-       MSG_DRAFT_ID = 4,
-       MSG_CBMSGBOX_ID = 5,
-
-       // new folder should be placed here
-
-       MSG_MAX_FOLDER_ID
-};
-
-
-/**
- *     @brief  Represents the values of a folder type. \n
- *     This enum is used as the value of MSG_FOLDER_TYPE_T.
- */
-enum _MSG_FOLDER_TYPE_E
-{
-       MSG_FOLDER_TYPE_INBOX = 1,              /**< Inbox folder */
-       MSG_FOLDER_TYPE_OUTBOX,         /**< Outbox folder */
-       MSG_FOLDER_TYPE_DRAFT,          /**< Draft folder */
-       MSG_FOLDER_TYPE_USER_DEF                /**< Folder which is created by a user */
-};
-
-
-/**
- *     @brief  Represents the values of a sort type. \n
- *     This enum is used as the value of MSG_SORT_TYPE_T.
- */
-enum _MSG_SORT_TYPE_E
-{
-       MSG_SORT_BY_UNKNOWN = 0,                        /**< Unknown sort type */
-       MSG_SORT_BY_DISPLAY_FROM,               /**< Sort by display from */
-       MSG_SORT_BY_DISPLAY_TO,                 /**< Sort by display to */
-       MSG_SORT_BY_DISPLAY_TIME,                       /**< Sort by display time */
-       MSG_SORT_BY_MSG_TYPE,                           /**< Sort by msg type */
-       MSG_SORT_BY_READ_STATUS,                        /**< Sort by read status */
-       MSG_SORT_BY_STORAGE_TYPE,               /**< Sort by storage type */
-       MSG_SORT_BY_THREAD_NAME,                        /**< Sort by name for thread view*/
-       MSG_SORT_BY_THREAD_DATE,                        /**< Sort by date for thread view*/
-       MSG_SORT_BY_THREAD_COUNT,               /**< Sort by count for thread view*/
-};
-
-
-/**
- *     @brief  Represents the values of a message type for quick panel. \n
- *     This enum is used as the value of MSG_QUICKPANEL_TYPE_T.
- */
-enum _MSG_QUICKPANEL_TYPE_E
-{
-       MSG_QUICKPANEL_SMS = 0,
-       MSG_QUICKPANEL_MMS,
-       MSG_QUICKPANEL_DELIVER_REP,
-       MSG_QUICKPANEL_READ_REP,
-       MSG_QUICKPANEL_VOICEMAIL,
-       MSG_QUICKPANEL_MMS_NOTI,
-};
-
-/**
- *     @}
- */
-enum _MSG_COUNT_LIMIT_MAILBOX_TYPE_E
-{
-       MSG_COUNT_LIMIT_INBOX_TYPE,
-       MSG_COUNT_LIMIT_OUTBOX_TYPE,
-       MSG_COUNT_LIMIT_SENTBOX_TYPE,
-       MSG_COUNT_LIMIT_DRAFTBOX_TYPE,
-       MSG_COUNT_LIMIT_CBMSGBOX_TYPE,
-       MSG_COUNT_LIMIT_MAILBOX_TYPE_MAX,
-};
-
-enum _MSG_COUNT_LIMIT_MSG_TYPE_E
-{
-       MSG_COUNT_LIMIT_SMS_TYPE,
-       MSG_COUNT_LIMIT_MMS_TYPE,
-       MSG_COUNT_LIMIT_CB_TYPE,
-       MSG_COUNT_LIMIT_WAPPUSH_TYPE,
-       MSG_COUNT_LIMIT_PROVISION_TYPE,
-       MSG_COUNT_LIMIT_MSG_TYPE_MAX,
-};
-
-enum _MSG_STORAGE_CHANGE_TYPE_E
-{
-       // msg data
-       MSG_STORAGE_CHANGE_INSERT = 1,
-       MSG_STORAGE_CHANGE_UPDATE,
-       MSG_STORAGE_CHANGE_DELETE,
-
-       // thread data
-       MSG_STORAGE_CHANGE_CONTACT,
-};
-
 #endif // MSG_STORAGE_TYPES_H
 
index f107acf..454d1b5 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef __MSG_THREAD_H__
 #define __MSG_THREAD_H__
index 6a03840..2ecd7fc 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef MSG_TRANSPORT_TYPES_H
 #define MSG_TRANSPORT_TYPES_H
@@ -37,6 +37,8 @@
 #include "MsgStorageTypes.h"
 #include "MsgMmsTypes.h"
 
+#include "msg_transport_types.h"
+
 /**
  *     @ingroup                MESSAGING_FRAMEWORK
  *     @defgroup       MESSAGING_TRANSPORT_TYPES       Messaging Transport Types
  */
 typedef struct
 {
-       MSG_REQUEST_ID_T                reqId;          /**< Indicates the corresponding request Id. */
-       MSG_NETWORK_STATUS_T    status;         /**< Indicates the status of the corresponding request.
-                                                                       Refer to enum _MSG_NETWORK_STATUS_E*/
+       msg_request_id_t                                reqId;          /**< Indicates the corresponding request Id. */
+       msg_network_status_t            status;         /**< Indicates the status of the corresponding request. Refer to enum _MSG_NETWORK_STATUS_E*/
 } MSG_SENT_STATUS_S;
 
 
 /*==================================================================================================
-                                    DEFINES
-==================================================================================================*/
-
-/**    @brief  Prototype of the function that will be called when the status of the message which is already sent is changed.
- *     Applications SHOULD implement this callback function and register it into Message handle.
- *     For how to register this callback function, please refer to msg_reg_sent_status_callback.
- *     If the application sends a message, this callback function will be called to report its sending status.
- *     The application can get the request ID from sent_status to know which request is bound.
- *     The callback function runs in the application process, not in the framework process.
- *     The memory of sent_status is managed by MAPI, when the callback function is finished.
- *     @param[in]      handle is Message handle.
- *     @param[in]      sent_status is a pointer to an MSG_SENT_STATUS_S structure.
- *     @param[in]      user_param is a pointer to user data.
- *     @return void
- */
-typedef void (*msg_sent_status_cb)(MSG_HANDLE_T handle, MSG_SENT_STATUS_S *sent_status, void *user_param);
-
-
-/**    @brief  Prototype of the function that will be called when the status of the message which is already sent is changed.
- *     Applications SHOULD implement this callback function and register it into Message handle.
- *     For how to register this callback function, please refer to msg_reg_sent_status_callback.
- *     If the application sends a message, this callback function will be called to report its sending status.
- *     The application can get the request ID from sent_status to know which request is bound.
- *     The callback function runs in the application process, not in the framework process.
- *     The memory of sent_status is managed by MAPI, when the callback function is finished.
- *     @param[in]      sent_status is a pointer to an MSG_SENT_STATUS_S structure.
- *     @param[in]      user_param is a pointer to user data.
- *     @return void
- */
-typedef void (*msg_simple_sent_status_cb)(MSG_SENT_STATUS_S *sent_status, void *user_param);
-
-
-/** @brief     Prototype of the function that will be called when a new message is received.
- *     Applications SHOULD implement this callback function and register it into Message handle.
- *     For how to register this callback function, please refer to msg_reg_sms_message_callback.
- *     This callback function will be called when a new message is received and the message satisfies the filter list.
- *     The callback function runs in the application process, not in the framework process.
- *     The memory for msg is managed by MAPI, when the callback function is finished.
- *     @param[in]      handle is Message handle.
- *     @param[in]      msg is a pointer to an msg_message_t structure.
- *     @param[in]      user_param is a pointer to user data.
- *     @return void
- */
-typedef void (*msg_sms_incoming_cb)(MSG_HANDLE_T handle, msg_message_t msg, void *user_param);
-
-
-/** @brief     Prototype of the function that will be called when a new MMS message is received.
- *     Applications SHOULD implement this callback function and register it into Message handle.
- *     For how to register this callback function, please refer to msg_reg_mms_conf_message_callback.
- *     This callback function will be called when a new MMS message is received and the message satisfies the filter list.
- *     The callback function runs in the application process, not in the framework process.
- *     The memory for msg is managed by MAPI, when the callback function is finished.
- *     @param[in]      handle is Message handle.
- *     @param[in]      msg is a pointer to an msg_message_t structure.
- *     @param[in]      user_param is a pointer to user data.
- *     @return void
- */
-typedef void (*msg_mms_conf_msg_incoming_cb)(MSG_HANDLE_T handle, msg_message_t msg, void *user_param);
-
-
-/** @brief     Prototype of the function that will be called when a new SyncML message is received.
- *     Applications SHOULD implement this callback function and register it into Message handle.
- *     For how to register this callback function, please refer to msg_reg_syncml_message_callback.
- *     This callback function will be called when a new message is received and the message satisfies the filter list.
- *     The callback function runs in the application process, not in the framework process.
- *     @param[in]      handle is Message handle.
- *     @param[in]      msg_type is MSG_SYNCML_MESSAGE_TYPE_T structure.
- *     @param[in]      push_body is WAP Push body data.
- *     @param[in]      push_body_len is the length of WAP Push body data.
- *     @param[in]      user_param is a pointer to user data.
- *     @return void
- */
-typedef void (*msg_syncml_msg_incoming_cb)(MSG_HANDLE_T handle, MSG_SYNCML_MESSAGE_TYPE_T msg_type, const char *push_body, int push_body_len, const char* wsp_header, int wsp_header_len, void *user_param);
-
-
-/** @brief     Prototype of the function that will be called when a new LBS message is received.
- *     Applications SHOULD implement this callback function and register it into Message handle.
- *     For how to register this callback function, please refer to msg_reg_lbs_message_callback.
- *     This callback function will be called when a new message is received and the message satisfies the filter list.
- *     The callback function runs in the application process, not in the framework process.
- *     @param[in]      hMsgHandle is Message handle.
- *     @param[in]      push_header is push message header data.
- *     @param[in]      push_body is push message body data.
- *     @param[in]      push_body_len is push message body length.
- *     @param[in]      user_param is a pointer to user data.
- *     @return void
- */
-typedef void (*msg_lbs_msg_incoming_cb)(MSG_HANDLE_T handle, const char *push_header, const char *push_body, int push_body_len, void *user_param);
-
-
-/** @brief     Prototype of the function that will be called when a new SyncML message is received.
- *     Applications SHOULD implement this callback function and register it into Message handle.
- *     For how to register this callback function, please refer to msg_reg_syncml_message_callback.
- *     This callback function will be called when a new message is received and the message satisfies the filter list.
- *     The callback function runs in the application process, not in the framework process.
- *     @param[in]      handle is Message handle.
- *     @param[in]      user_param is a pointer to user data.
- *     @return void
- */
-typedef void (*msg_syncml_msg_operation_cb)(MSG_HANDLE_T handle, int msgId, int extId, void *user_param);
-
-
-/*==================================================================================================
                                          TYPES
 ==================================================================================================*/
 
index 43c2b79..fd33621 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef MSG_TYPES_H
 #define MSG_TYPES_H
@@ -38,6 +38,8 @@
 #include <time.h>
 #include <stdbool.h>
 
+#include "msg_types.h"
+
 /**
  *     @ingroup                MESSAGING_FRAMEWORK
  *     @defgroup       MESSAGING_COMMON_TYPES  Messaging Common Types
  */
 
 /*==================================================================================================
-                                    DEFINES
-==================================================================================================*/
-#define MAX_TO_ADDRESS_CNT             10
-#define MAX_PHONE_NUMBER_LEN   20
-#define MAX_ADDRESS_VAL_LEN    254
-#define MAX_SIGN_VAL_LEN               128
-#define MAX_SUBJECT_LEN                        120
-#define MAX_DISPLAY_NAME_LEN   195
-#define MAX_IMAGE_PATH_LEN             1024
-#define MAX_MSG_DATA_LEN               320
-#define MAX_MSG_TEXT_LEN               1530
-#define MAX_FILTER_VALUE_LEN   40
-#define MAX_COMMAND_LEN                1024
-
-#define MAX_WAPPUSH_ID_LEN                     40
-#define MAX_WAPPUSH_HREF_LEN           300
-#define MAX_WAPPUSH_CONTENTS_LEN       2048
-
-#define MAX_PUSH_CACHEOP_INVALID_OBJECT_MAX    5
-#define MAX_PUSH_CACHEOP_INVALID_SERVICE_MAX   5
-#define MAX_PUSH_CACHEOP_MAX_URL_LEN                   200
-
-#define MAX_COMMON_INFO_SIZE   20
-
-/**
- *     @brief  Defines the maximum file path length
- */
-#define        MSG_FILEPATH_LEN_MAX    1024
-
-#define DEPRECATED __attribute__((deprecated))
-
-#ifndef EXPORT_API
-#define EXPORT_API __attribute__ ((visibility("default")))
-#endif
-
-/*==================================================================================================
                                          TYPES
 ==================================================================================================*/
 
 /**
- *     @brief  Defines Message handle.
- */
-typedef struct MessagingHandle *MSG_HANDLE_T;
-
-typedef struct opq_message_s *msg_message_t;
-
-typedef struct opq_threadview_s *msg_thread_view_t;
-
-/**
- *     @brief  Represents a messsage ID.
- */
-typedef unsigned int MSG_MESSAGE_ID_T;
-
-
-/**
- *     @brief  Represents a reference ID.
+ *     @brief  Defines the enabled MMS version
  */
-typedef unsigned int MSG_REFERENCE_ID_T;
-
-
-/**
- *     @brief  Represents a storage type.
-       See enum _MSG_STORAGE_ID_E
- */
-typedef unsigned char MSG_STORAGE_ID_T;
-
+#define        MMS_V1_2                                                                // MMS Version : MMS_V1_0 / MMS_V1_1 / MMS_V1_2
 
 /**
- *     @brief  Represents a folder ID.
-       See enum _MSG_FOLDER_ID_E
+ *     @brief  Defines the enabled DRM support
  */
-typedef char MSG_FOLDER_ID_T;
-
-
-/**
- *     @brief  Represents a request ID, which is unique for each request.
- */
-typedef unsigned int MSG_REQUEST_ID_T;
-
+#define        __SUPPORT_DRM__
 
 /**
- *     @brief  Represents a message priority. \n
- *     The values for this type SHOULD be in _MSG_PRIORITY_TYPE_E.
+ *     @brief  Defines the enabled JAVA MMS Application Id
  */
-typedef unsigned char MSG_PRIORITY_TYPE_T;
-
-
-/**
- *     @brief  Represents the network status of a message. \n
- *     The values for this type SHOULD be in _MSG_NETWORK_STATUS_E.
- */
-typedef unsigned char MSG_NETWORK_STATUS_T;
-
-
-/**
- *     @brief  Represents an address type. \n
- *     The values for this type SHOULD be in _MSG_ADDRESS_TYPE_E.
- */
-typedef unsigned char MSG_ADDRESS_TYPE_T;
-
-
-/**
- *     @brief  Represents an recipient type. \n
- *     The values for this type SHOULD be in _MSG_RECIPIENT_TYPE_E.
- */
-typedef unsigned char MSG_RECIPIENT_TYPE_T;
-
-
-/**
- *     @brief  Represents the type of a message direction. \n
- *     The values for this type SHOULD be in _MSG_DIRECTION_TYPE_E.
- */
-typedef unsigned char MSG_DIRECTION_TYPE_T;
-
-
-/**
- *     @brief  Represents an encoding type. \n
- *     The values for this type SHOULD be in _MSG_ENCODE_TYPE_E.
- */
-typedef unsigned char MSG_ENCODE_TYPE_T;
-
-
-/**
- *     @brief  Represents an error code. \n
- *     The values for this type SHOULD be in _MSG_ERROR_E
- */
-typedef int MSG_ERROR_T;
-
-
-/**
-\brief Represents WAP Push App Code.
-*/
-typedef unsigned char MSG_PUSH_ACTION_T;
-
-
-/**
-\brief Represents SyncML Message Type.
-*/
-typedef unsigned short MSG_SYNCML_MESSAGE_TYPE_T;
-
-
-/**
- *     @brief  Represents a Contact ID.
- */
-typedef unsigned int MSG_CONTACT_ID_T;
-
-
-/**
-  *  @brief    Represents a Delivery Report Status.
- *     The values for this type SHOULD be in _MSG_DELIVERY_REPORT_STATUS_E
-  */
-typedef int MSG_DELIVERY_REPORT_STATUS_T;
-
-
-/**
- *     @brief  Represents a Read Report Status.
- *     The values for this type SHOULD be in _MSG_READ_REPORT_STATUS_E
- */
-typedef int MSG_READ_REPORT_STATUS_T;
-
-
-/**
- *     @brief  Represents a Message Type.
- *     The values for this type SHOULD be in _MSG_MESSAGE_TYPE_E
-*/
-typedef unsigned short MSG_MESSAGE_TYPE_T;
+#define FEATURE_JAVA_MMS
 
 
 /**
- *     @brief  Represents a thread ID. \n
+ *     @brief  Defines message struct handle.
  */
-typedef unsigned int MSG_THREAD_ID_T;
 
+typedef struct _msg_struct{
+       int type;
+       void *data;
+}msg_struct_s;
 
 /*==================================================================================================
                                          STRUCTURES
@@ -226,14 +82,14 @@ typedef unsigned int MSG_THREAD_ID_T;
 /**
  *     @brief  Represents address information.
  */
+
 typedef struct
 {
-       MSG_THREAD_ID_T         threadId;                                                               /**< the thread ID of address */
-       MSG_ADDRESS_TYPE_T              addressType;                                                    /**< The type of an address in case of an Email or a mobile phone */
-       MSG_RECIPIENT_TYPE_T    recipientType;                                                  /**< The type of recipient address in case of To, Cc, and Bcc */
-       MSG_CONTACT_ID_T                contactId;                                                      /**< The contact ID of address */
-       char                                            addressVal[MAX_ADDRESS_VAL_LEN+1];      /**< The actual value of an address */
-       char                                            displayName[MAX_DISPLAY_NAME_LEN+1];    /**< The display name of an address */
+       msg_address_type_t              addressType;                                                                                                    /**< The type of an address in case of an Email or a mobile phone */
+       msg_recipient_type_t    recipientType;                                                                                                  /**< The type of recipient address in case of To, Cc, and Bcc */
+       msg_contact_id_t                        contactId;                                                                                                                      /**< The contact ID of address */
+       char                                                                            addressVal[MAX_ADDRESS_VAL_LEN+1];              /**< The actual value of an address */
+       char                                                                            displayName[MAX_DISPLAY_NAME_LEN+1];    /**< The display name of an address */
 } MSG_ADDRESS_INFO_S;
 
 
@@ -257,7 +113,7 @@ typedef struct
        time_t                          expiryTime;
        bool                                    bUseDeliveryCustomTime;
        time_t                          deliveryTime;
-       MSG_PRIORITY_TYPE_T     priority;
+       msg_priority_type_t     priority;
 } MMS_SENDINGOPT_S;
 
 
@@ -278,12 +134,9 @@ typedef struct
        bool bSetting;
        bool bDeliverReq;
        bool bKeepCopy;
+       msg_struct_t mmsSendOpt;
+       msg_struct_t smsSendOpt;
 
-       union
-       {
-               MMS_SENDINGOPT_S        mmsSendOpt;
-               SMS_SENDINGOPT_S        smsSendOpt;
-       } option;
 } MSG_SENDINGOPT_S;
 
 
@@ -310,7 +163,7 @@ typedef struct
 {
        bool                                    bReadReq;
        bool                                    bUseDeliveryCustomTime;
-       MSG_PRIORITY_TYPE_T     priority;
+       msg_priority_type_t     priority;
        MmsTimeStruct                   expiryTime;
        MmsTimeStruct                   deliveryTime;
 } MMS_SENDINGOPT_INFO_S;
@@ -349,22 +202,29 @@ typedef struct
  */
 typedef struct
 {
-       MSG_REQUEST_ID_T        reqId;  /**< Indicates the request ID, which is unique.
+       msg_request_id_t        reqId;  /**< Indicates the request ID, which is unique.
                                                                        When applications submit a request to the framework, this value will be set by the framework. */
-       msg_message_t           msg;    /**< Indicates the message structure to be sent by applications. */
-       MSG_SENDINGOPT_S        sendOpt;
+       msg_struct_t            msg;    /**< Indicates the message structure to be sent by applications. */
+       msg_struct_t            sendOpt;
 } MSG_REQUEST_S;
 
 
 /**
  *     @brief  Represents Address information list.
  */
+
 typedef struct
 {
-       MSG_CONTACT_ID_T                contactId;                      /**< The contact id of message common informatioin */
+       msg_contact_id_t                contactId;                      /**< The contact id of message common informatioin */
        MSG_ADDRESS_INFO_S              msgAddrInfo;            /**< The pointer to message common informatioin */
 } MSG_THREAD_LIST_INDEX_S;
 
+typedef struct
+{
+       msg_contact_id_t                contactId;                      /**< The contact id of message common informatioin */
+       msg_struct_t                    msgAddrInfo;            /**< The pointer to message common informatioin */
+} MSG_THREAD_LIST_INDEX_INFO_S;
+
 
 /**
  *     @brief  Represents Peer Count Info.
@@ -383,7 +243,7 @@ typedef struct
  */
 typedef struct
 {
-       MSG_PUSH_ACTION_T       action;
+       msg_push_action_t       action;
        unsigned long                   received;
        unsigned long                   created;
        unsigned long                   expires;
@@ -412,7 +272,7 @@ typedef struct
 {
        int                                     extId;
        int                                     pinCode;
-       msg_message_t           msg;
+       msg_struct_t            msg;
 }MSG_SYNCML_MESSAGE_S;
 
 
@@ -421,7 +281,7 @@ typedef struct
  */
  typedef struct
 {
-       MSG_SYNCML_MESSAGE_TYPE_T       syncmlType;
+       msg_syncml_message_type_t       syncmlType;
        int                                                     pushBodyLen;
        char                                                    pushBody[MAX_WAPPUSH_CONTENTS_LEN];
        int                                                             wspHeaderLen;
@@ -440,287 +300,18 @@ typedef struct
 }MSG_LBS_MESSAGE_DATA_S;
 
 
-
 /**
  *     @brief  Represents the Report Status Data.
  */
  typedef struct
 {
-       MSG_DELIVERY_REPORT_STATUS_T    deliveryStatus;         /**< Indicates the message ID of this message. */
+       msg_delivery_report_status_t    deliveryStatus;         /**< Indicates the message ID of this message. */
        time_t                                                  deliveryStatusTime;     /**< Indicates the display time related to the specific operation. */   //MAX_DISPLAY_TIME_LEN
-       MSG_READ_REPORT_STATUS_T                readStatus;                     /**< Indicates the message ID of this message. */
+       msg_read_report_status_t                readStatus;                     /**< Indicates the message ID of this message. */
        time_t                                                  readStatusTime;         /**< Indicates the display time related to the specific operation. */   //MAX_DISPLAY_TIME_LEN
 }MSG_REPORT_STATUS_INFO_S;
 
 
-/*==================================================================================================
-                                         ENUMS
-==================================================================================================*/
-
-/**
- *     @brief  Represents the type of Message. More members maybe added if needed \n
- *     This enum is used as the value of MSG_MESSAGE_TYPE_T.
- */
- enum _MSG_MESSAGE_TYPE_E
-{
-       MSG_TYPE_INVALID = 0,                   /** < Invalid Type Message */
-
-       MSG_TYPE_SMS,                                   /** < Normal SMS Message */
-       MSG_TYPE_SMS_CB,                                /** < Cell Broadcasting SMS Message */
-       MSG_TYPE_SMS_JAVACB,                    /** < JAVA Cell Broadcasting SMS Message */
-       MSG_TYPE_SMS_WAPPUSH,           /** < WAP Push SMS Message */
-       MSG_TYPE_SMS_MWI,                               /** < MWI SMS Message */
-       MSG_TYPE_SMS_SYNCML,                    /** < SyncML CP SMS Message */
-       MSG_TYPE_SMS_REJECT,                    /** < Reject Message */
-
-       MSG_TYPE_MMS,                                   /** < Normal MMS Message */
-       MSG_TYPE_MMS_JAVA,                      /** < JAVA MMS Message */
-       MSG_TYPE_MMS_NOTI,                      /** < MMS Notification Message */
-};
-
-
-/**
- *     @brief  Represents the values of an error code. \n
- *     Success code is zero, but all error codes SHOULD be negative and smaller than MSG_ERROR_BEGIN. \n
- *     This enum is used as the value of MSG_ERROR_T.
- */
-enum _MSG_ERROR_E
-{
-       MSG_SUCCESS = 0,                                /**< Successful */
-
-       MSG_ERR_NULL_MSGHANDLE = -1,    /**< Message handle is NULL */
-       MSG_ERR_NULL_POINTER = -2,              /**< Pointer is NULL */
-       MSG_ERR_NULL_MESSAGE = -3,              /**< Message is NULL */
-       MSG_ERR_INVALID_STORAGE_ID = -4,        /**< Storage ID is invalid */
-       MSG_ERR_INVALID_MSG_TYPE = -5,          /**< Message type is invalid */
-
-       MSG_ERR_INVALID_STORAGE_REG= -6,        /**< Storage registry is invalid */
-       MSG_ERR_INVALID_MESSAGE_ID = -7,        /**< Message ID is invalid */
-       MSG_ERR_INVALID_MSGHANDLE = -8, /**< Message handle is invalid */
-       MSG_ERR_INVALID_PARAMETER = -9, /**< Parameter is invalid */
-       MSG_ERR_INVALID_MESSAGE = -10,                  /**< Message is invalid */
-
-       MSG_ERR_INVALID_PLUGIN_HANDLE = -11,    /**< Plugin handle is invalid */
-       MSG_ERR_MEMORY_ERROR = -12,                     /**< Memory is error */
-       MSG_ERR_COMMUNICATION_ERROR = -13,      /**< Communication between client and server is error */
-       MSG_ERR_SIM_STORAGE_FULL = -14,         /**< SIM Storage is full */
-       MSG_ERR_TRANSPORT_ERROR = -15,                  /**< Transport event error */
-
-       MSG_ERR_CALLBACK_ERROR = -16,                   /**< Callback event error */
-       MSG_ERR_STORAGE_ERROR = -17,                    /**< Storage event error */
-       MSG_ERR_FILTER_ERROR = -18,                             /**< Filter event error */
-       MSG_ERR_MMS_ERROR = -19,                                /**< MMS event error */
-       MSG_ERR_MMPLAYER_CREATE = -20,                  /**< Multimedia Error*/
-
-       MSG_ERR_MMPLAYER_SET_ATTRS = -21,               /**< Multimedia Error*/
-       MSG_ERR_MMPLAYER_REALIZE = -22,         /**< Multimedia Error*/
-       MSG_ERR_MMPLAYER_PLAY = -23,                    /**< Multimedia Error*/
-       MSG_ERR_MMPLAYER_STOP = -24,                    /**< Multimedia Error*/
-       MSG_ERR_MMPLAYER_DESTROY = -25,         /**< Multimedia Error*/
-
-       MSG_ERR_UNKNOWN = -26,                                  /**< Unknown errors */
-
-       /* Start Database Errors */
-       MSG_ERR_DB_CONNECT = -27,
-       MSG_ERR_DB_DISCONNECT = -28,
-       MSG_ERR_DB_EXEC = -29,
-       MSG_ERR_DB_GETTABLE = -30,
-
-       MSG_ERR_DB_PREPARE = -31,
-       MSG_ERR_DB_STEP = -32,
-       MSG_ERR_DB_NORECORD= -33,
-       MSG_ERR_DB_STORAGE_INIT = -34,
-       MSG_ERR_DB_MAKE_DIR = -35,
-
-       MSG_ERR_DB_ROW = -36,
-       MSG_ERR_DB_DONE = -37,
-       MSG_ERR_DB_GENERIC= -38,
-       MSG_ERR_DB_END = -39,
-       /* End Database Errors */
-
-       /* Start Setting Errors */
-       MSG_ERR_SET_SETTING = -40,
-       MSG_ERR_SET_SIM_SET = -41,
-       MSG_ERR_SET_READ_ERROR = -42,
-       MSG_ERR_SET_WRITE_ERROR = -43,
-       MSG_ERR_SET_DELETE_ERROR = -44,
-       /* End Setting Errors */
-
-       /* Start Plugin Errors */
-       MSG_ERR_PLUGIN_TAPIINIT = -45,
-       MSG_ERR_PLUGIN_REGEVENT = -46,
-       MSG_ERR_PLUGIN_TRANSPORT = -47,
-       MSG_ERR_PLUGIN_STORAGE = -48,
-       MSG_ERR_PLUGIN_SETTING = -49,
-
-       MSG_ERR_PLUGIN_WAPDECODE = -50,
-       MSG_ERR_PLUGIN_TAPI_FAILED = -51,
-       MSG_ERR_PLUGIN_SIM_MSG_FULL = -52,
-       /* End Plugin Errors */
-
-       MSG_ERR_MESSAGE_COUNT_FULL = -53,
-       MSG_ERR_READREPORT_NOT_REQUESTED = -54,
-       MSG_ERR_READREPORT_ALEADY_SENT = -55,
-
-       MSG_ERR_FILTER_DUPLICATED = -56,                                /**< Filter duplicate error */
-       MSG_ERR_SECURITY_ERROR = -57,
-       MSG_ERR_NO_SIM = -58,
-       MSG_ERR_SERVER_NOT_READY= -59,
-};
-
-
-/**
- *     @brief  Represents the values of a message priority. \n
- *     This enum is used as the value of MSG_PRIORITY_TYPE_T.
- */
-enum _MSG_PRIORITY_TYPE_E
-{
-       MSG_MESSAGE_PRIORITY_LOW,               /**< Low priority */
-       MSG_MESSAGE_PRIORITY_NORMAL,    /**< Normal priority */
-       MSG_MESSAGE_PRIORITY_HIGH,              /**< High priority */
-};
-
-
-/**
- *     @brief  Represents the values of a network status. \n
- *     This enum is used as the value of MSG_NETWORK_STATUS_T.
- */
-enum _MSG_NETWORK_STATUS_E
-{
-       MSG_NETWORK_NOT_SEND = 0,               /**< Message is not sending */
-       MSG_NETWORK_SENDING,                            /**< Message is sending */
-       MSG_NETWORK_SEND_SUCCESS,               /**< Message is sent successfully */
-       MSG_NETWORK_SEND_FAIL,                  /**< Message is failed to send */
-       MSG_NETWORK_DELIVER_SUCCESS,    /**< Message is delivered */
-       MSG_NETWORK_DELIVER_FAIL,               /**< Message is failed to deliver */
-       MSG_NETWORK_RECEIVED,                   /**< Message is received */
-       MSG_NETWORK_REQ_CANCELLED,              /**< Request is cancelled */
-       MSG_NETWORK_RETRIEVING,                         /**< Message is retrieving */
-       MSG_NETWORK_RETRIEVE_SUCCESS,           /**< Message is retrieved successfully */
-       MSG_NETWORK_RETRIEVE_FAIL,                      /**< Message is failed to retrieve */
-       MSG_NETWORK_SEND_TIMEOUT,                       /**< Message is failed to send by timeout */
-};
-
-
-/**
- *     @brief  Represents the values of an address type. \n
- *     This enum is used as the value of MSG_ADDRESS_TYPE_T.
-*/
-enum _MSG_ADDRESS_TYPE_E
-{
-       MSG_ADDRESS_TYPE_UNKNOWN = 0,   /**< The address type is unknown. */
-       MSG_ADDRESS_TYPE_PLMN,                  /**< The address type is for a phone number like +1012345678. */
-       MSG_ADDRESS_TYPE_EMAIL,                 /**< The address type is for an email address like abc@example.email. */
-};
-
-
-/**
- *     @brief  Represents the values of a recipient type. \n
- *     This enum is used as the value of MSG_RECIPIENT_TYPE_T.
-*/
-enum _MSG_RECIPIENT_TYPE_E
-{
-       MSG_RECIPIENTS_TYPE_UNKNOWN = 0,        /**< The recipient type is unknown. */
-       MSG_RECIPIENTS_TYPE_TO,                 /**< The recipient type is for "To". */
-       MSG_RECIPIENTS_TYPE_CC,                 /**< The recipient type is for "Cc". */
-       MSG_RECIPIENTS_TYPE_BCC,                        /**< The recipient type is for "Bcc". */
-};
-
-
-/**
- *     @brief  Represents the values of a direction type. \n
- *     This enum is used as the value of MSG_DIRECTION_TYPE_T.
- */
-enum _MSG_DIRECTION_TYPE_E
-{
-       MSG_DIRECTION_TYPE_MO = 0,              /**< The direction type is for mobile originated */
-       MSG_DIRECTION_TYPE_MT,                  /**< The direction type is for mobile terminated */
-};
-
-
-/**
- *     @brief  Represents the values of a string encoding type. \n
- *     This enum is used as the value of MSG_ENCODE_TYPE_T.
- */
-enum _MSG_ENCODE_TYPE_E
-{
-       MSG_ENCODE_GSM7BIT = 0, /**< The string encoding type is GSM7BIT */
-       MSG_ENCODE_8BIT,                /**< The string encoding type is 8 BIT */
-       MSG_ENCODE_UCS2,                /**< The string encoding type is UCS2 */
-       MSG_ENCODE_AUTO,                /**< The string encoding type is AUTO */
-};
-
-
-/**
- *     @brief  Represents the action type of Push Message. \n
- *     This enum is used as the value of MSG_PUSH_ACTION_T.
- */
-enum _MSG_PUSH_ACTION_E
-{
-       // SI Action
-       MSG_PUSH_SI_ACTION_SIGNAL_NONE = 0x00,
-       MSG_PUSH_SI_ACTION_SIGNAL_LOW,
-       MSG_PUSH_SI_ACTION_SIGNAL_MEDIUM,
-       MSG_PUSH_SI_ACTION_SIGNAL_HIGH,
-       MSG_PUSH_SI_ACTION_DELETE,
-
-       // SL Action
-       MSG_PUSH_SL_ACTION_EXECUTE_LOW,
-       MSG_PUSH_SL_ACTION_EXECUTE_HIGH,
-       MSG_PUSH_SL_ACTION_CACHE,
-};
-
-
-/**
- *     @brief  Represents the type of SyncML Message. \n
- *     This enum is used as the value of MSG_SYNCML_MESSAGE_TYPE_T.
- */
- enum _MSG_SYNCML_MESSAGE_TYPE_E
- {
-       DM_WBXML,                                       /** < DM WBXML SyncML Message */
-       DM_XML,                                         /** < DM XML SyncML Message */
-       DM_NOTIFICATION,                        /** < DM Notification SyncML Message */
-
-       DS_NOTIFICATION,                        /** < DS Notification SyncML Message */
-       DS_WBXML,                                       /** < DS WBXML SyncML Message */
-
-       CP_XML,                                         /** < CP XML SyncML Message */
-       CP_WBXML,                                       /** < CP WBXML SyncML Message */
-
-       OTHERS,                                         /** < Unknown SyncML Message */
- };
-
-
-/**
- *     @brief  Represents the values of a Delivery Report Status. \n
- *     This enum is used as the value of MSG_DELIVERY_REPORT_STATUS_T.
-*/
- enum _MSG_DELIVERY_REPORT_STATUS_E
- {
-        MSG_DELIVERY_REPORT_NONE                               =       -1,     /**< Indicates the status unavailable */
-        MSG_DELIVERY_REPORT_EXPIRED                    =       0,      /**< Indicates the expired status of message */
-        MSG_DELIVERY_REPORT_SUCCESS                            =       1,      /**< Indicates the success status of message */
-        MSG_DELIVERY_REPORT_REJECTED                   =       2,      /**< Indicates the rejected status of message */
-        MSG_DELIVERY_REPORT_DEFERRED                   =       3,      /**< Indicates the deferred status of message */
-        MSG_DELIVERY_REPORT_UNRECOGNISED               =       4,      /**< Indicates the unrecongnised status of message */
-        MSG_DELIVERY_REPORT_INDETERMINATE              =       5,      /**< Indicates the unrecongnised status of message */
-        MSG_DELIVERY_REPORT_FORWARDED                  =       6,      /**< Indicates the forwarded status of message */
-        MSG_DELIVERY_REPORT_UNREACHABLE                =       7,      /**< Indicates the unreachable status of message */
-        MSG_DELIVERY_REPORT_ERROR                              =       8,      /**< Indicates the error status of message */
- };
-
-
-/**
- *     @brief  Represents the values of a Read Report Status. \n
- *     This enum is used as the value of MSG_READ_REPORT_STATUS_T.
-*/
-enum _MSG_READ_REPORT_STATUS_E
- {
-        MSG_READ_REPORT_NONE                   =       -1,       /**< Indicates the status unavailable */
-        MSG_READ_REPORT_IS_READ                =       0,        /**< Indicates the message is read */
-        MSG_READ_REPORT_IS_DELETED     =       1         /**< Indicates the message is deleted */
- };
-
 /**
  *     @}
  */
index 5fa7d7f..1906581 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef MSG_CMD_HANDLER_H
 #define MSG_CMD_HANDLER_H
@@ -59,6 +59,11 @@ int MsgGetQuickPanelDataHandler(const MSG_CMD_S *pCmd, char **ppEvent);
 int MsgResetDatabaseHandler(const MSG_CMD_S *pCmd, char **ppEvent);
 int MsgGetMemSizeHandler(const MSG_CMD_S *pCmd, char **ppEvent);
 int MsgGetReportStatusHandler(const MSG_CMD_S *pCmd, char **ppEvent);
+int MsgGetThreadIdByAddressHandler(const MSG_CMD_S *pCmd, char **ppEvent);
+int MsgGetThreadInfoHandler(const MSG_CMD_S *pCmd, char **ppEvent);
+
+int MsgBackupMessageHandler(const MSG_CMD_S *pCmd, char **ppEvent);
+int MsgRestoreMessageHandler(const MSG_CMD_S *pCmd, char **ppEvent);
 
 int MsgSetConfigHandler(const MSG_CMD_S *pCmd, char **ppEvent);
 int MsgGetConfigHandler(const MSG_CMD_S *pCmd, char **ppEvent);
@@ -81,9 +86,6 @@ int MsgIncomingSyncMLMsgHandler(const MSG_CMD_S *pCmd, char **ppEvent);
 int MsgIncomingLBSMsgHandler(const MSG_CMD_S *pCmd, char **ppEvent);
 int MsgSyncMLMsgOperationHandler(const MSG_CMD_S *pCmd, char **ppEvent);
 
-MSG_ERROR_T MsgPrepareScheduledMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S *pSendOpt, int ListenerFd);
-int MsgCreateScheduledAlarm(MSG_MESSAGE_INFO_S *pMsgInfo);
-int MsgScheduledAlarmCB(int AlarmId, void *pUserParam);
 int MsgIncomingMMSConfMsgHandler(const MSG_CMD_S *pCmd, char **ppEvent);
 int MsgAddFilterHandler(const MSG_CMD_S *pCmd, char **ppEvent);
 int MsgUpdateFilterHandler(const MSG_CMD_S *pCmd, char **ppEvent);
@@ -92,4 +94,13 @@ int MsgGetFilterListHandler(const MSG_CMD_S *pCmd, char **ppEvent);
 int MsgSetFilterOperationHandler(const MSG_CMD_S *pCmd, char **ppEvent);
 int MsgGetFilterOperationHandler(const MSG_CMD_S *pCmd, char **ppEvent);
 
+int MsgGetSMSCListHandler(const MSG_CMD_S *pCmd, char **ppEvent);
+int MsgGetCBInfoHandler(const MSG_CMD_S *pCmd, char **ppEvent);
+int MsgGetSmsSendOptHandler(const MSG_CMD_S *pCmd, char **ppEvent);
+int MsgGetMmsSendOptHandler(const MSG_CMD_S *pCmd, char **ppEvent);
+int MsgGetMmsRecvOptHandler(const MSG_CMD_S *pCmd, char **ppEvent);
+int MsgGetPushMsgOptHandler(const MSG_CMD_S *pCmd, char **ppEvent);
+int MsgGetVoiceMsgOptHandler(const MSG_CMD_S *pCmd, char **ppEvent);
+int MsgGetGeneralOptHandler(const MSG_CMD_S *pCmd, char **ppEvent);
+
 #endif // MSG_CMD_HANDLER_H
index 69e9da3..0f0100b 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef MSG_DELIVER_HANDLER_H
 #define MSG_DELIVER_HANDLER_H
 /*==================================================================================================
                                      FUNCTION PROTOTYPES
 ==================================================================================================*/
-MSG_ERROR_T MsgHandleMmsConfIncomingMsg(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_REQUEST_ID_T reqID);
-MSG_ERROR_T MsgHandleIncomingMsg(MSG_MESSAGE_INFO_S *pMsgInfo, bool *pSendNoti);
-MSG_ERROR_T MsgHandleSMS(MSG_MESSAGE_INFO_S *pMsgInfo, bool *pSendNoti);
-MSG_ERROR_T MsgHandleMMS(MSG_MESSAGE_INFO_S *pMsgInfo, bool *pSendNoti);
+msg_error_t MsgHandleMmsConfIncomingMsg(MSG_MESSAGE_INFO_S *pMsgInfo, msg_request_id_t reqID);
+msg_error_t MsgHandleIncomingMsg(MSG_MESSAGE_INFO_S *pMsgInfo, bool *pSendNoti);
+msg_error_t MsgHandleSMS(MSG_MESSAGE_INFO_S *pMsgInfo, bool *pSendNoti);
+msg_error_t MsgHandleMMS(MSG_MESSAGE_INFO_S *pMsgInfo, bool *pSendNoti);
 
 /*==================================================================================================
                                        DEFINES
index ef7db18..d07d2e3 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef MSG_PLUGIN_CONFIG_H
 #define MSG_PLUGIN_CONFIG_H
index 1c9f863..551efb9 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef MSG_PLUGIN_MANAGER_H
 #define MSG_PLUGIN_MANAGER_H
@@ -43,33 +43,33 @@ public:
        MsgPlugin(MSG_MAIN_TYPE_T plgType = MSG_UNKNOWN_TYPE, const char* libPath = NULL);
        ~MsgPlugin();
 
-       MSG_ERROR_T initialize();
+       msg_error_t initialize();
        void finalize();
 
-       MSG_ERROR_T submitReq(MSG_REQUEST_INFO_S *pReqInfo, bool bReqCb);
-       MSG_ERROR_T registerListener(MSG_PLUGIN_LISTENER_S *pListener);
-       MSG_ERROR_T checkSimStatus(MSG_SIM_STATUS_T *pStatus);
-       MSG_ERROR_T checkDeviceStatus();
+       msg_error_t submitReq(MSG_REQUEST_INFO_S *pReqInfo);
+       msg_error_t registerListener(MSG_PLUGIN_LISTENER_S *pListener);
+       msg_error_t checkSimStatus(MSG_SIM_STATUS_T *pStatus);
+       msg_error_t checkDeviceStatus();
 
-       MSG_ERROR_T initSimMessage();
-       MSG_ERROR_T saveSimMessage(MSG_MESSAGE_INFO_S *pMsgInfo, SMS_SIM_ID_LIST_S *pSimIdList);
-       MSG_ERROR_T deleteSimMessage(MSG_SIM_ID_T SimMsgId);
-       MSG_ERROR_T setReadStatus(MSG_SIM_ID_T SimMsgId);
-       MSG_ERROR_T setMemoryStatus(MSG_ERROR_T Error);
+       msg_error_t initSimMessage();
+       msg_error_t saveSimMessage(MSG_MESSAGE_INFO_S *pMsgInfo, SMS_SIM_ID_LIST_S *pSimIdList);
+       msg_error_t deleteSimMessage(msg_sim_id_t SimMsgId);
+       msg_error_t setReadStatus(msg_sim_id_t SimMsgId);
+       msg_error_t setMemoryStatus(msg_error_t Error);
 
-       MSG_ERROR_T initConfigData(MSG_SIM_STATUS_T SimStatus);
-       MSG_ERROR_T setConfigData(const MSG_SETTING_S *pSetting);
-       MSG_ERROR_T getConfigData(MSG_SETTING_S *pSetting);
+       msg_error_t initConfigData(MSG_SIM_STATUS_T SimStatus);
+       msg_error_t setConfigData(const MSG_SETTING_S *pSetting);
+       msg_error_t getConfigData(MSG_SETTING_S *pSetting);
 
        // MMS handlers
-       MSG_ERROR_T addMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S *pSendOptInfo, char *pFileData);
-       MSG_ERROR_T updateMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S *pSendOptInfo, char *pFileData);
-       MSG_ERROR_T processReceivedInd(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_REQUEST_INFO_S *pRequest, bool *bReject);
-       MSG_ERROR_T getMmsMessage(MSG_MESSAGE_INFO_S *pMsg,  MSG_SENDINGOPT_INFO_S *pSendOptInfo, MMS_MESSAGE_DATA_S *pMmsMsg, char **pDestMsg);
-       MSG_ERROR_T updateRejectStatus(MSG_MESSAGE_INFO_S *pMsgInfo);
-       MSG_ERROR_T composeReadReport(MSG_MESSAGE_INFO_S *pMsgInfo);
-
-       MSG_ERROR_T restoreMsg(MSG_MESSAGE_INFO_S *pMsgInfo, char* pRecvBody, int rcvdBodyLen, char* filePath);
+       msg_error_t addMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S *pSendOptInfo, char *pFileData);
+       msg_error_t updateMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S *pSendOptInfo, char *pFileData);
+       msg_error_t processReceivedInd(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_REQUEST_INFO_S *pRequest, bool *bReject);
+       msg_error_t getMmsMessage(MSG_MESSAGE_INFO_S *pMsg,  MSG_SENDINGOPT_INFO_S *pSendOptInfo, MMS_MESSAGE_DATA_S *pMmsMsg, char **pDestMsg);
+       msg_error_t updateRejectStatus(MSG_MESSAGE_INFO_S *pMsgInfo);
+       msg_error_t composeReadReport(MSG_MESSAGE_INFO_S *pMsgInfo);
+
+       msg_error_t restoreMsg(MSG_MESSAGE_INFO_S *pMsgInfo, char* pRecvBody, int rcvdBodyLen, char* filePath);
 
        operator void*() const {
                return (mSupportedMsg==MSG_UNKNOWN_TYPE)? NULL:(void*) this;
index 3387743..7b6823d 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef MSG_SETTING_HANDLER_H
 #define MSG_SETTING_HANDLER_H
 /*==================================================================================================
                                        FUNCTION PROTOTYPES
 ==================================================================================================*/
-MSG_ERROR_T MsgInitSimConfig(MSG_SIM_STATUS_T SimStatus);
-
-MSG_ERROR_T MsgSetConfigData(const MSG_SETTING_S *pSetting);
-MSG_ERROR_T MsgGetConfigData(MSG_SETTING_S *pSetting);
-
-MSG_ERROR_T MsgSetGeneralOpt(const MSG_SETTING_S *pSetting);
-MSG_ERROR_T MsgSetSMSSendOpt(const MSG_SETTING_S *pSetting);
-MSG_ERROR_T MsgSetSMSCList(const MSG_SETTING_S *pSetting, bool bSetSim);
-MSG_ERROR_T MsgSetMMSSendOpt(const MSG_SETTING_S *pSetting);
-MSG_ERROR_T MsgSetMMSRecvOpt(const MSG_SETTING_S *pSetting);
-MSG_ERROR_T MsgSetMMSStyleOpt(const MSG_SETTING_S *pSetting);
-MSG_ERROR_T MsgSetPushMsgOpt(const MSG_SETTING_S *pSetting);
-MSG_ERROR_T MsgSetCBMsgOpt(const MSG_SETTING_S *pSetting, bool bSetSim);
-MSG_ERROR_T MsgSetVoiceMailOpt(const MSG_SETTING_S *pSetting);
-MSG_ERROR_T MsgSetMsgSizeOpt(const MSG_SETTING_S *pSetting);
+msg_error_t MsgInitSimConfig(MSG_SIM_STATUS_T SimStatus);
+
+msg_error_t MsgSetConfigData(const MSG_SETTING_S *pSetting);
+msg_error_t MsgGetConfigData(MSG_SETTING_S *pSetting);
+
+msg_error_t MsgSetGeneralOpt(const MSG_SETTING_S *pSetting);
+msg_error_t MsgSetSMSSendOpt(const MSG_SETTING_S *pSetting);
+msg_error_t MsgSetSMSCList(const MSG_SETTING_S *pSetting, bool bSetSim);
+msg_error_t MsgSetMMSSendOpt(const MSG_SETTING_S *pSetting);
+msg_error_t MsgSetMMSRecvOpt(const MSG_SETTING_S *pSetting);
+msg_error_t MsgSetMMSStyleOpt(const MSG_SETTING_S *pSetting);
+msg_error_t MsgSetPushMsgOpt(const MSG_SETTING_S *pSetting);
+msg_error_t MsgSetCBMsgOpt(const MSG_SETTING_S *pSetting, bool bSetSim);
+msg_error_t MsgSetVoiceMailOpt(const MSG_SETTING_S *pSetting);
+msg_error_t MsgSetMsgSizeOpt(const MSG_SETTING_S *pSetting);
 
 void MsgGetGeneralOpt(MSG_SETTING_S *pSetting);
 void MsgGetSMSSendOpt(MSG_SETTING_S *pSetting);
@@ -54,8 +54,9 @@ void MsgGetCBMsgOpt(MSG_SETTING_S *pSetting);
 void MsgGetVoiceMailOpt(MSG_SETTING_S *pSetting);
 void MsgGetMsgSizeOpt(MSG_SETTING_S *pSetting);
 
-MSG_ERROR_T MsgSetConfigInSim(const MSG_SETTING_S *pSetting);
+msg_error_t MsgSetConfigInSim(const MSG_SETTING_S *pSetting);
 
+//void MsgSetDefaultConfig();
 
 #endif
 
index 0313cc9..68d97fd 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef MSG_STORAGE_HANDLER_H
 #define MSG_STORAGE_HANDLER_H
 ==================================================================================================*/
 #include "MsgStorageTypes.h"
 #include "MsgSettingTypes.h"
+#include "MsgFilterTypes.h"
 #include "MsgMmsTypes.h"
 #include "MsgTransportTypes.h"
 #include "MsgInternalTypes.h"
 
-
 /*==================================================================================================
                                      FUNCTION PROTOTYPES
 ==================================================================================================*/
-MSG_ERROR_T MsgStoConnectDB();
-MSG_ERROR_T MsgStoDisconnectDB();
-
-MSG_ERROR_T MsgStoInitDB(bool bSimChanged);
-
-MSG_ERROR_T MsgCreateAddressTable();
-MSG_ERROR_T MsgCreateFolderTable();
-MSG_ERROR_T MsgCreateMsgTable();
-MSG_ERROR_T MsgCreateSimMessageTable();
-MSG_ERROR_T MsgCreateWAPMessageTable();
-MSG_ERROR_T MsgCreateCBMessageTable();
-MSG_ERROR_T MsgCreateSyncMLMessageTable();
-MSG_ERROR_T MsgCreateScheduledMessageTable();
-MSG_ERROR_T MsgCreateSmsSendOptTable();
-MSG_ERROR_T MsgCreateFilterTable();
-MSG_ERROR_T MsgCreateMmsMsgTable();
-MSG_ERROR_T MsgCreateMmsAttributeTable();
-MSG_ERROR_T MsgAddDefaultFolders();
-MSG_ERROR_T MsgAddDefaultAddress();
-MSG_ERROR_T MsgStoResetDatabase();
-
-MSG_ERROR_T MsgStoAddMessage(MSG_MESSAGE_INFO_S *pMsg, MSG_SENDINGOPT_INFO_S* pSendOptInfo, int addrIdx = 0);
-MSG_ERROR_T MsgStoUpdateMessage(MSG_MESSAGE_INFO_S *pMsg, MSG_SENDINGOPT_INFO_S* pSendOptInfo, int addrIdx = 0);
-MSG_ERROR_T MsgStoUpdateReadStatus(MSG_MESSAGE_ID_T MsgId, bool bRead);
-MSG_ERROR_T MsgStoUpdateThreadReadStatus(MSG_THREAD_ID_T ThreadId);
-MSG_ERROR_T MsgStoUpdateProtectedStatus(MSG_MESSAGE_ID_T MsgId, bool bProtected);
-MSG_ERROR_T MsgStoDeleteMessage(MSG_MESSAGE_ID_T MsgId, bool bCheckIndication);
-MSG_ERROR_T MsgStoDeleteAllMessageInFolder(MSG_FOLDER_ID_T FolderId, bool bOnlyDB, MSG_MSGID_LIST_S *pMsgIdList);
-MSG_ERROR_T MsgStoMoveMessageToFolder(MSG_MESSAGE_ID_T MsgId, MSG_FOLDER_ID_T DestFolderId);
-MSG_ERROR_T MsgStoMoveMessageToStorage(const MSG_MESSAGE_ID_T MsgId, const MSG_STORAGE_ID_T DestStorageId);
-MSG_ERROR_T MsgStoCountMessage(MSG_FOLDER_ID_T FolderId, MSG_COUNT_INFO_S *pCountInfo);
-MSG_ERROR_T MsgStoCountMsgByType(const MSG_MESSAGE_TYPE_S *pMsgType, int *pMsgCount);
-MSG_ERROR_T MsgStoGetMessage(MSG_MESSAGE_ID_T MsgId, MSG_MESSAGE_INFO_S *pMsg, MSG_SENDINGOPT_INFO_S* pSendOptInfo);
-MSG_ERROR_T MsgStoGetFolderViewList(MSG_FOLDER_ID_T FolderId, const MSG_SORT_RULE_S *pSortRule, MSG_LIST_S *pMsgFolderViewList);
-MSG_ERROR_T MsgStoAddSyncMLMessage(MSG_MESSAGE_INFO_S *pMsgInfo, int ExtId, int PinCode);
-MSG_ERROR_T MsgStoGetMsgType(MSG_MESSAGE_ID_T msgId, MSG_MESSAGE_TYPE_S* pMsgType);
-MSG_ERROR_T MsgStoGetText(MSG_MESSAGE_ID_T MsgId, char *pSubject, char *pMsgText);
-MSG_ERROR_T MsgStoGetQuickPanelData(MSG_QUICKPANEL_TYPE_T Type, MSG_MESSAGE_INFO_S *pMsg);
-MSG_ERROR_T MsgStoGetThreadViewList(const MSG_SORT_RULE_S *pSortRule, MSG_THREAD_VIEW_LIST_S *pThreadViewList);
-MSG_ERROR_T MsgStoGetConversationViewList(MSG_THREAD_ID_T ThreadId, MSG_LIST_S *pConvViewList);
-MSG_ERROR_T MsgStoDeleteThreadMessageList(MSG_THREAD_ID_T ThreadId, MSG_MSGID_LIST_S *pMsgIdList);
-MSG_ERROR_T MsgStoCountMsgByContact(const MSG_THREAD_LIST_INDEX_S *pAddrInfo, MSG_THREAD_COUNT_INFO_S *pThreadCountInfo);
-MSG_ERROR_T MsgStoSearchMessage(const char *pSearchString, MSG_THREAD_VIEW_LIST_S *pThreadViewList);
-MSG_ERROR_T MsgStoSearchMessage(const MSG_SEARCH_CONDITION_S *pSearchCon, int offset, int limit, MSG_LIST_S *pMsgList);
-MSG_ERROR_T MsgStoGetMsgIdList(MSG_REFERENCE_ID_T RefId, MSG_MSGID_LIST_S *pMsgIdList);
-MSG_ERROR_T MsgStoGetRejectMsgList(const char *pNumber, MSG_REJECT_MSG_LIST_S *pRejectMsgList);
-MSG_ERROR_T MsgStoGetReportStatus(MSG_MESSAGE_ID_T msgId, MSG_REPORT_STATUS_INFO_S* pReportStatus);
-MSG_ERROR_T MsgStoGetThreadUnreadCnt(MSG_THREAD_ID_T ThreadId, int *cnt);
+msg_error_t MsgStoConnectDB();
+msg_error_t MsgStoDisconnectDB();
+
+msg_error_t MsgStoInitDB(bool bSimChanged);
+
+msg_error_t MsgCreateConversationTable();
+msg_error_t MsgCreateAddressTable();
+msg_error_t MsgCreateFolderTable();
+msg_error_t MsgCreateMsgTable();
+msg_error_t MsgCreateSimMessageTable();
+msg_error_t MsgCreateWAPMessageTable();
+msg_error_t MsgCreateCBMessageTable();
+msg_error_t MsgCreateSyncMLMessageTable();
+msg_error_t MsgCreateSmsSendOptTable();
+msg_error_t MsgCreateFilterTable();
+msg_error_t MsgCreateMmsTable();
+msg_error_t MsgAddDefaultFolders();
+msg_error_t MsgAddDefaultAddress();
+msg_error_t MsgStoResetDatabase();
+
+msg_error_t MsgStoBackupMessage();
+msg_error_t MsgStoRestoreMessage();
+
+msg_error_t MsgStoAddMessage(MSG_MESSAGE_INFO_S *pMsg, MSG_SENDINGOPT_INFO_S* pSendOptInfo);
+msg_error_t MsgStoUpdateMessage(MSG_MESSAGE_INFO_S *pMsg, MSG_SENDINGOPT_INFO_S* pSendOptInfo);
+msg_error_t MsgStoUpdateReadStatus(msg_message_id_t MsgId, bool bRead);
+msg_error_t MsgStoUpdateThreadReadStatus(msg_thread_id_t ThreadId);
+msg_error_t MsgStoUpdateProtectedStatus(msg_message_id_t MsgId, bool bProtected);
+msg_error_t MsgStoDeleteMessage(msg_message_id_t MsgId, bool bCheckIndication);
+msg_error_t MsgStoDeleteAllMessageInFolder(msg_folder_id_t FolderId, bool bOnlyDB, msg_id_list_s *pMsgIdList);
+msg_error_t MsgStoMoveMessageToFolder(msg_message_id_t MsgId, msg_folder_id_t DestFolderId);
+msg_error_t MsgStoMoveMessageToStorage(const msg_message_id_t MsgId, const msg_storage_id_t DestStorageId);
+msg_error_t MsgStoCountMessage(msg_folder_id_t FolderId, MSG_COUNT_INFO_S *pCountInfo);
+msg_error_t MsgStoCountMsgByType(const MSG_MESSAGE_TYPE_S *pMsgType, int *pMsgCount);
+msg_error_t MsgStoGetMessage(msg_message_id_t MsgId, MSG_MESSAGE_INFO_S *pMsg, MSG_SENDINGOPT_INFO_S* pSendOptInfo);
+msg_error_t MsgStoGetFolderViewList(msg_folder_id_t FolderId, const MSG_SORT_RULE_S *pSortRule, msg_struct_list_s *pMsgFolderViewList);
+msg_error_t MsgStoAddSyncMLMessage(MSG_MESSAGE_INFO_S *pMsgInfo, int ExtId, int PinCode);
+msg_error_t MsgStoGetMsgType(msg_message_id_t msgId, MSG_MESSAGE_TYPE_S* pMsgType);
+msg_error_t MsgStoGetText(msg_message_id_t MsgId, char *pSubject, char *pMsgText);
+msg_error_t MsgStoGetQuickPanelData(msg_quickpanel_type_t Type, MSG_MESSAGE_INFO_S *pMsg);
+msg_error_t MsgStoGetThreadViewList(const MSG_SORT_RULE_S *pSortRule, msg_struct_list_s *pThreadViewList);
+msg_error_t MsgStoGetConversationViewList(msg_thread_id_t ThreadId, msg_struct_list_s *pConvViewList);
+msg_error_t MsgStoDeleteThreadMessageList(msg_thread_id_t ThreadId, msg_id_list_s *pMsgIdList);
+msg_error_t MsgStoCountMsgByContact(const MSG_THREAD_LIST_INDEX_S *pAddrInfo, MSG_THREAD_COUNT_INFO_S *pThreadCountInfo);
+msg_error_t MsgStoSearchMessage(const char *pSearchString, msg_struct_list_s *pThreadViewList);
+msg_error_t MsgStoSearchMessage(const MSG_SEARCH_CONDITION_S *pSearchCon, int offset, int limit, msg_struct_list_s *pMsgList);
+msg_error_t MsgStoGetRejectMsgList(const char *pNumber, msg_struct_list_s *pRejectMsgList);
+msg_error_t MsgStoGetReportStatus(msg_message_id_t msgId, MSG_REPORT_STATUS_INFO_S* pReportStatus);
+msg_error_t MsgStoGetThreadIdByAddress(const MSG_MESSAGE_INFO_S *pMsg, msg_thread_id_t *pThreadId);
+msg_error_t MsgStoGetThreadUnreadCnt(msg_thread_id_t ThreadId, int *cnt);
+msg_error_t MsgStoGetAddressList(const msg_thread_id_t threadId, msg_struct_list_s *pAddrList);
+msg_error_t MsgStoGetThreadInfo(msg_thread_id_t threadId, MSG_THREAD_VIEW_S *pThreadInfo);
+msg_error_t MsgStoGetMessageList(msg_folder_id_t folderId, msg_thread_id_t threadId, msg_message_type_t msgType, msg_storage_id_t storageId, msg_struct_list_s *pMsgList);
 
 // Folder
-MSG_ERROR_T MsgStoAddFolder(const MSG_FOLDER_INFO_S *pFolderInfo);
-MSG_ERROR_T MsgStoUpdateFolder(const MSG_FOLDER_INFO_S *pFolderInfo);
-MSG_ERROR_T MsgStoDeleteFolder(MSG_FOLDER_ID_T FolderId);
-MSG_ERROR_T MsgStoGetFolderList(MSG_FOLDER_LIST_S *pFolderList);
+msg_error_t MsgStoAddFolder(const MSG_FOLDER_INFO_S *pFolderInfo);
+msg_error_t MsgStoUpdateFolder(const MSG_FOLDER_INFO_S *pFolderInfo);
+msg_error_t MsgStoDeleteFolder(msg_folder_id_t FolderId);
+msg_error_t MsgStoGetFolderList(msg_struct_list_s *pFolderList);
+
+// Filter
+msg_error_t MsgStoAddFilter(const MSG_FILTER_S *pFilter);
+msg_error_t MsgStoUpdateFilter(const MSG_FILTER_S *pFilter);
+msg_error_t MsgStoDeleteFilter(msg_filter_id_t FilterId);
+msg_error_t MsgStoGetFilterList(msg_struct_list_s *pFilterList);
 
 // Sim Operation related Functions
-MSG_ERROR_T MsgInitSimMessage(MSG_SIM_STATUS_T SimStatus);
-MSG_ERROR_T MsgStoClearSimMessageInDB();
+msg_error_t MsgInitSimMessage(MSG_SIM_STATUS_T SimStatus);
+msg_error_t MsgStoClearSimMessageInDB();
 
 // Internal Function
-MSG_ERROR_T MsgMakeSortRule(const MSG_SORT_RULE_S *pSortRule, char *pSqlSort);
-MSG_ERROR_T MsgStoGetSmsSendOpt(MSG_MESSAGE_ID_T MsgId, MSG_SENDINGOPT_INFO_S* pSendOpt);
-MSG_ERROR_T MsgStoGetMmsSendOpt(MSG_MESSAGE_ID_T MsgId, MSG_SENDINGOPT_INFO_S* pSendOpt);
-
-// Scheduled Msg
-MSG_ERROR_T MsgStoAddScheduledMessage(MSG_MESSAGE_ID_T MsgID, int AlarmId, int ListenerFd);
-MSG_ERROR_T MsgStoGetScheduledMessage(int AlarmId, MSG_REQUEST_INFO_S *pReqInfo, int *pListenerFd);
-MSG_ERROR_T MsgStoDeleteScheduledMessage(MSG_MESSAGE_ID_T MsgId);
+msg_error_t MsgMakeSortRule(const MSG_SORT_RULE_S *pSortRule, char *pSqlSort);
+msg_error_t MsgStoGetSmsSendOpt(msg_message_id_t MsgId, MSG_SENDINGOPT_INFO_S* pSendOpt);
+msg_error_t MsgStoGetMmsSendOpt(msg_message_id_t MsgId, MSG_SENDINGOPT_INFO_S* pSendOpt);
 
 // SyncML Msg
-MSG_ERROR_T MsgStoGetSyncMLExtId(MSG_MESSAGE_ID_T msgId, int *extId);
-bool MsgStoCheckSyncMLMsgInThread(MSG_THREAD_ID_T threadId);
+msg_error_t MsgStoGetSyncMLExtId(msg_message_id_t msgId, int *extId);
+bool MsgStoCheckSyncMLMsgInThread(msg_thread_id_t threadId);
 
-MSG_ERROR_T MsgStoUpdateMMSMessage(MSG_MESSAGE_INFO_S *pMsg);
-MSG_ERROR_T MsgStoGetContentLocation(MSG_MESSAGE_INFO_S* pMsgInfo);
-MSG_ERROR_T MsgStoSetReadReportSendStatus(MSG_MESSAGE_ID_T msgId, int readReportSendStatus);
+msg_error_t MsgStoUpdateMMSMessage(MSG_MESSAGE_INFO_S *pMsg);
+msg_error_t MsgStoGetContentLocation(MSG_MESSAGE_INFO_S* pMsgInfo);
+msg_error_t MsgStoSetReadReportSendStatus(msg_message_id_t msgId, int readReportSendStatus);
 
 
 ///////////////////////////////////////////////////////////////////////////////////
-MSG_ERROR_T MsgStoGetOrgAddressList(MSG_MESSAGE_INFO_S *pMsg);
-MSG_ERROR_T MsgStoUpdateNetworkStatus(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_NETWORK_STATUS_T Status);
-MSG_ERROR_T MsgStoGetSubject(MSG_MESSAGE_ID_T MsgId, char* pSubject);
-MSG_ERROR_T MsgStoGetRecipientList(MSG_MESSAGE_ID_T msgId, MSG_RECIPIENTS_LIST_S *pRecipientList);
-MSG_ERROR_T MsgStoGetReadStatus(MSG_MESSAGE_ID_T MsgId, bool *pReadStatus);
-MSG_ERROR_T MsgStoGetAddrInfo(MSG_MESSAGE_ID_T MsgId, MSG_ADDRESS_INFO_S *pAddrInfo);
+// For MMS - will be removed
+msg_error_t MsgStoGetOrgAddressList(MSG_MESSAGE_INFO_S *pMsg);
+msg_error_t MsgStoUpdateNetworkStatus(MSG_MESSAGE_INFO_S *pMsgInfo, msg_network_status_t Status);
+msg_error_t MsgStoGetSubject(msg_message_id_t MsgId, char* pSubject);
+msg_error_t MsgStoGetRecipientList(msg_message_id_t msgId, MSG_RECIPIENTS_LIST_S *pRecipientList);
+msg_error_t MsgStoGetReadStatus(msg_message_id_t MsgId, bool *pReadStatus);
+msg_error_t MsgStoGetAddrInfo(msg_message_id_t MsgId, MSG_ADDRESS_INFO_S *pAddrInfo);
 
 ///////////////////////////////////////////////////////////////////////////////////
 
-MSG_ERROR_T MsgStoResetNetworkStatus();
-MSG_ERROR_T MsgStoCleanAbnormalMmsData();
-MSG_ERROR_T MsgStoCheckReadReportStatus(MSG_MESSAGE_ID_T msgId);
+msg_error_t MsgStoResetNetworkStatus();
+msg_error_t MsgStoCleanAbnormalMmsData();
+msg_error_t MsgStoCheckReadReportStatus(msg_message_id_t msgId);
 
 #endif // MSG_STORAGE_HANDLER_H
 
index 02b353b..c3f42b9 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef MSG_SUBMIT_HANDLER_H
 #define MSG_SUBMIT_HANDLER_H
 /*==================================================================================================
                                      FUNCTION PROTOTYPES
 ==================================================================================================*/
-MSG_ERROR_T MsgSubmitReq(MSG_REQUEST_INFO_S* pReq, bool bScheduled);
-MSG_ERROR_T MsgSubmitReqSMS(MSG_REQUEST_INFO_S *pReqInfo);
-MSG_ERROR_T MsgSubmitReqMMS(MSG_REQUEST_INFO_S *pReqInfo, bool bScheduled);
+msg_error_t MsgSubmitReq(MSG_REQUEST_INFO_S* pReq, bool bScheduled);
+msg_error_t MsgSubmitReqSMS(MSG_REQUEST_INFO_S *pReqInfo);
+msg_error_t MsgSubmitReqMMS(MSG_REQUEST_INFO_S *pReqInfo);
 
-MSG_ERROR_T MsgCancelReq(MSG_REQUEST_ID_T reqId);
-MSG_ERROR_T MsgUpdateSentMsg(MSG_MESSAGE_ID_T MsgId, MSG_NETWORK_STATUS_T Status);
+msg_error_t MsgCancelReq(msg_request_id_t reqId);
+msg_error_t MsgUpdateSentMsg(msg_message_id_t MsgId, msg_network_status_t Status);
 
 void MsgCopyReqInfo(MSG_REQUEST_INFO_S *pSrc, int addrIdx, MSG_REQUEST_INFO_S *pDest);
 
index 62bc504..554b7d6 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef MSG_TRANSACTION_MANAGER_H
 #define MSG_TRANSACTION_MANAGER_H
@@ -78,12 +78,12 @@ public:
 
        javamms_list& getJavaMMSList();
 
-       void broadcastIncomingMsgCB(const MSG_ERROR_T err, const MSG_MESSAGE_INFO_S *msgInfo);
-       void broadcastMMSConfCB(const MSG_ERROR_T err, const MSG_MESSAGE_INFO_S *msgInfo, const MMS_RECV_DATA_S *mmsRecvData);
-       void broadcastSyncMLMsgCB(const MSG_ERROR_T err, const MSG_SYNCML_MESSAGE_DATA_S *syncMLData);
-       void broadcastLBSMsgCB(const MSG_ERROR_T err, const MSG_LBS_MESSAGE_DATA_S *lbsData);
-       void broadcastSyncMLMsgOperationCB(const MSG_ERROR_T err, const int msgId, const int extId);
-       void broadcastStorageChangeCB(const MSG_ERROR_T err, const MSG_STORAGE_CHANGE_TYPE_T storageChangeType, const MSG_MSGID_LIST_S *pMsgIdList);
+       void broadcastIncomingMsgCB(const msg_error_t err, const MSG_MESSAGE_INFO_S *msgInfo);
+       void broadcastMMSConfCB(const msg_error_t err, const MSG_MESSAGE_INFO_S *msgInfo, const MMS_RECV_DATA_S *mmsRecvData);
+       void broadcastSyncMLMsgCB(const msg_error_t err, const MSG_SYNCML_MESSAGE_DATA_S *syncMLData);
+       void broadcastLBSMsgCB(const msg_error_t err, const MSG_LBS_MESSAGE_DATA_S *lbsData);
+       void broadcastSyncMLMsgOperationCB(const msg_error_t err, const int msgId, const int extId);
+       void broadcastStorageChangeCB(const msg_error_t err, const msg_storage_change_type_t storageChangeType, const msg_id_list_s *pMsgIdList);
 
        void setTMStatus();
        void getTMStatus();
diff --git a/include/mapi/MapiMessage.h b/include/mapi/MapiMessage.h
deleted file mode 100755 (executable)
index a4e5630..0000000
+++ /dev/null
@@ -1,4923 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-/**
- *     @file           MapiMessage.h
- *     @brief  Defines message data API of messaging framework
- *     @version        1.0
- */
-
-#ifndef MAPI_MESSAGE_H
-#define MAPI_MESSAGE_H
-
-/**
- *     @section                Introduction
- *     - Introduction : Overview on message data related API
- *     @section                Program
- *     - Program : message data related API Reference
- */
-
-/*==================================================================================================
-                                         INCLUDE FILES
-==================================================================================================*/
-
-#include "MsgTypes.h"
-#include "MsgMmsTypes.h"
-
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-/**
- *     @ingroup        MESSAGING_FRAMEWORK
- *     @defgroup       MESSAGING_DATA_API      Messaging Data API
- *     @{
- */
-
-/*==================================================================================================
-                                                                        FUNCTION PROTOTYPES
-==================================================================================================*/
-
-/**
-
- * \par Description:
- * Allocate the memory for new message, which is used for composing SMS or MMS.
- *
- * \par Purpose:
- * This API is used to create Message object and should be called before any operation on the message object.
- *
- * \par Typical use case:
- * Before performing common operations on Messages such as Send, Save, Load, etc., this API should be called to create the message object.
- *
- * \par Method of function operation:
- * Creates the Message Object and initiaizes the members to default values.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - The type msg_message_t represents message object and hides the details of message object.
- * - Memory for the Message abject need NOT be created by the called \n
- * - You can set or get the value of message object using the below APIs.
- * - You should release the memory using msg_release_message(), unless memory leaks.
- *
- * \param none.
- *
- * \return Return Type (msg_message_t) \n
- * - msg_message_t - valid message object is returned upon success \n
- * - NULL      - In case of error in allocation of message object \n
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * msg_message_t               msg;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * msg = msg_new_message();
- *
- * if (msg == NULL)
- * {
- *     sprintf(str, "msg_new_message() Fail");
- *     print(str);
- * }
- *
- * ...
- * \endcode
- */
-/*================================================================================================*/
-msg_message_t msg_new_message(void);
-
-
-/**
-
- * \par Description:
- * Free the memory of msg_message_t, which is created by msg_new_message().
- *
- * \par Purpose:
- * This API is used to release memory created by message creation.
- *
- * \par Typical use case:
- * After using message object for send/save scenario, release message need to be called.
- *
- * \par Method of function operation:
- * Frees the memory allocated to message object and deletes the object.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - None
- *
- * \param msg_message_t    input - message object to be destroyed .
- *
- * \return Return Type (int(MSG_ERROR_T)) \n
- * - MSG_SUCCESS       - Successfully connected to Messaging Service \n
- * - MSG_ERR_NULL_POINTER      -       Input parameter is NULL.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * msg_message_t               msg;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * msg = msg_new_message();
- * ...
- * err = msg_release_message(&msg);
- *
- * if (err != MSG_SUCCESS)
- * {
- *     sprintf(str, "msg_release_message() Fail [%d]", err);
- *     print(str);
- *
- *     return err; // if success, return OPERATION_SUCCESS. Or if fail, return related error code.
- * }
- *
- * ...
- * \endcode
- */
-/*================================================================================================*/
-int msg_release_message(msg_message_t *msg);
-
-
-
-/**
-
- * \par Description:
- * Set message id field to the passed msg_id.
- *
- * \par Purpose:
- * This API is used to set the Message Id of the message object
- *
- * \par Typical use case:
- * Explicitly set the msgId member of message object.
- *
- * \par Method of function operation:
- * Set the msgId member of msg_message_t to the passed msgId.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - If msg is NULL, no action is done
- * - If msg is invalid, behavior is undefined
- *
- * \param msg_message_t    input - message object whose msgId is to be set.
- * \param int    input - Message Id to be set to the message id.
- *
- * \return Return Type (int(MSG_ERROR_T)) \n
- * - MSG_SUCCESS       - Successfully connected to Messaging Service \n
- * - MSG_ERR_NULL_POINTER      -       Input parameter is NULL.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * msg_message_t               msg;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * msg_add_message(msgHandle, msg, &sendOpt);
- * ...
- * err = msg_set_message_id(msg, 0);
- * if (err != MSG_SUCCESS)
- * {
- *     sprintf(str, "msg_release_message() Fail [%d]", err);
- *     print(str);
- *
- *     return err; // if success, return OPERATION_SUCCESS. Or if fail, return related error code.
- * }
- * err = msg_release_message(&msg);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-int msg_set_message_id(msg_message_t msg, int msg_id);
-
-
-/**
-
- * \par Description:
- * Get the message id in message object.
- *
- * \par Purpose:
- * This API is used to get the Message Id of the message object
- *
- * \par Typical use case:
- * Msg Id is needed to perform many operations on the message object.
- *
- * \par Method of function operation:
- * Returns the Message Id of the message object.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - None
- *
- * \param msg_message_t    input - message object whose msgId is returned.
- *
- * \return Return Type (int(MSG_ERROR_T)) \n
- * - MSG_SUCCESS       - Successfully connected to Messaging Service \n
- * - MSG_ERR_NULL_POINTER      -       Input parameter is NULL.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * msg_message_t               msg;
- * int msgId;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * msg_add_message(msgHandle, msg, &sendOpt);
- * ...
- * msgId = msg_get_message_id(msg);
- * ...
- * err = msg_release_message(&msg);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-int msg_get_message_id(msg_message_t msg);
-
-
-/**
-
- * \par Description:
- * Check if the message object is an SMS Message
- *
- * \par Purpose:
- * This API is used to to check if the message object is SMS type message
- *
- * \par Typical use case:
- * To check if the message object type is SMS.
- *
- * \par Method of function operation:
- * Compares the message object against SMS message type.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - If msg is NULL, nothing happens.
- * - If msg is invalid, undefined behavior happens.
- *
- * \param msg_message_t    input - message object which is to be decided if its SMS.
- *
- * \return Return Type (bool) \n
- * - true      - If message object is SMS  \n
- * - false - If message object is not SMS.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * msg_message_t               msg;
- * int msgId;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * msg_add_message(msgHandle, msg, &sendOpt);
- * ...
- * if( msg_is_sms(msg) )
- * {
- *     sprintf(str, "Message object is SMS");
- *     print(str);
- * }
- *...
- * err = msg_release_message(&msg);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-bool msg_is_sms(msg_message_t msg);
-
-
-
-/**
-
- * \par Description:
- * Check if the message object is an MMS Message
- *
- * \par Purpose:
- * This API is used to to check if the message object is MMS type message
- *
- * \par Typical use case:
- * To check if the message object type is MMS.
- *
- * \par Method of function operation:
- * Compares the message object against MMS message type.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - None
- *
- * \param msg_message_t    input - message object which is to be decided if its MMS.
- *
- * \return Return Type (bool) \n
- * - true      - If message object is MMS  \n
- * - false - If message object is not MMS.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * msg_message_t               msg;
- * int msgId;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * msg_add_message(msgHandle, msg, &sendOpt);
- * ...
- * if( msg_is_mms(msg) )
- * {
- *     sprintf(str, "Message object is MMS");
- *     print(str);
- * }
- *...
- * err = msg_release_message(&msg);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-bool msg_is_mms(msg_message_t msg);
-
-
-/**
-
- * \par Description:
- * Set storage id field to the passed storage_id.
- *
- * \par Purpose:
- * This API is used to set the Storage Id of the message object
- *
- * \par Typical use case:
- * Message objects can be saved in either phone memory or SIM card, this API helps in setting the same.
- *
- * \par Method of function operation:
- * Set the storageId member of msg_message_t to the passed Storage Id.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - If msg is NULL, no action is done
- * - If msg is invalid, behavior is undefined
- *
- * \param msg_message_t    input - message object whose msgId is to be set.
- * \param MSG_STORAGE_ID_T    input - Storage Id to be set to the message storage id.
- *
- * \return Return Type (int(MSG_ERROR_T)) \n
- * - MSG_SUCCESS       - Successfully connected to Messaging Service \n
- * - MSG_ERR_NULL_POINTER      -       Input parameter is NULL.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * msg_message_t               msg;
- * MSG_STORAGE_ID_T storageId = 0;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * msg_add_message(msgHandle, msg, &sendOpt);
- * ...
- * err = msg_set_storage_id(msg, storageId);
- * if (err != MSG_SUCCESS)
- * {
- *     sprintf(str, "msg_set_storage_id() Fail [%d]", err);
- *     print(str);
- *
- *     return err; // if success, return OPERATION_SUCCESS. Or if fail, return related error code.
- * }
- * err = msg_release_message(&msg);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-int msg_set_storage_id(msg_message_t opq_msg, MSG_STORAGE_ID_T storage_id);
-
-
-/**
-
- * \par Description:
- * Gets storage id field of the message object.
- *
- * \par Purpose:
- * This API is used to get Storage Id of the message object
- *
- * \par Typical use case:
- *  * Message objects can be saved in either phone memory or SIM card, this API helps in getting the same.
- *
- * \par Method of function operation:
- * Returnsthe storageId member of msg_message_t.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - If msg is invalid, behavior is undefined
- *
- * \param msg_message_t    input - message object whose msgId is to be set.
- *
- * \return Return Type (int (MSG_ERROR_T when negative, enum _MSG_STORAGE_ID_E when positive)) \n
- * - storageId - Returns the storage Id defined by enum _MSG_STORAGE_ID_E. \n
- * - MSG_ERR_NULL_POINTER                      msg is NULL.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * msg_message_t               msg;
- * MSG_STORAGE_ID_T storageId = 0;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * msg_add_message(msgHandle, msg, &sendOpt);
- * ...
- * storageId = msg_get_storage_id(msg);
- *
- * sprintf(str, "msg_set_storage_id() storageId [%d]", storageId);
- * print(str);
- *
- * err = msg_release_message(&msg);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-int msg_get_storage_id(msg_message_t opq_msg);
-
-
-/**
-
- * \par Description:
- * Check if the message object is saved in SIM card
- *
- * \par Purpose:
- * This API is used to to check if the message object is saved in SIM card
- *
- * \par Typical use case:
- * Message can be stored in Phone memory or SIM card, to check this we can use this API.
- *
- * \par Method of function operation:
- * Checks if storage Id is SIM and returns boolean.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - None
- *
- * \param msg_message_t    input - message object.
- *
- * \return Return Type (bool) \n
- * - true      - If message object is stored in SIM  \n
- * - false - If message object is not stored in SIM.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * msg_message_t               msg;
- * int msgId;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * msg_add_message(msgHandle, msg, &sendOpt);
- * ...
- * if( msg_is_in_sim(msg) )
- * {
- *     sprintf(str, "Message object stored in SIM");
- *     print(str);
- * }
- *...
- * err = msg_release_message(&msg);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-bool msg_is_in_sim(msg_message_t msg);
-
-
-/**
-
- * \par Description:
- * Set the message type field to msg_type.
- *
- * \par Purpose:
- * This API is used to set the Message Type of the message object
- *
- * \par Typical use case:
- * Message Objects can be SMS, MMS, etc message types, this API helps to set the message type.
- *
- * \par Method of function operation:
- * Set the msgType member of msg_message_t to the passed msgType.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - If msg is NULL, no action is done
- * - If msg is invalid, behavior is undefined
- *
- * \param msg_message_t    input - message object whose msgId is to be set.
- * \param MSG_MESSAGE_TYPE_T    input - Message type to be set.
- *
- * \return Return Type (int(MSG_ERROR_T)) \n
- * - MSG_SUCCESS       - Successfully connected to Messaging Service \n
- * - MSG_ERR_NULL_POINTER      -       Input parameter is NULL.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * msg_message_t               msg;
- * MSG_ERROR_T err = MSG_SUCCESS;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * msg_add_message(msgHandle, msg, &sendOpt);
- * ...
- * err = msg_set_message_type(msg, MSG_TYPE_SMS);
- * if (err != MSG_SUCCESS)
- * {
- *     sprintf(str, "msg_set_message_type() Fail [%d]", err);
- *     print(str);
- *
- *     return err; // if success, return OPERATION_SUCCESS. Or if fail, return related error code.
- * }
- * err = msg_release_message(&msg);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-int msg_set_message_type(msg_message_t msg, MSG_MESSAGE_TYPE_T msg_type);
-
-
-/**
-
- * \par Description:
- * Gets Message type field of the message object.
- *
- * \par Purpose:
- * This API is used to get Message Type of the message object
- *
- * \par Typical use case:
- * Message Objects can be SMS, MMS, etc message types, this API helps to get the message type.
- *
- * \par Method of function operation:
- * Returns the msgType member of msg_message_t.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - If msg is invalid, behavior is undefined
- *
- * \param msg_message_t    input - message object whose msgType  is to be set.
- *
- * \return Return Type (int) \n
- * - msgType - Returns the Message type of the Message object passed \n
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * msg_message_t               msg;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * int  msgType = 0;
-
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * msg_add_message(msgHandle, msg, &sendOpt);
- * ...
- * msgType = msg_get_message_type(msg);
- *
- * sprintf(str, "msg_get_message_type() Type [%d]", msgType);
- * print(str);
- *
- * err = msg_release_message(&msg);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-int msg_get_message_type(msg_message_t msg);
-
-
-/**
-
- * \par Description:
- * Set the folder id field to folder_id.
- *
- * \par Purpose:
- * This API is used to sets the Folder Id of the message object
- *
- * \par Typical use case:
- * Message Objects can be associated with different folders such as Inbox, Outbox, Sent, etc. this API enables to set the folder id.
- *
- * \par Method of function operation:
- * Set the folderId member of msg_message_t to the passed folder_id.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - If msg is NULL, no action is done
- * - If msg is invalid, behavior is undefined
- *
- * \param msg_message_t    input - message object whose msgId is to be set.
- * \param MSG_FOLDER_ID_T    input - Folder Id to be set.
- *
- * \return Return Type (int(MSG_ERROR_T)) \n
- * - MSG_SUCCESS       - Successfully connected to Messaging Service \n
- * - MSG_ERR_NULL_POINTER      -       Input parameter is NULL.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * msg_message_t msg;
- * MSG_FOLDER_ID_T folder_id = MSG_INBOX_ID;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * msg_add_message(msgHandle, msg, &sendOpt);
- * ...
- * err = msg_set_folder_id(msg, folder_id);
- * if (err != MSG_SUCCESS)
- * {
- *     sprintf(str, "msg_set_folder_id() Fail [%d]", err);
- *     print(str);
- *
- *     return err; // if success, return OPERATION_SUCCESS. Or if fail, return related error code.
- * }
- * err = msg_release_message(&msg);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-int msg_set_folder_id(msg_message_t msg, MSG_FOLDER_ID_T folder_id);
-
-
-/**
-
- * \par Description:
- * Gets Folder Id field of the message object.
- *
- * \par Purpose:
- * This API is used to get Folder Id of the message object
- *
- * \par Typical use case:
- * Message Objects can be associated with different folders such as Inbox, Outbox, Sent, etc. this API enables to get the folder id.
- *
- * \par Method of function operation:
- * Returns the folderId member of msg_message_t.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - If msg is invalid, behavior is undefined
- *
- * \param msg_message_t    input - message object.
- *
- * \return Return Type (int) \n
- * - storageId - Returns the Folder Id of the Message object passed \n
- * - MSG_ERR_NULL_POINTER      -       Input parameter is NULL.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * msg_message_t msg;
- * int  folderId = 0;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * msg_add_message(msgHandle, msg, &sendOpt);
- * ...
- * folderId = msg_get_folder_id(msg);
- *
- * sprintf(str, "msg_get_folder_id() Folder Id [%d]", folderId);
- * print(str);
- *
- * err = msg_release_message(&msg);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-int msg_get_folder_id(msg_message_t msg);
-
-
-/**
-
- * \par Description:
- * Reset address field in message object.
- *
- * \par Purpose:
- * This API is used for modifying the message object, such as forwarding a message.
- *
- * \par Typical use case:
- * Message Object address field might be needed to reset. This API helps in the same.
- *
- * \par Method of function operation:
- * Flushes the already set address list and reset to defaults.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - None
- *
- * \param msg_message_t    input - message object.
- *
- * \return Return Type (bool) \n
- * - MSG_SUCCESS       - Successfully connected to Messaging Service \n
- * - MSG_ERR_NULL_POINTER      -       Input parameter is NULL.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * msg_message_t msg;
- * int msgId;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * msg = msg_new_message();
- * MSG_SENDINGOPT_S sendOpt = {0};
- * err = msg_get_message(msgHandle, (MSG_MESSAGE_ID_T)msgId, msg, &sendOpt);
- * err = msg_reset_address(msg);
- * if (err != MSG_SUCCESS)
- * {
- *     sprintf(str, "msg_release_message() Fail [%d]", err);
- *     print(str);
- *
- *     return err; // if success, return OPERATION_SUCCESS. Or if fail, return related error code.
- * }
- * ...
- * err = msg_release_message(&msg);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-int msg_reset_address(msg_message_t msg);
-
-
-/**
-
- * \par Description:
- * Add recipient address in message object.
- *
- * \par Purpose:
- * This API is used for adding address to the message object.
- *
- * \par Typical use case:
- * Message Object recipient address field should be filled before message can be sent over the network.
- *
- * \par Method of function operation:
- * The phone_num_list is added to the addressList member of the message object structure.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - None
- *
- * \param msg_message_t        input - message object.
- * \param phone_num_list       input - concatenated number string, which is separated by ",", such as "1112223333, 4445556666".
- * \param to_type                      input - to_type is one of enum _MSG_RECIPIENT_TYPE_E.
- *
- * \return Return Type (bool) \n
- * - MSG_SUCCESS       - Successfully connected to Messaging Service \n
- * - MSG_ERR_NULL_POINTER      -       Input parameter is NULL.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * msg_message_t msg;
- * int msgId;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * msg = msg_new_message();
- * MSG_SENDINGOPT_S sendOpt = {0};
- * err = msg_get_message(msgHandle, (MSG_MESSAGE_ID_T)msgId, msg, &sendOpt);
- * err = msg_add_address(msg, "+1004", MSG_RECIPIENTS_TYPE_TO);
- * if (err != MSG_SUCCESS)
- * {
- *     sprintf(str, "msg_release_message() Fail [%d]", err);
- *     print(str);
- *
- *     return err; // if success, return OPERATION_SUCCESS. Or if fail, return related error code.
- * }
- * ...
- * err = msg_release_message(&msg);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-int msg_add_address(msg_message_t msg, const char* phone_num_list, MSG_RECIPIENT_TYPE_T to_type);
-
-
-/**
-
- * \par Description:
- * Return count of recipient address in message object.
- *
- * \par Purpose:
- * This API is used for getting the count of recipient addresses in the message object.
- *
- * \par Typical use case:
- * To get the count of the recipient list in the message object.
- *
- * \par Method of function operation:
- * Returns the address count member of the message object..
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - None
- *
- * \param msg_message_t        input - message object.
- *
- * \return Return Type (int) \n
- * - recipient count \n
- * - MSG_ERR_NULL_POINTER      -       Input parameter is NULL.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * msg_message_t msg;
- * int nCount;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * msg = msg_new_message();
- * MSG_SENDINGOPT_S sendOpt = {0};
- * nCount = msg_get_address_count(msg);
- * sprintf(str, "msg_add_address() nCount [%d]", nCount);
- * print(str);
- * ...
- * err = msg_release_message(&msg);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-int msg_get_address_count(msg_message_t msg);
-
-
-/**
-
- * \par Description:
- * Return ith thread id in message object.
- *
- * \par Purpose:
- * This API is used for getting the ith thread id in message object.
- *
- * \par Typical use case:
- * Get the requested thread id from the message object.
- *
- * \par Method of function operation:
- * Returns the ith thread id from the message object address list.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - None
- *
- * \param msg_message_t        input - message object.
- * \param int                          input - thread id.
- *
- * \return Return Type (int) \n
- * - thread id \n
- * - MSG_ERR_NULL_POINTER      -       Input parameter is NULL.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * msg_message_t msg;
- * int nCount;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * err = msg_get_ith_thread_id(msg, 0);
- * if(err != MSG_SUCCESS)
- * {
- *     sprintf(str, "msg_get_ith_thread_id() Fail [%d]", err);
- *     print(str);
- *     return err; // if success, return OPERATION_SUCCESS. Or if fail, return related error code.
- * }
- * ...
- * err = msg_release_message(&msg);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-int msg_get_ith_thread_id(msg_message_t msg, int ith);
-
-
-/**
-
- * \par Description:
- * Return ith recipient address in message object.
- *
- * \par Purpose:
- * This API is used for getting the ith recipient address in message object.
- *
- * \par Typical use case:
- * To get the requested recipient address index from the message object.
- *
- * \par Method of function operation:
- * Returns the ith recipient address in address list from the message object.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - You do not need to free the return value. It will be freed when you call msg_release_message().
- * -   Also, the value is valid until msg_message_t is freed by calling msg_release_message().
- *
- * \param msg_message_t        input - message object.
- * \param int                          input - recipient address index.
- *
- * \return Return Type (int) \n
- * - thread id \n
- * - MSG_ERR_NULL_POINTER      -       Input parameter is NULL.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * msg_message_t msg;
- * const char* address;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * address = msg_get_ith_address(msg, 0);
- * if(address != NULL && strlen(address) > 0)
- * {
- *     sprintf(str, "msg_get_ith_address() address [%s]", address);
- *     print(str);
- * }
- * ...
- * err = msg_release_message(&msg);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-const char* msg_get_ith_address(msg_message_t msg, int ith);
-
-
-/**
-
- * \par Description:
- * Return ith recipient type in message object.
- *
- * \par Purpose:
- * This API is used for getting the ith recipient type in message object.
- *
- * \par Typical use case:
- * To get the requested recipient type from the message object.
- *
- * \par Method of function operation:
- * Returns the ith recipient type in address list from the message object.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - None
- *
- * \param msg_message_t        input - message object.
- * \param int                          input - recipient address index.
- *
- * \return Return Type (int) \n
- * - thread id \n
- * - MSG_ERR_NULL_POINTER      -       Input parameter is NULL.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * msg_message_t msg;
- * int r_type;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * r_type = msg_get_ith_recipient_type(msg, 0);
- * sprintf(str, "msg_get_ith_recipient_type() r_type [%s]", r_type);
- * print(str);
- * ...
- * err = msg_release_message(&msg);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-int msg_get_ith_recipient_type(msg_message_t msg, int ith);
-
-
-/**
-
- * \par Description:
- * Return ith recipient name which is associated with contact engine.
- *
- * \par Purpose:
- * This API is used for getting the ith recipient name which is associated with contact engine.
- *
- * \par Typical use case:
- * To get the requested recipient name from the message object which is associated with the contact engine.
- *
- * \par Method of function operation:
- * Returns the ith recipient name of the address list from the message object.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - You do not need to free the return value. It will be freed when you call msg_release_message().
- * - Also, the value is valid until msg_message_t is freed by calling msg_release_message().
- *
- * \param msg_message_t        input - message object.
- * \param int                          input - recipient address index.
- *
- * \return Return Type (int) \n
- * - thread id \n
- * - MSG_ERR_NULL_POINTER      -       Input parameter is NULL.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * msg_message_t msg;
- * const char* name;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * name = msg_get_ith_name(msg, 0);
- * if(name != NULL && strlen(name) > 0)
- * {
- *     sprintf(str, "msg_get_ith_recipient_type() name [%s]", name);
- *     print(str);
- * }
- * ...
- * err = msg_release_message(&msg);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-const char* msg_get_ith_name(msg_message_t msg, int ith);
-
-
-/**
-
- * \par Description:
- * Return ith recipient contact id which is associated with contact engine.
- *
- * \par Purpose:
- * This API is used for getting the ith recipient contact id which is associated with contact engine.
- *
- * \par Typical use case:
- * To get the requested recipient contact id from the message object which is associated with the contact engine.
- *
- * \par Method of function operation:
- * Returns the ith recipient contact id in address list from the message object.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - If msg is NULL, nothing happens.
- * - If msg is invalid, undefined behavior happens.
- *
- * \param msg_message_t        input - message object.
- * \param int                          input - recipient address index.
- *
- * \return Return Type (int) \n
- * - thread id \n
- * - MSG_ERR_NULL_POINTER      -       Input parameter is NULL.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * msg_message_t msg;
- * int contact_id;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- * ...
- * contact_id = msg_get_ith_contact_id(msg, 0);
- * sprintf(str, "msg_get_ith_contact_id() contact_id [%d]", contact_id);
- * print(str);
- * ...
- * err = msg_release_message(&msg);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-int msg_get_ith_contact_id(msg_message_t msg, int ith);
-
-
-/**
-
- * \par Description:
- * Add reply address in message object.
- *
- * \par Purpose:
- * This API is used for adding reply address to the message object.
- *
- * \par Typical use case:
- * Message Object reply address field should be filled before message can be sent over the network.
- *
- * \par Method of function operation:
- * The phone_num is set to the replyAddress of the message object structure.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - None
- *
- * \param msg_message_t        input - message object.
- * \param phone_num            input - phone number such as "1112223333, 4445556666".
- *
- * \return Return Type (bool) \n
- * - MSG_SUCCESS       - Successfully connected to Messaging Service \n
- * - MSG_ERR_NULL_POINTER      - Input parameter is NULL.
- * - MSG_ERR_INVALID_PARAMETER - Input parameter is too long.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * msg_message_t msg;
- * int msgId;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * msg = msg_new_message();
- * MSG_SENDINGOPT_S sendOpt = {0};
- * err = msg_get_message(msgHandle, (MSG_MESSAGE_ID_T)msgId, msg, &sendOpt);
- * err = msg_set_reply_address(msg, "+821030016057");
- * if (err != MSG_SUCCESS)
- * {
- *     sprintf(str, "msg_release_message() Fail [%d]", err);
- *     print(str);
- *
- *     return err; // if success, return OPERATION_SUCCESS. Or if fail, return related error code.
- * }
- * ...
- * err = msg_release_message(&msg);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-int msg_set_reply_address(msg_message_t opq_msg, const char* phone_num);
-
-
-/**
-
- * \par Description:
- * Set data field to mdata of size. SMS data is used for either of text or binary data.
- *
- * \par Purpose:
- * This API is used to set the Message data field of the message object to the passed mdata parameter of size bytes.
- *
- * \par Typical use case:
- * Message Object needs to be filled with the data member, in case of SMS data can be text or binary and in case of MMS data is the MIME encoded buffer.
- *
- * \par Method of function operation:
- * Copies "size" bytes of mdata to the pData member of the message object.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - If msg is NULL, no action is done
- * - If msg is invalid, behavior is undefined
- *
- * \param msg_message_t        input - message object whose msgId is to be set.
- * \param const char*                  input - data to be set.
- * \param int                          input - size of mdata to be set to message object
- *
- * \return Return Type (int(MSG_ERROR_T)) \n
- * - MSG_SUCCESS       - Successfully connected to Messaging Service \n
- * - MSG_ERR_NULL_POINTER      -       Input parameter is NULL.
- * - MSG_ERR_INVALID_PARAMETER                 class_type is not one of enum _MSG_CLASS_TYPE_E.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * msg_message_t msg;
- * const char *msg_body = "Sample Message Body";
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- * ...
- * msg = msg_new_message();
- *
- * ...
- * ...
- * err = msg_sms_set_message_body(msg, msg_body, strlen(msg_body));
- * if (err != MSG_SUCCESS)
- * {
- *     sprintf(str, "msg_sms_set_message_body() Fail [%d]", err);
- *     print(str);
- *
- *     return err; // if success, return OPERATION_SUCCESS. Or if fail, return related error code.
- * }
- * err = msg_release_message(&msg);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-int msg_sms_set_message_body(msg_message_t msg, const char* mdata, int size);
-
-
-/**
-
- * \par Description:
- * Return data field in message object. SMS data is used for either of text or binary data.
- *
- * \par Purpose:
- * This API is used for getting the data field of the message object.
- *
- * \par Typical use case:
- * Message Object needs to be filled with the data member, in case of SMS data can be text or binary and in case of MMS data is the MIME encoded buffer.
- *
- * \par Method of function operation:
- * Returns the storageId member of msg_message_t.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - If msg is invalid, behavior is undefined
- *
- * \param msg_message_t    input - message object whose msgId is to be set.
- *
- * \return Return Type (const char* (message body)) \n
- * - char array        - Message body data \n
- * - NULL              - Error.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * msg_message_t msg;
- * const char *msg_body;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * msg_message_t msg = msg_new_message();
- * MSG_SENDINGOPT_S sendOpt = {0, };
- * msg_get_message(hMsgHandle, 1, msg, &sendOpt);
- * ...
- * msg_body = msg_sms_get_message_body(msg);
- * if (msg_body != NULL && strlen(msg_body) > 0)
- * {
- *     sprintf(str, "msg_sms_set_message_body() msg_body [%s]", msg_body);
- *     print(str);
- * }
- * ..
- * err = msg_release_message(&msg);
- * ...
- * \endcode
- */
- /*================================================================================================*/
-const char* msg_sms_get_message_body(msg_message_t msg);
-
-
-/**
-
- * \par Description:
- * Return data field in message object. MMS data is used for text.
- *
- * \par Purpose:
- * This API is used for getting the data field of the message object.
- *
- * \par Typical use case:
- * Message Object needs to be filled with the data member, in case of SMS data can be text or binary and in case of MMS data is the MIME encoded buffer.
- *
- * \par Method of function operation:
- * Returns the storageId member of msg_message_t.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - If msg is invalid, behavior is undefined
- *
- * \param msg_message_t    input - message object whose msgId is to be set.
- *
- * \return Return Type (const char* (message body)) \n
- * - char array        - Message body data \n
- * - NULL              - Error.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * msg_message_t msg;
- * const char *msg_body;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * msg_message_t msg = msg_new_message();
- * MSG_SENDINGOPT_S sendOpt = {0, };
- * msg_get_message(hMsgHandle, 1, msg, &sendOpt);
- * ...
- * msg_body = msg_mms_get_text_contents(msg);
- * if (msg_body != NULL && strlen(msg_body) > 0)
- * {
- *     sprintf(str, "msg_mms_get_text_contents() msg_body [%s]", msg_body);
- *     print(str);
- * }
- * ..
- * err = msg_release_message(&msg);
- * ...
- * \endcode
- */
- /*================================================================================================*/
-const char* msg_mms_get_text_contents(msg_message_t msg);
-
-
-/**
-
- * \par Description:
- * Gets the size of data field in message object.
- *
- * \par Purpose:
- * This API is used for getting the size of data field in message object.
- *
- * \par Typical use case:
- * Size of the Message data field can be useful in various scenarios such as restrict sending large MMS, display size to user, etc.
- *
- * \par Method of function operation:
- * Returns the dataSize member of msg_message_t.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - If msg is invalid, behavior is undefined
- *
- * \param msg_message_t    input - message object.
- *
- * \return Return Type (int) \n
- * - int - Size of the data in the Message Object
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * msg_message_t msg;
- * int msg_body_size;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * msg_message_t msg = msg_new_message();
- * MSG_SENDINGOPT_S sendOpt = {0, };
- * msg_get_message(hMsgHandle, 1, msg, &sendOpt);
- * ...
- * msg_body_size = msg_get_message_body_size(msg);
- * sprintf(str, "msg_sms_set_message_body() msg_body_size [%d]", msg_body_size);
- * print(str);
- * ..
- * err = msg_release_message(&msg);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-int msg_get_message_body_size(msg_message_t msg);
-
-
-/**
-
- * \par Description:
- * Sets subject field of the message object to subject. This API is used for MMS.
- *
- * \par Purpose:
- * This API is used for setting the subject field of the message object
- *
- * \par Typical use case:
- * MMS message object may contain subject field, this API enables to set the same.
- *
- * \par Method of function operation:
- * Set the subject member of msg_message_t to the passed subject.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - If msg is NULL, no action is done
- * - If msg is invalid, behavior is undefined
- *
- * \param msg_message_t    input - message object whose msgId is to be set.
- * \param const char*    input - Subject to be set.
- *
- * \return Return Type (int(MSG_ERROR_T)) \n
- * - MSG_SUCCESS       - Successfully connected to Messaging Service \n
- * - MSG_ERR_NULL_POINTER      -       Input parameter is NULL.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * msg_message_t msg;
- * const char* subject = "Test Subject";
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * err = msg_set_subject(msg, subject);
- * if (err != MSG_SUCCESS)
- * {
- *     sprintf(str, "msg_set_subject() Fail [%d]", err);
- *     print(str);
- *
- *     return err; // if success, return OPERATION_SUCCESS. Or if fail, return related error code.
- * }
- * err = msg_release_message(&msg);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-int msg_set_subject(msg_message_t msg, const char* subject);
-
-
-/**
-
- * \par Description:
- * Returns the subject field of the message object. This API is used for MMS.
- *
- * \par Purpose:
- * This API is used for getting the subject field of the message object
- *
- * \par Typical use case:
- * MMS message object may contain subject field, this API enables to get the same.
- *
- * \par Method of function operation:
- * Returns the subject member of msg_message_t.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - If msg is invalid, behavior is undefined
- *
- * \param msg_message_t    input - message object.
- *
- * \return Return Type (const char*) \n
- * - const char        - MMS message subject \n
- * - NULL      -       Message object/Subject field is NULL.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * msg_message_t msg;
- * char* msg_subject;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * msg_message_t msg = msg_new_message();
- * MSG_SENDINGOPT_S sendOpt = {0, };
- * msg_get_message(hMsgHandle, 1, msg, &sendOpt);
- * ...
- * msg_subject = msg_get_subject(msg);
- * if(msg_subject != NULL && strlen(msg_subject) > 0)
- * {
- *     sprintf(str, "msg_get_subject() msg_subject [%s]", msg_subject);
- *     print(str);
- * }
- * ..
- * err = msg_release_message(&msg);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-const char* msg_get_subject(msg_message_t msg);
-
-
-/**
-
- * \par Description:
- * Set time field to msg_time of the message object. \n
- * If you need to update time in message object, use this API with passing time() in time.h.
- *
- * \par Purpose:
- * This API is used for setting the message time of the message object
- *
- * \par Typical use case:
- * Message object should contain the time field before it is sent over the network.
- *
- * \par Method of function operation:
- * Set the msg_time member of msg_message_t to the passed msg_time.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - If msg is NULL, no action is done
- * - If msg is invalid, behavior is undefined
- *
- * \param msg_message_t    input - message object whose msgId is to be set.
- * \param const char*    input - Subject to be set.
- *
- * \return Return Type (int(MSG_ERROR_T)) \n
- * - MSG_SUCCESS       - Successfully connected to Messaging Service \n
- * - MSG_ERR_NULL_POINTER      -       Input parameter is NULL.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * msg_message_t msg;
- * time_t curTime = time(NULL);
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
-* msg = msg_new_message();
-* err = msg_set_time(msgInfo, curTime);
- * if (err != MSG_SUCCESS)
- * {
- *     sprintf(str, "msg_set_time() Fail [%d]", err);
- *     print(str);
- *
- *     return err; // if success, return OPERATION_SUCCESS. Or if fail, return related error code.
- * }
- * err = msg_release_message(&msg);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-int msg_set_time(msg_message_t msg, time_t msg_time);
-
-
-/**
-
- * \par Description:
- * Return the time field in message object.
- *
- * \par Purpose:
- * This API is used for getting the time field of the message object
- *
- * \par Typical use case:
- * Message object should contain the time field before it is sent over the network.
- *
- * \par Method of function operation:
- * Returns the msg_time member of msg_message_t.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - If msg is invalid, behavior is undefined
- *
- * \param msg_message_t    input - message object.
- *
- * \return Return Type (time_t) \n
- * - time_t - Message time value \n
- * - NULL       - Message object is NULL.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * msg_message_t msg;
- * time_t msg_time;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * msg_message_t msg = msg_new_message();
- * MSG_SENDINGOPT_S sendOpt = {0, };
- * msg_get_message(hMsgHandle, 1, msg, &sendOpt);
- * ...
- * msg_time = msg_get_time(msg);
- * sprintf(str, "msg_get_time() msg_time [%s]", ctime(msg_time));
- * print(str);
- * ..
- * err = msg_release_message(&msg);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-time_t* msg_get_time(msg_message_t msg);
-
-
-/**
-
- * \par Description:
- * Set network status to status. Network status represents the status result when you send/receive the message.
- *
- * \par Purpose:
- * This API is used for setting the network status field of the message object
- *
- * \par Typical use case:
- *  Network status represents the status result when you send/receive the message.
- *
- * \par Method of function operation:
- * Set the networkStatus member of msg_message_t to the passed status.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - If msg is NULL, no action is done
- * - If msg is invalid, behavior is undefined
- *
- * \param msg_message_t    input - message object whose msgId is to be set.
- * \param int    input - status is one of enum _MSG_NETWORK_STATUS_E.
- *
- * \return Return Type (int(MSG_ERROR_T)) \n
- * - MSG_SUCCESS       - Successfully connected to Messaging Service \n
- * - MSG_ERR_NULL_POINTER      -       Input parameter is NULL.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * msg_message_t msg;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * err= msg_set_network_status(msg, MSG_NETWORK_SEND_SUCCESS);
- * if (err != MSG_SUCCESS)
- * {
- *     sprintf(str, "msg_set_network_status() Fail [%d]", err);
- *     print(str);
- *
- *     return err; // if success, return OPERATION_SUCCESS. Or if fail, return related error code.
- * }
- * err = msg_release_message(&msg);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-int msg_set_network_status(msg_message_t msg, MSG_NETWORK_STATUS_T status);
-
-
-/**
-
- * \par Description:
- * Returns the network status of message object. Network status represents the status result when you send/receive the message.
- *
- * \par Purpose:
- * This API is used for getting the networkStatus field of the message object
- *
- * \par Typical use case:
- *  Network status represents the status result when you send/receive the message.
- *
- * \par Method of function operation:
- * Returns the networkStatus member of msg_message_t.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - If msg is invalid, behavior is undefined
- *
- * \param msg_message_t    input - message object.
- *
- * \return Return Type (int (MSG_ERROR_T when negative, enum _MSG_NETWORK_STATUS_E when positive)) \n
- * - positive int                                              enum _MSG_NETWORK_STATUS_E.
- * - MSG_ERR_NULL_POINTER                              msg is NULL.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * msg_message_t msg;
- * int network_status;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * msg_message_t msg = msg_new_message();
- * MSG_SENDINGOPT_S sendOpt = {0, };
- * msg_get_message(hMsgHandle, 1, msg, &sendOpt);
- * ...
- * network_status = msg_get_network_status(msg);
- *sprintf(str, "msg_get_network_status() network_status [%d]", network_status);
- * print(str);
- * ..
- * err = msg_release_message(&msg);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-int msg_get_network_status(msg_message_t msg);
-
-
-/**
-
- * \par Description:
- * Set message data encode type to encoding_type. The message data is encoded with one of GSM-7, ascii, ucs2, or auto.
- *
- * \par Purpose:
- * This API is used for setting the encode type field of the message object
- *
- * \par Typical use case:
- * The message data is encoded with one of GSM-7, ascii, ucs2, or auto.
- *
- * \par Method of function operation:
- * Set the encodeType member of msg_message_t to the passed encoding_type.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - If msg is NULL, no action is done
- * - If msg is invalid, behavior is undefined
- *
- * \param msg_message_t    input - message object.
- * \param MSG_ENCODE_TYPE_T    input - encode type to be set.
- *
- * \return Return Type (int(MSG_ERROR_T)) \n
- * - MSG_SUCCESS       - Successfully connected to Messaging Service \n
- * - MSG_ERR_NULL_POINTER      -       Input parameter is NULL.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * msg_message_t msg;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * err = msg_set_encode_type(msgInfo, MSG_ENCODE_GSM7BIT);
- * if (err != MSG_SUCCESS)
- * {
- *     sprintf(str, "msg_set_encode_type() Fail [%d]", err);
- *     print(str);
- *
- *     return err; // if success, return OPERATION_SUCCESS. Or if fail, return related error code.
- * }
- * err = msg_release_message(&msg);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-int msg_set_encode_type(msg_message_t msg, MSG_ENCODE_TYPE_T encoding_type);
-
-
-/**
-
- * \par Description:
- * Return message data encode type. The message data is encoded with one of GSM-7, ascii, ucs2, or auto.
- *
- * \par Purpose:
- * This API is used for getting the encode type field of the message object
- *
- * \par Typical use case:
- *  The message data is encoded with one of GSM-7, ascii, ucs2, or auto.
- *
- * \par Method of function operation:
- * Returns the encodeType member of msg_message_t.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - If msg is invalid, behavior is undefined
- *
- * \param msg_message_t    input - message object.
- *
- * \return Return Type (int) \n
- * - positive int                                              enum MSG_ENCODE_TYPE_T.
- * - MSG_ERR_NULL_POINTER                              msg is NULL.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * msg_message_t msg;
- * int encode_type;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * msg_message_t msg = msg_new_message();
- * MSG_SENDINGOPT_S sendOpt = {0, };
- * msg_get_message(hMsgHandle, 1, msg, &sendOpt);
- * ...
- * encode_type = msg_get_encode_type(msg);
- * sprintf(str, "msg_get_network_status() encode_type [%d]", encode_type);
- * print(str);
- * ..
- * err = msg_release_message(&msg);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-int msg_get_encode_type(msg_message_t msg);
-
-
-/**
-
- * \par Description:
- * Set message read status to read_flag.
- *
- * \par Purpose:
- * This API is used to set read status to bRead field of the message object
- *
- * \par Typical use case:
- * Read status can be set using this API.
- *
- * \par Method of function operation:
- * Set the bRead member of msg_message_t to the passed read_flag.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - If msg is NULL, no action is done
- * - If msg is invalid, behavior is undefined
- *
- * \param msg_message_t    input - message object.
- * \param bool    input - read status to be set.
- *
- * \return Return Type (int(MSG_ERROR_T)) \n
- * - MSG_SUCCESS       - Successfully connected to Messaging Service \n
- * - MSG_ERR_NULL_POINTER      -       Input parameter is NULL.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * msg_message_t msg;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * err = msg_set_read_status(msg, true);
- * if (err != MSG_SUCCESS)
- * {
- *     sprintf(str, "msg_set_read_status() Fail [%d]", err);
- *     print(str);
- *
- *     return err; // if success, return OPERATION_SUCCESS. Or if fail, return related error code.
- * }
- * ...
- * err = msg_release_message(&msg);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-int msg_set_read_status(msg_message_t msg, bool read_flag);
-
-
-/**
-
- * \par Description:
- * Return true if the message is read.
- *
- * \par Purpose:
- * This API is used to check if the message object is read.
- *
- * \par Typical use case:
- * Read status can be checked using this API.
- *
- * \par Method of function operation:
- * Checks if message object is read and returns bool.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - None
- *
- * \param msg_message_t    input - message object.
- *
- * \return Return Type (bool) \n
- * - true      - If message object is read \n
- * - false - If message object is not read.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * msg_message_t msg;
- * int msgId;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * if( msg_is_read(msgInfo) )
- * {
- *     sprintf(str, "Message object is read");
- *     print(str);
- * }
- *...
- * err = msg_release_message(&msg);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-bool msg_is_read(msg_message_t msg);
-
-
-/**
-
- * \par Description:
- * Set message protect status to protect_flag.
- *
- * \par Purpose:
- * This API is used to set message protect status to protect_flag.
- *
- * \par Typical use case:
- * Message protect status can be set using this API.
- *
- * \par Method of function operation:
- * Set the bProtected member of msg_message_t to the passed protect_flag.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - If msg is NULL, no action is done
- * - If msg is invalid, behavior is undefined
- *
- * \param msg_message_t    input - message object.
- * \param bool    input - protect status to be set.
- *
- * \return Return Type (int(MSG_ERROR_T)) \n
- * - MSG_SUCCESS       - Successfully connected to Messaging Service \n
- * - MSG_ERR_NULL_POINTER      -       Input parameter is NULL.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * msg_message_t msg;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * err = msg_set_protect_status(msg, true);
- * if (err != MSG_SUCCESS)
- * {
- *     sprintf(str, "msg_set_protect_status() Fail [%d]", err);
- *     print(str);
- *
- *     return err; // if success, return OPERATION_SUCCESS. Or if fail, return related error code.
- * }
- * ...
- * err = msg_release_message(&msg);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-int msg_set_protect_status(msg_message_t msg, bool protect_flag);
-
-
-/**
-
- * \par Description:
- * Return true if the message is protected.
- *
- * \par Purpose:
- * This API is used to check if the message object is protected.
- *
- * \par Typical use case:
- * Protected status can be checked using this API.
- *
- * \par Method of function operation:
- * Checks if message object is protected and returns bool.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - None
- *
- * \param msg_message_t    input - message object.
- *
- * \return Return Type (bool) \n
- * - true      - If message object is protected \n
- * - false - If message object is not protected.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * msg_message_t msg;
- * int msgId;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * if( msg_is_protected(msgInfo) )
- * {
- *     sprintf(str, "Message object is protected");
- *     print(str);
- * }
- *...
- * err = msg_release_message(&msg);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-bool msg_is_protected(msg_message_t msg);
-
-
-/**
-
- * \par Description:
- * Set message backup status to backup_flag.
- *
- * \par Purpose:
- * This API is used to set message backup status to backup_flag.
- *
- * \par Typical use case:
- * Message backup status can be set using this API.
- *
- * \par Method of function operation:
- * Set the bBackup member of msg_message_t to the passed backup_flag.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - If msg is NULL, no action is done
- * - If msg is invalid, behavior is undefined
- *
- * \param msg_message_t    input - message object.
- * \param bool    input - backup status to be set.
- *
- * \return Return Type (int(MSG_ERROR_T)) \n
- * - MSG_SUCCESS       - Successfully connected to Messaging Service \n
- * - MSG_ERR_NULL_POINTER      -       Input parameter is NULL.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * msg_message_t msg;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * err = msg_set_backup_status(msg, true);
- * if (err != MSG_SUCCESS)
- * {
- *     sprintf(str, "msg_set_backup_status() Fail [%d]", err);
- *     print(str);
- *
- *     return err; // if success, return OPERATION_SUCCESS. Or if fail, return related error code.
- * }
- * ...
- * err = msg_release_message(&msg);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-int msg_set_backup_status(msg_message_t opq_msg, bool backup_flag);
-
-
-/**
-
- * \par Description:
- * Return true if the message is a backup.
- *
- * \par Purpose:
- * This API is used to check if the message object is a backup.
- *
- * \par Typical use case:
- * Backup status can be checked using this API.
- *
- * \par Method of function operation:
- * Checks if message object is a backup and returns bool.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - None
- *
- * \param msg_message_t    input - message object.
- *
- * \return Return Type (bool) \n
- * - true      - If message object is a backup \n
- * - false - If message object is not a backup.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * msg_message_t msg;
- * int msgId;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * if( msg_is_backup(msgInfo) )
- * {
- *     sprintf(str, "Message object is a backup");
- *     print(str);
- * }
- *...
- * err = msg_release_message(&msg);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-bool msg_is_backup(msg_message_t opq_msg);
-
-
-/**
-
- * \par Description:
- * Set message priority to priority.
- *
- * \par Purpose:
- * This API is used to set message priority to priority.
- *
- * \par Typical use case:
- * Message priority can be set using this API.
- *
- * \par Method of function operation:
- * Set the priority member of msg_message_t to the passed priority.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - If msg is NULL, no action is done
- * - If msg is invalid, behavior is undefined
- *
- * \param msg_message_t    input - message object.
- * \param bool    input - priority status to be set.
- *
- * \return Return Type (int(MSG_ERROR_T)) \n
- * - MSG_SUCCESS       - Successfully connected to Messaging Service \n
- * - MSG_ERR_NULL_POINTER      -       Input parameter is NULL.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * msg_message_t msg;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * err = msg_set_priority_info(msgInfo, MSG_MESSAGE_PRIORITY_NORMAL);
- * if (err != MSG_SUCCESS)
- * {
- *     sprintf(str, "msg_set_priority_info() Fail [%d]", err);
- *     print(str);
- *
- *     return err; // if success, return OPERATION_SUCCESS. Or if fail, return related error code.
- * }
- * ...
- * err = msg_release_message(&msg);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-int msg_set_priority_info(msg_message_t msg, MSG_PRIORITY_TYPE_T priority);
-
-
-/**
-
- * \par Description:
- * Return priority value in message object.
- *
- * \par Purpose:
- * This API is used for getting the priority field of the message object
- *
- * \par Typical use case:
- * Message priority can be got using this API.
- *
- * \par Method of function operation:
- * Returns the priority member of msg_message_t.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - If msg is invalid, behavior is undefined
- *
- * \param msg_message_t    input - message object.
- *
- * \return Return Type int (MSG_ERROR_T when negative, enum _MSG_PRIORITY_TYPE_E) \n
- * - positive int                                              enum _MSG_PRIORITY_TYPE_E.
- * - MSG_ERR_NULL_POINTER                              msg is NULL.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * msg_message_t msg;
- * int priority;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * msg_message_t msg = msg_new_message();
- * MSG_SENDINGOPT_S sendOpt = {0, };
- * msg_get_message(hMsgHandle, 1, msg, &sendOpt);
- * ...
- * priority = msg_get_priority_info(msg);
- * sprintf(str, "msg_get_priority_info() priority [%d]", priority);
- * print(str);
- * ..
- * err = msg_release_message(&msg);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-int msg_get_priority_info(msg_message_t msg);
-
-
-/**
-
- * \par Description:
- * Set message direction to direction.
- *
- * \par Purpose:
- * This API is used to set message direction to direction.
- *
- * \par Typical use case:
- * Message direction can be set using this API.
- *
- * \par Method of function operation:
- * Set the direction member of msg_message_t to the passed direction.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - If msg is NULL, no action is done
- * - If msg is invalid, behavior is undefined
- *
- * \param msg_message_t    input - message object.
- * \param int    input - defined in enum _MSG_DIRECTION_TYPE_E.
- *
- * \return Return Type (int(MSG_ERROR_T)) \n
- * - MSG_SUCCESS       - Successfully connected to Messaging Service \n
- * - MSG_ERR_NULL_POINTER      -       Input parameter is NULL.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * msg_message_t msg;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * err = msg_set_direction_info(msgInfo, MSG_DIRECTION_TYPE_MT);
- * if (err != MSG_SUCCESS)
- * {
- *     sprintf(str, "msg_set_direction_info() Fail [%d]", err);
- *     print(str);
- *
- *     return err; // if success, return OPERATION_SUCCESS. Or if fail, return related error code.
- * }
- * ...
- * err = msg_release_message(&msg);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-int msg_set_direction_info(msg_message_t msg, MSG_DIRECTION_TYPE_T direction);
-
-
-/**
-
- * \par Description:
- * Return direction information in message object.
- *
- * \par Purpose:
- * This API is used for getting the direction information in message object.
- *
- * \par Typical use case:
- * Message direction can be got using this API.
- *
- * \par Method of function operation:
- * Returns the direction member of msg_message_t.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - If msg is invalid, behavior is undefined
- *
- * \param msg_message_t    input - message object.
- *
- * \return Return Type int (MSG_ERROR_T when negative, enum _MSG_DIRECTION_TYPE_E when positive) \n
- * - positive int                                              enum _MSG_DIRECTION_TYPE_E.
- * - MSG_ERR_NULL_POINTER                              msg is NULL.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * msg_message_t msg;
- * int direction;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * msg_message_t msg = msg_new_message();
- * MSG_SENDINGOPT_S sendOpt = {0, };
- * msg_get_message(hMsgHandle, 1, msg, &sendOpt);
- * ...
- * direction = msg_get_direction_info(msg);
- * sprintf(str, "msg_get_direction_info() direction [%d]", direction);
- * print(str);
- * ..
- * err = msg_release_message(&msg);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-int msg_get_direction_info(msg_message_t msg);
-
-
-/**
-
- * \par Description:
- * Set message port to dst_prt and src_port.
- *
- * \par Purpose:
- * This API is used to set message port to dst_prt and src_port.
- *
- * \par Typical use case:
- * Message source and destinatin ports are used in case of Push message.
- *
- * \par Method of function operation:
- * Set the msgPort member of msg_message_t to the passed source and destination port.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - If msg is NULL, no action is done
- * - If msg is invalid, behavior is undefined
- *
- * \param msg_message_t    input - message object.
- * \param src_port is the port of origin.
- * \param dst_port is the destination port for recipient.
- *
- * \return Return Type (int(MSG_ERROR_T)) \n
- * - MSG_SUCCESS       - Successfully connected to Messaging Service \n
- * - MSG_ERR_NULL_POINTER      -       Input parameter is NULL.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * msg_message_t msg;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * err = msg_set_port(msg, 656, 656);
- * if (err != MSG_SUCCESS)
- * {
- *     sprintf(str, "msg_set_port() Fail [%d]", err);
- *     print(str);
- *
- *     return err; // if success, return OPERATION_SUCCESS. Or if fail, return related error code.
- * }
- * ...
- * err = msg_release_message(&msg);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-int msg_set_port(msg_message_t msg, unsigned short dst_port, unsigned short src_port);
-
-
-/**
-
- * \par Description:
- * Return destination port number in message object.
- *
- * \par Purpose:
- * This API is used for getting destination port number in message object.
- *
- * \par Typical use case:
- * Recipient destinatin port be got using this API.
- *
- * \par Method of function operation:
- * Returns the destination port  from msgPort member of msg_message_t.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - If msg is invalid, behavior is undefined
- *
- * \param msg_message_t    input - message object.
- *
- * \return Return Type (int (MSG_ERROR_T when negative, destination port number when positive)) \n
- * - positive int                                              Destination port
- * - MSG_ERR_NULL_POINTER                              msg is NULL.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * msg_message_t msg;
- * int dest_port;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * msg_message_t msg = msg_new_message();
- * MSG_SENDINGOPT_S sendOpt = {0, };
- * msg_get_message(hMsgHandle, 1, msg, &sendOpt);
- * ...
- * dest_port = msg_get_dest_port(msg);
- * sprintf(str, "msg_get_dest_port() dest_port [%d]", dest_port);
- * print(str);
- * ..
- * err = msg_release_message(&msg);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-int msg_get_dest_port(msg_message_t msg);
-
-
-/**
-
- * \par Description:
- * Return source port number in message object.
- *
- * \par Purpose:
- * This API is used for getting source port number in message object.
- *
- * \par Typical use case:
- * Recipient source port be got using this API.
- *
- * \par Method of function operation:
- * Returns the source port  from msgPort member of msg_message_t.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - If msg is invalid, behavior is undefined
- *
- * \param msg_message_t    input - message object.
- *
- * \return Return Type int (MSG_ERROR_T when negative, destination port number when positive) \n
- * - positive int                                              source port.
- * - MSG_ERR_NULL_POINTER                              msg is NULL.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * msg_message_t msg;
- * int source_port;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * msg_message_t msg = msg_new_message();
- * MSG_SENDINGOPT_S sendOpt = {0, };
- * msg_get_message(hMsgHandle, 1, msg, &sendOpt);
- * ...
- * source_port = msg_get_src_port(msg);
- * sprintf(str, "msg_get_src_port() source_port [%d]", source_port);
- * print(str);
- * ..
- * err = msg_release_message(&msg);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-int msg_get_src_port(msg_message_t msg);
-
-
-/**
-
- * \par Description:
- * Set scheduled time to time_to_send, which is used for scheduled send.
- *
- * \par Purpose:
- * This API is used to set scheduled time to time_to_send, which is used for scheduled send.
- *
- * \par Typical use case:
- * Used to set Schedule Message feature on Message object
- *
- * \par Method of function operation:
- * Set the scheduledTime member of msg_message_t to the passed time_to_send.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - If msg is NULL, no action is done
- * - If msg is invalid, behavior is undefined
- *
- * \param msg_message_t    input - message object.
- * \param int    input - defined in enum _MSG_DIRECTION_TYPE_E.
- *
- * \return Return Type (int(MSG_ERROR_T)) \n
- * - MSG_SUCCESS       - Successfully connected to Messaging Service \n
- * - MSG_ERR_NULL_POINTER      -       Input parameter is NULL.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * msg_message_t msg;
- * time_t scheduledTime;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * time(&scheduledTime);
- *
- * err = msg_set_scheduled_time(msgInfo, scheduledTime);
- * if (err != MSG_SUCCESS)
- * {
- *     sprintf(str, "msg_set_scheduled_time() Fail [%d]", err);
- *     print(str);
- *
- *     return err; // if success, return OPERATION_SUCCESS. Or if fail, return related error code.
- * }
- * ...
- * err = msg_release_message(&msg);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-int msg_set_scheduled_time(msg_message_t msg, time_t time_to_send);
-
-
-
-/**
-
- * \par Description:
- * Return pointer to scheduled time in message object, which can be used for ctime(time_t*) parameter
- *
- * \par Purpose:
- * This API is used for getting the scheduled time in message object.
- *
- * \par Typical use case:
- * Used to get Schedule Message feature on Message object
- *
- * \par Method of function operation:
- * Returns the scheduledTime member of msg_message_t.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - If msg is invalid, behavior is undefined
- *
- * \param msg_message_t    input - message object.
- *
- * \return Return Type time_t \n
- * - time_t                                            Message scheduled time.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * msg_message_t msg;
- * time_t time_to_send;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * msg_message_t msg = msg_new_message();
- * MSG_SENDINGOPT_S sendOpt = {0, };
- * msg_get_message(hMsgHandle, 1, msg, &sendOpt);
- * ...
- * time_to_send = msg_get_scheduled_time(msg);
- * sprintf(str, "msg_get_scheduled_time() time_to_send [%d]", time_to_send);
- * print(str);
- * ..
- * err = msg_release_message(&msg);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-time_t* msg_get_scheduled_time(msg_message_t msg);
-
-
-
-/**
-
- * \par Description:
- * Get attachment count from MMS message.
- *
- * \par Purpose:
- * This API is used for getting the attachment count in message object.
- *
- * \par Typical use case:
- * Used to get attachment count feature on Message object
- *
- * \par Method of function operation:
- * Returns the attachCount member of msg_message_t.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - If msg is invalid, behavior is undefined
- *
- * \param msg_message_t    input - message object.
- *
- * \return Return Type int \n
- * - int                                               Message attachment count.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * msg_message_t msg;
- * int attach_count;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * msg_message_t msg = msg_new_message();
- * MSG_SENDINGOPT_S sendOpt = {0, };
- * msg_get_message(hMsgHandle, 1, msg, &sendOpt);
- * ...
- * attach_count = msg_get_attachment_count(msg);
- * sprintf(str, "msg_get_attachment_count() attach_count [%d]", attach_count);
- * print(str);
- * ..
- * err = msg_release_message(&msg);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-int msg_get_attachment_count(msg_message_t opq_msg);
-
-
-/**
-
- * \par Description:
- * Returns the thumbnail path field of the message object. This API is used for MMS.
- *
- * \par Purpose:
- * This API is used for getting the thumbnail path field of the message object
- *
- * \par Typical use case:
- * MMS message object may contain thumbnail path field, this API enables to get the same.
- *
- * \par Method of function operation:
- * Returns the thumbnail path member of msg_message_t.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - If msg is invalid, behavior is undefined
- *
- * \param msg_message_t    input - message object.
- *
- * \return Return Type (const char*) \n
- * - const char        - MMS message thumbnail path \n
- * - NULL      -       Message object/thumbnail path field is NULL.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * msg_message_t msg;
- * char* msg_thumbnail_path;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * msg_message_t msg = msg_new_message();
- * MSG_SENDINGOPT_S sendOpt = {0, };
- * msg_get_message(hMsgHandle, 1, msg, &sendOpt);
- * ...
- * msg_thumbnail_path = msg_get_thumbnail_path(msg);
- * if(msg_subject != NULL && strlen(msg_subject) > 0)
- * {
- *     sprintf(str, "msg_get_thumbnail_path() msg_thumbnail_path [%s]", msg_thumbnail_path);
- *     print(str);
- * }
- * ..
- * err = msg_release_message(&msg);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-const char* msg_get_thumbnail_path(msg_message_t opq_msg);
-
-
-
-/**
-
- * \par Description:
- * Set message data to MMS msg_data. This API is used for constructing MMS data.
- *
- * \par Purpose:
- * This API is used to set the Message data field of the message object to the passed MMS message data.
- *
- * \par Typical use case:
- * Compose the MMS_MESSAGE_DATA_S structure using msg_mms_* API and then this API can be called to set the MMS body.
- *
- * \par Method of function operation:
- * Serialized "size" bytes of mdata to the pData member of the message object.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - If msg is NULL, no action is done
- * - If msg is invalid, behavior is undefined
- *
- * \param msg_message_t        input - message object whose msgId is to be set.
- * \param const char*                  input - data to be set.
- * \param int                          input - size of mdata to be set to message object
- *
- * \return Return Type (int(MSG_ERROR_T)) \n
- * - MSG_SUCCESS       - Successfully connected to Messaging Service \n
- * - MSG_ERR_NULL_POINTER      -       Input parameter is NULL.
- * - MSG_ERR_INVALID_PARAMETER                 class_type is not one of enum _MSG_CLASS_TYPE_E.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * Refer to msg_mms_* APIs.
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * MMS_MESSAGE_DATA_S*  mms_data;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- * ...
- * mms_data = msg_mms_create_message();
- * ...
- * ...
- * err = msg_mms_set_message_body(msgInfo, mms_data);
- * if (err != MSG_SUCCESS)
- * {
- *     sprintf(str, "msg_mms_set_message_body() Fail [%d]", err);
- *     print(str);
- *
- *     return err; // if success, return OPERATION_SUCCESS. Or if fail, return related error code.
- * }
- * err = msg_mms_destroy_message(mms_data);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-int msg_mms_set_message_body(msg_message_t msg, const MMS_MESSAGE_DATA_S *msg_data);
-
-
-/**
-
- * \par Description:
- * Return pointer to MMS data in message object.
- *
- * \par Purpose:
- * This API is used for getting pointer to MMS data in message object.
- *
- * \par Typical use case:
- * Get the filled MMS data fromthe Message Object.
- *
- * \par Method of function operation:
- * Returns the storageId member of msg_message_t.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - If msg is invalid, behavior is undefined
- *
- * \param msg_message_t    input - message object whose msgId is to be set.
- * \param MMS_MESSAGE_DATA_S - body is passed by pointer, which contains MMS message data.
- *
- * \return Return Type (int(MSG_ERROR_T)) \n
- * - MSG_SUCCESS       - Successfully connected to Messaging Service \n
- * - MSG_ERR_NULL_POINTER      -       Input parameter is NULL.
- * - MSG_ERR_INVALID_PARAMETER                 class_type is not one of enum _MSG_CLASS_TYPE_E.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * msg_message_t msg;
- * MMS_MESSAGE_DATA_S  msgBody = {0};
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * msg_message_t msg = msg_new_message();
- * MSG_SENDINGOPT_S sendOpt = {0, };
- * msg_get_message(msgHandle, 1, msg, &sendOpt);
- *
- * ...
- * err = msg_mms_get_message_body(msg, &msgBody);
- * // access msgBody members using msg_mms_get_* APIs
- *
- * ..
- * err = msg_release_message(&msg);
- * ...
- * \endcode
- */
- /*================================================================================================*/
-int msg_mms_get_message_body(msg_message_t msg, MMS_MESSAGE_DATA_S *body );
-
-
-/**
-
- * \par Description:
- * Adds a SMIL page to MMS message data.
- *
- * \par Purpose:
- * This API is used for adding a SMIL page to MMS message data.
- *
- * \par Typical use case:
- * Add SMIL Page information to the MMS Message Object.
- *
- * \par Method of function operation:
- * Returns the storageId member of msg_message_t.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * The memory for a SMIL page will be allocated and copied in this function. \n
- * Applications need to call msg_mms_release_page_list to free the memory. \n
- * However, if this function is failed, the memory for a SMIL page is NOT allocated in this function.
- *
- * \param MMS_MESSAGE_DATA_S   - msg_data is a pointer to MMS message data.
- * \param int                                  - duration is time interval to play MMS SMIL page.
- *
- * \return Return Type (int(MSG_ERROR_T)) \n
- * - MMS_PAGE_S*       - Newly added MMS_PAGE_S object is returned \n
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * MMS_PAGE_S*         page[2];
- * MMS_MESSAGE_DATA_S*  mms_data;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * mms_data = msg_mms_create_message();
- *
- * ...
- * page[0] = msg_mms_add_page(mms_data, 5440);
- *
- * ...
- * msg_mms_destroy_message(mms_data);
- * ...
- * \endcode
- */
- /*================================================================================================*/
-MMS_PAGE_S* msg_mms_add_page(MMS_MESSAGE_DATA_S *msg_data, const int duration);
-
-
-/**
-
- * \par Description:
- * Adds a SMIL region to MMS message data.
- *
- * \par Purpose:
- * This API is used for adding a SMIL page to MMS message data.
- *
- * \par Typical use case:
- * Add SMIL Page information to the MMS Message Object.
- *
- * \par Method of function operation:
- * Allocates and assigns MMS_SMIL_REGION to region list member of MMS Message data object.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * The memory for a SMIL page will be allocated and copied in this function. \n
- * Applications need to call msg_mms_release_page_list to free the memory. \n
- * However, if this function is failed, the memory for a SMIL page is NOT allocated in this function.
- *
- * \param MMS_MESSAGE_DATA_S   - msg_data is a pointer to MMS message data.
- * \param const char*                  - szID is a pointer to SMIL region.
- * \param const int                            - x coordinate of SMIL region.
- * \param const int                            - y coordinate of SMIL region.
- * \param const int                            - width of SMIL region.
- * \param const int                            - height of SMIL region.
- * \param int                                  - background color of SMIL region.
- *
- * \return Return Type (int(MSG_ERROR_T)) \n
- * - MMS_SMIL_REGION*  - Newly added MMS_SMIL_REGION object is returned \n
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * MMS_PAGE_S*         page[2];
- * MMS_MESSAGE_DATA_S*  mms_data;
- * MMS_SMIL_REGION *mms_region;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * mms_data = msg_mms_create_message();
- * ...
- * msg_mms_set_rootlayout(mms_data, 100, 100, 0xffffff);
- * mms_region = msg_mms_add_region(mms_data, "Image", 0, 50, 100, 50, 0xffffff);
- * page[0] = msg_mms_add_page(mms_data, 5440);
- *
- * ..
- * msg_mms_destroy_message(mms_data);
- * ...
- * \endcode
- */
- /*================================================================================================*/
-MMS_SMIL_REGION* msg_mms_add_region(MMS_MESSAGE_DATA_S *msg_data, const char* szID, const int x, const int y, const int width, const int height, int bgcolor);
-
-
-/**
-
- * \par Description:
- * Adds a media to SMIL page.
- *
- * \par Purpose:
- * This API is used for adding media to SMIL page of the MMS Message Data object.
- *
- * \par Typical use case:
- * Add media to SMIL Page information of the MMS Message Object.
- *
- * \par Method of function operation:
- * Allocates and assigns MMS_MEDIA_S to media list member of MMS Message data object.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * The memory for a SMIL page will be allocated and copied in this function. \n
- * Applications need to call msg_mms_release_page_list to free the memory. \n
- * However, if this function is failed, the memory for a SMIL page is NOT allocated in this function.
- *
- * \param MMS_PAGE_S*                          - page is a pointer to SMIL page.
- * \param const MmsSmilMediaType       - mediatype is a value to point the media category.
- * \param const char*                          - regionid is a pointer of region, media to be displayed.
- * \param char*                                        - filepath is a pointer of media file location.
- *
- * \return Return Type (int(MSG_ERROR_T)) \n
- * - MMS_MEDIA_S*      - Newly added MMS_MEDIA_S object is returned \n
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * MMS_PAGE_S*         page[2];
- * MMS_MESSAGE_DATA_S*  mms_data;
- * MMS_SMIL_REGION *mms_region;
- * MMS_MEDIA_S*        media[5];
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * mms_data = msg_mms_create_message();
- *
- * ...
- * page[0] = msg_mms_add_page(mms_data, 5440);
- * media [0] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_IMG, "Image", (char*)"/opt/abc/xyz.jpg");
- *
- * ..
- * msg_mms_destroy_message(mms_data);
- * ...
- * \endcode
- */
- /*================================================================================================*/
-MMS_MEDIA_S* msg_mms_add_media(MMS_PAGE_S *page, const MmsSmilMediaType mediatype, const char* regionid, char* filepath);
-
-
-/**
-
- * \par Description:
- * Adds an attachment to MMS message data.
- *
- * \par Purpose:
- * This API is used for adding an attachment to MMS message data.
- *
- * \par Typical use case:
- * Adds attachment to SMIL Page information of the MMS Message Object.
- *
- * \par Method of function operation:
- * Adds the filepath to attach list member of MMS Message data object.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * The memory for a SMIL page will be allocated and copied in this function. \n
- * Applications need to call msg_mms_release_page_list to free the memory. \n
- * However, if this function is failed, the memory for a SMIL page is NOT allocated in this function.
- *
- * \param MMS_PAGE_S*                          - page is a pointer to SMIL page.
- * \param const MmsSmilMediaType       - mediatype is a value to point the media category.
- * \param const char*                          - regionid is a pointer of region, media to be displayed.
- * \param char*                                        - filepath is a pointer of media file location.
- *
- * \return Return Type (int(MSG_ERROR_T)) \n
- * - MMS_MEDIA_S*      - Newly added MMS_MEDIA_S object is returned \n
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * MMS_MESSAGE_DATA_S*  mms_data;
- * MMS_ATTACH_S*               attachment[1];
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * mms_data = msg_mms_create_message();
- *
- * ...
- * attachment[0] = msg_mms_add_attachment(mms_data, (char*)"/opt/abc/xyz.jpg");
- *
- * ..
- * msg_mms_destroy_message(mms_data);
- * ...
- * \endcode
- */
- /*================================================================================================*/
-MMS_ATTACH_S* msg_mms_add_attachment(MMS_MESSAGE_DATA_S *msg_data, char *filepath);
-
-
-/**
-
- * \par Description:
- * Adds a SMIL transition information  to MMS message data.
- *
- * \par Purpose:
- * This API is used for adding a SMIL transition information  to MMS message data.
- *
- * \par Typical use case:
- * Adds SMIL transition information of the MMS Message data.
- *
- * \par Method of function operation:
- * Allocates and assigns MMS_SMIL_TRANSITION to transition list member of MMS Message data object.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * The memory for a SMIL page will be allocated and copied in this function. \n
- * Applications need to call msg_mms_release_page_list to free the memory. \n
- * However, if this function is failed, the memory for a SMIL page is NOT allocated in this function.
- *
- * \param MMS_MESSAGE_DATA_S - msg_data is a pointer to MMS message data.
- * \param MMS_SMIL_TRANSITION * - transition is a pointer to SMIL transition information.
- *
- * \return Return Type (int(MSG_ERROR_T)) \n
- * MSG_SUCCESS                 Success in operation.
- * MSG_ERR_INVALID_PARAMETER   Parameter is invalid.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * MMS_MESSAGE_DATA_S*  mms_data;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * mms_data = msg_mms_create_message();
- *
- * ...
- * MMS_SMIL_TRANSITION transition;
- * err = msg_mms_add_transition(mms_data, &transition);
- * ..
- * msg_mms_destroy_message(mms_data);
- * ...
- * \endcode
- */
- /*================================================================================================*/
-int msg_mms_add_transition(MMS_MESSAGE_DATA_S *msg_data, MMS_SMIL_TRANSITION *transition);
-
-
-/**
-
- * \par Description:
- * Adds SMIL meta information  to MMS message data.
- *
- * \par Purpose:
- * This API is used for adding SMIL meta information  to MMS message data.
- *
- * \par Typical use case:
- * Adds SMIL meta information of the MMS Message data.
- *
- * \par Method of function operation:
- * Allocates and assigns MMS_SMIL_META to meta list member of MMS Message data object.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * The memory for a SMIL page will be allocated and copied in this function. \n
- * Applications need to call msg_mms_release_page_list to free the memory. \n
- * However, if this function is failed, the memory for a SMIL page is NOT allocated in this function.
- *
- * \param MMS_MESSAGE_DATA_S - msg_data is a pointer to MMS message data.
- * \param MMS_SMIL_META * - meta is a pointer to SMIL meta information.
- *
- * \return Return Type (int(MSG_ERROR_T)) \n
- * MSG_SUCCESS                 Success in operation.
- * MSG_ERR_INVALID_PARAMETER   Parameter is invalid.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * MMS_MESSAGE_DATA_S*  mms_data;
- * MMS_SMIL_META meta;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * mms_data = msg_mms_create_message();
- *
- * ...
- * MMS_MEDIA_S*        media = NULL;
- * media = msg_mms_add_meta(mms_data, &meta);
- * ...
- * msg_mms_destroy_message(mms_data);
- * ...
- * \endcode
- */
- /*================================================================================================*/
-int msg_mms_add_meta(MMS_MESSAGE_DATA_S *msg_data, MMS_SMIL_META *meta);
-
-
-/* MMS-1.3-con-601 */
-/**
-
- * \par Description:
- * Gets a SMIL page information of the current MMS message.
- *
- * \par Purpose:
- * This API is used to get a SMIL page information
- *
- * \par Typical use case:
- * Gets SMIL Page information of the MMS Message Object.
- *
- * \par Method of function operation:
- * Returns the page_idx page from the pagelist member of msg_message_t.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * This function MUST be called only after SMIL page is added. \n
- *
- * \param MMS_MESSAGE_DATA_S - msg_data is a pointer to MMS message data.
- * \param int page_idx - page_idx is the index of the SMIL page to be returned.
- *
- * \return Return Type (MMS_PAGE_S*) \n
- * - MMS_PAGE_S*       - page_idx MMS_PAGE_S object is returned \n
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * MMS_PAGE_S*         page[2];
- * MMS_MESSAGE_DATA_S*  mms_data;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * mms_data = msg_mms_create_message();
- *
- * ...
- * page[0] = msg_mms_get_page(mms_data, 0);
- *
- * ...
- * msg_mms_destroy_message(mms_data);
- * ...
- * \endcode
- */
- /*================================================================================================*/
-MMS_PAGE_S*    msg_mms_get_page(MMS_MESSAGE_DATA_S *msg_data, int page_idx);
-
-
-/**
-
- * \par Description:
- * Gets a SMIL region information of the current MMS message.
- *
- * \par Purpose:
- * This API is used to gets a SMIL region information.
- *
- * \par Typical use case:
- * Gets SMIL region information of the current MMS Message Object.
- *
- * \par Method of function operation:
- * Returns the media_idx media from the current media list.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * This function MUST be called only after SMIL region is added.
- *
- * \param MMS_MESSAGE_DATA_S - msg_data is a pointer to MMS message data.
- * \param int input - region_idx is the index of the SMIL region to be returned.
- *
- * \return Return Type (MMS_SMIL_REGION*) \n
- * - MMS_SMIL_REGION*  - pointer to MMS_SMIL_REGION structure.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * MMS_SMIL_REGION*    region[2];
- * MMS_MESSAGE_DATA_S*  mms_data;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * mms_data = msg_mms_create_message();
- *
- * ...
- * region[0] = msg_mms_get_smil_region(mms_data, 0);
- *
- * ...
- * msg_mms_destroy_message(mms_data);
- * ...
- * \endcode
- */
- /*================================================================================================*/
-MMS_SMIL_REGION* msg_mms_get_smil_region(MMS_MESSAGE_DATA_S *msg_data, int region_idx);
-
-
-/**
-
- * \par Description:
- * Gets a media information in a SMIL page of the current MMS message.
- *
- * \par Purpose:
- * This API is used to get a media information in a SMIL page
- *
- * \par Typical use case:
- * Gets media information of the current MMS Message Object.
- *
- * \par Method of function operation:
- * Returns the media_idx media from the current media list.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * This function MUST be called only after media is added. \n
- *
- * \param int input - media_idx is the index of the media to be returned. \n
- * \param MMS_PAGE_S* - page  is a pointer to SMIL page.
- *
- * \return Return Type (MMS_MEDIA_S*) \n
- * - MMS_MEDIA_S*      - pointer to MMS_MEDIA_S structure.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * MMS_MEDIA_S*        media[2];
- * MMS_PAGE_S *page[2];
- * MMS_MESSAGE_DATA_S*  mms_data;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * mms_data = msg_mms_create_message();
- *
- * ...
- * media[0] = msg_mms_get_media(page, 0);
- *
- * ...
- * msg_mms_destroy_message(mms_data);
- * ...
- * \endcode
- */
- /*================================================================================================*/
-MMS_MEDIA_S* msg_mms_get_media(MMS_PAGE_S *page, int media_idx);
-
-/**
-
- * \par Description:
- * Gets a attachment information of the current MMS message.
- *
- * \par Purpose:
- * This API is used to get a attachment information
- *
- * \par Typical use case:
- * Gets attachment information of the MMS Message Object.
- *
- * \par Method of function operation:
- * Returns the attach_idx attachment from the attachlist member of msg_message_t.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * This function MUST be called only after attachment is added. \n
- *
- * \param MMS_MESSAGE_DATA_S - msg_data is a pointer to MMS message data.
- * \param int input - attach_idx is the index of the attachment to be returned.
- *
- * \return Return Type (MMS_ATTACH_S*) \n
- * - MMS_ATTACH_S*     - pointer to MMS_ATTACH_S structure.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * MMS_ATTACH_S*       attachment[2];
- * MMS_MESSAGE_DATA_S*  mms_data;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * mms_data = msg_mms_create_message();
- *
- * ...
- * attachment[0] = msg_mms_get_attachment(mms_data, 0);
- *
- * ...
- * msg_mms_destroy_message(mms_data);
- * ...
- * \endcode
- */
- /*================================================================================================*/
-MMS_ATTACH_S* msg_mms_get_attachment(MMS_MESSAGE_DATA_S *msg_data, int attach_idx);
-
-
-/**
-
- * \par Description:
- * Gets a SMIL transition information of the current MMS message.
- *
- * \par Purpose:
- * This API is used to get a SMIL transition information.
- *
- * \par Typical use case:
- * Gets SMIL transition information of the current MMS Message Object.
- *
- * \par Method of function operation:
- * Returns the transition_idx transition from the current transition list.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- *     This function MUST be called only after SMIL transition is added.
- *
- * \param MMS_MESSAGE_DATA_S - msg_data is a pointer to MMS message data.
- * \param int input - transition_idx is the index of the SMIL transition to be returned.
- *
- * \return Return Type (MMS_SMIL_TRANSITION*) \n
- * - MMS_SMIL_TRANSITION*      - pointer to MMS_SMIL_TRANSITION structure.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * MMS_MESSAGE_DATA_S*  mms_data;
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * mms_data = msg_mms_create_message();
- *
- * ...
- * MMS_SMIL_TRANSITION* pTrans = msg_mms_get_transition(mms_data, 0);
- *
- * ...
- * msg_mms_destroy_message(mms_data);
- * ...
- * \endcode
- */
- /*================================================================================================*/
-MMS_SMIL_TRANSITION* msg_mms_get_transition(MMS_MESSAGE_DATA_S *msg_data, int transition_idx);
-
-
-/**
-
- * \par Description:
- * Gets a SMIL meta information of the current MMS message.
- *
- * \par Purpose:
- * This API is used to get a SMIL meta information.
- *
- * \par Typical use case:
- * Gets SMIL meta information of the current MMS Message Object.
- *
- * \par Method of function operation:
- * Returns the meta_idx meta from the current meta list.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * This function MUST be called only after SMIL meta is added.
- *
- * \param MMS_MESSAGE_DATA_S - msg_data is a pointer to MMS message data.
- * \param int input - meta_idx is the index of the SMIL meta to be returned.
- *
- * \return Return Type (MMS_SMIL_META*) \n
- * - MMS_SMIL_META*    - pointer to MMS_SMIL_META structure.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * MMS_MESSAGE_DATA_S*  mms_data;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * mms_data = msg_mms_create_message();
- *
- * ...
- * MMS_SMIL_META* pMeta = msg_mms_get_meta(mms_data, 0);
- *
- * ...
- * msg_mms_destroy_message(mms_data);
- * ...
- * \endcode
- */
- /*================================================================================================*/
-MMS_SMIL_META* msg_mms_get_meta(MMS_MESSAGE_DATA_S *msg_data, int meta_idx);
-
-
-/**
-
- * \par Description:
- * Release a SMIL page list of the current MMS message.
- *
- * \par Purpose:
- * This API is used to release a SMIL page list
- *
- * \par Typical use case:
- * Release SMIL page list of the MMS message object
- *
- * \par Method of function operation:
- * Release SMIL page list of MMS_MESSAGE_DATA_S object
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * This function MUST be called only after SMIL page is added. \n
- *
- * \param MMS_MESSAGE_DATA_S   - msg_data is a pointer to MMS message data.
- *
- * \return Return Type (int(MSG_ERROR_T)) \n
- * MSG_SUCCESS                 Success in operation.
- * MSG_ERR_NULL_POINTER        Parameter is NULL.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * MMS_PAGE_S*         page[2];
- * MMS_MESSAGE_DATA_S*  mms_data;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * mms_data = msg_mms_create_message();
- * ...
- * page[0] = msg_mms_add_page(mms_data, 5440);
- * ...
- * page[0] = msg_mms_get_page(0);
- *
- * msg_mms_release_page_list(mms_data);
- * ...
- * \endcode
- */
- /*================================================================================================*/
-int msg_mms_release_page_list(MMS_MESSAGE_DATA_S *msg_data);
-
-
-/**
-
- * \par Description:
- * Release a SMIL region list of the current MMS message.
- *
- * \par Purpose:
- * This API is used to release a SMIL region list
- *
- * \par Typical use case:
- * Release SMIL region list of the MMS message object
- *
- * \par Method of function operation:
- * Release SMIL region list of MMS_MESSAGE_DATA_S object
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * This function MUST be called only after SMIL region is added. \n
- *
- * \param MMS_MESSAGE_DATA_S   - msg_data is a pointer to MMS message data.
- *
- * \return Return Type (int(MSG_ERROR_T)) \n
- * MSG_SUCCESS                 Success in operation.
- * MSG_ERR_NULL_POINTER        Parameter is NULL.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * MMS_PAGE_S*         page[2];
- * MMS_MESSAGE_DATA_S*  mms_data;
- * MMS_SMIL_REGION *mms_region;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * mms_data = msg_mms_create_message();
- * ...
- * msg_mms_set_rootlayout(mms_data, 100, 100, 0xffffff);
- * mms_region = msg_mms_add_region(mms_data, "Image", 0, 50, 100, 50, 0xffffff);
- * page[0] = msg_mms_add_page(mms_data, 5440);
- * ...
- * msg_mms_release_region_list(mms_data);
- * ...
- * \endcode
- */
- /*================================================================================================*/
-int msg_mms_release_region_list(MMS_MESSAGE_DATA_S *msg_data);
-
-
-/**
-
- * \par Description:
- * Release an attachment list of the current MMS message.
- *
- * \par Purpose:
- * This API is used to release an attachment list
- *
- * \par Typical use case:
- * Release an attachment list of the MMS message object
- *
- * \par Method of function operation:
- * Release an attachment list of MMS_MESSAGE_DATA_S object
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * This function MUST be called only after attachment is added. \n
- *
- * \param MMS_MESSAGE_DATA_S   - msg_data is a pointer to MMS message data.
- *
- * \return Return Type (int(MSG_ERROR_T)) \n
- * MSG_SUCCESS                 Success in operation.
- * MSG_ERR_NULL_POINTER        Parameter is NULL.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * MMS_MESSAGE_DATA_S*  mms_data;
- * MMS_ATTACH_S*               attachment[1];
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * mms_data = msg_mms_create_message();
- *
- * ...
- * attachment[0] = msg_mms_add_attachment(mms_data, (char*)"/opt/abc/xyz.jpg");
- *
- * ..
- * msg_mms_release_attachment_list(mms_data);
- * ...
- * \endcode
- */
- /*================================================================================================*/
-int msg_mms_release_attachment_list(MMS_MESSAGE_DATA_S *msg_data);
-
-
-/**
-
- * \par Description:
- * Release a SMIL transition list of the current MMS message.
- *
- * \par Purpose:
- * This API is used to release a SMIL transition list
- *
- * \par Typical use case:
- * Release a SMIL transition list of the MMS message object
- *
- * \par Method of function operation:
- * Release a SMIL transition list of MMS_MESSAGE_DATA_S object
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * This function MUST be called only after SMIL transition is added. \n
- *
- * \param MMS_MESSAGE_DATA_S   - msg_data is a pointer to MMS message data.
- *
- * \return Return Type (int(MSG_ERROR_T)) \n
- * MSG_SUCCESS                 Success in operation.
- * MSG_ERR_NULL_POINTER        Parameter is NULL.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * MMS_MESSAGE_DATA_S*  mms_data;
- * MMS_ATTACH_S*               attachment[1];
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * mms_data = msg_mms_create_message();
- *
- * ...
- * MMS_SMIL_TRANSITION transition;
- * err = msg_mms_add_transition(mms_data, &transition);
- * ..
- * msg_mms_release_transition_list(mms_data);
- * ...
- * \endcode
- */
- /*================================================================================================*/
-int msg_mms_release_transition_list(MMS_MESSAGE_DATA_S *msg_data);
-
-
-/**
-
- * \par Description:
- * Release a SMIL meta list of the current MMS message.
- *
- * \par Purpose:
- * This API is used to release a SMIL meta list
- *
- * \par Typical use case:
- * Release a SMIL meta list of the MMS message object
- *
- * \par Method of function operation:
- * Release a SMIL meta list of MMS_MESSAGE_DATA_S object
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * This function MUST be called only after SMIL meta is added. \n
- *
- * \param MMS_MESSAGE_DATA_S   - msg_data is a pointer to MMS message data.
- *
- * \return Return Type (int(MSG_ERROR_T)) \n
- * MSG_SUCCESS                 Success in operation.
- * MSG_ERR_NULL_POINTER        Parameter is NULL.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * MMS_MESSAGE_DATA_S*  mms_data;
- * MMS_SMIL_META meta;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * mms_data = msg_mms_create_message();
- *
- * ...
- * MMS_MEDIA_S*        media = NULL;
- * media = msg_mms_add_meta(mms_data, &meta);
- * ...
- * msg_mms_release_meta_list(mms_data);
- * ...
- * \endcode
- */
- /*================================================================================================*/
-int msg_mms_release_meta_list(MMS_MESSAGE_DATA_S *msg_data);
-
-
-/**
-
- * \par Description:
- * Creates a MMS message data
- *
- * \par Purpose:
- * This API creates a MMS message data
- *
- * \par Typical use case:
- * MMS Message object should be created before adding Page, SMIL, attachment information.
- *
- * \par Method of function operation:
- * Allocates and returns a pointer to MMS_MESSAGE_DATA_S.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * The created MMS_MESSAGE_DATA_S object should be explicitly destroyed using msg_mms_destroy_message()
- *
- * \param None input
- *
- * \return Return Type (MMS_MESSAGE_DATA_S*) \n
- * - MMS_MESSAGE_DATA_S*       - pointer to newly created MMS_MESSAGE_DATA_S structure.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * mms_data = msg_mms_create_message();
- *
- * ...
- * msg_mms_destroy_message(mms_data);
- * ...
- * \endcode
- */
- /*================================================================================================*/
-MMS_MESSAGE_DATA_S* msg_mms_create_message(void);
-
-
-/**
-
- * \par Description:
- * Set the MMS root-layout
- *
- * \par Purpose:
- * This API is used for adding a SMIL page to MMS message data.
- *
- * \par Typical use case:
- * Add SMIL Page information to the MMS Message Object.
- *
- * \par Method of function operation:
- * Sets the rootlayout member to the passed root layout.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * None
- *
- * \param MMS_MESSAGE_DATA_S*  - msg is a pointer to mms message data.
- * \param const int                            - width of root-layout
- * \param const int                            - height of root-layout
- * \param int                                  - background color of root-layout
- *
- * \return Return Type (MMS_SMIL_ROOTLAYOUT*) \n
- * - MMS_SMIL_ROOTLAYOUT*      - pointer to MMS_SMIL_ROOTLAYOUT object is returned \n
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * MMS_MESSAGE_DATA_S*  mms_data;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * mms_data = msg_mms_create_message();
- * ...
- * msg_mms_set_rootlayout(mms_data, 100, 100, 0xffffff);
- * ..
- * msg_mms_destroy_message(mms_data);
- * ...
- * \endcode
- */
- /*================================================================================================*/
-MMS_SMIL_ROOTLAYOUT* msg_mms_set_rootlayout(MMS_MESSAGE_DATA_S* msg, const int width, const int height, const int bgcolor);
-
-
-/**
-
- * \par Description:
- * Destroy the created MMS message data.
- *
- * \par Purpose:
- * This API destroys the created MMS message data.
- *
- * \par Typical use case:
- * To free memory allocated with create message API.
- *
- * \par Method of function operation:
- * Frees the memory associated with MMS_MESSAGE_DATA_S object .
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- *This function MUST be called only after MMS message is created by msg_mms_create_message.
- *
- * \param
- * MMS_MESSAGE_DATA_S input - msg is a pointer to MMS message data.
- *
- * \return Return Type (int(MSG_ERROR_T)) \n
- * MSG_SUCCESS                 Success in operation.
- * MSG_ERR_NULL_POINTER        Parameter is NULL.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * mms_data = msg_mms_create_message();
- *
- * ...
- * msg_mms_destroy_message(mms_data);
- * ...
- * \endcode
- */
- /*================================================================================================*/
-int msg_mms_destroy_message(MMS_MESSAGE_DATA_S* msg);
-
-/**
- *     @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
diff --git a/include/mapi/MapiSetting.h b/include/mapi/MapiSetting.h
deleted file mode 100755 (executable)
index ae7ba78..0000000
+++ /dev/null
@@ -1,162 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#ifndef MAPI_SETTING_H
-#define MAPI_SETTING_H
-
-/**
- *     @section                Introduction
- *     - Introduction : Overview on Messaging Setting API
- *     @section                Program
- *     - Program : Messaging Setting API Reference
- */
-
-/*==================================================================================================
-                                         INCLUDE FILES
-==================================================================================================*/
-
-#include "MsgSettingTypes.h"
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-/**
- *     @ingroup                MESSAGING_FRAMEWORK
- *     @defgroup       MESSAGING_SETTING_API   Messaging Setting API
- *     @{
- */
-
-/*==================================================================================================
-                                     FUNCTION PROTOTYPES
-==================================================================================================*/
-
-/**
-
- * \par Description:
- * Sets a Messaging option such as SMS/MMS sending options, Push settings etc..
- *
- * \par Purpose:
- * This API is used to set message options.
- *
- * \par Typical use case:
- * Used in setting the messaging options such as SMS/MMS sending options, Push message settings etc.
- *
- * \par Method of function operation:
- * Stores the MSG_SETTING_S settings to storage such as gconf, etc.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * None
- *
- * \param input - MSG_HANDLE_T  handle is Message handle.
- * \param input - MSG_SETTING_S  setting is a pointer to setting information.
- *
- * \return Return Type int (MSG_ERROR_T) \n
- * - MSG_SUCCESS                                       Success in operation.
- * - MSG_ERR_SET_WRITE_ERROR           Setting configuration is error.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_SETTING_S setting;
- * MSG_ERROR_T err;
- *
- * ...
- * err = msg_set_config(msgHandle, &setting);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-int msg_set_config(MSG_HANDLE_T handle, const MSG_SETTING_S *setting);
-
-
-/**
-
- * \par Description:
- * Retrieve a Messaging option such as SMS/MMS sending options, Push settings etc..
- *
- * \par Purpose:
- * This API is used to getting message options.
- *
- * \par Typical use case:
- * Used in setting the messaging options such as SMS/MMS sending options, Push message settings etc.
- *
- * \par Method of function operation:
- * Stores the MSG_SETTING_S settings to storage such as gconf, etc.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * None
- *
- * \param input - MSG_HANDLE_T  handle is Message handle.
- * \param input - MSG_SETTING_S  setting is a pointer to setting information.
- *
- * \return Return Type int (MSG_ERROR_T) \n
- * - MSG_SUCCESS                                       Success in operation.
- * - MSG_ERR_SET_READ_ERROR            Getting configuration is error.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_SETTING_S setting;
- * MSG_ERROR_T err;
- *
- * ...
- * err = msg_get_config(msgHandle, &setting);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-int msg_get_config(MSG_HANDLE_T handle, MSG_SETTING_S *setting);
-
-/**
- *     @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // MAPI_SETTING_H
-
similarity index 50%
rename from include/mapi/MapiControl.h
rename to include/mapi/msg.h
index 6ebbad1..cf23937 100755 (executable)
@@ -1,40 +1,28 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-/**
- *     @file           MapiControl.h
- *     @brief          Defines control API of messaging framework
- *     @version        1.0
- */
-
-#ifndef MAPI_CONTROL_H
-#define MAPI_CONTROL_H
-
-/**
- *     @section                Introduction
- *     - Introduction : Overview on Messaging Control API
- *     @section                Program
- *     - Program : Messaging Control API Reference
- */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#ifndef MSG_H_
+#define MSG_H_
 
 /*==================================================================================================
                                          INCLUDE FILES
 ==================================================================================================*/
+#include <stdbool.h>
 
-#include "MsgTypes.h"
+#include "msg_types.h"
 
 #ifdef __cplusplus
 extern "C"
@@ -73,7 +61,7 @@ extern "C"
  * - memory for the handle need not be allocated by the application \n
  * - An error will be returned in case Messaging Service is not running.
  *
- * \param MSG_HANDLE_T    input - handle to be passed for all Messaging Services .
+ * \param msg_handle_t    input - handle to be passed for all Messaging Services .
  *
  * \return Return Type (int) \n
  * - MSG_SUCCESS       - Successfully connected to Messaging Service \n
@@ -94,8 +82,8 @@ extern "C"
  * \code
  * ...
  *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
+ * msg_handle_t msgHandle = NULL;
+ * msg_error_t err = MSG_SUCCESS;
  *
  * err = msg_open_msg_handle(&msgHandle);
  *
@@ -111,7 +99,7 @@ extern "C"
  * \endcode
  */
 /*================================================================================================*/
-int msg_open_msg_handle(MSG_HANDLE_T *handle);
+int msg_open_msg_handle(msg_handle_t *handle);
 
 
 /**
@@ -136,7 +124,7 @@ int msg_open_msg_handle(MSG_HANDLE_T *handle);
  * - memory for the handle need not be allocated by the application \n
  * - An error will be returned in case Messaging Service is not running.
  *
- * \param MSG_HANDLE_T    input - handle to be passed for all Messaging Services .
+ * \param msg_handle_t    input - handle to be passed for all Messaging Services .
  *
  * \return Return Type (int) \n
  * - MSG_SUCCESS       - Successfully connected to Messaging Service \n
@@ -156,8 +144,8 @@ int msg_open_msg_handle(MSG_HANDLE_T *handle);
  * \code
  * ...
  *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
+ * msg_handle_t msgHandle = NULL;
+ * msg_error_t err = MSG_SUCCESS;
  *
  * ...
  *
@@ -179,15 +167,73 @@ int msg_open_msg_handle(MSG_HANDLE_T *handle);
  * \endcode
  */
 /*================================================================================================*/
-int msg_close_msg_handle(MSG_HANDLE_T *handle);
+int msg_close_msg_handle(msg_handle_t *handle);
 
-/**
- *     @}
- */
+
+
+msg_struct_t msg_create_struct(int field);
+int msg_release_struct(msg_struct_t *msg_struct_handle);
+int msg_release_list_struct(msg_struct_list_s *msg_struct_list);
+
+int msg_get_int_value(msg_struct_t msg_struct_handle, int field, int *value);
+int msg_get_str_value(msg_struct_t msg_struct_handle, int field, char *value, int size);
+int msg_get_bool_value(msg_struct_t msg_struct_handle, int field, bool *value);
+int msg_get_struct_handle(msg_struct_t msg_struct_handle, int field, msg_struct_t *value);
+int msg_get_list_handle(msg_struct_t msg_struct_handle, int field, void **value);
+
+int msg_set_int_value(msg_struct_t msg_struct_handle, int field, int value);
+int msg_set_str_value(msg_struct_t msg_struct_handle, int field, char *value, int size);
+int msg_set_bool_value(msg_struct_t msg_struct_handle, int field, bool value);
+int msg_set_struct_handle(msg_struct_t msg_struct_handle, int field, msg_struct_t value);
+int msg_set_list_handle(msg_struct_t msg_struct_handle, int field, void *value);
+
+int msg_mms_add_item(msg_struct_t msg_struct_handle, int field, msg_struct_t *item);
+
+int msg_get_mms_struct(msg_struct_t msg_struct_handle, msg_struct_t mms_struct_handle);
+int msg_set_mms_struct(msg_struct_t msg_struct_handle, msg_struct_t mms_struct_handle);
+
+//list
+msg_struct_t msg_list_nth_data(msg_list_handle_t list_handle, int index);
+int msg_list_length(msg_list_handle_t list_handle);
+
+// filter
+int msg_add_filter(msg_handle_t handle, const msg_struct_t filter);
+int msg_update_filter(msg_handle_t handle, const msg_struct_t filter);
+int msg_delete_filter(msg_handle_t handle, msg_filter_id_t filter_id);
+int msg_get_filter_list(msg_handle_t handle, msg_struct_list_s *filter_list);
+int msg_set_filter_operation(msg_handle_t handle, bool set_flag);
+int msg_get_filter_operation(msg_handle_t handle, bool *set_flag);
+
+//setting
+int msg_get_smsc_opt(msg_handle_t handle, msg_struct_t msg_struct);
+int msg_set_smsc_opt(msg_handle_t handle, msg_struct_t msg_struct);
+
+int msg_get_cb_opt(msg_handle_t handle, msg_struct_t msg_struct);
+int msg_set_cb_opt(msg_handle_t handle, msg_struct_t msg_struct);
+
+int msg_get_sms_send_opt(msg_handle_t handle, msg_struct_t msg_struct);
+int msg_set_sms_send_opt(msg_handle_t handle, msg_struct_t msg_struct);
+
+int msg_get_mms_send_opt(msg_handle_t handle, msg_struct_t msg_struct);
+int msg_set_mms_send_opt(msg_handle_t handle, msg_struct_t msg_struct);
+
+int msg_get_mms_recv_opt(msg_handle_t handle, msg_struct_t msg_struct);
+int msg_set_mms_recv_opt(msg_handle_t handle, msg_struct_t msg_struct);
+
+int msg_get_push_msg_opt(msg_handle_t handle, msg_struct_t msg_struct);
+int msg_set_push_msg_opt(msg_handle_t handle, msg_struct_t msg_struct);
+
+int msg_get_voice_msg_opt(msg_handle_t handle, msg_struct_t msg_struct);
+int msg_set_voice_msg_opt(msg_handle_t handle, msg_struct_t msg_struct);
+
+int msg_get_general_opt(msg_handle_t handle, msg_struct_t msg_struct);
+int msg_set_general_opt(msg_handle_t handle, msg_struct_t msg_struct);
+
+int msg_get_msgsize_opt(msg_handle_t handle, msg_struct_t msg_struct);
+int msg_set_msgsize_opt(msg_handle_t handle, msg_struct_t msg_struct);
 
 #ifdef __cplusplus
 }
 #endif
 
-#endif // MAPI_STORAGE_H
-
+#endif /* MSG_H_ */
diff --git a/include/mapi/msg_private.h b/include/mapi/msg_private.h
new file mode 100755 (executable)
index 0000000..13e0312
--- /dev/null
@@ -0,0 +1,202 @@
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#ifndef MSG_PRIVATE_H_
+#define MSG_PRIVATE_H_
+
+/*==================================================================================================
+                                         INCLUDE FILES
+==================================================================================================*/
+
+#include "MsgTypes.h"
+#include "MsgStorageTypes.h"
+#include "MsgTransportTypes.h"
+#include "MsgMmsTypes.h"
+#include "MsgFilterTypes.h"
+#include "MsgSettingTypes.h"
+
+
+/*==================================================================================================
+                                                                        FUNCTION PROTOTYPES
+==================================================================================================*/
+
+// message
+void msg_message_create_struct(msg_struct_s *msg_struct);
+int msg_message_release(msg_struct_s **msg_struct);
+
+int msg_message_get_int_value(void *data, int field, int *value);
+int msg_message_get_bool_value(void *data, int field, bool *value);
+int msg_message_get_str_value(void *data, int field, char *value, int size);
+int msg_message_get_struct_hnd(void *data, int field, void **value);
+int msg_message_get_list_hnd(void *data, int field, void **value);
+
+int msg_message_set_int_value(void *data, int field, int value);
+int msg_message_set_bool_value(void *data, int field, bool value);
+int msg_message_set_str_value(void *data, int field, char *value, int size);
+int msg_message_set_struct_hnd(void *data, int field, void *value);
+
+void msg_message_copy_message(MSG_MESSAGE_HIDDEN_S *pSrc, MSG_MESSAGE_HIDDEN_S *pDst);
+
+
+// filter
+int msg_get_filter_info_int(void *filter, int field);
+char *msg_get_filter_info_str(void *filter, int field);
+int msg_set_filter_info_int(void *filter, int field, int value);
+int msg_set_filter_info_str(void *filter, int field, char *value, int size);
+
+
+// mms
+msg_struct_s *msg_mms_create_struct(int field);
+void *msg_mms_create_struct_data(int field);
+int msg_mms_release_struct(msg_struct_s **msg_struct_data);
+
+int msg_mms_get_int_value(msg_struct_s *msg_struct, int field, int *value);
+int msg_mms_get_str_value(msg_struct_s *msg_struct, int field, char *src, int size);
+int msg_mms_get_bool_value(msg_struct_s *msg_struct, int field, bool *value);
+int msg_mms_get_struct_handle(msg_struct_s *msg_struct, int field, msg_struct_s **value);
+int msg_mms_get_list_handle(msg_struct_s *msg_struct, int field, msg_list_handle_t *value);
+
+int msg_mms_set_int_value(msg_struct_s *msg_struct, int field, int value);
+int msg_mms_set_str_value(msg_struct_s *msg_struct, int field, char *value, int size);
+int msg_mms_set_bool_value(msg_struct_s *msg_struct, int field, bool value);
+int msg_mms_set_struct_handle(msg_struct_s *msg_struct, int field, msg_struct_s *value);
+int msg_mms_set_list_handle(msg_struct_s *msg_struct, int field, msg_list_handle_t value);
+
+void convert_to_mmsdata(const msg_struct_s *pSrc, MMS_MESSAGE_DATA_S *pDest);
+void convert_from_mmsdata(const MMS_MESSAGE_DATA_S *pSrc, msg_struct_s *pDest);
+
+// setting
+int msg_setting_get_int_value(msg_struct_s *msg_struct, int field, int *value);
+int msg_setting_get_str_value(msg_struct_s *msg_struct, int field, char *src, int size);
+int msg_setting_get_bool_value(msg_struct_s *msg_struct, int field, bool *value);
+int msg_setting_get_list_handle(msg_struct_s *msg_struct, int field, void **value);
+
+int msg_setting_set_int_value(msg_struct_s *msg_struct, int field, int value);
+int msg_setting_set_str_value(msg_struct_s *msg_struct, int field, char *value, int size);
+int msg_setting_set_bool_value(msg_struct_s *msg_struct, int field, bool value);
+
+int msg_get_smsc_opt_int(void *smsc_opt, int field);
+int msg_set_smsc_opt_int(void *smsc_opt, int field, int value);
+int msg_get_smsc_opt_list(void *smsc_opt, int field, void **value);
+
+int msg_get_smsc_info_int(void *smsc_info, int field);
+int msg_set_smsc_info_int(void *smsc_info, int field, int value);
+char* msg_get_smsc_info_str(void *smsc_info, int field);
+int msg_set_smsc_info_str(void *smsc_info, int field, char *val, int size);
+
+int msg_get_cb_option_int(void *cb_opt, int field);
+int msg_set_cb_option_int(void *cb_opt, int field, int value);
+bool msg_get_cb_option_bool(void *cb_opt, int field);
+int msg_set_cb_option_bool(void *cb_opt, int field, bool value);
+int msg_get_cb_option_list(void *cb_opt, int field, void **value);
+
+int msg_get_cb_channel_info_int(void *cb_ch_info, int field);
+int msg_set_cb_channel_info_int(void *cb_ch_info, int field, int value);
+bool msg_get_cb_channel_info_bool(void *cb_ch_info, int field);
+int msg_set_cb_channel_info_bool(void *cb_ch_info, int field, bool value);
+char *msg_get_cb_channel_info_str(void *cb_ch_info, int field);
+int msg_set_cb_channel_info_str(void *cb_ch_info, int field, char *val, int size);
+
+int msg_get_sms_send_opt_int(void *sms_send_opt, int field);
+int msg_set_sms_send_opt_int(void *sms_send_opt, int field, int value);
+bool msg_get_sms_send_opt_bool(void *sms_send_opt, int field);
+int msg_set_sms_send_opt_bool(void *sms_send_opt, int field, bool value);
+
+int msg_get_mms_send_opt_int(void *mms_send_opt, int field);
+int msg_set_mms_send_opt_int(void *mms_send_opt, int field, int value);
+bool msg_get_mms_send_opt_bool(void *mms_send_opt, int field);
+int msg_set_mms_send_opt_bool(void *mms_send_opt, int field, bool value);
+
+int msg_get_mms_recv_opt_int(void *mms_recv_opt, int field);
+int msg_set_mms_recv_opt_int(void *mms_recv_opt, int field, int value);
+bool msg_get_mms_recv_opt_bool(void *mms_recv_opt, int field);
+int msg_set_mms_recv_opt_bool(void *mms_recv_opt, int field, bool value);
+
+int msg_get_push_msg_opt_int(void *push_msg_opt, int field);
+int msg_set_push_msg_opt_int(void *push_msg_opt, int field, int value);
+bool msg_get_push_msg_opt_bool(void *push_msg_opt, int field);
+int msg_set_push_msg_opt_bool(void *push_msg_opt, int field, bool value);
+
+char *msg_get_voice_msg_opt_str(void *voice_msg_opt, int field);
+int msg_set_voice_msg_opt_str(void *voice_msg_opt, int field, char *val, int size);
+
+int msg_get_general_opt_int(void *general_opt, int field);
+int msg_set_general_opt_int(void *general_opt, int field, int value);
+bool msg_get_general_opt_bool(void *general_opt, int field);
+int msg_set_general_opt_bool(void *general_opt, int field, bool value);
+
+
+int msg_get_msgsize_opt_int(void *size_opt, int field);
+int msg_set_msgsize_opt_int(void *size_opt, int field, int value);
+
+/* added internal apis for new managed api (storage) */
+int msg_syncml_info_get_int(void *syncml_info, int field);
+int msg_count_info_get_int(void *count_info, int field);
+int msg_thread_count_get_int(void *count_info, int field);
+int msg_thread_index_get_int(void *index_info, int field);
+int msg_sortrule_get_int(void *sort_info, int field);
+int msg_folder_info_get_int(void *folder_info, int field);
+int msg_thread_info_get_int(void *data, int field);
+int msg_search_condition_get_int(void *condition_info, int field);
+int msg_report_status_get_int(void *report_info, int field);
+char* msg_folder_info_get_str(void *folder_info, int field);
+char *msg_thread_info_get_str(void *data, int field);
+char* msg_search_condition_get_str(void *condition_info, int field, int size);
+bool msg_sendopt_get_bool(void *send_opt, int field);
+bool msg_sortrule_get_bool(void *sort_rule, int field);
+int msg_sendopt_get_struct_handle(msg_struct_s *msg_struct, int field, void **value);
+int msg_syncml_get_struct_handle(msg_struct_s *msg_struct, int field, void **value);
+int msg_thread_index_get_struct_handle(msg_struct_s *msg_struct, int field, void **value);
+int msg_address_info_get_int(void *addr_info, int field);
+int msg_mms_sendopt_get_int(void *opt_info, int field);
+int msg_reject_message_get_int(void *msg_info, int field);
+char* msg_address_info_get_str(void *addr_info, int field, int size);
+char* msg_reject_message_get_str(void *msg_info, int field, int size);
+bool msg_mms_sendopt_get_bool(void *opt_info, int field);
+bool msg_sms_sendopt_get_bool(void *opt_info, int field);
+
+int msg_syncml_info_set_int(void *syncml_info, int field, int value);
+int msg_count_info_set_int(void *count_info, int field, int value);
+int msg_thread_count_set_int(void *count_info, int field, int value);
+int msg_thread_index_set_int(void *index_info, int field, int value);
+int msg_sortrule_set_int(void *sort_info, int field, int value);
+int msg_folder_info_set_int(void *folder_info, int field, int value);
+int msg_search_condition_set_int(void *condition_info, int field, int value);
+int msg_report_status_set_int(void *report_info, int field, int value);
+int msg_folder_info_set_str(void *folder_info, int field, char *value, int size);
+int msg_search_condition_set_str(void *condition_info, int field, char *value, int size);
+int msg_sendopt_set_bool(void *send_opt, int field, bool value);
+int msg_sortrule_set_bool(void *sort_rule, int field, bool value);
+int msg_sendopt_set_struct_handle(msg_struct_s *msg_struct, int field, msg_struct_s *value);
+int msg_syncml_set_struct_handle(msg_struct_s *msg_struct, int field, msg_struct_s *value);
+int msg_thread_index_set_struct_handle(msg_struct_s *msg_struct, int field, msg_struct_s *value);
+int msg_address_info_set_int(void *addrinfo, int field, int value);
+int msg_mms_sendopt_set_int(void *opt_info, int field, int value);
+int msg_reject_message_set_int(void *msg_info, int field, int value);
+int msg_address_info_set_str(void *addr_info, int field, char *value, int size);
+int msg_reject_message_set_str(void *msg_info, int field, char *value, int size);
+int msg_mms_sendopt_set_bool(void *option, int field, bool value);
+int msg_sms_sendopt_set_bool(void *option, int field, bool value);
+
+/* added internal apis for new managed api (transport) */
+int msg_request_get_int(void *request_info, int field);
+int msg_request_get_struct_handle(msg_struct_s *msg_struct, int field, void **value);
+int msg_request_set_int(void *request_info, int field, int value);
+int msg_request_set_struct_handle(msg_struct_s *msg_struct, int field, msg_struct_s *value);
+int msg_sent_status_get_int(MSG_SENT_STATUS_S *sent_status_info, int field);
+
+
+#endif /* MSG_PRIVATE_H_ */
similarity index 58%
rename from include/mapi/MapiStorage.h
rename to include/mapi/msg_storage.h
index 74f4d77..796f70f 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 /**
  *     @file           MapiStorage.h
@@ -34,7 +34,7 @@
                                          INCLUDE FILES
 ==================================================================================================*/
 
-#include "MsgStorageTypes.h"
+#include "msg_storage_types.h"
 
 #ifdef __cplusplus
 extern "C"
@@ -71,11 +71,11 @@ extern "C"
  * \par Important notes:
  * - Mandatory fields of a message structure MUST be valid, otherwise the function will be failed.
  *
- * \param input - MSG_HANDLE_T  handle is Message handle.
+ * \param input - msg_handle_t  handle is Message handle.
  * \param input - msg_message_t  msg is a pointer to an msg_message_t structure.
  * \param input - send_opt is a pointer to an MSG_SENDINGOPT_S structure.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS       - Successfully connected to Messaging Service \n
  * - MSG_ERR_NULL_POINTER      - Input parameter is NULL.
  * - MSG_ERR_STORAGE_ERROR - Storage is error.
@@ -93,7 +93,7 @@ extern "C"
  * \code
  * ...
  *
- * MSG_HANDLE_T msgHandle = NULL;
+ * msg_handle_t msgHandle = NULL;
  * msg_message_t               msg;
  * MSG_SENDINGOPT_S sendingOpt = {0};
  *
@@ -114,7 +114,7 @@ extern "C"
  * \endcode
  */
 /*================================================================================================*/
-int msg_add_message(MSG_HANDLE_T handle, const msg_message_t msg, const MSG_SENDINGOPT_S *send_opt);
+int msg_add_message(msg_handle_t handle, const msg_struct_t msg, const msg_struct_t send_opt);
 
 
 /**
@@ -137,10 +137,10 @@ int msg_add_message(MSG_HANDLE_T handle, const msg_message_t msg, const MSG_SEND
  * \par Important notes:
  * - Mandatory fields of a message structure MUST be valid, otherwise the function will be failed.
  *
- * \param input - MSG_HANDLE_T  handle is Message handle.
+ * \param input - msg_handle_t  handle is Message handle.
  * \param input - MSG_SYNCML_MESSAGE_S  syncml_msg is a pointer to an MSG_SYNCML_MESSAGE_S structure.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS       - Success in operation.
  * - MSG_ERR_NULL_POINTER - pMsg is NULL.
  * - MSG_ERR_INVALID_MSGHANDLE - Message handle is invalid.
@@ -164,7 +164,7 @@ int msg_add_message(MSG_HANDLE_T handle, const msg_message_t msg, const MSG_SEND
  * \code
  * ...
  *
- * MSG_HANDLE_T msgHandle = NULL;
+ * msg_handle_t msgHandle = NULL;
  * MSG_SYNCML_MESSAGE_S syncMLMsg;
  *
  * ...
@@ -184,7 +184,7 @@ int msg_add_message(MSG_HANDLE_T handle, const msg_message_t msg, const MSG_SEND
  * \endcode
  */
 /*================================================================================================*/
-int msg_add_syncml_message(MSG_HANDLE_T handle, const MSG_SYNCML_MESSAGE_S *syncml_msg);
+int msg_add_syncml_message(msg_handle_t handle, const msg_struct_t syncml_msg);
 
 
 /**
@@ -216,7 +216,7 @@ int msg_add_syncml_message(MSG_HANDLE_T handle, const MSG_SYNCML_MESSAGE_S *sync
  * \param input - msg is a pointer to an msg_message_t structure.
  * \param input - send_opt is a pointer to an MSG_SENDINGOPT_S structure.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS       - Success in operation.
  * - MSG_ERR_INVALID_PARAMETER - Parameter is invalid.
  * - MSG_ERR_STORAGE_ERROR - Storage is error.
@@ -234,7 +234,7 @@ int msg_add_syncml_message(MSG_HANDLE_T handle, const MSG_SYNCML_MESSAGE_S *sync
  * \code
  * ...
  *
- * MSG_HANDLE_T msgHandle = NULL;
+ * msg_handle_t msgHandle = NULL;
  * MSG_SYNCML_MESSAGE_S syncMLMsg;
  * MSG_SENDINGOPT_S sendingOpt = {0};
  *
@@ -255,7 +255,7 @@ int msg_add_syncml_message(MSG_HANDLE_T handle, const MSG_SYNCML_MESSAGE_S *sync
  * \endcode
  */
 /*================================================================================================*/
-int msg_update_message(MSG_HANDLE_T handle, const msg_message_t msg, const MSG_SENDINGOPT_S *send_opt);
+int msg_update_message(msg_handle_t handle, const msg_struct_t msg, const msg_struct_t send_opt);
 
 
 /**
@@ -282,7 +282,7 @@ int msg_update_message(MSG_HANDLE_T handle, const msg_message_t msg, const MSG_S
  * \param input - msg_id is Message ID.
  * \parem input - read is boolean for indicating whether a message is read or not.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS       - Success in operation.
  * - MSG_ERR_INVALID_PARAMETER - Parameter is invalid.
  * - MSG_ERR_STORAGE_ERROR - Storage is error.
@@ -300,7 +300,7 @@ int msg_update_message(MSG_HANDLE_T handle, const msg_message_t msg, const MSG_S
  * \code
  * ...
  *
- * MSG_HANDLE_T msgHandle = NULL;
+ * msg_handle_t msgHandle = NULL;
  * MSG_SYNCML_MESSAGE_S syncMLMsg;
  * MSG_SENDINGOPT_S sendingOpt = {0};
  *
@@ -321,7 +321,7 @@ int msg_update_message(MSG_HANDLE_T handle, const msg_message_t msg, const MSG_S
  * \endcode
  */
 /*================================================================================================*/
-int msg_update_read_status(MSG_HANDLE_T handle, MSG_MESSAGE_ID_T msg_id, bool read);
+int msg_update_read_status(msg_handle_t handle, msg_message_id_t msg_id, bool read);
 
 
 /**
@@ -348,7 +348,7 @@ int msg_update_read_status(MSG_HANDLE_T handle, MSG_MESSAGE_ID_T msg_id, bool re
  * \param input - msg_id is Message ID.
  * \parem input - is_protected is boolean for indicating whether a message is protected or not.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS       - Success in operation.
  * - MSG_ERR_INVALID_PARAMETER - Parameter is invalid.
  * - MSG_ERR_STORAGE_ERROR - Storage is error.
@@ -366,7 +366,7 @@ int msg_update_read_status(MSG_HANDLE_T handle, MSG_MESSAGE_ID_T msg_id, bool re
  * \code
  * ...
  *
- * MSG_HANDLE_T msgHandle = NULL;
+ * msg_handle_t msgHandle = NULL;
  * MSG_SYNCML_MESSAGE_S syncMLMsg;
  * MSG_SENDINGOPT_S sendingOpt = {0};
  *
@@ -387,7 +387,7 @@ int msg_update_read_status(MSG_HANDLE_T handle, MSG_MESSAGE_ID_T msg_id, bool re
  * \endcode
  */
 /*================================================================================================*/
-int msg_update_protected_status(MSG_HANDLE_T handle, MSG_MESSAGE_ID_T msg_id, bool is_protected);
+int msg_update_protected_status(msg_handle_t handle, msg_message_id_t msg_id, bool is_protected);
 
 
 /**
@@ -413,7 +413,7 @@ int msg_update_protected_status(MSG_HANDLE_T handle, MSG_MESSAGE_ID_T msg_id, bo
  * \param input - handle is Message handle.
  * \param input - msg_id is the ID of the Message to be deleted.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS       - Success in operation.
  * - MSG_ERR_INVALID_PARAMETER - Parameter is invalid.
  * - MSG_ERR_STORAGE_ERROR - Storage is error.
@@ -431,7 +431,7 @@ int msg_update_protected_status(MSG_HANDLE_T handle, MSG_MESSAGE_ID_T msg_id, bo
  * \code
  * ...
  *
- * MSG_HANDLE_T msgHandle = NULL;
+ * msg_handle_t msgHandle = NULL;
  * MSG_SYNCML_MESSAGE_S syncMLMsg;
  * MSG_SENDINGOPT_S sendingOpt = {0};
  *
@@ -452,7 +452,7 @@ int msg_update_protected_status(MSG_HANDLE_T handle, MSG_MESSAGE_ID_T msg_id, bo
  * \endcode
  */
 /*================================================================================================*/
-int msg_delete_message(MSG_HANDLE_T handle, MSG_MESSAGE_ID_T msg_id);
+int msg_delete_message(msg_handle_t handle, msg_message_id_t msg_id);
 
 
 /**
@@ -478,7 +478,7 @@ int msg_delete_message(MSG_HANDLE_T handle, MSG_MESSAGE_ID_T msg_id);
  * \param input - handle is Message handle.
  * \param input - folder_id is the ID of the folder to be deleted.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS       - Success in operation.
  * - MSG_ERR_INVALID_PARAMETER - Parameter is invalid.
  * - MSG_ERR_STORAGE_ERROR - Storage is error.
@@ -496,7 +496,7 @@ int msg_delete_message(MSG_HANDLE_T handle, MSG_MESSAGE_ID_T msg_id);
  * \code
  * ...
  *
- * MSG_HANDLE_T msgHandle = NULL;
+ * msg_handle_t msgHandle = NULL;
  * MSG_SYNCML_MESSAGE_S syncMLMsg;
  * MSG_SENDINGOPT_S sendingOpt = {0};
  *
@@ -517,7 +517,7 @@ int msg_delete_message(MSG_HANDLE_T handle, MSG_MESSAGE_ID_T msg_id);
  * \endcode
  */
 /*================================================================================================*/
-int msg_delete_all_msgs_in_folder(MSG_HANDLE_T handle, MSG_FOLDER_ID_T folder_id, bool bOnlyDB);
+int msg_delete_all_msgs_in_folder(msg_handle_t handle, msg_folder_id_t folder_id, bool bOnlyDB);
 
 
 
@@ -545,7 +545,7 @@ int msg_delete_all_msgs_in_folder(MSG_HANDLE_T handle, MSG_FOLDER_ID_T folder_id
  * \param input - msg_id is the ID of the message to be moved.
  * \param input - dest_folder_id is the ID of the destination folder.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS       - Success in operation.
  * - MSG_ERR_INVALID_PARAMETER - Parameter is invalid.
  * - MSG_ERR_STORAGE_ERROR - Storage is error.
@@ -563,7 +563,7 @@ int msg_delete_all_msgs_in_folder(MSG_HANDLE_T handle, MSG_FOLDER_ID_T folder_id
  * \code
  * ...
  *
- * MSG_HANDLE_T msgHandle = NULL;
+ * msg_handle_t msgHandle = NULL;
  * MSG_SYNCML_MESSAGE_S syncMLMsg;
  * MSG_SENDINGOPT_S sendingOpt = {0};
  *
@@ -584,7 +584,7 @@ int msg_delete_all_msgs_in_folder(MSG_HANDLE_T handle, MSG_FOLDER_ID_T folder_id
  * \endcode
  */
 /*================================================================================================*/
-int msg_move_msg_to_folder(MSG_HANDLE_T handle, MSG_MESSAGE_ID_T msg_id, MSG_FOLDER_ID_T dest_folder_id);
+int msg_move_msg_to_folder(msg_handle_t handle, msg_message_id_t msg_id, msg_folder_id_t dest_folder_id);
 
 
 /**
@@ -611,7 +611,7 @@ int msg_move_msg_to_folder(MSG_HANDLE_T handle, MSG_MESSAGE_ID_T msg_id, MSG_FOL
  * \param input - msg_id is the ID of the message to be moved.
  * \param input - storage_id is the ID of the destination storage.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS       - Success in operation.
  * - MSG_ERR_INVALID_PARAMETER - Parameter is invalid.
  * - MSG_ERR_STORAGE_ERROR - Storage is error.
@@ -629,7 +629,7 @@ int msg_move_msg_to_folder(MSG_HANDLE_T handle, MSG_MESSAGE_ID_T msg_id, MSG_FOL
  * \code
  * ...
  *
- * MSG_HANDLE_T msgHandle = NULL;
+ * msg_handle_t msgHandle = NULL;
  * MSG_SYNCML_MESSAGE_S syncMLMsg;
  * MSG_SENDINGOPT_S sendingOpt = {0};
  *
@@ -650,7 +650,7 @@ int msg_move_msg_to_folder(MSG_HANDLE_T handle, MSG_MESSAGE_ID_T msg_id, MSG_FOL
  * \endcode
  */
 /*================================================================================================*/
-int msg_move_msg_to_storage(MSG_HANDLE_T handle, MSG_MESSAGE_ID_T msg_id, MSG_STORAGE_ID_T storage_id);
+int msg_move_msg_to_storage(msg_handle_t handle, msg_message_id_t msg_id, msg_storage_id_t storage_id);
 
 
 /**
@@ -677,7 +677,7 @@ int msg_move_msg_to_storage(MSG_HANDLE_T handle, MSG_MESSAGE_ID_T msg_id, MSG_ST
  * \param input - folder_id is the ID of the folder to be counted.
  * \param output - count_info is a pointer to an MSG_COUNT_INFO_S structure.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS       - Success in operation.
  * - MSG_ERR_INVALID_PARAMETER - Parameter is invalid.
  * - MSG_ERR_STORAGE_ERROR - Storage is error.
@@ -695,7 +695,7 @@ int msg_move_msg_to_storage(MSG_HANDLE_T handle, MSG_MESSAGE_ID_T msg_id, MSG_ST
  * \code
  * ...
  *
- * MSG_HANDLE_T msgHandle = NULL;
+ * msg_handle_t msgHandle = NULL;
  * MSG_COUNT_INFO_S countInfo;
  *
  * ...
@@ -715,7 +715,7 @@ int msg_move_msg_to_storage(MSG_HANDLE_T handle, MSG_MESSAGE_ID_T msg_id, MSG_ST
  * \endcode
  */
 /*================================================================================================*/
-int msg_count_message(MSG_HANDLE_T handle, MSG_FOLDER_ID_T folder_id, MSG_COUNT_INFO_S *count_info);
+int msg_count_message(msg_handle_t handle, msg_folder_id_t folder_id, msg_struct_t count_info);
 
 
 /**
@@ -742,7 +742,7 @@ int msg_count_message(MSG_HANDLE_T handle, MSG_FOLDER_ID_T folder_id, MSG_COUNT_
  * \param input - msg_type is the message type to be counted.
  * \param output - msg_count is a pointer to the number of message.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS       - Success in operation.
  * - MSG_ERR_INVALID_PARAMETER - Parameter is invalid.
  * - MSG_ERR_STORAGE_ERROR - Storage is error.
@@ -760,7 +760,7 @@ int msg_count_message(MSG_HANDLE_T handle, MSG_FOLDER_ID_T folder_id, MSG_COUNT_
  * \code
  * ...
  *
- * MSG_HANDLE_T msgHandle = NULL;
+ * msg_handle_t msgHandle = NULL;
  * MSG_COUNT_INFO_S countInfo;
  *
  * ...
@@ -780,7 +780,7 @@ int msg_count_message(MSG_HANDLE_T handle, MSG_FOLDER_ID_T folder_id, MSG_COUNT_
  * \endcode
  */
 /*================================================================================================*/
-int msg_count_msg_by_type(MSG_HANDLE_T handle, MSG_MESSAGE_TYPE_T msg_type, int *msg_count);
+int msg_count_msg_by_type(msg_handle_t handle, msg_message_type_t msg_type, int *msg_count);
 
 
 /**
@@ -807,7 +807,7 @@ int msg_count_msg_by_type(MSG_HANDLE_T handle, MSG_MESSAGE_TYPE_T msg_type, int
  * \param input - addr_info is a pointer to an MSG_ADDRESS_INFO_LIST_S structure.
  * \param input - msg_thread_count_list is a pointer to an MSG_THREAD_COUNT_INFO_S structure.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS       - Success in operation.
  * - MSG_ERR_INVALID_PARAMETER - Parameter is invalid.
  * - MSG_ERR_STORAGE_ERROR - Storage is error.
@@ -825,7 +825,7 @@ int msg_count_msg_by_type(MSG_HANDLE_T handle, MSG_MESSAGE_TYPE_T msg_type, int
  * \code
  * ...
  *
- * MSG_HANDLE_T msgHandle = NULL;
+ * msg_handle_t msgHandle = NULL;
  * MSG_COUNT_INFO_S countInfo;
  *
  * ...
@@ -845,7 +845,7 @@ int msg_count_msg_by_type(MSG_HANDLE_T handle, MSG_MESSAGE_TYPE_T msg_type, int
  * \endcode
  */
 /*================================================================================================*/
-int msg_count_msg_by_contact(MSG_HANDLE_T handle, const MSG_THREAD_LIST_INDEX_S *addr_info, MSG_THREAD_COUNT_INFO_S *msg_thread_count_list);
+int msg_count_msg_by_contact(msg_handle_t handle, const msg_struct_t addr_info, msg_struct_t msg_thread_count_list);
 
 
 /**
@@ -876,7 +876,7 @@ handle is Message handle.
  * \param output - msg is a pointer to an msg_message_t structure.
  * \param input - send_opt is a pointer to an MSG_SENDINGOPT_S structure.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS       - Success in operation.
  * - MSG_ERR_INVALID_PARAMETER - Parameter is invalid.
  * - MSG_ERR_STORAGE_ERROR - Storage is error.
@@ -894,7 +894,7 @@ handle is Message handle.
  * \code
  * ...
  *
- * MSG_HANDLE_T msgHandle = NULL;
+ * msg_handle_t msgHandle = NULL;
  *
  * ...
  * msg_message_t msg = msg_new_message();
@@ -911,7 +911,7 @@ handle is Message handle.
  * \endcode
  */
 /*================================================================================================*/
-int msg_get_message(MSG_HANDLE_T handle, MSG_MESSAGE_ID_T msg_id, msg_message_t msg, MSG_SENDINGOPT_S *send_opt);
+int msg_get_message(msg_handle_t handle, msg_message_id_t msg_id, msg_struct_t msg, msg_struct_t send_opt);
 
 
 /**
@@ -941,7 +941,7 @@ int msg_get_message(MSG_HANDLE_T handle, MSG_MESSAGE_ID_T msg_id, msg_message_t
  * \param input - sort_rule indicates a sort type and sort order for querying messages.
  * \param output - msg_folder_view_list is a pointer to an MSG_FOLDER_VIEW_LIST_S structure.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS       - Success in operation.
  * - MSG_ERR_INVALID_PARAMETER - Parameter is invalid.
  * - MSG_ERR_STORAGE_ERROR - Storage is error.
@@ -959,7 +959,7 @@ int msg_get_message(MSG_HANDLE_T handle, MSG_MESSAGE_ID_T msg_id, msg_message_t
  * \code
  * ...
  *
- * MSG_HANDLE_T msgHandle = NULL;
+ * msg_handle_t msgHandle = NULL;
  *
  * ...
  * MSG_FOLDER_VIEW_LIST_S folderViewList;
@@ -975,7 +975,7 @@ int msg_get_message(MSG_HANDLE_T handle, MSG_MESSAGE_ID_T msg_id, msg_message_t
  * \endcode
  */
 /*================================================================================================*/
-int msg_get_folder_view_list(MSG_HANDLE_T handle, MSG_FOLDER_ID_T folder_id, const MSG_SORT_RULE_S *sort_rule, MSG_LIST_S *msg_folder_view_list);
+int msg_get_folder_view_list(msg_handle_t handle, msg_folder_id_t folder_id, const msg_struct_t sort_rule, msg_struct_list_s *msg_folder_view_list);
 
 
 /**
@@ -1002,9 +1002,9 @@ int msg_get_folder_view_list(MSG_HANDLE_T handle, MSG_FOLDER_ID_T folder_id, con
  *
  * \param input - handle is Message handle.
  * \param input - sort_rule indicates a sort type and sort order for querying messages.
- * \param output - msg_thread_view_list is a pointer to an MSG_THREAD_VIEW_LIST_S structure.
+ * \param output - msg_thread_view_list is a pointer to an msg_struct_list_s structure.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS       - Success in operation.
  * - MSG_ERR_INVALID_PARAMETER - Parameter is invalid.
  * - MSG_ERR_STORAGE_ERROR - Storage is error.
@@ -1022,10 +1022,10 @@ int msg_get_folder_view_list(MSG_HANDLE_T handle, MSG_FOLDER_ID_T folder_id, con
  * \code
  * ...
  *
- * MSG_HANDLE_T msgHandle = NULL;
+ * msg_handle_t msgHandle = NULL;
  *
  * ...
- * MSG_THREAD_VIEW_LIST_S threadViewList;
+ * msg_struct_list_s threadViewList;
  * ...
  * err = msg_get_thread_view_list(hMsgHandle, NULL, &threadViewList);
  * ...
@@ -1038,64 +1038,7 @@ int msg_get_folder_view_list(MSG_HANDLE_T handle, MSG_FOLDER_ID_T folder_id, con
  * \endcode
  */
 /*================================================================================================*/
-int msg_get_thread_view_list(MSG_HANDLE_T handle, const MSG_SORT_RULE_S *sort_rule, MSG_THREAD_VIEW_LIST_S *msg_thread_view_list);
-
-
-/**
-
- * \par Description:
- * Frees the memory of MSG_PEER_INFO_LIST_S allocated in msg_get_thread_view_list.
- *
- * \par Purpose:
- * This API is used to get the information of all peers to whom messages have been sent or recieved.
- *
- * \par Typical use case:
- * Get the common information from the specified folder from database.
- *
- * \par Method of function operation:
- * Frees the memory occupied by MSG_FOLDER_VIEW_LIST_S object and its members.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - The memory for a list will be allocated in this function.
- * - Applications need to call msg_release_thread_view_list to free the memory.
- * - However, if this function is failed, the memory for a list is NOT allocated in this function.
- *
- * \param input - msg_thread_view_list is a pointer to an MSG_THREAD_VIEW_LIST_S structure.
- *
- * \return Return Type (int(MSG_ERROR_T)) \n
- * - MSG_SUCCESS       - Success in operation.
- * - MSG_ERR_INVALID_PARAMETER - Parameter is invalid.
- * - MSG_ERR_STORAGE_ERROR - Storage is error.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- *
- * ...
- * MSG_THREAD_VIEW_LIST_S threadViewList;
- * ...
- * err = msg_get_thread_view_list(hMsgHandle, NULL, &threadViewList);
- * ...
- * msg_release_thread_view_list(&threadViewList);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-void msg_release_thread_view_list(MSG_THREAD_VIEW_LIST_S *msg_thread_view_list);
+int msg_get_thread_view_list(msg_handle_t handle, const msg_struct_t sort_rule, msg_struct_list_s *msg_thread_view_list);
 
 
 /**
@@ -1124,7 +1067,7 @@ void msg_release_thread_view_list(MSG_THREAD_VIEW_LIST_S *msg_thread_view_list);
  * \param input - thread_id is the ID of the thread to be returned.
  * \param output - msg_conv_view_list is a pointer to an MSG_CONV_VIEW_LIST_S structure.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS       - Success in operation.
  * - MSG_ERR_INVALID_PARAMETER - Parameter is invalid.
  * - MSG_ERR_STORAGE_ERROR - Storage is error.
@@ -1142,8 +1085,8 @@ void msg_release_thread_view_list(MSG_THREAD_VIEW_LIST_S *msg_thread_view_list);
  * \code
  * ...
  *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
+ * msg_handle_t msgHandle = NULL;
+ * msg_error_t err = MSG_SUCCESS;
  * ...
  * MSG_CONV_VIEW_LIST_S convViewList;
  * ...
@@ -1158,7 +1101,7 @@ void msg_release_thread_view_list(MSG_THREAD_VIEW_LIST_S *msg_thread_view_list);
  * \endcode
  */
 /*================================================================================================*/
-int msg_get_conversation_view_list(MSG_HANDLE_T handle, MSG_THREAD_ID_T thread_id, MSG_LIST_S *msg_conv_view_list);
+int msg_get_conversation_view_list(msg_handle_t handle, msg_thread_id_t thread_id, msg_struct_list_s *msg_conv_view_list);
 
 
 /**
@@ -1184,7 +1127,7 @@ int msg_get_conversation_view_list(MSG_HANDLE_T handle, MSG_THREAD_ID_T thread_i
  * \param input - handle is Message handle.
  * \param input - thread_id is the ID of the thread to be deleted.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS       - Success in operation.
  * - MSG_ERR_INVALID_PARAMETER - Parameter is invalid.
  * - MSG_ERR_STORAGE_ERROR - Storage is error.
@@ -1202,7 +1145,7 @@ int msg_get_conversation_view_list(MSG_HANDLE_T handle, MSG_THREAD_ID_T thread_i
  * \code
  * ...
  *
- * MSG_HANDLE_T msgHandle = NULL;
+ * msg_handle_t msgHandle = NULL;
  * MSG_SYNCML_MESSAGE_S syncMLMsg;
  * MSG_SENDINGOPT_S sendingOpt = {0};
  *
@@ -1222,7 +1165,7 @@ int msg_get_conversation_view_list(MSG_HANDLE_T handle, MSG_THREAD_ID_T thread_i
  * \endcode
  */
 /*================================================================================================*/
-int msg_delete_thread_message_list(MSG_HANDLE_T handle, MSG_THREAD_ID_T thread_id);
+int msg_delete_thread_message_list(msg_handle_t handle, msg_thread_id_t thread_id);
 
 
 /**
@@ -1248,7 +1191,7 @@ int msg_delete_thread_message_list(MSG_HANDLE_T handle, MSG_THREAD_ID_T thread_i
  * \param - handle is Message handle.
  * \param - folder_info is a pointer to an MSG_FOLDER_INFO_S structure.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS       - Success in operation.
  * - MSG_ERR_INVALID_PARAMETER - Parameter is invalid.
  * - MSG_ERR_STORAGE_ERROR - Storage is error.
@@ -1266,7 +1209,7 @@ int msg_delete_thread_message_list(MSG_HANDLE_T handle, MSG_THREAD_ID_T thread_i
  * \code
  * ...
  *
- * MSG_HANDLE_T msgHandle = NULL;
+ * msg_handle_t msgHandle = NULL;
  *  Make Folder
  * MSG_FOLDER_INFO_S folderInfo;
  * ...
@@ -1286,7 +1229,7 @@ int msg_delete_thread_message_list(MSG_HANDLE_T handle, MSG_THREAD_ID_T thread_i
  * \endcode
  */
 /*================================================================================================*/
-int msg_add_folder(MSG_HANDLE_T handle, const MSG_FOLDER_INFO_S *folder_info);
+int msg_add_folder(msg_handle_t handle, const msg_struct_t folder_info);
 
 
 /**
@@ -1312,7 +1255,7 @@ int msg_add_folder(MSG_HANDLE_T handle, const MSG_FOLDER_INFO_S *folder_info);
  * \param - handle is Message handle.
  * \param - folder_info is a pointer to an MSG_FOLDER_INFO_S structure.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS       - Success in operation.
  * - MSG_ERR_INVALID_PARAMETER - Parameter is invalid.
  * - MSG_ERR_STORAGE_ERROR - Storage is error.
@@ -1330,7 +1273,7 @@ int msg_add_folder(MSG_HANDLE_T handle, const MSG_FOLDER_INFO_S *folder_info);
  * \code
  * ...
  *
- * MSG_HANDLE_T msgHandle = NULL;
+ * msg_handle_t msgHandle = NULL;
  *  Make Folder
  * MSG_FOLDER_INFO_S folderInfo;
  * ...
@@ -1349,7 +1292,7 @@ int msg_add_folder(MSG_HANDLE_T handle, const MSG_FOLDER_INFO_S *folder_info);
  * \endcode
  */
 /*================================================================================================*/
-int msg_update_folder(MSG_HANDLE_T handle, const MSG_FOLDER_INFO_S *folder_info);
+int msg_update_folder(msg_handle_t handle, const msg_struct_t folder_info);
 
 
 /**
@@ -1375,7 +1318,7 @@ int msg_update_folder(MSG_HANDLE_T handle, const MSG_FOLDER_INFO_S *folder_info)
  * \param input - handle is Message handle.
  * \param input - folder_id is the ID of the folder to be deleted.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS       - Success in operation.
  * - MSG_ERR_INVALID_PARAMETER - Parameter is invalid.
  * - MSG_ERR_STORAGE_ERROR - Storage is error.
@@ -1393,7 +1336,7 @@ int msg_update_folder(MSG_HANDLE_T handle, const MSG_FOLDER_INFO_S *folder_info)
  * \code
  * ...
  *
- * MSG_HANDLE_T msgHandle = NULL;
+ * msg_handle_t msgHandle = NULL;
  * err = msg_open_msg_handle(&msgHandle);
  *
  * ...
@@ -1407,7 +1350,7 @@ int msg_update_folder(MSG_HANDLE_T handle, const MSG_FOLDER_INFO_S *folder_info)
  * \endcode
  */
 /*================================================================================================*/
-int msg_delete_folder(MSG_HANDLE_T handle, MSG_FOLDER_ID_T folder_id);
+int msg_delete_folder(msg_handle_t handle, msg_folder_id_t folder_id);
 
 
 /**
@@ -1431,71 +1374,9 @@ int msg_delete_folder(MSG_HANDLE_T handle, MSG_FOLDER_ID_T folder_id);
  * - None.
  *
  * \param input - handle is Message handle.
- * \param output - folder_list is a pointer to an MSG_FOLDER_LIST_S structure.
- *
- * \return Return Type (int(MSG_ERROR_T)) \n
- * - MSG_SUCCESS       - Success in operation.
- * - MSG_ERR_INVALID_PARAMETER - Parameter is invalid.
- * - MSG_ERR_STORAGE_ERROR - Storage is error.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
+ * \param output - folder_list is a pointer to an msg_struct_list_s structure.
  *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- *  MSG_FOLDER_LIST_S folderList;
-
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- * err = msg_get_folder_list(msgHandle, &folderList);
- * if( err != MSG_SUCCESS )
- * {
- *     printf("err [%d]", err);
- *     return err;
- * }
- * ...
- * msg_release_folder_list(&folderList);
- * \endcode
- */
-/*================================================================================================*/
-int msg_get_folder_list(MSG_HANDLE_T handle, MSG_FOLDER_LIST_S *folder_list);
-
-
-
-/**
-
- * \par Description:
- * Releases the memory of a folder list.
- *
- * \par Purpose:
- * This API is used to get the information list of folders.
- *
- * \par Typical use case:
- * Gets the folder list information.
- *
- * \par Method of function operation:
- * Sets up the database connection and queries for the folder list information.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - If folder_list is NULL, nothing happens.
- * - If folder_list is invalid, undefined behavior happens.
- *
- * \param input - folder_list is a pointer to an MSG_FOLDER_LIST_S structure.
- *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS       - Success in operation.
  * - MSG_ERR_INVALID_PARAMETER - Parameter is invalid.
  * - MSG_ERR_STORAGE_ERROR - Storage is error.
@@ -1513,8 +1394,8 @@ int msg_get_folder_list(MSG_HANDLE_T handle, MSG_FOLDER_LIST_S *folder_list);
  * \code
  * ...
  *
- * MSG_HANDLE_T msgHandle = NULL;
- *  MSG_FOLDER_LIST_S folderList;
+ * msg_handle_t msgHandle = NULL;
+ *  msg_struct_list_s folderList;
 
  * err = msg_open_msg_handle(&msgHandle);
  *
@@ -1530,7 +1411,7 @@ int msg_get_folder_list(MSG_HANDLE_T handle, MSG_FOLDER_LIST_S *folder_list);
  * \endcode
  */
 /*================================================================================================*/
-void msg_release_folder_list(MSG_FOLDER_LIST_S *folder_list);
+int msg_get_folder_list(msg_handle_t handle, msg_struct_list_s *folder_list);
 
 
 /**
@@ -1558,7 +1439,7 @@ void msg_release_folder_list(MSG_FOLDER_LIST_S *folder_list);
  * \param input - folder_id is the folder for the test messages.
  * \param input - num_msg is the number of messages.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS                                       Success in operation.
  * - MSG_ERR_INVALID_MSGHANDLE Parameter is invalid.
  * - MSG_ERR_INVALID_FOLDER_ID Storage is error.
@@ -1576,8 +1457,8 @@ void msg_release_folder_list(MSG_FOLDER_LIST_S *folder_list);
  * \code
  * ...
  *
- * MSG_HANDLE_T msgHandle = NULL;
- *  MSG_FOLDER_LIST_S folderList;
+ * msg_handle_t msgHandle = NULL;
+ *  msg_struct_list_s folderList;
 
  * err = msg_open_msg_handle(&msgHandle);
  *
@@ -1592,8 +1473,8 @@ void msg_release_folder_list(MSG_FOLDER_LIST_S *folder_list);
  * \endcode
  */
 /*================================================================================================*/
-int msg_generate_message(MSG_HANDLE_T handle, MSG_MESSAGE_TYPE_T msg_type, MSG_FOLDER_ID_T folder_id, unsigned int num_msg);
-int msg_generate_sms(MSG_HANDLE_T handle, MSG_FOLDER_ID_T folder_id, unsigned int num_msg) DEPRECATED;
+int msg_generate_message(msg_handle_t handle, msg_message_type_t msg_type, msg_folder_id_t folder_id, unsigned int num_msg);
+int msg_generate_sms(msg_handle_t handle, msg_folder_id_t folder_id, unsigned int num_msg) DEPRECATED;
 
 
 /**
@@ -1620,7 +1501,7 @@ int msg_generate_sms(MSG_HANDLE_T handle, MSG_FOLDER_ID_T folder_id, unsigned in
  * \param input - type is the type of message that Quick Panel need.
  * \param output - msg is a pointer to an msg_message_t structure.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS                                       Success in operation.
  * - MSG_ERR_INVALID_MSGHANDLE Parameter is invalid.
  * - MSG_ERR_INVALID_FOLDER_ID Storage is error.
@@ -1638,7 +1519,7 @@ int msg_generate_sms(MSG_HANDLE_T handle, MSG_FOLDER_ID_T folder_id, unsigned in
  * \code
  * ...
  *
- * MSG_HANDLE_T msgHandle = NULL;
+ * msg_handle_t msgHandle = NULL;
  * msg_message_t msgInfo;
 
  * err = msg_open_msg_handle(&msgHandle);
@@ -1654,7 +1535,7 @@ int msg_generate_sms(MSG_HANDLE_T handle, MSG_FOLDER_ID_T folder_id, unsigned in
  * \endcode
  */
 /*================================================================================================*/
-int msg_get_quick_panel_data(MSG_HANDLE_T handle, MSG_QUICKPANEL_TYPE_T type, msg_message_t msg);
+int msg_get_quick_panel_data(msg_handle_t handle, msg_quickpanel_type_t type, msg_struct_t msg);
 
 
 /**
@@ -1679,7 +1560,7 @@ int msg_get_quick_panel_data(MSG_HANDLE_T handle, MSG_QUICKPANEL_TYPE_T type, ms
  *
  * \param input - handle is Message handle.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS                                       Success in operation.
  * - MSG_ERR_INVALID_PARAMETER Parameter is invalid.
  * - MSG_ERR_STORAGE_ERROR             Storage is error.
@@ -1697,8 +1578,8 @@ int msg_get_quick_panel_data(MSG_HANDLE_T handle, MSG_QUICKPANEL_TYPE_T type, ms
  * \code
  * ...
  *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
+ * msg_handle_t msgHandle = NULL;
+ * msg_error_t err = MSG_SUCCESS;
  * err = msg_open_msg_handle(&msgHandle);
  *
  * ...
@@ -1712,7 +1593,7 @@ int msg_get_quick_panel_data(MSG_HANDLE_T handle, MSG_QUICKPANEL_TYPE_T type, ms
  * \endcode
  */
 /*================================================================================================*/
-int msg_reset_database(MSG_HANDLE_T handle);
+int msg_reset_database(msg_handle_t handle);
 
 
 /**
@@ -1738,7 +1619,7 @@ int msg_reset_database(MSG_HANDLE_T handle);
  * \param input - handle is Message handle.
  * \param output -     memsize is a pointer to the size.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS                                       Success in operation.
  * - MSG_ERR_INVALID_PARAMETER Parameter is invalid.
  * - MSG_ERR_STORAGE_ERROR             Storage is error.
@@ -1756,7 +1637,7 @@ int msg_reset_database(MSG_HANDLE_T handle);
  * \code
  * ...
  *
- * MSG_HANDLE_T msgHandle = NULL;
+ * msg_handle_t msgHandle = NULL;
  * int memsize = 0;
  * err = msg_open_msg_handle(&msgHandle);
  *
@@ -1771,35 +1652,34 @@ int msg_reset_database(MSG_HANDLE_T handle);
  * \endcode
  */
 /*================================================================================================*/
-int msg_get_mem_size(MSG_HANDLE_T handle, unsigned int* memsize);
-
+int msg_get_mem_size(msg_handle_t handle, unsigned int* memsize);
 
 /**
 
  * \par Description:
- * Return thread id in thread view object.
+ * Backup messages to storage.
  *
  * \par Purpose:
- * This API is used to get the thread id field in folder view object.
+ * This API is used to backup messages to storage.
  *
  * \par Typical use case:
- * Returns thread id value in thread view object.
+ * Backup messages to storage.
  *
  * \par Method of function operation:
- * Returns the threadId member of thread view object msg.
+ * Reads all the messages from Messaging database and writes to storage in V-Message format
  *
  * \par Sync (or) Async:
  * This is a Synchronous API.
  *
  * \par Important notes:
- * - If msg_thread is NULL, nothing happens.
- * - If msg_thread is invalid, undefined behavior happens.
+ * None
  *
- * \param msg_thread_view_t input - msg_thread is a thread view object.
+ * \param input - msg_handle_t  handle is Message handle.
  *
- * \return Return Type int (MSG_ERROR_T when negative, msg_id when positive) \n
- * - positive int                                              thread id.
- * - MSG_ERR_NULL_POINTER                              msg_thread is NULL.
+ * \return Return Type int (msg_error_t) \n
+ * - MSG_SUCCESS                                       Success in operation.
+ * - MSG_ERR_INVALID_PARAMETER Parameter is invalid.
+ * - MSG_ERR_STORAGE_ERROR             Storage is error.
  *
  * \par Prospective clients:
  * External/Native Apps using Messaging Services.
@@ -1814,51 +1694,44 @@ int msg_get_mem_size(MSG_HANDLE_T handle, unsigned int* memsize);
  * \code
  * ...
  *
- * MSG_HANDLE_T msgHandle = NULL;
- * msg_thread_view_t   msgThreadInfo;
- * MSG_ERROR_T err;
+ * msg_handle_t msgHandle = NULL;
+ * msg_error_t err;
  *
  * ...
- * err = msg_thread_view_get_thread_id(&msgThreadInfo);
- * if(msg_size > 0)
- * {
- * ...
- * }
+ * err = msg_backup_message(&msgHandle);
  * ...
  * \endcode
  */
 /*================================================================================================*/
-int msg_thread_view_get_thread_id(msg_thread_view_t msg_thread);
+int msg_backup_message(msg_handle_t handle);
 
 
 /**
 
  * \par Description:
- * Return address value in thread view object.
+ * Restore messages from backed up messages.
  *
  * \par Purpose:
- * This API is used to get the address value in thread view object.
+ * This API is used to restore messages from backed up messages.
  *
  * \par Typical use case:
- * Returns address value in thread view object.
+ * Restore messages from previously backed up messages.
  *
  * \par Method of function operation:
- * Returns the threadAddr member of thread view object msg.
+ * Reads the previously backup up messages and restores the database.
  *
  * \par Sync (or) Async:
  * This is a Synchronous API.
  *
  * \par Important notes:
- * - If msg_thread is NULL, nothing happens.
- * - If msg_thread is invalid, undefined behavior happens.
- * - You do not need to free the return value. It will be freed when you call msg_release_thread_view_list().
- * - Also, the value is valid until msg_thread_view_t is freed by calling msg_release_thread_view_list().
+ * None
  *
- * \param msg_thread_view_t input - msg_thread is a thread view object.
+ * \param input - msg_handle_t  handle is Message handle.
  *
- * \return Return Type int const char* (address value) \n
- * - const char*                                       address value.
- * - NULL                                                      msg_thread is NULL.
+ * \return Return Type int (msg_error_t) \n
+ * - MSG_SUCCESS                                       Success in operation.
+ * - MSG_ERR_INVALID_PARAMETER Parameter is invalid.
+ * - MSG_ERR_STORAGE_ERROR             Storage is error.
  *
  * \par Prospective clients:
  * External/Native Apps using Messaging Services.
@@ -1873,51 +1746,45 @@ int msg_thread_view_get_thread_id(msg_thread_view_t msg_thread);
  * \code
  * ...
  *
- * MSG_HANDLE_T msgHandle = NULL;
- * msg_thread_view_t   msgThreadInfo;
- * char* addr = NULL;
- *
- * ...
- * addr = msg_thread_view_get_address(&msgThreadInfo);
- * if(addr != 0 && strlen(addt) > 0)
- * {
- * ...
- * }
+ * msg_handle_t msgHandle = NULL;
+ * msg_error_t err;
+  * ...
+ * err = msg_restore_message(&msgHandle);
  * ...
  * \endcode
  */
 /*================================================================================================*/
-const char* msg_thread_view_get_address(msg_thread_view_t msg_thread);
+int msg_restore_message(msg_handle_t handle);
 
 
 /**
 
  * \par Description:
- * Return display name value in thread view object.
+ * Search messages or addresses which including a string that applcation want to find.
  *
  * \par Purpose:
- * This API is used to get the display name value in thread view object.
+ * This API is used to search messages or addresses from storage.
  *
  * \par Typical use case:
- * Returns address value in thread view object.
+ * Search messages or addresses from storage.
  *
  * \par Method of function operation:
- * Returns the threadName member of thread view object msg.
+ * search messages or addresses from storage.
  *
  * \par Sync (or) Async:
  * This is a Synchronous API.
  *
  * \par Important notes:
- * - If msg_thread is NULL, nothing happens.
- * - If msg_thread is invalid, undefined behavior happens.
- * - You do not need to free the return value. It will be freed when you call msg_release_thread_view_list().
- * - Also, the value is valid until msg_thread_view_t is freed by calling msg_release_thread_view_list().
+ * None
  *
- * \param msg_thread_view_t input - msg_thread is a thread view object.
+ * \param input - msg_handle_t  handle is Message handle.
+ * \param input - search_string is the string to search.
+ * \param output - msg_thread_view_list is a pointer to an msg_struct_list_s structure.
  *
- * \return Return Type int const char* (display name) \n
- * - const char*                                       display name.
- * - NULL                                                      msg_thread is NULL.
+ * \return Return Type int (msg_error_t) \n
+ * - MSG_SUCCESS                                       Success in operation.
+ * - MSG_ERR_INVALID_PARAMETER Parameter is invalid.
+ * - MSG_ERR_STORAGE_ERROR             Storage is error.
  *
  * \par Prospective clients:
  * External/Native Apps using Messaging Services.
@@ -1932,51 +1799,56 @@ const char* msg_thread_view_get_address(msg_thread_view_t msg_thread);
  * \code
  * ...
  *
- * MSG_HANDLE_T msgHandle = NULL;
- * msg_thread_view_t   msgThreadInfo;
- * char* disp_name = NULL;
- *
+ * msg_handle_t msgHandle = NULL;
+ * msg_error_t err = MSG_SUCCESS;
  * ...
- * disp_name = msg_thread_view_get_name(&msgThreadInfo);
- * if(disp_name != 0 && strlen(disp_name) > 0)
- * {
+ * char* search_string = "hello";
+ * msg_struct_list_s threadViewList;
  * ...
+ * err = msg_search_message_for_thread_view(&msgHandle, search_string, &threadViewList);
+ *
+ * if( err != MSG_SUCCESS )
+ * {
+ *     printf("err [%d]", err);
+ *     return err;
  * }
  * ...
  * \endcode
  */
 /*================================================================================================*/
-const char* msg_thread_view_get_name(msg_thread_view_t msg_thread);
+int msg_search_message_for_thread_view(msg_handle_t handle, const char *search_string, msg_struct_list_s *msg_thread_view_list);
 
 
 /**
 
  * \par Description:
- * Return image path in thread view object.
+ * Search messages or addresses which including a string that applcation want to find.
  *
  * \par Purpose:
- * This API is used to get the image path value in thread view object.
+ * This API is used to search messages or addresses from storage.
  *
  * \par Typical use case:
- * Returns image path value in thread view object.
+ * Search messages or addresses from storage.
  *
  * \par Method of function operation:
- * Returns the threadImagePath member of thread view object msg.
+ * search messages or addresses from storage.
  *
  * \par Sync (or) Async:
  * This is a Synchronous API.
  *
  * \par Important notes:
- * - If msg_thread is NULL, nothing happens.
- * - If msg_thread is invalid, undefined behavior happens.
- * - You do not need to free the return value. It will be freed when you call msg_release_thread_view_list().
- * - Also, the value is valid until msg_thread_view_t is freed by calling msg_release_thread_view_list().
+ * None
  *
- * \param msg_thread_view_t input - msg_thread is a thread view object.
+ * \param input - msg_handle_t  handle is Message handle.
+ * \param input - search_string is the string to search.
+ * \param input - offset is the offset of the search result.
+ * \param input - limit is the limit of the search result.
+ * \param output - msg_list is a pointer to an msg_struct_list_s structure.
  *
- * \return Return Type int const char* (thread image path) \n
- * - const char*                                       thread image path.
- * - NULL                                                      msg_thread is NULL.
+ * \return Return Type int (msg_error_t) \n
+ * - MSG_SUCCESS                                       Success in operation.
+ * - MSG_ERR_INVALID_PARAMETER Parameter is invalid.
+ * - MSG_ERR_STORAGE_ERROR             Storage is error.
  *
  * \par Prospective clients:
  * External/Native Apps using Messaging Services.
@@ -1991,51 +1863,62 @@ const char* msg_thread_view_get_name(msg_thread_view_t msg_thread);
  * \code
  * ...
  *
- * MSG_HANDLE_T msgHandle = NULL;
- * msg_thread_view_t   msgThreadInfo;
- * char* img_path = NULL;
+ * msg_handle_t msgHandle = NULL;
+ * msg_error_t err = MSG_SUCCESS;
+ * ...
+ * msg_struct_list_s msg_list;
+ * int offset = 0;
+ * int limit = 10;
+ *
+ * MSG_SEARCH_CONDITION_S searchCon;
+ *
+ * searchCon.msgType = MSG_TYPE_SMS;
+ * searchCon.folderId = MSG_INBOX_ID;
+ * searchCon.pSearchVal = "keyString";
+ * searchCon.pAddressVal = "01000000000";
  *
  * ...
- * img_path = msg_thread_view_get_name(&msgThreadInfo);
- * if(img_path != 0 && strlen(img_path) > 0)
+ * err = msg_search_message(hMsgHandle, &searchCon, offset, limit, &msgList);
+ *
+ * if( err != MSG_SUCCESS )
  * {
- * ...
+ *     printf("err [%d]", err);
+ *     return err;
  * }
  * ...
  * \endcode
  */
 /*================================================================================================*/
-const char* msg_thread_view_get_image_path(msg_thread_view_t msg_thread);
-
+int msg_search_message(msg_handle_t handle, const msg_struct_t msg_search_conditions, int offset, int limit, msg_struct_list_s *msg_list);
 
 /**
 
  * \par Description:
- * Return the message type field in thread view object.
+ * Get reject message list that application wants to find by phone number.
  *
  * \par Purpose:
- * This API is used to get the message type field value in thread view object.
+ * This API is used to get reject message list from storage.
  *
  * \par Typical use case:
- * Returns the message type value in thread view object.
+ * Get reject message list from storage.
  *
  * \par Method of function operation:
- * Returns the msgType member of thread view object msg.
+ * Get reject message list from storage.
  *
  * \par Sync (or) Async:
  * This is a Synchronous API.
  *
  * \par Important notes:
- * - If msg_thread is NULL, nothing happens.
- * - If msg_thread is invalid, undefined behavior happens.
- * - You do not need to free the return value. It will be freed when you call msg_release_thread_view_list().
- * - Also, the value is valid until msg_thread_view_t is freed by calling msg_release_thread_view_list().
- *
- * \param msg_thread_view_t input - msg_thread is a thread view object.
+ * None
  *
- * \return Return Type (int (MSG_ERROR_T when negative, msg_type when positive)) \n
- * - positive int                                      enum _MSG_MESSAGE_TYPE_E.
- * - EINVAL                                            msg_thread is NULL.
+ * \param input - msg_handle_t  handle is Message handle.
+ * \param input - phone_num is the string of phone number to find.
+ * \param output - msg_reject_msg_list is a pointer to an msg_struct_list_s structure.
+
+ * \return Return Type int (msg_error_t) \n
+ * - MSG_SUCCESS                                       Success in operation.
+ * - MSG_ERR_INVALID_PARAMETER Parameter is invalid.
+ * - MSG_ERR_STORAGE_ERROR             Storage is error.
  *
  * \par Prospective clients:
  * External/Native Apps using Messaging Services.
@@ -2050,47 +1933,54 @@ const char* msg_thread_view_get_image_path(msg_thread_view_t msg_thread);
  * \code
  * ...
  *
- * MSG_HANDLE_T msgHandle = NULL;
- * msg_thread_view_t   msgThreadInfo;
- * MSG_MESSAGE_TYPE_T msg_type;
- *
+ * msg_handle_t msgHandle = NULL;
+ * msg_error_t err = MSG_SUCCESS;
  * ...
- * msg_type = msg_thread_view_get_message_type(&msgThreadInfo);
+ * char* phone_num = "01030016057";
+ * msg_struct_list_s rejectMsgList;
+ * ...
+ * err = msg_get_reject_msg_list(hMsgHandle, phone_num, &rejectMsgList);
+ *
+ * if( err != MSG_SUCCESS )
+ * {
+ *     printf("err [%d]", err);
+ *     return err;
+ * }
  * ...
  * \endcode
  */
 /*================================================================================================*/
-int msg_thread_view_get_message_type(msg_thread_view_t msg_thread);
+int msg_get_reject_msg_list(msg_handle_t handle, const char* phone_num, msg_struct_list_s *msg_reject_msg_list);
 
 
 /**
 
  * \par Description:
- * Return data field in thread view object.
+ * Registers a callback function about the change of storage status to Message handle.
  *
  * \par Purpose:
- * This API is used to get the data field value in thread view object.
+ * This API is used to register a callback function about the change of storage status "msg_storage_change_cb" to Message handle.
  *
  * \par Typical use case:
- * Returns data value in thread view object.
+ * Register a callback function about the change of storage status.
  *
  * \par Method of function operation:
- * Returns the threadData member of thread view object msg.
+ * Adds the msg_storage_change_cb API to a callback function list.
  *
  * \par Sync (or) Async:
  * This is a Synchronous API.
  *
  * \par Important notes:
- * - If msg_thread is NULL, nothing happens.
- * - If msg_thread is invalid, undefined behavior happens.
- * - You do not need to free the return value. It will be freed when you call msg_release_thread_view_list().
- * - Also, the value is valid until msg_thread_view_t is freed by calling msg_release_thread_view_list().
+ *     This function MUST be called after Message handle is opened.
  *
- * \param msg_thread_view_t input - msg_thread is a thread view object.
+ * \param input - handle is Message handle.
+ * \param input - cb is a function to be called.
+ * \param input - user_param is a pointer to user data.
  *
- * \return Return Type int const char* (message data) \n
- * - const char*                                       message data.
- * - NULL                                                      msg_thread is NULL.
+ * \return Return Type (int(msg_error_t)) \n
+ * - MSG_SUCCESS                                                       Success in operation.
+ * - MSG_ERR_MSGHANDLE_NOT_CONNECTED   Message handle is not connected.
+ * - MSG_ERR_MEMORY_ERROR                              Memory is error.
  *
  * \par Prospective clients:
  * External/Native Apps using Messaging Services.
@@ -2105,51 +1995,55 @@ int msg_thread_view_get_message_type(msg_thread_view_t msg_thread);
  * \code
  * ...
  *
- * MSG_HANDLE_T msgHandle = NULL;
- * msg_thread_view_t   msgThreadInfo;
- * char* msg_data = NULL;
+ * int err = MSG_SUCCESS;
  *
- * ...
- * msg_data = msg_thread_view_get_data(&msgThreadInfo);
- * if(msg_data != 0 && strlen(msg_data) > 0)
+ * err = msg_reg_storage_change_callback(msgHandle, &storageCB, NULL);
+ * if (err != MSG_SUCCESS)
  * {
  * ...
  * }
+ * return;
+ * }
+ *
+ * void storageCB(msg_handle_t handle, msg_thread_id_t threadId, msg_message_id_t msgId, void *user_param)
+ * {
+ *     ...
+ * }
  * ...
  * \endcode
  */
 /*================================================================================================*/
-const char* msg_thread_view_get_data(msg_thread_view_t msg_thread);
+int msg_reg_storage_change_callback(msg_handle_t handle, msg_storage_change_cb cb, void *user_param);
 
 
 /**
 
  * \par Description:
- * Return time field in thread view object.
+ * Gets the report status information of message.
  *
  * \par Purpose:
- * This API is used to get the time field value in thread view object.
+ * This API is used to get the report status information of specified message.
  *
  * \par Typical use case:
- * Returns time value in thread view object.
+ * Gets the report status information of specified message from the database.
  *
  * \par Method of function operation:
- * Returns the threadTime member of thread view object msg.
+ * Sets up the database connection and Gets the report status information of specified message from the report table.
  *
  * \par Sync (or) Async:
  * This is a Synchronous API.
  *
  * \par Important notes:
- * - If msg_thread is NULL, nothing happens.
- * - If msg_thread is invalid, undefined behavior happens.
- * - You do not need to free the return value. It will be freed when you call msg_release_thread_view_list().
- * - Also, the value is valid until msg_thread_view_t is freed by calling msg_release_thread_view_list().
+ * - None
  *
- * \param msg_thread_view_t input - msg_thread is a thread view object.
+ * \param input - handle is Message handle.
+ * \param input - msg_id is the ID of the message.
+ * \param output - report_status is a pointer to a MSG_REPORT_STATUS_INFO_S structure.
  *
- * \return Return Type (time_t) \n
- * - time_t                                            message time.
- * - NULL                                                      thread view object is NULL.
+ * \return Return Type (int(msg_error_t)) \n
+ * - MSG_SUCCESS       - Success in operation.
+ * - MSG_ERR_INVALID_PARAMETER - Parameter is invalid.
+ * - MSG_ERR_STORAGE_ERROR - Storage is error.
  *
  * \par Prospective clients:
  * External/Native Apps using Messaging Services.
@@ -2164,858 +2058,41 @@ const char* msg_thread_view_get_data(msg_thread_view_t msg_thread);
  * \code
  * ...
  *
- * MSG_HANDLE_T msgHandle = NULL;
- * msg_thread_view_t   msgThreadInfo;
- * time_t msg_time;
+ * msg_handle_t msgHandle = NULL;
+ * MSG_REPORT_STATUS_INFO_S reportStatus;
+ *
+ * ...
+ *
+ * err = msg_open_msg_handle(&msgHandle);
  *
  * ...
- * msg_time = msg_thread_view_get_time(&msgThreadInfo);
+ *
+ * err = msg_get_report_status(msgHandle, msgID, &reportStatus)
+* if( err != MSG_SUCCESS )
+ * {
+ *     printf("err [%d]", err);
+ *     return err;
+ * }
+ *
  * ...
  * \endcode
  */
 /*================================================================================================*/
-time_t* msg_thread_view_get_time(msg_thread_view_t msg_thread);
+int msg_get_report_status(msg_handle_t handle, msg_message_id_t msg_id, msg_struct_t report_status);
 
 
-/**
 
- * \par Description:
- * Return direction field in thread view object.
- *
- * \par Purpose:
- * This API is used to get the direction field value in thread view object.
- *
- * \par Typical use case:
- * Returns direction value in thread view object.
- *
- * \par Method of function operation:
- * Returns the direction member of thread view object msg.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - If msg_thread is NULL, nothing happens.
- * - If msg_thread is invalid, undefined behavior happens.
- *
- * \param msg_thread_view_t input - msg_thread is a thread view object.
- *
- * \return Return Type (time_t) \n
- * - positive int                                      enum _MSG_DIRECTION_TYPE_E.
- * - MSG_ERR_NULL_POINTER                              msg_thread is NULL.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * msg_thread_view_t   msgThreadInfo;
- * int direction;
- *
- * ...
- * direction = msg_thread_view_get_direction(&msgThreadInfo);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-int msg_thread_view_get_direction(msg_thread_view_t msg_thread);
-
-
-/**
-
- * \par Description:
- * Return contact id field in thread view object.
- *
- * \par Purpose:
- * This API is used to get the contact id field value in thread view object.
- *
- * \par Typical use case:
- * Returns contact id value in thread view object.
- *
- * \par Method of function operation:
- * Returns the contactId member of thread view object msg.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - If msg_thread is NULL, nothing happens.
- * - If msg_thread is invalid, undefined behavior happens.
- *
- * \param msg_thread_view_t input - msg_thread is a thread view object.
- *
- * \return Return Type (int (MSG_ERROR_T when negative, contact id when positive)) \n
- * - positive int                                      contact id
- * - MSG_ERR_NULL_POINTER                      msg_thread is NULL.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * msg_thread_view_t   msgThreadInfo;
- * int contact_id;
- *
- * ...
- * contact_id = msg_thread_view_get_contact_id(&msgThreadInfo);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-int msg_thread_view_get_contact_id(msg_thread_view_t msg_thread);
-
-
-/**
-
- * \par Description:
- * Return unread message count field in thread view object.
- *
- * \par Purpose:
- * This API is used to get the unread message count field value in thread view object.
- *
- * \par Typical use case:
- * Returns unread message count value in thread view object.
- *
- * \par Method of function operation:
- * Returns the unreadCnt member of thread view object msg.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - If msg_thread is NULL, nothing happens.
- * - If msg_thread is invalid, undefined behavior happens.
- *
- * \param msg_thread_view_t input - msg_thread is a thread view object.
- *
- * \return Return Type nt (MSG_ERROR_T when negative, unread message count  when positive) \n
- * - positive int                                      unread message count \n
- * - MSG_ERR_NULL_POINTER                      msg_thread is NULL.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * msg_thread_view_t   msgThreadInfo;
- * int unread_count;
- *
- * ...
- * unread_count= msg_thread_view_get_unread_cnt(&msgThreadInfo);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-int msg_thread_view_get_unread_cnt(msg_thread_view_t msg_thread);
-
-
-
-/**
-
- * \par Description:
- * Return sms message count field in thread view object.
- *
- * \par Purpose:
- * This API is used to get the sms message count field value in thread view object.
- *
- * \par Typical use case:
- * Returns sms message count value in thread view object.
- *
- * \par Method of function operation:
- * Returns the smsCnt member of thread view object msg.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - If msg_thread is NULL, nothing happens.
- * - If msg_thread is invalid, undefined behavior happens.
- *
- * \param msg_thread_view_t input - msg_thread is a thread view object.
- *
- * \return Return Type int (MSG_ERROR_T when negative, sms message count when positive) \n
- * - positive int                                      sms message count
- * - MSG_ERR_NULL_POINTER                      msg_thread is NULL.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * msg_thread_view_t   msgThreadInfo;
- * int sms_count;
- *
- * ...
- * sms_count= msg_thread_view_get_sms_cnt(&msgThreadInfo);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-int msg_thread_view_get_sms_cnt(msg_thread_view_t msg_thread);
-
-
-/**
-
- * \par Description:
- * Return mms message count field in thread view object.
- *
- * \par Purpose:
- * This API is used to get the mms message count field value in thread view object.
- *
- * \par Typical use case:
- * Returns mms message count value in thread view object.
- *
- * \par Method of function operation:
- * Returns the mmsCnt member of thread view object msg.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - If msg_thread is NULL, nothing happens.
- * - If msg_thread is invalid, undefined behavior happens.
- *
- * \param msg_thread_view_t input - msg_thread is a thread view object.
- *
- * \return Return Type int (MSG_ERROR_T when negative, mms message count when positive) \n
- * - positive int                                      sms message count
- * - MSG_ERR_NULL_POINTER                      msg_thread is NULL.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * msg_thread_view_t   msgThreadInfo;
- * int mms_count;
- *
- * ...
- * mms_count= msg_thread_view_get_mms_cnt(&msgThreadInfo);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-int msg_thread_view_get_mms_cnt(msg_thread_view_t msg_thread);
-
-
-/**
-
- * \par Description:
- * Search messages or addresses which including a string that applcation want to find.
- *
- * \par Purpose:
- * This API is used to search messages or addresses from storage.
- *
- * \par Typical use case:
- * Search messages or addresses from storage.
- *
- * \par Method of function operation:
- * search messages or addresses from storage.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * None
- *
- * \param input - MSG_HANDLE_T  handle is Message handle.
- * \param input - search_string is the string to search.
- * \param output - msg_thread_view_list is a pointer to an MSG_THREAD_VIEW_LIST_S structure.
- *
- * \return Return Type int (MSG_ERROR_T) \n
- * - MSG_SUCCESS                                       Success in operation.
- * - MSG_ERR_INVALID_PARAMETER Parameter is invalid.
- * - MSG_ERR_STORAGE_ERROR             Storage is error.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * ...
- * char* search_string = "hello";
- * MSG_THREAD_VIEW_LIST_S threadViewList;
- * ...
- * err = msg_search_message_for_thread_view(&msgHandle, search_string, &threadViewList);
- *
- * if( err != MSG_SUCCESS )
- * {
- *     printf("err [%d]", err);
- *     return err;
- * }
- * ...
- * \endcode
- */
-/*================================================================================================*/
-int msg_search_message_for_thread_view(MSG_HANDLE_T handle, const char *search_string, MSG_THREAD_VIEW_LIST_S *msg_thread_view_list);
-
-
-/**
-
- * \par Description:
- * Search messages or addresses which including a string that applcation want to find.
- *
- * \par Purpose:
- * This API is used to search messages or addresses from storage.
- *
- * \par Typical use case:
- * Search messages or addresses from storage.
- *
- * \par Method of function operation:
- * search messages or addresses from storage.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * None
- *
- * \param input - MSG_HANDLE_T  handle is Message handle.
- * \param input - search_string is the string to search.
- * \param input - offset is the offset of the search result.
- * \param input - limit is the limit of the search result.
- * \param output - msg_list is a pointer to an MSG_LIST_S structure.
- *
- * \return Return Type int (MSG_ERROR_T) \n
- * - MSG_SUCCESS                                       Success in operation.
- * - MSG_ERR_INVALID_PARAMETER Parameter is invalid.
- * - MSG_ERR_STORAGE_ERROR             Storage is error.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * ...
- * MSG_LIST_S msg_list;
- * int offset = 0;
- * int limit = 10;
- *
- * MSG_SEARCH_CONDITION_S searchCon;
- *
- * searchCon.msgType = MSG_TYPE_SMS;
- * searchCon.folderId = MSG_INBOX_ID;
- * searchCon.pSearchVal = "keyString";
- * searchCon.pAddressVal = "01000000000";
- *
- * ...
- * err = msg_search_message(hMsgHandle, &searchCon, offset, limit, &msgList);
- *
- * if( err != MSG_SUCCESS )
- * {
- *     printf("err [%d]", err);
- *     return err;
- * }
- * ...
- * \endcode
- */
-/*================================================================================================*/
-int msg_search_message(MSG_HANDLE_T handle, const MSG_SEARCH_CONDITION_S *msg_search_conditions, int offset, int limit, MSG_LIST_S *msg_list);
-
-
-/**
-
- * \par Description:
- * Free the memory of msg_message_t, which is created by msg_new_message().
- *
- * \par Purpose:
- * This API is used to release memory created by message creation.
- *
- * \par Typical use case:
- * After using message object for send/save scenario, release message need to be called.
- *
- * \par Method of function operation:
- * Frees the memory allocated to message object and deletes the object.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - None
- *
- * \param msg_message_t    input - message object to be destroyed .
- *
- * \return Return Type (int(MSG_ERROR_T)) \n
- * - MSG_SUCCESS       - Successfully connected to Messaging Service \n
- * - MSG_ERR_NULL_POINTER      -       Input parameter is NULL.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * msg_message_t               msg;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * msg = msg_new_message();
- * ...
- * err = msg_release_message(&msg);
- *
- * if (err != MSG_SUCCESS)
- * {
- *     sprintf(str, "msg_release_message() Fail [%d]", err);
- *     print(str);
- *
- *     return err; // if success, return OPERATION_SUCCESS. Or if fail, return related error code.
- * }
- *
- * ...
- * \endcode
- */
-/*================================================================================================*/
-int msg_release_message_list(MSG_LIST_S *msg_list);
-
-
-/**
-
- * \par Description:
- * Get message ID list that application wants to find by reference ID.
- *
- * \par Purpose:
- * This API is used to get message ID list from storage.
- *
- * \par Typical use case:
- * Get message ID list from storage.
- *
- * \par Method of function operation:
- * Get message ID list from storage.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * None
- *
- * \param input - MSG_HANDLE_T  handle is Message handle.
- * \param input - ref_id is the reference id of message group.
- * \param output - msg_msgid_list is a pointer to an MSG_MSGID_LIST_S structure.
- *
- * \return Return Type int (MSG_ERROR_T) \n
- * - MSG_SUCCESS                                       Success in operation.
- * - MSG_ERR_INVALID_PARAMETER Parameter is invalid.
- * - MSG_ERR_STORAGE_ERROR             Storage is error.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * ...
- * MSG_REFERENCE_ID_T refId = 0;
- * MSG_MSGID_LIST_S msgIdList;
- * ...
- * err = msg_get_msgid_list(hMsgHandle, refId, &msgIdList);
- *
- * if( err != MSG_SUCCESS )
- * {
- *     printf("err [%d]", err);
- *     return err;
- * }
- * ...
- * \endcode
- */
-/*================================================================================================*/
-int msg_get_msgid_list(MSG_HANDLE_T handle, MSG_REFERENCE_ID_T ref_id, MSG_MSGID_LIST_S *msg_msgid_list);
-
-
-/**
-
- * \par Description:
- * Frees the memory of MSG_MSGID_LIST_S allocated in msg_get_msgid_list.
- *
- * \par Purpose:
- * This API is used to free the memory of MSG_MSGID_LIST_S allocated in msg_get_msgid_list.
- *
- * \par Typical use case:
- * To free the memory of MSG_MSGID_LIST_S and its members which was allocated in msg_get_msgid_list.
- *
- * \par Method of function operation:
- * To free the memory of MSG_MSGID_LIST_S and its members which was allocated in msg_get_msgid_list.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - If MSG_MSGID_LIST_S is NULL, nothing happens.
- * - If MSG_MSGID_LIST_S is invalid, undefined behavior happens.
- *
- * \param input - MSG_MSGID_LIST_S structure.
- *
- * \return Return Type (void) \n
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * - None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * ...
- * MSG_REFERENCE_ID_T refId = 0;
- * MSG_MSGID_LIST_S msgIdList;
- * ...
- * err = msg_get_msgid_list(hMsgHandle, refId, &msgIdList);
- *
- * if( err != MSG_SUCCESS )
- * {
- *     printf("err [%d]", err);
- *     return err;
- * }
- *
- * msg_release_msgid_list(&msgIdList);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-void msg_release_msgid_list(MSG_MSGID_LIST_S *msg_msgid_list);
-
-
-/**
-
- * \par Description:
- * Get reject message list that application wants to find by phone number.
- *
- * \par Purpose:
- * This API is used to get reject message list from storage.
- *
- * \par Typical use case:
- * Get reject message list from storage.
- *
- * \par Method of function operation:
- * Get reject message list from storage.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * None
- *
- * \param input - MSG_HANDLE_T  handle is Message handle.
- * \param input - phone_num is the string of phone number to find.
- * \param output - msg_reject_msg_list is a pointer to an MSG_REJECT_MSG_LIST_S structure.
-
- * \return Return Type int (MSG_ERROR_T) \n
- * - MSG_SUCCESS                                       Success in operation.
- * - MSG_ERR_INVALID_PARAMETER Parameter is invalid.
- * - MSG_ERR_STORAGE_ERROR             Storage is error.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * ...
- * char* phone_num = "01030016057";
- * MSG_REJECT_MSG_LIST_S rejectMsgList;
- * ...
- * err = msg_get_reject_msg_list(hMsgHandle, phone_num, &rejectMsgList);
- *
- * if( err != MSG_SUCCESS )
- * {
- *     printf("err [%d]", err);
- *     return err;
- * }
- * ...
- * \endcode
- */
-/*================================================================================================*/
-int msg_get_reject_msg_list(MSG_HANDLE_T handle, const char* phone_num, MSG_REJECT_MSG_LIST_S *msg_reject_msg_list);
-
-
-/**
 
- * \par Description:
- * Frees the memory of MSG_REJECT_MSG_LIST_S allocated in msg_get_reject_msg_list.
- *
- * \par Purpose:
- * This API is used to free the memory of MSG_REJECT_MSG_LIST_S allocated in msg_get_reject_msg_list.
- *
- * \par Typical use case:
- * To free the memory of MSG_REJECT_MSG_LIST_S and its members which was allocated in msg_get_reject_msg_list.
- *
- * \par Method of function operation:
- * To free the memory of MSG_REJECT_MSG_LIST_S and its members which was allocated in msg_get_reject_msg_list.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - If MSG_REJECT_MSG_LIST_S is NULL, nothing happens.
- * - If MSG_REJECT_MSG_LIST_S is invalid, undefined behavior happens.
- *
- * \param input - MSG_REJECT_MSG_LIST_S structure.
- *
- * \return Return Type (void) \n
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * - None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_ERROR_T err = MSG_SUCCESS;
- * ...
- * char* phone_num = "01030016057";
- * MSG_REJECT_MSG_LIST_S rejectMsgList;
- * ...
- * err = msg_get_reject_msg_list(hMsgHandle, phone_num, &rejectMsgList);
- *
- * if( err != MSG_SUCCESS )
- * {
- *     printf("err [%d]", err);
- *     return err;
- * }
- *
- * msg_release_reject_msg_list(&rejectMsgList);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-void msg_release_reject_msg_list(MSG_REJECT_MSG_LIST_S *msg_reject_msg_list);
+int msg_get_address_list(msg_handle_t handle, msg_thread_id_t thread_id, msg_struct_list_s *msg_address_list);
 
 
-/**
+int msg_get_thread_id_by_address(msg_handle_t handle, msg_struct_list_s *msg_address_list, msg_thread_id_t *thread_id);
 
- * \par Description:
- * Registers a callback function about the change of storage status to Message handle.
- *
- * \par Purpose:
- * This API is used to register a callback function about the change of storage status "msg_storage_change_cb" to Message handle.
- *
- * \par Typical use case:
- * Register a callback function about the change of storage status.
- *
- * \par Method of function operation:
- * Adds the msg_storage_change_cb API to a callback function list.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- *     This function MUST be called after Message handle is opened.
- *
- * \param input - handle is Message handle.
- * \param input - cb is a function to be called.
- * \param input - user_param is a pointer to user data.
- *
- * \return Return Type (int(MSG_ERROR_T)) \n
- * - MSG_SUCCESS                                                       Success in operation.
- * - MSG_ERR_MSGHANDLE_NOT_CONNECTED   Message handle is not connected.
- * - MSG_ERR_MEMORY_ERROR                              Memory is error.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * int err = MSG_SUCCESS;
- *
- * err = msg_reg_storage_change_callback(msgHandle, &storageCB, NULL);
- * if (err != MSG_SUCCESS)
- * {
- * ...
- * }
- * return;
- * }
- *
- * void storageCB(MSG_HANDLE_T handle, MSG_THREAD_ID_T threadId, MSG_MESSAGE_ID_T msgId, void *user_param)
- * {
- *     ...
- * }
- * ...
- * \endcode
- */
-/*================================================================================================*/
-int msg_reg_storage_change_callback(MSG_HANDLE_T handle, msg_storage_change_cb cb, void *user_param);
 
+int msg_get_thread(msg_handle_t handle, msg_thread_id_t thread_id, msg_struct_t msg_thread);
 
-/**
 
- * \par Description:
- * Gets the report status information of message.
- *
- * \par Purpose:
- * This API is used to get the report status information of specified message.
- *
- * \par Typical use case:
- * Gets the report status information of specified message from the database.
- *
- * \par Method of function operation:
- * Sets up the database connection and Gets the report status information of specified message from the report table.
- *
- * \par Sync (or) Async:
- * This is a Synchronous API.
- *
- * \par Important notes:
- * - None
- *
- * \param input - handle is Message handle.
- * \param input - msg_id is the ID of the message.
- * \param output - report_status is a pointer to a MSG_REPORT_STATUS_INFO_S structure.
- *
- * \return Return Type (int(MSG_ERROR_T)) \n
- * - MSG_SUCCESS       - Success in operation.
- * - MSG_ERR_INVALID_PARAMETER - Parameter is invalid.
- * - MSG_ERR_STORAGE_ERROR - Storage is error.
- *
- * \par Prospective clients:
- * External/Native Apps using Messaging Services.
- *
- * \par Related functions:
- * None
- *
- * \par Known issues/bugs:
- * None
- *
- * \par Sample code:
- * \code
- * ...
- *
- * MSG_HANDLE_T msgHandle = NULL;
- * MSG_REPORT_STATUS_INFO_S reportStatus;
- *
- * ...
- *
- * err = msg_open_msg_handle(&msgHandle);
- *
- * ...
- *
- * err = msg_get_report_status(msgHandle, msgID, &reportStatus)
-* if( err != MSG_SUCCESS )
- * {
- *     printf("err [%d]", err);
- *     return err;
- * }
- *
- * ...
- * \endcode
- */
-/*================================================================================================*/
-int msg_get_report_status(MSG_HANDLE_T handle, MSG_MESSAGE_ID_T msg_id, MSG_REPORT_STATUS_INFO_S *report_status);
+int msg_get_message_list(msg_handle_t handle, msg_folder_id_t folder_id, msg_thread_id_t thread_id, msg_message_type_t msg_type, msg_storage_id_t storage_id, msg_struct_list_s *msg_list);
 
 /**
  *     @}
diff --git a/include/mapi/msg_storage_types.h b/include/mapi/msg_storage_types.h
new file mode 100755 (executable)
index 0000000..7f0c9ba
--- /dev/null
@@ -0,0 +1,211 @@
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#ifndef MSG_STORAGE_TYPES_H_
+#define MSG_STORAGE_TYPES_H_
+
+/*==================================================================================================
+                                         INCLUDE FILES
+==================================================================================================*/
+
+#include "msg_types.h"
+
+/*==================================================================================================
+                                         STRUCTURES
+==================================================================================================*/
+
+/**
+ *     @brief  Represents message id list.
+ */
+typedef struct
+{
+       int                                     nCount;                         /**< The count of message id informatioin */
+       msg_message_id_t        *msgIdList;                     /**< The pointer to message id informatioin */
+}msg_id_list_s;
+
+
+/*==================================================================================================
+                                         TYPES
+==================================================================================================*/
+
+/**
+ *     @brief  Represents a folder type. \n
+ *     The values for this type SHOULD be in _MSG_FOLDER_TYPE_E.
+ */
+typedef unsigned char msg_folder_type_t;
+
+
+/**
+ *     @brief  Represents a sort type. \n
+ *     The values for this type SHOULD be in \ref _MSG_SORT_TYPE_E.
+ */
+typedef unsigned char msg_sort_type_t;
+
+
+/**
+ *     @brief  Represents a Saved SIM message ID.
+ */
+typedef signed short msg_sim_id_t;
+
+
+/**
+ *     @brief  Represents a message type for quick panel. \n
+ *     The values for this type SHOULD be in \ref _MSG_QUICKPANEL_TYPE_E.
+ */
+typedef unsigned char msg_quickpanel_type_t;
+
+
+/**
+ *     @brief  Represents a storage change CB type. \n
+ *     The values for this type SHOULD be in \ref _MSG_STORAGE_CHANGE_TYPE_E.
+ */
+typedef unsigned char msg_storage_change_type_t;
+
+
+/** @brief     Prototype of the function that will be called when the database of message framework is changed.
+ *     Applications SHOULD implement this callback function and register it into Message handle.
+ *     For how to register this callback function, please refer to msg_reg_storage_change_callback.
+ *     The callback function runs in the application process, not in the framework process.
+ *     @param[in]      handle is Message handle.
+ *     @param[in]      user_param is a pointer to user data.
+ *     @return void
+ */
+typedef void (*msg_storage_change_cb)(msg_handle_t handle, msg_storage_change_type_t storageChangeType, msg_id_list_s *pMsgIdList, void *user_param);
+
+
+/*==================================================================================================
+                                         ENUMS
+==================================================================================================*/
+
+/**
+ *     @brief  Represents the values of a storage type. \n
+ *     This enum is used as the value of msg_storage_id_t.
+ */
+enum _MSG_STORAGE_ID_E
+{
+       MSG_STORAGE_UNKNOWN = 0,                /**< Storage Id is unknown. */
+       MSG_STORAGE_PHONE,                      /**< Storage Id is Phone. */
+       MSG_STORAGE_SIM,                                /**< Storage Id is SIM card. */
+};
+
+
+/**
+ *     @brief  Represents the values of a storage type. \n
+ *     This enum is used as the value of msg_folder_id_t.
+ */
+enum _MSG_FOLDER_ID_E
+{
+       MSG_IOSBOX_ID = -1,                     /**< Indicates INBOX, OUTBOX and SENTBOX group folder id. (Only for search option.) */
+       MSG_ALLBOX_ID = 0,                              /**< Indicates INBOX, OUTBOX, SENTBOX and DRAFTBOX group folder id. (Only for search option.) */
+       MSG_INBOX_ID = 1,
+       MSG_OUTBOX_ID = 2,
+       MSG_SENTBOX_ID = 3,
+       MSG_DRAFT_ID = 4,
+       MSG_CBMSGBOX_ID = 5,
+       MSG_SPAMBOX_ID = 6,
+       MSG_SMS_TEMPLATE_ID = 7,
+       MSG_MMS_TEMPLATE_ID = 8,
+
+       // new folder should be placed here
+
+       MSG_MAX_FOLDER_ID
+};
+
+
+/**
+ *     @brief  Represents the values of a folder type. \n
+ *     This enum is used as the value of msg_folder_type_t.
+ */
+enum _MSG_FOLDER_TYPE_E
+{
+       MSG_FOLDER_TYPE_INBOX = 1,              /**< Inbox folder */
+       MSG_FOLDER_TYPE_OUTBOX,         /**< Outbox folder */
+       MSG_FOLDER_TYPE_DRAFT,          /**< Draft folder */
+       MSG_FOLDER_TYPE_SPAMBOX,                /**< Spambox folder */
+       MSG_FOLDER_TYPE_TEMPLATE,               /**< Template folder */
+       MSG_FOLDER_TYPE_USER_DEF                /**< Folder which is created by a user */
+};
+
+
+/**
+ *     @brief  Represents the values of a sort type. \n
+ *     This enum is used as the value of msg_sort_type_t.
+ */
+enum _MSG_SORT_TYPE_E
+{
+       MSG_SORT_BY_UNKNOWN = 0,                        /**< Unknown sort type */
+       MSG_SORT_BY_DISPLAY_FROM,               /**< Sort by display from */
+       MSG_SORT_BY_DISPLAY_TO,                 /**< Sort by display to */
+       MSG_SORT_BY_DISPLAY_TIME,                       /**< Sort by display time */
+       MSG_SORT_BY_MSG_TYPE,                           /**< Sort by msg type */
+       MSG_SORT_BY_READ_STATUS,                        /**< Sort by read status */
+       MSG_SORT_BY_STORAGE_TYPE,               /**< Sort by storage type */
+       MSG_SORT_BY_THREAD_NAME,                        /**< Sort by name for thread view*/
+       MSG_SORT_BY_THREAD_DATE,                        /**< Sort by date for thread view*/
+       MSG_SORT_BY_THREAD_COUNT,               /**< Sort by count for thread view*/
+};
+
+
+/**
+ *     @brief  Represents the values of a message type for quick panel. \n
+ *     This enum is used as the value of msg_quickpanel_type_t.
+ */
+enum _MSG_QUICKPANEL_TYPE_E
+{
+       MSG_QUICKPANEL_SMS = 0,
+       MSG_QUICKPANEL_MMS,
+       MSG_QUICKPANEL_DELIVER_REP,
+       MSG_QUICKPANEL_READ_REP,
+       MSG_QUICKPANEL_VOICEMAIL,
+       MSG_QUICKPANEL_MMS_NOTI,
+};
+
+/**
+ *     @}
+ */
+enum _MSG_COUNT_LIMIT_MAILBOX_TYPE_E
+{
+       MSG_COUNT_LIMIT_INBOX_TYPE,
+       MSG_COUNT_LIMIT_OUTBOX_TYPE,
+       MSG_COUNT_LIMIT_SENTBOX_TYPE,
+       MSG_COUNT_LIMIT_DRAFTBOX_TYPE,
+       MSG_COUNT_LIMIT_CBMSGBOX_TYPE,
+       MSG_COUNT_LIMIT_MAILBOX_TYPE_MAX,
+};
+
+enum _MSG_COUNT_LIMIT_MSG_TYPE_E
+{
+       MSG_COUNT_LIMIT_SMS_TYPE,
+       MSG_COUNT_LIMIT_MMS_TYPE,
+       MSG_COUNT_LIMIT_CB_TYPE,
+       MSG_COUNT_LIMIT_WAPPUSH_TYPE,
+       MSG_COUNT_LIMIT_PROVISION_TYPE,
+       MSG_COUNT_LIMIT_MSG_TYPE_MAX,
+};
+
+enum _MSG_STORAGE_CHANGE_TYPE_E
+{
+       // msg data
+       MSG_STORAGE_CHANGE_INSERT = 1,
+       MSG_STORAGE_CHANGE_UPDATE,
+       MSG_STORAGE_CHANGE_DELETE,
+
+       // thread data
+       MSG_STORAGE_CHANGE_CONTACT,
+};
+
+
+#endif /* MSG_STORAGE_TYPES_H_ */
similarity index 88%
rename from include/mapi/MapiTransport.h
rename to include/mapi/msg_transport.h
index fefe251..f5b9e0d 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 /**
  *     @file           MapiTransport.h
@@ -34,7 +34,7 @@
                                          INCLUDE FILES
 ==================================================================================================*/
 
-#include "MsgTransportTypes.h"
+#include "msg_transport_types.h"
 
 #ifdef __cplusplus
 extern "C"
@@ -76,7 +76,7 @@ extern "C"
  * \param input  - handle is Message handle.
  * \param input  - req is a pointer to an MSG_REQUEST_S structure.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS                                       Success in operation.
  * - MSG_ERR_INVALID_MSGHANDLE Message handle is invalid.
  * - MSG_ERR_NULL_POINTER                      Pointer is NULL.
@@ -110,7 +110,7 @@ extern "C"
  * \endcode
  */
 /*================================================================================================*/
-int msg_submit_req(MSG_HANDLE_T handle, MSG_REQUEST_S *req);
+int msg_submit_req(msg_handle_t handle, msg_struct_t req);
 
 
 /**
@@ -137,7 +137,7 @@ int msg_submit_req(MSG_HANDLE_T handle, MSG_REQUEST_S *req);
  * \param input - cb is a function to be called.
  * \param input - user_param is a pointer to user data.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS                                       Success in operation.
  * - MSG_ERR_INVALID_MSGHANDLE Message handle is invalid.
  *
@@ -168,7 +168,7 @@ int msg_submit_req(MSG_HANDLE_T handle, MSG_REQUEST_S *req);
  * return;
  * }
 
- * void sentStatusCB(MSG_HANDLE_T Handle, MSG_SENT_STATUS_S *pStatus, void *pUserParam)
+ * void sentStatusCB(msg_handle_t Handle, MSG_SENT_STATUS_S *pStatus, void *pUserParam)
  * {
  *     ...
  * }
@@ -176,7 +176,7 @@ int msg_submit_req(MSG_HANDLE_T handle, MSG_REQUEST_S *req);
  * \endcode
  */
 /*================================================================================================*/
-int msg_reg_sent_status_callback(MSG_HANDLE_T handle, msg_sent_status_cb cb, void *user_param);
+int msg_reg_sent_status_callback(msg_handle_t handle, msg_sent_status_cb cb, void *user_param);
 
 
 /**
@@ -204,7 +204,7 @@ int msg_reg_sent_status_callback(MSG_HANDLE_T handle, msg_sent_status_cb cb, voi
  * \param input - port is used for listening. If port is not used, please assign 0 to it.
  * \param input - user_param is a pointer to user data.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS                                       Success in operation.
  * - MSG_ERR_INVALID_MSGHANDLE Message handle is invalid.
  *
@@ -235,7 +235,7 @@ int msg_reg_sent_status_callback(MSG_HANDLE_T handle, msg_sent_status_cb cb, voi
  * return;
  * }
  *
- * void incomingSmsCB(MSG_HANDLE_T Handle, msg_message_t msg, void *pUserParam)
+ * void incomingSmsCB(msg_handle_t Handle, msg_message_t msg, void *pUserParam)
  * {
  *     ...
  * }
@@ -243,7 +243,7 @@ int msg_reg_sent_status_callback(MSG_HANDLE_T handle, msg_sent_status_cb cb, voi
  * \endcode
  */
 /*================================================================================================*/
-int msg_reg_sms_message_callback(MSG_HANDLE_T handle, msg_sms_incoming_cb cb, unsigned short port, void *user_param);
+int msg_reg_sms_message_callback(msg_handle_t handle, msg_sms_incoming_cb cb, unsigned short port, void *user_param);
 
 
 /**
@@ -272,7 +272,7 @@ int msg_reg_sms_message_callback(MSG_HANDLE_T handle, msg_sms_incoming_cb cb, un
  * \param input - app_id is used for listening. If appId is not used, please assign NULL to it.
  * \param input - user_param is a pointer to user data.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS                                       Success in operation.
  * - MSG_ERR_INVALID_MSGHANDLE Message handle is invalid.
  *
@@ -303,7 +303,7 @@ int msg_reg_sms_message_callback(MSG_HANDLE_T handle, msg_sms_incoming_cb cb, un
  * return;
  * }
  *
- * void incomingMmsConfCB(MSG_HANDLE_T Handle, msg_message_t msg, void *pUserParam)
+ * void incomingMmsConfCB(msg_handle_t Handle, msg_message_t msg, void *pUserParam)
  * {
  *     ...
  * }
@@ -311,7 +311,7 @@ int msg_reg_sms_message_callback(MSG_HANDLE_T handle, msg_sms_incoming_cb cb, un
  * \endcode
  */
 /*================================================================================================*/
-int msg_reg_mms_conf_message_callback(MSG_HANDLE_T handle, msg_mms_conf_msg_incoming_cb cb, const char *app_id, void *user_param);
+int msg_reg_mms_conf_message_callback(msg_handle_t handle, msg_mms_conf_msg_incoming_cb cb, const char *app_id, void *user_param);
 
 
 /**
@@ -338,7 +338,7 @@ int msg_reg_mms_conf_message_callback(MSG_HANDLE_T handle, msg_mms_conf_msg_inco
  * \param input - cb is a function to be called.
  * \param input - user_param is a pointer to user data.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS                                                       Success in operation.
  * - MSG_ERR_MSGHANDLE_NOT_CONNECTED   Message handle is not connected.
  * - MSG_ERR_MEMORY_ERROR                              Memory is error.
@@ -366,7 +366,7 @@ int msg_reg_mms_conf_message_callback(MSG_HANDLE_T handle, msg_mms_conf_msg_inco
  * return;
  * }
  *
- * void syncMLCB(MSG_HANDLE_T hMsgHandle, MSG_SYNCML_MESSAGE_TYPE_T msgType, const char* pPushHeader, int PushHeaderLen, const char* pPushBody, int PushBodyLen, void *pUserParam)
+ * void syncMLCB(msg_handle_t hMsgHandle, msg_syncml_message_type_t msgType, const char* pPushHeader, int PushHeaderLen, const char* pPushBody, int PushBodyLen, void *pUserParam)
  * {
  *     ...
  * }
@@ -374,7 +374,7 @@ int msg_reg_mms_conf_message_callback(MSG_HANDLE_T handle, msg_mms_conf_msg_inco
  * \endcode
  */
 /*================================================================================================*/
-int msg_reg_syncml_message_callback(MSG_HANDLE_T handle,  msg_syncml_msg_incoming_cb cb, void *user_param);
+int msg_reg_syncml_message_callback(msg_handle_t handle,  msg_syncml_msg_incoming_cb cb, void *user_param);
 
 
 /**
@@ -401,7 +401,7 @@ int msg_reg_syncml_message_callback(MSG_HANDLE_T handle,  msg_syncml_msg_incomin
  * \param input - cb is a function to be called.
  * \param input - user_param is a pointer to user data.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS                                                       Success in operation.
  * - MSG_ERR_MSGHANDLE_NOT_CONNECTED   Message handle is not connected.
  * - MSG_ERR_MEMORY_ERROR                              Memory is error.
@@ -429,7 +429,7 @@ int msg_reg_syncml_message_callback(MSG_HANDLE_T handle,  msg_syncml_msg_incomin
  * return;
  * }
  *
- * void lbsCB(MSG_HANDLE_T hMsgHandle, const char* pPushHeader, const char* pPushBody, int pushBodyLen, void *pUserParam)
+ * void lbsCB(msg_handle_t hMsgHandle, const char* pPushHeader, const char* pPushBody, int pushBodyLen, void *pUserParam)
  * {
  *     ...
  * }
@@ -437,7 +437,7 @@ int msg_reg_syncml_message_callback(MSG_HANDLE_T handle,  msg_syncml_msg_incomin
  * \endcode
  */
 /*================================================================================================*/
-int msg_reg_lbs_message_callback(MSG_HANDLE_T handle, msg_lbs_msg_incoming_cb cb, void *user_param);
+int msg_reg_lbs_message_callback(msg_handle_t handle, msg_lbs_msg_incoming_cb cb, void *user_param);
 
 
 /**
@@ -464,7 +464,7 @@ int msg_reg_lbs_message_callback(MSG_HANDLE_T handle, msg_lbs_msg_incoming_cb cb
  * \param input - cb is a function to be called.
  * \param input - user_param is a pointer to user data.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS                                                       Success in operation.
  * - MSG_ERR_MSGHANDLE_NOT_CONNECTED   Message handle is not connected.
  * - MSG_ERR_MEMORY_ERROR                              Memory is error.
@@ -492,7 +492,7 @@ int msg_reg_lbs_message_callback(MSG_HANDLE_T handle, msg_lbs_msg_incoming_cb cb
  * return;
  * }
  *
- * void lbsCB(MSG_HANDLE_T hMsgHandle, const char* pPushHeader, const char* pPushBody, int pushBodyLen, void *pUserParam)
+ * void lbsCB(msg_handle_t hMsgHandle, const char* pPushHeader, const char* pPushBody, int pushBodyLen, void *pUserParam)
  * {
  *     ...
  * }
@@ -500,7 +500,7 @@ int msg_reg_lbs_message_callback(MSG_HANDLE_T handle, msg_lbs_msg_incoming_cb cb
  * \endcode
  */
 /*================================================================================================*/
-int msg_reg_syncml_message_operation_callback(MSG_HANDLE_T handle,  msg_syncml_msg_operation_cb cb, void *user_param);
+int msg_reg_syncml_message_operation_callback(msg_handle_t handle,  msg_syncml_msg_operation_cb cb, void *user_param);
 
 
 /**
@@ -527,7 +527,7 @@ int msg_reg_syncml_message_operation_callback(MSG_HANDLE_T handle,  msg_syncml_m
  * \param input - cb is a function to be called.
  * \param input - user_param is a pointer to user data.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS                                                       Success in operation.
  * - MSG_ERR_MSGHANDLE_NOT_CONNECTED   Message handle is not connected.
  * - MSG_ERR_MEMORY_ERROR                              Memory is error.
@@ -555,7 +555,7 @@ int msg_reg_syncml_message_operation_callback(MSG_HANDLE_T handle,  msg_syncml_m
  * return;
  * }
  *
- * void lbsCB(MSG_HANDLE_T hMsgHandle, const char* pPushHeader, const char* pPushBody, int pushBodyLen, void *pUserParam)
+ * void lbsCB(msg_handle_t hMsgHandle, const char* pPushHeader, const char* pPushBody, int pushBodyLen, void *pUserParam)
  * {
  *     ...
  * }
@@ -563,7 +563,7 @@ int msg_reg_syncml_message_operation_callback(MSG_HANDLE_T handle,  msg_syncml_m
  * \endcode
  */
 /*================================================================================================*/
-int msg_syncml_message_operation(MSG_HANDLE_T handle,  MSG_MESSAGE_ID_T msgId);
+int msg_syncml_message_operation(msg_handle_t handle,  msg_message_id_t msgId);
 
 
 /**
@@ -591,7 +591,7 @@ int msg_syncml_message_operation(MSG_HANDLE_T handle,  MSG_MESSAGE_ID_T msgId);
  * \param input  - cb is a function to be called.
  * \param input  - user_param is for user data.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS                               Success in operation.
  * - MSG_ERR_NULL_POINTER              Invalid parameter.
  * - MSG_ERR_MEMORY_ERROR      Memory is error.
@@ -649,7 +649,7 @@ int msg_sms_send(const char *phone_num, const char *sms_text, msg_simple_sent_st
  * \param input  - cb is a function to be called.
  * \param input  - user_param is for user data.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS                               Success in operation.
  * - MSG_ERR_NULL_POINTER              Invalid parameter.
  * - MSG_ERR_MEMORY_ERROR      Memory is error.
@@ -683,7 +683,7 @@ int msg_sms_send(const char *phone_num, const char *sms_text, msg_simple_sent_st
  * \endcode
  */
 /*================================================================================================*/
-int msg_sms_send_message(MSG_HANDLE_T handle, MSG_REQUEST_S* req);
+int msg_sms_send_message(msg_handle_t handle, msg_struct_t req);
 
 
 /**
@@ -709,7 +709,7 @@ int msg_sms_send_message(MSG_HANDLE_T handle, MSG_REQUEST_S* req);
  * \param input  - handle is Message handle.
  * \param input  - req is a pointer to an MSG_REQUEST_S structure.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS                               Success in operation.
  * - MSG_ERR_NULL_POINTER              Invalid parameter.
  * - MSG_ERR_MEMORY_ERROR      Memory is error.
@@ -743,7 +743,7 @@ int msg_sms_send_message(MSG_HANDLE_T handle, MSG_REQUEST_S* req);
  * \endcode
  */
 /*================================================================================================*/
-int msg_mms_send_message(MSG_HANDLE_T handle, MSG_REQUEST_S* req);
+int msg_mms_send_message(msg_handle_t handle, msg_struct_t req);
 
 
 /**
@@ -770,7 +770,7 @@ int msg_mms_send_message(MSG_HANDLE_T handle, MSG_REQUEST_S* req);
  * \param input  - msg_id is a message id, which is a positive integer.
  * \param input  - mms_read_status is status whether message was read or not.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS                               Success in operation.
  * - MSG_ERR_NULL_POINTER              Invalid parameter.
  * - MSG_ERR_MEMORY_ERROR      Memory is error.
@@ -800,7 +800,7 @@ int msg_mms_send_message(MSG_HANDLE_T handle, MSG_REQUEST_S* req);
  * \endcode
  */
 /*================================================================================================*/
-int msg_mms_send_read_report(MSG_HANDLE_T handle, MSG_MESSAGE_ID_T msgId, MSG_READ_REPORT_STATUS_T mms_read_status);
+int msg_mms_send_read_report(msg_handle_t handle, msg_message_id_t msgId, msg_read_report_status_t mms_read_status);
 
 
 /**
@@ -826,7 +826,7 @@ int msg_mms_send_read_report(MSG_HANDLE_T handle, MSG_MESSAGE_ID_T msgId, MSG_RE
  * \param input  - handle is Message handle.
   * \param input  - req is a pointer to an MSG_REQUEST_S structure.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS                                       Success in operation.
  * - MSG_ERR_INVALID_MSGHANDLE         Message handle is invalid.
  * - MSG_ERR_NULL_POINTER                              Pointer is NULL.
@@ -856,7 +856,7 @@ int msg_mms_send_read_report(MSG_HANDLE_T handle, MSG_MESSAGE_ID_T msgId, MSG_RE
  * \endcode
  */
 /*================================================================================================*/
-int msg_mms_forward_message(MSG_HANDLE_T handle, MSG_REQUEST_S* req);
+int msg_mms_forward_message(msg_handle_t handle, msg_struct_t req);
 
 
 /**
@@ -882,7 +882,7 @@ int msg_mms_forward_message(MSG_HANDLE_T handle, MSG_REQUEST_S* req);
  * \param input  - handle is Message handle.
   * \param input  - req is a pointer to an MSG_REQUEST_S structure.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS                                       Success in operation.
  * - MSG_ERR_INVALID_MSGHANDLE         Message handle is invalid.
  * - MSG_ERR_NULL_POINTER                              Pointer is NULL.
@@ -912,7 +912,7 @@ int msg_mms_forward_message(MSG_HANDLE_T handle, MSG_REQUEST_S* req);
  * \endcode
  */
 /*================================================================================================*/
-int msg_mms_retrieve_message(MSG_HANDLE_T handle, MSG_REQUEST_S* req);
+int msg_mms_retrieve_message(msg_handle_t handle, msg_struct_t req);
 
 
 /* reject_msg_support */
@@ -939,7 +939,7 @@ int msg_mms_retrieve_message(MSG_HANDLE_T handle, MSG_REQUEST_S* req);
  * \param input  - handle is Message handle.
   * \param input  - req is a pointer to an MSG_REQUEST_S structure.
  *
- * \return Return Type (int(MSG_ERROR_T)) \n
+ * \return Return Type (int(msg_error_t)) \n
  * - MSG_SUCCESS                                       Success in operation.
  * - MSG_ERR_INVALID_MSGHANDLE         Message handle is invalid.
  * - MSG_ERR_NULL_POINTER                              Pointer is NULL.
@@ -969,7 +969,7 @@ int msg_mms_retrieve_message(MSG_HANDLE_T handle, MSG_REQUEST_S* req);
  * \endcode
  */
 /*================================================================================================*/
-int msg_mms_reject_message(MSG_HANDLE_T handle, MSG_REQUEST_S* req);
+int msg_mms_reject_message(msg_handle_t handle, msg_struct_t req);
 
 /**
  *     @}
diff --git a/include/mapi/msg_transport_types.h b/include/mapi/msg_transport_types.h
new file mode 100755 (executable)
index 0000000..58229a5
--- /dev/null
@@ -0,0 +1,132 @@
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#ifndef MSG_TRANSPORT_TYPES_H_
+#define MSG_TRANSPORT_TYPES_H_
+
+/*==================================================================================================
+                                         INCLUDE FILES
+==================================================================================================*/
+
+#include "msg_types.h"
+#include "msg_storage_types.h"
+
+
+/*==================================================================================================
+                                    DEFINES
+==================================================================================================*/
+
+/**    @brief  Prototype of the function that will be called when the status of the message which is already sent is changed.
+ *     Applications SHOULD implement this callback function and register it into Message handle.
+ *     For how to register this callback function, please refer to msg_reg_sent_status_callback.
+ *     If the application sends a message, this callback function will be called to report its sending status.
+ *     The application can get the request ID from sent_status to know which request is bound.
+ *     The callback function runs in the application process, not in the framework process.
+ *     The memory of sent_status is managed by MAPI, when the callback function is finished.
+ *     @param[in]      handle is Message handle.
+ *     @param[in]      sent_status is a pointer to an MSG_SENT_STATUS_S structure.
+ *     @param[in]      user_param is a pointer to user data.
+ *     @return void
+ */
+typedef void (*msg_sent_status_cb)(msg_handle_t handle, msg_struct_t sent_status, void *user_param);
+
+
+/**    @brief  Prototype of the function that will be called when the status of the message which is already sent is changed.
+ *     Applications SHOULD implement this callback function and register it into Message handle.
+ *     For how to register this callback function, please refer to msg_reg_sent_status_callback.
+ *     If the application sends a message, this callback function will be called to report its sending status.
+ *     The application can get the request ID from sent_status to know which request is bound.
+ *     The callback function runs in the application process, not in the framework process.
+ *     The memory of sent_status is managed by MAPI, when the callback function is finished.
+ *     @param[in]      sent_status is a pointer to an MSG_SENT_STATUS_S structure.
+ *     @param[in]      user_param is a pointer to user data.
+ *     @return void
+ */
+typedef void (*msg_simple_sent_status_cb)(msg_struct_t sent_status, void *user_param);
+
+
+/** @brief     Prototype of the function that will be called when a new message is received.
+ *     Applications SHOULD implement this callback function and register it into Message handle.
+ *     For how to register this callback function, please refer to msg_reg_sms_message_callback.
+ *     This callback function will be called when a new message is received and the message satisfies the filter list.
+ *     The callback function runs in the application process, not in the framework process.
+ *     The memory for msg is managed by MAPI, when the callback function is finished.
+ *     @param[in]      handle is Message handle.
+ *     @param[in]      msg is a pointer to an msg_message_t structure.
+ *     @param[in]      user_param is a pointer to user data.
+ *     @return void
+ */
+typedef void (*msg_sms_incoming_cb)(msg_handle_t handle, msg_struct_t msg, void *user_param);
+
+
+/** @brief     Prototype of the function that will be called when a new MMS message is received.
+ *     Applications SHOULD implement this callback function and register it into Message handle.
+ *     For how to register this callback function, please refer to msg_reg_mms_conf_message_callback.
+ *     This callback function will be called when a new MMS message is received and the message satisfies the filter list.
+ *     The callback function runs in the application process, not in the framework process.
+ *     The memory for msg is managed by MAPI, when the callback function is finished.
+ *     @param[in]      handle is Message handle.
+ *     @param[in]      msg is a pointer to an msg_message_t structure.
+ *     @param[in]      user_param is a pointer to user data.
+ *     @return void
+ */
+typedef void (*msg_mms_conf_msg_incoming_cb)(msg_handle_t handle, msg_struct_t msg, void *user_param);
+
+
+/** @brief     Prototype of the function that will be called when a new SyncML message is received.
+ *     Applications SHOULD implement this callback function and register it into Message handle.
+ *     For how to register this callback function, please refer to msg_reg_syncml_message_callback.
+ *     This callback function will be called when a new message is received and the message satisfies the filter list.
+ *     The callback function runs in the application process, not in the framework process.
+ *     @param[in]      handle is Message handle.
+ *     @param[in]      msg_type is msg_syncml_message_type_t structure.
+ *     @param[in]      push_body is WAP Push body data.
+ *     @param[in]      push_body_len is the length of WAP Push body data.
+ *     @param[in]      user_param is a pointer to user data.
+ *     @return void
+ */
+typedef void (*msg_syncml_msg_incoming_cb)(msg_handle_t handle, msg_syncml_message_type_t msg_type, const char *push_body, int push_body_len, const char* wsp_header, int wsp_header_len, void *user_param);
+
+
+/** @brief     Prototype of the function that will be called when a new LBS message is received.
+ *     Applications SHOULD implement this callback function and register it into Message handle.
+ *     For how to register this callback function, please refer to msg_reg_lbs_message_callback.
+ *     This callback function will be called when a new message is received and the message satisfies the filter list.
+ *     The callback function runs in the application process, not in the framework process.
+ *     @param[in]      hMsgHandle is Message handle.
+ *     @param[in]      push_header is push message header data.
+ *     @param[in]      push_body is push message body data.
+ *     @param[in]      push_body_len is push message body length.
+ *     @param[in]      user_param is a pointer to user data.
+ *     @return void
+ */
+typedef void (*msg_lbs_msg_incoming_cb)(msg_handle_t handle, const char *push_header, const char *push_body, int push_body_len, void *user_param);
+
+
+/** @brief     Prototype of the function that will be called when a new SyncML message is received.
+ *     Applications SHOULD implement this callback function and register it into Message handle.
+ *     For how to register this callback function, please refer to msg_reg_syncml_message_callback.
+ *     This callback function will be called when a new message is received and the message satisfies the filter list.
+ *     The callback function runs in the application process, not in the framework process.
+ *     @param[in]      handle is Message handle.
+ *     @param[in]      user_param is a pointer to user data.
+ *     @return void
+ */
+typedef void (*msg_syncml_msg_operation_cb)(msg_handle_t handle, int msgId, int extId, void *user_param);
+
+
+
+#endif /* MSG_TRANSPORT_TYPES_H_ */
diff --git a/include/mapi/msg_types.h b/include/mapi/msg_types.h
new file mode 100755 (executable)
index 0000000..4afa307
--- /dev/null
@@ -0,0 +1,1566 @@
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#ifndef MSG_TYPES_H_
+#define MSG_TYPES_H_
+
+/*==================================================================================================
+                                    DEFINES
+==================================================================================================*/
+
+#define DEPRECATED __attribute__((deprecated))
+
+#ifndef EXPORT_API
+#define EXPORT_API __attribute__ ((visibility("default")))
+#endif
+
+#define MAX_TO_ADDRESS_CNT             10
+#define MAX_PHONE_NUMBER_LEN   20
+#define MAX_ADDRESS_VAL_LEN    254
+#define MAX_SIGN_VAL_LEN               128
+#define MAX_SUBJECT_LEN                        120
+#define MAX_DISPLAY_NAME_LEN   195
+#define MAX_IMAGE_PATH_LEN             1024
+#define MAX_MSG_DATA_LEN               320
+#define MAX_MSG_TEXT_LEN               1530
+#define MAX_FILTER_VALUE_LEN   40
+#define MAX_COMMAND_LEN                1024
+#define MAX_FOLDER_NAME_SIZE           20
+
+#define MAX_WAPPUSH_ID_LEN                     40
+#define MAX_WAPPUSH_HREF_LEN           300
+#define MAX_WAPPUSH_CONTENTS_LEN       2048
+
+#define MAX_PUSH_CACHEOP_INVALID_OBJECT_MAX    5
+#define MAX_PUSH_CACHEOP_INVALID_SERVICE_MAX   5
+#define MAX_PUSH_CACHEOP_MAX_URL_LEN                   200
+
+#define MAX_COMMON_INFO_SIZE   20
+
+/**
+ *     @brief  Defines the maximum file path length
+ */
+#define        MSG_FILEPATH_LEN_MAX    1024
+
+// setting
+#define SMSC_NAME_MAX                  127             /* Max SMSC Name Length */
+#define SMSC_ADDR_MAX                  20              /* Max SMSC Adress Length  */
+#define SMSC_LIST_MAX                  5               /* Max List Count of SMSC */
+#define CB_CHANNEL_NAME_MAX    32              /* cb channel name max size */
+#define CB_CHANNEL_MAX                 30              /* cb channel max count */
+#define CB_LANG_TYPE_MAX               10
+
+/**
+ *     @brief  Defines the maximum file name length
+ */
+#define        MSG_FILENAME_LEN_MAX            255
+
+/**
+ *     @brief  Defines the maximum message id length
+ */
+#define        MSG_MSG_ID_LEN                  100
+
+/**
+ *     @brief  Defines the maximum in transition id length
+ */
+#define MAX_SMIL_TRANSIN_ID            100
+
+/**
+ *     @brief  Defines the maximum out transition id length
+ */
+#define MAX_SMIL_TRANSOUT_ID   100
+
+/**
+ *     @brief  Defines the maximum region id length
+ */
+#define        MAX_SMIL_REGION_ID              151
+
+/**
+ *     @brief  Defines the maximum transition id length
+ */
+#define MAX_SMIL_TRANSITION_ID         151
+
+/**
+ *     @brief  Defines the maximum meta id length
+ */
+#define MAX_SMIL_META_ID               151
+
+/**
+ *     @brief  Defines the maximum meta name length
+ */
+#define MAX_SMIL_META_NAME             100
+
+/**
+ *     @brief  Defines the maximum meta content length
+ */
+#define MAX_SMIL_META_CONTENT          255
+
+/**
+ *     @brief  Defines the maximum fit size
+ */
+#define        MAX_SMIL_FIT_SIZE               31
+
+/**
+ *     @brief  Defines the maximum pages in a MMS
+ */
+#define        MMS_PAGE_MAX                    20
+
+/**
+ *     @brief  Defines the maximum media in a MMS
+ */
+#define        MMS_MEDIA_MAX                   60
+
+/**
+ *     @brief  Defines the maximum alternate text length
+ */
+#define        MAX_SMIL_ALT_LEN                255
+
+
+//font size
+/**
+ *     @brief  Defines the small font size
+ */
+#define        MMS_SMIL_FONT_SIZE_SMALL                24
+
+/**
+ *     @brief  Defines the normal font size
+ */
+#define        MMS_SMIL_FONT_SIZE_NORMAL               30
+
+/**
+ *     @brief  Defines the large font size
+ */
+#define        MMS_SMIL_FONT_SIZE_LARGE                36
+
+#define MAX_SMIL_ANIMATE_ATTRIBUTE_NAME 100
+#define MAX_SMIL_ANIMATE_ATTRIBUTE_TYPE 100
+#define MAX_SMIL_ANIMATE_TARGET_ELEMENT 100
+#define MAX_SMIL_ANIMATE_CALC_MODE 100
+
+#define MAX_MMS_JAVA_APPID_LEN 32
+
+#define CONV_THUMB_WIDTH       250
+#define CONV_THUMB_HEIGHT 170
+
+#define MMS_TR_ID_LEN          40
+#define MMS_MSG_ID_LEN         40
+#define MMS_LOCATION_LEN       100
+/*==================================================================================================
+                                         TYPES
+==================================================================================================*/
+
+typedef struct opq_msg_svc_s *                 msg_handle_t;
+typedef struct opq_struct_s *                          msg_struct_t;
+
+
+typedef struct msg_list_handle *msg_list_handle_t;
+
+
+typedef struct {
+       int                                     nCount;                         /**< Indicates the count of msg_struct_t. */
+       msg_struct_t            *msg_struct_info;       /**< Indicates the msg_struct_t information list. */
+}msg_struct_list_s;
+
+
+/**
+ *     @brief  Represents a messsage ID.
+ */
+typedef unsigned int msg_message_id_t;
+
+
+/**
+ *     @brief  Represents a storage type.
+       See enum _MSG_STORAGE_ID_E
+ */
+typedef unsigned char msg_storage_id_t;
+
+
+/**
+ *     @brief  Represents a folder ID.
+       See enum _MSG_FOLDER_ID_E
+ */
+typedef char msg_folder_id_t;
+
+
+/**
+ *     @brief  Represents a request ID, which is unique for each request.
+ */
+typedef unsigned int msg_request_id_t;
+
+
+/**
+ *     @brief  Represents a message priority. \n
+ *     The values for this type SHOULD be in _MSG_PRIORITY_TYPE_E.
+ */
+typedef unsigned char msg_priority_type_t;
+
+
+/**
+ *     @brief  Represents the network status of a message. \n
+ *     The values for this type SHOULD be in _MSG_NETWORK_STATUS_E.
+ */
+typedef unsigned char msg_network_status_t;
+
+
+/**
+ *     @brief  Represents an address type. \n
+ *     The values for this type SHOULD be in _MSG_ADDRESS_TYPE_E.
+ */
+typedef unsigned char msg_address_type_t;
+
+
+/**
+ *     @brief  Represents an recipient type. \n
+ *     The values for this type SHOULD be in _MSG_RECIPIENT_TYPE_E.
+ */
+typedef unsigned char msg_recipient_type_t;
+
+
+/**
+ *     @brief  Represents the type of a message direction. \n
+ *     The values for this type SHOULD be in _MSG_DIRECTION_TYPE_E.
+ */
+typedef unsigned char msg_direction_type_t;
+
+
+/**
+ *     @brief  Represents an encoding type. \n
+ *     The values for this type SHOULD be in _MSG_ENCODE_TYPE_E.
+ */
+typedef unsigned char msg_encode_type_t;
+
+
+/**
+ *     @brief  Represents an error code. \n
+ *     The values for this type SHOULD be in _MSG_ERROR_E
+ */
+typedef int msg_error_t;
+
+
+/**
+\brief Represents WAP Push App Code.
+*/
+typedef unsigned char msg_push_action_t;
+
+
+/**
+\brief Represents SyncML Message Type.
+*/
+typedef unsigned short msg_syncml_message_type_t;
+
+
+/**
+ *     @brief  Represents a Contact ID.
+ */
+typedef unsigned int msg_contact_id_t;
+
+
+/**
+  *  @brief    Represents a Delivery Report Status.
+ *     The values for this type SHOULD be in _MSG_DELIVERY_REPORT_STATUS_E
+  */
+typedef int msg_delivery_report_status_t;
+
+
+/**
+ *     @brief  Represents a Read Report Status.
+ *     The values for this type SHOULD be in _MSG_READ_REPORT_STATUS_E
+ */
+typedef int msg_read_report_status_t;
+
+
+/**
+ *     @brief  Represents a Message Type.
+ *     The values for this type SHOULD be in _MSG_MESSAGE_TYPE_E
+*/
+typedef unsigned short msg_message_type_t;
+
+
+/**
+ *     @brief  Represents a thread ID. \n
+ */
+typedef unsigned int msg_thread_id_t;
+
+// filter
+/**
+ *     @brief  Represents a filter ID.
+ */
+typedef unsigned char msg_filter_id_t;
+
+
+/**
+ *     @brief  Represents a filter Type. \n
+ *     The filter Type represents a unique filter type. \n
+ *     The values for this type SHOULD be in _MSG_FILTER_TYPE_E.
+ */
+typedef unsigned char msg_filter_type_t;
+
+
+
+/*==================================================================================================
+                                         ENUMS
+==================================================================================================*/
+
+enum _MSG_STRUCT_E {
+       MSG_STRUCT_FILTER = 0X0000,                                                             /**< Indicates the MSG_STRUCT_FILTER */
+
+       MSG_STRUCT_MESSAGE_INFO = 0x0200,                               /**< Indicates the MSG_STRUCT_MESSAGE_INFO */
+       MSG_STRUCT_THREAD_INFO = 0x0300,
+
+       MSG_STRUCT_MMS = 0x0500,                                                                /**< Indicates the MSG_STRUCT_MMS */
+       MSG_STRUCT_MMS_PAGE = 0x0600,                                           /**< Indicates the MSG_STRUCT_MMS_PAGE */
+       MSG_STRUCT_MMS_MEDIA = 0x0700,                                  /**< Indicates the MSG_STRUCT_MMS_MEDIA */
+       MSG_STRUCT_MMS_ATTACH = 0x0800,                                 /**< Indicates the MSG_STRUCT_MMS_ATTACH */
+       MSG_STRUCT_MMS_REGION = 0x0900,                                 /**< Indicates the MSG_STRUCT_MMS_REGION */
+       MSG_STRUCT_MMS_TRANSITION = 0x0a00,                     /**< Indicates the MSG_STRUCT_MMS_TRANSITION */
+       MSG_STRUCT_MMS_META = 0x0b00,                                           /**< Indicates the MSG_STRUCT_MMS_META */
+       MSG_STRUCT_MMS_SMIL_TEXT = 0x0c00,                      /**< Indicates the MSG_STRUCT_MMS_SMIL_TEXT */
+       MSG_STRUCT_MMS_SMIL_AVI = 0x0d00,                               /**< Indicates the MSG_STRUCT_MMS_SMIL_AVI */
+
+       MSG_STRUCT_SETTING_SMSC_OPT = 0x2000,
+       MSG_STRUCT_SETTING_SMSC_INFO = 0x2100,                                          /**< Indicates the MSG_STRUCT_SETTING_SMSC_INFO */
+       MSG_STRUCT_SETTING_CB_OPT = 0x2200,                                                     /**< Indicates the MSG_STRUCT_SETTING_CB_OPT */
+       MSG_STRUCT_SETTING_CB_CHANNEL_INFO = 0x2300,                    /**< Indicates the MSG_STRUCT_CB_CHANNEL_INFO */
+       MSG_STRUCT_SETTING_SMS_SEND_OPT = 0x2400,                               /**< Indicates the MSG_STRUCT_SETTING_SMS_SEND_OPT */
+       MSG_STRUCT_SETTING_MMS_SEND_OPT = 0x2500,                               /**< Indicates the MSG_STRUCT_SETTING_MMS_SEND_OPT */
+       MSG_STRUCT_SETTING_MMS_RECV_OPT = 0x2600,                               /**< Indicates the MSG_STRUCT_SETTING_MMS_RECV_OPT */
+       MSG_STRUCT_SETTING_PUSH_MSG_OPT = 0x2700,                               /**< Indicates the MSG_STRUCT_SETTING_PUSH_MSG_OPT */
+       MSG_STRUCT_SETTING_VOICE_MSG_OPT = 0x2800,                              /**< Indicates the MSG_STRUCT_SETTING_VOICE_MSG_OPT */
+       MSG_STRUCT_SETTING_GENERAL_OPT = 0x2900,                                /**< Indicates the MSG_STRUCT_SETTING_GENERAL_OPT */
+       MSG_STRUCT_SETTING_MSGSIZE_OPT = 0x2c00,                                        /**< Indicates the MSG_STRUCT_SETTING_MSGSIZE_OPT */
+
+       MSG_STRUCT_SYNCML_INFO = 0x3100,                                        /**< Indicates the MSG_STRUCT_SYNCML_INFO */
+       MSG_STRUCT_COUNT_INFO = 0x3200,                                 /**< Indicates the MSG_STRUCT_COUNT_INFO */
+       MSG_STRUCT_THREAD_COUNT_INFO = 0x3300,          /**< Indicates the MSG_STRUCT_THREAD_COUNT_INFO */
+       MSG_STRUCT_THREAD_LIST_INDEX = 0x3400,          /**< Indicates the MSG_STRUCT_THREAD_LIST_INDEX */
+       MSG_STRUCT_SORT_RULE = 0x3500,                                          /**< Indicates the MSG_STRUCT_SORT_RULE */
+       MSG_STRUCT_FOLDER_INFO = 0x3600,                                        /**< Indicates the MSG_STRUCT_FOLDER_INFO */
+       MSG_STRUCT_SEARCH_CONDITION = 0x3700,           /**< Indicates the MSG_STRUCT_SEARCH_CONDITION */
+       MSG_STRUCT_REPORT_STATUS_INFO = 0x3800, /**< Indicates the MSG_STRUCT_REPORT_STATUS_INFO */
+
+       MSG_STRUCT_ADDRESS_INFO = 0x4000,                               /**< Indicates the MSG_STRUCT_ADDRESS_INFO */
+       MSG_STRUCT_SENDOPT = 0x4100,                                                    /**< Indicates the MSG_STRUCT_SENDOPT */
+       MSG_STRUCT_MMS_SENDOPT = 0x4200,                                /**< Indicates the MSG_STRUCT_MMS_SENDOPT */
+       MSG_STRUCT_SMS_SENDOPT = 0x4300,                                /**< Indicates the MSG_STRUCT_SMS_SENDOPT */
+       MSG_STRUCT_REJECT_MSG_INFO = 0x4400,                    /**< Indicates the MSG_STRUCT_REJECT_MSG_INFO */
+       MSG_STRUCT_REQUEST_INFO = 0x4500,                               /**< Indicates the MSG_STRUCT_REQUEST_INFO */
+       MSG_STRUCT_SENT_STATUS_INFO = 0x4600,                           /**< Indicates the MSG_STRUCT_SENT_STATUS_INFO */
+};
+
+enum _MSG_MESSAGE_INFO_E_ {
+       MSG_MESSAGE_ID_INT = MSG_STRUCT_MESSAGE_INFO+1,         /**< Indicates the message ID of this message. */
+       MSG_MESSAGE_THREAD_ID_INT,                              /**< Indicates the thread ID. */
+       MSG_MESSAGE_FOLDER_ID_INT,                              /**< Indicates the folder ID. see enum _MSG_FOLDER_TYPE_E */
+       MSG_MESSAGE_TYPE_INT,                           /**< Indicates the message type. See enum _MSG_MESSAGE_TYPE_E */
+       MSG_MESSAGE_CLASS_TYPE_INT,                             /**< Message class type. See enum _MSG_CLASS_TYPE_E */
+       MSG_MESSAGE_STORAGE_ID_INT,                             /**< Indicates where the message is saved. see enum _MSG_STORAGE_ID_E*/
+       MSG_MESSAGE_ADDR_LIST_STRUCT,                           /**< Indicates the address information list. */
+       MSG_MESSAGE_REPLY_ADDR_STR,                             /**< Indicates the reply address. */
+       MSG_MESSAGE_SUBJECT_STR,                                /**< Indicates the message subject. */
+       MSG_MESSAGE_DISPLAY_TIME_INT,                           /**< Indicates the display time related to the specific operation. */
+       MSG_MESSAGE_NETWORK_STATUS_INT,                         /**< Indicates the network status of the message. See enum _MSG_NETWORK_STATUS_E */
+       MSG_MESSAGE_ENCODE_TYPE_INT,                            /**< Indicates the string encoding type. See enum _MSG_ENCODE_TYPE_E */
+       MSG_MESSAGE_READ_BOOL,                                  /**< Indicates whether the message is read or not. */
+       MSG_MESSAGE_PROTECTED_BOOL,                             /**< Indicates whether the message is protected or not. */
+       MSG_MESSAGE_BACKUP_BOOL,                                /**< Indicates whether the message was restored from PC. */
+       MSG_MESSAGE_PRIORITY_INT,                               /**< Indicates the priority of the message. See enum _MSG_PRIORITY_TYPE_E */
+       MSG_MESSAGE_DIRECTION_INT,                              /**< Indicates whether the message is MO or MT, affecting address. See enum _MSG_DIRECTION_TYPE_E */
+       MSG_MESSAGE_PORT_VALID_BOOL,                            /**< Indicates whether port information is used or not. */
+       MSG_MESSAGE_DEST_PORT_INT,                              /**< Recipient port number, not greater than 16 bit */
+       MSG_MESSAGE_SRC_PORT_INT,                               /**< Sender port number, not greater than 16 bit */
+       MSG_MESSAGE_ATTACH_COUNT_INT,                           /**< Indicates the count of attached files in mms. */
+       MSG_MESSAGE_THUMBNAIL_PATH_STR,                         /**< Indicates the thumbnail path of message. */
+       MSG_MESSAGE_DATA_SIZE_INT,                              /**< Indicates the data size. The unit is byte. */
+       MSG_MESSAGE_SMS_DATA_STR,                               /**< Indicates the message payload information as a body. default character encoding is UTF-8*/
+       MSG_MESSAGE_MMS_TEXT_STR,
+};
+
+enum MSG_FILTER_INFO_E {
+       MSG_FILTER_ID_INT = MSG_STRUCT_FILTER+1,                /**< Indicates the filter ID. */
+       MSG_FILTER_TYPE_INT,                                    /**< Indicates the filter type. See enum _MSG_FILTER_TYPE_E */
+       MSG_FILTER_VALUE_STR,                                   /**< The value of a filter. */
+};
+
+enum MSG_STRUCT_THREAD_INFO_E {
+       MSG_THREAD_ID_INT = MSG_STRUCT_THREAD_INFO+1,           /**< Indicates the message thread ID. */
+       MSG_THREAD_NAME_STR,                                    /**< Indicates the message thread name */
+       MSG_THREAD_MSG_TYPE_INT,                                /**< Indicates the message type. See enum _MSG_MESSAGE_TYPE_E  */
+       MSG_THREAD_MSG_DATA_STR,                                /**< The latest message text. */
+       MSG_THREAD_MSG_TIME_INT,                                /**< The latest message time */
+       MSG_THREAD_DIRECTION_INT,                               /**< The latest message direction See enum _MSG_DIRECTION_TYPE_E */
+       MSG_THREAD_UNREAD_COUNT_INT,                            /**< Indicates unread count of thread */
+       MSG_THREAD_SMS_COUNT_INT,                               /**< Indicates sms message count of thread */
+       MSG_THREAD_MMS_COUNT_INT                                /**< Indicates mms message count of thread */
+};
+
+enum _MSG_STRUCT_SETTING_SMSC_OPT_E {
+       MSG_SMSC_SELECTED_ID_INT = MSG_STRUCT_SETTING_SMSC_OPT+1,
+       MSG_SMSC_LIST_STRUCT
+};
+
+enum _MSG_STRUCT_SETTING_SMSC_INFO_E {
+       MSG_SMSC_ADDR_TON_INT = MSG_STRUCT_SETTING_SMSC_INFO+1,         /**< Type of number. See enum _MSG_SMS_TON_E */
+       MSG_SMSC_ADDR_NPI_INT,                                  /**< Numbering plan ID. See enum _MSG_SMS_NPI_E */
+       MSG_SMSC_ADDR_STR,                                      /**< SMSC address */
+       MSG_SMSC_NAME_STR,                                      /**< SMSC name */
+       MSG_SMSC_PID_INT,                                       /**< Protocol idendifier See enum _MSG_SMS_PID_E */
+       MSG_SMSC_VAL_PERIOD_INT                                 /**< Validity period value. See enum _MSG_VAL_PERIOD_E*/
+};
+
+enum _MSG_STRUCT_CB_OPT_E {
+       MSG_CB_RECEIVE_BOOL = MSG_STRUCT_SETTING_CB_OPT+1,              /**< Indicates whether the CB message is received or not. */
+       MSG_CB_RECEIVE_ALL_CHANNEL_BOOL,                        /**< Indicates whether All Channel's CB message is received or not. */
+       MSG_CB_MAX_SIM_COUNT_INT,                               /**< Indicates the number of channels which can be stored in SIM. */
+       MSG_CB_CHANNEL_LIST_STRUCT,                             /**< Indicates the cell broadcasting channel information. */
+       MSG_CB_LANGUAGE_TYPE_ALL_BOOL,
+       MSG_CB_LANGUAGE_TYPE_ENG_BOOL,                  /**< CB message English  */
+       MSG_CB_LANGUAGE_TYPE_GER_BOOL,                  /**< CB message Germany */
+       MSG_CB_LANGUAGE_TYPE_FRE_BOOL,                  /**< CB message France */
+       MSG_CB_LANGUAGE_TYPE_ITA_BOOL,                  /**< CB message Italy */
+       MSG_CB_LANGUAGE_TYPE_NED_BOOL,                  /**< CB message Netherland */
+       MSG_CB_LANGUAGE_TYPE_SPA_BOOL,                  /**< CB message Spain */
+       MSG_CB_LANGUAGE_TYPE_POR_BOOL,                  /**< CB message Portugal */
+       MSG_CB_LANGUAGE_TYPE_SWE_BOOL,                  /**< CB message Sweden */
+       MSG_CB_LANGUAGE_TYPE_TUR_BOOL,                  /**< CB message Turkey */
+};
+
+enum _MSG_STRUCT_CB_CHANNEL_INFO_E {
+       MSG_CB_CHANNEL_ACTIVATE_BOOL = MSG_STRUCT_SETTING_CB_CHANNEL_INFO+1,    /**< Indicates whether the CB channel is activate or passive. */
+       MSG_CB_CHANNEL_ID_INT,                                          /**< Indicates the ID of a CB channel. */
+       MSG_CB_CHANNEL_NAME_STR                                         /**< Indicates the name of a CB channel. */
+};
+
+enum _MSG_STRUCT_SMS_SEND_OPT_E {
+       MSG_SMS_SENDOPT_ENCODE_TYPE_INT = MSG_STRUCT_SETTING_SMS_SEND_OPT+1,    /**< Indicates the string encoding type.  See enum _MSG_ENCODE_TYPE_E*/
+       MSG_SMS_SENDOPT_NETWORK_MODE_INT,                               /**< Indicates the network mode (CS/PS) to send SMS. See enum _MSG_SMS_NETWORK_MODE_E*/
+       MSG_SMS_SENDOPT_REPLY_PATH_BOOL,                                /**< Indicates whether the SMS reply path is set or not. */
+       MSG_SMS_SENDOPT_DELIVERY_REPORT_BOOL,                           /**< Indicates whether the SMS delivery report will be sent or not. */
+       MSG_SMS_SENDOPT_SAVE_STORAGE_INT                                /**< Indicates the default storage to save SMS. See enum _MSG_SMS_SAVE_STORAGE_E */
+};
+
+enum _MSG_STRUCT_MMS_SEND_OPT_E {
+       MSG_MMS_SENDOPT_CLASS_TYPE_INT = MSG_STRUCT_SETTING_MMS_SEND_OPT+1,             /**< Indicates the class type of message.  See enum _MSG_MMS_MSG_CLASS_TYPE_E */
+       MSG_MMS_SENDOPT_PRIORITY_TYPE_INT,                                      /**< Indicates the priority of the message. See enum _MSG_PRIORITY_TYPE_E */
+       MSG_MMS_SENDOPT_EXPIRY_TIME_INT,                                        /**< Indicates the time when the message is to be removed from the MMSC. See enum _MSG_MMS_EXPIRY_TIME_E */
+       MSG_MMS_SENDOPT_DELIVERY_TIME_INT,                                      /**< Indicates the message transmission time which is set in the MMSC. See enum _MSG_MMS_DELIVERY_TIME_E */
+       MSG_MMS_SENDOPT_CUSTOM_DELIVERY_TIME_INT,                               /**< Indicates the message transmission time which is set in the MMSC. */
+       MSG_MMS_SENDOPT_SENDER_VISIBILITY_BOOL,                                 /**< Indicates whether the address is hidden or not. */
+       MSG_MMS_SENDOPT_DELIVERY_REPORT_BOOL,                                   /**< Indicates whether the delivery report will be sent or not. */
+       MSG_MMS_SENDOPT_READ_REPLY_BOOL,                                        /**< Indicates whether the read report will be sent or not. */
+       MSG_MMS_SENDOPT_KEEP_COPY_BOOL,                                         /**< Indicates whether the message copy is kept or not. */
+       MSG_MMS_SENDOPT_BODY_REPLYING_BOOL,                                     /**< Indicates whether the body is included when replying or not. */
+       MSG_MMS_SENDOPT_HIDE_RECIPIENTS_BOOL,                                   /**< Indicates whether the recipients are hidden or not. */
+       MSG_MMS_SENDOPT_REPLY_CHARGING_INT,                                     /**< Indicates the reply charging type of message. See enum _MSG_MMS_REPLY_CHARGING_TYPE_E */
+       MSG_MMS_SENDOPT_REPLY_CHARGING_DEADLINE_INT,                            /**< Indicates the deadline for replying charging. is set in the MMSC. */
+       MSG_MMS_SENDOPT_REPLY_CHARGING_SIZE_INT,                                /**< Indicates the reply charging size. */
+       MSG_MMS_SENDOPT_CREATION_MODE_INT                                       /**< Indicates the creation mode of MMS. See enum _MSG_MMS_CREATION_MODE_E */
+};
+
+enum _MSG_STRUCT_MMS_RECV_OPT_E {
+       MSG_MMS_RECVOPT_HOME_RETRIEVE_TYPE_INT = MSG_STRUCT_SETTING_MMS_RECV_OPT+1,     /**< Indicates the retrieve type for MMS home network. See enum _MSG_MMS_HOME_RETRIEVE_TYPE_E */
+       MSG_MMS_RECVOPT_ABROAD_RETRIEVE_TYPE_INT,                               /**< Indicates the retrieve type for MMS abroad network. See enum _MSG_MMS_ABROAD_RETRIEVE_TYPE_E */
+       MSG_MMS_RECVOPT_READ_REPORT_BOOL,                                       /**< Indicates whether the read report will be sent or not. */
+       MSG_MMS_RECVOPT_DELIVERY_REPORT_BOOL,                                   /**< Indicates whether the delivery report will be sent or not. */
+       MSG_MMS_RECVOPT_REJECT_UNKNOWN_BOOL,                                    /**< Indicates whether unknown addresses are rejected or not. */
+       MSG_MMS_RECVOPT_REJECT_ADVERTISEMENT_BOOL                               /**< Indicates whether advertisement is rejected or not. */
+};
+
+enum _MSG_STRUCT_GENERAL_OPT_E {
+       MSG_GENERAL_KEEP_COPY_BOOL = MSG_STRUCT_SETTING_GENERAL_OPT+1,                  /**< Indicates whether the SMS message copy is kept or not. */
+       MSG_GENERAL_ALERT_TONE_INT,                                             /**< Indicates the period of playing alert tone. See enum _MSG_ALERT_TONE_E */
+       MSG_GENERAL_AUTO_ERASE_BOOL                                             /**< Indicates whether the auto-erase option is enabled or not. */
+};
+
+enum _MSG_STRUCT_PUSH_MSG_OPT_E {
+       MSG_PUSHMSG_RECEIVE_BOOL = MSG_STRUCT_SETTING_PUSH_MSG_OPT+1,           /**< Indicates whether the push message is received or not. */
+       MSG_PUSHMSG_SERVICE_TYPE_INT                                    /**< Indicates the service type of a push message. See enum _MSG_PUSH_SERVICE_TYPE_E */
+};
+
+enum _MSG_STRUCT_VOICE_MSG_OPT_E {
+       MSG_VOICEMSG_ADDRESS_STR = MSG_STRUCT_SETTING_VOICE_MSG_OPT+1,          /**< Indicates the address for voice message. */
+};
+
+enum _MSG_STRUCT_MSGSISE_OPT_E {
+       MSG_MESSAGE_SIZE_INT = MSG_STRUCT_SETTING_MSGSIZE_OPT+1,                /**< Indicates the message size */
+};
+
+//MSG_MMS_DATA
+enum MSG_MMS_INFO_E {
+       MSG_MMS_PAGE_LIST_HND = MSG_STRUCT_MMS+1,                       /**< The pointer to SMIL pages list */
+       MSG_MMS_REGION_LIST_HND,                                        /**< The pointer to SMIL regions list */
+       MSG_MMS_ATTACH_LIST_HND,                                        /**< The pointer to attachment list */
+       MSG_MMS_TRANSITION_LIST_HND,                                    /**< The pointer to SMIL transitions list */
+       MSG_MMS_META_LIST_HND,                                          /**< The pointer to SMIL meta list */
+       MSG_MMS_ROOTLAYOUT_WIDTH_INT,                                   /**< Indicates the width of the root layout */
+       MSG_MMS_ROOTLAYOUT_WIDTH_PERCENT_BOOL,                          /**< Indicates the length is in percentage(%) or not */
+       MSG_MMS_ROOTLAYOUT_HEIGHT_INT,                                  /**< Indicates the height of the root layout */
+       MSG_MMS_ROOTLAYOUT_HEIGHT_PERCENT_BOOL,                         /**< Indicates the length is in percentage(%) or not */
+       MSG_MMS_ROOTLAYOUT_BGCOLOR_INT,                                 /**< Indicates the background color of the root layout */
+};
+
+//MSG_MMS_PAGE
+enum MSG_MMS_PAGE_INFO_E {
+       MSG_MMS_PAGE_MEDIA_LIST_HND = MSG_STRUCT_MMS_PAGE+1,            /**< The pointer to media list */
+       MSG_MMS_PAGE_PAGE_DURATION_INT,                                 /**< Indicates the duration of the page */
+       MSG_MMS_PAGE_BEGIN_TIME_INT,                                    /**< Indicates the begin time of the page */
+       MSG_MMS_PAGE_END_TIME_INT,                                      /**< Indicates the end time of the page */
+       MSG_MMS_PAGE_MIN_INT,                                           /**< Indicates the min attribute of the page */
+       MSG_MMS_PAGE_MAX_INT,                                           /**< Indicates the max attribute of the page */
+       MSG_MMS_PAGE_REPEAT_INT,                                        /**< Indicates the page needs to be displayed repeatedly */
+};
+
+enum MSG_MMS_MEDIA_INFO {
+       MSG_MMS_MEDIA_TYPE_INT = MSG_STRUCT_MMS_MEDIA+1,                /**< Indicates the SMIL media type. see enum MmsSmilMediaType */
+       MSG_MMS_MEDIA_SRC_STR,                                          /**< Indicates the media source name */
+       MSG_MMS_MEDIA_FILENAME_STR,                                     /**< Indicates the file name */
+       MSG_MMS_MEDIA_FILEPATH_STR,                                     /**< Indicates the file path */
+       MSG_MMS_MEDIA_CONTENT_ID_STR,                                   /**< Indicates the content id */
+       MSG_MMS_MEDIA_REGION_ID_STR,                                    /**< Indicates the region id */
+       MSG_MMS_MEDIA_ALTERNATIVE_STR,                                  /**< Indicates the alternative text to be displayed in failure case */
+       MSG_MMS_MEDIA_DRM_TYPE_INT,                                     /**< Indicates the drm type. see enum MsgDrmType */
+       MSG_MMS_MEDIA_DRM_FULLPATH_STR,                                 /**< Indicates the fullpath of the DRM */
+       MSG_MMS_MEDIA_SMIL_TEXT_HND,                                    /**< Indicates the text attributes */
+       MSG_MMS_MEDIA_SMIL_AVI_HND,                                     /**< Indicates the video attributes */
+};
+
+//MSG_MMS_ATTACH
+enum MSG_MMS_ATTACH_INFO_E {
+       MSG_MMS_ATTACH_MIME_TYPE_INT = MSG_STRUCT_MMS_ATTACH+1,         /**< Indicates the file mime type. see enum MimeType */
+       MSG_MMS_ATTACH_FILENAME_STR,                                    /**< Indicates the file name */
+       MSG_MMS_ATTACH_FILEPATH_STR,                                    /**< Indicates the file path */
+       MSG_MMS_ATTACH_FILESIZE_INT,                                    /**< Indicates the size of the file */
+       MSG_MMS_ATTACH_DRM_TYPE_INT,                                    /**< Indicates the drm type. see enum MsgDrmType */
+       MSG_MMS_ATTACH_DRM_FULLPATH_STR,                                /**< Indicates the fullpath of the DRM */
+};
+
+enum MSG_MMS_REGION_INFO_E {
+       MSG_MMS_REGION_ID_STR = MSG_STRUCT_MMS_REGION+1,                /**< Indicates the ID of region information */
+       MSG_MMS_REGION_LENGTH_LEFT_INT,                                 /**< Indicates the left co-ordinate of the region */
+       MSG_MMS_REGION_LENGTH_LEFT_PERCENT_BOOL,                        /**< Indicates the length is in percentage(%) or not */
+       MSG_MMS_REGION_LENGTH_TOP_INT,                                  /**< Indicates the top co-ordinate of the region */
+       MSG_MMS_REGION_LENGTH_TOP_PERCENT_BOOL,                         /**< Indicates the length is in percentage(%) or not */
+       MSG_MMS_REGION_LENGTH_WIDTH_INT,                                /**< Indicates the width of the region */
+       MSG_MMS_REGION_LENGTH_WIDTH_PERCENT_BOOL,                       /**< Indicates the length is in percentage(%) or not */
+       MSG_MMS_REGION_LENGTH_HEIGHT_INT,                               /**< Indicates the width of the region */
+       MSG_MMS_REGION_LENGTH_HEIGHT_PERCENT_BOOL,                      /**< Indicates the length is in percentage(%) or not */
+       MSG_MMS_REGION_BGCOLOR_INT,                                     /**< Indicates the background color of the region */
+       MSG_MMS_REGION_FIT_TYPE_INT,                                    /**< Indicates the fit type. see enum REGION_FIT_TYPE_T */
+};
+
+enum MSG_MMS_META_INFO_E {
+       MSG_MMS_META_ID_STR = MSG_STRUCT_MMS_META+1,                    /**< Indicates the ID of meta information */
+       MSG_MMS_META_NAME_STR,                                          /**< Indicates the Name */
+       MSG_MMS_META_CONTENT_STR,                                       /**< Indicates the content */
+};
+
+enum MSG_MMS_TRANSION_INFO_E {
+       MSG_MMS_TRANSITION_ID_STR = MSG_STRUCT_MMS_TRANSITION+1,        /**< Indicates the ID of transition information */
+       MSG_MMS_TRANSITION_TYPE_INT,                                    /**< Indicates the transition type. see enum MmsSmilTransType */
+       MSG_MMS_TRANSITION_SUBTYPE_INT,                                 /**< Indicates the transition sub type. see enum MmsSmilTransSubType */
+       MSG_MMS_TRANSITION_DURATION_INT,                                /**< Indicates the transition duration */
+};
+
+enum MSG_MMS_SMIL_TEXT_INFO_E {
+       MSG_MMS_SMIL_TEXT_TRANSITION_IN_ID_STR = MSG_STRUCT_MMS_SMIL_TEXT+1,    /**< Indicates the In SMIL transition id */
+       MSG_MMS_SMIL_TEXT_TRANSITION_OUT_ID_STR,                                /**< Indicates the Out SMIL transition id */
+       MSG_MMS_SMIL_TEXT_REPEAT_INT,                                           /**< Indicates the text needs to be displayed repeatedly */
+       MSG_MMS_SMIL_TEXT_BEGIN_INT,                                            /**< Indicates the begin time */
+       MSG_MMS_SMIL_TEXT_END_INT,                                              /**< Indicates the end time */
+       MSG_MMS_SMIL_TEXT_DURTIME_INT,                                          /**< Indicates the duration */
+       MSG_MMS_SMIL_TEXT_BGCOLOR_INT,                                          /**< Indicates the background color of the text */
+       MSG_MMS_SMIL_TEXT_BOLD_BOOL,                                            /**< Indicates whether the text is bold */
+       MSG_MMS_SMIL_TEXT_UNDERLINE_BOOL,                                       /**< Indicates whether the text is underlined */
+       MSG_MMS_SMIL_TEXT_ITALIC_BOOL,                                          /**< Indicates whether the text is Italic */
+       MSG_MMS_SMIL_TEXT_REVERSE_BOOL,                                         /**< Indicates whether the text is reversed */
+       MSG_MMS_SMIL_TEXT_DIRECTION_TYPE_INT,                                   /**< Indicates the text direction type. see enum MmsTextDirection */
+       MSG_MMS_SMIL_TEXT_SIZE_INT,                                             /**< Indicates the font size */
+       MSG_MMS_SMIL_TEXT_COLOR_INT,                                            /**< Indicates the font color */
+};
+
+enum MSG_MMS_SMIL_AVI_INFO_E {
+       MSG_MMS_SMIL_AVI_TRANSITION_IN_ID_STR = MSG_STRUCT_MMS_SMIL_AVI+1,      /**< Indicates the In SMIL transition id */
+       MSG_MMS_SMIL_AVI_TRANSITION_OUT_ID_STR,                                 /**< Indicates the Out SMIL transition id */
+       MSG_MMS_SMIL_AVI_REPEAT_INT,                                            /**< Indicates the video needs to be displayed repeatedly */
+       MSG_MMS_SMIL_AVI_BEGIN_INT,                                             /**< Indicates the begin time */
+       MSG_MMS_SMIL_AVI_END_INT,                                               /**< Indicates the end time */
+       MSG_MMS_SMIL_AVI_DURTIME_INT,                                           /**< Indicates the duration */
+       MSG_MMS_SMIL_AVI_BGCOLOR_INT,                                           /**< Indicates the background color of the text */
+};
+
+enum MSG_SEND_OPT_E {
+       MSG_SEND_OPT_SETTING_BOOL = MSG_STRUCT_SENDOPT+1,                       /**< Indicates whether the sending option is set ot not for a message */
+       MSG_SEND_OPT_DELIVER_REQ_BOOL,                                          /**< Indicates whether the delivey custom time is used or not */
+       MSG_SEND_OPT_KEEPCOPY_BOOL,                                             /**< Indicates whether the message copy is kept or not */
+       MSG_SEND_OPT_MMS_OPT_HND,                                               /**< The handle of MMS sending option for a message */
+       MSG_SEND_OPT_SMS_OPT_HND,                                               /**< The handle of SMS sending option for a message */
+};
+
+enum MSG_SYNCML_INFO_E {
+       MSG_SYNCML_INFO_EXTID_INT = MSG_STRUCT_SYNCML_INFO+1,                   /**< Indicates the ext ID */
+       MSG_SYNCML_INFO_PINCODE_INT,                                            /**< Indicates the PIN code */
+       MSG_SYNCML_INFO_MESSAGE_HND,                                            /**< Indicate the handle of a message */
+};
+
+enum MSG_COUNT_INFO_E {
+       MSG_COUNT_INFO_READ_INT = MSG_STRUCT_COUNT_INFO+1,                      /**< The count of read messages */
+       MSG_COUNT_INFO_UNREAD_INT,                                              /**< The count of unread messages */
+       MSG_COUNT_INFO_SMS_INT,                                                 /**< The count of sms type messages */
+       MSG_COUNT_INFO_MMS_INT,                                                 /**< The count of mms type messages */
+};
+
+enum MSG_THREAD_COUNT_INFO_E {
+       MSG_THREAD_COUNT_TOTAL_INT = MSG_STRUCT_THREAD_COUNT_INFO+1,            /**< Indicates the total number of messages from the Peer. */
+       MSG_THREAD_COUNT_UNREAD_INT,                                            /**< Indicates the unread messages from the Peer. */
+       MSG_THREAD_COUNT_SMS_INT,                                               /**< Indicates the SMS messages from the Peer. */
+       MSG_THREAD_COUNT_MMS_INT,                                               /**< Indicates the MMS messages from the Peer. */
+};
+
+enum MSG_THREAD_LIST_INDEX_E {
+       MSG_THREAD_LIST_INDEX_CONTACTID_INT = MSG_STRUCT_THREAD_LIST_INDEX+1,   /**< The contact id of message common informatioin */
+       MSG_THREAD_LIST_INDEX_ADDR_INFO_HND,                                    /**< The pointer to message common informatioin */
+};
+
+enum MSG_SORT_RULE_E {
+       MSG_SORT_RULE_SORT_TYPE_INT = MSG_STRUCT_SORT_RULE+1,           /**< Indicates the sort type. See enum _MSG_SORT_TYPE_E */
+       MSG_SORT_RULE_ACSCEND_BOOL,                                     /**< Indicates the sort order which is ascending or descending */
+};
+
+enum MSG_FOLDER_INFO_E {
+       MSG_FOLDER_INFO_ID_INT = MSG_STRUCT_FOLDER_INFO+1,              /**< Indicates the unique folder ID. */
+       MSG_FOLDER_INFO_NAME_STR,                                       /**< Indicates the name of the folder. */
+       MSG_FOLDER_INFO_TYPE_INT,                                       /**< Indicates the folder type. */
+};
+
+enum MSG_SEARCH_CONDITION_E {
+       MSG_SEARCH_CONDITION_FOLDERID_INT = MSG_STRUCT_SEARCH_CONDITION+1,              /**< Indicates the folder ID for searching messages. See enum _MSG_FOLDER_ID_E */
+       MSG_SEARCH_CONDITION_MSGTYPE_INT,                                               /**< Indicates the message type for searching messages. See enum _MSG_MESSAGE_TYPE_E */
+       MSG_SEARCH_CONDITION_ADDRESS_VALUE_STR,                                         /**< The address value for searching messages. */
+       MSG_SEARCH_CONDITION_SEARCH_VALUE_STR,                                          /**< The string to search */
+       MSG_SEARCH_CONDITION_RESERVED_INT,
+};
+
+enum MSG_REPORT_STATUS_E {
+       MSG_REPORT_STATUS_DELIVERY_STATUS_INT = MSG_STRUCT_REPORT_STATUS_INFO+1,        /**< Indicates the message ID of this message. */
+       MSG_REPORT_STATUS_DELIVERY_TIME_INT,                                            /**< Indicates the display time related to the specific operation. */
+       MSG_REPORT_STATUS_READ_STATUS_INT,                                              /**< Indicates the message ID of this message. */
+       MSG_REPORT_STATUS_READ_TIME_INT,                                                /**< Indicates the display time related to the specific operation. */
+};
+enum MSG_ADDRESS_INFO_E {
+       MSG_ADDRESS_INFO_ADDRESS_TYPE_INT = MSG_STRUCT_ADDRESS_INFO+1,                  /**< The type of an address in case of an Email or a mobile phone. See enum _MSG_ADDRESS_TYPE_E */
+       MSG_ADDRESS_INFO_RECIPIENT_TYPE_INT,                                            /**< The type of recipient address in case of To, Cc, and Bcc. See enum _MSG_RECIPIENT_TYPE_E */
+       MSG_ADDRESS_INFO_CONTACT_ID_INT,                                                /**< The contact ID of address */
+       MSG_ADDRESS_INFO_ADDRESS_VALUE_STR,                                             /**< The actual value of an address */
+       MSG_ADDRESS_INFO_DISPLAYNAME_STR,                                               /**< The display name of an address */
+};
+
+enum MSG_MMS_SENDOPT_E {
+       MSG_MMS_SENDOPTION_READ_REQUEST_BOOL = MSG_STRUCT_MMS_SENDOPT+1,                /**< Indicates whether it requests read report or not */
+       MSG_MMS_SENDOPTION_EXPIRY_TIME_INT,                                             /**< Indicates MMS expiry time */
+       MSG_MMS_SENDOPTION_DELIVERY_CUSTOMTIME_BOOL,                                    /**< Indicates whether is use MMS delivery custom time */
+       MSG_MMS_SENDOPTION_DELIVERY_TIME_INT,                                           /**< Indicates MMS delivery time */
+       MSG_MMS_SENDOPTION_PRIORITY_INT,                                                /**< Indicates MMS priority. See enum _MSG_PRIORITY_TYPE_E */
+};
+
+enum MSG_SMS_SENDOPT_E {
+       MSG_SMS_SENDOPT_REPLYPATH_BOOL = MSG_STRUCT_SMS_SENDOPT+1,              /**< Indicates whether reply path is set */
+};
+
+enum MSG_REJECT_MESSAGE_E {
+       MSG_REJECT_MESSAGE_MSGID_INT = MSG_STRUCT_REJECT_MSG_INFO+1,            /**< Indicates the font type none */
+       MSG_REJECT_MESSAGE_MSGTEXT_STR,                                         /**< Indicates the font type none */
+       MSG_REJECT_MESSAGE_DISPLAY_TIME_INT,                                    /**< Indicates the font type none */
+};
+
+enum MSG_REQUEST_INFO_E {
+       MSG_REQUEST_REQUESTID_INT = MSG_STRUCT_REQUEST_INFO+1,  /**< Indicates the request ID, which is unique. When applications submit a request to the framework, this value will be set by the framework. */
+       MSG_REQUEST_MESSAGE_HND,                                /**< Indicates the message structure to be sent by applications. */
+       MSG_REQUEST_SENDOPT_HND,
+};
+
+enum MSG_SENT_STATUS_INFO_E {
+       MSG_SENT_STATUS_REQUESTID_INT = MSG_STRUCT_SENT_STATUS_INFO+1,  /**< Indicates the corresponding request Id. */
+       MSG_SENT_STATUS_NETWORK_STATUS_INT,                             /**< Indicates the status of the corresponding request. Refer to enum _MSG_NETWORK_STATUS_E*/
+};
+
+
+/**
+ *     @brief  Represents the values of a message class type. \n
+ *     This enum is used as the value of MSG_CLASS_TYPE_T.
+ */
+enum _MSG_CLASS_TYPE_E
+{
+       MSG_CLASS_0 = 0,                /**< Immediately presented on the recipient device display */
+       MSG_CLASS_1,                    /**< Stored in the mobile equipment or SIM (depending on memory availability) */
+       MSG_CLASS_2,                    /**< Stored in SIM */
+       MSG_CLASS_3,                    /**< Transferred to the terminal equipment (such as PDA or PC) which is connected to the mobile equipment */
+       MSG_CLASS_NONE,
+};
+
+/**
+ *     @brief  Represents the type of Message. More members maybe added if needed \n
+ *     This enum is used as the value of msg_message_type_t.
+ */
+ enum _MSG_MESSAGE_TYPE_E
+{
+       MSG_TYPE_INVALID = 0,                   /** < Invalid Type Message */
+
+       MSG_TYPE_SMS,                                   /** < Normal SMS Message */
+       MSG_TYPE_SMS_CB,                                /** < Cell Broadcasting SMS Message */
+       MSG_TYPE_SMS_JAVACB,                    /** < JAVA Cell Broadcasting SMS Message */
+       MSG_TYPE_SMS_WAPPUSH,           /** < WAP Push SMS Message */
+       MSG_TYPE_SMS_MWI,                               /** < MWI SMS Message */
+       MSG_TYPE_SMS_SYNCML,                    /** < SyncML CP SMS Message */
+       MSG_TYPE_SMS_REJECT,                    /** < Reject Message */
+       MSG_TYPE_MMS,                                   /** < Normal MMS Message */
+       MSG_TYPE_MMS_JAVA,                      /** < JAVA MMS Message */
+       MSG_TYPE_MMS_NOTI,                      /** < MMS Notification Message */
+};
+
+
+/**
+ *     @brief  Represents the values of an error code. \n
+ *     Success code is zero, but all error codes SHOULD be negative and smaller than MSG_ERROR_BEGIN. \n
+ *     This enum is used as the value of msg_error_t.
+ */
+enum _MSG_ERROR_E
+{
+       MSG_SUCCESS = 0,                                /**< Successful */
+
+       MSG_ERR_NULL_MSGHANDLE = -1,    /**< Message handle is NULL */
+       MSG_ERR_NULL_POINTER = -2,              /**< Pointer is NULL */
+       MSG_ERR_NULL_MESSAGE = -3,              /**< Message is NULL */
+       MSG_ERR_INVALID_STORAGE_ID = -4,        /**< Storage ID is invalid */
+       MSG_ERR_INVALID_MSG_TYPE = -5,          /**< Message type is invalid */
+
+       MSG_ERR_INVALID_STORAGE_REG= -6,        /**< Storage registry is invalid */
+       MSG_ERR_INVALID_MESSAGE_ID = -7,        /**< Message ID is invalid */
+       MSG_ERR_INVALID_MSGHANDLE = -8, /**< Message handle is invalid */
+       MSG_ERR_INVALID_PARAMETER = -9, /**< Parameter is invalid */
+       MSG_ERR_INVALID_MESSAGE = -10,                  /**< Message is invalid */
+
+       MSG_ERR_INVALID_PLUGIN_HANDLE = -11,    /**< Plugin handle is invalid */
+       MSG_ERR_MEMORY_ERROR = -12,                     /**< Memory is error */
+       MSG_ERR_COMMUNICATION_ERROR = -13,      /**< Communication between client and server is error */
+       MSG_ERR_SIM_STORAGE_FULL = -14,         /**< SIM Storage is full */
+       MSG_ERR_TRANSPORT_ERROR = -15,                  /**< Transport event error */
+
+       MSG_ERR_CALLBACK_ERROR = -16,                   /**< Callback event error */
+       MSG_ERR_STORAGE_ERROR = -17,                    /**< Storage event error */
+       MSG_ERR_FILTER_ERROR = -18,                             /**< Filter event error */
+       MSG_ERR_MMS_ERROR = -19,                                /**< MMS event error */
+       MSG_ERR_MMPLAYER_CREATE = -20,                  /**< Multimedia Error*/
+
+       MSG_ERR_MMPLAYER_SET_ATTRS = -21,               /**< Multimedia Error*/
+       MSG_ERR_MMPLAYER_REALIZE = -22,         /**< Multimedia Error*/
+       MSG_ERR_MMPLAYER_PLAY = -23,                    /**< Multimedia Error*/
+       MSG_ERR_MMPLAYER_STOP = -24,                    /**< Multimedia Error*/
+       MSG_ERR_MMPLAYER_DESTROY = -25,         /**< Multimedia Error*/
+
+       MSG_ERR_UNKNOWN = -26,                                  /**< Unknown errors */
+
+       /* Start Database Errors */
+       MSG_ERR_DB_CONNECT = -27,
+       MSG_ERR_DB_DISCONNECT = -28,
+       MSG_ERR_DB_EXEC = -29,
+       MSG_ERR_DB_GETTABLE = -30,
+
+       MSG_ERR_DB_PREPARE = -31,
+       MSG_ERR_DB_STEP = -32,
+       MSG_ERR_DB_NORECORD= -33,
+       MSG_ERR_DB_STORAGE_INIT = -34,
+       MSG_ERR_DB_MAKE_DIR = -35,
+
+       MSG_ERR_DB_ROW = -36,
+       MSG_ERR_DB_DONE = -37,
+       MSG_ERR_DB_GENERIC= -38,
+       MSG_ERR_DB_END = -39,
+       /* End Database Errors */
+
+       /* Start Setting Errors */
+       MSG_ERR_SET_SETTING = -40,
+       MSG_ERR_SET_SIM_SET = -41,
+       MSG_ERR_SET_READ_ERROR = -42,
+       MSG_ERR_SET_WRITE_ERROR = -43,
+       MSG_ERR_SET_DELETE_ERROR = -44,
+       /* End Setting Errors */
+
+       /* Start Plugin Errors */
+       MSG_ERR_PLUGIN_TAPIINIT = -45,
+       MSG_ERR_PLUGIN_REGEVENT = -46,
+       MSG_ERR_PLUGIN_TRANSPORT = -47,
+       MSG_ERR_PLUGIN_STORAGE = -48,
+       MSG_ERR_PLUGIN_SETTING = -49,
+
+       MSG_ERR_PLUGIN_WAPDECODE = -50,
+       MSG_ERR_PLUGIN_TAPI_FAILED = -51,
+       MSG_ERR_PLUGIN_SIM_MSG_FULL = -52,
+       /* End Plugin Errors */
+
+       MSG_ERR_MESSAGE_COUNT_FULL = -53,
+       MSG_ERR_READREPORT_NOT_REQUESTED = -54,
+       MSG_ERR_READREPORT_ALEADY_SENT = -55,
+
+       MSG_ERR_FILTER_DUPLICATED = -56,                                /**< Filter duplicate error */
+       MSG_ERR_SECURITY_ERROR = -57,
+       MSG_ERR_NO_SIM = -58,
+       MSG_ERR_SERVER_NOT_READY= -59,
+};
+
+
+/**
+ *     @brief  Represents the values of a message priority. \n
+ *     This enum is used as the value of msg_priority_type_t.
+ */
+enum _MSG_PRIORITY_TYPE_E
+{
+       MSG_MESSAGE_PRIORITY_LOW,               /**< Low priority */
+       MSG_MESSAGE_PRIORITY_NORMAL,    /**< Normal priority */
+       MSG_MESSAGE_PRIORITY_HIGH,              /**< High priority */
+};
+
+
+/**
+ *     @brief  Represents the values of a network status. \n
+ *     This enum is used as the value of msg_network_status_t.
+ */
+enum _MSG_NETWORK_STATUS_E
+{
+       MSG_NETWORK_NOT_SEND = 0,               /**< Message is not sending */
+       MSG_NETWORK_SENDING,                            /**< Message is sending */
+       MSG_NETWORK_SEND_SUCCESS,               /**< Message is sent successfully */
+       MSG_NETWORK_SEND_FAIL,                  /**< Message is failed to send */
+       MSG_NETWORK_DELIVER_SUCCESS,    /**< Message is delivered */
+       MSG_NETWORK_DELIVER_FAIL,               /**< Message is failed to deliver */
+       MSG_NETWORK_RECEIVED,                   /**< Message is received */
+       MSG_NETWORK_REQ_CANCELLED,              /**< Request is cancelled */
+       MSG_NETWORK_RETRIEVING,                         /**< Message is retrieving */
+       MSG_NETWORK_RETRIEVE_SUCCESS,           /**< Message is retrieved successfully */
+       MSG_NETWORK_RETRIEVE_FAIL,                      /**< Message is failed to retrieve */
+       MSG_NETWORK_SEND_TIMEOUT,                       /**< Message is failed to send by timeout */
+};
+
+
+/**
+ *     @brief  Represents the values of an address type. \n
+ *     This enum is used as the value of msg_address_type_t.
+*/
+enum _MSG_ADDRESS_TYPE_E
+{
+       MSG_ADDRESS_TYPE_UNKNOWN = 0,   /**< The address type is unknown. */
+       MSG_ADDRESS_TYPE_PLMN,                  /**< The address type is for a phone number like +1012345678. */
+       MSG_ADDRESS_TYPE_EMAIL,                 /**< The address type is for an email address like abc@example.email. */
+};
+
+
+/**
+ *     @brief  Represents the values of a recipient type. \n
+ *     This enum is used as the value of msg_recipient_type_t.
+*/
+enum _MSG_RECIPIENT_TYPE_E
+{
+       MSG_RECIPIENTS_TYPE_UNKNOWN = 0,        /**< The recipient type is unknown. */
+       MSG_RECIPIENTS_TYPE_TO,                 /**< The recipient type is for "To". */
+       MSG_RECIPIENTS_TYPE_CC,                 /**< The recipient type is for "Cc". */
+       MSG_RECIPIENTS_TYPE_BCC,                        /**< The recipient type is for "Bcc". */
+};
+
+
+/**
+ *     @brief  Represents the values of a direction type. \n
+ *     This enum is used as the value of msg_direction_type_t.
+ */
+enum _MSG_DIRECTION_TYPE_E
+{
+       MSG_DIRECTION_TYPE_MO = 0,              /**< The direction type is for mobile originated */
+       MSG_DIRECTION_TYPE_MT,                  /**< The direction type is for mobile terminated */
+};
+
+
+/**
+ *     @brief  Represents the values of a string encoding type. \n
+ *     This enum is used as the value of msg_encode_type_t.
+ */
+enum _MSG_ENCODE_TYPE_E
+{
+       MSG_ENCODE_GSM7BIT = 0, /**< The string encoding type is GSM7BIT */
+       MSG_ENCODE_8BIT,                /**< The string encoding type is 8 BIT */
+       MSG_ENCODE_UCS2,                /**< The string encoding type is UCS2 */
+       MSG_ENCODE_AUTO,                /**< The string encoding type is AUTO */
+};
+
+
+/**
+ *     @brief  Represents the action type of Push Message. \n
+ *     This enum is used as the value of msg_push_action_t.
+ */
+enum _MSG_PUSH_ACTION_E
+{
+       // SI Action
+       MSG_PUSH_SI_ACTION_SIGNAL_NONE = 0x00,
+       MSG_PUSH_SI_ACTION_SIGNAL_LOW,
+       MSG_PUSH_SI_ACTION_SIGNAL_MEDIUM,
+       MSG_PUSH_SI_ACTION_SIGNAL_HIGH,
+       MSG_PUSH_SI_ACTION_DELETE,
+
+       // SL Action
+       MSG_PUSH_SL_ACTION_EXECUTE_LOW,
+       MSG_PUSH_SL_ACTION_EXECUTE_HIGH,
+       MSG_PUSH_SL_ACTION_CACHE,
+};
+
+
+/**
+ *     @brief  Represents the type of SyncML Message. \n
+ *     This enum is used as the value of msg_syncml_message_type_t.
+ */
+ enum _MSG_SYNCML_MESSAGE_TYPE_E
+ {
+       DM_WBXML,                                       /** < DM WBXML SyncML Message */
+       DM_XML,                                         /** < DM XML SyncML Message */
+       DM_NOTIFICATION,                        /** < DM Notification SyncML Message */
+
+       DS_NOTIFICATION,                        /** < DS Notification SyncML Message */
+       DS_WBXML,                                       /** < DS WBXML SyncML Message */
+
+       CP_XML,                                         /** < CP XML SyncML Message */
+       CP_WBXML,                                       /** < CP WBXML SyncML Message */
+
+       OTHERS,                                         /** < Unknown SyncML Message */
+ };
+
+
+/**
+ *     @brief  Represents the values of a Delivery Report Status. \n
+ *     This enum is used as the value of msg_delivery_report_status_t.
+*/
+ enum _MSG_DELIVERY_REPORT_STATUS_E
+ {
+        MSG_DELIVERY_REPORT_NONE                               =       -1,     /**< Indicates the status unavailable */
+        MSG_DELIVERY_REPORT_EXPIRED                    =       0,      /**< Indicates the expired status of message */
+        MSG_DELIVERY_REPORT_SUCCESS                            =       1,      /**< Indicates the success status of message */
+        MSG_DELIVERY_REPORT_REJECTED                   =       2,      /**< Indicates the rejected status of message */
+        MSG_DELIVERY_REPORT_DEFERRED                   =       3,      /**< Indicates the deferred status of message */
+        MSG_DELIVERY_REPORT_UNRECOGNISED               =       4,      /**< Indicates the unrecongnised status of message */
+        MSG_DELIVERY_REPORT_INDETERMINATE              =       5,      /**< Indicates the unrecongnised status of message */
+        MSG_DELIVERY_REPORT_FORWARDED                  =       6,      /**< Indicates the forwarded status of message */
+        MSG_DELIVERY_REPORT_UNREACHABLE                =       7,      /**< Indicates the unreachable status of message */
+        MSG_DELIVERY_REPORT_ERROR                              =       8,      /**< Indicates the error status of message */
+ };
+
+
+/**
+ *     @brief  Represents the values of a Read Report Status. \n
+ *     This enum is used as the value of msg_read_report_status_t.
+*/
+enum _MSG_READ_REPORT_STATUS_E
+ {
+        MSG_READ_REPORT_NONE                   =       -1,       /**< Indicates the status unavailable */
+        MSG_READ_REPORT_IS_READ                =       0,        /**< Indicates the message is read */
+        MSG_READ_REPORT_IS_DELETED     =       1         /**< Indicates the message is deleted */
+ };
+
+
+// filter
+/**
+ *     @brief  Represents the values of a filter type. \n
+ *     This enum is used as the value of msg_filter_type_t.
+ */
+enum _MSG_FILTER_TYPE_E
+{
+       MSG_FILTER_BY_ADDRESS = 0,                      /**< Filtered by where the message is come */
+       MSG_FILTER_BY_SUBJECT,                          /**< Filtered by sub string in the subject */
+};
+
+
+// mms
+
+/**
+ *     @brief  Represents the values of a mime type.
+ */
+typedef enum   _MimeType
+{
+       // 0
+       MIME_ASTERISK                                                                                   = 0x0000, /**< Indicates the valid default mime type  */
+
+       // 1
+       MIME_APPLICATION_XML                                                                    = 0x1000, /**< Indicates the application xml type */
+       MIME_APPLICATION_WML_XML                                                        = 0x1001,       /**< Indicates the application wml xml type  */
+       MIME_APPLICATION_XHTML_XML                                                      = 0x1002,       /**< Indicates the application xhtml xml type  */
+       MIME_APPLICATION_JAVA_VM                                                                = 0x1003, /**< Indicates the application java vm type */
+       MIME_APPLICATION_SMIL                                                           = 0x1004, /**< Indicates the application smil  type */
+       MIME_APPLICATION_JAVA_ARCHIVE                                           = 0x1005, /**< Indicates the application java archive type */
+       MIME_APPLICATION_JAVA                                                           = 0x1006, /**< Indicates the application java  type */
+       MIME_APPLICATION_OCTET_STREAM                                           = 0x1007, /**< Indicates the application octect stream type */
+       MIME_APPLICATION_STUDIOM                                                        = 0x1008, /**< Indicates the application studiom type */
+       MIME_APPLICATION_FUNMEDIA                                                       = 0x1009, /**< Indicates the application fun media type */
+       MIME_APPLICATION_MSWORD                                                         = 0x100a,       /**< Indicates the application ms word type */
+       MIME_APPLICATION_PDF                                                                    = 0x100b, /**< Indicates the application pdf type */
+       MIME_APPLICATION_SDP                                                                    = 0x100c,  /**< Indicates the application sdp type */
+       MIME_APPLICATION_RAM                                                                    = 0x100d, /**< Indicates the application ram type */
+       MIME_APPLICATION_ASTERIC                                                                = 0x100e, /**< Indicates the application as main type and generic sub type */
+
+       // 16
+       MIME_APPLICATION_VND_WAP_XHTMLXML                                       = 0x1100, /**< Indicates the application wap xhtml xml type */
+       MIME_APPLICATION_VND_WAP_WMLC                                           = 0x1101,  /**< Indicates the application wap wmlc type */
+       MIME_APPLICATION_VND_WAP_WMLSCRIPTC                             = 0x1102,  /**< Indicates the application wap wmlscrpitc type */
+       MIME_APPLICATION_VND_WAP_WTA_EVENTC                             = 0x1103, /**< Indicates the application wap  wta event type */
+       MIME_APPLICATION_VND_WAP_UAPROF                                 = 0x1104, /**< Indicates the application wap uaprof type */
+       MIME_APPLICATION_VND_WAP_SIC                                            = 0x1105,  /**< Indicates the application wap sic type */
+       MIME_APPLICATION_VND_WAP_SLC                                            = 0x1106, /**< Indicates the application wap slc type */
+       MIME_APPLICATION_VND_WAP_COC                                            = 0x1107, /**< Indicates the application wap coc type */
+       MIME_APPLICATION_VND_WAP_SIA                                            = 0x1108, /**< Indicates the application wap sia type */
+       MIME_APPLICATION_VND_WAP_CONNECTIVITY_WBXML             = 0x1109,  /**< Indicates the application wap connectivity wbxml type */
+       MIME_APPLICATION_VND_WAP_MULTIPART_FORM_DATA    = 0x110a, /**< Indicates the application wap multipart data type */
+       MIME_APPLICATION_VND_WAP_MULTIPART_BYTERANGES   = 0x110b, /**< Indicates the application wap multipart byte type */
+       MIME_APPLICATION_VND_WAP_MULTIPART_MIXED                        = 0x110c,  /**< Indicates the application wap multipart mixed type */
+       MIME_APPLICATION_VND_WAP_MULTIPART_RELATED              = 0x110d,  /**< Indicates the application wap multipart related type */
+       MIME_APPLICATION_VND_WAP_MULTIPART_ALTERNATIVE  = 0x110e,  /**< Indicates the application wap  multipart alternative type */
+       MIME_APPLICATION_VND_WAP_MULTIPART_ASTERIC              = 0x110f, /**< Indicates the application wap mulitpart as main type and generic sub type */
+       MIME_APPLICATION_VND_WAP_WBXML                                  = 0x1110, /**< Indicates the application wap wbxml type */
+       MIME_APPLICATION_VND_OMA_DD_XML                                 = 0x1111, /**< Indicates the application oma dd xml type */
+       MIME_APPLICATION_VND_OMA_DRM_MESSAGE                            = 0x1112,  /**< Indicates the application oma drm message type */
+       MIME_APPLICATION_VND_OMA_DRM_CONTENT                            = 0x1113, /**< Indicates the application oma drm content type */
+       MIME_APPLICATION_VND_OMA_DRM_RIGHTS_XML                 = 0x1114, /**< Indicates the application oma drm rights xml type */
+       MIME_APPLICATION_VND_OMA_DRM_RIGHTS_WBXML               = 0x1115,  /**< Indicates the application oma drm rights wbxml type */
+       MIME_APPLICATION_VND_OMA_DRM_RO_XML                             = 0x1116, /**< Indicates the application oma drm ro xml type */
+       MIME_APPLICATION_VND_OMA_DRM_DCF                                        = 0x1117, /**< Indicates the application oma drm dcf type */
+       MIME_APPLICATION_VND_OMA_ROAPPDU_XML                            = 0x1118,  /**< Indicates the application oma roap pdu xml type */
+       MIME_APPLICATION_VND_OMA_ROAPTRIGGER_XML                        = 0x1119,       /**< Indicates the application oma roap trigger xml  type */
+       MIME_APPLICATION_VND_SMAF                                                       = 0x111a,  /**< Indicates the application smaf type */
+       MIME_APPLICATION_VND_RN_REALMEDIA                                       = 0x111b,  /**< Indicates the application rn real media type */
+       MIME_APPLICATION_VND_SUN_J2ME_JAVA_ARCHIVE              = 0x111c,  /**< Indicates the application j2me java archive type */
+       MIME_APPLICATION_VND_EXCEL                                                      = 0x111e,  /**< Indicates the application excel type */
+       MIME_APPLICATION_VND_POWERPOINT                                 = 0x111f,  /**< Indicates the application power point type */
+       MIME_APPLICATION_VND_MSWORD                                             = 0x1120,        /**< Indicates the application ms word type */
+
+       // 49
+       MIME_APPLICATION_X_HDMLC                                                        = 0x1200, /**< Indicates the application x hdmlc type */
+       MIME_APPLICATION_X_X968_USERCERT                                        = 0x1201, /**< Indicates the application x x968 user certified type */
+       MIME_APPLICATION_X_WWW_FORM_URLENCODED                  = 0x1202, /**< Indicates the application x www form url encoded type */
+       MIME_APPLICATION_X_SMAF                                                         = 0x1203, /**< Indicates the application x smaf type */
+       MIME_APPLICATION_X_FLASH                                                                = 0x1204, /**< Indicates the application x flash type */
+       MIME_APPLICATION_X_EXCEL                                                                = 0x1205, /**< Indicates the application x excel type */
+       MIME_APPLICATION_X_POWERPOINT                                           = 0x1206, /**< Indicates the application x power point type */
+
+       // 56
+       MIME_AUDIO_BASIC                                                                                = 0x2000, /**< Indicates the audio basic type  */
+       MIME_AUDIO_MPEG                                                                         = 0x2001, /**< Indicates the audio mpeg type  */
+       MIME_AUDIO_MP3                                                                          = 0x2002, /**< Indicates the audio mp3 type  */
+       MIME_AUDIO_MPG3                                                                         = 0x2003,  /**< Indicates the audio mpg3 type  */
+       MIME_AUDIO_MPEG3                                                                                = 0x2004, /**< Indicates the audio mpeg3 type  */
+       MIME_AUDIO_MPG                                                                          = 0x2005, /**< Indicates the audio mpg type  */
+       MIME_AUDIO_AAC                                                                          = 0x2006, /**< Indicates the audio aac type  */
+       MIME_AUDIO_G72                                                                          = 0x2007, /**< Indicates the audio g72 type  */
+       MIME_AUDIO_AMR                                                                          = 0x2008, /**< Indicates the audio amr type  */
+       MIME_AUDIO_AMR_WB                                                                       = 0x2009, /**< Indicates the audio amr wb type  */
+       MIME_AUDIO_MMF                                                                          = 0x200a, /**< Indicates the audio mmf type  */
+       MIME_AUDIO_SMAF                                                                         = 0x200b, /**< Indicates the audio smaf type  */
+       MIME_AUDIO_IMELODY                                                                      = 0x200c, /**< Indicates the audio imelody type  */
+       MIME_AUDIO_IMELODY2                                                                     = 0x200d, /**< Indicates the audio imelody2 type  */
+       MIME_AUDIO_MELODY                                                                       = 0x200e, /**< Indicates the audio melody type  */
+       MIME_AUDIO_MID                                                                          = 0x200f, /**< Indicates the audio mid type  */
+       MIME_AUDIO_MIDI                                                                         = 0x2010, /**< Indicates the audio midi type  */
+       MIME_AUDIO_SP_MIDI                                                                      = 0x2011, /**< Indicates the audio sp midi type  */
+       MIME_AUDIO_WAVE                                                                         = 0x2012, /**< Indicates the audio wave type  */
+       MIME_AUDIO_WAV                                                                          = 0x2013, /**< Indicates the audio wav type  */
+       MIME_AUDIO_3GPP                                                                         = 0x2014, /**< Indicates the audio 3gpp type  */
+       MIME_AUDIO_MP4                                                                          = 0x2015, /**< Indicates the audio mp4 type  */
+       MIME_AUDIO_MP4A_LATM                                                            = 0x2016, /**< Indicates the audio mp4 latm type  */
+       MIME_AUDIO_M4A                                                                          = 0x2017, /**< Indicates the audio m4a type  */
+       MIME_AUDIO_MPEG4                                                                                = 0x2018, /**< Indicates the audio mpeg4 type  */
+       MIME_AUDIO_WMA                                                                          = 0x2019, /**< Indicates the audio wma type  */
+       MIME_AUDIO_XMF                                                                          = 0x201a, /**< Indicates the audio xmf type  */
+       MIME_AUDIO_IMY                                                                          = 0x201b, /**< Indicates the audio imy type  */
+       MIME_AUDIO_MOBILE_XMF                                                           = 0x201c, /**< Indicates the audio mobile xmf type  */
+
+       //85
+       MIME_AUDIO_VND_RN_REALAUDIO                                             = 0x2100, /**< Indicates the audio rn real audio type  */
+
+       // 86
+       MIME_AUDIO_X_MPEG                                                                       = 0x2200, /**< Indicates the audio x mpeg type  */
+       MIME_AUDIO_X_MP3                                                                                = 0x2201, /**< Indicates the audio x mp3 type  */
+       MIME_AUDIO_X_MPEG3                                                                      = 0x2202,    /**< Indicates the audio x mpeg3 type  */
+       MIME_AUDIO_X_MPG                                                                                = 0x2203, /**< Indicates the audio x mpg type  */
+       MIME_AUDIO_X_AMR                                                                                = 0x2204, /**< Indicates the audio x amr type  */
+       MIME_AUDIO_X_MMF                                                                                = 0x2205, /**< Indicates the audio x mmf type  */
+       MIME_AUDIO_X_SMAF                                                                       = 0x2206, /**< Indicates the audio x smaf type  */
+       MIME_AUDIO_X_IMELODY                                                                    = 0x2207, /**< Indicates the audio x imelody type  */
+       MIME_AUDIO_X_MIDI                                                                               = 0x2208, /**< Indicates the audio x midi type  */
+       MIME_AUDIO_X_MPEGAUDIO                                                          = 0x2209, /**< Indicates the audio x mpeg  type  */
+       MIME_AUDIO_X_PN_REALAUDIO                                                       = 0x220a, /**< Indicates the audio x pn real audio type  */
+       MIME_AUDIO_X_PN_MULTIRATE_REALAUDIO                             = 0x220b, /**< Indicates the audio x pn multirate real audio  type  */
+       MIME_AUDIO_X_PN_MULTIRATE_REALAUDIO_LIVE                        = 0x220c, /**< Indicates the audio x pn multirate real audio live type  */
+       MIME_AUDIO_X_WAVE                                                                       = 0x220d, /**< Indicates the audio x wave  type  */
+       MIME_AUDIO_X_WAV                                                                                = 0x220e, /**< Indicates the audio x wav  type  */
+       MIME_AUDIO_X_MS_WMA                                                                     = 0x220f, /**< Indicates the audio ms wma type  */
+       MIME_AUDIO_X_MID                                                                                = 0x2210, /**< Indicates the audio mid type  */
+       MIME_AUDIO_X_MS_ASF                                                                     = 0x2211, /**< Indicates the audio ms asf  type  */
+       MIME_AUDIO_X_XMF                                                                                = 0x2212, /**< Indicates the audio x xmf  type  */
+
+       // 105
+       MIME_IMAGE_GIF                                                                          = 0x3000, /**< Indicates the image gif type  */
+       MIME_IMAGE_JPEG                                                                         = 0x3001, /**< Indicates the image jpeg type  */
+       MIME_IMAGE_JPG                                                                          = 0x3002, /**< Indicates the image jpg type  */
+       MIME_IMAGE_TIFF                                                                         = 0x3003, /**< Indicates the image tiff type  */
+       MIME_IMAGE_TIF                                                                          = 0x3004, /**< Indicates the image tif type  */
+       MIME_IMAGE_PNG                                                                          = 0x3005, /**< Indicates the image png type  */
+       MIME_IMAGE_WBMP                                                                         = 0x3006, /**< Indicates the image wbmp type  */
+       MIME_IMAGE_PJPEG                                                                                = 0x3007, /**< Indicates the image pjpeg type  */
+       MIME_IMAGE_BMP                                                                          = 0x3008, /**< Indicates the image bmp type  */
+       MIME_IMAGE_SVG                                                                          = 0x3009, /**< Indicates the image svg type  */
+       MIME_IMAGE_SVG1                                                                         = 0x300a, /**< Indicates the image svg1 type  */
+
+       // 116
+       MIME_IMAGE_VND_WAP_WBMP                                                 = 0x3100,  /**< Indicates the image vnd wap wbmp type  */
+       MIME_IMAGE_VND_TMO_GIF                                                          = 0x3101,  /**< Indicates the image vnd tmo gif type  */
+       MIME_IMAGE_VND_TMO_JPG                                                          = 0x3102,  /**< Indicates the image vnd tmo jpg type  */
+
+       // 119
+       MIME_IMAGE_X_BMP                                                                                = 0x3200, /**< Indicates the image x bmp type  */
+
+       // 120
+       MIME_MESSAGE_RFC822                                                                     = 0x4000,  /**< Indicates the message rfc822 type  */
+
+       // 121
+       MIME_MULTIPART_MIXED                                                                    = 0x5000,  /**< Indicates the multipart mixed type  */
+       MIME_MULTIPART_RELATED                                                          = 0x5001, /**< Indicates the multipart related type  */
+       MIME_MULTIPART_ALTERNATIVE                                                      = 0x5002, /**< Indicates the multipart alternative type  */
+       MIME_MULTIPART_FORM_DATA                                                        = 0x5003, /**< Indicates the multipart form data type  */
+       MIME_MULTIPART_BYTERANGE                                                        = 0x5004, /**< Indicates the multipart byte range type  */
+       MIME_MULTIPART_REPORT                                                           = 0x5005, /**< Indicates the multipart report type  */
+       MIME_MULTIPART_VOICE_MESSAGE                                            = 0x5006, /**< Indicates the multipart voice message type  */
+
+       // 128
+       MIME_TEXT_TXT                                                                                   = 0x6000, /**< Indicates the text txt type  */
+       MIME_TEXT_HTML                                                                          = 0x6001, /**< Indicates the text html type  */
+       MIME_TEXT_PLAIN                                                                         = 0x6002,  /**< Indicates the text plain type  */
+       MIME_TEXT_CSS                                                                                   = 0x6003,  /**< Indicates the text css type  */
+       MIME_TEXT_XML                                                                                   = 0x6004,  /**< Indicates the text xml type  */
+       MIME_TEXT_IMELODY                                                                               = 0x6005,  /**< Indicates the text imelody type  */
+
+       // 134
+       MIME_TEXT_VND_WAP_WMLSCRIPT                                             = 0x6100, /**< Indicates the text wap wmlscript  type  */
+       MIME_TEXT_VND_WAP_WML                                                           = 0x6101, /**< Indicates the text wap wml  type  */
+       MIME_TEXT_VND_WAP_WTA_EVENT                                             = 0x6102, /**< Indicates the text wap wta event  type  */
+       MIME_TEXT_VND_WAP_CONNECTIVITY_XML                              = 0x6103, /**< Indicates the text wap connectivity xml  type  */
+       MIME_TEXT_VND_WAP_SI                                                                    = 0x6104,  /**< Indicates the text wap si  type  */
+       MIME_TEXT_VND_WAP_SL                                                            = 0x6105, /**< Indicates the text wap sl  type  */
+       MIME_TEXT_VND_WAP_CO                                                            = 0x6106, /**< Indicates the text wap co  type  */
+       MIME_TEXT_VND_SUN_J2ME_APP_DESCRIPTOR                           = 0x6107, /**< Indicates the text sun j2me type  */
+
+       // 142
+       MIME_TEXT_X_HDML                                                                                = 0x6200, /**< Indicates the x html  type  */
+       MIME_TEXT_X_VCALENDAR                                                           = 0x6201,  /**< Indicates the x calendar  type  */
+       MIME_TEXT_X_VCARD                                                                       = 0x6202, /**< Indicates the x vcard  type  */
+       MIME_TEXT_X_IMELODY                                                                     = 0x6203, /**< Indicates the x imelody  type  */
+       MIME_TEXT_X_IMELODY2                                                                    = 0x6204, /**< Indicates the x imelody2  type  */
+       MIME_TEXT_X_VNOTE                                                                       = 0x6205,  /**< Indicates the x vnote  type  */
+
+       // 148
+       MIME_VIDEO_MPEG4                                                                                = 0x7000, /**< Indicates the mpeg4  type  */
+       MIME_VIDEO_MP4                                                                          = 0x7001, /**< Indicates the mp4  type  */
+       MIME_VIDEO_H263                                                                         = 0x7002, /**< Indicates the h263  type  */
+       MIME_VIDEO_3GPP                                                                         = 0x7003, /**< Indicates the 3gpp  type  */
+       MIME_VIDEO_3GP                                                                          = 0x7004, /**< Indicates the 3gp  type  */
+       MIME_VIDEO_AVI                                                                          = 0x7005, /**< Indicates the avi  type  */
+       MIME_VIDEO_SDP                                                                          = 0x7006, /**< Indicates the sdp  type  */
+       MIME_VIDEO_MP4_ES                                                                       = 0x7007, /**< Indicates the mp4 es  type  */
+       MIME_VIDEO_MPEG                                                                         = 0x7008, /**< Indicates the mpeg  type  */
+
+       // 157
+       MIME_VIDEO_VND_RN_REALVIDEO                                                     = 0x7100, /**< Indicates the pn real video type  */
+       MIME_VIDEO_VND_RN_REALMEDIA                                                     = 0x7101, /**< Indicates the pn multi rate real media type  */
+
+       // 159
+       MIME_VIDEO_X_MP4                                                                                = 0x7200, /**< Indicates the video x mp4 type  */
+       MIME_VIDEO_X_PV_MP4                                                                     = 0x7201, /**< Indicates the video x pv mp4 type  */
+       MIME_VIDEO_X_PN_REALVIDEO                                                       = 0x7202, /**< Indicates the x pn real video type  */
+       MIME_VIDEO_X_PN_MULTIRATE_REALVIDEO                             = 0x7203, /**< Indicates the x pn multi rate real video type  */
+       MIME_VIDEO_X_MS_WMV                                                                     = 0x7204, /**< Indicates the x ms wmv type  */
+       MIME_VIDEO_X_MS_ASF                                                                     = 0x7205, /**< Indicates the x ms asf type  */
+       MIME_VIDEO_X_PV_PVX                                                                     = 0x7206, /**< Indicates the x pv pvx type  */
+
+       MIME_TYPE_VALUE_MAX                                                                     = 0x7207,               /**< Indicates the maximum mime type  */
+       MIME_UNKNOWN                                                                                    = 0xffff        /**< Indicates the unknown mime type  */
+
+} MimeType;
+
+/**
+ *     @brief  Represents the values of a DRM type.
+ */
+//#ifdef __SUPPORT_DRM__
+typedef enum
+{
+       MSG_DRM_TYPE_NONE       = 0, /**< Indicates the drm type none */
+       MSG_DRM_TYPE_FL         = 1, /**< Indicates the forward lock */         /* 2004-07-09: forwardLock type */
+       MSG_DRM_TYPE_CD         = 2, /**< Indicates the combined delivery */    /* 2004-07-09: combined delivery type */
+       MSG_DRM_TYPE_SD         = 3, /**< Indicates the separate delivery */    /* 2004-07-09: seperate delivery type */
+       MSG_DRM_TYPE_SSD        = 4     /**< Indicates the special separate delivery */ // 2005-02-28: add Special Sperate Delivery
+}MsgDrmType;
+//#endif
+
+/**
+ *     @brief  Represents the values of a SMIL region type.
+ */
+typedef enum _REGION_FIT_TYPE_T
+{
+       MMSUI_IMAGE_REGION_FIT_HIDDEN,   /**< Indicates the hidden fit type */
+       MMSUI_IMAGE_REGION_FIT_MEET,     /**< Indicates the meet fit type */
+}REGION_FIT_TYPE_T;
+
+
+/**
+ *     @brief  Represents the values of a SMIL media type.
+ */
+typedef enum
+{
+       MMS_SMIL_MEDIA_INVALID = 0, /**< Indicates the invalid media type */
+       MMS_SMIL_MEDIA_IMG,                     /**< Indicates the image media */
+       MMS_SMIL_MEDIA_AUDIO,           /**< Indicates the audio media */
+       MMS_SMIL_MEDIA_VIDEO,           /**< Indicates the video media */
+       MMS_SMIL_MEDIA_TEXT,            /**< Indicates the text media */
+       MMS_SMIL_MEDIA_ANIMATE,         /**< Indicates the animation media */
+       MMS_SMIL_MEDIA_IMG_OR_VIDEO     , /**< Indicates the image or video media */
+       MMS_SMIL_MEDIA_MAX = 0xffffffff,        /**< Indicates the maximum media type */
+}MmsSmilMediaType;
+
+/**
+ *     @brief  Represents the values of a SMIL transition type.
+ */
+typedef enum
+{
+       MMS_SMIL_TRANS_NONE = 0,                /**< Indicates the transition type none */                      /* default */
+       MMS_SMIL_TRANS_SLIDEWIPE = 1,   /**< Indicates the slide wipe transition */
+       MMS_SMIL_TRANS_BARWIPE = 2,             /**< Indicates the bar wipe transition */
+       MMS_SMIL_TRANS_BARNDOORWIPE = 3, /**< Indicates the bar and door wipe transition */
+       MMS_SMIL_TRANS_FADE = 4,                /**< Indicates the fade transition */
+       MMS_SMIL_TRANS_RANDOMBLOCK = 5, /**< Indicates the random block transition */
+       MMS_SMIL_TRANS_ZOOMIN = 6,              /**< Indicates the zoom in transition */
+       MMS_SMIL_TRANS_IRISWIPE = 7,    /**< Indicates the iris wipe transition */
+       MMS_SMIL_TRANS_BOXWIPE = 8,             /**< Indicates the box wipe transition */
+       MMS_SMIL_TRANS_FOURBOXWIPE = 9, /**< Indicates the four box wipe transition */
+       MMS_SMIL_TRANS_PUSHWIPE  =10,   /**< Indicates the push wipe transition */
+       MMS_SMIL_TRANS_ELLIPSEWIPE  = 11 /**< Indicates the ellipse wipe transition */
+}MmsSmilTransType;
+
+/**
+ *     @brief  Represents the values of a SMIL transition sub type.
+ */
+typedef enum
+{
+       MMS_SMIL_TRANS_SUB_NONE = 0,    /**< Indicates the transition sub type none */
+       MMS_SMIL_TRANS_SUB_FROM_LEFT = 1,       /**< Indicates the from left transition */      /* slideWipe's default */
+       MMS_SMIL_TRANS_SUB_FROM_TOP = 2,        /**< Indicates the from top transition */
+       MMS_SMIL_TRANS_SUB_FROM_BOTTOM = 3,     /**< Indicates the from bottom transition */
+       MMS_SMIL_TRANS_SUB_TOP_TO_BOTTOM = 4, /**< Indicates the from top to bottom transition */                       /* barWipe's default */
+       MMS_SMIL_TRANS_SUB_BOTTOM_TO_TOP = 5, /**< Indicates the from bottom to top transition */
+       MMS_SMIL_TRANS_SUB_HORIZONTAL = 6,      /**< Indicates the horizontal transition */             /* barDoorWipe's default */
+    MMS_SMIL_TRANS_SUB_FROM_RIGHT = 7, /**< Indicates the from right transition */
+    MMS_SMIL_TRANS_SUB_VERTICAL = 8 /**< Indicates the vertical transition */
+}MmsSmilTransSubType;
+
+/**
+ *     @brief  Represents the values of a text font type.
+ */
+typedef enum
+{
+       MMS_SMIL_FONT_TYPE_NONE = 0, /**< Indicates the font type none */
+       MMS_SMIL_FONT_TYPE_NORMAL = 1, /**< Indicates the font type normal */
+       MMS_SMIL_FONT_TYPE_ITALIC = 2, /**< Indicates the font type italic */
+       MMS_SMIL_FONT_TYPE_BOLD = 3, /**< Indicates the font type bold */
+       MMS_SMIL_FONT_TYPE_UNDERLINE = 4 /**< Indicates the font type underline */
+}MmsSmilFontType;
+
+/**
+ *     @brief  Represents the values of a MMS text direction.
+ */
+typedef enum   _MmsTextDir{
+       MMS_TEXT_DIRECTION_INVALID = -1, /**< Indicates the invalid direction */
+       MMS_TEXT_DIRECTION_RIGHT = 0,   /**< Indicates the right direction */
+       MMS_TEXT_DIRECTION_DOWN,                /**< Indicates the down direction */            // supported to GC
+} MmsTextDirection;
+
+/**
+ *     @brief  Represents the values of MMS Read Report Sent Status.
+ */
+typedef enum
+{
+       MMS_RECEIVE_READ_REPORT_NO_SEND,        // didn't send yet
+       MMS_RECEIVE_READ_REPORT_MUST_SEND,      // didn't send yet but will send
+       MMS_RECEIVE_READ_REPORT_SENT,           // sent
+       MMS_RECEIVE_READ_REPORT_NO_SENT,        // required but, didn't send by user's choice
+} MmsRecvReadReportSendStatus ;
+
+
+// setting
+
+/**
+ *     @brief  Represents the values of an option type. \n
+ *     This enum is used as the value of MSG_OPTION_TYPE_T.
+ */
+enum _MSG_OPTION_TYPE_E
+{
+       MSG_GENERAL_OPT,                        /**< General option */
+       MSG_SMS_SENDOPT,                        /**< SMS send option */
+       MSG_SMSC_LIST,                          /**< SMSC list option */
+       MSG_MMS_SENDOPT,                        /**< MMS send option */
+       MSG_MMS_RECVOPT,                        /**< MMS receive option */
+       MSG_MMS_CLASSOPT,                       /**< MMS class option such as personal, advertisement, and informational */
+       MSG_MMS_STYLEOPT,                       /**< MMS style option */
+       MSG_PUSHMSG_OPT,                        /**< Push message option */
+       MSG_CBMSG_OPT,                  /**< Cell broadcasting message option */
+       MSG_VOICEMAIL_OPT,                      /**< Voice mail option */
+       MSG_MSGSIZE_OPT,                        /**< Message size option */
+};
+
+
+/**
+ *     @brief  Represents the values of an SMS network mode. \n
+ *     This enum is used as the value of MSG_SMS_NETWORK_MODE_T.
+ */
+enum _MSG_SMS_NETWORK_MODE_E
+{
+       MSG_SMS_NETWORK_PS_ONLY = 0x01,         /**< Packet switched */
+       MSG_SMS_NETWORK_CS_ONLY = 0x02,         /**< Circuit switched */
+       MSG_SMS_NETWORK_PS_FIRST = 0x03,                /**< Packet switching preferred */
+};
+
+
+/**
+ *     @brief  Represents the value of period of playing alert tone. \n
+ *     The values for this type SHOULD be in MSG_ALERT_TONE_T.
+ */
+enum _MSG_ALERT_TONE_E
+{
+       MSG_ALERT_TONE_ONCE,
+       MSG_ALERT_TONE_2MINS,
+       MSG_ALERT_TONE_5MINS,
+       MSG_ALERT_TONE_10MINS,
+};
+
+
+/**
+ *     @brief  Represents the value of a default storage to save SMS. \n
+ *     The values for this type SHOULD be in MSG_SMS_SAVE_STORAGE_T.
+ */
+enum _MSG_SMS_SAVE_STORAGE_E
+{
+       MSG_SMS_SAVE_STORAGE_SIM,
+       MSG_SMS_SAVE_STORAGE_PHONE,
+};
+
+
+/**
+ *     @brief  Represents the values of the type of number for SMS center address. \n
+ *     This enum is used as the value of MSG_SMS_TON_T.
+ */
+enum _MSG_SMS_TON_E
+{
+       MSG_TON_UNKNOWN = 0,                    /**< Unknown */
+       MSG_TON_INTERNATIONAL,          /**< International */
+       MSG_TON_NATIONAL,                               /**< National */
+       MSG_TON_NETWORK,                                /**< Network */
+       MSG_TON_SUBSCRIBER,                     /**< Subscriber */
+       MSG_TON_ALPHANUMERIC,           /**< Alpha numeric */
+       MSG_TON_ABBREVIATED,                    /**< Abbreviated */
+       MSG_TON_RESERVE,                                /**< Reserve */
+};
+
+
+/**
+ *     @brief  Represents the values of the numbering plan ID for SMS center address. \n
+ *     This enum is used as the value of MSG_SMS_NPI_T.
+ */
+enum _MSG_SMS_NPI_E
+{
+       MSG_NPI_UNKNOWN = 0,                    /**< Unknown */
+       MSG_NPI_ISDN = 1,                               /**< ISDN */
+       MSG_NPI_DATA = 3,                               /**< Data */
+       MSG_NPI_TELEX = 4,                              /**< Telex */
+       MSG_NPI_SMSC = 5,                               /**< SMSC */
+       MSG_NPI_NATIONAL = 8,                   /**< National */
+       MSG_NPI_PRIVATE = 9,                    /**< Private */
+       MSG_NPI_IDENTIFICATION_ERMES = 10,              /**< Identification ermes */
+       MSG_NPI_IDENTIFICATION_RESERVED = 0xF           /**< Identification reserved */
+};
+
+
+/**
+ *     @brief  Represents the values of the protocol ID for SMS center address. \n
+ *     This enum is used as the value of MSG_SMS_PID_T.
+ */
+enum  _MSG_SMS_PID_E
+{
+       MSG_PID_NONE,           /**< None */
+       MSG_PID_TEXT,           /**< Text */
+       MSG_PID_VOICE,          /**< Voice */
+       MSG_PID_FAX,            /**< Fax */
+       MSG_PID_X400,           /**< X400 */
+       MSG_PID_ERMES,          /**< Ermes */
+       MSG_PID_EMAIL,          /**< Email */
+       MSG_PID_MAX             /**< Default */
+};
+
+
+/**
+ *     @brief  Represents the values of the Validity Period for SMS center. \n
+ *     This enum is used as the value of MSG_VAL_PERIOD_T.
+ */
+enum  _MSG_VAL_PERIOD_E
+{
+       MSG_VAL_1DAY = 167,
+       MSG_VAL_2DAYS = 168,
+       MSG_VAL_1WEEK = 173,
+       MSG_VAL_2WEEKS = 180,
+       MSG_VAL_MAXIMUM = 255,
+};
+
+
+enum  _MSG_MMS_EXPIRY_TIME_E
+{
+       MSG_EXPIRY_TIME_MAXIMUM = 0,
+       MSG_EXPIRY_TIME_1DAY = 86400,
+       MSG_EXPIRY_TIME_2DAYS = 2*86400,
+       MSG_EXPIRY_TIME_1WEEK = 604800,
+       MSG_EXPIRY_TIME_2WEEKS = 2*604800,
+};
+
+
+enum  _MSG_MMS_DELIVERY_TIME_E
+{
+       MSG_DELIVERY_TIME_IMMEDIATLY = 0,
+       MSG_DELIVERY_TIME_1HOUR = 3600,
+       MSG_DELIVERY_TIME_1DAY = 86400,
+       MSG_DELIVERY_TIME_1WEEK = 604800,
+       MSG_DELIVERY_TIME_CUSTOM
+};
+
+
+enum _MSG_MMS_MSG_CLASS_TYPE_E
+{
+       MSG_CLASS_PERSONAL,                     /**<Personal message class*/
+       MSG_CLASS_ADVERTISEMENT,                /**<Advertisement message class*/
+       MSG_CLASS_INFORMATIONAL,                /**<Informational message class */
+       MSG_CLASS_AUTO,                         /**<Automatic */
+       MSG_CLASS_MAX                                   /**< */
+};
+
+
+enum _MSG_MMS_REPLY_CHARGING_TYPE_E
+{
+       MSG_REPLY_CHARGING_NONE,                                        /**<Reply-Charging none */
+       MSG_REPLY_CHARGING_REQUESTED,                           /**<Reply-Charging requested */
+       MSG_REPLY_CHARGING_REQUESTED_TEXT_ONLY, /**<Reply-Charging requested text-only */
+       MSG_REPLY_CHARGING_ACCEPTED,                            /**<Reply-Charging accepted */
+       MSG_REPLY_CHARGING_ACCEPTED_TEXT_ONLY,  /**<Reply-Charging accepted text-only */
+       MSG_REPLY_CHARGING_MAX
+};
+
+
+enum _MSG_MMS_CREATION_MODE_E
+{
+       MSG_CREATION_MODE_RESTRICTED,
+       MSG_CREATION_MODE_WARNING,
+       MSG_CREATION_MODE_FREE
+};
+
+
+/**
+ *     @brief  Represents the values of the retrieve type for MMS home network. \n
+ *     This enum is used as the value of MSG_MMS_HOME_RETRIEVE_TYPE_T.
+ */
+enum _MSG_MMS_HOME_RETRIEVE_TYPE_E
+{
+       MSG_HOME_AUTO_DOWNLOAD,         /**< Home auto download */
+       MSG_HOME_MANUAL,                                        /**< Home manual */
+       MSG_HOME_RESTRICTED,                            /**< Home restricted */
+       MSG_HOME_REJECT,                                        /**< Home reject */
+       MSG_HOME_MAX                                            /**< Default */
+};
+
+
+/**
+ *     @brief  Represents the values of the retrieve type for MMS abroad network. \n
+ *     This enum is used as the value of MSG_MMS_ABROAD_RETRIEVE_TYPE_T.
+ */
+enum _MSG_MMS_ABROAD_RETRIEVE_TYPE_E
+{
+       MSG_ABROAD_AUTO_DOWNLOAD,       /**< Abroad auto download */
+       MSG_ABROAD_MANUAL,                      /**< Abroad manual */
+       MSG_ABROAD_RESTRICTED,          /**< Abroad restricted */
+       MSG_ABROAD_REJECT,                      /**< Abroad reject */
+       MSG_ABROAD_MAX                          /**< Default */
+};
+
+
+/**
+ *     @brief  Represents the values of the frequency of sending MMS read report. \n
+ *     This enum is used as the value of MSG_MMS_SEND_READ_REPORT_T.
+ */
+enum _MSG_MMS_SEND_READ_REPORT_E
+{
+       MSG_SEND_READ_REPORT_ALWAYS,    /**< Read report always */
+       MSG_SEND_READ_REPORT_NEVER,             /**< Read report never */
+       MSG_SEND_READ_REPORT_REQUEST,   /**< Read report request */
+       MSG_SEND_READ_REPORT_MAX                /**< Default */
+};
+
+
+/**
+ *     @brief  Represents the values of the service type for a push message. \n
+ *     This enum is used as the value of MSG_PUSH_SERVICE_TYPE_T.
+ */
+enum _MSG_PUSH_SERVICE_TYPE_E
+{
+       MSG_PUSH_SERVICE_ALWAYS,        /**< Push message service always */
+       MSG_PUSH_SERVICE_PROMPT,                /**< Push message service prompt */
+       MSG_PUSH_SERVICE_NEVER,         /**< Push message service never */
+};
+
+
+/**
+ *     @brief  Represents the values of the language type for a cell broadcasting message. \n
+ *     This enum is used as the value of MSG_CB_LANGUAGE_TYPE_T.
+ */
+enum _MSG_CB_LANGUAGE_TYPE_E
+{
+       MSG_CBLANG_TYPE_ALL,                    /**< CB check all */
+       MSG_CBLANG_TYPE_ENG,                    /**< CB message English  */
+       MSG_CBLANG_TYPE_GER,                    /**< CB message Germany */
+       MSG_CBLANG_TYPE_FRE,                    /**< CB message France */
+       MSG_CBLANG_TYPE_ITA,                    /**< CB message Italy */
+       MSG_CBLANG_TYPE_NED,                    /**< CB message Netherland */
+       MSG_CBLANG_TYPE_SPA,                    /**< CB message Spain */
+       MSG_CBLANG_TYPE_POR,                    /**< CB message Portugal */
+       MSG_CBLANG_TYPE_SWE,                    /**< CB message Sweden */
+       MSG_CBLANG_TYPE_TUR,                    /**< CB message Turkey */
+       MSG_CBLANG_TYPE_MAX                     /**< Default */
+};
+
+
+/**
+ *     @brief  Represents the values of SIM status. \n
+ *     This enum is used as the value of MSG_SIM_STATUS_T.
+ */
+enum _MSG_SIM_STATUS_E
+{
+       MSG_SIM_STATUS_NORMAL = 0,
+       MSG_SIM_STATUS_CHANGED,
+       MSG_SIM_STATUS_NOT_FOUND,
+};
+
+
+#endif /* MSG_TYPES_H_ */
index af8ab57..0bfef12 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef MSG_HELPER_H
 #define MSG_HELPER_H
 #define HAPTIC_TEST_ITERATION 1
 #define MSG_VIBRATION_INTERVAL 3000
 
+typedef void (*msg_sensor_cb)();
 
 /*==================================================================================================
                                        FUNCTION PROTOTYPES
 ==================================================================================================*/
 
 // SoundPlayer
-MSG_ERROR_T MsgSoundPlayUninit();
+msg_error_t MsgSoundPlayUninit();
 void MsgSoundPlayStart();
 void MsgSoundPlayStop();
 int MsgSoundPlayMelody(char *pMsgToneFilePath, bool bIncreasing);
 void MsgSoundPlayVibration();
 
+//Sensor FW wrapper.
+msg_error_t MsgSensorConnect();
+void MsgSensorDisconnect();
+msg_error_t MsgRegSensorCB(msg_sensor_cb cb);
 
-#endif // MSG_HELPER_H
+#endif // MSG_HELPER_H
\ No newline at end of file
index 052fd11..ff1d0fb 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef MSG_HANDLE_H
 #define MSG_HANDLE_H
@@ -26,6 +26,7 @@
 ==================================================================================================*/
 #include "MsgStorageTypes.h"
 #include "MsgTransportTypes.h"
+#include "MsgFilterTypes.h"
 #include "MsgSettingTypes.h"
 #include "MsgCmdTypes.h"
 #include "MsgInternalTypes.h"
@@ -46,59 +47,91 @@ class MsgHandle
                void closeHandle(MsgHandle* pHandle);
 
                // Transport
-               MSG_ERROR_T submitReq(MSG_REQUEST_S* pReq);
-               MSG_ERROR_T cancelReq(MSG_REQUEST_ID_T reqId);
+               msg_error_t submitReq(MSG_REQUEST_S* pReq);
+               msg_error_t cancelReq(msg_request_id_t reqId);
 
-               MSG_ERROR_T regSentStatusCallback(msg_sent_status_cb onStatusChanged,  void *pUserParam);
-               MSG_ERROR_T regSmsMessageCallback(msg_sms_incoming_cb onMsgIncoming, unsigned short port, void *pUserParam);
-               MSG_ERROR_T regMmsConfMessageCallback(msg_mms_conf_msg_incoming_cb onMMSConfMsgIncoming, const char *pAppId, void *pUserParam);
-               MSG_ERROR_T regSyncMLMessageCallback(msg_syncml_msg_incoming_cb onSyncMLMsgIncoming, void *pUserParam);
-               MSG_ERROR_T regLBSMessageCallback(msg_lbs_msg_incoming_cb onLBSMsgIncoming, void *pUserParam);
+               msg_error_t regSentStatusCallback(msg_sent_status_cb onStatusChanged,  void *pUserParam);
+               msg_error_t regSmsMessageCallback(msg_sms_incoming_cb onMsgIncoming, unsigned short port, void *pUserParam);
+               msg_error_t regMmsConfMessageCallback(msg_mms_conf_msg_incoming_cb onMMSConfMsgIncoming, const char *pAppId, void *pUserParam);
+               msg_error_t regSyncMLMessageCallback(msg_syncml_msg_incoming_cb onSyncMLMsgIncoming, void *pUserParam);
+               msg_error_t regLBSMessageCallback(msg_lbs_msg_incoming_cb onLBSMsgIncoming, void *pUserParam);
 
-               MSG_ERROR_T regSyncMLMessageOperationCallback(msg_syncml_msg_operation_cb onSyncMLMsgOperation, void *pUserParam);
+               msg_error_t regSyncMLMessageOperationCallback(msg_syncml_msg_operation_cb onSyncMLMsgOperation, void *pUserParam);
 
-               MSG_ERROR_T operateSyncMLMessage(MSG_MESSAGE_ID_T msgId);
+               msg_error_t operateSyncMLMessage(msg_message_id_t msgId);
 
                // Storage
-               int addMessage(const MSG_MESSAGE_S *pMsg, const MSG_SENDINGOPT_S *pSendOpt);
-               MSG_ERROR_T addSyncMLMessage(const MSG_SYNCML_MESSAGE_S *pSyncMLMsg);
-               MSG_ERROR_T updateMessage(const MSG_MESSAGE_S *pMsg, const MSG_SENDINGOPT_S *pSendOpt);
-               MSG_ERROR_T updateReadStatus(MSG_MESSAGE_ID_T MsgId, bool bRead);
-               MSG_ERROR_T updateProtectedStatus(MSG_MESSAGE_ID_T MsgId, bool bProtected);
-               MSG_ERROR_T deleteMessage(MSG_MESSAGE_ID_T MsgId);
-               MSG_ERROR_T deleteAllMessagesInFolder(MSG_FOLDER_ID_T FolderId, bool bOnlyDB);
-               MSG_ERROR_T moveMessageToFolder(MSG_MESSAGE_ID_T MsgId, MSG_FOLDER_ID_T DestFolderId);
-               MSG_ERROR_T moveMessageToStorage(MSG_MESSAGE_ID_T MsgId, MSG_STORAGE_ID_T DestStorageId);
-               MSG_ERROR_T countMessage(MSG_FOLDER_ID_T FolderId, MSG_COUNT_INFO_S *pCountInfo);
-               MSG_ERROR_T countMsgByType(const MSG_MESSAGE_TYPE_S *pMsgType, int *pMsgCount);
-               MSG_ERROR_T countMsgByContact(const MSG_THREAD_LIST_INDEX_S *pAddrInfo, MSG_THREAD_COUNT_INFO_S *pMsgThreadCountList);
-               MSG_ERROR_T getMessage(MSG_MESSAGE_ID_T MsgId, MSG_MESSAGE_S *pMsg, MSG_SENDINGOPT_S *pSendOpt);
-               MSG_ERROR_T getFolderViewList(MSG_FOLDER_ID_T FolderId, const MSG_SORT_RULE_S *pSortRule, MSG_LIST_S *pMsgFolderViewList);
-               MSG_ERROR_T addFolder(const MSG_FOLDER_INFO_S *pFolderInfo);
-               MSG_ERROR_T updateFolder(const MSG_FOLDER_INFO_S *pFolderInfo);
-               MSG_ERROR_T deleteFolder(MSG_FOLDER_ID_T FolderId);
-               MSG_ERROR_T getFolderList(MSG_FOLDER_LIST_S *pFolderList);
-
-               MSG_ERROR_T getThreadViewList(const MSG_SORT_RULE_S *pSortRule, MSG_THREAD_VIEW_LIST_S *pThreadViewList);
-               MSG_ERROR_T getConversationViewList(MSG_THREAD_ID_T ThreadId, MSG_LIST_S *pConvViewList);
-               MSG_ERROR_T deleteThreadMessageList(MSG_THREAD_ID_T thread_id);
-               MSG_ERROR_T getQuickPanelData(MSG_QUICKPANEL_TYPE_T Type, MSG_MESSAGE_S *pMsg);
-               MSG_ERROR_T resetDatabase();
-               MSG_ERROR_T getMemSize(unsigned int* memsize);
-
-               // Setting
-               MSG_ERROR_T setConfig(const MSG_SETTING_S *pSetting);
-               MSG_ERROR_T getConfig(MSG_SETTING_S *pSetting);
+               int addMessage(MSG_MESSAGE_HIDDEN_S *pMsg, const MSG_SENDINGOPT_S *pSendOpt);
+               msg_error_t addSyncMLMessage(const MSG_SYNCML_MESSAGE_S *pSyncMLMsg);
+               msg_error_t updateMessage(const MSG_MESSAGE_HIDDEN_S *pMsg, const MSG_SENDINGOPT_S *pSendOpt);
+               msg_error_t updateReadStatus(msg_message_id_t MsgId, bool bRead);
+               msg_error_t updateProtectedStatus(msg_message_id_t MsgId, bool bProtected);
+               msg_error_t deleteMessage(msg_message_id_t MsgId);
+               msg_error_t deleteAllMessagesInFolder(msg_folder_id_t FolderId, bool bOnlyDB);
+               msg_error_t moveMessageToFolder(msg_message_id_t MsgId, msg_folder_id_t DestFolderId);
+               msg_error_t moveMessageToStorage(msg_message_id_t MsgId, msg_storage_id_t DestStorageId);
+               msg_error_t countMessage(msg_folder_id_t FolderId, MSG_COUNT_INFO_S *pCountInfo);
+               msg_error_t countMsgByType(const MSG_MESSAGE_TYPE_S *pMsgType, int *pMsgCount);
+               msg_error_t countMsgByContact(const MSG_THREAD_LIST_INDEX_INFO_S *pAddrInfo, MSG_THREAD_COUNT_INFO_S *pMsgThreadCountList);
+               msg_error_t getMessage(msg_message_id_t MsgId, MSG_MESSAGE_HIDDEN_S *pMsg, MSG_SENDINGOPT_S *pSendOpt);
+               msg_error_t getFolderViewList(msg_folder_id_t FolderId, const MSG_SORT_RULE_S *pSortRule, msg_struct_list_s *pMsgFolderViewList);
+               msg_error_t addFolder(const MSG_FOLDER_INFO_S *pFolderInfo);
+               msg_error_t updateFolder(const MSG_FOLDER_INFO_S *pFolderInfo);
+               msg_error_t deleteFolder(msg_folder_id_t FolderId);
+               msg_error_t getFolderList(msg_struct_list_s *pFolderList);
+
+               msg_error_t getThreadViewList(const MSG_SORT_RULE_S *pSortRule, msg_struct_list_s *pThreadViewList);
+               msg_error_t getConversationViewList(msg_thread_id_t ThreadId, msg_struct_list_s *pConvViewList);
+               msg_error_t deleteThreadMessageList(msg_thread_id_t thread_id);
+               msg_error_t getQuickPanelData(msg_quickpanel_type_t Type, MSG_MESSAGE_HIDDEN_S *pMsg);
+               msg_error_t resetDatabase();
+               msg_error_t getMemSize(unsigned int* memsize);
+
+               msg_error_t getAddressList(const msg_thread_id_t threadId, msg_struct_list_s *pAddrList);
+
+               // Filter
+               msg_error_t addFilter(const MSG_FILTER_S *pFilter);
+               msg_error_t updateFilter(const MSG_FILTER_S *pFilter);
+               msg_error_t deleteFilter(msg_filter_id_t FilterId);
+               msg_error_t getFilterList(msg_struct_list_s *pFilterList);
+               msg_error_t setFilterOperation(bool bSetFlag);
+               msg_error_t getFilterOperation(bool *pSetFlag);
+
+               //setting
+               msg_error_t getSMSCOption(msg_struct_t msg_struct);
+               msg_error_t setSMSCOption(msg_struct_t msg_struct);
+               msg_error_t getCBOption(msg_struct_t msg_struct);
+               msg_error_t setCBOption(msg_struct_t msg_struct);
+               msg_error_t getSmsSendOpt(msg_struct_t msg_struct);
+               msg_error_t setSmsSendOpt(msg_struct_t msg_struct);
+               msg_error_t getMmsSendOpt(msg_struct_t msg_struct);
+               msg_error_t setMmsSendOpt(msg_struct_t msg_struct);
+               msg_error_t getMmsRecvOpt(msg_struct_t msg_struct);
+               msg_error_t setMmsRecvOpt(msg_struct_t msg_struct);;
+               msg_error_t getPushMsgOpt(msg_struct_t msg_struct);
+               msg_error_t setPushMsgOpt(msg_struct_t msg_struct);
+               msg_error_t getVoiceMsgOpt(msg_struct_t msg_struct);
+               msg_error_t setVoiceMsgOpt(msg_struct_t msg_struct);
+               msg_error_t getGeneralOpt(msg_struct_t msg_struct);
+               msg_error_t setGeneralOpt(msg_struct_t msg_struct);
+               msg_error_t getMsgSizeOpt(msg_struct_t msg_struct);
+               msg_error_t setMsgSizeOpt(msg_struct_t msg_struct);
+
+               //Backup & Restore
+               msg_error_t backupMessage();
+               msg_error_t restoreMessage();
 
                // ETC
-               MSG_ERROR_T searchMessage(const char *pSearchString, MSG_THREAD_VIEW_LIST_S *pThreadViewList);
-               MSG_ERROR_T searchMessage(const MSG_SEARCH_CONDITION_S *pSearchCon, int offset, int limit, MSG_LIST_S *pMsgList);
-               MSG_ERROR_T getMsgIdList(MSG_REFERENCE_ID_T RefId, MSG_MSGID_LIST_S *pMsgIdList);
-               MSG_ERROR_T getRejectMsgList(const char *pNumber, MSG_REJECT_MSG_LIST_S *pRejectMsgList);
-               MSG_ERROR_T regStorageChangeCallback(msg_storage_change_cb onStorageChange, void *pUserParam);
-               MSG_ERROR_T getReportStatus(MSG_MESSAGE_ID_T msg_id, MSG_REPORT_STATUS_INFO_S *pReport_status);
-
-               void convertMsgStruct(const MSG_MESSAGE_INFO_S *pSource, MSG_MESSAGE_S *pDest);
+               msg_error_t searchMessage(const char *pSearchString, msg_struct_list_s *pThreadViewList);
+               msg_error_t searchMessage(const MSG_SEARCH_CONDITION_S *pSearchCon, int offset, int limit, msg_struct_list_s *pMsgList);
+               msg_error_t getRejectMsgList(const char *pNumber, msg_struct_list_s *pRejectMsgList);
+               msg_error_t regStorageChangeCallback(msg_storage_change_cb onStorageChange, void *pUserParam);
+               msg_error_t getReportStatus(msg_message_id_t msg_id, MSG_REPORT_STATUS_INFO_S *pReport_status);
+               msg_error_t getThreadIdByAddress(msg_struct_list_s *pAddrList, msg_thread_id_t *pThreadId);
+               msg_error_t getThread(msg_thread_id_t threadId, MSG_THREAD_VIEW_S* pThreadInfo);
+               msg_error_t getMessageList(msg_folder_id_t folderId, msg_thread_id_t threadId, msg_message_type_t msgType, msg_storage_id_t storageId, msg_struct_list_s *pMsgList);
+
+               void convertMsgStruct(const MSG_MESSAGE_INFO_S *pSource, MSG_MESSAGE_HIDDEN_S *pDest);
                void convertSendOptStruct(const MSG_SENDINGOPT_INFO_S* pSrc, MSG_SENDINGOPT_S* pDest, MSG_MESSAGE_TYPE_S msgType);
 
        private:
@@ -107,7 +140,7 @@ class MsgHandle
                void write(const char *pCmd, int CmdSize, char **ppEvent);
                void read(char **ppEvent);
                void generateConnectionId(char *ConnectionId);
-               void convertMsgStruct(const MSG_MESSAGE_S *pSource, MSG_MESSAGE_INFO_S *pDest);
+               void convertMsgStruct(const MSG_MESSAGE_HIDDEN_S *pSource, MSG_MESSAGE_INFO_S *pDest);
                void convertSendOptStruct(const MSG_SENDINGOPT_S* pSrc, MSG_SENDINGOPT_INFO_S* pDest, MSG_MESSAGE_TYPE_S msgType);
                int getSettingCmdSize(MSG_OPTION_TYPE_T optionType);
 
index 15a1ff5..53002cf 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef __MSG_PROXY_LISTENER_H__
 #define __MSG_PROXY_LISTENER_H__
index 8a55347..49c7a0b 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef MSG_CONTACT_H
 #define MSG_CONTACT_H
@@ -29,12 +29,12 @@ typedef void (*MsgContactChangeCB)();
 /*==================================================================================================
                                      FUNCTION PROTOTYPES
 ==================================================================================================*/
-MSG_ERROR_T MsgOpenContactSvc();
-MSG_ERROR_T MsgCloseContactSvc();
+msg_error_t MsgOpenContactSvc();
+msg_error_t MsgCloseContactSvc();
 
-MSG_ERROR_T MsgInitContactSvc(MsgContactChangeCB cb);
+msg_error_t MsgInitContactSvc(MsgContactChangeCB cb);
 
-MSG_ERROR_T MsgGetContactInfo(const MSG_ADDRESS_INFO_S *pAddrInfo, MSG_CONTACT_INFO_S *pContactInfo);
+msg_error_t MsgGetContactInfo(const MSG_ADDRESS_INFO_S *pAddrInfo, MSG_CONTACT_INFO_S *pContactInfo);
 
 void MsgSyncContact();
 
@@ -44,6 +44,9 @@ bool MsgDeleteContact(int index);
 
 int MsgGetContactNameOrder();
 
+msg_error_t MsgAddPhoneLog(const MSG_MESSAGE_INFO_S *pMsgInfo);
+msg_error_t MsgDeletePhoneLog(msg_message_id_t msgId);
+
 int MsgContactSVCBeginTrans();
 int MsgContactSVCEndTrans(bool bSuccess);
 
index ee52510..952805c 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef __MSG_DEBUG_H__
 #define __MSG_DEBUG_H__
@@ -28,6 +28,7 @@
 
 #include "MsgTypes.h"
 #include "MsgCmdTypes.h"
+#include "MsgFilterTypes.h"
 
 extern "C"{
        #include <dlog.h>
@@ -39,7 +40,7 @@ extern "C"{
 ==================================================================================================*/
 #define USER_TAG "MSG_FW"
 
-//#define DLOG_ENABLE
+#define DLOG_ENABLE
 //#define LOG_ENABLE
 
 
@@ -160,8 +161,30 @@ int get_tid();
 #define MSG_BEGIN()
 #define MSG_END()
 
-#define MSG_PROFILE_BEGIN(pfid)
-#define MSG_PROFILE_END(pfid)
+#define MSG_PROFILE_BEGIN(pfid) \
+       unsigned int __prf_l1_##pfid = __LINE__;    \
+       struct timeval __prf_1_##pfid;              \
+       struct timeval __prf_2_##pfid;              \
+       do {                                        \
+               gettimeofday(&__prf_1_##pfid, 0);       \
+       } while (0)
+
+#define MSG_PROFILE_END(pfid) \
+       unsigned int __prf_l2_##pfid = __LINE__;\
+       do { \
+               gettimeofday(&__prf_2_##pfid, 0);\
+               long __ds = __prf_2_##pfid.tv_sec - __prf_1_##pfid.tv_sec;\
+               long __dm = __prf_2_##pfid.tv_usec - __prf_1_##pfid.tv_usec;\
+               if ( __dm < 0 ) { __ds--; __dm = 1000000 + __dm; } \
+               printf("**PROFILE** [MSGFW: %s: %s() %u ~ %u] " #pfid                            \
+               " -> Elapsed Time: %u.%06u seconds\n",                    \
+               rindex(__FILE__, '/')+1,                \
+               __FUNCTION__, \
+               __prf_l1_##pfid,                                         \
+               __prf_l2_##pfid,                                         \
+               (unsigned int)(__ds),                                    \
+               (unsigned int)(__dm));                                   \
+       } while (0)
 
 #endif
 
index 02c3ae4..09d83ef 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef __MSG_DRM_WRAPPER_H_
 #define __MSG_DRM_WRAPPER_H_
index 7f6c1f0..50ce5b7 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef MSG_EXCEPTION_H
 #define MSG_EXCEPTION_H
index eb7e6d6..6b25914 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef MSG_GCONF_WRAPPER_H
 #define MSG_GCONF_WRAPPER_H
@@ -44,15 +44,21 @@ typedef struct _MSG_GOBJECT_CLIENT_S
 /*==================================================================================================
                                      FUNCTION PROTOTYPES
 ==================================================================================================*/
-MSG_ERROR_T    MsgSettingSetString(const char *pKey, const char *pSetValue);
-MSG_ERROR_T    MsgSettingSetInt(const char *pKey, int nSetValue);
-MSG_ERROR_T    MsgSettingSetBool(const char *pKey, bool bSetValue);
+msg_error_t    MsgSettingSetString(const char *pKey, const char *pSetValue);
+msg_error_t    MsgSettingSetInt(const char *pKey, int nSetValue);
+msg_error_t    MsgSettingSetBool(const char *pKey, bool bSetValue);
 
 char*                  MsgSettingGetString(const char *pKey);
 int                            MsgSettingGetInt(const char *pKey);
 int                            MsgSettingGetBool(const char *pKey, bool *pVal);
 
-MSG_ERROR_T    MsgSettingHandleNewMsg(int SmsCnt, int MmsCnt);
-MSG_ERROR_T    MsgSettingSetIndicator(int SmsCnt, int MmsCnt);
+msg_error_t    MsgSettingHandleNewMsg(int SmsCnt, int MmsCnt);
+msg_error_t    MsgSettingSetIndicator(int SmsCnt, int MmsCnt);
+
+bool   MsgSettingGetAutoReject();
+bool   MsgSettingGetUnknownAutoReject();
+
+void   MsgSettingRegVconfCB();
+void   MsgSettingRemoveVconfCB();
 
 #endif // MSG_GCONF_WRAPPER_H
index ca15b42..683f26e 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef __IPCSocket_H__
 #define __IPCSocket_H__
@@ -62,8 +62,8 @@ public:
        fd_set  fdSet() { return fds; }
        int     fd() { return sockfd; }
 
-       MSG_ERROR_T connect(const char *path);
-       MSG_ERROR_T close();
+       msg_error_t connect(const char *path);
+       msg_error_t close();
        /* write msg to ipc server */
        int     write(const char* buf, int len);
        /* read msg from ipc server */
@@ -88,8 +88,8 @@ public:
        fd_set  fdSet() { return fds; }
        int     fd() { return sockfd; }
 
-       MSG_ERROR_T open(const char *path);
-       MSG_ERROR_T accept();
+       msg_error_t open(const char *path);
+       msg_error_t accept();
        void            close(int fd);
 
        /* read msg from client of fd */
index 0c07f8c..4900312 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef __MSG_MEMORY_H__
 #define __MSG_MEMORY_H__
index 9a323da..a91f81a 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef MSG_MMS_MESSAGE_H
 #define MSG_MMS_MESSAGE_H
 
 int msg_verify_number(const char *raw, char *trimmed);
 int msg_verify_email(const char *raw);
-MSG_ERROR_T _MsgMmsAddPage(MMS_MESSAGE_DATA_S *pMsgData, MMS_PAGE_S *pPage);
-MSG_ERROR_T _MsgMmsAddMedia(MMS_PAGE_S *pPage, MMS_MEDIA_S *pMedia);
-MSG_ERROR_T _MsgMmsAddSmilDoc(char *pSmil, MMS_MESSAGE_DATA_S *pMsgData);
-MSG_ERROR_T _MsgMmsAddAttachment(MMS_MESSAGE_DATA_S *pMsgData, MMS_ATTACH_S *pMedia);
-MSG_ERROR_T _MsgMmsAddRegion(MMS_MESSAGE_DATA_S *pMsgData, MMS_SMIL_REGION * pRegion);
-MSG_ERROR_T _MsgMmsAddTransition(MMS_MESSAGE_DATA_S *pMsgData, MMS_SMIL_TRANSITION *pTransition);
-MSG_ERROR_T _MsgMmsAddMeta(MMS_MESSAGE_DATA_S *pMsgData, MMS_SMIL_META *pMeta);
+msg_error_t _MsgMmsAddPage(MMS_MESSAGE_DATA_S *pMsgData, MMS_PAGE_S *pPage);
+msg_error_t _MsgMmsAddMedia(MMS_PAGE_S *pPage, MMS_MEDIA_S *pMedia);
+msg_error_t _MsgMmsAddSmilDoc(char *pSmil, MMS_MESSAGE_DATA_S *pMsgData);
+msg_error_t _MsgMmsAddAttachment(MMS_MESSAGE_DATA_S *pMsgData, MMS_ATTACH_S *pMedia);
+msg_error_t _MsgMmsAddRegion(MMS_MESSAGE_DATA_S *pMsgData, MMS_SMIL_REGION * pRegion);
+msg_error_t _MsgMmsAddTransition(MMS_MESSAGE_DATA_S *pMsgData, MMS_SMIL_TRANSITION *pTransition);
+msg_error_t _MsgMmsAddMeta(MMS_MESSAGE_DATA_S *pMsgData, MMS_SMIL_META *pMeta);
 
 bool _MsgMmsFindMatchedMedia(MMS_MESSAGE_DATA_S *pMsgData, char *pszFilePath);
 
@@ -46,11 +46,11 @@ int _MsgMmsGetAttachCount(MMS_MESSAGE_DATA_S *pMsgData);
 int _MsgMmsGetTransitionCount(MMS_MESSAGE_DATA_S *pMsgData);
 int _MsgMmsGetMetaCount(MMS_MESSAGE_DATA_S *pMsgData);
 
-MSG_ERROR_T _MsgMmsReleasePageList(MMS_MESSAGE_DATA_S *pMsgData);
-MSG_ERROR_T _MsgMmsReleaseRegionList(MMS_MESSAGE_DATA_S *pMsgData);
-MSG_ERROR_T    _MsgMmsReleaseAttachList(MMS_MESSAGE_DATA_S *pMsgData);
-MSG_ERROR_T _MsgMmsReleaseMetaList(MMS_MESSAGE_DATA_S *pMsgData);
-MSG_ERROR_T _MsgMmsReleaseTransitionList(MMS_MESSAGE_DATA_S *pMsgData);
+msg_error_t _MsgMmsReleasePageList(MMS_MESSAGE_DATA_S *pMsgData);
+msg_error_t _MsgMmsReleaseRegionList(MMS_MESSAGE_DATA_S *pMsgData);
+msg_error_t    _MsgMmsReleaseAttachList(MMS_MESSAGE_DATA_S *pMsgData);
+msg_error_t _MsgMmsReleaseMetaList(MMS_MESSAGE_DATA_S *pMsgData);
+msg_error_t _MsgMmsReleaseTransitionList(MMS_MESSAGE_DATA_S *pMsgData);
 
 char *_MsgMmsSerializeMessageData(const MMS_MESSAGE_DATA_S *pMsgData, unsigned int *pSize);
 bool _MsgMmsDeserializeMessageData(MMS_MESSAGE_DATA_S *pBody, char *pFileData);
index fd20d54..44aae6a 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef __MSG_MUTEX_H__
 #define __MSG_MUTEX_H__
index 232cfc3..8eb6173 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef MSG_QUICKPANEL_WRAPPER_H
 #define MSG_QUICKPANEL_WRAPPER_H
 /*==================================================================================================
                                          DEFINES
 ==================================================================================================*/
-#define NORMAL_MSG_ICON_PATH   "/opt/apps/org.tizen.message/res/icons/default/small/org.tizen.message.png"
-#define VOICE_MSG_ICON_PATH    "/opt/apps/org.tizen.message/res/icons/default/small/org.tizen.message.voice.png"
-#define CB_MSG_ICON_PATH               "/opt/apps/org.tizen.message/res/icons/default/small/org.tizen.message.cb.png"
+#define NORMAL_MSG_ICON_PATH   "/opt/apps/org.tizen.message/res/icons/default/small/org.tizen.message.noti.png"
+#define VOICE_MSG_ICON_PATH            "/opt/apps/org.tizen.message/res/icons/default/small/org.tizen.message.voice.png"
+#define CB_MSG_ICON_PATH                       "/opt/apps/org.tizen.message/res/icons/default/small/org.tizen.message.noti.png"
 #define NOTI_MSG_ICON_PATH             "/opt/apps/org.tizen.message/res/icons/default/small/org.tizen.message.noti.png"
 
-#define MSG_APP_PACKAGE_NAME "message"
-#define MSG_APP_LOCALEDIR              "/opt/apps/org.tizen.message/res/locale"
+#define MSG_APP_PACKAGE_NAME   "message"
+#define MSG_APP_LOCALEDIR                      "/opt/apps/org.tizen.message/res/locale"
 
-#define SENDING_MULTIMEDIA_MESSAGE_FAILED "IDS_MSGF_POP_SENDING_MULTIMEDIA_MESSAGE_FAILED"
-#define MULTIMEDIA_MESSAGE_SENT                   "IDS_MSGF_POP_MULTIMEDIA_MESSAGE_SENT"
-#define RETRIEVING_MESSAGE_FAILED                 "IDS_MSGF_POP_RETRIEVING_MESSAGE_FAILED"
-#define MESSAGE_RETRIEVED                               "IDS_MSGF_BODY_MESSAGE_RETRIEVED"
+#define SENDING_MULTIMEDIA_MESSAGE_FAILED      "Sending multimedia message failed"
+#define MULTIMEDIA_MESSAGE_SENT                                        "Multimedia message sent"
+#define RETRIEVING_MESSAGE_FAILED                                      "Retrieving message failed"
+#define MESSAGE_RETRIEVED                                                              "Message retrieved"
 
 
 /*==================================================================================================
                                      FUNCTION PROTOTYPES
 ==================================================================================================*/
 
-MSG_ERROR_T MsgInsertNoti(MsgDbHandler *pDbHandle, MSG_MESSAGE_INFO_S* pMsg);
+msg_error_t MsgInsertNoti(MsgDbHandler *pDbHandle, MSG_MESSAGE_INFO_S* pMsg);
 
-MSG_ERROR_T MsgInsertSmsReportToNoti(MsgDbHandler *pDbHandle, MSG_MESSAGE_ID_T MsgId, MSG_DELIVERY_REPORT_STATUS_T Status);
+msg_error_t MsgInsertSmsReportToNoti(MsgDbHandler *pDbHandle, msg_message_id_t MsgId, msg_delivery_report_status_t Status);
 
-MSG_ERROR_T MsgInsertMmsReportToNoti(MsgDbHandler *pDbHandle, MSG_MESSAGE_INFO_S* pMsg);
+msg_error_t MsgInsertMmsReportToNoti(MsgDbHandler *pDbHandle, MSG_MESSAGE_INFO_S* pMsg);
 
-MSG_ERROR_T MsgDeleteNotiByMsgId(MSG_MESSAGE_ID_T msgId);
+msg_error_t MsgDeleteNotiByMsgId(msg_message_id_t msgId);
 
-MSG_ERROR_T MsgDeleteNotiByThreadId(MSG_THREAD_ID_T ThreadId);
+msg_error_t MsgDeleteNotiByThreadId(msg_thread_id_t ThreadId);
 
-MSG_ERROR_T MsgInsertTicker(const char* pTickerMsg, const char* pLocaleTickerMsg);
+msg_error_t MsgInsertTicker(const char* pTickerMsg, const char* pLocaleTickerMsg);
 
 #endif // MSG_QUICKPANEL_WRAPPER_H
index 1d81379..37eea6d 100755 (executable)
@@ -1,22 +1,32 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef MSG_SOUND_PLAYER_H
 #define MSG_SOUND_PLAYER_H
 
+
+/*==================================================================================================
+                                    DEFINES
+==================================================================================================*/
+
+/*==================================================================================================
+                                    INCLUDE FILES
+==================================================================================================*/
+
+
 /*==================================================================================================
                                      FUNCTION PROTOTYPES
 ==================================================================================================*/
@@ -29,4 +39,3 @@ int MsgSoundRepeatAlarmCB(int TimerId, void *pUserParam);
 int MsgSoundGetUnreadMsgCnt();
 
 #endif // MSG_SOUND_PLAYER_H
-
diff --git a/include/utils/MsgSpamFilter.h b/include/utils/MsgSpamFilter.h
new file mode 100755 (executable)
index 0000000..fa0a909
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#ifndef MSG_SPAM_FILTER_H
+#define MSG_SPAM_FILTER_H
+
+/*==================================================================================================
+                                         INCLUDE FILES
+==================================================================================================*/
+#include "MsgFilterTypes.h"
+#include "MsgStorageTypes.h"
+#include "MsgInternalTypes.h"
+#include "MsgSqliteWrapper.h"
+
+
+/*==================================================================================================
+                                     FUNCTION PROTOTYPES
+==================================================================================================*/
+msg_error_t MsgSetFilterOperation(bool bSetFlag);
+msg_error_t MsgGetFilterOperation(bool *pSetFlag);
+
+bool MsgCheckFilter(MsgDbHandler *pDbHandle, MSG_MESSAGE_INFO_S *pMsgInfo);
+void MsgCalllogDBInit(void);
+void MsgCalllogDBFinish(void);
+
+#endif // MSG_SPAM_FILTER_H
index 9cc59a5..e219b7a 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef MSG_SQLITE_WRAPPER_H
 #define MSG_SQLITE_WRAPPER_H
 ==================================================================================================*/
 #define MSGFW_DB_NAME                  "/opt/dbspace/.msg_service.db"
 
-#define MSGFW_MESSAGE_TABLE_NAME               "MSG_MESSAGE_TABLE"
-#define MSGFW_FOLDER_TABLE_NAME                        "MSG_FOLDER_TABLE"
-#define MSGFW_ADDRESS_TABLE_NAME               "MSG_ADDRESS_TABLE"
-#define MSGFW_SIM_MSG_TABLE_NAME               "MSG_SIM_TABLE"
-#define MSGFW_FILTER_TABLE_NAME                        "MSG_FILTER_TABLE"
-#define MSGFW_PUSH_MSG_TABLE_NAME              "MSG_PUSH_TABLE"
-#define MSGFW_CB_MSG_TABLE_NAME                        "MSG_CBMSG_TABLE"
+#define MSGFW_MESSAGE_TABLE_NAME                               "MSG_MESSAGE_TABLE"
+#define MSGFW_FOLDER_TABLE_NAME                                        "MSG_FOLDER_TABLE"
+#define MSGFW_ADDRESS_TABLE_NAME                       "MSG_ADDRESS_TABLE"
+#define MSGFW_CONVERSATION_TABLE_NAME          "MSG_CONVERSATION_TABLE"
+#define MSGFW_SIM_MSG_TABLE_NAME                               "MSG_SIM_TABLE"
+#define MSGFW_FILTER_TABLE_NAME                                        "MSG_FILTER_TABLE"
+#define MSGFW_PUSH_MSG_TABLE_NAME                      "MSG_PUSH_TABLE"
+#define MSGFW_CB_MSG_TABLE_NAME                                "MSG_CBMSG_TABLE"
 #define MMS_PLUGIN_MESSAGE_TABLE_NAME          "MSG_MMS_MESSAGE_TABLE"
-#define MMS_PLUGIN_ATTRIBUTE_TABLE_NAME        "MSG_MMS_ATTR_TABLE"
-#define MSGFW_SYNCML_MSG_TABLE_NAME            "MSG_SYNCML_TABLE"
-#define MSGFW_SCHEDULED_MSG_TABLE_NAME         "MSG_SCHEDULED_TABLE"
-#define MSGFW_SMS_SENDOPT_TABLE_NAME           "MSG_SMS_SENDOPT_TABLE"
-#define MSGFW_REPORT_TABLE_NAME                        "MSG_REPORT_TABLE"
+#define MSGFW_SYNCML_MSG_TABLE_NAME            "MSG_SYNCML_TABLE"
+#define MSGFW_SMS_SENDOPT_TABLE_NAME           "MSG_SMS_SENDOPT_TABLE"
 
 #define MAX_QUERY_LEN                                  3072
-#define MAX_FOLDER_NAME_LEN                    20
-#define MAX_ACCOUNT_NAME_LEN                   51
+#define MAX_FOLDER_NAME_LEN            20
+#define MAX_ACCOUNT_NAME_LEN   51
 
 
 /*==================================================================================================
@@ -62,30 +60,31 @@ public:
        MsgDbHandler();
        ~MsgDbHandler();
 
-       MSG_ERROR_T connect();
-       MSG_ERROR_T disconnect();
+       msg_error_t connect();
+       msg_error_t disconnect();
 
        bool checkTableExist(const char *pTableName);
-       MSG_ERROR_T execQuery(const char *pQuery);
-       MSG_ERROR_T getTable(const char *pQuery, int *pRowCnt);
+       msg_error_t execQuery(const char *pQuery);
+       msg_error_t getTable(const char *pQuery, int *pRowCnt);
        void freeTable();
-       MSG_ERROR_T bindText(const char *pBindStr, int index);
-       MSG_ERROR_T bindBlob(const void * pBindBlob, int size, int index);
-       MSG_ERROR_T prepareQuery(const char *pQuery);
-       MSG_ERROR_T stepQuery();
+       msg_error_t bindText(const char *pBindStr, int index);
+       msg_error_t bindBlob(const void * pBindBlob, int size, int index);
+       msg_error_t prepareQuery(const char *pQuery);
+       msg_error_t stepQuery();
        void finalizeQuery();
        int columnInt(int ColumnIndex);
        const unsigned char* columnText(int ColumnIndex);
        const void* columnBlob(int ColumnIndex);
-       MSG_ERROR_T beginTrans();
-       MSG_ERROR_T endTrans(bool Success);
+       msg_error_t beginTrans();
+       msg_error_t endTrans(bool Success);
        int getColumnToInt(int RowIndex);
        char getColumnToChar(int RowIndex);
        void getColumnToString(int RowIndex, int Length, char *pString);
-       MSG_ERROR_T getRowId(const char *pTableName, unsigned int *pRowId);
+       msg_error_t getRowId(const char *pTableName, unsigned int *pRowId);
 
 private:
 
+       char **result;
 
 };
 
index 6a5a4f2..9d36330 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef MSG_UTIL_FILE_H
 #define MSG_UTIL_FILE_H
index 522a9d2..0d11260 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef MSG_UTIL_FUNCTION_H
 #define MSG_UTIL_FUNCTION_H
@@ -23,6 +23,7 @@
 ==================================================================================================*/
 #include "MsgStorageTypes.h"
 #include "MsgSettingTypes.h"
+#include "MsgFilterTypes.h"
 #include "MsgInternalTypes.h"
 #include "MsgCmdTypes.h"
 
@@ -37,23 +38,27 @@ int MsgEncodeCountByMsgType(int MsgCount, char **ppDest);
 
 int MsgEncodeRecipientList(MSG_RECIPIENTS_LIST_S *pRecipientList, char **ppDest);
 
-int MsgEncodeMsgId(MSG_MESSAGE_ID_T *pMsgId, char **ppDest);
+int MsgEncodeMsgId(msg_message_id_t *pMsgId, char **ppDest);
 
 int MsgEncodeMsgInfo(MSG_MESSAGE_INFO_S *pMsgInfo, char **ppDest);
 
 int MsgEncodeMsgInfo(MSG_MESSAGE_INFO_S *pMsgInfo,  MSG_SENDINGOPT_INFO_S* pSendOptInfo, char **ppDest);
 
-int MsgEncodeFolderViewList(MSG_LIST_S *pFolderViewList, char **ppDest);
+int MsgEncodeFolderViewList(msg_struct_list_s *pFolderViewList, char **ppDest);
 
-int MsgEncodeFolderList(MSG_FOLDER_LIST_S *pFolderList, char **ppDest);
+int MsgEncodeFolderList(msg_struct_list_s *pFolderList, char **ppDest);
 
 int MsgEncodeSetting(MSG_SETTING_S *pSetting, char **ppDest);
 
+int MsgEncodeFilterList(msg_struct_list_s *pFilterList, char **ppDest);
+
+int MsgEncodeFilterFlag(bool *pSetFlag, char **ppDest);
+
 int MsgEncodeMsgType(MSG_MESSAGE_TYPE_S *pMsgType, char **ppDest);
 
-int MsgEncodeThreadViewList(MSG_THREAD_VIEW_LIST_S *pThreadViewList, char **ppDest);
+int MsgEncodeThreadViewList(msg_struct_list_s *pThreadViewList, char **ppDest);
 
-int MsgEncodeConversationViewList(MSG_LIST_S *pConvViewList, char **ppDest);
+int MsgEncodeConversationViewList(msg_struct_list_s *pConvViewList, char **ppDest);
 
 int MsgEncodeMsgGetContactCount(MSG_THREAD_COUNT_INFO_S *threadCountInfo, char **ppDest);
 
@@ -61,31 +66,35 @@ int MsgEncodeMemSize(unsigned int *memsize, char **ppDest);
 
 int MsgEncodeSyncMLOperationData(int msgId, int extId, char **ppDest);
 
-int MsgEncodeStorageChangeData(const MSG_STORAGE_CHANGE_TYPE_T storageChangeType, const MSG_MSGID_LIST_S *pMsgIdList, char **ppDest);
+int MsgEncodeStorageChangeData(const msg_storage_change_type_t storageChangeType, const msg_id_list_s *pMsgIdList, char **ppDest);
 
 int MsgEncodeReportStatus(MSG_REPORT_STATUS_INFO_S* pReportStatus, char **ppDest);
 
+int MsgEncodeThreadId(msg_thread_id_t *pThreadId, char **ppDest);
+
+int MsgEncodeThreadInfo(MSG_THREAD_VIEW_S *pThreadInfo, char **ppDest);
+
 
 // Decoders
-void MsgDecodeMsgId(char *pSrc, MSG_MESSAGE_ID_T *pMsgId);
+void MsgDecodeMsgId(char *pSrc, msg_message_id_t *pMsgId);
 
 void MsgDecodeCountInfo(char *pSrc, MSG_COUNT_INFO_S *pCountInfo);
 
 void MsgDecodeMsgInfo(char *pSrc, MSG_MESSAGE_INFO_S *pMsgInfo,  MSG_SENDINGOPT_INFO_S* pSendOptInfo);
 
-void MsgDecodeFolderViewList(char *pSrc, MSG_LIST_S *pFolderViewList);
+void MsgDecodeFolderViewList(char *pSrc, msg_struct_list_s *pFolderViewList);
 
 void MsgDecodeRecipientList(char *pSrc, MSG_RECIPIENTS_LIST_S *pRecipientList);
 
-void MsgDecodeFolderList(char *pSrc, MSG_FOLDER_LIST_S *pFolderList);
+void MsgDecodeFolderList(char *pSrc, msg_struct_list_s *pFolderList);
 
 void MsgDecodeSetting(char *pSrc, MSG_SETTING_S *pSetting);
 
-void MsgDecodeMsgType(char *pSrc, MSG_MESSAGE_TYPE_S* pMsgType);
+void MsgDecodeFilterList(char *pSrc, msg_struct_list_s *pFilterList);
 
-void MsgDecodeThreadViewList(char *pSrc, MSG_THREAD_VIEW_LIST_S *pThreadViewList);
+void MsgDecodeFilterFlag(char *pSrc, bool *pSetFlag);
 
-void MsgDecodeConversationViewList(char *pSrc, MSG_LIST_S *pConvViewList);
+void MsgDecodeMsgType(char *pSrc, MSG_MESSAGE_TYPE_S* pMsgType);
 
 void   MsgDecodeContactCount(char *pSrc,  MSG_THREAD_COUNT_INFO_S *pMsgThreadCountList);
 
@@ -93,9 +102,17 @@ void MsgDecodeMemSize(char *pSrc, unsigned int *memsize);
 
 void   MsgDecodeReportStatus(char *pSrc,  MSG_REPORT_STATUS_INFO_S *pReportStatus);
 
+void MsgDecodeThreadId(char *pSrc, msg_thread_id_t *pThreadId);
+
+void MsgDecodeThreadInfo(char *pSrc, MSG_THREAD_VIEW_S *pThreadInfo);
+
 
 // Event Encoder
-int MsgMakeEvent(const void *pData, int DataSize, MSG_EVENT_TYPE_T MsgEvent, MSG_ERROR_T MsgError, void **ppEvent);
+int MsgMakeEvent(const void *pData, int DataSize, MSG_EVENT_TYPE_T MsgEvent, msg_error_t MsgError, void **ppEvent);
+
+
+int msg_verify_number(const char *raw, char *trimmed);
 
+int msg_verify_email(const char *raw);
 
 #endif // MSG_UTIL_FUNCTION_H
index a345bc7..d0ab5d9 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef MSG_UTIL_STORAGE_H
 #define MSG_UTIL_STORAGE_H
                                        FUNCTION PROTOTYPES
 ==================================================================================================*/
 // Common Function
-unsigned int MsgStoAddMessageTable(MsgDbHandler *pDbHandle, const MSG_MESSAGE_INFO_S *pMsgInfo, unsigned int AddrId);
-MSG_ERROR_T MsgStoSetReadStatus(MsgDbHandler *pDbHandle, MSG_MESSAGE_ID_T MsgId, bool bRead);
-MSG_ERROR_T MsgStoGetOldestMessage(MsgDbHandler *pDbHandle, const MSG_MESSAGE_INFO_S *pMsgInfo, MSG_MESSAGE_ID_T *pMsgId);
-MSG_ERROR_T MsgStoCheckMsgCntFull(MsgDbHandler *pDbHandle, const MSG_MESSAGE_TYPE_S* pMsgType, MSG_FOLDER_ID_T FolderId);
-MSG_ERROR_T MsgStoCountMsgByLimitCategory(MsgDbHandler *pDbHandle, const MSG_MESSAGE_TYPE_S *pMsgType, int *pMsgCount, MSG_FOLDER_ID_T folderId );
-int MsgStoCheckMsgCntLimit(const MSG_MESSAGE_TYPE_S* pMsgType, MSG_FOLDER_ID_T FolderId);
-
-MSG_ERROR_T MsgStoAddAddress(MsgDbHandler *pDbHandle, const MSG_ADDRESS_INFO_S *pAddrInfo, unsigned int *pAddrId);
-MSG_ERROR_T MsgStoUpdateAddress(MsgDbHandler *pDbHandle, unsigned int AddrId);
-MSG_ERROR_T MsgStoClearAddressTable(MsgDbHandler *pDbHandle);
-bool MsgExistAddress(MsgDbHandler *pDbHandle, const char *pAddress, unsigned int *pAddrId);
+unsigned int MsgStoAddMessageTable(MsgDbHandler *pDbHandle, const MSG_MESSAGE_INFO_S *pMsgInfo);
+msg_error_t MsgStoSetReadStatus(MsgDbHandler *pDbHandle, msg_message_id_t MsgId, bool bRead);
+msg_error_t MsgStoGetOldestMessage(MsgDbHandler *pDbHandle, const MSG_MESSAGE_INFO_S *pMsgInfo, msg_message_id_t *pMsgId);
+msg_error_t MsgStoCheckMsgCntFull(MsgDbHandler *pDbHandle, const MSG_MESSAGE_TYPE_S* pMsgType, msg_folder_id_t FolderId);
+msg_error_t MsgStoCountMsgByLimitCategory(MsgDbHandler *pDbHandle, const MSG_MESSAGE_TYPE_S *pMsgType, int *pMsgCount, msg_folder_id_t folderId );
+int MsgStoCheckMsgCntLimit(const MSG_MESSAGE_TYPE_S* pMsgType, msg_folder_id_t FolderId);
+
+msg_error_t MsgStoAddAddress(MsgDbHandler *pDbHandle, const MSG_MESSAGE_INFO_S *pMsg, msg_thread_id_t *pConvId);
+msg_error_t MsgStoGetAddressByMsgId(MsgDbHandler *pDbHandle, msg_message_id_t msgId, int contactNameOrder, int *nAddressCnt, MSG_ADDRESS_INFO_S *pAddress);
+msg_error_t MsgStoGetAddressByMsgId(MsgDbHandler *pDbHandle, msg_message_id_t msgId, int contactNameOrder, msg_struct_list_s *pAddress);
+msg_error_t MsgStoGetAddressByConvId(MsgDbHandler *pDbHandle, msg_thread_id_t convId, int contactNameOrder, msg_struct_list_s *pAddrlist);
+msg_error_t MsgStoAddConversation(MsgDbHandler *pDbHandle, msg_thread_id_t *pConvId);
+msg_error_t MsgStoUpdateConversation(MsgDbHandler *pDbHandle, msg_thread_id_t convId);
+msg_error_t MsgStoSetConversationDisplayName(MsgDbHandler *pDbHandle, int contactId);
+msg_error_t MsgStoSetConversationDisplayName(MsgDbHandler *pDbHandle, msg_thread_id_t convId);
+msg_error_t MsgStoClearConversationTable(MsgDbHandler *pDbHandle);
+bool MsgExistAddress(MsgDbHandler *pDbHandle, const MSG_MESSAGE_INFO_S *pMsg, msg_thread_id_t *pConvId);
 
 int MsgStoGetUnreadCnt(MsgDbHandler *pDbHandle, MSG_MAIN_TYPE_T MsgType);
-MSG_ERROR_T MsgStoAddContactInfo(MsgDbHandler *pDbHandle, MSG_CONTACT_INFO_S *pContactInfo, const char *pNumber);
-MSG_ERROR_T MsgStoClearContactInfo(MsgDbHandler *pDbHandle, int ContactId);
-MSG_ERROR_T MsgStoClearContactInfo(MsgDbHandler *pDbHandle, int ContactId, const char *pNumber);
-MSG_ERROR_T MsgStoGetMmsRawFilePath(MsgDbHandler *pDbHandle, MSG_MESSAGE_ID_T msgId, char *pFilePath);
-bool MsgStoCheckReadReportRequested(MsgDbHandler *pDbHandle, MSG_MESSAGE_ID_T MsgId);
-bool MsgStoCheckReadReportIsSent(MsgDbHandler *pDbHandle, MSG_MESSAGE_ID_T MsgId);
+msg_error_t MsgStoAddContactInfo(MsgDbHandler *pDbHandle, MSG_CONTACT_INFO_S *pContactInfo, const char *pNumber);
+msg_error_t MsgStoClearContactInfo(MsgDbHandler *pDbHandle, int ContactId);
+msg_error_t MsgStoClearContactInfo(MsgDbHandler *pDbHandle, int ContactId, const char *pNumber);
+msg_error_t MsgStoGetMmsRawFilePath(MsgDbHandler *pDbHandle, msg_message_id_t msgId, char *pFilePath);
+bool MsgStoCheckReadReportRequested(MsgDbHandler *pDbHandle, msg_message_id_t MsgId);
+bool MsgStoCheckReadReportIsSent(MsgDbHandler *pDbHandle, msg_message_id_t MsgId);
 char *MsgStoReplaceString(const char *org_str, const char *old_str, const char *new_str);
 
 #endif // MSG_UTIL_STORAGE_H
index 842c32a..6af422f 100755 (executable)
@@ -17,11 +17,14 @@ SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -O0 -g -Wall")
 ##########################################################
 
 SET(MAPI-SRCS 
-       ${CMAKE_SOURCE_DIR}/mapi/MapiControl.cpp
-       ${CMAKE_SOURCE_DIR}/mapi/MapiSetting.cpp
-       ${CMAKE_SOURCE_DIR}/mapi/MapiStorage.cpp
-       ${CMAKE_SOURCE_DIR}/mapi/MapiTransport.cpp
-       ${CMAKE_SOURCE_DIR}/mapi/MapiMessage.cpp
+       ${CMAKE_SOURCE_DIR}/mapi/msg_svc.cpp
+       ${CMAKE_SOURCE_DIR}/mapi/msg_control.cpp
+       ${CMAKE_SOURCE_DIR}/mapi/msg_storage.cpp
+       ${CMAKE_SOURCE_DIR}/mapi/msg_transport.cpp
+       ${CMAKE_SOURCE_DIR}/mapi/msg_filter.cpp
+       ${CMAKE_SOURCE_DIR}/mapi/msg_message.cpp
+       ${CMAKE_SOURCE_DIR}/mapi/msg_mms.cpp
+       ${CMAKE_SOURCE_DIR}/mapi/msg_setting.cpp
 )
 
 INCLUDE_DIRECTORIES(
diff --git a/mapi/MapiMessage.cpp b/mapi/MapiMessage.cpp
deleted file mode 100755 (executable)
index 74b0777..0000000
+++ /dev/null
@@ -1,1471 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include "MsgTypes.h"
-#include "MsgMmsTypes.h"
-#include "MsgMmsMessage.h"
-#include "MsgDebug.h"
-#include "MsgUtilFile.h"
-#include "MsgHandle.h"
-#include "MsgException.h"
-#include "MapiMessage.h"
-#include "MsgInternalTypes.h"
-#include "MsgDrmWrapper.h"
-
-
-static MSG_ERROR_T msg_mms_release_message(MMS_MESSAGE_DATA_S* msg_data);
-
-/*==================================================================================================
-                                     FUNCTION IMPLEMENTATION
-==================================================================================================*/
-EXPORT_API msg_message_t msg_new_message(void)
-{
-       MSG_MESSAGE_S *msg = new MSG_MESSAGE_S;
-
-       memset(msg, 0x00, sizeof(MSG_MESSAGE_S));
-
-       /* set default value to message*/
-       msg->msgId = 0;
-       msg->folderId = MSG_DRAFT_ID;
-       msg->referenceId = 0;
-       msg->msgType.mainType= MSG_SMS_TYPE;
-       msg->msgType.subType = MSG_NORMAL_SMS;
-       msg->msgType.classType = MSG_CLASS_NONE;
-       msg->storageId = MSG_STORAGE_PHONE;
-       msg->nAddressCnt = 0;
-       time_t curTime = time(NULL);
-       msg->displayTime = curTime;
-       msg->networkStatus = MSG_NETWORK_NOT_SEND;
-       msg->encodeType = MSG_ENCODE_AUTO;
-       msg->bRead = false;
-       msg->bProtected = false;
-       msg->bBackup = false;
-       msg->priority = MSG_MESSAGE_PRIORITY_NORMAL;
-       msg->direction = MSG_DIRECTION_TYPE_MO;
-       msg->msgPort.valid = false;
-       msg->dataSize = 0;
-       msg->pData = NULL;
-       msg->pMmsData = NULL;
-       msg->scheduledTime = 0;
-
-       return (msg_message_t) msg;
-}
-
-
-EXPORT_API int msg_release_message(msg_message_t *opq_msg)
-{
-       if (opq_msg == NULL)
-       {
-               MSG_FATAL("msg is NULL");
-               return MSG_ERR_NULL_POINTER;
-       }
-
-       MSG_MESSAGE_S* msg = NULL;
-
-       msg = (MSG_MESSAGE_S*)(*opq_msg);
-
-       if (msg != NULL)
-       {
-               MSG_DEBUG("main type : %d, data size : %d", msg->msgType.mainType, msg->dataSize);
-
-               if (msg->pData)
-               {
-                       delete [] static_cast<char*>(msg->pData);
-                       msg->pData = NULL;
-               }
-
-               if (msg->pMmsData)
-               {
-                       delete [] static_cast<char*>(msg->pMmsData);
-                       msg->pMmsData = NULL;
-               }
-
-               delete (MSG_MESSAGE_S*)(*opq_msg);
-               *opq_msg = NULL;
-       }
-
-       return MSG_SUCCESS;
-}
-
-
-EXPORT_API int msg_set_message_id(msg_message_t opq_msg, int msg_id)
-{
-       if ( !opq_msg )
-       {
-               MSG_FATAL("msg is NULL");
-               return MSG_ERR_NULL_POINTER;
-       }
-
-       MSG_MESSAGE_S *msg = (MSG_MESSAGE_S*) opq_msg;
-       msg->msgId = msg_id;
-       return MSG_SUCCESS;
-}
-
-
-EXPORT_API int msg_get_message_id(msg_message_t opq_msg)
-{
-       if( !opq_msg )
-       {
-               MSG_FATAL("msg is NULL");
-               return MSG_ERR_NULL_POINTER;
-       }
-       MSG_MESSAGE_S *msg = (MSG_MESSAGE_S*) opq_msg;
-
-       return msg->msgId;
-}
-
-
-EXPORT_API int msg_set_message_type(msg_message_t opq_msg, MSG_MESSAGE_TYPE_T msg_type)
-{
-       if (!opq_msg)
-       {
-               MSG_FATAL("msg or text is NULL");
-               return MSG_ERR_NULL_POINTER;
-       }
-
-       MSG_MESSAGE_S *msg = (MSG_MESSAGE_S*)opq_msg;
-
-       if (msg_type == MSG_TYPE_SMS)
-       {
-               msg->msgType.mainType = MSG_SMS_TYPE;
-               msg->msgType.subType = MSG_NORMAL_SMS;
-       }
-       else if (msg_type == MSG_TYPE_MMS)
-       {
-               msg->msgType.mainType = MSG_MMS_TYPE;
-               msg->msgType.subType = MSG_SENDREQ_MMS;
-       }
-       else if (msg_type == MSG_TYPE_MMS_JAVA)
-       {
-               msg->msgType.mainType = MSG_MMS_TYPE;
-               msg->msgType.subType = MSG_SENDREQ_JAVA_MMS;
-       }
-       else if (msg_type == MSG_TYPE_SMS_SYNCML)
-       {
-               msg->msgType.mainType = MSG_SMS_TYPE;
-               msg->msgType.subType = MSG_SYNCML_CP;
-       }
-       else if (msg_type == MSG_TYPE_SMS_REJECT)
-       {
-               msg->msgType.mainType = MSG_SMS_TYPE;
-               msg->msgType.subType = MSG_REJECT_SMS;
-       }
-       else
-       {
-               MSG_FATAL("invalid msg_type [%d]", msg_type);
-               return MSG_ERR_INVALID_PARAMETER;
-       }
-
-       return MSG_SUCCESS;
-}
-
-
-EXPORT_API int msg_get_message_type(msg_message_t opq_msg)
-{
-       if (!opq_msg)
-       {
-               MSG_FATAL("msg or msg_type is NULL");
-               return MSG_ERR_NULL_POINTER;
-       }
-
-       MSG_MESSAGE_S *msg = (MSG_MESSAGE_S*)opq_msg;
-
-       if (msg->msgType.mainType == MSG_SMS_TYPE)
-       {
-               if (msg->msgType.subType == MSG_CB_SMS)
-                       return MSG_TYPE_SMS_CB;
-               else    if (msg->msgType.subType == MSG_JAVACB_SMS)
-                       return MSG_TYPE_SMS_JAVACB;
-               else    if (msg->msgType.subType == MSG_WAP_SI_SMS || msg->msgType.subType == MSG_WAP_SL_SMS)
-                       return MSG_TYPE_SMS_WAPPUSH;
-               else    if (msg->msgType.subType == MSG_MWI_VOICE_SMS || msg->msgType.subType == MSG_MWI_FAX_SMS
-                               || msg->msgType.subType == MSG_MWI_EMAIL_SMS || msg->msgType.subType == MSG_MWI_OTHER_SMS)
-                       return MSG_TYPE_SMS_MWI;
-               else    if (msg->msgType.subType == MSG_SYNCML_CP)
-                       return MSG_TYPE_SMS_SYNCML;
-               else    if (msg->msgType.subType == MSG_REJECT_SMS)
-                       return MSG_TYPE_SMS_REJECT;
-               else
-                       return MSG_TYPE_SMS;
-       }
-       else if (msg->msgType.mainType == MSG_MMS_TYPE)
-       {
-               if (msg->msgType.subType == MSG_NOTIFICATIONIND_MMS)
-                       return MSG_TYPE_MMS_NOTI;
-               else if (msg->msgType.subType == MSG_SENDREQ_JAVA_MMS)
-                       return MSG_TYPE_MMS_JAVA;
-               else
-                       return MSG_TYPE_MMS;
-       }
-       else
-               return MSG_TYPE_INVALID;
-}
-
-
-EXPORT_API bool msg_is_sms(msg_message_t opq_msg)
-{
-       if( !opq_msg )
-       {
-               MSG_FATAL("msg or msg_type is NULL");
-               return false;
-       }
-
-       MSG_MESSAGE_S *msg = (MSG_MESSAGE_S*) opq_msg;
-       return (msg->msgType.mainType == MSG_SMS_TYPE);
-}
-
-
-EXPORT_API bool msg_is_mms(msg_message_t opq_msg)
-{
-       if( !opq_msg )
-       {
-               MSG_FATAL("msg or msg_type is NULL");
-               return false;
-       }
-
-       MSG_MESSAGE_S *msg = (MSG_MESSAGE_S*) opq_msg;
-       return (msg->msgType.mainType == MSG_MMS_TYPE);
-}
-
-
-EXPORT_API int msg_set_storage_id(msg_message_t opq_msg, MSG_STORAGE_ID_T storage_id)
-{
-       if( !opq_msg)
-       {
-               MSG_FATAL("msg or storage is NULL");
-               return MSG_ERR_NULL_POINTER;
-       }
-
-       if (storage_id != MSG_STORAGE_PHONE && storage_id != MSG_STORAGE_SIM)
-       {
-               MSG_FATAL("unsupported storage [%d]", storage_id);
-               return MSG_ERR_INVALID_PARAMETER;
-       }
-
-       MSG_MESSAGE_S *msg = (MSG_MESSAGE_S*) opq_msg;
-
-       msg->storageId = storage_id;
-
-       return MSG_SUCCESS;
-}
-
-
-EXPORT_API int msg_get_storage_id(msg_message_t opq_msg)
-{
-       if( !opq_msg )
-       {
-               MSG_FATAL("msg is NULL");
-               return MSG_ERR_NULL_POINTER;
-       }
-
-       MSG_MESSAGE_S *msg = (MSG_MESSAGE_S*) opq_msg;
-
-       return msg->storageId;
-}
-
-
-EXPORT_API bool msg_is_in_sim(msg_message_t opq_msg)
-{
-       if( !opq_msg )
-       {
-               MSG_FATAL("msg or folder is NULL");
-               return false;
-       }
-
-       MSG_MESSAGE_S *msg = (MSG_MESSAGE_S*) opq_msg;
-
-       return (msg->storageId == MSG_STORAGE_SIM);
-}
-
-
-EXPORT_API int msg_set_folder_id(msg_message_t opq_msg, MSG_FOLDER_ID_T folder_id)
-{
-       if( !opq_msg)
-       {
-               MSG_FATAL("msg or is NULL");
-               return MSG_ERR_NULL_POINTER;
-       }
-
-       if (folder_id < MSG_INBOX_ID || folder_id > MSG_MAX_FOLDER_ID)
-       {
-               MSG_FATAL("wrong folder ID [%d]", folder_id);
-               return MSG_ERR_INVALID_PARAMETER;
-       }
-
-       MSG_MESSAGE_S *msg = (MSG_MESSAGE_S*) opq_msg;
-
-       msg->folderId = folder_id;
-
-       return MSG_SUCCESS;
-}
-
-
-EXPORT_API int msg_get_folder_id(msg_message_t opq_msg)
-{
-       if( !opq_msg )
-       {
-               MSG_FATAL("msg is NULL");
-               return MSG_ERR_NULL_POINTER;
-       }
-
-       MSG_MESSAGE_S *msg = (MSG_MESSAGE_S*) opq_msg;
-
-       return msg->folderId;
-}
-
-
-EXPORT_API int msg_reset_address(msg_message_t opq_msg)
-{
-       if( !opq_msg )
-       {
-               MSG_FATAL("msg is NULL");
-               return MSG_ERR_NULL_POINTER;
-       }
-
-       MSG_MESSAGE_S *msg = (MSG_MESSAGE_S*) opq_msg;
-
-       msg->nAddressCnt = 0;
-
-       for (int i=0 ; i < MAX_TO_ADDRESS_CNT ; i++)
-       {
-               msg->addressList[i].threadId = 0;
-               msg->addressList[i].addressType = MSG_ADDRESS_TYPE_UNKNOWN;
-               msg->addressList[i].recipientType = MSG_RECIPIENTS_TYPE_UNKNOWN;
-               msg->addressList[i].contactId = 0;
-               msg->addressList[i].addressVal[0] = '\0';
-               msg->addressList[i].displayName[0] = '\0';
-       }
-
-       return MSG_SUCCESS;
-}
-
-
-EXPORT_API int msg_add_address(msg_message_t opq_msg, const char* phone_num_list, MSG_RECIPIENT_TYPE_T to_type )
-{
-       if( !opq_msg || !phone_num_list)
-       {
-               MSG_FATAL("msg or text or type is NULL");
-               return MSG_ERR_NULL_POINTER;
-       }
-
-       if (to_type < MSG_RECIPIENTS_TYPE_TO || to_type > MSG_RECIPIENTS_TYPE_BCC)
-       {
-               MSG_FATAL("unsupported recipient type [%d]", to_type);
-               return MSG_ERR_INVALID_PARAMETER;
-       }
-
-       MSG_MESSAGE_S *msg = (MSG_MESSAGE_S*) opq_msg;
-
-
-       if(msg->msgType.mainType == MSG_SMS_TYPE)
-       {
-               char trimmed_num[strlen(phone_num_list)+1];
-               bzero(trimmed_num, strlen(phone_num_list)+1);
-
-               MSG_ERROR_T retVal = msg_verify_number(phone_num_list, trimmed_num);
-
-               if ( retVal != MSG_SUCCESS )
-                       return retVal;
-
-               int i = msg->nAddressCnt;
-               for( char* cur_num = strtok(trimmed_num,", "); cur_num && (i < MAX_TO_ADDRESS_CNT);
-                                                                                                                       cur_num = strtok(NULL,", "), i++)
-               {
-                       if (strlen(cur_num) > MAX_ADDRESS_VAL_LEN)
-                       {
-                               MSG_DEBUG("Phone number is too long [%s], and sending is skipped", cur_num);
-                               continue;
-                       }
-
-                       /* fill the destination number in msgReq */
-                       msg->nAddressCnt++;
-                       msg->addressList[i].addressType = MSG_ADDRESS_TYPE_PLMN; // telephone number
-                       msg->addressList[i].recipientType = to_type; // recipient type
-                       snprintf(msg->addressList[i].addressVal, MAX_ADDRESS_VAL_LEN, "%s", cur_num);
-                       MSG_DEBUG("SMS AddressVal = [%s]", msg->addressList[i].addressVal);
-               }
-
-       }
-       else
-       {
-               char phone_num_list_tmp[strlen(phone_num_list)+1];
-               bzero(phone_num_list_tmp, strlen(phone_num_list)+1);
-
-               strncpy(phone_num_list_tmp, phone_num_list, strlen(phone_num_list));
-
-               MSG_ERROR_T retVal = msg_verify_email(phone_num_list_tmp);
-
-               if ( retVal != MSG_SUCCESS )
-                       return retVal;
-
-               int i = msg->nAddressCnt;
-               for( char* cur_num = strtok(phone_num_list_tmp,", "); cur_num && (i < MAX_TO_ADDRESS_CNT);
-                                                                                                                       cur_num = strtok(NULL,", "), i++)
-               {
-                       if (strlen(cur_num) > MAX_ADDRESS_VAL_LEN)
-                       {
-                               MSG_DEBUG("Phone number is too long [%s], and sending is skipped", cur_num);
-                               continue;
-                       }
-
-                       char trimmed_num[strlen(cur_num)+1];
-                       bzero(trimmed_num, strlen(cur_num)+1);
-
-                       retVal = msg_verify_number(cur_num, trimmed_num);
-
-                       if(retVal == MSG_SUCCESS)
-                       {
-                               /* fill the destination number in msgReq */
-                               msg->nAddressCnt++;
-                               msg->addressList[i].addressType = MSG_ADDRESS_TYPE_PLMN; // telephone number
-                               msg->addressList[i].recipientType = to_type; // recipient type
-                               snprintf(msg->addressList[i].addressVal, MAX_ADDRESS_VAL_LEN, "%s", trimmed_num);
-                               MSG_DEBUG("MMS Number AddressVal = [%s]", msg->addressList[i].addressVal);
-                       }
-                       else
-                       {
-                               /* fill the destination number in msgReq */
-                               msg->nAddressCnt++;
-                               msg->addressList[i].addressType = MSG_ADDRESS_TYPE_EMAIL; // telephone number
-                               msg->addressList[i].recipientType = to_type; // recipient type
-                               snprintf(msg->addressList[i].addressVal, MAX_ADDRESS_VAL_LEN, "%s", cur_num);
-                               MSG_DEBUG("MMS Email AddressVal = [%s]", msg->addressList[i].addressVal);
-                       }
-               }
-       }
-
-       return MSG_SUCCESS;
-}
-
-
-EXPORT_API int msg_get_address_count(msg_message_t opq_msg)
-{
-       if( !opq_msg )
-       {
-               MSG_FATAL("msg or count is NULL");
-               return MSG_ERR_NULL_POINTER;
-       }
-       MSG_MESSAGE_S *msg = (MSG_MESSAGE_S*) opq_msg;
-       return msg->nAddressCnt;
-}
-
-
-EXPORT_API int msg_get_ith_thread_id(msg_message_t opq_msg, int ith)
-{
-       if( !opq_msg)
-       {
-               MSG_FATAL("msg or text or type is NULL");
-               return MSG_ERR_NULL_POINTER;
-       }
-
-       MSG_MESSAGE_S *msg = (MSG_MESSAGE_S*) opq_msg;
-
-       if( ith < msg->nAddressCnt )
-       {
-               return msg->addressList[ith].threadId;
-       }
-       else
-       {
-               MSG_FATAL("Requested address count %d exceeds max %d in msg", ith, msg->nAddressCnt);
-               return MSG_ERR_UNKNOWN;
-       }
-}
-
-
-EXPORT_API const char* msg_get_ith_address(msg_message_t opq_msg, int ith)
-{
-       if( !opq_msg )
-       {
-               MSG_FATAL("msg or addr is NULL");
-               return NULL;
-       }
-
-       MSG_MESSAGE_S *msg = (MSG_MESSAGE_S*) opq_msg;
-
-       if( ith < msg->nAddressCnt )
-       {
-               return msg->addressList[ith].addressVal;
-       }
-       else
-       {
-               MSG_FATAL("Requested address count %d exceeds max %d in msg", ith, msg->nAddressCnt);
-               return NULL;
-       }
-}
-
-
-EXPORT_API int msg_get_ith_recipient_type(msg_message_t opq_msg, int ith)
-{
-       if( !opq_msg)
-       {
-               MSG_FATAL("msg or text or type is NULL");
-               return MSG_ERR_NULL_POINTER;
-       }
-
-       MSG_MESSAGE_S *msg = (MSG_MESSAGE_S*) opq_msg;
-
-       if( ith < msg->nAddressCnt )
-       {
-               return msg->addressList[ith].recipientType;
-       }
-       else
-       {
-               MSG_FATAL("Requested address count %d exceeds max %d in msg", ith, msg->nAddressCnt);
-               return MSG_ERR_UNKNOWN;
-       }
-}
-
-
-EXPORT_API const char* msg_get_ith_name(msg_message_t opq_msg, int ith)
-{
-       if( !opq_msg )
-       {
-               MSG_FATAL("msg or addr is NULL");
-               return NULL;
-       }
-
-       MSG_MESSAGE_S *msg = (MSG_MESSAGE_S*) opq_msg;
-
-       if( ith < msg->nAddressCnt )
-       {
-               return msg->addressList[ith].displayName;
-       }
-       else
-       {
-               MSG_FATAL("Requested address count %d exceeds max %d in msg", ith, msg->nAddressCnt);
-               return NULL;
-       }
-}
-
-
-EXPORT_API int msg_get_ith_contact_id(msg_message_t opq_msg, int ith)
-{
-       if( !opq_msg )
-       {
-               MSG_FATAL("msg or addr is NULL");
-               return MSG_ERR_NULL_POINTER;
-       }
-
-       MSG_MESSAGE_S *msg = (MSG_MESSAGE_S*) opq_msg;
-
-       if( ith < msg->nAddressCnt )
-       {
-               return msg->addressList[ith].contactId;
-       }
-       else
-       {
-               MSG_FATAL("Requested address count %d exceeds max %d in msg", ith, msg->nAddressCnt);
-               return MSG_ERR_UNKNOWN;
-       }
-}
-
-
-EXPORT_API int msg_set_reply_address(msg_message_t opq_msg, const char* phone_num)
-{
-       if( !opq_msg || !phone_num)
-       {
-               MSG_FATAL("msg or text or type is NULL");
-               return MSG_ERR_NULL_POINTER;
-       }
-
-       if (strlen(phone_num) > MAX_PHONE_NUMBER_LEN)
-       {
-               MSG_DEBUG("Phone number is too long [%s]", phone_num);
-               return MSG_ERR_INVALID_PARAMETER;
-       }
-
-       MSG_MESSAGE_S *msg = (MSG_MESSAGE_S*) opq_msg;
-
-       char trimmed_num[strlen(phone_num)+1];
-       bzero(trimmed_num, strlen(phone_num)+1);
-
-       MSG_ERROR_T retVal = msg_verify_number(phone_num, trimmed_num);
-
-       if (retVal != MSG_SUCCESS)
-               return retVal;
-
-       snprintf(msg->replyAddress, MAX_PHONE_NUMBER_LEN, "%s", phone_num);
-
-       MSG_DEBUG("Reply Address Number : [%s]", msg->replyAddress);
-
-       return MSG_SUCCESS;
-}
-
-
-EXPORT_API int msg_sms_set_message_body(msg_message_t opq_msg, const char* mdata, int size)
-{
-       if (!opq_msg || !mdata) {
-               MSG_FATAL("msg or text is NULL");
-               return MSG_ERR_NULL_POINTER;
-       }
-
-       if (size <= 0) {
-               MSG_FATAL("msg size is invalid");
-               return MSG_ERR_INVALID_PARAMETER;
-       }
-
-       MSG_MESSAGE_S *msg = (MSG_MESSAGE_S*) opq_msg;
-
-       if(msg->msgType.mainType == MSG_MMS_TYPE) {
-/** Temporary added codes for Binary MMS. */
-               if (msg->pMmsData)
-                       delete [] static_cast<char*>(msg->pMmsData);
-
-               msg->dataSize = size;
-
-               msg->pMmsData = (void*)new char[msg->dataSize+1];
-
-               memset(msg->pMmsData, 0x00, msg->dataSize+1);
-
-               memcpy((char *)msg->pMmsData, mdata, msg->dataSize);
-
-/** End. */
-       } else if (msg->msgType.mainType == MSG_SMS_TYPE) {
-               if (msg->pData)
-                       delete [] static_cast<char*>(msg->pData);
-
-               msg->dataSize = size;
-
-               msg->pData = (void*)new char[msg->dataSize+1];
-
-               memcpy((char *)msg->pData, mdata, msg->dataSize);
-
-               ((char*) msg->pData)[msg->dataSize] = '\0';
-
-       } else {
-               return MSG_ERR_INVALID_MSG_TYPE;
-       }
-
-       return MSG_SUCCESS;
-
-}
-
-
-EXPORT_API const char* msg_sms_get_message_body(msg_message_t opq_msg)
-{
-       if (!opq_msg) {
-               MSG_FATAL("msg is NULL");
-               return NULL;
-       }
-
-       MSG_MESSAGE_S *msg = (MSG_MESSAGE_S*) opq_msg;
-
-
-       if (msg->msgType.mainType == MSG_SMS_TYPE) {
-
-               return (char*) msg->pData;
-
-       } else if (msg->msgType.mainType == MSG_MMS_TYPE) {
-
-               return (char*) msg->pMmsData;
-
-       } else {
-               MSG_FATAL("msg type is invalid.");
-               return NULL;
-       }
-
-}
-
-
-EXPORT_API const char* msg_mms_get_text_contents(msg_message_t opq_msg)
-{
-       if( !opq_msg )
-       {
-               MSG_FATAL("msg is NULL");
-               return NULL;
-       }
-
-       MSG_MESSAGE_S *msg = (MSG_MESSAGE_S*) opq_msg;
-
-       if(msg->msgType.mainType != MSG_MMS_TYPE)
-       {
-               MSG_FATAL("msg is not mms type.");
-               return NULL;
-       }
-
-       return (char*) msg->pData;
-}
-
-
-EXPORT_API int msg_get_message_body_size(msg_message_t opq_msg )
-{
-       if( !opq_msg )
-       {
-               MSG_FATAL("msg is NULL");
-               return MSG_ERR_NULL_POINTER;
-       }
-
-       MSG_MESSAGE_S *msg = (MSG_MESSAGE_S*) opq_msg;
-       return msg->dataSize;
-}
-
-
-EXPORT_API int msg_set_subject(msg_message_t opq_msg, const char* subject )
-{
-       if( !opq_msg || !subject )
-       {
-               MSG_FATAL("msg or subject is NULL");
-               return MSG_ERR_NULL_POINTER;
-       }
-
-       MSG_MESSAGE_S *msg = (MSG_MESSAGE_S*) opq_msg;
-
-       snprintf(msg->subject, MAX_SUBJECT_LEN+1,"%s", subject);
-
-       return MSG_SUCCESS;
-}
-
-
-EXPORT_API const char* msg_get_subject(msg_message_t opq_msg)
-{
-       if( !opq_msg )
-       {
-               MSG_FATAL("msg is NULL");
-               return NULL;
-       }
-
-       MSG_MESSAGE_S *msg = (MSG_MESSAGE_S*) opq_msg;
-
-       return msg->subject;
-}
-
-
-EXPORT_API int msg_set_time(msg_message_t opq_msg, time_t msg_time)
-{
-       if( !opq_msg )
-       {
-               MSG_FATAL("msg is NULL");
-               return MSG_ERR_NULL_POINTER;
-       }
-
-       MSG_MESSAGE_S *msg = (MSG_MESSAGE_S*) opq_msg;
-
-       msg->displayTime = msg_time;
-       return MSG_SUCCESS;
-}
-
-
-EXPORT_API time_t* msg_get_time(msg_message_t opq_msg)
-{
-       if( !opq_msg )
-       {
-               MSG_FATAL("msg is NULL");
-               return NULL;
-       }
-
-       MSG_MESSAGE_S *msg = (MSG_MESSAGE_S*) opq_msg;
-
-       return &(msg->displayTime);
-}
-
-EXPORT_API int msg_set_network_status(msg_message_t opq_msg, MSG_NETWORK_STATUS_T status)
-{
-       if( !opq_msg )
-       {
-               MSG_FATAL("msg is NULL");
-               return MSG_ERR_NULL_POINTER;
-       }
-
-       MSG_MESSAGE_S *msg = (MSG_MESSAGE_S*) opq_msg;
-       msg->networkStatus = status;
-       return MSG_SUCCESS;
-}
-
-
-EXPORT_API int msg_get_network_status(msg_message_t opq_msg)
-{
-       if( !opq_msg )
-       {
-               MSG_FATAL("msg or status is NULL");
-               return MSG_ERR_NULL_POINTER;
-       }
-
-       MSG_MESSAGE_S *msg = (MSG_MESSAGE_S*) opq_msg;
-       return msg->networkStatus;
-}
-
-
-EXPORT_API int msg_set_encode_type(msg_message_t opq_msg, MSG_ENCODE_TYPE_T encoding_type)
-{
-       if( !opq_msg)
-       {
-               MSG_FATAL("msg or encoding_type is NULL");
-               return MSG_ERR_NULL_POINTER;
-       }
-
-       if( encoding_type != MSG_ENCODE_GSM7BIT &&
-               encoding_type != MSG_ENCODE_8BIT &&
-               encoding_type != MSG_ENCODE_UCS2 &&
-               encoding_type != MSG_ENCODE_AUTO )
-       {
-               MSG_FATAL("Encoding_type has invalid value [%d]", encoding_type);
-               return MSG_ERR_INVALID_PARAMETER;
-       }
-
-       MSG_MESSAGE_S *msg = (MSG_MESSAGE_S*) opq_msg;
-       msg->encodeType = encoding_type;
-       return MSG_SUCCESS;
-}
-
-
-EXPORT_API int msg_get_encode_type(msg_message_t opq_msg)
-{
-       if( !opq_msg )
-       {
-               MSG_FATAL("msg is NULL");
-               return MSG_ERR_NULL_POINTER;
-       }
-
-       MSG_MESSAGE_S *msg = (MSG_MESSAGE_S*) opq_msg;
-       return msg->encodeType;
-}
-
-
-EXPORT_API int msg_set_read_status(msg_message_t opq_msg, bool read_flag)
-{
-       if( !opq_msg )
-       {
-               MSG_FATAL("msg is NULL");
-               return MSG_ERR_NULL_POINTER;
-       }
-
-       MSG_MESSAGE_S *msg = (MSG_MESSAGE_S*) opq_msg;
-       msg->bRead = read_flag;
-       return MSG_SUCCESS;
-}
-
-
-EXPORT_API bool msg_is_read(msg_message_t opq_msg)
-{
-       if( !opq_msg )
-       {
-               MSG_FATAL("msg is NULL");
-               return false;
-       }
-
-       MSG_MESSAGE_S *msg = (MSG_MESSAGE_S*) opq_msg;
-
-       return msg->bRead;
-}
-
-
-EXPORT_API int msg_set_protect_status(msg_message_t opq_msg, bool protect_flag)
-{
-       if( !opq_msg )
-       {
-               MSG_FATAL("msg is NULL");
-               return MSG_ERR_NULL_POINTER;
-       }
-
-       MSG_MESSAGE_S *msg = (MSG_MESSAGE_S*) opq_msg;
-       msg->bProtected = protect_flag;
-       return MSG_SUCCESS;
-}
-
-
-EXPORT_API bool msg_is_protected(msg_message_t opq_msg)
-{
-       if( !opq_msg )
-       {
-               MSG_FATAL("msg or protected is NULL");
-               return false;
-       }
-
-       MSG_MESSAGE_S *msg = (MSG_MESSAGE_S*) opq_msg;
-       return msg->bProtected;
-}
-
-
-EXPORT_API int msg_set_backup_status(msg_message_t opq_msg, bool backup_flag)
-{
-       if( !opq_msg )
-       {
-               MSG_FATAL("msg is NULL");
-               return MSG_ERR_NULL_POINTER;
-       }
-
-       MSG_MESSAGE_S *msg = (MSG_MESSAGE_S*) opq_msg;
-       msg->bBackup = backup_flag;
-       return MSG_SUCCESS;
-}
-
-
-EXPORT_API bool msg_is_backup(msg_message_t opq_msg)
-{
-       if( !opq_msg )
-       {
-               MSG_FATAL("msg or protected is NULL");
-               return false;
-       }
-
-       MSG_MESSAGE_S *msg = (MSG_MESSAGE_S*) opq_msg;
-       return msg->bBackup;
-}
-
-
-EXPORT_API int msg_set_priority_info(msg_message_t opq_msg, MSG_PRIORITY_TYPE_T priority)
-{
-       if( !opq_msg)
-       {
-               MSG_FATAL("msg is NULL");
-               return MSG_ERR_NULL_POINTER;
-       }
-
-       MSG_MESSAGE_S *msg = (MSG_MESSAGE_S*) opq_msg;
-       msg->priority = priority;
-       return MSG_SUCCESS;
-}
-
-
-EXPORT_API int msg_get_priority_info(msg_message_t opq_msg)
-{
-       if( !opq_msg)
-       {
-               MSG_FATAL("msg is NULL");
-               return MSG_ERR_NULL_POINTER;
-       }
-
-       MSG_MESSAGE_S *msg = (MSG_MESSAGE_S*) opq_msg;
-       return msg->priority;
-}
-
-
-EXPORT_API int msg_set_direction_info(msg_message_t opq_msg, MSG_DIRECTION_TYPE_T direction)
-{
-       if( !opq_msg)
-       {
-               MSG_FATAL("msg is NULL");
-               return MSG_ERR_NULL_POINTER;
-       }
-
-       MSG_MESSAGE_S *msg = (MSG_MESSAGE_S*) opq_msg;
-       msg->direction= direction;
-       return MSG_SUCCESS;
-}
-
-
-EXPORT_API int msg_get_direction_info(msg_message_t opq_msg)
-{
-       if( !opq_msg )
-       {
-               MSG_FATAL("msg is NULL");
-               return MSG_ERR_NULL_POINTER;
-       }
-
-       MSG_MESSAGE_S *msg = (MSG_MESSAGE_S*) opq_msg;
-       return msg->direction;
-}
-
-
-EXPORT_API int msg_set_port(msg_message_t opq_msg, unsigned short dst_port, unsigned short src_port)
-{
-       if( !opq_msg )
-       {
-               MSG_FATAL("msg is NULL");
-               return MSG_ERR_NULL_POINTER;
-       }
-
-       if( !dst_port && !src_port )
-               return MSG_SUCCESS;
-
-       MSG_MESSAGE_S *msg = (MSG_MESSAGE_S*) opq_msg;
-       msg->msgPort.valid = true;
-       msg->msgPort.dstPort = dst_port;
-       msg->msgPort.srcPort = src_port;
-
-       return MSG_SUCCESS;
-}
-
-
-EXPORT_API int msg_get_dest_port(msg_message_t opq_msg)
-{
-       if( !opq_msg )
-       {
-               MSG_FATAL("msg or dst_port or src_port is NULL");
-               return MSG_ERR_NULL_POINTER;
-       }
-
-       MSG_MESSAGE_S *msg = (MSG_MESSAGE_S*) opq_msg;
-       if( msg->msgPort.valid )
-               return msg->msgPort.dstPort;
-       else
-               return 0;
-}
-
-
-EXPORT_API int msg_get_src_port(msg_message_t opq_msg)
-{
-       if( !opq_msg )
-       {
-               MSG_FATAL("msg or dst_port or src_port is NULL");
-               return MSG_ERR_NULL_POINTER;
-       }
-
-       MSG_MESSAGE_S *msg = (MSG_MESSAGE_S*) opq_msg;
-       if( msg->msgPort.valid )
-               return msg->msgPort.srcPort;
-       else
-               return 0;
-}
-
-
-EXPORT_API int msg_set_scheduled_time(msg_message_t opq_msg, time_t time_to_send)
-{
-       if( !opq_msg )
-       {
-               MSG_FATAL("msg is NULL");
-               return MSG_ERR_NULL_POINTER;
-       }
-
-       if( !time_to_send )
-               return MSG_SUCCESS;
-
-       MSG_MESSAGE_S *msg = (MSG_MESSAGE_S*) opq_msg;
-       msg->scheduledTime = time_to_send;
-
-       return MSG_SUCCESS;
-}
-
-
-EXPORT_API time_t* msg_get_scheduled_time(msg_message_t opq_msg)
-{
-       if( !opq_msg )
-       {
-               MSG_FATAL("msg is NULL");
-               return NULL;
-       }
-
-       MSG_MESSAGE_S *msg = (MSG_MESSAGE_S*) opq_msg;
-       return &(msg->scheduledTime);
-}
-
-
-EXPORT_API int msg_get_attachment_count(msg_message_t opq_msg)
-{
-       if ( !opq_msg )
-       {
-               MSG_FATAL("msg is NULL");
-               return MSG_ERR_NULL_POINTER;
-       }
-
-       MSG_MESSAGE_S* msg = (MSG_MESSAGE_S*) opq_msg;
-
-       return msg->attachCount;
-}
-
-EXPORT_API const char* msg_get_thumbnail_path(msg_message_t opq_msg)
-{
-       if (!opq_msg)
-       {
-               MSG_FATAL("msg is NULL");
-               return NULL;
-       }
-
-       MSG_MESSAGE_S* pMsg = (MSG_MESSAGE_S*)opq_msg;
-
-       return pMsg->thumbPath;
-}
-
-
-static MSG_ERROR_T msg_mms_release_message(MMS_MESSAGE_DATA_S* msg_data)
-{
-       _MsgMmsReleasePageList(msg_data);
-       _MsgMmsReleaseRegionList(msg_data);
-       _MsgMmsReleaseAttachList(msg_data);
-       _MsgMmsReleaseTransitionList(msg_data);
-       _MsgMmsReleaseMetaList(msg_data);
-       return MSG_SUCCESS;
-}
-
-
-EXPORT_API int msg_mms_set_message_body(msg_message_t opq_msg, const MMS_MESSAGE_DATA_S *msg_data)
-{
-       if (!opq_msg || !msg_data) {
-               MSG_FATAL("msg or msg_data is NULL");
-               return MSG_ERR_NULL_POINTER;
-       }
-
-       MSG_MESSAGE_S* msg = (MSG_MESSAGE_S*) opq_msg;
-
-       if (msg->msgType.mainType != MSG_MMS_TYPE) {
-               MSG_FATAL("msg is not mms type.");
-               return MSG_ERR_INVALID_MSG_TYPE;
-       }
-
-       if (msg->pMmsData) {
-               if (msg->dataSize > 0)
-                       delete[] ((char*) msg->pMmsData);
-       }
-
-       msg->dataSize = 0;
-
-       msg->pMmsData = _MsgMmsSerializeMessageData(msg_data, &(msg->dataSize));
-
-       MSG_DEBUG("msg->dataSize : [%d]", msg->dataSize);
-
-       if (msg->dataSize <= 0) {
-               MSG_FATAL("msg size is invalid");
-               return MSG_ERR_INVALID_PARAMETER;
-       }
-
-       return MSG_SUCCESS;
-}
-
-
-EXPORT_API int msg_mms_get_message_body(msg_message_t opq_msg, MMS_MESSAGE_DATA_S *body )
-{
-       if (!opq_msg || !body) {
-               MSG_FATAL("msg or body is NULL");
-               return MSG_ERR_NULL_POINTER;
-       }
-
-       MSG_MESSAGE_S *msg = (MSG_MESSAGE_S*) opq_msg;
-
-       if (msg->msgType.mainType != MSG_MMS_TYPE) {
-               MSG_FATAL("msg is not mms type.");
-               return MSG_ERR_INVALID_MSG_TYPE;
-       }
-
-       if (msg->pMmsData == NULL) {
-               MSG_FATAL("msg->pMmsData is NULL");
-               return MSG_ERR_NULL_POINTER;
-       }
-
-       _MsgMmsDeserializeMessageData(body, (char*)msg->pMmsData);
-
-       return MSG_SUCCESS;
-}
-
-
-EXPORT_API MMS_PAGE_S* msg_mms_add_page(MMS_MESSAGE_DATA_S *msg_data, const int duration)
-{
-       if(msg_data == NULL)
-               return NULL;
-
-       MMS_PAGE_S* page = (MMS_PAGE_S*)calloc(sizeof(MMS_PAGE_S), 1);
-       page->nDur = duration;
-
-       _MsgMmsAddPage(msg_data, page);
-
-       return page;
-}
-
-
-EXPORT_API MMS_SMIL_REGION* msg_mms_add_region(MMS_MESSAGE_DATA_S *msg_data, const char* szID, const int x, const int y, const int width, const int height, const int bgcolor)
-{
-       if(msg_data == NULL || szID == NULL)
-               return NULL;
-
-       MMS_SMIL_REGION* region = (MMS_SMIL_REGION *)calloc( sizeof(MMS_SMIL_REGION), 1 );
-
-       strncpy(region->szID, szID, MAX_SMIL_REGION_ID-1);
-       region->bgColor = bgcolor;
-       region->nLeft.value = x;
-       region->nLeft.bUnitPercent = true;
-       region->nTop.value = y;
-       region->nTop.bUnitPercent = true;
-       region->width.value = width;
-       region->width.bUnitPercent = true;
-       region->height.value = height;
-       region->height.bUnitPercent = true;
-       region->fit = MMSUI_IMAGE_REGION_FIT_MEET;
-
-       _MsgMmsAddRegion(msg_data, region);
-
-       return region;
-}
-
-
-EXPORT_API MMS_MEDIA_S* msg_mms_add_media(MMS_PAGE_S *page, const MmsSmilMediaType mediatype, const char* regionid, char* filepath)
-{
-       if(page == NULL || filepath == NULL)
-               return NULL;
-
-       if (MsgDrmIsDrmFile(filepath)) {
-               MSG_DRM_TYPE drm_type = MSG_DRM_NONE;
-
-               if (MsgDrmGetDrmType(filepath, &drm_type)) {
-                       if (drm_type == MSG_DRM_FORWARD_LOCK || drm_type == MSG_DRM_COMBINED_DELIVERY) {
-                               MSG_FATAL("file is a FL content");
-                               return NULL;
-                       }
-               }
-       }
-
-       MMS_MEDIA_S* media = (MMS_MEDIA_S *)calloc(sizeof(MMS_MEDIA_S), 1);
-       char *filename = NULL;
-
-       media->mediatype = mediatype;
-
-       if(regionid)
-               strncpy(media->regionId, regionid, MAX_SMIL_REGION_ID-1);
-
-       strncpy(media->szFilePath, filepath, MSG_FILEPATH_LEN_MAX-1);
-
-       filename = strrchr(filepath, '/');
-       strncpy(media->szFileName, filename + 1, MSG_FILENAME_LEN_MAX-1);
-       strncpy(media->szContentID, filename + 1, MSG_MSG_ID_LEN);
-
-       _MsgMmsAddMedia(page, media);
-
-       return media;
-}
-
-
-EXPORT_API MMS_ATTACH_S* msg_mms_add_attachment(MMS_MESSAGE_DATA_S *msg_data, char *filepath)
-{
-       if(msg_data == NULL || filepath == NULL)
-               return NULL;
-
-       if (MsgDrmIsDrmFile(filepath)) {
-               MSG_DRM_TYPE drm_type = MSG_DRM_NONE;
-
-               if (MsgDrmGetDrmType(filepath, &drm_type)) {
-                       if (drm_type == MSG_DRM_FORWARD_LOCK || drm_type == MSG_DRM_COMBINED_DELIVERY) {
-                               MSG_FATAL("file is a FL content");
-                               return NULL;
-                       }
-               }
-       }
-
-       MMS_ATTACH_S* attach = (MMS_ATTACH_S*)calloc(sizeof(MMS_ATTACH_S), 1);
-       char *filename = NULL;
-
-       attach->mediatype = MIME_UNKNOWN;
-       attach->fileSize = -1;
-       strncpy(attach->szFilePath, filepath, MSG_FILEPATH_LEN_MAX-1);
-       filename = strrchr(filepath, '/');
-       strncpy(attach->szFileName, filename + 1, MSG_FILENAME_LEN_MAX-1);
-
-       _MsgMmsAddAttachment(msg_data, attach);
-
-       return attach;
-}
-
-
-EXPORT_API int msg_mms_add_transition(MMS_MESSAGE_DATA_S *msg_data, MMS_SMIL_TRANSITION *transition)
-{
-       if(msg_data == NULL || transition == NULL)
-               return MSG_ERR_NULL_POINTER;
-
-       MMS_SMIL_TRANSITION *pTransition = (MMS_SMIL_TRANSITION *)calloc(sizeof(MMS_SMIL_TRANSITION), 1);
-
-       if (transition->szID[0] != '0')
-               strncpy(pTransition->szID, transition->szID, MAX_SMIL_TRANSITION_ID);
-
-       pTransition->nType = transition->nType;
-       pTransition->nSubType = transition->nSubType;
-       pTransition->nDur = transition->nDur;
-
-       _MsgMmsAddTransition(msg_data, pTransition);
-
-       return MSG_SUCCESS;
-}
-
-
-EXPORT_API int msg_mms_add_meta(MMS_MESSAGE_DATA_S *msg_data, MMS_SMIL_META *meta)
-{
-       if(msg_data == NULL || meta == NULL)
-               return MSG_ERR_NULL_POINTER;
-
-       MMS_SMIL_META *pMeta = (MMS_SMIL_META *)calloc(sizeof(MMS_SMIL_META), 1);
-
-       if (meta->szID[0] != '0')
-               strncpy(pMeta->szID, meta->szID, MAX_SMIL_TRANSITION_ID);
-
-       if (meta->szName[0] != '0')
-               strncpy(pMeta->szName, meta->szName, MAX_SMIL_META_NAME);
-
-       if (meta->szContent[0] != '0')
-               strncpy(pMeta->szContent, meta->szContent, MAX_SMIL_META_NAME);
-
-       _MsgMmsAddMeta(msg_data, pMeta);
-
-       return MSG_SUCCESS;
-}
-
-
-EXPORT_API MMS_PAGE_S *msg_mms_get_page(MMS_MESSAGE_DATA_S *msg_data, int page_idx)
-{
-       if (msg_data == NULL)
-               return NULL;
-
-       if (page_idx < 0)
-               return NULL;
-
-       return _MsgMmsGetPage(msg_data, page_idx);
-}
-
-
-EXPORT_API MMS_SMIL_REGION* msg_mms_get_smil_region(MMS_MESSAGE_DATA_S *msg_data, int region_idx)
-{
-       if (msg_data == NULL)
-               return NULL;
-
-       if (region_idx < 0)
-               return NULL;
-
-       return _MsgMmsGetSmilRegion(msg_data, region_idx);
-}
-
-
-EXPORT_API MMS_MEDIA_S* msg_mms_get_media(MMS_PAGE_S *page, int media_idx)
-{
-       if (page == NULL || media_idx < 0)
-               return NULL;
-
-       return _MsgMmsGetMedia(page, media_idx);
-}
-
-
-EXPORT_API MMS_ATTACH_S* msg_mms_get_attachment(MMS_MESSAGE_DATA_S *msg_data, int attach_idx)
-{
-       if (msg_data == NULL)
-               return NULL;
-
-       if ( attach_idx <0 )
-               return NULL;
-
-       return _MsgMmsGetAttachment(msg_data, attach_idx);
-}
-
-
-EXPORT_API MMS_SMIL_TRANSITION* msg_mms_get_transition(MMS_MESSAGE_DATA_S *msg_data, int transition_idx)
-{
-       if (msg_data == NULL)
-               return NULL;
-
-       if (transition_idx < 0)
-               return NULL;
-
-       return _MsgMmsGetTransition(msg_data, transition_idx);
-}
-
-
-EXPORT_API MMS_SMIL_META* msg_mms_get_meta(MMS_MESSAGE_DATA_S *msg_data, int meta_idx)
-{
-       if (msg_data == NULL)
-               return NULL;
-
-       if (meta_idx < 0)
-               return NULL;
-
-       return _MsgMmsGetMeta(msg_data, meta_idx);
-}
-
-
-EXPORT_API int msg_mms_release_page_list(MMS_MESSAGE_DATA_S *msg_data)
-{
-       if (msg_data == NULL)
-               return MSG_ERR_NULL_POINTER;
-
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = _MsgMmsReleasePageList(msg_data);
-
-       return err;
-}
-
-
-EXPORT_API int msg_mms_release_region_list(MMS_MESSAGE_DATA_S *msg_data)
-{
-       if (msg_data == NULL)
-               return MSG_ERR_NULL_POINTER;
-
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = _MsgMmsReleaseRegionList(msg_data);
-
-       return err;
-}
-
-
-EXPORT_API int msg_mms_release_attachment_list(MMS_MESSAGE_DATA_S *msg_data)
-{
-       if (msg_data == NULL)
-               return MSG_ERR_NULL_POINTER;
-
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = _MsgMmsReleaseAttachList(msg_data);
-
-       return err;
-}
-
-
-EXPORT_API int msg_mms_release_transition_list(MMS_MESSAGE_DATA_S *msg_data)
-{
-       if (msg_data == NULL)
-               return MSG_ERR_NULL_POINTER;
-
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = _MsgMmsReleaseTransitionList(msg_data);
-
-       return err;
-}
-
-
-EXPORT_API int msg_mms_release_meta_list(MMS_MESSAGE_DATA_S *msg_data)
-{
-       if (msg_data == NULL)
-               return MSG_ERR_NULL_POINTER;
-
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       err = _MsgMmsReleaseMetaList(msg_data);
-
-       return err;
-}
-
-
-EXPORT_API MMS_MESSAGE_DATA_S* msg_mms_create_message(void)
-{
-       MMS_MESSAGE_DATA_S *mmsmsg = (MMS_MESSAGE_DATA_S *)calloc(sizeof(MMS_MESSAGE_DATA_S), 1);
-
-       return mmsmsg;
-}
-
-
-EXPORT_API MMS_SMIL_ROOTLAYOUT* msg_mms_set_rootlayout(MMS_MESSAGE_DATA_S* msg, const int width, const int height, const int bgcolor)
-{
-       if (msg == NULL)
-               return NULL;
-
-       msg->rootlayout.width.value = width;
-       msg->rootlayout.width.bUnitPercent = true;
-       msg->rootlayout.height.value = height;
-       msg->rootlayout.height.bUnitPercent = true;
-       msg->rootlayout.bgColor = bgcolor;
-
-       return (MMS_SMIL_ROOTLAYOUT *)&(msg->rootlayout);
-}
-
-
-EXPORT_API int msg_mms_destroy_message(MMS_MESSAGE_DATA_S* msg)
-{
-       if (msg == NULL)
-               return MSG_ERR_NULL_POINTER;
-
-       msg_mms_release_message(msg);
-
-       free(msg);
-
-       msg = NULL;
-
-       return MSG_SUCCESS;
-}
-
diff --git a/mapi/MapiSetting.cpp b/mapi/MapiSetting.cpp
deleted file mode 100755 (executable)
index 385d797..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <errno.h>
-
-#include "MsgHandle.h"
-#include "MsgDebug.h"
-#include "MsgException.h"
-#include "MapiSetting.h"
-
-
-/*==================================================================================================
-                                     FUNCTION IMPLEMENTATION
-==================================================================================================*/
-EXPORT_API int msg_set_config(MSG_HANDLE_T handle, const MSG_SETTING_S *setting)
-{
-       MSG_ERROR_T err =  MSG_SUCCESS;
-
-       if (handle == NULL || setting == NULL)
-       {
-               return -EINVAL;
-       }
-
-       MsgHandle* pHandle = (MsgHandle*)handle;
-
-       try
-       {
-               err = pHandle->setConfig(setting);
-       }
-       catch (MsgException& e)
-       {
-               MSG_FATAL("%s", e.what());
-               return MSG_ERR_SET_WRITE_ERROR;
-       }
-
-       return err;
-}
-
-
-EXPORT_API int msg_get_config(MSG_HANDLE_T handle, MSG_SETTING_S *setting)
-{
-       MSG_ERROR_T err =  MSG_SUCCESS;
-
-       if (handle == NULL || setting == NULL)
-       {
-               return -EINVAL;
-       }
-
-       MsgHandle* pHandle = (MsgHandle*)handle;
-
-       try
-       {
-               err = pHandle->getConfig(setting);
-       }
-       catch (MsgException& e)
-       {
-               MSG_FATAL("%s", e.what());
-               return MSG_ERR_SET_READ_ERROR;
-       }
-
-       return err;
-}
-
diff --git a/mapi/MapiStorage.cpp b/mapi/MapiStorage.cpp
deleted file mode 100755 (executable)
index 9aaba60..0000000
+++ /dev/null
@@ -1,1352 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <errno.h>
-
-#include "MsgHandle.h"
-#include "MsgDebug.h"
-#include "MsgException.h"
-#include "MapiMessage.h"
-#include "MapiStorage.h"
-
-
-/*==================================================================================================
-                                     FUNCTION IMPLEMENTATION
-==================================================================================================*/
-EXPORT_API int msg_add_message(MSG_HANDLE_T handle, const msg_message_t opq_msg, const MSG_SENDINGOPT_S *send_opt)
-{
-       MSG_ERROR_T err =  MSG_SUCCESS;
-
-       if (handle == NULL || opq_msg == NULL || send_opt == NULL)
-       {
-               return -EINVAL;
-       }
-
-       MsgHandle* pHandle = (MsgHandle*)handle;
-       MSG_MESSAGE_S* pMsg = (MSG_MESSAGE_S*) opq_msg;
-
-       try
-       {
-               err = pHandle->addMessage(pMsg, send_opt);
-       }
-       catch (MsgException& e)
-       {
-               MSG_FATAL("%s", e.what());
-               return MSG_ERR_STORAGE_ERROR;
-       }
-
-       return err;
-}
-
-
-EXPORT_API int msg_add_syncml_message(MSG_HANDLE_T handle, const MSG_SYNCML_MESSAGE_S *syncml_msg)
-{
-       MSG_ERROR_T err =  MSG_SUCCESS;
-
-       if (handle == NULL || syncml_msg == NULL)
-       {
-               return -EINVAL;
-       }
-
-       MsgHandle* pHandle = (MsgHandle*)handle;
-
-       try
-       {
-               err = pHandle->addSyncMLMessage(syncml_msg);
-       }
-       catch (MsgException& e)
-       {
-               MSG_FATAL("%s", e.what());
-               return MSG_ERR_STORAGE_ERROR;
-       }
-
-       return err;
-}
-
-
-EXPORT_API int msg_update_message(MSG_HANDLE_T handle, const msg_message_t opq_msg, const MSG_SENDINGOPT_S *send_opt)
-{
-       MSG_ERROR_T err =  MSG_SUCCESS;
-
-       if (handle == NULL || opq_msg == NULL || send_opt == NULL)
-       {
-               return -EINVAL;
-       }
-
-       MsgHandle* pHandle = (MsgHandle*)handle;
-       MSG_MESSAGE_S* pMsg = (MSG_MESSAGE_S*) opq_msg;
-
-       if (pMsg->nAddressCnt > 1)
-       {
-               MSG_DEBUG("Multiple Address cannot be updated [%d]", pMsg->nAddressCnt);
-               return -EINVAL;
-       }
-
-       try
-       {
-               err = pHandle->updateMessage(pMsg, send_opt);
-       }
-       catch (MsgException& e)
-       {
-               MSG_FATAL("%s", e.what());
-               return MSG_ERR_STORAGE_ERROR;
-       }
-
-       return err;
-}
-
-
-EXPORT_API int msg_update_read_status(MSG_HANDLE_T handle, MSG_MESSAGE_ID_T msg_id, bool read)
-{
-       MSG_ERROR_T err =  MSG_SUCCESS;
-
-       if (handle == NULL)
-       {
-               return -EINVAL;
-       }
-
-       MsgHandle* pHandle = (MsgHandle*)handle;
-
-       try
-       {
-               err = pHandle->updateReadStatus(msg_id, read);
-       }
-       catch (MsgException& e)
-       {
-               MSG_FATAL("%s", e.what());
-               return MSG_ERR_STORAGE_ERROR;
-       }
-
-       return err;
-}
-
-
-EXPORT_API int msg_update_protected_status(MSG_HANDLE_T handle, MSG_MESSAGE_ID_T msg_id, bool is_protected)
-{
-       MSG_ERROR_T err =  MSG_SUCCESS;
-
-       if (handle == NULL)
-       {
-               return -EINVAL;
-       }
-
-       MsgHandle* pHandle = (MsgHandle*)handle;
-
-       try
-       {
-               err = pHandle->updateProtectedStatus(msg_id, is_protected);
-       }
-       catch (MsgException& e)
-       {
-               MSG_FATAL("%s", e.what());
-               return MSG_ERR_STORAGE_ERROR;
-       }
-
-       return err;
-}
-
-
-EXPORT_API int msg_delete_message(MSG_HANDLE_T handle, MSG_MESSAGE_ID_T msg_id)
-{
-       MSG_ERROR_T err =  MSG_SUCCESS;
-
-       if (handle == NULL)
-       {
-               return -EINVAL;
-       }
-
-       MsgHandle* pHandle = (MsgHandle*)handle;
-
-       try
-       {
-               err = pHandle->deleteMessage(msg_id);
-       }
-       catch (MsgException& e)
-       {
-               MSG_FATAL("%s", e.what());
-               return MSG_ERR_STORAGE_ERROR;
-       }
-
-       return err;
-}
-
-
-EXPORT_API int msg_delete_all_msgs_in_folder(MSG_HANDLE_T handle, MSG_FOLDER_ID_T folder_id, bool bOnlyDB)
-{
-       MSG_ERROR_T err =  MSG_SUCCESS;
-
-       if (handle == NULL)
-       {
-               return -EINVAL;
-       }
-
-       MsgHandle* pHandle = (MsgHandle*)handle;
-
-       try
-       {
-               err = pHandle->deleteAllMessagesInFolder(folder_id, bOnlyDB);
-       }
-       catch (MsgException& e)
-       {
-               MSG_FATAL("%s", e.what());
-               return MSG_ERR_STORAGE_ERROR;
-       }
-
-       return err;
-}
-
-
-EXPORT_API int msg_move_msg_to_folder(MSG_HANDLE_T handle, MSG_MESSAGE_ID_T msg_id, MSG_FOLDER_ID_T dest_folder_id)
-{
-       MSG_ERROR_T err =  MSG_SUCCESS;
-
-       if (handle == NULL)
-       {
-               return -EINVAL;
-       }
-
-       MsgHandle* pHandle = (MsgHandle*)handle;
-
-       try
-       {
-               err = pHandle->moveMessageToFolder(msg_id, dest_folder_id);
-       }
-       catch (MsgException& e)
-       {
-               MSG_FATAL("%s", e.what());
-               return MSG_ERR_STORAGE_ERROR;
-       }
-
-       return err;
-}
-
-
-EXPORT_API int msg_move_msg_to_storage(MSG_HANDLE_T handle, MSG_MESSAGE_ID_T msg_id, MSG_STORAGE_ID_T storage_id)
-{
-       MSG_ERROR_T err =  MSG_SUCCESS;
-
-       if (handle == NULL)
-       {
-               return -EINVAL;
-       }
-
-       if (storage_id != MSG_STORAGE_PHONE && storage_id != MSG_STORAGE_SIM)
-       {
-               MSG_FATAL("unsupported storage [%d]", storage_id);
-               return MSG_ERR_INVALID_PARAMETER;
-       }
-
-       MsgHandle* pHandle = (MsgHandle*)handle;
-
-       try
-       {
-               err = pHandle->moveMessageToStorage(msg_id, storage_id);
-       }
-       catch (MsgException& e)
-       {
-               MSG_FATAL("%s", e.what());
-               return MSG_ERR_STORAGE_ERROR;
-       }
-
-       return err;
-}
-
-
-EXPORT_API int msg_count_message(MSG_HANDLE_T handle, MSG_FOLDER_ID_T folder_id, MSG_COUNT_INFO_S *count_info)
-{
-       MSG_ERROR_T err =  MSG_SUCCESS;
-
-       if (handle == NULL)
-       {
-               return -EINVAL;
-       }
-
-       MsgHandle* pHandle = (MsgHandle*)handle;
-
-       try
-       {
-               err = pHandle->countMessage(folder_id, count_info);
-       }
-       catch (MsgException& e)
-       {
-               MSG_FATAL("%s", e.what());
-               return MSG_ERR_STORAGE_ERROR;
-       }
-
-       return err;
-}
-
-
-EXPORT_API int msg_count_msg_by_type(MSG_HANDLE_T handle, MSG_MESSAGE_TYPE_T msg_type, int *msg_count)
-{
-       MSG_ERROR_T err =  MSG_SUCCESS;
-
-       if (handle == NULL)
-       {
-               return -EINVAL;
-       }
-
-       MsgHandle* pHandle = (MsgHandle*)handle;
-
-       MSG_MESSAGE_TYPE_S msgType = {0};
-
-       if (msg_type == MSG_TYPE_SMS)
-       {
-               msgType.mainType = MSG_SMS_TYPE;
-               msgType.subType = MSG_NORMAL_SMS;
-       }
-       else if (msg_type == MSG_TYPE_SMS_WAPPUSH)
-       {
-               msgType.mainType = MSG_SMS_TYPE;
-               msgType.subType = MSG_WAP_SI_SMS;
-       }
-       else if (msg_type == MSG_TYPE_MMS)
-       {
-               msgType.mainType = MSG_MMS_TYPE;
-               msgType.subType = MSG_SENDREQ_MMS;
-       }
-
-       try
-       {
-               err = pHandle->countMsgByType(&msgType, msg_count);
-       }
-       catch (MsgException& e)
-       {
-               MSG_FATAL("%s", e.what());
-               return MSG_ERR_STORAGE_ERROR;
-       }
-
-       return err;
-}
-
-
-EXPORT_API int msg_count_msg_by_contact(MSG_HANDLE_T handle, const MSG_THREAD_LIST_INDEX_S *addr_info, MSG_THREAD_COUNT_INFO_S *msg_thread_count_list)
-{
-       MSG_ERROR_T err =  MSG_SUCCESS;
-
-       if (handle == NULL || addr_info == NULL)
-       {
-               return -EINVAL;
-       }
-
-       MsgHandle* pHandle = (MsgHandle*)handle;
-
-       try
-       {
-               err = pHandle->countMsgByContact(addr_info, msg_thread_count_list);
-       }
-       catch (MsgException& e)
-       {
-               MSG_FATAL("%s", e.what());
-               return MSG_ERR_STORAGE_ERROR;
-       }
-
-       return err;
-}
-
-
-EXPORT_API int msg_get_message(MSG_HANDLE_T handle, MSG_MESSAGE_ID_T msg_id, msg_message_t opq_msg, MSG_SENDINGOPT_S *send_opt)
-{
-       MSG_ERROR_T err =  MSG_SUCCESS;
-
-       if (handle == NULL || !opq_msg)
-       {
-               MSG_FATAL("handle or opq_msg is NULL");
-               return -EINVAL;
-       }
-
-       MsgHandle* pHandle = (MsgHandle*)handle;
-       MSG_MESSAGE_S* pMsg = (MSG_MESSAGE_S*) opq_msg;
-
-       try
-       {
-               err = pHandle->getMessage(msg_id, pMsg, send_opt);
-       }
-       catch (MsgException& e)
-       {
-               MSG_FATAL("%s", e.what());
-               return MSG_ERR_STORAGE_ERROR;
-       }
-
-       return err;
-}
-
-
-EXPORT_API int msg_get_folder_view_list(MSG_HANDLE_T handle, MSG_FOLDER_ID_T folder_id, const MSG_SORT_RULE_S *sort_rule, MSG_LIST_S *msg_folder_view_list)
-{
-       MSG_ERROR_T err =  MSG_SUCCESS;
-
-       if (handle == NULL)
-       {
-               return -EINVAL;
-       }
-
-       MsgHandle* pHandle = (MsgHandle*)handle;
-
-       try
-       {
-               if (sort_rule == NULL)
-               {
-                       MSG_SORT_RULE_S sortRule = {0};
-
-                       sortRule.sortType = MSG_SORT_BY_READ_STATUS;
-                       sortRule.bAscending = true;
-
-                       err = pHandle->getFolderViewList(folder_id, &sortRule, msg_folder_view_list);
-               }
-               else
-               {
-               err = pHandle->getFolderViewList(folder_id, sort_rule, msg_folder_view_list);
-       }
-       }
-       catch (MsgException& e)
-       {
-               MSG_FATAL("%s", e.what());
-               return MSG_ERR_STORAGE_ERROR;
-       }
-
-       return err;
-}
-
-
-EXPORT_API int msg_get_thread_view_list(MSG_HANDLE_T handle, const MSG_SORT_RULE_S *sort_rule, MSG_THREAD_VIEW_LIST_S *msg_thread_view_list)
-{
-       MSG_ERROR_T err =  MSG_SUCCESS;
-
-       if (handle == NULL)
-       {
-               return -EINVAL;
-       }
-
-       MsgHandle* pHandle = (MsgHandle*)handle;
-
-       try
-       {
-               if (sort_rule == NULL)
-               {
-                       MSG_SORT_RULE_S sortRule = {0};
-
-                       sortRule.sortType = MSG_SORT_BY_THREAD_DATE;
-                       sortRule.bAscending = false;
-
-                       err = pHandle->getThreadViewList(&sortRule, msg_thread_view_list);
-               }
-               else
-               {
-                       err = pHandle->getThreadViewList(sort_rule, msg_thread_view_list);
-               }
-       }
-       catch (MsgException& e)
-       {
-               MSG_FATAL("%s", e.what());
-               return MSG_ERR_STORAGE_ERROR;
-       }
-
-       return err;
-}
-
-
-EXPORT_API void msg_release_thread_view_list(MSG_THREAD_VIEW_LIST_S *msg_thread_view_list)
-{
-       if (msg_thread_view_list == NULL)
-       {
-               return;
-       }
-
-       // Memory Free
-       if(msg_thread_view_list->msgThreadInfo != NULL)
-       {
-               if(msg_thread_view_list->nCount > 0)
-               {
-                       for(int i=0; i<msg_thread_view_list->nCount; i++)
-                               delete [] (MSG_THREAD_VIEW_S*)msg_thread_view_list->msgThreadInfo[i];
-               }
-
-               //free peer info list
-               delete [] msg_thread_view_list->msgThreadInfo;
-               msg_thread_view_list->msgThreadInfo = NULL;
-       }
-
-       msg_thread_view_list->nCount = 0;
-}
-
-
-EXPORT_API int msg_get_conversation_view_list(MSG_HANDLE_T handle, MSG_THREAD_ID_T thread_id, MSG_LIST_S *msg_conv_view_list)
-{
-       MSG_ERROR_T err =  MSG_SUCCESS;
-
-       if (handle == NULL)
-       {
-               return -EINVAL;
-       }
-
-       MsgHandle* pHandle = (MsgHandle*)handle;
-
-       try
-       {
-               err = pHandle->getConversationViewList(thread_id, msg_conv_view_list);
-       }
-       catch (MsgException& e)
-       {
-               MSG_FATAL("%s", e.what());
-               return MSG_ERR_STORAGE_ERROR;
-       }
-
-       return err;
-}
-
-
-EXPORT_API int msg_delete_thread_message_list(MSG_HANDLE_T handle, MSG_THREAD_ID_T thread_id)
-{
-       MSG_ERROR_T err =  MSG_SUCCESS;
-
-       if (handle == NULL)
-       {
-               return -EINVAL;
-       }
-
-       MsgHandle* pHandle = (MsgHandle*)handle;
-
-       try
-       {
-               err = pHandle->deleteThreadMessageList(thread_id);
-       }
-       catch (MsgException& e)
-       {
-               MSG_FATAL("%s", e.what());
-               return MSG_ERR_STORAGE_ERROR;
-       }
-
-       return err;
-}
-
-
-EXPORT_API int msg_add_folder(MSG_HANDLE_T handle, const MSG_FOLDER_INFO_S *folder_info)
-{
-       MSG_ERROR_T err =  MSG_SUCCESS;
-
-       if (handle == NULL || folder_info == NULL)
-       {
-               return -EINVAL;
-       }
-
-       MsgHandle* pHandle = (MsgHandle*)handle;
-
-       try
-       {
-               err = pHandle->addFolder(folder_info);
-       }
-       catch (MsgException& e)
-       {
-               MSG_FATAL("%s", e.what());
-               return MSG_ERR_STORAGE_ERROR;
-       }
-
-       return err;
-}
-
-
-EXPORT_API int msg_update_folder(MSG_HANDLE_T handle, const MSG_FOLDER_INFO_S *folder_info)
-{
-       MSG_ERROR_T err =  MSG_SUCCESS;
-
-       if (handle == NULL || folder_info == NULL)
-       {
-               return -EINVAL;
-       }
-
-       MsgHandle* pHandle = (MsgHandle*)handle;
-
-       try
-       {
-               err = pHandle->updateFolder(folder_info);
-       }
-       catch (MsgException& e)
-       {
-               MSG_FATAL("%s", e.what());
-               return MSG_ERR_STORAGE_ERROR;
-       }
-
-       return err;
-}
-
-
-EXPORT_API int msg_delete_folder(MSG_HANDLE_T handle, MSG_FOLDER_ID_T folder_id)
-{
-       MSG_ERROR_T err =  MSG_SUCCESS;
-
-       if (handle == NULL)
-       {
-               return -EINVAL;
-       }
-
-       MsgHandle* pHandle = (MsgHandle*)handle;
-
-       try
-       {
-               err = pHandle->deleteFolder(folder_id);
-       }
-       catch (MsgException& e)
-       {
-               MSG_FATAL("%s", e.what());
-               return MSG_ERR_STORAGE_ERROR;
-       }
-
-       return err;
-}
-
-
-EXPORT_API int msg_get_folder_list(MSG_HANDLE_T handle, MSG_FOLDER_LIST_S *folder_list)
-{
-       MSG_ERROR_T err =  MSG_SUCCESS;
-
-       if (handle == NULL)
-       {
-               return -EINVAL;
-       }
-
-       MsgHandle* pHandle = (MsgHandle*)handle;
-
-       try
-       {
-               err = pHandle->getFolderList(folder_list);
-       }
-       catch (MsgException& e)
-       {
-               MSG_FATAL("%s", e.what());
-               return MSG_ERR_STORAGE_ERROR;
-       }
-
-       return err;
-}
-
-
-EXPORT_API void msg_release_folder_list(MSG_FOLDER_LIST_S *folder_list)
-{
-       if (folder_list == NULL)
-       {
-               return;
-       }
-
-       // Memory Free
-       if (folder_list->folderInfo != NULL)
-       {
-               free(folder_list->folderInfo);
-               folder_list->folderInfo = NULL;
-       }
-
-       folder_list->nCount = 0;
-}
-
-
-EXPORT_API int msg_generate_message(MSG_HANDLE_T handle, MSG_MESSAGE_TYPE_T msg_type, MSG_FOLDER_ID_T folder_id, unsigned int num_msg)
-{
-       if (handle == NULL)
-       {
-               MSG_DEBUG("Handle is NULL");
-               return -EINVAL;
-       }
-
-       if (folder_id >= MSG_MAX_FOLDER_ID)
-       {
-               MSG_DEBUG("folderId is invalid [%d]", folder_id);
-               return -EINVAL;
-       }
-
-       MSG_DEBUG("type : %d, folder : %d, num_msg : %d", msg_type, folder_id, num_msg);
-
-       int err = 0;
-       MSG_SENDINGOPT_S sendingOpt = {0};
-       sendingOpt.bSetting = false;
-
-       char strMsg[20] = {0};
-       char prefix[10] ="0103001";
-//     int postfix = 8111;
-       int postfix = 0;
-
-       srand(getpid());
-       // Make Message
-       MSG_MESSAGE_S msgInfo = {0, };  //structure is used to enhance performance
-
-       for (unsigned int i = 0; i < num_msg; i++)
-       {
-               bzero(&msgInfo, sizeof(MSG_MESSAGE_S));
-
-               msgInfo.msgId   = 0; // It should be set 0
-               msgInfo.folderId = folder_id;
-
-               if (msg_type == MSG_TYPE_MMS)
-               {
-                       msgInfo.msgType.mainType = MSG_MMS_TYPE;
-                       //msgInfo.msgType.subType = MSG_RETRIEVE_MMS;
-                       msgInfo.msgType.subType = MSG_SENDREQ_MMS;
-               }
-               else
-               {
-                       msgInfo.msgType.mainType = MSG_SMS_TYPE;
-                       msgInfo.msgType.subType = MSG_NORMAL_SMS;
-
-                       snprintf(strMsg, sizeof(strMsg), "test msg %d", i);
-                       msgInfo.dataSize = strlen(strMsg);
-                       msgInfo.pData = strMsg;
-               }
-
-               msgInfo.storageId = MSG_STORAGE_PHONE;
-
-               msgInfo.nAddressCnt = 1;
-
-               msgInfo.addressList[0].addressType = MSG_ADDRESS_TYPE_PLMN;
-
-               postfix = rand()%10000;
-               snprintf(msgInfo.addressList[0].addressVal, MAX_ADDRESS_VAL_LEN+1, "%s%04d", prefix, postfix);
-
-               msgInfo.addressList[0].recipientType = MSG_RECIPIENTS_TYPE_TO;
-
-               time(&(msgInfo.displayTime));
-
-               msgInfo.networkStatus = MSG_NETWORK_NOT_SEND;
-               msgInfo.bRead = false;
-               msgInfo.bProtected = false;
-               msgInfo.priority = MSG_MESSAGE_PRIORITY_NORMAL;
-
-               if (folder_id == MSG_OUTBOX_ID || folder_id == MSG_SENTBOX_ID)
-                       msgInfo.direction = MSG_DIRECTION_TYPE_MO;
-               else
-                       msgInfo.direction = MSG_DIRECTION_TYPE_MT;
-
-               if (msg_type == MSG_TYPE_MMS)
-               {
-                       snprintf(msgInfo.subject, MAX_SUBJECT_LEN+1, "subject %d", i);
-
-                       if(folder_id == MSG_INBOX_ID) msgInfo.networkStatus = MSG_NETWORK_RETRIEVE_SUCCESS;
-
-                       MMS_MESSAGE_DATA_S* mms_data;
-                       MMS_PAGE_S* page[2];
-                       MMS_MEDIA_S* media[5];
-
-                       mms_data = msg_mms_create_message();
-
-                       msg_mms_set_rootlayout(mms_data, 100, 100, 0xffffff);
-                       msg_mms_add_region(mms_data, "Image", 0, 50, 100, 50, 0xffffff);
-                       msg_mms_add_region(mms_data, "Text", 0, 0, 100, 50, 0xffffff);
-
-                       //------------>  1st Slide Composing
-                       page[0] = msg_mms_add_page(mms_data, 5440);
-
-                       media[0] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_IMG, "Image", (char*)"/opt/etc/msg-service/P091120_104633.jpg");
-                       media[1] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_AUDIO, NULL, (char*)"/opt/etc/msg-service/audio.amr");
-                       media[2] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_TEXT, "Text", (char*)"/opt/etc/msg-service/Temp0_2.txt");
-                       media[2]->sMedia.sText.nColor = 0x000000;
-                       media[2]->sMedia.sText.nSize = MMS_SMIL_FONT_SIZE_NORMAL;
-                       media[2]->sMedia.sText.bBold = true;
-
-                       //------------>  2nd Slide Composing
-                       page[1] = msg_mms_add_page(mms_data, 4544);
-
-                       media[3] = msg_mms_add_media(page[1], MMS_SMIL_MEDIA_TEXT, "Text", (char*)"/opt/etc/msg-service/Temp1_0.txt");
-                       media[3]->sMedia.sText.nColor = 0x000000;
-                       media[3]->sMedia.sText.nSize = MMS_SMIL_FONT_SIZE_NORMAL;
-                       media[3]->sMedia.sText.bItalic = true;
-                       media[4] = msg_mms_add_media(page[1], MMS_SMIL_MEDIA_VIDEO, "Text", (char*)"/opt/etc/msg-service/V091120_104905.3gp");
-                       strncpy(media[4]->szAlt, "Video Load Fail", MAX_SMIL_ALT_LEN-1);
-
-                       msg_mms_set_message_body((msg_message_t)&msgInfo, mms_data);
-
-                       msg_mms_destroy_message(mms_data);
-               }
-
-               err = msg_add_message(handle, (msg_message_t)&msgInfo, &sendingOpt);
-
-               if (msg_type == MSG_TYPE_MMS && msgInfo.pMmsData) //free pMmsData directly. It is added to enhance performance
-                       delete [] static_cast<char*>(msgInfo.pMmsData);
-
-               if (err < 0)
-               {
-                       MSG_DEBUG("err [%d]", err);
-                       return err;
-               }
-       }
-
-       return MSG_SUCCESS;
-}
-
-
-EXPORT_API int msg_generate_sms(MSG_HANDLE_T handle, MSG_FOLDER_ID_T folder_id, unsigned int num_msg)
-{
-       MSG_DEBUG("folder %d, num_msg %d", folder_id, num_msg);
-
-       if (handle == NULL)
-       {
-               MSG_DEBUG("Handle is NULL");
-               return -EINVAL;
-       }
-
-       if (folder_id >= MSG_MAX_FOLDER_ID)
-       {
-               MSG_DEBUG("folderId is invalid");
-               return -EINVAL;
-       }
-
-       int err = 0;
-
-       // Make Message
-       MSG_MESSAGE_S msgInfo = {0};
-       char strMsg[20] = {0};
-
-       char prefix[10] ="0103001";
-       int postfix = 0;
-
-       MSG_SENDINGOPT_S sendingOpt = {0};
-       sendingOpt.bSetting = false;
-
-       srand(getpid());
-
-       for (unsigned int i = 0; i < num_msg; i++)
-       {
-               bzero(&msgInfo, sizeof(msgInfo));
-               msgInfo.msgId   = 0; // It should be set 0
-               msgInfo.folderId = folder_id;
-
-               msgInfo.msgType.mainType = MSG_SMS_TYPE;
-               msgInfo.msgType.subType = 0;
-
-               msgInfo.storageId = MSG_STORAGE_PHONE;
-
-               snprintf(strMsg, sizeof(strMsg), "test %d", i);
-               msgInfo.dataSize = strlen(strMsg);
-               msgInfo.pData = strMsg;
-
-               msgInfo.addressList[0].addressType = MSG_ADDRESS_TYPE_PLMN;
-               postfix = rand()%10000;
-               snprintf(msgInfo.addressList[0].addressVal, MAX_ADDRESS_VAL_LEN+1, "%s%04d", prefix, postfix);
-               msgInfo.addressList[0].recipientType = MSG_RECIPIENTS_TYPE_TO;
-               msgInfo.nAddressCnt = 1;
-
-               time(&(msgInfo.displayTime));
-
-               msgInfo.networkStatus = MSG_NETWORK_NOT_SEND;
-               msgInfo.bRead = false;
-               msgInfo.bProtected = false;
-               msgInfo.priority = MSG_MESSAGE_PRIORITY_NORMAL;
-               msgInfo.direction = MSG_DIRECTION_TYPE_MO;
-
-               err = msg_add_message(handle, (msg_message_t) &msgInfo, &sendingOpt);
-
-               if (err < 0)
-               {
-                       MSG_DEBUG("err [%d]", err);
-                       return err;
-               }
-       }
-
-       return MSG_SUCCESS;
-}
-
-
-EXPORT_API int msg_get_quick_panel_data(MSG_HANDLE_T handle, MSG_QUICKPANEL_TYPE_T type, msg_message_t opq_msg)
-{
-       MSG_ERROR_T err =  MSG_SUCCESS;
-
-       if (handle == NULL || !opq_msg )
-       {
-               MSG_FATAL("handle or opq_msg is NULL");
-               return -EINVAL;
-       }
-
-       MsgHandle* pHandle = (MsgHandle*)handle;
-       MSG_MESSAGE_S* pMsg = (MSG_MESSAGE_S*) opq_msg;
-
-       try
-       {
-               err = pHandle->getQuickPanelData(type, pMsg);
-       }
-       catch (MsgException& e)
-       {
-               MSG_FATAL("%s", e.what());
-               return MSG_ERR_STORAGE_ERROR;
-       }
-
-       return err;
-}
-
-
-EXPORT_API int msg_reset_database(MSG_HANDLE_T handle)
-{
-       MSG_ERROR_T err =  MSG_SUCCESS;
-
-       if (handle == NULL)
-       {
-               return -EINVAL;
-       }
-
-       MsgHandle* pHandle = (MsgHandle*)handle;
-
-       try
-       {
-               err = pHandle->resetDatabase();
-       }
-       catch (MsgException& e)
-       {
-               MSG_FATAL("%s", e.what());
-               return MSG_ERR_STORAGE_ERROR;
-       }
-
-       return err;
-}
-
-
-EXPORT_API int msg_get_mem_size(MSG_HANDLE_T handle, unsigned int* memsize)
-{
-       MSG_ERROR_T err =  MSG_SUCCESS;
-
-       if (handle == NULL)
-       {
-               return -EINVAL;
-       }
-
-       MsgHandle* pHandle = (MsgHandle*)handle;
-
-       try
-       {
-               err = pHandle->getMemSize(memsize);
-       }
-       catch (MsgException& e)
-       {
-               MSG_FATAL("%s", e.what());
-               return MSG_ERR_STORAGE_ERROR;
-       }
-
-       return err;
-
-}
-
-
-EXPORT_API int msg_thread_view_get_thread_id(msg_thread_view_t msg_thread)
-{
-       if (msg_thread == NULL)
-       {
-               MSG_FATAL("msg_thread is NULL");
-               return -EINVAL;
-       }
-
-       MSG_THREAD_VIEW_S* pMsg = (MSG_THREAD_VIEW_S*)msg_thread;
-
-       return pMsg->threadId;
-}
-
-
-EXPORT_API const char* msg_thread_view_get_address(msg_thread_view_t msg_thread)
-{
-       if (msg_thread == NULL)
-       {
-               MSG_FATAL("msg_thread is NULL");
-               return NULL;
-       }
-
-       MSG_THREAD_VIEW_S* pMsg = (MSG_THREAD_VIEW_S*)msg_thread;
-
-       return pMsg->threadAddr;
-}
-
-
-EXPORT_API const char* msg_thread_view_get_name(msg_thread_view_t msg_thread)
-{
-       if (msg_thread == NULL)
-       {
-               MSG_FATAL("msg_thread is NULL");
-               return NULL;
-       }
-
-       MSG_THREAD_VIEW_S* pMsg = (MSG_THREAD_VIEW_S*)msg_thread;
-
-       return pMsg->threadName;
-}
-
-
-EXPORT_API const char* msg_thread_view_get_image_path(msg_thread_view_t msg_thread)
-{
-       if (msg_thread == NULL)
-       {
-               MSG_FATAL("msg_thread is NULL");
-               return NULL;
-       }
-
-       MSG_THREAD_VIEW_S* pMsg = (MSG_THREAD_VIEW_S*)msg_thread;
-
-       return pMsg->threadImagePath;
-}
-
-
-EXPORT_API int msg_thread_view_get_message_type(msg_thread_view_t msg_thread)
-{
-       if (msg_thread == NULL)
-       {
-               MSG_FATAL("msg_thread is NULL");
-               return -EINVAL;
-       }
-
-       MSG_THREAD_VIEW_S* pMsg = (MSG_THREAD_VIEW_S*)msg_thread;
-
-       if (pMsg->threadType.mainType == MSG_SMS_TYPE)
-       {
-               if (pMsg->threadType.subType == MSG_CB_SMS)
-                       return MSG_TYPE_SMS_CB;
-               else    if (pMsg->threadType.subType == MSG_JAVACB_SMS)
-                       return MSG_TYPE_SMS_JAVACB;
-               else    if (pMsg->threadType.subType == MSG_WAP_SI_SMS || pMsg->threadType.subType == MSG_WAP_SL_SMS)
-                       return MSG_TYPE_SMS_WAPPUSH;
-               else    if (pMsg->threadType.subType == MSG_MWI_VOICE_SMS || pMsg->threadType.subType == MSG_MWI_FAX_SMS
-                               || pMsg->threadType.subType == MSG_MWI_EMAIL_SMS || pMsg->threadType.subType == MSG_MWI_OTHER_SMS)
-                       return MSG_TYPE_SMS_MWI;
-               else    if (pMsg->threadType.subType == MSG_SYNCML_CP)
-                       return MSG_TYPE_SMS_SYNCML;
-               else    if (pMsg->threadType.subType == MSG_REJECT_SMS)
-                       return MSG_TYPE_SMS_REJECT;
-               else
-                       return MSG_TYPE_SMS;
-       }
-       else if (pMsg->threadType.mainType == MSG_MMS_TYPE)
-       {
-               if (pMsg->threadType.subType == MSG_NOTIFICATIONIND_MMS)
-                       return MSG_TYPE_MMS_NOTI;
-               else if (pMsg->threadType.subType == MSG_SENDREQ_JAVA_MMS)
-                       return MSG_TYPE_MMS_JAVA;
-               else
-                       return MSG_TYPE_MMS;
-       }
-       else
-               return MSG_TYPE_INVALID;
-}
-
-
-EXPORT_API const char* msg_thread_view_get_data(msg_thread_view_t msg_thread)
-{
-       if (msg_thread == NULL)
-       {
-               MSG_FATAL("msg_thread is NULL");
-               return NULL;
-       }
-
-       MSG_THREAD_VIEW_S* pMsg = (MSG_THREAD_VIEW_S*)msg_thread;
-
-       return pMsg->threadData;
-}
-
-
-EXPORT_API time_t* msg_thread_view_get_time(msg_thread_view_t msg_thread)
-{
-       if (msg_thread == NULL)
-       {
-               MSG_FATAL("msg_thread is NULL");
-               return NULL;
-       }
-
-       MSG_THREAD_VIEW_S* pMsg = (MSG_THREAD_VIEW_S*)msg_thread;
-
-       return &(pMsg->threadTime);
-}
-
-
-EXPORT_API int msg_thread_view_get_direction(msg_thread_view_t msg_thread)
-{
-       if (msg_thread == NULL)
-       {
-               MSG_FATAL("msg_thread is NULL");
-               return -EINVAL;
-       }
-
-       MSG_THREAD_VIEW_S* pMsg = (MSG_THREAD_VIEW_S*)msg_thread;
-
-       return pMsg->direction;
-}
-
-
-EXPORT_API int msg_thread_view_get_contact_id(msg_thread_view_t msg_thread)
-{
-       if (msg_thread == NULL)
-       {
-               MSG_FATAL("msg_thread is NULL");
-               return -EINVAL;
-       }
-
-       MSG_THREAD_VIEW_S* pMsg = (MSG_THREAD_VIEW_S*)msg_thread;
-
-       return pMsg->contactId;
-}
-
-
-EXPORT_API int msg_thread_view_get_unread_cnt(msg_thread_view_t msg_thread)
-{
-       if (msg_thread == NULL)
-       {
-               MSG_FATAL("msg_thread is NULL");
-               return -EINVAL;
-       }
-
-       MSG_THREAD_VIEW_S* pMsg = (MSG_THREAD_VIEW_S*)msg_thread;
-
-       return pMsg->unreadCnt;
-}
-
-
-EXPORT_API int msg_thread_view_get_sms_cnt(msg_thread_view_t msg_thread)
-{
-       if (msg_thread == NULL)
-       {
-               MSG_FATAL("msg_thread is NULL");
-               return -EINVAL;
-       }
-
-       MSG_THREAD_VIEW_S* pMsg = (MSG_THREAD_VIEW_S*)msg_thread;
-
-       return pMsg->smsCnt;
-}
-
-
-EXPORT_API int msg_thread_view_get_mms_cnt(msg_thread_view_t msg_thread)
-{
-       if (msg_thread == NULL)
-       {
-               MSG_FATAL("msg_thread is NULL");
-               return -EINVAL;
-       }
-
-       MSG_THREAD_VIEW_S* pMsg = (MSG_THREAD_VIEW_S*)msg_thread;
-
-       return pMsg->mmsCnt;
-}
-
-
-EXPORT_API int msg_search_message_for_thread_view(MSG_HANDLE_T handle, const char *search_string, MSG_THREAD_VIEW_LIST_S *msg_thread_view_list)
-{
-       MSG_ERROR_T err =  MSG_SUCCESS;
-
-       if (handle == NULL || search_string == NULL)
-       {
-               return -EINVAL;
-       }
-
-       if (strlen(search_string) <= 0 || strlen(search_string) > MAX_MSG_TEXT_LEN)
-       {
-               return -EINVAL;
-       }
-
-       MsgHandle* pHandle = (MsgHandle*)handle;
-
-       try
-       {
-               err = pHandle->searchMessage(search_string, msg_thread_view_list);
-       }
-       catch (MsgException& e)
-       {
-               MSG_FATAL("%s", e.what());
-               return MSG_ERR_STORAGE_ERROR;
-       }
-
-       return err;
-}
-
-
-EXPORT_API int msg_search_message(MSG_HANDLE_T handle, const MSG_SEARCH_CONDITION_S *msg_search_conditions, int offset, int limit, MSG_LIST_S *msg_list)
-{
-       MSG_ERROR_T err =  MSG_SUCCESS;
-
-       if (handle == NULL || msg_search_conditions == NULL)
-       {
-               return -EINVAL;
-       }
-
-       MsgHandle* pHandle = (MsgHandle*)handle;
-
-       try
-       {
-               err = pHandle->searchMessage(msg_search_conditions, offset, limit, msg_list);
-       }
-       catch (MsgException& e)
-       {
-               MSG_FATAL("%s", e.what());
-               return MSG_ERR_STORAGE_ERROR;
-       }
-
-       return err;
-}
-
-
-EXPORT_API int msg_release_message_list(MSG_LIST_S *msg_list)
-{
-       if (msg_list == NULL)
-       {
-               MSG_FATAL("msg_list is NULL");
-               return MSG_ERR_NULL_POINTER;
-       }
-
-
-       // Memory Free
-       if (msg_list->msgInfo!= NULL)
-       {
-               if(msg_list->nCount > 0)
-               {
-                       for(int i=0; i<msg_list->nCount; i++)
-                               msg_release_message(&(msg_list->msgInfo[i]));
-               }
-
-               delete [] msg_list->msgInfo;
-               msg_list->msgInfo = NULL;
-       }
-
-       msg_list->nCount = 0;
-
-       return MSG_SUCCESS;
-}
-
-
-EXPORT_API int msg_get_msgid_list(MSG_HANDLE_T handle, MSG_REFERENCE_ID_T ref_id, MSG_MSGID_LIST_S *msg_msgid_list)
-{
-       MSG_ERROR_T err =  MSG_SUCCESS;
-
-       if (handle == NULL)
-       {
-               return -EINVAL;
-       }
-
-       MsgHandle* pHandle = (MsgHandle*)handle;
-
-       try
-       {
-               err = pHandle->getMsgIdList(ref_id, msg_msgid_list);
-       }
-       catch (MsgException& e)
-       {
-               MSG_FATAL("%s", e.what());
-               return MSG_ERR_STORAGE_ERROR;
-       }
-
-       return err;
-}
-
-
-EXPORT_API void msg_release_msgid_list(MSG_MSGID_LIST_S *msg_msgid_list)
-{
-       if (msg_msgid_list == NULL)
-       {
-               return;
-       }
-
-       // Memory Free
-       if(msg_msgid_list->msgIdList != NULL)
-       {
-               //free peer info list
-               delete [] msg_msgid_list->msgIdList;
-               msg_msgid_list->msgIdList = NULL;
-       }
-
-       msg_msgid_list->nCount = 0;
-}
-
-
-EXPORT_API int msg_get_reject_msg_list(MSG_HANDLE_T handle, const char *phone_num, MSG_REJECT_MSG_LIST_S *msg_reject_msg_list)
-{
-       MSG_ERROR_T err =  MSG_SUCCESS;
-
-       if (handle == NULL)
-       {
-               return -EINVAL;
-       }
-
-       MsgHandle* pHandle = (MsgHandle*)handle;
-
-       try
-       {
-               err = pHandle->getRejectMsgList(phone_num, msg_reject_msg_list);
-       }
-       catch (MsgException& e)
-       {
-               MSG_FATAL("%s", e.what());
-               return MSG_ERR_STORAGE_ERROR;
-       }
-
-       return err;
-}
-
-
-EXPORT_API void msg_release_reject_msg_list(MSG_REJECT_MSG_LIST_S *msg_reject_msg_list)
-{
-       if (msg_reject_msg_list == NULL)
-       {
-               return;
-       }
-
-       // Memory Free
-       if(msg_reject_msg_list->rejectMsgInfo != NULL)
-       {
-               //free peer info list
-               delete [] msg_reject_msg_list->rejectMsgInfo;
-               msg_reject_msg_list->rejectMsgInfo = NULL;
-       }
-
-       msg_reject_msg_list->nCount = 0;
-}
-
-
-EXPORT_API int msg_reg_storage_change_callback(MSG_HANDLE_T handle, msg_storage_change_cb cb, void *user_param)
-{
-       MSG_ERROR_T err =  MSG_SUCCESS;
-
-       if (handle == NULL || cb == NULL)
-       {
-               return -EINVAL;
-       }
-
-       MsgHandle* pHandle = (MsgHandle*)handle;
-
-       try
-       {
-               err = pHandle->regStorageChangeCallback(cb, user_param);
-       }
-       catch (MsgException& e)
-       {
-               MSG_FATAL("%s", e.what());
-               return MSG_ERR_CALLBACK_ERROR;
-       }
-
-       return err;
-}
-
-
-EXPORT_API int msg_get_report_status(MSG_HANDLE_T handle, MSG_MESSAGE_ID_T msg_id, MSG_REPORT_STATUS_INFO_S *report_status)
-{
-       MSG_ERROR_T err =  MSG_SUCCESS;
-
-       if (handle == NULL || msg_id < 1)
-       {
-               return -EINVAL;
-       }
-
-       MsgHandle* pHandle = (MsgHandle*)handle;
-
-       try
-       {
-               err = pHandle->getReportStatus(msg_id, report_status);
-       }
-       catch (MsgException& e)
-       {
-               MSG_FATAL("%s", e.what());
-               return MSG_ERR_STORAGE_ERROR;
-       }
-
-       return err;
-}
-
diff --git a/mapi/MapiTransport.cpp b/mapi/MapiTransport.cpp
deleted file mode 100755 (executable)
index 0cfbc38..0000000
+++ /dev/null
@@ -1,602 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-#include <errno.h>
-
-#include "MsgHandle.h"
-#include "MsgDebug.h"
-#include "MsgException.h"
-#include "MapiTransport.h"
-#include "MapiControl.h"
-#include "MapiStorage.h"
-#include "MapiMessage.h"
-
-
-/*==================================================================================================
-                                     FUNCTION IMPLEMENTATION
-==================================================================================================*/
-EXPORT_API int msg_submit_req(MSG_HANDLE_T handle, MSG_REQUEST_S *req)
-{
-       MSG_ERROR_T err =  MSG_SUCCESS;
-
-       if (handle == NULL ||req == NULL)
-       {
-               return -EINVAL;
-       }
-
-       MsgHandle* pHandle = (MsgHandle*)handle;
-
-       try
-       {
-               err = pHandle->submitReq(req);
-       }
-       catch (MsgException& e)
-       {
-               MSG_FATAL("%s", e.what());
-               return MSG_ERR_TRANSPORT_ERROR;
-       }
-
-       return err;
-}
-
-
-EXPORT_API int msg_reg_sent_status_callback(MSG_HANDLE_T handle, msg_sent_status_cb cb, void *user_param)
-{
-       MSG_ERROR_T err =  MSG_SUCCESS;
-
-       if (handle == NULL || cb == NULL)
-       {
-               return -EINVAL;
-       }
-
-       MsgHandle* pHandle = (MsgHandle*)handle;
-
-       try
-       {
-               err = pHandle->regSentStatusCallback(cb, user_param);
-       }
-       catch (MsgException& e)
-       {
-               MSG_FATAL("%s", e.what());
-               return MSG_ERR_CALLBACK_ERROR;
-       }
-
-       return err;
-}
-
-
-EXPORT_API int msg_reg_sms_message_callback(MSG_HANDLE_T handle, msg_sms_incoming_cb cb, unsigned short port, void *user_param)
-{
-       MSG_ERROR_T err =  MSG_SUCCESS;
-
-       if (handle == NULL || cb == NULL)
-       {
-               return -EINVAL;
-       }
-
-       MsgHandle* pHandle = (MsgHandle*)handle;
-
-       try
-       {
-               err = pHandle->regSmsMessageCallback(cb, port, user_param);
-       }
-       catch (MsgException& e)
-       {
-               MSG_FATAL("%s", e.what());
-               return MSG_ERR_CALLBACK_ERROR;
-       }
-
-       return err;
-}
-
-
-EXPORT_API int msg_reg_mms_conf_message_callback(MSG_HANDLE_T handle, msg_mms_conf_msg_incoming_cb cb, const char *app_id, void *user_param)
-{
-       MSG_ERROR_T err =  MSG_SUCCESS;
-
-       if (handle == NULL || cb == NULL)
-       {
-               return -EINVAL;
-       }
-
-       if (app_id && strlen(app_id) > MAX_MMS_JAVA_APPID_LEN)
-       {
-               return -EINVAL;
-       }
-
-       MsgHandle* pHandle = (MsgHandle*)handle;
-
-       try
-       {
-               err = pHandle->regMmsConfMessageCallback(cb, app_id, user_param);
-       }
-       catch (MsgException& e)
-       {
-               MSG_FATAL("%s", e.what());
-               return MSG_ERR_CALLBACK_ERROR;
-       }
-
-       return err;
-}
-
-
-EXPORT_API int msg_reg_syncml_message_callback(MSG_HANDLE_T handle,  msg_syncml_msg_incoming_cb cb, void *user_param)
-{
-       MSG_ERROR_T err =  MSG_SUCCESS;
-
-       if (handle == NULL || cb == NULL)
-       {
-               return -EINVAL;
-       }
-
-       MsgHandle* pHandle = (MsgHandle*)handle;
-
-       try
-       {
-               err = pHandle->regSyncMLMessageCallback(cb, user_param);
-       }
-       catch (MsgException& e)
-       {
-               MSG_FATAL("%s", e.what());
-               return MSG_ERR_CALLBACK_ERROR;
-       }
-
-       return err;
-}
-
-
-EXPORT_API int msg_reg_lbs_message_callback(MSG_HANDLE_T handle, msg_lbs_msg_incoming_cb cb, void *user_param)
-{
-       MSG_ERROR_T err =  MSG_SUCCESS;
-
-       if (handle == NULL || cb == NULL)
-       {
-               return -EINVAL;
-       }
-
-       MsgHandle* pHandle = (MsgHandle*)handle;
-
-       try
-       {
-               err = pHandle->regLBSMessageCallback(cb, user_param);
-       }
-       catch (MsgException& e)
-       {
-               MSG_FATAL("%s", e.what());
-               return MSG_ERR_CALLBACK_ERROR;
-       }
-
-       return err;
-}
-
-
-EXPORT_API int msg_reg_syncml_message_operation_callback(MSG_HANDLE_T handle,  msg_syncml_msg_operation_cb cb, void *user_param)
-{
-       MSG_ERROR_T err =  MSG_SUCCESS;
-
-       if (handle == NULL || cb == NULL)
-       {
-               return -EINVAL;
-       }
-
-       MsgHandle* pHandle = (MsgHandle*)handle;
-
-       try
-       {
-               err = pHandle->regSyncMLMessageOperationCallback(cb, user_param);
-       }
-       catch (MsgException& e)
-       {
-               MSG_FATAL("%s", e.what());
-               return MSG_ERR_CALLBACK_ERROR;
-       }
-
-       return err;
-}
-
-
-EXPORT_API int msg_syncml_message_operation(MSG_HANDLE_T handle,  MSG_MESSAGE_ID_T msgId)
-{
-       MSG_ERROR_T err =  MSG_SUCCESS;
-
-       if (handle == NULL || msgId < 1)
-       {
-               return -EINVAL;
-       }
-
-       MsgHandle* pHandle = (MsgHandle*)handle;
-
-       try
-       {
-               err = pHandle->operateSyncMLMessage(msgId);
-       }
-       catch (MsgException& e)
-       {
-               MSG_FATAL("%s", e.what());
-               return MSG_ERR_TRANSPORT_ERROR;
-       }
-
-       return err;
-}
-
-
-static MSG_HANDLE_T msgHandle = NULL;
-static msg_simple_sent_status_cb sentStatusCallback = NULL;
-
-static void sent_status_cb_func(MSG_HANDLE_T handle, MSG_SENT_STATUS_S *sent_status, void *user_param)
-{
-       MSG_DEBUG("Sent Status [%d]", sent_status->status);
-
-       msg_simple_sent_status_cb pfunc = sentStatusCallback;
-
-       pfunc(sent_status, user_param);
-
-       MSG_DEBUG("After entering callback function.");
-
-       // Close control handle instance
-       //      msg_close_msg_handle(&msgHandle);
-
-       //      MSG_DEBUG("After msg_close_msg_handle.");
-
-}
-
-
-static int msg_send_single_sms(const char *phone_num, const char *sms_text, msg_simple_sent_status_cb cb, void *user_param)
-{
-       if (phone_num == NULL || sms_text == NULL || cb == NULL)
-       {
-               MSG_DEBUG("Invalid parameter [%s] [%s] [%s]", phone_num, sms_text, cb);
-               return -EINVAL;
-       }
-
-       if (strlen(phone_num) > MAX_PHONE_NUMBER_LEN)
-       {
-               MSG_DEBUG("Phone Number is too long [%s]", phone_num);
-               return -EINVAL;
-       }
-
-       MSG_REQUEST_S msgReq = {0};
-       MSG_ERROR_T retVal = MSG_SUCCESS;
-
-       // Open control handle instance
-       if ((retVal = msg_open_msg_handle(&msgHandle)) != MSG_SUCCESS)
-       {
-               MSG_DEBUG("MsgOpenMsgHandle is failed. Error Code = %d", retVal);
-               return retVal;
-       }
-
-       msgReq.msg = msg_new_message();
-       MSG_MESSAGE_S *reqmsg = (MSG_MESSAGE_S*) msgReq.msg;
-       /* when sending SMS */
-       reqmsg->msgType.mainType = MSG_SMS_TYPE;
-       reqmsg->msgType.subType = MSG_NORMAL_SMS;
-       reqmsg->msgId = 0;
-       reqmsg->folderId = MSG_OUTBOX_ID;
-
-       /* fill the destination number in msgReq */
-       reqmsg->nAddressCnt = 1;
-       reqmsg->addressList[0].addressType = MSG_ADDRESS_TYPE_PLMN; // telephone number
-       reqmsg->addressList[0].recipientType = MSG_RECIPIENTS_TYPE_TO; // telephone number
-       memset(reqmsg->addressList, 0x00, MAX_ADDRESS_VAL_LEN);
-       strncpy(reqmsg->addressList[0].addressVal, phone_num, MAX_ADDRESS_VAL_LEN);
-       MSG_DEBUG("AddressVal = [%s]", reqmsg->addressList[0].addressVal);
-
-       reqmsg->msgPort.valid = false;
-
-       /* fill the msg text in msgReq */
-       reqmsg->dataSize = strlen(sms_text);
-       reqmsg->pData = (void*)malloc(reqmsg->dataSize+1);
-       strncpy((char *)reqmsg->pData, sms_text, reqmsg->dataSize);
-
-       sentStatusCallback = cb;
-
-       // register sent status callback
-       retVal = msg_reg_sent_status_callback(msgHandle, sent_status_cb_func, user_param);
-
-       if (retVal != MSG_SUCCESS)
-       {
-               MSG_DEBUG("msg_reg_sent_status_callback() is failed. Error Code = %d", retVal);
-               msg_close_msg_handle(&msgHandle);
-               return retVal;
-       }
-
-       // sending message request
-       retVal = msg_submit_req(msgHandle, &msgReq);
-
-       if (retVal != MSG_SUCCESS)
-       {
-               MSG_DEBUG("msg_submit_req() is failed. Error Code = %d", retVal);
-               msg_close_msg_handle(&msgHandle);
-               return retVal;
-       }
-
-       /* Releasing msg_message_t is mandotory. Unless, memory leaks */
-       msg_release_message(&(msgReq.msg));
-
-       return MSG_SUCCESS;
-}
-
-
-static int msg_verify_number(const char *raw, char *trimmed)
-{
-       if( !(raw && trimmed) )
-       {
-               MSG_DEBUG("Phone Number is NULL");
-               return MSG_ERR_NULL_POINTER;
-       }
-
-       MSG_DEBUG("Phone Number is NULL");
-       for( int i=0, j=0 ; raw[i] ; i++ )
-       {
-               if ( (raw[i] >= '0' && raw[i] <= '9') || (raw[i] == ',') || raw[i] == ' ' || raw[i] == '+' )
-                       trimmed[j++] = raw[i];
-               else if( raw[i] == '-')
-                       continue;
-               else
-               {
-                       MSG_DEBUG("Unacceptable character in telephone number: [%c]", raw[i]);
-                       return MSG_ERR_INVALID_PARAMETER;
-               }
-       }
-       MSG_DEBUG("Trimming [%s]->[%s]", raw, trimmed);
-       return MSG_SUCCESS;
-}
-
-
-EXPORT_API int msg_sms_send(const char *phone_num_list, const char *sms_text, msg_simple_sent_status_cb cb, void *user_param)
-{
-       if (phone_num_list == NULL || sms_text == NULL || cb == NULL)
-       {
-               MSG_DEBUG("Invalid parameter [%s] [%s] [%s]", phone_num_list, sms_text, cb);
-               return -EINVAL;
-       }
-
-       char trimmed_num[strlen(phone_num_list)+1];
-       bzero(trimmed_num, strlen(phone_num_list)+1);
-
-       MSG_ERROR_T retVal = msg_verify_number(phone_num_list, trimmed_num);
-
-       if ( retVal != MSG_SUCCESS )
-               return retVal;
-
-       for( char* cur_num = strtok(trimmed_num,", "); cur_num ; cur_num = strtok(NULL,", "))
-       {
-               if (strlen(cur_num) > MAX_PHONE_NUMBER_LEN)
-               {
-                       MSG_DEBUG("Phone number is too long [%s], and sending is skipped", cur_num);
-                       continue;
-               }
-
-               MSG_DEBUG("phone number: [%s]", cur_num);
-               MSG_DEBUG("text: [%s]", sms_text);
-               retVal = msg_send_single_sms(cur_num, sms_text, cb, user_param);
-
-               if (retVal != MSG_SUCCESS)
-                       return retVal;
-       }
-
-       return MSG_SUCCESS;
-}
-
-
-EXPORT_API int msg_sms_send_message(MSG_HANDLE_T handle, MSG_REQUEST_S* req)
-{
-       MSG_ERROR_T err =  MSG_SUCCESS;
-
-       if (handle == NULL || !req) {
-               MSG_FATAL("handle or req is NULL");
-               return MSG_ERR_NULL_POINTER;
-       }
-
-       req->reqId = 1; // arbitrary number
-
-       MSG_MESSAGE_S *reqmsg = (MSG_MESSAGE_S*) req->msg;
-
-       if (reqmsg->dataSize <= 0) {
-               MSG_FATAL("msg size is invalid : [%d]", reqmsg->dataSize);
-               return MSG_ERR_INVALID_PARAMETER;
-       }
-
-       if (reqmsg->msgType.mainType != MSG_SMS_TYPE) {
-               MSG_DEBUG("mainType is not SMS [%d]", reqmsg->msgType.mainType);
-               reqmsg->msgType.mainType = MSG_SMS_TYPE;
-       }
-
-       if (reqmsg->msgType.subType > MSG_CONCAT_SIM_SMS) {
-               MSG_DEBUG("subType is not SMS [%d]", reqmsg->msgType.subType);
-               reqmsg->msgType.subType = MSG_NORMAL_SMS;
-       }
-
-       reqmsg->folderId = MSG_OUTBOX_ID; // outbox fixed
-       reqmsg->networkStatus = MSG_NETWORK_SENDING;
-
-       err = msg_submit_req(handle, req);
-
-       if (err == MSG_SUCCESS)
-               MSG_DEBUG("Sending Message is OK!");
-       else
-               MSG_DEBUG("Sending Message is failed! [%d]", err);
-
-       return err;
-}
-
-
-EXPORT_API int msg_mms_send_message(MSG_HANDLE_T handle, MSG_REQUEST_S* req)
-{
-       MSG_ERROR_T err =  MSG_SUCCESS;
-
-       if (handle == NULL || !req)
-       {
-               MSG_FATAL("handle or req is NULL");
-               return MSG_ERR_INVALID_PARAMETER;
-       }
-
-       req->reqId = 1; // arbitrary number
-
-       MSG_MESSAGE_S *reqmsg = (MSG_MESSAGE_S*) req->msg;
-
-       if (reqmsg->dataSize <= 0)
-       {
-               MSG_FATAL("MMS data size is invalid");
-               return MSG_ERR_INVALID_PARAMETER;
-       }
-
-       reqmsg->msgType.mainType = MSG_MMS_TYPE;
-       reqmsg->msgType.subType = MSG_SENDREQ_MMS;
-       reqmsg->folderId = MSG_OUTBOX_ID; // outbox fixed
-       reqmsg->networkStatus = MSG_NETWORK_SENDING;
-
-       err = msg_submit_req(handle, req);
-
-       if (err == MSG_SUCCESS)
-               MSG_DEBUG("Sending Message is OK!");
-       else
-               MSG_DEBUG("Sending Message is failed! [%d]", err);
-
-       return err;
-}
-
-
-EXPORT_API int msg_mms_send_read_report(MSG_HANDLE_T handle, MSG_MESSAGE_ID_T msgId, MSG_READ_REPORT_STATUS_T mms_read_status)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       MSG_REQUEST_S req = {0};
-
-       if (handle == NULL)
-       {
-               return MSG_ERR_INVALID_PARAMETER;
-       }
-
-       req.reqId = 1; // arbitrary number
-
-       req.msg = msg_new_message();
-
-       MSG_MESSAGE_S *reqmsg = (MSG_MESSAGE_S*) req.msg;
-
-       reqmsg->msgPort.valid = false;
-       reqmsg->msgId = msgId;
-       reqmsg->folderId = MSG_OUTBOX_ID; // outbox fixed
-       reqmsg->msgType.mainType = MSG_MMS_TYPE;
-       reqmsg->msgType.subType = MSG_READREPLY_MMS;
-
-       reqmsg->dataSize = sizeof(MSG_READ_REPORT_STATUS_T);
-       reqmsg->pMmsData = (char *)calloc(reqmsg->dataSize, 1);
-
-       memcpy((char *)reqmsg->pMmsData, &mms_read_status, sizeof(MSG_READ_REPORT_STATUS_T));
-
-       MSG_DEBUG("mms_read_status [%d]", mms_read_status);
-
-       err = msg_submit_req(handle, &req);
-
-       if (err == MSG_SUCCESS)
-               MSG_DEBUG("Sending Message is OK!");
-       else
-               MSG_DEBUG("Sending Message is failed!");
-
-       free(reqmsg->pMmsData);
-
-       return err;
-}
-
-
-EXPORT_API int msg_mms_forward_message(MSG_HANDLE_T handle, MSG_REQUEST_S* req)
-{
-       MSG_ERROR_T err =  MSG_SUCCESS;
-
-       if (handle == NULL || !req )
-       {
-               MSG_FATAL("handle or req is NULL");
-               return MSG_ERR_INVALID_PARAMETER;
-       }
-
-       MSG_MESSAGE_S *reqmsg = (MSG_MESSAGE_S*) req->msg;
-
-       req->reqId = 1;
-
-       reqmsg->msgType.mainType = MSG_MMS_TYPE;
-       reqmsg->msgType.subType = MSG_FORWARD_MMS;
-       reqmsg->folderId = MSG_OUTBOX_ID; // outbox fixed
-       reqmsg->networkStatus = MSG_NETWORK_SENDING;
-
-       err = msg_submit_req(handle, req);
-
-       if (err == MSG_SUCCESS)
-               MSG_DEBUG("Sending Message is OK!");
-       else
-               MSG_DEBUG("Sending Message is failed!");
-
-       return err;
-}
-
-
-EXPORT_API int msg_mms_retrieve_message(MSG_HANDLE_T handle, MSG_REQUEST_S* req)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       if ( handle == NULL|| !req)
-       {
-               MSG_FATAL("handle or req is NULL");
-               return MSG_ERR_INVALID_PARAMETER;
-       }
-
-       MSG_MESSAGE_S *reqmsg = (MSG_MESSAGE_S*) req->msg;
-
-       reqmsg->msgType.mainType = MSG_MMS_TYPE;
-       reqmsg->msgType.subType = MSG_RETRIEVE_MMS;
-       reqmsg->folderId = MSG_OUTBOX_ID; // outbox fixed
-       reqmsg->networkStatus = MSG_NETWORK_RETRIEVING;
-
-       err = msg_submit_req(handle, req);
-
-       if (err == MSG_SUCCESS)
-               MSG_DEBUG("Sending Message is OK!");
-       else
-               MSG_DEBUG("Sending Message is failed!");
-
-       return err;
-}
-
-
-/* reject_msg_support */
-EXPORT_API int msg_mms_reject_message(MSG_HANDLE_T handle, MSG_REQUEST_S* req)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       if (handle == NULL || !req )
-       {
-               MSG_FATAL("handle or req is NULL");
-               return MSG_ERR_INVALID_PARAMETER;
-       }
-
-       MSG_MESSAGE_S *reqmsg = (MSG_MESSAGE_S*) req->msg;
-
-       reqmsg->msgType.mainType = MSG_MMS_TYPE;
-       reqmsg->msgType.subType = MSG_NOTIFYRESPIND_MMS;
-       reqmsg->folderId = MSG_OUTBOX_ID; // outbox fixed
-       reqmsg->networkStatus = MSG_NETWORK_SENDING;
-
-       err = msg_submit_req(handle, req);
-
-       if (err == MSG_SUCCESS)
-               MSG_DEBUG("Sending Message is OK!");
-       else
-               MSG_DEBUG("Sending Message is failed!");
-
-       return err;
-}
-/* reject_msg_support */
-
similarity index 61%
rename from mapi/MapiControl.cpp
rename to mapi/msg_control.cpp
index f71c405..cf24235 100755 (executable)
@@ -1,31 +1,32 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include <errno.h>
 
 #include "MsgHandle.h"
 #include "MsgDebug.h"
 #include "MsgException.h"
-#include "MapiControl.h"
 
+#include "msg_private.h"
+#include "msg.h"
 
 /*==================================================================================================
                                      FUNCTION IMPLEMENTATION
 ==================================================================================================*/
-EXPORT_API int msg_open_msg_handle(MSG_HANDLE_T *handle)
+EXPORT_API int msg_open_msg_handle(msg_handle_t *handle)
 {
        MsgHandle* pHandle = new MsgHandle();
 
@@ -36,7 +37,7 @@ EXPORT_API int msg_open_msg_handle(MSG_HANDLE_T *handle)
        }
 
        // Create MsgHandle
-       *handle = (MSG_HANDLE_T)pHandle;
+       *handle = (msg_handle_t)pHandle;
 
        if (*handle == NULL)
                return -EINVAL;
@@ -60,7 +61,7 @@ EXPORT_API int msg_open_msg_handle(MSG_HANDLE_T *handle)
 }
 
 
-EXPORT_API int msg_close_msg_handle(MSG_HANDLE_T *handle)
+EXPORT_API int msg_close_msg_handle(msg_handle_t *handle)
 {
        if (handle == NULL || *handle == NULL)
        {
diff --git a/mapi/msg_filter.cpp b/mapi/msg_filter.cpp
new file mode 100755 (executable)
index 0000000..cf862e0
--- /dev/null
@@ -0,0 +1,285 @@
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#include <errno.h>
+
+#include "MsgException.h"
+#include "MsgDebug.h"
+#include "MsgHandle.h"
+#include "msg.h"
+
+/*==================================================================================================
+                                     FUNCTION IMPLEMENTATION
+==================================================================================================*/
+EXPORT_API int msg_add_filter(msg_handle_t handle, const msg_struct_t msg_struct_handle)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       // TODO : check NULL in msg_struct_handle
+       msg_struct_s *msg_struct = (msg_struct_s *) msg_struct_handle;
+
+       if (handle == NULL || msg_struct == NULL)
+       {
+               return -EINVAL;
+       }
+
+       if(msg_struct->type != MSG_STRUCT_FILTER)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       try
+       {
+               err = pHandle->addFilter((const MSG_FILTER_S *)msg_struct->data);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_FILTER_ERROR;
+       }
+
+       return err;
+}
+
+
+EXPORT_API int msg_update_filter(msg_handle_t handle, const msg_struct_t msg_struct_handle)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       // TODO : check NULL in msg_struct_handle
+       msg_struct_s *msg_struct = (msg_struct_s *) msg_struct_handle;
+
+       if (handle == NULL || msg_struct == NULL)
+       {
+               return -EINVAL;
+       }
+
+
+       if(msg_struct->type != MSG_STRUCT_FILTER)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       try
+       {
+               err = pHandle->updateFilter((const MSG_FILTER_S *)msg_struct->data);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_FILTER_ERROR;
+       }
+
+       return err;
+}
+
+
+EXPORT_API int msg_delete_filter(msg_handle_t handle, msg_filter_id_t filter_id)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       try
+       {
+               err = pHandle->deleteFilter(filter_id);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_FILTER_ERROR;
+       }
+
+       return err;
+}
+
+
+EXPORT_API int msg_get_filter_list(msg_handle_t handle, msg_struct_list_s *filter_list)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL || filter_list == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       try
+       {
+               err = pHandle->getFilterList(filter_list);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_FILTER_ERROR;
+       }
+
+       return err;
+}
+
+
+EXPORT_API int msg_set_filter_operation(msg_handle_t handle, bool set_flag)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       try
+       {
+               err = pHandle->setFilterOperation(set_flag);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_FILTER_ERROR;
+       }
+
+       return err;
+}
+
+
+EXPORT_API int msg_get_filter_operation(msg_handle_t handle, bool *set_flag)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       try
+       {
+               err = pHandle->getFilterOperation(set_flag);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_FILTER_ERROR;
+       }
+
+       return err;
+}
+
+
+
+
+int msg_get_filter_info_int(void *filter, int field)
+{
+       if (!filter)
+               return MSG_ERR_NULL_POINTER;
+
+       int ret = 0;
+
+       MSG_FILTER_S *filter_data = (MSG_FILTER_S *)filter;
+
+       switch (field)
+       {
+       case MSG_FILTER_ID_INT :
+               ret = filter_data->filterId;
+               break;
+       case MSG_FILTER_TYPE_INT :
+               ret = filter_data->filterType;
+               break;
+       default :
+               return MSG_ERR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+
+char *msg_get_filter_info_str(void *filter, int field)
+{
+       if (!filter)
+               return NULL;
+
+       char *ret_str = NULL;
+
+       MSG_FILTER_S *filter_data = (MSG_FILTER_S *)filter;
+
+       switch (field)
+       {
+       case MSG_FILTER_VALUE_STR :
+               ret_str = filter_data->filterValue;
+               break;
+       default :
+               return NULL;
+       }
+
+       return ret_str;
+}
+
+int msg_set_filter_info_int(void *filter, int field, int value)
+{
+       if (!filter)
+               return MSG_ERR_NULL_POINTER;
+
+       msg_error_t err =  MSG_SUCCESS;
+       MSG_FILTER_S *filter_data = (MSG_FILTER_S *)filter;
+
+       switch (field)
+       {
+       case MSG_FILTER_ID_INT :
+               filter_data->filterId = value;
+               break;
+       case MSG_FILTER_TYPE_INT :
+               filter_data->filterType = value;
+               break;
+       default :
+               return MSG_ERR_INVALID_PARAMETER;
+       }
+
+       return err;
+}
+
+int msg_set_filter_info_str(void *filter, int field, char *value, int size)
+{
+       if (!filter || !value)
+               return MSG_ERR_NULL_POINTER;
+
+       msg_error_t err =  MSG_SUCCESS;
+       MSG_FILTER_S *filter_data = (MSG_FILTER_S *)filter;
+
+       switch (field)
+       {
+       case MSG_FILTER_VALUE_STR :
+               strncpy(filter_data->filterValue, value, size);
+               break;
+       default :
+               return MSG_ERR_INVALID_PARAMETER;
+       }
+
+       return err;
+}
+
+
diff --git a/mapi/msg_message.cpp b/mapi/msg_message.cpp
new file mode 100755 (executable)
index 0000000..23fabc4
--- /dev/null
@@ -0,0 +1,602 @@
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#include <string.h>
+
+#include "MsgTypes.h"
+#include "MsgStorageTypes.h"
+#include "MsgInternalTypes.h"
+#include "MsgMmsMessage.h"
+
+#include "msg.h"
+#include "msg_private.h"
+
+void msg_message_create_struct(msg_struct_s *msg_struct)
+{
+       MSG_MESSAGE_HIDDEN_S *msg = (MSG_MESSAGE_HIDDEN_S *)new MSG_MESSAGE_HIDDEN_S;
+       memset(msg, 0x00, sizeof(MSG_MESSAGE_HIDDEN_S));
+
+       /* set default value to message*/
+       msg->msgId = 0;
+       msg->threadId = 0;
+       msg->folderId = MSG_DRAFT_ID;
+       msg->mainType= MSG_SMS_TYPE;
+       msg->subType = MSG_NORMAL_SMS;
+       msg->classType = MSG_CLASS_NONE;
+       msg->storageId = MSG_STORAGE_PHONE;
+       time_t curTime = time(NULL);
+       msg->displayTime = curTime;
+       msg->networkStatus = MSG_NETWORK_NOT_SEND;
+       msg->encodeType = MSG_ENCODE_AUTO;
+       msg->bRead = false;
+       msg->bProtected = false;
+       msg->bBackup = false;
+       msg->priority = MSG_MESSAGE_PRIORITY_NORMAL;
+       msg->direction = MSG_DIRECTION_TYPE_MO;
+       msg->bPortValid = false;
+       msg->dataSize = 0;
+       msg->pData = NULL;
+       msg->pMmsData = NULL;
+
+       /* Allocate memory for address list of message */
+       msg_struct_list_s *addr_list = (msg_struct_list_s *)new msg_struct_list_s;
+
+       addr_list->nCount = 0;
+       addr_list->msg_struct_info = (msg_struct_t *)new char[sizeof(MSG_ADDRESS_INFO_S *)*MAX_TO_ADDRESS_CNT];
+
+       msg_struct_s *pTmp = NULL;
+
+       for (int i = 0; i < MAX_TO_ADDRESS_CNT; i++) {
+               addr_list->msg_struct_info[i] = (msg_struct_t)new char[sizeof(msg_struct_s)];
+               pTmp = (msg_struct_s *)addr_list->msg_struct_info[i];
+               pTmp->type = MSG_STRUCT_ADDRESS_INFO;
+               pTmp->data = new MSG_ADDRESS_INFO_S;
+               memset(pTmp->data, 0x00, sizeof(MSG_ADDRESS_INFO_S));
+
+               addr_list->msg_struct_info[i] = (msg_struct_t)pTmp;
+       }
+
+       msg->addr_list = addr_list;
+
+       msg_struct->data = (int *)msg;
+}
+
+int msg_message_release(msg_struct_s **msg_struct)
+{
+       MSG_MESSAGE_HIDDEN_S *msg = (MSG_MESSAGE_HIDDEN_S *)(*msg_struct)->data;
+
+       if (msg->pData) {
+               delete [] static_cast<char*>(msg->pData);
+               msg->pData = NULL;
+       }
+
+       if (msg->pMmsData) {
+               delete [] static_cast<char*>(msg->pMmsData);
+               msg->pMmsData = NULL;
+       }
+
+       // Memory Free
+       if (msg->addr_list!= NULL)
+       {
+               for(int i=0; i<MAX_TO_ADDRESS_CNT; i++) {
+                       msg_struct_s * addrInfo = (msg_struct_s *)msg->addr_list->msg_struct_info[i];
+                       delete (MSG_ADDRESS_INFO_S *)addrInfo->data;
+                       addrInfo->data = NULL;
+                       delete (msg_struct_s *)msg->addr_list->msg_struct_info[i];
+                       msg->addr_list->msg_struct_info[i] = NULL;
+               }
+
+               delete [] msg->addr_list->msg_struct_info;
+
+               delete msg->addr_list;
+               msg->addr_list = NULL;
+       }
+
+       delete msg;
+       (*msg_struct)->data = NULL;
+
+       delete (msg_struct_s *)*msg_struct;
+       *msg_struct = NULL;
+
+       return MSG_SUCCESS;
+}
+
+int msg_message_get_int_value(void *data, int field, int *value)
+{
+       if (!data)
+               return MSG_ERR_NULL_POINTER;
+
+       int ret = MSG_SUCCESS;
+
+       MSG_MESSAGE_HIDDEN_S *msg_data = (MSG_MESSAGE_HIDDEN_S *)data;
+
+       switch (field)
+       {
+       case MSG_MESSAGE_ID_INT :
+               *value = msg_data->msgId;
+               break;
+       case MSG_MESSAGE_THREAD_ID_INT :
+               *value = msg_data->threadId;
+               break;
+       case MSG_MESSAGE_FOLDER_ID_INT :
+               *value = msg_data->folderId;
+               break;
+       case MSG_MESSAGE_TYPE_INT :
+       {
+        if (msg_data->mainType == MSG_SMS_TYPE)
+        {
+                       if (msg_data->subType == MSG_CB_SMS)
+                               *value = MSG_TYPE_SMS_CB;
+                       else if (msg_data->subType == MSG_JAVACB_SMS)
+                               *value = MSG_TYPE_SMS_JAVACB;
+                       else if (msg_data->subType == MSG_WAP_SI_SMS || msg_data->subType == MSG_WAP_SL_SMS)
+                               *value = MSG_TYPE_SMS_WAPPUSH;
+                       else if (msg_data->subType == MSG_MWI_VOICE_SMS || msg_data->subType == MSG_MWI_FAX_SMS
+                                       || msg_data->subType == MSG_MWI_EMAIL_SMS || msg_data->subType == MSG_MWI_OTHER_SMS)
+                               *value = MSG_TYPE_SMS_MWI;
+                       else if (msg_data->subType == MSG_SYNCML_CP)
+                               *value = MSG_TYPE_SMS_SYNCML;
+                       else if (msg_data->subType == MSG_REJECT_SMS)
+                               *value = MSG_TYPE_SMS_REJECT;
+                       else
+                               *value = MSG_TYPE_SMS;
+        }
+        else if (msg_data->mainType == MSG_MMS_TYPE)
+        {
+                       if (msg_data->subType == MSG_NOTIFICATIONIND_MMS)
+                               *value = MSG_TYPE_MMS_NOTI;
+                       else if (msg_data->subType == MSG_SENDREQ_JAVA_MMS)
+                               *value = MSG_TYPE_MMS_JAVA;
+                       else
+                               *value = MSG_TYPE_MMS;
+        }
+        else
+               *value = MSG_TYPE_INVALID;
+
+       break;
+       }
+       case MSG_MESSAGE_CLASS_TYPE_INT :
+               *value = msg_data->classType;
+               break;
+       case MSG_MESSAGE_STORAGE_ID_INT :
+               *value = msg_data->storageId;
+               break;
+       case MSG_MESSAGE_DISPLAY_TIME_INT :
+               *value = msg_data->displayTime;
+               break;
+       case MSG_MESSAGE_NETWORK_STATUS_INT :
+               *value = msg_data->networkStatus;
+               break;
+       case MSG_MESSAGE_ENCODE_TYPE_INT :
+               *value = msg_data->encodeType;
+               break;
+       case MSG_MESSAGE_PRIORITY_INT :
+               *value = msg_data->priority;
+               break;
+       case MSG_MESSAGE_DIRECTION_INT :
+               *value = msg_data->direction;
+               break;
+       case MSG_MESSAGE_DEST_PORT_INT :
+               *value = msg_data->dstPort;
+               break;
+       case MSG_MESSAGE_SRC_PORT_INT :
+               *value = msg_data->srcPort;
+               break;
+       case MSG_MESSAGE_ATTACH_COUNT_INT :
+               *value = msg_data->attachCount;
+               break;
+       case MSG_MESSAGE_DATA_SIZE_INT :
+               *value = msg_data->dataSize;
+               break;
+       default :
+               ret = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+
+       return ret;
+}
+
+int msg_message_get_bool_value(void *data, int field, bool *value)
+{
+       if (!data)
+               return MSG_ERR_NULL_POINTER;
+
+       int ret = MSG_SUCCESS;
+
+       MSG_MESSAGE_HIDDEN_S *msg_data = (MSG_MESSAGE_HIDDEN_S *)data;
+
+       switch (field) {
+       case MSG_MESSAGE_READ_BOOL :
+               *value = msg_data->bRead;
+               break;
+       case MSG_MESSAGE_PROTECTED_BOOL :
+               *value = msg_data->bProtected;
+               break;
+       case MSG_MESSAGE_BACKUP_BOOL :
+               *value = msg_data->bBackup;
+               break;
+       case MSG_MESSAGE_PORT_VALID_BOOL :
+               *value = msg_data->bPortValid;
+               break;
+       default :
+               ret = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+
+       return ret;
+}
+
+int msg_message_get_str_value(void *data, int field, char *value, int size)
+{
+       if (!data || !value)
+               return MSG_ERR_NULL_POINTER;
+
+       int ret = MSG_SUCCESS;
+
+       MSG_MESSAGE_HIDDEN_S *msg_data = (MSG_MESSAGE_HIDDEN_S *)data;
+
+       switch (field) {
+       case MSG_MESSAGE_REPLY_ADDR_STR :
+               strncpy(value, msg_data->replyAddress, size);
+               break;
+       case MSG_MESSAGE_SUBJECT_STR :
+               strncpy(value, msg_data->subject, size);
+               break;
+       case MSG_MESSAGE_THUMBNAIL_PATH_STR :
+               strncpy(value, msg_data->thumbPath, size);
+               break;
+       case MSG_MESSAGE_SMS_DATA_STR :
+       case MSG_MESSAGE_MMS_TEXT_STR :
+               if (msg_data->pData != NULL)
+                       strncpy(value, (char *)msg_data->pData, size);
+               break;
+       default :
+               ret = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+
+       return ret;
+}
+
+int msg_message_get_struct_hnd(void *data, int field, void **value)
+{
+       if (!data)
+               return MSG_ERR_NULL_POINTER;
+
+       int ret = MSG_SUCCESS;
+
+       MSG_MESSAGE_HIDDEN_S *msg_data = (MSG_MESSAGE_HIDDEN_S *)data;
+
+       switch (field) {
+       default :
+               ret = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+
+       return ret;
+}
+
+int msg_message_get_list_hnd(void *data, int field, void **value)
+{
+       if (!data)
+               return MSG_ERR_NULL_POINTER;
+
+       int ret = MSG_SUCCESS;
+
+       MSG_MESSAGE_HIDDEN_S *msg_data = (MSG_MESSAGE_HIDDEN_S *)data;
+
+       switch (field) {
+       case MSG_MESSAGE_ADDR_LIST_STRUCT :
+               *value = (void *)msg_data->addr_list;
+               break;
+       default :
+               ret = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+
+       return ret;
+}
+
+int msg_message_set_int_value(void *data, int field, int value)
+{
+       if (!data)
+               return MSG_ERR_NULL_POINTER;
+
+       int ret = MSG_SUCCESS;
+
+       MSG_MESSAGE_HIDDEN_S *msg_data = (MSG_MESSAGE_HIDDEN_S *)data;
+
+       switch (field)
+       {
+       case MSG_MESSAGE_ID_INT :
+               msg_data->msgId = value;
+               break;
+       case MSG_MESSAGE_THREAD_ID_INT :
+               msg_data->threadId = value;
+               break;
+       case MSG_MESSAGE_FOLDER_ID_INT :
+               msg_data->folderId = value;
+               break;
+       case MSG_MESSAGE_TYPE_INT :
+       {
+        if (value == MSG_TYPE_SMS) {
+               msg_data->mainType = MSG_SMS_TYPE;
+               msg_data->subType = MSG_NORMAL_SMS;
+        } else if (value == MSG_TYPE_MMS) {
+               msg_data->mainType = MSG_MMS_TYPE;
+               msg_data->subType = MSG_SENDREQ_MMS;
+        } else if (value == MSG_TYPE_MMS_JAVA) {
+               msg_data->mainType = MSG_MMS_TYPE;
+                       msg_data->subType = MSG_SENDREQ_JAVA_MMS;
+        } else if (value == MSG_TYPE_SMS_SYNCML) {
+               msg_data->mainType = MSG_SMS_TYPE;
+               msg_data->subType = MSG_SYNCML_CP;
+        } else if (value == MSG_TYPE_SMS_REJECT) {
+               msg_data->mainType = MSG_SMS_TYPE;
+               msg_data->subType = MSG_REJECT_SMS;
+        }
+        break;
+       }
+       case MSG_MESSAGE_CLASS_TYPE_INT :
+               msg_data->classType = value;
+               break;
+       case MSG_MESSAGE_STORAGE_ID_INT :
+               msg_data->storageId = value;
+               break;
+       case MSG_MESSAGE_DISPLAY_TIME_INT :
+               msg_data->displayTime = value;
+               break;
+       case MSG_MESSAGE_NETWORK_STATUS_INT :
+               msg_data->networkStatus = value;
+               break;
+       case MSG_MESSAGE_ENCODE_TYPE_INT :
+               msg_data->encodeType = value;
+               break;
+       case MSG_MESSAGE_PRIORITY_INT :
+               msg_data->priority = value;
+               break;
+       case MSG_MESSAGE_DIRECTION_INT :
+               msg_data->direction = value;
+               break;
+       case MSG_MESSAGE_DEST_PORT_INT :
+               msg_data->dstPort = value;
+               break;
+       case MSG_MESSAGE_SRC_PORT_INT :
+               msg_data->srcPort = value;
+               break;
+       case MSG_MESSAGE_ATTACH_COUNT_INT :
+                msg_data->attachCount = value;
+               break;
+       case MSG_MESSAGE_DATA_SIZE_INT :
+               msg_data->dataSize = value;
+               break;
+       default :
+               ret = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+
+       return ret;
+}
+
+int msg_message_set_bool_value(void *data, int field, bool value)
+{
+       if (!data)
+               return MSG_ERR_NULL_POINTER;
+
+       int ret = MSG_SUCCESS;
+
+       MSG_MESSAGE_HIDDEN_S *msg_data = (MSG_MESSAGE_HIDDEN_S *)data;
+
+       switch (field) {
+       case MSG_MESSAGE_READ_BOOL :
+               msg_data->bRead = value;
+               break;
+       case MSG_MESSAGE_PROTECTED_BOOL :
+               msg_data->bProtected = value;
+               break;
+       case MSG_MESSAGE_BACKUP_BOOL :
+               msg_data->bBackup = value;
+               break;
+       case MSG_MESSAGE_PORT_VALID_BOOL :
+               msg_data->bPortValid = value;
+               break;
+       default :
+               ret = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+
+       return ret;
+}
+
+int msg_message_set_str_value(void *data, int field, char *value, int size)
+{
+       if (!data || !value)
+               return MSG_ERR_NULL_POINTER;
+
+       int ret = MSG_SUCCESS;
+
+       MSG_MESSAGE_HIDDEN_S *msg_data = (MSG_MESSAGE_HIDDEN_S *)data;
+
+       switch (field) {
+       case MSG_MESSAGE_REPLY_ADDR_STR :
+               snprintf(msg_data->replyAddress, sizeof(msg_data->replyAddress), "%s", value);
+               break;
+       case MSG_MESSAGE_SUBJECT_STR :
+               snprintf(msg_data->subject, sizeof(msg_data->subject), "%s",value);
+               break;
+       case MSG_MESSAGE_THUMBNAIL_PATH_STR :
+               snprintf(msg_data->thumbPath, sizeof(msg_data->thumbPath), "%s",value);
+               break;
+       case MSG_MESSAGE_SMS_DATA_STR :
+       {
+                if (msg_data->pData)
+                        delete [] static_cast<char*>(msg_data->pData);
+
+                msg_data->dataSize = size;
+
+                msg_data->pData = (void*)new char[msg_data->dataSize+1];
+
+                memcpy((char *)msg_data->pData, value, msg_data->dataSize);
+
+                ((char*) msg_data->pData)[msg_data->dataSize] = '\0';
+       }
+               break;
+       default :
+               ret = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+
+       return ret;
+}
+
+int msg_message_set_struct_hnd(void *data, int field, void *value)
+{
+       if (!data)
+               return MSG_ERR_NULL_POINTER;
+
+       int ret = MSG_SUCCESS;
+
+       MSG_MESSAGE_HIDDEN_S *msg_data = (MSG_MESSAGE_HIDDEN_S *)data;
+
+       switch (field) {
+       default :
+               ret = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+
+       return ret;
+}
+
+void msg_message_copy_message(MSG_MESSAGE_HIDDEN_S *pSrc, MSG_MESSAGE_HIDDEN_S *pDst)
+{
+
+       pDst->msgId = pSrc->msgId;
+       pDst->threadId = pSrc->msgId;
+       pDst->folderId = pSrc->folderId;
+       pDst->mainType = pSrc->mainType;
+       pDst->subType = pSrc->subType;
+       pDst->classType = pSrc->classType;
+       pDst->storageId = pSrc->storageId;
+       pDst->displayTime = pSrc->displayTime;
+       pDst->networkStatus = pSrc->networkStatus;
+       pDst->encodeType = pSrc->encodeType;
+       pDst->bRead = pSrc->bRead;
+       pDst->bProtected = pSrc->bProtected;
+       pDst->bBackup = pSrc->bBackup;
+       pDst->priority = pSrc->priority;
+       pDst->direction = pSrc->direction;
+       pDst->bPortValid = pSrc->bPortValid;
+       pDst->dataSize = pSrc->dataSize;
+       memcpy(pDst->subject, pSrc->subject, sizeof(pDst->subject));
+       if(pSrc->dataSize)
+       {
+               if(pSrc->pMmsData)
+               {
+                       pDst->pMmsData = new char[pSrc->dataSize + 1];
+                       memcpy(pDst->pMmsData, pSrc->pMmsData, pSrc->dataSize);
+               }
+               if(pSrc->pData)
+               {
+                       int data_len = strlen((const char *)pSrc->pData);
+                       pDst->pData = new char[data_len + 1];
+                       strncpy((char *)pDst->pData, (const char *)pSrc->pData, data_len);
+               }
+       }
+       msg_struct_list_s *src_addrlist = pSrc->addr_list;
+       msg_struct_list_s *dst_addrlist = pDst->addr_list;
+       dst_addrlist->nCount = src_addrlist->nCount;
+
+       for(int i=0; i < MAX_TO_ADDRESS_CNT; ++i)
+       {
+               msg_struct_s *src_addr = (msg_struct_s *)src_addrlist->msg_struct_info[i];
+               msg_struct_s *dst_addr = (msg_struct_s *)dst_addrlist->msg_struct_info[i];
+               memcpy(dst_addr->data, src_addr->data, sizeof(MSG_ADDRESS_INFO_S));
+       }
+}
+
+EXPORT_API int msg_get_mms_struct(msg_struct_t msg_struct_handle, msg_struct_t mms_struct_handle)
+{
+       //TODO :: check message type is MMS
+       int ret = MSG_SUCCESS;
+       msg_struct_s *msg_struct = (msg_struct_s *)msg_struct_handle;
+       msg_struct_s *mms_struct = (msg_struct_s *)mms_struct_handle;
+
+       if (msg_struct == NULL || mms_struct == NULL) {
+               return MSG_ERR_INVALID_PARAMETER;
+       }
+
+       if (msg_struct->data == NULL || mms_struct->data == NULL) {
+               return MSG_ERR_INVALID_PARAMETER;
+       }
+
+       if (msg_struct->type != MSG_STRUCT_MESSAGE_INFO || mms_struct->type != MSG_STRUCT_MMS) {
+               return MSG_ERR_INVALID_PARAMETER;
+       }
+
+       MSG_MESSAGE_HIDDEN_S *msg_data = (MSG_MESSAGE_HIDDEN_S *)msg_struct->data;
+
+       MMS_MESSAGE_DATA_S *tmp_mms_data  = (MMS_MESSAGE_DATA_S *)calloc(1, sizeof(MMS_MESSAGE_DATA_S));
+
+       _MsgMmsDeserializeMessageData(tmp_mms_data, (char*)msg_data->pMmsData);
+
+       convert_from_mmsdata(tmp_mms_data, mms_struct);
+
+       _MsgMmsReleasePageList(tmp_mms_data);
+       _MsgMmsReleaseRegionList(tmp_mms_data);
+       _MsgMmsReleaseAttachList(tmp_mms_data);
+       _MsgMmsReleaseTransitionList(tmp_mms_data);
+       _MsgMmsReleaseMetaList(tmp_mms_data);
+       free(tmp_mms_data);
+
+       return ret;
+}
+
+EXPORT_API int msg_set_mms_struct(msg_struct_t msg_struct_handle, msg_struct_t mms_struct_handle)
+{
+       //TODO :: check message type is MMS
+       int ret = MSG_SUCCESS;
+       msg_struct_s *msg_struct = (msg_struct_s *)msg_struct_handle;
+       msg_struct_s *mms_struct = (msg_struct_s *)mms_struct_handle;
+
+       if (msg_struct == NULL || mms_struct == NULL) {
+               return MSG_ERR_INVALID_PARAMETER;
+       }
+
+       if (msg_struct->data == NULL || mms_struct->data == NULL) {
+               return MSG_ERR_INVALID_PARAMETER;
+       }
+
+       if (msg_struct->type != MSG_STRUCT_MESSAGE_INFO || mms_struct->type != MSG_STRUCT_MMS) {
+               return MSG_ERR_INVALID_PARAMETER;
+       }
+
+       MSG_MESSAGE_HIDDEN_S *msg_data = (MSG_MESSAGE_HIDDEN_S *)msg_struct->data;
+
+       MMS_MESSAGE_DATA_S *tmp_mms_data = (MMS_MESSAGE_DATA_S *)calloc(1,sizeof(MMS_MESSAGE_DATA_S));
+
+       convert_to_mmsdata(mms_struct, tmp_mms_data);
+
+       msg_data->pMmsData = _MsgMmsSerializeMessageData(tmp_mms_data, &(msg_data->dataSize));
+
+       _MsgMmsReleasePageList(tmp_mms_data);
+       _MsgMmsReleaseRegionList(tmp_mms_data);
+       _MsgMmsReleaseAttachList(tmp_mms_data);
+       _MsgMmsReleaseTransitionList(tmp_mms_data);
+       _MsgMmsReleaseMetaList(tmp_mms_data);
+       free(tmp_mms_data);
+       return ret;
+}
+
diff --git a/mapi/msg_mms.cpp b/mapi/msg_mms.cpp
new file mode 100755 (executable)
index 0000000..2ad6f04
--- /dev/null
@@ -0,0 +1,1294 @@
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#include <stdio.h>
+#include <string.h>
+
+#include <MsgHandle.h>
+#include <MsgException.h>
+#include "MsgTypes.h"
+#include "MsgMmsTypes.h"
+#include "MsgMmsMessage.h"
+
+#include "msg.h"
+#include "msg_private.h"
+
+//Internel Struct
+typedef struct _MMS_DATA_S
+{
+       GList                   *pagelist;
+       GList                   *regionlist;
+       GList                   *attachlist;
+       GList                   *transitionlist;
+       GList                   *metalist;
+       MMS_SMIL_ROOTLAYOUT     rootlayout;
+       MMS_APPID_INFO_S        msgAppId;
+} MMS_DATA_HIDDEN_S;
+
+typedef struct
+{
+       MmsSmilMediaType        mediatype; /**< Indicates the SMIL media type. see enum MmsSmilMediaType */
+
+       char                    szSrc[MSG_FILEPATH_LEN_MAX];/**< Indicates the media source name */
+       char                    szFileName[MSG_FILENAME_LEN_MAX]; /**< Indicates the file name */
+       char                    szFilePath[MSG_FILEPATH_LEN_MAX]; /**< Indicates the file path */
+       char                    szContentID[MSG_MSG_ID_LEN+1]; /**< Indicates the content id */
+       char                    regionId[MAX_SMIL_REGION_ID]; /**< Indicates the region id */
+       char                    szAlt[MAX_SMIL_ALT_LEN]; /**< Indicates the alternative text to be displayed in failure case */
+       MsgDrmType              drmType; /**< Indicates the drm type. see enum MsgDrmType */
+       char                    szDrm2FullPath[MSG_FILEPATH_LEN_MAX];  /**< Indicates the fullpath of the DRM */
+       msg_struct_s *pText;
+       msg_struct_s *pAVI;
+} MMS_MEDIA_HIDDEN_S;
+
+static void __msg_mms_release_mms(msg_struct_s *mms_struct);
+static void __msg_mms_release_page(msg_struct_s *page_struct);
+static void __msg_mms_release_media(msg_struct_s *media_struct);
+static void __msg_mms_release_region(msg_struct_s *region_struct);
+static void __msg_mms_release_attach(msg_struct_s *attach_struct);
+static void __msg_mms_release_transition(msg_struct_s *transition_struct);
+static void __msg_mms_release_meta(msg_struct_s *meta_struct);
+
+/*==================================================================================================
+                                     FUNCTION IMPLEMENTATION
+==================================================================================================*/
+static inline void *get_msg_struct_data(msg_struct_s *msg_struct)
+{
+       if (msg_struct == NULL)
+               return NULL;
+
+       return msg_struct->data;
+}
+
+msg_struct_s *msg_mms_create_struct(int type)
+{
+       msg_struct_s *msg_struct = new msg_struct_s;
+       bzero(msg_struct, sizeof(msg_struct_s));
+
+       msg_struct->type = type;
+       msg_struct->data = msg_mms_create_struct_data(type);
+
+       return msg_struct;
+}
+
+void *msg_mms_create_struct_data(int field)
+{
+       void *data = NULL;
+
+       switch(field)
+       {
+       case MSG_STRUCT_MMS:
+               data = (void *)new MMS_DATA_HIDDEN_S;
+               bzero(data, sizeof(MMS_DATA_HIDDEN_S));
+               break;
+       case MSG_STRUCT_MMS_PAGE:
+               data = (void *)new MMS_PAGE_S;
+               bzero(data, sizeof(MMS_PAGE_S));
+               break;
+       case MSG_STRUCT_MMS_MEDIA:
+       {
+               MMS_MEDIA_HIDDEN_S *media = new MMS_MEDIA_HIDDEN_S;
+               bzero(media, sizeof(MMS_MEDIA_HIDDEN_S));
+
+               media->pText = msg_mms_create_struct(MSG_STRUCT_MMS_SMIL_TEXT);
+               media->pAVI = msg_mms_create_struct(MSG_STRUCT_MMS_SMIL_AVI);
+               data = (void *)media;
+       }
+               break;
+       case MSG_STRUCT_MMS_ATTACH:
+               data = (void *)new MMS_ATTACH_S;
+               bzero(data, sizeof(MMS_ATTACH_S));
+               break;
+       case MSG_STRUCT_MMS_REGION:
+               data = (void *)new MMS_SMIL_REGION;
+               bzero(data, sizeof(MMS_SMIL_REGION));
+               ((MMS_SMIL_REGION *)data)->fit = MMSUI_IMAGE_REGION_FIT_MEET;
+               break;
+       case MSG_STRUCT_MMS_TRANSITION:
+               data = (void *)new MMS_SMIL_TRANSITION;
+               bzero(data, sizeof(MMS_SMIL_TRANSITION));
+               break;
+       case MSG_STRUCT_MMS_META:
+               data = (void *)new MMS_SMIL_META;
+               bzero(data, sizeof(MMS_SMIL_META));
+               break;
+       case MSG_STRUCT_MMS_SMIL_TEXT:
+               data = (void *)new MmsSmilText;
+               bzero(data, sizeof(MmsSmilText));
+               break;
+       case MSG_STRUCT_MMS_SMIL_AVI:
+               data = (void *)new MmsSmilAVI;
+               bzero(data, sizeof(MmsSmilAVI));
+               break;
+       }
+
+       return data;
+}
+
+void msg_mms_list_item_free_func(gpointer data)
+{
+       msg_struct_s *msg_struct = (msg_struct_s *)data;
+       if (msg_struct->type == MSG_STRUCT_MMS_MEDIA)  {
+               __msg_mms_release_media(msg_struct);
+       } else if (msg_struct->type == MSG_STRUCT_MMS_PAGE) {
+               __msg_mms_release_page(msg_struct);
+       } else if (msg_struct->type == MSG_STRUCT_MMS_ATTACH) {
+               __msg_mms_release_attach(msg_struct);
+       } else if (msg_struct->type == MSG_STRUCT_MMS_REGION) {
+               __msg_mms_release_region(msg_struct);
+       } else if (msg_struct->type == MSG_STRUCT_MMS_TRANSITION) {
+               __msg_mms_release_transition(msg_struct);
+       } else if (msg_struct->type == MSG_STRUCT_MMS_META) {
+               __msg_mms_release_meta(msg_struct);
+       }
+}
+
+void __msg_mms_release_page(msg_struct_s *page_struct)
+{
+       MMS_PAGE_S *page = (MMS_PAGE_S *)page_struct->data;
+       if (page->medialist) {
+                g_list_free_full(page->medialist, msg_mms_list_item_free_func);
+       }
+
+       delete (MMS_PAGE_S *)page;
+       page_struct->data = NULL;
+
+       delete page_struct;
+}
+
+void __msg_mms_release_media(msg_struct_s *media_struct)
+{
+       MMS_MEDIA_HIDDEN_S *media = (MMS_MEDIA_HIDDEN_S *)media_struct->data;
+
+       if (media->pText)
+               msg_mms_release_struct(&media->pText);
+
+       if (media->pAVI)
+               msg_mms_release_struct(&media->pAVI);
+
+       delete (MMS_MEDIA_HIDDEN_S *)media;
+
+       media_struct->data = NULL;
+
+       delete media_struct;
+}
+
+void __msg_mms_release_attach(msg_struct_s *attach_struct)
+{
+       MMS_ATTACH_S *attach = (MMS_ATTACH_S *)attach_struct->data;
+
+       delete (MMS_ATTACH_S *)attach;
+
+       attach_struct->data = NULL;
+
+       delete attach_struct;
+}
+
+void __msg_mms_release_region(msg_struct_s *region_struct)
+{
+       MMS_SMIL_REGION *region = (MMS_SMIL_REGION *)region_struct->data;
+
+       delete (MMS_SMIL_REGION *)region;
+
+       region_struct->data = NULL;
+
+       delete region_struct;
+}
+
+void __msg_mms_release_transition(msg_struct_s *transition_struct)
+{
+       MMS_SMIL_TRANSITION *transition = (MMS_SMIL_TRANSITION *)transition_struct->data;
+
+       delete (MMS_SMIL_TRANSITION *)transition;
+
+       transition_struct->data = NULL;
+
+       delete transition_struct;
+}
+
+void __msg_mms_release_meta(msg_struct_s *meta_struct)
+{
+       MMS_SMIL_META *meta = (MMS_SMIL_META *)meta_struct->data;
+
+       delete (MMS_SMIL_META *)meta;
+
+       meta_struct->data = NULL;
+
+       delete meta_struct;
+}
+
+void __msg_mms_release_mms(msg_struct_s *mms_struct)
+{
+       MMS_DATA_HIDDEN_S *mms = (MMS_DATA_HIDDEN_S *)mms_struct->data;
+
+       if (mms->pagelist) {
+               g_list_free_full(mms->pagelist, msg_mms_list_item_free_func);
+               mms->pagelist = NULL;
+       }
+
+       if (mms->regionlist) {
+               g_list_free_full(mms->regionlist, msg_mms_list_item_free_func);
+               mms->regionlist = NULL;
+       }
+
+       if (mms->attachlist) {
+               g_list_free_full(mms->attachlist, msg_mms_list_item_free_func);
+               mms->attachlist = NULL;
+       }
+
+       if (mms->transitionlist) {
+               g_list_free_full(mms->transitionlist, msg_mms_list_item_free_func);
+               mms->transitionlist = NULL;
+       }
+
+       if (mms->metalist) {
+               g_list_free_full(mms->metalist, msg_mms_list_item_free_func);
+               mms->metalist = NULL;
+       }
+
+       delete (MMS_DATA_HIDDEN_S *)mms;
+
+       mms_struct->data = NULL;
+
+       delete mms_struct;
+}
+
+int msg_mms_release_struct(msg_struct_s **msg_struct_data)
+{
+       msg_struct_s *msg_struct = (msg_struct_s *)*msg_struct_data;
+       int type = msg_struct->type;
+
+       switch(type)
+       {
+       case MSG_STRUCT_MMS:
+               __msg_mms_release_mms(*msg_struct_data);
+               *msg_struct_data = NULL;
+               break;
+       case MSG_STRUCT_MMS_PAGE:
+               __msg_mms_release_page(*msg_struct_data);
+               *msg_struct_data = NULL;
+               break;
+       case MSG_STRUCT_MMS_MEDIA:
+               __msg_mms_release_media(*msg_struct_data);
+               *msg_struct_data = NULL;
+               break;
+       case MSG_STRUCT_MMS_ATTACH:
+               __msg_mms_release_attach(*msg_struct_data);
+               *msg_struct_data = NULL;
+               break;
+       case MSG_STRUCT_MMS_REGION:
+               __msg_mms_release_attach(*msg_struct_data);
+               *msg_struct_data = NULL;
+               break;
+       case MSG_STRUCT_MMS_TRANSITION:
+               __msg_mms_release_transition(*msg_struct_data);
+               *msg_struct_data = NULL;
+               break;
+       case MSG_STRUCT_MMS_META:
+               __msg_mms_release_meta(*msg_struct_data);
+               *msg_struct_data = NULL;
+               break;
+       case MSG_STRUCT_MMS_SMIL_TEXT:
+               delete (MmsSmilText*)msg_struct->data;
+               delete msg_struct;
+               *msg_struct_data = NULL;
+               break;
+       case MSG_STRUCT_MMS_SMIL_AVI:
+               delete (MmsSmilAVI*)msg_struct->data;
+               delete msg_struct;
+               *msg_struct_data = NULL;
+               break;
+       }
+
+       return 0;
+}
+
+int msg_mms_get_int_value(msg_struct_s *msg_struct, int field, int *value)
+{
+       msg_error_t err = MSG_SUCCESS;
+
+       switch(msg_struct->type) {
+       case MSG_STRUCT_MMS:
+       {
+               MMS_DATA_HIDDEN_S *mms_data = (MMS_DATA_HIDDEN_S *)msg_struct->data;
+               if (field == MSG_MMS_ROOTLAYOUT_WIDTH_INT)
+                       *value = mms_data->rootlayout.width.value;
+               else if (field == MSG_MMS_ROOTLAYOUT_HEIGHT_INT)
+                       *value = mms_data->rootlayout.height.value;
+               else if (field == MSG_MMS_ROOTLAYOUT_BGCOLOR_INT)
+                       *value = mms_data->rootlayout.bgColor;
+               else
+                       err = MSG_ERR_INVALID_PARAMETER;
+       }
+       break;
+       case MSG_STRUCT_MMS_PAGE:
+       {
+               MMS_PAGE_S *mms_page_data = (MMS_PAGE_S *)msg_struct->data;
+               if (field == MSG_MMS_PAGE_PAGE_DURATION_INT)
+                       *value = mms_page_data->nDur;
+               else if (field == MSG_MMS_PAGE_BEGIN_TIME_INT)
+                       *value = mms_page_data->nBegin;
+               else if (field == MSG_MMS_PAGE_END_TIME_INT)
+                       *value = mms_page_data->nEnd;
+               else if (field == MSG_MMS_PAGE_MIN_INT)
+                       *value = mms_page_data->nMin;
+               else if (field == MSG_MMS_PAGE_MAX_INT)
+                       *value = mms_page_data->nMax;
+               else if (field == MSG_MMS_PAGE_REPEAT_INT)
+                       *value = mms_page_data->nRepeat;
+               else
+                       err = MSG_ERR_INVALID_PARAMETER;
+       }
+       break;
+       case MSG_STRUCT_MMS_MEDIA:
+       {
+               MMS_MEDIA_S *mms_media_data = (MMS_MEDIA_S *)msg_struct->data;
+               if (field == MSG_MMS_MEDIA_TYPE_INT)
+                       *value = mms_media_data->mediatype;
+               else if (field == MSG_MMS_MEDIA_DRM_TYPE_INT)
+                       *value = mms_media_data->drmType;
+               else
+                       err = MSG_ERR_INVALID_PARAMETER;
+       }
+       break;
+       case MSG_STRUCT_MMS_ATTACH:
+       {
+               MMS_ATTACH_S *mms_attach_data = (MMS_ATTACH_S *)msg_struct->data;
+               if (field == MSG_MMS_ATTACH_MIME_TYPE_INT)
+                       *value = mms_attach_data->mediatype;
+               else if (field == MSG_MMS_ATTACH_FILESIZE_INT)
+                       *value = mms_attach_data->fileSize;
+               else if (field == MSG_MMS_ATTACH_DRM_TYPE_INT)
+                       *value = mms_attach_data->drmType;
+               else
+                       err = MSG_ERR_INVALID_PARAMETER;
+       }
+       break;
+       case MSG_STRUCT_MMS_REGION:
+       {
+               MMS_SMIL_REGION *mms_region_data = (MMS_SMIL_REGION *)msg_struct->data;
+               if (field == MSG_MMS_REGION_LENGTH_LEFT_INT)
+                       *value = mms_region_data->nLeft.value;
+               else if (field == MSG_MMS_REGION_LENGTH_TOP_INT)
+                       *value = mms_region_data->nTop.value;
+               else if (field == MSG_MMS_REGION_LENGTH_WIDTH_INT)
+                       *value = mms_region_data->width.value;
+               else if (field == MSG_MMS_REGION_LENGTH_HEIGHT_INT)
+                       *value = mms_region_data->height.value;
+               else if (field == MSG_MMS_REGION_BGCOLOR_INT)
+                       *value = mms_region_data->bgColor;
+               else if (field == MSG_MMS_REGION_FIT_TYPE_INT)
+                       *value = mms_region_data->fit;
+               else
+                       err = MSG_ERR_INVALID_PARAMETER;
+       }
+       break;
+       case MSG_STRUCT_MMS_TRANSITION:
+       {
+               MMS_SMIL_TRANSITION *mms_transition_data = (MMS_SMIL_TRANSITION *)msg_struct->data;
+               if (field == MSG_MMS_TRANSITION_TYPE_INT)
+                       *value = mms_transition_data->nType;
+               else if (field == MSG_MMS_TRANSITION_SUBTYPE_INT)
+                       *value = mms_transition_data->nSubType;
+               else if (field == MSG_MMS_TRANSITION_DURATION_INT)
+                       *value = mms_transition_data->nDur;
+               else
+                       err = MSG_ERR_INVALID_PARAMETER;
+       }
+       break;
+       case MSG_STRUCT_MMS_SMIL_TEXT:
+       {
+               MmsSmilText *mms_smil_text_data = (MmsSmilText *)msg_struct->data;
+               if (field == MSG_MMS_SMIL_TEXT_REPEAT_INT)
+                       *value = mms_smil_text_data->nRepeat;
+               else if (field == MSG_MMS_SMIL_TEXT_BEGIN_INT)
+                       *value = mms_smil_text_data->nBegin;
+               else if (field == MSG_MMS_SMIL_TEXT_END_INT)
+                       *value = mms_smil_text_data->nEnd;
+               else if (field == MSG_MMS_SMIL_TEXT_DURTIME_INT)
+                       *value = mms_smil_text_data->nDurTime;
+               else if (field == MSG_MMS_SMIL_TEXT_BGCOLOR_INT)
+                       *value = mms_smil_text_data->nBgColor;
+               else if (field == MSG_MMS_SMIL_TEXT_DIRECTION_TYPE_INT)
+                       *value = mms_smil_text_data->nDirection;
+               else if (field == MSG_MMS_SMIL_TEXT_SIZE_INT)
+                       *value = mms_smil_text_data->nSize;
+               else if (field == MSG_MMS_SMIL_TEXT_COLOR_INT)
+                       *value = mms_smil_text_data->nColor;
+               else
+                       err = MSG_ERR_INVALID_PARAMETER;
+       }
+       break;
+       case MSG_STRUCT_MMS_SMIL_AVI:
+       {
+               MmsSmilAVI *mms_smil_avi_data = (MmsSmilAVI *)msg_struct->data;
+               if (field == MSG_MMS_SMIL_AVI_REPEAT_INT)
+                       *value = mms_smil_avi_data->nRepeat;
+               else if (field == MSG_MMS_SMIL_AVI_BEGIN_INT)
+                       *value = mms_smil_avi_data->nBegin;
+               else if (field == MSG_MMS_SMIL_AVI_END_INT)
+                       *value = mms_smil_avi_data->nEnd;
+               else if (field == MSG_MMS_SMIL_AVI_DURTIME_INT)
+                       *value = mms_smil_avi_data->nDurTime;
+               else if (field == MSG_MMS_SMIL_AVI_BGCOLOR_INT)
+                       *value = mms_smil_avi_data->nBgColor;
+               else
+                       err = MSG_ERR_INVALID_PARAMETER;
+       }
+       break;
+       default :
+               err = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+       return MSG_SUCCESS;
+}
+
+int msg_mms_get_str_value(msg_struct_s *msg_struct, int field, char *value, int size)
+{
+       msg_error_t err = MSG_SUCCESS;
+
+       switch(msg_struct->type) {
+       case MSG_STRUCT_MMS_MEDIA:
+       {
+               MMS_MEDIA_S *mms_media_data = (MMS_MEDIA_S *)msg_struct->data;
+               if (field == MSG_MMS_MEDIA_SRC_STR)
+                       strncpy(value, mms_media_data->szSrc, size);
+               else if (field == MSG_MMS_MEDIA_FILENAME_STR)
+                       strncpy(value, mms_media_data->szFileName, size);
+               else if (field == MSG_MMS_MEDIA_FILEPATH_STR)
+                       strncpy(value, mms_media_data->szFilePath, size);
+               else if (field == MSG_MMS_MEDIA_CONTENT_ID_STR)
+                       strncpy(value, mms_media_data->szContentID, size);
+               else if (field == MSG_MMS_MEDIA_REGION_ID_STR)
+                       strncpy(value, mms_media_data->regionId, size);
+               else if (field == MSG_MMS_MEDIA_ALTERNATIVE_STR)
+                       strncpy(value, mms_media_data->szAlt, size);
+               else if (field == MSG_MMS_MEDIA_DRM_FULLPATH_STR)
+                       strncpy(value, mms_media_data->szDrm2FullPath, size);
+               else
+                       err = MSG_ERR_INVALID_PARAMETER;
+       }
+       break;
+       case MSG_STRUCT_MMS_ATTACH:
+       {
+               MMS_ATTACH_S *mms_attach_data = (MMS_ATTACH_S *)msg_struct->data;
+               if (field == MSG_MMS_ATTACH_FILENAME_STR)
+                       strncpy(value, mms_attach_data->szFileName, size);
+               else if (field == MSG_MMS_ATTACH_FILEPATH_STR)
+                       strncpy(value, mms_attach_data->szFilePath, size);
+               else if (field == MSG_MMS_ATTACH_DRM_FULLPATH_STR)
+                       strncpy(value, mms_attach_data->szDrm2FullPath, size);
+               else
+                       err = MSG_ERR_INVALID_PARAMETER;
+       }
+       break;
+       case MSG_STRUCT_MMS_REGION:
+       {
+               MMS_SMIL_REGION *mms_region_data = (MMS_SMIL_REGION *)msg_struct->data;
+               if (field == MSG_MMS_REGION_ID_STR)
+                       strncpy(value, mms_region_data->szID, size);
+               else
+                       err = MSG_ERR_INVALID_PARAMETER;
+       }
+       break;
+       case MSG_STRUCT_MMS_TRANSITION:
+       {
+               MMS_SMIL_TRANSITION *mms_transition_data = (MMS_SMIL_TRANSITION *)msg_struct->data;
+               if (field == MSG_MMS_TRANSITION_ID_STR)
+                       strncpy(value, mms_transition_data->szID, size);
+               else
+                       err = MSG_ERR_INVALID_PARAMETER;
+       }
+       break;
+       case MSG_STRUCT_MMS_META:
+       {
+               MMS_SMIL_META *mms_meta_data = (MMS_SMIL_META *)msg_struct->data;
+               if (field == MSG_MMS_META_ID_STR)
+                       strncpy(value, mms_meta_data->szID, size);
+               else if (field == MSG_MMS_META_NAME_STR)
+                       strncpy(value, mms_meta_data->szName, size);
+               else if (field == MSG_MMS_META_CONTENT_STR)
+                       strncpy(value, mms_meta_data->szContent, size);
+               else
+                       err = MSG_ERR_INVALID_PARAMETER;
+       }
+       break;
+       case MSG_STRUCT_MMS_SMIL_TEXT:
+       {
+               MmsSmilText *mms_smil_text_data = (MmsSmilText *)msg_struct->data;
+               if (field == MSG_MMS_SMIL_TEXT_TRANSITION_IN_ID_STR)
+                       strncpy(value, mms_smil_text_data->szTransInId, size);
+               else if (field == MSG_MMS_SMIL_TEXT_TRANSITION_OUT_ID_STR)
+                       strncpy(value, mms_smil_text_data->szTransOutId, size);
+               else
+                       err = MSG_ERR_INVALID_PARAMETER;
+       }
+       break;
+       case MSG_STRUCT_MMS_SMIL_AVI:
+       {
+               MmsSmilAVI *mms_smil_avi_data = (MmsSmilAVI *)msg_struct->data;
+               if (field == MSG_MMS_SMIL_AVI_TRANSITION_IN_ID_STR)
+                       strncpy(value, mms_smil_avi_data->szTransInId, size);
+               else if (field == MSG_MMS_SMIL_AVI_TRANSITION_OUT_ID_STR)
+                       strncpy(value, mms_smil_avi_data->szTransOutId, size);
+               else
+                       err = MSG_ERR_INVALID_PARAMETER;
+       }
+       break;
+       default :
+                       err = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+       return MSG_SUCCESS;
+}
+
+int msg_mms_get_bool_value(msg_struct_s *msg_struct, int field, bool *value)
+{
+       msg_error_t err = MSG_SUCCESS;
+
+       switch(msg_struct->type) {
+       case MSG_STRUCT_MMS:
+       {
+               MMS_DATA_HIDDEN_S *mms_data = (MMS_DATA_HIDDEN_S *)msg_struct->data;
+               if (field == MSG_MMS_ROOTLAYOUT_WIDTH_PERCENT_BOOL)
+                       *value = mms_data->rootlayout.width.bUnitPercent;
+               else if (field == MSG_MMS_ROOTLAYOUT_HEIGHT_PERCENT_BOOL)
+                       *value = mms_data->rootlayout.height.bUnitPercent;
+               else
+                       err = MSG_ERR_INVALID_PARAMETER;
+       }
+       break;
+       case MSG_STRUCT_MMS_REGION:
+       {
+               MMS_SMIL_REGION *mms_region_data = (MMS_SMIL_REGION *)msg_struct->data;
+               if (field == MSG_MMS_REGION_LENGTH_LEFT_PERCENT_BOOL)
+                       *value = mms_region_data->nLeft.bUnitPercent;
+               else if (field == MSG_MMS_REGION_LENGTH_TOP_PERCENT_BOOL)
+                       *value = mms_region_data->nTop.bUnitPercent;
+               else if (field == MSG_MMS_REGION_LENGTH_WIDTH_PERCENT_BOOL)
+                       *value = mms_region_data->width.bUnitPercent;
+               else if (field == MSG_MMS_REGION_LENGTH_HEIGHT_PERCENT_BOOL)
+                       *value = mms_region_data->height.bUnitPercent;
+               else
+                       err = MSG_ERR_INVALID_PARAMETER;
+       }
+       break;
+       case MSG_STRUCT_MMS_SMIL_TEXT:
+       {
+               MmsSmilText *mms_smil_text_data = (MmsSmilText *)msg_struct->data;
+               if (field == MSG_MMS_SMIL_TEXT_BOLD_BOOL)
+                       *value = mms_smil_text_data->bBold;
+               else if (field == MSG_MMS_SMIL_TEXT_UNDERLINE_BOOL)
+                       *value = mms_smil_text_data->bUnderLine;
+               else if (field == MSG_MMS_SMIL_TEXT_ITALIC_BOOL)
+                       *value = mms_smil_text_data->bItalic;
+               else if (field == MSG_MMS_SMIL_TEXT_REVERSE_BOOL)
+                       *value = mms_smil_text_data->bReverse;
+               else
+                       err = MSG_ERR_INVALID_PARAMETER;
+       }
+       break;
+       default :
+               err = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+       return MSG_SUCCESS;
+}
+
+int msg_mms_get_struct_handle(msg_struct_s *msg_struct, int field, msg_struct_s **value)
+{
+       msg_error_t err = MSG_SUCCESS;
+
+       switch(msg_struct->type) {
+       case MSG_STRUCT_MMS_MEDIA:
+       {
+               MMS_MEDIA_HIDDEN_S *mms_media_data = (MMS_MEDIA_HIDDEN_S *)msg_struct->data;
+               if (field == MSG_MMS_MEDIA_SMIL_TEXT_HND)
+                       *value = mms_media_data->pText;
+               else if (field == MSG_MMS_MEDIA_SMIL_AVI_HND)
+                       *value = mms_media_data->pAVI;
+               else
+                       err = MSG_ERR_INVALID_PARAMETER;
+       }
+       break;
+       default :
+               err = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+       return MSG_SUCCESS;
+}
+
+int msg_mms_get_list_handle(msg_struct_s *msg_struct, int field, msg_list_handle_t *value)
+{
+       msg_error_t err = MSG_SUCCESS;
+
+       switch(msg_struct->type) {
+       case MSG_STRUCT_MMS:
+       {
+               MMS_DATA_HIDDEN_S *mms_data = (MMS_DATA_HIDDEN_S *)msg_struct->data;
+               if (field == MSG_MMS_PAGE_LIST_HND)
+                       *value = (msg_list_handle_t)mms_data->pagelist;
+               else if (field == MSG_MMS_REGION_LIST_HND)
+                       *value = (msg_list_handle_t)mms_data->regionlist;
+               else if (field == MSG_MMS_ATTACH_LIST_HND)
+                       *value = (msg_list_handle_t)mms_data->attachlist;
+               else if (field == MSG_MMS_TRANSITION_LIST_HND)
+                       *value = (msg_list_handle_t)mms_data->transitionlist;
+               else if (field == MSG_MMS_META_LIST_HND)
+                       *value = (msg_list_handle_t)mms_data->metalist;
+               else
+                       err = MSG_ERR_INVALID_PARAMETER;
+       }
+       break;
+       case MSG_STRUCT_MMS_PAGE:
+       {
+               MMS_PAGE_S *mms_page_data = (MMS_PAGE_S *)msg_struct->data;
+               if (field == MSG_MMS_PAGE_MEDIA_LIST_HND)
+                       *value = (msg_list_handle_t)mms_page_data->medialist;
+               else
+                       err = MSG_ERR_INVALID_PARAMETER;
+       }
+       break;
+       default :
+               err = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+       return MSG_SUCCESS;
+}
+/*SET*/
+int msg_mms_set_int_value(msg_struct_s *msg_struct, int field, int value)
+{
+       msg_error_t err = MSG_SUCCESS;
+
+       switch(msg_struct->type) {
+       case MSG_STRUCT_MMS:
+       {
+               MMS_DATA_HIDDEN_S *mms_data = (MMS_DATA_HIDDEN_S *)msg_struct->data;
+               if (field == MSG_MMS_ROOTLAYOUT_WIDTH_INT)
+                       mms_data->rootlayout.width.value = value;
+               else if (field == MSG_MMS_ROOTLAYOUT_HEIGHT_INT)
+                       mms_data->rootlayout.height.value = value;
+               else if (field == MSG_MMS_ROOTLAYOUT_BGCOLOR_INT)
+                       mms_data->rootlayout.bgColor = value;
+               else
+                       err = MSG_ERR_INVALID_PARAMETER;
+       }
+       break;
+       case MSG_STRUCT_MMS_PAGE:
+       {
+               MMS_PAGE_S *mms_page_data = (MMS_PAGE_S *)msg_struct->data;
+               if (field == MSG_MMS_PAGE_PAGE_DURATION_INT)
+                       mms_page_data->nDur = value;
+               else if (field == MSG_MMS_PAGE_BEGIN_TIME_INT)
+                       mms_page_data->nBegin = value;
+               else if (field == MSG_MMS_PAGE_END_TIME_INT)
+                       mms_page_data->nEnd = value;
+               else if (field == MSG_MMS_PAGE_MIN_INT)
+                       mms_page_data->nMin = value;
+               else if (field == MSG_MMS_PAGE_MAX_INT)
+                       mms_page_data->nMax = value;
+               else if (field == MSG_MMS_PAGE_REPEAT_INT)
+                       mms_page_data->nRepeat = value;
+               else
+                       err = MSG_ERR_INVALID_PARAMETER;
+       }
+       break;
+       case MSG_STRUCT_MMS_MEDIA:
+       {
+               MMS_MEDIA_S *mms_media_data = (MMS_MEDIA_S *)msg_struct->data;
+               if (field == MSG_MMS_MEDIA_TYPE_INT)
+                       mms_media_data->mediatype = (MmsSmilMediaType)value;
+               else if (field == MSG_MMS_MEDIA_DRM_TYPE_INT)
+                       mms_media_data->drmType = (MsgDrmType)value;
+               else
+                       err = MSG_ERR_INVALID_PARAMETER;
+       }
+       break;
+       case MSG_STRUCT_MMS_ATTACH:
+       {
+               MMS_ATTACH_S *mms_attach_data = (MMS_ATTACH_S *)msg_struct->data;
+               if (field == MSG_MMS_ATTACH_MIME_TYPE_INT)
+                       mms_attach_data->mediatype = (MimeType)value;
+               else if (field == MSG_MMS_ATTACH_FILESIZE_INT)
+                       mms_attach_data->fileSize = value;
+               else if (field == MSG_MMS_ATTACH_DRM_TYPE_INT)
+                       mms_attach_data->drmType = (MsgDrmType)value;
+               else
+                       err = MSG_ERR_INVALID_PARAMETER;
+       }
+       break;
+       case MSG_STRUCT_MMS_REGION:
+       {
+               MMS_SMIL_REGION *mms_region_data = (MMS_SMIL_REGION *)msg_struct->data;
+               if (field == MSG_MMS_REGION_LENGTH_LEFT_INT)
+                       mms_region_data->nLeft.value = value;
+               else if (field == MSG_MMS_REGION_LENGTH_TOP_INT)
+                       mms_region_data->nTop.value = value;
+               else if (field == MSG_MMS_REGION_LENGTH_WIDTH_INT)
+                       mms_region_data->width.value = value;
+               else if (field == MSG_MMS_REGION_LENGTH_HEIGHT_INT)
+                       mms_region_data->height.value = value;
+               else if (field == MSG_MMS_REGION_BGCOLOR_INT)
+                       mms_region_data->bgColor = value;
+               else if (field == MSG_MMS_REGION_FIT_TYPE_INT)
+                       mms_region_data->fit = (REGION_FIT_TYPE_T)value;
+               else
+                       err = MSG_ERR_INVALID_PARAMETER;
+       }
+       break;
+       case MSG_STRUCT_MMS_TRANSITION:
+       {
+               MMS_SMIL_TRANSITION *mms_transition_data = (MMS_SMIL_TRANSITION *)msg_struct->data;
+               if (field == MSG_MMS_TRANSITION_TYPE_INT)
+                       mms_transition_data->nType = (MmsSmilTransType)value;
+               else if (field == MSG_MMS_TRANSITION_SUBTYPE_INT)
+                       mms_transition_data->nSubType = (MmsSmilTransSubType)value;
+               else if (field == MSG_MMS_TRANSITION_DURATION_INT)
+                       mms_transition_data->nDur = value;
+               else
+                       err = MSG_ERR_INVALID_PARAMETER;
+       }
+       break;
+       case MSG_STRUCT_MMS_SMIL_TEXT:
+       {
+               MmsSmilText *mms_smil_text_data = (MmsSmilText *)msg_struct->data;
+               if (field == MSG_MMS_SMIL_TEXT_REPEAT_INT)
+                       mms_smil_text_data->nRepeat = value;
+               else if (field == MSG_MMS_SMIL_TEXT_BEGIN_INT)
+                       mms_smil_text_data->nBegin = value;
+               else if (field == MSG_MMS_SMIL_TEXT_END_INT)
+                       mms_smil_text_data->nEnd = value;
+               else if (field == MSG_MMS_SMIL_TEXT_DURTIME_INT)
+                       mms_smil_text_data->nDurTime = value;
+               else if (field == MSG_MMS_SMIL_TEXT_BGCOLOR_INT)
+                       mms_smil_text_data->nBgColor = value;
+               else if (field == MSG_MMS_SMIL_TEXT_DIRECTION_TYPE_INT)
+                       mms_smil_text_data->nDirection = (MmsTextDirection)value;
+               else if (field == MSG_MMS_SMIL_TEXT_SIZE_INT)
+                       mms_smil_text_data->nSize = value;
+               else if (field == MSG_MMS_SMIL_TEXT_COLOR_INT)
+                       mms_smil_text_data->nColor = value;
+               else
+                       err = MSG_ERR_INVALID_PARAMETER;
+       }
+       break;
+       case MSG_STRUCT_MMS_SMIL_AVI:
+       {
+               MmsSmilAVI *mms_smil_avi_data = (MmsSmilAVI *)msg_struct->data;
+               if (field == MSG_MMS_SMIL_AVI_REPEAT_INT)
+                       mms_smil_avi_data->nRepeat = value;
+               else if (field == MSG_MMS_SMIL_AVI_BEGIN_INT)
+                       mms_smil_avi_data->nBegin = value;
+               else if (field == MSG_MMS_SMIL_AVI_END_INT)
+                       mms_smil_avi_data->nEnd = value;
+               else if (field == MSG_MMS_SMIL_AVI_DURTIME_INT)
+                       mms_smil_avi_data->nDurTime = value;
+               else if (field == MSG_MMS_SMIL_AVI_BGCOLOR_INT)
+                       mms_smil_avi_data->nBgColor = value;
+               else
+                       err = MSG_ERR_INVALID_PARAMETER;
+       }
+       break;
+       default :
+               err = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+       return MSG_SUCCESS;
+}
+
+int msg_mms_set_str_value(msg_struct_s *msg_struct, int field, char *value, int size)
+{
+       msg_error_t err = MSG_SUCCESS;
+
+       switch(msg_struct->type) {
+       case MSG_STRUCT_MMS_MEDIA:
+       {
+               MMS_MEDIA_S *mms_media_data = (MMS_MEDIA_S *)msg_struct->data;
+               if (field == MSG_MMS_MEDIA_SRC_STR)
+                       strncpy(mms_media_data->szSrc, value, MSG_FILEPATH_LEN_MAX);
+               else if (field == MSG_MMS_MEDIA_FILENAME_STR) {
+                       strncpy(mms_media_data->szFileName, value, MSG_FILEPATH_LEN_MAX);
+               } else if (field == MSG_MMS_MEDIA_FILEPATH_STR) {
+                       char *filename = NULL;
+                       strncpy(mms_media_data->szFilePath, value, MSG_FILEPATH_LEN_MAX);
+                       filename = strrchr(value, '/');
+                       strncpy(mms_media_data->szFileName, filename + 1, MSG_FILENAME_LEN_MAX-1);
+                       strncpy(mms_media_data->szContentID, filename + 1, MSG_MSG_ID_LEN);
+               } else if (field == MSG_MMS_MEDIA_CONTENT_ID_STR)
+                       strncpy(mms_media_data->szContentID, value, MSG_MSG_ID_LEN);
+               else if (field == MSG_MMS_MEDIA_REGION_ID_STR)
+                       strncpy(mms_media_data->regionId, value, MAX_SMIL_REGION_ID);
+               else if (field == MSG_MMS_MEDIA_ALTERNATIVE_STR)
+                       strncpy(mms_media_data->szAlt, value, MAX_SMIL_ALT_LEN);
+               else if (field == MSG_MMS_MEDIA_DRM_FULLPATH_STR)
+                       strncpy(mms_media_data->szDrm2FullPath, value, MSG_FILEPATH_LEN_MAX);
+               else
+                       err = MSG_ERR_INVALID_PARAMETER;
+       }
+       break;
+       case MSG_STRUCT_MMS_ATTACH:
+       {
+               MMS_ATTACH_S *mms_attach_data = (MMS_ATTACH_S *)msg_struct->data;
+               if (field == MSG_MMS_ATTACH_FILENAME_STR)
+                       strncpy(mms_attach_data->szFileName, value, MSG_FILENAME_LEN_MAX);
+               else if (field == MSG_MMS_ATTACH_FILEPATH_STR) {
+                       char *filename = NULL;
+                       char *filepath = value;
+                       mms_attach_data->mediatype = MIME_UNKNOWN;
+                       mms_attach_data->fileSize = -1;
+
+                       strncpy(mms_attach_data->szFilePath, filepath, MSG_FILEPATH_LEN_MAX-1);
+
+                       filename = strrchr(filepath, '/');
+                       strncpy(mms_attach_data->szFileName, filename + 1, MSG_FILENAME_LEN_MAX-1);
+               } else if (field == MSG_MMS_ATTACH_DRM_FULLPATH_STR)
+                       strncpy(mms_attach_data->szDrm2FullPath, value, MSG_FILEPATH_LEN_MAX);
+               else
+                       err = MSG_ERR_INVALID_PARAMETER;
+       }
+       break;
+       case MSG_STRUCT_MMS_REGION:
+       {
+               MMS_SMIL_REGION *mms_region_data = (MMS_SMIL_REGION *)msg_struct->data;
+               if (field == MSG_MMS_REGION_ID_STR)
+                       strncpy(mms_region_data->szID, value, MAX_SMIL_REGION_ID);
+               else
+                       err = MSG_ERR_INVALID_PARAMETER;
+       }
+       break;
+       case MSG_STRUCT_MMS_TRANSITION:
+       {
+               MMS_SMIL_TRANSITION *mms_transition_data = (MMS_SMIL_TRANSITION *)msg_struct->data;
+               if (field == MSG_MMS_TRANSITION_ID_STR)
+                       strncpy(mms_transition_data->szID, value, MAX_SMIL_TRANSITION_ID);
+               else
+                       err = MSG_ERR_INVALID_PARAMETER;
+       }
+       break;
+       case MSG_STRUCT_MMS_META:
+       {
+               MMS_SMIL_META *mms_meta_data = (MMS_SMIL_META *)msg_struct->data;
+               if (field == MSG_MMS_META_ID_STR)
+                       strncpy(mms_meta_data->szID, value, MAX_SMIL_META_ID);
+               else if (field == MSG_MMS_META_NAME_STR)
+                       strncpy(mms_meta_data->szID, value, MAX_SMIL_META_NAME);
+               else if (field == MSG_MMS_META_CONTENT_STR)
+                       strncpy(mms_meta_data->szID, value, MAX_SMIL_META_CONTENT);
+               else
+                       err = MSG_ERR_INVALID_PARAMETER;
+       }
+       break;
+       case MSG_STRUCT_MMS_SMIL_TEXT:
+       {
+               MmsSmilText *mms_smil_text_data = (MmsSmilText *)msg_struct->data;
+               if (field == MSG_MMS_SMIL_TEXT_TRANSITION_IN_ID_STR)
+                       strncpy(mms_smil_text_data->szTransInId, value, MAX_SMIL_TRANSIN_ID);
+               else if (field == MSG_MMS_SMIL_TEXT_TRANSITION_OUT_ID_STR)
+                       strncpy(mms_smil_text_data->szTransOutId, value, MAX_SMIL_TRANSOUT_ID);
+               else
+                       err = MSG_ERR_INVALID_PARAMETER;
+       }
+       break;
+       case MSG_STRUCT_MMS_SMIL_AVI:
+       {
+               MmsSmilAVI *mms_smil_avi_data = (MmsSmilAVI *)msg_struct->data;
+               if (field == MSG_MMS_SMIL_AVI_TRANSITION_IN_ID_STR)
+                       strncpy(mms_smil_avi_data->szTransInId, value, MAX_SMIL_TRANSIN_ID);
+               else if (field == MSG_MMS_SMIL_AVI_TRANSITION_OUT_ID_STR)
+                       strncpy(mms_smil_avi_data->szTransOutId, value, MAX_SMIL_TRANSOUT_ID);
+               else
+                       err = MSG_ERR_INVALID_PARAMETER;
+       }
+       break;
+       default :
+                       err = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+       return MSG_SUCCESS;
+}
+
+int msg_mms_set_bool_value(msg_struct_s *msg_struct, int field, bool value)
+{
+       msg_error_t err = MSG_SUCCESS;
+
+       switch(msg_struct->type) {
+       case MSG_STRUCT_MMS:
+       {
+               MMS_DATA_HIDDEN_S *mms_data = (MMS_DATA_HIDDEN_S *)msg_struct->data;
+               if (field == MSG_MMS_ROOTLAYOUT_WIDTH_PERCENT_BOOL)
+                       mms_data->rootlayout.width.bUnitPercent = value;
+               else if (field == MSG_MMS_ROOTLAYOUT_HEIGHT_PERCENT_BOOL)
+                       mms_data->rootlayout.height.bUnitPercent = value;
+               else
+                       err  = MSG_ERR_INVALID_PARAMETER;
+       }
+       break;
+       case MSG_STRUCT_MMS_REGION:
+       {
+               MMS_SMIL_REGION *mms_region_data = (MMS_SMIL_REGION *)msg_struct->data;
+               if (field == MSG_MMS_REGION_LENGTH_LEFT_PERCENT_BOOL)
+                       mms_region_data->nLeft.bUnitPercent = value;
+               else if (field == MSG_MMS_REGION_LENGTH_TOP_PERCENT_BOOL)
+                       mms_region_data->nTop.bUnitPercent = value;
+               else if (field == MSG_MMS_REGION_LENGTH_WIDTH_PERCENT_BOOL)
+                       mms_region_data->width.bUnitPercent = value;
+               else if (field == MSG_MMS_REGION_LENGTH_HEIGHT_PERCENT_BOOL)
+                       mms_region_data->height.bUnitPercent = value;
+               else
+                       err = MSG_ERR_INVALID_PARAMETER;
+       }
+       break;
+       case MSG_STRUCT_MMS_SMIL_TEXT:
+       {
+               MmsSmilText *mms_smil_text_data = (MmsSmilText *)msg_struct->data;
+               if (field == MSG_MMS_SMIL_TEXT_BOLD_BOOL)
+                       mms_smil_text_data->bBold = value;
+               else if (field == MSG_MMS_SMIL_TEXT_UNDERLINE_BOOL)
+                       mms_smil_text_data->bUnderLine = value;
+               else if (field == MSG_MMS_SMIL_TEXT_ITALIC_BOOL)
+                       mms_smil_text_data->bItalic = value;
+               else if (field == MSG_MMS_SMIL_TEXT_REVERSE_BOOL)
+                       mms_smil_text_data->bReverse = value;
+               else
+                       err = MSG_ERR_INVALID_PARAMETER;
+       }
+       break;
+       default :
+               err = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+       return MSG_SUCCESS;
+}
+
+int msg_mms_set_struct_handle(msg_struct_s *msg_struct, int field, msg_struct_s *value)
+{
+       msg_error_t err = MSG_SUCCESS;
+
+       switch(msg_struct->type) {
+       case MSG_STRUCT_MMS_MEDIA:
+       {
+               MMS_MEDIA_HIDDEN_S *mms_media_data = (MMS_MEDIA_HIDDEN_S *)msg_struct->data;
+
+               if (field == MSG_MMS_MEDIA_SMIL_TEXT_HND)
+                       memcpy(mms_media_data->pText->data, value->data, sizeof(MmsSmilText));
+               else if (field == MSG_MMS_MEDIA_SMIL_AVI_HND)
+                       memcpy(mms_media_data->pAVI->data, value->data, sizeof(MmsSmilAVI));
+               else
+                       err = MSG_ERR_INVALID_PARAMETER;
+       }
+       break;
+       default :
+               err = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+       return MSG_SUCCESS;
+}
+
+int msg_mms_set_list_handle(msg_struct_s *msg_struct, int field, msg_list_handle_t value)
+{
+       msg_error_t err = MSG_SUCCESS;
+
+       switch(msg_struct->type) {
+       case MSG_STRUCT_MMS:
+       {
+               MMS_DATA_HIDDEN_S *mms_data = (MMS_DATA_HIDDEN_S *)msg_struct->data;
+               if (field == MSG_MMS_PAGE_LIST_HND)
+                       mms_data->pagelist = (GList *)value;
+               else if (field == MSG_MMS_REGION_LIST_HND)
+                       mms_data->regionlist = (GList *)value;
+               else if (field == MSG_MMS_ATTACH_LIST_HND)
+                       mms_data->attachlist = (GList *)value;
+               else if (field == MSG_MMS_TRANSITION_LIST_HND)
+                       mms_data->transitionlist = (GList *)value;
+               else if (field == MSG_MMS_META_LIST_HND)
+                       mms_data->metalist = (GList *)value;
+               else
+                       err = MSG_ERR_INVALID_PARAMETER;
+       }
+       break;
+       case MSG_STRUCT_MMS_PAGE:
+       {
+               MMS_PAGE_S *mms_page_data = (MMS_PAGE_S *)msg_struct->data;
+               if (field == MSG_MMS_PAGE_MEDIA_LIST_HND)
+                       mms_page_data->medialist = (GList *)value;
+               else
+                       err = MSG_ERR_INVALID_PARAMETER;
+       }
+       break;
+       default :
+               err = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+       return MSG_SUCCESS;
+}
+
+EXPORT_API int msg_mms_add_item(msg_struct_t msg_struct_handle, int field, msg_struct_t *item)
+{
+       msg_error_t err = MSG_SUCCESS;
+       msg_struct_s *msg_struct = (msg_struct_s *)msg_struct_handle;
+
+       msg_struct_s *msg_struct_item = NULL;
+       void *data = NULL;
+       switch(msg_struct->type) {
+       case MSG_STRUCT_MMS:
+       {
+
+               MMS_DATA_HIDDEN_S *mms_data = (MMS_DATA_HIDDEN_S *)msg_struct->data;
+
+               if (field == MSG_STRUCT_MMS_PAGE) {
+                       msg_struct_item = msg_mms_create_struct(field);
+                       mms_data->pagelist = g_list_append(mms_data->pagelist, msg_struct_item);
+                       *item = (msg_struct_t)msg_struct_item;
+               } else if (field == MSG_STRUCT_MMS_REGION) {
+                       msg_struct_item = msg_mms_create_struct(field);
+                       mms_data->regionlist = g_list_append(mms_data->regionlist, msg_struct_item);
+                       *item = (msg_struct_t)msg_struct_item;
+               } else if (field == MSG_STRUCT_MMS_ATTACH) {
+                       msg_struct_item = msg_mms_create_struct(field);
+                       mms_data->attachlist = g_list_append(mms_data->attachlist, msg_struct_item);
+                       *item = (msg_struct_t)msg_struct_item;
+               } else if (field == MSG_STRUCT_MMS_TRANSITION) {
+                       msg_struct_item = msg_mms_create_struct(field);
+                       mms_data->transitionlist = g_list_append(mms_data->transitionlist, msg_struct_item);
+                       *item = (msg_struct_t)msg_struct_item;
+               } else if (field == MSG_STRUCT_MMS_META) {
+                       msg_struct_item = msg_mms_create_struct(field);
+                       mms_data->metalist = g_list_append(mms_data->metalist, msg_struct_item);
+                       *item = (msg_struct_t)msg_struct_item;
+               } else {
+                       err = MSG_ERR_INVALID_PARAMETER;
+               }
+       }
+       break;
+       case MSG_STRUCT_MMS_PAGE:
+       {
+
+               MMS_PAGE_S *mms_page_data = (MMS_PAGE_S *)msg_struct->data;
+
+               if (field == MSG_STRUCT_MMS_MEDIA) {
+                       msg_struct_item = msg_mms_create_struct(field);
+                       mms_page_data->medialist = g_list_append(mms_page_data->medialist, msg_struct_item);
+                       *item = (msg_struct_t)msg_struct_item;
+               } else {
+                       err = MSG_ERR_INVALID_PARAMETER;
+               }
+       }
+       break;
+       default :
+               err = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+
+       return err;
+}
+
+void convert_to_media_data(const msg_struct_s *pSrc, MMS_MEDIA_S *pDest)
+{
+       const MMS_MEDIA_HIDDEN_S *src_media = (MMS_MEDIA_HIDDEN_S *)pSrc->data;
+       MMS_MEDIA_S *dst_media = pDest;
+
+       dst_media->mediatype = src_media->mediatype;
+       memcpy(dst_media->szSrc, src_media->szSrc, MSG_FILEPATH_LEN_MAX);
+       memcpy(dst_media->szFileName, src_media->szFileName, MSG_FILEPATH_LEN_MAX);
+       memcpy(dst_media->szFilePath, src_media->szFilePath, MSG_FILEPATH_LEN_MAX);
+       memcpy(dst_media->szContentID, src_media->szContentID, MSG_MSG_ID_LEN+1);
+       memcpy(dst_media->regionId, src_media->regionId, MAX_SMIL_REGION_ID);
+       memcpy(dst_media->szAlt, src_media->szAlt, MAX_SMIL_ALT_LEN);
+
+       memcpy(dst_media->szDrm2FullPath, src_media->szDrm2FullPath, MSG_FILEPATH_LEN_MAX);
+       dst_media->drmType = src_media->drmType;
+
+       if (src_media->mediatype == MMS_SMIL_MEDIA_TEXT) {
+               msg_struct_s *smil_struct = (msg_struct_s *)src_media->pText;
+               MmsSmilText *smiltext = (MmsSmilText *)smil_struct->data;
+               memcpy(&dst_media->sMedia.sText, smiltext, sizeof(MmsSmilText));
+       } else {
+               msg_struct_s *smil_struct = (msg_struct_s *)src_media->pAVI;
+               MmsSmilAVI *smilavi = (MmsSmilAVI *)smil_struct->data;
+               memcpy(&dst_media->sMedia.sAVI, smilavi, sizeof(MmsSmilAVI));
+       }
+}
+
+void convert_from_media_data(const MMS_MEDIA_S *pSrc, msg_struct_s *pDest)
+{
+       const MMS_MEDIA_S *src_media = pSrc;
+       MMS_MEDIA_HIDDEN_S *dst_media = (MMS_MEDIA_HIDDEN_S *)pDest->data;
+
+       dst_media->mediatype = src_media->mediatype;
+       memcpy(dst_media->szSrc, src_media->szSrc, MSG_FILEPATH_LEN_MAX);
+       memcpy(dst_media->szFileName, src_media->szFileName, MSG_FILEPATH_LEN_MAX);
+       memcpy(dst_media->szFilePath, src_media->szFilePath, MSG_FILEPATH_LEN_MAX);
+       memcpy(dst_media->szContentID, src_media->szContentID, MSG_MSG_ID_LEN+1);
+       memcpy(dst_media->regionId, src_media->regionId, MAX_SMIL_REGION_ID);
+       memcpy(dst_media->szAlt, src_media->szAlt, MAX_SMIL_ALT_LEN);
+
+       memcpy(dst_media->szDrm2FullPath, src_media->szDrm2FullPath, MSG_FILEPATH_LEN_MAX);
+       dst_media->drmType = src_media->drmType;
+
+       if (src_media->mediatype == MMS_SMIL_MEDIA_TEXT) {
+               msg_struct_s *dst_smil_struct = (msg_struct_s *)dst_media->pText;
+               MmsSmilText *dst_smiltext = (MmsSmilText *)dst_smil_struct->data;
+               memcpy(dst_smiltext, &src_media->sMedia.sText, sizeof(MmsSmilText));
+       } else {
+               msg_struct_s *dst_smil_struct = (msg_struct_s *)dst_media->pAVI;
+               MmsSmilAVI *dst_smilavi = (MmsSmilAVI *)dst_smil_struct->data;
+               memcpy(dst_smilavi, &src_media->sMedia.sAVI, sizeof(MmsSmilAVI));
+       }
+}
+
+void convert_to_mmsdata(const msg_struct_s *pSrc, MMS_MESSAGE_DATA_S *pDest)
+{
+       int i, j;
+       MMS_DATA_HIDDEN_S *pSrcMms = (MMS_DATA_HIDDEN_S *)pSrc->data;
+
+       pDest->pageCnt = g_list_length(pSrcMms->pagelist);
+
+       for (i = 0; i < pDest->pageCnt; i++) {
+               MMS_PAGE_S *page = (MMS_PAGE_S *)calloc(1, sizeof(MMS_PAGE_S));
+               MMS_PAGE_S *src_page = (MMS_PAGE_S *)get_msg_struct_data((msg_struct_s *)g_list_nth_data(pSrcMms->pagelist, i));
+               page->mediaCnt = g_list_length(src_page->medialist);
+
+               for (j = 0; j < page->mediaCnt; j++)
+               {
+                       MMS_MEDIA_S *dst_media = (MMS_MEDIA_S *)calloc(1, sizeof(MMS_MEDIA_S));
+                       msg_struct_s *src_media_s = (msg_struct_s *)g_list_nth_data(src_page->medialist, j);
+
+                       convert_to_media_data(src_media_s, dst_media);
+
+                       page->medialist = g_list_append(page->medialist, dst_media);
+               }
+
+               page->nDur = src_page->nDur;
+               page->nBegin = src_page->nBegin;
+               page->nEnd = src_page->nEnd;
+               page->nMin = src_page->nMin;
+               page->nMax = src_page->nMax;
+               page->nRepeat = src_page->nRepeat;
+
+               pDest->pagelist = g_list_append(pDest->pagelist, page);
+       }
+
+       pDest->regionCnt = g_list_length(pSrcMms->regionlist);
+
+       for (i = 0; i < pDest->regionCnt; i++) {
+               MMS_SMIL_REGION *region = (MMS_SMIL_REGION *)calloc(1, sizeof(MMS_SMIL_REGION));
+               MMS_SMIL_REGION *src_region = (MMS_SMIL_REGION *)get_msg_struct_data((msg_struct_s *)g_list_nth_data(pSrcMms->regionlist, i));
+               memcpy(region, src_region, sizeof(MMS_SMIL_REGION));
+               pDest->regionlist = g_list_append(pDest->regionlist, region);
+       }
+
+       pDest->attachCnt = g_list_length(pSrcMms->attachlist);
+
+       for (i = 0; i < pDest->attachCnt; i++) {
+               MMS_ATTACH_S *attach = (MMS_ATTACH_S *)calloc(1, sizeof(MMS_ATTACH_S));
+               MMS_ATTACH_S *src_attach = (MMS_ATTACH_S *)get_msg_struct_data((msg_struct_s *)g_list_nth_data(pSrcMms->attachlist, i));
+               memcpy(attach, src_attach, sizeof(MMS_ATTACH_S));
+               pDest->attachlist = g_list_append(pDest->attachlist, attach);
+       }
+
+       pDest->transitionCnt = g_list_length(pSrcMms->transitionlist);
+
+       for (i = 0; i < pDest->transitionCnt; i++) {
+               MMS_SMIL_TRANSITION *transition = (MMS_SMIL_TRANSITION *)calloc(1, sizeof(MMS_SMIL_TRANSITION));
+               MMS_SMIL_TRANSITION *src_transition = (MMS_SMIL_TRANSITION *)get_msg_struct_data((msg_struct_s *)g_list_nth_data(pSrcMms->transitionlist, i));
+               memcpy(transition, src_transition, sizeof(MMS_SMIL_TRANSITION));
+               pDest->transitionlist = g_list_append(pDest->transitionlist, transition);
+       }
+
+       pDest->metaCnt = g_list_length(pSrcMms->metalist);
+
+       for (i = 0; i < pDest->metaCnt; i++) {
+               MMS_SMIL_META *meta = (MMS_SMIL_META *)calloc(1, sizeof(MMS_SMIL_META));
+               MMS_SMIL_META *src_meta = (MMS_SMIL_META *)get_msg_struct_data((msg_struct_s *)g_list_nth_data(pSrcMms->metalist, i));
+               memcpy(meta, src_meta, sizeof(MMS_SMIL_META));
+               pDest->metalist = g_list_append(pDest->metalist, meta);
+       }
+
+       memcpy(&pDest->rootlayout, &pSrcMms->rootlayout, sizeof(MMS_SMIL_ROOTLAYOUT));
+
+       memcpy(&pDest->msgAppId, &pSrcMms->msgAppId, sizeof(MMS_APPID_INFO_S));
+}
+
+void convert_from_mmsdata(const MMS_MESSAGE_DATA_S *pSrc, msg_struct_s *pDest)
+{
+       int i, j;
+       MMS_DATA_HIDDEN_S *pDestMms = (MMS_DATA_HIDDEN_S *)pDest->data;
+
+       for (i = 0; i < pSrc->pageCnt; i++) {
+               msg_struct_s *page_struct = msg_mms_create_struct(MSG_STRUCT_MMS_PAGE);
+               MMS_PAGE_S *page = (MMS_PAGE_S *)page_struct->data;
+
+               MMS_PAGE_S *src_page = (MMS_PAGE_S *)g_list_nth_data(pSrc->pagelist, i);
+               page->mediaCnt = g_list_length(src_page->medialist);
+
+               for (j = 0; j < page->mediaCnt; j++)
+               {
+                       msg_struct_s *dst_media_s = msg_mms_create_struct(MSG_STRUCT_MMS_MEDIA);
+
+                       MMS_MEDIA_S *src_media = (MMS_MEDIA_S *)g_list_nth_data(src_page->medialist, j);
+
+                       convert_from_media_data(src_media, dst_media_s);
+
+                       page->medialist = g_list_append(page->medialist, dst_media_s);
+               }
+
+               page->nDur = src_page->nDur;
+               page->nBegin = src_page->nBegin;
+               page->nEnd = src_page->nEnd;
+               page->nMin = src_page->nMin;
+               page->nMax = src_page->nMax;
+               page->nRepeat = src_page->nRepeat;
+
+               pDestMms->pagelist = g_list_append(pDestMms->pagelist, page_struct);
+       }
+
+       for (i = 0; i < pSrc->regionCnt; i++) {
+               msg_struct_s *region_struct = msg_mms_create_struct(MSG_STRUCT_MMS_REGION);
+               MMS_SMIL_REGION *region = (MMS_SMIL_REGION *)region_struct->data;
+               MMS_SMIL_REGION *src_region = (MMS_SMIL_REGION *)g_list_nth_data(pSrc->regionlist, i);
+               memcpy(region, src_region, sizeof(MMS_SMIL_REGION));
+               pDestMms->regionlist = g_list_append(pDestMms->regionlist, region_struct);
+       }
+
+       for (i = 0; i < pSrc->attachCnt; i++) {
+               msg_struct_s *attach_struct = msg_mms_create_struct(MSG_STRUCT_MMS_ATTACH);
+               MMS_ATTACH_S *attach = (MMS_ATTACH_S *)attach_struct->data;
+               MMS_ATTACH_S *src_attach = (MMS_ATTACH_S *)g_list_nth_data(pSrc->attachlist, i);
+               memcpy(attach, src_attach, sizeof(MMS_ATTACH_S));
+               pDestMms->attachlist = g_list_append(pDestMms->attachlist, attach_struct);
+       }
+
+       for (i = 0; i < pSrc->transitionCnt; i++) {
+               msg_struct_s *transition_struct = msg_mms_create_struct(MSG_STRUCT_MMS_TRANSITION);
+               MMS_SMIL_TRANSITION *transition = (MMS_SMIL_TRANSITION *)transition_struct->data;
+               MMS_SMIL_TRANSITION *src_transition = (MMS_SMIL_TRANSITION *)g_list_nth_data(pSrc->transitionlist, i);
+               memcpy(transition, src_transition, sizeof(MMS_SMIL_TRANSITION));
+               pDestMms->transitionlist = g_list_append(pDestMms->transitionlist, transition_struct);
+       }
+
+       for (i = 0; i < pSrc->metaCnt; i++) {
+               msg_struct_s *meta_struct = msg_mms_create_struct(MSG_STRUCT_MMS_META);
+               MMS_SMIL_META *meta = (MMS_SMIL_META *)meta_struct->data;
+               MMS_SMIL_META *src_meta = (MMS_SMIL_META *)g_list_nth_data(pSrc->metalist, i);
+
+               memcpy(meta, src_meta, sizeof(MMS_SMIL_META));
+               pDestMms->metalist = g_list_append(pDestMms->metalist, meta_struct);
+       }
+
+       memcpy(&pDestMms->rootlayout, &pSrc->rootlayout, sizeof(MMS_SMIL_ROOTLAYOUT));
+
+       memcpy(&pDestMms->msgAppId, &pSrc->msgAppId, sizeof(MMS_APPID_INFO_S));
+}
diff --git a/mapi/msg_setting.cpp b/mapi/msg_setting.cpp
new file mode 100755 (executable)
index 0000000..33b9110
--- /dev/null
@@ -0,0 +1,1826 @@
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#include <errno.h>
+#include <MsgException.h>
+#include "MsgHandle.h"
+#include "MsgDebug.h"
+
+#include "msg_private.h"
+#include "msg.h"
+
+/*******************************************************************************
+ *                                                                      SMSC                                                                  *
+ *******************************************************************************/
+
+int msg_setting_get_int_value(msg_struct_s *msg_struct, int field, int *value)
+{
+       int err = MSG_SUCCESS;
+
+       switch (msg_struct->type) {
+       case MSG_STRUCT_SETTING_SMSC_OPT :
+               *value = msg_get_smsc_opt_int(msg_struct->data, field);
+               break;
+       case MSG_STRUCT_SETTING_SMSC_INFO :
+               *value = msg_get_smsc_info_int(msg_struct->data, field);
+               break;
+       case MSG_STRUCT_SETTING_CB_OPT :
+               *value = msg_get_cb_option_int(msg_struct->data, field);
+               break;
+       case MSG_STRUCT_SETTING_CB_CHANNEL_INFO :
+               *value = msg_get_cb_channel_info_int(msg_struct->data, field);
+               break;
+       case MSG_STRUCT_SETTING_SMS_SEND_OPT :
+               *value = msg_get_sms_send_opt_int(msg_struct->data, field);
+               break;
+       case MSG_STRUCT_SETTING_MMS_SEND_OPT :
+               *value = msg_get_mms_send_opt_int(msg_struct->data, field);
+               break;
+       case MSG_STRUCT_SETTING_MMS_RECV_OPT :
+               *value = msg_get_mms_recv_opt_int(msg_struct->data, field);
+               break;
+       case MSG_STRUCT_SETTING_PUSH_MSG_OPT :
+               *value = msg_get_push_msg_opt_int(msg_struct->data, field);
+               break;
+       case MSG_STRUCT_SETTING_GENERAL_OPT :
+               *value = msg_get_general_opt_int(msg_struct->data, field);
+               break;
+       case MSG_STRUCT_SETTING_MSGSIZE_OPT :
+               *value = msg_get_msgsize_opt_int(msg_struct->data, field);
+               break;
+       default :
+               err = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+
+       return err;
+}
+
+int msg_setting_get_str_value(msg_struct_s *msg_struct, int field, char *src, int size)
+{
+       int err = MSG_SUCCESS;
+       char *ret_str = NULL;
+
+       switch (msg_struct->type)
+       {
+       case MSG_STRUCT_SETTING_SMSC_INFO :
+               ret_str = msg_get_smsc_info_str(msg_struct->data, field);
+               if (ret_str == NULL)
+                       err = MSG_ERR_UNKNOWN;
+               else
+                       strncpy(src, ret_str, size);
+               break;
+       case MSG_STRUCT_SETTING_CB_CHANNEL_INFO :
+               ret_str = msg_get_cb_channel_info_str(msg_struct->data, field);
+               if (ret_str == NULL)
+                       err = MSG_ERR_UNKNOWN;
+               else
+                       strncpy(src, ret_str, size);
+               break;
+       case MSG_STRUCT_SETTING_VOICE_MSG_OPT :
+               ret_str = msg_get_voice_msg_opt_str(msg_struct->data, field);
+               if (ret_str == NULL)
+                       err = MSG_ERR_UNKNOWN;
+               else
+                       strncpy(src, ret_str, size);
+               break;
+       default :
+               err = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+
+       return err;
+}
+
+int msg_setting_get_bool_value(msg_struct_s *msg_struct, int field, bool *value)
+{
+       int err = MSG_SUCCESS;
+
+       switch (msg_struct->type) {
+       case MSG_STRUCT_SETTING_CB_OPT :
+               *value = msg_get_cb_option_bool(msg_struct->data, field);
+               break;
+       case MSG_STRUCT_SETTING_CB_CHANNEL_INFO :
+               *value = msg_get_cb_channel_info_bool(msg_struct->data, field);
+               break;
+       case MSG_STRUCT_SETTING_SMS_SEND_OPT :
+               *value = msg_get_sms_send_opt_bool(msg_struct->data, field);
+               break;
+       case MSG_STRUCT_SETTING_MMS_SEND_OPT :
+               *value = msg_get_mms_send_opt_bool(msg_struct->data, field);
+               break;
+       case MSG_STRUCT_SETTING_MMS_RECV_OPT :
+               *value = msg_get_mms_recv_opt_bool(msg_struct->data, field);
+               break;
+       case MSG_STRUCT_SETTING_PUSH_MSG_OPT :
+               *value = msg_get_push_msg_opt_bool(msg_struct->data, field);
+               break;
+       case MSG_STRUCT_SETTING_GENERAL_OPT :
+               *value = msg_get_general_opt_bool(msg_struct->data, field);
+               break;
+       default :
+               err = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+
+       return err;
+}
+
+int msg_setting_get_list_handle(msg_struct_s *msg_struct, int field, void **value)
+{
+       int err = MSG_SUCCESS;
+
+       switch (msg_struct->type) {
+       case MSG_STRUCT_SETTING_SMSC_OPT :
+               err = msg_get_smsc_opt_list(msg_struct->data, field, value);
+               break;
+       case MSG_STRUCT_SETTING_CB_OPT :
+               err = msg_get_cb_option_list(msg_struct->data, field, value);
+               break;
+       default :
+               break;
+       }
+
+       return err;
+}
+
+int msg_setting_set_int_value(msg_struct_s *msg_struct, int field, int value)
+{
+       int err = MSG_SUCCESS;
+
+       switch (msg_struct->type) {
+       case MSG_STRUCT_SETTING_SMSC_OPT :
+               err = msg_set_smsc_opt_int(msg_struct->data, field, value);
+               break;
+       case MSG_STRUCT_SETTING_SMSC_INFO :
+               err = msg_set_smsc_info_int(msg_struct->data, field, value);
+               break;
+       case MSG_STRUCT_SETTING_CB_OPT :
+               err = msg_set_cb_option_int(msg_struct->data, field, value);
+               break;
+       case MSG_STRUCT_SETTING_CB_CHANNEL_INFO :
+               err = msg_set_cb_channel_info_int(msg_struct->data, field, value);
+               break;
+       case MSG_STRUCT_SETTING_SMS_SEND_OPT :
+               err = msg_set_sms_send_opt_int(msg_struct->data, field, value);
+               break;
+       case MSG_STRUCT_SETTING_MMS_SEND_OPT :
+               err = msg_set_mms_send_opt_int(msg_struct->data, field, value);
+               break;
+       case MSG_STRUCT_SETTING_MMS_RECV_OPT :
+               err = msg_set_mms_recv_opt_int(msg_struct->data, field, value);
+               break;
+       case MSG_STRUCT_SETTING_PUSH_MSG_OPT :
+               err = msg_set_push_msg_opt_int(msg_struct->data, field, value);
+               break;
+       case MSG_STRUCT_SETTING_GENERAL_OPT :
+               err = msg_set_general_opt_int(msg_struct->data, field, value);
+               break;
+       case MSG_STRUCT_SETTING_MSGSIZE_OPT :
+               err = msg_set_msgsize_opt_int(msg_struct->data, field, value);
+               break;
+       default :
+               err = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+
+       return err;
+}
+
+int msg_setting_set_str_value(msg_struct_s *msg_struct, int field, char *value, int size)
+{
+       int err = MSG_SUCCESS;
+
+       switch (msg_struct->type)
+       {
+       case MSG_STRUCT_SETTING_SMSC_INFO :
+               err = msg_set_smsc_info_str(msg_struct->data, field, value, size);
+               break;
+       case MSG_STRUCT_SETTING_CB_CHANNEL_INFO :
+               err = msg_set_cb_channel_info_str(msg_struct->data, field, value, size);
+               break;
+       case MSG_STRUCT_SETTING_VOICE_MSG_OPT :
+               err = msg_set_voice_msg_opt_str(msg_struct->data, field, value, size);
+               break;
+       default :
+               err = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+
+       return err;
+}
+
+int msg_setting_set_bool_value(msg_struct_s *msg_struct, int field, bool value)
+{
+       int err = MSG_SUCCESS;
+
+       switch (msg_struct->type) {
+       case MSG_STRUCT_SETTING_CB_OPT :
+               err = msg_set_cb_option_bool(msg_struct->data, field, value);
+               break;
+       case MSG_STRUCT_SETTING_CB_CHANNEL_INFO :
+               err = msg_set_cb_channel_info_bool(msg_struct->data, field, value);
+               break;
+       case MSG_STRUCT_SETTING_SMS_SEND_OPT :
+               err = msg_set_sms_send_opt_bool(msg_struct->data, field, value);
+               break;
+       case MSG_STRUCT_SETTING_MMS_SEND_OPT :
+               err = msg_set_mms_send_opt_bool(msg_struct->data, field, value);
+               break;
+       case MSG_STRUCT_SETTING_MMS_RECV_OPT :
+               err = msg_set_mms_recv_opt_bool(msg_struct->data, field, value);
+               break;
+       case MSG_STRUCT_SETTING_PUSH_MSG_OPT :
+               err = msg_set_push_msg_opt_bool(msg_struct->data, field, value);
+               break;
+       case MSG_STRUCT_SETTING_GENERAL_OPT :
+               err = msg_set_general_opt_bool(msg_struct->data, field, value);
+               break;
+       default :
+               err = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+
+       return err;
+}
+
+
+EXPORT_API int msg_get_smsc_opt(msg_handle_t handle, msg_struct_t msg_struct)
+{
+
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       try
+       {
+               err = pHandle->getSMSCOption(msg_struct);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_SET_READ_ERROR;
+       }
+
+       return err;
+}
+
+EXPORT_API int msg_set_smsc_opt(msg_handle_t handle, msg_struct_t msg_struct)
+{
+
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL || msg_struct == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       try
+       {
+               err = pHandle->setSMSCOption(msg_struct);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_SET_READ_ERROR;
+       }
+
+       return err;
+}
+
+int msg_get_smsc_opt_list(void *smsc_opt, int field, void **value)
+{
+       if (!smsc_opt)
+               return MSG_ERR_NULL_POINTER;
+
+       MSG_SMSC_LIST_HIDDEN_S *smsc_opt_data = (MSG_SMSC_LIST_HIDDEN_S *)smsc_opt;
+
+       int ret = MSG_SUCCESS;
+
+       switch (field)
+       {
+       case MSG_SMSC_LIST_STRUCT :
+               *value = (void *)smsc_opt_data->smsc_list;
+               break;
+       default :
+               break;
+       }
+
+       return ret;
+}
+
+int msg_get_smsc_opt_int(void *smsc_opt, int field)
+{
+       if (!smsc_opt)
+               return MSG_ERR_NULL_POINTER;
+
+       int ret = MSG_SUCCESS;
+
+       MSG_SMSC_LIST_HIDDEN_S *smsc_opt_data = (MSG_SMSC_LIST_HIDDEN_S *)smsc_opt;
+
+       switch (field)
+       {
+       case MSG_SMSC_SELECTED_ID_INT :
+               ret = smsc_opt_data->selected;
+               break;
+       default :
+               return MSG_ERR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int msg_set_smsc_opt_int(void *smsc_opt, int field, int value)
+{
+       if (!smsc_opt)
+               return MSG_ERR_NULL_POINTER;
+
+       int ret = MSG_SUCCESS;
+
+       MSG_SMSC_LIST_HIDDEN_S *smsc_opt_data = (MSG_SMSC_LIST_HIDDEN_S *)smsc_opt;
+
+       switch (field)
+       {
+       case MSG_SMSC_SELECTED_ID_INT :
+               ret = smsc_opt_data->selected;
+               break;
+       default :
+               ret = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+
+       return ret;
+}
+
+int msg_get_smsc_info_int(void *smsc_info, int field)
+{
+       if (!smsc_info)
+               return MSG_ERR_NULL_POINTER;
+
+       int ret = MSG_SUCCESS;
+
+       MSG_SMSC_DATA_S *smsc_data = (MSG_SMSC_DATA_S *)smsc_info;
+
+       switch (field)
+       {
+       case MSG_SMSC_ADDR_TON_INT :
+               ret = smsc_data->smscAddr.ton;
+               break;
+       case MSG_SMSC_ADDR_NPI_INT :
+               ret = smsc_data->smscAddr.npi;
+               break;
+       case MSG_SMSC_PID_INT :
+               ret = smsc_data->pid;
+               break;
+       case MSG_SMSC_VAL_PERIOD_INT :
+               ret = smsc_data->valPeriod;
+               break;
+       default :
+               return MSG_ERR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int msg_set_smsc_info_int(void *smsc_info, int field, int value)
+{
+       if (!smsc_info)
+               return MSG_ERR_NULL_POINTER;
+
+       int err = MSG_SUCCESS;
+
+       MSG_SMSC_DATA_S *smsc_data = (MSG_SMSC_DATA_S *)smsc_info;
+
+       switch (field)
+       {
+       case MSG_SMSC_ADDR_TON_INT :
+               smsc_data->smscAddr.ton = value;
+               break;
+       case MSG_SMSC_ADDR_NPI_INT :
+               smsc_data->smscAddr.npi = value;
+               break;
+       case MSG_SMSC_PID_INT :
+               smsc_data->pid = value;
+               break;
+       case MSG_SMSC_VAL_PERIOD_INT :
+               smsc_data->valPeriod = value;
+               break;
+       default :
+               err = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+
+       return err;
+}
+
+char *msg_get_smsc_info_str(void *smsc_info, int field)
+{
+       if (!smsc_info)
+               return NULL;
+
+       char *ret_str = NULL;
+
+       MSG_SMSC_DATA_S *smsc_data = (MSG_SMSC_DATA_S *)smsc_info;
+
+       switch (field)
+       {
+       case MSG_SMSC_ADDR_STR :
+               ret_str = smsc_data->smscAddr.address;
+               break;
+       case MSG_SMSC_NAME_STR :
+               ret_str = smsc_data->name;
+               break;
+       default :
+               return NULL;
+       }
+
+       return ret_str;
+}
+
+int msg_set_smsc_info_str(void *smsc_info, int field, char *val, int size)
+{
+       if (!smsc_info)
+               return MSG_ERR_NULL_POINTER;
+
+       int err = MSG_SUCCESS;
+
+       MSG_SMSC_DATA_S *smsc_data = (MSG_SMSC_DATA_S *)smsc_info;
+
+       switch (field)
+       {
+       case MSG_SMSC_ADDR_STR :
+               bzero(smsc_data->smscAddr.address, sizeof(smsc_data->smscAddr.address));
+               snprintf(smsc_data->smscAddr.address, sizeof(smsc_data->smscAddr.address), "%s", val);
+               break;
+       case MSG_SMSC_NAME_STR :
+               bzero(smsc_data->name, sizeof(smsc_data->name));
+               snprintf(smsc_data->name, sizeof(smsc_data->name), "%s", val);
+               break;
+       default :
+               err = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+
+       return err;
+}
+
+EXPORT_API int msg_get_cb_opt(msg_handle_t handle, msg_struct_t msg_struct)
+{
+
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       try
+       {
+               err = pHandle->getCBOption(msg_struct);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_SET_READ_ERROR;
+       }
+
+       return err;
+}
+
+EXPORT_API int msg_set_cb_opt(msg_handle_t handle, msg_struct_t msg_struct)
+{
+
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL || msg_struct == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       try
+       {
+               err = pHandle->setCBOption(msg_struct);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_SET_READ_ERROR;
+       }
+
+       return err;
+}
+
+int msg_get_cb_option_int(void *cb_opt, int field)
+{
+       if (!cb_opt)
+               return MSG_ERR_NULL_POINTER;
+
+       int ret = MSG_SUCCESS;
+
+       MSG_CBMSG_OPT_HIDDEN_S *cb_opt_data = (MSG_CBMSG_OPT_HIDDEN_S *)cb_opt;
+
+       switch (field)
+       {
+       case MSG_CB_MAX_SIM_COUNT_INT :
+               ret = cb_opt_data->maxSimCnt;
+               break;
+       default :
+               ret = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+
+       return ret;
+}
+
+int msg_set_cb_option_int(void *cb_opt, int field, int value)
+{
+       if (!cb_opt)
+               return MSG_ERR_NULL_POINTER;
+
+       int ret = MSG_SUCCESS;
+
+       MSG_CBMSG_OPT_HIDDEN_S *cb_opt_data = (MSG_CBMSG_OPT_HIDDEN_S *)cb_opt;
+
+       switch (field)
+       {
+       case MSG_CB_MAX_SIM_COUNT_INT :
+               cb_opt_data->maxSimCnt = value;
+               break;
+       default :
+               ret = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+
+       return ret;
+}
+
+
+bool msg_get_cb_option_bool(void *cb_opt, int field)
+{
+       if (!cb_opt)
+               return false;
+
+       bool ret = false;
+
+       MSG_CBMSG_OPT_HIDDEN_S *cb_opt_data = (MSG_CBMSG_OPT_HIDDEN_S *)cb_opt;
+
+       switch (field)
+       {
+       case MSG_CB_RECEIVE_BOOL :
+               ret = cb_opt_data->bReceive;
+               break;
+       case MSG_CB_RECEIVE_ALL_CHANNEL_BOOL :
+               ret = cb_opt_data->bAllChannel;
+               break;
+       case MSG_CB_LANGUAGE_TYPE_ALL_BOOL :
+               ret = cb_opt_data->bLanguage[MSG_CBLANG_TYPE_ALL];
+               break;
+       case MSG_CB_LANGUAGE_TYPE_ENG_BOOL :
+               ret = cb_opt_data->bLanguage[MSG_CBLANG_TYPE_ENG];
+               break;
+       case MSG_CB_LANGUAGE_TYPE_GER_BOOL :
+               ret = cb_opt_data->bLanguage[MSG_CBLANG_TYPE_GER];
+               break;
+       case MSG_CB_LANGUAGE_TYPE_FRE_BOOL :
+               ret = cb_opt_data->bLanguage[MSG_CBLANG_TYPE_FRE];
+               break;
+       case MSG_CB_LANGUAGE_TYPE_ITA_BOOL :
+               ret = cb_opt_data->bLanguage[MSG_CBLANG_TYPE_ITA];
+               break;
+       case MSG_CB_LANGUAGE_TYPE_NED_BOOL :
+               ret = cb_opt_data->bLanguage[MSG_CBLANG_TYPE_NED];
+               break;
+       case MSG_CB_LANGUAGE_TYPE_SPA_BOOL :
+               ret = cb_opt_data->bLanguage[MSG_CBLANG_TYPE_SPA];
+               break;
+       case MSG_CB_LANGUAGE_TYPE_POR_BOOL :
+               ret = cb_opt_data->bLanguage[MSG_CBLANG_TYPE_POR];
+               break;
+       case MSG_CB_LANGUAGE_TYPE_SWE_BOOL :
+               ret = cb_opt_data->bLanguage[MSG_CBLANG_TYPE_SWE];
+               break;
+       case MSG_CB_LANGUAGE_TYPE_TUR_BOOL :
+               ret = cb_opt_data->bLanguage[MSG_CBLANG_TYPE_TUR];
+               break;
+       default :
+               break;
+       }
+
+       return ret;
+}
+
+int msg_set_cb_option_bool(void *cb_opt, int field, bool value)
+{
+       if (!cb_opt)
+               return MSG_ERR_NULL_POINTER;
+
+       int ret = MSG_SUCCESS;
+
+       MSG_CBMSG_OPT_HIDDEN_S *cb_opt_data = (MSG_CBMSG_OPT_HIDDEN_S *)cb_opt;
+
+       switch (field)
+       {
+       case MSG_CB_RECEIVE_BOOL :
+               cb_opt_data->bReceive = value;
+               break;
+       case MSG_CB_RECEIVE_ALL_CHANNEL_BOOL :
+               cb_opt_data->bAllChannel = value;
+               break;
+       case MSG_CB_LANGUAGE_TYPE_ALL_BOOL :
+               cb_opt_data->bLanguage[MSG_CBLANG_TYPE_ALL] = value;
+               break;
+       case MSG_CB_LANGUAGE_TYPE_ENG_BOOL :
+               cb_opt_data->bLanguage[MSG_CBLANG_TYPE_ENG] = value;
+               break;
+       case MSG_CB_LANGUAGE_TYPE_GER_BOOL :
+               cb_opt_data->bLanguage[MSG_CBLANG_TYPE_GER] = value;
+               break;
+       case MSG_CB_LANGUAGE_TYPE_FRE_BOOL :
+               cb_opt_data->bLanguage[MSG_CBLANG_TYPE_FRE] = value;
+               break;
+       case MSG_CB_LANGUAGE_TYPE_ITA_BOOL :
+               cb_opt_data->bLanguage[MSG_CBLANG_TYPE_ITA] = value;
+               break;
+       case MSG_CB_LANGUAGE_TYPE_NED_BOOL :
+               cb_opt_data->bLanguage[MSG_CBLANG_TYPE_NED] = value;
+               break;
+       case MSG_CB_LANGUAGE_TYPE_SPA_BOOL :
+               cb_opt_data->bLanguage[MSG_CBLANG_TYPE_SPA] = value;
+               break;
+       case MSG_CB_LANGUAGE_TYPE_POR_BOOL :
+               cb_opt_data->bLanguage[MSG_CBLANG_TYPE_POR] = value;
+               break;
+       case MSG_CB_LANGUAGE_TYPE_SWE_BOOL :
+               cb_opt_data->bLanguage[MSG_CBLANG_TYPE_SWE] = value;
+               break;
+       case MSG_CB_LANGUAGE_TYPE_TUR_BOOL :
+               cb_opt_data->bLanguage[MSG_CBLANG_TYPE_TUR] = value;
+               break;
+       default :
+               ret = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+
+       return ret;
+}
+
+int msg_get_cb_option_list(void *cb_opt, int field, void **value)
+{
+       if (!cb_opt)
+               return MSG_ERR_NULL_POINTER;
+
+       MSG_CBMSG_OPT_HIDDEN_S *cb_opt_data = (MSG_CBMSG_OPT_HIDDEN_S *)cb_opt;
+
+       int ret = MSG_SUCCESS;
+
+       switch (field)
+       {
+       case MSG_CB_CHANNEL_LIST_STRUCT :
+               *value = (void *)cb_opt_data->channelData;
+               break;
+       default :
+               break;
+       }
+
+       return ret;
+}
+
+int msg_get_cb_channel_info_int(void *cb_ch_info, int field)
+{
+       if (!cb_ch_info)
+               return MSG_ERR_NULL_POINTER;
+
+       int ret = MSG_ERR_INVALID_PARAMETER;
+
+       MSG_CB_CHANNEL_INFO_S *cb_ch_data = (MSG_CB_CHANNEL_INFO_S *)cb_ch_info;
+
+       switch (field)
+       {
+       case MSG_CB_CHANNEL_ID_INT :
+               ret = cb_ch_data->id;
+               break;
+       default :
+               break;
+       }
+
+       return ret;
+}
+
+int msg_set_cb_channel_info_int(void *cb_ch_info, int field, int value)
+{
+       if (!cb_ch_info)
+               return MSG_ERR_NULL_POINTER;
+
+       int ret = MSG_SUCCESS;
+
+       MSG_CB_CHANNEL_INFO_S *cb_ch_data = (MSG_CB_CHANNEL_INFO_S *)cb_ch_info;
+
+       switch (field)
+       {
+       case MSG_CB_CHANNEL_ID_INT :
+               cb_ch_data->id = value;
+               break;
+       default :
+               ret = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+
+       return ret;
+}
+
+bool msg_get_cb_channel_info_bool(void *cb_ch_info, int field)
+{
+       if (!cb_ch_info)
+               return false;
+
+       bool ret = false;
+
+       MSG_CB_CHANNEL_INFO_S *cb_ch_data = (MSG_CB_CHANNEL_INFO_S *)cb_ch_info;
+
+       switch (field)
+       {
+       case MSG_CB_CHANNEL_ACTIVATE_BOOL :
+               ret = cb_ch_data->bActivate;
+               break;
+       default :
+               break;
+       }
+
+       return ret;
+}
+
+int msg_set_cb_channel_info_bool(void *cb_ch_info, int field, bool value)
+{
+       if (!cb_ch_info)
+               return MSG_ERR_NULL_POINTER;
+
+       int ret = MSG_SUCCESS;
+
+       MSG_CB_CHANNEL_INFO_S *cb_ch_data = (MSG_CB_CHANNEL_INFO_S *)cb_ch_info;
+
+       switch (field)
+       {
+       case MSG_CB_CHANNEL_ACTIVATE_BOOL :
+               cb_ch_data->bActivate = value;
+               break;
+       default :
+               ret = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+
+       return ret;
+}
+
+char *msg_get_cb_channel_info_str(void *cb_ch_info, int field)
+{
+       if (!cb_ch_info)
+               return NULL;
+
+       char *ret_str = NULL;
+
+       MSG_CB_CHANNEL_INFO_S *cb_ch_data = (MSG_CB_CHANNEL_INFO_S *)cb_ch_info;
+
+       switch (field)
+       {
+       case MSG_CB_CHANNEL_NAME_STR :
+               ret_str = cb_ch_data->name;
+               break;
+       default :
+               break;
+       }
+
+       return ret_str;
+}
+
+int msg_set_cb_channel_info_str(void *cb_ch_info, int field, char *val, int size)
+{
+       if (!cb_ch_info)
+               return MSG_ERR_NULL_POINTER;
+
+       int ret = MSG_SUCCESS;
+
+       MSG_CB_CHANNEL_INFO_S *cb_ch_data = (MSG_CB_CHANNEL_INFO_S *)cb_ch_info;
+
+       switch (field)
+       {
+       case MSG_CB_CHANNEL_NAME_STR :
+               bzero(cb_ch_data->name, sizeof(cb_ch_data->name));
+               snprintf(cb_ch_data->name, sizeof(cb_ch_data->name), "%s", val);
+               break;
+       default :
+               ret = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+
+       return ret;
+}
+
+EXPORT_API int msg_get_sms_send_opt(msg_handle_t handle, msg_struct_t msg_struct)
+{
+
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       try
+       {
+               err = pHandle->getSmsSendOpt(msg_struct);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_SET_READ_ERROR;
+       }
+
+       return err;
+}
+
+EXPORT_API int msg_set_sms_send_opt(msg_handle_t handle, msg_struct_t msg_struct)
+{
+
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL || msg_struct == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       try
+       {
+               err = pHandle->setSmsSendOpt(msg_struct);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_SET_READ_ERROR;
+       }
+
+       return err;
+}
+
+int msg_get_sms_send_opt_int(void *sms_send_opt, int field)
+{
+       if (!sms_send_opt)
+               return MSG_ERR_NULL_POINTER;
+
+       int ret = MSG_ERR_INVALID_PARAMETER;
+
+       MSG_SMS_SENDOPT_S *send_opt = (MSG_SMS_SENDOPT_S *)sms_send_opt;
+
+       switch (field)
+       {
+       case MSG_SMS_SENDOPT_ENCODE_TYPE_INT :
+               ret = send_opt->dcs;
+               break;
+       case MSG_SMS_SENDOPT_NETWORK_MODE_INT :
+               ret = send_opt->netMode;
+               break;
+       case MSG_SMS_SENDOPT_SAVE_STORAGE_INT :
+               ret = send_opt->saveStorage;
+               break;
+       default :
+               break;
+       }
+
+       return ret;
+}
+
+int msg_set_sms_send_opt_int(void *sms_send_opt, int field, int value)
+{
+       if (!sms_send_opt)
+               return MSG_ERR_NULL_POINTER;
+
+       int ret = MSG_SUCCESS;
+
+       MSG_SMS_SENDOPT_S *send_opt = (MSG_SMS_SENDOPT_S *)sms_send_opt;
+
+       switch (field)
+       {
+       case MSG_SMS_SENDOPT_ENCODE_TYPE_INT :
+               send_opt->dcs = value;
+               break;
+       case MSG_SMS_SENDOPT_NETWORK_MODE_INT :
+               send_opt->netMode = value;
+               break;
+       case MSG_SMS_SENDOPT_SAVE_STORAGE_INT :
+               send_opt->saveStorage = value;
+               break;
+       default :
+               ret = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+
+       return ret;
+}
+
+bool msg_get_sms_send_opt_bool(void *sms_send_opt, int field)
+{
+       if (!sms_send_opt)
+               return false;
+
+       bool ret = false;
+
+       MSG_SMS_SENDOPT_S *send_opt = (MSG_SMS_SENDOPT_S *)sms_send_opt;
+
+       switch (field)
+       {
+       case MSG_SMS_SENDOPT_REPLY_PATH_BOOL :
+               ret = send_opt->bReplyPath;
+               break;
+       case MSG_SMS_SENDOPT_DELIVERY_REPORT_BOOL :
+               ret = send_opt->bDeliveryReport;
+               break;
+       default :
+               break;
+       }
+
+       return ret;
+}
+
+int msg_set_sms_send_opt_bool(void *sms_send_opt, int field, bool value)
+{
+       if (!sms_send_opt)
+               return false;
+
+       int ret = MSG_SUCCESS;
+
+       MSG_SMS_SENDOPT_S *send_opt = (MSG_SMS_SENDOPT_S *)sms_send_opt;
+
+       switch (field)
+       {
+       case MSG_SMS_SENDOPT_REPLY_PATH_BOOL :
+               send_opt->bReplyPath = value;
+               break;
+       case MSG_SMS_SENDOPT_DELIVERY_REPORT_BOOL :
+               send_opt->bDeliveryReport = value;
+               break;
+       default :
+               ret = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+
+       return ret;
+}
+
+EXPORT_API int msg_get_mms_send_opt(msg_handle_t handle, msg_struct_t msg_struct)
+{
+
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       try
+       {
+               err = pHandle->getMmsSendOpt(msg_struct);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_SET_READ_ERROR;
+       }
+
+       return err;
+}
+
+EXPORT_API int msg_set_mms_send_opt(msg_handle_t handle, msg_struct_t msg_struct)
+{
+
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL || msg_struct == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       try
+       {
+               err = pHandle->setMmsSendOpt(msg_struct);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_SET_READ_ERROR;
+       }
+
+       return err;
+}
+
+
+int msg_get_mms_send_opt_int(void *mms_send_opt, int field)
+{
+       if (!mms_send_opt)
+               return MSG_ERR_NULL_POINTER;
+
+       int ret = MSG_ERR_INVALID_PARAMETER;
+
+       MSG_MMS_SENDOPT_S *send_opt = (MSG_MMS_SENDOPT_S *)mms_send_opt;
+
+       switch (field)
+       {
+       case MSG_MMS_SENDOPT_CLASS_TYPE_INT :
+               ret = send_opt->msgClass;
+               break;
+       case MSG_MMS_SENDOPT_PRIORITY_TYPE_INT :
+               ret = send_opt->priority;
+               break;
+       case MSG_MMS_SENDOPT_EXPIRY_TIME_INT :
+               ret = send_opt->expiryTime;
+               break;
+       case MSG_MMS_SENDOPT_DELIVERY_TIME_INT :
+               ret = send_opt->deliveryTime;
+               break;
+       case MSG_MMS_SENDOPT_CUSTOM_DELIVERY_TIME_INT :
+               ret = send_opt->customDeliveryTime;
+               break;
+       case MSG_MMS_SENDOPT_REPLY_CHARGING_INT :
+               ret = send_opt->replyCharging;
+               break;
+       case MSG_MMS_SENDOPT_REPLY_CHARGING_DEADLINE_INT :
+               ret = send_opt->replyChargingDeadline;
+               break;
+       case MSG_MMS_SENDOPT_REPLY_CHARGING_SIZE_INT :
+               ret = send_opt->replyChargingSize;
+               break;
+       case MSG_MMS_SENDOPT_CREATION_MODE_INT :
+               ret = send_opt->creationMode;
+               break;
+       default :
+               break;
+       }
+
+       return ret;
+}
+
+int msg_set_mms_send_opt_int(void *mms_send_opt, int field, int value)
+{
+       if (!mms_send_opt)
+               return MSG_ERR_NULL_POINTER;
+
+       int ret = MSG_SUCCESS;
+
+       MSG_MMS_SENDOPT_S *send_opt = (MSG_MMS_SENDOPT_S *)mms_send_opt;
+
+       switch (field)
+       {
+       case MSG_MMS_SENDOPT_CLASS_TYPE_INT :
+               send_opt->msgClass = value;
+               break;
+       case MSG_MMS_SENDOPT_PRIORITY_TYPE_INT :
+               send_opt->priority = value;
+               break;
+       case MSG_MMS_SENDOPT_EXPIRY_TIME_INT :
+               send_opt->expiryTime = value;
+               break;
+       case MSG_MMS_SENDOPT_DELIVERY_TIME_INT :
+               send_opt->deliveryTime = value;
+               break;
+       case MSG_MMS_SENDOPT_CUSTOM_DELIVERY_TIME_INT :
+               send_opt->customDeliveryTime = value;
+               break;
+       case MSG_MMS_SENDOPT_REPLY_CHARGING_INT :
+               send_opt->replyCharging = value;
+               break;
+       case MSG_MMS_SENDOPT_REPLY_CHARGING_DEADLINE_INT :
+               send_opt->replyChargingDeadline = value;
+               break;
+       case MSG_MMS_SENDOPT_REPLY_CHARGING_SIZE_INT :
+               send_opt->replyChargingSize = value;
+               break;
+       case MSG_MMS_SENDOPT_CREATION_MODE_INT :
+               send_opt->creationMode = value;
+               break;
+       default :
+               ret = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+
+       return ret;
+}
+
+bool msg_get_mms_send_opt_bool(void *mms_send_opt, int field)
+{
+       if (!mms_send_opt)
+               return false;
+
+       bool ret = false;
+
+       MSG_MMS_SENDOPT_S *send_opt = (MSG_MMS_SENDOPT_S *)mms_send_opt;
+
+       switch (field)
+       {
+       case MSG_MMS_SENDOPT_SENDER_VISIBILITY_BOOL :
+               ret = send_opt->bSenderVisibility;
+               break;
+       case MSG_MMS_SENDOPT_DELIVERY_REPORT_BOOL :
+               ret = send_opt->bDeliveryReport;
+               break;
+       case MSG_MMS_SENDOPT_READ_REPLY_BOOL :
+               ret = send_opt->bReadReply;
+               break;
+       case MSG_MMS_SENDOPT_KEEP_COPY_BOOL :
+               ret = send_opt->bKeepCopy;
+               break;
+       case MSG_MMS_SENDOPT_BODY_REPLYING_BOOL :
+               ret = send_opt->bBodyReplying;
+               break;
+       case MSG_MMS_SENDOPT_HIDE_RECIPIENTS_BOOL :
+               ret = send_opt->bHideRecipients;
+               break;
+       default :
+               break;
+       }
+
+       return ret;
+}
+
+int msg_set_mms_send_opt_bool(void *mms_send_opt, int field, bool value)
+{
+       if (!mms_send_opt)
+               return MSG_ERR_NULL_POINTER;
+
+       int ret = MSG_SUCCESS;
+
+       MSG_MMS_SENDOPT_S *send_opt = (MSG_MMS_SENDOPT_S *)mms_send_opt;
+
+       switch (field)
+       {
+       case MSG_MMS_SENDOPT_SENDER_VISIBILITY_BOOL :
+               send_opt->bSenderVisibility = value;
+               break;
+       case MSG_MMS_SENDOPT_DELIVERY_REPORT_BOOL :
+               send_opt->bDeliveryReport = value;
+               break;
+       case MSG_MMS_SENDOPT_READ_REPLY_BOOL :
+               send_opt->bReadReply = value;
+               break;
+       case MSG_MMS_SENDOPT_KEEP_COPY_BOOL :
+               send_opt->bKeepCopy = value;
+               break;
+       case MSG_MMS_SENDOPT_BODY_REPLYING_BOOL :
+               send_opt->bBodyReplying = value;
+               break;
+       case MSG_MMS_SENDOPT_HIDE_RECIPIENTS_BOOL :
+               send_opt->bHideRecipients = value;
+               break;
+       default :
+               ret = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+
+       return ret;
+}
+
+EXPORT_API int msg_get_mms_recv_opt(msg_handle_t handle, msg_struct_t msg_struct)
+{
+
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       try
+       {
+               err = pHandle->getMmsRecvOpt(msg_struct);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_SET_READ_ERROR;
+       }
+
+       return err;
+}
+
+EXPORT_API int msg_set_mms_recv_opt(msg_handle_t handle, msg_struct_t msg_struct)
+{
+
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL || msg_struct == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       try
+       {
+               err = pHandle->setMmsRecvOpt(msg_struct);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_SET_READ_ERROR;
+       }
+
+       return err;
+}
+
+int msg_get_mms_recv_opt_int(void *mms_recv_opt, int field)
+{
+       if (!mms_recv_opt)
+               return MSG_ERR_NULL_POINTER;
+
+       int ret = MSG_ERR_INVALID_PARAMETER;
+
+       MSG_MMS_RECVOPT_S *recv_opt = (MSG_MMS_RECVOPT_S *)mms_recv_opt;
+
+       switch (field)
+       {
+       case MSG_MMS_RECVOPT_HOME_RETRIEVE_TYPE_INT :
+               ret = recv_opt->homeNetwork;
+               break;
+       case MSG_MMS_RECVOPT_ABROAD_RETRIEVE_TYPE_INT :
+               ret = recv_opt->abroadNetwok;
+               break;
+       default :
+               break;
+       }
+
+       return ret;
+}
+
+int msg_set_mms_recv_opt_int(void *mms_recv_opt, int field, int value)
+{
+       if (!mms_recv_opt)
+               return MSG_ERR_NULL_POINTER;
+
+       int ret = MSG_SUCCESS;
+
+       MSG_MMS_RECVOPT_S *recv_opt = (MSG_MMS_RECVOPT_S *)mms_recv_opt;
+
+       switch (field)
+       {
+       case MSG_MMS_RECVOPT_HOME_RETRIEVE_TYPE_INT :
+               recv_opt->homeNetwork = value;
+               break;
+       case MSG_MMS_RECVOPT_ABROAD_RETRIEVE_TYPE_INT :
+               recv_opt->abroadNetwok = value;
+               break;
+       default :
+               ret = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+
+       return ret;
+}
+
+bool msg_get_mms_recv_opt_bool(void *mms_recv_opt, int field)
+{
+       if (!mms_recv_opt)
+               return false;
+
+       bool ret = false;
+
+       MSG_MMS_RECVOPT_S *recv_opt = (MSG_MMS_RECVOPT_S *)mms_recv_opt;
+
+       switch (field)
+       {
+       case MSG_MMS_RECVOPT_READ_REPORT_BOOL :
+               ret = recv_opt->readReceipt;
+               break;
+       case MSG_MMS_RECVOPT_DELIVERY_REPORT_BOOL :
+               ret = recv_opt->bDeliveryReceipt;
+               break;
+       case MSG_MMS_RECVOPT_REJECT_UNKNOWN_BOOL :
+               ret = recv_opt->bRejectUnknown;
+               break;
+       case MSG_MMS_RECVOPT_REJECT_ADVERTISEMENT_BOOL :
+               ret = recv_opt->bRejectAdvertisement;
+               break;
+       default :
+               break;
+       }
+
+       return ret;
+}
+
+int msg_set_mms_recv_opt_bool(void *mms_recv_opt, int field, bool value)
+{
+       if (!mms_recv_opt)
+               return MSG_ERR_NULL_POINTER;
+
+       int ret = MSG_SUCCESS;
+
+       MSG_MMS_RECVOPT_S *recv_opt = (MSG_MMS_RECVOPT_S *)mms_recv_opt;
+
+       switch (field)
+       {
+       case MSG_MMS_RECVOPT_READ_REPORT_BOOL :
+               recv_opt->readReceipt = value;
+               break;
+       case MSG_MMS_RECVOPT_DELIVERY_REPORT_BOOL :
+               recv_opt->bDeliveryReceipt = value;
+               break;
+       case MSG_MMS_RECVOPT_REJECT_UNKNOWN_BOOL :
+               recv_opt->bRejectUnknown = value;
+               break;
+       case MSG_MMS_RECVOPT_REJECT_ADVERTISEMENT_BOOL :
+               recv_opt->bRejectAdvertisement = value;
+               break;
+       default :
+               ret = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+
+       return ret;
+}
+
+EXPORT_API int msg_get_push_msg_opt(msg_handle_t handle, msg_struct_t msg_struct)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       try
+       {
+               err = pHandle->getPushMsgOpt(msg_struct);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_SET_READ_ERROR;
+       }
+
+       return err;
+}
+
+EXPORT_API int msg_set_push_msg_opt(msg_handle_t handle, msg_struct_t msg_struct)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL || msg_struct == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       try
+       {
+               err = pHandle->setPushMsgOpt(msg_struct);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_SET_READ_ERROR;
+       }
+
+       return err;
+}
+
+int msg_get_push_msg_opt_int(void *push_msg_opt, int field)
+{
+       if (!push_msg_opt)
+               return MSG_ERR_NULL_POINTER;
+
+       int ret = MSG_ERR_INVALID_PARAMETER;
+
+       MSG_PUSHMSG_OPT_S *push_opt = (MSG_PUSHMSG_OPT_S *)push_msg_opt;
+
+       switch (field)
+       {
+       case MSG_PUSHMSG_SERVICE_TYPE_INT :
+               ret = push_opt->serviceType;
+               break;
+       default :
+               break;
+       }
+
+       return ret;
+}
+
+int msg_set_push_msg_opt_int(void *push_msg_opt, int field, int value)
+{
+       if (!push_msg_opt)
+               return MSG_ERR_NULL_POINTER;
+
+       int ret = MSG_SUCCESS;
+
+       MSG_PUSHMSG_OPT_S *push_opt = (MSG_PUSHMSG_OPT_S *)push_msg_opt;
+
+       switch (field)
+       {
+       case MSG_PUSHMSG_SERVICE_TYPE_INT :
+               push_opt->serviceType = value;
+               break;
+       default :
+               ret = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+
+       return ret;
+}
+
+bool msg_get_push_msg_opt_bool(void *push_msg_opt, int field)
+{
+       if (!push_msg_opt)
+               return false;
+
+       bool ret = false;
+
+       MSG_PUSHMSG_OPT_S *push_opt = (MSG_PUSHMSG_OPT_S *)push_msg_opt;
+
+       switch (field)
+       {
+       case MSG_PUSHMSG_RECEIVE_BOOL :
+               ret = push_opt->bReceive;
+               break;
+       default :
+               break;
+       }
+
+       return ret;
+}
+
+int msg_set_push_msg_opt_bool(void *push_msg_opt, int field, bool value)
+{
+       if (!push_msg_opt)
+               return MSG_ERR_NULL_POINTER;
+
+       int ret = MSG_SUCCESS;
+
+       MSG_PUSHMSG_OPT_S *push_opt = (MSG_PUSHMSG_OPT_S *)push_msg_opt;
+
+       switch (field)
+       {
+       case MSG_PUSHMSG_RECEIVE_BOOL :
+               push_opt->bReceive = value;
+               break;
+       default :
+               ret = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+
+       return ret;
+}
+
+EXPORT_API int msg_get_voice_msg_opt(msg_handle_t handle, msg_struct_t msg_struct)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       try
+       {
+               err = pHandle->getVoiceMsgOpt(msg_struct);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_SET_READ_ERROR;
+       }
+
+       return err;
+}
+
+EXPORT_API int msg_set_voice_msg_opt(msg_handle_t handle, msg_struct_t msg_struct)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL || msg_struct == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       try
+       {
+               err = pHandle->setVoiceMsgOpt(msg_struct);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_SET_READ_ERROR;
+       }
+
+       return err;
+}
+
+char *msg_get_voice_msg_opt_str(void *voice_msg_opt, int field)
+{
+       if (!voice_msg_opt)
+               return NULL;
+
+       char *ret_str = NULL;
+
+       MSG_VOICEMAIL_OPT_S *voice_opt = (MSG_VOICEMAIL_OPT_S *)voice_msg_opt;
+
+       switch (field)
+       {
+       case MSG_VOICEMSG_ADDRESS_STR :
+               ret_str = voice_opt->mailNumber;
+               break;
+       default :
+               break;
+       }
+
+       return ret_str;
+}
+
+int msg_set_voice_msg_opt_str(void *voice_msg_opt, int field, char *val, int size)
+{
+       if (!voice_msg_opt)
+               return MSG_ERR_NULL_POINTER;
+
+       int ret = MSG_SUCCESS;
+
+       MSG_VOICEMAIL_OPT_S *voice_opt = (MSG_VOICEMAIL_OPT_S *)voice_msg_opt;
+
+       switch (field)
+       {
+       case MSG_VOICEMSG_ADDRESS_STR :
+               bzero(voice_opt->mailNumber, sizeof(voice_opt->mailNumber));
+               snprintf(voice_opt->mailNumber, sizeof(voice_opt->mailNumber), "%s", val);
+               break;
+       default :
+               ret = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+
+       return ret;
+}
+
+EXPORT_API int msg_get_general_opt(msg_handle_t handle, msg_struct_t msg_struct)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       try
+       {
+               err = pHandle->getGeneralOpt(msg_struct);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_SET_READ_ERROR;
+       }
+
+       return err;
+}
+
+EXPORT_API int msg_set_general_opt(msg_handle_t handle, msg_struct_t msg_struct)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL || msg_struct == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       try
+       {
+               err = pHandle->setGeneralOpt(msg_struct);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_SET_READ_ERROR;
+       }
+
+       return err;
+}
+
+int msg_get_general_opt_int(void *general_opt, int field)
+{
+       if (!general_opt)
+               return MSG_ERR_NULL_POINTER;
+
+       int ret = MSG_ERR_INVALID_PARAMETER;
+
+       MSG_GENERAL_OPT_S *opt = (MSG_GENERAL_OPT_S *)general_opt;
+
+       switch (field)
+       {
+       case MSG_GENERAL_ALERT_TONE_INT :
+               ret = opt->alertTone;
+               break;
+       default :
+               break;
+       }
+
+       return ret;
+}
+
+int msg_set_general_opt_int(void *general_opt, int field, int value)
+{
+       if (!general_opt)
+               return MSG_ERR_NULL_POINTER;
+
+       int ret = MSG_SUCCESS;
+
+       MSG_GENERAL_OPT_S *opt = (MSG_GENERAL_OPT_S *)general_opt;
+
+       switch (field)
+       {
+       case MSG_GENERAL_ALERT_TONE_INT :
+               opt->alertTone = value;
+               break;
+       default :
+               ret = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+
+       return ret;
+}
+
+bool msg_get_general_opt_bool(void *general_opt, int field)
+{
+       if (!general_opt)
+               return false;
+
+       int ret = false;
+
+       MSG_GENERAL_OPT_S *opt = (MSG_GENERAL_OPT_S *)general_opt;
+
+       switch (field)
+       {
+       case MSG_GENERAL_KEEP_COPY_BOOL :
+               ret = opt->bKeepCopy;
+               break;
+       case MSG_GENERAL_AUTO_ERASE_BOOL :
+               ret = opt->bAutoErase;
+               break;
+       default :
+               break;
+       }
+
+       return ret;
+}
+
+int msg_set_general_opt_bool(void *general_opt, int field, bool value)
+{
+       if (!general_opt)
+               return MSG_ERR_NULL_POINTER;
+
+       int ret = MSG_SUCCESS;
+
+       MSG_GENERAL_OPT_S *opt = (MSG_GENERAL_OPT_S *)general_opt;
+
+       switch (field)
+       {
+       case MSG_GENERAL_KEEP_COPY_BOOL :
+               opt->bKeepCopy = value;
+               break;
+       case MSG_GENERAL_AUTO_ERASE_BOOL :
+               opt->bAutoErase = value;
+               break;
+       default :
+               ret = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+
+       return ret;
+}
+
+EXPORT_API int msg_get_msgsize_opt(msg_handle_t handle, msg_struct_t msg_struct)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       try
+       {
+               err = pHandle->getMsgSizeOpt(msg_struct);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_SET_READ_ERROR;
+       }
+
+       return err;
+}
+
+EXPORT_API int msg_set_msgsize_opt(msg_handle_t handle, msg_struct_t msg_struct)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL || msg_struct == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       try
+       {
+               err = pHandle->setMsgSizeOpt(msg_struct);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_SET_READ_ERROR;
+       }
+
+       return err;
+}
+
+int msg_get_msgsize_opt_int(void *size_opt, int field)
+{
+       if (!size_opt)
+               return MSG_ERR_NULL_POINTER;
+
+       int ret = MSG_ERR_INVALID_PARAMETER;
+
+       MSG_MSGSIZE_OPT_S *msg_opt = (MSG_MSGSIZE_OPT_S *)size_opt;
+
+       switch (field)
+       {
+       case MSG_MESSAGE_SIZE_INT :
+               ret = msg_opt->nMsgSize;
+               break;
+       default :
+               break;
+       }
+
+       return ret;
+}
+
+int msg_set_msgsize_opt_int(void *size_opt, int field, int value)
+{
+       if (!size_opt)
+               return MSG_ERR_NULL_POINTER;
+
+       int ret = MSG_SUCCESS;
+
+       MSG_MSGSIZE_OPT_S *msg_opt = (MSG_MSGSIZE_OPT_S *)size_opt;
+
+       switch (field)
+       {
+       case MSG_MESSAGE_SIZE_INT :
+               msg_opt->nMsgSize = value;
+               break;
+       default :
+               ret = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+
+       return ret;
+}
diff --git a/mapi/msg_storage.cpp b/mapi/msg_storage.cpp
new file mode 100755 (executable)
index 0000000..c729773
--- /dev/null
@@ -0,0 +1,2285 @@
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#include <errno.h>
+
+#include "MsgHandle.h"
+#include "MsgDebug.h"
+#include "MsgException.h"
+
+#include "msg.h"
+#include "msg_private.h"
+#include "msg_storage.h"
+
+
+static int msg_thread_get_msg_type(int mainType, int subType);
+/*==================================================================================================
+                                     FUNCTION IMPLEMENTATION
+==================================================================================================*/
+EXPORT_API int msg_add_message(msg_handle_t handle, msg_struct_t opq_msg, const msg_struct_t send_opt)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL || opq_msg == NULL || send_opt == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       msg_struct_s *pMsgStruct = (msg_struct_s *)opq_msg;
+       msg_struct_s *pStruct = (msg_struct_s *)send_opt;
+
+       try
+       {
+               err = pHandle->addMessage((MSG_MESSAGE_HIDDEN_S *)pMsgStruct->data, (MSG_SENDINGOPT_S *)pStruct->data);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_STORAGE_ERROR;
+       }
+
+       return err;
+}
+
+
+EXPORT_API int msg_add_syncml_message(msg_handle_t handle, const msg_struct_t syncml_msg)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL || syncml_msg == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+       msg_struct_s *pStruct = (msg_struct_s *)syncml_msg;
+
+       try
+       {
+               err = pHandle->addSyncMLMessage((MSG_SYNCML_MESSAGE_S *)pStruct->data);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_STORAGE_ERROR;
+       }
+
+       return err;
+}
+
+
+EXPORT_API int msg_update_message(msg_handle_t handle, const msg_struct_t opq_msg, const msg_struct_t send_opt)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL || opq_msg == NULL || send_opt == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+       msg_struct_s *pMsgStruct = (msg_struct_s *)opq_msg;
+       msg_struct_s* pStruct = (msg_struct_s *)send_opt;
+
+       MSG_MESSAGE_HIDDEN_S *msg = (MSG_MESSAGE_HIDDEN_S *)pMsgStruct->data;
+
+       if (msg->addr_list->nCount > 1)
+       {
+               MSG_DEBUG("Multiple Address cannot be updated [%d]", msg->addr_list->nCount);
+               return -EINVAL;
+       }
+
+       try
+       {
+               err = pHandle->updateMessage(msg, (MSG_SENDINGOPT_S *)pStruct->data);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_STORAGE_ERROR;
+       }
+
+       return err;
+}
+
+
+EXPORT_API int msg_update_read_status(msg_handle_t handle, msg_message_id_t msg_id, bool read)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       try
+       {
+               err = pHandle->updateReadStatus(msg_id, read);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_STORAGE_ERROR;
+       }
+
+       return err;
+}
+
+
+EXPORT_API int msg_update_protected_status(msg_handle_t handle, msg_message_id_t msg_id, bool is_protected)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       try
+       {
+               err = pHandle->updateProtectedStatus(msg_id, is_protected);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_STORAGE_ERROR;
+       }
+
+       return err;
+}
+
+
+EXPORT_API int msg_delete_message(msg_handle_t handle, msg_message_id_t msg_id)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       try
+       {
+               err = pHandle->deleteMessage(msg_id);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_STORAGE_ERROR;
+       }
+
+       return err;
+}
+
+
+EXPORT_API int msg_delete_all_msgs_in_folder(msg_handle_t handle, msg_folder_id_t folder_id, bool bOnlyDB)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       try
+       {
+               err = pHandle->deleteAllMessagesInFolder(folder_id, bOnlyDB);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_STORAGE_ERROR;
+       }
+
+       return err;
+}
+
+
+EXPORT_API int msg_move_msg_to_folder(msg_handle_t handle, msg_message_id_t msg_id, msg_folder_id_t dest_folder_id)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       try
+       {
+               err = pHandle->moveMessageToFolder(msg_id, dest_folder_id);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_STORAGE_ERROR;
+       }
+
+       return err;
+}
+
+
+EXPORT_API int msg_move_msg_to_storage(msg_handle_t handle, msg_message_id_t msg_id, msg_storage_id_t storage_id)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL)
+       {
+               return -EINVAL;
+       }
+
+       if (storage_id != MSG_STORAGE_PHONE && storage_id != MSG_STORAGE_SIM)
+       {
+               MSG_FATAL("unsupported storage [%d]", storage_id);
+               return MSG_ERR_INVALID_PARAMETER;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       try
+       {
+               err = pHandle->moveMessageToStorage(msg_id, storage_id);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_STORAGE_ERROR;
+       }
+
+       return err;
+}
+
+
+EXPORT_API int msg_count_message(msg_handle_t handle, msg_folder_id_t folder_id, msg_struct_t count_info)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+       msg_struct_s *pStruct = (msg_struct_s *)count_info;
+       try
+       {
+               err = pHandle->countMessage(folder_id, (MSG_COUNT_INFO_S *)pStruct->data);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_STORAGE_ERROR;
+       }
+
+       return err;
+}
+
+
+EXPORT_API int msg_count_msg_by_type(msg_handle_t handle, msg_message_type_t msg_type, int *msg_count)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       MSG_MESSAGE_TYPE_S msgType = {0};
+
+       if (msg_type == MSG_TYPE_SMS)
+       {
+               msgType.mainType = MSG_SMS_TYPE;
+               msgType.subType = MSG_NORMAL_SMS;
+       }
+       else if (msg_type == MSG_TYPE_SMS_WAPPUSH)
+       {
+               msgType.mainType = MSG_SMS_TYPE;
+               msgType.subType = MSG_WAP_SI_SMS;
+       }
+       else if (msg_type == MSG_TYPE_MMS)
+       {
+               msgType.mainType = MSG_MMS_TYPE;
+               msgType.subType = MSG_SENDREQ_MMS;
+       }
+
+       try
+       {
+               err = pHandle->countMsgByType(&msgType, msg_count);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_STORAGE_ERROR;
+       }
+
+       return err;
+}
+
+
+EXPORT_API int msg_count_msg_by_contact(msg_handle_t handle, const msg_struct_t addr_info, msg_struct_t msg_thread_count_list)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL || addr_info == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+       msg_struct_s *pAddr = (msg_struct_s *)addr_info;
+       msg_struct_s *pCount = (msg_struct_s *)msg_thread_count_list;
+
+       try
+       {
+               err = pHandle->countMsgByContact((MSG_THREAD_LIST_INDEX_INFO_S *)pAddr->data, (MSG_THREAD_COUNT_INFO_S *)pCount->data);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_STORAGE_ERROR;
+       }
+
+       return err;
+}
+
+
+EXPORT_API int msg_get_message(msg_handle_t handle, msg_message_id_t msg_id, msg_struct_t opq_msg, msg_struct_t send_opt)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL || !opq_msg)
+       {
+               MSG_FATAL("handle or opq_msg is NULL");
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       msg_struct_s *pMsgStruct = (msg_struct_s *)opq_msg;
+       msg_struct_s *pStruct = (msg_struct_s *)send_opt;
+
+       try
+       {
+               err = pHandle->getMessage(msg_id, (MSG_MESSAGE_HIDDEN_S *)pMsgStruct->data, (MSG_SENDINGOPT_S *)pStruct->data);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_STORAGE_ERROR;
+       }
+
+       return err;
+}
+
+
+EXPORT_API int msg_get_folder_view_list(msg_handle_t handle, msg_folder_id_t folder_id, const msg_struct_t sort_rule, msg_struct_list_s *msg_folder_view_list)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+       msg_struct_s *pStruct = (msg_struct_s *)sort_rule;
+
+       try
+       {
+               if (sort_rule == NULL)
+               {
+                       MSG_SORT_RULE_S sortRule = {0};
+
+                       sortRule.sortType = MSG_SORT_BY_READ_STATUS;
+                       sortRule.bAscending = true;
+
+                       err = pHandle->getFolderViewList(folder_id, &sortRule, msg_folder_view_list);
+               }
+               else
+               {
+               err = pHandle->getFolderViewList(folder_id, (MSG_SORT_RULE_S *)pStruct->data, msg_folder_view_list);
+       }
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_STORAGE_ERROR;
+       }
+
+       return err;
+}
+
+
+EXPORT_API int msg_get_thread_view_list(msg_handle_t handle, const msg_struct_t sort_rule, msg_struct_list_s *msg_thread_view_list)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+       msg_struct_s *pStruct =(msg_struct_s *)sort_rule;
+
+       try
+       {
+               if (sort_rule == NULL)
+               {
+                       MSG_SORT_RULE_S sortRule = {0};
+
+                       sortRule.sortType = MSG_SORT_BY_THREAD_DATE;
+                       sortRule.bAscending = false;
+
+                       err = pHandle->getThreadViewList(&sortRule, msg_thread_view_list);
+               }
+               else
+               {
+                       err = pHandle->getThreadViewList((MSG_SORT_RULE_S *)pStruct->data, msg_thread_view_list);
+               }
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_STORAGE_ERROR;
+       }
+
+       return err;
+}
+
+
+EXPORT_API int msg_get_conversation_view_list(msg_handle_t handle, msg_thread_id_t thread_id, msg_struct_list_s *msg_conv_view_list)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       try
+       {
+               err = pHandle->getConversationViewList(thread_id, msg_conv_view_list);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_STORAGE_ERROR;
+       }
+
+       return err;
+}
+
+
+EXPORT_API int msg_delete_thread_message_list(msg_handle_t handle, msg_thread_id_t thread_id)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       try
+       {
+               err = pHandle->deleteThreadMessageList(thread_id);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_STORAGE_ERROR;
+       }
+
+       return err;
+}
+
+
+EXPORT_API int msg_add_folder(msg_handle_t handle, const msg_struct_t folder_info)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL || folder_info == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+       msg_struct_s *pStruct = (msg_struct_s *)folder_info;
+
+       try
+       {
+               err = pHandle->addFolder((MSG_FOLDER_INFO_S *)pStruct->data);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_STORAGE_ERROR;
+       }
+
+       return err;
+}
+
+
+EXPORT_API int msg_update_folder(msg_handle_t handle, const msg_struct_t folder_info)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL || folder_info == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+       msg_struct_s *pStruct = (msg_struct_s *)folder_info;
+
+       try
+       {
+               err = pHandle->updateFolder((MSG_FOLDER_INFO_S *)pStruct->data);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_STORAGE_ERROR;
+       }
+
+       return err;
+}
+
+
+EXPORT_API int msg_delete_folder(msg_handle_t handle, msg_folder_id_t folder_id)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       try
+       {
+               err = pHandle->deleteFolder(folder_id);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_STORAGE_ERROR;
+       }
+
+       return err;
+}
+
+
+EXPORT_API int msg_get_folder_list(msg_handle_t handle, msg_struct_list_s *folder_list)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       try
+       {
+               err = pHandle->getFolderList(folder_list);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_STORAGE_ERROR;
+       }
+
+       return err;
+}
+
+
+EXPORT_API int msg_generate_message(msg_handle_t handle, msg_message_type_t msg_type, msg_folder_id_t folder_id, unsigned int num_msg)
+{
+       if (handle == NULL)
+       {
+               MSG_DEBUG("Handle is NULL");
+               return -EINVAL;
+       }
+
+       if (folder_id >= MSG_MAX_FOLDER_ID)
+       {
+               MSG_DEBUG("folderId is invalid [%d]", folder_id);
+               return -EINVAL;
+       }
+
+       MSG_DEBUG("type : %d, folder : %d, num_msg : %d", msg_type, folder_id, num_msg);
+
+       int err = 0;
+       MSG_SENDINGOPT_S sendingOpt = {0};
+       sendingOpt.bSetting = false;
+
+       char strMsg[20] = {0};
+       char prefix[10] ="0103001";
+//     int postfix = 8111;
+       int postfix = 0;
+
+       srand(getpid());
+
+       msg_struct_s *msg_s = NULL;
+       msg_struct_s *addr_s = NULL;
+       MSG_MESSAGE_HIDDEN_S *msgInfo = NULL;
+       MSG_ADDRESS_INFO_S *addrInfo = NULL;
+
+       for (unsigned int i = 0; i < num_msg; i++)
+       {
+               msg_s = (msg_struct_s *)msg_create_struct(MSG_STRUCT_MESSAGE_INFO);
+               msgInfo = (MSG_MESSAGE_HIDDEN_S *)msg_s->data;
+
+               msgInfo->folderId = folder_id;
+
+               if (msg_type == MSG_TYPE_MMS)
+               {
+                       msgInfo->mainType = MSG_MMS_TYPE;
+                       msgInfo->subType = MSG_SENDREQ_MMS;
+               }
+               else
+               {
+                       msgInfo->mainType = MSG_SMS_TYPE;
+                       msgInfo->subType = MSG_NORMAL_SMS;
+
+                       snprintf(strMsg, sizeof(strMsg), "test msg %d", i);
+                       msgInfo->dataSize = strlen(strMsg);
+                       msgInfo->pData = (void*)new char[msgInfo->dataSize+1];
+            memcpy((char *)msgInfo->pData, strMsg, msgInfo->dataSize);
+            ((char*) msgInfo->pData)[msgInfo->dataSize] = '\0';
+               }
+
+               msgInfo->storageId = MSG_STORAGE_PHONE;
+
+               msgInfo->addr_list->nCount = 1;
+
+               addr_s = (msg_struct_s *)msgInfo->addr_list->msg_struct_info[0];
+
+               addrInfo = (MSG_ADDRESS_INFO_S *)addr_s->data;
+
+               addrInfo->addressType = MSG_ADDRESS_TYPE_PLMN;
+               postfix = rand()%10000;
+               snprintf(addrInfo->addressVal, MAX_ADDRESS_VAL_LEN+1, "%s%04d", prefix, postfix);
+
+               addrInfo->recipientType = MSG_RECIPIENTS_TYPE_TO;
+
+               time(&(msgInfo->displayTime));
+
+               msgInfo->networkStatus = MSG_NETWORK_NOT_SEND;
+               msgInfo->bRead = false;
+               msgInfo->bProtected = false;
+               msgInfo->priority = MSG_MESSAGE_PRIORITY_NORMAL;
+
+               if (folder_id == MSG_OUTBOX_ID || folder_id == MSG_SENTBOX_ID)
+                       msgInfo->direction = MSG_DIRECTION_TYPE_MO;
+               else
+                       msgInfo->direction = MSG_DIRECTION_TYPE_MT;
+
+               if (msg_type == MSG_TYPE_MMS)
+               {
+                       snprintf(msgInfo->subject, MAX_SUBJECT_LEN+1, "subject %d", i);
+
+                       if(folder_id == MSG_INBOX_ID) msgInfo->networkStatus = MSG_NETWORK_RETRIEVE_SUCCESS;
+
+                       //MMS_MESSAGE_DATA_S* mms_data;
+                       //MMS_PAGE_S* page[2];
+                       //MMS_MEDIA_S* media[5];
+
+//                     mms_data = msg_mms_create_message();
+
+//                     msg_mms_set_rootlayout(mms_data, 100, 100, 0xffffff);
+//                     msg_mms_add_region(mms_data, "Image", 0, 50, 100, 50, 0xffffff);
+//                     msg_mms_add_region(mms_data, "Text", 0, 0, 100, 50, 0xffffff);
+
+                       //------------>  1st Slide Composing
+//                     page[0] = msg_mms_add_page(mms_data, 5440);
+
+//                     media[0] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_IMG, "Image", (char*)"/opt/etc/msg-service/P091120_104633.jpg");
+//                     media[1] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_AUDIO, NULL, (char*)"/opt/etc/msg-service/audio.amr");
+//                     media[2] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_TEXT, "Text", (char*)"/opt/etc/msg-service/Temp0_2.txt");
+//                     media[2]->sMedia.sText.nColor = 0x000000;
+//                     media[2]->sMedia.sText.nSize = MMS_SMIL_FONT_SIZE_NORMAL;
+//                     media[2]->sMedia.sText.bBold = true;
+
+                       //------------>  2nd Slide Composing
+//                     page[1] = msg_mms_add_page(mms_data, 4544);
+
+//                     media[3] = msg_mms_add_media(page[1], MMS_SMIL_MEDIA_TEXT, "Text", (char*)"/opt/etc/msg-service/Temp1_0.txt");
+//                     media[3]->sMedia.sText.nColor = 0x000000;
+//                     media[3]->sMedia.sText.nSize = MMS_SMIL_FONT_SIZE_NORMAL;
+//                     media[3]->sMedia.sText.bItalic = true;
+//                     media[4] = msg_mms_add_media(page[1], MMS_SMIL_MEDIA_VIDEO, "Text", (char*)"/opt/etc/msg-service/V091120_104905.3gp");
+//                     strncpy(media[4]->szAlt, "Video Load Fail", MAX_SMIL_ALT_LEN-1);
+
+                       //FIXME msg_mms_set_message_body((msg_message_t)&msgInfo, mms_data);
+
+//                     msg_mms_destroy_message(mms_data);
+               }
+
+               //err = msg_add_message(handle, (msg_message_t)&msgInfo, &sendingOpt);
+               try
+               {
+                       MsgHandle* pHandle = (MsgHandle*)handle;
+                       err = pHandle->addMessage(msgInfo, &sendingOpt);
+               }
+               catch (MsgException& e)
+               {
+                       MSG_FATAL("%s", e.what());
+                       return MSG_ERR_STORAGE_ERROR;
+               }
+
+               if (msg_type == MSG_TYPE_MMS && msgInfo->pMmsData) //free pMmsData directly. It is added to enhance performance
+                       delete [] static_cast<char*>(msgInfo->pMmsData);
+
+               if (err < 0)
+               {
+                       MSG_DEBUG("err [%d]", err);
+                       return err;
+               }
+
+               msg_release_struct((msg_struct_t *)&msg_s);
+       }
+
+       return MSG_SUCCESS;
+}
+
+
+EXPORT_API int msg_generate_sms(msg_handle_t handle, msg_folder_id_t folder_id, unsigned int num_msg)
+{
+       MSG_DEBUG("folder %d, num_msg %d", folder_id, num_msg);
+
+       if (handle == NULL)
+       {
+               MSG_DEBUG("Handle is NULL");
+               return -EINVAL;
+       }
+
+       if (folder_id >= MSG_MAX_FOLDER_ID)
+       {
+               MSG_DEBUG("folderId is invalid");
+               return -EINVAL;
+       }
+
+       int err = 0;
+       char strMsg[20] = {0};
+       char prefix[10] ="0103001";
+       int postfix = 0;
+
+       MSG_SENDINGOPT_S sendingOpt = {0};
+       sendingOpt.bSetting = false;
+
+       srand(getpid());
+
+       msg_struct_s *msg_s = NULL;
+       msg_struct_s *addr_s = NULL;
+       MSG_MESSAGE_HIDDEN_S *msgInfo = NULL;
+       MSG_ADDRESS_INFO_S *addrInfo = NULL;
+
+       for (unsigned int i = 0; i < num_msg; i++)
+       {
+               msg_s = (msg_struct_s *)msg_create_struct(MSG_STRUCT_MESSAGE_INFO);
+               msgInfo = (MSG_MESSAGE_HIDDEN_S *)msg_s->data;
+
+               msgInfo->msgId  = 0; // It should be set 0
+               msgInfo->folderId = folder_id;
+
+               msgInfo->mainType = MSG_SMS_TYPE;
+               msgInfo->subType = 0;
+
+               msgInfo->storageId = MSG_STORAGE_PHONE;
+
+               snprintf(strMsg, sizeof(strMsg), "test %d", i);
+               msgInfo->dataSize = strlen(strMsg);
+               msgInfo->pData = strMsg;
+
+               msgInfo->addr_list->nCount = 1;
+
+               addr_s = (msg_struct_s *)msgInfo->addr_list->msg_struct_info[0];
+
+               addrInfo = (MSG_ADDRESS_INFO_S *)addr_s->data;
+
+               addrInfo->addressType = MSG_ADDRESS_TYPE_PLMN;
+               postfix = rand()%10000;
+               snprintf(addrInfo->addressVal, MAX_ADDRESS_VAL_LEN+1, "%s%04d", prefix, postfix);
+
+               addrInfo->recipientType = MSG_RECIPIENTS_TYPE_TO;
+
+               time(&(msgInfo->displayTime));
+
+               msgInfo->networkStatus = MSG_NETWORK_NOT_SEND;
+               msgInfo->bRead = false;
+               msgInfo->bProtected = false;
+               msgInfo->priority = MSG_MESSAGE_PRIORITY_NORMAL;
+               msgInfo->direction = MSG_DIRECTION_TYPE_MO;
+
+//             err = msg_add_message(handle, (msg_message_t) &msgInfo, &sendingOpt);
+               try
+               {
+                       MsgHandle* pHandle = (MsgHandle*)handle;
+                       err = pHandle->addMessage(msgInfo, &sendingOpt);
+               }
+               catch (MsgException& e)
+               {
+                       MSG_FATAL("%s", e.what());
+                       return MSG_ERR_STORAGE_ERROR;
+               }
+
+               if (err < 0)
+               {
+                       MSG_DEBUG("err [%d]", err);
+                       return err;
+               }
+
+               msg_release_struct((msg_struct_t *)&msg_s);
+       }
+
+       return MSG_SUCCESS;
+}
+
+
+EXPORT_API int msg_get_quick_panel_data(msg_handle_t handle, msg_quickpanel_type_t type, msg_struct_t opq_msg)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL || !opq_msg )
+       {
+               MSG_FATAL("handle or opq_msg is NULL");
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+       msg_struct_s *pMsg = (msg_struct_s *)opq_msg;
+
+       try
+       {
+               err = pHandle->getQuickPanelData(type, (MSG_MESSAGE_HIDDEN_S *)pMsg->data);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_STORAGE_ERROR;
+       }
+
+       return err;
+}
+
+
+EXPORT_API int msg_reset_database(msg_handle_t handle)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       try
+       {
+               err = pHandle->resetDatabase();
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_STORAGE_ERROR;
+       }
+
+       return err;
+}
+
+
+EXPORT_API int msg_get_mem_size(msg_handle_t handle, unsigned int* memsize)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       try
+       {
+               err = pHandle->getMemSize(memsize);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_STORAGE_ERROR;
+       }
+
+       return err;
+
+}
+
+EXPORT_API int msg_backup_message(msg_handle_t handle)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       try
+       {
+               err = pHandle->backupMessage();
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_STORAGE_ERROR;
+       }
+
+       return err;
+}
+
+
+EXPORT_API int msg_restore_message(msg_handle_t handle)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       try
+       {
+               err = pHandle->restoreMessage();
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_STORAGE_ERROR;
+       }
+
+       return err;
+}
+
+
+EXPORT_API int msg_search_message_for_thread_view(msg_handle_t handle, const char *search_string, msg_struct_list_s *msg_thread_view_list)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL || search_string == NULL)
+       {
+               return -EINVAL;
+       }
+
+       if (strlen(search_string) <= 0 || strlen(search_string) > MAX_MSG_TEXT_LEN)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       try
+       {
+               err = pHandle->searchMessage(search_string, msg_thread_view_list);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_STORAGE_ERROR;
+       }
+
+       return err;
+}
+
+
+EXPORT_API int msg_search_message(msg_handle_t handle, const msg_struct_t msg_search_conditions, int offset, int limit, msg_struct_list_s *msg_list)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL || msg_search_conditions == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+       msg_struct_s *pStruct = (msg_struct_s *)msg_search_conditions;
+
+       try
+       {
+               err = pHandle->searchMessage((MSG_SEARCH_CONDITION_S *)pStruct->data, offset, limit, msg_list);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_STORAGE_ERROR;
+       }
+
+       return err;
+}
+
+EXPORT_API int msg_get_reject_msg_list(msg_handle_t handle, const char *phone_num, msg_struct_list_s *msg_reject_msg_list)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       try
+       {
+               err = pHandle->getRejectMsgList(phone_num, msg_reject_msg_list);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_STORAGE_ERROR;
+       }
+
+       return err;
+}
+
+
+EXPORT_API int msg_reg_storage_change_callback(msg_handle_t handle, msg_storage_change_cb cb, void *user_param)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL || cb == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       try
+       {
+               err = pHandle->regStorageChangeCallback(cb, user_param);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_CALLBACK_ERROR;
+       }
+
+       return err;
+}
+
+
+EXPORT_API int msg_get_report_status(msg_handle_t handle, msg_message_id_t msg_id, msg_struct_t report_status)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL || msg_id < 1)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+       msg_struct_s *pStruct = (msg_struct_s *)report_status;
+
+       try
+       {
+               err = pHandle->getReportStatus(msg_id, (MSG_REPORT_STATUS_INFO_S *)pStruct->data);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_STORAGE_ERROR;
+       }
+
+       return err;
+}
+
+EXPORT_API int msg_get_address_list(msg_handle_t handle, msg_thread_id_t thread_id, msg_struct_list_s *msg_address_list)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       try
+       {
+               err = pHandle->getAddressList(thread_id, msg_address_list);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_STORAGE_ERROR;
+       }
+
+       return err;
+}
+
+
+EXPORT_API int msg_get_thread_id_by_address(msg_handle_t handle, msg_struct_list_s *msg_address_list, msg_thread_id_t *thread_id)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL || msg_address_list->nCount < 1)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       try
+       {
+               err = pHandle->getThreadIdByAddress(msg_address_list, thread_id);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_STORAGE_ERROR;
+       }
+
+       return err;
+}
+
+
+EXPORT_API int msg_get_thread(msg_handle_t handle, msg_thread_id_t thread_id, msg_struct_t msg_thread)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL || msg_thread == NULL ) {
+               MSG_FATAL("handle or msg_thread is NULL");
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+       msg_struct_s *msgThread = (msg_struct_s *)msg_thread;
+       if (msgThread->type != MSG_STRUCT_THREAD_INFO) {
+               MSG_FATAL("Invaild type. type [%d]", msgThread->type);
+               return MSG_ERR_INVALID_PARAMETER;
+       }
+
+       MSG_THREAD_VIEW_S* pThreadInfo = (MSG_THREAD_VIEW_S *)msgThread->data;
+
+       try
+       {
+               err = pHandle->getThread(thread_id, pThreadInfo);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_STORAGE_ERROR;
+       }
+
+       return err;
+}
+
+
+EXPORT_API int msg_get_message_list(msg_handle_t handle, msg_folder_id_t folder_id, msg_thread_id_t thread_id, msg_message_type_t msg_type, msg_storage_id_t storage_id, msg_struct_list_s *msg_list)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL) {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       try
+       {
+               err = pHandle->getMessageList(folder_id, thread_id, msg_type, storage_id, msg_list);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_STORAGE_ERROR;
+       }
+
+       return err;
+}
+
+static int msg_thread_get_msg_type(int mainType, int subType)
+{
+       if (mainType == MSG_SMS_TYPE)
+       {
+               if (subType == MSG_CB_SMS)
+                       return MSG_TYPE_SMS_CB;
+               else if (subType == MSG_JAVACB_SMS)
+                       return MSG_TYPE_SMS_JAVACB;
+               else if (subType == MSG_WAP_SI_SMS || subType == MSG_WAP_SL_SMS)
+                       return MSG_TYPE_SMS_WAPPUSH;
+               else if (subType == MSG_MWI_VOICE_SMS || subType == MSG_MWI_FAX_SMS
+                               || subType == MSG_MWI_EMAIL_SMS || subType == MSG_MWI_OTHER_SMS)
+                       return MSG_TYPE_SMS_MWI;
+               else    if (subType == MSG_SYNCML_CP)
+                       return MSG_TYPE_SMS_SYNCML;
+               else    if (subType == MSG_REJECT_SMS)
+                       return MSG_TYPE_SMS_REJECT;
+               else
+                       return MSG_TYPE_SMS;
+       }
+       else if (mainType == MSG_MMS_TYPE)
+       {
+               if (subType == MSG_NOTIFICATIONIND_MMS)
+                       return MSG_TYPE_MMS_NOTI;
+               else if (subType == MSG_SENDREQ_JAVA_MMS)
+                       return MSG_TYPE_MMS_JAVA;
+               else
+                       return MSG_TYPE_MMS;
+       }
+       else
+               return MSG_TYPE_INVALID;
+}
+
+
+int msg_syncml_info_get_int(void *syncml_info, int field)
+{
+       int result = -1;
+       MSG_SYNCML_MESSAGE_S *pSync = (MSG_SYNCML_MESSAGE_S *)syncml_info;
+       switch(field)
+       {
+       case MSG_SYNCML_INFO_EXTID_INT:
+               result = pSync->extId;
+               break;
+       case MSG_SYNCML_INFO_PINCODE_INT:
+               result = pSync->pinCode;
+               break;
+       default:
+               result = -1;
+               break;
+       }
+       return result;
+}
+
+int msg_count_info_get_int(void *count_info, int field)
+{
+       int result = -1;
+       MSG_COUNT_INFO_S *pCount = (MSG_COUNT_INFO_S *)count_info;
+       switch(field)
+       {
+       case MSG_COUNT_INFO_READ_INT:
+               result = pCount->nReadCnt;
+               break;
+       case MSG_COUNT_INFO_UNREAD_INT:
+               result = pCount->nUnreadCnt;
+               break;
+       case MSG_COUNT_INFO_SMS_INT:
+               result = pCount->nSms;
+               break;
+       case MSG_COUNT_INFO_MMS_INT:
+               result = pCount->nMms;
+               break;
+       default:
+               result = -1;
+               break;
+       }
+       return result;
+}
+
+int msg_thread_count_get_int(void *count_info, int field)
+{
+       int result = -1;
+       MSG_THREAD_COUNT_INFO_S *pCount = (MSG_THREAD_COUNT_INFO_S *)count_info;
+       switch(field)
+       {
+       case MSG_THREAD_COUNT_TOTAL_INT:
+               result = pCount->totalCount;
+               break;
+       case MSG_THREAD_COUNT_UNREAD_INT:
+               result = pCount->unReadCount;
+               break;
+       case MSG_THREAD_COUNT_SMS_INT:
+               result = pCount->smsMsgCount;
+               break;
+       case MSG_THREAD_COUNT_MMS_INT:
+               result = pCount->mmsMsgCount;
+               break;
+       default:
+               result = -1;
+               break;
+       }
+       return result;
+}
+
+int msg_thread_index_get_int(void *index_info, int field)
+{
+       int result = -1;
+       MSG_THREAD_LIST_INDEX_S *pIndex = (MSG_THREAD_LIST_INDEX_S *)index_info;
+       switch(field)
+       {
+       case MSG_THREAD_LIST_INDEX_CONTACTID_INT:
+               result = pIndex->contactId;
+               break;
+       default:
+               result = -1;
+               break;
+       }
+       return result;
+}
+
+int msg_sortrule_get_int(void *sort_info, int field)
+{
+       int result = -1;
+       MSG_SORT_RULE_S *pSort = (MSG_SORT_RULE_S *)sort_info;
+       switch(field)
+       {
+       case MSG_SORT_RULE_SORT_TYPE_INT:
+               result = pSort->sortType;
+               break;
+       default:
+               result = -1;
+               break;
+       }
+       return result;
+}
+
+int msg_folder_info_get_int(void *folder_info, int field)
+{
+       int result = -1;
+       MSG_FOLDER_INFO_S *pFolder = (MSG_FOLDER_INFO_S *)folder_info;
+       switch(field)
+       {
+       case MSG_FOLDER_INFO_ID_INT:
+               result = pFolder->folderId;
+               break;
+       case MSG_FOLDER_INFO_TYPE_INT:
+               result = pFolder->folderType;
+               break;
+       default:
+               result = -1;
+               break;
+       }
+       return result;
+}
+
+int msg_thread_info_get_int(void *data, int field)
+{
+       int result = -1;
+       MSG_THREAD_VIEW_S *pThread = (MSG_THREAD_VIEW_S *)data;
+
+       switch(field)
+       {
+       case MSG_THREAD_ID_INT :
+               result = pThread->threadId;
+               break;
+       case MSG_THREAD_MSG_TYPE_INT :
+               result = msg_thread_get_msg_type(pThread->mainType, pThread->subType);
+               break;
+       case MSG_THREAD_MSG_TIME_INT :
+               result = pThread->threadTime;
+               break;
+       case MSG_THREAD_DIRECTION_INT :
+               result = pThread->direction;
+               break;
+       case MSG_THREAD_UNREAD_COUNT_INT :
+               result = pThread->unreadCnt;
+               break;
+       case MSG_THREAD_SMS_COUNT_INT :
+               result = pThread->smsCnt;
+               break;
+       case MSG_THREAD_MMS_COUNT_INT :
+               result = pThread->mmsCnt;
+               break;
+       default:
+               result = -1;
+               break;
+       }
+       return result;
+}
+
+int msg_search_condition_get_int(void *condition_info, int field)
+{
+       int result = -1;
+       MSG_SEARCH_CONDITION_S *pCond = (MSG_SEARCH_CONDITION_S *)condition_info;
+       switch(field)
+       {
+       case MSG_SEARCH_CONDITION_FOLDERID_INT:
+               result = pCond->folderId;
+               break;
+       case MSG_SEARCH_CONDITION_MSGTYPE_INT:
+               result = pCond->msgType;
+               break;
+       case MSG_SEARCH_CONDITION_RESERVED_INT:
+               result = pCond->reserved;
+               break;
+       default:
+               result = -1;
+               break;
+       }
+       return result;
+}
+
+int msg_report_status_get_int(void *report_info, int field)
+{
+       int result = -1;
+       MSG_REPORT_STATUS_INFO_S *pReport = (MSG_REPORT_STATUS_INFO_S *)report_info;
+       switch(field)
+       {
+       case MSG_REPORT_STATUS_DELIVERY_STATUS_INT:
+               result = pReport->deliveryStatus;
+               break;
+       case MSG_REPORT_STATUS_DELIVERY_TIME_INT:
+               result = pReport->deliveryStatusTime;
+               break;
+       case MSG_REPORT_STATUS_READ_STATUS_INT:
+               result = pReport->readStatus;
+               break;
+       case MSG_REPORT_STATUS_READ_TIME_INT:
+               result = pReport->readStatusTime;
+               break;
+       default:
+               result = -1;
+               break;
+       }
+       return result;
+}
+
+char* msg_folder_info_get_str(void *folder_info, int field)
+{
+       char *result = NULL;
+       MSG_FOLDER_INFO_S *pFolder = (MSG_FOLDER_INFO_S *)folder_info;
+       switch(field)
+       {
+       case MSG_FOLDER_INFO_NAME_STR:
+               result = pFolder->folderName;
+               break;
+       default:
+               result = NULL;
+               break;
+       }
+       return result;
+}
+
+char *msg_thread_info_get_str(void *data, int field)
+{
+       char *ret_str = NULL;
+       MSG_THREAD_VIEW_S *pThread = (MSG_THREAD_VIEW_S *)data;
+
+       switch(field)
+       {
+       case MSG_THREAD_NAME_STR :
+               ret_str = pThread->threadName;
+               break;
+       case MSG_THREAD_MSG_DATA_STR :
+               ret_str = pThread->threadData;
+               break;
+       default:
+               break;
+       }
+
+       return ret_str;
+}
+
+char* msg_search_condition_get_str(void *condition_info, int field, int size)
+{
+       char *result = NULL;
+       MSG_SEARCH_CONDITION_S *search_cond = (MSG_SEARCH_CONDITION_S *)condition_info;
+       switch(field)
+       {
+       case MSG_SEARCH_CONDITION_ADDRESS_VALUE_STR:
+               result = search_cond->pAddressVal;
+               break;
+       case MSG_SEARCH_CONDITION_SEARCH_VALUE_STR:
+               result = search_cond->pSearchVal;
+               break;
+
+       default:
+               result = NULL;
+               break;
+       }
+       return result;
+}
+
+bool msg_sendopt_get_bool(void *send_opt, int field)
+{
+       bool result = false;
+       MSG_SENDINGOPT_S *sendopt = (MSG_SENDINGOPT_S *)send_opt;
+       switch(field)
+       {
+       case MSG_SEND_OPT_SETTING_BOOL:
+               result = sendopt->bDeliverReq;
+               break;
+       case MSG_SEND_OPT_KEEPCOPY_BOOL:
+               result = sendopt->bDeliverReq;
+               break;
+       case MSG_SEND_OPT_DELIVER_REQ_BOOL:
+               result = sendopt->bDeliverReq;
+               break;
+       default:
+               break;
+       }
+       return result;
+}
+
+bool msg_sortrule_get_bool(void *sort_rule, int field)
+{
+       bool result = false;
+       MSG_SORT_RULE_S *pSort = (MSG_SORT_RULE_S *)sort_rule;
+       switch(field)
+       {
+       case MSG_SORT_RULE_ACSCEND_BOOL:
+               result = pSort->bAscending;
+               break;
+       default:
+               break;
+       }
+       return result;
+}
+
+int msg_sendopt_get_struct_handle(msg_struct_s *msg_struct, int field, void **value)
+{
+       msg_error_t err =  MSG_SUCCESS;
+       if(!msg_struct || !value)
+               return MSG_ERR_NULL_POINTER;
+
+       MSG_SENDINGOPT_S *sendopt = (MSG_SENDINGOPT_S *)msg_struct->data;
+
+       switch(field)
+       {
+       case MSG_SEND_OPT_MMS_OPT_HND:
+               *value = (void *)sendopt->mmsSendOpt;
+               break;
+       case MSG_SEND_OPT_SMS_OPT_HND:
+               *value = (void *)sendopt->smsSendOpt;
+               break;
+       default:
+               err = MSG_ERR_UNKNOWN;
+               break;
+       }
+       return err;
+}
+
+int msg_syncml_get_struct_handle(msg_struct_s *msg_struct, int field, void **value)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if(!msg_struct || !value)
+               return MSG_ERR_NULL_POINTER;
+
+       MSG_SYNCML_MESSAGE_S *pSync = (MSG_SYNCML_MESSAGE_S *)msg_struct->data;
+       switch(field)
+       {
+       case MSG_SYNCML_INFO_MESSAGE_HND:
+               *value = (void *)pSync->msg;
+               break;
+       default:
+               err = MSG_ERR_UNKNOWN;
+               break;
+
+       }
+       return err;
+}
+
+int msg_thread_index_get_struct_handle(msg_struct_s *msg_struct, int field, void **value)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if(!msg_struct || !value)
+               return MSG_ERR_NULL_POINTER;
+
+       MSG_THREAD_LIST_INDEX_INFO_S *pIndex = (MSG_THREAD_LIST_INDEX_INFO_S *)msg_struct->data;
+       switch(field)
+       {
+       case MSG_SYNCML_INFO_MESSAGE_HND:
+               *value = (void *)pIndex->msgAddrInfo;
+               break;
+       default:
+               err = MSG_ERR_UNKNOWN;
+               break;
+
+       }
+       return err;
+}
+
+int msg_address_info_get_int(void *addr_info, int field)
+{
+       int result = -1;
+       MSG_ADDRESS_INFO_S *pAddr = (MSG_ADDRESS_INFO_S *)addr_info;
+       switch(field)
+       {
+       case MSG_ADDRESS_INFO_ADDRESS_TYPE_INT:
+               result = pAddr->addressType;
+               break;
+       case MSG_ADDRESS_INFO_RECIPIENT_TYPE_INT:
+               result = pAddr->recipientType;
+               break;
+       case MSG_ADDRESS_INFO_CONTACT_ID_INT:
+               result = pAddr->contactId;
+               break;
+       default:
+               break;
+       }
+       return result;
+}
+int msg_mms_sendopt_get_int(void *opt_info, int field)
+{
+       int result = -1;
+       MMS_SENDINGOPT_S *pOpt = (MMS_SENDINGOPT_S *)opt_info;
+       switch(field)
+       {
+       case MSG_MMS_SENDOPTION_EXPIRY_TIME_INT:
+               result = pOpt->expiryTime;
+               break;
+       case MSG_MMS_SENDOPTION_DELIVERY_TIME_INT:
+               result = pOpt->deliveryTime;
+               break;
+       case MSG_MMS_SENDOPTION_PRIORITY_INT:
+               result = pOpt->priority;
+               break;
+       default:
+               break;
+       }
+       return result;
+}
+
+int msg_reject_message_get_int(void *msg_info, int field)
+{
+       int result = -1;
+       MSG_REJECT_MSG_INFO_S *pMsg = (MSG_REJECT_MSG_INFO_S *)msg_info;
+       switch(field)
+       {
+       case MSG_REJECT_MESSAGE_MSGID_INT:
+               result = pMsg->msgId;
+               break;
+       case MSG_REJECT_MESSAGE_DISPLAY_TIME_INT:
+               result = pMsg->displayTime;
+               break;
+       default:
+               break;
+       }
+       return result;
+}
+
+char* msg_address_info_get_str(void *addr_info, int field, int size)
+{
+       char *result = NULL;
+       MSG_ADDRESS_INFO_S *pAddr = (MSG_ADDRESS_INFO_S *)addr_info;
+       switch(field)
+       {
+       case MSG_ADDRESS_INFO_ADDRESS_VALUE_STR:
+               result = pAddr->addressVal;
+               break;
+       case MSG_ADDRESS_INFO_DISPLAYNAME_STR:
+               result = pAddr->displayName;
+               break;
+
+       default:
+               result = NULL;
+               break;
+       }
+       return result;
+}
+
+char* msg_reject_message_get_str(void *msg_info, int field, int size)
+{
+       char *result = NULL;
+       MSG_REJECT_MSG_INFO_S *pMsg = (MSG_REJECT_MSG_INFO_S *)msg_info;
+       switch(field)
+       {
+       case MSG_REJECT_MESSAGE_MSGTEXT_STR:
+               result = pMsg->msgText;
+               break;
+       default:
+               result = NULL;
+               break;
+       }
+       return result;
+}
+
+bool msg_mms_sendopt_get_bool(void *opt_info, int field)
+{
+       bool result = false;
+       MMS_SENDINGOPT_S *pOpt = (MMS_SENDINGOPT_S *)opt_info;
+       switch(field)
+       {
+       case MSG_MMS_SENDOPTION_READ_REQUEST_BOOL:
+               result = pOpt->bReadReq;
+               break;
+       case MSG_MMS_SENDOPTION_DELIVERY_CUSTOMTIME_BOOL:
+               result = pOpt->bUseDeliveryCustomTime;
+               break;
+       default:
+               break;
+       }
+       return result;
+}
+
+bool msg_sms_sendopt_get_bool(void *opt_info, int field)
+{
+       bool result = false;
+       SMS_SENDINGOPT_S *pOpt = (SMS_SENDINGOPT_S *)opt_info;
+       switch(field)
+       {
+       case MSG_SMS_SENDOPT_REPLYPATH_BOOL:
+               result = pOpt->bReplyPath;
+               break;
+       default:
+               break;
+       }
+       return result;
+}
+
+int msg_syncml_info_set_int(void *syncml_info, int field, int value)
+{
+
+       msg_error_t err =  MSG_SUCCESS;
+       if(!syncml_info)
+               return MSG_ERR_NULL_POINTER;
+
+    MSG_SYNCML_MESSAGE_S *pSync = (MSG_SYNCML_MESSAGE_S *)syncml_info;
+    switch(field)
+    {
+    case MSG_SYNCML_INFO_EXTID_INT:
+               pSync->extId = value;
+               break;
+    case MSG_SYNCML_INFO_PINCODE_INT:
+               pSync->pinCode = value;
+               break;
+    default:
+               err = MSG_ERR_UNKNOWN;
+               break;
+    }
+
+       return err;
+}
+
+int msg_count_info_set_int(void *count_info, int field, int value)
+{
+       msg_error_t err =  MSG_SUCCESS;
+       if(!count_info)
+               return MSG_ERR_NULL_POINTER;
+
+    MSG_COUNT_INFO_S *pCount = (MSG_COUNT_INFO_S *)count_info;
+
+    switch(field)
+    {
+    case MSG_COUNT_INFO_READ_INT:
+               pCount->nReadCnt = value;
+               break;
+    case MSG_COUNT_INFO_UNREAD_INT:
+               pCount->nUnreadCnt = value;
+               break;
+    case MSG_COUNT_INFO_SMS_INT:
+               pCount->nSms = value;
+               break;
+    case MSG_COUNT_INFO_MMS_INT:
+               pCount->nMms = value;
+               break;
+    default:
+               err = MSG_ERR_UNKNOWN;
+               break;
+    }
+       return err;
+}
+
+int msg_thread_count_set_int(void *count_info, int field, int value)
+{
+       msg_error_t err =  MSG_SUCCESS;
+       if(!count_info)
+               return MSG_ERR_NULL_POINTER;
+
+    MSG_THREAD_COUNT_INFO_S *pCount = (MSG_THREAD_COUNT_INFO_S *)count_info;
+    switch(field)
+    {
+    case MSG_THREAD_COUNT_TOTAL_INT:
+               pCount->totalCount = value;
+               break;
+    case MSG_THREAD_COUNT_UNREAD_INT:
+               pCount->unReadCount = value;
+               break;
+    case MSG_THREAD_COUNT_SMS_INT:
+               pCount->smsMsgCount = value;
+               break;
+    case MSG_THREAD_COUNT_MMS_INT:
+               pCount->mmsMsgCount = value;
+               break;
+    default:
+               err = MSG_ERR_UNKNOWN;
+               break;
+    }
+       return err;
+}
+
+int msg_thread_index_set_int(void *index_info, int field, int value)
+{
+       msg_error_t err =  MSG_SUCCESS;
+       if(!index_info)
+               return MSG_ERR_NULL_POINTER;
+
+    MSG_THREAD_LIST_INDEX_S *pIndex = (MSG_THREAD_LIST_INDEX_S *)index_info;
+    switch(field)
+    {
+    case MSG_THREAD_LIST_INDEX_CONTACTID_INT:
+               pIndex->contactId = value;
+               break;
+    default:
+               err = MSG_ERR_UNKNOWN;
+               break;
+    }
+
+       return err;
+}
+
+int msg_sortrule_set_int(void *sort_info, int field, int value)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if(!sort_info)
+               return MSG_ERR_NULL_POINTER;
+
+    MSG_SORT_RULE_S *pSort = (MSG_SORT_RULE_S *)sort_info;
+    switch(field)
+    {
+    case MSG_SORT_RULE_SORT_TYPE_INT:
+               pSort->sortType = value;
+               break;
+    default:
+               err = MSG_ERR_UNKNOWN;
+               break;
+    }
+       return err;
+}
+
+int msg_folder_info_set_int(void *folder_info, int field, int value)
+{
+       msg_error_t err =  MSG_SUCCESS;
+       if(!folder_info)
+               return MSG_ERR_NULL_POINTER;
+
+    MSG_FOLDER_INFO_S *pFolder = (MSG_FOLDER_INFO_S *)folder_info;
+    switch(field)
+    {
+    case MSG_FOLDER_INFO_ID_INT:
+               pFolder->folderId = value;
+               break;
+    case MSG_FOLDER_INFO_TYPE_INT:
+               pFolder->folderType = value;
+               break;
+    default:
+               err = MSG_ERR_UNKNOWN;
+               break;
+    }
+
+       return err;
+}
+
+int msg_search_condition_set_int(void *condition_info, int field, int value)
+{
+       msg_error_t err =  MSG_SUCCESS;
+       if(!condition_info)
+               return MSG_ERR_NULL_POINTER;
+
+    MSG_SEARCH_CONDITION_S *pCond = (MSG_SEARCH_CONDITION_S *)condition_info;
+    switch(field)
+    {
+    case MSG_SEARCH_CONDITION_FOLDERID_INT:
+               pCond->folderId = value;
+               break;
+    case MSG_SEARCH_CONDITION_MSGTYPE_INT:
+               pCond->msgType = value;
+               break;
+    case MSG_SEARCH_CONDITION_RESERVED_INT:
+               pCond->reserved = value;
+               break;
+    default:
+               err = MSG_ERR_UNKNOWN;
+               break;
+    }
+
+       return err;
+}
+
+int msg_report_status_set_int(void *report_info, int field, int value)
+{
+       msg_error_t err =  MSG_SUCCESS;
+       if(!report_info)
+               return MSG_ERR_NULL_POINTER;
+
+    MSG_REPORT_STATUS_INFO_S *pReport = (MSG_REPORT_STATUS_INFO_S *)report_info;
+    switch(field)
+    {
+    case MSG_REPORT_STATUS_DELIVERY_STATUS_INT:
+               pReport->deliveryStatus = value;
+               break;
+    case MSG_REPORT_STATUS_DELIVERY_TIME_INT:
+               pReport->deliveryStatusTime = value;
+               break;
+    case MSG_REPORT_STATUS_READ_STATUS_INT:
+               pReport->readStatus = value;
+               break;
+    case MSG_REPORT_STATUS_READ_TIME_INT:
+               pReport->readStatusTime = value;
+               break;
+    default:
+               err = MSG_ERR_UNKNOWN;
+               break;
+    }
+
+       return err;
+}
+
+int msg_folder_info_set_str(void *folder_info, int field, char *value, int size)
+{
+       msg_error_t err =  MSG_SUCCESS;
+       if(!folder_info || !value)
+               return MSG_ERR_NULL_POINTER;
+    MSG_FOLDER_INFO_S *pFolder = (MSG_FOLDER_INFO_S *)folder_info;
+    int _len = 0;
+    (size > MAX_FOLDER_NAME_SIZE)? _len = MAX_FOLDER_NAME_SIZE : _len = size;
+    switch(field)
+    {
+    case MSG_FOLDER_INFO_NAME_STR:
+               strncpy(pFolder->folderName, value, _len);
+               break;
+    default:
+               err = MSG_ERR_UNKNOWN;
+               break;
+    }
+
+       return err;
+}
+
+int msg_search_condition_set_str(void *condition_info, int field, char *value, int size)
+{
+       msg_error_t err =  MSG_SUCCESS;
+       if(!condition_info || !value)
+               return MSG_ERR_NULL_POINTER;
+
+    MSG_SEARCH_CONDITION_S *search_cond = (MSG_SEARCH_CONDITION_S *)condition_info;
+
+    switch(field)
+    {
+    case MSG_SEARCH_CONDITION_ADDRESS_VALUE_STR:
+               search_cond->pAddressVal = value;
+               break;
+    case MSG_SEARCH_CONDITION_SEARCH_VALUE_STR:
+               search_cond->pSearchVal = value;
+               break;
+
+    default:
+               err = MSG_ERR_UNKNOWN;
+               break;
+    }
+       return err;
+}
+
+int msg_sendopt_set_bool(void *send_opt, int field, bool value)
+{
+       msg_error_t err =  MSG_SUCCESS;
+       if(!send_opt)
+               return MSG_ERR_NULL_POINTER;
+
+    MSG_SENDINGOPT_S *sendopt = (MSG_SENDINGOPT_S *)send_opt;
+    switch(field)
+    {
+    case MSG_SEND_OPT_SETTING_BOOL:
+               sendopt->bDeliverReq = value;
+               break;
+    case MSG_SEND_OPT_KEEPCOPY_BOOL:
+               sendopt->bDeliverReq = value;
+               break;
+    case MSG_SEND_OPT_DELIVER_REQ_BOOL:
+               sendopt->bDeliverReq = value;
+               break;
+    default:
+               err = MSG_ERR_UNKNOWN;
+               break;
+    }
+       return err;
+}
+
+int msg_sortrule_set_bool(void *sort_rule, int field, bool value)
+{
+       msg_error_t err =  MSG_SUCCESS;
+       if(!sort_rule)
+               return MSG_ERR_NULL_POINTER;
+
+    MSG_SORT_RULE_S *pSort = (MSG_SORT_RULE_S *)sort_rule;
+    switch(field)
+    {
+    case MSG_SORT_RULE_ACSCEND_BOOL:
+               pSort->bAscending = value;
+               break;
+    default:
+               err = MSG_ERR_UNKNOWN;
+               break;
+    }
+       return err;
+}
+
+int msg_sendopt_set_struct_handle(msg_struct_s *msg_struct, int field, msg_struct_s *value)
+{
+       msg_error_t err =  MSG_SUCCESS;
+       if(!msg_struct || !value)
+               return MSG_ERR_NULL_POINTER;
+
+       MSG_SENDINGOPT_S *sendopt = (MSG_SENDINGOPT_S *)msg_struct->data;
+       msg_struct_s *pTmp = NULL;
+
+       switch(field)
+       {
+       case MSG_SEND_OPT_MMS_OPT_HND:
+               pTmp = (msg_struct_s *)sendopt->mmsSendOpt;
+               memcpy(pTmp->data, value->data, sizeof(MMS_SENDINGOPT_INFO_S));
+               break;
+       case MSG_SEND_OPT_SMS_OPT_HND:
+               pTmp = (msg_struct_s *)sendopt->smsSendOpt;
+               memcpy(pTmp->data, value->data, sizeof(SMS_SENDINGOPT_INFO_S));
+               break;
+       default:
+               err = MSG_ERR_UNKNOWN;
+               break;
+       }
+       return err;
+}
+
+int msg_syncml_set_struct_handle(msg_struct_s *msg_struct, int field, msg_struct_s *value)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if(!msg_struct || !value)
+               return MSG_ERR_NULL_POINTER;
+
+       MSG_SYNCML_MESSAGE_S *pSync = (MSG_SYNCML_MESSAGE_S *)msg_struct->data;
+       msg_struct_s *pTmp = NULL;
+
+       switch(field)
+       {
+       case MSG_SYNCML_INFO_MESSAGE_HND:
+       {
+               pTmp = (msg_struct_s *)pSync->msg;
+               MSG_MESSAGE_HIDDEN_S *pSrc = (MSG_MESSAGE_HIDDEN_S *)value->data;
+               MSG_MESSAGE_HIDDEN_S *pDst = (MSG_MESSAGE_HIDDEN_S *)pTmp->data;
+               msg_message_copy_message(pSrc, pDst);
+               break;
+       }
+       default:
+               err = MSG_ERR_UNKNOWN;
+               break;
+
+       }
+       return err;
+}
+
+int msg_thread_index_set_struct_handle(msg_struct_s *msg_struct, int field, msg_struct_s *value)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if(!msg_struct || !value)
+               return MSG_ERR_NULL_POINTER;
+
+       MSG_THREAD_LIST_INDEX_INFO_S *pIndex = (MSG_THREAD_LIST_INDEX_INFO_S *)msg_struct->data;
+       msg_struct_s *pTmp = NULL;
+
+       switch(field)
+       {
+       case MSG_THREAD_LIST_INDEX_ADDR_INFO_HND:
+               pTmp = (msg_struct_s *)pIndex->msgAddrInfo;
+               memcpy(pTmp->data, value->data, sizeof(MSG_ADDRESS_INFO_S));
+               break;
+       default:
+               err = MSG_ERR_UNKNOWN;
+               break;
+
+       }
+       return err;
+}
+
+int msg_address_info_set_int(void *addrinfo, int field, int value)
+{
+       msg_error_t err =  MSG_SUCCESS;
+       if(!addrinfo)
+               return MSG_ERR_NULL_POINTER;
+
+       MSG_ADDRESS_INFO_S *pAddr = (MSG_ADDRESS_INFO_S *)addrinfo;
+       switch(field)
+       {
+       case MSG_ADDRESS_INFO_ADDRESS_TYPE_INT:
+               pAddr->addressType = value;
+               break;
+       case MSG_ADDRESS_INFO_RECIPIENT_TYPE_INT:
+               pAddr->recipientType = value;
+               break;
+       case MSG_ADDRESS_INFO_CONTACT_ID_INT:
+               pAddr->contactId = value;
+               break;
+       default:
+               err = MSG_ERR_UNKNOWN;
+       break;
+       }
+
+       return err;
+}
+
+
+int msg_mms_sendopt_set_int(void *opt_info, int field, int value)
+{
+       msg_error_t err =  MSG_SUCCESS;
+       if(!opt_info)
+               return MSG_ERR_NULL_POINTER;
+
+       MMS_SENDINGOPT_S *pOpt = (MMS_SENDINGOPT_S *)opt_info;
+       switch(field)
+       {
+       case MSG_MMS_SENDOPTION_EXPIRY_TIME_INT:
+               pOpt->expiryTime = value;
+               break;
+       case MSG_MMS_SENDOPTION_DELIVERY_TIME_INT:
+               pOpt->deliveryTime = value;
+               break;
+       case MSG_MMS_SENDOPTION_PRIORITY_INT:
+               pOpt->priority = value;
+               break;
+       default:
+               err = MSG_ERR_UNKNOWN;
+       break;
+       }
+
+       return err;
+}
+
+int msg_reject_message_set_int(void *msg_info, int field, int value)
+{
+       msg_error_t err =  MSG_SUCCESS;
+       if(!msg_info)
+               return MSG_ERR_NULL_POINTER;
+
+       MSG_REJECT_MSG_INFO_S *pMsg = (MSG_REJECT_MSG_INFO_S *)msg_info;
+       switch(field)
+       {
+       case MSG_REJECT_MESSAGE_MSGID_INT:
+               pMsg->msgId = value;
+               break;
+       case MSG_REJECT_MESSAGE_DISPLAY_TIME_INT:
+               pMsg->displayTime = value;
+               break;
+       default:
+               err = MSG_ERR_UNKNOWN;
+       break;
+       }
+
+       return err;
+}
+
+int msg_address_info_set_str(void *addr_info, int field, char *value, int size)
+{
+       msg_error_t err =  MSG_SUCCESS;
+       if(!addr_info || !value)
+               return MSG_ERR_NULL_POINTER;
+    MSG_ADDRESS_INFO_S *pAddr = (MSG_ADDRESS_INFO_S *)addr_info;
+    int _len = 0;
+
+    switch(field)
+    {
+    case MSG_ADDRESS_INFO_ADDRESS_VALUE_STR:
+        (size > MAX_ADDRESS_VAL_LEN)? _len = MAX_ADDRESS_VAL_LEN : _len = size;
+        memset(pAddr->addressVal, 0x00, sizeof(pAddr->addressVal));
+               strncpy(pAddr->addressVal, value, _len);
+               break;
+    case MSG_ADDRESS_INFO_DISPLAYNAME_STR:
+        (size > MAX_DISPLAY_NAME_LEN)? _len = MAX_DISPLAY_NAME_LEN : _len = size;
+        memset(pAddr->displayName, 0x00, sizeof(pAddr->displayName));
+               strncpy(pAddr->displayName, value, _len);
+               break;
+    default:
+               err = MSG_ERR_UNKNOWN;
+               break;
+    }
+
+       return err;
+}
+int msg_reject_message_set_str(void *msg_info, int field, char *value, int size)
+{
+       msg_error_t err =  MSG_SUCCESS;
+       if(!msg_info || !value)
+               return MSG_ERR_NULL_POINTER;
+    MSG_REJECT_MSG_INFO_S *pMsg = (MSG_REJECT_MSG_INFO_S *)msg_info;
+    int _len = 0;
+    (size > MAX_MSG_TEXT_LEN)? _len = MAX_MSG_TEXT_LEN : _len = size;
+    switch(field)
+    {
+    case MSG_REJECT_MESSAGE_MSGTEXT_STR:
+               strncpy(pMsg->msgText, value, _len);
+               break;
+    default:
+               err = MSG_ERR_UNKNOWN;
+               break;
+    }
+
+       return err;
+}
+
+int msg_mms_sendopt_set_bool(void *option, int field, bool value)
+{
+       msg_error_t err =  MSG_SUCCESS;
+       if(!option)
+               return MSG_ERR_NULL_POINTER;
+
+    MMS_SENDINGOPT_S *pOpt = (MMS_SENDINGOPT_S *)option;
+    switch(field)
+    {
+    case MSG_MMS_SENDOPTION_READ_REQUEST_BOOL:
+               pOpt->bReadReq = value;
+               break;
+    case MSG_MMS_SENDOPTION_DELIVERY_CUSTOMTIME_BOOL:
+               pOpt->bUseDeliveryCustomTime = value;
+               break;
+    default:
+               err = MSG_ERR_UNKNOWN;
+               break;
+    }
+       return err;
+}
+
+int msg_sms_sendopt_set_bool(void *option, int field, bool value)
+{
+       msg_error_t err =  MSG_SUCCESS;
+       if(!option)
+               return MSG_ERR_NULL_POINTER;
+
+    SMS_SENDINGOPT_S *pOpt = (SMS_SENDINGOPT_S *)option;
+    switch(field)
+    {
+    case MSG_SMS_SENDOPT_REPLYPATH_BOOL:
+               pOpt->bReplyPath = value;
+               break;
+    default:
+               err = MSG_ERR_UNKNOWN;
+               break;
+    }
+       return err;
+}
diff --git a/mapi/msg_svc.cpp b/mapi/msg_svc.cpp
new file mode 100755 (executable)
index 0000000..7a269e0
--- /dev/null
@@ -0,0 +1,1257 @@
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#include <string.h>
+
+#include "MsgTypes.h"
+#include "MsgHandle.h"
+#include "MsgException.h"
+
+#include "msg_private.h"
+#include "msg.h"
+
+#define MSG_TYPE_CHECK(a, b) \
+               ({\
+                       if(a != (b & 0xff00)) return MSG_ERR_INVALID_PARAMETER; \
+               })\
+
+
+
+EXPORT_API msg_struct_t msg_create_struct(int field)
+{
+       msg_struct_s *msg_struct = new msg_struct_s;
+       memset(msg_struct, 0x00, sizeof(msg_struct_s));
+
+       msg_struct->type = field;
+
+       switch(field)
+       {
+       case MSG_STRUCT_MESSAGE_INFO :
+               msg_message_create_struct(msg_struct);
+               break;
+       case MSG_STRUCT_FILTER:
+       {
+               msg_struct->data = (void *)new MSG_FILTER_S;
+               memset(msg_struct->data, 0x00, sizeof(MSG_FILTER_S));
+               break;
+       }
+       case MSG_STRUCT_THREAD_INFO:
+       {
+               msg_struct->data = (void *)new MSG_THREAD_VIEW_S;
+               memset(msg_struct->data, 0x00, sizeof(MSG_THREAD_VIEW_S));
+               break;
+       }
+       case MSG_STRUCT_SENDOPT:
+       {
+               MSG_SENDINGOPT_S *pOpt = (MSG_SENDINGOPT_S *)new MSG_SENDINGOPT_S;
+               memset(pOpt, 0x00, sizeof(MSG_SENDINGOPT_S));
+               msg_struct->data = pOpt;
+
+               msg_struct_s *pSms = new msg_struct_s;
+               msg_struct_s *pMms = new msg_struct_s;
+
+               pOpt->mmsSendOpt = (msg_struct_t)pMms;
+               pOpt->smsSendOpt = (msg_struct_t)pSms;
+
+               pMms->type = MSG_STRUCT_MMS_SENDOPT;
+               pMms->data = new MMS_SENDINGOPT_S;
+               memset(pMms->data, 0x00, sizeof(MMS_SENDINGOPT_S));
+
+               pSms->type = MSG_STRUCT_SMS_SENDOPT;
+               pSms->data = new SMS_SENDINGOPT_S;
+               memset(pSms->data, 0x00, sizeof(SMS_SENDINGOPT_S));
+               break;
+       }
+       case MSG_STRUCT_SYNCML_INFO:
+       {
+               MSG_SYNCML_MESSAGE_S *pSyncML= (MSG_SYNCML_MESSAGE_S *)new MSG_SYNCML_MESSAGE_S;
+               memset(pSyncML, 0x00, sizeof(MSG_SYNCML_MESSAGE_S));
+               msg_struct->data = pSyncML;
+
+               msg_struct_s *pStruct = new msg_struct_s;
+               pSyncML->msg = (msg_struct_t)pStruct;
+               pStruct->type = MSG_STRUCT_MESSAGE_INFO;
+               msg_message_create_struct(pStruct);
+
+               break;
+       }
+       case MSG_STRUCT_COUNT_INFO:
+       {
+               msg_struct->data = new MSG_COUNT_INFO_S;
+               memset(msg_struct->data, 0x00, sizeof(MSG_COUNT_INFO_S));
+               break;
+       }
+       case MSG_STRUCT_THREAD_COUNT_INFO:
+       {
+               msg_struct->data = new MSG_THREAD_COUNT_INFO_S;
+               memset(msg_struct->data, 0x00, sizeof(MSG_THREAD_COUNT_INFO_S));
+               break;
+       }
+       case MSG_STRUCT_THREAD_LIST_INDEX:
+       {
+               MSG_THREAD_LIST_INDEX_INFO_S * pThread = (MSG_THREAD_LIST_INDEX_INFO_S *)new MSG_THREAD_LIST_INDEX_INFO_S;
+               memset(pThread, 0x00, sizeof(MSG_THREAD_LIST_INDEX_INFO_S));
+
+               msg_struct->data = (void *)pThread;
+
+               msg_struct_s *pStruct = new msg_struct_s;
+               pThread->msgAddrInfo = (msg_struct_t)pStruct;
+
+               pStruct->type = MSG_STRUCT_ADDRESS_INFO;
+               pStruct->data = new MSG_ADDRESS_INFO_S;
+               memset(pStruct->data, 0x00, sizeof(MSG_ADDRESS_INFO_S));
+
+               break;
+       }
+       case MSG_STRUCT_SORT_RULE:
+       {
+               msg_struct->data = new MSG_SORT_RULE_S;
+               memset(msg_struct->data, 0x00, sizeof(MSG_SORT_RULE_S));
+               break;
+       }
+       case MSG_STRUCT_FOLDER_INFO:
+       {
+               msg_struct->data = new MSG_FOLDER_INFO_S;
+               memset(msg_struct->data, 0x00, sizeof(MSG_FOLDER_INFO_S));
+               break;
+       }
+       case MSG_STRUCT_SEARCH_CONDITION:
+       {
+               msg_struct->data = new MSG_SEARCH_CONDITION_S;
+               memset(msg_struct->data, 0x00, sizeof(MSG_SEARCH_CONDITION_S));
+               break;
+       }
+       case MSG_STRUCT_REPORT_STATUS_INFO:
+       {
+               msg_struct->data = new MSG_REPORT_STATUS_INFO_S;
+               memset(msg_struct->data, 0x00, sizeof(MSG_REPORT_STATUS_INFO_S));
+               break;
+       }
+       case MSG_STRUCT_SETTING_SMSC_OPT :
+       {
+        msg_struct->data = new MSG_SMSC_LIST_HIDDEN_S;
+        memset(msg_struct->data, 0x00, sizeof(MSG_SMSC_LIST_HIDDEN_S));
+
+        MSG_SMSC_LIST_HIDDEN_S *pTmp = (MSG_SMSC_LIST_HIDDEN_S *)msg_struct->data;
+
+        msg_struct_list_s *smsc_list = (msg_struct_list_s *)new msg_struct_list_s;
+        memset(smsc_list, 0x00, sizeof(msg_struct_list_s));
+
+        pTmp->smsc_list = smsc_list;
+
+        smsc_list->msg_struct_info = (msg_struct_t *)new char[sizeof(msg_struct_t)*SMSC_LIST_MAX];
+
+        msg_struct_s *pStructTmp = NULL;
+
+        for (int i = 0; i < SMSC_LIST_MAX; i++) {
+                pStructTmp = (msg_struct_s *)new msg_struct_s;
+                pStructTmp->type = MSG_STRUCT_SETTING_SMSC_INFO;
+                pStructTmp->data = new MSG_SMSC_DATA_S;
+                memset(pStructTmp->data, 0x00, sizeof(MSG_SMSC_DATA_S));
+                smsc_list->msg_struct_info[i] = (msg_struct_t)pStructTmp;
+        }
+               break;
+       }
+       case MSG_STRUCT_SETTING_SMSC_INFO :
+       {
+               msg_struct->data = new MSG_SMSC_DATA_S;
+               memset(msg_struct->data, 0x00, sizeof(MSG_SMSC_DATA_S));
+               break;
+       }
+       case MSG_STRUCT_SETTING_CB_OPT :
+       {
+        msg_struct->data = new MSG_CBMSG_OPT_HIDDEN_S;
+        memset(msg_struct->data, 0x00, sizeof(MSG_CBMSG_OPT_HIDDEN_S));
+
+        MSG_CBMSG_OPT_HIDDEN_S *pTmp = (MSG_CBMSG_OPT_HIDDEN_S *)msg_struct->data;
+
+        pTmp->channelData = (msg_struct_list_s *)new msg_struct_list_s;
+        memset(pTmp->channelData, 0x00, sizeof(msg_struct_list_s));
+
+        pTmp->channelData->msg_struct_info = (msg_struct_t *)new char[sizeof(msg_struct_t)*CB_CHANNEL_MAX];
+
+        msg_struct_s *pStructTmp = NULL;
+
+        for (int i = 0; i < CB_CHANNEL_MAX; i++) {
+                pStructTmp = (msg_struct_s *)new msg_struct_s;
+                pStructTmp->type = MSG_STRUCT_SETTING_CB_CHANNEL_INFO;
+                pStructTmp->data = new MSG_CB_CHANNEL_INFO_S;
+
+                memset(pStructTmp->data, 0x00, sizeof(MSG_CB_CHANNEL_INFO_S));
+                pTmp->channelData->msg_struct_info[i] = (msg_struct_t)pStructTmp;
+        }
+
+               break;
+       }
+       case MSG_STRUCT_SETTING_CB_CHANNEL_INFO :
+       {
+               msg_struct->data = new MSG_CB_CHANNEL_INFO_S;
+               memset(msg_struct->data, 0x00, sizeof(MSG_CB_CHANNEL_INFO_S));
+               break;
+       }
+       case MSG_STRUCT_SETTING_SMS_SEND_OPT :
+       {
+        msg_struct->data = new MSG_SMS_SENDOPT_S;
+        memset(msg_struct->data, 0x00, sizeof(MSG_SMS_SENDOPT_S));
+               break;
+       }
+       case MSG_STRUCT_SETTING_MMS_SEND_OPT :
+       {
+               msg_struct->data = new MSG_MMS_SENDOPT_S;
+               memset(msg_struct->data, 0x00, sizeof(MSG_MMS_SENDOPT_S));
+               break;
+       }
+       case MSG_STRUCT_SETTING_MMS_RECV_OPT :
+       {
+               msg_struct->data = new MSG_MMS_RECVOPT_S;
+               memset(msg_struct->data, 0x00, sizeof(MSG_MMS_RECVOPT_S));
+               break;
+       }
+       case MSG_STRUCT_SETTING_PUSH_MSG_OPT :
+       {
+               msg_struct->data = new MSG_PUSHMSG_OPT_S;
+               memset(msg_struct->data, 0x00, sizeof(MSG_PUSHMSG_OPT_S));
+               break;
+       }
+       case MSG_STRUCT_SETTING_VOICE_MSG_OPT :
+       {
+               msg_struct->data = new MSG_VOICEMAIL_OPT_S;
+               memset(msg_struct->data, 0x00, sizeof(MSG_VOICEMAIL_OPT_S));
+               break;
+       }
+       case MSG_STRUCT_SETTING_GENERAL_OPT :
+       {
+               msg_struct->data = new MSG_GENERAL_OPT_S;
+               memset(msg_struct->data, 0x00, sizeof(MSG_GENERAL_OPT_S));
+               break;
+       }
+       case MSG_STRUCT_SETTING_MSGSIZE_OPT :
+       {
+               msg_struct->data = new MSG_MSGSIZE_OPT_S;
+               memset(msg_struct->data, 0x00, sizeof(MSG_MSGSIZE_OPT_S));
+               break;
+       }
+       case MSG_STRUCT_SMS_SENDOPT:
+       {
+               msg_struct->data = new SMS_SENDINGOPT_S;
+               memset(msg_struct->data, 0x00, sizeof(SMS_SENDINGOPT_S));
+               break;
+       }
+       case MSG_STRUCT_MMS_SENDOPT:
+       {
+               msg_struct->data = new MMS_SENDINGOPT_S;
+               memset(msg_struct->data, 0x00, sizeof(MMS_SENDINGOPT_S));
+               break;
+       }
+       case MSG_STRUCT_REQUEST_INFO:
+       {
+               MSG_REQUEST_S *pRequest = (MSG_REQUEST_S *)new MSG_REQUEST_S;
+               memset(pRequest, 0x00, sizeof(MSG_REQUEST_S));
+               msg_struct->data = pRequest;
+
+               msg_struct_s *pMsg = (msg_struct_s *)new msg_struct_s;
+               msg_struct_s *pOpt = (msg_struct_s *)new msg_struct_s;
+
+               pRequest->msg = (msg_struct_t)pMsg;
+               pRequest->sendOpt = (msg_struct_t)pOpt;
+
+               pMsg->type = MSG_STRUCT_MESSAGE_INFO;
+               msg_message_create_struct(pMsg);
+
+               pOpt->type = MSG_STRUCT_SENDOPT;
+               pOpt->data = new MSG_SENDINGOPT_S;
+               memset(pOpt->data, 0x00, sizeof(MSG_SENDINGOPT_S));
+               msg_struct_s *pSms = new msg_struct_s;
+               msg_struct_s *pMms = new msg_struct_s;
+
+               MSG_SENDINGOPT_S *sendOpt = (MSG_SENDINGOPT_S *)pOpt->data;
+
+               sendOpt->mmsSendOpt = (msg_struct_t)pMms;
+               sendOpt->smsSendOpt = (msg_struct_t)pSms;
+
+               pMms->type = MSG_STRUCT_MMS_SENDOPT;
+               pMms->data = new MMS_SENDINGOPT_S;
+               memset(pMms->data, 0x00, sizeof(MMS_SENDINGOPT_S));
+
+               pSms->type = MSG_STRUCT_SMS_SENDOPT;
+               pSms->data = new SMS_SENDINGOPT_S;
+               memset(pSms->data, 0x00, sizeof(SMS_SENDINGOPT_S));
+               break;
+       }
+       case MSG_STRUCT_MMS:
+       case MSG_STRUCT_MMS_PAGE:
+       case MSG_STRUCT_MMS_MEDIA:
+       case MSG_STRUCT_MMS_ATTACH:
+       case MSG_STRUCT_MMS_REGION:
+       case MSG_STRUCT_MMS_TRANSITION:
+       case MSG_STRUCT_MMS_META:
+       case MSG_STRUCT_MMS_SMIL_TEXT:
+       case MSG_STRUCT_MMS_SMIL_AVI:
+               msg_struct->data = msg_mms_create_struct_data(field);
+               break;
+       }
+
+       return (msg_struct_t) msg_struct;
+}
+
+
+EXPORT_API int msg_release_struct(msg_struct_t *msg_struct_handle)
+{
+       msg_error_t err = MSG_SUCCESS;
+
+       if (msg_struct_handle == NULL || *msg_struct_handle == NULL)
+               return MSG_ERR_NULL_POINTER;
+
+       msg_struct_s *msg_struct = (msg_struct_s *)*msg_struct_handle;
+
+       switch(msg_struct->type)
+       {
+       case MSG_STRUCT_MESSAGE_INFO :
+       {
+               msg_message_release(&msg_struct);
+
+               *msg_struct_handle = NULL;
+               break;
+       }
+       case MSG_STRUCT_FILTER:
+       {
+               delete (MSG_FILTER_S*)(msg_struct->data);
+               msg_struct->data = NULL;
+
+               delete msg_struct;
+               *msg_struct_handle = NULL;
+               break;
+       }
+       case MSG_STRUCT_THREAD_INFO:
+       {
+               delete (MSG_THREAD_VIEW_S*)(msg_struct->data);
+               msg_struct->data = NULL;
+
+               delete msg_struct;
+               *msg_struct_handle = NULL;
+               break;
+       }
+       case MSG_STRUCT_SENDOPT:
+       {
+               MSG_SENDINGOPT_S *pOpt = (MSG_SENDINGOPT_S*)(msg_struct->data);
+               delete (MMS_SENDINGOPT_S *)(((msg_struct_s *)pOpt->mmsSendOpt)->data);
+               ((msg_struct_s *)pOpt->mmsSendOpt)->data = NULL;
+               delete (msg_struct_s *)pOpt->mmsSendOpt;
+               pOpt->mmsSendOpt = NULL;
+
+               delete (SMS_SENDINGOPT_S *)(((msg_struct_s *)pOpt->smsSendOpt)->data);
+               ((msg_struct_s *)pOpt->smsSendOpt)->data = NULL;
+               delete (msg_struct_s *)pOpt->smsSendOpt;
+               pOpt->smsSendOpt = NULL;
+
+               delete pOpt;
+               msg_struct->data = NULL;
+
+               delete msg_struct;
+               *msg_struct_handle = NULL;
+
+               break;
+       }
+       case MSG_STRUCT_SYNCML_INFO:
+       {
+               MSG_SYNCML_MESSAGE_S *pSyncML = (MSG_SYNCML_MESSAGE_S*)(msg_struct->data);
+               msg_struct_s *msg = (msg_struct_s *)pSyncML->msg;
+               msg_message_release(&msg);
+
+               delete pSyncML;
+               msg_struct->data = NULL;
+
+               delete msg_struct;
+               *msg_struct_handle = NULL;
+               break;
+       }
+       case MSG_STRUCT_COUNT_INFO:
+       {
+               delete (MSG_COUNT_INFO_S*)(msg_struct->data);
+               msg_struct->data = NULL;
+
+               delete msg_struct;
+               *msg_struct_handle = NULL;
+               break;
+       }
+       case MSG_STRUCT_THREAD_COUNT_INFO:
+       {
+               delete (MSG_THREAD_COUNT_INFO_S*)(msg_struct->data);
+               msg_struct->data = NULL;
+
+               delete msg_struct;
+               *msg_struct_handle = NULL;
+
+               break;
+       }
+       case MSG_STRUCT_THREAD_LIST_INDEX:
+       {
+               MSG_THREAD_LIST_INDEX_INFO_S *pThread = (MSG_THREAD_LIST_INDEX_INFO_S*)(msg_struct->data);
+               delete (MSG_ADDRESS_INFO_S *)(((msg_struct_s *)pThread->msgAddrInfo)->data);
+               ((msg_struct_s *)pThread->msgAddrInfo)->data = NULL;
+               delete (msg_struct_s *)pThread->msgAddrInfo;
+               pThread->msgAddrInfo = NULL;
+               delete pThread;
+               msg_struct->data = NULL;
+
+               delete msg_struct;
+               *msg_struct_handle = NULL;
+
+               break;
+       }
+       case MSG_STRUCT_SORT_RULE:
+       {
+               delete (MSG_SORT_RULE_S*)(msg_struct->data);
+               msg_struct->data = NULL;
+
+               delete msg_struct;
+               *msg_struct_handle = NULL;
+
+               break;
+       }
+       case MSG_STRUCT_FOLDER_INFO:
+       {
+               delete (MSG_FOLDER_INFO_S*)(msg_struct->data);
+               msg_struct->data = NULL;
+
+               delete msg_struct;
+               *msg_struct_handle = NULL;
+
+               break;
+       }
+       case MSG_STRUCT_SEARCH_CONDITION:
+       {
+               delete (MSG_SEARCH_CONDITION_S*)(msg_struct->data);
+               msg_struct->data = NULL;
+
+               delete msg_struct;
+               *msg_struct_handle = NULL;
+
+               break;
+       }
+       case MSG_STRUCT_REPORT_STATUS_INFO:
+       {
+               delete (MSG_REPORT_STATUS_INFO_S*)(msg_struct->data);
+               msg_struct->data = NULL;
+
+               delete msg_struct;
+               *msg_struct_handle = NULL;
+
+               break;
+       }
+       case MSG_STRUCT_SMS_SENDOPT:
+       {
+               delete (SMS_SENDINGOPT_S*)(msg_struct->data);
+               msg_struct->data = NULL;
+
+               delete msg_struct;
+               *msg_struct_handle = NULL;
+
+               break;
+       }
+       case MSG_STRUCT_MMS_SENDOPT:
+       {
+               delete (MMS_SENDINGOPT_S*)(msg_struct->data);
+               msg_struct->data = NULL;
+
+               delete msg_struct;
+               *msg_struct_handle = NULL;
+
+               break;
+       }
+       case MSG_STRUCT_REQUEST_INFO:
+       {
+               MSG_REQUEST_S *pRequest = (MSG_REQUEST_S*)(msg_struct->data);
+
+               MSG_SENDINGOPT_S *pSendingOpt = (MSG_SENDINGOPT_S *)(((msg_struct_s *)pRequest->sendOpt)->data);
+
+               msg_struct_s *pMmsOpt = (msg_struct_s *)pSendingOpt->mmsSendOpt;
+               msg_struct_s *pSmsOpt = (msg_struct_s *)pSendingOpt->smsSendOpt;
+
+               delete (MMS_SENDINGOPT_S *)(pMmsOpt->data);
+               pMmsOpt->data = NULL;
+               delete (msg_struct_s *)pSendingOpt->mmsSendOpt;
+               pSendingOpt->mmsSendOpt = NULL;
+               delete (MMS_SENDINGOPT_S *)(pSmsOpt->data);
+               pSmsOpt->data = NULL;
+               delete (msg_struct_s *)pSendingOpt->smsSendOpt;
+               pSendingOpt->smsSendOpt = NULL;
+
+               delete (MSG_SENDINGOPT_S *)pSendingOpt;
+               ((msg_struct_s *)pRequest->sendOpt)->data = NULL;
+               delete (msg_struct_s *)pRequest->sendOpt;
+               pRequest->sendOpt = NULL;
+
+               msg_struct_s *msg = (msg_struct_s *)pRequest->msg;
+               msg_message_release(&msg);
+
+               delete pRequest;
+               msg_struct->data = NULL;
+
+               delete msg_struct;
+               *msg_struct_handle = NULL;
+               break;
+       }
+       case MSG_STRUCT_MMS:
+       case MSG_STRUCT_MMS_PAGE:
+       case MSG_STRUCT_MMS_MEDIA:
+       case MSG_STRUCT_MMS_ATTACH:
+       case MSG_STRUCT_MMS_REGION:
+       case MSG_STRUCT_MMS_TRANSITION:
+       case MSG_STRUCT_MMS_META:
+       case MSG_STRUCT_MMS_SMIL_TEXT:
+       case MSG_STRUCT_MMS_SMIL_AVI:
+       {
+               msg_mms_release_struct(&msg_struct);
+               *msg_struct_handle = NULL;
+               break;
+       }
+       case MSG_STRUCT_SETTING_SMSC_OPT :
+       {
+               msg_struct_list_s *smsc_list = NULL;
+               msg_struct_s *smsc_info = NULL;
+               MSG_SMSC_LIST_HIDDEN_S *pTmp = NULL;
+
+               pTmp = (MSG_SMSC_LIST_HIDDEN_S *)msg_struct->data;
+               smsc_list = (msg_struct_list_s *)pTmp->smsc_list;
+
+               for (int i = 0; i < SMSC_LIST_MAX; i++) {
+                       smsc_info = (msg_struct_s *)smsc_list->msg_struct_info[i];
+                       delete [] (MSG_SMSC_DATA_S*)(smsc_info->data);
+                       delete [] smsc_info;
+               }
+
+               delete [] smsc_list->msg_struct_info;
+
+               delete [] (MSG_SMSC_LIST_HIDDEN_S*)pTmp;
+               msg_struct->data = NULL;
+
+               delete msg_struct;
+               *msg_struct_handle = NULL;
+               break;
+       }
+       case MSG_STRUCT_SETTING_CB_CHANNEL_INFO :
+       {
+               delete (MSG_CB_CHANNEL_INFO_S*)(msg_struct->data);
+               msg_struct->data = NULL;
+
+               delete msg_struct;
+               *msg_struct_handle = NULL;
+               break;
+       }
+       case MSG_STRUCT_SETTING_CB_OPT :
+       {
+               msg_struct_list_s *cb_list = NULL;
+               msg_struct_s *cb_info = NULL;
+               MSG_CBMSG_OPT_HIDDEN_S *pTmp = NULL;
+
+               pTmp = (MSG_CBMSG_OPT_HIDDEN_S *)msg_struct->data;
+               cb_list = (msg_struct_list_s *)pTmp->channelData;
+
+               for (int i = 0; i < CB_CHANNEL_MAX; i++) {
+                       cb_info = (msg_struct_s *)cb_list->msg_struct_info[i];
+                       delete [] (MSG_CB_CHANNEL_INFO_S*)(cb_info->data);
+                       delete [] cb_info;
+               }
+
+               delete [] cb_list->msg_struct_info;
+
+               delete [] (MSG_CBMSG_OPT_HIDDEN_S*)pTmp;
+               msg_struct->data = NULL;
+
+               delete msg_struct;
+               *msg_struct_handle = NULL;
+               break;
+       }
+       case MSG_STRUCT_SETTING_SMS_SEND_OPT :
+       {
+               delete (MSG_SMS_SENDOPT_S*)(msg_struct->data);
+               msg_struct->data = NULL;
+
+               delete msg_struct;
+               *msg_struct_handle = NULL;
+               break;
+       }
+       case MSG_STRUCT_SETTING_MMS_SEND_OPT :
+       {
+               delete (MSG_MMS_SENDOPT_S*)(msg_struct->data);
+               msg_struct->data = NULL;
+
+               delete msg_struct;
+               *msg_struct_handle = NULL;
+               break;
+       }
+       case MSG_STRUCT_SETTING_MMS_RECV_OPT :
+       {
+               delete (MSG_MMS_RECVOPT_S*)(msg_struct->data);
+               msg_struct->data = NULL;
+
+               delete msg_struct;
+               *msg_struct_handle = NULL;
+               break;
+       }
+       case MSG_STRUCT_SETTING_PUSH_MSG_OPT :
+       {
+               delete (MSG_PUSHMSG_OPT_S*)(msg_struct->data);
+               msg_struct->data = NULL;
+
+               delete msg_struct;
+               *msg_struct_handle = NULL;
+               break;
+       }
+       case MSG_STRUCT_SETTING_VOICE_MSG_OPT :
+       {
+               delete (MSG_VOICEMAIL_OPT_S*)(msg_struct->data);
+               msg_struct->data = NULL;
+
+               delete msg_struct;
+               *msg_struct_handle = NULL;
+               break;
+       }
+       case MSG_STRUCT_SETTING_GENERAL_OPT :
+       {
+               delete (MSG_GENERAL_OPT_S*)(msg_struct->data);
+               msg_struct->data = NULL;
+
+               delete msg_struct;
+               *msg_struct_handle = NULL;
+               break;
+       }
+       case MSG_STRUCT_SETTING_MSGSIZE_OPT :
+       {
+               delete (MSG_MSGSIZE_OPT_S*)(msg_struct->data);
+               msg_struct->data = NULL;
+
+               delete msg_struct;
+               *msg_struct_handle = NULL;
+               break;
+       }
+       default :
+               err = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+
+       return err;
+}
+
+int msg_release_list_struct(msg_struct_list_s *msg_struct_list)
+{
+       msg_error_t err = MSG_SUCCESS;
+
+       if (msg_struct_list == NULL)
+               return MSG_ERR_NULL_POINTER;
+
+       if (msg_struct_list->msg_struct_info == NULL) {
+               if (msg_struct_list->nCount > 0)
+                       msg_struct_list->nCount = 0;
+               return err;
+       }
+
+       if(msg_struct_list->nCount > 0) {
+               for(int i = 0; i < msg_struct_list->nCount; i++) {
+                       msg_release_struct(&(msg_struct_list->msg_struct_info[i]));
+               }
+       }
+
+       //free peer info list
+       delete [] msg_struct_list->msg_struct_info;
+       msg_struct_list->msg_struct_info = NULL;
+
+       return err;
+}
+
+EXPORT_API int msg_get_int_value(msg_struct_t msg_struct_handle, int field, int *value)
+{
+
+       msg_error_t err = MSG_SUCCESS;
+
+       if (msg_struct_handle == NULL)
+               return MSG_ERR_NULL_POINTER;
+
+       msg_struct_s *msg_struct = (msg_struct_s *) msg_struct_handle;
+       MSG_TYPE_CHECK(msg_struct->type, field);
+
+       if (msg_struct->data == NULL)
+               return MSG_ERR_NULL_POINTER;
+
+       switch (msg_struct->type)
+       {
+       case MSG_STRUCT_MESSAGE_INFO :
+               err = msg_message_get_int_value(msg_struct->data, field, value);
+               break;
+       case MSG_STRUCT_FILTER:
+               *value = msg_get_filter_info_int(msg_struct->data, field);
+               break;
+       case MSG_STRUCT_SYNCML_INFO :
+               *value = msg_syncml_info_get_int(msg_struct->data, field);
+               break;
+       case MSG_STRUCT_COUNT_INFO :
+               *value = msg_count_info_get_int(msg_struct->data, field);
+               break;
+       case MSG_STRUCT_THREAD_COUNT_INFO :
+               *value = msg_thread_count_get_int(msg_struct->data, field);
+               break;
+       case MSG_STRUCT_THREAD_LIST_INDEX :
+               *value = msg_thread_index_get_int(msg_struct->data, field);
+               break;
+       case MSG_STRUCT_SORT_RULE :
+               *value = msg_sortrule_get_int(msg_struct->data, field);
+               break;
+       case MSG_STRUCT_FOLDER_INFO :
+               *value = msg_folder_info_get_int(msg_struct->data, field);
+               break;
+       case MSG_STRUCT_THREAD_INFO :
+               *value = msg_thread_info_get_int(msg_struct->data, field);
+               break;
+       case MSG_STRUCT_SEARCH_CONDITION :
+               *value = msg_search_condition_get_int(msg_struct->data, field);
+               break;
+       case MSG_STRUCT_REPORT_STATUS_INFO :
+               *value = msg_report_status_get_int(msg_struct->data, field);
+               break;
+       case MSG_STRUCT_ADDRESS_INFO :
+               *value = msg_address_info_get_int(msg_struct->data, field);
+               break;
+       case MSG_STRUCT_MMS_SENDOPT :
+               *value = msg_mms_sendopt_get_int(msg_struct->data, field);
+               break;
+       case MSG_STRUCT_REJECT_MSG_INFO :
+               *value = msg_reject_message_get_int(msg_struct->data, field);
+               break;
+       case MSG_STRUCT_REQUEST_INFO :
+               *value = msg_request_get_int(msg_struct->data, field);
+               break;
+       case MSG_STRUCT_SENT_STATUS_INFO :
+               *value = msg_sent_status_get_int((MSG_SENT_STATUS_S *)msg_struct->data, field);
+               break;
+       case MSG_STRUCT_MMS:
+       case MSG_STRUCT_MMS_PAGE:
+       case MSG_STRUCT_MMS_MEDIA:
+       case MSG_STRUCT_MMS_ATTACH:
+       case MSG_STRUCT_MMS_REGION:
+       case MSG_STRUCT_MMS_TRANSITION:
+       case MSG_STRUCT_MMS_META:
+       case MSG_STRUCT_MMS_SMIL_TEXT:
+       case MSG_STRUCT_MMS_SMIL_AVI:
+               err = msg_mms_get_int_value(msg_struct, field, value);
+               break;
+       case MSG_STRUCT_SETTING_SMSC_OPT :
+       case MSG_STRUCT_SETTING_SMSC_INFO :
+       case MSG_STRUCT_SETTING_CB_OPT :
+       case MSG_STRUCT_SETTING_CB_CHANNEL_INFO :
+       case MSG_STRUCT_SETTING_SMS_SEND_OPT :
+       case MSG_STRUCT_SETTING_MMS_SEND_OPT :
+       case MSG_STRUCT_SETTING_MMS_RECV_OPT :
+       case MSG_STRUCT_SETTING_PUSH_MSG_OPT :
+       case MSG_STRUCT_SETTING_GENERAL_OPT :
+       case MSG_STRUCT_SETTING_MSGSIZE_OPT :
+               err = msg_setting_get_int_value(msg_struct, field, value);
+               break;
+       default :
+               err = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+
+       return err;
+}
+
+EXPORT_API int msg_get_str_value(msg_struct_t msg_struct_handle, int field, char *src, int size)
+{
+       msg_error_t err = MSG_SUCCESS;
+
+       if (msg_struct_handle == NULL)
+               return MSG_ERR_NULL_POINTER;
+
+       msg_struct_s *msg_struct = (msg_struct_s *) msg_struct_handle;
+
+       if (msg_struct->data == NULL)
+               return MSG_ERR_NULL_POINTER;
+
+       char *ret_str = NULL;
+
+       switch (msg_struct->type)
+       {
+       case MSG_STRUCT_MESSAGE_INFO :
+               err = msg_message_get_str_value(msg_struct->data, field, src, size);
+               break;
+       case MSG_STRUCT_FILTER:
+               ret_str = msg_get_filter_info_str(msg_struct->data, field);
+                       if (ret_str == NULL)
+                               err = MSG_ERR_UNKNOWN;
+                       else
+                               strncpy(src, ret_str, size);
+               break;
+       case MSG_STRUCT_FOLDER_INFO :
+               ret_str = msg_folder_info_get_str(msg_struct->data, field);
+               if (ret_str == NULL)
+                       err = MSG_ERR_UNKNOWN;
+               else
+                       strncpy(src, ret_str, size);
+               break;
+       case MSG_STRUCT_THREAD_INFO :
+               ret_str = msg_thread_info_get_str(msg_struct->data, field);
+               if (ret_str == NULL)
+                       err = MSG_ERR_UNKNOWN;
+               else
+                       strncpy(src, ret_str, size);
+               break;
+       case MSG_STRUCT_SEARCH_CONDITION :
+               ret_str = msg_search_condition_get_str(msg_struct->data, field, size);
+               if (ret_str == NULL)
+                       err = MSG_ERR_UNKNOWN;
+               else
+                       strncpy(src, ret_str, size);
+               break;
+
+       case MSG_STRUCT_ADDRESS_INFO :
+               ret_str = msg_address_info_get_str(msg_struct->data, field, size);
+               if (ret_str == NULL)
+                       err = MSG_ERR_UNKNOWN;
+               else
+                       strncpy(src, ret_str, size);
+               break;
+
+       case MSG_STRUCT_REJECT_MSG_INFO :
+               ret_str = msg_reject_message_get_str(msg_struct->data, field, size);
+               if (ret_str == NULL)
+                       err = MSG_ERR_UNKNOWN;
+               else
+                       strncpy(src, ret_str, size);
+               break;
+       case MSG_STRUCT_MMS:
+       case MSG_STRUCT_MMS_PAGE:
+       case MSG_STRUCT_MMS_MEDIA:
+       case MSG_STRUCT_MMS_ATTACH:
+       case MSG_STRUCT_MMS_REGION:
+       case MSG_STRUCT_MMS_TRANSITION:
+       case MSG_STRUCT_MMS_META:
+       case MSG_STRUCT_MMS_SMIL_TEXT:
+       case MSG_STRUCT_MMS_SMIL_AVI:
+               err = msg_mms_get_str_value(msg_struct, field, src, size);
+               break;
+       case MSG_STRUCT_SETTING_SMSC_INFO :
+       case MSG_STRUCT_SETTING_CB_CHANNEL_INFO :
+       case MSG_STRUCT_SETTING_VOICE_MSG_OPT :
+               err = msg_setting_get_str_value(msg_struct, field, src, size);
+               break;
+       default :
+               err = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+
+       return err;
+}
+
+EXPORT_API int msg_get_bool_value(msg_struct_t msg_struct_handle, int field, bool *value)
+{
+       msg_error_t err = MSG_SUCCESS;
+
+       if (msg_struct_handle == NULL)
+               return MSG_ERR_NULL_POINTER;
+
+       msg_struct_s *msg_struct = (msg_struct_s *) msg_struct_handle;
+
+       if (msg_struct->data == NULL)
+               return MSG_ERR_NULL_POINTER;
+
+       switch (msg_struct->type)
+       {
+       case MSG_STRUCT_MESSAGE_INFO :
+               err = msg_message_get_bool_value(msg_struct->data, field, value);
+               break;
+       case MSG_STRUCT_SENDOPT:
+               *value = msg_sendopt_get_bool(msg_struct->data, field);
+               break;
+       case MSG_STRUCT_SORT_RULE:
+               *value = msg_sortrule_get_bool(msg_struct->data, field);
+               break;
+       case MSG_STRUCT_MMS_SENDOPT:
+               *value = msg_mms_sendopt_get_bool(msg_struct->data, field);
+               break;
+       case MSG_STRUCT_SMS_SENDOPT:
+               *value = msg_sms_sendopt_get_bool(msg_struct->data, field);
+               break;
+       case MSG_STRUCT_MMS:
+       case MSG_STRUCT_MMS_PAGE:
+       case MSG_STRUCT_MMS_MEDIA:
+       case MSG_STRUCT_MMS_ATTACH:
+       case MSG_STRUCT_MMS_REGION:
+       case MSG_STRUCT_MMS_TRANSITION:
+       case MSG_STRUCT_MMS_META:
+       case MSG_STRUCT_MMS_SMIL_TEXT:
+       case MSG_STRUCT_MMS_SMIL_AVI:
+               err = msg_mms_get_bool_value(msg_struct, field, value);
+               break;
+       case MSG_STRUCT_SETTING_CB_OPT :
+       case MSG_STRUCT_SETTING_CB_CHANNEL_INFO :
+       case MSG_STRUCT_SETTING_SMS_SEND_OPT :
+       case MSG_STRUCT_SETTING_MMS_SEND_OPT :
+       case MSG_STRUCT_SETTING_MMS_RECV_OPT :
+       case MSG_STRUCT_SETTING_PUSH_MSG_OPT :
+       case MSG_STRUCT_SETTING_GENERAL_OPT :
+               err = msg_setting_get_bool_value(msg_struct, field, value);
+               break;
+       default :
+               err = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+
+       return err;
+}
+
+EXPORT_API int msg_get_struct_handle(msg_struct_t msg_struct_handle, int field, msg_struct_t *value)
+{
+       msg_error_t err = MSG_SUCCESS;
+
+       if (msg_struct_handle == NULL)
+               return MSG_ERR_NULL_POINTER;
+
+       msg_struct_s *msg_struct = (msg_struct_s *) msg_struct_handle;
+
+       if (msg_struct->data == NULL)
+               return MSG_ERR_NULL_POINTER;
+
+       switch (msg_struct->type)
+       {
+       case MSG_STRUCT_MESSAGE_INFO :
+               err = msg_message_get_struct_hnd(msg_struct->data, field, (void **)value);
+               break;
+       case MSG_STRUCT_SENDOPT:
+               err = msg_sendopt_get_struct_handle(msg_struct, field, (void **)value);
+               break;
+       case MSG_STRUCT_SYNCML_INFO:
+               err = msg_syncml_get_struct_handle(msg_struct, field, (void **)value);
+               break;
+       case MSG_STRUCT_THREAD_LIST_INDEX:
+               err = msg_thread_index_get_struct_handle(msg_struct, field, (void **)value);
+               break;
+       case MSG_STRUCT_MMS_MEDIA:
+               err = msg_mms_get_struct_handle(msg_struct, field, (msg_struct_s**)value);
+               break;
+       case MSG_STRUCT_REQUEST_INFO:
+               err = msg_request_get_struct_handle(msg_struct, field, (void **)value);
+               break;
+       default :
+               err = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+
+       return err;
+}
+
+EXPORT_API int msg_get_list_handle(msg_struct_t msg_struct_handle, int field, void **value)
+{
+       msg_error_t err = MSG_SUCCESS;
+
+       if (msg_struct_handle == NULL)
+               return MSG_ERR_NULL_POINTER;
+
+       msg_struct_s *msg_struct = (msg_struct_s *) msg_struct_handle;
+
+       if (msg_struct->data == NULL)
+               return MSG_ERR_NULL_POINTER;
+
+       switch (msg_struct->type)
+       {
+       case MSG_STRUCT_MESSAGE_INFO :
+               err = msg_message_get_list_hnd(msg_struct->data, field, value);
+               break;
+       case MSG_STRUCT_MMS:
+       case MSG_STRUCT_MMS_PAGE:
+               err = msg_mms_get_list_handle(msg_struct, field, (msg_list_handle_t *)value);
+               break;
+       case MSG_STRUCT_SETTING_CB_OPT :
+       case MSG_STRUCT_SETTING_SMSC_OPT :
+               err = msg_setting_get_list_handle(msg_struct, field, value);
+               break;
+       default :
+               err = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+
+       return err;
+}
+
+EXPORT_API int msg_set_int_value(msg_struct_t msg_struct_handle, int field, int value)
+{
+       msg_error_t err = MSG_SUCCESS;
+
+       if (msg_struct_handle == NULL)
+               return MSG_ERR_NULL_POINTER;
+
+       msg_struct_s *msg_struct = (msg_struct_s *) msg_struct_handle;
+
+       if (msg_struct->data == NULL)
+               return MSG_ERR_NULL_POINTER;
+
+       switch (msg_struct->type)
+       {
+       case MSG_STRUCT_MESSAGE_INFO :
+               err = msg_message_set_int_value(msg_struct->data, field, value);
+               break;
+       case MSG_STRUCT_FILTER :
+               err = msg_set_filter_info_int(msg_struct->data, field, value);
+               break;
+       case MSG_STRUCT_SYNCML_INFO :
+               err = msg_syncml_info_set_int(msg_struct->data, field, value);
+               break;
+       case MSG_STRUCT_COUNT_INFO :
+               err = msg_count_info_set_int(msg_struct->data, field, value);
+               break;
+       case MSG_STRUCT_THREAD_COUNT_INFO :
+               err = msg_thread_count_set_int(msg_struct->data, field, value);
+               break;
+       case MSG_STRUCT_THREAD_LIST_INDEX :
+               err = msg_thread_index_set_int(msg_struct->data, field, value);
+               break;
+       case MSG_STRUCT_SORT_RULE :
+               err = msg_sortrule_set_int(msg_struct->data, field, value);
+               break;
+       case MSG_STRUCT_FOLDER_INFO :
+               err = msg_folder_info_set_int(msg_struct->data, field, value);
+               break;
+       case MSG_STRUCT_SEARCH_CONDITION :
+               err = msg_search_condition_set_int(msg_struct->data, field, value);
+               break;
+       case MSG_STRUCT_REPORT_STATUS_INFO :
+               err = msg_report_status_set_int(msg_struct->data, field, value);
+               break;
+       case MSG_STRUCT_ADDRESS_INFO :
+               err = msg_address_info_set_int(msg_struct->data, field, value);
+               break;
+       case MSG_STRUCT_MMS_SENDOPT :
+               err = msg_mms_sendopt_set_int(msg_struct->data, field, value);
+               break;
+       case MSG_STRUCT_REJECT_MSG_INFO :
+               err = msg_reject_message_set_int(msg_struct->data, field, value);
+               break;
+       case MSG_STRUCT_REQUEST_INFO :
+               err = msg_request_set_int(msg_struct->data, field, value);
+               break;
+       case MSG_STRUCT_MMS:
+       case MSG_STRUCT_MMS_PAGE:
+       case MSG_STRUCT_MMS_MEDIA:
+       case MSG_STRUCT_MMS_ATTACH:
+       case MSG_STRUCT_MMS_REGION:
+       case MSG_STRUCT_MMS_TRANSITION:
+       case MSG_STRUCT_MMS_META:
+       case MSG_STRUCT_MMS_SMIL_TEXT:
+       case MSG_STRUCT_MMS_SMIL_AVI:
+               err = msg_mms_set_int_value(msg_struct, field, value);
+               break;
+       case MSG_STRUCT_SETTING_SMSC_OPT :
+       case MSG_STRUCT_SETTING_SMSC_INFO :
+       case MSG_STRUCT_SETTING_CB_OPT :
+       case MSG_STRUCT_SETTING_CB_CHANNEL_INFO :
+       case MSG_STRUCT_SETTING_SMS_SEND_OPT :
+       case MSG_STRUCT_SETTING_MMS_SEND_OPT :
+       case MSG_STRUCT_SETTING_MMS_RECV_OPT :
+       case MSG_STRUCT_SETTING_PUSH_MSG_OPT :
+       case MSG_STRUCT_SETTING_GENERAL_OPT :
+       case MSG_STRUCT_SETTING_MSGSIZE_OPT :
+               err = msg_setting_set_int_value(msg_struct, field, value);
+               break;
+       default :
+               err = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+
+       return err;
+}
+
+EXPORT_API int msg_set_str_value(msg_struct_t msg_struct_handle, int field, char *value, int size)
+{
+       msg_error_t err = MSG_SUCCESS;
+
+       if (msg_struct_handle == NULL)
+               return MSG_ERR_NULL_POINTER;
+
+       msg_struct_s *msg_struct = (msg_struct_s *) msg_struct_handle;
+
+       if (msg_struct->data == NULL)
+               return MSG_ERR_NULL_POINTER;
+
+       switch (msg_struct->type)
+       {
+       case MSG_STRUCT_MESSAGE_INFO :
+               err = msg_message_set_str_value(msg_struct->data, field, value, size);
+               break;
+       case MSG_STRUCT_FILTER :
+               err = msg_set_filter_info_str(msg_struct->data, field, value, size);
+               break;
+       case MSG_STRUCT_FOLDER_INFO :
+               err = msg_folder_info_set_str(msg_struct->data, field, value, size);
+               break;
+       case MSG_STRUCT_SEARCH_CONDITION :
+               err = msg_search_condition_set_str(msg_struct->data, field, value, size);
+               break;
+       case MSG_STRUCT_ADDRESS_INFO :
+               err = msg_address_info_set_str(msg_struct->data, field, value, size);
+               break;
+       case MSG_STRUCT_REJECT_MSG_INFO :
+               err = msg_reject_message_set_str(msg_struct->data, field, value, size);
+               break;
+       case MSG_STRUCT_MMS:
+       case MSG_STRUCT_MMS_PAGE:
+       case MSG_STRUCT_MMS_MEDIA:
+       case MSG_STRUCT_MMS_ATTACH:
+       case MSG_STRUCT_MMS_REGION:
+       case MSG_STRUCT_MMS_TRANSITION:
+       case MSG_STRUCT_MMS_META:
+       case MSG_STRUCT_MMS_SMIL_TEXT:
+       case MSG_STRUCT_MMS_SMIL_AVI:
+               err = msg_mms_set_str_value(msg_struct, field, value, size);
+               break;
+       case MSG_STRUCT_SETTING_SMSC_INFO :
+       case MSG_STRUCT_SETTING_CB_CHANNEL_INFO :
+       case MSG_STRUCT_SETTING_VOICE_MSG_OPT :
+               err = msg_setting_set_str_value(msg_struct, field, value, size);
+               break;
+       default :
+               err = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+
+       return err;
+}
+
+EXPORT_API int msg_set_bool_value(msg_struct_t msg_struct_handle, int field, bool value)
+{
+       msg_error_t err = MSG_SUCCESS;
+
+       if (msg_struct_handle == NULL)
+               return MSG_ERR_NULL_POINTER;
+
+       msg_struct_s *msg_struct = (msg_struct_s *) msg_struct_handle;
+
+       if (msg_struct->data == NULL)
+               return MSG_ERR_NULL_POINTER;
+
+       switch (msg_struct->type)
+       {
+       case MSG_STRUCT_MESSAGE_INFO :
+               err = msg_message_set_bool_value(msg_struct->data, field, value);
+               break;
+       case MSG_STRUCT_SENDOPT:
+               err = msg_sendopt_set_bool(msg_struct->data, field, value);
+               break;
+       case MSG_STRUCT_SORT_RULE:
+               err = msg_sortrule_set_bool(msg_struct->data, field, value);
+               break;
+       case MSG_STRUCT_MMS_SENDOPT:
+               err = msg_mms_sendopt_set_bool(msg_struct->data, field, value);
+               break;
+       case MSG_STRUCT_SMS_SENDOPT:
+               err = msg_sms_sendopt_set_bool(msg_struct->data, field, value);
+               break;
+       case MSG_STRUCT_MMS:
+       case MSG_STRUCT_MMS_PAGE:
+       case MSG_STRUCT_MMS_MEDIA:
+       case MSG_STRUCT_MMS_ATTACH:
+       case MSG_STRUCT_MMS_REGION:
+       case MSG_STRUCT_MMS_TRANSITION:
+       case MSG_STRUCT_MMS_META:
+       case MSG_STRUCT_MMS_SMIL_TEXT:
+       case MSG_STRUCT_MMS_SMIL_AVI:
+               err = msg_mms_set_bool_value(msg_struct, field, value);
+               break;
+       case MSG_STRUCT_SETTING_CB_OPT :
+       case MSG_STRUCT_SETTING_CB_CHANNEL_INFO :
+       case MSG_STRUCT_SETTING_SMS_SEND_OPT :
+       case MSG_STRUCT_SETTING_MMS_SEND_OPT :
+       case MSG_STRUCT_SETTING_MMS_RECV_OPT :
+       case MSG_STRUCT_SETTING_PUSH_MSG_OPT :
+       case MSG_STRUCT_SETTING_GENERAL_OPT :
+               err = msg_setting_set_bool_value(msg_struct, field, value);
+               break;
+       default :
+               err = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+
+       return err;
+}
+
+EXPORT_API int msg_set_struct_handle(msg_struct_t msg_struct_handle, int field, msg_struct_t value)
+{
+       msg_error_t err = MSG_SUCCESS;
+
+       if (msg_struct_handle == NULL)
+               return MSG_ERR_NULL_POINTER;
+
+       msg_struct_s *msg_struct = (msg_struct_s *) msg_struct_handle;
+
+       if (msg_struct->data == NULL)
+               return MSG_ERR_NULL_POINTER;
+
+       switch (msg_struct->type)
+       {
+       case MSG_STRUCT_MESSAGE_INFO :
+               err = msg_message_set_struct_hnd(msg_struct->data, field, (void *)value);
+               break;
+       case MSG_STRUCT_SENDOPT:
+               err = msg_sendopt_set_struct_handle(msg_struct, field, (msg_struct_s *)value);
+               break;
+       case MSG_STRUCT_SYNCML_INFO:
+               err = msg_syncml_set_struct_handle(msg_struct, field, (msg_struct_s *)value);
+               break;
+       case MSG_STRUCT_THREAD_LIST_INDEX:
+               err = msg_thread_index_set_struct_handle(msg_struct, field, (msg_struct_s *)value);
+               break;
+       case MSG_STRUCT_MMS_MEDIA:
+               err = msg_mms_set_struct_handle(msg_struct, field, (msg_struct_s *)value);
+               break;
+       case MSG_STRUCT_REQUEST_INFO:
+               err = msg_request_set_struct_handle(msg_struct, field, (msg_struct_s *)value);
+               break;
+       default :
+               err = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+
+       return err;
+}
+
+EXPORT_API int msg_set_list_handle(msg_struct_t msg_struct_handle, int field, void *value)
+{
+       msg_error_t err = MSG_SUCCESS;
+
+       if (msg_struct_handle == NULL)
+               return MSG_ERR_NULL_POINTER;
+
+       msg_struct_s *msg_struct = (msg_struct_s *) msg_struct_handle;
+
+       if (msg_struct->data == NULL)
+               return MSG_ERR_NULL_POINTER;
+
+       switch (msg_struct->type)
+       {
+       default :
+               err = MSG_ERR_INVALID_PARAMETER;
+               break;
+       }
+       return err;
+}
+
+EXPORT_API msg_struct_t msg_list_nth_data(msg_list_handle_t list_handle, int index)
+{
+       return (msg_struct_t)g_list_nth_data((GList *)list_handle,(guint)index);
+}
+
+EXPORT_API int msg_list_length(msg_list_handle_t list_handle)
+{
+       return (int)g_list_length((GList *)list_handle);
+}
diff --git a/mapi/msg_transport.cpp b/mapi/msg_transport.cpp
new file mode 100755 (executable)
index 0000000..ec6dfd6
--- /dev/null
@@ -0,0 +1,767 @@
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#include <errno.h>
+
+#include "MsgHandle.h"
+#include "MsgDebug.h"
+#include "MsgException.h"
+#include "MsgUtilFunction.h"
+
+#include "msg.h"
+#include "msg_private.h"
+#include "msg_transport.h"
+
+
+/*==================================================================================================
+                                     FUNCTION IMPLEMENTATION
+==================================================================================================*/
+EXPORT_API int msg_submit_req(msg_handle_t handle, msg_struct_t req)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL ||req == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       msg_struct_s *pStruct = (msg_struct_s *)req;
+
+       try
+       {
+               err = pHandle->submitReq((MSG_REQUEST_S *)pStruct->data);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_TRANSPORT_ERROR;
+       }
+
+       return err;
+}
+
+
+EXPORT_API int msg_reg_sent_status_callback(msg_handle_t handle, msg_sent_status_cb cb, void *user_param)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL || cb == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       try
+       {
+               err = pHandle->regSentStatusCallback(cb, user_param);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_CALLBACK_ERROR;
+       }
+
+       return err;
+}
+
+
+EXPORT_API int msg_reg_sms_message_callback(msg_handle_t handle, msg_sms_incoming_cb cb, unsigned short port, void *user_param)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL || cb == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       try
+       {
+               err = pHandle->regSmsMessageCallback(cb, port, user_param);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_CALLBACK_ERROR;
+       }
+
+       return err;
+}
+
+
+EXPORT_API int msg_reg_mms_conf_message_callback(msg_handle_t handle, msg_mms_conf_msg_incoming_cb cb, const char *app_id, void *user_param)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL || cb == NULL)
+       {
+               return -EINVAL;
+       }
+
+       if (app_id && strlen(app_id) > MAX_MMS_JAVA_APPID_LEN)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       try
+       {
+               err = pHandle->regMmsConfMessageCallback(cb, app_id, user_param);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_CALLBACK_ERROR;
+       }
+
+       return err;
+}
+
+
+EXPORT_API int msg_reg_syncml_message_callback(msg_handle_t handle,  msg_syncml_msg_incoming_cb cb, void *user_param)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL || cb == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       try
+       {
+               err = pHandle->regSyncMLMessageCallback(cb, user_param);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_CALLBACK_ERROR;
+       }
+
+       return err;
+}
+
+
+EXPORT_API int msg_reg_lbs_message_callback(msg_handle_t handle, msg_lbs_msg_incoming_cb cb, void *user_param)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL || cb == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       try
+       {
+               err = pHandle->regLBSMessageCallback(cb, user_param);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_CALLBACK_ERROR;
+       }
+
+       return err;
+}
+
+
+EXPORT_API int msg_reg_syncml_message_operation_callback(msg_handle_t handle,  msg_syncml_msg_operation_cb cb, void *user_param)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL || cb == NULL)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       try
+       {
+               err = pHandle->regSyncMLMessageOperationCallback(cb, user_param);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_CALLBACK_ERROR;
+       }
+
+       return err;
+}
+
+
+EXPORT_API int msg_syncml_message_operation(msg_handle_t handle,  msg_message_id_t msgId)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL || msgId < 1)
+       {
+               return -EINVAL;
+       }
+
+       MsgHandle* pHandle = (MsgHandle*)handle;
+
+       try
+       {
+               err = pHandle->operateSyncMLMessage(msgId);
+       }
+       catch (MsgException& e)
+       {
+               MSG_FATAL("%s", e.what());
+               return MSG_ERR_TRANSPORT_ERROR;
+       }
+
+       return err;
+}
+
+
+static msg_handle_t msgHandle = NULL;
+static msg_simple_sent_status_cb sentStatusCallback = NULL;
+
+static void sent_status_cb_func(msg_handle_t handle, msg_struct_t sent_status, void *user_param)
+{
+//     MSG_DEBUG("Sent Status [%d]", sent_status->status);
+
+       msg_simple_sent_status_cb pfunc = sentStatusCallback;
+// TODO : Fixme
+       pfunc((msg_struct_t)sent_status, user_param);
+
+       MSG_DEBUG("After entering callback function.");
+
+       // Close control handle instance
+       //      msg_close_msg_handle(&msgHandle);
+
+       //      MSG_DEBUG("After msg_close_msg_handle.");
+
+}
+
+
+static int msg_send_single_sms(const char *phone_num, const char *sms_text, msg_simple_sent_status_cb cb, void *user_param)
+{
+       if (phone_num == NULL || sms_text == NULL || cb == NULL)
+       {
+               MSG_DEBUG("Invalid parameter [%s] [%s] [%s]", phone_num, sms_text, cb);
+               return -EINVAL;
+       }
+
+       if (strlen(phone_num) > MAX_PHONE_NUMBER_LEN)
+       {
+               MSG_DEBUG("Phone Number is too long [%s]", phone_num);
+               return -EINVAL;
+       }
+
+       msg_struct_s req = {0,};
+       MSG_REQUEST_S msgReq = {0};
+
+       req.type = MSG_STRUCT_REQUEST_INFO;
+       req.data = (void *)&msgReq;
+
+       msg_error_t retVal = MSG_SUCCESS;
+
+       // Open control handle instance
+       if ((retVal = msg_open_msg_handle(&msgHandle)) != MSG_SUCCESS)
+       {
+               MSG_DEBUG("MsgOpenMsgHandle is failed. Error Code = %d", retVal);
+               return retVal;
+       }
+
+       //msgReq.msg = msg_new_message();
+       MSG_MESSAGE_HIDDEN_S msg_info = {0,};
+       msg_struct_s msg = {0,};
+
+       msg.type = MSG_STRUCT_MESSAGE_INFO;
+       msg.data = &msg_info;
+
+       /* when sending SMS */
+       msg_info.mainType = MSG_SMS_TYPE;
+       msg_info.subType = MSG_NORMAL_SMS;
+       msg_info.msgId = 0;
+       msg_info.folderId = MSG_OUTBOX_ID;
+
+       /* fill the destination number in msgReq */
+       msg_struct_list_s addr_list = {0,};
+
+       addr_list.nCount = 1;
+
+       msg_struct_s addr_info[addr_list.nCount];
+       memset(addr_info, 0, sizeof(msg_struct_s) * addr_list.nCount);
+       addr_list.msg_struct_info = (msg_struct_t *)&addr_info;
+
+       MSG_ADDRESS_INFO_S address[addr_list.nCount];
+       memset(address, 0, sizeof(MSG_ADDRESS_INFO_S) * addr_list.nCount);
+
+       for (int i = 0; i < addr_list.nCount; i++) {
+               addr_info[i].type = MSG_STRUCT_ADDRESS_INFO;
+               addr_info[i].data = (void *)&address[i];
+
+               address[i].addressType = MSG_ADDRESS_TYPE_PLMN;
+               snprintf(address[i].addressVal, MAX_ADDRESS_VAL_LEN+1, "%s", phone_num);
+
+               address[i].recipientType = MSG_RECIPIENTS_TYPE_TO;
+       }
+
+       msg_info.addr_list = &addr_list;
+
+       msg_info.bPortValid = false;
+
+       /* fill the msg text in msgReq */
+       msg_info.dataSize = strlen(sms_text);
+       msg_info.pData = (void*)malloc(msg_info.dataSize+1);
+       strncpy((char *)msg_info.pData, sms_text, msg_info.dataSize);
+
+       sentStatusCallback = cb;
+
+       // register sent status callback
+       retVal = msg_reg_sent_status_callback(msgHandle, sent_status_cb_func, user_param);
+
+       if (retVal != MSG_SUCCESS)
+       {
+               MSG_DEBUG("msg_reg_sent_status_callback() is failed. Error Code = %d", retVal);
+               msg_close_msg_handle(&msgHandle);
+               return retVal;
+       }
+
+       // sending message request
+       msgReq.msg = (msg_struct_t)&msg;
+
+       retVal = msg_submit_req(msgHandle, (msg_struct_t)&req);
+
+       if (retVal != MSG_SUCCESS)
+       {
+               MSG_DEBUG("msg_submit_req() is failed. Error Code = %d", retVal);
+               msg_close_msg_handle(&msgHandle);
+               return retVal;
+       }
+
+       return MSG_SUCCESS;
+}
+
+EXPORT_API int msg_sms_send(const char *phone_num_list, const char *sms_text, msg_simple_sent_status_cb cb, void *user_param)
+{
+       if (phone_num_list == NULL || sms_text == NULL || cb == NULL)
+       {
+               MSG_DEBUG("Invalid parameter [%s] [%s] [%s]", phone_num_list, sms_text, cb);
+               return -EINVAL;
+       }
+
+       char trimmed_num[strlen(phone_num_list)+1];
+       bzero(trimmed_num, strlen(phone_num_list)+1);
+
+       msg_error_t retVal = msg_verify_number(phone_num_list, trimmed_num);
+
+       if ( retVal != MSG_SUCCESS )
+               return retVal;
+
+       for( char* cur_num = strtok(trimmed_num,", "); cur_num ; cur_num = strtok(NULL,", "))
+       {
+               if (strlen(cur_num) > MAX_PHONE_NUMBER_LEN)
+               {
+                       MSG_DEBUG("Phone number is too long [%s], and sending is skipped", cur_num);
+                       continue;
+               }
+
+               MSG_DEBUG("phone number: [%s]", cur_num);
+               MSG_DEBUG("text: [%s]", sms_text);
+               retVal = msg_send_single_sms(cur_num, sms_text, cb, user_param);
+
+               if (retVal != MSG_SUCCESS)
+                       return retVal;
+       }
+
+       return MSG_SUCCESS;
+}
+
+
+EXPORT_API int msg_sms_send_message(msg_handle_t handle, msg_struct_t req)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL || !req) {
+               MSG_FATAL("handle or req is NULL");
+               return MSG_ERR_NULL_POINTER;
+       }
+
+       msg_struct_s *req_s = (msg_struct_s *)req;
+       MSG_REQUEST_S *pReq = (MSG_REQUEST_S *)req_s->data;
+
+       pReq->reqId = 1;
+
+       msg_struct_s *msg_s = (msg_struct_s *)pReq->msg;
+
+       MSG_MESSAGE_HIDDEN_S *reqmsg = (MSG_MESSAGE_HIDDEN_S*)msg_s->data;
+
+       if (reqmsg->dataSize <= 0) {
+               MSG_FATAL("msg size is invalid : [%d]", reqmsg->dataSize);
+               return MSG_ERR_INVALID_PARAMETER;
+       }
+
+       if (reqmsg->mainType != MSG_SMS_TYPE) {
+               MSG_DEBUG("mainType is not SMS [%d]", reqmsg->mainType);
+               reqmsg->mainType = MSG_SMS_TYPE;
+       }
+
+       if (reqmsg->subType > MSG_CONCAT_SIM_SMS) {
+               MSG_DEBUG("subType is not SMS [%d]", reqmsg->subType);
+               reqmsg->subType = MSG_NORMAL_SMS;
+       }
+
+       reqmsg->folderId = MSG_OUTBOX_ID; // outbox fixed
+       reqmsg->networkStatus = MSG_NETWORK_SENDING;
+
+       err = msg_submit_req(handle, req);
+
+       if (err == MSG_SUCCESS)
+               MSG_DEBUG("Sending Message is OK!");
+       else
+               MSG_DEBUG("Sending Message is failed! [%d]", err);
+
+       return err;
+}
+
+
+EXPORT_API int msg_mms_send_message(msg_handle_t handle, msg_struct_t req)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL || !req)
+       {
+               MSG_FATAL("handle or req is NULL");
+               return MSG_ERR_INVALID_PARAMETER;
+       }
+
+       msg_struct_s *req_s = (msg_struct_s *)req;
+       MSG_REQUEST_S *pReq = (MSG_REQUEST_S *)req_s->data;
+
+       pReq->reqId = 1;
+
+       msg_struct_s *msg_s = (msg_struct_s *)pReq->msg;
+
+       MSG_MESSAGE_HIDDEN_S *reqmsg = (MSG_MESSAGE_HIDDEN_S*)msg_s->data;
+
+       if (reqmsg->dataSize <= 0)
+       {
+               MSG_FATAL("MMS data size is invalid");
+               return MSG_ERR_INVALID_PARAMETER;
+       }
+
+       reqmsg->mainType = MSG_MMS_TYPE;
+       reqmsg->subType = MSG_SENDREQ_MMS;
+       reqmsg->folderId = MSG_OUTBOX_ID; // outbox fixed
+       reqmsg->networkStatus = MSG_NETWORK_SENDING;
+
+       err = msg_submit_req(handle, req);
+
+       if (err == MSG_SUCCESS)
+               MSG_DEBUG("Sending Message is OK!");
+       else
+               MSG_DEBUG("Sending Message is failed! [%d]", err);
+
+       return err;
+}
+
+
+EXPORT_API int msg_mms_send_read_report(msg_handle_t handle, msg_message_id_t msgId, msg_read_report_status_t mms_read_status)
+{
+       msg_error_t err = MSG_SUCCESS;
+
+       if (handle == NULL)
+       {
+               return MSG_ERR_INVALID_PARAMETER;
+       }
+
+       msg_struct_t req_t = msg_create_struct(MSG_STRUCT_REQUEST_INFO);
+
+       msg_struct_s *req_s = (msg_struct_s *)req_t;
+       MSG_REQUEST_S *req = (MSG_REQUEST_S *)req_s->data;
+       msg_struct_s *msg_s = (msg_struct_s *)req->msg;
+       MSG_MESSAGE_HIDDEN_S *reqmsg = (MSG_MESSAGE_HIDDEN_S *)msg_s->data;
+       void *read_report_data = NULL;
+       size_t read_report_datasize;
+
+       read_report_datasize = sizeof(msg_read_report_status_t);
+       read_report_data = (void *)calloc(read_report_datasize, 1);
+       if(read_report_data == NULL) {
+               return MSG_ERR_MEMORY_ERROR;
+       }
+
+       MSG_DEBUG("mms_read_status [%d]", mms_read_status);
+       memcpy(read_report_data, &mms_read_status, read_report_datasize);
+
+       req->reqId = 1;
+
+       reqmsg->bPortValid = false;
+       reqmsg->msgId = msgId;
+       reqmsg->folderId = MSG_OUTBOX_ID; // outbox fixed
+       reqmsg->mainType = MSG_MMS_TYPE;
+       reqmsg->subType = MSG_READREPLY_MMS;
+
+       reqmsg->dataSize = read_report_datasize;
+       reqmsg->pMmsData = read_report_data;
+
+       err = msg_submit_req(handle, req_t);
+       if (err == MSG_SUCCESS)
+               MSG_DEBUG("Sending Message is OK!");
+       else
+               MSG_DEBUG("Sending Message is failed!");
+
+       free(read_report_data);
+       read_report_data = NULL;
+       reqmsg->pMmsData = NULL;
+
+       msg_release_struct(&req_t);
+
+       return err;
+}
+
+
+EXPORT_API int msg_mms_forward_message(msg_handle_t handle, msg_struct_t req)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if (handle == NULL || !req )
+       {
+               MSG_FATAL("handle or req is NULL");
+               return MSG_ERR_INVALID_PARAMETER;
+       }
+
+       msg_struct_s *req_s = (msg_struct_s *)req;
+       MSG_REQUEST_S *pReq = (MSG_REQUEST_S *)req_s->data;
+
+       pReq->reqId = 1;
+
+       msg_struct_s *msg_s = (msg_struct_s *)pReq->msg;
+
+       MSG_MESSAGE_HIDDEN_S *reqmsg = (MSG_MESSAGE_HIDDEN_S*)msg_s->data;
+
+       reqmsg->mainType = MSG_MMS_TYPE;
+       reqmsg->subType = MSG_FORWARD_MMS;
+       reqmsg->folderId = MSG_OUTBOX_ID; // outbox fixed
+       reqmsg->networkStatus = MSG_NETWORK_SENDING;
+
+       err = msg_submit_req(handle, req);
+
+       if (err == MSG_SUCCESS)
+               MSG_DEBUG("Sending Message is OK!");
+       else
+               MSG_DEBUG("Sending Message is failed!");
+
+       return err;
+}
+
+
+EXPORT_API int msg_mms_retrieve_message(msg_handle_t handle, msg_struct_t req)
+{
+       msg_error_t err = MSG_SUCCESS;
+
+       if ( handle == NULL|| !req)
+       {
+               MSG_FATAL("handle or req is NULL");
+               return MSG_ERR_INVALID_PARAMETER;
+       }
+
+       msg_struct_s *req_s = (msg_struct_s *)req;
+       MSG_REQUEST_S *pReq = (MSG_REQUEST_S *)req_s->data;
+
+       msg_struct_s *msg_s = (msg_struct_s *)pReq->msg;
+       MSG_MESSAGE_HIDDEN_S *reqmsg = (MSG_MESSAGE_HIDDEN_S*)msg_s->data;
+
+       reqmsg->mainType = MSG_MMS_TYPE;
+       reqmsg->subType = MSG_RETRIEVE_MMS;
+       reqmsg->folderId = MSG_OUTBOX_ID; // outbox fixed
+       reqmsg->networkStatus = MSG_NETWORK_RETRIEVING;
+
+       err = msg_submit_req(handle, req);
+
+       if (err == MSG_SUCCESS)
+               MSG_DEBUG("Sending Message is OK!");
+       else
+               MSG_DEBUG("Sending Message is failed!");
+
+       return err;
+}
+
+
+/* reject_msg_support */
+EXPORT_API int msg_mms_reject_message(msg_handle_t handle, msg_struct_t req)
+{
+       msg_error_t err = MSG_SUCCESS;
+
+       if (handle == NULL || !req )
+       {
+               MSG_FATAL("handle or req is NULL");
+               return MSG_ERR_INVALID_PARAMETER;
+       }
+
+       msg_struct_s *req_s = (msg_struct_s *)req;
+       MSG_REQUEST_S *pReq = (MSG_REQUEST_S *)req_s->data;
+
+       msg_struct_s *msg_s = (msg_struct_s *)pReq->msg;
+       MSG_MESSAGE_HIDDEN_S *reqmsg = (MSG_MESSAGE_HIDDEN_S*)msg_s->data;
+
+       reqmsg->mainType = MSG_MMS_TYPE;
+       reqmsg->subType = MSG_NOTIFYRESPIND_MMS;
+       reqmsg->folderId = MSG_OUTBOX_ID; // outbox fixed
+       reqmsg->networkStatus = MSG_NETWORK_SENDING;
+
+       err = msg_submit_req(handle, req);
+
+       if (err == MSG_SUCCESS)
+               MSG_DEBUG("Sending Message is OK!");
+       else
+               MSG_DEBUG("Sending Message is failed!");
+
+       return err;
+}
+/* reject_msg_support */
+
+
+int msg_request_get_int(void *request_info, int field)
+{
+       int result = -1;
+       MSG_REQUEST_S *pRequest = (MSG_REQUEST_S *)request_info;
+       switch(field)
+       {
+       case MSG_REQUEST_REQUESTID_INT:
+               result = pRequest->reqId;
+               break;
+
+       default:
+               break;
+       }
+       return result;
+}
+
+
+int msg_request_get_struct_handle(msg_struct_s *msg_struct, int field, void **value)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       if(!msg_struct || !value)
+               return MSG_ERR_NULL_POINTER;
+
+       MSG_REQUEST_S *pRequest = (MSG_REQUEST_S *)msg_struct->data;
+       switch(field)
+       {
+       case MSG_REQUEST_MESSAGE_HND:
+               *value = (void *)pRequest->msg;
+               break;
+       case MSG_REQUEST_SENDOPT_HND:
+               *value = (void *)pRequest->sendOpt;
+               break;
+       default:
+               err = MSG_ERR_UNKNOWN;
+               break;
+
+       }
+       return err;
+}
+
+int msg_request_set_int(void *request_info, int field, int value)
+{
+       msg_error_t err =  MSG_SUCCESS;
+       if(!request_info)
+               return MSG_ERR_NULL_POINTER;
+
+       MSG_REQUEST_S *pRequest = (MSG_REQUEST_S *)request_info;
+       switch(field)
+       {
+       case MSG_REQUEST_REQUESTID_INT:
+               pRequest->reqId = value;
+               break;
+       default:
+               err = MSG_ERR_UNKNOWN;
+       break;
+       }
+
+       return err;
+}
+
+int msg_request_set_struct_handle(msg_struct_s *msg_struct, int field, msg_struct_s *value)
+{
+       msg_error_t err =  MSG_SUCCESS;
+       if(!msg_struct || !value)
+               return MSG_ERR_NULL_POINTER;
+
+       MSG_REQUEST_S *pRequest = (MSG_REQUEST_S *)msg_struct->data;
+       msg_struct_s *pTmp = NULL;
+
+
+       switch(field)
+       {
+       case MSG_REQUEST_MESSAGE_HND:
+       {
+               pTmp = (msg_struct_s *)pRequest->msg;
+               MSG_MESSAGE_HIDDEN_S *pSrc = (MSG_MESSAGE_HIDDEN_S *)value->data;
+               MSG_MESSAGE_HIDDEN_S *pDst = (MSG_MESSAGE_HIDDEN_S *)pTmp->data;
+               msg_message_copy_message(pSrc, pDst);
+               break;
+       }
+       case MSG_REQUEST_SENDOPT_HND:
+       {
+               pTmp = (msg_struct_s *)pRequest->sendOpt;
+               MSG_SENDINGOPT_S *pSrc = (MSG_SENDINGOPT_S *)value->data;
+               MSG_SENDINGOPT_S *pDst = (MSG_SENDINGOPT_S *)pTmp->data;
+               pDst->bDeliverReq = pSrc->bDeliverReq;
+               pDst->bKeepCopy = pSrc->bKeepCopy;
+               pDst->bSetting = pSrc->bSetting;
+
+               msg_struct_s *tmpDstMmsSendOpt = (msg_struct_s *)pDst->mmsSendOpt;
+               msg_struct_s *tmpDstSmsSendOpt = (msg_struct_s *)pDst->smsSendOpt;
+
+               msg_struct_s *tmpSrcMmsSendOpt = (msg_struct_s *)pDst->mmsSendOpt;
+               msg_struct_s *tmpSrcSmsSendOpt = (msg_struct_s *)pDst->smsSendOpt;
+
+               tmpDstMmsSendOpt->type = tmpSrcMmsSendOpt->type;
+               memcpy(tmpDstMmsSendOpt->data, tmpSrcMmsSendOpt->data, sizeof(MMS_SENDINGOPT_S));
+
+               tmpDstSmsSendOpt->type = tmpSrcSmsSendOpt->type;
+               memcpy(tmpDstSmsSendOpt->data, tmpSrcSmsSendOpt->data, sizeof(SMS_SENDINGOPT_S));
+
+               break;
+       }
+       default:
+               err = MSG_ERR_UNKNOWN;
+               break;
+       }
+       return err;
+}
+
+
+int msg_sent_status_get_int(MSG_SENT_STATUS_S *sent_status_info, int field)
+{
+       int result = -1;
+
+       switch(field)
+       {
+       case MSG_SENT_STATUS_REQUESTID_INT:
+               result = sent_status_info->reqId;
+               break;
+       case MSG_SENT_STATUS_NETWORK_STATUS_INT:
+               result = sent_status_info->status;
+               break;
+       default:
+               break;
+       }
+       return result;
+}
index 48318db..0c9ab19 100755 (executable)
@@ -1,8 +1,6 @@
 #!/bin/sh
 ## A script for running msg-server in booting time.
 
-dlogutil -v threadtime -f /var/log/msgfw.log -r 1000 -n 10 MSG_FW &
-
 if [ ! -e /opt/etc/.hib_capturing ]; then
 /usr/bin/msg-server &
 fi
index a33a996..893f0ce 100755 (executable)
@@ -15,11 +15,13 @@ SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -O0 -g -Wall")
 ##########################################################
 
 SET(MSG-HELPER-SRCS
+       ${CMAKE_SOURCE_DIR}/msg_helper/MsgSensorWrapper.cpp
        ${CMAKE_SOURCE_DIR}/msg_helper/MsgSoundPlayer.cpp
        ${CMAKE_SOURCE_DIR}/msg_helper/main.cpp
 )
 
 INCLUDE_DIRECTORIES(
+    ${CMAKE_SOURCE_DIR}/include/mapi
        ${CMAKE_SOURCE_DIR}/include/common
        ${CMAKE_SOURCE_DIR}/include/framework
        ${CMAKE_SOURCE_DIR}/include/msg_helper
@@ -27,7 +29,7 @@ INCLUDE_DIRECTORIES(
 )
 
 INCLUDE(FindPkgConfig)
-pkg_check_modules(msg_helper_pkgs REQUIRED glib-2.0 dlog vconf devman_haptic mm-player mm-fileinfo mm-player svi)
+pkg_check_modules(msg_helper_pkgs REQUIRED glib-2.0 dlog vconf devman_haptic mm-player mm-fileinfo mm-player svi sensor)
 
 FOREACH(flag ${msg_helper_pkgs_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
diff --git a/msg_helper/MsgSensorWrapper.cpp b/msg_helper/MsgSensorWrapper.cpp
new file mode 100755 (executable)
index 0000000..4e615ca
--- /dev/null
@@ -0,0 +1,107 @@
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#include "MsgDebug.h"
+#include "MsgCppTypes.h"
+#include "MsgGconfWrapper.h"
+#include "MsgHelper.h"
+
+#include <sensor.h>
+
+/*==================================================================================================
+                                     VARIABLES
+==================================================================================================*/
+int sensorHandler = -1;
+
+msg_sensor_cb cbFunction = NULL;
+
+/*==================================================================================================
+                                     FUNCTION IMPLEMENTATION
+==================================================================================================*/
+
+void MsgSensorCB(unsigned int event_type, sensor_event_data_t *event_data , void *data)
+{
+       int *my_event_data;
+
+       my_event_data = (int *)(event_data->event_data);
+
+       if (event_type == MOTION_ENGINE_EVENT_TOP_TO_BOTTOM)
+               if(*my_event_data == MOTION_ENGIEN_TOP_TO_BOTTOM_DETECTION) {
+                       MSG_DEBUG("top to bottom event detected.");
+                       if(MsgSettingGetInt(VCONFKEY_SETAPPL_MOTION_ACTIVATION))
+                               if(MsgSettingGetInt(VCONFKEY_SETAPPL_USE_TURN_OVER))
+                                       cbFunction();
+               }
+}
+
+
+msg_error_t MsgSensorConnect()
+{
+       sensorHandler = sf_connect(MOTION_SENSOR);
+       if (sensorHandler < 0) {
+               MSG_DEBUG("sensor attach fail.");
+               return MSG_ERR_UNKNOWN;
+       }
+
+       return MSG_SUCCESS;
+}
+
+
+void MsgSensorDisconnect()
+{
+       if(cbFunction != NULL)
+               cbFunction = NULL;
+
+       if (sensorHandler < 0)
+               return;
+
+       sf_stop(sensorHandler);
+       sf_disconnect(sensorHandler);
+}
+
+
+msg_error_t MsgRegSensorCB(msg_sensor_cb cb)
+{
+       int resultCondition = -1;
+
+       if (sensorHandler < 0) {
+               MSG_DEBUG("Not connected to sensor FW.");
+               return MSG_ERR_UNKNOWN;
+       }
+
+       if(cb != NULL) {
+               // regist cb.
+               cbFunction = cb;
+       } else {
+               MSG_DEBUG("cb is NULL.");
+               return MSG_ERR_UNKNOWN;
+       }
+
+       resultCondition = sf_register_event(sensorHandler, MOTION_ENGINE_EVENT_TOP_TO_BOTTOM , NULL , MsgSensorCB,NULL);
+       if (resultCondition < 0) {
+               MSG_DEBUG("SLP_sensor_register_cb fail to gather data.");
+               return MSG_ERR_UNKNOWN;
+       }
+
+       MSG_DEBUG("Start SF.");
+       resultCondition = sf_start(sensorHandler, 0);
+       if (resultCondition < 0) {
+               MSG_DEBUG("SLP_sensor_start fail.");
+               return MSG_ERR_UNKNOWN;
+       }
+
+       return MSG_SUCCESS;
+}
index b775368..d0a3ce6 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include <pthread.h>
 
 #include "MsgCppTypes.h"
 #include "MsgSettingTypes.h"
 #include "MsgGconfWrapper.h"
+#include "MsgUtilFile.h"
 #include "MsgHelper.h"
 
-#include <devman_haptic.h>
+#include <devman_managed.h>
 #include <svi.h>
 
 #include <mm_error.h>
@@ -103,7 +104,8 @@ static int MsgSoundPlayCallback(int message, void *param, void *user_param)
                        MSG_DEBUG("Play is started.");
                        break;
                case MM_MESSAGE_END_OF_STREAM:
-                       MSG_DEBUG("end of stream");
+               case MM_MESSAGE_STATE_INTERRUPTED:
+                       MSG_DEBUG("EOS or Interrupted.");
                        MsgSoundPlayStop();
                        if(!bPlaying && !bVibrating)
                                worker_done();
@@ -133,7 +135,7 @@ void* MsgPlayThread(void *data)
 
        tmpFileFath = MsgSettingGetString(VCONFKEY_SETAPPL_NOTI_MSG_RINGTONE_PATH_STR);
 
-       if (tmpFileFath == NULL) {
+       if (tmpFileFath == NULL || MsgGetFileSize(tmpFileFath) < 1) {
                msg_tone_file_path = new char[MAX_SOUND_FILE_LEN];
                strncpy(msg_tone_file_path, DEFAULT_FILE, MAX_SOUND_FILE_LEN-1);
        } else {
@@ -219,7 +221,7 @@ void* MsgPlayThread(void *data)
 }
 
 
-MSG_ERROR_T MsgSoundPlayUninit()
+msg_error_t MsgSoundPlayUninit()
 {
        MSG_BEGIN();
 
index 4ffd4a4..94115aa 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include <stdio.h>
 #include <glib.h>
@@ -45,7 +45,9 @@ int main(int argc, char** argv)
 
        MSG_DEBUG("############### Start msg_helper ###############");
 
+#if !GLIB_CHECK_VERSION(2, 31, 0)
        g_thread_init(NULL);
+#endif
 
        bool notEnd = false;
 
@@ -71,6 +73,9 @@ int main(int argc, char** argv)
        {
                loop = g_main_loop_new(NULL, FALSE);
 
+               if (MsgSensorConnect() == MSG_SUCCESS)
+                       if (MsgRegSensorCB(&worker_done) != MSG_SUCCESS)
+                               MsgSensorDisconnect();
 
                if (loop != NULL)
                {
@@ -82,6 +87,7 @@ int main(int argc, char** argv)
                else
                {
                        MSG_DEBUG("Fail to create g_main_loop!!!");
+                       MsgSensorDisconnect();
                }
        }
 
index 74016e3..2323e92 100755 (executable)
@@ -1,10 +1,10 @@
 Name:           msg-service
-Version:        0.8.7
-Release:        5
-License:        Flora Software License
-Summary:        Messaging Framework Library 
+Version:        0.9.0
+Release:        1
+License:        Apache License v2.0
+Summary:        Messaging Framework Library
 Group:          System/Libraries
-Source0:       %{name}-%{version}.tar.gz
+Source0:        %{name}-%{version}.tar.gz
 
 Requires(post): /usr/bin/sqlite3
 Requires(post): /usr/bin/vconftool
@@ -12,6 +12,8 @@ Requires(post): /sbin/ldconfig
 Requires(postun): /sbin/ldconfig
 BuildRequires: cmake
 BuildRequires: pkgconfig(alarm-service)
+BuildRequires: pkgconfig(aul)
+BuildRequires: pkgconfig(capi-appfw-application)
 BuildRequires: pkgconfig(contacts-service)
 BuildRequires: pkgconfig(db-util)
 BuildRequires: pkgconfig(devman_haptic)
@@ -20,6 +22,7 @@ BuildRequires: pkgconfig(drm-client)
 BuildRequires: pkgconfig(drm-trusted)
 BuildRequires: pkgconfig(glib-2.0)
 BuildRequires: pkgconfig(libcurl)
+BuildRequires: pkgconfig(libsystemd-daemon)
 BuildRequires: pkgconfig(libxml-2.0)
 BuildRequires: pkgconfig(libwbxml2)
 BuildRequires: pkgconfig(media-thumbnail)
@@ -28,6 +31,7 @@ BuildRequires: pkgconfig(mm-player)
 BuildRequires: pkgconfig(mm-session)
 BuildRequires: pkgconfig(network)
 BuildRequires: pkgconfig(notification)
+BuildRequires: pkgconfig(phone-misc)
 BuildRequires: pkgconfig(pmapi)
 BuildRequires: pkgconfig(mmutil-imgp)
 BuildRequires: pkgconfig(mmutil-jpeg)
@@ -36,14 +40,13 @@ BuildRequires: pkgconfig(sensor)
 BuildRequires: pkgconfig(svi)
 BuildRequires: pkgconfig(tapi)
 BuildRequires: pkgconfig(vconf)
-BuildRequires: pkgconfig(capi-appfw-application)
 
-%description 
-Description: Messaging Framework Library 
+%description
+Description: Messaging Framework Library
 
 
 %package devel
-License:        Flora Software License
+License:        Apache License v2.0
 Summary:        Messaging Framework Library (development)
 Requires:       %{name} = %{version}-%{release}
 Group:          Development/Libraries
@@ -53,7 +56,7 @@ Description: Messaging Framework Library (development)
 
 
 %package tools
-License:        Flora Software License
+License:        Apache License v2.0
 Summary:        Messaging server application
 Requires:       %{name} = %{version}-%{release}
 Group:          TO_BU / FILL_IN
@@ -67,26 +70,26 @@ Description:  Messaging server application
 
 
 %package -n sms-plugin
-License:        Flora Software License
-Summary:        SMS plugin library 
+License:        Apache License v2.0
+Summary:        SMS plugin library
 Requires:       %{name} = %{version}-%{release}
 Group:          System/Libraries
 Requires(post): /sbin/ldconfig
 Requires(postun): /sbin/ldconfig
 
 %description -n sms-plugin
-Description: SMS plugin library  
+Description: SMS plugin library
 
 %package -n mms-plugin
-License:        Flora Software License
-Summary:        MMS plugin library 
+License:        Apache License v2.0
+Summary:        MMS plugin library
 Requires:       %{name} = %{version}-%{release}
 Group:          System/Libraries
 Requires(post): /sbin/ldconfig
 Requires(postun): /sbin/ldconfig
 
 %description -n mms-plugin
-Description: MMS plugin library  
+Description: MMS plugin library
 
 %prep
 %setup -q
@@ -114,40 +117,37 @@ mkdir -p %{buildroot}/opt/data/msg-service
 %post -n sms-plugin -p /sbin/ldconfig
 %post -n mms-plugin -p /sbin/ldconfig
 
-%post 
+%post
 /sbin/ldconfig
 
 if [ ! -f /opt/dbspace/.msg_service.db ]
 then
-        sqlite3 /opt/dbspace/.msg_service.db "PRAGMA journal_mode = PERSIST;
-
-        CREATE TABLE MSG_ADDRESS_TABLE(ADDRESS_ID INTEGER PRIMARY KEY, ADDRESS_TYPE INTEGER, RECIPIENT_TYPE INTEGER, ADDRESS_VAL TEXT, CONTACT_ID INTEGER, DISPLAY_NAME TEXT, FIRST_NAME TEXT, LAST_NAME TEXT, IMAGE_PATH TEXT, SYNC_TIME DATETIME, UNREAD_CNT INTEGER DEFAULT 0, SMS_CNT INTEGER DEFAULT 0, MMS_CNT INTEGER DEFAULT 0, MAIN_TYPE INTEGER NOT NULL, SUB_TYPE INTEGER NOT NULL, MSG_DIRECTION INTEGER NOT NULL, MSG_TIME DATETIME, MSG_TEXT TEXT);
-        CREATE TABLE MSG_FOLDER_TABLE(FOLDER_ID INTEGER PRIMARY KEY, FOLDER_NAME TEXT NOT NULL, FOLDER_TYPE INTEGER DEFAULT 0);
-        CREATE TABLE MSG_MESSAGE_TABLE(MSG_ID INTEGER PRIMARY KEY, ADDRESS_ID INTEGER, FOLDER_ID INTEGER, REFERENCE_ID INTEGER, STORAGE_ID INTEGER NOT NULL, MAIN_TYPE INTEGER NOT NULL, SUB_TYPE INTEGER NOT NULL, DISPLAY_TIME DATETIME, DATA_SIZE INTEGER DEFAULT 0, NETWORK_STATUS INTEGER DEFAULT 0, READ_STATUS INTEGER DEFAULT 0, PROTECTED INTEGER DEFAULT 0, PRIORITY INTEGER DEFAULT 0, MSG_DIRECTION INTEGER NOT NULL, SCHEDULED_TIME DATETIME, BACKUP INTEGER DEFAULT 0, SUBJECT TEXT, MSG_DATA TEXT, THUMB_PATH TEXT, MSG_TEXT TEXT, DELIVERY_REPORT_STATUS INTEGER DEFAULT 0, DELIVERY_REPORT_TIME DATETIME, READ_REPORT_STATUS INTEGER DEFAULT 0, READ_REPORT_TIME DATETIME, ATTACHMENT_COUNT INTEGER DEFAULT 0, FOREIGN KEY(ADDRESS_ID) REFERENCES MSG_ADDRESS_TABLE(ADDRESS_ID), FOREIGN KEY(FOLDER_ID) REFERENCES MSG_FOLDER_TABLE(FOLDER_ID));
-        CREATE TABLE MSG_SIM_TABLE(MSG_ID INTEGER, SIM_ID INTEGER NOT NULL, FOREIGN KEY(MSG_ID) REFERENCES MSG_MESSAGE_TABLE(MSG_ID));
-        CREATE TABLE MSG_PUSH_TABLE(MSG_ID INTEGER, ACTION INTEGER, CREATED INTEGER, EXPIRES INTEGER, ID TEXT, HREF TEXT, CONTENT TEXT, FOREIGN KEY(MSG_ID) REFERENCES MSG_MESSAGE_TABLE(MSG_ID));
-        CREATE TABLE MSG_CBMSG_TABLE(MSG_ID INTEGER, CB_MSG_ID INTEGER NOT NULL, FOREIGN KEY(MSG_ID) REFERENCES MSG_MESSAGE_TABLE(MSG_ID));
-        CREATE TABLE MSG_SYNCML_TABLE(MSG_ID INTEGER, EXT_ID INTEGER NOT NULL, PINCODE INTEGER NOT NULL, FOREIGN KEY(MSG_ID) REFERENCES MSG_MESSAGE_TABLE(MSG_ID));
-        CREATE TABLE MSG_SCHEDULED_TABLE(MSG_ID INTEGER, ALARM_ID INTEGER NOT NULL, LISTENER_FD INTEGER NOT NULL, FOREIGN KEY(MSG_ID) REFERENCES MSG_MESSAGE_TABLE(MSG_ID));
-        CREATE TABLE MSG_SMS_SENDOPT_TABLE(MSG_ID INTEGER, DELREP_REQ INTEGER NOT NULL, KEEP_COPY INTEGER NOT NULL, REPLY_PATH INTEGER NOT NULL, FOREIGN KEY(MSG_ID) REFERENCES MSG_MESSAGE_TABLE(MSG_ID));
-        CREATE TABLE MSG_FILTER_TABLE(FILTER_ID INTEGER PRIMARY KEY, FILTER_TYPE INTEGER NOT NULL, FILTER_VALUE TEXT NOT NULL);
-        CREATE TABLE MSG_MMS_MESSAGE_TABLE(REFERENCE_ID INTEGER, TRANSACTION_ID TEXT, MESSAGE_ID TEXT, FWD_MESSAGE_ID TEXT, CONTENTS_LOCATION TEXT, FILE_PATH TEXT, FOREIGN KEY(REFERENCE_ID) REFERENCES MSG_MESSAGE_TABLE(REFERENCE_ID));
-        CREATE TABLE MSG_MMS_ATTR_TABLE(REFERENCE_ID INTEGER, VERSION INTEGER NOT NULL, DATA_TYPE INTEGER DEFAULT -1, DATE DATETIME, HIDE_ADDRESS INTEGER DEFAULT 0, ASK_DELIVERY_REPORT INTEGER DEFAULT 0, REPORT_ALLOWED INTEGER DEFAULT 0, READ_REPORT_ALLOWED_TYPE INTEGER DEFAULT 0, ASK_READ_REPLY INTEGER DEFAULT 0, READ INTEGER DEFAULT 0, READ_REPORT_SEND_STATUS INTEGER DEFAULT 0, READ_REPORT_SENT INTEGER DEFAULT 0, PRIORITY INTEGER DEFAULT 0, KEEP_COPY INTEGER DEFAULT 0, MSG_SIZE INTEGER NOT NULL, MSG_CLASS INTEGER DEFAULT -1, EXPIRY_TIME DATETIME, CUSTOM_DELIVERY_TIME INTEGER DEFAULT 0, DELIVERY_TIME DATETIME, MSG_STATUS INTEGER DEFAULT -1, FOREIGN KEY(REFERENCE_ID) REFERENCES MSG_MESSAGE_TABLE(REFERENCE_ID));
-
-        CREATE INDEX MSG_ADDRESS_INDEX ON MSG_ADDRESS_TABLE(ADDRESS_ID);
-        CREATE INDEX MSG_FOLDER_INDEX ON MSG_FOLDER_TABLE(FOLDER_ID);
-        CREATE INDEX MSG_MESSAGE_INDEX ON MSG_MESSAGE_TABLE(MSG_ID, ADDRESS_ID, FOLDER_ID);
-
-        INSERT INTO MSG_FOLDER_TABLE VALUES (1, 'INBOX', 1);
-        INSERT INTO MSG_FOLDER_TABLE VALUES (2, 'OUTBOX', 2);
-        INSERT INTO MSG_FOLDER_TABLE VALUES (3, 'SENTBOX', 2);
-        INSERT INTO MSG_FOLDER_TABLE VALUES (4, 'DRAFT', 3);
-        INSERT INTO MSG_FOLDER_TABLE VALUES (5, 'CBMSGBOX', 1);
-        INSERT INTO MSG_FOLDER_TABLE VALUES (6, 'SPAMBOX', 4);
-        INSERT INTO MSG_FOLDER_TABLE VALUES (7, 'SMS TEMPLATE', 5);
-        INSERT INTO MSG_FOLDER_TABLE VALUES (8, 'MMS TEMPLATE', 5);
-
-        INSERT INTO MSG_ADDRESS_TABLE VALUES (0, 0, 0, '', 0, '', '', '', '', 0, 0, 0, 0, 0, 0, 0, 0, '');"
+    sqlite3 /opt/dbspace/.msg_service.db "PRAGMA journal_mode = PERSIST;
+
+    CREATE TABLE MSG_CONVERSATION_TABLE ( CONV_ID INTEGER NOT NULL , UNREAD_CNT INTEGER DEFAULT 0 , SMS_CNT INTEGER DEFAULT 0 , MMS_CNT INTEGER DEFAULT 0 , MAIN_TYPE INTEGER NOT NULL , SUB_TYPE INTEGER NOT NULL , MSG_DIRECTION INTEGER NOT NULL , DISPLAY_TIME INTEGER , DISPLAY_NAME TEXT , MSG_TEXT TEXT );
+    CREATE TABLE MSG_ADDRESS_TABLE ( ADDRESS_ID INTEGER PRIMARY KEY , CONV_ID INTEGER  NOT NULL , ADDRESS_TYPE INTEGER , RECIPIENT_TYPE INTEGER , ADDRESS_VAL TEXT , CONTACT_ID INTEGER , DISPLAY_NAME TEXT , FIRST_NAME TEXT , LAST_NAME TEXT , IMAGE_PATH TEXT , SYNC_TIME DATETIME , FOREIGN KEY (CONV_ID) REFERENCES MSG_CONVERSATION_TABLE (CONV_ID) );
+    CREATE TABLE MSG_FOLDER_TABLE ( FOLDER_ID INTEGER PRIMARY KEY , FOLDER_NAME TEXT NOT NULL , FOLDER_TYPE INTEGER DEFAULT 0 );
+    CREATE TABLE MSG_MESSAGE_TABLE ( MSG_ID INTEGER PRIMARY KEY , CONV_ID INTEGER NOT NULL , FOLDER_ID INTEGER NOT NULL , STORAGE_ID INTEGER NOT NULL , MAIN_TYPE INTEGER NOT NULL , SUB_TYPE INTEGER NOT NULL , DISPLAY_TIME DATETIME , DATA_SIZE INTEGER DEFAULT 0 , NETWORK_STATUS INTEGER DEFAULT 0 , READ_STATUS INTEGER DEFAULT 0 , PROTECTED INTEGER DEFAULT 0 , PRIORITY INTEGER DEFAULT 0 , MSG_DIRECTION INTEGER NOT NULL , SCHEDULED_TIME DATETIME , BACKUP INTEGER DEFAULT 0 , SUBJECT TEXT , MSG_DATA TEXT , THUMB_PATH TEXT , MSG_TEXT TEXT , DELIVERY_REPORT_STATUS INTEGER DEFAULT 0 , DELIVERY_REPORT_TIME DATETIME , READ_REPORT_STATUS INTEGER DEFAULT 0 , READ_REPORT_TIME DATETIME , ATTACHMENT_COUNT INTEGER DEFAULT 0 , FOREIGN KEY (CONV_ID) REFERENCES MSG_CONVERSATION_TABLE (CONV_ID) , FOREIGN KEY (FOLDER_ID) REFERENCES MSG_FOLDER_TABLE (FOLDER_ID) );
+    CREATE TABLE MSG_SIM_TABLE ( MSG_ID INTEGER , SIM_ID INTEGER NOT NULL , FOREIGN KEY(MSG_ID) REFERENCES MSG_MESSAGE_TABLE(MSG_ID) );
+    CREATE TABLE MSG_PUSH_TABLE ( MSG_ID INTEGER , ACTION INTEGER , CREATED INTEGER , EXPIRES INTEGER , ID TEXT , HREF TEXT , CONTENT TEXT , FOREIGN KEY(MSG_ID) REFERENCES MSG_MESSAGE_TABLE(MSG_ID) );
+    CREATE TABLE MSG_CBMSG_TABLE ( MSG_ID INTEGER , CB_MSG_ID INTEGER NOT NULL , FOREIGN KEY(MSG_ID) REFERENCES MSG_MESSAGE_TABLE(MSG_ID) );
+    CREATE TABLE MSG_SYNCML_TABLE ( MSG_ID INTEGER , EXT_ID INTEGER NOT NULL , PINCODE INTEGER NOT NULL , FOREIGN KEY(MSG_ID) REFERENCES MSG_MESSAGE_TABLE(MSG_ID) );
+    CREATE TABLE MSG_SMS_SENDOPT_TABLE ( MSG_ID INTEGER , DELREP_REQ INTEGER NOT NULL , KEEP_COPY INTEGER NOT NULL , REPLY_PATH INTEGER NOT NULL , FOREIGN KEY(MSG_ID) REFERENCES MSG_MESSAGE_TABLE(MSG_ID) );
+    CREATE TABLE MSG_FILTER_TABLE ( FILTER_ID INTEGER PRIMARY KEY , FILTER_TYPE INTEGER NOT NULL , FILTER_VALUE TEXT NOT NULL );
+    CREATE TABLE MSG_MMS_MESSAGE_TABLE ( MSG_ID INTEGER , TRANSACTION_ID TEXT , MESSAGE_ID TEXT , FWD_MESSAGE_ID TEXT , CONTENTS_LOCATION TEXT , FILE_PATH TEXT , VERSION INTEGER NOT NULL , DATA_TYPE INTEGER DEFAULT -1 , DATE DATETIME , HIDE_ADDRESS INTEGER DEFAULT 0 , ASK_DELIVERY_REPORT INTEGER DEFAULT 0 , REPORT_ALLOWED INTEGER DEFAULT 0 , READ_REPORT_ALLOWED_TYPE INTEGER DEFAULT 0 , ASK_READ_REPLY INTEGER DEFAULT 0 , READ INTEGER DEFAULT 0 , READ_REPORT_SEND_STATUS INTEGER DEFAULT 0 , READ_REPORT_SENT INTEGER DEFAULT 0 , PRIORITY INTEGER DEFAULT 0 , KEEP_COPY INTEGER DEFAULT 0 , MSG_SIZE INTEGER NOT NULL , MSG_CLASS INTEGER DEFAULT -1 , EXPIRY_TIME DATETIME , CUSTOM_DELIVERY_TIME INTEGER DEFAULT 0 , DELIVERY_TIME DATETIME , MSG_STATUS INTEGER DEFAULT -1 , FOREIGN KEY (MSG_ID) REFERENCES MSG_MESSAGE_TABLE (MSG_ID) );
+
+    CREATE INDEX MSG_CONVERSATION_INDEX ON MSG_CONVERSATION_TABLE(CONV_ID);
+    CREATE INDEX MSG_FOLDER_INDEX ON MSG_FOLDER_TABLE(FOLDER_ID);
+    CREATE INDEX MSG_MESSAGE_INDEX ON MSG_MESSAGE_TABLE(MSG_ID, CONV_ID, FOLDER_ID);
+
+    INSERT INTO MSG_FOLDER_TABLE VALUES (1, 'INBOX', 1);
+    INSERT INTO MSG_FOLDER_TABLE VALUES (2, 'OUTBOX', 2);
+    INSERT INTO MSG_FOLDER_TABLE VALUES (3, 'SENTBOX', 2);
+    INSERT INTO MSG_FOLDER_TABLE VALUES (4, 'DRAFT', 3);
+    INSERT INTO MSG_FOLDER_TABLE VALUES (5, 'CBMSGBOX', 1);
+    INSERT INTO MSG_FOLDER_TABLE VALUES (6, 'SPAMBOX', 4);
+    INSERT INTO MSG_FOLDER_TABLE VALUES (7, 'SMS TEMPLATE', 5);
+    INSERT INTO MSG_FOLDER_TABLE VALUES (8, 'MMS TEMPLATE', 5);"
 fi
 
 chown :6011 /opt/dbspace/.msg_service.db
@@ -158,108 +158,137 @@ chmod 660 /opt/dbspace/.msg_service.db
 chmod 660 /opt/dbspace/.msg_service.db-journal
 
 
-########## Setting Config Value ##########
-# General Options
-vconftool set -t bool db/msg/general/keep_copy 1
-vconftool set -t int db/msg/general/alert_tone 0
-vconftool set -t bool db/msg/general/auto_erase 0
-vconftool set -t bool db/msg/general/block_msg 0
+########## Setting Config Value (Internal keys) ##########
+# Message Server Status
+vconftool set -t bool memory/msg/ready 0 -i
 
 # SMS Send Options
-vconftool set -t int db/msg/sms_send/dcs 3
 vconftool set -t int db/msg/network_mode 2
-vconftool set -t bool db/msg/sms_send/reply_path 0
-vconftool set -t bool db/msg/sms_send/delivery_report 0
-vconftool set -t int db/msg/sms_send/save_storage 1
+
+# New Message Count
+vconftool set -t int db/msg/recv_sms 0
+vconftool set -t int db/msg/recv_mms 0
+
+########## Setting Config Value (Private keys) ##########
+# General Options
+vconftool set -t bool db/private/msg-service/general/keep_copy 1
+vconftool set -t bool db/private/msg-service/general/auto_erase 0
+vconftool set -t bool db/private/msg-service/general/block_msg 0
+vconftool set -t int db/private/msg-service/general/contact_sync_time 0
+
+# SMS Send Options
+vconftool set -t int db/private/msg-service/sms_send/dcs 3
+vconftool set -t bool db/private/msg-service/sms_send/reply_path 0
+vconftool set -t bool db/private/msg-service/sms_send/delivery_report 0
+vconftool set -t int db/private/msg-service/sms_send/save_storage 1
+
+# SMSC
+vconftool set -t int db/private/msg-service/smsc/total_count 1
+vconftool set -t int db/private/msg-service/smsc/selected 0
+
+vconftool set -t int db/private/msg-service/smsc/pid/0 1
+vconftool set -t int db/private/msg-service/smsc/val_period/0 255
+vconftool set -t string db/private/msg-service/smsc/name/0 ""
+vconftool set -t int db/private/msg-service/smsc/ton/0 1
+vconftool set -t int db/private/msg-service/smsc/npi/0 1
+vconftool set -t string db/private/msg-service/smsc/address/0 ""
+
+vconftool set -t int db/private/msg-service/smsc/pid/1 0
+vconftool set -t int db/private/msg-service/smsc/val_period/1 0
+vconftool set -t string db/private/msg-service/smsc/name/1 ""
+vconftool set -t int db/private/msg-service/smsc/ton/1 0
+vconftool set -t int db/private/msg-service/smsc/npi/1 0
+vconftool set -t string db/private/msg-service/smsc/address/1 ""
+
+vconftool set -t int db/private/msg-service/smsc/pid/2 0
+vconftool set -t int db/private/msg-service/smsc/val_period/2 0
+vconftool set -t string db/private/msg-service/smsc/name/2 ""
+vconftool set -t int db/private/msg-service/smsc/ton/2 0
+vconftool set -t int db/private/msg-service/smsc/npi/2 0
+vconftool set -t string db/private/msg-service/smsc/address/2 ""
 
 # MMS Send Options
-vconftool set -t int db/msg/mms_send/msg_class 0
-vconftool set -t int db/msg/mms_send/priority 1
-vconftool set -t int db/msg/mms_send/expiry_time 0
-vconftool set -t int db/msg/mms_send/custom_delivery 0
-vconftool set -t bool db/msg/mms_send/sender_visibility 0
-vconftool set -t bool db/msg/mms_send/delivery_report 1
-vconftool set -t bool db/msg/mms_send/read_reply 1
-vconftool set -t bool db/msg/mms_send/keep_copy 0
-vconftool set -t bool db/msg/mms_send/body_replying 0
-vconftool set -t bool db/msg/mms_send/hide_recipients 0
-vconftool set -t bool db/msg/mms_send/report_allowed 1
-vconftool set -t int db/msg/mms_send/reply_charging 0
-vconftool set -t int db/msg/mms_send/reply_charging_deadline 0
-vconftool set -t int db/msg/mms_send/reply_charging_size 0
-vconftool set -t int db/msg/mms_send/delivery_time 0
-vconftool set -t int db/msg/mms_send/creation_mode 2
+vconftool set -t int db/private/msg-service/mms_send/msg_class 0
+vconftool set -t int db/private/msg-service/mms_send/priority 1
+vconftool set -t int db/private/msg-service/mms_send/expiry_time 0
+vconftool set -t int db/private/msg-service/mms_send/custom_delivery 0
+vconftool set -t bool db/private/msg-service/mms_send/sender_visibility 0
+vconftool set -t bool db/private/msg-service/mms_send/delivery_report 1
+vconftool set -t bool db/private/msg-service/mms_send/read_reply 1
+vconftool set -t bool db/private/msg-service/mms_send/keep_copy 0
+vconftool set -t bool db/private/msg-service/mms_send/body_replying 0
+vconftool set -t bool db/private/msg-service/mms_send/hide_recipients 0
+vconftool set -t bool db/private/msg-service/mms_send/report_allowed 1
+vconftool set -t int db/private/msg-service/mms_send/reply_charging 0
+vconftool set -t int db/private/msg-service/mms_send/reply_charging_deadline 0
+vconftool set -t int db/private/msg-service/mms_send/reply_charging_size 0
+vconftool set -t int db/private/msg-service/mms_send/delivery_time 0
+vconftool set -t int db/private/msg-service/mms_send/creation_mode 2
 
 # MMS Receive Options
-vconftool set -t int db/msg/mms_recv/home_network 0
-vconftool set -t int db/msg/mms_recv/abroad_network 0
-vconftool set -t bool db/msg/mms_recv/read_receipt 1
-vconftool set -t bool db/msg/mms_recv/delivery_receipt 1
-vconftool set -t bool db/msg/mms_recv/reject_unknown 0
-vconftool set -t bool db/msg/mms_recv/reject_advertisement 0
+vconftool set -t int db/private/msg-service/mms_recv/home_network 0
+vconftool set -t int db/private/msg-service/mms_recv/abroad_network 0
+vconftool set -t bool db/private/msg-service/mms_recv/read_receipt 1
+vconftool set -t bool db/private/msg-service/mms_recv/delivery_receipt 1
+vconftool set -t bool db/private/msg-service/mms_recv/reject_unknown 0
+vconftool set -t bool db/private/msg-service/mms_recv/reject_advertisement 0
 
 # MMS Receive Options
-vconftool set -t int db/msg/mms_style/font_size 30
-vconftool set -t bool db/msg/mms_style/font_style/bold 0
-vconftool set -t bool db/msg/mms_style/font_style/italic 0
-vconftool set -t bool db/msg/mms_style/font_style/underline 0
-vconftool set -t int db/msg/mms_style/font_color/red 0
-vconftool set -t int db/msg/mms_style/font_color/green 0
-vconftool set -t int db/msg/mms_style/font_color/blue 0
-vconftool set -t int db/msg/mms_style/font_color/hue 255
-vconftool set -t int db/msg/mms_style/bg_color/red 255
-vconftool set -t int db/msg/mms_style/bg_color/green 255
-vconftool set -t int db/msg/mms_style/bg_color/blue 255
-vconftool set -t int db/msg/mms_style/bg_color/hue 255
-vconftool set -t int db/msg/mms_style/page_dur 2
-vconftool set -t int db/msg/mms_style/page_custom_dur 0
-vconftool set -t int db/msg/mms_style/page_dur_manual 0
+vconftool set -t int db/private/msg-service/mms_style/font_size 30
+vconftool set -t bool db/private/msg-service/mms_style/font_style/bold 0
+vconftool set -t bool db/private/msg-service/mms_style/font_style/italic 0
+vconftool set -t bool db/private/msg-service/mms_style/font_style/underline 0
+vconftool set -t int db/private/msg-service/mms_style/font_color/red 255
+vconftool set -t int db/private/msg-service/mms_style/font_color/green 255
+vconftool set -t int db/private/msg-service/mms_style/font_color/blue 255
+vconftool set -t int db/private/msg-service/mms_style/font_color/hue 255
+vconftool set -t int db/private/msg-service/mms_style/bg_color/red 0
+vconftool set -t int db/private/msg-service/mms_style/bg_color/green 0
+vconftool set -t int db/private/msg-service/mms_style/bg_color/blue 0
+vconftool set -t int db/private/msg-service/mms_style/bg_color/hue 255
+vconftool set -t int db/private/msg-service/mms_style/page_dur 2
+vconftool set -t int db/private/msg-service/mms_style/page_custom_dur 0
+vconftool set -t int db/private/msg-service/mms_style/page_dur_manual 0
 
 # Push Msg Options
-vconftool set -t bool db/msg/push_msg/recv_option 1
-vconftool set -t int db/msg/push_msg/service_load 1
+vconftool set -t bool db/private/msg-service/push_msg/recv_option 1
+vconftool set -t int db/private/msg-service/push_msg/service_load 1
 
 # CB Msg Options
-vconftool set -t bool db/msg/cb_msg/receive 0
-vconftool set -t bool db/msg/cb_msg/all_channel 0
-vconftool set -t int db/msg/cb_msg/max_sim_count 0
-vconftool set -t int db/msg/cb_msg/channel_count 0
-vconftool set -t bool db/msg/cb_msg/language/0 0
-vconftool set -t bool db/msg/cb_msg/language/1 0
-vconftool set -t bool db/msg/cb_msg/language/2 0
-vconftool set -t bool db/msg/cb_msg/language/3 0
-vconftool set -t bool db/msg/cb_msg/language/4 0
-vconftool set -t bool db/msg/cb_msg/language/5 0
-vconftool set -t bool db/msg/cb_msg/language/6 0
-vconftool set -t bool db/msg/cb_msg/language/7 0
-vconftool set -t bool db/msg/cb_msg/language/8 0
-vconftool set -t bool db/msg/cb_msg/language/9 0
-
-# SOS Msg Options
-vconftool set -t bool db/msg/sos_msg/send_option 0
-vconftool set -t int db/msg/sos_msg/recipient_count 0
-vconftool set -t int db/msg/sos_msg/repeat_count 0
-vconftool set -t string db/msg/sos_msg/msg_text ""
-vconftool set -t int db/msg/sos_msg/alert_type 0
+vconftool set -t bool db/private/msg-service/cb_msg/receive 0
+vconftool set -t bool db/private/msg-service/cb_msg/all_channel 0
+vconftool set -t int db/private/msg-service/cb_msg/max_sim_count 0
+vconftool set -t int db/private/msg-service/cb_msg/channel_count 0
+vconftool set -t bool db/private/msg-service/cb_msg/language/0 0
+vconftool set -t bool db/private/msg-service/cb_msg/language/1 0
+vconftool set -t bool db/private/msg-service/cb_msg/language/2 0
+vconftool set -t bool db/private/msg-service/cb_msg/language/3 0
+vconftool set -t bool db/private/msg-service/cb_msg/language/4 0
+vconftool set -t bool db/private/msg-service/cb_msg/language/5 0
+vconftool set -t bool db/private/msg-service/cb_msg/language/6 0
+vconftool set -t bool db/private/msg-service/cb_msg/language/7 0
+vconftool set -t bool db/private/msg-service/cb_msg/language/8 0
+vconftool set -t bool db/private/msg-service/cb_msg/language/9 0
 
 # Voice Mail Options
-vconftool set -t string db/msg/voice_mail/voice_mail_number "12345678"
+vconftool set -t string db/private/msg-service/voice_mail/voice_mail_number ""
 
 # MMS Size Options
-vconftool set -t int db/msg/size_opt/msg_size 300
+vconftool set -t int db/private/msg-service/size_opt/msg_size 300
 
-vconftool set -t int db/badge/org.tizen.message 0
+# SIM message count
+vconftool set -t int db/private/msg-service/sim_count/used_cnt 0
+vconftool set -t int db/private/msg-service/sim_count/total_cnt 0
 
-# Msg Count
-vconftool set -t int db/msg/recv_sms 0 -u 0
-vconftool set -t int db/msg/recv_mms 0 -u 0
+# SIM information
+vconftool set -t int memory/private/msg-service/sim_changed 0 -i
+vconftool set -t string memory/private/msg-service/sim_imsi "" -i
+vconftool set -t bool memory/private/msg-service/national_sim 0 -i
 
 %postun -p /sbin/ldconfig
 
 %postun tools -p /sbin/ldconfig
-
 %postun -n sms-plugin -p /sbin/ldconfig
-
 %postun -n mms-plugin -p /sbin/ldconfig
 
 %files
@@ -281,21 +310,12 @@ vconftool set -t int db/msg/recv_mms 0 -u 0
 %{_libdir}/pkgconfig/msg-service.pc
 %{_includedir}/msg-service/*
 
-
 %files tools
 %defattr(-,root,root,-)
 %{_bindir}/msg-helper
-%{_bindir}/msg-test-app
 %{_bindir}/msg-server
 %{_datadir}/media/Sherbet.wav
 %attr(0644,root,root)/usr/share/msg-service/plugin.cfg
-%attr(0644,root,root)/opt/etc/msg-service/Temp0_2.txt
-%attr(0644,root,root)/opt/etc/msg-service/Temp1_0.txt
-%attr(0644,root,root)/opt/etc/msg-service/audio.amr
-%attr(0644,root,root)/opt/etc/msg-service/P091120_104633.jpg
-%attr(0644,root,root)/opt/etc/msg-service/A.smi
-%attr(0644,root,root)/opt/etc/msg-service/V091120_104905.3gp
-%attr(0644,root,root)/opt/etc/msg-service/alert_on_call.mp3
 
 %files -n sms-plugin
 %defattr(-,root,root,-)
@@ -305,3 +325,119 @@ vconftool set -t int db/msg/recv_mms 0 -u 0
 %defattr(-,root,root,-)
 %{_libdir}/libmsg_mms_plugin.so
 %{_libdir}/libmsg_mms_language_pack.so
+
+%changelog
+* Wed Aug 8 2012 KeeBum Kim <keebum.kim@samsung.com>
+- Apply New TAPI.
+- Modify transaction data size of sos recipient list.
+
+* Tue Aug 7 2012 KeeBum Kim <keebum.kim@samsung.com>
+- Fix contact sync defect.
+- New MessageFW API.
+
+* Fri Jul 27 2012 KeeBum Kim <keebum.kim@samsung.com>
+- Change devman_haptic.h to devman_managed.h.
+- Modify to set MSG_SERVER_READY before sim status check.
+- Fix bug in sim message save related operations.
+- Limit sim related APIs not to work on sim not available status.
+- Modify indicator icon image path & related.
+
+* Tue Jul 17 2012 KeeBum Kim <keebum.kim@samsung.com>
+- Modify MAX_SEGMENT_NUM to 15.
+- Modify MMplayer related to support interrupted event.
+- Fix bug in storage change callback which could cause on submit request.
+
+* Fri Jun 29 2012 Sangkoo Kim <sangkoo.kim@samsung.com>
+- Modify vconf key path for sos sending option.
+
+* Mon Jun 18 2012 Seunghwan Lee <sh.cat.lee@samsung.com>
+- Storage change callback for scheduled message
+- code chage to support glib2-2.32
+- Apply Backup && Restore of Mms Type
+
+* Fri Jun 15 2012 Sangkoo Kim <sangkoo.kim@samsung.com>
+- Update display time for scheduled message when it is sent.
+
+* Thu Jun 14 2012 Seunghwan Lee <sh.cat.lee@samsung.com>
+- Comment the test app in CMakefile.
+- Modify MMS BG color of vconf value.
+- Bug fixed wrong query in MsgStoCheckReadReportIsSent
+- Add '-i' option for vconf keys of memory type
+- Add smsc vconf keys(default value).
+- To avoid msg incoming sound and notification on SOS
+
+* Fri Jun 8 2012 Sangkoo Kim <sangkoo.kim@samsung.com>
+- Add '-i' option for vconf keys of memory type.
+- Add smsc vconf keys(default value).
+- To avoid msg incoming sound and notification on SOS state.
+- Change BGcolor to black && font colore to white.
+
+* Wed May 31 2012 Keebum Kim <keebum.kim@samsung.com>
+- Apply Mdm policy.
+- SOS message.
+- Fix horizontality development problem.
+- Remove vconf key for new message count. (db/badge/com.samsung.message)
+- Change vconf key path of "mms_send/msg_class" to private.
+
+* Thu May 24 2012 Keebum Kim <keebum.kim@samsung.com>
+- Add new MAPI.
+
+* Fri May 18 2012 Sangkoo Kim <sangkoo.kim@samsung.com>
+- Modify to support new DRM service.
+- Rename private vconf keys.
+- Modify .postinst and .spec file to pre-install used vconf keys.
+- Remove compile warnings.
+- Fix bug in manual retrieve operation.
+
+* Fri May 11 2012 Jaeyun Jeong <jyjeong@samsung.com>
+- Fix DB conflict which cause db lock.
+- Fix bug in Find My Mobile function.
+- Add '*' and '#' symbol as valid number.
+
+* Wed May 9 2012 Keebum Kim <keebum.kim@samsung.com>
+- Change mobile tracker related vconf key define values.
+- Apply MDM policy for allowing text messaging.
+- Fix bug for getting thumbnail path.
+- Enable functionality of scheduled message.
+- Change alarm setting of scheduled message from volatile type to non-volatile.
+- Fix error in search query.
+
+* Thu May 3 2012 Keebum Kim <keebum.kim@samsung.com>
+- Change some thread list related APIs to support DB change.
+- DB change to support multiple recipient.
+
+* Thu Apr 19 2012 Keebum Kim <keebum.kim@samsung.com>
+- Modify to manage contact sync time by vconf.
+- Use g_idle_add() routine for updating unread message count(vconf values).
+- apply try{}catch{} code for handling unexpected exception to avoid thread terminating.
+- Fix bug for allocated size of replacing string.
+- Resolve search problem for special characters.
+- add xmlFree.
+
+* Tue Apr 10 2012 Keebum Kim <keebum.kim@samsung.com>
+- Remove unused vconf keys.
+- Initialize SMSC selected_index.
+- Remove systemd related.
+
+* Thu Apr 05 2012 Jaeyun Jeong <jyjeong@samsung.com>
+- Add notification property(NOTIFICATION_PROP_DISPLAY_ONLY_SIMMODE)
+- Fix S1-2397/2417/2418/2419.
+- Remove sent status callback check during submit request.
+- Modify offset and limit operation on search.
+- Remove invalid folder and file.
+- Change browser launching API from aul to service-capi.
+- Remove unused file.
+- Invalid type checking is fixed.
+
+* Fri Mar 16 2012 Jaeyun Jeong <jyjeong@samsung.com>
+- Add #include <sys/stat.h> to support chmod related defines.
+- Fix DRM content issue(unregistered mo content)
+
+* Wed Mar 14 2012 Jaeyun Jeong <jyjeong@samsung.com>
+- Modify plugin configuration file location for FOTA.
+- Remove the db query which create sample data.
+
+* Wed Feb 29 2012 Jaeyun Jeong <jyjeong@samsung.com>
+- Update msg-service.spec for OBS.
+- Fix TC execute failure.
+- Fix S1-1419(Removed mms raw file issue after rebooting)
index d121f6c..f8c8eca 100755 (executable)
@@ -20,6 +20,7 @@ SET(MMS-LANGUAGE-PACK-SRCS
 )
 
 INCLUDE_DIRECTORIES(
+    ${CMAKE_SOURCE_DIR}/include/mapi
        ${CMAKE_SOURCE_DIR}/include/common
        ${CMAKE_SOURCE_DIR}/include/utils
        ${CMAKE_CURRENT_SOURCE_DIR}/include
index 936c096..1a34a55 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include "MsgDebug.h"
 #include "MmsPluginWmLngPack.h"
@@ -358,7 +358,7 @@ MCHAR* __WmLngSwapPCode(MCHAR *mszOutput, MCHAR *mszInput, int length)
                mszOutput[i] = __WmLngSwapShort(mszInput[i]);
        }
 
-       mszOutput[i] = NULL;
+       mszOutput[i] = '\0';
 
        return mszOutput;
 }
@@ -402,7 +402,7 @@ bool WmConvert2PCode(MCHAR *pmszOutText, int outBufSize, char *szInText)
        byteCount = strlen((char*) szInText);
 
        if (byteCount == 0)
-               pmszOutText[0] = NULL;
+               pmszOutText[0] = '\0';
 
        if((WmConvertUTF2PCode(pmszOutText, outBufSize,(UCHAR*)szInText, byteCount) == true)) {
                return true;
@@ -554,7 +554,7 @@ bool WmConvertLatin2Code2PCode(MCHAR *pmszOutText, int outBufSize, char *szInTex
                        pmszOutText[i] = (MCHAR)(UCHAR)szInText[i];
        }
        /* Latin2 -> UNICODE */
-       pmszOutText[strLen] = NULL;
+       pmszOutText[strLen] = '\0';
 
        return true;
 }
@@ -595,7 +595,7 @@ bool WmConvertLatin3Code2PCode(MCHAR *pmszOutText, int outBufSize, char *szInTex
                        pmszOutText[i] = (MCHAR)(UCHAR)szInText[i];
        }
        /* Latin3 -> UNICODE */
-       pmszOutText[strLen] = NULL;
+       pmszOutText[strLen] = '\0';
 
        return true;
 }
@@ -635,7 +635,7 @@ bool WmConvertLatin4Code2PCode(MCHAR *pmszOutText, int outBufSize, char *szInTex
                        pmszOutText[i] = (MCHAR)(UCHAR)szInText[i];
        }
        /* Latin4 -> UNICODE */
-       pmszOutText[strLen] = NULL;
+       pmszOutText[strLen] = '\0';
 
        return true;
 }
@@ -675,7 +675,7 @@ bool WmConvertLatin8Code2PCode(MCHAR *pmszOutText, int outBufSize, char *szInTex
                        pmszOutText[i] = (MCHAR)(UCHAR)szInText[i];
        }
        /* Latin8 -> UNICODE */
-       pmszOutText[strLen] = NULL;
+       pmszOutText[strLen] = '\0';
 
        return true;
 }
@@ -716,7 +716,7 @@ bool WmConvertWin1251Code2PCode(MCHAR *pmszOutText, int outBufSize, char *szInTe
                        pmszOutText[i] = (MCHAR)(UCHAR)szInText[i];
        }
        /* Win1251 -> UNICODE */
-       pmszOutText[strLen] = NULL;
+       pmszOutText[strLen] = '\0';
 
        return true;
 }
@@ -757,7 +757,7 @@ bool WmConvertKoi8rCode2PCode(MCHAR *pmszOutText, int outBufSize, char *szInText
                        pmszOutText[i] = (MCHAR)(UCHAR)szInText[i];
        }
        /* bInKoi8-rTable -> UNICODE */
-       pmszOutText[strLen] = NULL;
+       pmszOutText[strLen] = '\0';
 
        return true;
 }
@@ -798,7 +798,7 @@ bool WmConvertKoi8uCode2PCode(MCHAR *pmszOutText, int outBufSize, char *szInText
                        pmszOutText[i] = (MCHAR)(UCHAR)szInText[i];
        }
        /* bInKoi8uTable -> UNICODE */
-       pmszOutText[strLen] = NULL;
+       pmszOutText[strLen] = '\0';
 
        return true;
 }
@@ -839,7 +839,7 @@ bool WmConvertLatin15Code2PCode(MCHAR *pmszOutText, int outBufSize, char *szInTe
                        pmszOutText[i] = (MCHAR)(UCHAR)szInText[i];
        }
        /* Latin15 -> UNICODE */
-       pmszOutText[strLen] = NULL;
+       pmszOutText[strLen] = '\0';
 
        return true;
 }
@@ -882,7 +882,7 @@ bool WmConvertLatin5Code2PCode(MCHAR *pmszOutText, int outBufSize, char *szInTex
                        pmszOutText[i] = (MCHAR)(UCHAR)szInText[i];
        }
        /* Latin5 -> UNICODE */
-       pmszOutText[strLen] = NULL;
+       pmszOutText[strLen] = '\0';
 
        return true;
 }
@@ -1003,7 +1003,7 @@ bool WmConvertLatinCode2PCode(MCHAR *pmszOutText, int outBufSize, char *szInText
 
        /* Latin1 -> UNICODE */
        __WmLngConvertLatin12Unicode(pmszOutText,(UCHAR*)szInText,strLen);
-       pmszOutText[strLen] = NULL;
+       pmszOutText[strLen] = '\0';
 
        return true;
 }
@@ -1024,7 +1024,7 @@ bool WmConvertLatinCode2PCodeN(MCHAR *pmszOutText, int outBufSize, char *szInTex
 
        if (charCount == 0) {
                MSG_DEBUG("WmConvert2PCodeN: charCount is0\n");
-               pmszOutText[charCount] = NULL;
+               pmszOutText[charCount] = '\0';
        }
 
        if (__WmConvertCodeBufferSizeCheck((char*)pmszOutText, outBufSize, charCount) == false) {
@@ -1037,9 +1037,9 @@ bool WmConvertLatinCode2PCodeN(MCHAR *pmszOutText, int outBufSize, char *szInTex
 
        strLen = strlen((char *)szInText);
        if(strLen < charCount) {
-               pmszOutText[strLen] = NULL;
+               pmszOutText[strLen] = '\0';
        } else {
-               pmszOutText[charCount] = NULL;
+               pmszOutText[charCount] = '\0';
        }
 
        return true;
index 1fcb907..3fc2214 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include "MsgDebug.h"
 #include "MmsPluginWmLngPack.h"
index cade759..315cee3 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include "MsgDebug.h"
 #include "MmsPluginWmLngPack.h"
@@ -60,7 +60,7 @@ bool WmConvertUTF2PCode (MCHAR *pmszOutText, int outBufSize, UCHAR *szInText, in
 {
        int length;
        if (byteCount == 0) {
-               pmszOutText[0] = NULL;
+               pmszOutText[0] = '\0';
                return true;
        }
 
index b209434..1fd9d14 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include "MsgDebug.h"
 #include "MmsPluginWmLngPack.h"
index e8f1e20..0631bdd 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include "MmsPluginAvCodec.h"
 #include <string.h>
index bbfaf5a..c55a5c1 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include "MmsPluginCodec.h"
 #include "MsgMmsTypes.h"
index 02ed598..d45e5b1 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include "MmsPluginConnManWrapper.h"
 
@@ -363,7 +363,7 @@ void MmsPluginCmAgent::processCBdatas(net_event_info_t *event_cb, void *user_dat
                MSG_DEBUG("Received NET_EVENT_NET_STATE_IND\n");
                break;
        default :
-               MSG_DEBUG("Error! Unknown Event\n\n");
+               MSG_DEBUG("Error! Unknown Event = %d\n\n", event_cb->Event);
                break;
        }
 
index b747d90..b372ecf 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include <stdlib.h>
 #include <ctype.h>
@@ -452,7 +452,7 @@ char *_MsgDecodeText(char *pOri)
                     && ((pDecEnd = strstr(pDecQ2 + 1, MSG_STR_DEC_END))!= NULL)) {     //"=?"
                        bEncoding = true;
 
-                       /* fixme: charset problem
+                       /* charset problem
                         * pDecStart ~ pDecQ : charSet & MSG_CHARSET_USC2 ~ MSG_CHARSET_UTF8 & LATIN
                         */
 
index 395bb35..c27fd33 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include <stdio.h>
 #include "MmsPluginMIME.h"
@@ -338,7 +338,7 @@ const char *MmsDebugGetMmsReportAllowed(MmsReportAllowed reportAllowed)
 }
 
 
-const char *MmsDebugGetMmsReadStatus(MSG_READ_REPORT_STATUS_T readStatus)
+const char *MmsDebugGetMmsReadStatus(msg_read_report_status_t readStatus)
 {
        _MSG_READ_REPORT_STATUS_E readReport = (_MSG_READ_REPORT_STATUS_E)readStatus;
 
@@ -472,7 +472,7 @@ const char *MmsDebugGetRetrieveStatus(MmsRetrieveStatus retrieveStatus)
 }
 
 
-const char *MmsDebugGetMsgStatus(MSG_DELIVERY_REPORT_STATUS_T msgStatus)
+const char *MmsDebugGetMsgStatus(msg_delivery_report_status_t msgStatus)
 {
        switch (msgStatus) {
        case MSG_DELIVERY_REPORT_ERROR:
index 55e95d2..5a2700d 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include<stdio.h>
 #include <string.h>
@@ -121,8 +121,8 @@ MmsHeader   mmsHeader =
 
        /* there is no right default value */
 
-       (MSG_DELIVERY_REPORT_STATUS_T)MSG_DELIVERY_REPORT_NONE,         //MmsMsgStatus                  iMsgStatus;
-       (MSG_READ_REPORT_STATUS_T)MSG_READ_REPORT_NONE,         //MmsReadStatus                 readStatus;
+       (msg_delivery_report_status_t)MSG_DELIVERY_REPORT_NONE,         //MmsMsgStatus                  iMsgStatus;
+       (msg_read_report_status_t)MSG_READ_REPORT_NONE,         //MmsReadStatus                 readStatus;
 
        /* MMS v1.1 ReplyCharge */
        {
@@ -222,8 +222,8 @@ void _MmsInitHeader()
        memset(mmsHeader.szContentLocation, 0, MMS_LOCATION_LEN + 1);
 
 
-       mmsHeader.msgStatus = (MSG_DELIVERY_REPORT_STATUS_T)MSG_DELIVERY_REPORT_NONE;
-       mmsHeader.readStatus = (MSG_READ_REPORT_STATUS_T)MSG_READ_REPORT_NONE;
+       mmsHeader.msgStatus = (msg_delivery_report_status_t)MSG_DELIVERY_REPORT_NONE;
+       mmsHeader.readStatus = (msg_read_report_status_t)MSG_READ_REPORT_NONE;
 
        mmsHeader.replyCharge.chargeType = (MmsReplyChargeType)MMS_REPLY_NONE;
        mmsHeader.replyCharge.chargeSize = 0;
@@ -753,7 +753,7 @@ bool MmsBinaryDecodeMsgHeader(FILE *pFile, int totalLength)
                                goto __CATCH;
                        }
 
-                       mmsHeader.msgStatus =  (MSG_DELIVERY_REPORT_STATUS_T)_MmsGetBinaryType(MmsCodeMsgStatus, (UINT16)(oneByte & 0x7F));
+                       mmsHeader.msgStatus =  (msg_delivery_report_status_t)_MmsGetBinaryType(MmsCodeMsgStatus, (UINT16)(oneByte & 0x7F));
                        MSG_DEBUG("MmsBinaryDecodeMsgHeader: msg status=%s \n", MmsDebugGetMsgStatus(mmsHeader.msgStatus)) ;
                        break;
 
@@ -848,7 +848,7 @@ bool MmsBinaryDecodeMsgHeader(FILE *pFile, int totalLength)
                                goto __CATCH;
                        }
 
-                       mmsHeader.readStatus =  (MSG_READ_REPORT_STATUS_T)_MmsGetBinaryType(MmsCodeReadStatus, (UINT16)(oneByte & 0x7F));
+                       mmsHeader.readStatus =  (msg_read_report_status_t)_MmsGetBinaryType(MmsCodeReadStatus, (UINT16)(oneByte & 0x7F));
                        MSG_DEBUG("MmsBinaryDecodeMsgHeader: read status=%s\n", MmsDebugGetMmsReadStatus(mmsHeader.readStatus));
                        break;
 
@@ -925,11 +925,6 @@ bool MmsBinaryDecodeMsgHeader(FILE *pFile, int totalLength)
                         * MMS_CODE_PREVIOUSLYSENTBY shall be a pair with MMS_CODE_PREVIOUSLYSENTDATE
                         */
 
-                       /*
-                        * fixme: There is no proper field to store this information.
-                        * Just increase pointer now.
-                        */
-
                        if (__MmsDecodeValueLength(pFile, &valueLength, totalLength) <= 0) {
                                MSG_DEBUG("MmsBinaryDecodeMsgHeader : 1. invalid MMS_CODE_PREVIOUSLYSENTBY \n");
                                goto __CATCH;
@@ -954,11 +949,6 @@ bool MmsBinaryDecodeMsgHeader(FILE *pFile, int totalLength)
                         * MMS_CODE_PREVIOUSLYSENTDATE shall be a pair with MMS_CODE_PREVIOUSLYSENTBY
                         */
 
-                       /*
-                        * fixme: There is no proper field to store this information.
-                        * Just increase pointer now.
-                        */
-
                        if (__MmsDecodeValueLength(pFile, &valueLength, totalLength) <= 0) {
                                MSG_DEBUG("MmsBinaryDecodeMsgHeader : 1. invalid MMS_CODE_PREVIOUSLYSENTDATE \n");
                                goto __CATCH;
@@ -1067,8 +1057,6 @@ bool MmsBinaryDecodeContentType(FILE *pFile, char *szFilePath, int totalLength)
 
 __CATCH:
 
-       /* fixme: Delete multipart using MmsDeleteMsg() */
-
        return false;
 }
 #endif
@@ -1160,8 +1148,6 @@ __RETURN:
 
 __CATCH:
 
-       /* fixme: Delete multipart using MmsDeleteMsg() */
-
        if (pMultipart) {
                if (pMultipart->pBody) {
                        if (pMultipart->pBody->body.pText) {
@@ -2668,7 +2654,7 @@ bool MmsBinaryDecodeDRMContent(FILE *pFile, char *szFilePath, MsgType *pMsgType,
        isFileCreated = true;
        MSG_DEBUG("MmsDrm2GetConvertState() [%d]", MmsDrm2GetConvertState());
 
-       if (pMsgType->type == MIME_APPLICATION_VND_OMA_DRM_MESSAGE && (MmsDrm2GetConvertState()!=MMS_DRM2_CONVERT_FINISH)) {
+       if (pMsgType->type == MIME_APPLICATION_VND_OMA_DRM_MESSAGE && (MmsDrm2GetConvertState() != MMS_DRM2_CONVERT_FINISH)) {
                MmsDrm2SetConvertState(MMS_DRM2_CONVERT_REQUIRED);
        } else {
                if (MsgDRM2GetDRMInfo(szTempFilePath, pMsgType) == false) {
@@ -3015,8 +3001,7 @@ bool MmsDrm2ConvertMsgBody(char *szOriginFilePath)
                                        MSG_DEBUG("MsgGetFileSize error");
                                        goto __CATCH;
                                }
-                               MSG_DEBUG("MmsDrm2ConvertMsgBody: end data part convert(converted data len = %d)\n", nSize);
-                               // <-- invoking drm agent api, converting data part end
+                               MSG_DEBUG("end data part convert(converted data len = %d)\n", nSize);
 
                                // move file pointer to the head of multipart
                                if (MsgFseek(pFile, curOffset, SEEK_SET) < 0) {
@@ -4345,8 +4330,6 @@ static bool __MmsBinaryDecodeEncodedString(FILE *pFile, char *szBuff, int bufLen
                        strncpy(szBuff, pData, bufLen - 1);
                }
 
-
-               /* fixme: charset transformation */
                switch (charSet) {
                case MSG_CHARSET_UTF16:
                case MSG_CHARSET_USC2:
@@ -4635,8 +4618,6 @@ MsgHeaderAddress *__MmsDecodeEncodedAddress(FILE *pFile, int totalLength)
                        }
                }
 
-               /* fixme: charset transformation */
-
                break;
        }
 
@@ -4825,7 +4806,7 @@ bool __MmsTextDecodeMsgHeader(FILE *pFile)
    ==========================================================*/
 
 //  to get message body this function should be modified from message raw file.
-bool _MmsReadMsgBody(MSG_MESSAGE_ID_T msgID, bool bSavePartsAsTempFiles, bool bRetrieved, char *retrievedPath)
+bool _MmsReadMsgBody(msg_message_id_t msgID, bool bSavePartsAsTempFiles, bool bRetrieved, char *retrievedPath)
 {
        FILE *pFile     = NULL;
        MmsMsg *pMsg = NULL;
@@ -6159,7 +6140,7 @@ bool MsgResolveNestedMultipart(MsgType *pPartType, MsgBody *pPartBody)
        case MIME_APPLICATION_VND_WAP_MULTIPART_ALTERNATIVE:
        case MIME_MULTIPART_ALTERNATIVE:
 
-               /* fixme:
+               /*
                 * Policy: multipart/alternative
                 * multipart/alternative message has only several parts of media.
                 * You should choose one of them and make the alternative part
@@ -7655,7 +7636,7 @@ bool MmsAddrUtilRemovePlmnString(char *pszAddr)
 
        strLen = strlen(pszAddr);
 
-       pszAddrCopy = (char*)malloc(strLen + 1);
+       pszAddrCopy = (char*)calloc(1,strLen + 1);
        if (!pszAddrCopy) {
                MSG_DEBUG("MmsAddrUtilRemovePlmnString: pszAddrCopy is NULL, mem alloc failed\n");
                return false;
@@ -8495,7 +8476,7 @@ bool MsgGetFileNameWithoutExtension (char *szOutputName, char *szName)
        return true;
 }
 
-int MmsGetMediaPartCount(MSG_MESSAGE_ID_T msgId)
+int MmsGetMediaPartCount(msg_message_id_t msgId)
 {
        MmsMsg *pMsg;
 
index 0f13934..ac0630a 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include <string.h>
 #include <drm_client_types.h>
index 2bf0a46..ca26649 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include <time.h>
 #include <stdlib.h>
@@ -46,10 +46,10 @@ static      char *gpMmsEncodeBuf2 = NULL;
 
 bool _MmsBinaryEncodeSendReqHdr(FILE *pFile, MmsMsg *pMsg);
 bool _MmsBinaryEncodeAckIndHdr(FILE *pFile, char *pTrID, bool bReportAllowed);
-bool _MmsBinaryEncodeNotiRespIndHdr(FILE* pFile, char *pTrID, MSG_DELIVERY_REPORT_STATUS_T iStatus, bool bReportAllowed);
+bool _MmsBinaryEncodeNotiRespIndHdr(FILE* pFile, char *pTrID, msg_delivery_report_status_t iStatus, bool bReportAllowed);
 bool _MmsBinaryEncodeForwardReqHdr(FILE *pFile, char *szContentLocation, char *szForwardTo, char *szForwardCc, char *szForwardBcc);
-bool _MmsBinaryEncodeReadReport10Hdr(FILE *pFile, MmsMsg *pMsg, MSG_READ_REPORT_STATUS_T mmsReadStatus);
-bool _MmsBinaryEncodeReadReport11Hdr(FILE *pFile, MmsMsg *pMsg, MSG_READ_REPORT_STATUS_T mmsReadStatus);
+bool _MmsBinaryEncodeReadReport10Hdr(FILE *pFile, MmsMsg *pMsg, msg_read_report_status_t mmsReadStatus);
+bool _MmsBinaryEncodeReadReport11Hdr(FILE *pFile, MmsMsg *pMsg, msg_read_report_status_t mmsReadStatus);
 
 static         bool __MmsEncodeSendReq(FILE *pFile, MmsMsg *pMsg, bool bIncludeSendReqHeader);
 static int MmsBinaryEncodeUintvarLen(UINT32 integer);
@@ -387,7 +387,7 @@ __CATCH:
 
 
 
-bool _MmsBinaryEncodeNotiRespIndHdr(FILE *pFile, char *szTrID, MSG_DELIVERY_REPORT_STATUS_T iStatus, bool bReportAllowed)
+bool _MmsBinaryEncodeNotiRespIndHdr(FILE *pFile, char *szTrID, msg_delivery_report_status_t iStatus, bool bReportAllowed)
 {
        int length = 0;
        UINT8 fieldCode = 0xff;
@@ -504,7 +504,7 @@ __CATCH:
 
 
 
-bool _MmsEncodeNotiRespInd(FILE *pFile, char *pTrID, MSG_DELIVERY_REPORT_STATUS_T iStatus, bool bReportAllowed)
+bool _MmsEncodeNotiRespInd(FILE *pFile, char *pTrID, msg_delivery_report_status_t iStatus, bool bReportAllowed)
 {
        _MmsRegisterEncodeBuffer2(gszMmsEncodeBuf2, MSG_MMS_ENCODE_BUFFER_MAX);
 
@@ -526,7 +526,7 @@ __CATCH:
 
 
 /* Functions for Acknowledge.ind & NotifyResp.ind  (END) ------------------------ */
-bool _MmsEncodeReadReport10(FILE *pFile, MmsMsg *pMsg, MSG_READ_REPORT_STATUS_T mmsReadStatus)
+bool _MmsEncodeReadReport10(FILE *pFile, MmsMsg *pMsg, msg_read_report_status_t mmsReadStatus)
 {
        char *pText = NULL;
        MsgMultipart *pPart = NULL;
@@ -654,7 +654,7 @@ __CATCH:
 }
 
 
-bool _MmsEncodeReadReport11(FILE *pFile, MmsMsg *pMsg, MSG_READ_REPORT_STATUS_T mmsReadStatus)
+bool _MmsEncodeReadReport11(FILE *pFile, MmsMsg *pMsg, msg_read_report_status_t mmsReadStatus)
 {
        _MmsRegisterEncodeBuffer(gszMmsEncodeBuf, MSG_MMS_ENCODE_BUFFER_MAX);
 
@@ -907,7 +907,6 @@ bool _MmsBinaryEncodeSendReqHdr(FILE *pFile, MmsMsg *pMsg)
                        goto __CATCH;
                }
 
-               /** fixme: Reply-charging-deadline */
                if (pMsg->mmsAttrib.replyCharge.deadLine.time > 0) {
                        if (__MmsBinaryEncodeTime(pFile, MMS_CODE_REPLYCHARGINGDEADLINE, pMsg->mmsAttrib.replyCharge.deadLine) == false) {
                                MSG_DEBUG("_MmsBinaryEncodeSendReqHdr: replyCharging __MmsBinaryEncodeTime fail\n");
@@ -915,7 +914,6 @@ bool _MmsBinaryEncodeSendReqHdr(FILE *pFile, MmsMsg *pMsg)
                        }
                }
 
-               /** fixme: Reply-charging-size */
                if (pMsg->mmsAttrib.replyCharge.chargeSize > 0) {
                        length = MmsBinaryEncodeIntegerLen(pMsg->mmsAttrib.replyCharge.chargeSize);
 
@@ -935,7 +933,6 @@ bool _MmsBinaryEncodeSendReqHdr(FILE *pFile, MmsMsg *pMsg)
                        }
                }
 
-               /** fixme: Reply-charging-ID  ----> used only when reply message  */
                if (pMsg->mmsAttrib.replyCharge.szChargeID[0]) {
                        length = MmsBinaryEncodeTextStringLen((UINT8*)pMsg->mmsAttrib.replyCharge.szChargeID);
                        if (length == -1) {
@@ -1019,8 +1016,7 @@ bool MmsBinaryEncodeSendReqHdrContTypeFildCode(FILE *pFile, int msgID)
        return ret;
 }
 
-
-bool _MmsBinaryEncodeReadReport10Hdr(FILE *pFile, MmsMsg *pMsg, MSG_READ_REPORT_STATUS_T mmsReadStatus)
+bool _MmsBinaryEncodeReadReport10Hdr(FILE *pFile, MmsMsg *pMsg, msg_read_report_status_t mmsReadStatus)
 {
        int length      = 0;
        char *szTo      = NULL;
@@ -1169,10 +1165,6 @@ bool _MmsBinaryEncodeReadReport10Hdr(FILE *pFile, MmsMsg *pMsg, MSG_READ_REPORT_
                goto __CATCH;
        }
 
-       /* fixme: msgContentType */
-       /* fixme: msgHeader */
-       /* fixme: msgBody */
-
        /* flush remained data on encoding file */
        if (MsgWriteDataFromEncodeBuffer(pFile, gpMmsEncodeBuf, &gCurMmsEncodeBuffPos,
                                                                                gMmsEncodeMaxLen, &gMmsEncodeCurOffset) == false) {
@@ -1193,7 +1185,7 @@ __CATCH:
 
 
 
-bool _MmsBinaryEncodeReadReport11Hdr(FILE *pFile, MmsMsg *pMsg, MSG_READ_REPORT_STATUS_T mmsReadStatus)
+bool _MmsBinaryEncodeReadReport11Hdr(FILE *pFile, MmsMsg *pMsg, msg_read_report_status_t mmsReadStatus)
 {
        UINT8 fieldCode = 0xff;
        UINT8 fieldValue = 0xff;
@@ -2881,7 +2873,7 @@ static bool MmsBinaryEncodeEncodedString(FILE *pFile, UINT8 *source, int length)
                goto __CATCH;
        }
 
-       /* fixme: Write charset on buffer -> integer value not long-integer */
+       /* Write charset on buffer -> integer value not long-integer */
        if (MmsBinaryEncodeInteger(pFile, charset, charLeng) == false) {
                MSG_DEBUG("MmsBinaryEncodeEncodedString : MmsBinaryEncodeInteger fail.\n");
                goto __CATCH;
index 881a9aa..120ae45 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include<stdio.h>
 #include<stdlib.h>
@@ -102,7 +102,7 @@ void MmsPluginEventHandler::handleMmsError(mmsTranQEntity *pRequest)
 {
        MSG_BEGIN();
 
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        MSG_MESSAGE_INFO_S msgInfo = {};
        MMS_RECV_DATA_S recvData = {{0}, };
index 5762a63..791bf7a 100755 (executable)
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include "MmsPluginHttp.h"
 #include "MmsPluginUserAgent.h"
 #include "stdlib.h"
 #include <time.h>
 #include "MmsPluginConnManWrapper.h"
+#include <curl/curl.h>
 
+static bool __httpGetHeaderField(MMS_HTTP_HEADER_FIELD_T httpHeaderItem, char *szHeaderBuffer);
+static void __httpGetHost(char *szHost, int nBufferLen);
+static void __httpAllocHeaderInfo(curl_slist **responseHeaders, char *szUrl, int ulContentLen);
 
+static MMS_NET_ERROR_T __httpReceiveData(void *ptr, size_t size, size_t nmemb, void *userdata);
+static size_t  __httpGetTransactionCB(void *ptr, size_t size, size_t nmemb, void *userdata);
+static size_t  __httpPostTransactionCB(void *ptr, size_t size, size_t nmemb, void *userdata);
 
-void httpGetHostFromUrl(char *pUrl, char *pHost)
+static int __httpCmdInitSession(MMS_PLUGIN_HTTP_DATA_S *httpConfig);
+static int __httpCmdPostTransaction(MMS_PLUGIN_HTTP_DATA_S *httpConfig);
+static int __httpCmdGetTransaction(MMS_PLUGIN_HTTP_DATA_S *httpConfig);
+
+static void __http_print_profile(CURL *curl);
+
+/*==================================================================================================
+                                     FUNCTION IMPLEMENTATION
+==================================================================================================*/
+static void __http_print_profile(CURL *curl)
 {
-       int hostLen = 0;
-       int tailLen = 0;
-       char *tail = NULL;
-
-       if (strstr(pUrl, "HTTP://") == NULL) {
-               tail = strstr(pUrl, "/");
-               if (NULL == tail)
-                       tailLen = 0;
-               else
-                       tailLen = strlen(tail);
-
-               hostLen = strlen(pUrl) - tailLen;
-               memcpy(pHost, pUrl, hostLen);
-               pHost[hostLen] = '\0';
-       } else {
-               tail = strstr(&pUrl[7], "/");
-               if (NULL == tail)
-                       tailLen = 0;
-               else
-                       tailLen = strlen(tail);
-
-               hostLen = strlen(pUrl) - tailLen - 7;
-               memcpy(pHost, &pUrl[7], hostLen);
-               pHost[hostLen] = '\0';
-       }
+       double speed_upload, speed_download, total_time;
+       double size_up, size_down;
+       double content_length;
+
+       char *content_type = NULL;
+       char *ip = NULL;
+       char *url = NULL;
+
+       long port;
+       long size;
+
+       MSG_DEBUG("**************************************************************************************************");
+
+       //time
+       curl_easy_getinfo(curl, CURLINFO_TOTAL_TIME, &total_time);
+       MSG_DEBUG("profile http Time: total %.3f seconds", total_time);
+
+       //url
+       curl_easy_getinfo(curl, CURLINFO_EFFECTIVE_URL, &url);
+       MSG_DEBUG("profile http Url: %s", url);
+
+       //size
+       curl_easy_getinfo(curl, CURLINFO_SIZE_UPLOAD, &size_up);
+       MSG_DEBUG("profile http Size: upload %.3f bytes", size_up);
+
+       curl_easy_getinfo(curl, CURLINFO_SIZE_DOWNLOAD, &size_down);
+       MSG_DEBUG("profile http Size: download %.3f bytes", size_down);
+
+       curl_easy_getinfo(curl, CURLINFO_HEADER_SIZE, &size);
+       MSG_DEBUG("profile http Size: header %ld bytes", size);
+
+       curl_easy_getinfo(curl, CURLINFO_REQUEST_SIZE, &size);
+       MSG_DEBUG("profile http Size: request %ld bytes", size);
+
+       //speed
+       curl_easy_getinfo(curl, CURLINFO_SPEED_UPLOAD, &speed_upload);
+       MSG_DEBUG("profile http Speed: upload %.3f bytes/sec", speed_upload);
+
+       curl_easy_getinfo(curl, CURLINFO_SPEED_DOWNLOAD, &speed_download);
+       MSG_DEBUG("profile http Speed: download %.3f bytes/sec", speed_download);
+
+       //content
+       curl_easy_getinfo(curl, CURLINFO_CONTENT_TYPE, &content_type);
+       MSG_DEBUG("profile http Content: type %s", content_type);
+
+       curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &content_length);
+       MSG_DEBUG("profile http Content: length download %.3f", content_length);
+
+       curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_UPLOAD, &content_length);
+       MSG_DEBUG("profile http Content: length upload %.3f", content_length);
+
+       //ip & port
+       curl_easy_getinfo(curl, CURLINFO_PRIMARY_IP, &ip);
+       MSG_DEBUG("profile http primary: ip %s", ip);
+
+       curl_easy_getinfo(curl, CURLINFO_PRIMARY_PORT, &port);
+       MSG_DEBUG("profile http primary: port %ld", port);
+
+       curl_easy_getinfo(curl, CURLINFO_LOCAL_IP, &ip);
+       MSG_DEBUG("profile http local: ip %s", ip);
+
+       curl_easy_getinfo(curl, CURLINFO_LOCAL_PORT, &port);
+       MSG_DEBUG("profile http local: port %ld", port);
+       MSG_DEBUG("**************************************************************************************************");
 }
 
-void  HttpHeaderInfo(curl_slist **responseHeaders, char *szUrl, int ulContentLen)
+static void __httpAllocHeaderInfo(curl_slist **responseHeaders, char *szUrl, int ulContentLen)
 {
        char szBuffer[1025] = {0, };
        char pcheader[HTTP_REQUEST_LEN] = {0, };
 
-       bool nResult = MsgMmsGetCustomHTTPHeader(MMS_HH_CONTENT_TYPE, szBuffer);
+
+       bool nResult = __httpGetHeaderField(MMS_HH_CONTENT_TYPE, szBuffer);
        if (nResult) {
                strcat(pcheader,"Content-Type: ");
                strcat(pcheader, szBuffer);
@@ -76,7 +132,7 @@ void  HttpHeaderInfo(curl_slist **responseHeaders, char *szUrl, int ulContentLen
 
        memset(szBuffer, 0, 1025);
        memset(pcheader, 0, HTTP_REQUEST_LEN);
-       nResult = MsgMmsGetCustomHTTPHeader(MMS_HH_HOST, szBuffer);
+       nResult = __httpGetHeaderField(MMS_HH_HOST, szBuffer);
        if (nResult) {
                strcat(pcheader, "HOST: ");
                strcat(pcheader, szBuffer);
@@ -86,7 +142,7 @@ void  HttpHeaderInfo(curl_slist **responseHeaders, char *szUrl, int ulContentLen
 
        memset(szBuffer, 0, 1025);
        memset(pcheader, 0, HTTP_REQUEST_LEN);
-       nResult = MsgMmsGetCustomHTTPHeader(MMS_HH_ACCEPT, szBuffer);
+       nResult = __httpGetHeaderField(MMS_HH_ACCEPT, szBuffer);
        if (nResult) {
                strcat(pcheader, "Accept: ");
                strcat(pcheader, szBuffer);
@@ -96,7 +152,7 @@ void  HttpHeaderInfo(curl_slist **responseHeaders, char *szUrl, int ulContentLen
 
        memset(szBuffer, 0, 1025);
        memset(pcheader, 0, HTTP_REQUEST_LEN);
-       nResult = MsgMmsGetCustomHTTPHeader(MMS_HH_ACCEPT_CHARSET, szBuffer);
+       nResult = __httpGetHeaderField(MMS_HH_ACCEPT_CHARSET, szBuffer);
        if (nResult) {
                strcat(pcheader, "Accept-Charset: ");
                strcat(pcheader, szBuffer);
@@ -106,7 +162,7 @@ void  HttpHeaderInfo(curl_slist **responseHeaders, char *szUrl, int ulContentLen
 
        memset(szBuffer, 0, 1025);
        memset(pcheader, 0, HTTP_REQUEST_LEN);
-       nResult = MsgMmsGetCustomHTTPHeader(MMS_HH_ACCEPT_LANGUAGE, szBuffer);
+       nResult = __httpGetHeaderField(MMS_HH_ACCEPT_LANGUAGE, szBuffer);
        if (nResult) {
                strcat(pcheader, "Accept-Language: ");
                strcat(pcheader, szBuffer);
@@ -116,7 +172,7 @@ void  HttpHeaderInfo(curl_slist **responseHeaders, char *szUrl, int ulContentLen
 
        memset(szBuffer, 0, 1025);
        memset(pcheader, 0, HTTP_REQUEST_LEN);
-       nResult = MsgMmsGetCustomHTTPHeader(MMS_HH_ACCEPT_ENCODING, szBuffer);
+       nResult = __httpGetHeaderField(MMS_HH_ACCEPT_ENCODING, szBuffer);
        if (nResult) {
                strcat(pcheader, "Accept-Encoding: ");
                strcat(pcheader, szBuffer);
@@ -126,7 +182,7 @@ void  HttpHeaderInfo(curl_slist **responseHeaders, char *szUrl, int ulContentLen
 
        memset(szBuffer, 0, 1025);
        memset(pcheader, 0, HTTP_REQUEST_LEN);
-       nResult = MsgMmsGetCustomHTTPHeader(MMS_HH_USER_AGENT, szBuffer);
+       nResult = __httpGetHeaderField(MMS_HH_USER_AGENT, szBuffer);
        if (nResult) {
                strcat(pcheader, "User-Agent: ");
                strcat(pcheader, szBuffer);
@@ -136,7 +192,7 @@ void  HttpHeaderInfo(curl_slist **responseHeaders, char *szUrl, int ulContentLen
 
        memset(szBuffer, 0, 1025);
        memset(pcheader, 0, HTTP_REQUEST_LEN);
-       nResult = MsgMmsGetCustomHTTPHeader(MMS_HH_WAP_PROFILE, szBuffer);
+       nResult = __httpGetHeaderField(MMS_HH_WAP_PROFILE, szBuffer);
        if (nResult) {
                strcat(pcheader, "X-wap-profile: ");
                strcat(pcheader, szBuffer);
@@ -145,7 +201,7 @@ void  HttpHeaderInfo(curl_slist **responseHeaders, char *szUrl, int ulContentLen
        }
 }
 
-bool MsgMmsGetCustomHTTPHeader(MMS_HTTP_HEADER_FIELD_T httpHeaderItem, char *szHeaderBuffer)
+static bool __httpGetHeaderField(MMS_HTTP_HEADER_FIELD_T httpHeaderItem, char *szHeaderBuffer)
 {
        bool result;
 
@@ -158,7 +214,7 @@ bool MsgMmsGetCustomHTTPHeader(MMS_HTTP_HEADER_FIELD_T httpHeaderItem, char *szH
                        break;
 
                case MMS_HH_HOST:
-                       MsgMmsGetHost(szHeaderBuffer, 1024);
+                       __httpGetHost(szHeaderBuffer, 1024);
                        if (strlen(szHeaderBuffer) > 0)
                                result = true;
                        else
@@ -218,7 +274,7 @@ bool MsgMmsGetCustomHTTPHeader(MMS_HTTP_HEADER_FIELD_T httpHeaderItem, char *szH
        return result;
 }
 
-void MsgMmsGetHost(char *szHost, int nBufferLen)
+static void __httpGetHost(char *szHost, int nBufferLen)
 {
        MmsPluginHttpAgent *pHttpAgent = MmsPluginHttpAgent::instance();
        MMS_PLUGIN_HTTP_DATA_S *httpConfigData = pHttpAgent->getHttpConfigData();
@@ -264,7 +320,7 @@ void MsgMmsGetHost(char *szHost, int nBufferLen)
 }
 
 
-MMS_NET_ERROR_T MmsHttpReadData(void *ptr, size_t size, size_t nmemb, void *userdata)
+static MMS_NET_ERROR_T __httpReceiveData(void *ptr, size_t size, size_t nmemb, void *userdata)
 {
        MMS_NET_ERROR_T httpRet = eMMS_UNKNOWN;
 
@@ -309,9 +365,9 @@ MMS_NET_ERROR_T MmsHttpReadData(void *ptr, size_t size, size_t nmemb, void *user
                        MSG_DEBUG(" Content Size is Zero");
 
                        if (pMmsPlgCd->final_content_buf != NULL) {
-                       free(pMmsPlgCd->final_content_buf );
+                               free(pMmsPlgCd->final_content_buf );
                                pMmsPlgCd->final_content_buf = NULL;
-                       }
+                       }
 
                        httpRet = eMMS_HTTP_EVENT_SENT_ACK_COMPLETED;
                } else if (pMmsPlgCd->final_content_buf != NULL && pMmsPlgCd->bufOffset != 0) {
@@ -329,25 +385,25 @@ MMS_NET_ERROR_T MmsHttpReadData(void *ptr, size_t size, size_t nmemb, void *user
 }
 
 
-size_t  MmsHttpPostTransactionCB(void *ptr, size_t size, size_t nmemb, void *userdata)
+static size_t  __httpPostTransactionCB(void *ptr, size_t size, size_t nmemb, void *userdata)
 {
        MSG_DEBUG(" ======  HTTP_EVENT_SENT ========");
        long length_received = size * nmemb;
-       MmsHttpReadData(ptr, size, nmemb, userdata);
+       __httpReceiveData(ptr, size, nmemb, userdata);
 
        return length_received;
 }
 
-size_t  MmsHttpGetTransactionCB(void *ptr, size_t size, size_t nmemb, void *userdata)
+static size_t  __httpGetTransactionCB(void *ptr, size_t size, size_t nmemb, void *userdata)
 {
        MSG_DEBUG(" ======  HTTP_EVENT_RECEIVED ========");
        long length_received = size * nmemb;
-       MmsHttpReadData(ptr, size, nmemb, userdata);
+       __httpReceiveData(ptr, size, nmemb, userdata);
 
        return length_received;
 }
 
-int httpCmdInitSession(MMS_PLUGIN_HTTP_DATA_S *httpConfig)
+static int __httpCmdInitSession(MMS_PLUGIN_HTTP_DATA_S *httpConfig)
 {
        MSG_DEBUG("HttpCmd Init Session");
 
@@ -375,7 +431,7 @@ int httpCmdInitSession(MMS_PLUGIN_HTTP_DATA_S *httpConfig)
 }
 
 
-int httpCmdPostTransaction(MMS_PLUGIN_HTTP_DATA_S *httpConfig)
+static int __httpCmdPostTransaction(MMS_PLUGIN_HTTP_DATA_S *httpConfig)
 {
        int trId;
 
@@ -395,11 +451,9 @@ int httpCmdPostTransaction(MMS_PLUGIN_HTTP_DATA_S *httpConfig)
                return eMMS_EXCEPTIONAL_ERROR;
        }
 
-       MSG_PROFILE_BEGIN(libcurl);
-
        CURLcode rc = curl_easy_perform(httpConfig->session);
 
-       MSG_PROFILE_END(libcurl);
+       __http_print_profile(httpConfig->session);
 
        MmsPluginHttpAgent*     httpAgent = MmsPluginHttpAgent::instance();
        MMS_PLUGIN_HTTP_DATA_S *httpConfigData = httpAgent->getHttpConfigData();
@@ -425,7 +479,7 @@ int httpCmdPostTransaction(MMS_PLUGIN_HTTP_DATA_S *httpConfig)
        return eMMS_HTTP_SENT_SUCCESS;
 }
 
-int httpCmdGetTransaction(MMS_PLUGIN_HTTP_DATA_S *httpConfig)
+static int __httpCmdGetTransaction(MMS_PLUGIN_HTTP_DATA_S *httpConfig)
 {
        int trId;
 
@@ -445,6 +499,8 @@ int httpCmdGetTransaction(MMS_PLUGIN_HTTP_DATA_S *httpConfig)
 
        CURLcode rc = curl_easy_perform(httpConfig->session);
 
+       __http_print_profile(httpConfig->session);
+
        MmsPluginHttpAgent*     httpAgent = MmsPluginHttpAgent::instance();
        MMS_PLUGIN_HTTP_DATA_S *httpConfigData = httpAgent->getHttpConfigData();
        if (httpConfigData->sessionHeader) {
@@ -486,11 +542,9 @@ MmsPluginHttpAgent::MmsPluginHttpAgent()
 
        httpCmdHandler.clear();
 
-       waiting = false;
-
-       httpCmdHandler[eHTTP_CMD_INIT_SESSION] = &httpCmdInitSession;
-       httpCmdHandler[eHTTP_CMD_POST_TRANSACTION] = &httpCmdPostTransaction;
-       httpCmdHandler[eHTTP_CMD_GET_TRANSACTION] = &httpCmdGetTransaction;
+       httpCmdHandler[eHTTP_CMD_INIT_SESSION] = &__httpCmdInitSession;
+       httpCmdHandler[eHTTP_CMD_POST_TRANSACTION] = &__httpCmdPostTransaction;
+       httpCmdHandler[eHTTP_CMD_GET_TRANSACTION] = &__httpCmdGetTransaction;
 }
 
 MmsPluginHttpAgent::~MmsPluginHttpAgent()
@@ -536,17 +590,6 @@ MMS_PLUGIN_HTTP_DATA_S *MmsPluginHttpAgent::getHttpConfigData()
        return &httpConfigData;
 }
 
-void MmsPluginHttpAgent::setHttpWaitingFlag(bool val)
-{
-       waiting = val;
-}
-
-bool MmsPluginHttpAgent::getHttpWaitingFlag()
-{
-       return waiting;
-}
-
-
 int MmsPluginHttpAgent::setSession(mmsTranQEntity *qEntity)
 {
        MSG_DEBUG("%s %d", qEntity->pPostData, qEntity->postDataLen);
@@ -557,10 +600,8 @@ int MmsPluginHttpAgent::setSession(mmsTranQEntity *qEntity)
 
                curl_slist *responseHeaders = NULL;
 
-               HttpHeaderInfo(&responseHeaders, NULL, qEntity->postDataLen);
-               responseHeaders = curl_slist_append(responseHeaders, "Pragma: ");
-               responseHeaders = curl_slist_append(responseHeaders, "Proxy-Connection: ");
-               responseHeaders = curl_slist_append(responseHeaders, "Expect: ");
+               __httpAllocHeaderInfo(&responseHeaders, NULL, qEntity->postDataLen);
+
                MSG_DEBUG(" === MMSCURI = %s === ", httpConfigData.mmscConfig.mmscUrl);
 
                httpConfigData.sessionHeader = (void *)responseHeaders;
@@ -573,7 +614,7 @@ int MmsPluginHttpAgent::setSession(mmsTranQEntity *qEntity)
                curl_easy_setopt(httpConfigData.session, CURLOPT_HTTPHEADER, responseHeaders);
                curl_easy_setopt(httpConfigData.session, CURLOPT_POSTFIELDS, qEntity->pPostData);
                curl_easy_setopt(httpConfigData.session, CURLOPT_POSTFIELDSIZE, qEntity->postDataLen);
-               curl_easy_setopt(httpConfigData.session, CURLOPT_WRITEFUNCTION, MmsHttpPostTransactionCB);
+               curl_easy_setopt(httpConfigData.session, CURLOPT_WRITEFUNCTION, __httpPostTransactionCB);
 
                curl_easy_setopt(httpConfigData.session, CURLOPT_TCP_NODELAY, 1);
        } else if (qEntity->eHttpCmdType == eHTTP_CMD_GET_TRANSACTION) {
@@ -586,11 +627,9 @@ int MmsPluginHttpAgent::setSession(mmsTranQEntity *qEntity)
 
                MSG_DEBUG("MmsHttpInitTransactionGet  szURL (%s)", szUrl);
 
-               curl_slist *responseHeaders = NULL;
+               curl_slist *responseHeaders = NULL;
 
-               HttpHeaderInfo(&responseHeaders, szUrl, 0);
-               responseHeaders = curl_slist_append(responseHeaders, "Pragma: ");
-               responseHeaders = curl_slist_append(responseHeaders, "Proxy-Connection: ");
+               __httpAllocHeaderInfo(&responseHeaders, NULL, 0);
 
                httpConfigData.sessionHeader = (void *)responseHeaders;
 
@@ -599,7 +638,7 @@ int MmsPluginHttpAgent::setSession(mmsTranQEntity *qEntity)
                curl_easy_setopt(httpConfigData.session, CURLOPT_URL, szUrl);
                curl_easy_setopt(httpConfigData.session, CURLOPT_NOPROGRESS, true);
                curl_easy_setopt(httpConfigData.session, CURLOPT_HTTPHEADER, responseHeaders);
-               curl_easy_setopt(httpConfigData.session, CURLOPT_WRITEFUNCTION, MmsHttpGetTransactionCB);
+               curl_easy_setopt(httpConfigData.session, CURLOPT_WRITEFUNCTION, __httpGetTransactionCB);
        } else {
                MSG_DEBUG("Unknown eHttpCmdType [%d]", qEntity->eHttpCmdType);
                return -1;
index 15ffcbe..7e3d831 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include <stdlib.h>
 #include <errno.h>
@@ -134,7 +134,7 @@ void MmsPluginInternal::processReceivedInd(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_REQ
 bool MmsPluginInternal::processNotiInd(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_REQUEST_INFO_S *pRequest)
 {
        MSG_DEBUG("MmsProcessNotiInd");
-       MSG_ERROR_T     err = MSG_SUCCESS;
+       msg_error_t     err = MSG_SUCCESS;
 
        MSG_MMS_HOME_RETRIEVE_TYPE_T retrieveType;
        bool bReportAllowed;
@@ -266,14 +266,14 @@ void MmsPluginInternal::processDeliveryInd(MSG_MESSAGE_INFO_S *pMsgInfo)
 
        MSG_DEBUG("#### mmsHeader.szMsgID = %s : when received delivery ind####", mmsHeader.szMsgID);
 
-       int tmpId = (MSG_MESSAGE_ID_T)MmsSearchMsgId(mmsHeader.pTo->szAddr, mmsHeader.szMsgID);
+       int tmpId = (msg_message_id_t)MmsSearchMsgId(mmsHeader.pTo->szAddr, mmsHeader.szMsgID);
 
 
        MSG_DEBUG("tmpId [%d]", tmpId);
        MSG_DEBUG("mmsHeader.pTo->szAddr [%s]", mmsHeader.pTo->szAddr);
 
        if (tmpId > 0) {
-               pMsgInfo->msgId = (MSG_MESSAGE_ID_T)tmpId;
+               pMsgInfo->msgId = (msg_message_id_t)tmpId;
 
                pMsg->mmsAttrib.pMultiStatus = MmsGetMultiStatus(pMsgInfo->msgId);
 
@@ -392,7 +392,7 @@ void MmsPluginInternal::processReadOrgInd(MSG_MESSAGE_INFO_S *pMsgInfo)
                int tmpId = MmsSearchMsgId(mmsHeader.pFrom->szAddr, mmsHeader.szMsgID);
 
                if (tmpId > 0) {
-                       pMsgInfo->msgId = (MSG_MESSAGE_ID_T)tmpId;
+                       pMsgInfo->msgId = (msg_message_id_t)tmpId;
 
                        pMsg->mmsAttrib.pMultiStatus = MmsGetMultiStatus(pMsgInfo->msgId);
 
@@ -484,7 +484,7 @@ void MmsPluginInternal::processSendConf(MSG_MESSAGE_INFO_S *pMsgInfo, mmsTranQEn
 {
        MSG_BEGIN();
 
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        MMS_RECV_DATA_S recvData = {{0}, };
 
@@ -546,7 +546,7 @@ void MmsPluginInternal::processRetrieveConf(MSG_MESSAGE_INFO_S *pMsgInfo, mmsTra
        MsgType partHeader;
        bool bMultipartRelated = false;
 
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
        MMS_RECV_DATA_S recvData = {{0}, };
 
        MmsAttrib attrib;
@@ -716,7 +716,7 @@ void MmsPluginInternal::processForwardConf(MSG_MESSAGE_INFO_S *msgInfo, mmsTranQ
  * @param      iReportAllowed [in] Specifies whether to send deliveryReport to sender or not
  * @return     This function returns true on success, or false on failure.
  */
-bool MmsPluginInternal::encodeNotifyRespInd(char *szTrID, MSG_DELIVERY_REPORT_STATUS_T iStatus, bool bReportAllowed, char *pSendFilePath)
+bool MmsPluginInternal::encodeNotifyRespInd(char *szTrID, msg_delivery_report_status_t iStatus, bool bReportAllowed, char *pSendFilePath)
 {
        MSG_BEGIN();
 
@@ -864,7 +864,7 @@ bool MmsPluginInternal::getMmsReport(MmsReport mmsReport)
        return result;
 }
 
-const char *MmsPluginInternal::getMmsDeliveryStatus(MSG_DELIVERY_REPORT_STATUS_T deliveryStatus)
+const char *MmsPluginInternal::getMmsDeliveryStatus(msg_delivery_report_status_t deliveryStatus)
 {
        MSG_DEBUG("msgStatus= %d", deliveryStatus);
 
@@ -884,7 +884,7 @@ const char *MmsPluginInternal::getMmsDeliveryStatus(MSG_DELIVERY_REPORT_STATUS_T
        }
 }
 
-const char *MmsPluginInternal::getMmsReadStatus(MSG_READ_REPORT_STATUS_T readStatus)
+const char *MmsPluginInternal::getMmsReadStatus(msg_read_report_status_t readStatus)
 {
        switch (readStatus) {
        case MSG_READ_REPORT_IS_READ:
index 6874224..02796d2 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include <string>
 #include <stdlib.h>
index 6b10ab5..6d29df9 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include <glib.h>
 #include <pthread.h>
@@ -39,7 +39,7 @@
 /*==================================================================================================
                                                        FUNCTION IMPLEMENTATION
 ==================================================================================================*/
-MSG_ERROR_T MsgPlgCreateHandle(MSG_PLUGIN_HANDLER_S *pPluginHandle)
+msg_error_t MsgPlgCreateHandle(MSG_PLUGIN_HANDLER_S *pPluginHandle)
 {
        if (pPluginHandle == NULL) {
                MSG_DEBUG("MMS plugin: create handler error ");
@@ -65,7 +65,7 @@ MSG_ERROR_T MsgPlgCreateHandle(MSG_PLUGIN_HANDLER_S *pPluginHandle)
 }
 
 
-MSG_ERROR_T MmsPlgDestroyHandle(MSG_PLUGIN_HANDLER_S *pPluginHandle)
+msg_error_t MmsPlgDestroyHandle(MSG_PLUGIN_HANDLER_S *pPluginHandle)
 {
        MSG_BEGIN();
 
@@ -80,7 +80,7 @@ MSG_ERROR_T MmsPlgDestroyHandle(MSG_PLUGIN_HANDLER_S *pPluginHandle)
 }
 
 
-MSG_ERROR_T MmsInitialize()
+msg_error_t MmsInitialize()
 {
        MSG_BEGIN();
 
@@ -93,7 +93,7 @@ MSG_ERROR_T MmsInitialize()
 }
 
 
-MSG_ERROR_T MmsFinalize()
+msg_error_t MmsFinalize()
 {
        MSG_BEGIN();
 
@@ -103,7 +103,7 @@ MSG_ERROR_T MmsFinalize()
 }
 
 
-MSG_ERROR_T MmsRegisterListener(MSG_PLUGIN_LISTENER_S *pListener)
+msg_error_t MmsRegisterListener(MSG_PLUGIN_LISTENER_S *pListener)
 {
        MSG_BEGIN();
 
@@ -115,7 +115,7 @@ MSG_ERROR_T MmsRegisterListener(MSG_PLUGIN_LISTENER_S *pListener)
 }
 
 
-MSG_ERROR_T MmsSubmitRequest(MSG_REQUEST_INFO_S *pReqInfo, bool bReqCb)
+msg_error_t MmsSubmitRequest(MSG_REQUEST_INFO_S *pReqInfo)
 {
        MSG_BEGIN();
 
@@ -135,7 +135,7 @@ MSG_ERROR_T MmsSubmitRequest(MSG_REQUEST_INFO_S *pReqInfo, bool bReqCb)
 }
 
 
-MSG_ERROR_T MmsAddMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S *pSendOptInfo, char *pFileData)
+msg_error_t MmsAddMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S *pSendOptInfo, char *pFileData)
 {
        MSG_BEGIN();
 
@@ -155,7 +155,7 @@ MSG_ERROR_T MmsAddMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S *p
 }
 
 
-MSG_ERROR_T MmsProcessReceivedInd(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_REQUEST_INFO_S *pRequest, bool *bReject)
+msg_error_t MmsProcessReceivedInd(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_REQUEST_INFO_S *pRequest, bool *bReject)
 {
        MSG_BEGIN();
 
@@ -177,11 +177,11 @@ MSG_ERROR_T MmsProcessReceivedInd(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_REQUEST_INFO
 }
 
 
-MSG_ERROR_T MmsUpdateMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S *pSendOptInfo,  char *pFileData)
+msg_error_t MmsUpdateMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S *pSendOptInfo,  char *pFileData)
 {
        MSG_BEGIN();
 
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        try {
                if (pMsgInfo->networkStatus == MSG_NETWORK_NOT_SEND) {
@@ -208,11 +208,11 @@ MSG_ERROR_T MmsUpdateMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S
 }
 
 
-MSG_ERROR_T MmsGetMmsMessage(MSG_MESSAGE_INFO_S *pMsg, MSG_SENDINGOPT_INFO_S *pSendOptInfo, MMS_MESSAGE_DATA_S *pMmsMsg, char **pDestMsg)
+msg_error_t MmsGetMmsMessage(MSG_MESSAGE_INFO_S *pMsg, MSG_SENDINGOPT_INFO_S *pSendOptInfo, MMS_MESSAGE_DATA_S *pMmsMsg, char **pDestMsg)
 {
        MSG_BEGIN();
 
-       MSG_ERROR_T     err = MSG_SUCCESS;
+       msg_error_t     err = MSG_SUCCESS;
 
        try {
                err = MmsPluginStorage::instance()->plgGetMmsMessage(pMsg, pSendOptInfo, pMmsMsg, pDestMsg);
@@ -230,11 +230,11 @@ MSG_ERROR_T MmsGetMmsMessage(MSG_MESSAGE_INFO_S *pMsg, MSG_SENDINGOPT_INFO_S *pS
 }
 
 
-MSG_ERROR_T MmsUpdateRejectStatus(MSG_MESSAGE_INFO_S *pMsgInfo)
+msg_error_t MmsUpdateRejectStatus(MSG_MESSAGE_INFO_S *pMsgInfo)
 {
        MSG_BEGIN();
 
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        try {
                char szTrID[MMS_TR_ID_LEN + 1] = {0x00};
@@ -269,7 +269,7 @@ MSG_ERROR_T MmsUpdateRejectStatus(MSG_MESSAGE_INFO_S *pMsgInfo)
 }
 
 
-MSG_ERROR_T MmsComposeReadReport(MSG_MESSAGE_INFO_S *pMsgInfo)
+msg_error_t MmsComposeReadReport(MSG_MESSAGE_INFO_S *pMsgInfo)
 {
        MSG_BEGIN();
 
@@ -289,7 +289,7 @@ MSG_ERROR_T MmsComposeReadReport(MSG_MESSAGE_INFO_S *pMsgInfo)
 }
 
 
-MSG_ERROR_T MmsRestoreMsg(MSG_MESSAGE_INFO_S *pMsgInfo, char *pRcvBody, int rcvdBodyLen, char *filePath)
+msg_error_t MmsRestoreMsg(MSG_MESSAGE_INFO_S *pMsgInfo, char *pRcvBody, int rcvdBodyLen, char *filePath)
 {
        MSG_BEGIN();
 
index 4089ef6..46c1c36 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -897,7 +897,7 @@ bool MmsComposeMessage(MmsMsg *pMmsMsg, MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDIN
        time_t RawTime = 0;
        time_t nTimeInSecs = 0;
 
-       MSG_ERROR_T     err = MSG_SUCCESS;
+       msg_error_t     err = MSG_SUCCESS;
 
        // Initialize mmsMsg structure
        MmsInitMsgAttrib(&pMmsMsg->mmsAttrib);
@@ -990,7 +990,7 @@ bool MmsComposeMessage(MmsMsg *pMmsMsg, MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDIN
        time(&RawTime);
        timeInfo = localtime(&RawTime);
        nTimeInSecs = mktime(timeInfo);
-       pMmsMsg->mmsAttrib.date = nTimeInSecs;  // todo: need to subtract timeline value to make GMT+0 time
+       pMmsMsg->mmsAttrib.date = nTimeInSecs;
 
        //setting subject
        strcpy(pMmsMsg->mmsAttrib.szSubject, pMsgInfo->subject);
@@ -1098,7 +1098,7 @@ bool MmsComposeMessage(MmsMsg *pMmsMsg, MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDIN
        return true;
 }
 
-void MmsComposeNotiMessage(MmsMsg *pMmsMsg, MSG_MESSAGE_ID_T msgID)
+void MmsComposeNotiMessage(MmsMsg *pMmsMsg, msg_message_id_t msgID)
 {
        MSG_BEGIN();
 
@@ -1281,7 +1281,7 @@ __CATCH:
 }
 
 #ifdef MMS_DELIEVERY_IND_ENABLED
-MmsMsgMultiStatus *MmsComposeDeliveryIndMessage(MmsMsg *pMmsMsg, MSG_MESSAGE_ID_T msgId)
+MmsMsgMultiStatus *MmsComposeDeliveryIndMessage(MmsMsg *pMmsMsg, msg_message_id_t msgId)
 {
        MmsMsgMultiStatus *pStatus = NULL;
        MmsMsgMultiStatus *pLastStatus = NULL;
@@ -1348,7 +1348,7 @@ MmsMsgMultiStatus *MmsComposeDeliveryIndMessage(MmsMsg *pMmsMsg, MSG_MESSAGE_ID_
 }
 #endif
 
-void MmsComposeReadReportMessage(MmsMsg *pMmsMsg, const MSG_MESSAGE_INFO_S *pMsgInfo, MSG_MESSAGE_ID_T selectedMsgId)
+void MmsComposeReadReportMessage(MmsMsg *pMmsMsg, const MSG_MESSAGE_INFO_S *pMsgInfo, msg_message_id_t selectedMsgId)
 {
        struct tm *timeInfo = NULL;
        time_t RawTime = 0;
@@ -1403,7 +1403,7 @@ int MmsSearchMsgId(char *toNumber, char *szMsgID)
        return msgId;
 }
 
-void MmsUpdateDeliveryReport(MSG_MESSAGE_ID_T msgId, MmsMsgMultiStatus *pStatus)
+void MmsUpdateDeliveryReport(msg_message_id_t msgId, MmsMsgMultiStatus *pStatus)
 {
        MSG_BEGIN();
 
@@ -1412,7 +1412,7 @@ void MmsUpdateDeliveryReport(MSG_MESSAGE_ID_T msgId, MmsMsgMultiStatus *pStatus)
        MSG_END();
 }
 
-void MmsUpdateReadReport(MSG_MESSAGE_ID_T msgId, MmsMsgMultiStatus *pStatus)
+void MmsUpdateReadReport(msg_message_id_t msgId, MmsMsgMultiStatus *pStatus)
 {
        MSG_BEGIN();
 
@@ -1421,7 +1421,7 @@ void MmsUpdateReadReport(MSG_MESSAGE_ID_T msgId, MmsMsgMultiStatus *pStatus)
        MSG_END();
 }
 
-MmsMsgMultiStatus *MmsGetMultiStatus(MSG_MESSAGE_ID_T msgId)
+MmsMsgMultiStatus *MmsGetMultiStatus(msg_message_id_t msgId)
 {
        MmsMsgMultiStatus *pMultiStatus;
 
index d592da0..38df2aa 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include "MmsPluginSMILValidate.h"
 #include "MsgDebug.h"
index 9d22b91..5ef0bbc 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include<stdio.h>
 #include <string.h>
@@ -35,7 +35,7 @@ static MmsSmilDoc *__gpaMmsSmilDoc[MMS_SMIL_MAX_DOC]={NULL, };
 static char gszColor[MMS_SMIL_COLOR_SIZE] = {0, };
 
 
-char *MmsSmilGetPresentationData(MSG_MESSAGE_ID_T msgId)
+char *MmsSmilGetPresentationData(msg_message_id_t msgId)
 {
        MmsMsg *pMsg;
 
@@ -333,10 +333,6 @@ void MmsSmilGetElement(MMS_MESSAGE_DATA_S *pMmsMsg, xmlNode *a_node)
                                        else
                                                pMedia->sMedia.sAVI.nDurTime =  MmsSmilGetTime((char *)pAttr->children->content);
 
-#ifdef MMS_SMIL_ANIMATE
-                                       if (cmd[ELEMENT_ANIMATE])
-                                               pMedia->sMedia.sAVI.nDur = MmsSmilGetTime((char *)pAttr->children->content);
-#endif
                                        break;
 
                                case ATTRIBUTE_SRC:
@@ -410,7 +406,6 @@ void MmsSmilGetElement(MMS_MESSAGE_DATA_S *pMmsMsg, xmlNode *a_node)
                                        if (cmd[ELEMENT_TEXT])
                                                pMedia->sMedia.sText.nDirection = MmsSmilGetFontDirection((char *)pAttr->children->content);
                                        break;
-
                                case ATTRIBUTE_REGION:
                                        strncpy(pMedia->regionId, (char *)pAttr->children->content, MAX_SMIL_REGION_ID - 1);
                                        break;
@@ -524,39 +519,6 @@ void MmsSmilGetElement(MMS_MESSAGE_DATA_S *pMmsMsg, xmlNode *a_node)
                                case ATTRIBUTE_CONTENT:
                                        strncpy(pMeta->szContent, (char *)pAttr->children->content, MAX_SMIL_META_CONTENT - 1);
                                        break;
-#ifdef MMS_SMIL_ANIMATE
-                               case ATTRIBUTE_ATTRIBUTE_NAME:
-                                       strcpy(pMedia->sMedia.sAVI.nAttributeName, (char *)pAttr->children->content);
-                                       break;
-
-                               case ATTRIBUTE_ATTRIBUTE_TYPE:
-                                       strcpy(pMedia->sMedia.sAVI.nAttributeType, (char *)pAttr->children->content);
-                                       break;
-
-                               case ATTRIBUTE_TARGET_ELEMENT:
-                                       strcpy(pMedia->sMedia.sAVI.nTargetElement, (char *)pAttr->children->content);
-                                       break;
-
-                               case ATTRIBUTE_FROM:
-                                       pMedia->sMedia.sAVI.nFrom = atoi((char *)pAttr->children->content);
-                                       break;
-
-                               case ATTRIBUTE_TO:
-                                       pMedia->sMedia.sAVI.nTo = atoi((char *)pAttr->children->content);
-                                       break;
-
-                               case ATTRIBUTE_BY:
-                                       pMedia->sMedia.sAVI.nBy = atoi((char *)pAttr->children->content);
-                                       break;
-
-                               case ATTRIBUTE_VALUES:
-                                       pMedia->sMedia.sAVI.nValues = atoi((char *)pAttr->children->content);
-                                       break;
-
-                               case ATTRIBUTE_CALCMODE:
-                                       strcpy(pMedia->sMedia.sAVI.nCalcMode, (char *)pAttr->children->content);
-                                       break;
-#endif
                                default:
                                        MSG_DEBUG("Undefined Attribute was found!!!!!");
                                }
@@ -968,24 +930,6 @@ int        MmsSmilGetAttrID(char *pString)
                return ATTRIBUTE_END;
        else if (!strcmp(pString, "repeatCount"))
                return ATTRIBUTE_REPEAT_COUNT;
-#ifdef MMS_SMIL_ANIMATE
-       else if (!strcmp(pString, "attributeName"))
-               return ATTRIBUTE_ATTRIBUTE_NAME;
-       else if (!strcmp(pString, "attributeType"))
-               return ATTRIBUTE_ATTRIBUTE_TYPE;
-       else if (!strcmp(pString, "targetElement"))
-               return ATTRIBUTE_TARGET_ELEMENT;
-       else if (!strcmp(pString, "from"))
-               return ATTRIBUTE_FROM;
-       else if (!strcmp(pString, "to"))
-               return ATTRIBUTE_TO;
-       else if (!strcmp(pString, "by"))
-               return ATTRIBUTE_BY;
-       else if (!strcmp(pString, "values"))
-               return ATTRIBUTE_VALUES;
-       else if (!strcmp(pString, "calcMode"))
-               return ATTRIBUTE_CALCMODE;
-#endif
        else
                return -1;
 }
@@ -1656,8 +1600,6 @@ bool MmsSmilAddRegion(HMmsSmil hSmilDoc, MMS_SMIL_REGION *pstSmilRegion)
                } else
                        MSG_DEBUG("There is no attribute in <region> node\n");
 
-               __MmsSmilInsertNode(pstLayoutList, pstRootLayoutList, pstRegion);
-
                MSG_END();
                return true;
        } else {
@@ -1927,7 +1869,6 @@ xmlNode *__MmsCreateMMNode(MMS_MEDIA_S *pstSmilMedia, char *pszContentID)
        case MMS_SMIL_MEDIA_IMG:
                pstMedia = xmlNewNode(NULL, (xmlChar *)"img");
                break;
-
        default:
                MSG_DEBUG("Invalid media type. Can't insert such-<media> node.");
                return NULL;
index 150deb9..bebed16 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include <stdlib.h>
 #include <sys/stat.h>
 #include "MmsPluginCodec.h"
 #include "MmsPluginSmil.h"
 #include "MmsPluginDrm.h"
-
-#include "media-thumbnail.h"
+#include <media-thumbnail.h>
 #include <mm_util_imgp.h>
 #include <mm_util_jpeg.h>
-
 #include "MsgHelper.h"
 
-
 static void __MmsReleaseMmsLists(MMS_MESSAGE_DATA_S *mms_data)
 {
        _MsgMmsReleasePageList(mms_data);
@@ -90,7 +87,7 @@ void MmsPluginStorage::addMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_I
 {
        MSG_BEGIN();
 
-       MSG_ERROR_T     err;
+       msg_error_t     err;
 
        MmsMsg mmsMsg;
 
@@ -103,7 +100,7 @@ void MmsPluginStorage::addMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_I
                char szTemp[MAX_MSG_DATA_LEN + 1];
 
                MMS_MESSAGE_DATA_S mmsMsgData;
-
+               bzero(&mmsMsgData,sizeof(MMS_MESSAGE_DATA_S));
                if (MmsComposeMessage(&mmsMsg, pMsgInfo, pSendOptInfo, &mmsMsgData, pFileData) != true) {
                        _MsgFreeBody(&mmsMsg.msgBody, mmsMsg.msgType.type);
 
@@ -113,81 +110,59 @@ void MmsPluginStorage::addMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_I
                        THROW(MsgException::MMS_PLG_ERROR, "MMS Message Compose Error");
                }
 
-               if (pMsgInfo->msgId == pMsgInfo->referenceId) {
-                       char fileName[MSG_FILENAME_LEN_MAX+1] = {0,};
-
-                       FILE *pFile = NULL;
-
-                       strcpy(szTemp,pMsgInfo->msgData);
-
-                       snprintf((char *)pMsgInfo->msgData, MAX_MSG_DATA_LEN+1, MSG_DATA_PATH"%d.mms", pMsgInfo->msgId);
+               char fileName[MSG_FILENAME_LEN_MAX+1] = {0,};
 
-                       if (addMmsMsgToDB(&mmsMsg, pMsgInfo, _MsgMmsGetAttachCount(&mmsMsgData)) != MSG_SUCCESS) {
-                               _MsgFreeBody(&mmsMsg.msgBody, mmsMsg.msgType.type);
-                               MsgFreeAttrib(&mmsMsg.mmsAttrib);
-                               __MmsReleaseMmsLists(&mmsMsgData);
-
-                               THROW(MsgException::MMS_PLG_ERROR, "MMS Stroage Error");
-                       }
-
-                       strcpy((char *)pMsgInfo->msgData,szTemp);
-
-                       snprintf(fileName, MSG_FILENAME_LEN_MAX+1, MSG_DATA_PATH"%d", mmsMsg.msgID);
+               FILE *pFile = NULL;
 
-                       pFile = MsgOpenMMSFile(fileName);
-                       if (!pFile) {
-                               _MsgFreeBody(&mmsMsg.msgBody, mmsMsg.msgType.type);
-                               MsgFreeAttrib(&mmsMsg.mmsAttrib);
-                               __MmsReleaseMmsLists(&mmsMsgData);
-                               THROW(MsgException::MMS_PLG_ERROR, "MMS File open Error");
-                       }
+               strcpy(szTemp,pMsgInfo->msgData);
 
-                       if (fchmod(fileno(pFile), file_mode) < 0) {
-                               _MsgFreeBody(&mmsMsg.msgBody, mmsMsg.msgType.type);
-                               MsgFreeAttrib(&mmsMsg.mmsAttrib);
-                               __MmsReleaseMmsLists(&mmsMsgData);
-                               MsgCloseFile(pFile);
+               snprintf((char *)pMsgInfo->msgData, MAX_MSG_DATA_LEN+1, MSG_DATA_PATH"%d.mms", pMsgInfo->msgId);
 
-                               THROW(MsgException::MMS_PLG_ERROR, "chmod() error: %s", strerror(errno));
-                       }
+               if (addMmsMsgToDB(&mmsMsg, pMsgInfo, _MsgMmsGetAttachCount(&mmsMsgData)) != MSG_SUCCESS) {
+                       _MsgFreeBody(&mmsMsg.msgBody, mmsMsg.msgType.type);
+                       MsgFreeAttrib(&mmsMsg.mmsAttrib);
+                       __MmsReleaseMmsLists(&mmsMsgData);
 
-                       if (_MmsEncodeSendReq(pFile, &mmsMsg) != true) {
-                               _MsgFreeBody(&mmsMsg.msgBody, mmsMsg.msgType.type);
-                               MsgFreeAttrib(&mmsMsg.mmsAttrib);
-                               __MmsReleaseMmsLists(&mmsMsgData);
-                               MsgCloseFile(pFile);
+                       THROW(MsgException::MMS_PLG_ERROR, "MMS Stroage Error");
+               }
 
-                               THROW(MsgException::MMS_PLG_ERROR, "MMS Message Encode Send Req Error");
-                       }
+               strcpy((char *)pMsgInfo->msgData,szTemp);
 
-                       MsgFsync(pFile);        //file is written to device immediately, it prevents missing file data from unexpected power off
-                       MsgCloseFile(pFile);
+               snprintf(fileName, MSG_FILENAME_LEN_MAX+1, MSG_DATA_PATH"%d", mmsMsg.msgID);
 
+               pFile = MsgOpenMMSFile(fileName);
+               if (!pFile) {
                        _MsgFreeBody(&mmsMsg.msgBody, mmsMsg.msgType.type);
                        MsgFreeAttrib(&mmsMsg.mmsAttrib);
                        __MmsReleaseMmsLists(&mmsMsgData);
-               } else {
-                       char szTemp[MAX_MSG_DATA_LEN + 1];
-
-                       strcpy(szTemp,pMsgInfo->msgData);
-
-                       snprintf((char *)pMsgInfo->msgData, MAX_MSG_DATA_LEN+1, MSG_DATA_PATH"%d.mms", pMsgInfo->referenceId);
-
-                       if (addMmsMsgToDB(&mmsMsg, pMsgInfo, _MsgMmsGetAttachCount(&mmsMsgData)) != MSG_SUCCESS) {
-                               _MsgFreeBody(&mmsMsg.msgBody, mmsMsg.msgType.type);
-                               MsgFreeAttrib(&mmsMsg.mmsAttrib);
-                               __MmsReleaseMmsLists(&mmsMsgData);
+                       THROW(MsgException::MMS_PLG_ERROR, "MMS File open Error");
+               }
 
-                               THROW(MsgException::MMS_PLG_ERROR, "MMS Stroage Error");
-                       }
+               if (fchmod(fileno(pFile), file_mode) < 0) {
+                       _MsgFreeBody(&mmsMsg.msgBody, mmsMsg.msgType.type);
+                       MsgFreeAttrib(&mmsMsg.mmsAttrib);
+                       __MmsReleaseMmsLists(&mmsMsgData);
+                       MsgCloseFile(pFile);
 
-                       strcpy((char *)pMsgInfo->msgData,szTemp);
+                       THROW(MsgException::MMS_PLG_ERROR, "chmod() error: %s", strerror(errno));
+               }
 
+               if (_MmsEncodeSendReq(pFile, &mmsMsg) != true) {
                        _MsgFreeBody(&mmsMsg.msgBody, mmsMsg.msgType.type);
                        MsgFreeAttrib(&mmsMsg.mmsAttrib);
-
                        __MmsReleaseMmsLists(&mmsMsgData);
+                       MsgCloseFile(pFile);
+
+                       THROW(MsgException::MMS_PLG_ERROR, "MMS Message Encode Send Req Error");
                }
+
+               MsgFsync(pFile);        //file is written to device immediately, it prevents missing file data from unexpected power off
+               MsgCloseFile(pFile);
+
+               _MsgFreeBody(&mmsMsg.msgBody, mmsMsg.msgType.type);
+               MsgFreeAttrib(&mmsMsg.mmsAttrib);
+               __MmsReleaseMmsLists(&mmsMsgData);
+
        } else if (pMsgInfo->msgType.subType == MSG_NOTIFICATIONIND_MMS) {
                MSG_DEBUG("######## MmsPlgAddMessage -> MSG_NOTIFICATIONIND_MMS ###########");
 
@@ -211,7 +186,6 @@ void MmsPluginStorage::addMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_I
                        pMsgInfo->networkStatus = MSG_NETWORK_SEND_SUCCESS;
                else
                        pMsgInfo->networkStatus = MSG_NETWORK_RETRIEVE_SUCCESS;
-
                strcpy(szTemp,pMsgInfo->msgData);
                memset(pMsgInfo->msgData, 0, MAX_MSG_DATA_LEN + 1);
                strncpy(pMsgInfo->msgData, pFileData, MAX_MSG_DATA_LEN);
@@ -219,6 +193,7 @@ void MmsPluginStorage::addMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_I
                MmsPluginStorage *pStorage = MmsPluginStorage::instance();
 
                MMS_MESSAGE_DATA_S mmsMsgData;
+               bzero(&mmsMsgData,sizeof(MMS_MESSAGE_DATA_S));
                if (mmsHeader.msgType.type == MIME_MULTIPART_RELATED || mmsHeader.msgType.type == MIME_APPLICATION_VND_WAP_MULTIPART_RELATED) {
                        char *pSmilDoc;
                        MmsMsg *pMsg = NULL;
@@ -258,12 +233,12 @@ void MmsPluginStorage::addMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_I
                char filePath[MAX_FULL_PATH_SIZE+1] = {0, };
                FILE *pFile = NULL;
 
-               MSG_READ_REPORT_STATUS_T readStatus;
-               MSG_MESSAGE_ID_T selectedMsgId;
+               msg_read_report_status_t readStatus;
+               msg_message_id_t selectedMsgId;
                int     version;
 
-               memcpy(&readStatus, pMsgInfo->msgData, sizeof(MSG_READ_REPORT_STATUS_T));
-               memcpy(&selectedMsgId, pMsgInfo->msgData + sizeof(MSG_READ_REPORT_STATUS_T), sizeof(MSG_MESSAGE_ID_T));
+               memcpy(&readStatus, pMsgInfo->msgData, sizeof(msg_read_report_status_t));
+               memcpy(&selectedMsgId, pMsgInfo->msgData + sizeof(msg_read_report_status_t), sizeof(msg_message_id_t));
 
                version = MmsPluginStorage::instance()->getMmsVersion(selectedMsgId);
 
@@ -403,19 +378,18 @@ void MmsPluginStorage::addMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_I
 
 void MmsPluginStorage::composeReadReport(MSG_MESSAGE_INFO_S *pMsgInfo)
 {
-       char filePath[MAX_FULL_PATH_SIZE+1] = {0, };
        FILE *pFile = NULL;
 
-       MSG_READ_REPORT_STATUS_T readStatus;
+       msg_read_report_status_t readStatus;
        int     version;
 
-       memcpy(&readStatus, pMsgInfo->msgData, sizeof(MSG_READ_REPORT_STATUS_T));
+       memcpy(&readStatus, pMsgInfo->msgData, sizeof(msg_read_report_status_t));
 
        MSG_DEBUG("pMsgInfo->msgId = %d", pMsgInfo->msgId);
 
        version = MmsPluginStorage::instance()->getMmsVersion(pMsgInfo->msgId);
 
-       snprintf((char *)pMsgInfo->msgData, MAX_MSG_DATA_LEN+1, MSG_DATA_PATH"%d.mms", pMsgInfo->msgId);
+       snprintf((char *)pMsgInfo->msgData, MAX_MSG_DATA_LEN+1, MSG_DATA_PATH"%d-Read-Rec.ind", pMsgInfo->msgId);
 
        if (version == 0x90)
                pMsgInfo->msgType.subType = MSG_READREPLY_MMS;
@@ -424,8 +398,7 @@ void MmsPluginStorage::composeReadReport(MSG_MESSAGE_INFO_S *pMsgInfo)
 
        MmsComposeReadReportMessage(&mmsMsg, pMsgInfo, pMsgInfo->msgId);
 
-       snprintf(filePath, MAX_FULL_PATH_SIZE+1, MSG_DATA_PATH"%d", mmsMsg.msgID);
-       pFile = MsgOpenMMSFile(filePath);
+       pFile = MsgOpenFile(pMsgInfo->msgData, "wb+");
        if (!pFile)
                THROW(MsgException::MMS_PLG_ERROR, "MsgOpenMMSFile Error");
 
@@ -447,7 +420,7 @@ void MmsPluginStorage::composeReadReport(MSG_MESSAGE_INFO_S *pMsgInfo)
 }
 
 
-MSG_ERROR_T MmsPluginStorage::addMmsMsgToDB(MmsMsg *pMmsMsg, const MSG_MESSAGE_INFO_S *pMsgInfo, int attachCnt)
+msg_error_t MmsPluginStorage::addMmsMsgToDB(MmsMsg *pMmsMsg, const MSG_MESSAGE_INFO_S *pMsgInfo, int attachCnt)
 {
        MSG_BEGIN();
 
@@ -455,50 +428,21 @@ MSG_ERROR_T MmsPluginStorage::addMmsMsgToDB(MmsMsg *pMmsMsg, const MSG_MESSAGE_I
 
        // Add Message
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
+       snprintf(sqlQuery, sizeof(sqlQuery), "INSERT INTO %s VALUES (%d, '%s', '%s', '%s', '%s', '%s', %d, %d, %ld, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d);",
+                       MMS_PLUGIN_MESSAGE_TABLE_NAME, pMmsMsg->msgID, pMmsMsg->szTrID, pMmsMsg->szMsgID, pMmsMsg->szForwardMsgID, pMmsMsg->szContentLocation,
+                       pMsgInfo->msgData, pMmsMsg->mmsAttrib.version, pMmsMsg->mmsAttrib.dataType, pMmsMsg->mmsAttrib.date, pMmsMsg->mmsAttrib.bHideAddress,
+                       pMmsMsg->mmsAttrib.bAskDeliveryReport, pMmsMsg->mmsAttrib.bReportAllowed, pMmsMsg->mmsAttrib.readReportAllowedType,
+                       pMmsMsg->mmsAttrib.bAskReadReply, pMmsMsg->mmsAttrib.bRead, pMmsMsg->mmsAttrib.readReportSendStatus, pMmsMsg->mmsAttrib.bReadReportSent,
+                       pMmsMsg->mmsAttrib.priority, pMmsMsg->mmsAttrib.bLeaveCopy, pMmsMsg->mmsAttrib.msgSize, pMmsMsg->mmsAttrib.msgClass,
+                       pMmsMsg->mmsAttrib.expiryTime.time,     pMmsMsg->mmsAttrib.bUseDeliveryCustomTime, pMmsMsg->mmsAttrib.deliveryTime.time, pMmsMsg->mmsAttrib.msgStatus);
 
-       if (checkExistedMessage(pMmsMsg->msgID) == false) {
-               snprintf(sqlQuery, sizeof(sqlQuery), "INSERT INTO %s VALUES (%d, '%s', '%s', '%s', '%s', '%s');",
-                                       MMS_PLUGIN_MESSAGE_TABLE_NAME, pMmsMsg->msgID, pMmsMsg->szTrID, pMmsMsg->szMsgID, pMmsMsg->szForwardMsgID, pMmsMsg->szContentLocation, pMsgInfo->msgData);
-
-               dbHandle.beginTrans();
-
-               if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS) {
-                       dbHandle.endTrans(false);
-                       return MSG_ERR_DB_EXEC;
-               }
-
-               memset(sqlQuery, 0x00, sizeof(sqlQuery));
+       MSG_DEBUG("\n!!!!!!!!! QUERY : %s\n", sqlQuery);
 
-               snprintf(sqlQuery, sizeof(sqlQuery), "INSERT INTO %s VALUES (%d, %d, %d, %ld, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d);",
-                                       MMS_PLUGIN_ATTRIBUTE_TABLE_NAME, pMmsMsg->msgID, pMmsMsg->mmsAttrib.version, pMmsMsg->mmsAttrib.dataType,
-                                                                                               pMmsMsg->mmsAttrib.date, pMmsMsg->mmsAttrib.bHideAddress, pMmsMsg->mmsAttrib.bAskDeliveryReport,
-                                                                                               pMmsMsg->mmsAttrib.bReportAllowed, pMmsMsg->mmsAttrib.readReportAllowedType, pMmsMsg->mmsAttrib.bAskReadReply,
-                                                                                               pMmsMsg->mmsAttrib.bRead, pMmsMsg->mmsAttrib.readReportSendStatus, pMmsMsg->mmsAttrib.bReadReportSent,
-                                                                                               pMmsMsg->mmsAttrib.priority, pMmsMsg->mmsAttrib.bLeaveCopy, pMmsMsg->mmsAttrib.msgSize, pMmsMsg->mmsAttrib.msgClass,
-                                                                                               pMmsMsg->mmsAttrib.expiryTime.time,     pMmsMsg->mmsAttrib.bUseDeliveryCustomTime, pMmsMsg->mmsAttrib.deliveryTime.time,
-                                                                                               pMmsMsg->mmsAttrib.msgStatus);
-
-               MSG_DEBUG("\n!!!!!!!!! QUERY : %s\n", sqlQuery);
-
-               if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS) {
-                       dbHandle.endTrans(false);
-                       return MSG_ERR_DB_EXEC;
-               }
-
-               if (updateMmsAttachCount(pMmsMsg->msgID, attachCnt) != MSG_SUCCESS) {
-                       dbHandle.endTrans(false);
-                       return MSG_ERR_DB_EXEC;
-               }
-
-               dbHandle.endTrans(true);
-       } else {
-               MSG_DEBUG("Already existed message");
+       if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS)
+               return MSG_ERR_DB_EXEC;
 
-               if (updateMmsAttachCount(pMmsMsg->msgID, attachCnt) != MSG_SUCCESS) {
-                       dbHandle.endTrans(false);
-                       return MSG_ERR_DB_EXEC;
-               }
-       }
+       if (updateMmsAttachCount(pMmsMsg->msgID, attachCnt) != MSG_SUCCESS)
+               return MSG_ERR_DB_EXEC;
 
        MSG_END();
 
@@ -506,11 +450,11 @@ MSG_ERROR_T MmsPluginStorage::addMmsMsgToDB(MmsMsg *pMmsMsg, const MSG_MESSAGE_I
 }
 
 
-MSG_ERROR_T    MmsPluginStorage::plgGetMmsMessage(MSG_MESSAGE_INFO_S *pMsg, MSG_SENDINGOPT_INFO_S *pSendOptInfo, MMS_MESSAGE_DATA_S *pMmsMsg, char **pDestMsg)
+msg_error_t    MmsPluginStorage::plgGetMmsMessage(MSG_MESSAGE_INFO_S *pMsg, MSG_SENDINGOPT_INFO_S *pSendOptInfo, MMS_MESSAGE_DATA_S *pMmsMsg, char **pDestMsg)
 {
        MSG_BEGIN();
 
-       MSG_ERROR_T     err = MSG_SUCCESS;
+       msg_error_t     err = MSG_SUCCESS;
 
        int partCnt = 0;
        unsigned int nSize = 0;
@@ -525,9 +469,8 @@ MSG_ERROR_T MmsPluginStorage::plgGetMmsMessage(MSG_MESSAGE_INFO_S *pMsg, MSG_SEN
                char sqlQuery[MAX_QUERY_LEN + 1];
 
                memset(sqlQuery, 0x00, sizeof(sqlQuery));
-               snprintf(sqlQuery, sizeof(sqlQuery), "SELECT ASK_DELIVERY_REPORT, KEEP_COPY, ASK_READ_REPLY, PRIORITY, EXPIRY_TIME, CUSTOM_DELIVERY_TIME, DELIVERY_TIME FROM %s WHERE REFERENCE_ID IN \
-                                                               (SELECT REFERENCE_ID FROM %s WHERE MSG_ID = %d);",
-                                                               MMS_PLUGIN_ATTRIBUTE_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME, pMsg->msgId);
+               snprintf(sqlQuery, sizeof(sqlQuery), "SELECT ASK_DELIVERY_REPORT, KEEP_COPY, ASK_READ_REPLY, PRIORITY, EXPIRY_TIME, CUSTOM_DELIVERY_TIME, DELIVERY_TIME \
+                               FROM %s WHERE MSG_ID = %d;", MMS_PLUGIN_MESSAGE_TABLE_NAME, pMsg->msgId);
 
                MSG_DEBUG("### SQLQuery = %s ###", sqlQuery);
 
@@ -557,7 +500,6 @@ MSG_ERROR_T MmsPluginStorage::plgGetMmsMessage(MSG_MESSAGE_INFO_S *pMsg, MSG_SEN
                        MSG_DEBUG("## deliveryTime = %d ##", pSendOptInfo->option.mmsSendOptInfo.deliveryTime.time);
                } else {
                        dbHandle.finalizeQuery();
-
                        return MSG_ERR_DB_STEP;
                }
 
@@ -700,11 +642,11 @@ L_CATCH:
 }
 
 
-MSG_ERROR_T MmsPluginStorage::updateMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S *pSendOptInfo, char *pFileData)
+msg_error_t MmsPluginStorage::updateMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S *pSendOptInfo, char *pFileData)
 {
        MSG_BEGIN();
 
-       MSG_ERROR_T     err = MSG_SUCCESS;
+       msg_error_t     err = MSG_SUCCESS;
 
        MmsMsg mmsMsg;
        bzero(&mmsMsg, sizeof(mmsMsg));
@@ -717,12 +659,9 @@ MSG_ERROR_T MmsPluginStorage::updateMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SE
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
        snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET ASK_DELIVERY_REPORT = %d, KEEP_COPY = %d, ASK_READ_REPLY = %d, EXPIRY_TIME = %d, CUSTOM_DELIVERY_TIME = %d, DELIVERY_TIME= %d, PRIORITY = %d \
-                                                                       WHERE REFERENCE_ID IN \
-                                                                       (SELECT REFERENCE_ID FROM %s WHERE MSG_ID = %d);",
-                               MMS_PLUGIN_ATTRIBUTE_TABLE_NAME, pSendOptInfo->bDeliverReq, pSendOptInfo->bKeepCopy, pSendOptInfo->option.mmsSendOptInfo.bReadReq,
-                                                                                               pSendOptInfo->option.mmsSendOptInfo.expiryTime.time, pSendOptInfo->option.mmsSendOptInfo.bUseDeliveryCustomTime,
-                                                                                               pSendOptInfo->option.mmsSendOptInfo.deliveryTime.time, pSendOptInfo->option.mmsSendOptInfo.priority,
-                                                                                               MSGFW_MESSAGE_TABLE_NAME, pMsgInfo->msgId);
+                       WHERE MSG_ID = %d;", MMS_PLUGIN_MESSAGE_TABLE_NAME, pSendOptInfo->bDeliverReq, pSendOptInfo->bKeepCopy, pSendOptInfo->option.mmsSendOptInfo.bReadReq,
+                       pSendOptInfo->option.mmsSendOptInfo.expiryTime.time, pSendOptInfo->option.mmsSendOptInfo.bUseDeliveryCustomTime, pSendOptInfo->option.mmsSendOptInfo.deliveryTime.time,
+                       pSendOptInfo->option.mmsSendOptInfo.priority, pMsgInfo->msgId);
 
        if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS)
                return MSG_ERR_DB_EXEC;
@@ -763,7 +702,7 @@ MSG_ERROR_T MmsPluginStorage::updateMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SE
 }
 
 
-MSG_ERROR_T MmsPluginStorage::updateConfMessage(MSG_MESSAGE_INFO_S *pMsgInfo)
+msg_error_t MmsPluginStorage::updateConfMessage(MSG_MESSAGE_INFO_S *pMsgInfo)
 {
        MSG_BEGIN();
 
@@ -774,10 +713,8 @@ MSG_ERROR_T MmsPluginStorage::updateConfMessage(MSG_MESSAGE_INFO_S *pMsgInfo)
        MSG_DEBUG("###### pMsgInfo->msgData = %s #######", pMmsRecvData->retrievedFilePath);
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
-       snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET MESSAGE_ID = '%s', FILE_PATH = '%s' WHERE REFERENCE_ID IN \
-                                       (SELECT REFERENCE_ID FROM %s WHERE MSG_ID = %d);",
-                                       MMS_PLUGIN_MESSAGE_TABLE_NAME, pMmsRecvData->szMsgID, pMmsRecvData->retrievedFilePath,
-                                       MSGFW_MESSAGE_TABLE_NAME, pMsgInfo->msgId);
+       snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET MESSAGE_ID = '%s', FILE_PATH = '%s' WHERE MSG_ID = %d;",
+                       MMS_PLUGIN_MESSAGE_TABLE_NAME, pMmsRecvData->szMsgID, pMmsRecvData->retrievedFilePath, pMsgInfo->msgId);
 
        MSG_DEBUG("SQLQuery = %s", sqlQuery);
 
@@ -790,7 +727,7 @@ MSG_ERROR_T MmsPluginStorage::updateConfMessage(MSG_MESSAGE_INFO_S *pMsgInfo)
 }
 
 
-MSG_ERROR_T MmsPluginStorage::updateMsgServerID(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S *pSendOptInfo)
+msg_error_t MmsPluginStorage::updateMsgServerID(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S *pSendOptInfo)
 {
        MSG_BEGIN();
 
@@ -799,10 +736,8 @@ MSG_ERROR_T MmsPluginStorage::updateMsgServerID(MSG_MESSAGE_INFO_S *pMsgInfo, MS
 
        MMS_RECV_DATA_S *pMmsRecvData = (MMS_RECV_DATA_S *)pMsgInfo->msgData;
 
-       snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET MESSAGE_ID = '%s' WHERE REFERENCE_ID IN \
-                                       (SELECT REFERENCE_ID FROM %s WHERE MSG_ID = %d);",
-                                       MMS_PLUGIN_MESSAGE_TABLE_NAME, pMmsRecvData->szMsgID,
-                                       MSGFW_MESSAGE_TABLE_NAME, pMsgInfo->msgId);
+       snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET MESSAGE_ID = '%s' WHERE MSG_ID = %d;",
+                       MMS_PLUGIN_MESSAGE_TABLE_NAME, pMmsRecvData->szMsgID, pMsgInfo->msgId);
 
        MSG_DEBUG("SQLQuery = %s", sqlQuery);
 
@@ -811,11 +746,9 @@ MSG_ERROR_T MmsPluginStorage::updateMsgServerID(MSG_MESSAGE_INFO_S *pMsgInfo, MS
 
        if (pSendOptInfo != NULL) {
                memset(sqlQuery, 0x00, sizeof(sqlQuery));
-               snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET ASK_DELIVERY_REPORT = %d, ASK_READ_REPLY = %d, PRIORITY = %d, EXPIRY_TIME = %d WHERE REFERENCE_ID IN \
-                                               (SELECT REFERENCE_ID FROM %s WHERE MSG_ID = %d);",
-                                               MMS_PLUGIN_ATTRIBUTE_TABLE_NAME, pSendOptInfo->bDeliverReq, pSendOptInfo->option.mmsSendOptInfo.bReadReq,
-                                               pSendOptInfo->option.mmsSendOptInfo.priority, pSendOptInfo->option.mmsSendOptInfo.expiryTime.time,
-                                               MSGFW_MESSAGE_TABLE_NAME, pMsgInfo->msgId);
+               snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET ASK_DELIVERY_REPORT = %d, ASK_READ_REPLY = %d, PRIORITY = %d, EXPIRY_TIME = %d \
+                               WHERE MSG_ID = %d;", MMS_PLUGIN_MESSAGE_TABLE_NAME, pSendOptInfo->bDeliverReq, pSendOptInfo->option.mmsSendOptInfo.bReadReq,
+                               pSendOptInfo->option.mmsSendOptInfo.priority, pSendOptInfo->option.mmsSendOptInfo.expiryTime.time, pMsgInfo->msgId);
 
                MSG_DEBUG("SQLQuery = %s", sqlQuery);
 
@@ -832,14 +765,14 @@ MSG_ERROR_T MmsPluginStorage::updateMsgServerID(MSG_MESSAGE_INFO_S *pMsgInfo, MS
 }
 
 
-MSG_ERROR_T MmsPluginStorage::updateNetStatus(MSG_MESSAGE_ID_T msgId, MSG_NETWORK_STATUS_T netStatus)
+msg_error_t MmsPluginStorage::updateNetStatus(msg_message_id_t msgId, msg_network_status_t netStatus)
 {
        char sqlQuery[MAX_QUERY_LEN + 1];
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
        snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET NETWORK_STATUS = %d WHERE MSG_ID = %d;",
-                                       MSGFW_MESSAGE_TABLE_NAME, netStatus, msgId);
+                       MSGFW_MESSAGE_TABLE_NAME, netStatus, msgId);
 
        if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS)
                return MSG_ERR_DB_EXEC;
@@ -848,15 +781,14 @@ MSG_ERROR_T MmsPluginStorage::updateNetStatus(MSG_MESSAGE_ID_T msgId, MSG_NETWOR
 }
 
 
-MSG_ERROR_T MmsPluginStorage::updateDeliveryReport(MSG_MESSAGE_ID_T msgId, MmsMsgMultiStatus *pStatus)
+msg_error_t MmsPluginStorage::updateDeliveryReport(msg_message_id_t msgId, MmsMsgMultiStatus *pStatus)
 {
        char sqlQuery[MAX_QUERY_LEN + 1];
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
-       snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET DELIVERY_REPORT_STATUS = %d, DELIVERY_REPORT_TIME = %ld \
-                                     WHERE MSG_ID = %d;",
-                               MSGFW_MESSAGE_TABLE_NAME, pStatus->msgStatus, pStatus->handledTime, msgId);
+       snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET DELIVERY_REPORT_STATUS = %d, DELIVERY_REPORT_TIME = %ld WHERE MSG_ID = %d;",
+                       MSGFW_MESSAGE_TABLE_NAME, pStatus->msgStatus, pStatus->handledTime, msgId);
 
        if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS)
                return MSG_ERR_DB_EXEC;
@@ -865,14 +797,13 @@ MSG_ERROR_T MmsPluginStorage::updateDeliveryReport(MSG_MESSAGE_ID_T msgId, MmsMs
 }
 
 
-MSG_ERROR_T MmsPluginStorage::updateReadReport(MSG_MESSAGE_ID_T msgId, MmsMsgMultiStatus *pStatus)
+msg_error_t MmsPluginStorage::updateReadReport(msg_message_id_t msgId, MmsMsgMultiStatus *pStatus)
 {
        char sqlQuery[MAX_QUERY_LEN + 1];
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
-       snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET READ_REPORT_STATUS = %d, READ_REPORT_TIME = %lu \
-                                     WHERE MSG_ID = %d;",
+       snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET READ_REPORT_STATUS = %d, READ_REPORT_TIME = %lu WHERE MSG_ID = %d;",
                        MSGFW_MESSAGE_TABLE_NAME, pStatus->readStatus, pStatus->readTime, msgId);
 
 
@@ -883,7 +814,7 @@ MSG_ERROR_T MmsPluginStorage::updateReadReport(MSG_MESSAGE_ID_T msgId, MmsMsgMul
 }
 
 
-MSG_ERROR_T MmsPluginStorage::updateMmsAttrib(MSG_MESSAGE_ID_T msgId, MmsAttrib *attrib, MSG_SUB_TYPE_T msgSubType)
+msg_error_t MmsPluginStorage::updateMmsAttrib(msg_message_id_t msgId, MmsAttrib *attrib, MSG_SUB_TYPE_T msgSubType)
 {
        MSG_BEGIN();
 
@@ -892,15 +823,11 @@ MSG_ERROR_T MmsPluginStorage::updateMmsAttrib(MSG_MESSAGE_ID_T msgId, MmsAttrib
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
        if (msgSubType == MSG_NOTIFICATIONIND_MMS) {
-               snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET EXPIRY_TIME = %d WHERE REFERENCE_ID IN \
-                                                               (SELECT REFERENCE_ID FROM %s WHERE MSG_ID = %d);",
-                                                               MMS_PLUGIN_ATTRIBUTE_TABLE_NAME, attrib->expiryTime.time,
-                                                               MSGFW_MESSAGE_TABLE_NAME, msgId);
+               snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET EXPIRY_TIME = %d WHERE MSG_ID = %d;",
+                               MMS_PLUGIN_MESSAGE_TABLE_NAME, attrib->expiryTime.time, msgId);
        } else if (msgSubType == MSG_RETRIEVE_AUTOCONF_MMS || msgSubType == MSG_RETRIEVE_MANUALCONF_MMS) {
-               snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET ASK_DELIVERY_REPORT = %d, ASK_READ_REPLY = %d, PRIORITY = %d WHERE REFERENCE_ID IN \
-                                                               (SELECT REFERENCE_ID FROM %s WHERE MSG_ID = %d);",
-                                                               MMS_PLUGIN_ATTRIBUTE_TABLE_NAME, attrib->bAskDeliveryReport, attrib->bAskReadReply, attrib->priority,
-                                                               MSGFW_MESSAGE_TABLE_NAME, msgId);
+               snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET ASK_DELIVERY_REPORT = %d, ASK_READ_REPLY = %d, PRIORITY = %d WHERE MSG_ID = %d;",
+                               MMS_PLUGIN_MESSAGE_TABLE_NAME, attrib->bAskDeliveryReport, attrib->bAskReadReply, attrib->priority, msgId);
        }
 
        MSG_DEBUG("QUERY : [%s]", sqlQuery);
@@ -914,15 +841,14 @@ MSG_ERROR_T MmsPluginStorage::updateMmsAttrib(MSG_MESSAGE_ID_T msgId, MmsAttrib
 }
 
 
-MSG_ERROR_T MmsPluginStorage::updateMmsAttachCount(MSG_MESSAGE_ID_T msgId, int count)
+msg_error_t MmsPluginStorage::updateMmsAttachCount(msg_message_id_t msgId, int count)
 {
        MSG_BEGIN();
 
        char sqlQuery[MAX_QUERY_LEN + 1];
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
-       snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET ATTACHMENT_COUNT = %d WHERE MSG_ID = %d;",
-                                                               MSGFW_MESSAGE_TABLE_NAME, count, msgId);
+       snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET ATTACHMENT_COUNT = %d WHERE MSG_ID = %d;", MSGFW_MESSAGE_TABLE_NAME, count, msgId);
 
        if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS) {
                MSG_DEBUG("Fail to execute query [%s]", sqlQuery);
@@ -934,7 +860,7 @@ MSG_ERROR_T MmsPluginStorage::updateMmsAttachCount(MSG_MESSAGE_ID_T msgId, int c
        return MSG_SUCCESS;
 }
 
-MmsMsgMultiStatus *MmsPluginStorage::getMultiStatus(MSG_MESSAGE_ID_T msgId)
+MmsMsgMultiStatus *MmsPluginStorage::getMultiStatus(msg_message_id_t msgId)
 {
        MSG_BEGIN();
 
@@ -944,11 +870,9 @@ MmsMsgMultiStatus *MmsPluginStorage::getMultiStatus(MSG_MESSAGE_ID_T msgId)
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
-       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT B.ADDRESS_VAL, A.DELIVERY_REPORT_STATUS, A.DELIVERY_REPORT_TIME, \
-                                                 A.READ_REPORT_STATUS, A.READ_REPORT_TIME \
-                                       FROM %s A, %s B \
-                                    WHERE A.MSG_ID = %d AND A.ADDRESS_ID = B.ADDRESS_ID;",
-                               MSGFW_MESSAGE_TABLE_NAME, MSGFW_ADDRESS_TABLE_NAME, msgId);
+       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT B.ADDRESS_VAL, A.DELIVERY_REPORT_STATUS, A.DELIVERY_REPORT_TIME, A.READ_REPORT_STATUS, A.READ_REPORT_TIME \
+                       FROM %s A, %s B WHERE A.MSG_ID = %d AND A.CONV_ID = B.CONV_ID;",
+                       MSGFW_MESSAGE_TABLE_NAME, MSGFW_ADDRESS_TABLE_NAME, msgId);
 
        if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS)
                MSG_DEBUG("MSG_ERR_DB_PREPARE");
@@ -963,9 +887,9 @@ MmsMsgMultiStatus *MmsPluginStorage::getMultiStatus(MSG_MESSAGE_ID_T msgId)
                        MSG_DEBUG("### szTo = %s ###", pMultiStatus->szTo);
                }
 
-               pMultiStatus->msgStatus = (MSG_DELIVERY_REPORT_STATUS_T)dbHandle.columnInt(1);
+               pMultiStatus->msgStatus = (msg_delivery_report_status_t)dbHandle.columnInt(1);
                pMultiStatus->handledTime = dbHandle.columnInt(2);
-               pMultiStatus->readStatus = (MSG_READ_REPORT_STATUS_T)dbHandle.columnInt(3);
+               pMultiStatus->readStatus = (msg_read_report_status_t)dbHandle.columnInt(3);
                pMultiStatus->readTime = dbHandle.columnInt(4);
        } else {
                MSG_DEBUG("MSG_ERR_DB_STEP");
@@ -981,15 +905,16 @@ MmsMsgMultiStatus *MmsPluginStorage::getMultiStatus(MSG_MESSAGE_ID_T msgId)
 }
 
 
-void MmsPluginStorage::getMmsAttrib(MSG_MESSAGE_ID_T msgId, MmsMsg *pMmsMsg)
+void MmsPluginStorage::getMmsAttrib(msg_message_id_t msgId, MmsMsg *pMmsMsg)
 {
        char sqlQuery[MAX_QUERY_LEN + 1];
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
-       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT * FROM %s WHERE REFERENCE_ID IN \
-                                               (SELECT REFERENCE_ID FROM %s WHERE MSG_ID = %d);",
-                                               MMS_PLUGIN_ATTRIBUTE_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME, msgId);
+       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT VERSION, DATA_TYPE,  DATE, HIDE_ADDRESS, ASK_DELIVERY_REPORT, REPORT_ALLOWED, \
+                       READ_REPORT_ALLOWED_TYPE, ASK_READ_REPLY, READ, READ_REPORT_SEND_STATUS, READ_REPORT_SENT, PRIORITY, \
+                       MSG_SIZE, MSG_CLASS, EXPIRY_TIME, CUSTOM_DELIVERY_TIME, DELIVERY_TIME, MSG_STATUS FROM %s WHERE MSG_ID = %d;",
+                       MMS_PLUGIN_MESSAGE_TABLE_NAME, msgId);
 
        if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS)
                MSG_DEBUG("MSG_ERR_DB_PREPARE");
@@ -1011,16 +936,16 @@ void MmsPluginStorage::getMmsAttrib(MSG_MESSAGE_ID_T msgId, MmsMsg *pMmsMsg)
                pMmsMsg->mmsAttrib.msgClass = (MmsMsgClass)dbHandle.columnInt(14);
                pMmsMsg->mmsAttrib.expiryTime.time = dbHandle.columnInt(15);
                pMmsMsg->mmsAttrib.deliveryTime.time = dbHandle.columnInt(17);
-               pMmsMsg->mmsAttrib.msgStatus = (MSG_DELIVERY_REPORT_STATUS_T)dbHandle.columnInt(18);
+               pMmsMsg->mmsAttrib.msgStatus = (msg_delivery_report_status_t)dbHandle.columnInt(18);
        }
 
        dbHandle.finalizeQuery();
 }
 
 
-MSG_ERROR_T MmsPluginStorage::getMmsMessageId(MSG_MESSAGE_ID_T selectedMsgId, MmsMsg *pMmsMsg)
+msg_error_t MmsPluginStorage::getMmsMessageId(msg_message_id_t selectedMsgId, MmsMsg *pMmsMsg)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        int rowCnt = 0;
 
@@ -1028,9 +953,8 @@ MSG_ERROR_T MmsPluginStorage::getMmsMessageId(MSG_MESSAGE_ID_T selectedMsgId, Mm
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
-       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT MESSAGE_ID FROM %s WHERE REFERENCE_ID IN \
-                                               (SELECT REFERENCE_ID FROM %s WHERE MSG_ID = %d);",
-                                               MMS_PLUGIN_MESSAGE_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME, selectedMsgId);
+       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT MESSAGE_ID FROM %s WHERE MSG_ID = %d;",
+                       MMS_PLUGIN_MESSAGE_TABLE_NAME, selectedMsgId);
 
        err = dbHandle.getTable(sqlQuery, &rowCnt);
 
@@ -1054,9 +978,9 @@ MSG_ERROR_T MmsPluginStorage::getMmsMessageId(MSG_MESSAGE_ID_T selectedMsgId, Mm
 }
 
 
-int MmsPluginStorage::getMmsVersion(MSG_MESSAGE_ID_T selectedMsgId)
+int MmsPluginStorage::getMmsVersion(msg_message_id_t selectedMsgId)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
        int rowCnt = 0;
 
        int     version = 0;
@@ -1065,9 +989,8 @@ int MmsPluginStorage::getMmsVersion(MSG_MESSAGE_ID_T selectedMsgId)
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
-       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT VERSION FROM %s WHERE REFERENCE_ID IN \
-                                               (SELECT REFERENCE_ID FROM %s WHERE MSG_ID = %d);",
-                                               MMS_PLUGIN_ATTRIBUTE_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME, selectedMsgId);
+       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT VERSION FROM %s WHERE MSG_ID = %d;",
+                       MMS_PLUGIN_MESSAGE_TABLE_NAME, selectedMsgId);
 
        MSG_DEBUG("SqlQuery = %s", sqlQuery);
 
@@ -1093,15 +1016,14 @@ int MmsPluginStorage::getMmsVersion(MSG_MESSAGE_ID_T selectedMsgId)
 }
 
 
-MSG_ERROR_T MmsPluginStorage::getContentLocation(MSG_MESSAGE_INFO_S *pMsgInfo)
+msg_error_t MmsPluginStorage::getContentLocation(MSG_MESSAGE_INFO_S *pMsgInfo)
 {
        char sqlQuery[MAX_QUERY_LEN + 1];
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
-       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT CONTENTS_LOCATION FROM %s WHERE REFERENCE_ID IN \
-                                               (SELECT REFERENCE_ID FROM %s WHERE MSG_ID = %d);",
-                                               MMS_PLUGIN_MESSAGE_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME, pMsgInfo->msgId);
+       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT CONTENTS_LOCATION FROM %s WHERE MSG_ID = %d;",
+                       MMS_PLUGIN_MESSAGE_TABLE_NAME, pMsgInfo->msgId);
 
        if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS)
                return MSG_ERR_DB_PREPARE;
@@ -1124,15 +1046,14 @@ MSG_ERROR_T MmsPluginStorage::getContentLocation(MSG_MESSAGE_INFO_S *pMsgInfo)
 
 
 /* reject_msg_support */
-MSG_ERROR_T MmsPluginStorage::getTrID(MSG_MESSAGE_INFO_S *pMsgInfo,char *pszTrID,int nBufferLen)
+msg_error_t MmsPluginStorage::getTrID(MSG_MESSAGE_INFO_S *pMsgInfo,char *pszTrID,int nBufferLen)
 {
        char sqlQuery[MAX_QUERY_LEN + 1];
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
-       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT TRANSACTION_ID FROM %s WHERE REFERENCE_ID IN \
-                                               (SELECT REFERENCE_ID FROM %s WHERE MSG_ID = %d);",
-                                               MMS_PLUGIN_MESSAGE_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME, pMsgInfo->msgId);
+       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT TRANSACTION_ID FROM %s WHERE MSG_ID = %d;",
+                       MMS_PLUGIN_MESSAGE_TABLE_NAME, pMsgInfo->msgId);
 
        if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS)
                return MSG_ERR_DB_PREPARE;
@@ -1155,15 +1076,14 @@ MSG_ERROR_T MmsPluginStorage::getTrID(MSG_MESSAGE_INFO_S *pMsgInfo,char *pszTrID
 /* reject_msg_support */
 
 
-MSG_ERROR_T MmsPluginStorage::getMmsRawFilePath(MSG_MESSAGE_ID_T msgId, char *pFilepath)
+msg_error_t MmsPluginStorage::getMmsRawFilePath(msg_message_id_t msgId, char *pFilepath)
 {
        char sqlQuery[MAX_QUERY_LEN + 1];
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
-       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT FILE_PATH FROM %s WHERE REFERENCE_ID IN \
-                                               (SELECT REFERENCE_ID FROM %s WHERE MSG_ID = %d);",
-                                               MMS_PLUGIN_MESSAGE_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME, msgId);
+       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT FILE_PATH FROM %s WHERE MSG_ID = %d;",
+                       MMS_PLUGIN_MESSAGE_TABLE_NAME, msgId);
 
        if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS)
                return MSG_ERR_DB_PREPARE;
@@ -1188,7 +1108,7 @@ int MmsPluginStorage::searchMsgId(char *toNumber, char *szMsgID)
 {
        int msgId = -1;
 
-       MSG_FOLDER_ID_T folderId = MSG_SENTBOX_ID;
+       msg_folder_id_t folderId = MSG_SENTBOX_ID;
 
        char sqlQuery[MAX_QUERY_LEN + 1];
 
@@ -1197,8 +1117,8 @@ int MmsPluginStorage::searchMsgId(char *toNumber, char *szMsgID)
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
        snprintf(sqlQuery, sizeof(sqlQuery), "SELECT A.MSG_ID FROM %s A, %s B \
-                                WHERE A.REFERENCE_ID = B.REFERENCE_ID AND A.FOLDER_ID = %d AND B.MESSAGE_ID LIKE '%%%s%%'",
-                               MSGFW_MESSAGE_TABLE_NAME, MMS_PLUGIN_MESSAGE_TABLE_NAME, folderId, szMsgID);
+                       WHERE A.MSG_ID = B.MSG_ID AND A.FOLDER_ID = %d AND B.MESSAGE_ID LIKE '%%%s%%'",
+                       MSGFW_MESSAGE_TABLE_NAME, MMS_PLUGIN_MESSAGE_TABLE_NAME, folderId, szMsgID);
 
        MSG_DEBUG("sqlQuery [%s]", sqlQuery);
 
@@ -1215,7 +1135,7 @@ int MmsPluginStorage::searchMsgId(char *toNumber, char *szMsgID)
 }
 
 
-MSG_ERROR_T MmsPluginStorage::setReadReportSendStatus(MSG_MESSAGE_ID_T msgId, int readReportSendStatus)
+msg_error_t MmsPluginStorage::setReadReportSendStatus(msg_message_id_t msgId, int readReportSendStatus)
 {
        bool bReadReportSent = false;
 
@@ -1228,10 +1148,8 @@ MSG_ERROR_T MmsPluginStorage::setReadReportSendStatus(MSG_MESSAGE_ID_T msgId, in
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
-       snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET READ_REPORT_SEND_STATUS = %d, READ_REPORT_SENT = %d WHERE REFERENCE_ID IN \
-                                       (SELECT REFERENCE_ID FROM %s WHERE MSG_ID = %d);",
-                                       MMS_PLUGIN_ATTRIBUTE_TABLE_NAME, (MmsRecvReadReportSendStatus)readReportSendStatus, (int)bReadReportSent,
-                                       MSGFW_MESSAGE_TABLE_NAME, msgId);
+       snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET READ_REPORT_SEND_STATUS = %d, READ_REPORT_SENT = %d WHERE MSG_ID = %d;",
+                       MMS_PLUGIN_MESSAGE_TABLE_NAME, (MmsRecvReadReportSendStatus)readReportSendStatus, (int)bReadReportSent, msgId);
 
        if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS)
                return MSG_ERR_DB_EXEC;
@@ -1240,45 +1158,7 @@ MSG_ERROR_T MmsPluginStorage::setReadReportSendStatus(MSG_MESSAGE_ID_T msgId, in
 }
 
 
-bool MmsPluginStorage::checkExistedMessage(MSG_MESSAGE_ID_T msgId)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       char sqlQuery[MAX_QUERY_LEN + 1];
-
-       memset(sqlQuery, 0x00, sizeof(sqlQuery));
-
-       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT REFERENCE_ID FROM %s WHERE REFERENCE_ID IN \
-                                       (SELECT REFERENCE_ID FROM %s WHERE MSG_ID = %d);",
-                                       MMS_PLUGIN_MESSAGE_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME, msgId);
-
-       int rowCnt = 0;
-       int refId = 0;
-
-       err = dbHandle.getTable(sqlQuery, &rowCnt);
-
-       // No record or other error
-       if (err != MSG_SUCCESS) {
-               MSG_DEBUG("result error");
-               dbHandle.freeTable();
-               return false;
-       }
-
-       refId = dbHandle.getColumnToInt(1);
-
-       MSG_DEBUG("refId : [%d]", refId);
-
-       if (rowCnt > 0) {
-               dbHandle.freeTable();
-               return true;
-       } else {
-               dbHandle.freeTable();
-               return false;
-       }
-}
-
-
-MSG_ERROR_T MmsPluginStorage::getMsgText(MMS_MESSAGE_DATA_S *pMmsMsg, char *pMsgText)
+msg_error_t MmsPluginStorage::getMsgText(MMS_MESSAGE_DATA_S *pMmsMsg, char *pMsgText)
 {
        MMS_PAGE_S *pPage = NULL;
        MMS_MEDIA_S *pMedia = NULL;
@@ -1328,7 +1208,7 @@ MSG_ERROR_T MmsPluginStorage::getMsgText(MMS_MESSAGE_DATA_S *pMmsMsg, char *pMsg
 }
 
 
-MSG_ERROR_T MmsPluginStorage::makeThumbnail(MMS_MESSAGE_DATA_S *pMmsMsg, char *pThumbnailPath, char *szFileName)
+msg_error_t MmsPluginStorage::makeThumbnail(MMS_MESSAGE_DATA_S *pMmsMsg, char *pThumbnailPath, char *szFileName)
 {
        MMS_PAGE_S *pPage = NULL;
        MMS_MEDIA_S *pMedia = NULL;
@@ -1518,11 +1398,11 @@ MSG_ERROR_T MmsPluginStorage::makeThumbnail(MMS_MESSAGE_DATA_S *pMmsMsg, char *p
 }
 
 
-MSG_ERROR_T MmsPluginStorage::addMmsNoti(MSG_MESSAGE_INFO_S *pMsgInfo)
+msg_error_t MmsPluginStorage::addMmsNoti(MSG_MESSAGE_INFO_S *pMsgInfo)
 {
        MSG_BEGIN();
 
-       MSG_ERROR_T     err = MSG_SUCCESS;
+       msg_error_t     err = MSG_SUCCESS;
 
        err = MsgInsertMmsReportToNoti(&dbHandle, pMsgInfo);
 
@@ -1532,11 +1412,11 @@ MSG_ERROR_T MmsPluginStorage::addMmsNoti(MSG_MESSAGE_INFO_S *pMsgInfo)
 }
 
 /* This API is not used anywhere now */
-MSG_ERROR_T    MmsPluginStorage::plgGetRestoreMessage(MSG_MESSAGE_INFO_S *pMsg, MSG_SENDINGOPT_INFO_S *pSendOptInfo, MMS_MESSAGE_DATA_S *pMmsMsg, char **pDestMsg, char *filePath)
+msg_error_t    MmsPluginStorage::plgGetRestoreMessage(MSG_MESSAGE_INFO_S *pMsg, MSG_SENDINGOPT_INFO_S *pSendOptInfo, MMS_MESSAGE_DATA_S *pMmsMsg, char **pDestMsg, char *filePath)
 {
        MSG_BEGIN();
 
-       MSG_ERROR_T     err = MSG_SUCCESS;
+       msg_error_t     err = MSG_SUCCESS;
        int partCnt = 0;
        MsgType partHeader;
        MmsAttrib pMmsAttrib;
index d7fc5cf..3379751 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include <stdio.h>
 #include "MmsPluginEventHandler.h"
@@ -104,7 +104,7 @@ void MmsPluginTransport::submitRequest(const MSG_REQUEST_INFO_S *pReqInfo)
                reqItem.eMmsPduType = eMMS_READREPORT_REQ;
                reqItem.eHttpCmdType = eHTTP_CMD_POST_TRANSACTION;
                reqItem.pPostData = MsgOpenAndReadMmsFile(pReqInfo->msgInfo.msgData, 0, -1, &reqItem.postDataLen);
-               // remove mms file
+               // remove x-Read-Rec.ind file
                remove(pReqInfo->msgInfo.msgData);
                break;
 
@@ -114,6 +114,8 @@ void MmsPluginTransport::submitRequest(const MSG_REQUEST_INFO_S *pReqInfo)
                reqItem.eMmsPduType = eMMS_READREC_IND;
                reqItem.eHttpCmdType = eHTTP_CMD_POST_TRANSACTION;
                reqItem.pPostData = MsgOpenAndReadMmsFile(pReqInfo->msgInfo.msgData, 0, -1, &reqItem.postDataLen);
+               // remove x-Read-Rec.ind file
+               remove(pReqInfo->msgInfo.msgData);
                break;
 
        case MSG_FORWARD_MMS:
@@ -130,7 +132,7 @@ void MmsPluginTransport::submitRequest(const MSG_REQUEST_INFO_S *pReqInfo)
 }
 
 
-void MmsPluginTransport::cancelRequest(MSG_REQUEST_ID_T reqId)
+void MmsPluginTransport::cancelRequest(msg_request_id_t reqId)
 {
 
 
index 9fa7ceb..bff7fc6 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include <glib.h>
 #include <curl/curl.h>
@@ -148,7 +148,7 @@ void updatePduType(mmsTranQEntity *qEntity)
                qEntity->eMmsPduType = eMMS_SEND_CONF;
                break;
        case eMMS_READREPORT_REQ:
-               qEntity->eMmsPduType = eMMS_SEND_CONF;
+               qEntity->eMmsPduType = eMMS_READREPORT_CONF;
                break;
        case eMMS_RETRIEVE_MANUAL_CONF:
                qEntity->eMmsPduType = eMMS_ACKNOWLEDGE_IND;
index 8e1b35f..84ac70e 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include "MsgTypes.h"
 
index 9e50704..ebd8cca 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef MMS_PLUGIN_CODEC_H
 #define MMS_PLUGIN_CODEC_H
@@ -209,8 +209,8 @@ typedef struct {
        MmsReportAllowed reportAllowed;
        char szContentLocation[MMS_LOCATION_LEN + 1];
 
-       MSG_DELIVERY_REPORT_STATUS_T msgStatus;
-       MSG_READ_REPORT_STATUS_T readStatus;
+       msg_delivery_report_status_t msgStatus;
+       msg_read_report_status_t readStatus;
 
        MmsReplyCharge replyCharge;
 
@@ -273,10 +273,10 @@ bool _MmsEncodeMsg(void);
 bool _MmsEncodeSendReq(FILE *pFile, MmsMsg *pMsg);
 bool _MmsEncodeTemplate(FILE *pFile, MmsMsg *pMsg);    // just encode MMS Body without any header.
 bool _MmsEncodeAckInd(FILE *pFile, char *szTrID, bool bReportAllowed);
-bool _MmsEncodeNotiRespInd(FILE *pFile, char *szTrID, MSG_DELIVERY_REPORT_STATUS_T iStatus, bool bReportAllowed);
+bool _MmsEncodeNotiRespInd(FILE *pFile, char *szTrID, msg_delivery_report_status_t iStatus, bool bReportAllowed);
 bool _MmsEncodeForwardReq(FILE *pFile, char *szContentLocation, char *szForwardTo, char *szForwardCc, char *szForwardBcc);
-bool _MmsEncodeReadReport10(FILE *pFile, MmsMsg *pMsg, MSG_READ_REPORT_STATUS_T mmsReadStatus);
-bool _MmsEncodeReadReport11(FILE *pFile, MmsMsg *pMsg, MSG_READ_REPORT_STATUS_T mmsReadStatus);
+bool _MmsEncodeReadReport10(FILE *pFile, MmsMsg *pMsg, msg_read_report_status_t mmsReadStatus);
+bool _MmsEncodeReadReport11(FILE *pFile, MmsMsg *pMsg, msg_read_report_status_t mmsReadStatus);
 
 
 bool MmsBinaryEncodeMsgBody(FILE *pFile, MsgType *pType, MsgBody *pBody, int nPartCount, bool bTemplate);//NEW_TEMPLATE
@@ -361,10 +361,10 @@ bool MsgMakeFileName(int iMsgType, char *szFileName, int nUntitleIndex);
 bool MsgMakeFileName(int iMsgType, char *szFileName, MsgDrmType drmType, int nUntitleIndex);
 #endif
 bool MsgGetFileNameWithoutExtension(char *szOutputName, char *szName);
-int MmsGetMediaPartCount(MSG_MESSAGE_ID_T msgId);
+int MmsGetMediaPartCount(msg_message_id_t msgId);
 bool MmsGetMediaPartHeader(int index, MsgType *pHeader);
 bool MmsGetMsgAttrib(MmsMsgID msgID, MmsAttrib *pAttrib);
-bool _MmsReadMsgBody(MSG_MESSAGE_ID_T msgID, bool bSavePartsAsTempFiles, bool bRetrieved, char *retrievedPath);
+bool _MmsReadMsgBody(msg_message_id_t msgID, bool bSavePartsAsTempFiles, bool bRetrieved, char *retrievedPath);
 
 #ifdef __SUPPORT_DRM__
 void _MsgFreeDRMInfo(MsgDRMInfo *pDrmInfo);
index 3c6cb03..f2bf4c8 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef MMSPLUGINCONNMANWRAPPER_H
 #define MMSPLUGINCONNMANWRAPPER_H
index 860fd15..e15a223 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #define        MMS_INVALID_MSG_ID      -1
 
index 7b9cfe8..a6613a5 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef MMS_PLUGIN_DEBUG_H
 #define        MMS_PLUGIN_DEBUG_H
 const char *MmsDebugGetMimeType(MimeType mimeType);
 const char *MmsDebugGetMmsReport(MmsReport report);
 const char *MmsDebugGetMmsReportAllowed(MmsReportAllowed reportAllowed);
-const char *MmsDebugGetMmsReadStatus(MSG_READ_REPORT_STATUS_T readStatus);
+const char *MmsDebugGetMmsReadStatus(msg_read_report_status_t readStatus);
 const char *MmsDebugGetMsgType(MmsMsgType msgType);
 const char *MmsDebugGetResponseStatus(MmsResponseStatus responseStatus);
 const char *MmsDebugGetRetrieveStatus(MmsRetrieveStatus retrieveStatus);
-const char *MmsDebugGetMsgStatus(MSG_DELIVERY_REPORT_STATUS_T msgStatus);
+const char *MmsDebugGetMsgStatus(msg_delivery_report_status_t msgStatus);
 const char *MmsDebugGetMsgClass(MmsMsgClass msgClass);
 const char *MmsDebugGetDataType(MmsDataType dataType);
 #ifdef MMS_PLUGIN_DEBUG_ENABLE
index 0cb66d1..6044337 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include "MsgMmsTypes.h"
 #include "MmsPluginMessage.h"
index 2b9bf8b..884c5b5 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef MMS_PLUGIN_EVENT_HANDLER_H
 #define MMS_PLUGIN_EVENT_HANDLER_H
@@ -34,7 +34,7 @@ public:
        static MmsPluginEventHandler *instance();
 
        void registerListener(MSG_PLUGIN_LISTENER_S *pListener);
-       void handleSentStatus(int TapiReqId, MSG_NETWORK_STATUS_T NetStatus);
+       void handleSentStatus(int TapiReqId, msg_network_status_t NetStatus);
        void handleMmsReceivedData(mmsTranQEntity *pRequest, char *pRetrivedFilePath);
        void handleMmsError(mmsTranQEntity *pRequest);
 
index bee0dc5..920a231 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef MMSPLUGINHTTP_H
 #define MMSPLUGINHTTP_H
@@ -23,8 +23,6 @@
 #include "MmsPluginTypes.h"
 #include "MsgMutex.h"
 
-#include <curl/curl.h>
-
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -34,18 +32,16 @@ extern "C" {
 }
 #endif
 
+
 class MmsPluginHttpAgent
 {
        public:
                static MmsPluginHttpAgent *instance();
 
-
-               void setHttpWaitingFlag(bool val);
-               bool getHttpWaitingFlag();
-
                int cmdRequest(MMS_HTTP_CMD_TYPE_T cmdType);
 
                int setSession(mmsTranQEntity *qEntity);
+
                void clearSession();
 
                void SetMMSProfile();
@@ -58,12 +54,9 @@ class MmsPluginHttpAgent
        private:
                static MmsPluginHttpAgent *pInstance;
 
-
                MmsPluginHttpAgent();
                ~MmsPluginHttpAgent();
 
-               bool waiting;
-
                MMS_PLUGIN_HTTP_CONTEXT_S mmsPlgCd;
 
                std::map<MMS_HTTP_CMD_TYPE_T,int(*)(MMS_PLUGIN_HTTP_DATA_S *)> httpCmdHandler;
@@ -91,8 +84,5 @@ enum _MMS_HTTP_HEADER_FIELD_E {
        MMS_HH_USER_AGENT,
        MMS_HH_WAP_PROFILE
 };
-void HttpHeaderInfo(curl_slist *responseHeaders, char *szUrl, int ulContentLen);
-bool MsgMmsGetCustomHTTPHeader(MMS_HTTP_HEADER_FIELD_T httpHeaderItem, char *szHeaderBuffer);
-void MsgMmsGetHost(char *szHost, int nBufferLen);
 
 #endif
index a22cf27..ada68bb 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef MMS_PLUGIN_INTERNAL_H
 #define MMS_PLUGIN_INTERNAL_H
@@ -38,7 +38,7 @@ class MmsPluginInternal
                void processSendConf(MSG_MESSAGE_INFO_S *pMsgInfo, mmsTranQEntity *pRequest);
                void processRetrieveConf(MSG_MESSAGE_INFO_S *pMsgInfo, mmsTranQEntity *pRequest, char *pRetrivedFilePath);
                void processForwardConf(MSG_MESSAGE_INFO_S *pMsgInfo, mmsTranQEntity *pRequest);
-               bool encodeNotifyRespInd(char *szTrID, MSG_DELIVERY_REPORT_STATUS_T iStatus, bool bReportAllowed, char *pSendFilePath);
+               bool encodeNotifyRespInd(char *szTrID, msg_delivery_report_status_t iStatus, bool bReportAllowed, char *pSendFilePath);
                bool encodeAckInd(char *szTrID, bool bReportAllowed, char *pSendFilePath);
 
        private:
@@ -52,7 +52,7 @@ class MmsPluginInternal
                void processReadOrgInd(MSG_MESSAGE_INFO_S *pMsgInfo);
                bool checkRejectNotiInd(int roamState, bool bReportAllowed, char *pSendFilePath);
                bool getMmsReport(MmsReport mmsReport);
-               const char *getMmsDeliveryStatus(MSG_DELIVERY_REPORT_STATUS_T deliveryStatus);
-               const char *getMmsReadStatus(MSG_READ_REPORT_STATUS_T readStatus);
+               const char *getMmsDeliveryStatus(msg_delivery_report_status_t deliveryStatus);
+               const char *getMmsReadStatus(msg_read_report_status_t readStatus);
 };
 #endif
index 8e9a652..29cefa9 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef _UTY_MIME_H_
 #define _UTY_MIME_H_
index a90a347..c01ec76 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef MMS_PLUGIN_MAIN_H
 #define MMS_PLUGIN_MAIN_H
@@ -32,27 +32,27 @@ extern "C"
 /*==================================================================================================
                                                        FUNCTION PROTOTYPES
 ==================================================================================================*/
-MSG_ERROR_T MmsInitialize();
+msg_error_t MmsInitialize();
 
-MSG_ERROR_T MmsFinalize();
+msg_error_t MmsFinalize();
 
-MSG_ERROR_T MmsRegisterListener(MSG_PLUGIN_LISTENER_S *pListener);
+msg_error_t MmsRegisterListener(MSG_PLUGIN_LISTENER_S *pListener);
 
-MSG_ERROR_T MmsSubmitRequest(MSG_REQUEST_INFO_S *pReqInfo, bool bReqCb);
+msg_error_t MmsSubmitRequest(MSG_REQUEST_INFO_S *pReqInfo);
 
-MSG_ERROR_T MmsAddMessage(MSG_MESSAGE_INFO_S *pMsg, MSG_SENDINGOPT_INFO_S *pSendOptInfo, char *pFileData);
+msg_error_t MmsAddMessage(MSG_MESSAGE_INFO_S *pMsg, MSG_SENDINGOPT_INFO_S *pSendOptInfo, char *pFileData);
 
-MSG_ERROR_T MmsProcessReceivedInd(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_REQUEST_INFO_S *pRequest, bool *bReject);
+msg_error_t MmsProcessReceivedInd(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_REQUEST_INFO_S *pRequest, bool *bReject);
 
-MSG_ERROR_T MmsUpdateMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S *pSendOptInfo, char *pFileData);
+msg_error_t MmsUpdateMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S *pSendOptInfo, char *pFileData);
 
-MSG_ERROR_T MmsGetMmsMessage(MSG_MESSAGE_INFO_S *pMsg,  MSG_SENDINGOPT_INFO_S *pSendOptInfo, MMS_MESSAGE_DATA_S *pMmsMsg, char **pDestMsg);
+msg_error_t MmsGetMmsMessage(MSG_MESSAGE_INFO_S *pMsg,  MSG_SENDINGOPT_INFO_S *pSendOptInfo, MMS_MESSAGE_DATA_S *pMmsMsg, char **pDestMsg);
 
-MSG_ERROR_T MmsUpdateRejectStatus(MSG_MESSAGE_INFO_S *pMsgInfo);
+msg_error_t MmsUpdateRejectStatus(MSG_MESSAGE_INFO_S *pMsgInfo);
 
-MSG_ERROR_T MmsComposeReadReport(MSG_MESSAGE_INFO_S *pMsgInfo);
+msg_error_t MmsComposeReadReport(MSG_MESSAGE_INFO_S *pMsgInfo);
 
-MSG_ERROR_T MmsRestoreMsg(MSG_MESSAGE_INFO_S *pMsgInfo, char *pRcvBody, int rcvdBodyLen, char *filePath);
+msg_error_t MmsRestoreMsg(MSG_MESSAGE_INFO_S *pMsgInfo, char *pRcvBody, int rcvdBodyLen, char *filePath);
 
 #ifdef __cplusplus
 }
index afd68e8..2969908 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef MMS_PLUGIN_MESSAGE_H
 #define MMS_PLUGIN_MESSAGE_H
@@ -51,7 +51,7 @@
 #define                MSG_MAILBOX_NAME_LEN            10
 
 #define                MsgContentType                                          MimeType
-#define                MsgRecipientType                                        MSG_RECIPIENT_TYPE_T
+#define                MsgRecipientType                                        msg_recipient_type_t
 #define                MMS_VERSION                                             0x92
 #define                MSG_STR_ADDR_DELIMETER                  ";"
 #define                MSG_CH_ADDR_DELIMETER                   ';'
@@ -262,10 +262,10 @@ typedef enum {
        MMS_SPECIAL_MSG_TYPE_VOICE_MESSAGE,             //voice message service
 
        MMS_SPECIAL_MSG_TYPE_VDF_POSTCARD,              //postcard service, or Generic Postcard Service
-       MMS_SPECIAL_MSG_TYPE_POSTCARD_EXT1,             //Stickers Service
-       MMS_SPECIAL_MSG_TYPE_POSTCARD_EXT2,             //Photo 10x15
-       MMS_SPECIAL_MSG_TYPE_POSTCARD_EXT3,             //8 Photos
-       MMS_SPECIAL_MSG_TYPE_POSTCARD_EXT4,             // 4 Photos
+       MMS_SPECIAL_MSG_TYPE_POSTCARD_EXT1,     //Stickers Service
+       MMS_SPECIAL_MSG_TYPE_POSTCARD_EXT2,     //Photo 10x15
+       MMS_SPECIAL_MSG_TYPE_POSTCARD_EXT3,     //8 Photos
+       MMS_SPECIAL_MSG_TYPE_POSTCARD_EXT4,     // 4 Photos
 } MmsSpecialMsgType;
 
 typedef enum {
@@ -305,12 +305,12 @@ typedef   struct _MmsMsgMultiStatus {
        char szTo[MAX_ADDRESS_VAL_LEN + 1];
        bool bDeliveryReportIsRead;
        bool bDeliveyrReportIsLast;
-       MSG_DELIVERY_REPORT_STATUS_T msgStatus;
+       msg_delivery_report_status_t msgStatus;
        UINT32 handledTime;
 
        bool bReadReplyIsRead;
        bool bReadReplyIsLast;
-       MSG_READ_REPORT_STATUS_T readStatus;
+       msg_read_report_status_t readStatus;
        UINT32 readTime;
 
        struct _MmsMsgMultiStatus *pNext;
@@ -361,12 +361,12 @@ typedef   struct _MMS_ATTRIB_S {
        int msgSize;
        MmsMsgClass msgClass;
        MmsTimeStruct expiryTime;
-       MmsTimeStruct expiryCustomTime;         // for expiry custom time,
+       MmsTimeStruct expiryCustomTime;
        MmsTimeStruct deliveryTime;
-       MmsTimeStruct deliveryCustomTime;       // for expiry custom time
+       MmsTimeStruct deliveryCustomTime;
 
        //for ReadMsg, When Sending notifyResp.ind
-       MSG_DELIVERY_REPORT_STATUS_T msgStatus;
+       msg_delivery_report_status_t msgStatus;
 
        MmsResponseStatus responseStatus;
        MmsRetrieveStatus retrieveStatus;
@@ -495,7 +495,7 @@ struct _MsgMessage {
 
 typedef        struct _MMS_MESSAGE_S {
        MmsAttrib mmsAttrib;
-       MSG_MESSAGE_ID_T msgID;
+       msg_message_id_t msgID;
        int mailbox;            // mailbox type,MMS_MAILBOX_XXX
        char szFileName[MSG_FILENAME_LEN_MAX];
        char szTrID[MMS_TR_ID_LEN + 1];
@@ -529,18 +529,18 @@ MsgMultipart *MmsMakeMultipart(MsgContentType mimeType, char *szTitleName, char
 bool MmsIsText(int type);
 bool MmsIsVitemContent(int type, char *pszName);
 bool MmsComposeMessage(MmsMsg *pMmsMsg, MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S *pSendOptInfo, MMS_MESSAGE_DATA_S *pMsgData, char *pFileData);
-void MmsComposeNotiMessage(MmsMsg *pMmsMsg, MSG_MESSAGE_ID_T msgID);
+void MmsComposeNotiMessage(MmsMsg *pMmsMsg, msg_message_id_t msgID);
 bool MmsGetMmsMessageBody(MmsMsg *pMmsMsg, char *retrievedFilePath);
 bool MmsComposeForwardHeader(MmsMsg *pMmsMsg, const MSG_MESSAGE_INFO_S *pMsgInfo);
 bool MmsComposeForwardMessage(MmsMsg *pMmsMsg, char *retrievedFilePath);
 #ifdef MMS_DELIEVERY_IND_ENABLED
-MmsMsgMultiStatus *MmsComposeDeliveryIndMessage(MmsMsg *pMmsMsg, MSG_MESSAGE_ID_T msgId);
+MmsMsgMultiStatus *MmsComposeDeliveryIndMessage(MmsMsg *pMmsMsg, msg_message_id_t msgId);
 #endif
-void MmsComposeReadReportMessage(MmsMsg *pMmsMsg, const MSG_MESSAGE_INFO_S *pMsgInfo, MSG_MESSAGE_ID_T selectedMsgId);
-MmsMsgMultiStatus *MmsGetMultiStatus(MSG_MESSAGE_ID_T msgId);
+void MmsComposeReadReportMessage(MmsMsg *pMmsMsg, const MSG_MESSAGE_INFO_S *pMsgInfo, msg_message_id_t selectedMsgId);
+MmsMsgMultiStatus *MmsGetMultiStatus(msg_message_id_t msgId);
 int MmsSearchMsgId(char *toNumber, char *szMsgID);
-void MmsUpdateDeliveryReport(MSG_MESSAGE_ID_T msgId, MmsMsgMultiStatus *pStatus);
-void MmsUpdateReadReport(MSG_MESSAGE_ID_T msgId, MmsMsgMultiStatus *pStatus);
+void MmsUpdateDeliveryReport(msg_message_id_t msgId, MmsMsgMultiStatus *pStatus);
+void MmsUpdateReadReport(msg_message_id_t msgId, MmsMsgMultiStatus *pStatus);
 MsgMultipart *MmsAllocMultipart(void);
 bool _MsgIsASCII(char *pszText);
 bool _MsgReplaceNonAscii(char *szInText, char **szOutText, char replaceChar);
@@ -551,7 +551,7 @@ char *MsgStrCopy(const char *string);
 char *MsgStrNCopy(const char *string, int length);
 int    MsgStrlen(char *pStr);
 bool _MsgConvertCharToHex(char pSrc, char *pDest);
-MSG_ERROR_T MmsAddAttachment(MMS_MESSAGE_DATA_S *pMsgData, MMS_MEDIA_S *pMedia);
+msg_error_t MmsAddAttachment(MMS_MESSAGE_DATA_S *pMsgData, MMS_MEDIA_S *pMedia);
 bool MmsCheckAdditionalMedia(MMS_MESSAGE_DATA_S *pMsgData, MsgType *partHeader);
 #ifdef __SUPPORT_DRM__
 bool __MsgInitMsgDRMInfo(MsgDRMInfo *pMsgDrmInfo);
index 00b7df5..2ec4174 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef MMS_PLUGIN_SMIL_VALIDATE_H
 #define MMS_PLUGIN_SMIL_VALIDATE_H
index da97405..1e9db28 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include "MmsPluginMessage.h"
 
index 9bb5162..af94847 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include <stdio.h>
 #include <string.h>
@@ -96,19 +96,9 @@ typedef enum _SMIL_ATTRIBUTE_T {
        ATTRIBUTE_BEGIN,
        ATTRIBUTE_END,
        ATTRIBUTE_REPEAT_COUNT,
-#ifdef MMS_SMIL_ANIMATE
-       ATTRIBUTE_ATTRIBUTE_NAME,
-       ATTRIBUTE_ATTRIBUTE_TYPE,
-       ATTRIBUTE_TARGET_ELEMENT,
-       ATTRIBUTE_FROM,
-       ATTRIBUTE_TO,
-       ATTRIBUTE_BY,
-       ATTRIBUTE_VALUES,
-       ATTRIBUTE_CALCMODE,
-#endif
 } SMIL_ATTRIBUTE_T;
 
-char *MmsSmilGetPresentationData(MSG_MESSAGE_ID_T msgId);
+char *MmsSmilGetPresentationData(msg_message_id_t msgId);
 bool MmsSmilParseSmilDoc(MMS_MESSAGE_DATA_S *pMmsMsg, char *pSmilDoc);
 void MmsSmilGetElement(MMS_MESSAGE_DATA_S *pMmsMsg, xmlNode *a_node);
 int MmsSmilGetColorValue(xmlChar *content);
@@ -229,20 +219,20 @@ xmlNode *__MmsCreateTextNode(MMS_MEDIA_S *pstSmilMedia, char *pszContentID);
  */
 xmlNode *__MmsCreateMMNode(MMS_MEDIA_S *pstSmilMedia, char *pszContentID);
 
-/**    @fn                     static bool __MmsInsertFirstChild(xmlNode *pstParent, xmlNode *pNode)
+/**    @fn                     static bool __MmsInsertFirstChild(xmlNode *pstParent, xmlNode *pstCurr)
  *     @brief          Inserts first child to parent node. \n
  *     @param[in]      pstParent specifies Parent node. \n
- *     @param[in]      pNode specifies Child node. \n
+ *     @param[in]      pstCurr specifies Child node. \n
  *     @retval         TRUE                            In case of Success. \n
  *     @retval         FALSE                           In case of failure. \n
  */
 bool __MmsInsertFirstChild(xmlNode *pParent, xmlNode *pNode);
 
-/**    @fn                     static bool __MmsSmilInsertNode(xmlNode *pstParent, xmlNode *pstLeftSibling, xmlNode *pNode)
+/**    @fn                     static bool __MmsSmilInsertNode(xmlNode *pstParent, xmlNode *pstLeftSibling, xmlNode *pstCurr)
  *     @brief          Inserts node. \n
  *     @param[in]      pstParent specifies Parent node. \n
  *     @param[in]      pstLeftSibling specifies Left Sibling node. \n
- *     @param[in]      pNode specifies Child node. \n
+ *     @param[in]      pstCurr specifies Child node. \n
  *     @retval         TRUE                            In case of Success. \n
  *     @retval         FALSE                           In case of failure. \n
  */
@@ -263,7 +253,7 @@ void _MmsSmilSetAttribute(xmlNode *pNode, char *szField, char *szValue);
  */
 char *__MmsSmilFindColorValue(int nValue);
 
-/**    @fn                     static xmlNodePtr UtilxmlStringGetNodeList(xmlNodePtr pstNode, char *pszName)
+/**    @fn                     static xmlNodePtr UtilxmlStringGetNodeList(xmlNodePtr pstNode, char *pszValue)
  *     @brief          Get node based on pszValue. \n
  *     @param[in]      pNode specifies node. \n
  *     @param[in]      pszName specifies name field. \n
index a482181..792cc42 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef MMS_PLUGIN_STORAGE_H
 #define MMS_PLUGIN_STORAGE_H
@@ -38,39 +38,38 @@ public:
 
        void addMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S *pSendOptInfo, char *pFileData);
        void getMmsMessage(MmsMsg **pMmsMsg);
-       void getMmsAttrib(MSG_MESSAGE_ID_T msgId, MmsMsg *pMmsMsg);
-       MSG_ERROR_T getMmsMessageId(MSG_MESSAGE_ID_T selectedMsgId, MmsMsg *pMmsMsg);
+       void getMmsAttrib(msg_message_id_t msgId, MmsMsg *pMmsMsg);
+       msg_error_t getMmsMessageId(msg_message_id_t selectedMsgId, MmsMsg *pMmsMsg);
        void composeReadReport(MSG_MESSAGE_INFO_S *pMsgInfo);
 
        int searchMsgId(char *toNumber, char *szMsgID);
-       int     getMmsVersion(MSG_MESSAGE_ID_T selectedMsgId);
-
-       MSG_ERROR_T     updateMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S *pSendOptInfo, char *pFileData);
-       MSG_ERROR_T     updateConfMessage(MSG_MESSAGE_INFO_S *pMsgInfo);
-       MSG_ERROR_T     updateMmsAttrib(MSG_MESSAGE_ID_T msgId, MmsAttrib *attrib, MSG_SUB_TYPE_T msgSubType);
-       MSG_ERROR_T updateMmsAttachCount(MSG_MESSAGE_ID_T msgId, int count);
-       MSG_ERROR_T     updateNetStatus(MSG_MESSAGE_ID_T msgId, MSG_NETWORK_STATUS_T netStatus);
-       MSG_ERROR_T updateDeliveryReport(MSG_MESSAGE_ID_T msgId, MmsMsgMultiStatus *pStatus);
-       MSG_ERROR_T     updateReadReport(MSG_MESSAGE_ID_T msgId, MmsMsgMultiStatus *pStatus);
-       MSG_ERROR_T     setReadReportSendStatus(MSG_MESSAGE_ID_T msgId, int readReportSendStatus);
-       MSG_ERROR_T     plgGetMmsMessage(MSG_MESSAGE_INFO_S *pMsg,  MSG_SENDINGOPT_INFO_S *pSendOptInfo, MMS_MESSAGE_DATA_S *pMmsMsg, char **pDestMsg);
-       MSG_ERROR_T     getContentLocation(MSG_MESSAGE_INFO_S *pMsgInfo);
-       MSG_ERROR_T getMmsRawFilePath(MSG_MESSAGE_ID_T msgId, char *pFilepath);
-       MSG_ERROR_T     plgGetRestoreMessage(MSG_MESSAGE_INFO_S *pMsg, MSG_SENDINGOPT_INFO_S *pSendOptInfo, MMS_MESSAGE_DATA_S *pMmsMsg, char **pDestMsg, char *filePath);
+       int     getMmsVersion(msg_message_id_t selectedMsgId);
+
+       msg_error_t     updateMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S *pSendOptInfo, char *pFileData);
+       msg_error_t     updateConfMessage(MSG_MESSAGE_INFO_S *pMsgInfo);
+       msg_error_t     updateMmsAttrib(msg_message_id_t msgId, MmsAttrib *attrib, MSG_SUB_TYPE_T msgSubType);
+       msg_error_t updateMmsAttachCount(msg_message_id_t msgId, int count);
+       msg_error_t     updateNetStatus(msg_message_id_t msgId, msg_network_status_t netStatus);
+       msg_error_t updateDeliveryReport(msg_message_id_t msgId, MmsMsgMultiStatus *pStatus);
+       msg_error_t     updateReadReport(msg_message_id_t msgId, MmsMsgMultiStatus *pStatus);
+       msg_error_t     setReadReportSendStatus(msg_message_id_t msgId, int readReportSendStatus);
+       msg_error_t     plgGetMmsMessage(MSG_MESSAGE_INFO_S *pMsg,  MSG_SENDINGOPT_INFO_S *pSendOptInfo, MMS_MESSAGE_DATA_S *pMmsMsg, char **pDestMsg);
+       msg_error_t     getContentLocation(MSG_MESSAGE_INFO_S *pMsgInfo);
+       msg_error_t getMmsRawFilePath(msg_message_id_t msgId, char *pFilepath);
+       msg_error_t     plgGetRestoreMessage(MSG_MESSAGE_INFO_S *pMsg, MSG_SENDINGOPT_INFO_S *pSendOptInfo, MMS_MESSAGE_DATA_S *pMmsMsg, char **pDestMsg, char *filePath);
        /* reject_msg_support */
-       MSG_ERROR_T getTrID(MSG_MESSAGE_INFO_S *pMsgInfo, char *pszTrID, int nBufferLen);
+       msg_error_t getTrID(MSG_MESSAGE_INFO_S *pMsgInfo, char *pszTrID, int nBufferLen);
        /* reject_msg_support */
 
-       MSG_ERROR_T updateMsgServerID(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S *pSendOptInfo);
+       msg_error_t updateMsgServerID(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S *pSendOptInfo);
 
-       MmsMsgMultiStatus *getMultiStatus(MSG_MESSAGE_ID_T msgId);
-       MSG_ERROR_T     getMsgText(MMS_MESSAGE_DATA_S *pMmsMsg, char *pMsgText);
-       MSG_ERROR_T     makeThumbnail(MMS_MESSAGE_DATA_S *pMmsMsg, char *pThumbnailPath, char *szFileName);
-       MSG_ERROR_T addMmsNoti(MSG_MESSAGE_INFO_S *pMsgInfo);
+       MmsMsgMultiStatus *getMultiStatus(msg_message_id_t msgId);
+       msg_error_t     getMsgText(MMS_MESSAGE_DATA_S *pMmsMsg, char *pMsgText);
+       msg_error_t     makeThumbnail(MMS_MESSAGE_DATA_S *pMmsMsg, char *pThumbnailPath, char *szFileName);
+       msg_error_t addMmsNoti(MSG_MESSAGE_INFO_S *pMsgInfo);
 
 private:
-       bool checkExistedMessage(MSG_MESSAGE_ID_T msgId);
-       MSG_ERROR_T addMmsMsgToDB(MmsMsg *pMmsMsg, const MSG_MESSAGE_INFO_S *pMsgInfo, int attachCnt = 0);
+       msg_error_t addMmsMsgToDB(MmsMsg *pMmsMsg, const MSG_MESSAGE_INFO_S *pMsgInfo, int attachCnt = 0);
 
        static MmsPluginStorage *pInstance;
 
index 6209991..f619cdd 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef MMS_PLUGIN_TRANSPORT_H
 #define MMS_PLUGIN_TRANSPORT_H
@@ -36,7 +36,7 @@ class MmsPluginTransport
                static MmsPluginTransport *instance();
 
                void submitRequest(const MSG_REQUEST_INFO_S *pReqInfo);
-               void cancelRequest(MSG_REQUEST_ID_T reqId);
+               void cancelRequest(msg_request_id_t reqId);
 
        private:
                MmsPluginTransport();
index f56dc1f..26b62fc 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef MMSTPDUTYPES_H
 #define MMSTPDUTYPES_H
@@ -124,7 +124,7 @@ typedef enum {
 
 typedef struct _mmsTranQEntity {
        bool isCompleted;
-       MSG_REQUEST_ID_T reqID;
+       msg_request_id_t reqID;
        int msgId;
        unsigned int sessionId;
        char transactionId[MMS_TR_ID_LEN + 1];
@@ -266,14 +266,14 @@ typedef enum {
 #define MMS_HTTP_HDR_ACCEPT_CHARSET "US-ASCII, ISO-8859-1, UTF-8"
 
 //  MMSC Address
-#define NOW_MMSC_URL    "http://165.213.73.234:7082/01030016028=01030016028"
-#define NOW_MMSC_IP      "165.213.73.234"
-#define NOW_MMSC_PROXY   "165.213.73.234"
-#define NOW_MMSC_PROXY_PORT  7082
+#define NOW_MMSC_URL    ""
+#define NOW_MMSC_IP      ""
+#define NOW_MMSC_PROXY   ""
+#define NOW_MMSC_PROXY_PORT
 
 #define DEFAULT_MMSC_URL               NOW_MMSC_URL
 #define DEFAULT_MMSC_IP                NOW_MMSC_IP
-#define DEFAULT_MMSC_PORT      7082
+#define DEFAULT_MMSC_PORT
 #define DEFAULT_HTTP_PROXY     NOW_MMSC_PROXY
 #define DEFAULT_HTTP_PROXY_PORT        NOW_MMSC_PROXY_PORT
 
index 2d3e46b..ed7f08e 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef MMSPLUGINUSERAGENT_H
 #define MMSPLUGINUSERAGENT_H
index 79ff390..114bc01 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef _MMS_PLUGIN_WM_LNG_PACK_H_
 #define _MMS_PLUGIN_WM_LNG_PACK_H_
index 6bc6dae..468b4e8 100755 (executable)
@@ -34,6 +34,7 @@ SET(SMS-PLUGIN-SRCS
 )
 
 INCLUDE_DIRECTORIES(
+    ${CMAKE_SOURCE_DIR}/include/mapi
        ${CMAKE_SOURCE_DIR}/include/common
        ${CMAKE_SOURCE_DIR}/include/utils
        ${CMAKE_CURRENT_SOURCE_DIR}/include
index 91eb50f..9fabe41 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include <glib.h>
 #include <pthread.h>
 #include "SmsPluginTpduCodec.h"
 #include "SmsPluginSimMsg.h"
 #include "SmsPluginSetting.h"
+#include "MsgGconfWrapper.h"
 #include "SmsPluginCallback.h"
 
-extern "C"
-{
-       #include <ITapiProductivity.h>
-}
-
+extern struct tapi_handle *pTapiHandle;
 
 /*==================================================================================================
                                      FUNCTION IMPLEMENTATION
 ==================================================================================================*/
-int TapiEventDeviceReady(const TelTapiEvent_t *pEvent, void*)
+void TapiEventDeviceReady(TapiHandle *handle, int result, void *data, void *user_data)
 {
-       MSG_DEBUG("TapiEventDeviceReady is called. : request id = [%d] status = [%d]", pEvent->RequestId, pEvent->Status);
+       MSG_DEBUG("TapiEventDeviceReady is called. : result = [%d]", result);
 
        try
        {
@@ -51,21 +48,20 @@ int TapiEventDeviceReady(const TelTapiEvent_t *pEvent, void*)
        catch (MsgException& e)
        {
                MSG_FATAL("%s", e.what());
-               return e.errorCode();
+               return;
        }
 
-       return 0;
 }
 
 
-int TapiEventSentStatus(const TelTapiEvent_t *pEvent, void*)
+void TapiEventSentStatus(TapiHandle *handle, int result, void *data, void *user_data)
 {
-       MSG_DEBUG("TapiEventSentStatus is called. : request id = [%d] status = [%d]", pEvent->RequestId, pEvent->Status);
+       MSG_DEBUG("TapiEventSentStatus is called. : result = [%d]", result);
 
-       MSG_NETWORK_STATUS_T netStatus;
+       msg_network_status_t netStatus;
 
        // Convert TAPI status -> Messaging status
-       if ((TelSmsResponse_t)pEvent->Status == TAPI_NETTEXT_SENDSMS_SUCCESS)
+       if ((TelSmsResponse_t)result == TAPI_NETTEXT_SENDSMS_SUCCESS)
                netStatus = MSG_NETWORK_SEND_SUCCESS;
        else
                netStatus = MSG_NETWORK_SEND_FAIL;
@@ -73,7 +69,7 @@ int TapiEventSentStatus(const TelTapiEvent_t *pEvent, void*)
        try
        {
                // Call Event Handler
-               SmsPluginEventHandler::instance()->handleSentStatus(pEvent->RequestId, netStatus);
+               SmsPluginEventHandler::instance()->handleSentStatus(netStatus);
 
                // Call SAT Handler
                SmsPluginSatHandler::instance()->ctrlSms(netStatus);
@@ -81,24 +77,22 @@ int TapiEventSentStatus(const TelTapiEvent_t *pEvent, void*)
        catch (MsgException& e)
        {
                MSG_FATAL("%s", e.what());
-               return e.errorCode();
+               return;
        }
 
-       return 0;
 }
 
 
-int TapiEventMsgIncoming(const TelTapiEvent_t *pEvent, void*)
+void TapiEventMsgIncoming(TapiHandle *handle, const char *noti_id, void *data, void *user_data)
 {
-       MSG_DEBUG("TapiEventMsgIncoming is called. Red Id [%d]", pEvent->RequestId);
+       MSG_DEBUG("TapiEventMsgIncoming is called. noti_id [%s]", noti_id);
 
-       if (pEvent->Status != TAPI_API_SUCCESS || pEvent->pData == NULL)
-       {
+       if (data == NULL) {
                MSG_DEBUG("Error. evt->pData is NULL.");
-               return 0;
+               return;
        }
 
-       TelSmsDatapackageInfo_t* pDataPackage = (TelSmsDatapackageInfo_t*)pEvent->pData;
+       TelSmsDatapackageInfo_t* pDataPackage = (TelSmsDatapackageInfo_t*)data;
 
        SMS_TPDU_S tpdu;
 
@@ -172,24 +166,23 @@ int TapiEventMsgIncoming(const TelTapiEvent_t *pEvent, void*)
        catch (MsgException& e)
        {
                MSG_FATAL("%s", e.what());
-               return e.errorCode();
+               return;
        }
 
-       return 0;
 }
 
 
-int TapiEventCbMsgIncoming(const TelTapiEvent_t *pEvent, void*)
+void TapiEventCbMsgIncoming(TapiHandle *handle, int result, void *data, void *user_data)
 {
        MSG_DEBUG("TapiEventCbMsgIncoming is called.");
 
-       if (pEvent->Status != TAPI_API_SUCCESS || pEvent->pData == NULL)
+       if (result != TAPI_API_SUCCESS || data == NULL)
        {
                MSG_DEBUG("Error. evt->pData is NULL.");
-               return 0;
+               return;
        }
 
-       TelSmsCbMsg_t *pCbMsg = (TelSmsCbMsg_t*)pEvent->pData;
+       TelSmsCbMsg_t *pCbMsg = (TelSmsCbMsg_t*)data;
 
        try
        {
@@ -198,54 +191,52 @@ int TapiEventCbMsgIncoming(const TelTapiEvent_t *pEvent, void*)
        catch (MsgException& e)
        {
                MSG_FATAL("%s", e.what());
-               return 0;
+               return;
        }
 
-       return 0;
 }
 
 
-int TapiEventDeliveryReportCNF(const TelTapiEvent_t *pEvent, void*)
+void TapiEventDeliveryReportCNF(TapiHandle *handle, int result, void *data, void *user_data)
 {
-       MSG_DEBUG("TapiEventDeliveryReportCNF is called. : request id = [%d] status = [%d]", pEvent->RequestId, pEvent->Status);
+       MSG_DEBUG("TapiEventDeliveryReportCNF is called. : result = [%d]", result);
 
-       return 0;
+       return;
 }
 
 
-int TapiEventGetSimMsgCnt(const TelTapiEvent_t *pEvent, void*)
+void TapiEventGetSimMsgCnt(TapiHandle *handle, int result, void *data, void *user_data)
 {
        MSG_DEBUG("TapiEventGetSimMsgCnt is called.");
 
-       if (pEvent->Status != TAPI_API_SUCCESS || pEvent->pData == NULL)
+       if (result != TAPI_API_SUCCESS || data == NULL)
        {
-               MSG_DEBUG("Error. evt->pData is NULL.");
+               MSG_DEBUG("Error. data is NULL.");
                MSG_SIM_COUNT_S simCnt;
                memset(&simCnt, 0x00, sizeof(MSG_SIM_COUNT_S));
                SmsPluginSimMsg::instance()->setSimMsgCntEvent(&simCnt);
-               return 0;
+               return;
        }
 
-       SmsPluginSimMsg::instance()->setSimMsgCntEvent((MSG_SIM_COUNT_S *)pEvent->pData);
+       SmsPluginSimMsg::instance()->setSimMsgCntEvent((MSG_SIM_COUNT_S *)data);
 
-       return 0;
 }
 
 
-int TapiEventGetSimMsg(const TelTapiEvent_t *pEvent, void*)
+void TapiEventGetSimMsg(TapiHandle *handle, int result, void *data, void *user_data)
 {
        MSG_DEBUG("TapiEventGetSimMsg is called.");
 
-       if (pEvent->Status != TAPI_API_SUCCESS || pEvent->pData == NULL)
+       if (result != TAPI_API_SUCCESS || data == NULL)
        {
-               MSG_DEBUG("Error!! pEvent->Status [%d]", pEvent->Status);
+               MSG_DEBUG("Error!! pEvent->Status [%d]", result);
 
                SmsPluginSimMsg::instance()->setSimMsgEvent(NULL, false);
 
-               return 0;
+               return;
        }
 
-       TelSmsData_t* pSmsTpdu = (TelSmsData_t*)pEvent->pData;
+       TelSmsData_t* pSmsTpdu = (TelSmsData_t*)data;
 
        // Reading TelSmsData_t
        MSG_DEBUG ("sim index %d", pSmsTpdu->SimIndex);
@@ -258,7 +249,7 @@ int TapiEventGetSimMsg(const TelTapiEvent_t *pEvent, void*)
 
                SmsPluginSimMsg::instance()->setSimMsgEvent(NULL, false);
 
-               return 0;
+               return;
        }
 
        SMS_TPDU_S tpdu;
@@ -287,7 +278,7 @@ int TapiEventGetSimMsg(const TelTapiEvent_t *pEvent, void*)
                                tpdu.data.deliver.userData.header[i].udhType == SMS_UDH_CONCAT_16BIT)
                        {
                                SmsPluginSimMsg::instance()->setSimMsgEvent(NULL, false);
-                               return 0;
+                               return;
                        }
                }
        }
@@ -302,7 +293,7 @@ int TapiEventGetSimMsg(const TelTapiEvent_t *pEvent, void*)
                                tpdu.data.submit.userData.header[i].udhType == SMS_UDH_CONCAT_16BIT)
                        {
                                SmsPluginSimMsg::instance()->setSimMsgEvent(NULL, false);
-                               return 0;
+                               return;
                        }
                }
        }
@@ -346,62 +337,60 @@ int TapiEventGetSimMsg(const TelTapiEvent_t *pEvent, void*)
 
        SmsPluginSimMsg::instance()->setSimMsgEvent(&msgInfo, true); // Call Event Handler
 
-       return 0;
 }
 
 
-int TapiEventSaveSimMsg(const TelTapiEvent_t *pEvent, void*)
+void TapiEventSaveSimMsg(TapiHandle *handle, int result, void *data, void *user_data)
 {
-       MSG_DEBUG("TapiEventSaveSimMsg is called. Red Id [%d]", pEvent->RequestId);
+       MSG_DEBUG("TapiEventSaveSimMsg is called. result [%d]", result);
 
-       if (pEvent->Status != TAPI_API_SUCCESS || pEvent->pData == NULL)
+       if (result != TAPI_API_SUCCESS || data == NULL)
        {
-               MSG_DEBUG("Error. evt->pData is NULL.");
-               SmsPluginSimMsg::instance()->setSimEvent((MSG_SIM_ID_T)0, false);
-               return 0;
+               MSG_DEBUG("Error. data is NULL.");
+               SmsPluginSimMsg::instance()->setSimEvent((msg_sim_id_t)0, false);
+               return;
        }
 
-       int simId = *((int*)pEvent->pData);
+       int simId = *((int*)data);
 
-       MSG_DEBUG("sim ID : [%d], status : [%d]", simId, (TelSmsCause_t)pEvent->Status);
+       MSG_DEBUG("sim ID : [%d], status : [%d]", simId, (TelSmsCause_t)result);
 
-       SmsPluginSimMsg::instance()->setSimEvent((MSG_SIM_ID_T)simId, true);
+       SmsPluginSimMsg::instance()->setSimEvent((msg_sim_id_t)simId, true);
 
-       return 0;
 }
 
 
-int TapiEventDeleteSimMsg(const TelTapiEvent_t *pEvent, void*)
+void TapiEventDeleteSimMsg(TapiHandle *handle, int result, void *data, void *user_data)
 {
-       MSG_DEBUG("TapiEventDeleteSimMsg is called. Red Id [%d]", pEvent->RequestId);
-       MSG_DEBUG("status : [%d]", (TelSmsCause_t)pEvent->Status);
+       MSG_DEBUG("TapiEventDeleteSimMsg is called. result [%d]", result);
+
+       MSG_DEBUG("status : [%d]", (TelSmsCause_t)result);
 
-       if (pEvent->Status != TAPI_API_SUCCESS || pEvent->pData == NULL)
+       if (result != TAPI_API_SUCCESS || data == NULL)
        {
-               MSG_DEBUG("Error. evt->pData is NULL.");
-               SmsPluginSimMsg::instance()->setSimEvent((MSG_SIM_ID_T)0, false);
-               return 0;
+               MSG_DEBUG("Error. data is NULL.");
+               SmsPluginSimMsg::instance()->setSimEvent((msg_sim_id_t)0, false);
+               return;
        }
 
-       int sim_id = *((int*)pEvent->pData);
+       int sim_id = *((int*)data);
 
-       SmsPluginSimMsg::instance()->setSimEvent((MSG_SIM_ID_T)sim_id, true);
+       SmsPluginSimMsg::instance()->setSimEvent((msg_sim_id_t)sim_id, true);
 
-       return 0;
 }
 
 
-int TapiEventSetConfigData(const TelTapiEvent_t *pEvent, void*)
+void TapiEventSetConfigData(TapiHandle *handle, int result, void *data, void *user_data)
 {
        MSG_DEBUG("TapiEventSetConfigData is called.");
 
-       if (pEvent->pData == NULL)
+       if (data == NULL)
        {
-               MSG_DEBUG("Error. evt->pData is NULL.");
-               return 0;
+               MSG_DEBUG("Error. data is NULL.");
+               return;
        }
 
-       TelSmsSetResponse* responseType = (TelSmsSetResponse*)pEvent->pData;
+       TelSmsSetResponse* responseType = (TelSmsSetResponse*)data;
 
        MSG_DEBUG("responseType : [%d]", *responseType);
 
@@ -434,55 +423,53 @@ int TapiEventSetConfigData(const TelTapiEvent_t *pEvent, void*)
 
        bool bRet = true;
 
-       MSG_DEBUG("status : [%d]", (TelSmsCause_t)pEvent->Status);
+       MSG_DEBUG("status : [%d]", (TelSmsCause_t)result);
 
-       if ((TelSmsCause_t)pEvent->Status != TAPI_NETTEXT_SUCCESS) bRet = false;
+       if ((TelSmsCause_t)result != TAPI_NETTEXT_SUCCESS) bRet = false;
 
        if (*responseType == TAPI_NETTEXT_SETMESSAGESTATUS_RSP)
                SmsPluginSimMsg::instance()->setSimEvent(0, bRet);
        else
                SmsPluginSetting::instance()->setResultFromSim(bRet);
 
-       return 0;
 }
 
 
-int TapiEventGetParamCnt(const TelTapiEvent_t *pEvent, void*)
+void TapiEventGetParamCnt(TapiHandle *handle, int result, void *data, void *user_data)
 {
        MSG_DEBUG("TapiEventGetParamCnt is called.");
 
-       if (pEvent->Status != TAPI_API_SUCCESS || pEvent->pData == NULL)
+       if (result != TAPI_API_SUCCESS || data == NULL)
        {
                MSG_DEBUG("Error. evt->pData is NULL.");
                SmsPluginSetting::instance()->setParamCntEvent(0);
-               return 0;
+               return;
        }
 
        int paramCnt = 0;
-       paramCnt = *((int*)pEvent->pData);
+       paramCnt = *((int*)data);
 
        SmsPluginSetting::instance()->setParamCntEvent(paramCnt);
 
-       return 0;
 }
 
 
-int TapiEventGetParam(const TelTapiEvent_t *pEvent, void*)
+void TapiEventGetParam(TapiHandle *handle, int result, void *data, void *user_data)
 {
        MSG_DEBUG("TapiEventGetConfigData is called.");
 
-       if (pEvent->Status != TAPI_API_SUCCESS || pEvent->pData == NULL)
+       if (result != TAPI_API_SUCCESS || data == NULL)
        {
-               MSG_DEBUG("Error. evt->pData is NULL.");
+               MSG_DEBUG("Error. data is NULL.");
                SmsPluginSetting::instance()->setParamEvent(NULL, -1, false);
-               return 0;
+               return;
        }
 
-       TelSmsParams_t* smsParam = (TelSmsParams_t*)pEvent->pData;
+       TelSmsParams_t* smsParam = (TelSmsParams_t*)data;
 
        int alphaIdLen = 0;
        int addrLen = 0;
-       MSG_SMSC_DATA_S smscData = {};
+       MSG_SMSC_DATA_S smscData = {0, };
 
        /*Check Alpha ID value*/
        alphaIdLen = smsParam->AlphaIdLen;
@@ -494,7 +481,7 @@ int TapiEventGetParam(const TelTapiEvent_t *pEvent, void*)
 
                SmsPluginSetting::instance()->setParamEvent(NULL, -1, false);
 
-               return 0;
+               return;
        }
 
 
@@ -505,13 +492,13 @@ int TapiEventGetParam(const TelTapiEvent_t *pEvent, void*)
        {
                MSG_DEBUG("addrLen is too long: %d", addrLen);
                SmsPluginSetting::instance()->setParamEvent(NULL, -1, false);
-               return 0;
+               return;
        }
        else if(addrLen < 2)
        {
                MSG_DEBUG("addrLen is too short: %d", addrLen);
                SmsPluginSetting::instance()->setParamEvent(NULL, -1, false);
-               return 0;
+               return;
        }
 
        MSG_DEBUG("addrLen : %d", addrLen);
@@ -550,7 +537,7 @@ int TapiEventGetParam(const TelTapiEvent_t *pEvent, void*)
 
                SmsPluginSetting::instance()->setParamEvent(NULL, -1, false);
 
-               return 0;
+               return;
        }
 
        /*Get the PID value*/
@@ -608,26 +595,25 @@ int TapiEventGetParam(const TelTapiEvent_t *pEvent, void*)
 
        SmsPluginSetting::instance()->setParamEvent(&smscData, (int)smsParam->RecordIndex, true);
 
-       return 0;
 }
 
 
-int TapiEventGetCBConfig(const TelTapiEvent_t *pEvent, void*)
+void TapiEventGetCBConfig(TapiHandle *handle, int result, void *data, void *user_data)
 {
        MSG_DEBUG("TapiEventGetCBConfig is called.");
 
        MSG_CBMSG_OPT_S cbOpt = {0};
 
-       if (pEvent->Status != TAPI_API_SUCCESS || pEvent->pData == NULL)
+       if (result != TAPI_API_SUCCESS || data == NULL)
        {
-               MSG_DEBUG("Error. evt->pData is NULL.");
+               MSG_DEBUG("Error. data is NULL.");
 
                SmsPluginSetting::instance()->setCbConfigEvent(NULL, false);
 
-               return 0;
+               return;
        }
 
-       TelSmsCbConfig_t* pCBConfig = (TelSmsCbConfig_t*)pEvent->pData;
+       TelSmsCbConfig_t* pCBConfig = (TelSmsCbConfig_t*)data;
 
        cbOpt.bReceive = (bool)pCBConfig->bCBEnabled;
 
@@ -648,6 +634,10 @@ int TapiEventGetCBConfig(const TelTapiEvent_t *pEvent, void*)
                cbOpt.channelData.channelCnt = CB_CHANNEL_MAX;
        }
 
+       if (MsgSettingSetInt(CB_CHANNEL_COUNT, cbOpt.channelData.channelCnt) != MSG_SUCCESS) {
+               MSG_DEBUG("Error to set config data [%s]", CB_CHANNEL_COUNT);
+       }
+
        MSG_DEBUG("Channel Count [%d]", cbOpt.channelData.channelCnt);
 
        for (int i = 0; i < cbOpt.channelData.channelCnt; i++)
@@ -661,128 +651,77 @@ int TapiEventGetCBConfig(const TelTapiEvent_t *pEvent, void*)
 
        SmsPluginSetting::instance()->setCbConfigEvent(&cbOpt, true);
 
-       return 0;
 }
 
 
-int TapiEventSatSmsRefresh(const TelTapiEvent_t *pEvent, void*)
+void TapiEventSatSmsRefresh(TapiHandle *handle, int result, void *data, void *user_data)
 {
        MSG_DEBUG("TapiEventSatSmsRefresh is called.");
 
-       if (pEvent->Status != TAPI_API_SUCCESS || pEvent->pData == NULL)
+       if (result != TAPI_API_SUCCESS || data == NULL)
        {
-               MSG_DEBUG("Error. evt->pData is NULL.");
-               return 0;
+               MSG_DEBUG("Error. data is NULL.");
+               return;
        }
 
        try
        {
-               SmsPluginSatHandler::instance()->refreshSms(pEvent->pData);
+               SmsPluginSatHandler::instance()->refreshSms(data);
        }
        catch (MsgException& e)
        {
                MSG_FATAL("%s", e.what());
-               return e.errorCode();
+               return;
        }
 
-       return 0;
 }
 
 
-int TapiEventSatSendSms(const TelTapiEvent_t *pEvent, void*)
+void TapiEventSatSendSms(TapiHandle *handle, int result, void *data, void *user_data)
 {
        MSG_DEBUG("TapiEventSatSendSms is called.");
 
-       if (pEvent->Status != TAPI_API_SUCCESS || pEvent->pData == NULL)
+       if (result != TAPI_API_SUCCESS || data == NULL)
        {
-               MSG_DEBUG("Error. evt->pData is NULL.");
-               return 0;
+               MSG_DEBUG("Error. data is NULL.");
+               return;
        }
 
        try
        {
-               SmsPluginSatHandler::instance()->sendSms(pEvent->pData);
+               SmsPluginSatHandler::instance()->sendSms(data);
        }
        catch (MsgException& e)
        {
                MSG_FATAL("%s", e.what());
-               return e.errorCode();
+               return;
        }
 
-       return 0;
 }
 
 
-int TapiEventSatMoSmsCtrl(const TelTapiEvent_t *pEvent, void*)
+void TapiEventSatMoSmsCtrl(TapiHandle *handle, int result, void *data, void *user_data)
 {
        MSG_DEBUG("TapiEventSatMoSmsCtrl is called.");
 
-       if (pEvent->Status != TAPI_API_SUCCESS || pEvent->pData == NULL)
-       {
-               MSG_DEBUG("Error. evt->pData is NULL.");
-               return 0;
-       }
-
-       try
-       {
-               SmsPluginSatHandler::instance()->ctrlSms(pEvent->pData);
-       }
-       catch (MsgException& e)
-       {
-               MSG_FATAL("%s", e.what());
-               return e.errorCode();
-       }
-
-       return 0;
-
-}
-
-
-int TapiEventFactoryDftSms(const TelTapiEvent_t *pEvent, void*)
-{
-       MSG_DEBUG("TapiEventFactoryDftSms is called.");
-
-       if (pEvent->Status != TAPI_API_SUCCESS || pEvent->pData == NULL)
-       {
-               MSG_DEBUG("Error. evt->pData is NULL.");
-               return 0;
-       }
-
-       TelFactoryDftSmsInfo_t* pSmsInfo = (TelFactoryDftSmsInfo_t *)pEvent->pData;
-
-       MSG_FOLDER_ID_T folderId = MSG_INBOX_ID;
-
-       if (pSmsInfo->option == TAPI_FACTORY_DFT_SMS_INBOX)
-       {
-               folderId = MSG_INBOX_ID;
-       }
-       else if (pSmsInfo->option == TAPI_FACTORY_DFT_SMS_DRAFTS)
-       {
-               folderId = MSG_DRAFT_ID;
-       }
-       else if (pSmsInfo->option == TAPI_FACTORY_DFT_SMS_OUTBOX)
-       {
-               folderId = MSG_OUTBOX_ID;
-       }
-       else if (pSmsInfo->option == TAPI_FACTORY_DFT_SMS_SENTBOX)
+       if (result != TAPI_API_SUCCESS || data == NULL)
        {
-               folderId = MSG_SENTBOX_ID;
+               MSG_DEBUG("Error. data is NULL.");
+               return;
        }
 
        try
        {
-               SmsPluginEventHandler::instance()->handleDftSms(folderId, pSmsInfo->number, pSmsInfo->data); // Call Event Handler
+               SmsPluginSatHandler::instance()->ctrlSms(data);
        }
        catch (MsgException& e)
        {
                MSG_FATAL("%s", e.what());
-               return e.errorCode();
+               return;
        }
 
-       return 0;
 }
 
-
 /*==================================================================================================
                                      IMPLEMENTATION OF SmsPluginCallback - Member Functions
 ==================================================================================================*/
@@ -819,38 +758,7 @@ void SmsPluginCallback::registerEvent()
 {
        unsigned int tempId = 0;
 
-       tel_register_event(TAPI_EVENT_NETTEXT_DEVICE_READY_IND, &tempId, (TelAppCallback)&TapiEventDeviceReady, NULL);
-
-       tel_register_event(TAPI_EVENT_NETTEXT_SENTSTATUS_CNF, &tempId, (TelAppCallback)&TapiEventSentStatus, NULL);
-       tel_register_event(TAPI_EVENT_NETTEXT_INCOM_IND, &tempId, (TelAppCallback)&TapiEventMsgIncoming, NULL);
-       tel_register_event(TAPI_EVENT_NETTEXT_CB_INCOM_IND, &tempId, (TelAppCallback)&TapiEventCbMsgIncoming, NULL);
-       tel_register_event(TAPI_EVENT_NETTEXT_DELIVERY_REPORT_CNF, &tempId, (TelAppCallback)&TapiEventDeliveryReportCNF, NULL);
-
-       tel_register_event(TAPI_EVENT_NETTEXT_SAVE_STATUS_CNF, &tempId, (TelAppCallback)&TapiEventSaveSimMsg, NULL);
-       tel_register_event(TAPI_EVENT_NETTEXT_DELETE_STATUS_CNF, &tempId, (TelAppCallback)&TapiEventDeleteSimMsg, NULL);
-       tel_register_event(TAPI_EVENT_NETTEXT_GET_COUNT_CNF, &tempId, (TelAppCallback)&TapiEventGetSimMsgCnt, NULL);
-       tel_register_event(TAPI_EVENT_NETTEXT_READ_SMS_CNF, &tempId, (TelAppCallback)&TapiEventGetSimMsg, NULL);
-
-       tel_register_event(TAPI_EVENT_NETTEXT_SET_REQUEST_CNF, &tempId, (TelAppCallback)&TapiEventSetConfigData, NULL);
-       tel_register_event(TAPI_EVENT_NETTEXT_PARAM_COUNT_IND, &tempId, (TelAppCallback)&TapiEventGetParamCnt, NULL);
-       tel_register_event(TAPI_EVENT_NETTEXT_GET_PARAM_CNF, &tempId, (TelAppCallback)&TapiEventGetParam, NULL);
-       tel_register_event(TAPI_EVENT_NETTEXT_GET_CB_CONFIG_CNF, &tempId, (TelAppCallback)&TapiEventGetCBConfig, NULL);
-
-       tel_register_event(TAPI_EVENT_SAT_SMS_REFRESH_IND, &tempId, (TelAppCallback)&TapiEventSatSmsRefresh, NULL);
-       tel_register_event(TAPI_EVENT_SAT_SEND_SMS_IND, &tempId, (TelAppCallback)&TapiEventSatSendSms, NULL);
-       tel_register_event(TAPI_EVENT_SAT_MO_SMS_CONTROL_IND, &tempId, (TelAppCallback)&TapiEventSatMoSmsCtrl, NULL);
-
-       tel_register_event(TAPI_EVENT_FACTORY_DFT_SMS, &tempId, (TelAppCallback)&TapiEventFactoryDftSms, NULL);
-
-       int tapiRet = TAPI_API_SUCCESS;
-
-       // Register app name to telephony server
-       tapiRet = tel_register_app_name((char*)"org.tizen.msgfw");
-
-       if (tapiRet != TAPI_API_SUCCESS)
-       {
-                THROW(MsgException::SMS_PLG_ERROR, "Failed to register applicatoin name on Telephony Server [%d]", tapiRet);
-       }
+       tel_register_noti_event(pTapiHandle, TAPI_NOTI_SMS_INCOM_MSG, TapiEventMsgIncoming, NULL);
 }
 
 
index b456670..0089238 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include <time.h>
 
@@ -106,7 +106,7 @@ void SmsPluginCbMsgHandler::handleCbMsg(TelSmsCbMsg_t *pCbMsg)
                convertCbMsgToMsginfo(cbMsg, &msgInfo);
 
                // Add CB Msg into DB
-               MSG_ERROR_T err = MSG_SUCCESS;
+               msg_error_t err = MSG_SUCCESS;
 
                err = SmsPluginStorage::instance()->addMessage(&msgInfo);
 
@@ -199,6 +199,8 @@ MSG_DEBUG("unpackLen : [%d]", unpackLen);
                        pCbPage->pageLength = unpackLen;
                        pCbPage->pageData[unpackLen] = '\0';
 
+//                     pCbPage->pageLength = strlen(pCbPage->pageData);
+//                     pCbPage->pageData[pCbPage->pageLength] = '\0';
                }
                break;
 
@@ -257,7 +259,6 @@ MSG_DEBUG("In Language Type : [%d], Out Language Type : [%d]", pCbPage->pageHead
 
        // Get Receive Time
        pCbPage->pageHeader.recvTime = getRecvTime();
-
 }
 
 
@@ -444,7 +445,7 @@ void SmsPluginCbMsgHandler::MakeCbMsg(SMS_CBMSG_PAGE_S CbPage, SMS_CBMSG_S *pCbM
 
 void SmsPluginCbMsgHandler::convertCbMsgToMsginfo(SMS_CBMSG_S cbMsg, MSG_MESSAGE_INFO_S *pMsgInfo)
 {
-       pMsgInfo->msgId = (MSG_MESSAGE_ID_T)cbMsg.msgId;
+       pMsgInfo->msgId = (msg_message_id_t)cbMsg.msgId;
 
        pMsgInfo->folderId = MSG_CBMSGBOX_ID;
 
index edab5c3..a19fbd4 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include "MsgDebug.h"
 #include "MsgCppTypes.h"
@@ -24,7 +24,6 @@
 #include "SmsPluginWapPushHandler.h"
 #include "SmsPluginConcatHandler.h"
 
-
 /*==================================================================================================
                                      IMPLEMENTATION OF SmsPluginConcatHandler - Member Functions
 ==================================================================================================*/
@@ -77,7 +76,7 @@ void SmsPluginConcatHandler::handleConcatMsg(SMS_TPDU_S *pTpdu)
 {
        MSG_BEGIN();
 
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
        bool noneConcatTypeHeader = true;
 
        if (pTpdu->tpduType != SMS_TPDU_DELIVER) {
@@ -318,6 +317,7 @@ void SmsPluginConcatHandler::convertConcatToMsginfo(const SMS_DELIVER_S *pTpdu,
 
        time_t rawtime = time(NULL);
 
+
        pMsgInfo->displayTime = rawtime;
 
        /** Convert Address values */
@@ -368,6 +368,7 @@ void SmsPluginConcatHandler::convertConcatToMsginfo(const SMS_DELIVER_S *pTpdu,
        MSG_DEBUG("Data Size [%d]", pMsgInfo->dataSize);
        MSG_DEBUG("Data [%s]", tmpBuf);
 
+
        if (pMsgInfo->dataSize > MAX_MSG_TEXT_LEN) {
                pMsgInfo->bTextSms = false;
 
index ec24fd6..20761af 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include<time.h>
 #include<stdio.h>
@@ -21,6 +21,7 @@
 
 #include "MsgDebug.h"
 #include "MsgUtilFile.h"
+#include "MsgGconfWrapper.h"
 #include "SmsPluginTextConvert.h"
 #include "SmsPluginTransport.h"
 #include "SmsPluginSimMsg.h"
@@ -28,7 +29,6 @@
 #include "SmsPluginConcatHandler.h"
 #include "SmsPluginEventHandler.h"
 
-
 /*==================================================================================================
                                      IMPLEMENTATION OF SmsPluginEventHandler - Member Functions
 ==================================================================================================*/
@@ -66,9 +66,9 @@ void SmsPluginEventHandler::registerListener(MSG_PLUGIN_LISTENER_S *pListener)
 }
 
 
-void SmsPluginEventHandler::handleSentStatus(int TapiReqId, MSG_NETWORK_STATUS_T NetStatus)
+void SmsPluginEventHandler::handleSentStatus(msg_network_status_t NetStatus)
 {
-       MSG_DEBUG("TapiReqId [%d], NetStatus[%d]", TapiReqId, NetStatus);
+       MSG_DEBUG("NetStatus[%d]", NetStatus);
 
        SmsPluginTransport::instance()->setNetStatus(NetStatus);
 
@@ -89,17 +89,15 @@ void SmsPluginEventHandler::handleSentStatus(int TapiReqId, MSG_NETWORK_STATUS_T
                }
 
                /** Callback to MSG FW */
-               if (sentInfo.reqInfo.bReqCb == true || NetStatus != MSG_NETWORK_SEND_SUCCESS) {
-                       MSG_SENT_STATUS_S msgStatus;
+               MSG_SENT_STATUS_S msgStatus;
 
-                       msgStatus.reqId = sentInfo.reqInfo.reqId;
-                       msgStatus.status = NetStatus;
+               msgStatus.reqId = sentInfo.reqInfo.reqId;
+               msgStatus.status = NetStatus;
 
-                       MSG_DEBUG("sentStatus.reqId : %d", msgStatus.reqId);
-                       MSG_DEBUG("sentStatus.status : %d", msgStatus.status);
+               MSG_DEBUG("sentStatus.reqId : %d", msgStatus.reqId);
+               MSG_DEBUG("sentStatus.status : %d", msgStatus.status);
 
-                       listener.pfSentStatusCb(&msgStatus);
-               }
+               listener.pfSentStatusCb(&msgStatus);
        }
 }
 
@@ -147,11 +145,10 @@ void SmsPluginEventHandler::handleMsgIncoming(SMS_TPDU_S *pTpdu)
 
        MSG_DEBUG("###############################################################");
 
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        /** Update Status in Report Table */
        if (msgInfo.msgType.subType == MSG_STATUS_REPORT_SMS) {
-
                err = SmsPluginStorage::instance()->addMessage(&msgInfo);
 
                if (err == MSG_SUCCESS) {
@@ -188,7 +185,7 @@ void SmsPluginEventHandler::handleMsgIncoming(SMS_TPDU_S *pTpdu)
 }
 
 
-void SmsPluginEventHandler::handleSyncMLMsgIncoming(MSG_SYNCML_MESSAGE_TYPE_T msgType, char* pPushBody, int PushBodyLen, char* pWspHeader, int WspHeaderLen)
+void SmsPluginEventHandler::handleSyncMLMsgIncoming(msg_syncml_message_type_t msgType, char* pPushBody, int PushBodyLen, char* pWspHeader, int WspHeaderLen)
 {
        MSG_SYNCML_MESSAGE_DATA_S syncMLData;
 
@@ -225,98 +222,11 @@ void SmsPluginEventHandler::handleLBSMsgIncoming(char* pPushHeader, char* pPushB
 }
 
 
-void SmsPluginEventHandler::handleDftSms(MSG_FOLDER_ID_T FolderId, char* pNumber, char* pData)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       MSG_MESSAGE_INFO_S msgInfo;
-       memset(&msgInfo, 0x00, sizeof(MSG_MESSAGE_INFO_S));
-
-       /** Set SMS Type */
-       msgInfo.msgType.mainType = MSG_SMS_TYPE;
-       msgInfo.msgType.subType = MSG_NORMAL_SMS;
-       msgInfo.msgType.classType = MSG_CLASS_NONE;
-
-       /** Set Folder ID */
-       msgInfo.folderId = FolderId;
-
-       msgInfo.networkStatus = MSG_NETWORK_RECEIVED;
-       msgInfo.bRead = false;
-       msgInfo.bProtected = false;
-       msgInfo.priority = MSG_MESSAGE_PRIORITY_NORMAL;
-
-       /** Set SMS Direction */
-       if (FolderId == MSG_INBOX_ID)
-               msgInfo.direction = MSG_DIRECTION_TYPE_MT;
-       else
-               msgInfo.direction = MSG_DIRECTION_TYPE_MO;
-
-       /** Set SMS Time Info */
-       time_t curTime;
-       time(&curTime);
-
-       msgInfo.displayTime = curTime;
-
-       /** Set Address Info */
-       msgInfo.nAddressCnt = 1;
-       msgInfo.addressList[0].addressType = MSG_ADDRESS_TYPE_PLMN;
-
-       if (pNumber != NULL) {
-               strncpy(msgInfo.addressList[0].addressVal, pNumber, MAX_ADDRESS_VAL_LEN);
-       }
-
-       /** Set Port */
-       msgInfo.msgPort.valid = false;
-       msgInfo.msgPort.dstPort = 0;
-       msgInfo.msgPort.srcPort = 0;
-
-       /** Set Subject */
-       memset(msgInfo.subject, 0x00, MAX_SUBJECT_LEN+1);
-
-       /** Set SMS Text */
-       msgInfo.bTextSms = true;
-
-       if (pData != NULL) {
-               strncpy(msgInfo.msgText, pData, MAX_MSG_TEXT_LEN);
-               msgInfo.dataSize = strlen(msgInfo.msgText);
-       } else {
-               memset(msgInfo.msgText, 0x00, sizeof(msgInfo.msgText));
-               msgInfo.dataSize = 0;
-       }
-
-       /** Print MSG_MESSAGE_INFO_S */
-       MSG_DEBUG("############# Convert  tpdu values to Message Info values ####################");
-       MSG_DEBUG("msgInfo.nAddressCnt : %d", msgInfo.nAddressCnt);
-       MSG_DEBUG("msgInfo.addressList[0].addressType : %d", msgInfo.addressList[0].addressType);
-       MSG_DEBUG("msgInfo.addressList[0].addressVal : %s", msgInfo.addressList[0].addressVal);
-       MSG_DEBUG("msgInfo.priority : %d", msgInfo.priority);
-       MSG_DEBUG("msgInfo.bProtected : %d", msgInfo.bProtected);
-       MSG_DEBUG("msgInfo.bRead : %d", msgInfo.bRead);
-       MSG_DEBUG("msgInfo.bTextSms : %d", msgInfo.bTextSms);
-       MSG_DEBUG("msgInfo.direction : %d", msgInfo.direction);
-       MSG_DEBUG("msgInfo.msgType.mainType : %d", msgInfo.msgType.mainType);
-       MSG_DEBUG("msgInfo.msgType.subType : %d", msgInfo.msgType.subType);
-       MSG_DEBUG("msgInfo.msgType.classType : %d", msgInfo.msgType.classType);
-       MSG_DEBUG("msgInfo.displayTime : %s", ctime(&msgInfo.displayTime));
-       MSG_DEBUG("msgInfo.msgPort.valid : %d", msgInfo.msgPort.valid);
-       MSG_DEBUG("msgInfo.encodeType : %d", msgInfo.encodeType);
-       MSG_DEBUG("msgInfo.dataSize : %d", msgInfo.dataSize);
-       if (msgInfo.bTextSms == true)
-               MSG_DEBUG("msgInfo.msgText : %s", msgInfo.msgText);
-       else
-               MSG_DEBUG("msgInfo.msgData : %s", msgInfo.msgData);
-       MSG_DEBUG("###############################################################");
-
-       /** Callback to MSG FW */
-       err = listener.pfMsgIncomingCb(&msgInfo);
-}
-
-
-MSG_ERROR_T SmsPluginEventHandler::callbackMsgIncoming(MSG_MESSAGE_INFO_S *pMsgInfo)
+msg_error_t SmsPluginEventHandler::callbackMsgIncoming(MSG_MESSAGE_INFO_S *pMsgInfo)
 {
        MSG_BEGIN();
 
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        /** Callback to MSG FW */
        err = listener.pfMsgIncomingCb(pMsgInfo);
@@ -327,17 +237,19 @@ MSG_ERROR_T SmsPluginEventHandler::callbackMsgIncoming(MSG_MESSAGE_INFO_S *pMsgI
 }
 
 
-MSG_ERROR_T SmsPluginEventHandler::callbackInitSimBySat()
+msg_error_t SmsPluginEventHandler::callbackInitSimBySat()
 {
        /** Callback to MSG FW */
        return listener.pfInitSimBySatCb();
 }
 
 
-MSG_ERROR_T SmsPluginEventHandler::callbackStorageChange(MSG_STORAGE_CHANGE_TYPE_T storageChangeType, MSG_MESSAGE_INFO_S *pMsgInfo)
+msg_error_t SmsPluginEventHandler::callbackStorageChange(msg_storage_change_type_t storageChangeType, MSG_MESSAGE_INFO_S *pMsgInfo)
 {
        /** Callback to MSG FW */
        listener.pfStorageChangeCb(storageChangeType, pMsgInfo);
+
+       return MSG_SUCCESS;
 }
 
 
@@ -564,6 +476,10 @@ void SmsPluginEventHandler::convertDeliverTpduToMsginfo(const SMS_DELIVER_S *pTp
        } else if (pTpdu->dcs.codingScheme == SMS_CHARSET_UCS2) {
                msgInfo->encodeType = MSG_ENCODE_UCS2;
                msgInfo->dataSize = SmsPluginTextConvert::instance()->convertUCS2ToUTF8((unsigned char*)msgInfo->msgText, MAX_MSG_TEXT_LEN, (unsigned char*)pTpdu->userData.data, pTpdu->userData.length);
+       } else if (pTpdu->dcs.codingScheme == SMS_CHARSET_EUCKR) {
+               msgInfo->encodeType = MSG_ENCODE_8BIT;
+               msgInfo->dataSize = SmsPluginTextConvert::instance()->convertEUCKRToUTF8((unsigned char*)msgInfo->msgText, MAX_MSG_TEXT_LEN, (unsigned char*)pTpdu->userData.data, pTpdu->userData.length);
+               return;
        }
 }
 
index d068e09..d81dfab 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include "MsgDebug.h"
 #include "MsgException.h"
 
 extern "C"
 {
+       #include <tapi_common.h>
+       #include <TelSms.h>
+       #include <TapiUtility.h>
        #include <ITapiSim.h>
        #include <ITapiNetText.h>
 }
 
+struct tapi_handle *pTapiHandle = NULL;
 
 /*==================================================================================================
                                      FUNCTION IMPLEMENTATION
 ==================================================================================================*/
-MSG_ERROR_T MsgPlgCreateHandle(MSG_PLUGIN_HANDLER_S *pPluginHandle)
+msg_error_t MsgPlgCreateHandle(MSG_PLUGIN_HANDLER_S *pPluginHandle)
 {
        if (pPluginHandle == NULL)
        {
@@ -71,7 +75,7 @@ MSG_ERROR_T MsgPlgCreateHandle(MSG_PLUGIN_HANDLER_S *pPluginHandle)
 }
 
 
-MSG_ERROR_T MsgPlgDestroyHandle(MSG_PLUGIN_HANDLER_S *pPluginHandle)
+msg_error_t MsgPlgDestroyHandle(MSG_PLUGIN_HANDLER_S *pPluginHandle)
 {
        if (pPluginHandle != NULL)
        {
@@ -85,17 +89,19 @@ MSG_ERROR_T MsgPlgDestroyHandle(MSG_PLUGIN_HANDLER_S *pPluginHandle)
 }
 
 
-MSG_ERROR_T SmsPlgInitialize()
+msg_error_t SmsPlgInitialize()
 {
        MSG_BEGIN();
 
-       int tapiRet = TAPI_API_SUCCESS;
+       TapiHandle *ph;
 
-       tapiRet = tel_init();
+       ph = tel_init(NULL);
 
-       if (tapiRet != TAPI_API_SUCCESS)
+       if (!ph)
                return MSG_ERR_PLUGIN_TAPIINIT;
 
+       pTapiHandle = ph;
+
        try
        {
                SmsPluginCallback::instance()->registerEvent();
@@ -117,13 +123,13 @@ MSG_ERROR_T SmsPlgInitialize()
 }
 
 
-MSG_ERROR_T SmsPlgFinalize()
+msg_error_t SmsPlgFinalize()
 {
        MSG_BEGIN();
 
        SmsPluginCallback::instance()->deRegisterEvent();
 
-        tel_deinit();
+       tel_deinit(pTapiHandle);
 
        MSG_END();
 
@@ -131,7 +137,7 @@ MSG_ERROR_T SmsPlgFinalize()
 }
 
 
-MSG_ERROR_T SmsPlgRegisterListener(MSG_PLUGIN_LISTENER_S *pListener)
+msg_error_t SmsPlgRegisterListener(MSG_PLUGIN_LISTENER_S *pListener)
 {
        MSG_BEGIN();
 
@@ -143,7 +149,7 @@ MSG_ERROR_T SmsPlgRegisterListener(MSG_PLUGIN_LISTENER_S *pListener)
 }
 
 
-MSG_ERROR_T SmsPlgCheckSimStatus(MSG_SIM_STATUS_T *pStatus)
+msg_error_t SmsPlgCheckSimStatus(MSG_SIM_STATUS_T *pStatus)
 {
        MSG_BEGIN();
 
@@ -152,17 +158,18 @@ MSG_ERROR_T SmsPlgCheckSimStatus(MSG_SIM_STATUS_T *pStatus)
        TelSimCardStatus_t status = TAPI_SIM_STATUS_CARD_ERROR;
        int cardChanged = 0;
 
+       // initialize pStatus.
+       *pStatus = MSG_SIM_STATUS_NOT_FOUND;
+
        // Check SIM Status
        while (1)
        {
                if (tryNum > 30) return MSG_ERR_PLUGIN_TAPIINIT;
 
-               tapiRet = tel_get_sim_init_info(&status, &cardChanged);
+               tapiRet = tel_get_sim_init_info(pTapiHandle, &status, &cardChanged);
 
-               if (tapiRet == TAPI_API_SUCCESS)
-               {
-                       if (status == TAPI_SIM_STATUS_SIM_PIN_REQUIRED || status == TAPI_SIM_STATUS_SIM_PUK_REQUIRED)
-                       {
+               if (tapiRet == TAPI_API_SUCCESS) {
+                       if (status == TAPI_SIM_STATUS_SIM_PIN_REQUIRED || status == TAPI_SIM_STATUS_SIM_PUK_REQUIRED) {
                                MSG_DEBUG("PIN or PUK is required [%d]", status);
 
                                sleep(3);
@@ -170,8 +177,7 @@ MSG_ERROR_T SmsPlgCheckSimStatus(MSG_SIM_STATUS_T *pStatus)
                                continue;
                        }
 
-                       if (status == TAPI_SIM_STATUS_SIM_INIT_COMPLETED)
-                       {
+                       if (status == TAPI_SIM_STATUS_SIM_INIT_COMPLETED) {
                                MSG_DEBUG("SIM status is OK [%d]", status);
 
                                MSG_DEBUG("SIM Changed [%d]", cardChanged);
@@ -182,55 +188,67 @@ MSG_ERROR_T SmsPlgCheckSimStatus(MSG_SIM_STATUS_T *pStatus)
                                        *pStatus = MSG_SIM_STATUS_NORMAL;
 
                                break;
-                       }
-                       else if (status == TAPI_SIM_STATUS_CARD_NOT_PRESENT)
-                       {
+                       } else if (status == TAPI_SIM_STATUS_CARD_NOT_PRESENT) {
                                MSG_DEBUG("SIM is not present [%d]", status);
-
-                               *pStatus = MSG_SIM_STATUS_NOT_FOUND;
-
                                break;
-                       }
-                       else
-                       {
+                       } else {
                                MSG_DEBUG("SIM status is not OK [%d]", status);
-
                                tryNum++;
 
                                sleep(3);
                        }
+               } else if (tapiRet == TAPI_API_SIM_NOT_FOUND) {
+                       MSG_DEBUG("tel_get_sim_init_info() result is TAPI_API_SIM_NOT_FOUND");
+                       break;
+               } else {
+                       MSG_DEBUG("tel_get_sim_init_info() result is unknown!!!!!!!!!! [%d]", tapiRet);
+                       tryNum++;
+
+                       sleep(3);
                }
-               else if (tapiRet == TAPI_API_SIM_NOT_FOUND)
+       }
+
+
+       char imsi[7];
+       memset(imsi, 0x00, sizeof(imsi));
+
+       // Get IMSI
+       if (*pStatus != MSG_SIM_STATUS_NOT_FOUND)
+       {
+               // Get IMSI
+               TelSimImsiInfo_t imsiInfo = {0};
+
+               tapiRet = tel_get_sim_imsi(pTapiHandle, &imsiInfo);
+
+               if (tapiRet == TAPI_API_SUCCESS)
                {
-                       MSG_DEBUG("tel_get_sim_init_info() result is TAPI_API_SIM_NOT_FOUND");
+                       MSG_DEBUG("tel_get_sim_imsi() Success - MCC [%s], MNC [%s]", imsiInfo.szMcc, imsiInfo.szMnc);
 
-                       *pStatus = MSG_SIM_STATUS_NOT_FOUND;
+                       sprintf(imsi, "%03d%03d", atoi(imsiInfo.szMcc), atoi(imsiInfo.szMnc));
 
-                       break;
+                       MSG_DEBUG("IMSI [%d]", atoi(imsi));
                }
                else
                {
-                       MSG_DEBUG("tel_get_sim_init_info() result is unknown!!!!!!!!!! [%d]", tapiRet);
-
-                       tryNum++;
-
-                       sleep(3);
+                       MSG_DEBUG("tel_get_sim_imsi() Error![%d]", tapiRet);
                }
        }
 
+       MsgSettingSetString(MSG_SIM_IMSI, imsi);
+
        MSG_END();
 
        return MSG_SUCCESS;
 }
 
 
-MSG_ERROR_T SmsPlgCheckDeviceStatus()
+msg_error_t SmsPlgCheckDeviceStatus()
 {
        MSG_BEGIN();
 
        int status = 0, tapiRet = TAPI_API_SUCCESS;
 
-       tapiRet = tel_check_sms_device_status(&status);
+       tapiRet = tel_check_sms_device_status(pTapiHandle, &status);
 
        if (tapiRet != TAPI_API_SUCCESS)
        {
@@ -239,12 +257,12 @@ MSG_ERROR_T SmsPlgCheckDeviceStatus()
                return MSG_ERR_PLUGIN_TAPI_FAILED;
        }
 
-       if (status == TAPI_NETTEXT_DEVICE_READY)
+       if (status == 1)
        {
                MSG_DEBUG("Device Is Ready");
                return MSG_SUCCESS;
        }
-       else if (status == TAPI_NETTEXT_DEVICE_NOT_READY)
+       else if (status == 0)
        {
                MSG_DEBUG("Device Is Not Ready.. Waiting For Ready Callback");
 
@@ -259,7 +277,7 @@ MSG_ERROR_T SmsPlgCheckDeviceStatus()
 }
 
 
-MSG_ERROR_T SmsPlgSubmitRequest(MSG_REQUEST_INFO_S *pReqInfo, bool bReqCb)
+msg_error_t SmsPlgSubmitRequest(MSG_REQUEST_INFO_S *pReqInfo)
 {
        // Add Submit SMS into DB
        if ((pReqInfo->msgInfo.msgId == 0) && pReqInfo->msgInfo.msgPort.valid == false) {
@@ -290,8 +308,6 @@ MSG_ERROR_T SmsPlgSubmitRequest(MSG_REQUEST_INFO_S *pReqInfo, bool bReqCb)
        memcpy(&(request.msgInfo), &(pReqInfo->msgInfo), sizeof(MSG_MESSAGE_INFO_S));
        memcpy(&(request.sendOptInfo), &(pReqInfo->sendOptInfo), sizeof(MSG_SENDINGOPT_INFO_S));
 
-       request.bReqCb = bReqCb;
-
        // Add Request into Queue and Start UA Manger
        SmsPluginUAManager::instance()->addReqEntity(request);
 
@@ -299,8 +315,16 @@ MSG_ERROR_T SmsPlgSubmitRequest(MSG_REQUEST_INFO_S *pReqInfo, bool bReqCb)
 }
 
 
-MSG_ERROR_T SmsPlgInitSimMessage()
+msg_error_t SmsPlgInitSimMessage()
 {
+       // Check SIM is present or not
+       MSG_SIM_STATUS_T simStatus = (MSG_SIM_STATUS_T)MsgSettingGetInt(MSG_SIM_CHANGED);
+
+       if (simStatus == MSG_SIM_STATUS_NOT_FOUND) {
+               MSG_DEBUG("SIM is not present..");
+               return MSG_ERR_NO_SIM;
+       }
+
        try
        {
                SmsPluginSimMsg::instance()->initSimMessage();
@@ -320,9 +344,17 @@ MSG_ERROR_T SmsPlgInitSimMessage()
 }
 
 
-MSG_ERROR_T SmsPlgSaveSimMessage(const MSG_MESSAGE_INFO_S *pMsgInfo, SMS_SIM_ID_LIST_S *pSimIdList)
+msg_error_t SmsPlgSaveSimMessage(const MSG_MESSAGE_INFO_S *pMsgInfo, SMS_SIM_ID_LIST_S *pSimIdList)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       // Check SIM is present or not
+       MSG_SIM_STATUS_T simStatus = (MSG_SIM_STATUS_T)MsgSettingGetInt(MSG_SIM_CHANGED);
+
+       if (simStatus == MSG_SIM_STATUS_NOT_FOUND) {
+               MSG_DEBUG("SIM is not present..");
+               return MSG_ERR_NO_SIM;
+       }
+
+       msg_error_t err = MSG_SUCCESS;
 
        err = SmsPluginSimMsg::instance()->saveSimMessage(pMsgInfo, pSimIdList);
 
@@ -330,8 +362,16 @@ MSG_ERROR_T SmsPlgSaveSimMessage(const MSG_MESSAGE_INFO_S *pMsgInfo, SMS_SIM_ID_
 }
 
 
-MSG_ERROR_T SmsPlgDeleteSimMessage(MSG_SIM_ID_T SimMsgId)
+msg_error_t SmsPlgDeleteSimMessage(msg_sim_id_t SimMsgId)
 {
+       // Check SIM is present or not
+       MSG_SIM_STATUS_T simStatus = (MSG_SIM_STATUS_T)MsgSettingGetInt(MSG_SIM_CHANGED);
+
+       if (simStatus == MSG_SIM_STATUS_NOT_FOUND) {
+               MSG_DEBUG("SIM is not present..");
+               return MSG_ERR_NO_SIM;
+       }
+
        try
        {
                SmsPluginSimMsg::instance()->deleteSimMessage(SimMsgId);
@@ -351,8 +391,16 @@ MSG_ERROR_T SmsPlgDeleteSimMessage(MSG_SIM_ID_T SimMsgId)
 }
 
 
-MSG_ERROR_T SmsPlgSetReadStatus(MSG_SIM_ID_T SimMsgId)
+msg_error_t SmsPlgSetReadStatus(msg_sim_id_t SimMsgId)
 {
+       // Check SIM is present or not
+       MSG_SIM_STATUS_T simStatus = (MSG_SIM_STATUS_T)MsgSettingGetInt(MSG_SIM_CHANGED);
+
+       if (simStatus == MSG_SIM_STATUS_NOT_FOUND) {
+               MSG_DEBUG("SIM is not present..");
+               return MSG_ERR_NO_SIM;
+       }
+
        try
        {
                SmsPluginSimMsg::instance()->setReadStatus(SimMsgId);
@@ -372,8 +420,16 @@ MSG_ERROR_T SmsPlgSetReadStatus(MSG_SIM_ID_T SimMsgId)
 }
 
 
-MSG_ERROR_T SmsPlgSetMemoryStatus(MSG_ERROR_T Error)
+msg_error_t SmsPlgSetMemoryStatus(msg_error_t Error)
 {
+       // Check SIM is present or not
+       MSG_SIM_STATUS_T simStatus = (MSG_SIM_STATUS_T)MsgSettingGetInt(MSG_SIM_CHANGED);
+
+       if (simStatus == MSG_SIM_STATUS_NOT_FOUND) {
+               MSG_DEBUG("SIM is not present..");
+               return MSG_ERR_NO_SIM;
+       }
+
        int tapiRet = TAPI_API_SUCCESS, reqId = 0;
        int status = TAPI_NETTEXT_PDA_MEMORY_STATUS_AVAILABLE;
 
@@ -384,7 +440,7 @@ MSG_ERROR_T SmsPlgSetMemoryStatus(MSG_ERROR_T Error)
 
        MSG_DEBUG("Set Status : [%d]", status);
 
-       tapiRet = tel_set_sms_memory_status(status, &reqId);
+       tapiRet = tel_set_sms_memory_status(pTapiHandle, status, NULL, NULL);
 
        if (tapiRet == TAPI_API_SUCCESS)
        {
@@ -399,8 +455,16 @@ MSG_ERROR_T SmsPlgSetMemoryStatus(MSG_ERROR_T Error)
 }
 
 
-MSG_ERROR_T SmsPlgInitConfigData(MSG_SIM_STATUS_T SimStatus)
+msg_error_t SmsPlgInitConfigData(MSG_SIM_STATUS_T SimStatus)
 {
+       // Check SIM is present or not
+       MSG_SIM_STATUS_T simStatus = (MSG_SIM_STATUS_T)MsgSettingGetInt(MSG_SIM_CHANGED);
+
+       if (simStatus == MSG_SIM_STATUS_NOT_FOUND) {
+               MSG_DEBUG("SIM is not present..");
+               return MSG_ERR_NO_SIM;
+       }
+
        try
        {
                SmsPluginSetting::instance()->initConfigData(SimStatus);
@@ -420,8 +484,16 @@ MSG_ERROR_T SmsPlgInitConfigData(MSG_SIM_STATUS_T SimStatus)
 }
 
 
-MSG_ERROR_T SmsPlgSetConfigData(const MSG_SETTING_S *pSetting)
+msg_error_t SmsPlgSetConfigData(const MSG_SETTING_S *pSetting)
 {
+       // Check SIM is present or not
+       MSG_SIM_STATUS_T simStatus = (MSG_SIM_STATUS_T)MsgSettingGetInt(MSG_SIM_CHANGED);
+
+       if (simStatus == MSG_SIM_STATUS_NOT_FOUND) {
+               MSG_DEBUG("SIM is not present..");
+               return MSG_ERR_NO_SIM;
+       }
+
        try
        {
                SmsPluginSetting::instance()->setConfigData(pSetting);
@@ -441,8 +513,16 @@ MSG_ERROR_T SmsPlgSetConfigData(const MSG_SETTING_S *pSetting)
 }
 
 
-MSG_ERROR_T SmsPlgGetConfigData(MSG_SETTING_S *pSetting)
+msg_error_t SmsPlgGetConfigData(MSG_SETTING_S *pSetting)
 {
+       // Check SIM is present or not
+       MSG_SIM_STATUS_T simStatus = (MSG_SIM_STATUS_T)MsgSettingGetInt(MSG_SIM_CHANGED);
+
+       if (simStatus == MSG_SIM_STATUS_NOT_FOUND) {
+               MSG_DEBUG("SIM is not present..");
+               return MSG_ERR_NO_SIM;
+       }
+
        try
        {
                SmsPluginSetting::instance()->getConfigData(pSetting);
index 6a1a863..6ae49d9 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include <stdio.h>
 #include <string.h>
@@ -192,6 +192,8 @@ int SmsPluginParamCodec::encodeSMSC(const char *pAddress, unsigned char *pEncode
        char newAddr[MAX_SMSC_LEN+1];
        memset(newAddr, 0x00, sizeof(newAddr));
 
+//MSG_DEBUG("SMSC [%s]", pAddress);
+
        if (pAddress[0] == '+')
        {
                strncpy(newAddr, pAddress+1, MAX_SMSC_LEN);
@@ -302,6 +304,8 @@ MSG_DEBUG("npi [%d]", pAddress->npi);
 
        offset +=       bcdLen;
 
+//MSG_DEBUG("address [%s]", pAddress->address);
+
        return offset;
 }
 
@@ -449,6 +453,9 @@ int SmsPluginParamCodec::convertDigitToBcd(char *pDigit, int DigitLen, unsigned
        int offset = 0;
        unsigned char temp;
 
+//MSG_DEBUG("DigitLen [%d]", DigitLen);
+//MSG_DEBUG("pDigit [%s]", pDigit);
+
        for (int i = 0; i < DigitLen; i++)
        {
                if (pDigit[i] == '*')
index 1ff65f7..60dd028 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include "MsgDebug.h"
 #include "MsgCppTypes.h"
 #include "SmsPluginUDCodec.h"
 #include "SmsPluginSetting.h"
 #include "SmsPluginTransport.h"
+#include "SmsPluginCallback.h"
 #include "SmsPluginEventHandler.h"
 #include "SmsPluginSatHandler.h"
 
 extern "C"
 {
+       #include <tapi_common.h>
+       #include <TelSms.h>
+       #include <TapiUtility.h>
        #include <ITapiNetText.h>
        #include <ITapiSat.h>
 }
 
+extern struct tapi_handle *pTapiHandle;
 /*==================================================================================================
                                      IMPLEMENTATION OF SmsPluginCbMsgHandler - Member Functions
 ==================================================================================================*/
@@ -65,66 +70,6 @@ SmsPluginSatHandler* SmsPluginSatHandler::instance()
 
 void SmsPluginSatHandler::refreshSms(void *pData)
 {
-       TelSatRefreshInd_t* pRefreshData = (TelSatRefreshInd_t*)pData;
-
-       if (pRefreshData->appType != TAPI_SAT_REFRESH_MSG)
-       {
-               MSG_DEBUG("App Type is wrong. [%d]", pRefreshData->appType);
-               return;
-       }
-
-       commandId = pRefreshData->commandId;
-
-       switch (pRefreshData->refreshMode)
-       {
-               case TAPI_SAT_REFRESH_SIM_INIT_AND_FULL_FCN :
-               case TAPI_SAT_REFRESH_SIM_INIT_AND_FCN :
-               {
-                       for (int i = 0; i < pRefreshData->fileCount; i++)
-                       {
-                               if ((SMS_SIM_EFILE_NAME_T)pRefreshData->fileId[i].FileName == SMS_SIM_EFILE_USIM_SMSP ||
-                                       (SMS_SIM_EFILE_NAME_T)pRefreshData->fileId[i].FileName == SMS_SIM_EFILE_SMSP)
-                               {
-                                       bSMSPChanged = true;
-                               }
-                               else if ((SMS_SIM_EFILE_NAME_T)pRefreshData->fileId[i].FileName == SMS_SIM_EFILE_USIM_CBMI ||
-                                       (SMS_SIM_EFILE_NAME_T)pRefreshData->fileId[i].FileName == SMS_SIM_EFILE_CBMI)
-                               {
-                                       bCBMIChanged = true;
-                               }
-                       }
-
-                       initSim();
-               }
-               break;
-
-               case TAPI_SAT_REFRESH_FCN :
-               {
-                       for (int i = 0; i < pRefreshData->fileCount; i++)
-                       {
-                               if ((SMS_SIM_EFILE_NAME_T)pRefreshData->fileId[i].FileName == SMS_SIM_EFILE_USIM_SMSP ||
-                                       (SMS_SIM_EFILE_NAME_T)pRefreshData->fileId[i].FileName == SMS_SIM_EFILE_SMSP)
-                               {
-                                       bSMSPChanged = true;
-                               }
-                               else if ((SMS_SIM_EFILE_NAME_T)pRefreshData->fileId[i].FileName == SMS_SIM_EFILE_USIM_CBMI ||
-                                       (SMS_SIM_EFILE_NAME_T)pRefreshData->fileId[i].FileName == SMS_SIM_EFILE_CBMI)
-                               {
-                                       bCBMIChanged = true;
-                               }
-                       }
-               }
-               break;
-
-               case TAPI_SAT_REFRESH_SIM_INIT :
-               {
-                       initSim();
-               }
-               break;
-
-               default:
-               break;
-       }
 }
 
 
@@ -198,7 +143,7 @@ void SmsPluginSatHandler::sendSms(void *pData)
        int reqId = 0, tapiRet = TAPI_API_SUCCESS;
 
        // Send SMS
-       tapiRet = tel_send_sms(&pkgInfo, 0, &reqId);
+       tapiRet = tel_send_sms(pTapiHandle, &pkgInfo, 0, TapiEventSentStatus, &reqId);
 
        if (tapiRet == TAPI_API_SUCCESS)
        {
@@ -233,7 +178,7 @@ void SmsPluginSatHandler::ctrlSms(void *pData)
        }
        else // Send SMS By APP
        {
-               MSG_NETWORK_STATUS_T netStatus = MSG_NETWORK_NOT_SEND;
+               msg_network_status_t netStatus = MSG_NETWORK_NOT_SEND;
 
                if (pCtrlData->moSmsCtrlResult == TAPI_SAT_CALL_CTRL_R_NOT_ALLOWED)
                {
@@ -249,12 +194,12 @@ void SmsPluginSatHandler::ctrlSms(void *pData)
                }
 
                // Call Event Handler
-               SmsPluginEventHandler::instance()->handleSentStatus(-1, netStatus);
+               SmsPluginEventHandler::instance()->handleSentStatus(netStatus);
        }
 }
 
 
-void SmsPluginSatHandler::ctrlSms(MSG_NETWORK_STATUS_T netStatus)
+void SmsPluginSatHandler::ctrlSms(msg_network_status_t netStatus)
 {
        if (bSendSms == true) // Send SMS By SAT
        {
@@ -274,7 +219,7 @@ void SmsPluginSatHandler::ctrlSms(MSG_NETWORK_STATUS_T netStatus)
 }
 
 
-void SmsPluginSatHandler::finishSimMsgInit(MSG_ERROR_T Err)
+void SmsPluginSatHandler::finishSimMsgInit(msg_error_t Err)
 {
        // SAT Handler is initializing SIM now
        if (bInitSim == true)
@@ -342,6 +287,7 @@ void        SmsPluginSatHandler::initSMSCList()
        for (int i = 0; i < settingData.option.smscList.totalCnt; i++)
        {
                MSG_DEBUG("pid[%d]", settingData.option.smscList.smscData[i].pid);
+//             MSG_DEBUG("dcs[%d]", settingData.option.smscList.smscData[i].dcs);
                MSG_DEBUG("val_period[%d]", settingData.option.smscList.smscData[i].valPeriod);
                MSG_DEBUG("name[%s]", settingData.option.smscList.smscData[i].name);
 
@@ -363,7 +309,7 @@ void        SmsPluginSatHandler::initSMSCList()
        }
 
        char keyName[128];
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        for (int i = 0; i < settingData.option.smscList.totalCnt; i++)
        {
@@ -445,7 +391,7 @@ void        SmsPluginSatHandler::initCBConfig()
        }
 
        char keyName[128];
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        for (int i = 0; i < settingData.option.cbMsgOpt.channelData.channelCnt; i++)
        {
@@ -497,6 +443,9 @@ int SmsPluginSatHandler::handleSatTpdu(unsigned char *pTpdu, unsigned char TpduL
 
        pos++;
 
+//     pTpdu[pos++] = SmsPluginTransport::instance()->getMsgRef();
+
+
        // TP-DA
        SMS_ADDRESS_S destAddr = {0};
        int addrLen = SmsPluginParamCodec::decodeAddress(&pTpdu[pos], &destAddr);
@@ -588,7 +537,7 @@ void SmsPluginSatHandler::sendResult(SMS_SAT_CMD_TYPE_T CmdType, int ResultType)
 
        int tapiRet = TAPI_API_SUCCESS;
 
-       tapiRet = tel_send_sat_app_exec_result(&satRetInfo);
+       tapiRet = tel_send_sat_app_exec_result(pTapiHandle, &satRetInfo);
 
        if (tapiRet == TAPI_API_SUCCESS)
        {
index b45c038..4f58d91 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include <errno.h>
 
 #include "MsgException.h"
 #include "MsgGconfWrapper.h"
 #include "SmsPluginParamCodec.h"
+#include "SmsPluginCallback.h"
 #include "SmsPluginSetting.h"
 
 
 extern "C"
 {
-#ifndef _TAPI_NETTEXT_H_
-       #include "ITapiNetText.h"
-       #include "ITapiSim.h"
-#endif
+       #include <tapi_common.h>
+       #include <TelSms.h>
+       #include <TapiUtility.h>
+       #include <ITapiNetText.h>
 }
 
+extern struct tapi_handle *pTapiHandle;
 
 /*==================================================================================================
                                      IMPLEMENTATION OF SmsPluginSetting - Member Functions
@@ -70,7 +72,7 @@ void SmsPluginSetting::initConfigData(MSG_SIM_STATUS_T SimStatus)
 {
        MSG_BEGIN();
 
-       MSG_ERROR_T     err = MSG_SUCCESS;
+       msg_error_t     err = MSG_SUCCESS;
 
        // Init SMS Parameter
        int paramCnt = 0;
@@ -199,9 +201,9 @@ void SmsPluginSetting::getConfigData(MSG_SETTING_S *pSetting)
 }
 
 
-MSG_ERROR_T SmsPluginSetting::addSMSCList(MSG_SMSC_LIST_S *pSmscList)
+msg_error_t SmsPluginSetting::addSMSCList(MSG_SMSC_LIST_S *pSmscList)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        MSG_DEBUG("total_count[%d]", pSmscList->totalCnt);
        MSG_DEBUG("selected index[%d]", pSmscList->selected);
@@ -286,9 +288,9 @@ MSG_ERROR_T SmsPluginSetting::addSMSCList(MSG_SMSC_LIST_S *pSmscList)
 }
 
 
-MSG_ERROR_T SmsPluginSetting::addCbOpt(MSG_CBMSG_OPT_S *pCbOpt)
+msg_error_t SmsPluginSetting::addCbOpt(MSG_CBMSG_OPT_S *pCbOpt)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        MSG_DEBUG("Receive [%d], All Channel [%d], Max SIM Count [%d]", pCbOpt->bReceive, pCbOpt->bAllChannel, pCbOpt->maxSimCnt);
 
@@ -470,7 +472,7 @@ void SmsPluginSetting::setParamList(const MSG_SMSC_LIST_S *pSMSCList)
                smsParam.ParamIndicator = ~(smsParam.ParamIndicator);
                MSG_DEBUG("ParamIndicator = [%02x]", smsParam.ParamIndicator);
 
-               ret = tel_set_sms_parameters((const TelSmsParams_t*)&smsParam, &reqId);
+               ret = tel_set_sms_parameters(pTapiHandle, (const TelSmsParams_t*)&smsParam, TapiEventSetConfigData, NULL);
 
                if (ret != TAPI_API_SUCCESS)
                        THROW(MsgException::SMS_PLG_ERROR, "tel_set_sms_parameters() Error. [%d]", ret);
@@ -500,7 +502,7 @@ void SmsPluginSetting::getParamList(MSG_SMSC_LIST_S *pSMSCList)
 
        for (int index = 0; index < paramCnt; index++)
        {
-               ret = tel_get_sms_parameters(index, &reqId);
+               ret = tel_get_sms_parameters(pTapiHandle, index, TapiEventGetParam, NULL);
 
                if (ret == TAPI_API_SUCCESS)
                {
@@ -546,7 +548,7 @@ int SmsPluginSetting::getParamCount()
 
        int ret = TAPI_API_SUCCESS;
 
-       ret = tel_get_sms_parameter_count(&reqId);
+       ret = tel_get_sms_parameter_count(pTapiHandle, TapiEventGetParamCnt, NULL);
 
        if (ret == TAPI_API_SUCCESS)
        {
@@ -567,7 +569,7 @@ bool SmsPluginSetting::getParam(int Index, MSG_SMSC_DATA_S *pSmscData)
 
        int ret = TAPI_API_SUCCESS;
 
-       ret = tel_get_sms_parameters(Index, &reqId);
+       ret = tel_get_sms_parameters(pTapiHandle, Index, TapiEventGetParam, NULL);
 
        if (ret == TAPI_API_SUCCESS)
        {
@@ -615,7 +617,7 @@ bool SmsPluginSetting::setCbConfig(const MSG_CBMSG_OPT_S *pCbOpt)
                cbConfig.MsgIDs[i] = (unsigned short)pCbOpt->channelData.channelInfo[i].id;
        }
 
-       ret = tel_set_sms_cb_config(&cbConfig, &reqId);
+       ret = tel_set_sms_cb_config(pTapiHandle, &cbConfig, TapiEventSetConfigData, NULL);
 
        if (ret == TAPI_API_SUCCESS)
        {
@@ -647,7 +649,7 @@ bool SmsPluginSetting::getCbConfig(MSG_CBMSG_OPT_S *pCbOpt)
 
        int ret = TAPI_API_SUCCESS;
 
-       ret = tel_get_sms_cb_config(&reqId);
+       ret = tel_get_sms_cb_config(pTapiHandle, TapiEventGetCBConfig, NULL);
 
        if (ret == TAPI_API_SUCCESS)
        {
@@ -870,4 +872,3 @@ SMS_PID_T SmsPluginSetting::convertPid(MSG_SMS_PID_T pid)
 
        return retPid;
 }
-
index 73c6a7c..33af517 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include <errno.h>
 
 #include "SmsPluginTransport.h"
 #include "SmsPluginStorage.h"
 #include "SmsPluginEventHandler.h"
+#include "SmsPluginCallback.h"
 #include "SmsPluginSimMsg.h"
 
+extern struct tapi_handle *pTapiHandle;
 
 /*==================================================================================================
                                      IMPLEMENTATION OF SmsPluginSimMsg - Member Functions
@@ -65,11 +67,13 @@ void SmsPluginSimMsg::initSimMessage()
 {
        MSG_BEGIN();
 
-       MSG_SIM_COUNT_S tmpMsgCnt = {};
+       MSG_SIM_COUNT_S tmpMsgCnt;
+       memset(&tmpMsgCnt, 0x00, sizeof(MSG_SIM_COUNT_S));
 
        getSimMsgCount(&tmpMsgCnt);
 
-       MSG_MESSAGE_INFO_S tmpMsgInfo = {};
+       MSG_MESSAGE_INFO_S tmpMsgInfo;
+       memset(&tmpMsgInfo, 0x00, sizeof(MSG_MESSAGE_INFO_S));
 
        for (int i = 0; i < tmpMsgCnt.usedCount; i++)
        {
@@ -87,12 +91,13 @@ void SmsPluginSimMsg::initSimMessage()
 }
 
 
-MSG_ERROR_T SmsPluginSimMsg::saveSimMessage(const MSG_MESSAGE_INFO_S *pMsgInfo, SMS_SIM_ID_LIST_S *pSimIdList)
+msg_error_t SmsPluginSimMsg::saveSimMessage(const MSG_MESSAGE_INFO_S *pMsgInfo, SMS_SIM_ID_LIST_S *pSimIdList)
 {
        // Reset Out Parameter
        pSimIdList->count = 0;
 
        SMS_TPDU_S tpdu;
+       memset(&tpdu, 0x00, sizeof(SMS_TPDU_S));
 
        tpdu.tpduType = SMS_TPDU_DELIVER;
 
@@ -104,11 +109,13 @@ MSG_ERROR_T SmsPluginSimMsg::saveSimMessage(const MSG_MESSAGE_INFO_S *pMsgInfo,
 
        // Set SMSC Options
        SMS_ADDRESS_S smsc;
+       memset(&smsc, 0x00, sizeof(SMS_ADDRESS_S));
        SmsPluginTransport::instance()->setSmscOptions(&smsc);
 
        // Make SMS_SUBMIT_DATA_S from MSG_REQUEST_INFO_S
        SMS_SUBMIT_DATA_S submitData;
-       SmsPluginTransport::instance()->msgInfoToSubmitData(pMsgInfo, &submitData, &(tpdu.data.deliver.dcs.codingScheme));
+       memset(&submitData, 0x00, sizeof(SMS_SUBMIT_DATA_S));
+       SmsPluginTransport::instance()->msgInfoToSubmitData(pMsgInfo, &submitData, &(tpdu.data.deliver.dcs.codingScheme), 0);
 
        // Check sim message full.
        if (checkSimMsgFull(submitData.segCount) == true)
@@ -137,14 +144,6 @@ MSG_ERROR_T SmsPluginSimMsg::saveSimMessage(const MSG_MESSAGE_INFO_S *pMsgInfo,
 
        for (unsigned int segCnt = 0; segCnt < submitData.segCount; segCnt++)
        {
-               if (submitData.userData[segCnt].header[0].udhType == SMS_UDH_CONCAT_8BIT ||
-                       submitData.userData[segCnt].header[0].udhType == SMS_UDH_CONCAT_16BIT)
-               {
-                       tpdu.data.deliver.userData.headerCnt = 1;
-
-                       SmsPluginTransport::instance()->setConcatHeader(&(submitData.userData[segCnt].header[0]), &(tpdu.data.deliver.userData.header[0]));
-               }
-
                tpdu.data.deliver.userData.length = submitData.userData[segCnt].length;
                memcpy(tpdu.data.deliver.userData.data, submitData.userData[segCnt].data, submitData.userData[segCnt].length);
 
@@ -173,7 +172,7 @@ MSG_ERROR_T SmsPluginSimMsg::saveSimMessage(const MSG_MESSAGE_INFO_S *pMsgInfo,
                // Save SMS in SIM
                int ret = 0;
 
-               ret = tel_write_sms_in_sim(&simSmsData, &reqId);
+               ret = tel_write_sms_in_sim(pTapiHandle, &simSmsData, TapiEventSaveSimMsg, NULL);
 
                if (ret == TAPI_API_SUCCESS)
                {
@@ -186,7 +185,7 @@ MSG_ERROR_T SmsPluginSimMsg::saveSimMessage(const MSG_MESSAGE_INFO_S *pMsgInfo,
                        return MSG_ERR_PLUGIN_STORAGE;
                }
 
-               MSG_SIM_ID_T SimId = 0;
+               msg_sim_id_t SimId = 0;
 
                bool bResult = false;
 
@@ -222,7 +221,7 @@ MSG_ERROR_T SmsPluginSimMsg::saveSimMessage(const MSG_MESSAGE_INFO_S *pMsgInfo,
 }
 
 
-MSG_ERROR_T SmsPluginSimMsg::saveClass2Message(const MSG_MESSAGE_INFO_S *pMsgInfo)
+msg_error_t SmsPluginSimMsg::saveClass2Message(const MSG_MESSAGE_INFO_S *pMsgInfo)
 {
        // Reset Flag
        bClass2Msg = false;
@@ -243,7 +242,7 @@ MSG_ERROR_T SmsPluginSimMsg::saveClass2Message(const MSG_MESSAGE_INFO_S *pMsgInf
 
        // Make SMS_SUBMIT_DATA_S from MSG_REQUEST_INFO_S
        SMS_SUBMIT_DATA_S submitData;
-       SmsPluginTransport::instance()->msgInfoToSubmitData(pMsgInfo, &submitData, &(tpdu.data.deliver.dcs.codingScheme));
+       SmsPluginTransport::instance()->msgInfoToSubmitData(pMsgInfo, &submitData, &(tpdu.data.deliver.dcs.codingScheme), 0);
 
        // Check sim message full.
        if (checkSimMsgFull(submitData.segCount) == true)
@@ -290,7 +289,7 @@ MSG_ERROR_T SmsPluginSimMsg::saveClass2Message(const MSG_MESSAGE_INFO_S *pMsgInf
        // Save Class 2 Msg in SIM
        int tapiRet = TAPI_API_SUCCESS;
 
-       tapiRet = tel_write_sms_in_sim(&simSmsData, &reqId);
+       tapiRet = tel_write_sms_in_sim(pTapiHandle, &simSmsData, TapiEventSaveSimMsg, NULL);
 
        if (tapiRet == TAPI_API_SUCCESS)
        {
@@ -324,12 +323,12 @@ MSG_ERROR_T SmsPluginSimMsg::saveClass2Message(const MSG_MESSAGE_INFO_S *pMsgInf
 }
 
 
-void SmsPluginSimMsg::deleteSimMessage(MSG_SIM_ID_T SimMsgId)
+void SmsPluginSimMsg::deleteSimMessage(msg_sim_id_t SimMsgId)
 {
        int tapiRet = TAPI_API_SUCCESS;
        int reqId = 0;
 
-       tapiRet = tel_delete_sms_in_sim((int)SimMsgId, &reqId);
+       tapiRet = tel_delete_sms_in_sim(pTapiHandle, (int)SimMsgId, TapiEventDeleteSimMsg, NULL);
 
        if (tapiRet == TAPI_API_SUCCESS)
        {
@@ -340,7 +339,7 @@ void SmsPluginSimMsg::deleteSimMessage(MSG_SIM_ID_T SimMsgId)
                THROW(MsgException::SMS_PLG_ERROR, "########  tel_delete_sms_in_sim Fail !!! req Id : [%d] return : [%d] #######", reqId, tapiRet);
        }
 
-       MSG_SIM_ID_T SimId = 0;
+       msg_sim_id_t SimId = 0;
        bool bResult = false;
 
        bResult = getSimEvent(&SimId);
@@ -356,7 +355,7 @@ void SmsPluginSimMsg::deleteSimMessage(MSG_SIM_ID_T SimMsgId)
 
                if (usedCnt == totalCnt)
                {
-                       tapiRet = tel_set_sms_memory_status(TAPI_NETTEXT_PDA_MEMORY_STATUS_AVAILABLE, &reqId);
+                       tapiRet = tel_set_sms_memory_status(pTapiHandle, TAPI_NETTEXT_PDA_MEMORY_STATUS_AVAILABLE, NULL, NULL);
 
                        if (tapiRet == TAPI_API_SUCCESS)
                        {
@@ -399,15 +398,13 @@ bool SmsPluginSimMsg::checkSimMsgFull(unsigned int SegCnt)
 }
 
 
-void SmsPluginSimMsg::setReadStatus(MSG_SIM_ID_T SimMsgId)
+void SmsPluginSimMsg::setReadStatus(msg_sim_id_t SimMsgId)
 {
        MSG_DEBUG("Sim Message ID [%d]", SimMsgId);
 
-       int reqId = 0;
-
        int ret = TAPI_API_SUCCESS;
 
-       ret = tel_set_sms_message_status((int)SimMsgId, TAPI_NETTEXT_STATUS_READ, &reqId);
+       ret = tel_set_sms_message_status(pTapiHandle, (int)SimMsgId, TAPI_NETTEXT_STATUS_READ, NULL, NULL);
 
        if (ret == TAPI_API_SUCCESS)
        {
@@ -418,18 +415,18 @@ void SmsPluginSimMsg::setReadStatus(MSG_SIM_ID_T SimMsgId)
                THROW(MsgException::SMS_PLG_ERROR, "########  tel_set_sms_message_status Fail !!! return : %d #######", ret);
        }
 
-       MSG_SIM_ID_T SimId = 0;
+       msg_sim_id_t SimId = 0;
        bool bResult = false;
 
        bResult = getSimEvent(&SimId);
 
        if (bResult == true)
        {
-               MSG_DEBUG("######## Setting Read Status was Successful !!! req Id : [%d] #######", reqId);
+               MSG_DEBUG("######## Setting Read Status was Successful !!! #######");
        }
        else
        {
-               THROW(MsgException::SMS_PLG_ERROR, "######## Setting Read Status was Failed !!! req Id : [%d] #######", reqId);
+               THROW(MsgException::SMS_PLG_ERROR, "######## Setting Read Status was Failed !!! #######");
        }
 }
 
@@ -440,7 +437,7 @@ void SmsPluginSimMsg::getSimMsgCount(MSG_SIM_COUNT_S *pSimMsgCnt)
 
        int ret = TAPI_API_SUCCESS;
 
-       ret = tel_get_sms_count(&reqId);
+       ret = tel_get_sms_count(pTapiHandle, TapiEventGetSimMsgCnt, NULL);
 
        if (ret == TAPI_API_SUCCESS)
        {
@@ -462,13 +459,13 @@ void SmsPluginSimMsg::getSimMsgCount(MSG_SIM_COUNT_S *pSimMsgCnt)
 }
 
 
-bool SmsPluginSimMsg::getSimMsg(MSG_SIM_ID_T SimMsgId, MSG_MESSAGE_INFO_S *pMsgInfo)
+bool SmsPluginSimMsg::getSimMsg(msg_sim_id_t SimMsgId, MSG_MESSAGE_INFO_S *pMsgInfo)
 {
        int reqId = 0;
 
        int ret = TAPI_API_SUCCESS;
 
-       ret = tel_read_sms_in_sim(SimMsgId, &reqId);
+       ret = tel_read_sms_in_sim(pTapiHandle, SimMsgId, TapiEventGetSimMsg, NULL);
 
        if (ret == TAPI_API_SUCCESS)
        {
@@ -653,11 +650,11 @@ bool SmsPluginSimMsg::getSimMsgEvent(MSG_MESSAGE_INFO_S *pMsgInfo)
 }
 
 
-void SmsPluginSimMsg::setSimEvent(MSG_SIM_ID_T SimId, bool bResult)
+void SmsPluginSimMsg::setSimEvent(msg_sim_id_t SimId, bool bResult)
 {
        if (bClass2Msg == true)
        {
-               MSG_ERROR_T err = MSG_SUCCESS;
+               msg_error_t err = MSG_SUCCESS;
 
                simMsgInfo.msgId = SimId;
 
@@ -700,7 +697,7 @@ void SmsPluginSimMsg::setSimEvent(MSG_SIM_ID_T SimId, bool bResult)
 }
 
 
-bool SmsPluginSimMsg::getSimEvent(MSG_SIM_ID_T *pSimId)
+bool SmsPluginSimMsg::getSimEvent(msg_sim_id_t *pSimId)
 {
        int ret = 0;
 
@@ -724,4 +721,3 @@ bool SmsPluginSimMsg::getSimEvent(MSG_SIM_ID_T *pSimId)
 
        return bTapiResult;
 }
-
index b6511a6..26fc681 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include <errno.h>
 
@@ -37,6 +37,7 @@ SmsPluginStorage* SmsPluginStorage::pInstance = NULL;
 
 SmsPluginStorage::SmsPluginStorage()
 {
+
 }
 
 
@@ -59,7 +60,7 @@ SmsPluginStorage* SmsPluginStorage::instance()
 }
 
 
-MSG_ERROR_T SmsPluginStorage::updateSentMsg(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_NETWORK_STATUS_T Status)
+msg_error_t SmsPluginStorage::updateSentMsg(MSG_MESSAGE_INFO_S *pMsgInfo, msg_network_status_t status)
 {
        MSG_BEGIN();
 
@@ -67,15 +68,15 @@ MSG_ERROR_T SmsPluginStorage::updateSentMsg(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_NE
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
-       MSG_DEBUG("Update Msg ID : [%d], Network Status : [%d] ", pMsgInfo->msgId, Status);
+       MSG_DEBUG("Update Msg ID : [%d], Network Status : [%d] ", pMsgInfo->msgId, status);
 
        /** Move Msg to SENTBOX */
-       if (Status == MSG_NETWORK_SEND_SUCCESS) {
+       if (status == MSG_NETWORK_SEND_SUCCESS) {
                snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET NETWORK_STATUS = %d, FOLDER_ID = %d WHERE MSG_ID = %d;",
-                                       MSGFW_MESSAGE_TABLE_NAME, Status, MSG_SENTBOX_ID, pMsgInfo->msgId);
+                                       MSGFW_MESSAGE_TABLE_NAME, status, MSG_SENTBOX_ID, pMsgInfo->msgId);
        } else {
                snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET NETWORK_STATUS = %d WHERE MSG_ID = %d;",
-                                       MSGFW_MESSAGE_TABLE_NAME, Status, pMsgInfo->msgId);
+                                       MSGFW_MESSAGE_TABLE_NAME, status, pMsgInfo->msgId);
        }
 
        if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS) {
@@ -83,25 +84,30 @@ MSG_ERROR_T SmsPluginStorage::updateSentMsg(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_NE
                return MSG_ERR_DB_EXEC;
        }
 
+       if (status == MSG_NETWORK_SEND_SUCCESS) {
+               MSG_DEBUG("MsgAddPhoneLog() : folderId [%d]", pMsgInfo->folderId);
+               MsgAddPhoneLog(pMsgInfo);
+       }
+
        MSG_END();
 
        return MSG_SUCCESS;
 }
 
 
-MSG_ERROR_T SmsPluginStorage::addSimMessage(MSG_MESSAGE_INFO_S *pSimMsgInfo)
+msg_error_t SmsPluginStorage::addSimMessage(MSG_MESSAGE_INFO_S *pSimMsgInfo)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
-       unsigned int msgId = 0;
-       unsigned int addrId = 0;
+       msg_message_id_t msgId = 0;
+       msg_thread_id_t convId = 0;
        unsigned int simId = 0;
 
        char sqlQuery[MAX_QUERY_LEN+1];
 
        dbHandle.beginTrans();
 
-       err = MsgStoAddAddress(&dbHandle, &(pSimMsgInfo->addressList[0]), &addrId);
+       err = MsgStoAddAddress(&dbHandle, pSimMsgInfo, &convId);
 
        if (err != MSG_SUCCESS) {
                dbHandle.endTrans(false);
@@ -116,7 +122,7 @@ MSG_ERROR_T SmsPluginStorage::addSimMessage(MSG_MESSAGE_INFO_S *pSimMsgInfo)
        }
 
        simId = pSimMsgInfo->msgId;
-       pSimMsgInfo->msgId = (MSG_MESSAGE_ID_T)msgId;
+       pSimMsgInfo->msgId = msgId;
 
        SMS_CONCAT_SIM_MSG_S concatSimMsg = {0};
 
@@ -145,11 +151,11 @@ MSG_ERROR_T SmsPluginStorage::addSimMessage(MSG_MESSAGE_INFO_S *pSimMsgInfo)
        /**  Add Message */
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
-       snprintf(sqlQuery, sizeof(sqlQuery), "INSERT INTO %s VALUES (%d, %d, %d, %d, %d, %d, %d, %ld, %d, %d, %d, %d, %d, %d, %ld, %d, ?, '', '', ?, %d, 0, %d, 0, 0);",
-                               MSGFW_MESSAGE_TABLE_NAME, msgId, addrId, pSimMsgInfo->folderId, 0, pSimMsgInfo->storageId,
-                               pSimMsgInfo->msgType.mainType, pSimMsgInfo->msgType.subType, pSimMsgInfo->displayTime, pSimMsgInfo->dataSize,
-                               pSimMsgInfo->networkStatus, pSimMsgInfo->bRead, pSimMsgInfo->bProtected, pSimMsgInfo->priority,
-                               pSimMsgInfo->direction, pSimMsgInfo->scheduledTime, pSimMsgInfo->bBackup, MSG_DELIVERY_REPORT_NONE, MSG_READ_REPORT_NONE);
+       snprintf(sqlQuery, sizeof(sqlQuery), "INSERT INTO %s VALUES (%d, %d, %d, %d, %d, %d, %ld, %d, %d, %d, %d, %d, %d, %ld, %d, ?, '', '', ?, %d, 0, %d, 0, 0);",
+                       MSGFW_MESSAGE_TABLE_NAME, msgId, convId, pSimMsgInfo->folderId, pSimMsgInfo->storageId,
+                       pSimMsgInfo->msgType.mainType, pSimMsgInfo->msgType.subType, pSimMsgInfo->displayTime, pSimMsgInfo->dataSize,
+                       pSimMsgInfo->networkStatus, pSimMsgInfo->bRead, pSimMsgInfo->bProtected, pSimMsgInfo->priority,
+                       pSimMsgInfo->direction, 0, pSimMsgInfo->bBackup, MSG_DELIVERY_REPORT_NONE, MSG_READ_REPORT_NONE);
 
        MSG_DEBUG("QUERY : %s", sqlQuery);
 
@@ -180,7 +186,7 @@ MSG_ERROR_T SmsPluginStorage::addSimMessage(MSG_MESSAGE_INFO_S *pSimMsgInfo)
                for (unsigned int i = 0; i < concatSimMsg.simIdCnt; i++) {
                        memset(sqlQuery, 0x00, sizeof(sqlQuery));
                        snprintf(sqlQuery, sizeof(sqlQuery), "INSERT INTO %s VALUES (%d, %d);",
-                                               MSGFW_SIM_MSG_TABLE_NAME, msgId, concatSimMsg.simIdList[i]);
+                                       MSGFW_SIM_MSG_TABLE_NAME, msgId, concatSimMsg.simIdList[i]);
 
                        MSG_DEBUG("QUERY : %s", sqlQuery);
 
@@ -192,7 +198,7 @@ MSG_ERROR_T SmsPluginStorage::addSimMessage(MSG_MESSAGE_INFO_S *pSimMsgInfo)
        } else {
                memset(sqlQuery, 0x00, sizeof(sqlQuery));
                snprintf(sqlQuery, sizeof(sqlQuery), "INSERT INTO %s VALUES (%d, %d);",
-                                       MSGFW_SIM_MSG_TABLE_NAME, msgId, simId);
+                               MSGFW_SIM_MSG_TABLE_NAME, msgId, simId);
 
                MSG_DEBUG("QUERY : %s", sqlQuery);
 
@@ -202,8 +208,8 @@ MSG_ERROR_T SmsPluginStorage::addSimMessage(MSG_MESSAGE_INFO_S *pSimMsgInfo)
                }
        }
 
-       /**  Update Address Info. */
-       if (MsgStoUpdateAddress(&dbHandle, addrId) != MSG_SUCCESS) {
+       /**  Update conversation table. */
+       if (MsgStoUpdateConversation(&dbHandle, convId) != MSG_SUCCESS) {
                dbHandle.endTrans(false);
                return MSG_ERR_STORAGE_ERROR;
        }
@@ -214,11 +220,11 @@ MSG_ERROR_T SmsPluginStorage::addSimMessage(MSG_MESSAGE_INFO_S *pSimMsgInfo)
 }
 
 
-MSG_ERROR_T SmsPluginStorage::addMessage(MSG_MESSAGE_INFO_S *pMsgInfo)
+msg_error_t SmsPluginStorage::addMessage(MSG_MESSAGE_INFO_S *pMsgInfo)
 {
        MSG_BEGIN();
 
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        /**  Check whether storage is full or not */
        err = checkStorageStatus(pMsgInfo);
@@ -290,12 +296,12 @@ MSG_ERROR_T SmsPluginStorage::addMessage(MSG_MESSAGE_INFO_S *pMsgInfo)
 }
 
 
-MSG_ERROR_T SmsPluginStorage::addSmsMessage(MSG_MESSAGE_INFO_S *pMsgInfo)
+msg_error_t SmsPluginStorage::addSmsMessage(MSG_MESSAGE_INFO_S *pMsgInfo)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        unsigned int rowId = 0;
-       unsigned int addrId = 0;
+       msg_thread_id_t convId = 0;
 
        char sqlQuery[MAX_QUERY_LEN+1];
 
@@ -303,26 +309,26 @@ MSG_ERROR_T SmsPluginStorage::addSmsMessage(MSG_MESSAGE_INFO_S *pMsgInfo)
 
        if (pMsgInfo->nAddressCnt > 0) {
 
-               err = MsgStoAddAddress(&dbHandle, &(pMsgInfo->addressList[0]), &addrId);
+               err = MsgStoAddAddress(&dbHandle, pMsgInfo, &convId);
 
                if (err != MSG_SUCCESS) {
                        dbHandle.endTrans(false);
                        return err;
                }
 
-               pMsgInfo->addressList[0].threadId = (MSG_THREAD_ID_T)addrId;
+               pMsgInfo->threadId = convId;
        }
 
        /**  Add Message Table */
-       rowId = MsgStoAddMessageTable(&dbHandle, pMsgInfo, addrId);
+       rowId = MsgStoAddMessageTable(&dbHandle, pMsgInfo);
 
        if (rowId <= 0) {
                dbHandle.endTrans(false);
                return MSG_ERR_DB_ROW;
        }
 
-       /** Update Address table */
-       err = MsgStoUpdateAddress(&dbHandle, addrId);
+       /** Update conversation table */
+       err = MsgStoUpdateConversation(&dbHandle, convId);
 
        if (err != MSG_SUCCESS) {
                dbHandle.endTrans(false);
@@ -331,8 +337,7 @@ MSG_ERROR_T SmsPluginStorage::addSmsMessage(MSG_MESSAGE_INFO_S *pMsgInfo)
 
        dbHandle.endTrans(true);
 
-       pMsgInfo->msgId = (MSG_MESSAGE_ID_T)rowId;
-       pMsgInfo->referenceId = (MSG_REFERENCE_ID_T)rowId;
+       pMsgInfo->msgId = (msg_message_id_t)rowId;
 
        MSG_END();
 
@@ -340,19 +345,19 @@ MSG_ERROR_T SmsPluginStorage::addSmsMessage(MSG_MESSAGE_INFO_S *pMsgInfo)
 }
 
 
-MSG_ERROR_T SmsPluginStorage::updateSmsMessage(MSG_MESSAGE_INFO_S *pMsg)
+msg_error_t SmsPluginStorage::updateSmsMessage(MSG_MESSAGE_INFO_S *pMsg)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        char sqlQuery[MAX_QUERY_LEN+1];
 
-       unsigned int addrId = 0;
+       msg_thread_id_t convId = 0;
 
        dbHandle.beginTrans();
 
        if (pMsg->nAddressCnt > 0) {
 
-               err = MsgStoAddAddress(&dbHandle, &(pMsg->addressList[0]), &addrId);
+               err = MsgStoAddAddress(&dbHandle, pMsg, &convId);
 
                if (err != MSG_SUCCESS) {
                        dbHandle.endTrans(false);
@@ -377,11 +382,10 @@ MSG_ERROR_T SmsPluginStorage::updateSmsMessage(MSG_MESSAGE_INFO_S *pMsg)
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
        snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET ADDRESS_ID = %d, FOLDER_ID = %d, STORAGE_ID = %d, MAIN_TYPE = %d, SUB_TYPE = %d, \
-                                                                       DISPLAY_TIME = %lu, DATA_SIZE = %d, NETWORK_STATUS = %d, READ_STATUS = %d, \
-                                                                       PROTECTED = %d, PRIORITY = %d, MSG_DIRECTION = %d, SCHEDULED_TIME = %lu, BACKUP = %d, SUBJECT = ?, MSG_DATA = ?, THUMB_PATH = ?, MSG_TEXT = ? \
-                                                                       WHERE MSG_ID = %d;",
-                               MSGFW_MESSAGE_TABLE_NAME, addrId, pMsg->folderId, pMsg->storageId, pMsg->msgType.mainType, pMsg->msgType.subType, pMsg->displayTime, pMsg->dataSize,
-                               pMsg->networkStatus, pMsg->bRead, pMsg->bProtected, pMsg->priority, pMsg->direction, pMsg->scheduledTime, pMsg->bBackup, pMsg->msgId);
+                       DISPLAY_TIME = %lu, DATA_SIZE = %d, NETWORK_STATUS = %d, READ_STATUS = %d, PROTECTED = %d, PRIORITY = %d, MSG_DIRECTION = %d, \
+                       BACKUP = %d, SUBJECT = ?, MSG_DATA = ?, THUMB_PATH = ?, MSG_TEXT = ? WHERE MSG_ID = %d;",
+                               MSGFW_MESSAGE_TABLE_NAME, convId, pMsg->folderId, pMsg->storageId, pMsg->msgType.mainType, pMsg->msgType.subType, pMsg->displayTime, pMsg->dataSize,
+                               pMsg->networkStatus, pMsg->bRead, pMsg->bProtected, pMsg->priority, pMsg->direction, pMsg->bBackup, pMsg->msgId);
 
        if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS) {
                dbHandle.endTrans(false);
@@ -408,14 +412,14 @@ MSG_ERROR_T SmsPluginStorage::updateSmsMessage(MSG_MESSAGE_INFO_S *pMsg)
 
        dbHandle.finalizeQuery();
 
-       err = MsgStoUpdateAddress(&dbHandle, addrId);
+       err = MsgStoUpdateConversation(&dbHandle, convId);
 
        if (err != MSG_SUCCESS) {
                dbHandle.endTrans(false);
                return MSG_ERR_STORAGE_ERROR;
        }
 
-       err = MsgStoClearAddressTable(&dbHandle);
+       err = MsgStoClearConversationTable(&dbHandle);
 
        if (err != MSG_SUCCESS) {
                dbHandle.endTrans(false);
@@ -428,35 +432,35 @@ MSG_ERROR_T SmsPluginStorage::updateSmsMessage(MSG_MESSAGE_INFO_S *pMsg)
 }
 
 
-MSG_ERROR_T SmsPluginStorage::deleteSmsMessage(MSG_MESSAGE_ID_T MsgId)
+msg_error_t SmsPluginStorage::deleteSmsMessage(msg_message_id_t msgId)
 {
        MSG_BEGIN();
 
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        char sqlQuery[MAX_QUERY_LEN+1];
 
         /**  Get SUB_TYPE, STORAGE_ID */
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
        snprintf(sqlQuery, sizeof(sqlQuery), "SELECT MAIN_TYPE, SUB_TYPE, FOLDER_ID, ADDRESS_ID \
-                                       FROM %s WHERE MSG_ID = %d;",
-                       MSGFW_MESSAGE_TABLE_NAME, MsgId);
+                       FROM %s WHERE MSG_ID = %d;",
+                       MSGFW_MESSAGE_TABLE_NAME, msgId);
 
        if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS)
                return MSG_ERR_DB_PREPARE;
 
        MSG_MESSAGE_TYPE_S msgType;
-       MSG_FOLDER_ID_T folderId;
+       msg_folder_id_t folderId;
 
-       unsigned int addrId;
+       msg_thread_id_t convId;
 
        if (dbHandle.stepQuery() == MSG_ERR_DB_ROW) {
                msgType.mainType = dbHandle.columnInt(0);
                msgType.subType = dbHandle.columnInt(1);
                folderId = dbHandle.columnInt(2);
-               addrId = dbHandle.columnInt(3);
+               convId = dbHandle.columnInt(3);
 
-               MSG_DEBUG("Main Type:[%d] SubType:[%d] FolderId:[%d] AddressId:[%d]", msgType.mainType, msgType.subType, folderId, addrId);
+               MSG_DEBUG("Main Type:[%d] SubType:[%d] FolderId:[%d] ConversationId:[%d]", msgType.mainType, msgType.subType, folderId, convId);
        } else {
                MSG_DEBUG("MsgStepQuery() Error [%s]", sqlQuery);
                dbHandle.finalizeQuery();
@@ -468,16 +472,7 @@ MSG_ERROR_T SmsPluginStorage::deleteSmsMessage(MSG_MESSAGE_ID_T MsgId)
        dbHandle.beginTrans();
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
-       snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;", MSGFW_SCHEDULED_MSG_TABLE_NAME, MsgId);
-
-       /** Delete Message from scheduled msg table */
-       if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS) {
-               dbHandle.endTrans(false);
-               return MSG_ERR_DB_EXEC;
-       }
-
-       memset(sqlQuery, 0x00, sizeof(sqlQuery));
-       snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;", MSGFW_SMS_SENDOPT_TABLE_NAME, MsgId);
+       snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;", MSGFW_SMS_SENDOPT_TABLE_NAME, msgId);
 
        /**  Delete SMS Send Option */
        if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS) {
@@ -487,7 +482,7 @@ MSG_ERROR_T SmsPluginStorage::deleteSmsMessage(MSG_MESSAGE_ID_T MsgId)
 
        if (msgType.subType == MSG_CB_SMS || msgType.subType == MSG_JAVACB_SMS) {
                memset(sqlQuery, 0x00, sizeof(sqlQuery));
-               snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;", MSGFW_CB_MSG_TABLE_NAME, MsgId);
+               snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;", MSGFW_CB_MSG_TABLE_NAME, msgId);
 
                /** Delete Push Message from push table */
                if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS) {
@@ -496,7 +491,7 @@ MSG_ERROR_T SmsPluginStorage::deleteSmsMessage(MSG_MESSAGE_ID_T MsgId)
                }
        } else if (msgType.subType >= MSG_WAP_SI_SMS && msgType.subType <= MSG_WAP_CO_SMS) {
                memset(sqlQuery, 0x00, sizeof(sqlQuery));
-               snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;", MSGFW_PUSH_MSG_TABLE_NAME, MsgId);
+               snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;", MSGFW_PUSH_MSG_TABLE_NAME, msgId);
 
                /**  Delete Push Message from push table */
                if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS) {
@@ -505,7 +500,7 @@ MSG_ERROR_T SmsPluginStorage::deleteSmsMessage(MSG_MESSAGE_ID_T MsgId)
                }
        } else if (msgType.subType == MSG_SYNCML_CP) {
                memset(sqlQuery, 0x00, sizeof(sqlQuery));
-               snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;", MSGFW_SYNCML_MSG_TABLE_NAME, MsgId);
+               snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;", MSGFW_SYNCML_MSG_TABLE_NAME, msgId);
 
                /**  Delete SyncML Message from syncML table */
                if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS) {
@@ -515,7 +510,7 @@ MSG_ERROR_T SmsPluginStorage::deleteSmsMessage(MSG_MESSAGE_ID_T MsgId)
        }
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
-       snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;", MSGFW_MESSAGE_TABLE_NAME, MsgId);
+       snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;", MSGFW_MESSAGE_TABLE_NAME, msgId);
 
        /** Delete Message from msg table */
        if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS) {
@@ -523,14 +518,14 @@ MSG_ERROR_T SmsPluginStorage::deleteSmsMessage(MSG_MESSAGE_ID_T MsgId)
                return MSG_ERR_DB_EXEC;
        }
 
-       /**  Clear Address table */
-       if (MsgStoClearAddressTable(&dbHandle) != MSG_SUCCESS) {
+       /**  Clear Conversation table */
+       if (MsgStoClearConversationTable(&dbHandle) != MSG_SUCCESS) {
                dbHandle.endTrans(false);
                return MSG_ERR_DB_EXEC;
        }
 
-       /**  Update Address Info.*/
-       if (MsgStoUpdateAddress(&dbHandle, addrId) != MSG_SUCCESS) {
+       /**  Update conversation table.*/
+       if (MsgStoUpdateConversation(&dbHandle, convId) != MSG_SUCCESS) {
                dbHandle.endTrans(false);
                return MSG_ERR_STORAGE_ERROR;
        }
@@ -553,35 +548,36 @@ MSG_ERROR_T SmsPluginStorage::deleteSmsMessage(MSG_MESSAGE_ID_T MsgId)
        mmsCnt = MsgStoGetUnreadCnt(&dbHandle, MSG_MMS_TYPE);
 
        MsgSettingHandleNewMsg(smsCnt, mmsCnt);
-       MsgDeleteNotiByMsgId(MsgId);
+       MsgDeleteNotiByMsgId(msgId);
 
        return MSG_SUCCESS;
 }
 
 
-MSG_ERROR_T SmsPluginStorage::addCbMessage(MSG_MESSAGE_INFO_S *pMsgInfo)
+msg_error_t SmsPluginStorage::addCbMessage(MSG_MESSAGE_INFO_S *pMsgInfo)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
-       unsigned int rowId = 0, addrId = 0;
+       unsigned int rowId = 0;
+       msg_thread_id_t convId = 0;
 
        char sqlQuery[MAX_QUERY_LEN+1];
 
        dbHandle.beginTrans();
 
        if (pMsgInfo->nAddressCnt > 0) {
-               err = MsgStoAddAddress(&dbHandle, &(pMsgInfo->addressList[0]), &addrId);
+               err = MsgStoAddAddress(&dbHandle, pMsgInfo, &convId);
 
                if (err != MSG_SUCCESS) {
                        dbHandle.endTrans(false);
                        return err;
                }
 
-               pMsgInfo->addressList[0].threadId = (MSG_THREAD_ID_T)addrId;
+               pMsgInfo->threadId = convId;
        }
 
        /**  Add Message Table */
-       rowId = MsgStoAddMessageTable(&dbHandle, pMsgInfo, addrId);
+       rowId = MsgStoAddMessageTable(&dbHandle, pMsgInfo);
 
        if (rowId <= 0) {
                dbHandle.endTrans(false);
@@ -595,15 +591,15 @@ MSG_ERROR_T SmsPluginStorage::addCbMessage(MSG_MESSAGE_INFO_S *pMsgInfo)
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
        sprintf(sqlQuery, "INSERT INTO %s VALUES (%d, %d);",
-                               MSGFW_CB_MSG_TABLE_NAME, rowId, cbMsgId);
+                       MSGFW_CB_MSG_TABLE_NAME, rowId, cbMsgId);
 
        if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS) {
                dbHandle.endTrans(false);
                return MSG_ERR_DB_EXEC;
        }
 
-       /**  Update Address Info. */
-       if (MsgStoUpdateAddress(&dbHandle, addrId) != MSG_SUCCESS) {
+       /**  Update conversation table. */
+       if (MsgStoUpdateConversation(&dbHandle, convId) != MSG_SUCCESS) {
                dbHandle.endTrans(false);
                return MSG_ERR_STORAGE_ERROR;
        }
@@ -611,30 +607,29 @@ MSG_ERROR_T SmsPluginStorage::addCbMessage(MSG_MESSAGE_INFO_S *pMsgInfo)
        dbHandle.endTrans(true);
 
        /** Assign Msg ID */
-       pMsgInfo->msgId = (MSG_MESSAGE_ID_T)rowId;
-       pMsgInfo->referenceId = (MSG_REFERENCE_ID_T)rowId;
+       pMsgInfo->msgId = (msg_message_id_t)rowId;
 
        return err;
 }
 
 
-MSG_ERROR_T SmsPluginStorage::addReplaceTypeMsg(MSG_MESSAGE_INFO_S *pMsgInfo)
+msg_error_t SmsPluginStorage::addReplaceTypeMsg(MSG_MESSAGE_INFO_S *pMsgInfo)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        char sqlQuery[MAX_QUERY_LEN+1];
 
-       unsigned int addrId = 0, retCnt = 0;
+       unsigned int retCnt = 0;
+       msg_thread_id_t convId = 0;
 
        /** Check if new address or not */
-       if (MsgExistAddress(&dbHandle, pMsgInfo->addressList[0].addressVal, &addrId) == true) {
-               MSG_DEBUG("Address Info. exists [%d] [%s]", addrId, pMsgInfo->addressList[0].addressVal);
+       if (MsgExistAddress(&dbHandle, pMsgInfo, &convId) == true) {
+               MSG_DEBUG("Address Info. exists [%d]", convId);
 
                /**  Find Replace Type Msg : Same Replace Type, Same Origin Address */
                memset(sqlQuery, 0x00, sizeof(sqlQuery));
-               snprintf(sqlQuery, sizeof(sqlQuery), "SELECT COUNT(*), A.MSG_ID FROM %s A, %s B \
-                                            WHERE A.ADDRESS_ID = B.ADDRESS_ID AND A.SUB_TYPE = %d AND B.ADDRESS_ID = %d;",
-                               MSGFW_MESSAGE_TABLE_NAME, MSGFW_ADDRESS_TABLE_NAME, pMsgInfo->msgType.subType, addrId);
+               snprintf(sqlQuery, sizeof(sqlQuery), "SELECT COUNT(*), MSG_ID FROM %s WHERE SUB_TYPE = %d AND B.CONV_ID = %d;",
+                               MSGFW_MESSAGE_TABLE_NAME, pMsgInfo->msgType.subType, convId);
 
                if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS)
                        return MSG_ERR_DB_PREPARE;
@@ -663,9 +658,9 @@ MSG_ERROR_T SmsPluginStorage::addReplaceTypeMsg(MSG_MESSAGE_INFO_S *pMsgInfo)
 }
 
 
-MSG_ERROR_T SmsPluginStorage::addWAPMessage(MSG_MESSAGE_INFO_S *pMsgInfo)
+msg_error_t SmsPluginStorage::addWAPMessage(MSG_MESSAGE_INFO_S *pMsgInfo)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        MSG_PUSH_MESSAGE_S pushMsg = {};
 
@@ -728,13 +723,13 @@ MSG_ERROR_T SmsPluginStorage::addWAPMessage(MSG_MESSAGE_INFO_S *pMsgInfo)
        pMsgInfo->folderId = MSG_INBOX_ID;
        pMsgInfo->storageId = MSG_STORAGE_PHONE;
 
-       unsigned int addrId = 0;
+       msg_thread_id_t convId = 0;
 
        dbHandle.beginTrans();
 
        if (pMsgInfo->nAddressCnt > 0) {
 
-               err = MsgStoAddAddress(&dbHandle, &(pMsgInfo->addressList[0]), &addrId);
+               err = MsgStoAddAddress(&dbHandle, pMsgInfo, &convId);
 
                if (err != MSG_SUCCESS) {
                        dbHandle.endTrans(false);
@@ -746,7 +741,7 @@ MSG_ERROR_T SmsPluginStorage::addWAPMessage(MSG_MESSAGE_INFO_S *pMsgInfo)
        unsigned int rowId = 0;
 
        /** Add Message Table */
-       rowId = MsgStoAddMessageTable(&dbHandle, pMsgInfo, addrId);
+       rowId = MsgStoAddMessageTable(&dbHandle, pMsgInfo);
 
        if (rowId <= 0) {
                dbHandle.endTrans(false);
@@ -755,7 +750,7 @@ MSG_ERROR_T SmsPluginStorage::addWAPMessage(MSG_MESSAGE_INFO_S *pMsgInfo)
 
        /**  add msg_push_table */
        snprintf (sqlQuery, sizeof(sqlQuery), "INSERT INTO %s VALUES (%d, %d, %lu, %lu, ?, ?, ?)",
-                                   MSGFW_PUSH_MSG_TABLE_NAME, pMsgInfo->msgId, pushMsg.action, pushMsg.created, pushMsg.expires);
+                       MSGFW_PUSH_MSG_TABLE_NAME, pMsgInfo->msgId, pushMsg.action, pushMsg.created, pushMsg.expires);
 
        if ((err = dbHandle.prepareQuery(sqlQuery)) != MSG_SUCCESS) {
                dbHandle.endTrans(false);
@@ -773,24 +768,23 @@ MSG_ERROR_T SmsPluginStorage::addWAPMessage(MSG_MESSAGE_INFO_S *pMsgInfo)
                return err;
        }
 
-       /** Update Address Info. */
-       if (MsgStoUpdateAddress(&dbHandle, addrId) != MSG_SUCCESS) {
+       /** Update conversation table. */
+       if (MsgStoUpdateConversation(&dbHandle, convId) != MSG_SUCCESS) {
                dbHandle.endTrans(false);
                return MSG_ERR_STORAGE_ERROR;
        }
 
        dbHandle.endTrans(true);
 
-       pMsgInfo->msgId = (MSG_MESSAGE_ID_T)rowId;
-       pMsgInfo->referenceId = (MSG_REFERENCE_ID_T)rowId;
+       pMsgInfo->msgId = (msg_message_id_t)rowId;
 
        return MSG_SUCCESS;
 }
 
 
-MSG_ERROR_T SmsPluginStorage::handleCOWAPMessage(MSG_MESSAGE_INFO_S *pMsgInfo)
+msg_error_t SmsPluginStorage::handleCOWAPMessage(MSG_MESSAGE_INFO_S *pMsgInfo)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        char href[MAX_PUSH_CACHEOP_MAX_URL_LEN+1];
        char sqlQuery[MAX_QUERY_LEN+1];
@@ -815,8 +809,7 @@ MSG_ERROR_T SmsPluginStorage::handleCOWAPMessage(MSG_MESSAGE_INFO_S *pMsgInfo)
                strncpy(href, &(pPushMsg->invalObjectUrl[i][0]), MAX_PUSH_CACHEOP_MAX_URL_LEN);
 
                memset(sqlQuery, 0x00, sizeof(sqlQuery));
-               snprintf (sqlQuery, sizeof(sqlQuery), "SELECT MSG_ID FROM %s WHERE HREF LIKE '%%%s%%';",
-                                       MSGFW_PUSH_MSG_TABLE_NAME, href);
+               snprintf (sqlQuery, sizeof(sqlQuery), "SELECT MSG_ID FROM %s WHERE HREF LIKE '%%%s%%';", MSGFW_PUSH_MSG_TABLE_NAME, href);
 
                dbHandle.beginTrans();
 
@@ -827,8 +820,7 @@ MSG_ERROR_T SmsPluginStorage::handleCOWAPMessage(MSG_MESSAGE_INFO_S *pMsgInfo)
                        msgid = dbHandle.getColumnToInt(1);
 
                        memset(sqlQuery, 0x00, sizeof(sqlQuery));
-                       snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID= %d;",
-                                               MSGFW_PUSH_MSG_TABLE_NAME, msgid);
+                       snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID= %d;", MSGFW_PUSH_MSG_TABLE_NAME, msgid);
 
                        /** Delete Message from Push table */
                        if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS) {
@@ -838,8 +830,7 @@ MSG_ERROR_T SmsPluginStorage::handleCOWAPMessage(MSG_MESSAGE_INFO_S *pMsgInfo)
                        }
 
                        memset(sqlQuery, 0x00, sizeof(sqlQuery));
-                       snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;",
-                                               MSGFW_MESSAGE_TABLE_NAME, msgid);
+                       snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;", MSGFW_MESSAGE_TABLE_NAME, msgid);
 
                        /** Delete Message from msg table */
                        if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS) {
@@ -855,8 +846,8 @@ MSG_ERROR_T SmsPluginStorage::handleCOWAPMessage(MSG_MESSAGE_INFO_S *pMsgInfo)
                                continue;
                        }
 
-                       /** Clear Address table */
-                       if (MsgStoClearAddressTable(&dbHandle) != MSG_SUCCESS) {
+                       /** Clear Conversation table */
+                       if (MsgStoClearConversationTable(&dbHandle) != MSG_SUCCESS) {
                                dbHandle.finalizeQuery();
                                dbHandle.endTrans(false);
                                continue;
@@ -876,8 +867,7 @@ MSG_ERROR_T SmsPluginStorage::handleCOWAPMessage(MSG_MESSAGE_INFO_S *pMsgInfo)
                strncpy(href, &(pPushMsg->invalObjectUrl[i][0]), MAX_PUSH_CACHEOP_MAX_URL_LEN);
 
                memset(sqlQuery, 0x00, sizeof(sqlQuery));
-               snprintf(sqlQuery, sizeof(sqlQuery), "SELECT MSG_ID FROM %s WHERE HREF LIKE '%%%s%%'",
-                                       MSGFW_PUSH_MSG_TABLE_NAME, href);
+               snprintf(sqlQuery, sizeof(sqlQuery), "SELECT MSG_ID FROM %s WHERE HREF LIKE '%%%s%%'", MSGFW_PUSH_MSG_TABLE_NAME, href);
 
                dbHandle.beginTrans();
 
@@ -888,8 +878,7 @@ MSG_ERROR_T SmsPluginStorage::handleCOWAPMessage(MSG_MESSAGE_INFO_S *pMsgInfo)
                        msgid = dbHandle.getColumnToInt(1);
 
                        memset(sqlQuery, 0x00, sizeof(sqlQuery));
-                       sprintf(sqlQuery, "DELETE FROM %s WHERE MSG_ID='%d'",
-                                               MSGFW_PUSH_MSG_TABLE_NAME, msgid);
+                       sprintf(sqlQuery, "DELETE FROM %s WHERE MSG_ID='%d'", MSGFW_PUSH_MSG_TABLE_NAME, msgid);
 
                        /** Delete Message from Push table */
                        if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS) {
@@ -899,8 +888,7 @@ MSG_ERROR_T SmsPluginStorage::handleCOWAPMessage(MSG_MESSAGE_INFO_S *pMsgInfo)
                        }
 
                        memset(sqlQuery, 0x00, sizeof(sqlQuery));
-                       snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;",
-                                               MSGFW_MESSAGE_TABLE_NAME, msgid);
+                       snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;", MSGFW_MESSAGE_TABLE_NAME, msgid);
 
                        /** Delete Message from msg table */
                        if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS) {
@@ -917,7 +905,7 @@ MSG_ERROR_T SmsPluginStorage::handleCOWAPMessage(MSG_MESSAGE_INFO_S *pMsgInfo)
                        }
 
                        /** Clear Address table */
-                       if (MsgStoClearAddressTable(&dbHandle) != MSG_SUCCESS) {
+                       if (MsgStoClearConversationTable(&dbHandle) != MSG_SUCCESS) {
                                dbHandle.finalizeQuery();
                                dbHandle.endTrans(false);
                                continue;
@@ -936,9 +924,9 @@ MSG_ERROR_T SmsPluginStorage::handleCOWAPMessage(MSG_MESSAGE_INFO_S *pMsgInfo)
 }
 
 
-MSG_ERROR_T SmsPluginStorage::checkPushMsgValidation(MSG_PUSH_MESSAGE_S *pPushMsg, bool *pbProceed)
+msg_error_t SmsPluginStorage::checkPushMsgValidation(MSG_PUSH_MESSAGE_S *pPushMsg, bool *pbProceed)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        unsigned long oldExpireTime = 0;
        int rowCnt = 0;
@@ -956,10 +944,10 @@ MSG_ERROR_T SmsPluginStorage::checkPushMsgValidation(MSG_PUSH_MESSAGE_S *pPushMs
        if (pPushMsg->action == MSG_PUSH_SL_ACTION_EXECUTE_LOW) {
                memset(sqlQuery, 0x00, sizeof(sqlQuery));
                snprintf(sqlQuery, sizeof(sqlQuery), "SELECT EXPIRES FROM %s WHERE ID = '%s' AND ACTION = %d",
-                                       MSGFW_PUSH_MSG_TABLE_NAME, pPushMsg->id, pPushMsg->action);
+                               MSGFW_PUSH_MSG_TABLE_NAME, pPushMsg->id, pPushMsg->action);
        } else {
                snprintf(sqlQuery, sizeof(sqlQuery), "SELECT EXPIRES FROM %s WHERE ID = '%s'",
-                                       MSGFW_PUSH_MSG_TABLE_NAME, pPushMsg->id);
+                               MSGFW_PUSH_MSG_TABLE_NAME, pPushMsg->id);
        }
 
        err = dbHandle.getTable(sqlQuery, &rowCnt);
@@ -983,9 +971,9 @@ MSG_ERROR_T SmsPluginStorage::checkPushMsgValidation(MSG_PUSH_MESSAGE_S *pPushMs
 }
 
 
-MSG_ERROR_T SmsPluginStorage::checkStorageStatus(MSG_MESSAGE_INFO_S *pMsgInfo)
+msg_error_t SmsPluginStorage::checkStorageStatus(MSG_MESSAGE_INFO_S *pMsgInfo)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        err = MsgStoCheckMsgCntFull(&dbHandle, &(pMsgInfo->msgType), pMsgInfo->folderId);
 
@@ -999,7 +987,7 @@ MSG_ERROR_T SmsPluginStorage::checkStorageStatus(MSG_MESSAGE_INFO_S *pMsgInfo)
                        MSG_DEBUG("bAutoErase: %d", bAutoErase);
 
                        if (bAutoErase == true) {
-                               MSG_MESSAGE_ID_T msgId;
+                               msg_message_id_t msgId;
 
                                /** Find the oldest message's msgId */
                                err = MsgStoGetOldestMessage(&dbHandle, pMsgInfo, &msgId);
@@ -1019,17 +1007,16 @@ MSG_ERROR_T SmsPluginStorage::checkStorageStatus(MSG_MESSAGE_INFO_S *pMsgInfo)
 }
 
 
-MSG_ERROR_T SmsPluginStorage::updateAllAddress()
+msg_error_t SmsPluginStorage::updateAllAddress()
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        int rowCnt = 0, index = 1;
        char sqlQuery[MAX_QUERY_LEN+1];
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
-       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT ADDRESS_ID FROM %s",
-                               MSGFW_ADDRESS_TABLE_NAME);
+       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT ADDRESS_ID FROM %s", MSGFW_ADDRESS_TABLE_NAME);
 
        err = dbHandle.getTable(sqlQuery, &rowCnt);
 
@@ -1044,7 +1031,7 @@ MSG_ERROR_T SmsPluginStorage::updateAllAddress()
 
        for (int i = 0; i < rowCnt; i++) {
 
-               err = MsgStoUpdateAddress(&dbHandle, index++);
+               err = MsgStoUpdateConversation(&dbHandle, index++);
 
                if (err != MSG_SUCCESS)
                        break;
index 8129fbf..8db889d 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include <glib.h>
 
@@ -80,6 +80,12 @@ int SmsPluginTextConvert::convertUTF8ToUCS2(OUT unsigned char *pDestText, IN int
        int ucs2Length = 0;
        int remainedBuffer = maxLength;
 
+#ifdef CONVERT_DUMP
+       int srcLen = srcTextLen;
+       const unsigned char * pTempSrcText = pSrcText;
+       const unsigned char * pTempDestText = pDestText;
+#endif
+
        i = j = 0;
 
        if(maxLength == 0 || pSrcText == NULL || pDestText ==  NULL)
@@ -119,13 +125,19 @@ int SmsPluginTextConvert::convertUTF8ToUCS2(OUT unsigned char *pDestText, IN int
                ucs2Length = maxLength - remainedBuffer;
        }
 
+#ifdef CONVERT_DUMP
+       MSG_DEBUG("\n########## Dump UTF8 -> UCS2\n");
+       convertDumpTextToHex((unsigned char*)pTempSrcText, srcLen);
+       convertDumpTextToHex((unsigned char*)pTempDestText, ucs2Length);
+#endif
+
        g_iconv_close(cd);
 
        return ucs2Length;
 }
 
 
-int SmsPluginTextConvert::convertUTF8ToAuto(OUT unsigned char *pDestText, IN int maxLength,  IN const unsigned char *pSrcText, IN int srcTextLen, OUT MSG_ENCODE_TYPE_T *pCharType)
+int SmsPluginTextConvert::convertUTF8ToAuto(OUT unsigned char *pDestText, IN int maxLength,  IN const unsigned char *pSrcText, IN int srcTextLen, OUT msg_encode_type_t *pCharType)
 {
        int utf8Length = 0;
        int gsm7bitLength = 0;
@@ -213,6 +225,10 @@ int SmsPluginTextConvert::convertUCS2ToUTF8(OUT unsigned char *pDestText, IN int
        int remainedBuffer = maxLength;
        int utf8Length;
 
+#ifdef CONVERT_DUMP
+       int srcLen = srcTextLen;
+       const unsigned char * pTempSrcText = pSrcText;
+#endif
        unsigned char * pTempDestText = pDestText;
 
        if (srcTextLen == 0 || pSrcText == NULL || pDestText ==  NULL || maxLength == 0)
@@ -234,6 +250,12 @@ int SmsPluginTextConvert::convertUCS2ToUTF8(OUT unsigned char *pDestText, IN int
        utf8Length = maxLength - remainedBuffer;
        pTempDestText[utf8Length] = 0x00;
 
+#ifdef CONVERT_DUMP
+       MSG_DEBUG("\n########## Dump UCS2 -> UTF8\n");
+       convertDumpTextToHex((unsigned char*)pTempSrcText, srcLen);
+       convertDumpTextToHex((unsigned char*)pTempDestText, utf8Length);
+#endif
+
        g_iconv_close(cd);
 
        return utf8Length;
@@ -245,6 +267,10 @@ int SmsPluginTextConvert::convertEUCKRToUTF8(OUT unsigned char *pDestText, IN in
        int remainedBuffer = maxLength;
        int utf8Length;
 
+#ifdef CONVERT_DUMP
+       int srcLen = srcTextLen;
+       const unsigned char * pTempSrcText = pSrcText;
+#endif
        unsigned char * pTempDestText = pDestText;
 
        if(srcTextLen == 0 || pSrcText == NULL || pDestText ==  NULL || maxLength == 0)
@@ -266,6 +292,12 @@ int SmsPluginTextConvert::convertEUCKRToUTF8(OUT unsigned char *pDestText, IN in
        utf8Length = maxLength - remainedBuffer;
        pTempDestText[utf8Length] = 0x00;
 
+#ifdef CONVERT_DUMP
+       MSG_DEBUG("\n########## Dump EUCKR -> UTF8\n");
+       convertDumpTextToHex((unsigned char*)pTempSrcText, srcLen);
+       convertDumpTextToHex((unsigned char*)pTempDestText, utf8Length);
+#endif
+
        g_iconv_close(cd);
 
        return utf8Length;
@@ -313,6 +345,8 @@ int SmsPluginTextConvert::convertUCS2ToGSM7bit(OUT unsigned char *pDestText, IN
 
                inText = inText | lowerByte;
 
+//MSG_DEBUG("inText : [%04x]", inText);
+
                itExt = extCharList.find(inText);
 
                if (itExt != extCharList.end())
@@ -455,6 +489,12 @@ MSG_DEBUG("no char");
                }
        }
 
+#ifdef CONVERT_DUMP
+       MSG_DEBUG("\n########## Dump UCS2 -> GSM7bit\n");
+       convertDumpTextToHex((unsigned char*)pSrcText, srcTextLen);
+       convertDumpTextToHex((unsigned char*)pDestText, outTextLen);
+#endif
+
        return outTextLen;
 }
 
@@ -484,11 +524,14 @@ int SmsPluginTextConvert::convertUCS2ToGSM7bitAuto(OUT unsigned char *pDestText,
                inText = (upperByte << 8) & 0xFF00;
                inText = inText | lowerByte;
 
+//MSG_DEBUG("inText : [%04x]", inText);
+
                // Check Default Char
                itChar = ucs2toGSM7DefList.find(inText);
 
                if (itChar != ucs2toGSM7DefList.end())
                {
+//MSG_DEBUG("default char");
                        pDestText[outTextLen++] = (unsigned char)itChar->second;
                }
                else
@@ -522,6 +565,12 @@ int SmsPluginTextConvert::convertUCS2ToGSM7bitAuto(OUT unsigned char *pDestText,
                }
        }
 
+#ifdef CONVERT_DUMP
+       MSG_DEBUG("\n########## Dump UCS2 -> GSM7bit\n");
+       convertDumpTextToHex((unsigned char*)pSrcText, srcTextLen);
+       convertDumpTextToHex((unsigned char*)pDestText, outTextLen);
+#endif
+
        return outTextLen;
 }
 
@@ -704,6 +753,12 @@ int SmsPluginTextConvert::convertGSM7bitToUCS2(OUT unsigned char *pDestText, IN
                maxLength -= 2;
        }
 
+#ifdef CONVERT_DUMP
+       MSG_DEBUG("\n########## Dump GSM7bit -> UCS2\n");
+       convertDumpTextToHex((unsigned char*)pSrcText, srcTextLen);
+       convertDumpTextToHex((unsigned char*)pDestText, outTextLen);
+#endif
+
        return outTextLen;
 }
 
@@ -745,7 +800,7 @@ SmsPluginTextConvert::SmsPluginTextConvert()
        extCharList[0x007C] = SMS_CHAR_GSM7EXT;
        extCharList[0x007D] = SMS_CHAR_GSM7EXT;
        extCharList[0x007E] = SMS_CHAR_GSM7EXT;
-       extCharList[0x20AC] = SMS_CHAR_GSM7EXT; // ��
+       extCharList[0x20AC] = SMS_CHAR_GSM7EXT; // ¢æ
 
        extCharList[0x00E7] = SMS_CHAR_TURKISH;
        extCharList[0x011E] = SMS_CHAR_TURKISH;
@@ -794,7 +849,7 @@ SmsPluginTextConvert::SmsPluginTextConvert()
        ucs2toGSM7ExtList[0x005E] = 0x14; // ^
        ucs2toGSM7ExtList[0x007C] = 0x40; // |
        ucs2toGSM7ExtList[0x007E] = 0x3D; // ~
-       ucs2toGSM7ExtList[0x20AC] = 0x65; // ��
+       ucs2toGSM7ExtList[0x20AC] = 0x65; // ¢æ
 
        // Turkish
        ucs2toTurkishList[0x005B] = 0x3C; // [
@@ -806,7 +861,7 @@ SmsPluginTextConvert::SmsPluginTextConvert()
        ucs2toTurkishList[0x005E] = 0x14; // ^
        ucs2toTurkishList[0x007C] = 0x40; // |
        ucs2toTurkishList[0x007E] = 0x3D; // ~
-       ucs2toTurkishList[0x20AC] = 0x65; // ��
+       ucs2toTurkishList[0x20AC] = 0x65; // ¢æ
        ucs2toTurkishList[0x00E7] = 0x63; // c LATIN SMALL LETTER S WITH CEDILLA *
        ucs2toTurkishList[0x011E] = 0x47; // G LATIN CAPITAL LETTER G WITH BREVE
        ucs2toTurkishList[0x011F] = 0x67; // g LATIN SMALL LETTER G WITH BREVE
@@ -827,7 +882,7 @@ SmsPluginTextConvert::SmsPluginTextConvert()
        ucs2toSpanishList[0x005E] = 0x14; // ^
        ucs2toSpanishList[0x007C] = 0x40; // |
        ucs2toSpanishList[0x007E] = 0x3D; // ~
-       ucs2toSpanishList[0x20AC] = 0x65; // ��
+       ucs2toSpanishList[0x20AC] = 0x65; // ¢æ
        ucs2toSpanishList[0x00C1] = 0x41; // A
        ucs2toSpanishList[0x00E1] = 0x61; // a
        ucs2toSpanishList[0x00CD] = 0x49; // I
@@ -847,7 +902,7 @@ SmsPluginTextConvert::SmsPluginTextConvert()
        ucs2toPortuList[0x005E] = 0x14; // ^
        ucs2toPortuList[0x007C] = 0x40; // |
        ucs2toPortuList[0x007E] = 0x3D; // ~
-       ucs2toPortuList[0x20AC] = 0x65; // ��
+       ucs2toPortuList[0x20AC] = 0x65; // ¢æ
        ucs2toPortuList[0x00D4] = 0x0B; // O
        ucs2toPortuList[0x00F4] = 0x0C; // o
        ucs2toPortuList[0x00C1] = 0x0E; // A
@@ -868,13 +923,13 @@ SmsPluginTextConvert::SmsPluginTextConvert()
        ucs2toPortuList[0x00F5] = 0x7C; // o
        ucs2toPortuList[0x00C2] = 0x61; // A
        ucs2toPortuList[0x00E2] = 0x7F; // a
-       ucs2toPortuList[0x03A6] = 0x12; // ��
-       ucs2toPortuList[0x0393] = 0x13; // ��
-       ucs2toPortuList[0x03A9] = 0x15; // ��
-       ucs2toPortuList[0x03A0] = 0x16; // ��
-       ucs2toPortuList[0x03A8] = 0x17; // ��
-       ucs2toPortuList[0x03A3] = 0x18; // ��
-       ucs2toPortuList[0x0398] = 0x19; // ��
+       ucs2toPortuList[0x03A6] = 0x12; // ¥Õ
+       ucs2toPortuList[0x0393] = 0x13; // ¥Ã
+       ucs2toPortuList[0x03A9] = 0x15; // ¥Ø
+       ucs2toPortuList[0x03A0] = 0x16; // ¥Ð
+       ucs2toPortuList[0x03A8] = 0x17; // ¥×
+       ucs2toPortuList[0x03A3] = 0x18; // ¥Ò
+       ucs2toPortuList[0x0398] = 0x19; // ¥È
 }
 
 
index ad9899c..6849f7f 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include <stdio.h>
 #include <string.h>
index 1532e60..08acd20 100755 (executable)
@@ -1,20 +1,21 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include <errno.h>
+#include <math.h>
 
 #include "MsgDebug.h"
 #include "MsgCppTypes.h"
@@ -26,6 +27,7 @@
 #include "SmsPluginTpduCodec.h"
 #include "SmsPluginEventHandler.h"
 #include "SmsPluginStorage.h"
+#include "SmsPluginCallback.h"
 #include "SmsPluginTransport.h"
 
 extern "C"
@@ -35,6 +37,8 @@ extern "C"
 
 #define MSG_DEBUG_BY_FILE
 
+extern struct tapi_handle *pTapiHandle;
+
 /*==================================================================================================
                                      IMPLEMENTATION OF SmsPluginTransport - Member Functions
 ==================================================================================================*/
@@ -93,130 +97,140 @@ void SmsPluginTransport::submitRequest(SMS_REQUEST_INFO_S *pReqInfo)
        // Set SMSC Options
        SMS_ADDRESS_S smsc;
        setSmscOptions(&smsc);
+       int i = 0;
+       int j = 0;
 
-       // Make SMS_SUBMIT_DATA_S from MSG_REQUEST_INFO_S
-       SMS_SUBMIT_DATA_S submitData = {{0},};
-       msgInfoToSubmitData(&(pReqInfo->msgInfo), &submitData, &(tpdu.data.submit.dcs.codingScheme));
+       MSG_DEBUG("pReqInfo->msgInfo.nAddressCnt [%d]", pReqInfo->msgInfo.nAddressCnt);
 
-       // Encode SMSC Address
-       unsigned char smscAddr[MAX_SMSC_LEN];
-       memset(smscAddr, 0x00, sizeof(smscAddr));
+       for (i = 0; i < pReqInfo->msgInfo.nAddressCnt; i++)
+       {
+               // Make SMS_SUBMIT_DATA_S from MSG_REQUEST_INFO_S
+               SMS_SUBMIT_DATA_S submitData = {{0},};
+               msgInfoToSubmitData(&(pReqInfo->msgInfo), &submitData, &(tpdu.data.submit.dcs.codingScheme), i);
 
-       int smscLen = SmsPluginParamCodec::encodeSMSC(&smsc, smscAddr);
+               // Encode SMSC Address
+               unsigned char smscAddr[MAX_SMSC_LEN];
+               memset(smscAddr, 0x00, sizeof(smscAddr));
 
-       if (smscLen <= 0) return;
+               int smscLen = SmsPluginParamCodec::encodeSMSC(&smsc, smscAddr);
 
-       for (int i = 0; i < smscLen; i++)
-       {
-               MSG_DEBUG("pSCAInfo [%02x]", smscAddr[i]);
-       }
+               if (smscLen <= 0) return;
 
-       int bufLen = 0, reqId = 0;
+               for (j = 0; j < smscLen; j++)
+               {
+                       MSG_DEBUG("pSCAInfo [%02x]", smscAddr[j]);
+               }
 
-       char buf[MAX_TPDU_DATA_LEN];
+               int bufLen = 0, reqId = 0;
 
-       int addLen = strlen(submitData.destAddress.address);
+               char buf[MAX_TPDU_DATA_LEN];
 
-       tpdu.data.submit.destAddress.ton = submitData.destAddress.ton;
-       tpdu.data.submit.destAddress.npi = submitData.destAddress.npi;
+               int addLen = strlen(submitData.destAddress.address);
 
-       memcpy(tpdu.data.submit.destAddress.address, submitData.destAddress.address, addLen);
-       tpdu.data.submit.destAddress.address[addLen] = '\0';
+               tpdu.data.submit.destAddress.ton = submitData.destAddress.ton;
+               tpdu.data.submit.destAddress.npi = submitData.destAddress.npi;
 
-       for (unsigned int segCnt = 0; segCnt < submitData.segCount; segCnt++)
-       {
-               if (submitData.userData[segCnt].headerCnt > 0)
-               {
-                       tpdu.data.submit.bHeaderInd = true;
+               if (addLen < MAX_ADDRESS_LEN) {
+                       memcpy(tpdu.data.submit.destAddress.address, submitData.destAddress.address, addLen);
+                       tpdu.data.submit.destAddress.address[addLen] = '\0';
+               } else {
+                       memcpy(tpdu.data.submit.destAddress.address, submitData.destAddress.address, MAX_ADDRESS_LEN);
+                       tpdu.data.submit.destAddress.address[MAX_ADDRESS_LEN] = '\0';
                }
-               else
+
+               for (unsigned int segCnt = 0; segCnt < submitData.segCount; segCnt++)
                {
-                       tpdu.data.submit.bHeaderInd = false;
-               }
+                       if (submitData.userData[segCnt].headerCnt > 0)
+                       {
+                               tpdu.data.submit.bHeaderInd = true;
+                       }
+                       else
+                       {
+                               tpdu.data.submit.bHeaderInd = false;
+                       }
 
-               memset(&(tpdu.data.submit.userData), 0x00, sizeof(SMS_USERDATA_S));
-               memcpy(&(tpdu.data.submit.userData), &(submitData.userData[segCnt]), sizeof(SMS_USERDATA_S));
+                       memset(&(tpdu.data.submit.userData), 0x00, sizeof(SMS_USERDATA_S));
+                       memcpy(&(tpdu.data.submit.userData), &(submitData.userData[segCnt]), sizeof(SMS_USERDATA_S));
 
-               // Encode SMS-SUBMIT TPDU
-               memset(buf, 0x00, sizeof(buf));
+                       // Encode SMS-SUBMIT TPDU
+                       memset(buf, 0x00, sizeof(buf));
 
-               bufLen = SmsPluginTpduCodec::encodeTpdu(&tpdu, buf);
+                       bufLen = SmsPluginTpduCodec::encodeTpdu(&tpdu, buf);
 
-               // Make Telephony Structure
-               TelSmsDatapackageInfo_t pkgInfo;
+                       // Make Telephony Structure
+                       TelSmsDatapackageInfo_t pkgInfo;
 
-               // Set TPDU data
-               memset((void*)pkgInfo.szData, 0x00, sizeof(pkgInfo.szData));
-               memcpy((void*)pkgInfo.szData, buf, bufLen);
+                       // Set TPDU data
+                       memset((void*)pkgInfo.szData, 0x00, sizeof(pkgInfo.szData));
+                       memcpy((void*)pkgInfo.szData, buf, bufLen);
 
-               pkgInfo.szData[bufLen] = 0;
-               pkgInfo.MsgLength = bufLen;
+                       pkgInfo.szData[bufLen] = 0;
+                       pkgInfo.MsgLength = bufLen;
 
-               // Set SMSC data
-               memset(pkgInfo.Sca, 0x00, sizeof(pkgInfo.Sca));
-               memcpy((void*)pkgInfo.Sca, smscAddr, smscLen);
-               pkgInfo.Sca[smscLen] = '\0';
+                       // Set SMSC data
+                       memset(pkgInfo.Sca, 0x00, sizeof(pkgInfo.Sca));
+                       memcpy((void*)pkgInfo.Sca, smscAddr, smscLen);
+                       pkgInfo.Sca[smscLen] = '\0';
 
-               MSG_DEBUG("bReqCb [%d]", pReqInfo->bReqCb);
+                       SMS_SENT_INFO_S sentInfo = {};
 
-               SMS_SENT_INFO_S sentInfo = {};
+                       bool bMoreMsg = FALSE;
 
-               TS_BOOL bMoreMsg = FALSE;
+                       memcpy(&(sentInfo.reqInfo), pReqInfo, sizeof(SMS_REQUEST_INFO_S));
 
-               memcpy(&(sentInfo.reqInfo), pReqInfo, sizeof(SMS_REQUEST_INFO_S));
+                       if ((segCnt+1) == submitData.segCount && (i+1)==pReqInfo->msgInfo.nAddressCnt)
+                       {
+                               sentInfo.bLast = true;
 
-               if ((segCnt+1) == submitData.segCount)
-               {
-                       sentInfo.bLast = true;
+                               bMoreMsg = FALSE;
+                       }
+                       else
+                       {
+                               sentInfo.bLast = false;
 
-                       bMoreMsg = FALSE;
-               }
-               else
-               {
-                       sentInfo.bLast = false;
+                               bMoreMsg = TRUE;
+                       }
 
-                       bMoreMsg = TRUE;
-               }
+                       SmsPluginEventHandler::instance()->SetSentInfo(&sentInfo);
 
-               SmsPluginEventHandler::instance()->SetSentInfo(&sentInfo);
+                       curStatus = MSG_NETWORK_SENDING;
 
-               curStatus = MSG_NETWORK_SENDING;
+                       // Send SMS
+                       int tapiRet = TAPI_API_SUCCESS;
 
-               // Send SMS
-               int tapiRet = TAPI_API_SUCCESS;
+                       tapiRet = tel_send_sms(pTapiHandle, &pkgInfo, bMoreMsg, TapiEventSentStatus, NULL);
 
-               tapiRet = tel_send_sms(&pkgInfo, bMoreMsg, &reqId);
+                       if (tapiRet == TAPI_API_SUCCESS)
+                       {
+                               MSG_DEBUG("########  TelTapiSmsSend Success !!! req Id : [%d] return : [%d] #######", reqId, tapiRet);
+                       }
+                       else
+                       {
+                               SmsPluginEventHandler::instance()->handleSentStatus(MSG_NETWORK_SEND_FAIL);
 
-               if (tapiRet == TAPI_API_SUCCESS)
-               {
-                       MSG_DEBUG("########  TelTapiSmsSend Success !!! req Id : [%d] return : [%d] #######", reqId, tapiRet);
-               }
-               else
-               {
-                       SmsPluginEventHandler::instance()->handleSentStatus(reqId, MSG_NETWORK_SEND_FAIL);
+                               THROW(MsgException::SMS_PLG_ERROR, "########  TelTapiSmsSend Fail !!! req Id : [%d] return : [%d] #######", reqId, tapiRet);
+                       }
 
-                       THROW(MsgException::SMS_PLG_ERROR, "########  TelTapiSmsSend Fail !!! req Id : [%d] return : [%d] #######", reqId, tapiRet);
-               }
+                       msg_network_status_t retStatus = getNetStatus();
 
-               MSG_NETWORK_STATUS_T retStatus = getNetStatus();
+                       if (retStatus == MSG_NETWORK_SEND_SUCCESS)
+                       {
+                               MSG_DEBUG("########  Msg Sent was Successful !!! req Id : [%d] return : [%d] #######", reqId, retStatus);
+                       }
+                       else
+                       {
+                               THROW(MsgException::SMS_PLG_ERROR, "########  Msg Sent was Failed !!! req Id : [%d] return : [%d] #######", reqId, retStatus);
+                       }
 
-               if (retStatus == MSG_NETWORK_SEND_SUCCESS)
-               {
-                       MSG_DEBUG("########  Msg Sent was Successful !!! req Id : [%d] return : [%d] #######", reqId, retStatus);
-               }
-               else
-               {
-                       THROW(MsgException::SMS_PLG_ERROR, "########  Msg Sent was Failed !!! req Id : [%d] return : [%d] #######", reqId, retStatus);
+                       if (tpdu.data.submit.userData.headerCnt > 0) tpdu.data.submit.userData.headerCnt--;
                }
-
-               if (tpdu.data.submit.userData.headerCnt > 0) tpdu.data.submit.userData.headerCnt--;
        }
 
        MSG_END();
 }
 
 
-void SmsPluginTransport::sendDeliverReport(MSG_ERROR_T err)
+void SmsPluginTransport::sendDeliverReport(msg_error_t err)
 {
        MSG_BEGIN();
 
@@ -233,7 +247,7 @@ void SmsPluginTransport::sendDeliverReport(MSG_ERROR_T err)
                tpdu.data.deliverRep.reportType = SMS_REPORT_POSITIVE;
                response = TAPI_NETTEXT_SENDSMS_SUCCESS;
 
-               tapiRet = tel_set_sms_memory_status(TAPI_NETTEXT_PDA_MEMORY_STATUS_AVAILABLE, &reqId);
+               tapiRet = tel_set_sms_memory_status(pTapiHandle, TAPI_NETTEXT_PDA_MEMORY_STATUS_AVAILABLE, NULL, NULL);
 
                if (tapiRet == TAPI_API_SUCCESS)
                {
@@ -250,7 +264,7 @@ void SmsPluginTransport::sendDeliverReport(MSG_ERROR_T err)
                tpdu.data.deliverRep.failCause = SMS_FC_MSG_CAPA_EXCEEDED;
                response = TAPI_NETTEXT_SIM_FULL;
 
-               tapiRet = tel_set_sms_memory_status(TAPI_NETTEXT_PDA_MEMORY_STATUS_FULL, &reqId);
+               tapiRet = tel_set_sms_memory_status(pTapiHandle, TAPI_NETTEXT_PDA_MEMORY_STATUS_FULL, NULL, NULL);
 
                if (tapiRet == TAPI_API_SUCCESS)
                {
@@ -267,7 +281,7 @@ void SmsPluginTransport::sendDeliverReport(MSG_ERROR_T err)
                tpdu.data.deliverRep.failCause = SMS_FC_MSG_CAPA_EXCEEDED;
                response = TAPI_NETTEXT_ME_FULL;
 
-               tapiRet = tel_set_sms_memory_status(TAPI_NETTEXT_PDA_MEMORY_STATUS_FULL, &reqId);
+               tapiRet = tel_set_sms_memory_status(pTapiHandle, TAPI_NETTEXT_PDA_MEMORY_STATUS_FULL, NULL, NULL);
 
                if (tapiRet == TAPI_API_SUCCESS)
                {
@@ -282,6 +296,8 @@ void SmsPluginTransport::sendDeliverReport(MSG_ERROR_T err)
        {
                tpdu.data.deliverRep.reportType = SMS_REPORT_NEGATIVE;
                tpdu.data.deliverRep.failCause = SMS_FC_UNSPEC_ERROR;
+               //response = TAPI_NETTEXT_PROTOCOL_ERROR;
+               // For gcf test [34.2.5.3 class2 message]
                response = TAPI_NETTEXT_SIM_FULL;
 
        }
@@ -329,7 +345,7 @@ void SmsPluginTransport::sendDeliverReport(MSG_ERROR_T err)
        pkgInfo.Sca[smscLen] = '\0';
 
        // Send Deliver Report
-       tapiRet = tel_send_sms_deliver_report(&pkgInfo, response, &reqId);
+       tapiRet = tel_send_sms_deliver_report(pTapiHandle, &pkgInfo, response, TapiEventDeliveryReportCNF, NULL);
 
        if (tapiRet == TAPI_API_SUCCESS)
        {
@@ -416,7 +432,7 @@ void SmsPluginTransport::setSmscOptions(SMS_ADDRESS_S *pSmsc)
        }
        else
        {
-               strncpy(pSmsc->address, "", MAX_ADDRESS_LEN);
+               strncpy(pSmsc->address, "+8210911111", MAX_ADDRESS_LEN);
        }
 
        memset(keyName, 0x00, sizeof(keyName));
@@ -439,14 +455,14 @@ void SmsPluginTransport::setSmscOptions(SMS_ADDRESS_S *pSmsc)
 }
 
 
-void SmsPluginTransport::msgInfoToSubmitData(const MSG_MESSAGE_INFO_S *pMsgInfo, SMS_SUBMIT_DATA_S *pData, SMS_CODING_SCHEME_T *pCharType)
+void SmsPluginTransport::msgInfoToSubmitData(const MSG_MESSAGE_INFO_S *pMsgInfo, SMS_SUBMIT_DATA_S *pData, SMS_CODING_SCHEME_T *pCharType, int addrIndex)
 {
        // Destination Address
        pData->destAddress.ton = SMS_TON_NATIONAL;
        pData->destAddress.npi = SMS_NPI_ISDN;
 
        memset(pData->destAddress.address, 0x00, MAX_ADDRESS_LEN+1);
-       memcpy(pData->destAddress.address, pMsgInfo->addressList[0].addressVal, MAX_ADDRESS_LEN);
+       memcpy(pData->destAddress.address, pMsgInfo->addressList[addrIndex].addressVal, MAX_ADDRESS_LEN);
 
        MSG_DEBUG("ton [%d]", pData->destAddress.ton);
        MSG_DEBUG("npi [%d]", pData->destAddress.npi);
@@ -457,7 +473,7 @@ void SmsPluginTransport::msgInfoToSubmitData(const MSG_MESSAGE_INFO_S *pMsgInfo,
        unsigned char decodeData[bufSize];
        memset(decodeData, 0x00, sizeof(decodeData));
 
-       MSG_ENCODE_TYPE_T encodeType = MSG_ENCODE_GSM7BIT;
+       msg_encode_type_t encodeType = MSG_ENCODE_GSM7BIT;
 
        SMS_LANGUAGE_ID_T langId = SMS_LANG_ID_RESERVED;
 
@@ -548,10 +564,7 @@ MSG_DEBUG("reply address : [%s]", pMsgInfo->replyAddress);
 
        segSize = getSegmentSize(*pCharType, decodeLen, pMsgInfo->msgPort.valid, langId, addrLen);
 
-       if (segSize >= decodeLen)
-               pData->segCount = 1;
-       else
-               pData->segCount = (decodeLen/segSize) + 1;
+       pData->segCount = ceil((double)decodeLen/(double)segSize);
 
 MSG_DEBUG("segment size : [%d], pData->segCount : [%d]", segSize, pData->segCount);
 
@@ -708,7 +721,7 @@ void SmsPluginTransport::setConcatHeader(SMS_UDH_S *pSrcHeader, SMS_UDH_S *pDstH
 }
 
 
-void SmsPluginTransport::setNetStatus(MSG_NETWORK_STATUS_T netStatus)
+void SmsPluginTransport::setNetStatus(msg_network_status_t netStatus)
 {
        mx.lock();
        curStatus = netStatus;
@@ -717,7 +730,7 @@ void SmsPluginTransport::setNetStatus(MSG_NETWORK_STATUS_T netStatus)
 }
 
 
-MSG_NETWORK_STATUS_T SmsPluginTransport::getNetStatus()
+msg_network_status_t SmsPluginTransport::getNetStatus()
 {
        mx.lock();
 
index 41d4561..0e97339 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include "MsgDebug.h"
 #include "MsgCppTypes.h"
index 3207eb1..e953d95 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include "MsgDebug.h"
 #include "MsgCppTypes.h"
@@ -96,6 +96,9 @@ int SmsPluginUDCodec::decodeUserData(const unsigned char *pTpdu, const int tpduL
                case SMS_CHARSET_UCS2:
                        decodeSize = decodeUCS2Data(pTpdu, tpduLen, bHeaderInd, pUserData, pTPUD);
                        break;
+               case SMS_CHARSET_EUCKR:
+                       decodeSize = decodeUCS2Data(pTpdu, tpduLen, bHeaderInd, pUserData, pTPUD);
+                       break;
        }
 
        return decodeSize;
@@ -729,6 +732,7 @@ int SmsPluginUDCodec::pack7bitChar(const unsigned char *pUserData, int dataLen,
        {
                if (shift == 0)
                {
+
                        pPackData[dstIdx] = pUserData[srcIdx];
 
                        if (srcIdx >= dataLen) break;
@@ -752,14 +756,12 @@ int SmsPluginUDCodec::pack7bitChar(const unsigned char *pUserData, int dataLen,
                {
                        pPackData[dstIdx-1] |= pUserData[srcIdx] << shift;
 
-
                        srcIdx++;
 
                        shift--;
                }
        }
 
-
        return dstIdx;
 }
 
@@ -777,7 +779,6 @@ MSG_DEBUG("dataLen = %d", dataLen);
        {
                if (shift == 0)
                {
-
                        pUnpackData[dstIdx] = pTpdu[srcIdx] & 0x7F;
 
                        shift = 7;
@@ -789,12 +790,10 @@ MSG_DEBUG("dataLen = %d", dataLen);
 
                if (shift > 0)
                {
-
                        pUnpackData[dstIdx] = (pTpdu[srcIdx-1] >> shift) + (pTpdu[srcIdx] << (8 - shift));
 
                        pUnpackData[dstIdx] &= 0x7F;
 
-
                        shift--;
 
                        if (shift > 0) srcIdx++;
@@ -803,4 +802,3 @@ MSG_DEBUG("dataLen = %d", dataLen);
 
        return dstIdx;
 }
-
index 1c0859c..015a750 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include "MsgDebug.h"
 #include "MsgCppTypes.h"
@@ -24,7 +24,6 @@
 #include "SmsPluginEventHandler.h"
 #include "SmsPluginWapPushHandler.h"
 
-
 #include <drm_client.h>
 
 static unsigned short wapPushPortList [] = {0x0b84, 0x0b85, 0x23F0, 0x23F1, 0x23F2, 0x23F3, 0xC34F};
@@ -920,7 +919,6 @@ void SmsPluginWapPushHandler::handleWapPushCallback(char* pPushHeader, char* pPu
        switch (appCode) {
        case SMS_WAP_APPLICATION_MMS_UA:
                MSG_DEBUG("Received MMS Notification");
-
                handleMMSNotification(pPushBody, PushBodyLen);
                break;
 
@@ -1050,6 +1048,7 @@ void SmsPluginWapPushHandler::handleMMSNotification(const char *pPushBody, int P
 
        /** Make MSG_MESSAGE_INFO_S */
        MSG_MESSAGE_INFO_S msgInfo;
+       memset(&msgInfo, 0x00, sizeof(MSG_MESSAGE_INFO_S));
 
        createMsgInfo(&msgInfo);
 
@@ -1080,7 +1079,7 @@ void SmsPluginWapPushHandler::handleMMSNotification(const char *pPushBody, int P
                msgInfo.msgText[msgInfo.dataSize] = '\0';
        }
 
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        /** Add MMS Noti Msg into DB */
        err = SmsPluginStorage::instance()->addMessage(&msgInfo);
@@ -1229,7 +1228,7 @@ void SmsPluginWapPushHandler::handleSIMessage(char* pPushBody, int PushBodyLen,
        xmlFree(xmlDoc);
        xmlFree(tmpXmlChar);
 
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        /** Add WAP Push Msg into DB */
        err = SmsPluginStorage::instance()->addMessage(&msgInfo);
@@ -1461,7 +1460,7 @@ void SmsPluginWapPushHandler::handleCOMessage(char* pPushBody, int PushBodyLen,
 
        msgInfo.dataSize = sizeof(cacheOp);
 
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        /** Add WAP Push Msg into DB */
        err = SmsPluginStorage::instance()->addMessage(&msgInfo);
@@ -1649,7 +1648,7 @@ unsigned long SmsPluginWapPushHandler::convertXmlCharToSec(char* pDate)
        return nTimeInSec;
 }
 
-MSG_PUSH_ACTION_T SmsPluginWapPushHandler::convertSIActionStrToEnum(char* pAction)
+msg_push_action_t SmsPluginWapPushHandler::convertSIActionStrToEnum(char* pAction)
 {
        int comp = 0;
 
@@ -1688,7 +1687,7 @@ MSG_PUSH_ACTION_T SmsPluginWapPushHandler::convertSIActionStrToEnum(char* pActio
 
 }
 
-MSG_PUSH_ACTION_T SmsPluginWapPushHandler::convertSLActionStrToEnum(char* pAction)
+msg_push_action_t SmsPluginWapPushHandler::convertSLActionStrToEnum(char* pAction)
 {
        int comp = 0;
 
@@ -2689,6 +2688,7 @@ void SmsPluginWapPushHandler::wspHeaderDecodeParameter( unsigned char* data, uns
                        break;
                        /* integer */
                case 0x03 :
+                       //param = (unsigned char *)malloc( (size_t)WSP_STANDARD_STR_LEN_MAX );
                        param = new char[WSP_STANDARD_STR_LEN_MAX];
                        if (param == NULL) {
                                MSG_DEBUG("WspLHeaderDecodeParameter: 0x03 MemAlloc failed\n");
index f1b5075..eff1409 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef SMS_PLUGIN_CALLBACK_H
 #define SMS_PLUGIN_CALLBACK_H
 
 extern "C"
 {
-       #include <TapiEvent.h>
+       #include <tapi_common.h>
+       #include <TelSms.h>
+       #include <TapiUtility.h>
+       #include <ITapiNetText.h>
 }
 
 /*==================================================================================================
                                      FUNCTION PROTOTYPES
 ==================================================================================================*/
-int TapiEventDeviceReady(const TelTapiEvent_t *pEvent, void*);
+void TapiEventDeviceReady(TapiHandle *handle, int result, void *data, void *user_data);
 
-int TapiEventSentStatus(const TelTapiEvent_t *pEvent, void*);
-int TapiEventMsgIncoming(const TelTapiEvent_t *pEvent, void*);
-int TapiEventCbMsgIncoming(const TelTapiEvent_t *pEvent, void*);
-int TapiEventDeliveryReportCNF(const TelTapiEvent_t *pEvent, void*);
+void TapiEventSentStatus(TapiHandle *handle, int result, void *data, void *user_data);
+void TapiEventMsgIncoming(TapiHandle *handle, int result, void *data, void *user_data);
+void TapiEventCbMsgIncoming(TapiHandle *handle, int result, void *data, void *user_data);
+void TapiEventDeliveryReportCNF(TapiHandle *handle, int result, void *data, void *user_data);
 
-int TapiEventGetSimMsgCnt(const TelTapiEvent_t *pEvent, void*);
-int TapiEventGetSimMsg(const TelTapiEvent_t *pEvent, void*);
-int TapiEventSaveSimMsg(const TelTapiEvent_t *pEvent, void*);
-int TapiEventDeleteSimMsg(const TelTapiEvent_t *pEvent, void*);
+void TapiEventGetSimMsgCnt(TapiHandle *handle, int result, void *data, void *user_data);
+void TapiEventGetSimMsg(TapiHandle *handle, int result, void *data, void *user_data);
+void TapiEventSaveSimMsg(TapiHandle *handle, int result, void *data, void *user_data);
+void TapiEventDeleteSimMsg(TapiHandle *handle, int result, void *data, void *user_data);
 
-int TapiEventSetConfigData(const TelTapiEvent_t *pEvent, void*);
+void TapiEventSetConfigData(TapiHandle *handle, int result, void *data, void *user_data);
 
-int TapiEventGetCBConfig(const TelTapiEvent_t *pEvent, void*);
+void TapiEventGetCBConfig(TapiHandle *handle, int result, void *data, void *user_data);
 
-int TapiEventGetParamCnt(const TelTapiEvent_t *pEvent, void*);
-int TapiEventGetParam(const TelTapiEvent_t *pEvent, void*);
+void TapiEventGetParamCnt(TapiHandle *handle, int result, void *data, void *user_data);
+void TapiEventGetParam(TapiHandle *handle, int result, void *data, void *user_data);
 
-int TapiEventSatSmsRefresh(const TelTapiEvent_t *pEvent, void*);
-int TapiEventSatSendSms(const TelTapiEvent_t *pEvent, void*);
-int TapiEventSatMoSmsCtrl(const TelTapiEvent_t *pEvent, void*);
+void TapiEventSatSmsRefresh(TapiHandle *handle, int result, void *data, void *user_data);
+void TapiEventSatSendSms(TapiHandle *handle, int result, void *data, void *user_data);
+void TapiEventSatMoSmsCtrl(TapiHandle *handle, int result, void *data, void *user_data);
 
-int TapiEventSimFileInfo(const TelTapiEvent_t *pEvent, void*);
-int TapiEventSimReadFile(const TelTapiEvent_t *pEvent, void*);
-
-int TapiEventFactoryDftSms(const TelTapiEvent_t *pEvent, void*);
+void TapiEventSimFileInfo(TapiHandle *handle, int result, void *data, void *user_data);
+void TapiEventSimReadFile(TapiHandle *handle, int result, void *data, void *user_data);
 
 
 /*==================================================================================================
index bac47f9..9e46c77 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef SMS_PLUGIN_CBMSG_HANDLER_H
 #define SMS_PLUGIN_CBMSG_HANDLER_H
@@ -30,10 +30,9 @@ using namespace std;
 
 extern "C"
 {
-#ifndef _TAPI_NETTEXT_H_
-       #include "ITapiNetText.h"
-//     #include "ITapi_common.h"
-#endif
+       #include <tapi_common.h>
+       #include <TelSms.h>
+       #include <ITapiNetText.h>
 }
 
 
index 4973f63..1920a62 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef SMS_PLUGIN_CONCAT_HANDLER_H
 #define SMS_PLUGIN_CONCAT_HANDLER_H
@@ -73,7 +73,7 @@ typedef struct _SMS_CONCAT_INFO_S
 typedef struct _SMS_SIM_ID_S
 {
        unsigned short          msgRef;
-       MSG_SIM_ID_T            simId;
+       msg_sim_id_t            simId;
 } SMS_SIM_ID_S;
 
 
@@ -88,6 +88,7 @@ public:
        bool IsConcatMsg(SMS_USERDATA_S *pUserData);
        void handleConcatMsg(SMS_TPDU_S *pTpdu);
 
+
 private:
        SmsPluginConcatHandler();
        virtual ~SmsPluginConcatHandler();
@@ -101,7 +102,6 @@ private:
 
        void removeFromConcatList(unsigned short MsgRef);
 
-
        vector<SMS_CONCAT_INFO_S> concatList;
 };
 
index 0b87220..0165eb2 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef SMS_PLUGIN_EVENT_HANDLER_H
 #define SMS_PLUGIN_EVENT_HANDLER_H
@@ -35,15 +35,14 @@ public:
        static SmsPluginEventHandler* instance();
 
        void registerListener(MSG_PLUGIN_LISTENER_S *pListener);
-       void handleSentStatus(int TapiReqId, MSG_NETWORK_STATUS_T NetStatus);
+       void handleSentStatus(msg_network_status_t NetStatus);
        void handleMsgIncoming(SMS_TPDU_S *pTpdu);
-       void handleSyncMLMsgIncoming(MSG_SYNCML_MESSAGE_TYPE_T msgType, char* pPushBody, int PushBodyLen, char* pWspHeader, int WspHeaderLen);
+       void handleSyncMLMsgIncoming(msg_syncml_message_type_t msgType, char* pPushBody, int PushBodyLen, char* pWspHeader, int WspHeaderLen);
        void handleLBSMsgIncoming(char* pPushHeader, char* pPushBody, int pushBodyLen);
-       void handleDftSms(MSG_FOLDER_ID_T FolderId, char* pNumber, char* pData);
 
-       MSG_ERROR_T callbackMsgIncoming(MSG_MESSAGE_INFO_S *pMsgInfo);
-       MSG_ERROR_T callbackInitSimBySat();
-       MSG_ERROR_T callbackStorageChange(MSG_STORAGE_CHANGE_TYPE_T storageChangeType, MSG_MESSAGE_INFO_S *pMsgInfo);
+       msg_error_t callbackMsgIncoming(MSG_MESSAGE_INFO_S *pMsgInfo);
+       msg_error_t callbackInitSimBySat();
+       msg_error_t callbackStorageChange(msg_storage_change_type_t storageChangeType, MSG_MESSAGE_INFO_S *pMsgInfo);
 
        void SetSentInfo(SMS_SENT_INFO_S *pSentInfo);
 
index 4cc6293..e8c55ca 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef SMS_PLUGIN_MAIN_H
 #define SMS_PLUGIN_MAIN_H
@@ -34,37 +34,37 @@ extern "C"
 /*==================================================================================================
                                      FUNCTION PROTOTYPES
 ==================================================================================================*/
-MSG_ERROR_T SmsPlgInitialize();
+msg_error_t SmsPlgInitialize();
 
-MSG_ERROR_T SmsPlgFinalize();
+msg_error_t SmsPlgFinalize();
 
-MSG_ERROR_T SmsPlgRegisterListener(MSG_PLUGIN_LISTENER_S *pListener);
+msg_error_t SmsPlgRegisterListener(MSG_PLUGIN_LISTENER_S *pListener);
 
-MSG_ERROR_T SmsPlgCheckSimStatus(MSG_SIM_STATUS_T *pStatus);
+msg_error_t SmsPlgCheckSimStatus(MSG_SIM_STATUS_T *pStatus);
 
-MSG_ERROR_T SmsPlgCheckDeviceStatus();
+msg_error_t SmsPlgCheckDeviceStatus();
 
-MSG_ERROR_T SmsPlgSubmitRequest(MSG_REQUEST_INFO_S *pReqInfo, bool bReqCb);
+msg_error_t SmsPlgSubmitRequest(MSG_REQUEST_INFO_S *pReqInfo);
 
-MSG_ERROR_T SmsPlgInitSimMessage();
+msg_error_t SmsPlgInitSimMessage();
 
-MSG_ERROR_T SmsPlgSaveSimMessage(const MSG_MESSAGE_INFO_S *pMsgInfo, SMS_SIM_ID_LIST_S *pSimIdList);
+msg_error_t SmsPlgSaveSimMessage(const MSG_MESSAGE_INFO_S *pMsgInfo, SMS_SIM_ID_LIST_S *pSimIdList);
 
-MSG_ERROR_T SmsPlgDeleteSimMessage(MSG_SIM_ID_T SimMsgId);
+msg_error_t SmsPlgDeleteSimMessage(msg_sim_id_t SimMsgId);
 
-MSG_ERROR_T SmsPlgGetSimMessage(MSG_SIM_ID_T SimMsgId);
+msg_error_t SmsPlgGetSimMessage(msg_sim_id_t SimMsgId);
 
-MSG_ERROR_T SmsPlgGetSimMessageCount();
+msg_error_t SmsPlgGetSimMessageCount();
 
-MSG_ERROR_T SmsPlgSetReadStatus(MSG_SIM_ID_T SimMsgId);
+msg_error_t SmsPlgSetReadStatus(msg_sim_id_t SimMsgId);
 
-MSG_ERROR_T SmsPlgSetMemoryStatus(MSG_ERROR_T Error);
+msg_error_t SmsPlgSetMemoryStatus(msg_error_t Error);
 
-MSG_ERROR_T SmsPlgInitConfigData(MSG_SIM_STATUS_T SimStatus);
+msg_error_t SmsPlgInitConfigData(MSG_SIM_STATUS_T SimStatus);
 
-MSG_ERROR_T SmsPlgSetConfigData(const MSG_SETTING_S *pSetting);
+msg_error_t SmsPlgSetConfigData(const MSG_SETTING_S *pSetting);
 
-MSG_ERROR_T SmsPlgGetConfigData(MSG_SETTING_S *pSetting);
+msg_error_t SmsPlgGetConfigData(MSG_SETTING_S *pSetting);
 
 #ifdef __cplusplus
 }
index 980d44a..8591935 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef SMS_PLUGIN_PARAMCODEC_H
 #define SMS_PLUGIN_PARAMCODEC_H
index 84f0e32..0cbf0bb 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef SMS_PLUGIN_SAT_HANDLER_H
 #define SMS_PLUGIN_SAT_HANDLER_H
@@ -34,9 +34,9 @@ public:
        void refreshSms(void *pData);
        void sendSms(void *pData);
        void ctrlSms(void *pData);
-       void ctrlSms(MSG_NETWORK_STATUS_T netStatus);
+       void ctrlSms(msg_network_status_t netStatus);
 
-       void finishSimMsgInit(MSG_ERROR_T Err);
+       void finishSimMsgInit(msg_error_t Err);
 
 private:
        SmsPluginSatHandler();
index 1aea56f..d649e48 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef SMS_PLUGIN_SETTING_H
 #define SMS_PLUGIN_SETTING_H
@@ -47,9 +47,9 @@ private:
        SmsPluginSetting();
        ~SmsPluginSetting();
 
-       MSG_ERROR_T addSMSCList(MSG_SMSC_LIST_S *pSmscList);
+       msg_error_t addSMSCList(MSG_SMSC_LIST_S *pSmscList);
 
-       MSG_ERROR_T addCbOpt(MSG_CBMSG_OPT_S *pCbOpt);
+       msg_error_t addCbOpt(MSG_CBMSG_OPT_S *pCbOpt);
        void getCbOpt(MSG_SETTING_S *pSetting);
 
        void setParamList(const MSG_SMSC_LIST_S *pSMSCList);
index 73094fc..c83bd6e 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef SMS_PLUGIN_SIMMSG_H
 #define SMS_PLUGIN_SIMMSG_H
 
 extern "C"
 {
-#ifndef _TAPI_NETTEXT_H_
-       #include "ITapiNetText.h"
-       #include "ITapiSim.h"
-#endif
+       #include <tapi_common.h>
+       #include <TelSms.h>
+       #include <TapiUtility.h>
+       #include <ITapiNetText.h>
 }
 
 /*==================================================================================================
@@ -44,34 +44,34 @@ public:
        static SmsPluginSimMsg* instance();
 
        void initSimMessage();
-       MSG_ERROR_T saveSimMessage(const MSG_MESSAGE_INFO_S *pMsgInfo, SMS_SIM_ID_LIST_S *pSimIdList);
-       MSG_ERROR_T saveClass2Message(const MSG_MESSAGE_INFO_S *pMsgInfo);
-       void deleteSimMessage(MSG_SIM_ID_T SimMsgId);
+       msg_error_t saveSimMessage(const MSG_MESSAGE_INFO_S *pMsgInfo, SMS_SIM_ID_LIST_S *pSimIdList);
+       msg_error_t saveClass2Message(const MSG_MESSAGE_INFO_S *pMsgInfo);
+       void deleteSimMessage(msg_sim_id_t SimMsgId);
        void getSimMessageList(MSG_SIM_MSG_INFO_LIST_S **ppSimMsgList);
-       void setReadStatus(MSG_SIM_ID_T SimMsgId);
+       void setReadStatus(msg_sim_id_t SimMsgId);
        bool checkSimMsgFull(unsigned int SegCnt);
 
        void setSimMsgCntEvent(const MSG_SIM_COUNT_S *pSimMsgCnt);
        void setSimMsgEvent(const MSG_MESSAGE_INFO_S *pMsgInfo, bool bSuccess);
-       void setSimEvent(MSG_SIM_ID_T SimId, bool bResult);
+       void setSimEvent(msg_sim_id_t SimId, bool bResult);
 
 private:
        SmsPluginSimMsg();
        ~SmsPluginSimMsg();
 
        void getSimMsgCount(MSG_SIM_COUNT_S *pSimMsgCnt);
-       bool getSimMsg(MSG_SIM_ID_T SimMsgId, MSG_MESSAGE_INFO_S* pMsgInfo);
+       bool getSimMsg(msg_sim_id_t SimMsgId, MSG_MESSAGE_INFO_S* pMsgInfo);
 
        void setSmsOptions(SMS_DELIVER_S *pDeliver);
        void convertTimeStamp(const MSG_MESSAGE_INFO_S* pMsgInfo, SMS_DELIVER_S *pDeliver);
 
        bool getSimMsgCntEvent(MSG_SIM_COUNT_S *pSimMsgCnt);
        bool getSimMsgEvent(MSG_MESSAGE_INFO_S *pMsgInfo);
-       bool getSimEvent(MSG_SIM_ID_T *pSimId);
+       bool getSimEvent(msg_sim_id_t *pSimId);
 
        static SmsPluginSimMsg* pInstance;
 
-       MSG_SIM_ID_T                    simMsgId;
+       msg_sim_id_t                    simMsgId;
 
        MSG_SIM_COUNT_S                 simMsgCnt;
 
index 73d11d1..fae7306 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef SMS_PLUGIN_STORAGE_H
 #define SMS_PLUGIN_STORAGE_H
 
 extern "C"
 {
-#ifndef _TAPI_NETTEXT_H_
-       #include "ITapiNetText.h"
-       #include "ITapiSim.h"
-#endif
+       #include <tapi_common.h>
+       #include <TelSms.h>
+       #include <TapiUtility.h>
+       #include <ITapiNetText.h>
 }
 
 /*==================================================================================================
@@ -44,29 +44,29 @@ class SmsPluginStorage
 public:
        static SmsPluginStorage* instance();
 
-       MSG_ERROR_T updateSentMsg(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_NETWORK_STATUS_T Status);
+       msg_error_t updateSentMsg(MSG_MESSAGE_INFO_S *pMsgInfo, msg_network_status_t Status);
 
-       MSG_ERROR_T addSimMessage(MSG_MESSAGE_INFO_S *pSimMsgInfo);
+       msg_error_t addSimMessage(MSG_MESSAGE_INFO_S *pSimMsgInfo);
 
-       MSG_ERROR_T addMessage(MSG_MESSAGE_INFO_S *pMsgInfo);
-       MSG_ERROR_T addSmsMessage(MSG_MESSAGE_INFO_S *pMsgInfo);
+       msg_error_t addMessage(MSG_MESSAGE_INFO_S *pMsgInfo);
+       msg_error_t addSmsMessage(MSG_MESSAGE_INFO_S *pMsgInfo);
 
-       MSG_ERROR_T deleteSmsMessage(MSG_MESSAGE_ID_T MsgId);
+       msg_error_t deleteSmsMessage(msg_message_id_t MsgId);
 
 private:
        SmsPluginStorage();
        ~SmsPluginStorage();
 
-       MSG_ERROR_T updateSmsMessage(MSG_MESSAGE_INFO_S *pMsgInfo);
+       msg_error_t updateSmsMessage(MSG_MESSAGE_INFO_S *pMsgInfo);
 
-       MSG_ERROR_T addCbMessage(MSG_MESSAGE_INFO_S *pMsgInfo);
-       MSG_ERROR_T addReplaceTypeMsg(MSG_MESSAGE_INFO_S *pMsgInfo);
-       MSG_ERROR_T addWAPMessage(MSG_MESSAGE_INFO_S *pMsgInfo);
-       MSG_ERROR_T handleCOWAPMessage(MSG_MESSAGE_INFO_S *pMsgInfo);
-       MSG_ERROR_T checkPushMsgValidation(MSG_PUSH_MESSAGE_S *pPushMsg, bool *pbProceed);
+       msg_error_t addCbMessage(MSG_MESSAGE_INFO_S *pMsgInfo);
+       msg_error_t addReplaceTypeMsg(MSG_MESSAGE_INFO_S *pMsgInfo);
+       msg_error_t addWAPMessage(MSG_MESSAGE_INFO_S *pMsgInfo);
+       msg_error_t handleCOWAPMessage(MSG_MESSAGE_INFO_S *pMsgInfo);
+       msg_error_t checkPushMsgValidation(MSG_PUSH_MESSAGE_S *pPushMsg, bool *pbProceed);
 
-       MSG_ERROR_T checkStorageStatus(MSG_MESSAGE_INFO_S *pMsgInfo);
-       MSG_ERROR_T updateAllAddress();
+       msg_error_t checkStorageStatus(MSG_MESSAGE_INFO_S *pMsgInfo);
+       msg_error_t updateAllAddress();
 
        static SmsPluginStorage* pInstance;
 
index 740ffe2..08cee2b 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef SMS_PLUGIN_TEXT_CONVERT_H
 #define SMS_PLUGIN_TEXT_CONVERT_H
@@ -61,17 +61,17 @@ static const WCHAR g_GSM7BitToUCS2[] =
 {
        /* @ */
        0x0040, 0x00A3, 0x0024, 0x00A5, 0x00E8, 0x00E9, 0x00F9, 0x00EC, 0x00F2, 0x00C7, 0x000A, 0x00D8, 0x00F8, 0x000D, 0x00C5, 0x00E5,
-       /* ¥Ä*/
+       /* ��*/
        0x0394, 0x005F, 0x03A6, 0x0393, 0x039B, 0x03A9, 0x03A0,         0x03A8, 0x03A3, 0x0398, 0x039E, 0x001B, 0x00C6, 0x00E6, 0x00DF, 0x00C9,
        /* SP */
        0x0020, 0x0021, 0x0022, 0x0023, 0x00A4, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
        /* 0 */
        0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
-       /* ¢®*/
+       /* ��*/
        0x00A1, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
        /* P */
        0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x00C4, 0x00D6, 0x00D1, 0x00DC, 0x00A7,
-       /* ¢¯*/
+       /* ��*/
        0x00BF, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
        /* p */
        0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x00E4, 0x00F6, 0x00F1, 0x00FC, 0x00E0
@@ -93,7 +93,7 @@ static const WCHAR g_GSM7BitExtToUCS2[] =
        /* | */
        0x007C, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020,
        0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020,
-                                                                     /* ¢æ*/
+                                                                     /* ��*/
        0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x20AC, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020,
        0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020
 };
@@ -114,7 +114,7 @@ static const WCHAR g_TurkishSingleToUCS2[] =
        /* | */
        0x007C, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x011E, 0x0020, 0x0130, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020,
        0x0020, 0x0020, 0x0020, 0x015E, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020,
-                                                                     /* ¢æ*/
+                                                                     /* ��*/
        0x0020, 0x0020, 0x0020, 0x00E7, 0x0020, 0x20AC, 0x0020, 0x011F, 0x0020, 0x0131, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020,
        0x0020, 0x0020, 0x0020, 0x015F, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020
 };
@@ -125,13 +125,13 @@ static const WCHAR g_TurkishLockingToUCS2[] =
 {
        /* @ */
        0x0040, 0x00A3, 0x0024, 0x00A5, 0x20AC, 0x00E9, 0x00F9, 0x00EC, 0x00F2, 0x00C7, 0x000A, 0x011E, 0x011F, 0x000D, 0x00C5, 0x00E5,
-       /* ¥Ä*/
+       /* ��*/
        0x0394, 0x005F, 0x03A6, 0x0393, 0x039B, 0x03A9, 0x03A0,         0x03A8, 0x03A3, 0x0398, 0x039E, 0x001B, 0x015E, 0x015F, 0x00DF, 0x00C9,
        /* SP */
        0x0020, 0x0021, 0x0022, 0x0023, 0x00A4, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
        /* 0 */
        0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
-       /* ¢®*/
+       /* ��*/
        0x0130, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
        /* P */
        0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x00C4, 0x00D6, 0x00D1, 0x00DC, 0x00A7,
@@ -157,7 +157,7 @@ static const WCHAR g_SpanishSingleToUCS2[] =
        /* | */
        0x007C, 0x00C1, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x00CD, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x00D3,
        0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x00DA, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020,
-                                                                     /* ¢æ*/
+                                                                     /* ��*/
        0x0020, 0x00E1, 0x0020, 0x0020, 0x0020, 0x20AC, 0x0020, 0x0020, 0x0020, 0x00ED, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x00F3,
        0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x00FA, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020
 };
@@ -178,7 +178,7 @@ static const WCHAR g_PortuSingleToUCS2[] =
        /* | */
        0x007C, 0x00C0, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x00CD, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x00D3,
        0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x00DA, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x00C3, 0x00D5, 0x0020, 0x0020, 0x0020,
-                                                                     /* ¢æ*/
+                                                                     /* ��*/
        0x0020, 0x00C2, 0x0020, 0x0020, 0x0020, 0x20AC, 0x0020, 0x0020, 0x0020, 0x00ED, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x00F3,
        0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x00FA, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x00E3, 0x00F5, 0x0020, 0x0020, 0x00E2
 };
@@ -189,17 +189,17 @@ static const WCHAR g_PortuLockingToUCS2[] =
 {
        /* @ */
        0x0040, 0x00A3, 0x0024, 0x00A5, 0x00EA, 0x00E9, 0x00FA, 0x00ED, 0x00F3, 0x00E7, 0x000A, 0x00D4, 0x00F4, 0x000D, 0x00C1, 0x00E1,
-       /* ¥Ä*/
+       /* ��*/
        0x0394, 0x005F, 0x0020, 0x00C7, 0x00C0, 0x0020, 0x005E,         0x005C, 0x20AC, 0x00D3, 0x007C, 0x001B, 0x00C2, 0x00E2, 0x00CA, 0x00C9,
        /* SP */
        0x0020, 0x0021, 0x0022, 0x0023, 0x00A4, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
        /* 0 */
        0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
-       /* ¢®*/
+       /* ��*/
        0x00CD, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
        /* P */
        0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x00C3, 0x00D5, 0x00DA, 0x00DC, 0x00A7,
-       /* ¢¯*/
+       /* ��*/
        0x00BF, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
        /* p */
        0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x00E3, 0x00F5, 0x0020, 0x00FC, 0x00E0
@@ -216,7 +216,7 @@ public:
 
        int convertUTF8ToGSM7bit(OUT unsigned char *pDestText, IN int maxLength,  IN const unsigned char *pSrcText, IN int srcTextLen, OUT SMS_LANGUAGE_ID_T *pLangId);
        int convertUTF8ToUCS2(OUT unsigned char *pDestText, IN int maxLength, IN const unsigned char *pSrcText, IN int srcTextLen);
-       int convertUTF8ToAuto(OUT unsigned char *pDestText, IN int maxLength,  IN const unsigned char *pSrcText, IN int srcTextLen, OUT MSG_ENCODE_TYPE_T *pCharType);
+       int convertUTF8ToAuto(OUT unsigned char *pDestText, IN int maxLength,  IN const unsigned char *pSrcText, IN int srcTextLen, OUT msg_encode_type_t *pCharType);
 
        int convertGSM7bitToUTF8(OUT unsigned char *pDestText, IN int maxLength,  IN const unsigned char *pSrcText, IN int srcTextLen, IN SMS_LANG_INFO_S *pLangInfo);
        int convertUCS2ToUTF8(OUT unsigned char *pDestText, IN int maxLength, IN const unsigned char *pSrcText, IN  int srcTextLen);
index c013409..43a79e1 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef SMS_PLUGIN_TPDU_CODEC_H
 #define SMS_PLUGIN_TPDU_CODEC_H
index a521f95..e86f463 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef SMS_PLUGIN_TRANSPORT_H
 #define SMS_PLUGIN_TRANSPORT_H
@@ -36,16 +36,16 @@ public:
        static SmsPluginTransport* instance();
 
        void submitRequest(SMS_REQUEST_INFO_S *pReqInfo);
-       void sendDeliverReport(MSG_ERROR_T err);
+       void sendDeliverReport(msg_error_t err);
 
        void setSmsSendOptions(SMS_SUBMIT_S *pSubmit);
        void setSmscOptions(SMS_ADDRESS_S *pSmsc);
 
-       void msgInfoToSubmitData(const MSG_MESSAGE_INFO_S *pMsgInfo, SMS_SUBMIT_DATA_S *pData, SMS_CODING_SCHEME_T *pCharType);
+       void msgInfoToSubmitData(const MSG_MESSAGE_INFO_S *pMsgInfo, SMS_SUBMIT_DATA_S *pData, SMS_CODING_SCHEME_T *pCharType, int addrIndex);
        void setConcatHeader(SMS_UDH_S *pSrcHeader, SMS_UDH_S *pDstHeader);
 
-       void setNetStatus(MSG_NETWORK_STATUS_T netStatus);
-       MSG_NETWORK_STATUS_T getNetStatus();
+       void setNetStatus(msg_network_status_t netStatus);
+       msg_network_status_t getNetStatus();
 
        unsigned char getMsgRef();
 
@@ -63,7 +63,7 @@ private:
        unsigned char           msgRef8bit;
        unsigned short  msgRef16bit;
 
-       MSG_NETWORK_STATUS_T curStatus;
+       msg_network_status_t curStatus;
 
        Mutex mx;
        CndVar cv;
index bc206df..eb07acc 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef SMS_PLUGIN_TYPES_H
 #define SMS_PLUGIN_TYPES_H
@@ -268,6 +268,7 @@ enum _SMS_CODING_SCHEME_E
        SMS_CHARSET_8BIT,
        SMS_CHARSET_UCS2,
        SMS_CHARSET_AUTO,
+       SMS_CHARSET_EUCKR,
 };
 
 
@@ -777,12 +778,9 @@ typedef struct _SMS_TPDU_S
 
 typedef struct
 {
-       MSG_REQUEST_ID_T                reqId;          /**< Indicates the request ID, which is unique.
-                                                                               When applications submit a request to the framework, this value will be set by the framework. */
-       MSG_MESSAGE_INFO_S              msgInfo;        /**< Indicates the message structure to be sent by applications. */
+       msg_request_id_t                                reqId;          /**< Indicates the request ID, which is unique. When applications submit a request to the framework, this value will be set by the framework. */
+       MSG_MESSAGE_INFO_S                      msgInfo;        /**< Indicates the message structure to be sent by applications. */
        MSG_SENDINGOPT_INFO_S   sendOptInfo;
-
-       bool                                            bReqCb;
 } SMS_REQUEST_INFO_S;
 
 
@@ -931,7 +929,7 @@ typedef struct
 typedef struct
 {
        unsigned int            simIdCnt;                                                                                       /**< The total number of SIM Msg ID*/
-       MSG_SIM_ID_T            simIdList[MAX_SEGMENT_NUM];                                                     /**< The SIM Msg ID List */
+       msg_sim_id_t            simIdList[MAX_SEGMENT_NUM];                                                     /**< The SIM Msg ID List */
        char                            msgData[(MAX_MSG_DATA_LEN*MAX_SEGMENT_NUM)+1];          /**< user data */
 } SMS_CONCAT_SIM_MSG_S;
 
index f0a610f..02d0ccb 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef SMS_PLUGIN_UA_MANAGER_H
 #define SMS_PLUGIN_UA_MANAGER_H
index b5fc77a..6db9d06 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef SMS_PLUGIN_UDCODEC_H
 #define SMS_PLUGIN_UDCODEC_H
index 5185d44..e89199a 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef SMS_PLUGIN_WAPPUSH_HANDLER_H
 #define SMS_PLUGIN_WAPPUSH_HANDLER_H
@@ -74,8 +74,8 @@ private:
        void getXmlDoc(const char* pPushBody, const int PushBodyLen, xmlDocPtr *pXmlDoc, const bool isText);
        void createMsgInfo(MSG_MESSAGE_INFO_S* pMsgInfo);
        unsigned long convertXmlCharToSec(char* pDate);
-       MSG_PUSH_ACTION_T convertSIActionStrToEnum(char* pAction);
-       MSG_PUSH_ACTION_T convertSLActionStrToEnum(char* pAction);
+       msg_push_action_t convertSIActionStrToEnum(char* pAction);
+       msg_push_action_t convertSLActionStrToEnum(char* pAction);
 
        unsigned long wspRetriveUintvarDecode( unsigned char* sourceData, unsigned long* currentPointer );
        unsigned long wspDecodeUintvar(unsigned long length, unsigned char* userVar );
index e0adc2e..e0b7c59 100755 (executable)
@@ -20,9 +20,11 @@ SET(TRANS-PROXY-SRCS
        ${CMAKE_SOURCE_DIR}/proxy/MsgHandleSetting.cpp
        ${CMAKE_SOURCE_DIR}/proxy/MsgHandleStorage.cpp
        ${CMAKE_SOURCE_DIR}/proxy/MsgHandleTransport.cpp
+       ${CMAKE_SOURCE_DIR}/proxy/MsgHandleFilter.cpp
 )
 
 INCLUDE_DIRECTORIES(
+    ${CMAKE_SOURCE_DIR}/include/mapi
        ${CMAKE_SOURCE_DIR}/include/common
        ${CMAKE_SOURCE_DIR}/include/framework
        ${CMAKE_SOURCE_DIR}/include/utils
index 9ae3bcd..31af9c9 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include <errno.h>
 #include <stdlib.h>
@@ -138,35 +138,43 @@ void MsgHandle::read(char **ppEvent)
 }
 
 
-void MsgHandle::convertMsgStruct(const MSG_MESSAGE_S *pSrc, MSG_MESSAGE_INFO_S *pDest)
+void MsgHandle::convertMsgStruct(const MSG_MESSAGE_HIDDEN_S *pSrc, MSG_MESSAGE_INFO_S *pDest)
 {
        MSG_BEGIN();
 
        pDest->msgId = pSrc->msgId;
+       pDest->threadId = pSrc->threadId;
        pDest->folderId = pSrc->folderId;
-       pDest->referenceId = pSrc->referenceId;
-       pDest->msgType.mainType = pSrc->msgType.mainType;
-       pDest->msgType.subType = pSrc->msgType.subType;
-       pDest->msgType.classType= pSrc->msgType.classType;
+       pDest->msgType.mainType = pSrc->mainType;
+       pDest->msgType.subType = pSrc->subType;
+       pDest->msgType.classType= pSrc->classType;
        pDest->storageId = pSrc->storageId;
 
-       pDest->nAddressCnt = pSrc->nAddressCnt;
+       msg_struct_list_s *addr_info_s = pSrc->addr_list;
 
-       for (int i = 0; i < pSrc->nAddressCnt; i++)
-       {
-               pDest->addressList[i].threadId = pSrc->addressList[i].threadId;
-               pDest->addressList[i].addressType = pSrc->addressList[i].addressType;
-               pDest->addressList[i].recipientType = pSrc->addressList[i].recipientType;
-               pDest->addressList[i].contactId = pSrc->addressList[i].contactId;
-               strncpy(pDest->addressList[i].addressVal, pSrc->addressList[i].addressVal, MAX_ADDRESS_VAL_LEN);
-               strncpy(pDest->addressList[i].displayName, pSrc->addressList[i].displayName, MAX_DISPLAY_NAME_LEN);
-               pDest->addressList[i].displayName[MAX_DISPLAY_NAME_LEN] = '\0';
+       if (addr_info_s) {
+               msg_struct_s *addr_info = NULL;
+               MSG_ADDRESS_INFO_S *address = NULL;
+
+               pDest->nAddressCnt = addr_info_s->nCount;
+
+               for (int i = 0; i < addr_info_s->nCount; i++)
+               {
+                       addr_info = (msg_struct_s *)addr_info_s->msg_struct_info[i];
+                       address = (MSG_ADDRESS_INFO_S *)addr_info->data;
+
+                       pDest->addressList[i].addressType = address->addressType;
+                       pDest->addressList[i].recipientType = address->recipientType;
+                       pDest->addressList[i].contactId = address->contactId;
+                       strncpy(pDest->addressList[i].addressVal, address->addressVal, MAX_ADDRESS_VAL_LEN);
+                       strncpy(pDest->addressList[i].displayName, address->displayName, MAX_DISPLAY_NAME_LEN);
+                       pDest->addressList[i].displayName[MAX_DISPLAY_NAME_LEN] = '\0';
+               }
        }
 
        strncpy(pDest->replyAddress, pSrc->replyAddress, MAX_PHONE_NUMBER_LEN);
        strncpy(pDest->subject, pSrc->subject, MAX_SUBJECT_LEN);
 
-       pDest->scheduledTime = pSrc->scheduledTime;
        pDest->displayTime = pSrc->displayTime;
        pDest->networkStatus = pSrc->networkStatus;
        pDest->encodeType = pSrc->encodeType;
@@ -177,16 +185,16 @@ void MsgHandle::convertMsgStruct(const MSG_MESSAGE_S *pSrc, MSG_MESSAGE_INFO_S *
        pDest->direction = pSrc->direction;
 
        // Set Port Info.
-       pDest->msgPort.valid = pSrc->msgPort.valid;
+       pDest->msgPort.valid = pSrc->bPortValid;
 
        if (pDest->msgPort.valid == true) {
-               pDest->msgPort.dstPort = pSrc->msgPort.dstPort;
-               pDest->msgPort.srcPort = pSrc->msgPort.srcPort;
+               pDest->msgPort.dstPort = pSrc->dstPort;
+               pDest->msgPort.srcPort = pSrc->srcPort;
        }
 
        MSG_DEBUG("nSize = %d",  pSrc->dataSize);
 
-       if (pSrc->msgType.mainType == MSG_SMS_TYPE){
+       if (pSrc->mainType == MSG_SMS_TYPE){
                pDest->bTextSms = true;
                pDest->dataSize = pSrc->dataSize;
 
@@ -219,12 +227,12 @@ void MsgHandle::convertMsgStruct(const MSG_MESSAGE_S *pSrc, MSG_MESSAGE_INFO_S *
 
                MSG_DEBUG("pData = %s",  pSrc->pData);
                MSG_DEBUG("msgText = %s",  pDest->msgText);
-       } else if (pSrc->msgType.mainType == MSG_MMS_TYPE) {
+       } else if (pSrc->mainType == MSG_MMS_TYPE) {
 
                pDest->bTextSms = false;
                pDest->dataSize = pSrc->dataSize;
 
-               if(pSrc->msgType.subType == MSG_READREPLY_MMS) {
+               if(pSrc->subType == MSG_READREPLY_MMS) {
                        memset(pDest->msgData, 0x00, sizeof(pDest->msgData));
                        memcpy(pDest->msgData, pSrc->pMmsData, pSrc->dataSize);
                } else {
@@ -236,7 +244,7 @@ void MsgHandle::convertMsgStruct(const MSG_MESSAGE_S *pSrc, MSG_MESSAGE_INFO_S *
                                THROW(MsgException::FILE_ERROR, "MsgCreateFileName error");
 
                        // change file extension in case of java MMS msg
-                       if (pSrc->msgType.subType == MSG_SENDREQ_JAVA_MMS) {
+                       if (pSrc->subType == MSG_SENDREQ_JAVA_MMS) {
                                char* pFileNameExt;
                                pFileNameExt = strstr(fileName,"DATA");
                                strncpy(pFileNameExt,"JAVA", MAX_COMMON_INFO_SIZE);
@@ -249,6 +257,9 @@ void MsgHandle::convertMsgStruct(const MSG_MESSAGE_S *pSrc, MSG_MESSAGE_INFO_S *
 
                        memset(pDest->msgData, 0x00, sizeof(pDest->msgData));
                        strncpy(pDest->msgData, fileName, MAX_MSG_DATA_LEN);
+                       if (pSrc->pData) {
+                               strncpy(pDest->msgText, (char*)pSrc->pData, sizeof(pDest->msgText));
+                       }
                }
        }
 
@@ -256,35 +267,21 @@ void MsgHandle::convertMsgStruct(const MSG_MESSAGE_S *pSrc, MSG_MESSAGE_INFO_S *
 }
 
 
-void MsgHandle::convertMsgStruct(const MSG_MESSAGE_INFO_S *pSrc, MSG_MESSAGE_S *pDest)
+void MsgHandle::convertMsgStruct(const MSG_MESSAGE_INFO_S *pSrc, MSG_MESSAGE_HIDDEN_S *pDest)
 {
        MSG_BEGIN();
 
        pDest->msgId = pSrc->msgId;
+       pDest->threadId = pSrc->threadId;
        pDest->folderId = pSrc->folderId;
-       pDest->referenceId = pSrc->referenceId;
-       pDest->msgType.mainType = pSrc->msgType.mainType;
-       pDest->msgType.subType = pSrc->msgType.subType;
+       pDest->mainType = pSrc->msgType.mainType;
+       pDest->subType = pSrc->msgType.subType;
        pDest->storageId = pSrc->storageId;
 
-       pDest->nAddressCnt = pSrc->nAddressCnt;
-
-       for (int i = 0; i < pSrc->nAddressCnt; i++)
-       {
-               pDest->addressList[i].threadId = pSrc->addressList[i].threadId;
-               pDest->addressList[i].addressType = pSrc->addressList[i].addressType;
-               pDest->addressList[i].recipientType = pSrc->addressList[i].recipientType;
-               pDest->addressList[i].contactId = pSrc->addressList[i].contactId;
-               strncpy(pDest->addressList[i].addressVal, pSrc->addressList[i].addressVal, MAX_ADDRESS_VAL_LEN);
-               strncpy(pDest->addressList[i].displayName, pSrc->addressList[i].displayName, MAX_DISPLAY_NAME_LEN);
-               pDest->addressList[i].displayName[MAX_DISPLAY_NAME_LEN] = '\0';
-       }
-
        strncpy(pDest->replyAddress, pSrc->replyAddress, MAX_PHONE_NUMBER_LEN);
        strncpy(pDest->subject, pSrc->subject, MAX_SUBJECT_LEN);
 
        pDest->displayTime = pSrc->displayTime;
-       pDest->scheduledTime = pSrc->scheduledTime;
        pDest->networkStatus = pSrc->networkStatus;
        pDest->encodeType = pSrc->encodeType;
        pDest->bRead = pSrc->bRead;
@@ -294,16 +291,35 @@ void MsgHandle::convertMsgStruct(const MSG_MESSAGE_INFO_S *pSrc, MSG_MESSAGE_S *
        pDest->direction = pSrc->direction;
 
        // Set Port Info.
-       pDest->msgPort.valid = pSrc->msgPort.valid;
+       pDest->bPortValid = pSrc->msgPort.valid;
 
-       if (pDest->msgPort.valid == true) {
-               pDest->msgPort.dstPort = pSrc->msgPort.dstPort;
-               pDest->msgPort.srcPort = pSrc->msgPort.srcPort;
+       if (pDest->bPortValid == true) {
+               pDest->dstPort = pSrc->msgPort.dstPort;
+               pDest->srcPort = pSrc->msgPort.srcPort;
        }
 
        if(pSrc->thumbPath[0] != '\0')
                strncpy(pDest->thumbPath, pSrc->thumbPath, MSG_FILEPATH_LEN_MAX);
 
+       pDest->addr_list->nCount = pSrc->nAddressCnt;
+
+       msg_struct_s *addr_info_s = NULL;
+       MSG_ADDRESS_INFO_S *addr_info = NULL;
+
+       for (int i = 0; i < pDest->addr_list->nCount; i++)
+       {
+               addr_info_s = (msg_struct_s *)pDest->addr_list->msg_struct_info[i];
+               addr_info = (MSG_ADDRESS_INFO_S *)addr_info_s->data;
+
+               addr_info->addressType = pSrc->addressList[i].addressType;
+               addr_info->recipientType = pSrc->addressList[i].recipientType;
+               addr_info->contactId = pSrc->addressList[i].contactId;
+               strncpy(addr_info->addressVal, pSrc->addressList[i].addressVal, MAX_ADDRESS_VAL_LEN);
+               strncpy(addr_info->displayName, pSrc->addressList[i].displayName, MAX_DISPLAY_NAME_LEN);
+               addr_info->displayName[MAX_DISPLAY_NAME_LEN] = '\0';
+       }
+
+
        if (pSrc->bTextSms == false) {
                int fileSize = 0;
 
@@ -388,29 +404,33 @@ void MsgHandle::convertSendOptStruct(const MSG_SENDINGOPT_S* pSrc, MSG_SENDINGOP
        MSG_DEBUG("pDest->bKeepCopy = %d", pDest->bKeepCopy);
 
        if (msgType.mainType == MSG_SMS_TYPE) {
-               pDest->option.smsSendOptInfo.bReplyPath = pSrc->option.smsSendOpt.bReplyPath;
+               msg_struct_s *pStruct = (msg_struct_s *)pSrc->smsSendOpt;
+               SMS_SENDINGOPT_S *pSms = (SMS_SENDINGOPT_S *)pStruct->data;
+               pDest->option.smsSendOptInfo.bReplyPath = pSms->bReplyPath;
        } else if (msgType.mainType == MSG_MMS_TYPE) {
-               pDest->option.mmsSendOptInfo.priority = pSrc->option.mmsSendOpt.priority;
-               pDest->option.mmsSendOptInfo.bReadReq = pSrc->option.mmsSendOpt.bReadReq;
+               msg_struct_s *pStruct = (msg_struct_s *)pSrc->mmsSendOpt;
+               MMS_SENDINGOPT_S *pMms = (MMS_SENDINGOPT_S *)pStruct->data;
+               pDest->option.mmsSendOptInfo.priority = pMms->priority;
+               pDest->option.mmsSendOptInfo.bReadReq = pMms->bReadReq;
 
-               MSG_DEBUG("pDest->option.mmsSendOpt.priority = %d", pDest->option.mmsSendOptInfo.priority);
-               MSG_DEBUG("pDest->option.mmsSendOpt.bReadReq = %d", pDest->option.mmsSendOptInfo.bReadReq);
+               MSG_DEBUG("pDest->option.mmsSendOpt.priority = %d", pMms->priority);
+               MSG_DEBUG("pDest->option.mmsSendOpt.bReadReq = %d", pMms->bReadReq);
 
-               if (pSrc->option.mmsSendOpt.expiryTime == 0) {
+               if (pMms->expiryTime == 0) {
                        pDest->option.mmsSendOptInfo.expiryTime.type = MMS_TIMETYPE_NONE;
-                       pDest->option.mmsSendOptInfo.expiryTime.time = pSrc->option.mmsSendOpt.expiryTime;
+                       pDest->option.mmsSendOptInfo.expiryTime.time = pMms->expiryTime;
                } else {
                        pDest->option.mmsSendOptInfo.expiryTime.type = MMS_TIMETYPE_RELATIVE;
-                       pDest->option.mmsSendOptInfo.expiryTime.time = pSrc->option.mmsSendOpt.expiryTime;
+                       pDest->option.mmsSendOptInfo.expiryTime.time = pMms->expiryTime;
                }
 
-               if (pSrc->option.mmsSendOpt.bUseDeliveryCustomTime == true) {
+               if (pMms->bUseDeliveryCustomTime == true) {
                        pDest->option.mmsSendOptInfo.bUseDeliveryCustomTime = true;
                } else {
                        pDest->option.mmsSendOptInfo.bUseDeliveryCustomTime = false;
                }
                pDest->option.mmsSendOptInfo.deliveryTime.type = MMS_TIMETYPE_RELATIVE;
-               pDest->option.mmsSendOptInfo.deliveryTime.time = pSrc->option.mmsSendOpt.deliveryTime;
+               pDest->option.mmsSendOptInfo.deliveryTime.time = pMms->deliveryTime;
 
                MSG_DEBUG("pDest->option.mmsSendOpt.expiryTime = %d", pDest->option.mmsSendOptInfo.expiryTime.time);
        }
@@ -430,16 +450,20 @@ void MsgHandle::convertSendOptStruct(const MSG_SENDINGOPT_INFO_S* pSrc, MSG_SEND
        MSG_DEBUG("pDest->bKeepCopy = %d", pDest->bKeepCopy);
 
        if (msgType.mainType == MSG_SMS_TYPE) {
-               pDest->option.smsSendOpt.bReplyPath = pSrc->option.smsSendOptInfo.bReplyPath;
+               msg_struct_s *pStruct = (msg_struct_s *)pDest->smsSendOpt;
+               SMS_SENDINGOPT_S *pSms = (SMS_SENDINGOPT_S *)pStruct->data;
+               pSms->bReplyPath = pSrc->option.smsSendOptInfo.bReplyPath;
        } else if (msgType.mainType == MSG_MMS_TYPE) {
-               pDest->option.mmsSendOpt.priority = pSrc->option.mmsSendOptInfo.priority;
-               pDest->option.mmsSendOpt.bReadReq = pSrc->option.mmsSendOptInfo.bReadReq;
-               pDest->option.mmsSendOpt.expiryTime = pSrc->option.mmsSendOptInfo.expiryTime.time;
-               pDest->option.mmsSendOpt.deliveryTime = pSrc->option.mmsSendOptInfo.deliveryTime.time;
-
-               MSG_DEBUG("pDest->option.mmsSendOpt.priority = %d", pDest->option.mmsSendOpt.priority);
-               MSG_DEBUG("pDest->option.mmsSendOpt.bReadReq = %d", pDest->option.mmsSendOpt.bReadReq);
-               MSG_DEBUG("pDest->option.mmsSendOpt.expiryTime = %d", pDest->option.mmsSendOpt.expiryTime);
+               msg_struct_s *pStruct = (msg_struct_s *)pDest->mmsSendOpt;
+               MMS_SENDINGOPT_S *pMms = (MMS_SENDINGOPT_S *)pStruct->data;
+               pMms->priority = pSrc->option.mmsSendOptInfo.priority;
+               pMms->bReadReq = pSrc->option.mmsSendOptInfo.bReadReq;
+               pMms->expiryTime = pSrc->option.mmsSendOptInfo.expiryTime.time;
+               pMms->deliveryTime = pSrc->option.mmsSendOptInfo.deliveryTime.time;
+
+               MSG_DEBUG("pDest->option.mmsSendOpt.priority = %d", pMms->priority);
+               MSG_DEBUG("pDest->option.mmsSendOpt.bReadReq = %d", pMms->bReadReq);
+               MSG_DEBUG("pDest->option.mmsSendOpt.expiryTime = %d", pMms->expiryTime);
        }
 
        MSG_END();
diff --git a/proxy/MsgHandleFilter.cpp b/proxy/MsgHandleFilter.cpp
new file mode 100755 (executable)
index 0000000..2799f47
--- /dev/null
@@ -0,0 +1,255 @@
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#include "MsgDebug.h"
+#include "MsgHandle.h"
+#include "MsgUtilFunction.h"
+#include "MsgCppTypes.h"
+#include "MsgException.h"
+
+
+/*==================================================================================================
+                                     IMPLEMENTATION OF MsgHandle - Filter Member Functions
+==================================================================================================*/
+msg_error_t MsgHandle::addFilter(const MSG_FILTER_S *pFilter)
+{
+       // Allocate Memory to Command Data
+       int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_FILTER_S);
+
+       char cmdBuf[cmdSize];
+       bzero(cmdBuf, cmdSize);
+       MSG_CMD_S* pCmd = (MSG_CMD_S*)cmdBuf;
+
+       // Set Command Parameters
+       pCmd->cmdType = MSG_CMD_ADD_FILTER;
+
+       // Copy Cookie
+       memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
+
+       // Copy Command Data
+       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), pFilter, sizeof(MSG_FILTER_S));
+
+       // Send Command to Messaging FW
+       char* pEventData = NULL;
+       AutoPtr<char> eventBuf(&pEventData);
+
+       write((char*)pCmd, cmdSize, &pEventData);
+
+       // Get Return Data
+       MSG_EVENT_S* pEvent = (MSG_EVENT_S*)pEventData;
+
+       if (pEvent->eventType != MSG_EVENT_ADD_FILTER)
+       {
+               THROW(MsgException::INVALID_RESULT, "Event Data Error");
+       }
+
+       return pEvent->result;
+}
+
+
+msg_error_t MsgHandle::updateFilter(const MSG_FILTER_S *pFilter)
+{
+       // Allocate Memory to Command Data
+       int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_FILTER_S);
+
+       char cmdBuf[cmdSize];
+       bzero(cmdBuf, cmdSize);
+       MSG_CMD_S* pCmd = (MSG_CMD_S*)cmdBuf;
+
+       // Set Command Parameters
+       pCmd->cmdType = MSG_CMD_UPDATE_FILTER;
+
+       // Copy Cookie
+       memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
+
+       // Copy Command Data
+       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), pFilter, sizeof(MSG_FILTER_S));
+
+       // Send Command to Messaging FW
+       char* pEventData = NULL;
+       AutoPtr<char> eventBuf(&pEventData);
+
+       write((char*)pCmd, cmdSize, &pEventData);
+
+       // Get Return Data
+       MSG_EVENT_S* pEvent = (MSG_EVENT_S*)pEventData;
+
+       if (pEvent->eventType != MSG_EVENT_UPDATE_FILTER)
+       {
+               THROW(MsgException::INVALID_RESULT, "Event Data Error");
+       }
+
+       return pEvent->result;
+}
+
+
+msg_error_t MsgHandle::deleteFilter(msg_filter_id_t FilterId)
+{
+       // Allocate Memory to Command Data
+       int cmdSize = sizeof(MSG_CMD_S) + sizeof(msg_filter_id_t);
+
+       char cmdBuf[cmdSize];
+       bzero(cmdBuf, cmdSize);
+       MSG_CMD_S* pCmd = (MSG_CMD_S*)cmdBuf;
+
+       // Set Command Parameters
+       pCmd->cmdType = MSG_CMD_DELETE_FILTER;
+
+       // Copy Cookie
+       memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
+
+       // Copy Command Data
+       memcpy(pCmd->cmdData, &FilterId, sizeof(msg_filter_id_t));
+
+       // Send Command to Messaging FW
+       char* pEventData = NULL;
+       AutoPtr<char> eventBuf(&pEventData);
+
+       write((char*)pCmd, cmdSize, &pEventData);
+
+       // Get Return Data
+       MSG_EVENT_S* pEvent = (MSG_EVENT_S*)pEventData;
+
+       if (pEvent->eventType != MSG_EVENT_DELETE_FILTER)
+       {
+               THROW(MsgException::INVALID_RESULT, "Event Data Error");
+       }
+
+       return pEvent->result;
+}
+
+
+msg_error_t MsgHandle::getFilterList(msg_struct_list_s *pFilterList)
+{
+       // Allocate Memory to Command Data
+       int cmdSize = sizeof(MSG_CMD_S);
+
+       char cmdBuf[cmdSize];
+       bzero(cmdBuf, cmdSize);
+       MSG_CMD_S* pCmd = (MSG_CMD_S*)cmdBuf;
+
+       // Set Command Parameters
+       pCmd->cmdType = MSG_CMD_GET_FILTERLIST;
+
+       // Copy Cookie
+       memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
+
+       // Send Command to Messaging FW
+       char* pEventData = NULL;
+       AutoPtr<char> eventBuf(&pEventData);
+
+       write((char*)pCmd, cmdSize, &pEventData);
+
+       // Get Return Data
+       MSG_EVENT_S* pEvent = (MSG_EVENT_S*)pEventData;
+
+       if (pEvent->eventType != MSG_EVENT_GET_FILTERLIST)
+       {
+               THROW(MsgException::INVALID_RESULT, "Event Data Error");
+       }
+
+       if(pEvent->result != MSG_SUCCESS) return pEvent->result;
+
+       // Decode Return Data
+       MsgDecodeFilterList(pEvent->data, pFilterList);
+
+       return MSG_SUCCESS;
+}
+
+
+msg_error_t MsgHandle::setFilterOperation(bool bSetFlag)
+{
+       msg_error_t ret = MSG_SUCCESS;
+
+       // Allocate Memory to Command Data
+       int cmdSize = sizeof(MSG_CMD_S) + sizeof(bool);
+
+       char cmdBuf[cmdSize];
+       bzero(cmdBuf, cmdSize);
+       MSG_CMD_S* pCmd = (MSG_CMD_S*)cmdBuf;
+
+       // Set Command Parameters
+       pCmd->cmdType = MSG_CMD_SET_FILTER_OPERATION;
+
+       // Copy Cookie
+       memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
+
+       // Copy Command Data
+       memcpy(pCmd->cmdData, &bSetFlag, sizeof(bool));
+
+       // Send Command to Messaging FW
+       char* pEventData = NULL;
+       AutoPtr<char> eventBuf(&pEventData);
+
+       write((char*)pCmd, cmdSize, &pEventData);
+
+       // Get Return Data
+       MSG_EVENT_S* pEvent = (MSG_EVENT_S*)pEventData;
+
+       if (pEvent->eventType != MSG_EVENT_SET_FILTER_OPERATION)
+       {
+               THROW(MsgException::INVALID_RESULT, "Event Data Error");
+       }
+
+       ret = pEvent->result;
+
+       return ret;
+}
+
+
+msg_error_t MsgHandle::getFilterOperation(bool *pSetFlag)
+{
+       msg_error_t ret = MSG_SUCCESS;
+
+       // Allocate Memory to Command Data
+       int cmdSize = sizeof(MSG_CMD_S);
+
+       char cmdBuf[cmdSize];
+       bzero(cmdBuf, cmdSize);
+       MSG_CMD_S* pCmd = (MSG_CMD_S*)cmdBuf;
+
+       // Set Command Parameters
+       pCmd->cmdType = MSG_CMD_GET_FILTER_OPERATION;
+
+       // Copy Cookie
+       memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
+
+       // Send Command to Messaging FW
+       char* pEventData = NULL;
+       AutoPtr<char> eventBuf(&pEventData);
+
+       write((char*)pCmd, cmdSize, &pEventData);
+
+       // Get Return Data
+       MSG_EVENT_S* pEvent = (MSG_EVENT_S*)pEventData;
+
+       if (pEvent->eventType != MSG_EVENT_GET_FILTER_OPERATION)
+       {
+               THROW(MsgException::INVALID_RESULT, "Event Data Error");
+       }
+
+       ret = pEvent->result;
+
+       // Decode Return Data
+       if (ret == MSG_SUCCESS)
+       {
+               MsgDecodeFilterFlag(pEvent->data, pSetFlag);
+               MSG_DEBUG("Flag : %d", *pSetFlag);
+       }
+
+       return ret;
+}
+
index 14edb5c..7efb912 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include "MsgDebug.h"
 #include "MsgUtilFunction.h"
 #include "MsgHandle.h"
 
 
+#define MSG_TYPE_CHECK(a, b) \
+               ({\
+                       if(a != b) return MSG_ERR_INVALID_PARAMETER; \
+               })\
+
+#define MSG_NULL_CHECK(a) \
+               ({\
+                       if(a == NULL) return MSG_ERR_NULL_POINTER; \
+               })\
+
 /*==================================================================================================
                                      IMPLEMENTATION OF MsgHandle - Setting Member Functions
 ==================================================================================================*/
-MSG_ERROR_T MsgHandle::setConfig(const MSG_SETTING_S *pSetting)
+
+msg_error_t MsgHandle::getSMSCOption(msg_struct_t msg_struct)
+{
+       msg_struct_s *smsc_opt = (msg_struct_s *)msg_struct;
+       MSG_TYPE_CHECK(smsc_opt->type, MSG_STRUCT_SETTING_SMSC_OPT);
+       MSG_NULL_CHECK(smsc_opt->data);
+
+       // Allocate Memory to Command Data
+       int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_OPTION_TYPE_T);
+
+       char cmdBuf[cmdSize];
+       bzero(cmdBuf, cmdSize);
+       MSG_CMD_S* pCmd = (MSG_CMD_S*)cmdBuf;
+
+       // Set Command Parameters
+       pCmd->cmdType = MSG_CMD_GET_SMSC_OPT;
+
+       // Set option type
+       MSG_OPTION_TYPE_T opt_type = MSG_SMSC_LIST;
+
+       // Copy Cookie
+       memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
+
+       // Copy Command Data
+       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &opt_type, sizeof(MSG_OPTION_TYPE_T));
+
+       // Send Command to Messaging FW
+       char* pEventData = NULL;
+       AutoPtr<char> eventBuf(&pEventData);
+
+       write((char*)pCmd, cmdSize, &pEventData);
+
+       // Get Return Data
+       MSG_EVENT_S* pEvent = (MSG_EVENT_S*)pEventData;
+
+       if (pEvent->eventType != MSG_EVENT_GET_SMSC_OPT)
+       {
+               THROW(MsgException::INVALID_RESULT, "Event Data Error");
+       }
+
+       if (pEvent->result == MSG_SUCCESS) {
+               MSG_SMSC_LIST_S smsc_list_tmp = {0,};
+               int dataSize = 0;
+
+               dataSize = sizeof(MSG_SMSC_LIST_S);
+               memcpy(&smsc_list_tmp, pEvent->data, dataSize);
+
+               MSG_SMSC_LIST_HIDDEN_S *pTmp = (MSG_SMSC_LIST_HIDDEN_S *)smsc_opt->data;
+
+               pTmp->smsc_list->nCount = smsc_list_tmp.totalCnt;
+
+               msg_struct_s *pStructTmp = NULL;
+
+               for (int i = 0; i < pTmp->smsc_list->nCount; i++) {
+                       pStructTmp = (msg_struct_s *)pTmp->smsc_list->msg_struct_info[i];
+                       memset(pStructTmp->data, 0x00, sizeof(MSG_SMSC_DATA_S));
+                       memcpy(pStructTmp->data, &(smsc_list_tmp.smscData[i]), sizeof(MSG_SMSC_DATA_S));
+               }
+       }
+
+       return pEvent->result;
+}
+
+msg_error_t MsgHandle::setSMSCOption(msg_struct_t msg_struct)
+{
+       msg_struct_s *smsc_opt = (msg_struct_s *)msg_struct;
+       MSG_TYPE_CHECK(smsc_opt->type, MSG_STRUCT_SETTING_SMSC_OPT);
+       MSG_NULL_CHECK(smsc_opt->data);
+
+       // Allocate Memory to Command Data
+       MSG_OPTION_TYPE_T optionType = MSG_SMSC_LIST;
+       int cmdSize = getSettingCmdSize(optionType);
+
+       char cmdBuf[cmdSize];
+       bzero(cmdBuf, cmdSize);
+       MSG_CMD_S* pCmd = (MSG_CMD_S*)cmdBuf;
+       int i = 0;
+
+       msg_struct_s *pTmp = (msg_struct_s *)msg_struct;
+       MSG_SMSC_LIST_HIDDEN_S *pTmpList = (MSG_SMSC_LIST_HIDDEN_S *)pTmp->data;
+
+       MSG_SMSC_LIST_S smsc_list_tmp = {0,};
+
+       smsc_list_tmp.totalCnt = pTmpList->smsc_list->nCount;
+       smsc_list_tmp.selected = pTmpList->selected;
+
+       msg_struct_s *pStructTmp = NULL;
+
+       for (i=0; i < smsc_list_tmp.totalCnt; i++) {
+               pStructTmp = (msg_struct_s *)pTmpList->smsc_list->msg_struct_info[i];
+               MSG_TYPE_CHECK(pStructTmp->type, MSG_STRUCT_SETTING_SMSC_INFO);
+               memcpy(&(smsc_list_tmp.smscData[i]), pStructTmp->data, sizeof(MSG_SMSC_DATA_S));
+       }
+
+       // Set Command Parameters
+       pCmd->cmdType = MSG_CMD_SET_SMSC_OPT;
+
+    // Copy Cookie
+    memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
+
+       MSG_SETTING_S pSetting = {0,};
+
+       pSetting.type = optionType;
+       memcpy(&(pSetting.option), &smsc_list_tmp, sizeof(MSG_SMSC_LIST_S));
+
+    // Copy Command Data
+    memcpy(pCmd->cmdData, &pSetting, cmdSize-sizeof(MSG_CMD_S));
+
+       // Send Command to Messaging FW
+       char* pEventData = NULL;
+       AutoPtr<char> eventBuf(&pEventData);
+
+       write((char*)pCmd, cmdSize, &pEventData);
+
+       // Get Return Data
+       MSG_EVENT_S* pEvent = (MSG_EVENT_S*)pEventData;
+
+       if (pEvent->eventType != MSG_EVENT_SET_SMSC_OPT)
+       {
+               THROW(MsgException::INVALID_RESULT, "Event Data Error");
+       }
+
+       return pEvent->result;
+}
+
+msg_error_t MsgHandle::getCBOption(msg_struct_t msg_struct)
 {
+       msg_struct_s *cb_opt = (msg_struct_s *)msg_struct;
+       MSG_TYPE_CHECK(cb_opt->type, MSG_STRUCT_SETTING_CB_OPT);
+       MSG_NULL_CHECK(cb_opt->data);
+
        // Allocate Memory to Command Data
-       int cmdSize = getSettingCmdSize(pSetting->type);
+       int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_OPTION_TYPE_T);
 
        char cmdBuf[cmdSize];
        bzero(cmdBuf, cmdSize);
        MSG_CMD_S* pCmd = (MSG_CMD_S*)cmdBuf;
 
        // Set Command Parameters
-       pCmd->cmdType = MSG_CMD_SET_CONFIG;
+       pCmd->cmdType = MSG_CMD_GET_CB_OPT;
+
+       // Set option type
+       MSG_OPTION_TYPE_T opt_type = MSG_CBMSG_OPT;
 
        // Copy Cookie
        memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
 
        // Copy Command Data
-       memcpy(pCmd->cmdData, pSetting, cmdSize-sizeof(MSG_CMD_S));
+       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &opt_type, sizeof(MSG_OPTION_TYPE_T));
 
        // Send Command to Messaging FW
        char* pEventData = NULL;
@@ -51,17 +193,110 @@ MSG_ERROR_T MsgHandle::setConfig(const MSG_SETTING_S *pSetting)
        // Get Return Data
        MSG_EVENT_S* pEvent = (MSG_EVENT_S*)pEventData;
 
-       if (pEvent->eventType != MSG_EVENT_SET_CONFIG)
+       if (pEvent->eventType != MSG_EVENT_GET_CB_OPT)
        {
                THROW(MsgException::INVALID_RESULT, "Event Data Error");
        }
 
+       if (pEvent->result == MSG_SUCCESS) {
+               int i = 0;
+               MSG_CBMSG_OPT_S cb_opt_tmp = {0,};
+               memcpy(&cb_opt_tmp, pEvent->data, sizeof(MSG_CBMSG_OPT_S));
+
+               MSG_CBMSG_OPT_HIDDEN_S *pTmp = (MSG_CBMSG_OPT_HIDDEN_S *)cb_opt->data;
+               pTmp->bAllChannel = cb_opt_tmp.bAllChannel;
+               pTmp->bReceive = cb_opt_tmp.bReceive;
+               pTmp->maxSimCnt = cb_opt_tmp.maxSimCnt;
+
+               for (i = 0; i < CB_LANG_TYPE_MAX; i++)
+                       pTmp->bLanguage[i] = cb_opt_tmp.bLanguage[i];
+
+               pTmp->channelData->nCount = cb_opt_tmp.channelData.channelCnt;
+
+               msg_struct_s *pStructTmp = NULL;
+
+               for (i = 0; i < pTmp->channelData->nCount; i++) {
+                       pStructTmp = (msg_struct_s *)pTmp->channelData->msg_struct_info[i];
+                       memset(pStructTmp->data, 0x00, sizeof(MSG_CB_CHANNEL_INFO_S));
+                       memcpy(pStructTmp->data, &(cb_opt_tmp.channelData.channelInfo[i]), sizeof(MSG_CB_CHANNEL_INFO_S));
+               }
+       }
+
        return pEvent->result;
 }
 
+msg_error_t MsgHandle::setCBOption(msg_struct_t msg_struct)
+{
+       msg_struct_s *cb_opt = (msg_struct_s *)msg_struct;
+       MSG_TYPE_CHECK(cb_opt->type, MSG_STRUCT_SETTING_CB_OPT);
+       MSG_NULL_CHECK(cb_opt->data);
+
+       // Allocate Memory to Command Data
+       MSG_OPTION_TYPE_T optionType = MSG_CBMSG_OPT;
+       int cmdSize = getSettingCmdSize(optionType);
+
+       char cmdBuf[cmdSize];
+       bzero(cmdBuf, cmdSize);
+       MSG_CMD_S* pCmd = (MSG_CMD_S*)cmdBuf;
+       int i = 0;
+
+       // Set Command Parameters
+       pCmd->cmdType = MSG_CMD_SET_CB_OPT;
+
+       // Copy Cookie
+       memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
+
+       // Copy Command Data
+       MSG_CBMSG_OPT_S cb_opt_tmp = {0,};
+       MSG_CBMSG_OPT_HIDDEN_S *cb_msg_opt = (MSG_CBMSG_OPT_HIDDEN_S *)cb_opt->data;
+
+       cb_opt_tmp.bAllChannel = cb_msg_opt->bAllChannel;
+       cb_opt_tmp.bReceive = cb_msg_opt->bReceive;
+       cb_opt_tmp.maxSimCnt = cb_msg_opt->maxSimCnt;
+       for (int i = 0; i < CB_LANG_TYPE_MAX; i++)
+               cb_opt_tmp.bLanguage[i] = cb_msg_opt->bLanguage[i];
+
+       msg_struct_list_s *cb_ch_list = cb_msg_opt->channelData;
+       msg_struct_s *pStructTmp = NULL;
+
+       cb_opt_tmp.channelData.channelCnt = cb_ch_list->nCount;
+
+       for (i = 0; i < cb_opt_tmp.channelData.channelCnt; i++) {
+               pStructTmp = (msg_struct_s *)cb_ch_list->msg_struct_info[i];
+               memcpy(&(cb_opt_tmp.channelData.channelInfo[i]), &pStructTmp->data, sizeof(MSG_CB_CHANNEL_INFO_S));
+       }
+
+       MSG_SETTING_S pSetting = {0,};
+       pSetting.type = optionType;
+
+       memcpy(&(pSetting.option.cbMsgOpt), &cb_opt_tmp, sizeof(MSG_CBMSG_OPT_S));
+
+    // Copy Command Data
+    memcpy(pCmd->cmdData, &pSetting, cmdSize-sizeof(MSG_CMD_S));
+
+       // Send Command to Messaging FW
+       char* pEventData = NULL;
+       AutoPtr<char> eventBuf(&pEventData);
+
+       write((char*)pCmd, cmdSize, &pEventData);
+
+       // Get Return Data
+       MSG_EVENT_S* pEvent = (MSG_EVENT_S*)pEventData;
 
-MSG_ERROR_T MsgHandle::getConfig(MSG_SETTING_S *pSetting)
+       if (pEvent->eventType != MSG_EVENT_SET_CB_OPT)
+       {
+               THROW(MsgException::INVALID_RESULT, "Event Data Error");
+       }
+
+       return pEvent->result;
+}
+
+msg_error_t MsgHandle::getSmsSendOpt(msg_struct_t msg_struct)
 {
+       msg_struct_s *sms_send_opt = (msg_struct_s *)msg_struct;
+       MSG_TYPE_CHECK(sms_send_opt->type, MSG_STRUCT_SETTING_SMS_SEND_OPT);
+       MSG_NULL_CHECK(sms_send_opt->data);
+
        // Allocate Memory to Command Data
        int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_OPTION_TYPE_T);
 
@@ -70,32 +305,632 @@ MSG_ERROR_T MsgHandle::getConfig(MSG_SETTING_S *pSetting)
        MSG_CMD_S* pCmd = (MSG_CMD_S*)cmdBuf;
 
        // Set Command Parameters
-       pCmd->cmdType = MSG_CMD_GET_CONFIG;
+       pCmd->cmdType = MSG_CMD_GET_SMS_SEND_OPT;
+
+       // Set option type
+       MSG_OPTION_TYPE_T opt_type = MSG_SMS_SENDOPT;
+
+       // Copy Cookie
+       memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
+
+       // Copy Command Data
+       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &opt_type, sizeof(MSG_OPTION_TYPE_T));
+
+       // Send Command to Messaging FW
+       char* pEventData = NULL;
+       AutoPtr<char> eventBuf(&pEventData);
+
+       write((char*)pCmd, cmdSize, &pEventData);
+
+       // Get Return Data
+       MSG_EVENT_S* pEvent = (MSG_EVENT_S*)pEventData;
+
+       if (pEvent->eventType != MSG_EVENT_GET_SMS_SEND_OPT)
+       {
+               THROW(MsgException::INVALID_RESULT, "Event Data Error");
+       }
+
+       if (pEvent->result == MSG_SUCCESS) {
+               memcpy(sms_send_opt->data, pEvent->data, sizeof(MSG_SMS_SENDOPT_S));
+       }
+
+       return pEvent->result;
+}
+
+msg_error_t MsgHandle::setSmsSendOpt(msg_struct_t msg_struct)
+{
+       msg_struct_s *sms_send_opt = (msg_struct_s *)msg_struct;
+       MSG_TYPE_CHECK(sms_send_opt->type, MSG_STRUCT_SETTING_SMS_SEND_OPT);
+       MSG_NULL_CHECK(sms_send_opt->data);
+
+       // Allocate Memory to Command Data
+       MSG_OPTION_TYPE_T optionType = MSG_SMS_SENDOPT;
+       int cmdSize = getSettingCmdSize(optionType);
+
+       char cmdBuf[cmdSize];
+       bzero(cmdBuf, cmdSize);
+       MSG_CMD_S* pCmd = (MSG_CMD_S*)cmdBuf;
+
+       // Set Command Parameters
+       pCmd->cmdType = MSG_CMD_SET_SMS_SEND_OPT;
 
        // Copy Cookie
        memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
 
        // Copy Command Data
-       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &(pSetting->type), sizeof(MSG_OPTION_TYPE_T));
+       MSG_SETTING_S pSetting = {0,};
+       pSetting.type = optionType;
+
+       memcpy(&(pSetting.option.smsSendOpt), sms_send_opt->data, sizeof(MSG_SMS_SENDOPT_S));
+
+    // Copy Command Data
+    memcpy(pCmd->cmdData, &pSetting, cmdSize-sizeof(MSG_CMD_S));
 
        // Send Command to Messaging FW
        char* pEventData = NULL;
        AutoPtr<char> eventBuf(&pEventData);
 
+       write((char*)pCmd, cmdSize, &pEventData);
+
+       // Get Return Data
+       MSG_EVENT_S* pEvent = (MSG_EVENT_S*)pEventData;
+
+       if (pEvent->eventType != MSG_EVENT_SET_SMS_SEND_OPT)
+       {
+               THROW(MsgException::INVALID_RESULT, "Event Data Error");
+       }
+
+       return pEvent->result;
+}
+
+msg_error_t MsgHandle::getMmsSendOpt(msg_struct_t msg_struct)
+{
+       msg_struct_s *mms_send_opt = (msg_struct_s *)msg_struct;
+       MSG_TYPE_CHECK(mms_send_opt->type, MSG_STRUCT_SETTING_MMS_SEND_OPT);
+       MSG_NULL_CHECK(mms_send_opt->data);
+
+       // Allocate Memory to Command Data
+       int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_OPTION_TYPE_T);
+
+       char cmdBuf[cmdSize];
+       bzero(cmdBuf, cmdSize);
+       MSG_CMD_S* pCmd = (MSG_CMD_S*)cmdBuf;
+
+       // Set Command Parameters
+       pCmd->cmdType = MSG_CMD_GET_MMS_SEND_OPT;
+
+       // Set option type
+       MSG_OPTION_TYPE_T opt_type = MSG_MMS_SENDOPT;
+
+       // Copy Cookie
+       memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
+
+       // Copy Command Data
+       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &opt_type, sizeof(MSG_OPTION_TYPE_T));
+
+       // Send Command to Messaging FW
+       char* pEventData = NULL;
+       AutoPtr<char> eventBuf(&pEventData);
 
        write((char*)pCmd, cmdSize, &pEventData);
 
        // Get Return Data
        MSG_EVENT_S* pEvent = (MSG_EVENT_S*)pEventData;
 
-       if (pEvent->eventType != MSG_EVENT_GET_CONFIG)
+       if (pEvent->eventType != MSG_EVENT_GET_MMS_SEND_OPT)
        {
                THROW(MsgException::INVALID_RESULT, "Event Data Error");
        }
 
-       if (pEvent->result == MSG_SUCCESS)
-               MsgDecodeSetting(pEvent->data, pSetting);
+       if (pEvent->result == MSG_SUCCESS) {
+               memcpy(mms_send_opt->data, pEvent->data, sizeof(MSG_MMS_SENDOPT_S));
+       }
+
+       return pEvent->result;
+}
+
+msg_error_t MsgHandle::setMmsSendOpt(msg_struct_t msg_struct)
+{
+       msg_struct_s *mms_send_opt = (msg_struct_s *)msg_struct;
+       MSG_TYPE_CHECK(mms_send_opt->type, MSG_STRUCT_SETTING_MMS_SEND_OPT);
+       MSG_NULL_CHECK(mms_send_opt->data);
+
+       // Allocate Memory to Command Data
+       MSG_OPTION_TYPE_T optionType = MSG_MMS_SENDOPT;
+       int cmdSize = getSettingCmdSize(optionType);
+
+       char cmdBuf[cmdSize];
+       bzero(cmdBuf, cmdSize);
+       MSG_CMD_S* pCmd = (MSG_CMD_S*)cmdBuf;
+
+       // Set Command Parameters
+       pCmd->cmdType = MSG_CMD_SET_MMS_SEND_OPT;
+
+       // Copy Cookie
+       memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
+
+       // Copy Command Data
+       MSG_SETTING_S pSetting = {0,};
+       pSetting.type = optionType;
+
+       memcpy(&(pSetting.option.mmsSendOpt), mms_send_opt->data, sizeof(MSG_MMS_SENDOPT_S));
+
+    // Copy Command Data
+    memcpy(pCmd->cmdData, &pSetting, cmdSize-sizeof(MSG_CMD_S));
+
+       // Send Command to Messaging FW
+       char* pEventData = NULL;
+       AutoPtr<char> eventBuf(&pEventData);
+
+       write((char*)pCmd, cmdSize, &pEventData);
+
+       // Get Return Data
+       MSG_EVENT_S* pEvent = (MSG_EVENT_S*)pEventData;
+
+       if (pEvent->eventType != MSG_EVENT_SET_MMS_SEND_OPT)
+       {
+               THROW(MsgException::INVALID_RESULT, "Event Data Error");
+       }
 
        return pEvent->result;
 }
 
+msg_error_t MsgHandle::getMmsRecvOpt(msg_struct_t msg_struct)
+{
+       msg_struct_s *mms_recv_opt = (msg_struct_s *)msg_struct;
+       MSG_TYPE_CHECK(mms_recv_opt->type, MSG_STRUCT_SETTING_MMS_RECV_OPT);
+       MSG_NULL_CHECK(mms_recv_opt->data);
+
+       // Allocate Memory to Command Data
+       int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_OPTION_TYPE_T);
+
+       char cmdBuf[cmdSize];
+       bzero(cmdBuf, cmdSize);
+       MSG_CMD_S* pCmd = (MSG_CMD_S*)cmdBuf;
+
+       // Set Command Parameters
+       pCmd->cmdType = MSG_CMD_GET_MMS_RECV_OPT;
+
+       // Set option type
+       MSG_OPTION_TYPE_T opt_type = MSG_MMS_RECVOPT;
+
+       // Copy Cookie
+       memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
+
+       // Copy Command Data
+       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &opt_type, sizeof(MSG_OPTION_TYPE_T));
+
+       // Send Command to Messaging FW
+       char* pEventData = NULL;
+       AutoPtr<char> eventBuf(&pEventData);
+
+       write((char*)pCmd, cmdSize, &pEventData);
+
+       // Get Return Data
+       MSG_EVENT_S* pEvent = (MSG_EVENT_S*)pEventData;
+
+       if (pEvent->eventType != MSG_EVENT_GET_MMS_RECV_OPT)
+       {
+               THROW(MsgException::INVALID_RESULT, "Event Data Error");
+       }
+
+       if (pEvent->result == MSG_SUCCESS) {
+               memcpy(mms_recv_opt->data, pEvent->data, sizeof(MSG_MMS_RECVOPT_S));
+       }
+
+       return pEvent->result;
+}
+
+msg_error_t MsgHandle::setMmsRecvOpt(msg_struct_t msg_struct)
+{
+       msg_struct_s *mms_recv_opt = (msg_struct_s *)msg_struct;
+       MSG_TYPE_CHECK(mms_recv_opt->type, MSG_STRUCT_SETTING_MMS_RECV_OPT);
+       MSG_NULL_CHECK(mms_recv_opt->data);
+
+       // Allocate Memory to Command Data
+       MSG_OPTION_TYPE_T optionType = MSG_MMS_RECVOPT;
+       int cmdSize = getSettingCmdSize(optionType);
+
+       char cmdBuf[cmdSize];
+       bzero(cmdBuf, cmdSize);
+       MSG_CMD_S* pCmd = (MSG_CMD_S*)cmdBuf;
+
+       // Set Command Parameters
+       pCmd->cmdType = MSG_CMD_SET_MMS_RECV_OPT;
+
+       // Copy Cookie
+       memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
+
+       // Copy Command Data
+       MSG_SETTING_S pSetting = {0,};
+       pSetting.type = optionType;
+
+       memcpy(&(pSetting.option.mmsRecvOpt), mms_recv_opt->data, sizeof(MSG_MMS_RECVOPT_S));
+
+    // Copy Command Data
+    memcpy(pCmd->cmdData, &pSetting, cmdSize-sizeof(MSG_CMD_S));
+
+       // Send Command to Messaging FW
+       char* pEventData = NULL;
+       AutoPtr<char> eventBuf(&pEventData);
+
+       write((char*)pCmd, cmdSize, &pEventData);
+
+       // Get Return Data
+       MSG_EVENT_S* pEvent = (MSG_EVENT_S*)pEventData;
+
+       if (pEvent->eventType != MSG_EVENT_SET_MMS_RECV_OPT)
+       {
+               THROW(MsgException::INVALID_RESULT, "Event Data Error");
+       }
+
+       return pEvent->result;
+}
+
+msg_error_t MsgHandle::getPushMsgOpt(msg_struct_t msg_struct)
+{
+       msg_struct_s *push_opt = (msg_struct_s *)msg_struct;
+       MSG_TYPE_CHECK(push_opt->type, MSG_STRUCT_SETTING_PUSH_MSG_OPT);
+       MSG_NULL_CHECK(push_opt->data);
+
+       // Allocate Memory to Command Data
+       int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_OPTION_TYPE_T);
+
+       char cmdBuf[cmdSize];
+       bzero(cmdBuf, cmdSize);
+       MSG_CMD_S* pCmd = (MSG_CMD_S*)cmdBuf;
+
+       // Set Command Parameters
+       pCmd->cmdType = MSG_CMD_GET_PUSH_MSG_OPT;
+
+       // Set option type
+       MSG_OPTION_TYPE_T opt_type = MSG_PUSHMSG_OPT;
+
+       // Copy Cookie
+       memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
+
+       // Copy Command Data
+       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &opt_type, sizeof(MSG_OPTION_TYPE_T));
+
+       // Send Command to Messaging FW
+       char* pEventData = NULL;
+       AutoPtr<char> eventBuf(&pEventData);
+
+       write((char*)pCmd, cmdSize, &pEventData);
+
+       // Get Return Data
+       MSG_EVENT_S* pEvent = (MSG_EVENT_S*)pEventData;
+
+       if (pEvent->eventType != MSG_EVENT_GET_PUSH_MSG_OPT)
+       {
+               THROW(MsgException::INVALID_RESULT, "Event Data Error");
+       }
+
+       if (pEvent->result == MSG_SUCCESS) {
+               memcpy(push_opt->data, pEvent->data, sizeof(MSG_PUSHMSG_OPT_S));
+       }
+
+       return pEvent->result;
+}
+
+msg_error_t MsgHandle::setPushMsgOpt(msg_struct_t msg_struct)
+{
+       msg_struct_s *push_opt = (msg_struct_s *)msg_struct;
+       MSG_TYPE_CHECK(push_opt->type, MSG_STRUCT_SETTING_PUSH_MSG_OPT);
+       MSG_NULL_CHECK(push_opt->data);
+
+       // Allocate Memory to Command Data
+       MSG_OPTION_TYPE_T optionType = MSG_PUSHMSG_OPT;
+       int cmdSize = getSettingCmdSize(optionType);
+
+       char cmdBuf[cmdSize];
+       bzero(cmdBuf, cmdSize);
+       MSG_CMD_S* pCmd = (MSG_CMD_S*)cmdBuf;
+
+       // Set Command Parameters
+       pCmd->cmdType = MSG_CMD_SET_PUSH_MSG_OPT;
+
+       // Copy Cookie
+       memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
+
+       // Copy Command Data
+       MSG_SETTING_S pSetting = {0,};
+       pSetting.type = optionType;
+
+       memcpy(&(pSetting.option.pushMsgOpt), push_opt->data, sizeof(MSG_PUSHMSG_OPT_S));
+
+    // Copy Command Data
+    memcpy(pCmd->cmdData, &pSetting, cmdSize-sizeof(MSG_CMD_S));
+
+       // Send Command to Messaging FW
+       char* pEventData = NULL;
+       AutoPtr<char> eventBuf(&pEventData);
+
+       write((char*)pCmd, cmdSize, &pEventData);
+
+       // Get Return Data
+       MSG_EVENT_S* pEvent = (MSG_EVENT_S*)pEventData;
+
+       if (pEvent->eventType != MSG_EVENT_SET_PUSH_MSG_OPT)
+       {
+               THROW(MsgException::INVALID_RESULT, "Event Data Error");
+       }
+
+       return pEvent->result;
+}
+
+msg_error_t MsgHandle::getVoiceMsgOpt(msg_struct_t msg_struct)
+{
+       msg_struct_s *voice_opt = (msg_struct_s *)msg_struct;
+       MSG_TYPE_CHECK(voice_opt->type, MSG_STRUCT_SETTING_VOICE_MSG_OPT);
+       MSG_NULL_CHECK(voice_opt->data);
+
+       // Allocate Memory to Command Data
+       int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_OPTION_TYPE_T);
+
+       char cmdBuf[cmdSize];
+       bzero(cmdBuf, cmdSize);
+       MSG_CMD_S* pCmd = (MSG_CMD_S*)cmdBuf;
+
+       // Set Command Parameters
+       pCmd->cmdType = MSG_CMD_GET_VOICE_MSG_OPT;
+
+       // Set option type
+       MSG_OPTION_TYPE_T opt_type = MSG_VOICEMAIL_OPT;
+
+       // Copy Cookie
+       memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
+
+       // Copy Command Data
+       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &opt_type, sizeof(MSG_OPTION_TYPE_T));
+
+       // Send Command to Messaging FW
+       char* pEventData = NULL;
+       AutoPtr<char> eventBuf(&pEventData);
+
+       write((char*)pCmd, cmdSize, &pEventData);
+
+       // Get Return Data
+       MSG_EVENT_S* pEvent = (MSG_EVENT_S*)pEventData;
+
+       if (pEvent->eventType != MSG_EVENT_GET_VOICE_MSG_OPT)
+       {
+               THROW(MsgException::INVALID_RESULT, "Event Data Error");
+       }
+
+       if (pEvent->result == MSG_SUCCESS) {
+               memcpy(voice_opt->data, pEvent->data, sizeof(MSG_VOICEMAIL_OPT_S));
+       }
+
+       return pEvent->result;
+}
+
+msg_error_t MsgHandle::setVoiceMsgOpt(msg_struct_t msg_struct)
+{
+       msg_struct_s *voice_opt = (msg_struct_s *)msg_struct;
+       MSG_TYPE_CHECK(voice_opt->type, MSG_STRUCT_SETTING_VOICE_MSG_OPT);
+       MSG_NULL_CHECK(voice_opt->data);
+
+       // Allocate Memory to Command Data
+       MSG_OPTION_TYPE_T optionType = MSG_VOICEMAIL_OPT;
+       int cmdSize = getSettingCmdSize(optionType);
+
+       char cmdBuf[cmdSize];
+       bzero(cmdBuf, cmdSize);
+       MSG_CMD_S* pCmd = (MSG_CMD_S*)cmdBuf;
+
+       // Set Command Parameters
+       pCmd->cmdType = MSG_CMD_SET_VOICE_MSG_OPT;
+
+       // Copy Cookie
+       memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
+
+       // Copy Command Data
+       MSG_SETTING_S pSetting = {0,};
+       pSetting.type = optionType;
+
+       memcpy(&(pSetting.option.voiceMailOpt), voice_opt->data, sizeof(MSG_VOICEMAIL_OPT_S));
+
+    // Copy Command Data
+    memcpy(pCmd->cmdData, &pSetting, cmdSize-sizeof(MSG_CMD_S));
+
+       // Send Command to Messaging FW
+       char* pEventData = NULL;
+       AutoPtr<char> eventBuf(&pEventData);
+
+       write((char*)pCmd, cmdSize, &pEventData);
+
+       // Get Return Data
+       MSG_EVENT_S* pEvent = (MSG_EVENT_S*)pEventData;
+
+       if (pEvent->eventType != MSG_EVENT_SET_VOICE_MSG_OPT)
+       {
+               THROW(MsgException::INVALID_RESULT, "Event Data Error");
+       }
+
+       return pEvent->result;
+}
+
+msg_error_t MsgHandle::getGeneralOpt(msg_struct_t msg_struct)
+{
+       msg_struct_s *general_opt = (msg_struct_s *)msg_struct;
+       MSG_TYPE_CHECK(general_opt->type, MSG_STRUCT_SETTING_GENERAL_OPT);
+       MSG_NULL_CHECK(general_opt->data);
+
+       // Allocate Memory to Command Data
+       int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_OPTION_TYPE_T);
+
+       char cmdBuf[cmdSize];
+       bzero(cmdBuf, cmdSize);
+       MSG_CMD_S* pCmd = (MSG_CMD_S*)cmdBuf;
+
+       // Set Command Parameters
+       pCmd->cmdType = MSG_CMD_GET_GENERAL_MSG_OPT;
+
+       // Set option type
+       MSG_OPTION_TYPE_T opt_type = MSG_GENERAL_OPT;
+
+       // Copy Cookie
+       memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
+
+       // Copy Command Data
+       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &opt_type, sizeof(MSG_OPTION_TYPE_T));
+
+       // Send Command to Messaging FW
+       char* pEventData = NULL;
+       AutoPtr<char> eventBuf(&pEventData);
+
+       write((char*)pCmd, cmdSize, &pEventData);
+
+       // Get Return Data
+       MSG_EVENT_S* pEvent = (MSG_EVENT_S*)pEventData;
+
+       if (pEvent->eventType != MSG_EVENT_GET_GENERAL_MSG_OPT)
+       {
+               THROW(MsgException::INVALID_RESULT, "Event Data Error");
+       }
+
+       if (pEvent->result == MSG_SUCCESS) {
+               memcpy(general_opt->data, pEvent->data, sizeof(MSG_GENERAL_OPT_S));
+       }
+
+       return pEvent->result;
+}
+
+msg_error_t MsgHandle::setGeneralOpt(msg_struct_t msg_struct)
+{
+       msg_struct_s *general_opt = (msg_struct_s *)msg_struct;
+       MSG_TYPE_CHECK(general_opt->type, MSG_STRUCT_SETTING_GENERAL_OPT);
+       MSG_NULL_CHECK(general_opt->data);
+
+       // Allocate Memory to Command Data
+       MSG_OPTION_TYPE_T optionType = MSG_GENERAL_OPT;
+       int cmdSize = getSettingCmdSize(optionType);
+
+       char cmdBuf[cmdSize];
+       bzero(cmdBuf, cmdSize);
+       MSG_CMD_S* pCmd = (MSG_CMD_S*)cmdBuf;
+
+       // Set Command Parameters
+       pCmd->cmdType = MSG_CMD_SET_GENERAL_MSG_OPT;
+
+       // Copy Cookie
+       memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
+
+       // Copy Command Data
+       MSG_SETTING_S pSetting = {0,};
+       pSetting.type = optionType;
+
+       memcpy(&(pSetting.option.generalOpt), general_opt->data, sizeof(MSG_GENERAL_OPT_S));
+
+    // Copy Command Data
+    memcpy(pCmd->cmdData, &pSetting, cmdSize-sizeof(MSG_CMD_S));
+
+       // Send Command to Messaging FW
+       char* pEventData = NULL;
+       AutoPtr<char> eventBuf(&pEventData);
+
+       write((char*)pCmd, cmdSize, &pEventData);
+
+       // Get Return Data
+       MSG_EVENT_S* pEvent = (MSG_EVENT_S*)pEventData;
+
+       if (pEvent->eventType != MSG_EVENT_SET_GENERAL_MSG_OPT)
+       {
+               THROW(MsgException::INVALID_RESULT, "Event Data Error");
+       }
+
+       return pEvent->result;
+}
+
+msg_error_t MsgHandle::getMsgSizeOpt(msg_struct_t msg_struct)
+{
+       msg_struct_s *msg_size_opt = (msg_struct_s *)msg_struct;
+       MSG_TYPE_CHECK(msg_size_opt->type, MSG_STRUCT_SETTING_MSGSIZE_OPT);
+       MSG_NULL_CHECK(msg_size_opt->data);
+
+       // Allocate Memory to Command Data
+       int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_OPTION_TYPE_T);
+
+       char cmdBuf[cmdSize];
+       bzero(cmdBuf, cmdSize);
+       MSG_CMD_S* pCmd = (MSG_CMD_S*)cmdBuf;
+
+       // Set Command Parameters
+       pCmd->cmdType = MSG_CMD_GET_MSG_SIZE_OPT;
+
+       // Set option type
+       MSG_OPTION_TYPE_T opt_type = MSG_MSGSIZE_OPT;
+
+       // Copy Cookie
+       memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
+
+       // Copy Command Data
+       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &opt_type, sizeof(MSG_OPTION_TYPE_T));
+
+       // Send Command to Messaging FW
+       char* pEventData = NULL;
+       AutoPtr<char> eventBuf(&pEventData);
+
+       write((char*)pCmd, cmdSize, &pEventData);
+
+       // Get Return Data
+       MSG_EVENT_S* pEvent = (MSG_EVENT_S*)pEventData;
+
+       if (pEvent->eventType != MSG_EVENT_GET_MSG_SIZE_OPT)
+       {
+               THROW(MsgException::INVALID_RESULT, "Event Data Error");
+       }
+
+       if (pEvent->result == MSG_SUCCESS) {
+               memcpy(msg_size_opt->data, pEvent->data, sizeof(MSG_MSGSIZE_OPT_S));
+       }
+
+       return pEvent->result;
+}
+
+msg_error_t MsgHandle::setMsgSizeOpt(msg_struct_t msg_struct)
+{
+       msg_struct_s *msg_size_opt = (msg_struct_s *)msg_struct;
+       MSG_TYPE_CHECK(msg_size_opt->type, MSG_STRUCT_SETTING_MSGSIZE_OPT);
+       MSG_NULL_CHECK(msg_size_opt->data);
+
+       // Allocate Memory to Command Data
+       MSG_OPTION_TYPE_T optionType = MSG_MSGSIZE_OPT;
+       int cmdSize = getSettingCmdSize(optionType);
+
+       char cmdBuf[cmdSize];
+       bzero(cmdBuf, cmdSize);
+       MSG_CMD_S* pCmd = (MSG_CMD_S*)cmdBuf;
+
+       // Set Command Parameters
+       pCmd->cmdType = MSG_CMD_SET_MSG_SIZE_OPT;
+
+       // Copy Cookie
+       memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
+
+       // Copy Command Data
+       MSG_SETTING_S pSetting = {0,};
+       pSetting.type = optionType;
+
+       memcpy(&(pSetting.option.msgSizeOpt), msg_size_opt->data, sizeof(MSG_MSGSIZE_OPT_S));
+
+    // Copy Command Data
+    memcpy(pCmd->cmdData, &pSetting, cmdSize-sizeof(MSG_CMD_S));
+
+       // Send Command to Messaging FW
+       char* pEventData = NULL;
+       AutoPtr<char> eventBuf(&pEventData);
+
+       write((char*)pCmd, cmdSize, &pEventData);
+
+       // Get Return Data
+       MSG_EVENT_S* pEvent = (MSG_EVENT_S*)pEventData;
+
+       if (pEvent->eventType != MSG_EVENT_SET_MSG_SIZE_OPT)
+       {
+               THROW(MsgException::INVALID_RESULT, "Event Data Error");
+       }
+
+       return pEvent->result;
+}
index 5af0dc8..5f72126 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include "MsgDebug.h"
 #include "MsgUtilFile.h"
@@ -28,7 +28,7 @@
 /*==================================================================================================
                                      IMPLEMENTATION OF MsgHandle - Storage Member Functions
 ==================================================================================================*/
-int MsgHandle::addMessage(const MSG_MESSAGE_S *pMsg, const MSG_SENDINGOPT_S *pSendOpt)
+int MsgHandle::addMessage(MSG_MESSAGE_HIDDEN_S *pMsg, const MSG_SENDINGOPT_S *pSendOpt)
 {
        MSG_MESSAGE_INFO_S msgInfo = {0};
        MSG_SENDINGOPT_INFO_S sendOptInfo;
@@ -37,7 +37,13 @@ int MsgHandle::addMessage(const MSG_MESSAGE_S *pMsg, const MSG_SENDINGOPT_S *pSe
        convertMsgStruct(pMsg, &msgInfo);
 
        // Covert MSG_SENDINGOPT_S to MSG_SENDINGOPT_INFO_S
-       convertSendOptStruct(pSendOpt, &sendOptInfo, pMsg->msgType);
+       MSG_MESSAGE_TYPE_S msgType = {0,};
+
+       msgType.mainType = pMsg->mainType;
+       msgType.subType = pMsg->subType;
+       msgType.classType = pMsg->classType;
+
+       convertSendOptStruct(pSendOpt, &sendOptInfo, msgType);
 
        // Allocate Memory to Command Data
        int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_MESSAGE_INFO_S) + sizeof(MSG_SENDINGOPT_INFO_S);
@@ -72,7 +78,7 @@ int MsgHandle::addMessage(const MSG_MESSAGE_S *pMsg, const MSG_SENDINGOPT_S *pSe
 
        if (pEvent->result != MSG_SUCCESS) return pEvent->result;
 
-       MSG_MESSAGE_ID_T msgId = 0;
+       msg_message_id_t msgId = 0;
 
        // Decode Return Data
        MsgDecodeMsgId(pEvent->data, &msgId);
@@ -81,12 +87,13 @@ int MsgHandle::addMessage(const MSG_MESSAGE_S *pMsg, const MSG_SENDINGOPT_S *pSe
 }
 
 
-MSG_ERROR_T MsgHandle::addSyncMLMessage(const MSG_SYNCML_MESSAGE_S *pSyncMLMsg)
+msg_error_t MsgHandle::addSyncMLMessage(const MSG_SYNCML_MESSAGE_S *pSyncMLMsg)
 {
        MSG_MESSAGE_INFO_S msgInfo;
 
        // Covert MSG_MESSAGE_S to MSG_MESSAGE_INFO_S
-       convertMsgStruct((MSG_MESSAGE_S*)pSyncMLMsg->msg, &msgInfo);
+       msg_struct_s *msg = (msg_struct_s *)pSyncMLMsg->msg;
+       convertMsgStruct((MSG_MESSAGE_HIDDEN_S *)msg->data, &msgInfo);
 
        // Allocate Memory to Command Data
        int cmdSize = sizeof(MSG_CMD_S) + sizeof(int) + sizeof(int) + sizeof(MSG_MESSAGE_INFO_S);
@@ -125,7 +132,7 @@ MSG_ERROR_T MsgHandle::addSyncMLMessage(const MSG_SYNCML_MESSAGE_S *pSyncMLMsg)
 }
 
 
-MSG_ERROR_T MsgHandle::updateMessage(const MSG_MESSAGE_S *pMsg, const MSG_SENDINGOPT_S *pSendOpt)
+msg_error_t MsgHandle::updateMessage(const MSG_MESSAGE_HIDDEN_S *pMsg, const MSG_SENDINGOPT_S *pSendOpt)
 {
        MSG_MESSAGE_INFO_S msgInfo;
        MSG_SENDINGOPT_INFO_S sendOptInfo;
@@ -133,8 +140,15 @@ MSG_ERROR_T MsgHandle::updateMessage(const MSG_MESSAGE_S *pMsg, const MSG_SENDIN
        // Covert MSG_MESSAGE_S to MSG_MESSAGE_INFO_S
        convertMsgStruct(pMsg, &msgInfo);
 
-       if(pSendOpt != NULL)
-               convertSendOptStruct(pSendOpt, &sendOptInfo, pMsg->msgType);
+       if(pSendOpt != NULL) {
+               MSG_MESSAGE_TYPE_S msgType = {0,};
+
+               msgType.mainType = pMsg->mainType;
+               msgType.subType = pMsg->subType;
+               msgType.classType = pMsg->classType;
+
+               convertSendOptStruct(pSendOpt, &sendOptInfo, msgType);
+       }
 
        // Allocate Memory to Command Data
        int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_MESSAGE_INFO_S) + sizeof(MSG_SENDINGOPT_INFO_S);
@@ -172,10 +186,10 @@ MSG_ERROR_T MsgHandle::updateMessage(const MSG_MESSAGE_S *pMsg, const MSG_SENDIN
 }
 
 
-MSG_ERROR_T MsgHandle::updateReadStatus(MSG_MESSAGE_ID_T MsgId, bool bRead)
+msg_error_t MsgHandle::updateReadStatus(msg_message_id_t MsgId, bool bRead)
 {
        // Allocate Memory to Command Data
-       int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_MESSAGE_ID_T) + sizeof(bool);
+       int cmdSize = sizeof(MSG_CMD_S) + sizeof(msg_message_id_t) + sizeof(bool);
 
        char cmdBuf[cmdSize];
        bzero(cmdBuf, cmdSize);
@@ -188,8 +202,8 @@ MSG_ERROR_T MsgHandle::updateReadStatus(MSG_MESSAGE_ID_T MsgId, bool bRead)
        memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
 
        // Copy Command Data
-       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &MsgId, sizeof(MSG_MESSAGE_ID_T));
-       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN+sizeof(MSG_MESSAGE_ID_T)), &bRead, sizeof(bool));
+       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &MsgId, sizeof(msg_message_id_t));
+       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN+sizeof(msg_message_id_t)), &bRead, sizeof(bool));
 
        // Send Command to Messaging FW
        char* pEventData = NULL;
@@ -210,10 +224,10 @@ MSG_ERROR_T MsgHandle::updateReadStatus(MSG_MESSAGE_ID_T MsgId, bool bRead)
 }
 
 
-MSG_ERROR_T MsgHandle::updateProtectedStatus(MSG_MESSAGE_ID_T MsgId, bool bProtected)
+msg_error_t MsgHandle::updateProtectedStatus(msg_message_id_t MsgId, bool bProtected)
 {
        // Allocate Memory to Command Data
-       int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_MESSAGE_ID_T) + sizeof(bool);
+       int cmdSize = sizeof(MSG_CMD_S) + sizeof(msg_message_id_t) + sizeof(bool);
 
        char cmdBuf[cmdSize];
        bzero(cmdBuf, cmdSize);
@@ -226,8 +240,8 @@ MSG_ERROR_T MsgHandle::updateProtectedStatus(MSG_MESSAGE_ID_T MsgId, bool bProte
        memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
 
        // Copy Command Data
-       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &MsgId, sizeof(MSG_MESSAGE_ID_T));
-       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN+sizeof(MSG_MESSAGE_ID_T)), &bProtected, sizeof(bool));
+       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &MsgId, sizeof(msg_message_id_t));
+       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN+sizeof(msg_message_id_t)), &bProtected, sizeof(bool));
 
        // Send Command to Messaging FW
        char* pEventData = NULL;
@@ -248,10 +262,10 @@ MSG_ERROR_T MsgHandle::updateProtectedStatus(MSG_MESSAGE_ID_T MsgId, bool bProte
 }
 
 
-MSG_ERROR_T MsgHandle::deleteMessage(MSG_MESSAGE_ID_T MsgId)
+msg_error_t MsgHandle::deleteMessage(msg_message_id_t MsgId)
 {
        // Allocate Memory to Command Data
-       int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_MESSAGE_ID_T);
+       int cmdSize = sizeof(MSG_CMD_S) + sizeof(msg_message_id_t);
 
        char cmdBuf[cmdSize];
        bzero(cmdBuf, cmdSize);
@@ -264,7 +278,7 @@ MSG_ERROR_T MsgHandle::deleteMessage(MSG_MESSAGE_ID_T MsgId)
        memcpy((void*)pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
 
        // Copy Command Data
-       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &MsgId, sizeof(MSG_MESSAGE_ID_T));
+       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &MsgId, sizeof(msg_message_id_t));
 
        // Send Command to Messaging FW
        char* pEventData = NULL;
@@ -285,10 +299,10 @@ MSG_ERROR_T MsgHandle::deleteMessage(MSG_MESSAGE_ID_T MsgId)
 }
 
 
-MSG_ERROR_T MsgHandle::deleteAllMessagesInFolder(MSG_FOLDER_ID_T FolderId, bool bOnlyDB)
+msg_error_t MsgHandle::deleteAllMessagesInFolder(msg_folder_id_t FolderId, bool bOnlyDB)
 {
        // Allocate Memory to Command Data
-       int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_FOLDER_ID_T);
+       int cmdSize = sizeof(MSG_CMD_S) + sizeof(msg_folder_id_t);
 
        char cmdBuf[cmdSize];
        bzero(cmdBuf, cmdSize);
@@ -301,8 +315,8 @@ MSG_ERROR_T MsgHandle::deleteAllMessagesInFolder(MSG_FOLDER_ID_T FolderId, bool
        memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
 
        // Copy Command Data
-       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &FolderId, sizeof(MSG_FOLDER_ID_T));
-       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN+sizeof(MSG_FOLDER_ID_T)), &bOnlyDB, sizeof(bool));
+       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &FolderId, sizeof(msg_folder_id_t));
+       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN+sizeof(msg_folder_id_t)), &bOnlyDB, sizeof(bool));
 
        // Send Command to Messaging FW
        char* pEventData = NULL;
@@ -323,10 +337,10 @@ MSG_ERROR_T MsgHandle::deleteAllMessagesInFolder(MSG_FOLDER_ID_T FolderId, bool
 }
 
 
-MSG_ERROR_T MsgHandle::moveMessageToFolder(MSG_MESSAGE_ID_T MsgId, MSG_FOLDER_ID_T DestFolderId)
+msg_error_t MsgHandle::moveMessageToFolder(msg_message_id_t MsgId, msg_folder_id_t DestFolderId)
 {
        // Allocate Memory to Command Data
-       int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_MESSAGE_ID_T) + sizeof(MSG_FOLDER_ID_T);
+       int cmdSize = sizeof(MSG_CMD_S) + sizeof(msg_message_id_t) + sizeof(msg_folder_id_t);
 
        char cmdBuf[cmdSize];
        bzero(cmdBuf, cmdSize);
@@ -339,8 +353,8 @@ MSG_ERROR_T MsgHandle::moveMessageToFolder(MSG_MESSAGE_ID_T MsgId, MSG_FOLDER_ID
        memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
 
        // Copy Command Data
-       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &MsgId, sizeof(MSG_MESSAGE_ID_T));
-       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+sizeof(MSG_MESSAGE_ID_T)+MAX_COOKIE_LEN), &DestFolderId, sizeof(MSG_FOLDER_ID_T));
+       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &MsgId, sizeof(msg_message_id_t));
+       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+sizeof(msg_message_id_t)+MAX_COOKIE_LEN), &DestFolderId, sizeof(msg_folder_id_t));
 
        // Send Command to Messaging FW
        char* pEventData = NULL;
@@ -361,10 +375,10 @@ MSG_ERROR_T MsgHandle::moveMessageToFolder(MSG_MESSAGE_ID_T MsgId, MSG_FOLDER_ID
 }
 
 
-MSG_ERROR_T MsgHandle::moveMessageToStorage(MSG_MESSAGE_ID_T MsgId, MSG_STORAGE_ID_T DestStorageId)
+msg_error_t MsgHandle::moveMessageToStorage(msg_message_id_t MsgId, msg_storage_id_t DestStorageId)
 {
        // Allocate Memory to Command Data
-       int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_MESSAGE_ID_T) + sizeof(MSG_STORAGE_ID_T);
+       int cmdSize = sizeof(MSG_CMD_S) + sizeof(msg_message_id_t) + sizeof(msg_storage_id_t);
 
        char cmdBuf[cmdSize];
        bzero(cmdBuf, cmdSize);
@@ -377,8 +391,8 @@ MSG_ERROR_T MsgHandle::moveMessageToStorage(MSG_MESSAGE_ID_T MsgId, MSG_STORAGE_
        memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
 
        // Copy Command Data
-       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &MsgId, sizeof(MSG_MESSAGE_ID_T));
-       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN+sizeof(MSG_MESSAGE_ID_T)), &DestStorageId, sizeof(MSG_STORAGE_ID_T));
+       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &MsgId, sizeof(msg_message_id_t));
+       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN+sizeof(msg_message_id_t)), &DestStorageId, sizeof(msg_storage_id_t));
 
        // Send Command to Messaging FW
        char* pEventData = NULL;
@@ -399,10 +413,10 @@ MSG_ERROR_T MsgHandle::moveMessageToStorage(MSG_MESSAGE_ID_T MsgId, MSG_STORAGE_
 }
 
 
-MSG_ERROR_T MsgHandle::countMessage(MSG_FOLDER_ID_T FolderId, MSG_COUNT_INFO_S *pCountInfo)
+msg_error_t MsgHandle::countMessage(msg_folder_id_t FolderId, MSG_COUNT_INFO_S *pCountInfo)
 {
        // Allocate Memory to Command Data
-       int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_FOLDER_ID_T);
+       int cmdSize = sizeof(MSG_CMD_S) + sizeof(msg_folder_id_t);
 
        char cmdBuf[cmdSize];
        bzero(cmdBuf, cmdSize);
@@ -415,7 +429,7 @@ MSG_ERROR_T MsgHandle::countMessage(MSG_FOLDER_ID_T FolderId, MSG_COUNT_INFO_S *
        memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
 
        // Copy Command Data
-       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &FolderId, sizeof(MSG_FOLDER_ID_T));
+       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &FolderId, sizeof(msg_folder_id_t));
 
        // Send Command to Messaging FW
        char* pEventData = NULL;
@@ -441,7 +455,7 @@ MSG_ERROR_T MsgHandle::countMessage(MSG_FOLDER_ID_T FolderId, MSG_COUNT_INFO_S *
 }
 
 
-MSG_ERROR_T MsgHandle::countMsgByType(const MSG_MESSAGE_TYPE_S *pMsgType, int *pMsgCount)
+msg_error_t MsgHandle::countMsgByType(const MSG_MESSAGE_TYPE_S *pMsgType, int *pMsgCount)
 {
        // Allocate Memory to Command Data
        int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_MESSAGE_TYPE_S);
@@ -476,13 +490,13 @@ MSG_ERROR_T MsgHandle::countMsgByType(const MSG_MESSAGE_TYPE_S *pMsgType, int *p
        if(pEvent->result != MSG_SUCCESS) return pEvent->result;
 
        // Decode Return Data
-       memcpy(pMsgCount, (void*)((char*)pEvent+sizeof(MSG_EVENT_TYPE_T)+sizeof(MSG_ERROR_T)), sizeof(int));
+       memcpy(pMsgCount, (void*)((char*)pEvent+sizeof(MSG_EVENT_TYPE_T)+sizeof(msg_error_t)), sizeof(int));
 
        return MSG_SUCCESS;
 }
 
 
-MSG_ERROR_T MsgHandle::countMsgByContact(const MSG_THREAD_LIST_INDEX_S *pAddrInfo, MSG_THREAD_COUNT_INFO_S *pMsgThreadCountList)
+msg_error_t MsgHandle::countMsgByContact(const MSG_THREAD_LIST_INDEX_INFO_S *pAddrInfo, MSG_THREAD_COUNT_INFO_S *pMsgThreadCountList)
 {
        // Allocate Memory to Command Data
        int cmdSize = sizeof(MSG_CMD_S) +  sizeof(MSG_THREAD_LIST_INDEX_S);
@@ -498,8 +512,10 @@ MSG_ERROR_T MsgHandle::countMsgByContact(const MSG_THREAD_LIST_INDEX_S *pAddrInf
        memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
 
        // Copy Command Data
-       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), pAddrInfo, sizeof(MSG_THREAD_LIST_INDEX_S));
+       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), pAddrInfo, sizeof(msg_contact_id_t));
+       msg_struct_s *pAddr = (msg_struct_s *)pAddrInfo->msgAddrInfo;
 
+       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN + sizeof(msg_contact_id_t)), pAddr->data, sizeof(MSG_ADDRESS_INFO_S));
        // Send Command to Messaging FW
        char* pEventData = NULL;
        AutoPtr<char> eventBuf(&pEventData);
@@ -523,10 +539,10 @@ MSG_ERROR_T MsgHandle::countMsgByContact(const MSG_THREAD_LIST_INDEX_S *pAddrInf
 }
 
 
-MSG_ERROR_T MsgHandle::getMessage(MSG_MESSAGE_ID_T MsgId, MSG_MESSAGE_S *pMsg, MSG_SENDINGOPT_S *pSendOpt)
+msg_error_t MsgHandle::getMessage(msg_message_id_t MsgId, MSG_MESSAGE_HIDDEN_S *pMsg, MSG_SENDINGOPT_S *pSendOpt)
 {
        // Allocate Memory to Command Data
-       int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_MESSAGE_ID_T);
+       int cmdSize = sizeof(MSG_CMD_S) + sizeof(msg_message_id_t);
 
        char cmdBuf[cmdSize];
        bzero(cmdBuf, cmdSize);
@@ -539,7 +555,7 @@ MSG_ERROR_T MsgHandle::getMessage(MSG_MESSAGE_ID_T MsgId, MSG_MESSAGE_S *pMsg, M
        memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
 
        // Copy Command Data
-       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &MsgId, sizeof(MSG_MESSAGE_ID_T));
+       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &MsgId, sizeof(msg_message_id_t));
 
        // Send Command to Messaging FW
        char* pEventData = NULL;
@@ -564,11 +580,18 @@ MSG_ERROR_T MsgHandle::getMessage(MSG_MESSAGE_ID_T MsgId, MSG_MESSAGE_S *pMsg, M
        MSG_SENDINGOPT_INFO_S sendOptInfo;
        MsgDecodeMsgInfo(pEvent->data, &msgInfo, &sendOptInfo);
 
-       // Covert MSG_MESSAGE_INFO_S to MSG_MESSAGE_S
+       // Covert MSG_MESSAGE_INFO_S to MSG_MESSAGE_HIDDEN_S
        convertMsgStruct(&msgInfo, pMsg);
 
-       if(pSendOpt != NULL)
-               convertSendOptStruct(&sendOptInfo, pSendOpt, pMsg->msgType);
+       if(pSendOpt != NULL) {
+               MSG_MESSAGE_TYPE_S msgType = {0,};
+
+               msgType.mainType = pMsg->mainType;
+               msgType.subType = pMsg->subType;
+               msgType.classType = pMsg->classType;
+
+               convertSendOptStruct(&sendOptInfo, pSendOpt, msgType);
+       }
 
        // Delete Temp File
        if (msgInfo.bTextSms == false)
@@ -581,9 +604,9 @@ MSG_ERROR_T MsgHandle::getMessage(MSG_MESSAGE_ID_T MsgId, MSG_MESSAGE_S *pMsg, M
 }
 
 
-MSG_ERROR_T MsgHandle::getFolderViewList(MSG_FOLDER_ID_T FolderId, const MSG_SORT_RULE_S *pSortRule, MSG_LIST_S *pMsgFolderViewList)
+msg_error_t MsgHandle::getFolderViewList(msg_folder_id_t FolderId, const MSG_SORT_RULE_S *pSortRule, msg_struct_list_s *pMsgFolderViewList)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        err = MsgStoConnectDB();
 
@@ -607,7 +630,7 @@ MSG_ERROR_T MsgHandle::getFolderViewList(MSG_FOLDER_ID_T FolderId, const MSG_SOR
 }
 
 
-MSG_ERROR_T MsgHandle::addFolder(const MSG_FOLDER_INFO_S *pFolderInfo)
+msg_error_t MsgHandle::addFolder(const MSG_FOLDER_INFO_S *pFolderInfo)
 {
        // Allocate Memory to Command Data
        int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_FOLDER_INFO_S);
@@ -644,7 +667,7 @@ MSG_ERROR_T MsgHandle::addFolder(const MSG_FOLDER_INFO_S *pFolderInfo)
 }
 
 
-MSG_ERROR_T MsgHandle::updateFolder(const MSG_FOLDER_INFO_S *pFolderInfo)
+msg_error_t MsgHandle::updateFolder(const MSG_FOLDER_INFO_S *pFolderInfo)
 {
        // Allocate Memory to Command Data
        int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_FOLDER_INFO_S);
@@ -681,10 +704,10 @@ MSG_ERROR_T MsgHandle::updateFolder(const MSG_FOLDER_INFO_S *pFolderInfo)
 }
 
 
-MSG_ERROR_T MsgHandle::deleteFolder(MSG_FOLDER_ID_T FolderId)
+msg_error_t MsgHandle::deleteFolder(msg_folder_id_t FolderId)
 {
        // Allocate Memory to Command Data
-       int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_FOLDER_ID_T);
+       int cmdSize = sizeof(MSG_CMD_S) + sizeof(msg_folder_id_t);
 
        char cmdBuf[cmdSize];
        bzero(cmdBuf, cmdSize);
@@ -697,7 +720,7 @@ MSG_ERROR_T MsgHandle::deleteFolder(MSG_FOLDER_ID_T FolderId)
        memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
 
        // Copy Command Data
-       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &FolderId, sizeof(MSG_FOLDER_ID_T));
+       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &FolderId, sizeof(msg_folder_id_t));
 
        // Send Command to Messaging FW
        char* pEventData = NULL;
@@ -718,7 +741,7 @@ MSG_ERROR_T MsgHandle::deleteFolder(MSG_FOLDER_ID_T FolderId)
 }
 
 
-MSG_ERROR_T MsgHandle::getFolderList(MSG_FOLDER_LIST_S *pFolderList)
+msg_error_t MsgHandle::getFolderList(msg_struct_list_s *pFolderList)
 {
        // Allocate Memory to Command Data
        int cmdSize = sizeof(MSG_CMD_S);
@@ -756,9 +779,9 @@ MSG_ERROR_T MsgHandle::getFolderList(MSG_FOLDER_LIST_S *pFolderList)
 }
 
 
-MSG_ERROR_T MsgHandle::getThreadViewList(const MSG_SORT_RULE_S *pSortRule, MSG_THREAD_VIEW_LIST_S *pThreadViewList)
+msg_error_t MsgHandle::getThreadViewList(const MSG_SORT_RULE_S *pSortRule, msg_struct_list_s *pThreadViewList)
 {
-       MSG_ERROR_T err =  MSG_SUCCESS;
+       msg_error_t err =  MSG_SUCCESS;
 
        err = MsgStoConnectDB();
 
@@ -782,11 +805,11 @@ MSG_ERROR_T MsgHandle::getThreadViewList(const MSG_SORT_RULE_S *pSortRule, MSG_T
 }
 
 
-MSG_ERROR_T MsgHandle::getConversationViewList(MSG_THREAD_ID_T ThreadId, MSG_LIST_S *pConvViewList)
+msg_error_t MsgHandle::getConversationViewList(msg_thread_id_t ThreadId, msg_struct_list_s *pConvViewList)
 {
        MSG_BEGIN();
 
-       MSG_ERROR_T err =  MSG_SUCCESS;
+       msg_error_t err =  MSG_SUCCESS;
 
        MsgStoConnectDB();
        err = MsgStoGetConversationViewList(ThreadId, pConvViewList);
@@ -797,8 +820,9 @@ MSG_ERROR_T MsgHandle::getConversationViewList(MSG_THREAD_ID_T ThreadId, MSG_LIS
 
 
 // Update Read Status for the Thead ID
+#if 1
        // Allocate Memory to Command Data
-       int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_THREAD_ID_T);
+       int cmdSize = sizeof(MSG_CMD_S) + sizeof(msg_thread_id_t);
 
        char cmdBuf[cmdSize];
        bzero(cmdBuf, cmdSize);
@@ -811,7 +835,7 @@ MSG_ERROR_T MsgHandle::getConversationViewList(MSG_THREAD_ID_T ThreadId, MSG_LIS
        memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
 
        // Copy Command Data
-       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &ThreadId, sizeof(MSG_THREAD_ID_T));
+       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &ThreadId, sizeof(msg_thread_id_t));
 
        // Send Command to Messaging FW
        char* pEventData = NULL;
@@ -826,6 +850,7 @@ MSG_ERROR_T MsgHandle::getConversationViewList(MSG_THREAD_ID_T ThreadId, MSG_LIS
        {
                THROW(MsgException::INVALID_RESULT, "Event Data Error");
        }
+#endif
 
        MSG_END();
 
@@ -833,7 +858,7 @@ MSG_ERROR_T MsgHandle::getConversationViewList(MSG_THREAD_ID_T ThreadId, MSG_LIS
 }
 
 
-MSG_ERROR_T MsgHandle::deleteThreadMessageList(MSG_THREAD_ID_T ThreadId)
+msg_error_t MsgHandle::deleteThreadMessageList(msg_thread_id_t ThreadId)
 {
        // Allocate Memory to Command Data
        int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_THREAD_LIST_INDEX_S);
@@ -849,7 +874,7 @@ MSG_ERROR_T MsgHandle::deleteThreadMessageList(MSG_THREAD_ID_T ThreadId)
        memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
 
        // Copy Command Data
-       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &ThreadId, sizeof(MSG_THREAD_ID_T));
+       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &ThreadId, sizeof(msg_thread_id_t));
 
        // Send Command to Messaging FW
        char* pEventData = NULL;
@@ -872,10 +897,10 @@ MSG_ERROR_T MsgHandle::deleteThreadMessageList(MSG_THREAD_ID_T ThreadId)
 }
 
 
-MSG_ERROR_T MsgHandle::getQuickPanelData(MSG_QUICKPANEL_TYPE_T Type, MSG_MESSAGE_S *pMsg)
+msg_error_t MsgHandle::getQuickPanelData(msg_quickpanel_type_t Type, MSG_MESSAGE_HIDDEN_S *pMsg)
 {
        // Allocate Memory to Command Data
-       int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_QUICKPANEL_TYPE_T);
+       int cmdSize = sizeof(MSG_CMD_S) + sizeof(msg_quickpanel_type_t);
 
        char cmdBuf[cmdSize];
        bzero(cmdBuf, cmdSize);
@@ -888,7 +913,7 @@ MSG_ERROR_T MsgHandle::getQuickPanelData(MSG_QUICKPANEL_TYPE_T Type, MSG_MESSAGE
        memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
 
        // Copy Command Data
-       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &Type, sizeof(MSG_QUICKPANEL_TYPE_T));
+       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &Type, sizeof(msg_quickpanel_type_t));
 
        // Send Command to Messaging FW
        char* pEventData = NULL;
@@ -909,7 +934,7 @@ MSG_ERROR_T MsgHandle::getQuickPanelData(MSG_QUICKPANEL_TYPE_T Type, MSG_MESSAGE
        // Decode Return Data
        MSG_MESSAGE_INFO_S msgInfo;
 
-       memcpy(&msgInfo, (void*)((char*)pEvent+sizeof(MSG_EVENT_TYPE_T)+sizeof(MSG_ERROR_T)), sizeof(MSG_MESSAGE_INFO_S));
+       memcpy(&msgInfo, (void*)((char*)pEvent+sizeof(MSG_EVENT_TYPE_T)+sizeof(msg_error_t)), sizeof(MSG_MESSAGE_INFO_S));
 
        // Covert MSG_MESSAGE_INFO_S to MSG_MESSAGE_S
        convertMsgStruct(&msgInfo, pMsg);
@@ -925,7 +950,7 @@ MSG_ERROR_T MsgHandle::getQuickPanelData(MSG_QUICKPANEL_TYPE_T Type, MSG_MESSAGE
 }
 
 
-MSG_ERROR_T MsgHandle::resetDatabase()
+msg_error_t MsgHandle::resetDatabase()
 {
        // Allocate Memory to Command Data
        int cmdSize = sizeof(MSG_CMD_S);
@@ -958,7 +983,7 @@ MSG_ERROR_T MsgHandle::resetDatabase()
 }
 
 
-MSG_ERROR_T MsgHandle::getMemSize(unsigned int* memsize)
+msg_error_t MsgHandle::getMemSize(unsigned int* memsize)
 {
        // Allocate Memory to Command Data
        int cmdSize = sizeof(MSG_CMD_S);
@@ -997,46 +1022,94 @@ MSG_ERROR_T MsgHandle::getMemSize(unsigned int* memsize)
 }
 
 
-MSG_ERROR_T MsgHandle::searchMessage(const char *pSearchString, MSG_THREAD_VIEW_LIST_S *pThreadViewList)
+msg_error_t MsgHandle::backupMessage()
 {
-       MSG_ERROR_T err =  MSG_SUCCESS;
+       // Allocate Memory to Command Data
+       int cmdSize = sizeof(MSG_CMD_S);
 
-       err = MsgStoConnectDB();
+       char cmdBuf[cmdSize];
+       bzero(cmdBuf, cmdSize);
+       MSG_CMD_S* pCmd = (MSG_CMD_S*)cmdBuf;
 
-       if (err != MSG_SUCCESS)
+       // Set Command Parameters
+       pCmd->cmdType = MSG_CMD_BACKUP_MESSAGE;
+
+       // Copy Cookie
+       memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
+
+       // Send Command to Messaging FW
+       char* pEventData = NULL;
+       AutoPtr<char> eventBuf(&pEventData);
+
+
+       write((char*)pCmd, cmdSize, &pEventData);
+
+       // Get Return Data
+       MSG_EVENT_S* pEvent = (MSG_EVENT_S*)pEventData;
+
+       if (pEvent->eventType != MSG_EVENT_BACKUP_MESSAGE)
        {
-               MSG_DEBUG("MsgStoConnectDB() Error!!");
-               return err;
+               THROW(MsgException::INVALID_RESULT, "Event Data Error");
        }
 
-       err = MsgStoSearchMessage(pSearchString, pThreadViewList);
+       if(pEvent->result != MSG_SUCCESS) return pEvent->result;
 
-       if (err != MSG_SUCCESS)
+       return MSG_SUCCESS;
+}
+
+
+msg_error_t MsgHandle::restoreMessage()
+{
+       // Allocate Memory to Command Data
+       int cmdSize = sizeof(MSG_CMD_S);
+
+       char cmdBuf[cmdSize];
+       bzero(cmdBuf, cmdSize);
+       MSG_CMD_S* pCmd = (MSG_CMD_S*)cmdBuf;
+
+       // Set Command Parameters
+       pCmd->cmdType = MSG_CMD_RESTORE_MESSAGE;
+
+       // Copy Cookie
+       memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
+
+       // Send Command to Messaging FW
+       char* pEventData = NULL;
+       AutoPtr<char> eventBuf(&pEventData);
+
+
+       write((char*)pCmd, cmdSize, &pEventData);
+
+       // Get Return Data
+       MSG_EVENT_S* pEvent = (MSG_EVENT_S*)pEventData;
+
+       if (pEvent->eventType != MSG_EVENT_RESTORE_MESSAGE)
        {
-               MSG_DEBUG("MsgStoSearchMessage() Error!!");
-               return err;
+               THROW(MsgException::INVALID_RESULT, "Event Data Error");
        }
 
-       MsgStoDisconnectDB();
+       if(pEvent->result != MSG_SUCCESS) return pEvent->result;
 
-       return err;
+       return MSG_SUCCESS;
 }
 
 
-MSG_ERROR_T MsgHandle::searchMessage(const MSG_SEARCH_CONDITION_S *pSearchCon, int offset, int limit, MSG_LIST_S *pMsgList)
+msg_error_t MsgHandle::searchMessage(const char *pSearchString, msg_struct_list_s *pThreadViewList)
 {
-       MSG_ERROR_T err =  MSG_SUCCESS;
+       msg_error_t err =  MSG_SUCCESS;
 
        err = MsgStoConnectDB();
 
-       if (err != MSG_SUCCESS) {
+       if (err != MSG_SUCCESS)
+       {
                MSG_DEBUG("MsgStoConnectDB() Error!!");
                return err;
        }
 
-       err = MsgStoSearchMessage(pSearchCon, offset, limit, pMsgList);
+       err = MsgStoSearchMessage(pSearchString, pThreadViewList);
 
-       if (err != MSG_SUCCESS) {
+       if (err != MSG_SUCCESS)
+       {
                MSG_DEBUG("MsgStoSearchMessage() Error!!");
                return err;
        }
@@ -1047,23 +1120,20 @@ MSG_ERROR_T MsgHandle::searchMessage(const MSG_SEARCH_CONDITION_S *pSearchCon, i
 }
 
 
-
-MSG_ERROR_T MsgHandle::getMsgIdList(MSG_REFERENCE_ID_T RefId, MSG_MSGID_LIST_S *pMsgIdList)
+msg_error_t MsgHandle::searchMessage(const MSG_SEARCH_CONDITION_S *pSearchCon, int offset, int limit, msg_struct_list_s *pMsgList)
 {
-       MSG_ERROR_T err =  MSG_SUCCESS;
+       msg_error_t err =  MSG_SUCCESS;
 
        err = MsgStoConnectDB();
 
-       if (err != MSG_SUCCESS)
-       {
+       if (err != MSG_SUCCESS) {
                MSG_DEBUG("MsgStoConnectDB() Error!!");
                return err;
        }
 
-       err = MsgStoGetMsgIdList(RefId, pMsgIdList);
+       err = MsgStoSearchMessage(pSearchCon, offset, limit, pMsgList);
 
-       if (err != MSG_SUCCESS)
-       {
+       if (err != MSG_SUCCESS) {
                MSG_DEBUG("MsgStoSearchMessage() Error!!");
                return err;
        }
@@ -1074,9 +1144,9 @@ MSG_ERROR_T MsgHandle::getMsgIdList(MSG_REFERENCE_ID_T RefId, MSG_MSGID_LIST_S *
 }
 
 
-MSG_ERROR_T MsgHandle::getRejectMsgList(const char *pNumber, MSG_REJECT_MSG_LIST_S *pRejectMsgList)
+msg_error_t MsgHandle::getRejectMsgList(const char *pNumber, msg_struct_list_s *pRejectMsgList)
 {
-       MSG_ERROR_T err =  MSG_SUCCESS;
+       msg_error_t err =  MSG_SUCCESS;
 
        err = MsgStoConnectDB();
 
@@ -1100,7 +1170,7 @@ MSG_ERROR_T MsgHandle::getRejectMsgList(const char *pNumber, MSG_REJECT_MSG_LIST
 }
 
 
-MSG_ERROR_T MsgHandle::regStorageChangeCallback(msg_storage_change_cb onStorageChange, void *pUserParam)
+msg_error_t MsgHandle::regStorageChangeCallback(msg_storage_change_cb onStorageChange, void *pUserParam)
 {
        if (!onStorageChange)
                THROW(MsgException::INVALID_PARAM, "onStorageChange is null");
@@ -1150,10 +1220,10 @@ MSG_ERROR_T MsgHandle::regStorageChangeCallback(msg_storage_change_cb onStorageC
 }
 
 
-MSG_ERROR_T MsgHandle::getReportStatus(MSG_MESSAGE_ID_T msg_id, MSG_REPORT_STATUS_INFO_S *pReport_status)
+msg_error_t MsgHandle::getReportStatus(msg_message_id_t msg_id, MSG_REPORT_STATUS_INFO_S *pReport_status)
 {
        // Allocate Memory to Command Data
-       int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_MESSAGE_ID_T);
+       int cmdSize = sizeof(MSG_CMD_S) + sizeof(msg_message_id_t);
 
        char cmdBuf[cmdSize];
        bzero(cmdBuf, cmdSize);
@@ -1166,7 +1236,7 @@ MSG_ERROR_T MsgHandle::getReportStatus(MSG_MESSAGE_ID_T msg_id, MSG_REPORT_STATU
        memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
 
        // Copy Command Data
-       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &msg_id, sizeof(MSG_MESSAGE_ID_T));
+       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &msg_id, sizeof(msg_message_id_t));
 
        // Send Command to Messaging FW
        char* pEventData = NULL;
@@ -1190,3 +1260,138 @@ MSG_ERROR_T MsgHandle::getReportStatus(MSG_MESSAGE_ID_T msg_id, MSG_REPORT_STATU
 
        return MSG_SUCCESS;
 }
+
+
+msg_error_t MsgHandle::getAddressList(const msg_thread_id_t threadId, msg_struct_list_s *pAddrList)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       err = MsgStoConnectDB();
+
+       if (err != MSG_SUCCESS)
+       {
+               MSG_DEBUG("MsgStoConnectDB() Error!!");
+               return err;
+       }
+
+       err = MsgStoGetAddressList(threadId, (msg_struct_list_s *)pAddrList);
+
+       if (err != MSG_SUCCESS)
+       {
+               MSG_DEBUG("MsgStoGetThreadViewList() Error!!");
+               return err;
+       }
+
+       MsgStoDisconnectDB();
+
+       return err;
+}
+
+
+msg_error_t MsgHandle::getThreadIdByAddress(msg_struct_list_s *pAddrList, msg_thread_id_t *pThreadId)
+{
+       // Allocate Memory to Command Data
+       int cmdSize = sizeof(MSG_CMD_S) + sizeof(pAddrList->nCount) + (sizeof(MSG_ADDRESS_INFO_S)*pAddrList->nCount);
+
+       char cmdBuf[cmdSize];
+       bzero(cmdBuf, cmdSize);
+       MSG_CMD_S* pCmd = (MSG_CMD_S*)cmdBuf;
+
+       // Set Command Parameters
+       pCmd->cmdType = MSG_CMD_GET_THREAD_ID_BY_ADDRESS;
+
+       // Copy Cookie
+       memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
+
+       // Copy Command Data
+       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &pAddrList->nCount, sizeof(pAddrList->nCount));
+       int addSize = sizeof(MSG_ADDRESS_INFO_S);
+       for(int i=0; i<pAddrList->nCount; i++) {
+               memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+sizeof(pAddrList->nCount)+(addSize*i)+MAX_COOKIE_LEN), ((msg_struct_s *)(pAddrList->msg_struct_info[i]))->data, sizeof(MSG_ADDRESS_INFO_S));
+       }
+
+       // Send Command to Messaging FW
+       char* pEventData = NULL;
+       AutoPtr<char> eventBuf(&pEventData);
+
+
+       write((char*)pCmd, cmdSize, &pEventData);
+
+       // Get Return Data
+       MSG_EVENT_S* pEvent = (MSG_EVENT_S*)pEventData;
+
+       if (pEvent->eventType != MSG_EVENT_GET_THREAD_ID_BY_ADDRESS)
+       {
+               THROW(MsgException::INVALID_RESULT, "Event Data Error");
+       }
+
+       if(pEvent->result != MSG_SUCCESS) return pEvent->result;
+
+       // Decode Return Data
+       MsgDecodeThreadId(pEvent->data, pThreadId);
+
+       return MSG_SUCCESS;
+}
+
+
+msg_error_t MsgHandle::getThread(msg_thread_id_t threadId, MSG_THREAD_VIEW_S* pThreadInfo)
+{
+       // Allocate Memory to Command Data
+       int cmdSize = sizeof(MSG_CMD_S) + sizeof(msg_thread_id_t);
+
+       char cmdBuf[cmdSize];
+       bzero(cmdBuf, cmdSize);
+       MSG_CMD_S* pCmd = (MSG_CMD_S*)cmdBuf;
+
+       // Set Command Parameters
+       pCmd->cmdType = MSG_CMD_GET_THREAD_INFO;
+
+       // Copy Cookie
+       memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
+
+       // Copy Command Data
+       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &threadId, sizeof(msg_thread_id_t));
+
+       // Send Command to Messaging FW
+       char* pEventData = NULL;
+       AutoPtr<char> eventBuf(&pEventData);
+
+       write((char*)pCmd, cmdSize, &pEventData);
+
+       // Get Return Data
+       MSG_EVENT_S* pEvent = (MSG_EVENT_S*)pEventData;
+
+       if (pEvent->eventType != MSG_EVENT_GET_THREAD_INFO)
+       {
+               THROW(MsgException::INVALID_RESULT, "Event Data Error");
+       }
+
+       // Decode Return Data
+       MsgDecodeThreadInfo(pEvent->data, pThreadInfo);
+
+       return MSG_SUCCESS;
+}
+
+
+msg_error_t MsgHandle::getMessageList(msg_folder_id_t folderId, msg_thread_id_t threadId, msg_message_type_t msgType, msg_storage_id_t storageId, msg_struct_list_s *pMsgList)
+{
+       msg_error_t err =  MSG_SUCCESS;
+
+       err = MsgStoConnectDB();
+
+       if (err != MSG_SUCCESS) {
+               MSG_DEBUG("MsgStoConnectDB() Error!!");
+               return err;
+       }
+
+       err = MsgStoGetMessageList(folderId, threadId, msgType, storageId, pMsgList);
+
+       if (err != MSG_SUCCESS) {
+               MSG_DEBUG("MsgStoSearchMessage() Error!!");
+               return err;
+       }
+
+       MsgStoDisconnectDB();
+
+       return err;
+}
index 03ca13f..e3ade18 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include <time.h>
 #include <errno.h>
@@ -27,7 +27,7 @@
 /*==================================================================================================
                                      IMPLEMENTATION OF MsgHandle - Transport Member Functions
 ==================================================================================================*/
-MSG_ERROR_T MsgHandle::submitReq(MSG_REQUEST_S* pReq)
+msg_error_t MsgHandle::submitReq(MSG_REQUEST_S* pReq)
 {
        MSG_BEGIN();
 
@@ -37,13 +37,15 @@ MSG_ERROR_T MsgHandle::submitReq(MSG_REQUEST_S* pReq)
        MSG_REQUEST_INFO_S reqInfo = {0};
        char trId[MMS_TR_ID_LEN+1] = {0};
 
-       MSG_MESSAGE_S *reqmsg = (MSG_MESSAGE_S*) pReq->msg;
+       msg_struct_s *msg_s = (msg_struct_s *)pReq->msg;
 
-       if (reqmsg->msgType.subType != MSG_SENDREQ_JAVA_MMS) {
+       MSG_MESSAGE_HIDDEN_S *reqmsg = (MSG_MESSAGE_HIDDEN_S*)msg_s->data;
+
+       if (reqmsg->subType != MSG_SENDREQ_JAVA_MMS) {
                // In case MMS read report, get address value later.
-               if(reqmsg->msgType.subType != MSG_READREPLY_MMS) {
-                       if ((reqmsg->nAddressCnt == 0) || (reqmsg->nAddressCnt > MAX_TO_ADDRESS_CNT)) {
-                               MSG_DEBUG("Recipient address count error [%d]", reqmsg->nAddressCnt );
+               if(reqmsg->subType != MSG_READREPLY_MMS) {
+                       if ((reqmsg->addr_list->nCount == 0) || (reqmsg->addr_list->nCount > MAX_TO_ADDRESS_CNT)) {
+                               MSG_DEBUG("Recipient address count error [%d]", reqmsg->addr_list->nCount );
                                return MSG_ERR_INVALID_MESSAGE;
                        }
                }
@@ -51,7 +53,7 @@ MSG_ERROR_T MsgHandle::submitReq(MSG_REQUEST_S* pReq)
                /* Begin: Setting default values for submit request */
        //      pReq->msg.msgId = 0;    // Set Request ID: internal use
        //      pReq->msg.folderId = MSG_OUTBOX_ID;     // Set Folder ID
-               if (reqmsg->msgType.subType == MSG_RETRIEVE_MMS) {
+               if (reqmsg->subType == MSG_RETRIEVE_MMS) {
                        reqmsg->networkStatus = MSG_NETWORK_RETRIEVING;
                } else {
                        reqmsg->networkStatus = MSG_NETWORK_SENDING;
@@ -80,7 +82,13 @@ MSG_ERROR_T MsgHandle::submitReq(MSG_REQUEST_S* pReq)
        // Convert MSG_MESSAGE_S to MSG_MESSAGE_INFO_S
        convertMsgStruct(reqmsg, &(reqInfo.msgInfo));
 
-       convertSendOptStruct(&(pReq->sendOpt), &(reqInfo.sendOptInfo), reqmsg->msgType);
+       MSG_MESSAGE_TYPE_S msgType = {0,};
+
+       msgType.mainType = reqmsg->mainType;
+       msgType.subType = reqmsg->subType;
+       msgType.classType = reqmsg->classType;
+
+       convertSendOptStruct((const MSG_SENDINGOPT_S *)pReq->sendOpt, &(reqInfo.sendOptInfo), msgType);
 
        reqInfo.reqId = 0;
 
@@ -95,7 +103,7 @@ MSG_ERROR_T MsgHandle::submitReq(MSG_REQUEST_S* pReq)
        int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_REQUEST_INFO_S) + sizeof(MSG_PROXY_INFO_S);
 
        // In case of JAVA MMS msg, add trId
-       if (reqmsg->msgType.subType == MSG_SENDREQ_JAVA_MMS)
+       if (reqmsg->subType == MSG_SENDREQ_JAVA_MMS)
                cmdSize += sizeof(trId);
 
        char cmdBuf[cmdSize];
@@ -114,7 +122,7 @@ MSG_ERROR_T MsgHandle::submitReq(MSG_REQUEST_S* pReq)
        memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN+sizeof(MSG_REQUEST_INFO_S)), &chInfo, sizeof(MSG_PROXY_INFO_S));
 
        // In case of JAVA MMS msg, add trId
-       if (reqmsg->msgType.subType == MSG_SENDREQ_JAVA_MMS)
+       if (reqmsg->subType == MSG_SENDREQ_JAVA_MMS)
                memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN+sizeof(MSG_REQUEST_INFO_S)+sizeof(MSG_PROXY_INFO_S)), &trId, sizeof(trId));
 
        // Send Command to Messaging FW
@@ -141,10 +149,10 @@ MSG_ERROR_T MsgHandle::submitReq(MSG_REQUEST_S* pReq)
 }
 
 
-MSG_ERROR_T MsgHandle::cancelReq(MSG_REQUEST_ID_T reqId)
+msg_error_t MsgHandle::cancelReq(msg_request_id_t reqId)
 {
        // Allocate Memory to Command Data
-       int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_REQUEST_ID_T);
+       int cmdSize = sizeof(MSG_CMD_S) + sizeof(msg_request_id_t);
 
        char cmdBuf[cmdSize];
        bzero(cmdBuf, cmdSize);
@@ -158,7 +166,7 @@ MSG_ERROR_T MsgHandle::cancelReq(MSG_REQUEST_ID_T reqId)
        memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
 
        // Copy Command Data
-       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &reqId, sizeof(MSG_REQUEST_ID_T));
+       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &reqId, sizeof(msg_request_id_t));
 
        // Send Command to Messaging FW
        char* pEventData = NULL;
@@ -179,7 +187,7 @@ MSG_ERROR_T MsgHandle::cancelReq(MSG_REQUEST_ID_T reqId)
 }
 
 
-MSG_ERROR_T MsgHandle::regSentStatusCallback(msg_sent_status_cb onStatusChanged, void *pUserParam)
+msg_error_t MsgHandle::regSentStatusCallback(msg_sent_status_cb onStatusChanged, void *pUserParam)
 {
        if (!onStatusChanged)
                THROW(MsgException::INVALID_PARAM, "onStatusChanged is null");
@@ -229,7 +237,7 @@ MSG_ERROR_T MsgHandle::regSentStatusCallback(msg_sent_status_cb onStatusChanged,
 }
 
 
-MSG_ERROR_T MsgHandle::regSmsMessageCallback(msg_sms_incoming_cb onMsgIncoming, unsigned short port, void *pUserParam)
+msg_error_t MsgHandle::regSmsMessageCallback(msg_sms_incoming_cb onMsgIncoming, unsigned short port, void *pUserParam)
 {
        if( (!onMsgIncoming) )
                THROW(MsgException::INVALID_PARAM, "Param %p", onMsgIncoming);
@@ -284,7 +292,7 @@ MSG_ERROR_T MsgHandle::regSmsMessageCallback(msg_sms_incoming_cb onMsgIncoming,
 }
 
 
-MSG_ERROR_T MsgHandle::regMmsConfMessageCallback(msg_mms_conf_msg_incoming_cb onMMSConfMsgIncoming, const char *pAppId, void *pUserParam)
+msg_error_t MsgHandle::regMmsConfMessageCallback(msg_mms_conf_msg_incoming_cb onMMSConfMsgIncoming, const char *pAppId, void *pUserParam)
 {
        if( (!onMMSConfMsgIncoming) )
                THROW(MsgException::INVALID_PARAM, "Param %p", onMMSConfMsgIncoming);
@@ -341,7 +349,7 @@ MSG_ERROR_T MsgHandle::regMmsConfMessageCallback(msg_mms_conf_msg_incoming_cb on
 }
 
 
-MSG_ERROR_T MsgHandle::regSyncMLMessageCallback(msg_syncml_msg_incoming_cb onSyncMLMsgIncoming, void *pUserParam)
+msg_error_t MsgHandle::regSyncMLMessageCallback(msg_syncml_msg_incoming_cb onSyncMLMsgIncoming, void *pUserParam)
 {
        if( (!onSyncMLMsgIncoming) )
                THROW(MsgException::INVALID_PARAM, "Param %p", onSyncMLMsgIncoming);
@@ -394,7 +402,7 @@ MSG_ERROR_T MsgHandle::regSyncMLMessageCallback(msg_syncml_msg_incoming_cb onSyn
 }
 
 
-MSG_ERROR_T MsgHandle::regLBSMessageCallback(msg_lbs_msg_incoming_cb onLBSMsgIncoming, void *pUserParam)
+msg_error_t MsgHandle::regLBSMessageCallback(msg_lbs_msg_incoming_cb onLBSMsgIncoming, void *pUserParam)
 {
        if( (!onLBSMsgIncoming) )
                THROW(MsgException::INVALID_PARAM, "Param %p", onLBSMsgIncoming);
@@ -446,7 +454,7 @@ MSG_ERROR_T MsgHandle::regLBSMessageCallback(msg_lbs_msg_incoming_cb onLBSMsgInc
 }
 
 
-MSG_ERROR_T MsgHandle::regSyncMLMessageOperationCallback(msg_syncml_msg_operation_cb onSyncMLMsgOperation, void *pUserParam)
+msg_error_t MsgHandle::regSyncMLMessageOperationCallback(msg_syncml_msg_operation_cb onSyncMLMsgOperation, void *pUserParam)
 {
        if( (!onSyncMLMsgOperation) )
                THROW(MsgException::INVALID_PARAM, "Param %p", onSyncMLMsgOperation);
@@ -500,13 +508,13 @@ MSG_ERROR_T MsgHandle::regSyncMLMessageOperationCallback(msg_syncml_msg_operatio
 }
 
 
-MSG_ERROR_T MsgHandle::operateSyncMLMessage(MSG_MESSAGE_ID_T msgId)
+msg_error_t MsgHandle::operateSyncMLMessage(msg_message_id_t msgId)
 {
        if( msgId < 1)
                THROW(MsgException::INVALID_PARAM, "Param msgId %d", msgId);
 
        // Allocate Memory to Command Data
-       int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_MESSAGE_ID_T);
+       int cmdSize = sizeof(MSG_CMD_S) + sizeof(msg_message_id_t);
 
        char cmdBuf[cmdSize];
        bzero(cmdBuf, cmdSize);
@@ -519,7 +527,7 @@ MSG_ERROR_T MsgHandle::operateSyncMLMessage(MSG_MESSAGE_ID_T msgId)
        memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
 
        // Copy Command Data
-       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &msgId, sizeof(MSG_MESSAGE_ID_T));
+       memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &msgId, sizeof(msg_message_id_t));
 
        // Send Command to Messaging FW
        char* pEventData = NULL;
index 5293dc6..1bf4a38 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include <errno.h>
 
@@ -478,12 +478,13 @@ void MsgProxyListener::handleEvent(const MSG_EVENT_S* pMsgEvent)
        {
                unsigned int chInfo[3] = {0}; //3// reqid, status, object
 
-//             unsigned int* pChInfo = (unsigned int*) pMsgEvent->data;
+               memcpy(&chInfo, (void*)((char*)pMsgEvent+sizeof(MSG_EVENT_TYPE_T)+sizeof(msg_error_t)), sizeof(chInfo));
 
-               memcpy(&chInfo, (void*)((char*)pMsgEvent+sizeof(MSG_EVENT_TYPE_T)+sizeof(MSG_ERROR_T)), sizeof(chInfo));
+               msg_struct_s status = {0,};
+               MSG_SENT_STATUS_S statusData = {(msg_request_id_t)chInfo[0], (msg_network_status_t)chInfo[1]};
 
-               //      [0] = pStatus->reqId;   [1] = pStatus->status;  [2] = chInfo.handleAddr;
-               MSG_SENT_STATUS_S status = {(MSG_REQUEST_ID_T)chInfo[0], (MSG_NETWORK_STATUS_T)chInfo[1]};
+               status.type = MSG_STRUCT_SENT_STATUS_INFO;
+               status.data = (void *)&statusData;
 
                mx.lock();
 
@@ -497,7 +498,7 @@ void MsgProxyListener::handleEvent(const MSG_EVENT_S* pMsgEvent)
 
                        void* param = it->userParam;
 
-                       pfunc((MSG_HANDLE_T)pHandle, &status, param);
+                       pfunc((msg_handle_t)pHandle, (msg_struct_t)&status, param);
                }
 
                mx.unlock();
@@ -529,22 +530,64 @@ void MsgProxyListener::handleEvent(const MSG_EVENT_S* pMsgEvent)
                        MsgHandle* pHandle = it->hAddr;
 
                        MSG_MESSAGE_INFO_S *pMsgInfo = (MSG_MESSAGE_INFO_S *)pMsgEvent->data;
-                       MSG_MESSAGE_S msg = {0};
+                       MSG_MESSAGE_HIDDEN_S msgHidden = {0,};
 
-                       msg.pData = NULL;
-                       msg.pMmsData = NULL;
+                       msgHidden.pData = NULL;
+                       msgHidden.pMmsData = NULL;
 
-                       pHandle->convertMsgStruct(pMsgInfo, &msg);
+                       /* Allocate memory for address list of message */
+                       msg_struct_list_s *addr_list = (msg_struct_list_s *)new msg_struct_list_s;
+
+                       addr_list->nCount = 0;
+                       addr_list->msg_struct_info = (msg_struct_t *)new char[sizeof(MSG_ADDRESS_INFO_S *)*MAX_TO_ADDRESS_CNT];
+
+                       msg_struct_s *pTmp = NULL;
+
+                       for (int i = 0; i < MAX_TO_ADDRESS_CNT; i++) {
+                               addr_list->msg_struct_info[i] = (msg_struct_t)new char[sizeof(msg_struct_s)];
+                               pTmp = (msg_struct_s *)addr_list->msg_struct_info[i];
+                               pTmp->type = MSG_STRUCT_ADDRESS_INFO;
+                               pTmp->data = new MSG_ADDRESS_INFO_S;
+                               memset(pTmp->data, 0x00, sizeof(MSG_ADDRESS_INFO_S));
+
+                               addr_list->msg_struct_info[i] = (msg_struct_t)pTmp;
+                       }
+
+                       msgHidden.addr_list = addr_list;
+
+                       pHandle->convertMsgStruct(pMsgInfo, &msgHidden);
+
+                       msg_struct_s msg = {0,};
+                       msg.type = MSG_STRUCT_MESSAGE_INFO;
+                       msg.data = &msgHidden;
 
                        msg_sms_incoming_cb pfunc = it->pfIncomingCB;
 
                        void* param = it->userParam;
 
-                       pfunc((MSG_HANDLE_T)pHandle, (msg_message_t) &msg, param);
+                       pfunc((msg_handle_t)pHandle, (msg_struct_t) &msg, param);
+
+                       delete [] (char*)msgHidden.pData;
+                       if (msgHidden.pMmsData != NULL)
+                               delete [] (char*)msgHidden.pMmsData;
+
+                       // address Memory Free
+                       if (msgHidden.addr_list!= NULL)
+                       {
+                               for(int i=0; i<MAX_TO_ADDRESS_CNT; i++) {
+                                       msg_struct_s * addrInfo = (msg_struct_s *)msgHidden.addr_list->msg_struct_info[i];
+                                       delete (MSG_ADDRESS_INFO_S *)addrInfo->data;
+                                       addrInfo->data = NULL;
+                                       delete (msg_struct_s *)msgHidden.addr_list->msg_struct_info[i];
+                                       msgHidden.addr_list->msg_struct_info[i] = NULL;
+                               }
+
+                               delete [] msgHidden.addr_list->msg_struct_info;
+
+                               delete msgHidden.addr_list;
+                               msgHidden.addr_list = NULL;
+                       }
 
-                       delete [] (char*)msg.pData;
-                       if (msg.pMmsData != NULL)
-                               delete [] (char*)msg.pMmsData;
                }
 
        }
@@ -592,22 +635,62 @@ void MsgProxyListener::handleEvent(const MSG_EVENT_S* pMsgEvent)
                        MsgHandle* pHandle = it->hAddr;
 
                        MSG_MESSAGE_INFO_S *pMsgInfo = (MSG_MESSAGE_INFO_S *)pMsgEvent->data;
-                       MSG_MESSAGE_S msg = {0};
+                       MSG_MESSAGE_HIDDEN_S msgHidden = {0,};
+
+                       msgHidden.pData = NULL;
+                       msgHidden.pMmsData = NULL;
+
+                       /* Allocate memory for address list of message */
+                       msg_struct_list_s *addr_list = (msg_struct_list_s *)new msg_struct_list_s;
 
-                       msg.pData = NULL;
-                       msg.pMmsData = NULL;
+                       addr_list->nCount = 0;
+                       addr_list->msg_struct_info = (msg_struct_t *)new char[sizeof(MSG_ADDRESS_INFO_S *)*MAX_TO_ADDRESS_CNT];
 
-                       pHandle->convertMsgStruct(pMsgInfo, &msg);
+                       msg_struct_s *pTmp = NULL;
+
+                       for (int i = 0; i < MAX_TO_ADDRESS_CNT; i++) {
+                               addr_list->msg_struct_info[i] = (msg_struct_t)new char[sizeof(msg_struct_s)];
+                               pTmp = (msg_struct_s *)addr_list->msg_struct_info[i];
+                               pTmp->type = MSG_STRUCT_ADDRESS_INFO;
+                               pTmp->data = new MSG_ADDRESS_INFO_S;
+                               memset(pTmp->data, 0x00, sizeof(MSG_ADDRESS_INFO_S));
+
+                               addr_list->msg_struct_info[i] = (msg_struct_t)pTmp;
+                       }
+
+                       msgHidden.addr_list = addr_list;
+
+                       pHandle->convertMsgStruct(pMsgInfo, &msgHidden);
+
+                       msg_struct_s msg = {0,};
+                       msg.type = MSG_STRUCT_MESSAGE_INFO;
+                       msg.data = &msgHidden;
 
                        msg_mms_conf_msg_incoming_cb pfunc = it->pfMMSConfIncomingCB;
 
                        void* param = it->userParam;
+                       pfunc((msg_handle_t)pHandle, (msg_struct_t) &msg, param);
 
-                       pfunc((MSG_HANDLE_T)pHandle, (msg_message_t) &msg, param);
+                       delete [] (char*)msgHidden.pData;
+                       if (msgHidden.pMmsData != NULL)
+                               delete [] (char*)msgHidden.pMmsData;
 
-                       delete [] (char*)msg.pData;
-                       if (msg.pMmsData != NULL)
-                               delete [] (char*)msg.pMmsData;
+                       // address Memory Free
+                       if (msgHidden.addr_list!= NULL)
+                       {
+                               for(int i=0; i<MAX_TO_ADDRESS_CNT; i++) {
+                                       msg_struct_s * addrInfo = (msg_struct_s *)msgHidden.addr_list->msg_struct_info[i];
+                                       delete (MSG_ADDRESS_INFO_S *)addrInfo->data;
+                                       addrInfo->data = NULL;
+                                       delete (msg_struct_s *)msgHidden.addr_list->msg_struct_info[i];
+                                       msgHidden.addr_list->msg_struct_info[i] = NULL;
+                               }
+
+                               delete [] msgHidden.addr_list->msg_struct_info;
+
+                               delete msgHidden.addr_list;
+                               msgHidden.addr_list = NULL;
+                       }
 
                        // Here the retrieved message will be deleted from native storage.
                        // as of now, msg which have appId is considered as JAVA MMS message and it will be sent and handled in JAVA app.
@@ -636,7 +719,7 @@ void MsgProxyListener::handleEvent(const MSG_EVENT_S* pMsgEvent)
 
                        void* param = it->userParam;
 
-                       pfunc((MSG_HANDLE_T)pHandle, pSyncMLData->syncmlType, pSyncMLData->pushBody, pSyncMLData->pushBodyLen, pSyncMLData->wspHeader, pSyncMLData->wspHeaderLen, param);
+                       pfunc((msg_handle_t)pHandle, pSyncMLData->syncmlType, pSyncMLData->pushBody, pSyncMLData->pushBodyLen, pSyncMLData->wspHeader, pSyncMLData->wspHeaderLen, param);
                }
 
                mx.unlock();
@@ -657,7 +740,7 @@ void MsgProxyListener::handleEvent(const MSG_EVENT_S* pMsgEvent)
 
                        void* param = it->userParam;
 
-                       pfunc((MSG_HANDLE_T)pHandle, pLBSData->pushHeader, pLBSData->pushBody, pLBSData->pushBodyLen, param);
+                       pfunc((msg_handle_t)pHandle, pLBSData->pushHeader, pLBSData->pushBody, pLBSData->pushBodyLen, param);
                }
 
                mx.unlock();
@@ -667,8 +750,8 @@ void MsgProxyListener::handleEvent(const MSG_EVENT_S* pMsgEvent)
                int msgId;
                int extId;
 
-               memcpy(&msgId, (void*)((char*)pMsgEvent+sizeof(MSG_EVENT_TYPE_T)+sizeof(MSG_ERROR_T)), sizeof(int));
-               memcpy(&extId, (void*)((char*)pMsgEvent+sizeof(MSG_EVENT_TYPE_T)+sizeof(MSG_ERROR_T)+sizeof(int)), sizeof(int));
+               memcpy(&msgId, (void*)((char*)pMsgEvent+sizeof(MSG_EVENT_TYPE_T)+sizeof(msg_error_t)), sizeof(int));
+               memcpy(&extId, (void*)((char*)pMsgEvent+sizeof(MSG_EVENT_TYPE_T)+sizeof(msg_error_t)+sizeof(int)), sizeof(int));
 
                MSG_DEBUG("msgId [%d]", msgId);
                MSG_DEBUG("extId [%d]", extId);
@@ -685,23 +768,23 @@ void MsgProxyListener::handleEvent(const MSG_EVENT_S* pMsgEvent)
 
                        void* param = it->userParam;
 
-                       pfunc((MSG_HANDLE_T)pHandle, msgId, extId, param);
+                       pfunc((msg_handle_t)pHandle, msgId, extId, param);
                }
 
                mx.unlock();
        }
        else if (pMsgEvent->eventType == MSG_EVENT_PLG_STORAGE_CHANGE_IND)
        {
-               MSG_STORAGE_CHANGE_TYPE_T storageChangeType;
-               MSG_MSGID_LIST_S msgIdList;
-               memset(&msgIdList, 0x00, sizeof(MSG_MSGID_LIST_S));
+               msg_storage_change_type_t storageChangeType;
+               msg_id_list_s msgIdList;
+               memset(&msgIdList, 0x00, sizeof(msg_id_list_s));
 
                // Decode event data
-               memcpy(&storageChangeType, (void*)((char*)pMsgEvent+sizeof(MSG_EVENT_TYPE_T)+sizeof(MSG_ERROR_T)), sizeof(MSG_STORAGE_CHANGE_TYPE_T));
-               memcpy(&msgIdList.nCount, (void*)((char*)pMsgEvent+sizeof(MSG_EVENT_TYPE_T)+sizeof(MSG_ERROR_T)+sizeof(MSG_STORAGE_CHANGE_TYPE_T)), sizeof(int));
+               memcpy(&storageChangeType, (void*)((char*)pMsgEvent+sizeof(MSG_EVENT_TYPE_T)+sizeof(msg_error_t)), sizeof(msg_storage_change_type_t));
+               memcpy(&msgIdList.nCount, (void*)((char*)pMsgEvent+sizeof(MSG_EVENT_TYPE_T)+sizeof(msg_error_t)+sizeof(msg_storage_change_type_t)), sizeof(int));
 
                if(msgIdList.nCount > 0)
-                       msgIdList.msgIdList = (MSG_MESSAGE_ID_T*)((char*)pMsgEvent+sizeof(MSG_EVENT_TYPE_T)+sizeof(MSG_ERROR_T)+sizeof(MSG_STORAGE_CHANGE_TYPE_T)+sizeof(int));
+                       msgIdList.msgIdList = (msg_message_id_t*)((char*)pMsgEvent+sizeof(MSG_EVENT_TYPE_T)+sizeof(msg_error_t)+sizeof(msg_storage_change_type_t)+sizeof(int));
                else
                        msgIdList.msgIdList = NULL;
 
@@ -719,7 +802,7 @@ void MsgProxyListener::handleEvent(const MSG_EVENT_S* pMsgEvent)
 
                        void* param = it->userParam;
 
-                       pfunc((MSG_HANDLE_T)pHandle, storageChangeType, &msgIdList, param);
+                       pfunc((msg_handle_t)pHandle, storageChangeType, (msg_id_list_s*)&msgIdList, param);
                }
 
                mx.unlock();
diff --git a/test_app/CMakeLists.txt b/test_app/CMakeLists.txt
deleted file mode 100755 (executable)
index 1f3d70c..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-PROJECT(msg-server CXX)
-
-SET(CMAKE_SKIP_BUILD_RPATH TRUE)
-
-IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
-       SET(CMAKE_BUILD_TYPE "Debug")
-ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
-MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
-
-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -O0 -g -Wall")
-
-##########################################################
-# Define Test App
-##########################################################
-
-SET(TEST-APP-SRCS
-       ${CMAKE_SOURCE_DIR}/test_app/MsgTestSetting.cpp
-       ${CMAKE_SOURCE_DIR}/test_app/MsgTestStorage.cpp
-       ${CMAKE_SOURCE_DIR}/test_app/MsgTestTransport.cpp
-#      ${CMAKE_SOURCE_DIR}/test_app/MsgTestConvert.cpp
-       ${CMAKE_SOURCE_DIR}/test_app/MsgTestThreadView.cpp
-       ${CMAKE_SOURCE_DIR}/test_app/main.cpp
-)
-
-INCLUDE_DIRECTORIES(
-       ${CMAKE_SOURCE_DIR}/include/common
-       ${CMAKE_SOURCE_DIR}/include/mapi
-)
-
-INCLUDE(FindPkgConfig)
-pkg_check_modules(test_app_pkgs REQUIRED glib-2.0)
-
-FOREACH(flag ${test_app_pkgs_CFLAGS})
-       SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
-ENDFOREACH(flag)
-
-SET(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
-
-ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
-
-SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
-
-ADD_EXECUTABLE(msg-test-app ${TEST-APP-SRCS})
-TARGET_LINK_LIBRARIES(msg-test-app ${test_app_pkgs_LDFLAGS} ${MAPI-LIB})
-
-INSTALL(TARGETS msg-test-app DESTINATION bin)
-
diff --git a/test_app/MsgTestConvert.cpp b/test_app/MsgTestConvert.cpp
deleted file mode 100755 (executable)
index 7ba4126..0000000
+++ /dev/null
@@ -1,395 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-
-/*==================================================================================================
-                                         INCLUDE FILES
-==================================================================================================*/
-//#include <time.h>
-#include <iostream>
-#include <stdio.h>
-#include <string>
-#include <stdlib.h>
-using namespace std;
-
-#include "MsgConvertText.h"
-#include "MsgTestConvert.h"
-#include "main.h"
-
-/*==================================================================================================
-                                     FUNCTION IMPLEMENTATION
-==================================================================================================*/
-
-#define MAX_DUMP_COLUMN        16
-void MsgDumpTextToHex(const unsigned char *pText, int length)
-{
-       printf("\n\n=======================================\n");
-       printf("   Dump Text To Hex - Length :%d\n", length);
-       printf("=======================================");
-
-       for (int i = 0; i < length; i++ )
-       {
-               if ( i % MAX_DUMP_COLUMN == 0 )
-               {
-                       printf("\n\t");
-               }
-
-               printf("%02x ", pText[i]);
-       }
-
-       printf("\n=======================================\n\n");
-}
-
-
-const int MAX_TEST_BUFFER = 1000;
-
-void MsgTestConvertLocaleToUTF8()
-{
-       int localeStrLen = 0;
-       unsigned char localeString[MAX_TEST_BUFFER];
-       int utf8StrLen;
-       unsigned char utf8String[MAX_TEST_BUFFER];
-
-       printf("Input :\n");
-       cin.getline((char*)localeString, MAX_TEST_BUFFER);
-
-       localeStrLen = strlen((char*)localeString);
-       utf8StrLen = MsgConvertLocaleToUTF8(utf8String, MAX_TEST_BUFFER, localeString, localeStrLen);
-       if ( utf8StrLen <= 0 )
-       {
-               printf("MsgConvertLocaleToUTF8() failed. src string [%s]\n", localeString);
-               return;
-       }
-
-       printf("=== STRING DUMP ===\n");
-       printf("src : [%s]\n", localeString);
-       printf("dst : [%s]\n", utf8String);
-       MsgDumpTextToHex(localeString, localeStrLen);
-       MsgDumpTextToHex(utf8String, utf8StrLen);
-}
-
-
-/*
-File Format Example
-------
-(total bytes)
-(hexadecimal integer for 1 byte)s
-------
-4
-4D 61 69 6E
-------
-
-*/
-/**
-return:
-       byte length
-*/
-int MsgTestConvertReadTextFromFile(unsigned char *pStr)
-{
-       FILE *fp;
-       char filename[100];
-       int byteLength;
-       int i;
-       int c;
-
-       printf("Input file name: \n");
-       scanf("%s", filename);
-       if ( (fp = fopen(filename, "r")) == NULL )
-       {
-               printf("File Open failed. file name [%s]\n", filename);
-               return -1;
-       }
-
-       // read byte length of input text
-       fscanf(fp, "%d", &byteLength);
-
-       printf("read text from file[%s] - size:%d\n", filename, byteLength);
-       // read text
-       for ( i = 0; i < byteLength; i++ )
-       {
-               if ( fscanf(fp, "%x", &c) == EOF )
-                       break;
-               if ( c > 0xFF )
-               {
-                       printf("Wrong Input : index[%d] value [%x]\n", i, c);
-                       byteLength = -1;
-                       break;
-               }
-               pStr[i] = (char)(c & 0xFF);
-               //printf("%x\n", pStr[i]);
-       }
-
-       fclose(fp);
-
-       return byteLength;
-}
-
-void MsgTestConvertUTF8ToUCS2()
-{
-       int utf8StrLen = 0;
-       unsigned char utf8String[MAX_TEST_BUFFER];
-       int ucs2StrLen = 0;
-       WCHAR ucs2String[MAX_TEST_BUFFER];
-
-       utf8StrLen = MsgTestConvertReadTextFromFile(utf8String);
-       if ( utf8StrLen < 0 )
-       {
-               printf("Error - Read Text from File\n");
-               return;
-       }
-
-       //ucs2StrLen = MsgConvertUTF8toUCS2(ucs2String, MAX_TEST_BUFFER, utf8String);   // for null terminated utf8 string
-       ucs2StrLen = MsgConvertUTF8toUCS2((unsigned char *)ucs2String, MAX_TEST_BUFFER, utf8String, utf8StrLen);
-
-       printf("=== STRING DUMP ===\n");
-       printf("src: [%s]", utf8String);
-       MsgDumpTextToHex(utf8String, utf8StrLen);
-       MsgDumpTextToHex((unsigned char*)ucs2String, ucs2StrLen);
-
-}
-
-void MsgTestConvertUCS2ToUTF8()
-{
-       int utf8StrLen = 0;
-       unsigned char utf8String[MAX_TEST_BUFFER];
-       int ucs2StrLen = 0;
-       WCHAR ucs2String[MAX_TEST_BUFFER];
-
-       ucs2StrLen = MsgTestConvertReadTextFromFile((unsigned char*)ucs2String);
-       if ( ucs2StrLen < 0 )
-       {
-               printf("Error - Read Text from File\n");
-               return;
-       }
-
-       utf8StrLen = MsgConvertUCS2toUTF8(utf8String, MAX_TEST_BUFFER, (unsigned char *)ucs2String, ucs2StrLen);
-
-       printf("=== STRING DUMP ===\n");
-       printf("dst: [%s]", utf8String);
-       MsgDumpTextToHex((unsigned char*)ucs2String, ucs2StrLen);
-       MsgDumpTextToHex(utf8String, utf8StrLen);
-}
-
-void MsgTestConvertGSM7bitToUCS2()
-{
-       int gsm7bitStrLen = 0;
-       unsigned char gsm7bitString[MAX_TEST_BUFFER];
-       int ucs2StrLen = 0;
-       WCHAR ucs2String[MAX_TEST_BUFFER];
-
-       gsm7bitStrLen = MsgTestConvertReadTextFromFile(gsm7bitString);
-       if ( gsm7bitStrLen < 0 )
-       {
-               printf("Error - Read Text from File\n");
-               return;
-       }
-
-       ucs2StrLen = MsgConvertGSM7bitToUCS2((unsigned char *)ucs2String, MAX_TEST_BUFFER, gsm7bitString, gsm7bitStrLen);
-
-       printf("=== STRING DUMP ===\n");
-       MsgDumpTextToHex(gsm7bitString, gsm7bitStrLen);
-       MsgDumpTextToHex((unsigned char*)ucs2String, ucs2StrLen);
-}
-
-void MsgTestConvertUCS2ToGSM7bit()
-{
-       int ucs2StrLen = 0;
-       WCHAR ucs2String[MAX_TEST_BUFFER];
-       int gsm7bitStrLen = 0;
-       unsigned char gsm7bitString[MAX_TEST_BUFFER];
-
-       ucs2StrLen = MsgTestConvertReadTextFromFile((unsigned char*)ucs2String);
-       if ( ucs2StrLen < 0 )
-       {
-               printf("Error - Read Text from File\n");
-               return;
-       }
-
-       bool bUnknown = false;
-       MSG_LANGUAGE_ID_T langId = MSG_LANG_ID_RESERVED;
-       gsm7bitStrLen = MsgConvertUCS2toGSM7bit(gsm7bitString, MAX_TEST_BUFFER, (unsigned char *)ucs2String, ucs2StrLen, &bUnknown, &langId);
-
-       printf("=== STRING DUMP ===");
-       MsgDumpTextToHex((unsigned char*)ucs2String, ucs2StrLen);
-       MsgDumpTextToHex(gsm7bitString, gsm7bitStrLen);
-}
-
-void MsgTestConvertGSM7BitToUTF8()
-{
-       int gsm7bitStrLen = 0;
-       unsigned char gsm7bitString[MAX_TEST_BUFFER];
-       int utf8StrLen = 0;
-       unsigned char utf8String[MAX_TEST_BUFFER];
-
-       gsm7bitStrLen = MsgTestConvertReadTextFromFile(gsm7bitString);
-       if ( gsm7bitStrLen < 0 )
-       {
-               printf("Error - Read Text from File\n");
-               return;
-       }
-
-       memset(utf8String, 0x00, sizeof(utf8String));
-       utf8StrLen = MsgConvertGSM7bitToUTF8(utf8String, MAX_TEST_BUFFER, gsm7bitString, gsm7bitStrLen);
-
-       printf("=== STRING DUMP ===\n");
-       printf("dest(UTF8) : [%s]\n", utf8String);
-       MsgDumpTextToHex(gsm7bitString, gsm7bitStrLen);
-       MsgDumpTextToHex(utf8String, utf8StrLen);
-}
-
-void MsgTestConvertUTF8ToGSM7bit()
-{
-       int utf8StrLen = 0;
-       unsigned char utf8String[MAX_TEST_BUFFER];
-       int gsm7bitStrLen = 0;
-       unsigned char gsm7bitString[MAX_TEST_BUFFER];
-
-       utf8StrLen = MsgTestConvertReadTextFromFile(utf8String);
-       if ( utf8StrLen < 0 )
-       {
-               printf("Error - Read Text from File\n");
-               return;
-       }
-
-       MSG_LANGUAGE_ID_T langId = MSG_LANG_ID_RESERVED;
-       gsm7bitStrLen = MsgConvertUTF8ToGSM7bit(gsm7bitString, MAX_TEST_BUFFER, utf8String, utf8StrLen, &langId);
-
-       printf("=== STRING DUMP ===\n");
-       MsgDumpTextToHex(utf8String, utf8StrLen);
-       MsgDumpTextToHex(gsm7bitString, gsm7bitStrLen);
-}
-
-void MsgTestConvertUTF8ToUCS2Key()
-{
-       int utf8StrLen = 0;
-       unsigned char utf8String[MAX_TEST_BUFFER];
-       int ucs2StrLen = 0;
-       WCHAR ucs2String[MAX_TEST_BUFFER];
-
-       printf("Input :\n");
-       cin.getline((char *)utf8String, MAX_TEST_BUFFER);
-
-       utf8StrLen = strlen((char *)utf8String);
-
-       ucs2StrLen = MsgConvertUTF8toUCS2((unsigned char *)ucs2String, MAX_TEST_BUFFER, utf8String);    // for null terminated utf8 string
-       //ucs2StrLen = MsgConvertUTF8toUCS2(ucs2String, MAX_TEST_BUFFER, utf8String, utf8StrLen);
-
-       printf("=== STRING DUMP ===\n");
-       printf("src: [%s]", utf8String);
-       MsgDumpTextToHex(utf8String, utf8StrLen);
-       MsgDumpTextToHex((unsigned char*)ucs2String, ucs2StrLen);
-
-}
-
-void MsgTestConvertUTF8ToGSM7bitKey()
-{
-       int utf8StrLen = 0;
-       unsigned char utf8String[MAX_TEST_BUFFER];
-       int gsm7bitStrLen = 0;
-       unsigned char gsm7bitString[MAX_TEST_BUFFER];
-
-       printf("Input :\n");
-       cin.getline((char *)utf8String, MAX_TEST_BUFFER);
-
-       utf8StrLen = strlen((char *)utf8String);
-
-       MSG_LANGUAGE_ID_T langId = MSG_LANG_ID_RESERVED;
-       gsm7bitStrLen = MsgConvertUTF8ToGSM7bit(gsm7bitString, MAX_TEST_BUFFER, utf8String, utf8StrLen, &langId);       // for null terminated utf8 string
-
-       printf("=== STRING DUMP ===\n");
-       MsgDumpTextToHex(utf8String, utf8StrLen);
-       MsgDumpTextToHex(gsm7bitString, gsm7bitStrLen);
-}
-
-
-void MsgTestConvertSelectMenu( char *pMenu)
-{
-       int menuNum = atoi(pMenu);
-
-       switch ( menuNum )
-       {
-               case 0: // quit
-                       return;
-               case 1: // Locale -> UTF8
-                       MsgTestConvertLocaleToUTF8();
-                       break;
-               case 2: // UTF-8 -> UCS2
-                       MsgTestConvertUTF8ToUCS2();
-                       break;
-               case 3: // UCS2 -> UTF-8
-                       MsgTestConvertUCS2ToUTF8();
-                       break;
-               case 4: // GSM 7bit -> UCS2
-                       MsgTestConvertGSM7bitToUCS2();
-                       break;
-               case 5: // UCS2 -> GSM 7bit
-                       MsgTestConvertUCS2ToGSM7bit();
-                       break;
-               case 6: // GSM 7bit -> UTF-8
-                       MsgTestConvertGSM7BitToUTF8();
-                       break;
-               case 7: // UTF-8 -> GSM 7bit
-                       MsgTestConvertUTF8ToGSM7bit();
-                       break;
-               case 8:
-                       MsgTestConvertUTF8ToUCS2Key();
-                       break;
-               case 9:
-                       MsgTestConvertUTF8ToGSM7bitKey();
-                       break;
-               default:
-                       printf("Invalid Menu. Select Again\n");
-                       break;
-       }
-}
-
-// main function for testing converting
-MSG_ERROR_T MsgTestConvertMain()
-{
-       char menu[3];
-
-       do
-       {
-//             system("clear");
-
-               printf("=======================\n");
-               printf("    Convert Test                     \n");
-               printf("=======================\n");
-               printf("[1] locale -> UTF8 - (Keyboard input)\n");
-               printf("[2] UTF8 -> UCS2 - (File)\n");
-               printf("[3] UCS2 -> UTF8 - (File)\n");
-               printf("[4] GSM 7bit -> UCS2 - (File)\n");
-               printf("[5] UCS2 -> GSM 7bit - (File)\n");
-               printf("[6] GSM 7bit -> UTF8 - (File)\n");
-               printf("[7] UTF8 -> GSM 7bit - (File)\n");
-               printf("[8] UTF8 -> UCS2 - (Keyboard)\n");
-               printf("[9] UTF8 -> GSM 7bit - (Keyboard)\n");
-               printf("[0] Return to Main Menu\n");
-               printf("=======================\n");
-
-               printf("Select Test Menu : ");
-
-               memset(menu, 0x00, sizeof(menu));
-               cin.getline(menu, 3);
-
-               MsgTestConvertSelectMenu(menu);
-       }
-       while ( strcmp(menu, "0") != 0 );
-
-       return 0;
-}
-
-
diff --git a/test_app/MsgTestConvert.h b/test_app/MsgTestConvert.h
deleted file mode 100755 (executable)
index 8e0be80..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-
-#ifndef MSG_TEST_CONVERT_H
-#define MSG_TEST_CONVERT_H
-
-/*==================================================================================================
-                                         INCLUDE FILES
-==================================================================================================*/
-#include "MsgTypes.h"
-
-
-/*==================================================================================================
-                                     FUNCTION PROTOTYPES
-==================================================================================================*/
-
-
-MSG_ERROR_T MsgTestConvertMain();
-
-
-#endif //MSG_TEST_CONVERT_H
-
diff --git a/test_app/MsgTestSetting.cpp b/test_app/MsgTestSetting.cpp
deleted file mode 100755 (executable)
index 5f8fc59..0000000
+++ /dev/null
@@ -1,1082 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-
-/*==================================================================================================
-                                         INCLUDE FILES
-==================================================================================================*/
-#include <iostream>
-#include <string>
-#include <stdlib.h>
-using namespace std;
-
-#include "MapiSetting.h"
-#include "MsgTestSetting.h"
-#include "main.h"
-
-/*==================================================================================================
-                                     FUNCTION IMPLEMENTATION
-==================================================================================================*/
-void MsgTestSettingMain(MSG_HANDLE_T hMsgHandle)
-{
-       if (hMsgHandle == NULL)
-       {
-               MSG_DEBUG("Handle is NULL");
-               return;
-       }
-
-       char menu[2];
-
-       do
-       {
-               system ("clear");
-
-               print("======================================");
-               print("============ Setting Menu ============");
-               print("======================================");
-               print("[1] General Options");
-               print("[2] SMS Send Options");
-               print("[3] SMSC List");
-               print("[4] MMS Send Options");
-               print("[5] MMS Recv Options");
-               print("[6] MMS Style Options");
-               print("[7] Push Msg Options");
-               print("[8] CB Msg Options");
-               print("[0] Voice Mail Option");
-               print("[A] Msg Size Option");
-               print("[B] Back");
-               print("======================================");
-
-               print("Input : ");
-
-               memset(menu, 0x00, sizeof(menu));
-               cin.getline(menu, 2);
-
-               MsgSelectMenu(hMsgHandle, menu);
-       }
-       while (strcmp(menu, "B"));
-}
-
-
-void MsgSelectMenu(MSG_HANDLE_T hMsgHandle, char *pMenu)
-{
-       if (!strcmp(pMenu, "1"))
-       {
-               MsgTestGeneralOpt(hMsgHandle);
-       }
-       else if (!strcmp(pMenu, "2"))
-       {
-               MsgTestSMSSendOpt(hMsgHandle);
-       }
-       else if (!strcmp(pMenu, "3"))
-       {
-               MsgTestSMSCList(hMsgHandle);
-       }
-       else if (!strcmp(pMenu, "4"))
-       {
-               MsgTestMMSSendOpt(hMsgHandle);
-       }
-       else if (!strcmp(pMenu, "5"))
-       {
-               MsgTestMMSRecvOpt(hMsgHandle);
-       }
-       else if (!strcmp(pMenu, "6"))
-       {
-               MsgTestMMSStyleOpt(hMsgHandle);
-       }
-       else if (!strcmp(pMenu, "7"))
-       {
-               MsgTestPushMsgOpt(hMsgHandle);
-       }
-       else if (!strcmp(pMenu, "8"))
-       {
-               MsgTestCBMsgOpt(hMsgHandle);
-       }
-       else if (!strcmp(pMenu, "0"))
-       {
-               MsgTestVoiceMailOpt(hMsgHandle);
-       }
-       else if (!strcmp(pMenu, "A"))
-       {
-               MsgTestMsgSizeOpt(hMsgHandle);
-       }
-}
-
-
-void MsgTestGeneralOpt(MSG_HANDLE_T hMsgHandle)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       char menu[2];
-       char strPrint [512];
-
-       MSG_SETTING_S setting;
-
-       do
-       {
-               memset(&setting, 0x00, sizeof(MSG_OPTION_TYPE_T)+sizeof(MSG_GENERAL_OPT_S));
-
-               setting.type = MSG_GENERAL_OPT;
-
-               err = msg_get_config(hMsgHandle, &setting);
-
-               system ("clear");
-
-               print("======================================");
-               print("=========== General Option ===========");
-               print("======================================");
-
-               memset(strPrint, 0x00, sizeof(strPrint));
-               snprintf(strPrint, sizeof(strPrint), "Keep a Copy : [%d]", setting.option.generalOpt.bKeepCopy);
-               print(strPrint);
-
-               memset(strPrint, 0x00, sizeof(strPrint));
-               snprintf(strPrint, sizeof(strPrint), "Alert Tone : [%d]", setting.option.generalOpt.alertTone);
-               print(strPrint);
-
-               print("======================================");
-               print("================ Menu ================");
-               print("[U] Update Options");
-               print("[B] Back");
-               print("======================================");
-
-               print("Input : ");
-
-               memset(menu, 0x00, sizeof(menu));
-               cin.getline(menu, 2);
-
-               if (!strcmp(menu, "U"))
-               {
-                       memset(&setting, 0x00, sizeof(MSG_OPTION_TYPE_T)+sizeof(MSG_GENERAL_OPT_S));
-
-                       setting.type = MSG_GENERAL_OPT;
-
-                       setting.option.generalOpt.bKeepCopy = true;
-                       setting.option.generalOpt.alertTone = MSG_ALERT_TONE_ONCE;
-               }
-               else if (!strcmp(menu, "B"))
-               {
-                       break;
-               }
-               else
-               {
-                       continue;
-               }
-
-               err = msg_set_config(hMsgHandle, &setting);
-
-               if (err == MSG_SUCCESS)
-                       print("Setting Config Data is OK!");
-               else
-                       print("Setting Config Data is failed!");
-       }
-       while (1);
-}
-
-
-void MsgTestSMSSendOpt(MSG_HANDLE_T hMsgHandle)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       char menu[2];
-       char strPrint [512];
-
-       MSG_SETTING_S setting;
-
-       do
-       {
-               memset(&setting, 0x00, sizeof(MSG_OPTION_TYPE_T)+sizeof(MSG_SMS_SENDOPT_S));
-
-               setting.type = MSG_SMS_SENDOPT;
-
-               err = msg_get_config(hMsgHandle, &setting);
-
-               system ("clear");
-
-               print("======================================");
-               print("=========== SMS Send Option ===========");
-               print("======================================");
-
-               memset(strPrint, 0x00, sizeof(strPrint));
-               snprintf(strPrint, sizeof(strPrint), "DCS : [%d]", setting.option.smsSendOpt.dcs);
-               print(strPrint);
-
-               memset(strPrint, 0x00, sizeof(strPrint));
-               snprintf(strPrint, sizeof(strPrint), "Network Selection : [%d]", setting.option.smsSendOpt.netMode);
-               print(strPrint);
-
-               memset(strPrint, 0x00, sizeof(strPrint));
-               snprintf(strPrint, sizeof(strPrint), "Reply Path : [%d]", setting.option.smsSendOpt.bReplyPath);
-               print(strPrint);
-
-               memset(strPrint, 0x00, sizeof(strPrint));
-               snprintf(strPrint, sizeof(strPrint), "Delivery Report : [%d]", setting.option.smsSendOpt.bDeliveryReport);
-               print(strPrint);
-
-               memset(strPrint, 0x00, sizeof(strPrint));
-               snprintf(strPrint, sizeof(strPrint), "Save Storage : [%d]", setting.option.smsSendOpt.saveStorage);
-               print(strPrint);
-
-               print("======================================");
-               print("================ Menu ================");
-               print("[U] Update Options");
-               print("[B] Back");
-               print("======================================");
-
-               print("Input : ");
-
-               memset(menu, 0x00, sizeof(menu));
-               cin.getline(menu, 2);
-
-               if (!strcmp(menu, "U"))
-               {
-                       memset(&setting, 0x00, sizeof(MSG_OPTION_TYPE_T)+sizeof(MSG_SMS_SENDOPT_S));
-
-                       setting.type = MSG_SMS_SENDOPT;
-
-                       setting.option.smsSendOpt.dcs = MSG_ENCODE_AUTO;
-                       setting.option.smsSendOpt.netMode = MSG_SMS_NETWORK_CS_ONLY;
-                       setting.option.smsSendOpt.bReplyPath = false;
-                       setting.option.smsSendOpt.bDeliveryReport = true;
-                       setting.option.smsSendOpt.saveStorage = MSG_SMS_SAVE_STORAGE_PHONE;
-               }
-               else if (!strcmp(menu, "B"))
-               {
-                       break;
-               }
-               else
-               {
-                       continue;
-               }
-
-               err = msg_set_config(hMsgHandle, &setting);
-
-               if (err == MSG_SUCCESS)
-                       print("Setting Config Data is OK!");
-               else
-                       print("Setting Config Data is failed!");
-       }
-       while (1);
-}
-
-
-void MsgTestSMSCList(MSG_HANDLE_T hMsgHandle)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       char menu[2];
-       char strPrint [512];
-
-       MSG_SETTING_S setting;
-
-       do
-       {
-               memset(&setting, 0x00, sizeof(MSG_OPTION_TYPE_T)+sizeof(MSG_SMSC_LIST_S));
-
-               setting.type = MSG_SMSC_LIST;
-
-               err = msg_get_config(hMsgHandle, &setting);
-
-               system ("clear");
-
-               print("======================================");
-               print("============== SMSC List ==============");
-               print("======================================");
-
-               memset(strPrint, 0x00, sizeof(strPrint));
-               snprintf(strPrint, sizeof(strPrint), "Total Count : [%d]", setting.option.smscList.totalCnt);
-               print(strPrint);
-
-               memset(strPrint, 0x00, sizeof(strPrint));
-               snprintf(strPrint, sizeof(strPrint), "Selected SMSC : [%d]", setting.option.smscList.selected);
-               print(strPrint);
-
-               for (int i = 0; i < setting.option.smscList.totalCnt; i++)
-               {
-                       print("======================================");
-
-                       memset(strPrint, 0x00, sizeof(strPrint));
-                       snprintf(strPrint, sizeof(strPrint), "SMSC Name : [%s]", setting.option.smscList.smscData[i].name);
-                       print(strPrint);
-
-                       memset(strPrint, 0x00, sizeof(strPrint));
-                       snprintf(strPrint, sizeof(strPrint), "SMSC Address : [%s]", setting.option.smscList.smscData[i].smscAddr.address);
-                       print(strPrint);
-
-                       memset(strPrint, 0x00, sizeof(strPrint));
-                       snprintf(strPrint, sizeof(strPrint), "SMSC PID : [%d]", setting.option.smscList.smscData[i].pid);
-                       print(strPrint);
-
-                       memset(strPrint, 0x00, sizeof(strPrint));
-                       snprintf(strPrint, sizeof(strPrint), "SMSC VAL PERIOD : [%d]", setting.option.smscList.smscData[i].valPeriod);
-                       print(strPrint);
-
-                       memset(strPrint, 0x00, sizeof(strPrint));
-                       snprintf(strPrint, sizeof(strPrint), "SMSC TON : [%d]", setting.option.smscList.smscData[i].smscAddr.ton);
-                       print(strPrint);
-
-                       memset(strPrint, 0x00, sizeof(strPrint));
-                       snprintf(strPrint, sizeof(strPrint), "SMSC NPI : [%d]", setting.option.smscList.smscData[i].smscAddr.npi);
-                       print(strPrint);
-               }
-
-               print("======================================");
-               print("================ Menu ================");
-               print("[A] Add New SMSC");
-               print("[U] Update SMSC");
-               print("[D] Delete SMSC");
-               print("[B] Back");
-               print("======================================");
-
-               print("Input : ");
-
-               memset(menu, 0x00, sizeof(menu));
-               cin.getline(menu, 2);
-
-               if (!strcmp(menu, "A"))
-               {
-                       continue;
-               }
-               else if (!strcmp(menu, "U"))
-               {
-                       memset(&setting, 0x00, sizeof(MSG_OPTION_TYPE_T)+sizeof(MSG_SMSC_LIST_S));
-
-                       setting.type = MSG_SMSC_LIST;
-
-                       setting.option.smscList.selected = 0;
-                       setting.option.smscList.totalCnt = 1;
-                       setting.option.smscList.smscData[0].pid = MSG_PID_TEXT;
-                       setting.option.smscList.smscData[0].valPeriod = MSG_VAL_MAXIMUM;
-                       snprintf(setting.option.smscList.smscData[0].name, SMSC_NAME_MAX, "%s", "SMS Centre 1");
-
-                       setting.option.smscList.smscData[0].smscAddr.ton = MSG_TON_INTERNATIONAL;
-                       setting.option.smscList.smscData[0].smscAddr.npi = MSG_NPI_ISDN;
-                       snprintf(setting.option.smscList.smscData[0].smscAddr.address, SMSC_ADDR_MAX, "%s", "1111");
-               }
-               else if (!strcmp(menu, "D"))
-               {
-                       continue;
-               }
-               else if (!strcmp(menu, "B"))
-               {
-                       break;
-               }
-               else
-               {
-                       continue;
-               }
-
-               err = msg_set_config(hMsgHandle, &setting);
-
-               if (err == MSG_SUCCESS)
-                       print("Setting Config Data is OK!");
-               else
-                       print("Setting Config Data is failed!");
-       }
-       while (1);
-}
-
-
-void MsgTestMMSSendOpt(MSG_HANDLE_T hMsgHandle)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       char menu[2];
-       char strPrint [512];
-
-       MSG_SETTING_S setting;
-
-       do
-       {
-               memset(&setting, 0x00, sizeof(MSG_OPTION_TYPE_T)+sizeof(MSG_MMS_SENDOPT_S));
-
-               setting.type = MSG_MMS_SENDOPT;
-
-               err = msg_get_config(hMsgHandle, &setting);
-
-               system ("clear");
-
-               print("======================================");
-               print("=========== MMS Send Option ===========");
-               print("======================================");
-
-               memset(strPrint, 0x00, sizeof(strPrint));
-               snprintf(strPrint, sizeof(strPrint), "Msg Class : [%d]", setting.option.mmsSendOpt.msgClass);
-               print(strPrint);
-
-               memset(strPrint, 0x00, sizeof(strPrint));
-               snprintf(strPrint, sizeof(strPrint), "Priority : [%d]", setting.option.mmsSendOpt.priority);
-               print(strPrint);
-
-               memset(strPrint, 0x00, sizeof(strPrint));
-               snprintf(strPrint, sizeof(strPrint), "Expiry Time : [%d]", setting.option.mmsSendOpt.expiryTime);
-               print(strPrint);
-
-               memset(strPrint, 0x00, sizeof(strPrint));
-               snprintf(strPrint, sizeof(strPrint), "Delivery Time : [%d]", setting.option.mmsSendOpt.deliveryTime);
-               print(strPrint);
-
-               memset(strPrint, 0x00, sizeof(strPrint));
-               snprintf(strPrint, sizeof(strPrint), "Custom Delivery Time : [%d]", setting.option.mmsSendOpt.customDeliveryTime);
-               print(strPrint);
-
-               memset(strPrint, 0x00, sizeof(strPrint));
-               snprintf(strPrint, sizeof(strPrint), "Sender Visibility : [%d]", setting.option.mmsSendOpt.bSenderVisibility);
-               print(strPrint);
-
-               memset(strPrint, 0x00, sizeof(strPrint));
-               snprintf(strPrint, sizeof(strPrint), "Delivery Report : [%d]", setting.option.mmsSendOpt.bDeliveryReport);
-               print(strPrint);
-
-               memset(strPrint, 0x00, sizeof(strPrint));
-               snprintf(strPrint, sizeof(strPrint), "Read Reply : [%d]", setting.option.mmsSendOpt.bReadReply);
-               print(strPrint);
-
-               memset(strPrint, 0x00, sizeof(strPrint));
-               snprintf(strPrint, sizeof(strPrint), "Keep Copy : [%d]", setting.option.mmsSendOpt.bKeepCopy);
-               print(strPrint);
-
-               memset(strPrint, 0x00, sizeof(strPrint));
-               snprintf(strPrint, sizeof(strPrint), "Body Replying : [%d]", setting.option.mmsSendOpt.bBodyReplying);
-               print(strPrint);
-
-               memset(strPrint, 0x00, sizeof(strPrint));
-               snprintf(strPrint, sizeof(strPrint), "Hide Recipients : [%d]", setting.option.mmsSendOpt.bHideRecipients);
-               print(strPrint);
-
-               memset(strPrint, 0x00, sizeof(strPrint));
-               snprintf(strPrint, sizeof(strPrint), "Reply Charging : [%d]", setting.option.mmsSendOpt.replyCharging);
-               print(strPrint);
-
-               memset(strPrint, 0x00, sizeof(strPrint));
-               snprintf(strPrint, sizeof(strPrint), "Reply Charging Deadline : [%d]", setting.option.mmsSendOpt.replyChargingDeadline);
-               print(strPrint);
-
-               memset(strPrint, 0x00, sizeof(strPrint));
-               snprintf(strPrint, sizeof(strPrint), "Reply Charging Size : [%d]", setting.option.mmsSendOpt.replyChargingSize);
-               print(strPrint);
-
-               memset(strPrint, 0x00, sizeof(strPrint));
-               snprintf(strPrint, sizeof(strPrint), "Creation Mode : [%d]", setting.option.mmsSendOpt.creationMode);
-               print(strPrint);
-
-               print("======================================");
-               print("================ Menu ================");
-               print("[U] Update Options");
-               print("[B] Back");
-               print("======================================");
-
-               print("Input : ");
-
-               memset(menu, 0x00, sizeof(menu));
-               cin.getline(menu, 2);
-
-               if (!strcmp(menu, "U"))
-               {
-                       memset(&setting, 0x00, sizeof(MSG_OPTION_TYPE_T)+sizeof(MSG_MMS_SENDOPT_S));
-
-                       setting.type = MSG_MMS_SENDOPT;
-
-                       setting.option.mmsSendOpt.msgClass = MSG_CLASS_AUTO;
-                       setting.option.mmsSendOpt.priority = MSG_MESSAGE_PRIORITY_NORMAL;
-                       setting.option.mmsSendOpt.expiryTime = MSG_EXPIRY_TIME_1DAY;
-                       setting.option.mmsSendOpt.deliveryTime = MSG_DELIVERY_TIME_IMMEDIATLY;
-                       setting.option.mmsSendOpt.customDeliveryTime = 0;
-                       setting.option.mmsSendOpt.bSenderVisibility = false;
-                       setting.option.mmsSendOpt.bDeliveryReport = true;
-                       setting.option.mmsSendOpt.bReadReply = false;
-                       setting.option.mmsSendOpt.bKeepCopy = false;
-                       setting.option.mmsSendOpt.bBodyReplying = false;
-                       setting.option.mmsSendOpt.bHideRecipients = false;
-                       setting.option.mmsSendOpt.replyCharging = MSG_REPLY_CHARGING_NONE;
-                       setting.option.mmsSendOpt.replyChargingDeadline = 0;
-                       setting.option.mmsSendOpt.replyChargingSize = 0;
-                       setting.option.mmsSendOpt.creationMode = MSG_CREATION_MODE_FREE;
-               }
-               else if (!strcmp(menu, "B"))
-               {
-                       break;
-               }
-               else
-               {
-                       continue;
-               }
-
-               err = msg_set_config(hMsgHandle, &setting);
-
-               if (err == MSG_SUCCESS)
-                       print("Setting Config Data is OK!");
-               else
-                       print("Setting Config Data is failed!");
-       }
-       while (1);
-}
-
-
-void MsgTestMMSRecvOpt(MSG_HANDLE_T hMsgHandle)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       char menu[2];
-       char strPrint [512];
-
-       MSG_SETTING_S setOption;
-       MSG_SETTING_S getOption;
-
-       do
-       {
-               memset(&getOption, 0x00, sizeof(MSG_OPTION_TYPE_T)+sizeof(MSG_MMS_RECVOPT_S));
-
-               getOption.type = MSG_MMS_RECVOPT;
-
-               err = msg_get_config(hMsgHandle, &getOption);
-
-               system ("clear");
-
-               print("======================================");
-               print("=========== MMS Recv Option ===========");
-               print("======================================");
-
-               memset(strPrint, 0x00, sizeof(strPrint));
-               snprintf(strPrint, sizeof(strPrint), "Home Network : [%d]", getOption.option.mmsRecvOpt.homeNetwork);
-               print(strPrint);
-
-               memset(strPrint, 0x00, sizeof(strPrint));
-               snprintf(strPrint, sizeof(strPrint), "Abroad Network : [%d]", getOption.option.mmsRecvOpt.abroadNetwok);
-               print(strPrint);
-
-               memset(strPrint, 0x00, sizeof(strPrint));
-               snprintf(strPrint, sizeof(strPrint), "Read Receipt : [%d]", getOption.option.mmsRecvOpt.readReceipt);
-               print(strPrint);
-
-               memset(strPrint, 0x00, sizeof(strPrint));
-               snprintf(strPrint, sizeof(strPrint), "Delivery Receipt : [%d]", getOption.option.mmsRecvOpt.bDeliveryReceipt);
-               print(strPrint);
-
-               memset(strPrint, 0x00, sizeof(strPrint));
-               snprintf(strPrint, sizeof(strPrint), "Reject Unknown : [%d]", getOption.option.mmsRecvOpt.bRejectUnknown);
-               print(strPrint);
-
-               memset(strPrint, 0x00, sizeof(strPrint));
-               snprintf(strPrint, sizeof(strPrint), "Reject Advertisement : [%d]", getOption.option.mmsRecvOpt.bRejectAdvertisement);
-               print(strPrint);
-
-               print("======================================");
-               print("================ Menu ================");
-               print("[U] Update Options");
-               print("[B] Back");
-               print("======================================");
-
-               print("Input : ");
-
-               memset(menu, 0x00, sizeof(menu));
-               cin.getline(menu, 2);
-
-               if (!strcmp(menu, "U"))
-               {
-                       memset(&setOption, 0x00, sizeof(MSG_OPTION_TYPE_T)+sizeof(MSG_MMS_RECVOPT_S));
-
-                       setOption.type = MSG_MMS_RECVOPT;
-
-                       setOption.option.mmsRecvOpt.homeNetwork = MSG_HOME_AUTO_DOWNLOAD;
-                       setOption.option.mmsRecvOpt.abroadNetwok = MSG_ABROAD_RESTRICTED;
-                       setOption.option.mmsRecvOpt.readReceipt = false;
-                       setOption.option.mmsRecvOpt.bDeliveryReceipt = true;
-                       setOption.option.mmsRecvOpt.bRejectUnknown = false;
-                       setOption.option.mmsRecvOpt.bRejectAdvertisement = false;
-
-                       err = msg_set_config(hMsgHandle, &setOption);
-
-                       if (err == MSG_SUCCESS)
-                               print("Setting Config Data is OK!");
-                       else
-                               print("Setting Config Data is failed!");
-               }
-               else if (!strcmp(menu, "B"))
-               {
-                       break;
-               }
-               else
-               {
-                       continue;
-               }
-       }
-       while (1);
-}
-
-
-void MsgTestMMSStyleOpt(MSG_HANDLE_T hMsgHandle)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       char menu[2];
-       char strPrint [512];
-
-       MSG_SETTING_S setOption;
-       MSG_SETTING_S getOption;
-
-       do
-       {
-               memset(&getOption, 0x00, sizeof(MSG_OPTION_TYPE_T)+sizeof(MSG_MMS_STYLEOPT_S));
-
-               getOption.type = MSG_MMS_STYLEOPT;
-
-               err = msg_get_config(hMsgHandle, &getOption);
-
-               system ("clear");
-
-               print("======================================");
-               print("=========== MMS Style Option ===========");
-               print("======================================");
-
-               memset(strPrint, 0x00, sizeof(strPrint));
-               snprintf(strPrint, sizeof(strPrint), "Font Size : [%d]", getOption.option.mmsStyleOpt.fontSize);
-               print(strPrint);
-
-               memset(strPrint, 0x00, sizeof(strPrint));
-               snprintf(strPrint, sizeof(strPrint), "Font Style (Bold) : [%d]", getOption.option.mmsStyleOpt.bFontStyleBold);
-               print(strPrint);
-
-               memset(strPrint, 0x00, sizeof(strPrint));
-               snprintf(strPrint, sizeof(strPrint), "Font Style (Italic) : [%d]", getOption.option.mmsStyleOpt.bFontStyleItalic);
-               print(strPrint);
-
-               memset(strPrint, 0x00, sizeof(strPrint));
-               snprintf(strPrint, sizeof(strPrint), "Font Style (Underline) : [%d]", getOption.option.mmsStyleOpt.bFontStyleUnderline);
-               print(strPrint);
-
-               memset(strPrint, 0x00, sizeof(strPrint));
-               snprintf(strPrint, sizeof(strPrint), "Font Color (Red) : [%d]", getOption.option.mmsStyleOpt.fontColorRed);
-               print(strPrint);
-
-               memset(strPrint, 0x00, sizeof(strPrint));
-               snprintf(strPrint, sizeof(strPrint), "Font Color (Green) : [%d]", getOption.option.mmsStyleOpt.fontColorGreen);
-               print(strPrint);
-
-               memset(strPrint, 0x00, sizeof(strPrint));
-               snprintf(strPrint, sizeof(strPrint), "Font Color (Blue) : [%d]", getOption.option.mmsStyleOpt.fontColorBlue);
-               print(strPrint);
-
-               memset(strPrint, 0x00, sizeof(strPrint));
-               snprintf(strPrint, sizeof(strPrint), "Font Color (Hue) : [%d]", getOption.option.mmsStyleOpt.fontColorHue);
-               print(strPrint);
-
-               memset(strPrint, 0x00, sizeof(strPrint));
-               snprintf(strPrint, sizeof(strPrint), "BG Color (Red) : [%d]", getOption.option.mmsStyleOpt.bgColorRed);
-               print(strPrint);
-
-               memset(strPrint, 0x00, sizeof(strPrint));
-               snprintf(strPrint, sizeof(strPrint), "BG Color (Green) : [%d]", getOption.option.mmsStyleOpt.bgColorGreen);
-               print(strPrint);
-
-               memset(strPrint, 0x00, sizeof(strPrint));
-               snprintf(strPrint, sizeof(strPrint), "BG Color (Blue) : [%d]", getOption.option.mmsStyleOpt.bgColorBlue);
-               print(strPrint);
-
-               memset(strPrint, 0x00, sizeof(strPrint));
-               snprintf(strPrint, sizeof(strPrint), "BG Color (Hue) : [%d]", getOption.option.mmsStyleOpt.bgColorHue);
-               print(strPrint);
-
-               memset(strPrint, 0x00, sizeof(strPrint));
-               snprintf(strPrint, sizeof(strPrint), "Page Duration : [%d]", getOption.option.mmsStyleOpt.pageDur);
-               print(strPrint);
-
-               memset(strPrint, 0x00, sizeof(strPrint));
-               snprintf(strPrint, sizeof(strPrint), "Page Custom Duration : [%d]", getOption.option.mmsStyleOpt.pageCustomDur);
-               print(strPrint);
-
-               memset(strPrint, 0x00, sizeof(strPrint));
-               snprintf(strPrint, sizeof(strPrint), "Page Duration Manual : [%d]", getOption.option.mmsStyleOpt.pageDurManual);
-               print(strPrint);
-
-               print("======================================");
-               print("================ Menu ================");
-               print("[U] Update Options");
-               print("[B] Back");
-               print("======================================");
-
-               print("Input : ");
-
-               memset(menu, 0x00, sizeof(menu));
-               cin.getline(menu, 2);
-
-               if (!strcmp(menu, "U"))
-               {
-                       memset(&setOption, 0x00, sizeof(MSG_OPTION_TYPE_T)+sizeof(MSG_MMS_STYLEOPT_S));
-
-                       setOption.type = MSG_MMS_STYLEOPT;
-
-                       setOption.option.mmsStyleOpt.fontSize = 30;
-                       setOption.option.mmsStyleOpt.bFontStyleBold = true;
-                       setOption.option.mmsStyleOpt.bFontStyleItalic = true;
-                       setOption.option.mmsStyleOpt.bFontStyleUnderline = false;
-                       setOption.option.mmsStyleOpt.fontColorRed = 0;
-                       setOption.option.mmsStyleOpt.fontColorGreen = 0;
-                       setOption.option.mmsStyleOpt.fontColorBlue = 0;
-                       setOption.option.mmsStyleOpt.fontColorHue = 255;
-                       setOption.option.mmsStyleOpt.bgColorRed = 255;
-                       setOption.option.mmsStyleOpt.bgColorGreen = 255;
-                       setOption.option.mmsStyleOpt.bgColorBlue = 255;
-                       setOption.option.mmsStyleOpt.bgColorHue = 255;
-                       setOption.option.mmsStyleOpt.pageDur = 2;
-                       setOption.option.mmsStyleOpt.pageCustomDur = 0;
-                       setOption.option.mmsStyleOpt.pageDurManual = 0;
-
-                       err = msg_set_config(hMsgHandle, &setOption);
-
-                       if (err == MSG_SUCCESS)
-                               print("Setting Config Data is OK!");
-                       else
-                               print("Setting Config Data is failed!");
-               }
-               else if (!strcmp(menu, "B"))
-               {
-                       break;
-               }
-               else
-               {
-                       continue;
-               }
-       }
-       while (1);
-}
-
-
-void MsgTestPushMsgOpt(MSG_HANDLE_T hMsgHandle)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       char menu[2];
-       char strPrint [512];
-
-       MSG_SETTING_S setOption;
-       MSG_SETTING_S getOption;
-
-       do
-       {
-               memset(&getOption, 0x00, sizeof(MSG_OPTION_TYPE_T)+sizeof(MSG_PUSHMSG_OPT_S));
-
-               getOption.type = MSG_PUSHMSG_OPT;
-
-               err = msg_get_config(hMsgHandle, &getOption);
-
-               system ("clear");
-
-               print("======================================");
-               print("=========== Push Msg Option ===========");
-               print("======================================");
-
-               memset(strPrint, 0x00, sizeof(strPrint));
-               snprintf(strPrint, sizeof(strPrint), "Receive Option : [%d]", getOption.option.pushMsgOpt.bReceive);
-               print(strPrint);
-
-               memset(strPrint, 0x00, sizeof(strPrint));
-               snprintf(strPrint, sizeof(strPrint), "Service Load : [%d]", getOption.option.pushMsgOpt.serviceType);
-               print(strPrint);
-
-               print("======================================");
-               print("================ Menu ================");
-               print("[U] Update Options");
-               print("[B] Back");
-               print("======================================");
-
-               print("Input : ");
-
-               memset(menu, 0x00, sizeof(menu));
-               cin.getline(menu, 2);
-
-               if (!strcmp(menu, "U"))
-               {
-                       memset(&setOption, 0x00, sizeof(MSG_OPTION_TYPE_T)+sizeof(MSG_PUSHMSG_OPT_S));
-
-                       setOption.type = MSG_PUSHMSG_OPT;
-
-                       setOption.option.pushMsgOpt.bReceive = false;
-                       setOption.option.pushMsgOpt.serviceType = MSG_PUSH_SERVICE_PROMPT;
-
-                       err = msg_set_config(hMsgHandle, &setOption);
-
-                       if (err == MSG_SUCCESS)
-                               print("Setting Config Data is OK!");
-                       else
-                               print("Setting Config Data is failed!");
-               }
-               else if (!strcmp(menu, "B"))
-               {
-                       break;
-               }
-               else
-               {
-                       continue;
-               }
-       }while (1);
-}
-
-
-void MsgTestCBMsgOpt(MSG_HANDLE_T hMsgHandle)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       char menu[2];
-       char strPrint [512];
-
-       MSG_SETTING_S setOption;
-       MSG_SETTING_S getOption;
-
-       do
-       {
-               memset(&getOption, 0x00, sizeof(MSG_OPTION_TYPE_T)+sizeof(MSG_CBMSG_OPT_S));
-
-               getOption.type = MSG_CBMSG_OPT;
-
-               err = msg_get_config(hMsgHandle, &getOption);
-
-               system ("clear");
-
-               print("======================================");
-               print("=========== CB Msg Option ===========");
-               print("======================================");
-
-               memset(strPrint, 0x00, sizeof(strPrint));
-               snprintf(strPrint, sizeof(strPrint), "Receive : [%d]", getOption.option.cbMsgOpt.bReceive);
-               print(strPrint);
-
-               memset(strPrint, 0x00, sizeof(strPrint));
-               snprintf(strPrint, sizeof(strPrint), "All Channel : [%d]", getOption.option.cbMsgOpt.bAllChannel);
-               print(strPrint);
-
-                       memset(strPrint, 0x00, sizeof(strPrint));
-               snprintf(strPrint, sizeof(strPrint), "Channel Count : [%d]", getOption.option.cbMsgOpt.channelData.channelCnt);
-                       print(strPrint);
-
-               for (int i = 0; i < getOption.option.cbMsgOpt.channelData.channelCnt; i++)
-               {
-                       memset(strPrint, 0x00, sizeof(strPrint));
-                       snprintf(strPrint, sizeof(strPrint), "Channel Activate : [%d]", getOption.option.cbMsgOpt.channelData.channelInfo[i].bActivate);
-                       print(strPrint);
-
-                       memset(strPrint, 0x00, sizeof(strPrint));
-                       snprintf(strPrint, sizeof(strPrint), "Channel ID : [%d]", getOption.option.cbMsgOpt.channelData.channelInfo[i].id);
-                       print(strPrint);
-
-                       memset(strPrint, 0x00, sizeof(strPrint));
-                       snprintf(strPrint, sizeof(strPrint), "Channel Name : [%s]", getOption.option.cbMsgOpt.channelData.channelInfo[i].name);
-                       print(strPrint);
-               }
-
-               for (int i = MSG_CBLANG_TYPE_ALL; i < MSG_CBLANG_TYPE_MAX; i++)
-               {
-                       memset(strPrint, 0x00, sizeof(strPrint));
-                       snprintf(strPrint, sizeof(strPrint), "Language[%d] : [%d]", i, getOption.option.cbMsgOpt.bLanguage[i]);
-                       print(strPrint);
-               }
-
-               print("======================================");
-               print("================ Menu ================");
-               print("[U] Update Options");
-               print("[B] Back");
-               print("======================================");
-
-               print("Input : ");
-
-               memset(menu, 0x00, sizeof(menu));
-               cin.getline(menu, 2);
-
-               if (!strcmp(menu, "U"))
-               {
-                       memset(&setOption, 0x00, sizeof(MSG_OPTION_TYPE_T)+sizeof(MSG_CBMSG_OPT_S));
-
-                       setOption.type = MSG_CBMSG_OPT;
-
-                       setOption.option.cbMsgOpt.bReceive = true;
-                       setOption.option.cbMsgOpt.bAllChannel = true;
-
-                       setOption.option.cbMsgOpt.channelData.channelCnt = 3;
-
-                       setOption.option.cbMsgOpt.channelData.channelInfo[0].bActivate = true;
-                       setOption.option.cbMsgOpt.channelData.channelInfo[0].id = 10;
-                       memset(setOption.option.cbMsgOpt.channelData.channelInfo[0].name, 0x00, CB_CHANNEL_NAME_MAX+1);
-                       strncpy(setOption.option.cbMsgOpt.channelData.channelInfo[0].name, "CB MSG", CB_CHANNEL_NAME_MAX);
-
-                       setOption.option.cbMsgOpt.channelData.channelInfo[1].bActivate = true;
-                       setOption.option.cbMsgOpt.channelData.channelInfo[1].id = 50;
-                       memset(setOption.option.cbMsgOpt.channelData.channelInfo[1].name, 0x00, CB_CHANNEL_NAME_MAX+1);
-                       strncpy(setOption.option.cbMsgOpt.channelData.channelInfo[1].name, "CB TEST", CB_CHANNEL_NAME_MAX);
-
-                       setOption.option.cbMsgOpt.channelData.channelInfo[2].bActivate = false;
-                       setOption.option.cbMsgOpt.channelData.channelInfo[2].id = 60;
-                       memset(setOption.option.cbMsgOpt.channelData.channelInfo[2].name, 0x00, CB_CHANNEL_NAME_MAX+1);
-
-//                     memcpy(&setOption.option.cbMsgOpt.channelData, &getOption.option.cbMsgOpt.channelData, sizeof(MSG_CB_CHANNEL_S));
-
-                       setOption.option.cbMsgOpt.bLanguage[MSG_CBLANG_TYPE_ALL] = false;
-                       setOption.option.cbMsgOpt.bLanguage[MSG_CBLANG_TYPE_ENG] = true;
-                       setOption.option.cbMsgOpt.bLanguage[MSG_CBLANG_TYPE_GER] = false;
-                       setOption.option.cbMsgOpt.bLanguage[MSG_CBLANG_TYPE_FRE] = false;
-                       setOption.option.cbMsgOpt.bLanguage[MSG_CBLANG_TYPE_ITA] = false;
-                       setOption.option.cbMsgOpt.bLanguage[MSG_CBLANG_TYPE_NED] = false;
-                       setOption.option.cbMsgOpt.bLanguage[MSG_CBLANG_TYPE_SPA] = false;
-                       setOption.option.cbMsgOpt.bLanguage[MSG_CBLANG_TYPE_POR] = false;
-                       setOption.option.cbMsgOpt.bLanguage[MSG_CBLANG_TYPE_SWE] = false;
-                       setOption.option.cbMsgOpt.bLanguage[MSG_CBLANG_TYPE_TUR] = false;
-
-                       err = msg_set_config(hMsgHandle, &setOption);
-
-                       if (err == MSG_SUCCESS)
-                               print("Setting Config Data is OK!");
-                       else
-                               print("Setting Config Data is failed!");
-               }
-               else if (!strcmp(menu, "B"))
-               {
-                       break;
-               }
-               else
-               {
-                       continue;
-               }
-       }while (1);
-}
-
-
-void MsgTestVoiceMailOpt(MSG_HANDLE_T hMsgHandle)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       char menu[2];
-       char strPrint [512];
-
-       MSG_SETTING_S setOption;
-       MSG_SETTING_S getOption;
-
-       do
-       {
-               memset(&getOption, 0x00, sizeof(MSG_OPTION_TYPE_T)+sizeof(MSG_VOICEMAIL_OPT_S));
-
-               getOption.type = MSG_VOICEMAIL_OPT;
-
-               err = msg_get_config(hMsgHandle, &getOption);
-
-               system ("clear");
-
-               print("======================================");
-               print("=========== Voice Mail Option ===========");
-               print("======================================");
-
-               memset(strPrint, 0x00, sizeof(strPrint));
-               snprintf(strPrint, sizeof(strPrint), "Voice Mail Number : [%s]", getOption.option.voiceMailOpt.mailNumber);
-               print(strPrint);
-
-               print("======================================");
-               print("================ Menu ================");
-               print("[U] Update Options");
-               print("[B] Back");
-               print("======================================");
-
-               print("Input : ");
-
-               memset(menu, 0x00, sizeof(menu));
-               cin.getline(menu, 2);
-
-               if (!strcmp(menu, "U"))
-               {
-                       memset(&setOption, 0x00, sizeof(MSG_OPTION_TYPE_T)+sizeof(MSG_VOICEMAIL_OPT_S));
-
-                       setOption.type = MSG_VOICEMAIL_OPT;
-
-                       memset(setOption.option.voiceMailOpt.mailNumber, 0x00, sizeof(MAX_PHONE_NUMBER_LEN));
-                       strncpy(setOption.option.voiceMailOpt.mailNumber, "11111", MAX_PHONE_NUMBER_LEN);
-
-                       err = msg_set_config(hMsgHandle, &setOption);
-
-                       if (err == MSG_SUCCESS)
-                               print("Setting Config Data is OK!");
-                       else
-                               print("Setting Config Data is failed!");
-               }
-               else if (!strcmp(menu, "B"))
-               {
-                       break;
-               }
-               else
-               {
-                       continue;
-               }
-       }while (1);
-}
-
-
-void MsgTestMsgSizeOpt(MSG_HANDLE_T hMsgHandle)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       char menu[2];
-       char strPrint [512];
-
-       MSG_SETTING_S setOption;
-       MSG_SETTING_S getOption;
-
-       do
-       {
-               memset(&getOption, 0x00, sizeof(MSG_OPTION_TYPE_T)+sizeof(MSG_MSGSIZE_OPT_S));
-
-               getOption.type = MSG_MSGSIZE_OPT;
-
-               err = msg_get_config(hMsgHandle, &getOption);
-
-               system ("clear");
-
-               memset(strPrint, 0x00, sizeof(strPrint));
-               snprintf(strPrint, sizeof(strPrint), "Message Size : [%d]", getOption.option.msgSizeOpt.nMsgSize);
-               print(strPrint);
-
-               print("======================================");
-               print("================ Menu ================");
-               print("[U] Update Options");
-               print("[B] Back");
-               print("======================================");
-
-               print("Input : ");
-
-               memset(menu, 0x00, sizeof(menu));
-               cin.getline(menu, 2);
-
-               if (!strcmp(menu, "U"))
-               {
-                       memset(&setOption, 0x00, sizeof(MSG_OPTION_TYPE_T)+sizeof(MSG_MSGSIZE_OPT_S));
-
-                       setOption.type = MSG_MSGSIZE_OPT;
-
-                       setOption.option.msgSizeOpt.nMsgSize = 100;
-
-                       err = msg_set_config(hMsgHandle, &setOption);
-
-                       if (err == MSG_SUCCESS)
-                               print("Setting Config Data is OK!");
-                       else
-                               print("Setting Config Data is failed!");
-               }
-               else if (!strcmp(menu, "B"))
-               {
-                       break;
-               }
-               else
-               {
-                       continue;
-               }
-       }while (1);
-}
-
diff --git a/test_app/MsgTestSetting.h b/test_app/MsgTestSetting.h
deleted file mode 100755 (executable)
index 96ebd06..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-
-/**
- *     @file           MsgTestSetting.h
- *     @brief          Defines setting test function of messaging framework
- *     @version                1.0
- */
-
-#ifndef MSG_TEST_SETTING_H
-#define MSG_TEST_SETTING_H
-
-/**
- *     @section                Introduction
- *     - Introduction : Overview on Messaging Setting Test Function
- *     @section                Program
- *     - Program : Messaging Setting Test Function Reference
- */
-
-/*==================================================================================================
-                                         INCLUDE FILES
-==================================================================================================*/
-
-#include "MsgTypes.h"
-
-/**
- *     @ingroup                MESSAGING_FRAMEWORK
- *     @defgroup       MESSAGING_SETTING_TEST_FUNCTION Messaging Setting Test Function
- *     @{
- */
-
-/*==================================================================================================
-                                     FUNCTION PROTOTYPES
-==================================================================================================*/
-
-/**    @fn             void MsgTestSettingMain(MSG_HANDLE_T hMsgHandle)
- *     @brief  Shows a setting menu.
- *     @param[in]      hMsgHandle is Message handle.
- */
-void MsgTestSettingMain(MSG_HANDLE_T hMsgHandle);
-
-
-/**    @fn             void MsgSelectMenu(MSG_HANDLE_T hMsgHandle, char *pMenu)
- *     @brief  Selects a setting menu.
- *     @param[in]      hMsgHandle is Message handle. \n
- *     @param[in]      pMenu is a pointer that indicates which menu is selected. \n
- */
-void MsgSelectMenu(MSG_HANDLE_T hMsgHandle, char *pMenu);
-
-
-/**    @fn             void MsgTestGeneralOpt(MSG_HANDLE_T hMsgHandle)
- *     @brief  Tests MsgGetConfig and MsgSetConfig.
- *     @param[in]      hMsgHandle is Message handle.
- */
-void MsgTestGeneralOpt(MSG_HANDLE_T hMsgHandle);
-
-
-/**    @fn             void MsgTestSMSSendOpt(MSG_HANDLE_T hMsgHandle)
- *     @brief  Tests MsgGetConfig and MsgSetConfig.
- *     @param[in]      hMsgHandle is Message handle.
- */
-void MsgTestSMSSendOpt(MSG_HANDLE_T hMsgHandle);
-
-
-/**    @fn             void MsgTestSMSCList(MSG_HANDLE_T hMsgHandle)
- *     @brief  Tests MsgGetConfig and MsgSetConfig.
- *     @param[in]      hMsgHandle is Message handle.
- */
-void MsgTestSMSCList(MSG_HANDLE_T hMsgHandle);
-
-
-/**    @fn             void MsgTestMMSSendOpt(MSG_HANDLE_T hMsgHandle)
- *     @brief  Tests MsgGetConfig and MsgSetConfig.
- *     @param[in]      hMsgHandle is Message handle.
- */
-void MsgTestMMSSendOpt(MSG_HANDLE_T hMsgHandle);
-
-
-/**    @fn             void MsgTestMMSRecvOpt(MSG_HANDLE_T hMsgHandle)
- *     @brief  Tests MsgGetConfig and MsgSetConfig.
- *     @param[in]      hMsgHandle is Message handle.
- */
-void MsgTestMMSRecvOpt(MSG_HANDLE_T hMsgHandle);
-
-
-/**    @fn             void MsgTestMMSStyleOpt(MSG_HANDLE_T hMsgHandle)
- *     @brief  Tests MsgGetConfig and MsgSetConfig.
- *     @param[in]      hMsgHandle is Message handle.
- */
-void MsgTestMMSStyleOpt(MSG_HANDLE_T hMsgHandle);
-
-
-/**    @fn             void MsgTestPushMsgOpt(MSG_HANDLE_T hMsgHandle)
- *     @brief  Tests MsgGetConfig and MsgSetConfig.
- *     @param[in]      hMsgHandle is Message handle.
- */
-void MsgTestPushMsgOpt(MSG_HANDLE_T hMsgHandle);
-
-
-/**    @fn             void MsgTestCBMsgOpt(MSG_HANDLE_T hMsgHandle)
- *     @brief  Tests MsgGetConfig and MsgSetConfig.
- *     @param[in]      hMsgHandle is Message handle.
- */
-void MsgTestCBMsgOpt(MSG_HANDLE_T hMsgHandle);
-
-
-/**    @fn             void MsgTestVoiceMailOpt(MSG_HANDLE_T hMsgHandle)
- *     @brief  Tests MsgGetConfig and MsgSetConfig.
- *     @param[in]      hMsgHandle is Message handle.
- */
-void MsgTestVoiceMailOpt(MSG_HANDLE_T hMsgHandle);
-
-
-/**    @fn             void MsgTestMsgSizeOpt(MSG_HANDLE_T hMsgHandle)
- *     @brief  Tests MsgGetConfig and MsgSetConfig.
- *     @param[in]      hMsgHandle is Message handle.
- */
-void MsgTestMsgSizeOpt(MSG_HANDLE_T hMsgHandle);
-
-/**
- *     @}
- */
-
-#endif // MSG_TEST_SETTING_H
-
diff --git a/test_app/MsgTestStorage.cpp b/test_app/MsgTestStorage.cpp
deleted file mode 100755 (executable)
index 0460fae..0000000
+++ /dev/null
@@ -1,1911 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-
-/*==================================================================================================
-                                         INCLUDE FILES
-==================================================================================================*/
-#include <time.h>
-#include <iostream>
-#include <string>
-#include <stdlib.h>
-using namespace std;
-
-#include "MsgMmsTypes.h"
-#include "MsgSettingTypes.h"
-#include "MapiStorage.h"
-#include "MapiSetting.h"
-#include "MapiMessage.h"
-#include "MapiTransport.h"
-#include "MsgTestStorage.h"
-#include "MsgTestTransport.h"
-#include "main.h"
-
-MSG_FOLDER_LIST_S g_folderList;
-
-#define MSG_PROFILE_BEGIN(pfid) \
-       unsigned int __prf_l1_##pfid = __LINE__;    \
-       struct timeval __prf_1_##pfid;              \
-       struct timeval __prf_2_##pfid;              \
-       do {                                        \
-               gettimeofday(&__prf_1_##pfid, 0);       \
-       } while (0)
-
-#define MSG_PROFILE_END(pfid) \
-       unsigned int __prf_l2_##pfid = __LINE__;\
-       do { \
-               gettimeofday(&__prf_2_##pfid, 0);\
-               long __ds = __prf_2_##pfid.tv_sec - __prf_1_##pfid.tv_sec;\
-               long __dm = __prf_2_##pfid.tv_usec - __prf_1_##pfid.tv_usec;\
-               if ( __dm < 0 ) { __ds--; __dm = 1000000 + __dm; } \
-               printf("**PROFILE** [MSGFW: %s: %s() %u ~ %u] " #pfid " -> Elapsed Time: %u.%06u seconds\n",                    \
-               rindex(__FILE__, '/')+1,                \
-               __FUNCTION__, \
-               __prf_l1_##pfid,                                         \
-               __prf_l2_##pfid,                                         \
-               (unsigned int)(__ds),                                    \
-               (unsigned int)(__dm));                                   \
-       } while (0)
-
-/*==================================================================================================
-                                     FUNCTION IMPLEMENTATION
-==================================================================================================*/
-void MsgTestAddMessage(MSG_HANDLE_T hMsgHandle)
-{
-       if (hMsgHandle == NULL)
-       {
-               MSG_DEBUG("Handle is NULL");
-               return;
-       }
-
-       // Make Message
-       msg_message_t msgInfo = msg_new_message();
-       MSG_SENDINGOPT_S sendOpt = {0, };
-
-       print("\n===== Input Message =====");
-       print("Input Message Type 0:SMS 1:MMS :");
-       unsigned int msgType;
-       msgType = cin.get();    //&msgType, 1);
-       cin.get(); // consume "enter key"
-
-       if( msgType == '0' )
-       {
-               msg_set_message_type(msgInfo, MSG_TYPE_SMS);
-       }
-       else if ( msgType == '1' )
-       {
-               msg_set_message_type(msgInfo, MSG_TYPE_MMS);
-       }
-       else
-       {
-               MSG_DEBUG("Msg Type input error %d", msgType);
-       }
-
-       print("\nInput Message Sending Option ?. 'Y' : Yes 'N' : No  ");
-
-       char bSendOpt = 0, ch = 0;
-       cin >> bSendOpt;
-       ch = cin.get();
-
-       if( bSendOpt == 'Y' || bSendOpt == 'y')
-       {
-               sendOpt.bSetting = true;
-
-               /* EX : Set SendingOption */
-               if( msg_is_sms(msgInfo) ) //msgInfo.msgType.mainType == MSG_SMS_TYPE)
-               {
-                       print("\nRequest Delivery Report? Press 'Y' or 'N' :");
-                       char bDelivery = 0;
-                       ch = 0;
-                       cin >> bDelivery;
-                       ch = cin.get();
-
-                       if( bDelivery == 'Y' || bDelivery == 'y')
-                               sendOpt.bDeliverReq = true;
-                       else
-                               sendOpt.bDeliverReq = false;
-
-                       print("\nKeep a Copy? Press 'Y' or 'N' :");
-                       char bKeepCopy = 0;
-                       ch = 0;
-                       cin >> bKeepCopy;
-                       ch = cin.get();
-
-                       if( bKeepCopy == 'Y' || bKeepCopy == 'y')
-                               sendOpt.bKeepCopy = true;
-                       else
-                               sendOpt.bKeepCopy = false;
-
-                       print("\nSet Reply Path? Press 'Y' or 'N' :");
-                       char bReplyPath = 0;
-                       ch = 0;
-                       cin >> bReplyPath;
-                       ch = cin.get();
-
-                       if( bReplyPath == 'Y' || bReplyPath == 'y')
-                               sendOpt.option.smsSendOpt.bReplyPath = true;
-                       else
-                               sendOpt.option.smsSendOpt.bReplyPath = false;
-               }
-               else if( msg_is_mms(msgInfo) )//msgInfo.msgType.mainType == MSG_MMS_TYPE)
-               {
-                       print("\nRequest Delivery Report? Press 'Y' or 'N' :");
-                       char bDelivery = 0;
-                       ch = 0;
-                       cin >> bDelivery;
-                       ch = cin.get();
-
-                       if( bDelivery == 'Y' || bDelivery == 'y')
-                               sendOpt.bDeliverReq = true;
-                       else
-                               sendOpt.bDeliverReq = false;
-
-                       print("\nKeep a Copy? Press 'Y' or 'N' :");
-                       char bKeepCopy = 0;
-                       ch = 0;
-                       cin >> bKeepCopy;
-                       ch = cin.get();
-
-                       if( bKeepCopy == 'Y' || bKeepCopy == 'y')
-                               sendOpt.bKeepCopy = true;
-                       else
-                               sendOpt.bKeepCopy = false;
-
-                       print("\nRequest Read Report? Press 'Y' or 'N' :");
-                       char bRead = 0;
-                       ch = 0;
-                       cin >> bRead;
-                       ch = cin.get();
-
-                       if( bRead == 'Y' || bRead == 'y')
-                               sendOpt.option.mmsSendOpt.bReadReq = true;
-                       else
-                               sendOpt.option.mmsSendOpt.bReadReq = false;
-
-                       print("\nSet Priority? 'U' : Ugent, 'N' : Normal, 'L' : Low");
-                       char priority = 0;
-                       ch = 0;
-                       cin >> priority;
-                       ch = cin.get();
-
-                       if( priority == 'U' || priority == 'u')
-                               sendOpt.option.mmsSendOpt.priority = MSG_MESSAGE_PRIORITY_HIGH;
-                       else if( priority == 'N' || priority == 'n')
-                               sendOpt.option.mmsSendOpt.priority = MSG_MESSAGE_PRIORITY_NORMAL;
-                       else if( priority == 'L' || priority == 'l')
-                               sendOpt.option.mmsSendOpt.priority = MSG_MESSAGE_PRIORITY_LOW;
-
-                       print("\nSet Expiry Time? '0' : Max '1' : 1 Day, '2' : 2 Days, '3' : 1 Week, '4' : 2 Weeks ");
-                       char expiryTime = 0;
-                       ch = 0;
-                       cin >> expiryTime;
-                       ch = cin.get();
-
-                       if( expiryTime == '0')
-                               sendOpt.option.mmsSendOpt.expiryTime = MSG_EXPIRY_TIME_MAXIMUM;
-                       else if( expiryTime == '1')
-                               sendOpt.option.mmsSendOpt.expiryTime = MSG_EXPIRY_TIME_1DAY;
-                       else if( expiryTime == '2')
-                               sendOpt.option.mmsSendOpt.expiryTime = MSG_EXPIRY_TIME_2DAYS;
-                       else if( expiryTime == '3')
-                               sendOpt.option.mmsSendOpt.expiryTime = MSG_EXPIRY_TIME_1WEEK;
-                       else if( expiryTime == '4')
-                               sendOpt.option.mmsSendOpt.expiryTime = MSG_EXPIRY_TIME_2WEEKS;
-
-                       print("\nSet Delivery Time? '0' : Immediately '1' : 1 Hour, '2' : 1 Day, '3' : 1 Week ");
-                       char deliveryTime = 0;
-                       ch = 0;
-                       cin >> deliveryTime;
-                       ch = cin.get();
-
-                       if( deliveryTime == '0')
-                               sendOpt.option.mmsSendOpt.deliveryTime = MSG_DELIVERY_TIME_IMMEDIATLY;
-                       else if( deliveryTime == '1')
-                               sendOpt.option.mmsSendOpt.deliveryTime = MSG_DELIVERY_TIME_1HOUR;
-                       else if( deliveryTime == '2')
-                               sendOpt.option.mmsSendOpt.deliveryTime = MSG_DELIVERY_TIME_1DAY;
-                       else if( deliveryTime == '3')
-                               sendOpt.option.mmsSendOpt.deliveryTime = MSG_DELIVERY_TIME_1WEEK;
-
-                       MSG_DEBUG("sendOpt.option.mmsSendOpt.deliveryTime = %lu", sendOpt.option.mmsSendOpt.deliveryTime);
-               }
-       }
-       else            /* In case of No setting per Message, Set Message option with Global Setting value */
-       {
-               sendOpt.bSetting = false;
-       }
-
-       MSG_DEBUG("### bSetting = %d ###", sendOpt.bSetting);
-       MSG_DEBUG("MsgType [%d]", msg_get_message_type(msgInfo));
-
-       if(msg_is_sms(msgInfo)) //msgInfo.msgType.mainType == MSG_SMS_TYPE)
-       {
-               print("\n===== Input Message =====");
-               print("Input Message Text :");
-
-               char strMsg[1200];
-               memset(strMsg, 0x00, sizeof(strMsg));
-
-//             strcpy(strMsg, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
-//             strcpy(strMsg, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNO");
-//             strcpy(strMsg, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNO ABCDEFGHIJKLMNO ABCDEFGHIJKLMNO ABCDEFGHIJKLMNO ABCDEFGHIJKLMNO ABCDEFGHIJKLMNO");
-//             strcpy(strMsg, "AAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAA");
-
-               cin.getline(strMsg, 1024);
-
-               if (msg_sms_set_message_body(msgInfo, strMsg, strlen(strMsg)) != MSG_SUCCESS)
-               {
-                       return;
-               }
-       }
-
-       else if(msg_is_mms(msgInfo)) //msgInfo.msgType.mainType == MSG_MMS_TYPE)
-       {
-               // Compose MMS Message Body (Text, Image, Sound, Video)
-               //MMS_MESSAGE_DATA_S    msgData ={0, };
-               MMS_MESSAGE_DATA_S*      mms_data;//msgHandle;
-               MMS_PAGE_S* page[2];
-               MMS_MEDIA_S* media[5];
-               MMS_ATTACH_S* attachment[5];
-               int nSize = 0;
-
-               print("\n===== Input Subject =====");
-
-               char                                    strSubject[120];
-               int                                             subjectLen;
-               memset(strSubject, 0x00, sizeof(strSubject));
-
-               cin.getline(strSubject, 120);
-               subjectLen = strlen(strSubject);
-
-               msg_set_subject(msgInfo, strSubject);
-
-               mms_data = msg_mms_create_message();
-
-               print("\n===== Input Message =====");
-               print("Input Multipart type 0: Multiprat Related, 1:Multipart Mixed");
-
-               unsigned int multipartType;
-               multipartType = cin.get();
-               cin.get(); // consume "enter key"
-
-               if(multipartType == '0')
-               {
-                       msg_mms_set_rootlayout(mms_data, 100, 100, 0xffffff);
-                       msg_mms_add_region(mms_data, "Image", 0, 50, 100, 50, 0xffffff);
-                       msg_mms_add_region(mms_data, "Text", 0, 0, 100, 50, 0xffffff);
-
-                       //------------>  1st Slide Composing
-                       page[0] = msg_mms_add_page(mms_data, 5440);
-
-                       media[0] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_IMG, "Image", (char*)"/opt/etc/msg-service/P091120_104633.jpg");
-                       media[1] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_AUDIO, NULL, (char*)"/opt/etc/msg-service/audio.amr");
-                       media[2] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_TEXT, "Text", (char*)"/opt/etc/msg-service/Temp0_2.txt");
-                       media[2]->sMedia.sText.nColor = 0x000000;
-                       media[2]->sMedia.sText.nSize = MMS_SMIL_FONT_SIZE_NORMAL;
-                       media[2]->sMedia.sText.bBold = true;
-
-                       //------------>  2nd Slide Composing
-                       page[1] = msg_mms_add_page(mms_data, 4544);
-
-                       media[3] = msg_mms_add_media(page[1], MMS_SMIL_MEDIA_TEXT, "Text", (char*)"/opt/etc/msg-service/Temp1_0.txt");
-                       media[3]->sMedia.sText.nColor = 0x000000;
-                       media[3]->sMedia.sText.nSize = MMS_SMIL_FONT_SIZE_NORMAL;
-                       media[3]->sMedia.sText.bItalic = true;
-                       media[4] = msg_mms_add_media(page[1], MMS_SMIL_MEDIA_VIDEO, "Text", (char*)"/opt/etc/msg-service/V091120_104905.3gp");
-                       strncpy(media[4]->szAlt, "Video Load Fail", MAX_SMIL_ALT_LEN-1);
-               }
-               else
-               {
-                       attachment[0] = msg_mms_add_attachment(mms_data, (char*)"/opt/etc/msg-service/P091120_104633.jpg");
-                       attachment[1] = msg_mms_add_attachment(mms_data, (char*)"/opt/etc/msg-service/audio.amr");
-                       attachment[2] = msg_mms_add_attachment(mms_data, (char*)"/opt/etc/msg-service/Temp0_2.txt");
-                       attachment[3] = msg_mms_add_attachment(mms_data, (char*)"/opt/etc/msg-service/Temp1_0.txt");
-                       attachment[4] = msg_mms_add_attachment(mms_data, (char*)"/opt/etc/msg-service/V091120_104905.3gp");
-               }
-
-               MSG_DEBUG("nSize = %d",  nSize);
-
-               msg_mms_set_message_body(msgInfo, mms_data);
-
-               msg_mms_release_page_list(mms_data);
-               msg_mms_release_region_list(mms_data);
-               msg_mms_release_attachment_list(mms_data);
-               msg_mms_release_transition_list(mms_data);
-               msg_mms_release_meta_list(mms_data);
-
-               msg_mms_destroy_message(mms_data);
-       }
-
-       int nToCnt = 0;
-
-       char strNumber[MAX_ADDRESS_VAL_LEN];
-       memset(strNumber, 0x00, MAX_ADDRESS_VAL_LEN);
-
-       print("\n===== Add Recipient =====");
-
-       while (nToCnt < MAX_TO_ADDRESS_CNT)
-       {
-               print("\nInput Recipient Number. Press 'N' if you don't want : ");
-
-               cin.getline(strNumber, 1024);
-
-               if (!strcmp(strNumber, "N")) break;
-
-               MSG_DEBUG("strNumber [%s]", strNumber);
-
-               if(msg_is_mms(msgInfo)) // in case of MMS
-               {
-                       print("\n===== Input Recipient Type =====");
-                       print("Input Message Type 0:To 1:Cc 2: Bcc :");
-
-                       unsigned int recipientType;
-                       recipientType = cin.get();      //&msgType, 1);
-                       cin.get(); // consume "enter key"
-
-                       if(recipientType == '0')
-                               msg_add_address(msgInfo, strNumber, MSG_RECIPIENTS_TYPE_TO);
-                       else if(recipientType == '1')
-                               msg_add_address(msgInfo, strNumber, MSG_RECIPIENTS_TYPE_CC);
-                       else if(recipientType == '2')
-                               msg_add_address(msgInfo, strNumber, MSG_RECIPIENTS_TYPE_BCC);
-                       else
-                               MSG_DEBUG("Recipient Type input error %d", recipientType);
-               }
-               else // in case of SMS
-                       msg_add_address(msgInfo, strNumber, MSG_RECIPIENTS_TYPE_TO);
-
-               nToCnt++;
-       }
-
-       MSG_DEBUG("nToContactCnt [%d]", msg_get_address_count(msgInfo));
-
-       if(msg_is_sms(msgInfo))
-       {
-               char strReplyAddr[MAX_PHONE_NUMBER_LEN];
-               memset(strReplyAddr, 0x00, MAX_PHONE_NUMBER_LEN);
-
-               print("\n===== Set Reply Address =====");
-
-               print("\nInput Reply Number. Press 'N' if you don't want : ");
-
-               cin.getline(strReplyAddr, 1024);
-
-               if (!strcmp(strReplyAddr, "N"))
-               {
-                       print("\nReply Number is not set.");
-               }
-               else
-               {
-                       MSG_DEBUG("strReplyAddr [%s]", strReplyAddr);
-
-                       msg_set_reply_address(msgInfo, strReplyAddr);
-               }
-
-               // for test
-//             msg_set_backup_status(msgInfo, true);
-       }
-
-       // Port Number Test
-//     msg_set_port(msgInfo, 4010, 0);
-
-       print("\n======================================");
-       print("[1] Send Message");
-       print("[2] Save Message into Draft");
-       print("[3] Scheduled Message Send");
-       print("======================================");
-       print("Input : ");
-
-       int select = 0;
-       char ch1 = 0;
-
-       cin >> select;
-       ch1 = cin.get();
-
-       if (select == 1)
-       {
-               MsgTestSubmitReq(hMsgHandle, msgInfo, &sendOpt);
-       }
-       else if (select == 2)
-       {
-               print("Start Saving Message...");
-
-               int MsgId = 0;
-
-               MsgId = msg_add_message(hMsgHandle, msgInfo, &sendOpt);
-
-               MSG_DEBUG("Saving Message is Finished![%d]", MsgId);
-       }
-
-       else if (select == 3)
-       {
-               MsgTestScheduledSubmitReq(hMsgHandle, msgInfo, &sendOpt);
-       }
-
-       msg_release_message(&msgInfo);
-}
-
-void MsgTestMsgGen(MSG_HANDLE_T hMsgHandle)
-{
-       if (hMsgHandle == NULL)
-       {
-               MSG_DEBUG("Handle is NULL");
-               return;
-       }
-
-       char menu[5];
-
-       print("Input Message Count: ");
-
-       memset(menu, 0x00, sizeof(menu));
-       cin.getline(menu, 5);
-
-       unsigned int count = atoi(menu);
-
-       print("Input Message Type(SMS[1], MMS[2]): ");
-
-       memset(menu, 0x00, sizeof(menu));
-       cin.getline(menu, 5);
-
-       MSG_MESSAGE_TYPE_T msgType = MSG_TYPE_INVALID;
-
-       if (atoi(menu) == 1)
-               msgType = MSG_TYPE_SMS;
-       else if (atoi(menu) == 2)
-               msgType = MSG_TYPE_MMS;
-
-       print("Input folder(INBOX[1], OUTBOX[2], SENTBOX[3], DRAFTBOX[4]): ");
-
-       memset(menu, 0x00, sizeof(menu));
-       cin.getline(menu, 5);
-
-       MSG_FOLDER_ID_T folderId = atoi(menu);
-
-       MSG_ERROR_T err = msg_generate_message(hMsgHandle, msgType, folderId, count);
-
-       if (err != MSG_SUCCESS)
-       {
-               MSG_DEBUG("err [%d]", err);
-       }
-}
-
-
-void MsgTestGetMessage(MSG_HANDLE_T hMsgHandle, int MsgId)
-{
-       if (hMsgHandle == NULL)
-       {
-               MSG_DEBUG("Handle is NULL");
-               return;
-       }
-
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       msg_message_t msg = msg_new_message();
-       MSG_SENDINGOPT_S sendOpt = {0, };
-
-       err = msg_get_message(hMsgHandle, (MSG_MESSAGE_ID_T)MsgId, msg, &sendOpt);
-
-       if (err != MSG_SUCCESS)
-       {
-               msg_release_message(&msg);
-               return;
-       }
-
-       // Update Read Status
-       msg_update_read_status(hMsgHandle, MsgId, true);
-
-       // Send Read Report
-       if (msg_is_mms(msg))
-       {
-               int folder_id = msg_get_folder_id(msg);
-               if (folder_id == MSG_INBOX_ID) {
-                       msg_mms_send_read_report(hMsgHandle, MsgId, MSG_READ_REPORT_IS_READ);
-               }
-       }
-
-       MsgPrintMessage(hMsgHandle, msg, &sendOpt);
-
-       msg_release_message(&msg);
-}
-
-
-void MsgTestGetMessageList(MSG_HANDLE_T hMsgHandle, int FolderId)
-{
-       if (hMsgHandle == NULL)
-       {
-               MSG_DEBUG("Handle is NULL");
-               return;
-       }
-
-       char menu[5];
-
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       MSG_SORT_RULE_S sortRule = {0};
-
-       sortRule.sortType               = MSG_SORT_BY_READ_STATUS;
-       sortRule.bAscending     = false;
-
-       MSG_LIST_S folderViewList;
-
-       MSG_MESSAGE_TYPE_T MsgType;
-       MSG_NETWORK_STATUS_T NetworkStatus;
-
-       char displayTime[32];
-       memset(displayTime, 0x00, sizeof(displayTime));
-
-       do
-       {
-               err = msg_get_folder_view_list(hMsgHandle, (MSG_FOLDER_ID_T)FolderId, NULL, &folderViewList);
-
-               if (err != MSG_SUCCESS && err != MSG_ERR_DB_NORECORD)
-               {
-                       print("Get Message List is failed!");
-                       return;
-               }
-
-               system ("clear" );
-
-               printf("======================================\n");
-               for (int i = 0; i < g_folderList.nCount; i++)
-               {
-                       if (FolderId == g_folderList.folderInfo[i].folderId)
-                       {
-                               printf("=============== %s ===============\n", g_folderList.folderInfo[i].folderName);
-                               break;
-                       }
-               }
-               printf("======================================\n");
-
-               if (folderViewList.nCount <= 0)
-               {
-                       printf("Empty...\n");
-               }
-               else
-               {
-                       MSG_PROFILE_BEGIN(2);
-
-                       for (int i = 0; i < folderViewList.nCount; i++)
-                       {
-                               memset(displayTime, 0x00, sizeof(displayTime));
-
-                               MsgConvertTime(msg_get_time(folderViewList.msgInfo[i]), displayTime);
-
-                               const char* msgText = NULL;
-
-                               int msgType = msg_get_message_type(folderViewList.msgInfo[i]);
-
-                               if(msgType==MSG_TYPE_MMS_NOTI || msgType==MSG_TYPE_MMS_JAVA || msgType==MSG_TYPE_MMS)
-                                       msgText = msg_mms_get_text_contents(folderViewList.msgInfo[i]);
-                               else
-                                       msgText = msg_sms_get_message_body(folderViewList.msgInfo[i]);
-
-                               printf("[%02d]\t[%s %s %s %s] [%s]\t[%s]\nDate [%s]\nMessage Text [%s] \tMessage data size [%d]\n",
-                                               msg_get_message_id(folderViewList.msgInfo[i]),
-                                               MsgConvertMsgType(msg_get_message_type(folderViewList.msgInfo[i])),
-                                               MsgConvertStorageId(msg_get_storage_id(folderViewList.msgInfo[i])),
-                                               MsgConvertReadStatus(msg_is_read(folderViewList.msgInfo[i])),
-                                               MsgConvertProtectedStatus(msg_is_protected(folderViewList.msgInfo[i])),
-                                               MsgConvertNetworkStatus(msg_get_network_status(folderViewList.msgInfo[i])),
-                                               msg_get_ith_address(folderViewList.msgInfo[i], 0),
-                                               displayTime,
-                                               msgText,
-                                               msg_get_message_body_size(folderViewList.msgInfo[i]));
-                               printf("--------------------------------------------------------\n");
-                       }
-
-                       MSG_PROFILE_END(2);
-               }
-
-               printf("======================================\n");
-               printf("================ Menu ================\n");
-               printf("======================================\n");
-               printf("[C] Create Message\n");
-               printf("[D] Delete All Messages\n");
-               printf("[B] Back\n");
-               printf("======================================\n");
-
-               printf("Input : ");
-
-               memset(menu, 0x00, sizeof(menu));
-               cin.getline(menu, 5);
-
-               if (!strcmp(menu, "C") || !strcmp(menu, "c")) // Add Message
-               {
-                       MsgTestAddMessage(hMsgHandle);
-               }
-               else if (!strcmp(menu, "D") || !strcmp(menu, "d"))
-               {
-                       char menu[2];
-
-                       printf("Do you really wanna delete all messages [Y or N] ?\n");
-
-                       memset(menu, 0x00, sizeof(menu));
-                       cin.getline(menu, 2);
-
-                       if (!strcmp(menu, "Y"))
-                               msg_delete_all_msgs_in_folder(hMsgHandle, (MSG_FOLDER_ID_T)FolderId, false);
-               }
-               else if (!strcmp(menu, "B") || !strcmp(menu, "b"))
-               {
-                       break;
-               }
-               else
-               {
-                       int msgId = atoi(menu);
-
-                       for (int i = 0; i < folderViewList.nCount; i++)
-                       {
-                               if ( msg_get_message_id( folderViewList.msgInfo[i] ) == msgId)
-                               {
-                                       MsgType = msg_get_message_type(folderViewList.msgInfo[i]);
-                                       NetworkStatus = msg_get_network_status(folderViewList.msgInfo[i]);
-
-                                       MsgRunMsgListMenu(hMsgHandle, msgId, FolderId, MsgType, NetworkStatus);
-
-                                       break;
-                               }
-                       }
-               }
-
-               msg_release_message_list(&folderViewList);
-               printf("release folderview list [%d]\n", folderViewList.nCount);
-       }
-       while (strcmp(menu, "B"));
-}
-
-
-void MsgTestUpdateMessage(MSG_HANDLE_T hMsgHandle, msg_message_t pMsg)
-{
-       if (hMsgHandle == NULL)
-       {
-               MSG_DEBUG("Handle is NULL");
-               return;
-       }
-
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       MSG_SENDINGOPT_S sendOpt = {0, };
-
-       print("\n===== Input Message =====");
-       print("Input Message Text :");
-
-       char strMsg[1024] = {0};
-
-//     strcpy(strMsg, "ABCDEFGHIGKLMNOPQRSTUVWXYZ ABCDEFGHIGKLMNOPQRSTUVWXYZ ABCDEFGHIGKLMNOPQRSTUVWXYZ ABCDEFGHIGKLMNOPQRSTUVWXYZ ABCDEFGHIGKLMNOPQRSTUVWXYZ ABCDEFGHIGKLMNOPQRSTUVWXYZ");
-       cin.getline(strMsg, 1024);
-
-       msg_sms_set_message_body(pMsg, strMsg, strlen(strMsg));
-
-       int nToCnt = msg_get_address_count(pMsg);
-
-       char strNumber[MAX_ADDRESS_VAL_LEN] = {0};
-
-       printf("\n===== Add Recipient =====\n");
-
-       MSG_DEBUG("address count [%d]", nToCnt);
-
-       if (nToCnt > 0)
-       {
-               msg_reset_address(pMsg);
-       }
-
-       printf("\nInput Recipient Number. Press 'N' if you don't want : \n");
-
-       cin.getline(strNumber, 1024);
-
-       if (strcmp(strNumber, "N"))
-       {
-               MSG_DEBUG("strNumber [%s]", strNumber);
-
-               msg_add_address(pMsg, strNumber, MSG_RECIPIENTS_TYPE_TO);
-
-               MSG_DEBUG("contactVal [%s]", msg_get_ith_address(pMsg, 0));
-
-               MSG_DEBUG("nToContactCnt [%d]", msg_get_address_count(pMsg));
-       }
-
-       print("\nInput Message Sending Option ?. 'Y' : Yes 'N' : No  ");
-
-       char bSendOpt = 0, ch = 0;
-       cin >> bSendOpt;
-       ch = cin.get();
-
-       if( bSendOpt == 'Y' || bSendOpt == 'y')
-       {
-               sendOpt.bSetting = true;
-
-               /* EX : Set SendingOption */
-               if( msg_is_sms(pMsg) )
-               {
-                       printf("\nRequest Delivery Report? Press 'Y' or 'N' :\n");
-                       char bDelivery = 0;
-                       ch = 0;
-                       cin >> bDelivery;
-                       ch = cin.get();
-
-                       if( bDelivery == 'Y' || bDelivery == 'y')
-                               sendOpt.bDeliverReq = true;
-                       else
-                               sendOpt.bDeliverReq = false;
-
-                       print("\nKeep a Copy? Press 'Y' or 'N' :");
-                       char bKeepCopy = 0;
-                       ch = 0;
-                       cin >> bKeepCopy;
-                       ch = cin.get();
-
-                       if( bKeepCopy == 'Y' || bKeepCopy == 'y')
-                               sendOpt.bKeepCopy = true;
-                       else
-                               sendOpt.bKeepCopy = false;
-
-                       print("\nSet Reply Path? Press 'Y' or 'N' :");
-                       char bReplyPath = 0;
-                       ch = 0;
-                       cin >> bReplyPath;
-                       ch = cin.get();
-
-                       if( bReplyPath == 'Y' || bReplyPath == 'y')
-                               sendOpt.option.smsSendOpt.bReplyPath = true;
-                       else
-                               sendOpt.option.smsSendOpt.bReplyPath = false;
-               }
-               else if( msg_is_mms(pMsg) )
-               {
-                       print("\nRequest Delivery Report? Press 'Y' or 'N' :");
-                       char bDelivery = 0;
-                       ch = 0;
-                       cin >> bDelivery;
-                       ch = cin.get();
-
-                       if( bDelivery == 'Y' || bDelivery == 'y')
-                               sendOpt.bDeliverReq = true;
-                       else
-                               sendOpt.bDeliverReq = false;
-
-                       print("\nKeep a Copy? Press 'Y' or 'N' :");
-                       char bKeepCopy = 0;
-                       ch = 0;
-                       cin >> bKeepCopy;
-                       ch = cin.get();
-
-                       if( bKeepCopy == 'Y' || bKeepCopy == 'y')
-                               sendOpt.bKeepCopy = true;
-                       else
-                               sendOpt.bKeepCopy = false;
-
-                       print("\nRequest Read Report? Press 'Y' or 'N' :");
-                       char bRead = 0;
-                       ch = 0;
-                       cin >> bRead;
-                       ch = cin.get();
-
-                       if( bRead == 'Y' || bRead == 'y')
-                               sendOpt.option.mmsSendOpt.bReadReq = true;
-                       else
-                               sendOpt.option.mmsSendOpt.bReadReq = false;
-
-                       print("\nSet Priority? 'U' : Ugent, 'N' : Normal, 'L' : Low");
-                       char priority = 0;
-                       ch = 0;
-                       cin >> priority;
-                       ch = cin.get();
-
-                       if( priority == 'U' || priority == 'u')
-                               sendOpt.option.mmsSendOpt.priority = MSG_MESSAGE_PRIORITY_HIGH;
-                       else if( priority == 'N' || priority == 'n')
-                               sendOpt.option.mmsSendOpt.priority = MSG_MESSAGE_PRIORITY_NORMAL;
-                       else if( priority == 'L' || priority == 'l')
-                               sendOpt.option.mmsSendOpt.priority = MSG_MESSAGE_PRIORITY_LOW;
-
-                       print("\nSet Expiry Time? '0' : Max '1' : 1 Day, '2' : 2 Days, '3' : 1 Week, '4' : 2 Weeks ");
-                       char expiryTime = 0;
-                       ch = 0;
-                       cin >> expiryTime;
-                       ch = cin.get();
-
-                       if( expiryTime == '0')
-                               sendOpt.option.mmsSendOpt.expiryTime = MSG_EXPIRY_TIME_MAXIMUM;
-                       else if( expiryTime == '1')
-                               sendOpt.option.mmsSendOpt.expiryTime = MSG_EXPIRY_TIME_1DAY;
-                       else if( expiryTime == '2')
-                               sendOpt.option.mmsSendOpt.expiryTime = MSG_EXPIRY_TIME_2DAYS;
-                       else if( expiryTime == '3')
-                               sendOpt.option.mmsSendOpt.expiryTime = MSG_EXPIRY_TIME_1WEEK;
-                       else if( expiryTime == '4')
-                               sendOpt.option.mmsSendOpt.expiryTime = MSG_EXPIRY_TIME_2WEEKS;
-
-                       print("\nSet Delivery Time? '0' : Immediately '1' : 1 Hour, '2' : 1 Day, '3' : 1 Week ");
-                       char deliveryTime = 0;
-                       ch = 0;
-                       cin >> deliveryTime;
-                       ch = cin.get();
-
-                       if( expiryTime == '0')
-                               sendOpt.option.mmsSendOpt.deliveryTime = MSG_DELIVERY_TIME_IMMEDIATLY;
-                       else if( expiryTime == '1')
-                               sendOpt.option.mmsSendOpt.deliveryTime = MSG_DELIVERY_TIME_1HOUR;
-                       else if( expiryTime == '2')
-                               sendOpt.option.mmsSendOpt.deliveryTime = MSG_DELIVERY_TIME_1DAY;
-                       else if( expiryTime == '3')
-                               sendOpt.option.mmsSendOpt.deliveryTime = MSG_DELIVERY_TIME_1WEEK;
-
-               }
-       }
-       else            /* In case of No setting per Message, Set Message option with Global Setting value */
-       {
-               sendOpt.bSetting = false;
-       }
-
-       err = msg_update_message(hMsgHandle, pMsg, &sendOpt);
-
-       if (err == MSG_SUCCESS)
-               print("Update Message is OK!");
-       else
-               print("Update Message is failed!");
-}
-
-
-void MsgTestMoveMessage(MSG_HANDLE_T hMsgHandle, MSG_MESSAGE_ID_T MsgId)
-{
-       if (hMsgHandle == NULL)
-       {
-               MSG_DEBUG("Handle is NULL");
-               return;
-       }
-
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       char strFolder[3];
-
-       print("======================================");
-
-       for (int i = 3; i < g_folderList.nCount; i++)
-               printf("[%d] %s", g_folderList.folderInfo[i].folderId, g_folderList.folderInfo[i].folderName);
-
-       print("======================================");
-
-       print("Select Folder :");
-
-       memset(strFolder, 0x00, sizeof(strFolder));
-       cin.getline(strFolder, 3);
-
-       int nFolder = atoi(strFolder);
-
-       if (nFolder <= 3 || nFolder > g_folderList.nCount)
-       {
-               print("Select Wrong Folder!!!");
-       }
-       else
-       {
-               err = msg_move_msg_to_folder(hMsgHandle, MsgId, nFolder);
-
-               if (err == MSG_SUCCESS)
-                       print("Moving Message is OK!");
-               else
-                       print("Moving Message is failed!");
-       }
-}
-
-void MsgTestMoveStorageMessage(MSG_HANDLE_T hMsgHandle, msg_message_t pmsg)
-{
-       if (hMsgHandle == NULL)
-       {
-               MSG_DEBUG("Handle is NULL");
-               return;
-       }
-
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       if(msg_is_in_sim(pmsg))
-               err = msg_move_msg_to_storage( hMsgHandle, msg_get_message_id(pmsg), MSG_STORAGE_PHONE);
-       else
-               err = msg_move_msg_to_storage( hMsgHandle, msg_get_message_id(pmsg), MSG_STORAGE_SIM);
-
-       if (err == MSG_SUCCESS)
-               print("Moving Message is OK!");
-       else
-               print("Moving Message is failed!");
-}
-
-
-void MsgTestAddFolder(MSG_HANDLE_T hMsgHandle)
-{
-       if (hMsgHandle == NULL)
-       {
-               MSG_DEBUG("Handle is NULL");
-               return;
-       }
-
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       // Make Folder
-       MSG_FOLDER_INFO_S folderInfo = {};
-
-       folderInfo.folderId = 0;
-       folderInfo.folderType = MSG_FOLDER_TYPE_USER_DEF;
-
-       print("Input Folder Name :");
-
-       char strName[MAX_FOLDER_NAME_SIZE+1];
-       memset(strName, 0x00, sizeof(strName));
-
-       cin.getline(strName, MAX_FOLDER_NAME_SIZE);
-
-       strncpy(folderInfo.folderName, strName, MAX_FOLDER_NAME_SIZE);
-
-       MSG_DEBUG("folderId [%d]", folderInfo.folderId);
-       MSG_DEBUG("folderType [%d]", folderInfo.folderType);
-       MSG_DEBUG("folderName [%s]", folderInfo.folderName);
-
-       print("Start Creating New Folder...");
-
-       err = msg_add_folder(hMsgHandle, &folderInfo);
-
-       if (err == MSG_SUCCESS)
-               print("Creating New Folder is OK!");
-       else
-               print("Creating New Folder is failed!");
-}
-
-
-void MsgTestUpdateFolder(MSG_HANDLE_T hMsgHandle)
-{
-       if (hMsgHandle == NULL)
-       {
-               MSG_DEBUG("Handle is NULL");
-               return;
-       }
-
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       // Make Folder
-       MSG_FOLDER_INFO_S folderInfo;
-
-       print("Select Folder to Update :");
-
-       char strId[3];
-       memset(strId, 0x00, sizeof(strId));
-
-       cin.getline(strId, 3);
-
-       folderInfo.folderId = atoi(strId);
-
-       if (folderInfo.folderId <= MSG_DRAFT_ID)
-       {
-               print("Wrong Folder ID!!");
-               return;
-       }
-
-       folderInfo.folderType = g_folderList.folderInfo[folderInfo.folderId-1].folderType;
-
-       print("Input New Folder Name :");
-
-       char strName[MAX_FOLDER_NAME_SIZE+1];
-       memset(strName, 0x00, sizeof(strName));
-
-       cin.getline(strName, MAX_FOLDER_NAME_SIZE);
-
-       strncpy(folderInfo.folderName, strName, MAX_FOLDER_NAME_SIZE);
-
-       MSG_DEBUG("folderId [%d]", folderInfo.folderId);
-       MSG_DEBUG("folderType [%d]", folderInfo.folderType);
-       MSG_DEBUG("folderName [%s]", folderInfo.folderName);
-
-       print("Start Updating Folder...");
-
-       err = msg_update_folder(hMsgHandle, &folderInfo);
-
-       if (err == MSG_SUCCESS)
-               print("Updating Folder is OK!");
-       else
-               print("Updating Folder is failed!");
-}
-
-
-void MsgTestDeleteFolder(MSG_HANDLE_T hMsgHandle)
-{
-       if (hMsgHandle == NULL)
-       {
-               MSG_DEBUG("Handle is NULL");
-               return;
-       }
-
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       print("Select Folder to Delete :");
-
-       char strId[3];
-       memset(strId, 0x00, sizeof(strId));
-
-       cin.getline(strId, 3);
-
-       MSG_FOLDER_ID_T folderId = atoi(strId);
-
-       if (folderId <= MSG_DRAFT_ID)
-       {
-               print("Wrong Folder ID!!");
-               return;
-       }
-
-       print("Start Deleting Folder...");
-
-       err = msg_delete_folder(hMsgHandle, folderId);
-
-       if (err == MSG_SUCCESS)
-               print("Deleting Folder is OK!");
-       else
-               print("Deleting Folder is failed!");
-}
-
-
-void MsgTestDeleteMessage(MSG_HANDLE_T hMsgHandle, MSG_MESSAGE_ID_T nMsgId)
-{
-       msg_mms_send_read_report(hMsgHandle, nMsgId, MSG_READ_REPORT_IS_DELETED);
-
-       if (msg_delete_message(hMsgHandle, nMsgId) != MSG_SUCCESS)
-               print("Failed to delete Message");
-}
-
-
-void MsgTestForwardMMSMessage(MSG_HANDLE_T hMsgHandle, MSG_MESSAGE_ID_T nMsgId)
-{
-       msg_message_t msg = msg_new_message();
-
-       MSG_SENDINGOPT_S sendOpt = {0};
-
-       if (msg_get_message(hMsgHandle, (MSG_MESSAGE_ID_T)nMsgId, msg, &sendOpt) != MSG_SUCCESS)
-       {
-               print("Failed to get Message");
-               msg_release_message(&msg);
-               return;
-       }
-
-       // Update Read Status
-       msg_update_read_status(hMsgHandle, msg_get_message_id(msg), true);
-
-       // send read report
-       msg_mms_send_read_report(hMsgHandle, nMsgId, MSG_READ_REPORT_IS_READ);
-
-       // read address from stdin
-       char strNumber[MAX_ADDRESS_VAL_LEN];
-
-       memset(strNumber, 0x00, sizeof(strNumber));
-
-       printf("\nInput Recipient Number. Press 'N' if you don't want : \n");
-
-       cin.getline(strNumber, 1024);
-
-       if (!strcmp(strNumber, "N"))
-       {
-               msg_release_message(&msg);
-               return;
-       }
-
-       // write address
-       msg_reset_address(msg);
-       msg_add_address(msg, strNumber, MSG_RECIPIENTS_TYPE_TO);
-
-       // write subject for forward msg
-       char strSubject[MAX_SUBJECT_LEN] = {0};
-       snprintf(strSubject, MAX_SUBJECT_LEN, "FW: %s", msg_get_subject(msg));
-       msg_set_subject(msg, strSubject);
-
-       // forward the message
-       MSG_REQUEST_S req = {0};
-       req.msg = msg;
-       req.sendOpt = sendOpt;
-
-       if (msg_mms_forward_message(hMsgHandle, &req) != MSG_SUCCESS)
-               printf("Failed to Forward Message\n");
-
-       msg_release_message(&msg);
-}
-
-
-void MsgTestRetrieveMessage(MSG_HANDLE_T hMsgHandle, MSG_MESSAGE_ID_T nMsgId)
-{
-       if (hMsgHandle == NULL)
-       {
-               MSG_DEBUG("Handle is NULL");
-               return;
-       }
-
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       msg_message_t msg = msg_new_message();
-       MSG_SENDINGOPT_S sendOpt = {0};
-
-       err = msg_get_message(hMsgHandle, nMsgId, msg, &sendOpt);
-
-       msg_update_read_status(hMsgHandle, msg_get_message_id(msg), true);
-
-       if( err != MSG_SUCCESS)
-               print("Get Message Failed!");
-
-       MSG_REQUEST_S req = {0, msg, sendOpt};
-
-       err = msg_mms_retrieve_message(hMsgHandle, &req);
-
-       if( err != MSG_SUCCESS)
-               print("Retrieve MMS Message Failed!");
-}
-
-/* reject_msg_support */
-void MsgTestRejectMessage(MSG_HANDLE_T hMsgHandle, MSG_MESSAGE_ID_T nMsgId)
-{
-       if (hMsgHandle == NULL)
-       {
-               MSG_DEBUG("Handle is NULL");
-               return;
-       }
-
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       msg_message_t msg = msg_new_message();
-       MSG_SENDINGOPT_S sendOpt = {0, };
-
-       err = msg_get_message(hMsgHandle, nMsgId, msg, &sendOpt);
-
-       if( err != MSG_SUCCESS)
-               print("Get Message Failed!");
-
-       MSG_REQUEST_S req = {0};
-       req.msg = msg;
-       req.sendOpt = sendOpt;
-
-       err = msg_mms_reject_message(hMsgHandle, &req);
-
-       if( err != MSG_SUCCESS)
-               print("Retrieve MMS Message Failed!");
-
-       msg_release_message(&msg);
-}
-/* reject_msg_support */
-
-void MsgTestUpdateMMSMessage(MSG_HANDLE_T hMsgHandle, MSG_MESSAGE_ID_T nMsgId)
-{
-       MSG_DEBUG("Update MMS Message");
-
-       if (hMsgHandle == NULL)
-       {
-               MSG_DEBUG("Handle is NULL");
-               return;
-       }
-
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       msg_message_t msg = msg_new_message();
-
-       MSG_SENDINGOPT_S sendOpt = {0};
-
-       err = msg_get_message(hMsgHandle, (MSG_MESSAGE_ID_T)nMsgId, msg, &sendOpt);
-
-       if (err != MSG_SUCCESS)
-       {
-               print("Get Message Failed!");
-               msg_release_message(&msg);
-
-               return;
-       }
-
-       MMS_MESSAGE_DATA_S *msgBody = msg_mms_create_message();
-
-       msg_mms_get_message_body(msg, msgBody);
-
-       msg_mms_add_attachment(msgBody, (char*)"/opt/etc/msg-service/P091120_104633.jpg");
-       msg_mms_add_attachment(msgBody, (char*)"/opt/etc/msg-service/audio.amr");
-
-       msg_mms_set_message_body(msg, msgBody);
-
-       time_t curTime = time(NULL);
-       msg_set_time(msg, curTime);
-       msg_set_network_status(msg, MSG_NETWORK_NOT_SEND);
-       msg_set_read_status(msg, false);
-       msg_set_protect_status(msg, false);
-       msg_set_direction_info(msg, MSG_DIRECTION_TYPE_MO);
-
-       err= msg_update_message(hMsgHandle, msg, &sendOpt);
-
-       msg_mms_destroy_message(msgBody);
-
-       msg_release_message(&msg);
-}
-
-
-void MsgPrintMMSBody(msg_message_t pMsg)
-{
-       MMS_MESSAGE_DATA_S *msgBody = msg_mms_create_message();
-       msg_mms_get_message_body(pMsg, msgBody);
-
-       //Multipart Related
-       if (msgBody->pageCnt)
-       {
-               printf("multipart type: Multipart Related\n");
-
-               //Print root-layout info
-               printf("\n** ROOT LAYOUT INFO **\n");
-               printf("width: %d %s\nheight: %d %s\nbgColor:%x\n", msgBody->rootlayout.width.value, msgBody->rootlayout.width.bUnitPercent ? "%" : "",
-                        msgBody->rootlayout.height.value,  msgBody->rootlayout.height.bUnitPercent ? "%" : "", msgBody->rootlayout.bgColor);
-
-               // Print Region Info
-               printf("\n** REGION INFO **\n");
-               printf("Region Count: %d\n", msgBody->regionCnt);
-
-               for(int i = 0; i < msgBody->regionCnt; ++i)
-               {
-                       MMS_SMIL_REGION *pRegion = msg_mms_get_smil_region(msgBody, i);
-
-                       printf("%d region id: %s\n%d region left : %d %s\n%d region top : %d %s\n%d region width : %d %s\n%d region height : %d %s\n%d region bgColor : %x\n%d region fit : %s\n",
-                               i, pRegion->szID, i, pRegion->nLeft.value, pRegion->nLeft.bUnitPercent ? "%": "", i, pRegion->nTop.value, pRegion->nTop.bUnitPercent ? "%": "",
-                               i, pRegion->width.value, pRegion->width.bUnitPercent ? "%": "", i, pRegion->height.value, pRegion->height.bUnitPercent ? "%": "",
-                               i, pRegion->bgColor, i, (pRegion->fit == MMSUI_IMAGE_REGION_FIT_MEET) ? "MEET" : "HIDDEN");
-               }
-
-               printf("\n** PAGES & CONTENTS INFO **\n");
-               printf("PAGE Count: %d\n", msgBody->pageCnt);
-
-               // Print Page info
-               for(int i = 0; i< msgBody->pageCnt; ++i)
-               {
-                       MMS_PAGE_S *pPage = msg_mms_get_page(msgBody, i);
-
-                       printf("%d page's duration: %d msec \n%d page's media count: %d\n", i, pPage->nDur, i, pPage->mediaCnt);
-
-                       // Print Contents Info
-                       for(int j = 0; j < pPage->mediaCnt; ++j)
-                       {
-                               MMS_MEDIA_S *pMedia = msg_mms_get_media(pPage, j);
-                               printf("%d media's filename: %s\n%d media's filepath: %s\n%d media's regionId: %s\n Bold: %d\n Italic: %d\n", j, pMedia->szFileName, j, pMedia->szFilePath, j, pMedia->regionId, pMedia->sMedia.sText.bBold, pMedia->sMedia.sText.bItalic);
-
-                               if (pMedia->drmType != MSG_DRM_TYPE_NONE)
-                               {
-                                       printf("%d media's drmtype: %d (1: Fowward Lock, 2:Combined Delivery, 3: Separated Delivery\n%d media's drmpath: %s\n", j, pMedia->drmType, j, pMedia->szDrm2FullPath);
-                               }
-                       }
-                       printf("\n");
-               }
-       }
-       else
-       {
-               printf("multipart type: Multipart Mixed\n");
-       }
-
-       printf("Attachment Count: %d\n", msgBody->attachCnt);
-
-       for(int i = 0; i < msgBody->attachCnt; ++i)
-       {
-               MMS_ATTACH_S *pAttach = msg_mms_get_attachment(msgBody, i);
-               printf("Attachment file Name: %s\n", pAttach->szFileName);
-               printf("Attachment file Path: %s\n", pAttach->szFilePath);
-               printf("Attached file size: %d\n", pAttach->fileSize);
-
-               if (pAttach->drmType != MSG_DRM_TYPE_NONE)
-                       printf("%d media's drmtype: %d (1: Fowward Lock, 2:Combined Delivery, 3: Separated Delivery\n%d media's drmpath: %s\n", i, pAttach->drmType, i, pAttach->szDrm2FullPath);
-       }
-
-       /*destroy and free message data*/
-       msg_mms_destroy_message(msgBody);
-
-}
-
-
-void MsgPrintMessage(MSG_HANDLE_T hMsgHandle, msg_message_t pMsg, MSG_SENDINGOPT_S* pSendOpt)
-{
-       MSG_FOLDER_ID_T folderId = msg_get_folder_id(pMsg);
-
-       system ("clear" );
-
-       printf("======================================\n");
-       printf("============== Message ==============\n");
-       printf("======================================\n");
-
-       if (msg_is_mms(pMsg) && msg_get_message_type(pMsg) == MSG_TYPE_MMS_NOTI)
-       {
-               MMS_MESSAGE_DATA_S *msgBody = msg_mms_create_message();
-
-               msg_mms_get_message_body(pMsg, msgBody);
-
-               //Multipart Related
-               if (msgBody->pageCnt)
-               {
-                       printf("multipart type: Multipart Related\n");
-
-                       //Print root-layout info
-                       printf("\n** ROOT LAYOUT INFO **\n");
-                       printf("width: %d %s\nheight: %d %s\nbgColor:%x\n", msgBody->rootlayout.width.value, msgBody->rootlayout.width.bUnitPercent ? "%" : "",
-                                msgBody->rootlayout.height.value,  msgBody->rootlayout.height.bUnitPercent ? "%" : "", msgBody->rootlayout.bgColor);
-
-                       // Print Region Info
-                       printf("\n** REGION INFO **\n");
-                       printf("Region Count: %d\n", msgBody->regionCnt);
-
-                       for(int i = 0; i < msgBody->regionCnt; ++i)
-                       {
-                               MMS_SMIL_REGION* pRegion = msg_mms_get_smil_region(msgBody, i);
-
-                               printf("%d region id: %s\n%d region left : %d %s\n%d region top : %d %s\n%d region width : %d %s\n%d region height : %d %s\n%d region bgColor : %x\n %d region fit : %s\n",
-                                       i, pRegion->szID, i, pRegion->nLeft.value, pRegion->nLeft.bUnitPercent ? "%": "", i, pRegion->nTop.value, pRegion->nTop.bUnitPercent ? "%": "",
-                                       i, pRegion->width.value, pRegion->width.bUnitPercent ? "%": "", i, pRegion->height.value, pRegion->height.bUnitPercent ? "%": "",
-                                       i, pRegion->bgColor, i, (pRegion->fit == MMSUI_IMAGE_REGION_FIT_MEET) ? "MEET" : "HIDDEN");
-                       }
-
-                       printf("\n** PAGES & CONTENTS INFO **\n");
-                       printf("PAGE Count: %d\n", msgBody->pageCnt);
-
-                       // Print Page info
-                       for(int i = 0; i< msgBody->pageCnt; ++i)
-                       {
-                               MMS_PAGE_S* pPage = msg_mms_get_page(msgBody, i);
-
-                               printf("%d page's duration: %d msec \n%d page's media count: %d\n", i, pPage->nDur, i, pPage->mediaCnt);
-
-                               // Print Contents Info
-                               for(int j = 0; j < pPage->mediaCnt; ++j)
-                               {
-                                       MMS_MEDIA_S* pMedia = msg_mms_get_media(pPage, j);
-                                       printf("%d media's filename: %s\n%d media's filepath: %s\n%d media's regionId: %s\n Bold: %d\n Italic: %d\n", j, pMedia->szFileName, j, pMedia->szFilePath, j, pMedia->regionId, pMedia->sMedia.sText.bBold, pMedia->sMedia.sText.bItalic);
-
-                                       if(pMedia->drmType != MSG_DRM_TYPE_NONE)
-                                       {
-                                               printf("%d media's drmtype: %d (1: Fowward Lock, 2:Combined Delivery, 3: Separated Delivery\n%d media's drmpath: %s\n", j, pMedia->drmType, j, pMedia->szDrm2FullPath);
-                                       }
-
-                               }
-                               printf("\n");
-                       }
-               }
-
-               else
-               {
-                       printf("multipart type: Multipart Mixed\n");
-               }
-
-               for(int i = 0; i < msgBody->attachCnt; ++i)
-               {
-                       MMS_ATTACH_S*   pAttach = msg_mms_get_attachment(msgBody, i);
-                       printf("Attachment file Name: %s\n", pAttach->szFileName);
-                       printf("Attachment file Path: %s\n", pAttach->szFilePath);
-                       printf("Attached file size: %d\n", pAttach->fileSize);
-
-                       if(pAttach->drmType != MSG_DRM_TYPE_NONE)
-                               printf("%d media's drmtype: %d (1: Fowward Lock, 2:Combined Delivery, 3: Separated Delivery\n%d media's drmpath: %s\n", i, pAttach->drmType, i, pAttach->szDrm2FullPath);
-               }
-
-               char displayTime[32];
-               memset(displayTime, 0x00, sizeof(displayTime));
-
-               MsgConvertTime(msg_get_time(pMsg), displayTime);
-
-               printf("date & time: %s\n", displayTime);
-               printf("from address: %s\n", msg_get_ith_address(pMsg, 0));
-
-               if(msg_is_sms(pMsg))
-               {
-                       printf("*** SMS Setting Value ***\n");
-                       printf("Delivery Request : %d\n", pSendOpt->bDeliverReq);
-                       printf("Reply Path : %d\n", pSendOpt->option.smsSendOpt.bReplyPath);
-               }
-               else if(msg_is_mms(pMsg))
-               {
-                       printf("Subject: %s\n", msg_get_subject(pMsg));
-
-                       char expiryTime[32];
-                       memset(expiryTime, 0x00, sizeof(expiryTime));
-
-                       MsgConvertTime(&(pSendOpt->option.mmsSendOpt.expiryTime), expiryTime);
-
-                       printf("*** MMS Setting Value ***\n ");
-                       printf("Delivery Requeset : %d\n Read Report Request : %d\n Priority : %d\n ExpiryTime : %s\n\n",
-                               pSendOpt->bDeliverReq, pSendOpt->option.mmsSendOpt.bReadReq, pSendOpt->option.mmsSendOpt.priority, expiryTime);
-
-                       MSG_REPORT_STATUS_INFO_S reportStatus = {};
-
-                       msg_get_report_status(hMsgHandle, msg_get_message_id(pMsg), &reportStatus);
-
-                       memset(expiryTime, 0x00, sizeof(expiryTime));
-                       MsgConvertTime(&(reportStatus.deliveryStatusTime), expiryTime);
-
-                       printf("Delivery Report Status : %d\n Delivery Report Status Time: %s\n ",
-                               reportStatus.deliveryStatus, expiryTime);
-
-                       memset(expiryTime, 0x00, sizeof(expiryTime));
-                       MsgConvertTime(&(reportStatus.readStatusTime), expiryTime);
-
-                       printf("Read Report Status : %d\n Read Report Status Time: %s\n ",
-                               reportStatus.readStatus, expiryTime);
-               }
-
-               printf("======================================\n");
-               printf("[R] Reply\n[T] rTreive MMS\n[F] Forward\n[D] Delete\n[C] Change Folder\n[M] Move to Sim\n[P] Protect\n[B] Back");
-
-               /*destroy and free message data*/
-               msg_mms_destroy_message(msgBody);
-       }
-       else if (folderId == MSG_INBOX_ID)
-       {
-               char displayTime[32];
-               memset(displayTime, 0x00, sizeof(displayTime));
-
-               MsgConvertTime(msg_get_time(pMsg), displayTime);
-
-               const char* msgText = NULL;
-
-               int msgType = msg_get_message_type(pMsg);
-
-               if (msgType==MSG_TYPE_MMS_NOTI || msgType==MSG_TYPE_MMS_JAVA || msgType==MSG_TYPE_MMS) {
-                       msgText = msg_mms_get_text_contents(pMsg);
-               } else {
-                       msgText = msg_sms_get_message_body(pMsg);
-               }
-
-               printf("message text\n[%s]\n\ndate & time : [%s]\n\naddress : [%s]\nname : [%s]\ncontact ID : [%d]\n",
-                                          msgText, displayTime, msg_get_ith_address(pMsg, 0), msg_get_ith_name(pMsg, 0), msg_get_ith_contact_id(pMsg, 0));
-
-               if (msg_is_mms(pMsg)) {
-                       printf("Subject: %s\n", msg_get_subject(pMsg));
-                       MsgPrintMMSBody(pMsg);
-               }
-
-               if(msg_is_in_sim(pMsg))
-               {
-                       printf("\nstorage : [Sim Card]\n");
-                       printf("======================================\n");
-//                     if(msg_get_message_type(pMsg) == MSG_TYPE_SMS_SYNCML)
-                               printf("[R] Reply\n[F] Forward\n[D] Delete\n[C] Change Folder\n[M] Move to Phone\n[P] Protect\n[B] Back\n[I] Install CP Message");
-//                     else
-//                             printf("[R] Reply\n[F] Forward\n[D] Delete\n[C] Change Folder\n[M] Move to Phone\n[P] Protect\n[B] Back");
-               }
-               else
-               {
-                       printf("======================================\n");
-//                     if(msg_get_message_type(pMsg) == MSG_TYPE_SMS_SYNCML)
-                               printf("[R] Reply\n[F] Forward\n[D] Delete\n[C] Change Folder\n[M] Move to Sim\n[P] Protect\n[B] Back\n[I] Install CP Message");
-//                     else
-//                             printf("[R] Reply\n[T] rTreive MMS\n[F] Forward\n[D] Delete\n[C] Change Folder\n[M] Move to Sim\n[P] Protect\n[B] Back");
-               }
-       }
-       else if (folderId == MSG_OUTBOX_ID)
-       {
-               char displayTime[32];
-               memset(displayTime, 0x00, sizeof(displayTime));
-
-               MsgConvertTime(msg_get_time(pMsg), displayTime);
-
-               const char* msgText = NULL;
-
-               int msgType = msg_get_message_type(pMsg);
-
-               if(msgType==MSG_TYPE_MMS_NOTI || msgType==MSG_TYPE_MMS_JAVA || msgType==MSG_TYPE_MMS)
-                       msgText = msg_mms_get_text_contents(pMsg);
-               else
-                       msgText = msg_sms_get_message_body(pMsg);
-
-               printf("message text\n[%s]\n\ndate & time : [%s]\n\n", msgText, displayTime);
-
-               int addr_count = msg_get_address_count(pMsg);
-               for (int i = 0; i < addr_count; i++)
-                       printf("address : [%s]\nname : [%s]\ncontact ID : [%d]\n\n", msg_get_ith_address(pMsg, i), msg_get_ith_name (pMsg, i), msg_get_ith_contact_id(pMsg, i) );
-
-
-               if(msg_is_in_sim(pMsg))
-               {
-                       printf("\nstorage : [Sim Card]\n");
-                       printf("======================================\n");
-                       printf("[S] Send\n[F] Forward\n[D] Delete\n[C] Change Folder\n[M] Move to Phone\n[P] Protect\n[B] Back");
-               }
-               else
-               {
-                       printf("======================================\n");
-                       printf("[S] Send\n[F] Forward\n[D] Delete\n[C] Change Folder\n[M] Move to Sim\n[P] Protect\n[B] Back");
-               }
-       }
-       else if (folderId == MSG_DRAFT_ID)
-       {
-               char displayTime[32];
-               memset(displayTime, 0x00, sizeof(displayTime));
-
-               MsgConvertTime(msg_get_time(pMsg), displayTime);
-
-               const char* msgText = NULL;
-
-               int msgType = msg_get_message_type(pMsg);
-
-               if(msgType==MSG_TYPE_MMS_NOTI || msgType==MSG_TYPE_MMS_JAVA || msgType==MSG_TYPE_MMS)
-                       msgText = msg_mms_get_text_contents(pMsg);
-               else
-                       msgText = msg_sms_get_message_body(pMsg);
-
-               printf("message text\n[%s]\n\ndate & time : [%s]\n\n", msgText, displayTime);
-
-               int addr_count = msg_get_address_count(pMsg);
-               for (int i = 0; i < addr_count; i++)
-                       printf("address : [%s]\nname : [%s]\ncontact ID : [%d]\n\n", msg_get_ith_address(pMsg, i), msg_get_ith_name (pMsg, i), msg_get_ith_contact_id(pMsg, i));
-
-               printf("======================================\n");
-               printf("[S] Send\n[E] Edit\n[D] Delete\n[C] Change Folder\n[P] Protect\n[B] Back");
-       }
-       else
-       {
-               char displayTime[32];
-               memset(displayTime, 0x00, sizeof(displayTime));
-
-               MsgConvertTime(msg_get_time(pMsg), displayTime);
-
-               const char* msgText = NULL;
-
-               int msgType = msg_get_message_type(pMsg);
-
-               if(msgType==MSG_TYPE_MMS_NOTI || msgType==MSG_TYPE_MMS_JAVA || msgType==MSG_TYPE_MMS)
-                       msgText = msg_mms_get_text_contents(pMsg);
-               else
-                       msgText = msg_sms_get_message_body(pMsg);
-
-               printf("message text\n[%s]\n\ndate & time : [%s]\n\n", msgText, displayTime);
-
-               int addr_count = msg_get_address_count(pMsg);
-               for (int i = 0; i < addr_count; i++)
-                       printf("address : [%s]\nname : [%s]\ncontact ID : [%d]\n\n", msg_get_ith_address(pMsg, i), msg_get_ith_name(pMsg, i), msg_get_ith_contact_id(pMsg, i));
-
-               if(msg_is_sms(pMsg))
-               {
-                       printf("*** SMS Setting Value ***\n");
-                       printf("Delivery Requeset : %d\nReply Path : %d\n", pSendOpt->bDeliverReq, pSendOpt->option.smsSendOpt.bReplyPath);
-               }
-               else if(msg_is_mms(pMsg))
-               {
-                       printf("Subject: %s\n", msg_get_subject(pMsg));
-
-                       char expiryTime[32];
-                       memset(expiryTime, 0x00, sizeof(expiryTime));
-
-                       MsgConvertTime(&(pSendOpt->option.mmsSendOpt.expiryTime), expiryTime);
-
-                       printf("*** MMS Setting Value ***\n ");
-                       printf("Delivery Requeset : %d\n Read Report Request : %d\n Priority : %d\n ExpiryTime : %s\n\n",
-                               pSendOpt->bDeliverReq, pSendOpt->option.mmsSendOpt.bReadReq, pSendOpt->option.mmsSendOpt.priority, expiryTime);
-
-                       MSG_REPORT_STATUS_INFO_S reportStatus = {};
-
-                       msg_get_report_status(hMsgHandle, msg_get_message_id(pMsg), &reportStatus);
-
-                       memset(expiryTime, 0x00, sizeof(expiryTime));
-                       MsgConvertTime(&(reportStatus.deliveryStatusTime), expiryTime);
-
-                       printf("Delivery Report Status : %d\n Delivery Report Status Time: %s\n ",
-                               reportStatus.deliveryStatus, expiryTime);
-
-                       memset(expiryTime, 0x00, sizeof(expiryTime));
-                       MsgConvertTime(&(reportStatus.readStatusTime), expiryTime);
-
-                       printf("Read Report Status : %d\n Read Report Status Time: %s\n ",
-                               reportStatus.readStatus, expiryTime);
-
-                       MsgPrintMMSBody(pMsg);
-               }
-
-
-               printf("======================================\n");
-               printf("[D] Delete\n[P] Protect\n[B] Back");
-       }
-
-       printf("\n======================================\n");
-       print("Input : ");
-
-       char select = 0, ch = 0;
-
-       cin >> select;
-       ch = cin.get();
-
-       MsgRunMsgMenu(hMsgHandle, select, pMsg, pSendOpt);
-}
-
-
-void MsgRunMsgMenu(MSG_HANDLE_T hMsgHandle, char Menu, msg_message_t pMsg, MSG_SENDINGOPT_S *pSendOpt)
-{
-       switch (Menu)
-       {
-               case 'R' :
-               {
-
-
-               }
-               break;
-
-               case 'T' :
-               {
-
-               }
-
-               case 'F' :
-               {
-
-
-               }
-               break;
-
-               case 'D' : // Delete Message
-               {
-                       if ( msg_is_protected(pMsg))
-                               print("The message is protected. You cannot delete.");
-                       else
-                               msg_delete_message(hMsgHandle, msg_get_message_id(pMsg));
-               }
-               break;
-
-               case 'C' : // Move Message to other folder
-               {
-                       MsgTestMoveMessage(hMsgHandle, msg_get_message_id(pMsg));
-               }
-               break;
-
-               case 'M' : // Move to Sim
-               {
-                       MsgTestMoveStorageMessage(hMsgHandle, pMsg);
-               }
-               break;
-
-               case 'P' :  // Set Protect
-               {
-                       if (msg_is_protected(pMsg))
-                               msg_update_protected_status(hMsgHandle, msg_get_message_id(pMsg), false);
-                       else
-                               msg_update_protected_status(hMsgHandle, msg_get_message_id(pMsg), true);
-               }
-               break;
-
-               case 'S' :
-               {
-                       MsgTestSubmitReq(hMsgHandle, pMsg, NULL); // fuction call to "MsgTestTransport.cpp"
-               }
-               break;
-
-               case 'E' :
-               {
-                       MsgTestUpdateMessage(hMsgHandle, pMsg);
-               }
-               break;
-
-               case 'B' :
-               break;
-
-               case 'I' :
-               {
-                       //if(msg_get_message_type(pMsg) == MSG_TYPE_SMS_SYNCML)
-                               msg_syncml_message_operation(hMsgHandle, (MSG_MESSAGE_ID_T)msg_get_message_id(pMsg));
-               }
-               break;
-
-               default :
-               {
-                       print("Not Supported Menu");
-               }
-               break;
-       }
-}
-
-
-void MsgRunMsgListMenu(MSG_HANDLE_T hMsgHandle, int MsgId, int FolderId, MSG_MESSAGE_TYPE_T MsgType, MSG_NETWORK_STATUS_T NetworkStatus)
-{
-       if (MsgType == MSG_TYPE_SMS || MsgType == MSG_TYPE_SMS_CB || MsgType == MSG_TYPE_SMS_JAVACB ||
-               MsgType == MSG_TYPE_SMS_MWI || MsgType == MSG_TYPE_SMS_SYNCML || MsgType == MSG_TYPE_SMS_WAPPUSH)
-       {
-               if (MsgId > 0 && MsgId <= 9999)
-               {
-                       MsgTestGetMessage(hMsgHandle, MsgId);
-               }
-               else
-               {
-                       print("Not Supported Msg Id");
-                       return;
-               }
-       }
-       else if (MsgType == MSG_TYPE_MMS || MsgType == MSG_TYPE_MMS_JAVA || MsgType == MSG_TYPE_MMS_NOTI)
-       {
-               char menu[2];
-
-               if(NetworkStatus == MSG_NETWORK_RETRIEVE_SUCCESS  ||NetworkStatus == MSG_NETWORK_SEND_SUCCESS ||
-                       NetworkStatus == MSG_NETWORK_SEND_FAIL || NetworkStatus == MSG_NETWORK_SENDING)
-               {
-                       print("======== Select ========");
-                       print("[R] Read MMS Message");
-                       print("[F] Forward MMS Message");
-                       print("[D] Delete MMS Message");
-                       print("[B] BACK");
-                       print("====================");
-                       print("Input : ");
-               }
-               else if(NetworkStatus == MSG_NETWORK_RETRIEVE_FAIL || NetworkStatus == MSG_NETWORK_RECEIVED)
-               {
-                       print("======== Select ========");
-                       print("[T] Retrieve MMS Message");
-                       print("[J] Reject MMS Message");
-                       print("[D] Delete MMS Message");
-                       print("[B] BACK");
-                       print("====================");
-                       print("Input : ");
-               }
-               else if(NetworkStatus == MSG_NETWORK_NOT_SEND)
-               {
-                       print("======== Select ========");
-                       print("[R] Read MMS Message");
-                       print("[U] Update MMS Message");
-                       print("[B] BACK");
-                       print("====================");
-                       print("Input : ");
-               }
-
-               memset(menu, 0x00, sizeof(menu));
-               cin.getline(menu, 2);
-
-               if (MsgId <= 0 || MsgId > 9999)
-               {
-                       print("Not Supported Msg Id");
-                       return;
-               }
-
-               if (!strcmp(menu, "R"))
-               {
-                       MsgTestGetMessage(hMsgHandle, MsgId);
-               }
-               else if (!strcmp(menu, "D"))
-               {
-                       MsgTestDeleteMessage(hMsgHandle, MsgId);
-               }
-               else if(!strcmp(menu, "F"))
-               {
-                       MsgTestForwardMMSMessage(hMsgHandle, MsgId);
-               }
-               else if(!strcmp(menu, "T"))
-               {
-                       MsgTestRetrieveMessage(hMsgHandle, MsgId);
-               }
-               /* reject_msg_support */
-               else if(!strcmp(menu, "J"))
-               {
-                       MsgTestRejectMessage(hMsgHandle, MsgId);
-               }
-               /* reject_msg_support */
-               else if(!strcmp(menu, "U"))
-               {
-                       MsgTestUpdateMMSMessage(hMsgHandle, MsgId);
-               }
-               else if (!strcmp(menu, "B"))
-               {
-                       return;
-               }
-       }
-}
-
-
-void MsgGetCurrentTime(time_t *pTime)
-{
-
-       time_t curTime;
-       time(&curTime);
-       //struct tm timeStruct = {0};
-       //localtime_r(&curTime, &timeStruct);
-
-       //memset(pTime, 0x00, sizeof(pTime));
-       //sprintf(pTime, "%04d-%02d-%02d %02d:%02d:%02d",
-       //      timeStruct.tm_year+1900, timeStruct.tm_mon+1, timeStruct.tm_mday,
-       //      timeStruct.tm_hour, timeStruct.tm_min, timeStruct.tm_sec);
-
-       *pTime = curTime;
-       MSG_DEBUG("Current time is %s", ctime(&curTime));
-}
-
-
-const char* MsgConvertMsgType(MSG_MESSAGE_TYPE_T MsgType)
-{
-       if (MsgType == MSG_TYPE_SMS)
-                       return "SMS";
-       else if (MsgType == MSG_TYPE_SMS_CB || MsgType == MSG_TYPE_SMS_JAVACB)
-                       return "CB";
-       else if (MsgType == MSG_TYPE_SMS_WAPPUSH)
-                       return "WAP";
-       else if (MsgType == MSG_TYPE_SMS_MWI)
-                       return "MWI";
-       else if (MsgType == MSG_TYPE_MMS || MsgType == MSG_TYPE_MMS_NOTI)
-               return "MMS";
-
-       return "UNKNOWN";
-}
-
-
-const char* MsgConvertStorageId(MSG_STORAGE_ID_T StorageId)
-{
-       if (StorageId == MSG_STORAGE_PHONE)
-               return "PHONE";
-       else if (StorageId == MSG_STORAGE_SIM)
-               return "SIM";
-
-       return "PHONE";
-}
-
-
-const char* MsgConvertNetworkStatus(MSG_NETWORK_STATUS_T status)
-{
-       switch (status)
-       {
-               case MSG_NETWORK_NOT_SEND :
-                       return "NOT SEND";
-               case MSG_NETWORK_SENDING :
-                       return "SENDING";
-               case MSG_NETWORK_SEND_SUCCESS :
-                       return "SENT";
-               case MSG_NETWORK_SEND_FAIL :
-                       return "FAIL TO SEND";
-               case MSG_NETWORK_DELIVER_SUCCESS :
-                       return "DELIVERED";
-               case MSG_NETWORK_DELIVER_FAIL :
-                       return "FAIL TO DELIVER";
-               case MSG_NETWORK_RECEIVED :
-                       return "RECEIVED";
-               case MSG_NETWORK_RETRIEVE_FAIL:
-                       return "NOT YET RETRIEVED";
-               case MSG_NETWORK_RETRIEVE_SUCCESS :
-                       return "RETRIEVED";
-               case MSG_NETWORK_RETRIEVING:
-                       return "RETRIEVING";
-               default :
-                       return "NOT SEND";
-       }
-
-       return "NOT SEND";
-}
-
-
-const char* MsgConvertReadStatus(bool ReadStatus)
-{
-       if (ReadStatus == true)
-               return "READ";
-       else if (ReadStatus == false)
-               return "UNREAD";
-
-       return "UNREAD";
-}
-
-
-const char* MsgConvertProtectedStatus(bool ProtectedStatus)
-{
-       if (ProtectedStatus == true)
-               return "PROTECTED";
-       else if (ProtectedStatus == false)
-               return "UNPROTECTED";
-
-       return "PROTECTED";
-}
-
-
-void MsgConvertTime(time_t *pTime, char *pDisplayTme)
-{
-       struct tm * timeinfo;
-
-       tzset();
-
-       timeinfo = localtime(pTime);
-
-//     MSG_DEBUG("time  zone is %s", timeinfo->tm_zone);
-
-       memset(pDisplayTme, 0x00, sizeof(pDisplayTme));
-
-//     strftime(timeBuff, 32, "%c", timeinfo);
-
-       strftime(pDisplayTme, 32, "%Y-%02m-%02d %T %z", timeinfo);
-}
-
diff --git a/test_app/MsgTestStorage.h b/test_app/MsgTestStorage.h
deleted file mode 100755 (executable)
index 71e8dea..0000000
+++ /dev/null
@@ -1,264 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-
-/**
- *     @file           MsgTestStorage.h
- *     @brief          Defines storage test function of messaging framework
- *     @version                1.0
- */
-
-#ifndef MSG_TEST_STORAGE_H
-#define MSG_TEST_STORAGE_H
-
-/**
- *     @section                Introduction
- *     - Introduction : Overview on Messaging Storage Test Function
- *     @section                Program
- *     - Program : Messaging Storage Test Function Reference
- */
-
-/*==================================================================================================
-                                         INCLUDE FILES
-==================================================================================================*/
-
-#include "MsgTypes.h"
-
-/**
- *     @ingroup                MESSAGING_FRAMEWORK
- *     @defgroup       MESSAGING_STORAGE_TEST_FUNCTION Messaging Storage Test Function
- *     @{
- */
-
-/*==================================================================================================
-                                     FUNCTION PROTOTYPES
-==================================================================================================*/
-
-/**    @fn             void MsgTestAddMessage(MSG_HANDLE_T hMsgHandle)
- *     @brief  Tests MsgAddMessage.
- *     @param[in]      hMsgHandle is Message handle. \n
- */
-void MsgTestAddMessage(MSG_HANDLE_T hMsgHandle);
-
-
-/**    @fn             void MsgTestGetMessage(MSG_HANDLE_T hMsgHandle, int MsgId)
- *     @brief  Tests MsgGetMessage.
- *     @param[in]      hMsgHandle is Message handle. \n
- *     @param[in]      MsgId is the ID of the message to be returned. \n
- */
-void MsgTestGetMessage(MSG_HANDLE_T hMsgHandle, int MsgId);
-
-
-/**    @fn             void MsgTestGetMessageList(MSG_HANDLE_T hMsgHandle, int FolderId)
- *     @brief  Tests MsgGetMsgCommInfoList.
- *     @param[in]      hMsgHandle is Message handle. \n
- *     @param[in]      FolderId is the ID of the folder to be returned. \n
- */
-void MsgTestGetMessageList(MSG_HANDLE_T hMsgHandle, int FolderId);
-
-
-/**    @fn             void MsgTestUpdateMessage(MSG_HANDLE_T hMsgHandle, msg_message_t *pMsg)
- *     @brief  Tests MsgUpdateMessage.
- *     @param[in]      hMsgHandle is Message handle. \n
- *     @param[in]      pMsg is a pointer to an msg_message_t structure. \n
- */
-void MsgTestUpdateMessage(MSG_HANDLE_T hMsgHandle, msg_message_t pMsg);
-
-/**    @fn             void MsgTestUpdateMMSMessage(MSG_HANDLE_T hMsgHandle, MSG_MESSAGE_ID_T nMsgId)
- *     @brief  Tests MsgUpdateMessage.
- *     @param[in]      hMsgHandle is Message handle. \n
- *     @param[in]      pMsg is a pointer to an msg_message_t structure. \n
- */
-void MsgTestUpdateMMSMessage(MSG_HANDLE_T hMsgHandle, MSG_MESSAGE_ID_T nMsgId);
-
-/**    @fn             void MsgTestMoveMessage(MSG_HANDLE_T hMsgHandle, MSG_MESSAGE_ID_T MsgId)
- *     @brief  Tests MsgMoveMessageToFolder.
- *     @param[in]      hMsgHandle is Message handle. \n
- *     @param[in]      MsgId is the ID of the message to be moved. \n
- */
-void MsgTestMoveMessage(MSG_HANDLE_T hMsgHandle, MSG_MESSAGE_ID_T MsgId);
-
-
-/**    @fn             void MsgTestMoveStorageMessage(MSG_HANDLE_T hMsgHandle, MSG_MESSAGE_ID_T MsgId, MSG_STORAGE_ID_T storageId)
- *     @brief  Tests MsgMoveMessageToStorage.
- *     @param[in]      hMsgHandle is Message handle. \n
- *     @param[in]      MsgId is the ID of the message to be moved. \n
- *     @param[in]      storageId is the destination storage ID. \n
- */
-void MsgTestMoveStorageMessage(MSG_HANDLE_T hMsgHandle, msg_message_t pMsg);
-
-
-/**    @fn             void MsgTestAddFolder(MSG_HANDLE_T hMsgHandle)
- *     @brief  Tests MsgAddFolder.
- *     @remarks
-       Pre-condition : The storage has to be properly setup and initialized. \n
-       The code below is to create folder.
- *     @code
-       void MsgTestAddFolder(MSG_HANDLE_T hMsgHandle)
-       {
-               if (hMsgHandle == NULL)
-               {
-                       MSG_DEBUG("Handle is NULL");
-                       return;
-               }
-
-               MSG_ERROR_T err = MSG_SUCCESS;
-
-               // Make Folder
-               MSG_FOLDER_INFO_S folderInfo;
-
-               folderInfo.folderId = g_folderList.nCount + 1;
-               folderInfo.folderType = MSG_FOLDER_TYPE_USER_DEF;
-
-               char strName[MAX_FOLDER_NAME_SIZE+1];
-               memset(strName, 0x00, sizeof(strName));
-               cin.getline(strName, MAX_FOLDER_NAME_SIZE);
-               strncpy(folderInfo.folderName, strName, MAX_FOLDER_NAME_SIZE);
-
-               MSG_DEBUG("folderId [%d]", folderInfo.folderId);
-               MSG_DEBUG("folderType [%d]", folderInfo.folderType);
-               MSG_DEBUG("folderName [%s]", folderInfo.folderName);
-
-               print("Start Creating New Folder...");
-
-               // Create Folder
-               err = MsgAddFolder(hMsgHandle, &folderInfo);
-
-               if (err == MSG_SUCCESS)
-                       print("Creating New Folder is OK!");
-               else
-                       print("Creating New Folder is failed!");
-       }
- *     @endcode
- *     @param[in]      hMsgHandle is Message handle.
- */
-void MsgTestAddFolder(MSG_HANDLE_T hMsgHandle);
-
-
-/**    @fn             void MsgTestUpdateFolder(MSG_HANDLE_T hMsgHandle)
- *     @brief  Tests MsgUpdateFolder.
- *     @param[in]      hMsgHandle is Message handle.
- */
-void MsgTestUpdateFolder(MSG_HANDLE_T hMsgHandle);
-
-
-/**    @fn             void MsgTestDeleteFolder(MSG_HANDLE_T hMsgHandle)
- *     @brief  Tests MsgDeleteFolder.
- *     @param[in]      hMsgHandle is Message handle.
- */
-void MsgTestDeleteFolder(MSG_HANDLE_T hMsgHandle);
-
-void MsgTestDeleteMessage(MSG_HANDLE_T hMsgHandle, MSG_MESSAGE_ID_T nMsgId);
-
-/**    @fn             void MsgPrintMMSBody(msg_message_t pMsg)
- *     @brief  Prints mms body's (content) information.
- *     @param[in]      pMsg is a pointer to an msg_message_t structure. \n
- */
-void MsgPrintMMSBody(msg_message_t pMsg);
-
-/**    @fn             void MsgPrintMessage(MSG_HANDLE_T hMsgHandle, msg_message_t *pMsg)
- *     @brief  Prints message information.
- *     @param[in]      hMsgHandle is Message handle. \n
- *     @param[in]      pMsg is a pointer to an msg_message_t structure. \n
- */
-void MsgPrintMessage(MSG_HANDLE_T hMsgHandle, msg_message_t pMsg, MSG_SENDINGOPT_S* pSendOpt);
-
-
-/**    @fn             void MsgRunMsgMenu(MSG_HANDLE_T hMsgHandle, char Menu, msg_message_t *pMsg)
- *     @brief  Runs the selected function in the message menu.
- *     @param[in]      hMsgHandle is Message handle. \n
- *     @param[in]      Menu indicates which menu is selected. \n
- *     @param[in]      pMsg is a pointer to an msg_message_t structure. \n
- */
-void MsgRunMsgMenu(MSG_HANDLE_T hMsgHandle, char Menu, msg_message_t pMsg, MSG_SENDINGOPT_S *pSendOpt);
-
-
-/**    @fn             void MsgRunMsgListMenu(MSG_HANDLE_T hMsgHandle, char *pMenu, int FolderId, MSG_MAIN_TYPE_T mainType, MSG_NETWORK_STATUS_T NetworkStatus)
- *     @brief  Runs the selected function in the message list menu.
- *     @param[in]      hMsgHandle is Message handle. \n
- *     @param[in]      pMenu is a pointer that indicates which menu is selected. \n
- *     @param[in]      FolderId is the ID of the folder to be run. \n
- */
-void MsgRunMsgListMenu(MSG_HANDLE_T hMsgHandle, int MsgId, int FolderId, MSG_MESSAGE_TYPE_T MsgType, MSG_NETWORK_STATUS_T NetworkStatus);
-
-
-/**    @fn             void MsgGetCurrentTime(time_t *pTime)
- *     @brief  Gets the current time.
- *     @param[out]     pTime is a pointer that indicates the current time.
- */
-void MsgGetCurrentTime(time_t *pTime);
-
-
-/**    @fn             char* MsgConvertMsgType(MSG_MAIN_TYPE_T MainType)
- *     @brief  Converts the message type.
- *     @param[in]      MainType indicates the message type to be returned.
- *     @retval SMS \n
- *     @retval MMS \n
- *     @retval EMAIL \n
- */
-const char* MsgConvertMsgType(MSG_MESSAGE_TYPE_T MsgType);
-
-const char* MsgConvertStorageId(MSG_STORAGE_ID_T StorageId);
-
-const char* MsgConvertNetworkStatus(MSG_NETWORK_STATUS_T status);
-
-/**    @fn             char* MsgConvertReadStatus(bool ReadStatus)
- *     @brief  Converts the read status of a message.
- *     @param[in]      ReadStatus indicates whether a message is read or not.
- *     @retval READ \n
- *     @retval UNREAD \n
- */
-const char* MsgConvertReadStatus(bool ReadStatus);
-
-
-/**    @fn             char* MsgConvertProtectedStatus(bool ProtectedStatus)
- *     @brief  Converts the protected status of a message.
- *     @param[in]      ProtectedStatus indicates whether a message is protected or not.
- *     @retval PROTECTED \n
- *     @retval UNPROTECTED \n
- */
-const char* MsgConvertProtectedStatus(bool ProtectedStatus);
-
-
-/**    @fn             char* MsgConvertTime(const time_t *pTime)
- *     @brief  Converts the time_t value to string.
- *     @param[in]      time_t value.
- *     @retval String type time present. \n
- */
-void MsgConvertTime(time_t *pTime, char *pDisplayTme);
-
-//MSG_ERROR_T convertMsgStruct(const msg_message_t *pSource, MSG_MESSAGE_INFO_S *pDest);
-
-MSG_ERROR_T MsgTestSendReadReport(MSG_HANDLE_T hMsgHandle, msg_message_t pMsg, int mmsReadStatus, int version);
-
-void MsgTestForwardMMSMessage(MSG_HANDLE_T hMsgHandle, MSG_MESSAGE_ID_T nMsgId);
-
-void MsgTestRetrieveMessage(MSG_HANDLE_T hMsgHandle, MSG_MESSAGE_ID_T nMsgId);
-
-void MsgTestMsgGen(MSG_HANDLE_T hMsgHandle);
-
-//thread view
-void MsgThreadViewMain(MSG_HANDLE_T hMsgHandle);
-
-void MsgRunThreadViewMenu(MSG_HANDLE_T  hMsgHandle, MSG_THREAD_LIST_INDEX_S *pAddrList);
-
-/**
- *     @}
- */
-
-
-#endif //MSG_TEST_STORAGE_H
-
diff --git a/test_app/MsgTestThreadView.cpp b/test_app/MsgTestThreadView.cpp
deleted file mode 100755 (executable)
index 2f41146..0000000
+++ /dev/null
@@ -1,602 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-
-/*==================================================================================================
-                                         INCLUDE FILES
-==================================================================================================*/
-#include <time.h>
-#include <iostream>
-#include <string>
-#include <stdlib.h>
-using namespace std;
-
-#include "MsgMmsTypes.h"
-#include "MsgTypes.h"
-#include "MapiStorage.h"
-#include "MapiSetting.h"
-#include "MapiMessage.h"
-#include "MsgTestStorage.h"
-#include "MsgTestTransport.h"
-#include "MsgTestThreadView.h"
-#include "main.h"
-
-
-#define MSG_PROFILE_BEGIN(pfid) \
-       unsigned int __prf_l1_##pfid = __LINE__;    \
-       struct timeval __prf_1_##pfid;              \
-       struct timeval __prf_2_##pfid;              \
-       do {                                        \
-               gettimeofday(&__prf_1_##pfid, 0);       \
-       } while (0)
-
-#define MSG_PROFILE_END(pfid) \
-       unsigned int __prf_l2_##pfid = __LINE__;\
-       do { \
-               gettimeofday(&__prf_2_##pfid, 0);\
-               long __ds = __prf_2_##pfid.tv_sec - __prf_1_##pfid.tv_sec;\
-               long __dm = __prf_2_##pfid.tv_usec - __prf_1_##pfid.tv_usec;\
-               if ( __dm < 0 ) { __ds--; __dm = 1000000 + __dm; } \
-               printf("**PROFILE** [MSGFW: %s: %s() %u ~ %u] " #pfid " -> Elapsed Time: %u.%06u seconds\n",                    \
-               rindex(__FILE__, '/')+1,                \
-               __FUNCTION__, \
-               __prf_l1_##pfid,                                         \
-               __prf_l2_##pfid,                                         \
-               (unsigned int)(__ds),                                    \
-               (unsigned int)(__dm));                                   \
-       } while (0)
-
-
-/*==================================================================================================
-                                     FUNCTION IMPLEMENTATION
-==================================================================================================*/
-void MsgThreadViewMain(MSG_HANDLE_T hMsgHandle)
-{
-       if (hMsgHandle == NULL)
-       {
-               MSG_DEBUG("Handle is NULL");
-               return;
-       }
-
-       char menu[5];
-
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       MSG_SORT_RULE_S sortRule = {0};
-
-       // Set Sort Rule
-       sortRule.sortType = MSG_SORT_BY_THREAD_DATE;
-       sortRule.bAscending = false;
-
-       MSG_THREAD_VIEW_LIST_S threadViewList;
-
-       char displayTime[32];
-
-       do
-       {
-               err = msg_get_thread_view_list(hMsgHandle, NULL, &threadViewList);
-
-               if (err != MSG_SUCCESS && err != MSG_ERR_DB_NORECORD)
-               {
-                       print("Get Message List is failed!");
-                       return;
-               }
-
-               system ("clear" );
-
-               print("======================================");
-               print("============ Thread View =============");
-               print("======================================");
-
-               if (threadViewList.nCount <= 0)
-               {
-                       print("Empty...");
-               }
-               else
-               {
-                       MSG_PROFILE_BEGIN(1);
-
-                       for (int i = 0; i < threadViewList.nCount; i++)
-                       {
-                               memset(displayTime, 0x00, sizeof(displayTime));
-
-                               MsgConvertTime(msg_thread_view_get_time(threadViewList.msgThreadInfo[i]), displayTime);
-
-                               printf("[%04d]\tUnread Msg [%d]\t[%s] [%s] [%s]\n[%s]\tType [%s]\tMessage Text [%s]\n",
-                                               msg_thread_view_get_thread_id(threadViewList.msgThreadInfo[i]),
-                                               msg_thread_view_get_unread_cnt(threadViewList.msgThreadInfo[i]),
-                                               msg_thread_view_get_address(threadViewList.msgThreadInfo[i]),
-                                               msg_thread_view_get_name(threadViewList.msgThreadInfo[i]),
-                                               displayTime,
-                                               MsgConvertDirection(msg_thread_view_get_direction(threadViewList.msgThreadInfo[i])),
-                                               MsgConvertType(msg_thread_view_get_message_type(threadViewList.msgThreadInfo[i])),
-                                               msg_thread_view_get_data(threadViewList.msgThreadInfo[i]));
-
-                               printf("--------------------------------------------------------\n");
-                       }
-                       MSG_PROFILE_END(1);
-               }
-
-               print("======================================");
-               print("================ Menu ================");
-               print("======================================");
-               print("[C] Create Message");
-               print("[D] Delete Thread");
-               print("[B] Back");
-               print("======================================");
-
-               print("Input : ");
-
-               memset(menu, 0x00, sizeof(menu));
-               cin.getline(menu, 5);
-
-               if (!strcmp(menu, "C") || !strcmp(menu, "c")) // Add Message
-               {
-                       MsgTestAddMessage(hMsgHandle);
-               }
-               else if (!strcmp(menu, "D") || !strcmp(menu, "d"))
-               {
-                       print("Choose Thread ID : ");
-
-                       char id[5];
-
-                       memset(id, 0x00, sizeof(id));
-                       cin.getline(id, 5);
-
-                       print("Do you really wanna delete messages in thread [Y or N] ?");
-
-                       char select[2];
-
-                       memset(select, 0x00, sizeof(select));
-                       cin.getline(select, 2);
-
-MSG_PROFILE_BEGIN(3);
-                       if (!strcmp(select, "Y") || !strcmp(select, "y"))
-                               msg_delete_thread_message_list(hMsgHandle, (MSG_THREAD_ID_T)atoi(id));
-MSG_PROFILE_END(3);
-               }
-               else if (!strcmp(menu, "B") || !strcmp(menu, "b"))
-               {
-                       msg_release_thread_view_list(&threadViewList);
-                       MSG_DEBUG("release thread view list [%d]", threadViewList.nCount);
-                       break;
-               }
-               else
-               {
-                       MSG_THREAD_ID_T threadId = atoi(menu);
-
-                       for (int i = 0; i < threadViewList.nCount; i++)
-                       {
-                               if ((MSG_THREAD_ID_T)msg_thread_view_get_thread_id(threadViewList.msgThreadInfo[i]) == threadId)
-                               {
-                                       MsgRunConversationView(hMsgHandle, threadId, msg_thread_view_get_address(threadViewList.msgThreadInfo[i]), msg_thread_view_get_name(threadViewList.msgThreadInfo[i]));
-
-                                       break;
-                               }
-                       }
-               }
-
-               msg_release_thread_view_list(&threadViewList);
-               MSG_DEBUG("release thread view list [%d]", threadViewList.nCount);
-       }
-       while (strcmp(menu, "B"));
-}
-
-
-void MsgSearchViewMain(MSG_HANDLE_T hMsgHandle)
-{
-       if (hMsgHandle == NULL)
-       {
-               MSG_DEBUG("Handle is NULL");
-               return;
-       }
-
-       char menu[5], displayTime[32], searchString[1024];
-
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       do
-       {
-               print("Search Mode 0:Message 1:Thread :");
-
-               memset(menu, 0x00, sizeof(menu));
-               cin.getline(menu, 4);
-
-               int searchType = atoi(menu);
-
-
-               print("Input String to Search :");
-
-               memset(searchString, 0x00, sizeof(searchString));
-
-               cin.getline(searchString, 1024);
-
-
-               if(searchType == 0)
-               {
-
-                       MSG_LIST_S msgList;
-
-                       print("Target folder (0:ALLBOX 1:INBOX 2:OUTBOX 3:SENTBOX) :");
-
-                       memset(menu, 0x00, sizeof(menu));
-                       cin.getline(menu, 4);
-
-                       int folderId = atoi(menu);
-
-
-                       print("Target message type (0:ALLTYPE 1:SMS 9:MMS) :");
-
-                       memset(menu, 0x00, sizeof(menu));
-                       cin.getline(menu, 4);
-
-                       int msgType = atoi(menu);
-
-
-                       print("Search Result offset (0~) :");
-
-                       memset(menu, 0x00, sizeof(menu));
-                       cin.getline(menu, 4);
-
-                       int offset = atoi(menu);
-
-
-                       print("Search Result limit (0~) :");
-
-                       memset(menu, 0x00, sizeof(menu));
-                       cin.getline(menu, 4);
-
-                       int limit = atoi(menu);
-
-                       MSG_SEARCH_CONDITION_S searchCon;
-                       memset(&searchCon, 0x00, sizeof(MSG_SEARCH_CONDITION_S));
-
-                       searchCon.msgType = msgType;
-                       searchCon.folderId = folderId;
-                       searchCon.pSearchVal = searchString;
-                       searchCon.pAddressVal = searchString;
-
-                       MSG_PROFILE_BEGIN(_msg_search_message_);
-                       err = msg_search_message(hMsgHandle, &searchCon, offset, limit, &msgList);
-                       MSG_PROFILE_END(_msg_search_message_);
-
-                       if (err != MSG_SUCCESS && err != MSG_ERR_DB_NORECORD)
-                       {
-                               print("Get Message List is failed!");
-                               return;
-                       }
-
-
-                       system ("clear" );
-
-                       print("======================================");
-                       print("============ Search View =============");
-                       print("======================================");
-
-                       if (msgList.nCount <= 0)
-                       {
-                               print("Empty...");
-                       }
-                       else
-                       {
-
-                               for (int i = 0; i < msgList.nCount; i++)
-                               {
-                                       memset(displayTime, 0x00, sizeof(displayTime));
-
-                                       MsgConvertTime(msg_get_time(msgList.msgInfo[i]), displayTime);
-
-                                       const char* msgText = NULL;
-
-                                       int msgType = msg_get_message_type(msgList.msgInfo[i]);
-
-                                       if(msgType==MSG_TYPE_MMS_NOTI || msgType==MSG_TYPE_MMS_JAVA || msgType==MSG_TYPE_MMS)
-                                               msgText = msg_mms_get_text_contents(msgList.msgInfo[i]);
-                                       else
-                                               msgText = msg_sms_get_message_body(msgList.msgInfo[i]);
-
-                                       printf("[%02d]\t[%s %s %s %s] [%s]\t[%s]\nDate [%s]\nMessage Text [%s] \tMessage data size [%d]\n",
-                                                       msg_get_message_id(msgList.msgInfo[i]),
-                                                       MsgConvertMsgType(msg_get_message_type(msgList.msgInfo[i])),
-                                                       MsgConvertStorageId(msg_get_storage_id(msgList.msgInfo[i])),
-                                                       MsgConvertReadStatus(msg_is_read(msgList.msgInfo[i])),
-                                                       MsgConvertProtectedStatus(msg_is_protected(msgList.msgInfo[i])),
-                                                       MsgConvertNetworkStatus(msg_get_network_status(msgList.msgInfo[i])),
-                                                       msg_get_ith_address(msgList.msgInfo[i], 0),
-                                                       displayTime,
-                                                       msgText,
-                                                       msg_get_message_body_size(msgList.msgInfo[i]));
-                                       printf("--------------------------------------------------------\n");
-                               }
-                       }
-
-                       print("======================================");
-                       print("================ Menu ================");
-                       print("======================================");
-                       print("[S] Search Again");
-                       print("[B] Back");
-                       print("======================================");
-
-                       print("Input : ");
-
-                       memset(menu, 0x00, sizeof(menu));
-                       cin.getline(menu, 5);
-
-                       if (!strcmp(menu, "S") || !strcmp(menu, "s"))
-                       {
-                               continue;
-                       }
-                       else if (!strcmp(menu, "B") || !strcmp(menu, "b"))
-                       {
-                               msg_release_message_list(&msgList);
-                               MSG_DEBUG("release msg list [%d]", msgList.nCount);
-                               break;
-                       }
-                       else
-                       {
-                               int msgId = atoi(menu);
-
-                               MsgTestGetMessage(hMsgHandle, msgId);
-                               break;
-                       }
-
-                       msg_release_message_list(&msgList);
-                       MSG_DEBUG("release msg list [%d]", msgList.nCount);
-               }
-               else if(searchType == 1)
-               {
-
-                       MSG_THREAD_VIEW_LIST_S threadViewList;
-
-               MSG_PROFILE_BEGIN(1);
-
-                       err = msg_search_message_for_thread_view(hMsgHandle, searchString, &threadViewList);
-
-               MSG_PROFILE_END(1);
-
-               if (err != MSG_SUCCESS && err != MSG_ERR_DB_NORECORD)
-               {
-                       print("Get Message List is failed!");
-                       return;
-               }
-
-               system ("clear" );
-
-               print("======================================");
-               print("============ Search View =============");
-               print("======================================");
-
-               if (threadViewList.nCount <= 0)
-               {
-                       print("Empty...");
-               }
-               else
-               {
-
-                       for (int i = 0; i < threadViewList.nCount; i++)
-                       {
-                               memset(displayTime, 0x00, sizeof(displayTime));
-
-                               MsgConvertTime(msg_thread_view_get_time(threadViewList.msgThreadInfo[i]), displayTime);
-
-                               printf("[%04d]\tUnread Msg [%d]\t[%s] [%s] [%s] [%s]\n[%s]\tMessage Text [%s]\n",
-                                               msg_thread_view_get_thread_id(threadViewList.msgThreadInfo[i]),
-                                               msg_thread_view_get_unread_cnt(threadViewList.msgThreadInfo[i]),
-                                               msg_thread_view_get_address(threadViewList.msgThreadInfo[i]),
-                                               msg_thread_view_get_name(threadViewList.msgThreadInfo[i]),
-                                               msg_thread_view_get_image_path(threadViewList.msgThreadInfo[i]),
-                                               displayTime,
-                                               MsgConvertDirection(msg_thread_view_get_direction(threadViewList.msgThreadInfo[i])),
-                                               msg_thread_view_get_data(threadViewList.msgThreadInfo[i]));
-
-                               printf("--------------------------------------------------------\n");
-                       }
-               }
-
-               print("======================================");
-               print("================ Menu ================");
-               print("======================================");
-               print("[C] Create Message");
-               print("[D] Delete Thread");
-               print("[S] Search Again");
-               print("[B] Back");
-               print("======================================");
-
-               print("Input : ");
-
-               memset(menu, 0x00, sizeof(menu));
-               cin.getline(menu, 5);
-
-               if (!strcmp(menu, "C") || !strcmp(menu, "c")) // Add Message
-               {
-                       MsgTestAddMessage(hMsgHandle);
-               }
-               else if (!strcmp(menu, "D") || !strcmp(menu, "d"))
-               {
-                       print("Choose Thread ID : ");
-
-                       char id[5];
-
-                       memset(id, 0x00, sizeof(id));
-                       cin.getline(id, 5);
-
-                       print("Do you really wanna delete messages in thread [Y or N] ?");
-
-                       char select[2];
-
-                       memset(select, 0x00, sizeof(select));
-                       cin.getline(select, 2);
-
-                       if (!strcmp(select, "Y") || !strcmp(select, "y"))
-                               msg_delete_thread_message_list(hMsgHandle, (MSG_THREAD_ID_T)atoi(id));
-               }
-               else if (!strcmp(menu, "S") || !strcmp(menu, "s"))
-               {
-                       continue;
-               }
-               else if (!strcmp(menu, "B") || !strcmp(menu, "b"))
-               {
-                       msg_release_thread_view_list(&threadViewList);
-                       MSG_DEBUG("release thread view list [%d]", threadViewList.nCount);
-                       break;
-               }
-               else
-               {
-                       MSG_THREAD_ID_T threadId = atoi(menu);
-
-                       for (int i = 0; i < threadViewList.nCount; i++)
-                       {
-                               if ((MSG_THREAD_ID_T)msg_thread_view_get_thread_id(threadViewList.msgThreadInfo[i]) == threadId)
-                               {
-                                       MsgRunConversationView(hMsgHandle, threadId, msg_thread_view_get_address(threadViewList.msgThreadInfo[i]), msg_thread_view_get_name(threadViewList.msgThreadInfo[i]));
-
-                                       break;
-                               }
-                       }
-               }
-
-               msg_release_thread_view_list(&threadViewList);
-               MSG_DEBUG("release thread view list [%d]", threadViewList.nCount);
-       }
-       }
-       while (strcmp(menu, "B"));
-}
-
-
-void MsgRunConversationView(MSG_HANDLE_T hMsgHandle, MSG_THREAD_ID_T ThreadId, const char *pAddress, const char *pName)
-{
-       char menu[5];
-
-       char displayTime[32];
-
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       MSG_LIST_S convViewList;
-
-       do
-       {
-               err = msg_get_conversation_view_list(hMsgHandle, ThreadId, &convViewList);
-
-               if (err != MSG_SUCCESS && err != MSG_ERR_DB_NORECORD)
-               {
-                       print("Get Message List is failed!");
-                       return;
-               }
-
-               system ("clear" );
-
-               printf("======================================\n");
-               printf("============ %s ============\n", pAddress);
-               printf("============ %s ============\n", pName);
-               printf("======================================\n");
-
-               if (convViewList.nCount <= 0)
-               {
-                       print("Empty...");
-               }
-               else
-               {
-                       for (int i = 0; i < convViewList.nCount; i++)
-                       {
-                               memset(displayTime, 0x00, sizeof(displayTime));
-
-                               MsgConvertTime(msg_get_time(convViewList.msgInfo[i]), displayTime);
-
-                               const char* msgText = NULL;
-
-                               int msgType = msg_get_message_type(convViewList.msgInfo[i]);
-
-                               if(msgType==MSG_TYPE_MMS_NOTI || msgType==MSG_TYPE_MMS_JAVA || msgType==MSG_TYPE_MMS)
-                                       msgText = msg_mms_get_text_contents(convViewList.msgInfo[i]);
-                               else
-                                       msgText = msg_sms_get_message_body(convViewList.msgInfo[i]);
-
-                               printf("[%04d]\t[%s] [%s]\tText [%s] Attachment count [%d] Date [%s]\n",
-                                               msg_get_message_id(convViewList.msgInfo[i]),
-                                               MsgConvertDirection(msg_get_direction_info(convViewList.msgInfo[i])),
-                                               MsgConvertMsgType(msg_get_message_type(convViewList.msgInfo[i])),
-                                               msgText,
-                                               msg_get_attachment_count(convViewList.msgInfo[i]),
-                                               displayTime);
-
-                               printf("--------------------------------------------------------\n");
-                       }
-               }
-
-               print("======================================");
-               print("================ Menu ================");
-               print("======================================");
-               print("[R] Reply");
-               print("[D] Delete Message");
-               print("[B] Back");
-               print("======================================");
-
-               print("Input : ");
-
-               memset(menu, 0x00, sizeof(menu));
-               cin.getline(menu, 5);
-
-               if (!strcmp(menu, "R") || !strcmp(menu, "r"))
-               {
-
-               }
-               else if (!strcmp(menu, "D") || !strcmp(menu, "d"))
-               {
-
-               }
-
-               msg_release_message_list(&convViewList);
-               MSG_DEBUG("release conversation view list [%d]", convViewList.nCount);
-       }
-       while (strcmp(menu, "B") && strcmp(menu, "b"));
-}
-
-
-const char* MsgConvertDirection(MSG_DIRECTION_TYPE_T Direction)
-{
-       if (Direction == MSG_DIRECTION_TYPE_MO)
-               return "SENT";
-       else if (Direction == MSG_DIRECTION_TYPE_MT)
-               return "RECEIVED";
-
-       return "RECEIVED";
-}
-
-
-const char* MsgConvertType(MSG_MESSAGE_TYPE_T MsgType)
-{
-       if (MsgType == MSG_TYPE_SMS)
-               return "SMS";
-       else if (MsgType == MSG_TYPE_SMS_CB ||MsgType == MSG_TYPE_SMS_JAVACB)
-               return "CB";
-       else if (MsgType == MSG_TYPE_SMS_WAPPUSH)
-               return "WAP Push";
-       else if (MsgType == MSG_TYPE_SMS_MWI)
-               return "MWI";
-       else if (MsgType == MSG_TYPE_SMS_SYNCML)
-               return "SyncML";
-       else if (MsgType == MSG_TYPE_SMS_REJECT)
-               return "Reject SMS";
-       else if (MsgType == MSG_TYPE_MMS)
-               return "MMS";
-       else if (MsgType == MSG_TYPE_MMS_NOTI)
-               return "MMS Noti";
-       else if (MsgType == MSG_TYPE_MMS_JAVA)
-               return "Java MMS";
-
-       return "SMS";
-}
-
diff --git a/test_app/MsgTestThreadView.h b/test_app/MsgTestThreadView.h
deleted file mode 100755 (executable)
index 5ddc417..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-
-/**
- *     @file           MsgTestStorage.h
- *     @brief          Defines storage test function of messaging framework
- *     @version                1.0
- */
-
-#ifndef MSG_TEST_THREAD_VIEW_H
-#define MSG_TEST_THREAD_VIEW_H
-
-/**
- *     @section                Introduction
- *     - Introduction : Overview on Messaging Storage Test Function
- *     @section                Program
- *     - Program : Messaging Storage Test Function Reference
- */
-
-/*==================================================================================================
-                                         INCLUDE FILES
-==================================================================================================*/
-
-#include "MsgTypes.h"
-
-/**
- *     @ingroup                MESSAGING_FRAMEWORK
- *     @defgroup       MESSAGING_STORAGE_TEST_FUNCTION Messaging Thread View Test Function
- *     @{
- */
-
-/*==================================================================================================
-                                     FUNCTION PROTOTYPES
-==================================================================================================*/
-void MsgThreadViewMain(MSG_HANDLE_T hMsgHandle);
-
-void MsgSearchViewMain(MSG_HANDLE_T hMsgHandle);
-
-void MsgRunThreadViewMenu(MSG_HANDLE_T  hMsgHandle, MSG_THREAD_LIST_INDEX_S *pAddrList);
-
-void MsgRunConversationView(MSG_HANDLE_T hMsgHandle, MSG_THREAD_ID_T ThreadId, const char *pAddress, const char *pName);
-
-const char* MsgConvertDirection(MSG_DIRECTION_TYPE_T Direction);
-
-const char* MsgConvertType(MSG_MESSAGE_TYPE_T MsgType);
-
-/**
- *     @}
- */
-
-
-#endif //MSG_TEST_THREAD_VIEW_H
-
diff --git a/test_app/MsgTestTransport.cpp b/test_app/MsgTestTransport.cpp
deleted file mode 100755 (executable)
index f43cafc..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-
-/*==================================================================================================
-                                         INCLUDE FILES
-==================================================================================================*/
-
-#include "MsgSettingTypes.h"
-#include "MapiTransport.h"
-#include "MapiSetting.h"
-#include "MsgTestTransport.h"
-#include "main.h"
-#include "MapiMessage.h"
-
-/*==================================================================================================
-                                     FUNCTION IMPLEMENTATION
-==================================================================================================*/
-
-MSG_ERROR_T MsgTestSubmitReq(MSG_HANDLE_T hMsgHandle, msg_message_t pMsg, MSG_SENDINGOPT_S* pSendOpt)
-{
-       if ( !hMsgHandle || !pMsg )
-       {
-               MSG_DEBUG("Handle or pMsg is NULL");
-               return MSG_ERR_NULL_MSGHANDLE;
-       }
-
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       MSG_REQUEST_S req = {0};
-
-       req.msg = pMsg;
-
-       if( pSendOpt )
-               memcpy(&req.sendOpt, pSendOpt, sizeof(req.sendOpt));
-
-       MSG_DEBUG("==== [MsgTestSubmitReq] MSG ID = [%d] ====", msg_get_message_id(req.msg));
-       MSG_DEBUG("==== [MsgTestSubmitReq] Folder ID = [%d] ====", msg_get_folder_id(req.msg));
-       MSG_DEBUG("==== [MsgTestSubmitReq] Message Type = [%d] ====", msg_get_message_type(req.msg));
-       MSG_DEBUG("==== [MsgTestSubmitReq] # number = [%d] ====", msg_get_address_count(req.msg));
-       MSG_DEBUG("==== [MsgTestSubmitReq] to = [%s] ====", msg_get_ith_address(req.msg, 0));
-//     MSG_DEBUG("==== [MsgTestSubmitReq] Message Data = [%s] ====", msg_sms_get_message_body(req.msg));
-       MSG_DEBUG("==== [MsgTestSubmitReq] Message Data size = [%d] ====", msg_get_message_body_size(req.msg));
-
-       MSG_DEBUG("==== [MsgTestSubmitReq] sendOpt : bSetting = [%d] ====", req.sendOpt.bSetting);
-       MSG_DEBUG("==== [MsgTestSubmitReq] sendOpt : bDelivery = [%d] ====", req.sendOpt.bDeliverReq);
-       MSG_DEBUG("==== [MsgTestSubmitReq] sendOpt : bKeepCopy = [%d] ====", req.sendOpt.bKeepCopy);
-
-       if(msg_is_sms(pMsg))
-               MSG_DEBUG("==== [MsgTestSubmitReq] sendOpt : bReplyPath = [%d] ====", req.sendOpt.option.smsSendOpt.bReplyPath);
-       else if(msg_is_mms(pMsg))
-       {
-               MSG_DEBUG("==== [MsgTestSubmitReq] sendOpt : bReadReq = [%d] ====", req.sendOpt.option.mmsSendOpt.bReadReq);
-               MSG_DEBUG("==== [MsgTestSubmitReq] sendOpt : priority = [%d] ====", req.sendOpt.option.mmsSendOpt.priority);
-               MSG_DEBUG("==== [MsgTestSubmitReq] sendOpt : expiryTime = [%lu] ====", req.sendOpt.option.mmsSendOpt.expiryTime);
-               MSG_DEBUG("==== [MsgTestSubmitReq] sendOpt : deliveryTime = [%lu] ====", req.sendOpt.option.mmsSendOpt.deliveryTime);
-       }
-
-       print("Start Sending Message...");
-
-       if (msg_is_mms(req.msg))
-       {
-               if (msg_get_message_type(req.msg) == MSG_TYPE_MMS)
-                       err = msg_mms_send_message(hMsgHandle, &req);
-               else
-                       err = msg_mms_retrieve_message(hMsgHandle, &req);
-       }
-       else
-               err = msg_sms_send_message(hMsgHandle, &req);
-
-       if (err == MSG_SUCCESS)
-               printf("Sending Message is successful!!!");
-       else
-               printf("Sending Message is failed!!! %d", err);
-
-       return err;
-}
-
-MSG_ERROR_T MsgTestScheduledSubmitReq(MSG_HANDLE_T hMsgHandle, msg_message_t pMsg, MSG_SENDINGOPT_S* pSendOpt)
-{
-       if ( !hMsgHandle || !pMsg )
-       {
-               MSG_DEBUG("Handle is NULL");
-               return MSG_ERR_NULL_MSGHANDLE;
-       }
-
-       MSG_REQUEST_S req = {0};
-
-       req.msg = pMsg;
-       if( pSendOpt )
-               req.sendOpt = *pSendOpt; //     memcpy(&req.sendOpt, pSendOpt, sizeof(req.sendOpt));
-
-               time_t scheduledTime;
-
-               time(&scheduledTime);
-               scheduledTime = scheduledTime + 180;
-       msg_set_scheduled_time(req.msg, scheduledTime);
-
-       MSG_DEBUG("==== [MsgTestSubmitReq] MSG ID = [%d] ====", msg_get_message_id(req.msg));
-       MSG_DEBUG("==== [MsgTestSubmitReq] Folder ID = [%d] ====", msg_get_folder_id(req.msg));
-       MSG_DEBUG("==== [MsgTestSubmitReq] Msg Type = [%d] ====", msg_get_message_type(req.msg));
-//     MSG_DEBUG("==== [MsgTestSubmitReq] Message Data = [%s] ====", msg_sms_get_message_body(req.msg));
-       MSG_DEBUG("==== [MsgTestSubmitReq] Message Data size = [%d] ====", msg_get_message_body_size(req.msg));
-
-       print("Start Sending Message...");
-
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       if (msg_is_mms(req.msg))
-               {
-               if (msg_get_message_type(req.msg) == MSG_TYPE_MMS)
-                       err = msg_mms_send_message(hMsgHandle, &req);
-               else
-                       err = msg_mms_retrieve_message(hMsgHandle, &req);
-       }
-       else
-               err = msg_sms_send_message(hMsgHandle, &req);
-
-       if (err == MSG_SUCCESS)
-               print("Sending Message is OK!");
-       else
-               print("Sending Message is failed!");
-
-       return err;
-}
-
diff --git a/test_app/MsgTestTransport.h b/test_app/MsgTestTransport.h
deleted file mode 100755 (executable)
index d2ce670..0000000
+++ /dev/null
@@ -1,199 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-
-/**
- *     @file           MsgTestTransport.h
- *     @brief          Defines transport test function of messaging framework
- *     @version                1.0
- */
-
-#ifndef MSG_TEST_TRANSPORT_H
-#define MSG_TEST_TRANSPORT_H
-
-/**
- *     @section                Introduction
- *     - Introduction : Overview on Messaging Transport Test Function
- *     @section                Program
- *     - Program : Messaging Transport Test Function Reference
- */
-
-/*==================================================================================================
-                                         INCLUDE FILES
-==================================================================================================*/
-
-#include "MsgTypes.h"
-
-/**
- *     @ingroup                MESSAGING_FRAMEWORK
- *     @defgroup       MESSAGING_TRANSPORT_TEST_FUNCTION       Messaging Transport Test Function
- *     @{
- */
-
-/*==================================================================================================
-                                     FUNCTION PROTOTYPES
-==================================================================================================*/
-
-/**    @fn             MSG_ERROR_T MsgTestSubmitReq(MSG_HANDLE_T hMsgHandle, msg_message_t *pMsg)
- *     @brief  Tests MsgSubmitReq.
- *     @remarks
-       This function requires two pieces of elements ready.
-       One is message structure which is composed on application, and the other is message handle.
-       An connected message handle is required for both sending a message, and receiving a message. \n
-       To send a SMS, precondition : there should be SMS plugin already plugged into framework.
-       The SMS plugin should provide SMS extension structure, subtypes, and classtypes. \n
-       To get the result, application MUST implement the callback function, MsgOnStatusChangedCallback(), and register it to message handle. \n
-       To receive messages, an application MUST also implement the callback function, MsgOnMessageIncomingCallback(), and register it to message handle.
-       In this example, only SMS is interested to receive and process, while other types of messages would be ignored by the application.
-       Besides that, an application MAY set a filter list, in this way, only incoming messages which satisfy the filter list will be passed to the registered callback function. \n
-       Supposing the subtype are defined as below, and the callback functions, MsgOnStatusChangedCallback() and MsgOnMessageIncomingCallback(), are defined too.
- *     @code
-       enum _MSG_SUB_TYPE_E
-       {
-               MSG_NORMAL_SMS = 0,     // Text SMS message
-               MSG_WAPPUSH_SMS,                // WAP Push message
-               MSG_CB_SMS,                     // Cell Broadcasting message
-       };
-
-       enum _MSG_CLASS_TYPE_E
-       {
-               MSG_CLASS_0 = 0,                // Immediately presented on the recipient device display
-               MSG_CLASS_1,                    // Stored in the mobile equipment or SIM (depending on memory availability)
-               MSG_CLASS_2,                    // Stored in SIM
-               MSG_CLASS_3,                    // Transferred to the terminal equipment (such as PDA or PC) which is connected to the mobile equipment
-               MSG_CLASS_NONE,
-       };
-
-       void sentStatusCB(MSG_HANDLE_T hMsgHandle, MSG_SENT_STATUS_S* pMsgStatus)
-       {
-               print("sentStatusCB() called");
-               printf("reqId : %d status : %d", pMsgStatus->reqId, pMsgStatus->status);
-       }
-
-       void incomingMessageCB (MSG_HANDLE_T hMsgHandle, msg_message_t* pNewMsg)
-       {
-               cout << "New Message Received" << endl;
-               MSG_DEBUG("msgId : %d", pNewMsg->msgId);
-               MSG_DEBUG("folderId : %d", pNewMsg->folderId);
-               MSG_DEBUG("msgType.mainType = %d", pNewMsg->msgType.mainType);
-               MSG_DEBUG("msgType.subType = %d", pNewMsg->msgType.subType);
-               MSG_DEBUG("nAddressCnt = %d", pNewMsg->nAddressCnt);
-               MSG_DEBUG("addressList[0].addressType = %d", pNewMsg->addressList[0].addressType);
-               MSG_DEBUG("addressList[0].addressVal = %s", pNewMsg->addressList[0].addressVal);
-               MSG_DEBUG("displayTime = %s", pNewMsg->displayTime);
-               MSG_DEBUG("networkStatus = %d", pNewMsg->networkStatus);
-               MSG_DEBUG("bRead = %d", pNewMsg->bRead);
-               MSG_DEBUG("bProtected = %d", pNewMsg->bProtected);
-               MSG_DEBUG("bHasAttach = %d", pNewMsg->bHasAttach);
-               MSG_DEBUG("bHasDrm = %d", pNewMsg->bHasDrm);
-               MSG_DEBUG("priority = %d", pNewMsg->priority);
-               MSG_DEBUG("dataSize = %d", pNewMsg->dataSize);
-               MSG_DEBUG("msgData = %s", (char*)pNewMsg->pData);
-       }
-
-       MSG_ERROR_T MsgTestSubmitReq(MSG_HANDLE_T hMsgHandle, msg_message_t *pMsg)
-       {
-               if (hMsgHandle == NULL)
-               {
-                       MSG_DEBUG("Handle is NULL");
-                       return MSG_ERR_NULL_MSGHANDLE;
-               }
-
-               MSG_ERROR_T err = MSG_SUCCESS;
-
-               MSG_REQUEST_S req;
-
-               // Make Request Message
-               if (pMsg == NULL)
-               {
-                       MSG_DEBUG("Message is NULL");
-                       return MSG_ERR_NULL_MESSAGE;
-               }
-               else
-               {
-                       req.reqId = 1; // arbitrary number
-                       req.msg.msgId = pMsg->msgId;
-                       req.msg.folderId = MSG_OUTBOX_ID; // outbox fixed
-                       req.msg.msgType = pMsg->msgType;
-                       req.msg.accountId = pMsg->accountId;
-                       req.msg.storageId = pMsg->storageId;
-
-                       req.msg.nAddressCnt = pMsg->nAddressCnt;
-
-                       for (int i = 0; i < pMsg->nAddressCnt; i++)
-                       {
-                               req.msg.addressList[i].addressType = pMsg->addressList[i].addressType;
-                               strncpy(req.msg.addressList[i].addressVal, pMsg->addressList[i].addressVal, MAX_ADDRESS_VAL_LEN);
-                       }
-
-                       strncpy(req.msg.displayTime, pMsg->displayTime, MAX_DISPLAY_TIME_LEN);
-
-                       req.msg.networkStatus = MSG_NETWORK_SENDING;
-                       req.msg.bRead = pMsg->bRead;
-                       req.msg.bProtected = pMsg->bProtected;
-                       req.msg.bHasAttach = pMsg->bHasAttach;
-                       req.msg.bHasDrm = pMsg->bHasDrm;
-                       req.msg.priority = pMsg->priority;
-                       req.msg.direction = pMsg->direction;
-                       req.msg.dataSize = pMsg->dataSize;
-
-                       req.msg.pData = (void*)new char[req.msg.dataSize];
-                       strncpy((char*)req.msg.pData, (char*)pMsg->pData, pMsg->dataSize);
-               }
-
-               MSG_DEBUG("==== [MsgTestSubmitReq] Message ID = [%d] ====", req.msg.msgId);
-               MSG_DEBUG("==== [MsgTestSubmitReq] Folder ID = [%d] ====", req.msg.folderId);
-               MSG_DEBUG("==== [MsgTestSubmitReq] Main Type = [%d] ====", req.msg.msgType.mainType);
-               MSG_DEBUG("==== [MsgTestSubmitReq] Sub Type = [%d] ====", req.msg.msgType.subType);
-               MSG_DEBUG("==== [MsgTestSubmitReq] Message Data = [%s] ====", (char*)req.msg.pData);
-
-               print("Start Sending Message...");
-
-               // Submit Request
-               err = MsgSubmitReq(hMsgHandle, &req);
-
-               if (err == MSG_SUCCESS)
-                       print("Sending Message is OK!");
-               else
-                       print("Sending Message is failed!");
-
-               return err;
-       }
- *     @endcode
- *     @param[in]      hMsgHandle is Message handle. \n
- *     @param[in]      pMsg is a pointer to an msg_message_t structure. \n
- *     @return MSG_ERROR_T
- *     @retval MSG_SUCCESS                             Success in operation. \n
- *     @retval MSG_ERR_NULL_MSGHANDLE          Message handle is NULL. \n
- *     @retval MSG_ERR_MEMORY_ERROR            Memory is error. \n
- *     @retval MSG_ERR_NULL_MESSAGE            Message is NULL. \n
- *     @retval MSG_ERR_INVALID_MSGHANDLE       Message handle is invalid. \n
- *     @retval MSG_ERR_NULL_POINTER            pMsg is NULL. \n
- *     @retval MSG_ERR_PLUGIN                          Generic error code for plugin. \n
- */
-MSG_ERROR_T MsgTestSubmitReq(MSG_HANDLE_T hMsgHandle, msg_message_t pMsg, MSG_SENDINGOPT_S* pSendOpt);
-
-MSG_ERROR_T MsgRetreiveMMSMessage(MSG_HANDLE_T hMsgHandle, msg_message_t pMsg);
-
-MSG_ERROR_T MsgTestScheduledSubmitReq(MSG_HANDLE_T hMsgHandle, msg_message_t pMsg, MSG_SENDINGOPT_S* pSendOpt);
-
-
-/**
- *     @}
- */
-
-#endif //MSG_TEST_TRANSPORT_H
-
diff --git a/test_app/main.cpp b/test_app/main.cpp
deleted file mode 100755 (executable)
index c40a007..0000000
+++ /dev/null
@@ -1,505 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-
-/*==================================================================================================
-                                         INCLUDE FILES
-==================================================================================================*/
-#include <iostream>
-#include <list>
-#include <vector>
-#include <string>
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <sys/syscall.h>
-#include <glib.h>
-
-using namespace std;
-
-#include "MapiControl.h"
-#include "MapiStorage.h"
-#include "MapiTransport.h"
-#include "MapiMessage.h"
-#include "MsgTestStorage.h"
-#include "MsgTestSetting.h"
-#include "MsgTestThreadView.h"
-#include "MsgTestConvert.h"
-#include "main.h"
-#include <stdio.h>
-
-/*==================================================================================================
-                                         VARIABLES
-==================================================================================================*/
-extern MSG_FOLDER_LIST_S g_folderList;
-
-static MSG_HANDLE_T msgHandle = NULL;
-
-GMainLoop *mainloop;
-
-/*==================================================================================================
-                                     FUNCTION IMPLEMENTATION
-==================================================================================================*/
-int main(void)
-{
-       print("======================================");
-       print("==== Start Messaging FW Test App. ====");
-       print("======================================");
-
-       if (init_app() != MSG_SUCCESS)
-               return -1;
-
-       return 0;
-}
-
-
-void print(const char* string)
-{
-       cout << string << endl;
-}
-
-
-void print(int i)
-{
-       cout << i << endl;
-}
-
-
-int get_tid()
-{
-    return syscall(__NR_gettid);
-}
-
-
-void printMessageS(msg_message_t pNewMsg)
-{
-       MSG_DEBUG("msgId = %d", msg_get_message_id(pNewMsg));
-       MSG_DEBUG("folderId = %d", msg_get_folder_id(pNewMsg));
-       MSG_DEBUG("msgType = %d", msg_get_message_type(pNewMsg));
-       MSG_DEBUG("nAddressCnt = %d", msg_get_address_count(pNewMsg));
-       MSG_DEBUG("addressList[0].threadId = %d", msg_get_ith_thread_id(pNewMsg, 0));
-       MSG_DEBUG("addressList[0].addressVal = %s", msg_get_ith_address(pNewMsg, 0));
-       MSG_DEBUG("addressList[0].displayname = %s", msg_get_ith_name(pNewMsg, 0));
-       MSG_DEBUG("displayTime = %s", ctime(msg_get_time(pNewMsg)));
-       MSG_DEBUG("networkStatus = %d", msg_get_network_status(pNewMsg));
-       MSG_DEBUG("bRead = %d", msg_is_read(pNewMsg));
-       MSG_DEBUG("bProtected = %d", msg_is_protected(pNewMsg));
-       MSG_DEBUG("priority = %d", msg_get_priority_info(pNewMsg));
-       MSG_DEBUG("dataSize = %d", msg_get_message_body_size(pNewMsg));
-
-       int msgType = msg_get_message_type(pNewMsg);
-
-       if(msgType==MSG_TYPE_MMS_NOTI || msgType==MSG_TYPE_MMS_JAVA || msgType==MSG_TYPE_MMS)
-               MSG_DEBUG("msgData = %s", msg_mms_get_text_contents(pNewMsg));
-       else
-               MSG_DEBUG("msgData = %s", msg_sms_get_message_body(pNewMsg));
-}
-
-
-void sentStatusCB(MSG_HANDLE_T Handle, MSG_SENT_STATUS_S *pStatus, void *pUserParam)
-{
-       MSG_DEBUG("Receive SentStatus !!!!!!!!!!!!!!!!!");
-
-       if (pStatus->status == MSG_NETWORK_SEND_SUCCESS)
-               MSG_DEBUG("reqId : %d  MSG SENT SUCCESS !!! ", pStatus->reqId);
-       else
-               MSG_DEBUG("reqId : %d  MSG SENT FAIL !!! [%d]", pStatus->reqId, pStatus->status);
-
-       MSG_DEBUG("User Param [%s]", (char*)pUserParam);
-}
-
-
-void incomingSmsCB(MSG_HANDLE_T Handle, msg_message_t msg, void *pUserParam)
-{
-       MSG_DEBUG("Receive New Message !!!!!!!!!!!!!!!!!");
-
-       printMessageS(msg);
-
-       MSG_DEBUG("User Param [%s]", (char*)pUserParam);
-}
-
-
-void incomingMmsConfCB(MSG_HANDLE_T Handle, msg_message_t msg, void *pUserParam)
-{
-       if ( msg_get_network_status(msg) == MSG_NETWORK_RETRIEVE_SUCCESS)
-       {
-               MSG_DEBUG("Receive New MMS Message !!!!!!!!!!!!!!!!!msg Id [%d]", msg_get_message_id(msg));
-       }
-       else
-               MSG_DEBUG("MMS RETRIEVE FAIL !!!!!!! [%d]", msg_get_network_status(msg));
-}
-
-
-void appPortCB (MSG_HANDLE_T Handle, msg_message_t msg, void *pUserParam)
-{
-       MSG_DEBUG("Receive App Port Message - Port Number [%d] !!!!!!!!!!!!!!!!!", msg_get_dest_port(msg));
-
-       printMessageS(msg);
-}
-
-
-void syncMLCB(MSG_HANDLE_T hMsgHandle, MSG_SYNCML_MESSAGE_TYPE_T msgType, const char* pPushBody, int PushBodyLen, const char* wspHeader, int wspHeaderLen, void *pUserParam)
-{
-       MSG_DEBUG("syncMLCB() called");
-
-       MSG_DEBUG("msgType [%d]", msgType);
-
-//     MSG_DEBUG("PushHeaderLen [%d]", PushHeaderLen);
-
-//     MSG_DEBUG("pPushHeader [%s]", pPushHeader);
-
-       MSG_DEBUG("PushBodyLen [%d]", PushBodyLen);
-
-       MSG_DEBUG("[pPushBody]");
-       for (int i = 0; i < PushBodyLen; i++)
-       {
-               printf("[%02x]", pPushBody[i]);
-       }
-       printf("\n\n");
-
-       MSG_SYNCML_MESSAGE_S syncMLMsg;
-
-       memset(&syncMLMsg, 0x00, sizeof(MSG_SYNCML_MESSAGE_S));
-
-       syncMLMsg.extId = 11;
-       syncMLMsg.pinCode = 1111;
-
-       syncMLMsg.msg = msg_new_message();
-
-       msg_set_folder_id(syncMLMsg.msg, MSG_INBOX_ID); //      syncMLMsg.msg.folderId = 1;
-       msg_set_message_type(syncMLMsg.msg, MSG_TYPE_SMS_SYNCML);
-       msg_set_network_status(syncMLMsg.msg, MSG_NETWORK_RECEIVED);    //syncMLMsg.msg.networkStatus = MSG_NETWORK_RECEIVED;
-       msg_set_direction_info(syncMLMsg.msg, MSG_DIRECTION_TYPE_MT);
-
-       msg_add_address(syncMLMsg.msg, "+1004", MSG_RECIPIENTS_TYPE_TO);
-
-       // setting received time
-       time_t t                =       time(NULL);
-       time_t utfTime  =       time(&t);
-       msg_set_time(syncMLMsg.msg, utfTime);
-
-       char msg_body[]="SyncML Message";
-       msg_sms_set_message_body(syncMLMsg.msg, msg_body, strlen(msg_body));
-
-       int err = msg_add_syncml_message(msgHandle, &syncMLMsg);
-
-       if (err != MSG_SUCCESS)
-       {
-               MSG_DEBUG("MsgAddSyncMLMessage() Fail [%d]", err);
-               return;
-       }
-}
-
-
-void syncMLOperationCB(MSG_HANDLE_T handle, int msgId, int extId, void *user_param)
-{
-       MSG_DEBUG("syncMLOperationCB() called");
-
-       MSG_DEBUG("msgId [%d]", msgId);
-
-       MSG_DEBUG("extId [%d]", extId);
-
-       //SyncML operation proccess hsa to be place here.
-}
-
-
-void lbsCB(MSG_HANDLE_T hMsgHandle, const char* pPushHeader, const char* pPushBody, int pushBodyLen, void *pUserParam)
-{
-       MSG_DEBUG("lbsCB() called");
-
-       MSG_DEBUG("pPushHeader : [%s]", pPushHeader);
-
-       MSG_DEBUG("pushBodyLen [%d]", pushBodyLen);
-
-       MSG_DEBUG("[pPushBody]");
-       for (int i = 0; i < pushBodyLen; i++)
-       {
-               printf("[%02x]", pPushBody[i]);
-       }
-       printf("\n\n");
-}
-
-
-void storageChangeCB(MSG_HANDLE_T hMsgHandle, MSG_STORAGE_CHANGE_TYPE_T storageChangeType, MSG_MSGID_LIST_S *pMsgIdList, void *pUserParam)
-{
-       MSG_DEBUG("storageChangeCB() called");
-
-       MSG_DEBUG("storageChangeType[%d]", storageChangeType);
-
-       MSG_DEBUG("pMsgIdList->nCount [%d]", pMsgIdList->nCount);
-
-       if (pMsgIdList->nCount > 0) {
-               for (int i = 0; i < pMsgIdList->nCount; i++)
-                       MSG_DEBUG("pMsgIdList->msgIdList[%d] [%d]", i, pMsgIdList->msgIdList[i]);
-       }
-}
-
-
-MSG_ERROR_T init_app()
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       char str[TEST_APP_PIRNT_STR_LEN+1] = {0,};
-
-       err = msg_open_msg_handle(&msgHandle);
-
-       if (err != MSG_SUCCESS)
-       {
-               snprintf(str, TEST_APP_PIRNT_STR_LEN+1, "msg_open_msg_handle() Fail [%d]", err);
-               print(str);
-
-               return err;
-       }
-
-       err = msg_reg_sent_status_callback(msgHandle, &sentStatusCB, (void*)"sent status callback");
-
-       if (err != MSG_SUCCESS)
-       {
-               snprintf(str, TEST_APP_PIRNT_STR_LEN+1, "msg_reg_sent_status_callback() Fail [%d]", err);
-               print(str);
-
-               return err;
-       }
-
-       err = msg_reg_sms_message_callback(msgHandle, &incomingSmsCB, 0, (void*)"sms message callback");
-
-       if (err != MSG_SUCCESS)
-       {
-               snprintf(str, TEST_APP_PIRNT_STR_LEN+1, "msg_reg_sms_message_callback() Fail [%d]", err);
-               print(str);
-
-               return err;
-       }
-
-       err = msg_reg_sms_message_callback(msgHandle, &appPortCB, 4010, (void*)"sms message callback with port");
-
-       if (err != MSG_SUCCESS)
-       {
-               snprintf(str, TEST_APP_PIRNT_STR_LEN+1, "msg_reg_sms_message_callback() Fail [%d]", err);
-               print(str);
-
-               return err;
-       }
-
-        err = msg_reg_syncml_message_callback(msgHandle, &syncMLCB, NULL);
-
-       if (err != MSG_SUCCESS)
-       {
-               snprintf(str, TEST_APP_PIRNT_STR_LEN+1, "msg_reg_syncml_message_callback() Fail [%d]", err);
-               print(str);
-
-               return err;
-       }
-
-       err = msg_reg_syncml_message_operation_callback(msgHandle, &syncMLOperationCB, NULL);
-
-       if (err != MSG_SUCCESS)
-       {
-               snprintf(str, TEST_APP_PIRNT_STR_LEN+1, "msg_reg_syncml_message_operation_callback() Fail [%d]", err);
-               print(str);
-
-               return err;
-       }
-
-       err = msg_reg_lbs_message_callback(msgHandle, &lbsCB, NULL);
-
-       if (err != MSG_SUCCESS)
-       {
-               snprintf(str, TEST_APP_PIRNT_STR_LEN+1, "msg_reg_lbs_message_callback() Fail [%d]", err);
-               print(str);
-
-               return err;
-       }
-
-       err = msg_reg_mms_conf_message_callback(msgHandle, &incomingMmsConfCB, NULL, NULL);
-
-       if (err != MSG_SUCCESS)
-       {
-               snprintf(str, TEST_APP_PIRNT_STR_LEN+1, "msg_reg_mms_conf_message_callback() Fail [%d]", err);
-               print(str);
-
-               return err;
-       }
-
-       err = msg_reg_storage_change_callback(msgHandle, &storageChangeCB, NULL);
-
-       if (err != MSG_SUCCESS)
-       {
-               snprintf(str, TEST_APP_PIRNT_STR_LEN+1, "msg_reg_storage_change_callback() Fail [%d]", err);
-               print(str);
-
-               return err;
-       }
-
-       pthread_t tid;
-
-       if (pthread_create(&tid, NULL, show_menu, NULL) != 0)
-       {
-               MSG_DEBUG("MsgInitThread not invoked: %s", strerror(errno));
-               return MSG_ERR_UNKNOWN;
-       }
-
-       mainloop = g_main_loop_new(NULL, FALSE);
-
-       MSG_DEBUG("Entering GMain Loop to Receive Notifications...");
-
-       g_main_loop_run(mainloop);
-
-       return err;
-}
-
-
-void* show_menu(void*)
-{
-       MSG_ERROR_T err = MSG_SUCCESS;
-
-       char menu[3];
-
-       char strPrint[TEST_APP_PIRNT_STR_LEN+1] = {0,};
-
-       // Get Message Count
-       MSG_COUNT_INFO_S countInfo;
-
-       do
-       {
-               msg_release_folder_list(&g_folderList);
-
-               // Get Folder List
-               err = msg_get_folder_list(msgHandle, &g_folderList);
-
-               if (err != MSG_SUCCESS)
-               {
-                       MSG_DEBUG("MsgGetFolderList() Fail [%d]", err);
-                       return (void*)1;
-               }
-
-               system ("clear");
-
-               print("======================================");
-               print("============== Box List ==============");
-               print("======================================");
-
-               for (int i = 0; i < g_folderList.nCount; i++)
-               {
-                       if (msg_count_message(msgHandle, g_folderList.folderInfo[i].folderId, &countInfo) != MSG_SUCCESS)
-                               return (void*)1;
-
-                       memset(strPrint, 0x00, sizeof(strPrint));
-                       snprintf(strPrint, TEST_APP_PIRNT_STR_LEN+1, "[%d] %s \t [%d/%d] [SMS %d/MMS %d]",
-                               g_folderList.folderInfo[i].folderId, g_folderList.folderInfo[i].folderName, countInfo.nUnreadCnt, countInfo.nUnreadCnt + countInfo.nReadCnt, countInfo.nSms, countInfo.nMms);
-                       print(strPrint);
-               }
-
-               print("======================================");
-               print("================ Menu ================");
-               print("======================================");
-               print("[C] Create Message");
-               print("[S] Setting");
-               print("[A] Add New Folder");
-               print("[D] Delete a Folder");
-               print("[U] Update Folder Name");
-               print("[V] Convert(Encode/Decode) Charset");
-               print("[M] Msg Generator");
-               print("[T] Thread View Test");
-               print("[G] Search Message");
-               print("[Q] Quit");
-               print("======================================");
-
-               print("Input : ");
-
-               memset(menu, 0x00, sizeof(menu));
-               cin.getline(menu, 3);
-
-               run_app(menu);
-       }
-       while (strcmp(menu, "Q"));
-
-       msg_release_folder_list(&g_folderList);
-
-       msg_close_msg_handle(&msgHandle);
-
-       if (msgHandle != NULL)
-       {
-               MSG_DEBUG("msgHandle is not NULL [%p]", msgHandle);
-       }
-
-       if (g_main_loop_is_running(mainloop))
-               g_main_loop_quit(mainloop);
-
-       print("======================================");
-       print("==== End Messaging FW Test App. Bye===");
-       print("======================================");
-
-       exit(0);
-}
-
-
-void run_app(char *pMenu)
-{
-       if (!strcmp(pMenu, "C") || !strcmp(pMenu, "c"))
-       {
-               MsgTestAddMessage(msgHandle);
-       }
-       else if (!strcmp(pMenu, "S") || !strcmp(pMenu, "s"))
-       {
-               MsgTestSettingMain(msgHandle);
-       }
-       else if (!strcmp(pMenu, "A") || !strcmp(pMenu, "a"))
-       {
-               MsgTestAddFolder(msgHandle);
-       }
-       else if (!strcmp(pMenu, "D") || !strcmp(pMenu, "d"))
-       {
-               MsgTestDeleteFolder(msgHandle);
-       }
-       else if (!strcmp(pMenu, "U") || !strcmp(pMenu, "u"))
-       {
-               MsgTestUpdateFolder(msgHandle);
-       }
-       else if (!strcmp(pMenu, "V") || !strcmp(pMenu, "v"))
-       {
-//             MsgTestConvertMain();
-       }
-       else if (!strcmp(pMenu, "M") || !strcmp(pMenu, "m"))
-       {
-               MsgTestMsgGen(msgHandle);
-       }
-       else if (!strcmp(pMenu, "T") || !strcmp(pMenu, "t"))
-       {
-               MsgThreadViewMain(msgHandle);
-       }
-       else if (!strcmp(pMenu, "G") || !strcmp(pMenu, "g"))
-       {
-               MsgSearchViewMain(msgHandle);
-       }
-       else if (!strcmp(pMenu, "Q") || !strcmp(pMenu, "q"))
-       {
-               return;
-       }
-       else
-       {
-               int folderId = atoi(pMenu);
-
-               if (folderId > 0 && folderId < 100)
-               {
-                       // Query Msg List in Msg Box
-                       MsgTestGetMessageList(msgHandle, folderId);
-               }
-               else
-                       print("Not Supported");
-       }
-}
-
diff --git a/test_app/main.h b/test_app/main.h
deleted file mode 100755 (executable)
index 49158e2..0000000
+++ /dev/null
@@ -1,203 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-
-/**
- *     @file           Main.h
- *     @brief          Defines function for test application of messaging framework
- *     @version                1.0
- */
-
-#ifndef MSG_TEST_MAIN_H
-#define MSG_TEST_MAIN_H
-
-/**
- *     @mainpage
- *     @section                Introduction
- *     - This document includes as follows : \n
- *     What is Messaging API \n
- *     What are included in Messaging API, such as data types, functions, and so on \n
- *     @section                Contents
- *     - Modules
- *     - Structure
- *     - MessageHandle
- *     - Request
- *     - Callback
- *     - Filter
- *     - Storage
- *     - Extendability
- *     @section                Modules
- *     MAPI provides a service to send, receive, parse and assemble messages over arbitrary message delivery mechanisms such as SMS, MMS, and E-mail.
- *     Messaging Service consists of a collection of common functionality and sets of service specific functionality.
- *     Use of particular messaging service specific functionality shall be possible.
- *     MAPI provides a collection of data structures as well as functions to implement the functionality. \n\n
- *     The data structures and functions are grouped into modules, as listed below:
- *     - Message sending and reception
- *     - Storage management
- *     - Message storage
- *     - Folder storage
- *     @section                Structure
- *     Message \n\n
- *     A message represents a generic data collection of SMS, MMS, and E-mail.
- *     This is not specific to any service, but supports the extension of this structure.
- *     For service specific message, please refer to extendability of common structure.
- *     Each message has a unique message ID in the entire messaging framework.
- *     The message information can be retrieved from the storage by its message ID. \n\n
- *     This concept is defined in MsgTypes.h. \n\n
- *     Folder \n
- *     A folder represents a container of messages.
- *     Each folder has a unique folder ID in the entire messaging framework.
- *     The folder information can be retrieved from the storage by its folder ID.
- *     A folder can specify where it is stored.
- *     The storage where a folder is stored can be different from the storage where its containing messages are stored. \n\n
- *     This concept is defined in MsgStorageTypes.h. \n\n
- *     @section                MessageHandle
- *     MessageHandle is the connection between application and MAPI.
- *     When an application wants to send, receive, add, or get a message, it must open a MessageHandle first.
- *     To know how to use asynchronous callback for communication between application and framework, please refer to Callback. \n\n
- *     A MessageHandle can be assigned with following information: \n
- *     - Register MsgOnMessageIncomingCallback function.
- *     - Register MsgOnStatusChangedCallback function.
- *     - Set filter rule.
- *     @section                Request
- *     A request contains the information that is used to command framework for services, such as sending a message.
- *     A request is sent to Messaging Framework via a MessageHandle, and Messaging Framework chooses proper plugin to handle the request.
- *     A common usage for the request is to send a message. \n\n
- *     This concept is defined in MsgTypes.h. \n\n
- *     @section                Callback
- *     Callback is used by application to detect incoming message and underlayer status change.
- *     Two callback functions are implemented by applications and should be bound to a MessageHandle.
- *     Both prototypes are provided: \n
- *     - One is MsgOnMessageIncomingCallback, which is to listen incoming message.
- *     - The other is MsgOnStatusChangedCallback, which is to listen underlayer status change.
- *     @section                Filter
- *     When an application is only interested in some kinds of messages, filter list is used to filter these specific messages and return them to the application.
- *     Noted that filter is for filtering incoming messages, not a storage concept.
- *     Filter is the basic unit to set the rules, it tells the filter service how to filter the message.
- *     Filter list is composed of various filters. \n\n
- *     They are defined in MsgFilterTypes.h. \n\n
- *     Application can set a filter list for a MessageHandle to get the interesting message.
- *     Please refer to MSG_FILTER_S and MSG_FILTER_LIST_S for details.
- *     MAPI does NOT define any filters.
- *     Application developers should refer to the specific implementation of filter service to get the supported filters.
- *     @section                Storage
- *     Storage is a collection of messages and related information that are stored on one storage media.
- *     Storage media is the physical data storage device, such as SD card and Flash.
- *     One storage media can have more than one storages.
- *     Since storage media can be removable, the storages on the media can be detached and attached dynamically.
- *     For instance, user plugs out SD card from UE 1 and plugs in this card into UE 2, all the messages stored in this card will be hidden from UE 1 and be visible to UE 2.
- *     For details information, please refer to MSG_STORAGE_LIST_S.
- *     Application can query supported storages by MAPI method MsgGetStorageList.
- *     @section                Extendability
- *     There are several structures in LiMo Messageing designed to be extended. They are: \n
- *     - MSG_FOLDER_INFO_S
- *     - msg_message_t
- *     - MSG_REQUEST_S
- */
-
-/*==================================================================================================
-                                         INCLUDE FILES
-==================================================================================================*/
-
-#include <sys/types.h>
-#include <unistd.h>
-#include <string.h>
-#include <sys/time.h>
-#include <time.h>
-
-#include "MsgTypes.h"
-
-#define TEST_APP_PIRNT_STR_LEN                 128
-
-/**
- *     @ingroup                MESSAGING_FRAMEWORK
- *     @defgroup       MESSAGING_TEST_APPLICATION_BASIC_FUNCTION       Messaging Test Application Basic Function
- *     @{
- */
-
-
-/*==================================================================================================
-                                         DEFINES
-==================================================================================================*/
-#define MSG_FATAL(fmt, ...) \
-       do \
-       {\
-               printf("\n[%d] [MSGFW: %s: %s(): %d] *FAILED* << " fmt" >>\n", get_tid(), rindex(__FILE__, '/')+1,  __FUNCTION__, __LINE__,  ##__VA_ARGS__);\
-       } while (0)
-
-#define MSG_DEBUG(fmt, ...) \
-       do\
-       {\
-               printf("\n[%d] [MSGFW: %s: %s(): %d] " fmt"\n", get_tid(), rindex(__FILE__, '/')+1, __FUNCTION__, __LINE__, ##__VA_ARGS__);\
-       } while (0)
-
-#define MSG_BEGIN() \
-       do\
-    {\
-        printf("\n[%d] BEGIN >>>> %s() at [MSGFW: %s: %d]\n", get_tid(),__FUNCTION__, rindex(__FILE__, '/')+1,  __LINE__ );\
-    } while( 0 )
-
-#define MSG_END() \
-       do\
-    {\
-        printf("\n[%d] END   <<<< %s() at [MSGFW: %s: %d]\n", get_tid(), __FUNCTION__, rindex(__FILE__, '/')+1,  __LINE__); \
-    } \
-    while( 0 )
-
-
-/*==================================================================================================
-                                     FUNCTION PROTOTYPES
-==================================================================================================*/
-
-void print(const char* string);
-
-
-void print(int i);
-
-
-int get_tid();
-
-
-/**    @fn             MSG_ERROR_T init_app()
- *     @brief  Initializes a test application.
- *     @return MSG_ERROR_T
- *     @retval MSG_SUCCESS                             Success in operation. \n
- *     @retval MSG_ERR_NULL_POINTER            pMsg is NULL. \n
- *     @retval MSG_ERR_MEMORY_ERROR            Memory is error. \n
- *     @retval MSG_ERR_INVALID_MSGHANDLE       Message handle is invalid. \n
- *     @retval MSG_ERR_INVALID_PARAMETER       Parameter is invalid. \n
- */
-MSG_ERROR_T init_app();
-
-
-/**    @fn             void show_menu()
- *     @brief  Shows folder information and the test menu list.
- */
-void* show_menu(void*);
-
-
-/**    @fn             void run_app(char menu)
- *     @brief  Runs a selected menu in the test menu list.
- *     @param[in]      Menu indicates which menu is selected.
- */
-void run_app(char *pMenu);
-
-/**
- *     @}
- */
-
-#endif //MSG_TEST_MAIN_H
-
diff --git a/test_app/mms_files/A.smi b/test_app/mms_files/A.smi
deleted file mode 100755 (executable)
index 9714462..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-<smil>\r
-<head>\r
-<layout>\r
-<root-layout backgroundColor="#ffffff"/>\r
-<region id="Image" top="50%" left="0%" width="100%" height="50%" fit="meet" backgroundColor="#ffffff"/>\r
-<region id="Text" top="0%" left="0%" width="100%" height="50%" backgroundColor="#ffffff"/>\r
-</layout>\r
-</head>\r
-<body>\r
-<par dur="5440ms">\r
-<text src="Temp0_2.txt" color="#000000" size="20" region="Text">\r
-<param name="foreground-color" value="#000000"/>\r
-<param name="textsize" value="20"/>\r
-</text>\r
-<img src="P091120_104633.jpg" region="Image"/>\r
-<audio src="audio.amr"/>\r
-</par>\r
-<par dur="4544ms">\r
-<text src="Temp1_0.txt" color="#000000" size="20" region="Text">\r
-<param name="foreground-color" value="#000000"/>\r
-<param name="textsize" value="20"/>\r
-</text>\r
-<video src="V091120_104905.3gp" region="Text" alt="Video Load Fail"/>\r
-</par>\r
-</body>\r
-</smil>\r
diff --git a/test_app/mms_files/P091120_104633.jpg b/test_app/mms_files/P091120_104633.jpg
deleted file mode 100755 (executable)
index c241c2a..0000000
Binary files a/test_app/mms_files/P091120_104633.jpg and /dev/null differ
diff --git a/test_app/mms_files/Temp0_2.txt b/test_app/mms_files/Temp0_2.txt
deleted file mode 100755 (executable)
index 74c7dd8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Test MMS Message
\ No newline at end of file
diff --git a/test_app/mms_files/Temp1_0.txt b/test_app/mms_files/Temp1_0.txt
deleted file mode 100755 (executable)
index f6d6f92..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Second Slide
\ No newline at end of file
diff --git a/test_app/mms_files/V091120_104905.3gp b/test_app/mms_files/V091120_104905.3gp
deleted file mode 100755 (executable)
index 7cdcb31..0000000
Binary files a/test_app/mms_files/V091120_104905.3gp and /dev/null differ
diff --git a/test_app/mms_files/audio.amr b/test_app/mms_files/audio.amr
deleted file mode 100755 (executable)
index 645ec5d..0000000
Binary files a/test_app/mms_files/audio.amr and /dev/null differ
index 2c6df8e..8cf91be 100755 (executable)
@@ -14,7 +14,7 @@ SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -O0 -g -Wall")
 # Define Framework Utils
 ##########################################################
 
-SET(UTILS-SRCS 
+SET(UTILS-SRCS
        ${CMAKE_SOURCE_DIR}/utils/MsgDebug.cpp
        ${CMAKE_SOURCE_DIR}/utils/MsgException.cpp
        ${CMAKE_SOURCE_DIR}/utils/MsgUtilFunction.cpp
@@ -23,15 +23,17 @@ SET(UTILS-SRCS
        ${CMAKE_SOURCE_DIR}/utils/MsgSqliteWrapper.cpp
        ${CMAKE_SOURCE_DIR}/utils/MsgSoundPlayer.cpp
        ${CMAKE_SOURCE_DIR}/utils/MsgUtilStorage.cpp
-       ${CMAKE_SOURCE_DIR}/utils/MsgContact.cpp
        ${CMAKE_SOURCE_DIR}/utils/MsgGconfWrapper.cpp
+       ${CMAKE_SOURCE_DIR}/utils/MsgContact.cpp
        ${CMAKE_SOURCE_DIR}/utils/MsgNotificationWrapper.cpp
        ${CMAKE_SOURCE_DIR}/utils/MsgMemory.cpp
        ${CMAKE_SOURCE_DIR}/utils/MsgMmsMessage.cpp
+       ${CMAKE_SOURCE_DIR}/utils/MsgSpamFilter.cpp
        ${CMAKE_SOURCE_DIR}/utils/MsgDrmWrapper.cpp
 )
 
 INCLUDE_DIRECTORIES(
+    ${CMAKE_SOURCE_DIR}/include/mapi
        ${CMAKE_SOURCE_DIR}/include/common
        ${CMAKE_SOURCE_DIR}/include/framework
        ${CMAKE_SOURCE_DIR}/include/msg_helper
@@ -39,7 +41,7 @@ INCLUDE_DIRECTORIES(
 )
 
 INCLUDE(FindPkgConfig)
-pkg_check_modules(utils_pkgs REQUIRED glib-2.0 vconf db-util contacts-service dlog pmapi mm-session alarm-service notification drm-client drm-trusted)
+pkg_check_modules(utils_pkgs REQUIRED glib-2.0 vconf db-util contacts-service dlog pmapi mm-session alarm-service notification phone-misc drm-client drm-trusted)
 
 FOREACH(flag ${utils_pkgs_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
@@ -52,7 +54,7 @@ SET(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
 
 ADD_LIBRARY(${UTILS-LIB} SHARED ${UTILS-SRCS})
-TARGET_LINK_LIBRARIES(${UTILS-LIB} ${utils_pkgs_LDFLAGS} rt)
+TARGET_LINK_LIBRARIES(${UTILS-LIB} ${utils_pkgs_LDFLAGS} rt ${VOBJECT-LIB})
 
 INSTALL(TARGETS ${UTILS-LIB} DESTINATION lib COMPONENT RuntimeLibraries)
 
index 519139f..6aecb5e 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 extern "C"
 {
@@ -43,34 +43,26 @@ static void MsgContactSvcCallback(void *pData)
        MsgSyncContact();
 
        if (ContactDbHandle.disconnect() != MSG_SUCCESS)
-       {
                MSG_DEBUG("DB Disconnect Fail");
-       }
 }
 
 
-MSG_ERROR_T MsgOpenContactSvc()
+msg_error_t MsgOpenContactSvc()
 {
        int errCode = CTS_SUCCESS;
 
-       if(!isContactSvcOpened)
-       {
+       if (!isContactSvcOpened) {
                errCode = contacts_svc_connect();
 
-               if (errCode == CTS_SUCCESS)
-               {
+               if (errCode == CTS_SUCCESS) {
                        MSG_DEBUG("Connect to Contact Service Success");
                        isContactSvcOpened = true;
-               }
-               else
-               {
+               } else {
                        MSG_DEBUG("Connect to Contact Service Fail [%d]", errCode);
                        isContactSvcOpened = false;
                        return MSG_ERR_DB_CONNECT;
                }
-       }
-       else
-       {
+       } else {
                MSG_DEBUG("Already connected to Contact Service.");
        }
 
@@ -78,20 +70,16 @@ MSG_ERROR_T MsgOpenContactSvc()
 }
 
 
-MSG_ERROR_T MsgCloseContactSvc()
+msg_error_t MsgCloseContactSvc()
 {
        int errCode = CTS_SUCCESS;
 
-       if(isContactSvcOpened)
-       {
+       if (isContactSvcOpened) {
                errCode = contacts_svc_disconnect();
 
-               if (errCode == CTS_SUCCESS)
-               {
+               if (errCode == CTS_SUCCESS) {
                        MSG_DEBUG("Disconnect to Contact Service Success");
-               }
-               else
-               {
+               } else {
                        MSG_DEBUG("Disconnect to Contact Service Fail [%d]", errCode);
                        return MSG_ERR_DB_DISCONNECT;
                }
@@ -101,7 +89,7 @@ MSG_ERROR_T MsgCloseContactSvc()
 }
 
 
-MSG_ERROR_T MsgInitContactSvc(MsgContactChangeCB cb)
+msg_error_t MsgInitContactSvc(MsgContactChangeCB cb)
 {
        int errCode = CTS_SUCCESS;
 
@@ -112,19 +100,15 @@ MSG_ERROR_T MsgInitContactSvc(MsgContactChangeCB cb)
        errCode = contacts_svc_subscribe_change(CTS_SUBSCRIBE_CONTACT_CHANGE, MsgContactSvcCallback, NULL);
 
        if (errCode == CTS_SUCCESS)
-       {
                MSG_DEBUG("Register Contact Service Callback");
-       }
        else
-       {
                MSG_DEBUG("Fail to Register Contact Service Callback [%d]", errCode);
-       }
 
        return MSG_SUCCESS;
 }
 
 
-MSG_ERROR_T MsgGetContactInfo(const MSG_ADDRESS_INFO_S *pAddrInfo, MSG_CONTACT_INFO_S *pContactInfo)
+msg_error_t MsgGetContactInfo(const MSG_ADDRESS_INFO_S *pAddrInfo, MSG_CONTACT_INFO_S *pContactInfo)
 {
        MSG_BEGIN();
 
@@ -132,8 +116,7 @@ MSG_ERROR_T MsgGetContactInfo(const MSG_ADDRESS_INFO_S *pAddrInfo, MSG_CONTACT_I
 
        memset(pContactInfo, 0x00, sizeof(MSG_CONTACT_INFO_S));
 
-       if (pAddrInfo->addressType == MSG_ADDRESS_TYPE_PLMN && strlen(pAddrInfo->addressVal) > (MAX_PHONE_NUMBER_LEN+1))
-       {
+       if (pAddrInfo->addressType == MSG_ADDRESS_TYPE_PLMN && strlen(pAddrInfo->addressVal) > (MAX_PHONE_NUMBER_LEN+1)) {
                MSG_DEBUG("Phone Number is too long [%s]", pAddrInfo->addressVal);
                return MSG_ERR_INVALID_PARAMETER;
        }
@@ -151,14 +134,12 @@ MSG_ERROR_T MsgGetContactInfo(const MSG_ADDRESS_INFO_S *pAddrInfo, MSG_CONTACT_I
 
        index = contacts_svc_find_contact_by(recordType, (char*)pAddrInfo->addressVal);
 
-       if (index > CTS_SUCCESS)
-       {
+       if (index > CTS_SUCCESS) {
                MSG_DEBUG("Index : [%d]", index);
                ret = contacts_svc_get_contact(index, &contact);
        }
 
-       if (ret < 0)
-       {
+       if (ret < 0) {
                MSG_DEBUG("No Contact Info");
                return MSG_SUCCESS;
        }
@@ -167,8 +148,7 @@ MSG_ERROR_T MsgGetContactInfo(const MSG_ADDRESS_INFO_S *pAddrInfo, MSG_CONTACT_I
 
        ret = contacts_svc_struct_get_value(contact, CTS_CF_NAME_VALUE, &name);
 
-       if (ret != CTS_SUCCESS)
-       {
+       if (ret != CTS_SUCCESS) {
                MSG_DEBUG("contacts_svc_struct_get_value() Error [%d]", ret);
                return MSG_SUCCESS;
        }
@@ -180,26 +160,19 @@ MSG_ERROR_T MsgGetContactInfo(const MSG_ADDRESS_INFO_S *pAddrInfo, MSG_CONTACT_I
        MSG_DEBUG("Display Name : [%s], First Name : [%s], Last Name : [%s]", strDisplayName, strFirstName, strLastName);
 
        if (strDisplayName != NULL)
-       {
                strncpy(pContactInfo->displayName, strDisplayName, MAX_DISPLAY_NAME_LEN);
-       }
 
        if (strFirstName != NULL)
-       {
                strncpy(pContactInfo->firstName, strFirstName, MAX_DISPLAY_NAME_LEN);
-       }
 
        if (strLastName != NULL)
-       {
                strncpy(pContactInfo->lastName, strLastName, MAX_DISPLAY_NAME_LEN);
-       }
 
        CTSvalue* base = NULL;
 
        ret = contacts_svc_struct_get_value(contact, CTS_CF_BASE_INFO_VALUE, &base);
 
-       if (ret != CTS_SUCCESS)
-       {
+       if (ret != CTS_SUCCESS) {
                MSG_DEBUG("contacts_svc_struct_get_value() Error [%d]", ret);
                return MSG_SUCCESS;
        }
@@ -211,9 +184,7 @@ MSG_ERROR_T MsgGetContactInfo(const MSG_ADDRESS_INFO_S *pAddrInfo, MSG_CONTACT_I
        const char* strImagePath = contacts_svc_value_get_str(base, CTS_BASE_VAL_IMG_PATH_STR);
 
        if (strImagePath != NULL)
-       {
                strncpy(pContactInfo->imagePath , strImagePath, MAX_IMAGE_PATH_LEN);
-       }
 
        MSG_DEBUG("Image Path [%s]", pContactInfo->imagePath);
 
@@ -245,10 +216,9 @@ void MsgSyncContact()
 
        CTSiter* pIter;
 
-       ret = contacts_svc_get_updated_contacts(0, lastSyncTime, &pIter);
+       ret = contacts_svc_get_updated_contacts(-1, lastSyncTime, &pIter);
 
-       if (ret != CTS_SUCCESS)
-       {
+       if (ret != CTS_SUCCESS) {
                MSG_DEBUG("contacts_svc_get_updated_contacts() Error [%d]", ret);
                return;
        }
@@ -265,14 +235,10 @@ void MsgSyncContact()
 
                int type = contacts_svc_value_get_int(row_info, CTS_LIST_CHANGE_TYPE_INT);
 
-               if (type == CTS_OPERATION_UPDATED || type == CTS_OPERATION_INSERTED)
-               {
+               if (type == CTS_OPERATION_UPDATED || type == CTS_OPERATION_INSERTED) {
                        MsgUpdateContact(index_num, type);
-               }
-               else // Delete
-               {
+               } else {// Delete
                        MSG_DEBUG("Delete Contact");
-
                        MsgDeleteContact(index_num);
                }
 
@@ -282,7 +248,6 @@ void MsgSyncContact()
                contacts_svc_value_free(row_info);
 
                changed_count++;
-
        }
 
        MsgSettingSetInt(CONTACT_SYNC_TIME, lastSyncTime);
@@ -300,8 +265,7 @@ bool MsgInsertContact(MSG_CONTACT_INFO_S *pContactInfo, const char *pNumber)
        if (!pNumber || strlen(pNumber) <= 0)
                return false;
 
-       if (MsgStoAddContactInfo(&ContactDbHandle, pContactInfo, pNumber) != MSG_SUCCESS)
-       {
+       if (MsgStoAddContactInfo(&ContactDbHandle, pContactInfo, pNumber) != MSG_SUCCESS) {
                MSG_DEBUG("Fail to add contact info.");
                return false;
        }
@@ -318,8 +282,7 @@ bool MsgUpdateContact(int index, int type)
 
        ret = contacts_svc_get_contact(index, &contact);
 
-       if (ret != CTS_SUCCESS)
-       {
+       if (ret != CTS_SUCCESS) {
                MSG_DEBUG("contacts_svc_get_contact() Error [%d]", ret);
                return false;
        }
@@ -329,8 +292,7 @@ bool MsgUpdateContact(int index, int type)
 
        ret = contacts_svc_struct_get_value(contact, CTS_CF_BASE_INFO_VALUE, &base);
 
-       if (ret != CTS_SUCCESS)
-       {
+       if (ret != CTS_SUCCESS) {
                MSG_DEBUG("contacts_svc_struct_get_value() Error [%d]", ret);
                return false;
        }
@@ -344,9 +306,7 @@ bool MsgUpdateContact(int index, int type)
        const char* strImagePath = contacts_svc_value_get_str(base, CTS_BASE_VAL_IMG_PATH_STR);
 
        if (strImagePath != NULL)
-       {
                strncpy(contactInfo.imagePath , strImagePath, MAX_IMAGE_PATH_LEN);
-       }
 
        MSG_DEBUG("Image Path [%s]", contactInfo.imagePath);
 
@@ -355,8 +315,7 @@ bool MsgUpdateContact(int index, int type)
 
        ret = contacts_svc_struct_get_value(contact, CTS_CF_NAME_VALUE, &name);
 
-       if (ret != CTS_SUCCESS)
-       {
+       if (ret != CTS_SUCCESS) {
                MSG_DEBUG("contacts_svc_struct_get_value() Error [%d]", ret);
                return MSG_SUCCESS;
        }
@@ -368,19 +327,13 @@ bool MsgUpdateContact(int index, int type)
        MSG_DEBUG("Display Name : [%s], First Name : [%s], Last Name : [%s]", strDisplayName, strFirstName, strLastName);
 
        if (strDisplayName != NULL)
-       {
                strncpy(contactInfo.displayName, strDisplayName, MAX_DISPLAY_NAME_LEN);
-       }
 
        if (strFirstName != NULL)
-       {
                strncpy(contactInfo.firstName, strFirstName, MAX_DISPLAY_NAME_LEN);
-       }
 
        if (strLastName != NULL)
-       {
                strncpy(contactInfo.lastName, strLastName, MAX_DISPLAY_NAME_LEN);
-       }
 
        MsgStoClearContactInfo(&ContactDbHandle, index);
 
@@ -393,10 +346,8 @@ bool MsgUpdateContact(int index, int type)
        cursor = get_list;
 
        // No phone number in contact
-       if (cursor == NULL)
-       {
+       if (cursor == NULL) {
                 contacts_svc_struct_free(contact);
-
                return true;
        }
 
@@ -409,11 +360,11 @@ bool MsgUpdateContact(int index, int type)
                MSG_DEBUG("Number = %s", strNumber);
 
                if (MsgInsertContact(&contactInfo, strNumber) == false)
-               {
                        continue;
-               }
        }
 
+       MsgStoSetConversationDisplayName(&ContactDbHandle, index);
+
        contacts_svc_struct_free(contact);
 
        return true;
@@ -423,9 +374,7 @@ bool MsgUpdateContact(int index, int type)
 bool MsgDeleteContact(int index)
 {
        if (MsgStoClearContactInfo(&ContactDbHandle, index) != MSG_SUCCESS)
-       {
                return false;
-       }
 
        return true;
 }
@@ -448,6 +397,81 @@ int MsgGetContactNameOrder()
 }
 
 
+msg_error_t MsgAddPhoneLog(const MSG_MESSAGE_INFO_S *pMsgInfo)
+{
+       msg_error_t err = MSG_SUCCESS;
+
+       MSG_DEBUG("folderId [%d], number [%s]", pMsgInfo->folderId, pMsgInfo->addressList[0].addressVal);
+
+       CTSvalue* plog;
+
+       plog = contacts_svc_value_new(CTS_VALUE_PHONELOG);
+
+       contacts_svc_value_set_str(plog, CTS_PLOG_VAL_NUMBER_STR, (char*)pMsgInfo->addressList[0].addressVal);
+       contacts_svc_value_set_int(plog, CTS_PLOG_VAL_LOG_TIME_INT, (int)time(NULL));
+
+       char strText[101];
+       memset(strText, 0x00, sizeof(strText));
+
+       if (pMsgInfo->msgType.mainType == MSG_SMS_TYPE) {
+               strncpy(strText, pMsgInfo->msgText, 100);
+               MSG_DEBUG("msgText : %s", strText);
+       } else if (pMsgInfo->msgType.mainType == MSG_MMS_TYPE) {
+               if (strlen(pMsgInfo->subject) > 0 || pMsgInfo->msgType.subType == MSG_NOTIFICATIONIND_MMS) {
+                       strncpy(strText, pMsgInfo->subject, 100);
+                       MSG_DEBUG("subject : %s", strText);
+               } else {
+                       strncpy(strText, pMsgInfo->msgText, 100);
+                       MSG_DEBUG("msgText : %s", strText);
+               }
+       }
+
+       contacts_svc_value_set_str(plog, CTS_PLOG_VAL_SHORTMSG_STR, strText);
+       contacts_svc_value_set_int(plog, CTS_PLOG_VAL_MSGID_INT, (int)pMsgInfo->msgId);
+
+       if (pMsgInfo->folderId == MSG_INBOX_ID) {
+               if (pMsgInfo->msgType.mainType == MSG_SMS_TYPE)
+                       contacts_svc_value_set_int(plog, CTS_PLOG_VAL_LOG_TYPE_INT, CTS_PLOG_TYPE_SMS_INCOMMING);
+               else if (pMsgInfo->msgType.mainType == MSG_MMS_TYPE)
+                       contacts_svc_value_set_int(plog, CTS_PLOG_VAL_LOG_TYPE_INT, CTS_PLOG_TYPE_MMS_INCOMMING);
+       } else if (pMsgInfo->folderId == MSG_OUTBOX_ID) {
+               if (pMsgInfo->msgType.mainType == MSG_SMS_TYPE)
+                       contacts_svc_value_set_int(plog, CTS_PLOG_VAL_LOG_TYPE_INT, CTS_PLOG_TYPE_SMS_OUTGOING);
+               else if (pMsgInfo->msgType.mainType == MSG_MMS_TYPE)
+                       contacts_svc_value_set_int(plog, CTS_PLOG_VAL_LOG_TYPE_INT, CTS_PLOG_TYPE_MMS_OUTGOING);
+       } else if (pMsgInfo->folderId == MSG_SPAMBOX_ID) {
+               if (pMsgInfo->msgType.mainType == MSG_SMS_TYPE)
+                       contacts_svc_value_set_int(plog, CTS_PLOG_VAL_LOG_TYPE_INT, CTS_PLOG_TYPE_SMS_BLOCKED);
+               else if (pMsgInfo->msgType.mainType == MSG_MMS_TYPE)
+                       contacts_svc_value_set_int(plog, CTS_PLOG_VAL_LOG_TYPE_INT, CTS_PLOG_TYPE_MMS_BLOCKED);
+       }
+
+       int ret = contacts_svc_insert_phonelog(plog);
+
+       if (ret != CTS_SUCCESS)
+               MSG_DEBUG("contacts_svc_insert_phonelog() Failed!!! [%d]", ret);
+
+       contacts_svc_value_free(plog);
+
+       return err;
+}
+
+
+msg_error_t MsgDeletePhoneLog(msg_message_id_t msgId)
+{
+       msg_error_t err = MSG_SUCCESS;
+
+       MSG_DEBUG("MsgDeletePhoneLog [%d]", msgId);
+
+       int ret = contacts_svc_delete_phonelog(CTS_PLOG_DEL_BY_MSGID, msgId);
+
+       if (ret != CTS_SUCCESS)
+               MSG_DEBUG("contacts_svc_delete_phonelog() Failed!!! [%d]", ret);
+
+       return err;
+}
+
+
 int MsgContactSVCBeginTrans()
 {
        return contacts_svc_begin_trans();
index fa63eff..f4a157b 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include "MsgDebug.h"
 #include <sys/syscall.h>
@@ -70,12 +70,22 @@ const char * MsgDbgCmdStr(MSG_CMD_TYPE_T cmdType)
                        return "MSG_CMD_DELETE_FOLDER";
                case MSG_CMD_GET_FOLDERLIST:
                        return "MSG_CMD_GET_FOLDERLIST";
-               case MSG_CMD_SET_CONFIG:
-                       return "MSG_CMD_SET_CONFIG";
+               case MSG_CMD_ADD_FILTER:
+                       return "MSG_CMD_ADD_FILTER";
 
 // 20
-               case MSG_CMD_GET_CONFIG:
-                       return "MSG_CMD_GET_CONFIG";
+               case MSG_CMD_UPDATE_FILTER:
+                       return "MSG_CMD_UPDATE_FILTER";
+               case MSG_CMD_DELETE_FILTER:
+                       return "MSG_CMD_DELETE_FILTER";
+               case MSG_CMD_GET_FILTERLIST:
+                       return "MSG_CMD_GET_FILTERLIST";
+               case MSG_CMD_SET_FILTER_OPERATION:
+                       return "MSG_CMD_SET_FILTER_OPERATION";
+               case MSG_CMD_GET_FILTER_OPERATION:
+                       return "MSG_CMD_GET_FILTER_OPERATION";
+
+// 25
                case MSG_CMD_GET_MSG_TYPE:
                        return "MSG_CMD_GET_MSG_TYPE";
                case MSG_CMD_SUBMIT_REQ:
@@ -84,10 +94,10 @@ const char * MsgDbgCmdStr(MSG_CMD_TYPE_T cmdType)
                        return "MSG_CMD_CANCEL_REQ";
                case MSG_CMD_REG_SENT_STATUS_CB:
                        return "MSG_CMD_REG_SENT_STATUS_CB";
-
-// 25
                case MSG_CMD_REG_STORAGE_CHANGE_CB:
                        return "MSG_CMD_REG_STORAGE_CHANGE_CB";
+
+// 30
                case MSG_CMD_REG_INCOMING_MSG_CB:
                        return "MSG_CMD_REG_INCOMING_MSG_CB";
                case MSG_CMD_REG_INCOMING_MMS_CONF_MSG_CB:
@@ -96,10 +106,10 @@ const char * MsgDbgCmdStr(MSG_CMD_TYPE_T cmdType)
                        return "MSG_CMD_REG_INCOMING_SYNCML_MSG_CB";
                case MSG_CMD_REG_INCOMING_LBS_MSG_CB:
                        return "MSG_CMD_REG_INCOMING_LBS_MSG_CB";
-
-// 30
                case MSG_CMD_PLG_SENT_STATUS_CNF:
                        return "MSG_CMD_PLG_SENT_STATUS_CNF";
+
+// 35
                case MSG_CMD_PLG_STORAGE_CHANGE_IND:
                        return "MSG_CMD_PLG_STORAGE_CHANGE_IND";
                case MSG_CMD_PLG_INCOMING_MSG_IND:
@@ -108,10 +118,10 @@ const char * MsgDbgCmdStr(MSG_CMD_TYPE_T cmdType)
                        return "MSG_CMD_PLG_INCOMING_MMS_CONF";
                case MSG_CMD_PLG_INCOMING_SYNCML_IND:
                        return "MSG_CMD_PLG_INCOMING_SYNCML_IND";
-
-// 35
                case MSG_CMD_PLG_INCOMING_LBS_IND:
                        return "MSG_CMD_PLG_INCOMING_LBS_IND";
+
+// 40
                case MSG_CMD_PLG_INIT_SIM_BY_SAT:
                        return "MSG_CMD_PLG_INIT_SIM_BY_SAT";
                case MSG_CMD_GET_THREADVIEWLIST:
@@ -120,10 +130,10 @@ const char * MsgDbgCmdStr(MSG_CMD_TYPE_T cmdType)
                        return "MSG_CMD_GET_CONVERSATIONVIEWLIST";
                case MSG_CMD_DELETE_THREADMESSAGELIST:
                        return "MSG_CMD_DELETE_THREADMESSAGELIST";
-
-// 40
                case MSG_CMD_GET_CONTACT_COUNT:
                        return "MSG_CMD_GET_CONTACT_COUNT";
+
+// 45
                case MSG_CMD_GET_QUICKPANEL_DATA:
                        return "MSG_CMD_GET_QUICKPANEL_DATA";
                case MSG_CMD_COUNT_BY_MSGTYPE:
@@ -132,10 +142,10 @@ const char * MsgDbgCmdStr(MSG_CMD_TYPE_T cmdType)
                        return "MSG_CMD_RESET_DB";
                case MSG_CMD_GET_MEMSIZE:
                        return "MSG_CMD_GET_MEMSIZE";
-
-// 45
                case MSG_CMD_BACKUP_MESSAGE:
                        return "MSG_CMD_BACKUP_MESSAGE";
+
+// 50
                case MSG_CMD_RESTORE_MESSAGE:
                        return "MSG_CMD_RESTORE_MESSAGE";
                case MSG_CMD_UPDATE_THREAD_READ:
@@ -144,11 +154,52 @@ const char * MsgDbgCmdStr(MSG_CMD_TYPE_T cmdType)
                        return "MSG_CMD_REG_SYNCML_MSG_OPERATION_CB";
                case MSG_CMD_SYNCML_OPERATION:
                        return "MSG_CMD_SYNCML_OPERATION";
-
-// 50
                case MSG_CMD_GET_REPORT_STATUS:
                        return "MSG_CMD_GET_REPORT_STATUS";
 
+// 55
+               case MSG_CMD_GET_THREAD_ID_BY_ADDRESS:
+                       return "MSG_CMD_GET_THREAD_ID_BY_ADDRESS";
+               case MSG_CMD_GET_THREAD_INFO:
+                       return "MSG_CMD_GET_THREAD_INFO";
+               case MSG_CMD_GET_SMSC_OPT:
+                       return "MSG_CMD_GET_SMSC_OPT";
+               case MSG_CMD_GET_CB_OPT:
+                       return "MSG_CMD_GET_CB_OPT";
+               case MSG_CMD_GET_SMS_SEND_OPT:
+                       return "MSG_CMD_GET_SMS_SEND_OPT";
+
+// 60
+               case MSG_CMD_GET_MMS_SEND_OPT:
+                       return "MSG_CMD_GET_MMS_SEND_OPT";
+               case MSG_CMD_GET_MMS_RECV_OPT:
+                       return "MSG_CMD_GET_MMS_RECV_OPT";
+               case MSG_CMD_GET_PUSH_MSG_OPT:
+                       return "MSG_CMD_GET_PUSH_MSG_OPT";
+               case MSG_CMD_GET_VOICE_MSG_OPT:
+                       return "MSG_CMD_GET_VOICE_MSG_OPT";
+               case MSG_CMD_GET_GENERAL_MSG_OPT:
+                       return "MSG_CMD_GET_GENERAL_MSG_OPT";
+
+// 65
+               case MSG_CMD_SET_SMSC_OPT:
+                       return "MSG_CMD_SET_SMSC_OPT";
+               case MSG_CMD_SET_CB_OPT:
+                       return "MSG_CMD_SET_CB_OPT";
+               case MSG_CMD_SET_SMS_SEND_OPT:
+                       return "MSG_CMD_SET_SMS_SEND_OPT";
+               case MSG_CMD_SET_MMS_SEND_OPT:
+                       return "MSG_CMD_SET_MMS_SEND_OPT";
+               case MSG_CMD_SET_MMS_RECV_OPT:
+                       return "MSG_CMD_SET_MMS_RECV_OPT";
+
+// 70
+               case MSG_CMD_SET_PUSH_MSG_OPT:
+                       return "MSG_CMD_SET_PUSH_MSG_OPT";
+               case MSG_CMD_SET_VOICE_MSG_OPT:
+                       return "MSG_CMD_SET_VOICE_MSG_OPT";
+               case MSG_CMD_SET_GENERAL_MSG_OPT:
+                       return "MSG_CMD_SET_GENERAL_MSG_OPT";
                default:
                        return "Unknown Command Type!!!";
        }
@@ -202,11 +253,20 @@ const char * MsgDbgEvtStr(MSG_EVENT_TYPE_T evtType)
                        return "MSG_EVENT_DELETE_FOLDER";
                case MSG_EVENT_GET_FOLDERLIST:
                        return "MSG_EVENT_GET_FOLDERLIST";
-               case MSG_EVENT_SET_CONFIG:
-                       return "MSG_EVENT_SET_CONFIG";
-// 20
-               case MSG_EVENT_GET_CONFIG:
-                       return "MSG_EVENT_GET_CONFIG";
+               case MSG_EVENT_ADD_FILTER:
+                       return "MSG_EVENT_ADD_FILTER";
+//20
+               case MSG_EVENT_UPDATE_FILTER:
+                       return "MSG_EVENT_UPDATE_FILTER";
+               case MSG_EVENT_DELETE_FILTER:
+                       return "MSG_EVENT_DELETE_FILTER";
+               case MSG_EVENT_GET_FILTERLIST:
+                       return "MSG_EVENT_GET_FILTERLIST";
+               case MSG_EVENT_SET_FILTER_OPERATION:
+                       return "MSG_EVENT_SET_FILTER_OPERATION";
+               case MSG_EVENT_GET_FILTER_OPERATION:
+                       return "MSG_EVENT_GET_FILTER_OPERATION";
+//25
                case MSG_EVENT_GET_MSG_TYPE:
                        return "MSG_EVENT_GET_MSG_TYPE";
                case MSG_EVENT_SUBMIT_REQ:
@@ -215,9 +275,10 @@ const char * MsgDbgEvtStr(MSG_EVENT_TYPE_T evtType)
                        return "MSG_EVENT_CANCEL_REQ";
                case MSG_EVENT_REG_SENT_STATUS_CB:
                        return "MSG_EVENT_REG_SENT_STATUS_CB";
-// 25
                case MSG_EVENT_REG_STORAGE_CHANGE_CB:
                        return "MSG_EVENT_REG_STORAGE_CHANGE_CB";
+
+// 30
                case MSG_EVENT_REG_INCOMING_MSG_CB:
                        return "MSG_EVENT_REG_INCOMING_MSG_CB";
                case MSG_EVENT_REG_INCOMING_MMS_CONF_MSG_CB:
@@ -226,9 +287,10 @@ const char * MsgDbgEvtStr(MSG_EVENT_TYPE_T evtType)
                        return "MSG_EVENT_REG_INCOMING_SYNCML_MSG_CB";
                case MSG_EVENT_REG_INCOMING_LBS_MSG_CB:
                        return "MSG_EVENT_REG_INCOMING_LBS_MSG_CB";
-// 30
                case MSG_EVENT_PLG_SENT_STATUS_CNF:
                        return "MSG_EVENT_PLG_SENT_STATUS_CNF";
+
+// 35
                case MSG_EVENT_PLG_STORAGE_CHANGE_IND:
                        return "MSG_EVENT_STORAGE_CHANGE_CB";
                case MSG_EVENT_PLG_INCOMING_MSG_IND:
@@ -237,9 +299,10 @@ const char * MsgDbgEvtStr(MSG_EVENT_TYPE_T evtType)
                        return "MSG_EVENT_PLG_INCOMING_MMS_CONF";
                case MSG_EVENT_PLG_INCOMING_SYNCML_MSG_IND:
                        return "MSG_EVENT_PLG_INCOMING_SYNCML_MSG_IND";
-// 35
                case MSG_EVENT_PLG_INCOMING_LBS_MSG_IND:
                        return "MSG_EVENT_PLG_INCOMING_LBS_MSG_IND";
+
+// 40
                case MSG_EVENT_PLG_INIT_SIM_BY_SAT:
                        return "MSG_EVENT_PLG_INIT_SIM_BY_SAT";
                case MSG_EVENT_GET_THREADVIEWLIST:
@@ -248,9 +311,10 @@ const char * MsgDbgEvtStr(MSG_EVENT_TYPE_T evtType)
                        return "MSG_EVENT_GET_CONVERSATIONVIEWLIST";
                case MSG_EVENT_DELETE_THREADMESSAGELIST:
                        return "MSG_EVENT_DELETE_THREADMESSAGELIST";
-// 40
                case MSG_EVENT_GET_CONTACT_COUNT:
                        return "MSG_EVENT_GET_CONTACT_COUNT";
+
+// 45
                case MSG_EVENT_GET_QUICKPANEL_DATA:
                        return "MSG_EVENT_GET_QUICKPANEL_DATA";
                case MSG_EVENT_COUNT_BY_MSGTYPE:
@@ -259,9 +323,10 @@ const char * MsgDbgEvtStr(MSG_EVENT_TYPE_T evtType)
                        return "MSG_EVENT_RESET_DB";
                case MSG_EVENT_GET_MEMSIZE:
                        return "MSG_EVENT_GET_MEMSIZE";
-// 45
                case MSG_EVENT_BACKUP_MESSAGE:
                        return "MSG_EVENT_BACKUP_MESSAGE";
+
+// 50
                case MSG_EVENT_RESTORE_MESSAGE:
                        return "MSG_EVENT_RESTORE_MESSAGE";
                case MSG_EVENT_UPDATE_THREAD_READ:
@@ -270,10 +335,52 @@ const char * MsgDbgEvtStr(MSG_EVENT_TYPE_T evtType)
                        return "MSG_EVENT_REG_SYNCML_MSG_OPERATION_CB";
                case MSG_EVENT_SYNCML_OPERATION:
                        return "MSG_EVENT_SYNCML_OPERATION";
-// 50
                case MSG_EVENT_GET_REPORT_STATUS:
                        return "MSG_EVENT_GET_REPORT_STATUS";
 
+// 55
+               case MSG_CMD_GET_THREAD_ID_BY_ADDRESS:
+                       return "MSG_CMD_GET_THREAD_ID_BY_ADDRESS";
+               case MSG_CMD_GET_THREAD_INFO:
+                       return "MSG_CMD_GET_THREAD_INFO";
+               case MSG_EVENT_GET_SMSC_OPT:
+                       return "MSG_EVENT_GET_SMSC_OPT";
+               case MSG_EVENT_GET_CB_OPT:
+                       return "MSG_EVENT_GET_CB_OPT";
+               case MSG_EVENT_GET_SMS_SEND_OPT:
+                       return "MSG_EVENT_GET_SMS_SEND_OPT";
+
+// 60
+               case MSG_EVENT_GET_MMS_SEND_OPT:
+                       return "MSG_EVENT_GET_MMS_SEND_OPT";
+               case MSG_EVENT_GET_MMS_RECV_OPT:
+                       return "MSG_EVENT_GET_MMS_RECV_OPT";
+               case MSG_EVENT_GET_PUSH_MSG_OPT:
+                       return "MSG_EVENT_GET_PUSH_MSG_OPT";
+               case MSG_EVENT_GET_VOICE_MSG_OPT:
+                       return "MSG_EVENT_GET_VOICE_MSG_OPT";
+               case MSG_EVENT_GET_GENERAL_MSG_OPT:
+                       return "MSG_EVENT_GET_GENERAL_MSG_OPT";
+
+// 65
+               case MSG_EVENT_SET_SMSC_OPT:
+                       return "MSG_EVENT_SET_SMSC_OPT";
+               case MSG_EVENT_SET_CB_OPT:
+                       return "MSG_EVENT_SET_CB_OPT";
+               case MSG_EVENT_SET_SMS_SEND_OPT:
+                       return "MSG_EVENT_SET_SMS_SEND_OPT";
+               case MSG_EVENT_SET_MMS_SEND_OPT:
+                       return "MSG_EVENT_SET_MMS_SEND_OPT";
+               case MSG_EVENT_SET_MMS_RECV_OPT:
+                       return "MSG_EVENT_SET_MMS_RECV_OPT";
+
+// 70
+               case MSG_EVENT_SET_PUSH_MSG_OPT:
+                       return "MSG_EVENT_SET_PUSH_MSG_OPT";
+               case MSG_EVENT_SET_VOICE_MSG_OPT:
+                       return "MSG_EVENT_SET_VOICE_MSG_OPT";
+               case MSG_EVENT_SET_GENERAL_MSG_OPT:
+                       return "MSG_EVENT_SET_GENERAL_MSG_OPT";
 
                default:
                        return "Unknown Event Type!!!";
index 64a8acf..7e0b88b 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include "MsgDebug.h"
 #include "MsgDrmWrapper.h"
@@ -172,7 +172,7 @@ bool MsgDrmConvertDmtoDcfType(char *inputFile, char *outputFile)
                drm_trusted_opn_conv_info_s trusted_open_conv_input;
                bzero(&trusted_open_conv_input, sizeof(drm_trusted_opn_conv_info_s));
 
-               strncpy(trusted_open_conv_input.filePath, outputFile, DRM_TRUSTED_MAX_FILEPATH_LEN);
+               strncpy(trusted_open_conv_input.filePath, outputFile, DRM_TRUSTED_MAX_FILEPATH_LEN-1);
                trusted_open_conv_input.install_RO = DRM_TRUSTED_TRUE;
 
                ret = drm_trusted_open_convert(&trusted_open_conv_input, &hConvert);
index 8b85869..28c0bfe 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include "MsgException.h"
 
index 29683dc..df5ce3d 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include <stdio.h>
 
 #include "MsgUtilStorage.h"
 #include "MsgGconfWrapper.h"
 
+#ifdef USE_GCONF
+
+#define GCONF_SUCCESS 1
+
+MSG_GOBJECT_CLIENT_S* pClient = NULL;
+
+#endif
+
+bool bAutoReject = false;
+bool bUnknownAutoReject = false;
+
 
 /*==================================================================================================
                                      DEFINES
 ==================================================================================================*/
-#define MSG_UNREAD_CNT         "db/badge/org.tizen.message"
 
 
 /*==================================================================================================
                                      FUNCTION IMPLEMENTATION
 ==================================================================================================*/
-MSG_ERROR_T MsgSettingSetString(const char *pKey, const char *pSetValue)
+static void MsgVconfCB(keynode_t *key, void* data)
+{
+       char *keyStr = NULL;
+       keyStr = vconf_keynode_get_name(key);
+
+       if (!keyStr)
+               return;
+
+       if (!strcmp(keyStr, VCONFKEY_CISSAPPL_AUTO_REJECT_BOOL)) {
+               bAutoReject = vconf_keynode_get_bool(key);
+               MSG_DEBUG("[%s] key CB called. set to [%d].", VCONFKEY_CISSAPPL_AUTO_REJECT_BOOL, bAutoReject);
+       } else if (!strcmp(keyStr, VCONFKEY_CISSAPPL_AUTO_REJECT_UNKNOWN_BOOL)) {
+               bUnknownAutoReject = vconf_keynode_get_bool(key);
+               MSG_DEBUG("[%s] key CB called. set to [%d].", VCONFKEY_CISSAPPL_AUTO_REJECT_UNKNOWN_BOOL, bUnknownAutoReject);
+       } else {
+               MSG_DEBUG("key did not match.");
+       }
+}
+
+msg_error_t MsgSettingSetString(const char *pKey, const char *pSetValue)
 {
        if (pKey == NULL || pSetValue == NULL)
        {
@@ -40,14 +69,19 @@ MSG_ERROR_T MsgSettingSetString(const char *pKey, const char *pSetValue)
                return MSG_ERR_NULL_POINTER;
        }
 
+#ifdef USE_GCONF
+       if (gconf_client_set_string((GConfClient*)pClient, pKey, pSetValue, NULL) !=  GCONF_SUCCESS)
+               return MSG_ERR_SET_SETTING;
+#else
        if (vconf_set_str(pKey, pSetValue) != 0)
                return MSG_ERR_SET_SETTING;
+#endif
 
        return MSG_SUCCESS;
 }
 
 
-MSG_ERROR_T MsgSettingSetInt(const char *pKey, int nSetValue)
+msg_error_t MsgSettingSetInt(const char *pKey, int nSetValue)
 {
        if (pKey == NULL)
        {
@@ -55,14 +89,19 @@ MSG_ERROR_T MsgSettingSetInt(const char *pKey, int nSetValue)
                return MSG_ERR_NULL_POINTER;
        }
 
+#ifdef USE_GCONF
+       if (gconf_client_set_int((GConfClient*)pClient, pKey, nSetValue, NULL) !=  GCONF_SUCCESS)
+               return MSG_ERR_SET_SETTING;
+#else
        if (vconf_set_int(pKey, nSetValue) != 0)
                return MSG_ERR_SET_SETTING;
+#endif
 
        return MSG_SUCCESS;
 }
 
 
-MSG_ERROR_T MsgSettingSetBool(const char *pKey, bool bSetValue)
+msg_error_t MsgSettingSetBool(const char *pKey, bool bSetValue)
 {
        if (pKey == NULL)
        {
@@ -70,8 +109,13 @@ MSG_ERROR_T MsgSettingSetBool(const char *pKey, bool bSetValue)
                return MSG_ERR_NULL_POINTER;
        }
 
+#ifdef USE_GCONF
+       if (gconf_client_set_bool((GConfClient*)pClient, pKey, bSetValue, NULL) !=  GCONF_SUCCESS)
+               return MSG_ERR_SET_SETTING;
+#else
        if (vconf_set_bool(pKey, bSetValue) != 0)
                return MSG_ERR_SET_SETTING;
+#endif
 
        return MSG_SUCCESS;
 }
@@ -85,7 +129,11 @@ char* MsgSettingGetString(const char *pKey)
                return NULL;
        }
 
+#ifdef USE_GCONF
+       return gconf_client_get_string((GConfClient*)pClient, pKey, NULL);
+#else
        return vconf_get_str(pKey);
+#endif
 }
 
 
@@ -99,8 +147,12 @@ int MsgSettingGetInt(const char *pKey)
 
        int retVal = 0;
 
+#ifdef USE_GCONF
+       retVal = gconf_client_get_int((GConfClient*)pClient, pKey, NULL);
+#else
        if (vconf_get_int(pKey, &retVal) < 0)
                return -1;
+#endif
 
        return retVal;
 }
@@ -116,8 +168,12 @@ int MsgSettingGetBool(const char *pKey, bool *pVal)
 
        int retVal = 0, param = 0;
 
+#ifdef USE_GCONF
+       *pVal = gconf_client_get_bool((GConfClient*)pClient, pKey, NULL);
+#else
        if (vconf_get_bool(pKey, &param) < 0)
                return -1;
+#endif
 
        *pVal = (bool)param;
 
@@ -125,7 +181,7 @@ int MsgSettingGetBool(const char *pKey, bool *pVal)
 }
 
 
-MSG_ERROR_T MsgSettingHandleNewMsg(int SmsCnt, int MmsCnt)
+msg_error_t MsgSettingHandleNewMsg(int SmsCnt, int MmsCnt)
 {
        MSG_BEGIN();
 
@@ -154,7 +210,7 @@ MSG_ERROR_T MsgSettingHandleNewMsg(int SmsCnt, int MmsCnt)
 }
 
 
-MSG_ERROR_T MsgSettingSetIndicator(int SmsCnt, int MmsCnt)
+msg_error_t MsgSettingSetIndicator(int SmsCnt, int MmsCnt)
 {
 
        if (MsgSettingSetInt(VCONFKEY_MESSAGE_RECV_SMS_STATE, SmsCnt) != 0)
@@ -162,10 +218,50 @@ MSG_ERROR_T MsgSettingSetIndicator(int SmsCnt, int MmsCnt)
        if (MsgSettingSetInt(VCONFKEY_MESSAGE_RECV_MMS_STATE, MmsCnt) != 0)
                return MSG_ERR_SET_SETTING;
 
+       /* Not used currently.
        int sumCnt = SmsCnt + MmsCnt;
 
        if (MsgSettingSetInt(MSG_UNREAD_CNT, sumCnt) != 0)
                return MSG_ERR_SET_SETTING;
+       */
 
        return MSG_SUCCESS;
 }
+
+
+bool MsgSettingGetAutoReject()
+{
+       return bAutoReject;
+}
+
+bool MsgSettingGetUnknownAutoReject()
+{
+       return bUnknownAutoReject;
+}
+
+
+void MsgSettingRegVconfCB()
+{
+       // Set default values.
+       MsgSettingGetBool(VCONFKEY_CISSAPPL_AUTO_REJECT_BOOL, &bAutoReject);
+       MsgSettingGetBool(VCONFKEY_CISSAPPL_AUTO_REJECT_UNKNOWN_BOOL, &bUnknownAutoReject);
+
+       if (vconf_notify_key_changed(VCONFKEY_CISSAPPL_AUTO_REJECT_BOOL, MsgVconfCB, NULL) < 0) {
+               MSG_DEBUG("Fail to regist vconf CB with [%s]", VCONFKEY_CISSAPPL_AUTO_REJECT_BOOL);
+       }
+
+       if (vconf_notify_key_changed(VCONFKEY_CISSAPPL_AUTO_REJECT_UNKNOWN_BOOL, MsgVconfCB, NULL) < 0) {
+               MSG_DEBUG("Fail to regist vconf CB with [%s]", VCONFKEY_CISSAPPL_AUTO_REJECT_UNKNOWN_BOOL);
+       }
+}
+
+void MsgSettingRemoveVconfCB()
+{
+       if (vconf_ignore_key_changed(VCONFKEY_CISSAPPL_AUTO_REJECT_BOOL, MsgVconfCB) < 0) {
+               MSG_DEBUG("Fail to regist vconf CB with [%s]", VCONFKEY_CISSAPPL_AUTO_REJECT_BOOL);
+       }
+
+       if (vconf_ignore_key_changed(VCONFKEY_CISSAPPL_AUTO_REJECT_UNKNOWN_BOOL, MsgVconfCB) < 0) {
+               MSG_DEBUG("Fail to regist vconf CB with [%s]", VCONFKEY_CISSAPPL_AUTO_REJECT_UNKNOWN_BOOL);
+       }
+}
index e3793db..940625c 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include <sys/socket.h>
 #include <sys/un.h>
@@ -38,7 +38,7 @@ MsgIpcClientSocket::MsgIpcClientSocket() : sockfd(-1), remotefd(-1), maxfd(-1)
 }
 
 
-MSG_ERROR_T MsgIpcClientSocket::connect(const char* path)
+msg_error_t MsgIpcClientSocket::connect(const char* path)
 {
        MSG_BEGIN();
 
@@ -88,7 +88,7 @@ MSG_ERROR_T MsgIpcClientSocket::connect(const char* path)
 }
 
 
-MSG_ERROR_T MsgIpcClientSocket::close()
+msg_error_t MsgIpcClientSocket::close()
 {
        if (sockfd < 0) {
                MSG_FATAL("Client socket is not opened (check if you call close twice by accident) [%d]", sockfd);
@@ -214,12 +214,13 @@ int MsgIpcClientSocket::read(char** buf, int* len)
 
        /*  read the data in subsequence */
        if ((*len) > 0) {
-               *buf = new char[*len+1];
-               bzero(*buf, *len+1);
-               n = readn(*buf, *len);
+               unsigned int ulen = (unsigned int)*len;
+               *buf = new char[ulen+1];
+               bzero(*buf, ulen+1);
+               n = readn(*buf, ulen);
 
-               if (n !=  *len) {
-                       MSG_FATAL("WARNING: read data_size [%d] not matched [%d]", n, *len);
+               if (n !=  ulen) {
+                       MSG_FATAL("WARNING: read data_size [%d] not matched [%d]", n, ulen);
                        return CUSTOM_SOCKET_ERROR;
                }
        }
@@ -251,7 +252,7 @@ void MsgIpcServerSocket::addfd(int fd)
                maxfd = fd;
 }
 
-MSG_ERROR_T MsgIpcServerSocket::open(const char* path)
+msg_error_t MsgIpcServerSocket::open(const char* path)
 {
        MSG_BEGIN();
 
@@ -319,7 +320,7 @@ MSG_ERROR_T MsgIpcServerSocket::open(const char* path)
        return MSG_SUCCESS;
 }
 
-MSG_ERROR_T MsgIpcServerSocket::accept()
+msg_error_t MsgIpcServerSocket::accept()
 {
        MSG_BEGIN();
 
@@ -429,12 +430,13 @@ int MsgIpcServerSocket::read(int fd, char** buf, int* len )
 
        if ((*len) > 0) {
                /* read the data in subsequence */
-               *buf = new char[*len+1];
-               bzero(*buf, *len+1);
-               n = readn(fd, *buf, *len);
+               unsigned int ulen = (unsigned int)*len;
+               *buf = new char[ulen+1];
+               bzero(*buf, ulen+1);
+               n = readn(fd, *buf, ulen);
 
-               if (n != *len) {
-                       MSG_FATAL("WARNING: read data_size [%d] not matched [%d]", n, *len);
+               if (n != ulen) {
+                       MSG_FATAL("WARNING: read data_size [%d] not matched [%d]", n, ulen);
                        return CUSTOM_SOCKET_ERROR;
                }
        }
index 43e1b9e..4efaf90 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include <malloc.h>
 
index a712609..e9fd34e 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include <stdio.h>
 #include <string.h>
@@ -35,74 +35,6 @@ MMS_SMIL_ROOTLAYOUT  rootlayout;
 static void __release_glist_element(gpointer data, gpointer user_data);
 static void __release_page_element(gpointer data, gpointer user_data);
 
-int msg_verify_number(const char *raw, char *trimmed)
-{
-       if (!(raw && trimmed)) {
-               MSG_DEBUG("Phone Number is NULL");
-               return MSG_ERR_NULL_POINTER;
-       }
-
-       for (int i = 0, j = 0; raw[i]; i++) {
-               if ((raw[i] >= '0' && raw[i] <= '9') || (raw[i] == ',') || raw[i] == ' ' || raw[i] == '+') {
-                       trimmed[j++] = raw[i];
-               } else if (raw[i] == '-') {
-                       continue;
-               } else {
-                       MSG_DEBUG("Unacceptable character in telephone number: [%c]", raw[i]);
-                       return MSG_ERR_INVALID_PARAMETER;
-               }
-       }
-
-       MSG_DEBUG("Trimming [%s]->[%s]", raw, trimmed);
-       return MSG_SUCCESS;
-}
-
-int msg_verify_email(const char *raw)
-{
-       bool onlyNum = true;
-       bool atExist = false;
-
-       if (!raw) {
-               MSG_DEBUG("Email is NULL");
-               return MSG_ERR_NULL_POINTER;
-       }
-
-       for (int i = 0; raw[i]; i++) {
-
-               if (raw[i] == '@') {
-                       onlyNum = false;
-
-                       if (atExist == false) {
-                               atExist = true;
-                               continue;
-                       } else {
-                               MSG_DEBUG("Character [@] is included more than twice in email address.");
-                               return MSG_ERR_INVALID_PARAMETER;
-                       }
-               }
-
-               if ((raw[i] >= '0' && raw[i] <= '9') || raw[i] == ' ' || raw[i] == '+') {
-                       continue;
-               } else if ((raw[i] >= 'a' && raw[i] <= 'z') ||(raw[i] >= 'A' && raw[i] <= 'Z') ||(raw[i] == '.') || raw[i] == '_' || raw[i] == '-') {
-                       onlyNum = false;
-                       continue;
-               } else if (raw[i] == ',') {
-                       if (onlyNum == false && atExist == false) {
-                               MSG_DEBUG("Unacceptable type in address.");
-                               return MSG_ERR_INVALID_PARAMETER;
-                       }
-                       atExist = false;
-                       onlyNum = true;
-                       continue;
-               } else {
-                       MSG_DEBUG("Unacceptable character in address : [%c]", raw[i]);
-                       return MSG_ERR_INVALID_PARAMETER;
-               }
-       }
-
-       return MSG_SUCCESS;
-}
-
 static void __release_glist_element(gpointer data, gpointer user_data)
 {
        if(data != NULL) {
@@ -134,7 +66,7 @@ static void __release_page_element(gpointer data, gpointer user_data)
        }
 }
 
-MSG_ERROR_T _MsgMmsReleasePageList(MMS_MESSAGE_DATA_S *pMsgData)
+msg_error_t _MsgMmsReleasePageList(MMS_MESSAGE_DATA_S *pMsgData)
 {
        if (pMsgData == NULL) {
                MSG_DEBUG("pMsgData is NULL");
@@ -152,7 +84,7 @@ MSG_ERROR_T _MsgMmsReleasePageList(MMS_MESSAGE_DATA_S *pMsgData)
        return MSG_SUCCESS;
 }
 
-MSG_ERROR_T _MsgMmsReleaseRegionList(MMS_MESSAGE_DATA_S *pMsgData)
+msg_error_t _MsgMmsReleaseRegionList(MMS_MESSAGE_DATA_S *pMsgData)
 {
        if (pMsgData == NULL) {
                MSG_DEBUG("pMsgData is NULL");
@@ -170,7 +102,7 @@ MSG_ERROR_T _MsgMmsReleaseRegionList(MMS_MESSAGE_DATA_S *pMsgData)
        return MSG_SUCCESS;
 }
 
-MSG_ERROR_T _MsgMmsReleaseAttachList(MMS_MESSAGE_DATA_S *pMsgData)
+msg_error_t _MsgMmsReleaseAttachList(MMS_MESSAGE_DATA_S *pMsgData)
 {
        if (pMsgData == NULL) {
                MSG_DEBUG("pMsgData is NULL");
@@ -188,7 +120,7 @@ MSG_ERROR_T _MsgMmsReleaseAttachList(MMS_MESSAGE_DATA_S *pMsgData)
        return MSG_SUCCESS;
 }
 
-MSG_ERROR_T _MsgMmsReleaseTransitionList(MMS_MESSAGE_DATA_S *pMsgData)
+msg_error_t _MsgMmsReleaseTransitionList(MMS_MESSAGE_DATA_S *pMsgData)
 {
        if (pMsgData == NULL) {
                MSG_DEBUG("pMsgData is NULL");
@@ -206,7 +138,7 @@ MSG_ERROR_T _MsgMmsReleaseTransitionList(MMS_MESSAGE_DATA_S *pMsgData)
        return MSG_SUCCESS;
 }
 
-MSG_ERROR_T _MsgMmsReleaseMetaList(MMS_MESSAGE_DATA_S *pMsgData)
+msg_error_t _MsgMmsReleaseMetaList(MMS_MESSAGE_DATA_S *pMsgData)
 {
        if (pMsgData == NULL) {
                MSG_DEBUG("pMsgData is NULL");
@@ -224,7 +156,7 @@ MSG_ERROR_T _MsgMmsReleaseMetaList(MMS_MESSAGE_DATA_S *pMsgData)
        return MSG_SUCCESS;
 }
 
-MSG_ERROR_T _MsgMmsAddRegion(MMS_MESSAGE_DATA_S *pMsgData, MMS_SMIL_REGION* pRegion)
+msg_error_t _MsgMmsAddRegion(MMS_MESSAGE_DATA_S *pMsgData, MMS_SMIL_REGION* pRegion)
 {
        if(pMsgData == NULL || pRegion == NULL)
                return MSG_ERR_INVALID_PARAMETER;
@@ -235,7 +167,7 @@ MSG_ERROR_T _MsgMmsAddRegion(MMS_MESSAGE_DATA_S *pMsgData, MMS_SMIL_REGION* pReg
        return MSG_SUCCESS;
 }
 
-MSG_ERROR_T _MsgMmsAddPage(MMS_MESSAGE_DATA_S *pMsgData, MMS_PAGE_S *pPage)
+msg_error_t _MsgMmsAddPage(MMS_MESSAGE_DATA_S *pMsgData, MMS_PAGE_S *pPage)
 {
        if(pMsgData == NULL || pPage == NULL)
                return MSG_ERR_INVALID_PARAMETER;
@@ -246,7 +178,7 @@ MSG_ERROR_T _MsgMmsAddPage(MMS_MESSAGE_DATA_S *pMsgData, MMS_PAGE_S *pPage)
        return MSG_SUCCESS;
 }
 
-MSG_ERROR_T _MsgMmsAddMedia(MMS_PAGE_S* pPage, MMS_MEDIA_S *pMedia)
+msg_error_t _MsgMmsAddMedia(MMS_PAGE_S* pPage, MMS_MEDIA_S *pMedia)
 {
        if(pPage == NULL || pMedia == NULL)
                return MSG_ERR_INVALID_PARAMETER;
@@ -262,7 +194,7 @@ MSG_ERROR_T _MsgMmsAddMedia(MMS_PAGE_S* pPage, MMS_MEDIA_S *pMedia)
        return MSG_SUCCESS;
 }
 
-MSG_ERROR_T _MsgMmsAddTransition(MMS_MESSAGE_DATA_S *pMsgData, MMS_SMIL_TRANSITION* pTransition)
+msg_error_t _MsgMmsAddTransition(MMS_MESSAGE_DATA_S *pMsgData, MMS_SMIL_TRANSITION* pTransition)
 {
        if(pMsgData == NULL || pTransition == NULL)
                return MSG_ERR_INVALID_PARAMETER;
@@ -273,7 +205,7 @@ MSG_ERROR_T _MsgMmsAddTransition(MMS_MESSAGE_DATA_S *pMsgData, MMS_SMIL_TRANSITI
        return MSG_SUCCESS;
 }
 
-MSG_ERROR_T _MsgMmsAddMeta(MMS_MESSAGE_DATA_S *pMsgData, MMS_SMIL_META* pMeta)
+msg_error_t _MsgMmsAddMeta(MMS_MESSAGE_DATA_S *pMsgData, MMS_SMIL_META* pMeta)
 {
        if(pMsgData == NULL || pMeta == NULL)
                return MSG_ERR_INVALID_PARAMETER;
@@ -284,7 +216,7 @@ MSG_ERROR_T _MsgMmsAddMeta(MMS_MESSAGE_DATA_S *pMsgData, MMS_SMIL_META* pMeta)
        return MSG_SUCCESS;
 }
 
-MSG_ERROR_T _MsgMmsAddAttachment(MMS_MESSAGE_DATA_S *pMsgData, MMS_ATTACH_S *pAttach)
+msg_error_t _MsgMmsAddAttachment(MMS_MESSAGE_DATA_S *pMsgData, MMS_ATTACH_S *pAttach)
 {
        if(pMsgData == NULL || pAttach == NULL)
                return MSG_ERR_INVALID_PARAMETER;
@@ -319,7 +251,7 @@ bool _MsgMmsFindMatchedMedia(MMS_MESSAGE_DATA_S *pMsgData, char *pszFilePath)
        return false;
 }
 
-MSG_ERROR_T _MsgMmsAddSmilDoc(char* pSmil, MMS_MESSAGE_DATA_S* pMsgData)
+msg_error_t _MsgMmsAddSmilDoc(char* pSmil, MMS_MESSAGE_DATA_S* pMsgData)
 {
        MSG_DEBUG("MsgMmsAddSmilDoc");
 
index ff54533..fdcf88c 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include <fcntl.h>     /* O_RDWR */
 #include <sys/mman.h>
index ab6e54e..116171e 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include "MsgDebug.h"
 #include "MsgContact.h"
@@ -27,15 +27,14 @@ extern "C"
 /*==================================================================================================
                                      FUNCTION IMPLEMENTATION
 ==================================================================================================*/
-MSG_ERROR_T MsgInsertNoti(MsgDbHandler *pDbHandle, MSG_MESSAGE_INFO_S* pMsg)
+msg_error_t MsgInsertNoti(MsgDbHandler *pDbHandle, MSG_MESSAGE_INFO_S* pMsg)
 {
-
        notification_h noti = NULL;
        notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
        bundle* args;
 
        int contactId = 0;
-       int threadId = 0;
+       msg_thread_id_t threadId = 0;
        time_t msgTime = 0;
        char tempId[6];
        char addressVal[MAX_ADDRESS_VAL_LEN+1];
@@ -50,11 +49,9 @@ MSG_ERROR_T MsgInsertNoti(MsgDbHandler *pDbHandle, MSG_MESSAGE_INFO_S* pMsg)
        memset(displayName, 0x00, sizeof(displayName));
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
-       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT A.ADDRESS_ID, A.ADDRESS_VAL, A.DISPLAY_NAME, A.FIRST_NAME, A.LAST_NAME, \
-                                               B.DISPLAY_TIME, A.CONTACT_ID \
-                                               FROM %s A, %s B \
-                                            WHERE B.MSG_ID=%d AND A.ADDRESS_ID=B.ADDRESS_ID;",
-               MSGFW_ADDRESS_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME, pMsg->msgId);
+       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT A.CONV_ID, A.ADDRESS_VAL, A.DISPLAY_NAME, A.FIRST_NAME, A.LAST_NAME, B.DISPLAY_TIME, A.CONTACT_ID \
+                       FROM %s A, %s B WHERE B.MSG_ID=%d AND A.CONV_ID=B.CONV_ID;",
+                       MSGFW_ADDRESS_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME, pMsg->msgId);
 
        if (pDbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS)
                return MSG_ERR_DB_PREPARE;
@@ -243,7 +240,7 @@ MSG_ERROR_T MsgInsertNoti(MsgDbHandler *pDbHandle, MSG_MESSAGE_INFO_S* pMsg)
 }
 
 
-MSG_ERROR_T MsgInsertSmsReportToNoti(MsgDbHandler *pDbHandle, MSG_MESSAGE_ID_T MsgId, MSG_DELIVERY_REPORT_STATUS_T Status)
+msg_error_t MsgInsertSmsReportToNoti(MsgDbHandler *pDbHandle, msg_message_id_t msgId, msg_delivery_report_status_t status)
 {
        notification_h noti = NULL;
        notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
@@ -262,10 +259,8 @@ MSG_ERROR_T MsgInsertSmsReportToNoti(MsgDbHandler *pDbHandle, MSG_MESSAGE_ID_T M
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
        snprintf(sqlQuery, sizeof(sqlQuery), "SELECT A.ADDRESS_VAL, A.DISPLAY_NAME, A.FIRST_NAME, A.LAST_NAME \
-                                                                      FROM %s A, %s B \
-                                                                   WHERE B.MSG_ID = %d \
-                                                                        AND A.ADDRESS_ID = B.ADDRESS_ID;",
-                               MSGFW_ADDRESS_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME, MsgId);
+                       FROM %s A, %s B WHERE B.MSG_ID = %d AND A.CONV_ID = B.CONV_ID;",
+                       MSGFW_ADDRESS_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME, msgId);
 
        if (pDbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS)
                return MSG_ERR_DB_PREPARE;
@@ -333,7 +328,7 @@ MSG_ERROR_T MsgInsertSmsReportToNoti(MsgDbHandler *pDbHandle, MSG_MESSAGE_ID_T M
                notification_set_text(noti, NOTIFICATION_TEXT_TYPE_TITLE, displayName, NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
 
 
-       if (Status == MSG_DELIVERY_REPORT_SUCCESS)
+       if (status == MSG_DELIVERY_REPORT_SUCCESS)
                snprintf(contents, MAX_DISPLAY_NAME_LEN, "Delivered.");
        else
                snprintf(contents, MAX_DISPLAY_NAME_LEN, "Deliver Failed.");
@@ -354,14 +349,13 @@ MSG_ERROR_T MsgInsertSmsReportToNoti(MsgDbHandler *pDbHandle, MSG_MESSAGE_ID_T M
 }
 
 
-MSG_ERROR_T MsgInsertMmsReportToNoti(MsgDbHandler *pDbHandle, MSG_MESSAGE_INFO_S* pMsg)
+msg_error_t MsgInsertMmsReportToNoti(MsgDbHandler *pDbHandle, MSG_MESSAGE_INFO_S* pMsg)
 {
-
        notification_h noti = NULL;
        notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
 
-       MSG_DELIVERY_REPORT_STATUS_T    deliveryStatus;
-       MSG_READ_REPORT_STATUS_T                readStatus;
+       msg_delivery_report_status_t    deliveryStatus;
+       msg_read_report_status_t                readStatus;
 
        char addressVal[MAX_ADDRESS_VAL_LEN+1];
        char firstName[MAX_DISPLAY_NAME_LEN+1], lastName[MAX_DISPLAY_NAME_LEN+1];
@@ -377,9 +371,8 @@ MSG_ERROR_T MsgInsertMmsReportToNoti(MsgDbHandler *pDbHandle, MSG_MESSAGE_INFO_S
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
        snprintf(sqlQuery, sizeof(sqlQuery), "SELECT A.ADDRESS_VAL, A.DISPLAY_NAME, A.FIRST_NAME, A.LAST_NAME, B.DELIVERY_REPORT_STATUS, B.READ_REPORT_STATUS \
-                                                                      FROM %s A, %s B \
-                                                                       WHERE B.MSG_ID=%d AND A.ADDRESS_ID=B.ADDRESS_ID;",
-                               MSGFW_ADDRESS_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME, pMsg->msgId);
+                       FROM %s A, %s B WHERE B.MSG_ID=%d AND A.CONV_ID=B.CONV_ID;",
+                       MSGFW_ADDRESS_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME, pMsg->msgId);
 
        if (pDbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS)
                return MSG_ERR_DB_PREPARE;
@@ -422,8 +415,8 @@ MSG_ERROR_T MsgInsertMmsReportToNoti(MsgDbHandler *pDbHandle, MSG_MESSAGE_INFO_S
                        }
                }
 
-               deliveryStatus = (MSG_DELIVERY_REPORT_STATUS_T)pDbHandle->columnInt(4);
-               readStatus = (MSG_READ_REPORT_STATUS_T)pDbHandle->columnInt(5);
+               deliveryStatus = (msg_delivery_report_status_t)pDbHandle->columnInt(4);
+               readStatus = (msg_read_report_status_t)pDbHandle->columnInt(5);
 
        } else {
                pDbHandle->finalizeQuery();
@@ -545,7 +538,7 @@ MSG_ERROR_T MsgInsertMmsReportToNoti(MsgDbHandler *pDbHandle, MSG_MESSAGE_INFO_S
 }
 
 
-MSG_ERROR_T MsgDeleteNotiByMsgId(MSG_MESSAGE_ID_T msgId)
+msg_error_t MsgDeleteNotiByMsgId(msg_message_id_t msgId)
 {
 
        notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
@@ -562,7 +555,7 @@ MSG_ERROR_T MsgDeleteNotiByMsgId(MSG_MESSAGE_ID_T msgId)
 }
 
 
-MSG_ERROR_T MsgDeleteNotiByThreadId(MSG_THREAD_ID_T ThreadId)
+msg_error_t MsgDeleteNotiByThreadId(msg_thread_id_t ThreadId)
 {
        notification_delete_group_by_group_id(NULL, NOTIFICATION_TYPE_NOTI, ThreadId);
 
@@ -570,7 +563,7 @@ MSG_ERROR_T MsgDeleteNotiByThreadId(MSG_THREAD_ID_T ThreadId)
 }
 
 
-MSG_ERROR_T MsgInsertTicker(const char* pTickerMsg, const char* pLocaleTickerMsg)
+msg_error_t MsgInsertTicker(const char* pTickerMsg, const char* pLocaleTickerMsg)
 {
 
        MSG_DEBUG("pTickerMsg [%s]", pTickerMsg);
@@ -590,7 +583,7 @@ MSG_ERROR_T MsgInsertTicker(const char* pTickerMsg, const char* pLocaleTickerMsg
                MSG_DEBUG("Fail to notification_set_application : %d", noti_err);
        }
 
-       noti_err = notification_set_image(noti, NOTIFICATION_IMAGE_TYPE_ICON, CB_MSG_ICON_PATH);
+       noti_err = notification_set_image(noti, NOTIFICATION_IMAGE_TYPE_ICON, NORMAL_MSG_ICON_PATH);
        if (noti_err != NOTIFICATION_ERROR_NONE) {
                MSG_DEBUG("Fail to notification_set_image : %d", noti_err);
        }
index 1b4dcca..1218096 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include <wait.h>
 
@@ -24,8 +24,7 @@
 
 #include <alarm.h>
 
-
- /*==================================================================================================
+/*==================================================================================================
                                      VARIABLES
 ==================================================================================================*/
 static bool g_bRepeat = false;
diff --git a/utils/MsgSpamFilter.cpp b/utils/MsgSpamFilter.cpp
new file mode 100755 (executable)
index 0000000..21a10e3
--- /dev/null
@@ -0,0 +1,278 @@
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#include "MsgDebug.h"
+#include "MsgUtilFile.h"
+#include "MsgCppTypes.h"
+#include "MsgGconfWrapper.h"
+#include "MsgSpamFilter.h"
+
+extern "C" {
+#include <phone-misc.h>
+}
+
+/*==================================================================================================
+                                     VARIABLES
+==================================================================================================*/
+phone_misc_h *calllogHandle = NULL;
+
+
+/*==================================================================================================
+                                     FUNCTION IMPLEMENTATION
+==================================================================================================*/
+msg_error_t MsgSetFilterOperation(bool bSetFlag)
+{
+       MSG_BEGIN();
+
+       if (MsgSettingSetBool(MSG_BLOCK_MESSAGE, bSetFlag) != MSG_SUCCESS) {
+               MSG_DEBUG("Error to set config data [%s]", MSG_BLOCK_MESSAGE);
+               return MSG_ERR_SET_SETTING;
+       }
+
+       MSG_END();
+
+       return MSG_SUCCESS;
+}
+
+
+msg_error_t MsgGetFilterOperation(bool *pSetFlag)
+{
+       MSG_BEGIN();
+
+       MsgSettingGetBool(MSG_BLOCK_MESSAGE, pSetFlag);
+
+       MSG_END();
+
+       return MSG_SUCCESS;
+}
+
+
+void GetValidNumber(const char *pSrcNum, char *pDestNum)
+{
+       int overLen = 0, i = 0;
+
+       overLen = strlen(pSrcNum) - VALID_ADDRESS_LEN;
+
+       for (i = 0; i < VALID_ADDRESS_LEN; i++)
+               pDestNum[i] = pSrcNum[i+overLen];
+
+       pDestNum[i] = '\0';
+}
+
+
+bool MsgCheckFilter(MsgDbHandler *pDbHandle, MSG_MESSAGE_INFO_S *pMsgInfo)
+{
+       MSG_BEGIN();
+
+       msg_error_t err = MSG_SUCCESS;
+
+       // =======================================================================
+       // Check Block List of Call-log (Auto Reject)
+       // =======================================================================
+       int ret = 0;
+
+       MSG_DEBUG("bAutoReject = [%d], bUnknownAutoReject = [%d]", MsgSettingGetAutoReject(), MsgSettingGetUnknownAutoReject());
+
+       if (MsgSettingGetAutoReject()) {
+               char checkNumber[MAX_ADDRESS_VAL_LEN+1] = {0,};
+               snprintf(checkNumber, MAX_ADDRESS_VAL_LEN, "%s", pMsgInfo->addressList[0].addressVal);
+
+               if (checkNumber[0] == '\0') {
+                       if (MsgSettingGetUnknownAutoReject())
+                               return true;
+               } else {
+                       ret = phone_misc_block_check(calllogHandle, checkNumber);
+                       MSG_DEBUG("phone_misc_block_check [%d]", ret);
+               }
+
+               if (ret > 0) {
+                       MSG_DEBUG("Message is Rejected by auto-reject option.");
+                       return true;
+               }
+       }
+
+       // =======================================================================
+       // Check Filter Operation
+       // =======================================================================
+       bool filterFlag = false;
+
+       MsgGetFilterOperation(&filterFlag);
+
+       if (filterFlag == false) {
+               MSG_DEBUG("filter operation is not working");
+               return false;
+       }
+
+       // =======================================================================
+       // Check Filter by Address
+       // =======================================================================
+       int rowCnt = 0;
+
+       MSG_DEBUG("pMsg->addressList[0].addressVal [%s]", pMsgInfo->addressList[0].addressVal);
+
+       char newNumber[VALID_ADDRESS_LEN+1];
+       char sqlQuery[MAX_QUERY_LEN+1];
+
+       if (strlen(pMsgInfo->addressList[0].addressVal) > VALID_ADDRESS_LEN) {
+               memset(newNumber, 0x00, sizeof(newNumber));
+               memset(sqlQuery, 0x00, sizeof(sqlQuery));
+
+               GetValidNumber(pMsgInfo->addressList[0].addressVal, newNumber);
+
+               snprintf(sqlQuery, sizeof(sqlQuery), "SELECT FILTER_ID FROM %s WHERE FILTER_TYPE = %d AND FILTER_VALUE LIKE '%%%s';",
+                               MSGFW_FILTER_TABLE_NAME, MSG_FILTER_BY_ADDRESS, newNumber);
+       } else {
+               memset(sqlQuery, 0x00, sizeof(sqlQuery));
+
+               snprintf(sqlQuery, sizeof(sqlQuery), "SELECT FILTER_ID FROM %s WHERE FILTER_TYPE = %d AND FILTER_VALUE = '%s';",
+                               MSGFW_FILTER_TABLE_NAME, MSG_FILTER_BY_ADDRESS, pMsgInfo->addressList[0].addressVal);
+       }
+
+       err = pDbHandle->getTable(sqlQuery, &rowCnt);
+
+       if (rowCnt > 0) {
+               MSG_DEBUG("Msg is Filtered by Address : [%s]", pMsgInfo->addressList[0].addressVal);
+
+               pDbHandle->freeTable();
+
+               pMsgInfo->folderId = MSG_SPAMBOX_ID;
+
+               return true;
+       } else {
+               MSG_DEBUG("Msg is NOT Filtered by Address : [%s]", pMsgInfo->addressList[0].addressVal);
+
+               pDbHandle->freeTable();
+       }
+
+       // =======================================================================
+       // Check Filter by Subject
+       // =======================================================================
+       // Get Filter List
+       memset(sqlQuery, 0x00, sizeof(sqlQuery));
+
+       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT FILTER_VALUE FROM %s WHERE FILTER_TYPE = %d;",
+                       MSGFW_FILTER_TABLE_NAME, MSG_FILTER_BY_SUBJECT);
+
+       rowCnt = 0;
+
+       err = pDbHandle->getTable(sqlQuery, &rowCnt);
+
+       if (err != MSG_SUCCESS) {
+               MSG_DEBUG("MsgGetTable() Error [%d] : [%s]", err, sqlQuery);
+
+               pDbHandle->freeTable();
+
+               return false;
+       }
+
+       char filterValue[MAX_FILTER_VALUE_LEN+1];
+
+       char* pData = NULL;
+       AutoPtr<char> buf(&pData);
+
+       int fileSize = 0;
+       bool bFiltered = false;
+
+       for (int i = 1; i <= rowCnt; i++)
+       {
+               memset(filterValue, 0x00, sizeof(filterValue));
+
+               pDbHandle->getColumnToString(i, MAX_FILTER_VALUE_LEN, filterValue);
+
+               MSG_DEBUG("filterValue [%s]", filterValue);
+
+               if (strlen(filterValue) <= 0) continue;
+
+               if (pMsgInfo->msgType.mainType == MSG_SMS_TYPE && pMsgInfo->msgType.subType == MSG_NORMAL_SMS) {
+                       if (pMsgInfo->bTextSms == false) {
+                               if (MsgOpenAndReadFile(pMsgInfo->msgData, &pData, &fileSize) == false) {
+                                       pDbHandle->freeTable();
+                                       return false;
+                               }
+                               MSG_DEBUG("file data [%s]", pData);
+                       } else {
+                               if (pMsgInfo->dataSize > 0) {
+                                       pData = new char[pMsgInfo->dataSize+1];
+
+                                       strncpy(pData, pMsgInfo->msgText, pMsgInfo->dataSize);
+                                       pData[strlen(pMsgInfo->msgText)] = '\0';
+                               }
+                       }
+               } else if(pMsgInfo->msgType.mainType == MSG_MMS_TYPE) {
+                       if (strlen(pMsgInfo->subject) > 0) {
+                               pData = new char[strlen(pMsgInfo->subject)+1];
+
+                               strncpy(pData, pMsgInfo->subject, strlen(pMsgInfo->subject));
+                               pData[strlen(pMsgInfo->subject)] = '\0';
+                       }
+               }
+
+               // NULL value check
+               if (pData == NULL) {
+                       MSG_DEBUG("pData is NULL");
+
+                       bFiltered = false;
+                       break;
+               }
+
+               MSG_DEBUG("pData [%s]", pData);
+
+               if (strcasestr(pData, filterValue) != NULL) {
+                       MSG_DEBUG("Msg is Filtered by Subject [%s] Data [%s]", filterValue, pData);
+
+                       bFiltered = true;
+                       break;
+               }
+       }
+
+       pDbHandle->freeTable();
+
+       if (bFiltered == true) {
+               MSG_DEBUG("Msg is Filtered by Subject");
+
+               pMsgInfo->folderId = MSG_SPAMBOX_ID;
+
+               return true;
+       } else {
+               MSG_DEBUG("Msg is NOT Filtered by Subject");
+       }
+
+       MSG_END();
+
+       return false;
+}
+
+void MsgCalllogDBInit(void)
+{
+       MSG_BEGIN();
+
+       if (calllogHandle == NULL)
+               calllogHandle = phone_misc_connect();
+
+       MSG_END();
+}
+
+void MsgCalllogDBFinish(void)
+{
+       MSG_BEGIN();
+
+       if (calllogHandle != NULL) {
+               if (phone_misc_disconnect(calllogHandle) == PH_MISC_SUCCESS)
+                       calllogHandle = NULL;
+       }
+
+       MSG_END();
+}
index deb9781..dc5461d 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include <stdio.h>
 #include <stddef.h>
@@ -34,7 +34,7 @@ extern "C"
 ==================================================================================================*/
 __thread sqlite3 *handle = NULL;
 __thread sqlite3_stmt *stmt = NULL;
-__thread char **result = NULL;
+//__thread char **result = NULL;
 
 
 /*==================================================================================================
@@ -61,7 +61,7 @@ MsgDbHandler::~MsgDbHandler()
 }
 
 
-MSG_ERROR_T MsgDbHandler::connect()
+msg_error_t MsgDbHandler::connect()
 {
        int ret = 0;
 
@@ -94,7 +94,7 @@ MSG_ERROR_T MsgDbHandler::connect()
 }
 
 
-MSG_ERROR_T MsgDbHandler::disconnect()
+msg_error_t MsgDbHandler::disconnect()
 {
        int ret = 0;
 
@@ -146,7 +146,7 @@ bool MsgDbHandler::checkTableExist(const char *pTableName)
 }
 
 
-MSG_ERROR_T MsgDbHandler::execQuery(const char *pQuery)
+msg_error_t MsgDbHandler::execQuery(const char *pQuery)
 {
        int ret = 0;
 
@@ -173,7 +173,7 @@ MSG_ERROR_T MsgDbHandler::execQuery(const char *pQuery)
 }
 
 
-MSG_ERROR_T MsgDbHandler::getTable(const char *pQuery, int *pRowCnt)
+msg_error_t MsgDbHandler::getTable(const char *pQuery, int *pRowCnt)
 {
        int ret = 0;
 
@@ -182,7 +182,7 @@ MSG_ERROR_T MsgDbHandler::getTable(const char *pQuery, int *pRowCnt)
        if(connect() != MSG_SUCCESS)
                return MSG_ERR_DB_DISCONNECT;
 
-
+       freeTable();
        ret = sqlite3_get_table(handle, pQuery, &result, pRowCnt, 0, NULL);
 
        if (ret == SQLITE_OK)
@@ -216,7 +216,7 @@ void MsgDbHandler::freeTable()
 }
 
 
-MSG_ERROR_T MsgDbHandler::bindText(const char *pBindStr, int index)
+msg_error_t MsgDbHandler::bindText(const char *pBindStr, int index)
 {
        int ret = 0;
 
@@ -227,7 +227,7 @@ MSG_ERROR_T MsgDbHandler::bindText(const char *pBindStr, int index)
 }
 
 
-MSG_ERROR_T MsgDbHandler::bindBlob(const void * pBindBlob, int size, int index)
+msg_error_t MsgDbHandler::bindBlob(const void * pBindBlob, int size, int index)
 {
        int ret = 0;
 
@@ -237,7 +237,7 @@ MSG_ERROR_T MsgDbHandler::bindBlob(const void * pBindBlob, int size, int index)
 }
 
 
-MSG_ERROR_T MsgDbHandler::prepareQuery(const char *pQuery)
+msg_error_t MsgDbHandler::prepareQuery(const char *pQuery)
 {
        int ret = 0;
 
@@ -262,7 +262,7 @@ MSG_ERROR_T MsgDbHandler::prepareQuery(const char *pQuery)
 }
 
 
-MSG_ERROR_T MsgDbHandler::stepQuery()
+msg_error_t MsgDbHandler::stepQuery()
 {
        int ret = 0;
 
@@ -314,7 +314,7 @@ const void* MsgDbHandler::columnBlob(int ColumnIndex)
 }
 
 
-MSG_ERROR_T MsgDbHandler::beginTrans()
+msg_error_t MsgDbHandler::beginTrans()
 {
        int ret = 0;
 
@@ -339,7 +339,7 @@ MSG_ERROR_T MsgDbHandler::beginTrans()
 }
 
 
-MSG_ERROR_T MsgDbHandler::endTrans(bool Success)
+msg_error_t MsgDbHandler::endTrans(bool Success)
 {
        int ret = 0;
 
@@ -418,7 +418,7 @@ void MsgDbHandler::getColumnToString(int RowIndex, int Length, char *pString)
 }
 
 
-MSG_ERROR_T MsgDbHandler::getRowId(const char *pTableName, unsigned int *pRowId)
+msg_error_t MsgDbHandler::getRowId(const char *pTableName, unsigned int *pRowId)
 {
        int ret = 0, nRowId = 0, nRowCnt = 0;
        char strQuery[256];
index 08eec9a..b8deb33 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include <stdio.h>
 #include <stddef.h>
@@ -875,10 +875,6 @@ bool MsgAppendFile(const char *pFilePath, const char *pData, int DataSize)
        return true;
 }
 
-/**
-* Remove temporal Mms folder (/opt/data/msg-service/msgdata/*.dir)
-*/
-
 void MsgMmsInitDir()
 {
        struct dirent *d = NULL;
@@ -891,6 +887,7 @@ void MsgMmsInitDir()
                return;
        }
 
+       // Remove temporal Mms folder (/opt/data/msg-service/msgdata/*.dir)
        while ((d = readdir(dir)) != NULL) {
                if (d->d_type == DT_DIR) {
                        if ((strcmp(".", d->d_name) == 0) || (strcmp("..", d->d_name) == 0))
index b54e77a..a45a11c 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include "MsgDebug.h"
 #include "MsgUtilFunction.h"
@@ -78,11 +78,11 @@ int MsgEncodeCountByMsgType(int MsgCount, char **ppDest)
 }
 
 
-int MsgEncodeMsgId(MSG_MESSAGE_ID_T *pMsgId, char **ppDest)
+int MsgEncodeMsgId(msg_message_id_t *pMsgId, char **ppDest)
 {
        int dataSize = 0;
 
-       dataSize = (sizeof(MSG_MESSAGE_ID_T));
+       dataSize = (sizeof(msg_message_id_t));
 
        *ppDest = (char*)new char[dataSize];
 
@@ -131,14 +131,12 @@ int MsgEncodeMsgInfo(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S* pSendO
        return dataSize;
 }
 
-
-int MsgEncodeFolderViewList(MSG_LIST_S *pFolderViewList, char **ppDest)
+int MsgEncodeFolderList(msg_struct_list_s *pFolderList, char **ppDest)
 {
        int count = 0, dataSize = 0;
 
-       count = pFolderViewList->nCount;
-
-       dataSize = sizeof(int) + (sizeof(MSG_MESSAGE_S)*count);
+       count = pFolderList->nCount;
+       dataSize = sizeof(int) + (sizeof(MSG_FOLDER_INFO_S)*count);
 
        *ppDest = (char*)new char[dataSize];
 
@@ -147,22 +145,24 @@ int MsgEncodeFolderViewList(MSG_LIST_S *pFolderViewList, char **ppDest)
        memcpy(p, &count, sizeof(int));
        p = (void*)((char*)p + sizeof(int));
 
+       msg_struct_s *folder_info = NULL;
+
        for (int i = 0; i < count; i++)
        {
-               memcpy(p, &(pFolderViewList->msgInfo[i]), sizeof(MSG_MESSAGE_S));
-               p = (void*)((char*)p + sizeof(MSG_MESSAGE_S));
+               folder_info = (msg_struct_s *)pFolderList->msg_struct_info[i];
+               memcpy(p, folder_info->data, sizeof(MSG_FOLDER_INFO_S));
+               p = (void*)((char*)p + sizeof(MSG_FOLDER_INFO_S));
        }
 
        return dataSize;
 }
 
-
-int MsgEncodeFolderList(MSG_FOLDER_LIST_S *pFolderList, char **ppDest)
+int MsgEncodeFilterList(msg_struct_list_s *pFilterList, char **ppDest)
 {
        int count = 0, dataSize = 0;
 
-       count = pFolderList->nCount;
-       dataSize = sizeof(int) + (sizeof(MSG_FOLDER_INFO_S)*count);
+       count = pFilterList->nCount;
+       dataSize = sizeof(int) + (sizeof(MSG_FILTER_S)*count);
 
        *ppDest = (char*)new char[dataSize];
 
@@ -171,59 +171,30 @@ int MsgEncodeFolderList(MSG_FOLDER_LIST_S *pFolderList, char **ppDest)
        memcpy(p, &count, sizeof(int));
        p = (void*)((char*)p + sizeof(int));
 
+       msg_struct_s *filter_info = NULL;
+
        for (int i = 0; i < count; i++)
        {
-               memcpy(p, &(pFolderList->folderInfo[i]), sizeof(MSG_FOLDER_INFO_S));
-               p = (void*)((char*)p + sizeof(MSG_FOLDER_INFO_S));
+               filter_info = (msg_struct_s *)pFilterList->msg_struct_info[i];
+               memcpy(p, filter_info->data, sizeof(MSG_FILTER_S));
+               p = (void*)((char*)p + sizeof(MSG_FILTER_S));
        }
 
        return dataSize;
 }
 
 
-int MsgEncodeSetting(MSG_SETTING_S *pSetting, char **ppDest)
+int MsgEncodeFilterFlag(bool *pSetFlag, char **ppDest)
 {
-       int dataSize = sizeof(MSG_OPTION_TYPE_T);
+       int dataSize = 0;
 
-       switch (pSetting->type)
-       {
-               case MSG_GENERAL_OPT :
-                       dataSize += sizeof(MSG_GENERAL_OPT_S);
-               break;
-               case MSG_SMS_SENDOPT :
-                       dataSize += sizeof(MSG_SMS_SENDOPT_S);
-               break;
-               case MSG_SMSC_LIST :
-                       dataSize += sizeof(MSG_SMSC_LIST_S);
-               break;
-               case MSG_MMS_SENDOPT :
-                       dataSize += sizeof(MSG_MMS_SENDOPT_S);
-               break;
-               case MSG_MMS_RECVOPT :
-                       dataSize += sizeof(MSG_MMS_RECVOPT_S);
-               break;
-               case MSG_MMS_STYLEOPT :
-                       dataSize += sizeof(MSG_MMS_STYLEOPT_S);
-               break;
-               case MSG_PUSHMSG_OPT :
-                       dataSize += sizeof(MSG_PUSHMSG_OPT_S);
-               break;
-               case MSG_CBMSG_OPT :
-                       dataSize += sizeof(MSG_CBMSG_OPT_S);
-               break;
-               case MSG_VOICEMAIL_OPT :
-                       dataSize += sizeof(MSG_VOICEMAIL_OPT_S);
-               break;
-               case MSG_MSGSIZE_OPT :
-                       dataSize += sizeof(MSG_MSGSIZE_OPT_S);
-               break;
-       }
+       dataSize = (sizeof(bool));
 
        *ppDest = (char*)new char[dataSize];
 
        void* p = (void*)*ppDest;
 
-       memcpy(p, pSetting, dataSize);
+       memcpy(p, pSetFlag, dataSize);
 
        return dataSize;
 }
@@ -245,7 +216,7 @@ int MsgEncodeMsgType(MSG_MESSAGE_TYPE_S *pMsgType, char **ppDest)
 }
 
 
-int MsgEncodeThreadViewList(MSG_THREAD_VIEW_LIST_S *pThreadViewList, char **ppDest)
+int MsgEncodeThreadViewList(msg_struct_list_s *pThreadViewList, char **ppDest)
 {
        int count = 0, dataSize = 0;
 
@@ -260,9 +231,12 @@ int MsgEncodeThreadViewList(MSG_THREAD_VIEW_LIST_S *pThreadViewList, char **ppDe
        memcpy(p, &count, sizeof(int));
        p = (void*)((char*)p + sizeof(int));
 
+       msg_struct_s *thread_info = NULL;
+
        for (int i = 0; i < count; i++)
        {
-               memcpy(p, &(pThreadViewList->msgThreadInfo[i]), sizeof(MSG_THREAD_VIEW_S));
+               thread_info = (msg_struct_s *)pThreadViewList->msg_struct_info[i];
+               memcpy(p, thread_info->data, sizeof(MSG_THREAD_VIEW_S));
                p = (void*)((char*)p + sizeof(MSG_THREAD_VIEW_S));
        }
 
@@ -270,13 +244,13 @@ int MsgEncodeThreadViewList(MSG_THREAD_VIEW_LIST_S *pThreadViewList, char **ppDe
 }
 
 
-int MsgEncodeConversationViewList(MSG_LIST_S *pConvViewList, char **ppDest)
+int MsgEncodeConversationViewList(msg_struct_list_s *pConvViewList, char **ppDest)
 {
        int count = 0, dataSize = 0;
 
        count = pConvViewList->nCount;
 
-       dataSize = sizeof(int) + (sizeof(MSG_LIST_S)*count);
+       dataSize = sizeof(int) + (sizeof(msg_struct_list_s)*count);
 
        *ppDest = (char*)new char[dataSize];
 
@@ -287,8 +261,8 @@ int MsgEncodeConversationViewList(MSG_LIST_S *pConvViewList, char **ppDest)
 
        for (int i = 0; i < count; i++)
        {
-               memcpy(p, &(pConvViewList->msgInfo[i]), sizeof(MSG_LIST_S));
-               p = (void*)((char*)p + sizeof(MSG_LIST_S));
+               memcpy(p, &(pConvViewList->msg_struct_info[i]), sizeof(msg_struct_list_s));
+               p = (void*)((char*)p + sizeof(msg_struct_list_s));
        }
 
        return dataSize;
@@ -355,28 +329,28 @@ int MsgEncodeSyncMLOperationData(int msgId, int extId, char **ppDest)
 }
 
 
-int MsgEncodeStorageChangeData(const MSG_STORAGE_CHANGE_TYPE_T storageChangeType, const MSG_MSGID_LIST_S *pMsgIdList, char **ppDest)
+int MsgEncodeStorageChangeData(const msg_storage_change_type_t storageChangeType, const msg_id_list_s *pMsgIdList, char **ppDest)
 {
        int dataSize = 0;
        int count = 0;
 
        count = pMsgIdList->nCount;
 
-       dataSize = sizeof(MSG_STORAGE_CHANGE_TYPE_T) + sizeof(int) + (sizeof(MSG_MESSAGE_ID_T)*count);
+       dataSize = sizeof(msg_storage_change_type_t) + sizeof(int) + (sizeof(msg_message_id_t)*count);
 
        *ppDest = (char*)new char[dataSize];
 
        void* p = (void*)*ppDest;
 
-       memcpy(p, &storageChangeType, sizeof(MSG_STORAGE_CHANGE_TYPE_T));
-       p = (void*)((char*)p + sizeof(MSG_STORAGE_CHANGE_TYPE_T));
+       memcpy(p, &storageChangeType, sizeof(msg_storage_change_type_t));
+       p = (void*)((char*)p + sizeof(msg_storage_change_type_t));
 
        memcpy(p, &count, sizeof(int));
        p = (void*)((char*)p + sizeof(int));
 
        for (int i = 0; i < count; i++) {
-               memcpy(p, &(pMsgIdList->msgIdList[i]), sizeof(MSG_MESSAGE_ID_T));
-               p = (void*)((char*)p + sizeof(MSG_MESSAGE_ID_T));
+               memcpy(p, &(pMsgIdList->msgIdList[i]), sizeof(msg_message_id_t));
+               p = (void*)((char*)p + sizeof(msg_message_id_t));
        }
 
        return dataSize;
@@ -399,10 +373,45 @@ int MsgEncodeReportStatus(MSG_REPORT_STATUS_INFO_S* pReportStatus, char **ppDest
 }
 
 
+int MsgEncodeThreadId(msg_thread_id_t *pThreadId, char **ppDest)
+{
+       int dataSize = 0;
+
+       dataSize = (sizeof(msg_thread_id_t));
+
+       *ppDest = (char*)new char[dataSize];
+
+       void* p = (void*)*ppDest;
+
+       memcpy(p, pThreadId, dataSize);
+
+       return dataSize;
+}
+
+
+int MsgEncodeThreadInfo(MSG_THREAD_VIEW_S *pThreadInfo, char **ppDest)
+{
+       int dataSize = 0;
+
+       dataSize = sizeof(MSG_THREAD_VIEW_S);
+
+       *ppDest = (char*)new char[dataSize];
+
+       void* p = (void*)*ppDest;
+
+       memcpy(p, pThreadInfo, sizeof(MSG_THREAD_VIEW_S));
+
+       p = (void*)((char*)p + sizeof(MSG_THREAD_VIEW_S));
+
+       return dataSize;
+}
+
+
+
 // Decoders
-void MsgDecodeMsgId(char *pSrc, MSG_MESSAGE_ID_T *pMsgId)
+void MsgDecodeMsgId(char *pSrc, msg_message_id_t *pMsgId)
 {
-       memcpy(pMsgId, pSrc, sizeof(MSG_MESSAGE_ID_T));
+       memcpy(pMsgId, pSrc, sizeof(msg_message_id_t));
 }
 
 
@@ -427,36 +436,6 @@ void MsgDecodeMsgInfo(char *pSrc, MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_I
        memcpy(pSendOptInfo, pSrc, sizeof(MSG_SENDINGOPT_INFO_S));
 }
 
-
-void MsgDecodeFolderViewList(char *pSrc, MSG_LIST_S *pFolderViewList)
-{
-       int count = 0;
-
-       memcpy(&count, pSrc, sizeof(int));
-       pSrc = pSrc + sizeof(int);
-
-       if( count > 0 )
-       {
-               pFolderViewList->nCount = count;
-               pFolderViewList->msgInfo = (msg_message_t*)new char[sizeof(MSG_MESSAGE_S)*count];
-
-               MSG_MESSAGE_S* pInfoTmp = (MSG_MESSAGE_S*)pFolderViewList->msgInfo;
-
-               for (int i = 0; i < count; i++)
-               {
-                       memcpy(pInfoTmp, pSrc, sizeof(MSG_MESSAGE_S));
-                       pSrc = pSrc + sizeof(MSG_MESSAGE_S);
-                       pInfoTmp++;
-               }
-       }
-       else if ( count == 0 )
-       {
-               pFolderViewList->nCount = count;
-               pFolderViewList->msgInfo = NULL;
-       }
-}
-
-
 void MsgDecodeRecipientList(char *pSrc, MSG_RECIPIENTS_LIST_S *pRecipientList)
 {
        int count = 0;
@@ -478,133 +457,82 @@ void MsgDecodeRecipientList(char *pSrc, MSG_RECIPIENTS_LIST_S *pRecipientList)
 }
 
 
-void MsgDecodeFolderList(char *pSrc, MSG_FOLDER_LIST_S *pFolderList)
+void MsgDecodeFolderList(char *pSrc, msg_struct_list_s *pFolderList)
 {
        int count = 0;
 
        memcpy(&count, pSrc, sizeof(int));
        pSrc = pSrc + sizeof(int);
 
-       pFolderList->nCount = count;
-       pFolderList->folderInfo = (MSG_FOLDER_INFO_S*)new char[sizeof(MSG_FOLDER_INFO_S)*count];
-
-       MSG_FOLDER_INFO_S* pInfoTmp = pFolderList->folderInfo;
-
-       for (int i = 0; i < count; i++)
+       if( count > 0 )
        {
-               memcpy(pInfoTmp, pSrc, sizeof(MSG_FOLDER_INFO_S));
-               pSrc = pSrc + sizeof(MSG_FOLDER_INFO_S);
-               pInfoTmp++;
-       }
-}
+               pFolderList->nCount = count;
+               pFolderList->msg_struct_info = (msg_struct_t *)new char[sizeof(MSG_FOLDER_INFO_S *)*count];
 
+               msg_struct_s *pInfoTmp = NULL;
 
-void MsgDecodeSetting(char *pSrc, MSG_SETTING_S *pSetting)
-{
-       int dataSize = sizeof(MSG_OPTION_TYPE_T);
+               for (int i = 0; i < count; i++)
+               {
 
-       switch (pSetting->type)
+                       pFolderList->msg_struct_info[i] = (msg_struct_t )new char[sizeof(msg_struct_s)];
+                       pInfoTmp = (msg_struct_s *)pFolderList->msg_struct_info[i];
+                       pInfoTmp->type = MSG_STRUCT_FOLDER_INFO;
+                       pInfoTmp->data = new char[sizeof(MSG_FOLDER_INFO_S)];
+                       memcpy(pInfoTmp->data, pSrc, sizeof(MSG_FOLDER_INFO_S));
+                       pSrc = pSrc + sizeof(MSG_FOLDER_INFO_S);
+               }
+       }
+       else if ( count == 0 )
        {
-               case MSG_GENERAL_OPT :
-                       dataSize += sizeof(MSG_GENERAL_OPT_S);
-               break;
-               case MSG_SMS_SENDOPT :
-                       dataSize += sizeof(MSG_SMS_SENDOPT_S);
-               break;
-               case MSG_SMSC_LIST :
-                       dataSize += sizeof(MSG_SMSC_LIST_S);
-               break;
-               case MSG_MMS_SENDOPT :
-                       dataSize += sizeof(MSG_MMS_SENDOPT_S);
-               break;
-               case MSG_MMS_RECVOPT :
-                       dataSize += sizeof(MSG_MMS_RECVOPT_S);
-               break;
-               case MSG_MMS_STYLEOPT :
-                       dataSize += sizeof(MSG_MMS_STYLEOPT_S);
-               break;
-               case MSG_PUSHMSG_OPT :
-                       dataSize += sizeof(MSG_PUSHMSG_OPT_S);
-               break;
-               case MSG_CBMSG_OPT :
-                       dataSize += sizeof(MSG_CBMSG_OPT_S);
-               break;
-               case MSG_VOICEMAIL_OPT :
-                       dataSize += sizeof(MSG_VOICEMAIL_OPT_S);
-               break;
-               case MSG_MSGSIZE_OPT :
-                       dataSize += sizeof(MSG_MSGSIZE_OPT_S);
-               break;
+               pFolderList->nCount = count;
+               pFolderList->msg_struct_info = NULL;
        }
-
-       memcpy(pSetting, pSrc, dataSize);
 }
 
-
-void MsgDecodeMsgType(char *pSrc, MSG_MESSAGE_TYPE_S* pMsgType)
-{
-       memcpy(pMsgType, pSrc, sizeof(MSG_MESSAGE_TYPE_S));
-}
-
-
-void MsgDecodeThreadViewList(char *pSrc, MSG_THREAD_VIEW_LIST_S *pThreadViewList)
+void MsgDecodeFilterList(char *pSrc, msg_struct_list_s *pFilterList)
 {
        int count = 0;
 
        memcpy(&count, pSrc, sizeof(int));
        pSrc = pSrc + sizeof(int);
 
-       if (count > 0)
+       if( count > 0 )
        {
-               pThreadViewList->nCount = count;
-               pThreadViewList->msgThreadInfo = (msg_thread_view_t*)new char[sizeof(MSG_THREAD_VIEW_S)*count];
+               pFilterList->nCount = count;
+               pFilterList->msg_struct_info = (msg_struct_t *)new char[sizeof(MSG_FILTER_S *)*count];
 
-               MSG_THREAD_VIEW_S* pInfoTmp = (MSG_THREAD_VIEW_S*)pThreadViewList->msgThreadInfo;
+               msg_struct_s *pStructTmp = NULL;
 
                for (int i = 0; i < count; i++)
                {
-                       memcpy(pInfoTmp, pSrc, sizeof(MSG_THREAD_VIEW_S));
-                       pSrc = pSrc + sizeof(MSG_THREAD_VIEW_S);
-                       pInfoTmp++;
+                       pFilterList->msg_struct_info[i] = (msg_struct_t )new char[sizeof(msg_struct_s)];
+                       pStructTmp = (msg_struct_s *)pFilterList->msg_struct_info[i];
+                       pStructTmp->type = MSG_STRUCT_FILTER;
+                       pStructTmp->data = new char[sizeof(MSG_FILTER_S)];
+                       memcpy(pStructTmp->data, pSrc, sizeof(MSG_FILTER_S));
+                       pSrc = pSrc + sizeof(MSG_FILTER_S);
                }
        }
-       else if (count == 0)
+       else if ( count == 0 )
        {
-               pThreadViewList->nCount = count;
-               pThreadViewList->msgThreadInfo = NULL;
+               pFilterList->nCount = count;
+               pFilterList->msg_struct_info = NULL;
        }
+
 }
 
 
-void MsgDecodeConversationViewList(char *pSrc, MSG_LIST_S *pConvViewList)
+void MsgDecodeFilterFlag(char *pSrc, bool *pSetFlag)
 {
-       int count = 0;
-
-       memcpy(&count, pSrc, sizeof(int));
-       pSrc = pSrc + sizeof(int);
-
-       if (count > 0)
-       {
-               pConvViewList->nCount = count;
-               pConvViewList->msgInfo = (msg_message_t*)new char[sizeof(MSG_MESSAGE_S)*count];
+       memcpy(pSetFlag, pSrc, sizeof(bool));
+}
 
-               MSG_MESSAGE_S* pInfoTmp = (MSG_MESSAGE_S*)pConvViewList->msgInfo;
 
-               for (int i = 0; i < count; i++)
-               {
-                       memcpy(pInfoTmp, pSrc, sizeof(MSG_MESSAGE_S));
-                       pSrc = pSrc + sizeof(MSG_MESSAGE_S);
-                       pInfoTmp++;
-               }
-       }
-       else if (count == 0)
-       {
-               pConvViewList->nCount = count;
-               pConvViewList->msgInfo = NULL;
-       }
+void MsgDecodeMsgType(char *pSrc, MSG_MESSAGE_TYPE_S* pMsgType)
+{
+       memcpy(pMsgType, pSrc, sizeof(MSG_MESSAGE_TYPE_S));
 }
 
-
 void   MsgDecodeContactCount(char *pSrc,  MSG_THREAD_COUNT_INFO_S *pMsgThreadCountList)
 {
        int count = 0;
@@ -643,8 +571,8 @@ void        MsgDecodeReportStatus(char *pSrc,  MSG_REPORT_STATUS_INFO_S *pReportStatus)
        if(pSrc == NULL)
                return;
 
-       memcpy(&count, pSrc, sizeof(MSG_DELIVERY_REPORT_STATUS_T));
-       pSrc = pSrc + sizeof(MSG_DELIVERY_REPORT_STATUS_T);
+       memcpy(&count, pSrc, sizeof(msg_delivery_report_status_t));
+       pSrc = pSrc + sizeof(msg_delivery_report_status_t);
        pReportStatus->deliveryStatus = count;
 
 
@@ -653,8 +581,8 @@ void        MsgDecodeReportStatus(char *pSrc,  MSG_REPORT_STATUS_INFO_S *pReportStatus)
        pReportStatus->deliveryStatusTime = count;
 
 
-       memcpy(&count, pSrc, sizeof(MSG_READ_REPORT_STATUS_T));
-       pSrc = pSrc + sizeof(MSG_READ_REPORT_STATUS_T);
+       memcpy(&count, pSrc, sizeof(msg_read_report_status_t));
+       pSrc = pSrc + sizeof(msg_read_report_status_t);
        pReportStatus->readStatus = count;
 
 
@@ -666,9 +594,18 @@ void       MsgDecodeReportStatus(char *pSrc,  MSG_REPORT_STATUS_INFO_S *pReportStatus)
        return;
 }
 
+void MsgDecodeThreadId(char *pSrc, msg_thread_id_t *pThreadId)
+{
+       memcpy(pThreadId, pSrc, sizeof(msg_thread_id_t));
+}
+
+void MsgDecodeThreadInfo(char *pSrc, MSG_THREAD_VIEW_S *pThreadInfo)
+{
+       memcpy(pThreadInfo, pSrc, sizeof(MSG_THREAD_VIEW_S));
+}
 
 // Event Encoder
-int MsgMakeEvent(const void *pData, int DataSize, MSG_EVENT_TYPE_T MsgEvent, MSG_ERROR_T MsgError, void **ppEvent)
+int MsgMakeEvent(const void *pData, int DataSize, MSG_EVENT_TYPE_T MsgEvent, msg_error_t MsgError, void **ppEvent)
 {
        MSG_EVENT_S* pMsgEvent = NULL;
 
@@ -687,3 +624,72 @@ int MsgMakeEvent(const void *pData, int DataSize, MSG_EVENT_TYPE_T MsgEvent, MSG
 
        return (sizeof(MSG_EVENT_S) + DataSize);
 }
+
+int msg_verify_number(const char *raw, char *trimmed)
+{
+       if (!(raw && trimmed)) {
+               MSG_DEBUG("Phone Number is NULL");
+               return MSG_ERR_NULL_POINTER;
+       }
+
+       for (int i=0, j=0 ; raw[i] ; i++) {
+               if ((raw[i] >= '0' && raw[i] <= '9') || raw[i] == '+' || raw[i] == ',' || raw[i] == ' ' \
+                               || raw[i] == '*' ||  raw[i] == '#') {
+                       trimmed[j++] = raw[i];
+               } else if (raw[i] == '-') {
+                       continue;
+               } else {
+                       MSG_DEBUG("Unacceptable character in telephone number: [%c]", raw[i]);
+                       return MSG_ERR_INVALID_PARAMETER;
+               }
+       }
+
+       MSG_DEBUG("Trimming [%s]->[%s]", raw, trimmed);
+       return MSG_SUCCESS;
+}
+
+int msg_verify_email(const char *raw)
+{
+       bool onlyNum = true;
+       bool atExist = false;
+
+       if (!raw) {
+               MSG_DEBUG("Email is NULL");
+               return MSG_ERR_NULL_POINTER;
+       }
+
+       for (int i = 0; raw[i]; i++) {
+
+               if (raw[i] == '@') {
+                       onlyNum = false;
+
+                       if (atExist == false) {
+                               atExist = true;
+                               continue;
+                       } else {
+                               MSG_DEBUG("Character [@] is included more than twice in email address.");
+                               return MSG_ERR_INVALID_PARAMETER;
+                       }
+               }
+
+               if ((raw[i] >= '0' && raw[i] <= '9') || raw[i] == '+' || raw[i] == '*' ||  raw[i] == '#') {
+                       continue;
+               } else if ((raw[i] >= 'a' && raw[i] <= 'z') ||(raw[i] >= 'A' && raw[i] <= 'Z') ||(raw[i] == '.') || raw[i] == '_' || raw[i] == '-') {
+                       onlyNum = false;
+                       continue;
+               } else if (raw[i] == ',') {
+                       if (onlyNum == false && atExist == false) {
+                               MSG_DEBUG("Unacceptable type in address.");
+                               return MSG_ERR_INVALID_PARAMETER;
+                       }
+                       atExist = false;
+                       onlyNum = true;
+                       continue;
+               } else {
+                       MSG_DEBUG("Unacceptable character in address : [%c]", raw[i]);
+                       return MSG_ERR_INVALID_PARAMETER;
+               }
+       }
+
+       return MSG_SUCCESS;
+}
index c706151..525e41b 100755 (executable)
@@ -1,18 +1,18 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *    http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+* Copyright 2012  Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.tizenopensource.org/license
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include "MsgDebug.h"
 #include "MsgUtilFile.h"
@@ -32,20 +32,18 @@ static int msgCntLimit[MSG_COUNT_LIMIT_MAILBOX_TYPE_MAX][MSG_COUNT_LIMIT_MSG_TYP
 /*==================================================================================================
                                      FUNCTION IMPLEMENTATION
 ==================================================================================================*/
-unsigned int MsgStoAddMessageTable(MsgDbHandler *pDbHandle, const MSG_MESSAGE_INFO_S *pMsgInfo, unsigned int AddrId)
+unsigned int MsgStoAddMessageTable(MsgDbHandler *pDbHandle, const MSG_MESSAGE_INFO_S *pMsgInfo)
 {
        MSG_BEGIN();
 
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
-       unsigned int msgId = 0;
+       msg_message_id_t msgId = 0;
 
        err = pDbHandle->getRowId(MSGFW_MESSAGE_TABLE_NAME, &msgId);
 
        if (err != MSG_SUCCESS)
-       {
                return 0;
-       }
 
        int fileSize = 0;
 
@@ -53,8 +51,7 @@ unsigned int MsgStoAddMessageTable(MsgDbHandler *pDbHandle, const MSG_MESSAGE_IN
        AutoPtr<char> buf(&pFileData);
 
        // Get File Data
-       if (pMsgInfo->bTextSms == false)
-       {
+       if (pMsgInfo->bTextSms == false) {
                if (MsgOpenAndReadFile(pMsgInfo->msgData, &pFileData, &fileSize) == false)
                        return 0;
 
@@ -66,18 +63,15 @@ unsigned int MsgStoAddMessageTable(MsgDbHandler *pDbHandle, const MSG_MESSAGE_IN
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
-       snprintf(sqlQuery, sizeof(sqlQuery), "INSERT INTO %s VALUES (%d, %d, %d, %d, %d, %d, %d, %ld, %d, %d, %d, %d, %d, %d, %ld, %d, ?, ?, ?, ?, %d, 0, %d, 0, 0);",
-                               MSGFW_MESSAGE_TABLE_NAME, msgId, AddrId, pMsgInfo->folderId, msgId, pMsgInfo->storageId,
-                               pMsgInfo->msgType.mainType, pMsgInfo->msgType.subType, pMsgInfo->displayTime, pMsgInfo->dataSize,
-                               pMsgInfo->networkStatus, pMsgInfo->bRead, pMsgInfo->bProtected, pMsgInfo->priority,
-                               pMsgInfo->direction, pMsgInfo->scheduledTime, pMsgInfo->bBackup, MSG_DELIVERY_REPORT_NONE, MSG_READ_REPORT_NONE);
+       snprintf(sqlQuery, sizeof(sqlQuery), "INSERT INTO %s VALUES (%d, %d, %d, %d, %d, %d, %ld, %d, %d, %d, %d, %d, %d, %ld, %d, ?, ?, ?, ?, %d, 0, %d, 0, 0);",
+                       MSGFW_MESSAGE_TABLE_NAME, msgId, pMsgInfo->threadId, pMsgInfo->folderId, pMsgInfo->storageId, pMsgInfo->msgType.mainType,
+                       pMsgInfo->msgType.subType, pMsgInfo->displayTime, pMsgInfo->dataSize, pMsgInfo->networkStatus, pMsgInfo->bRead, pMsgInfo->bProtected,
+                       pMsgInfo->priority, pMsgInfo->direction, 0, pMsgInfo->bBackup, MSG_DELIVERY_REPORT_NONE, MSG_READ_REPORT_NONE);
 
        MSG_DEBUG("QUERY : %s", sqlQuery);
 
        if (pDbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS)
-       {
                return 0;
-       }
 
        pDbHandle->bindText(pMsgInfo->subject, 1);
 
@@ -90,8 +84,7 @@ unsigned int MsgStoAddMessageTable(MsgDbHandler *pDbHandle, const MSG_MESSAGE_IN
        else
                pDbHandle->bindText(pMsgInfo->msgText, 4);
 
-       if (pDbHandle->stepQuery() != MSG_ERR_DB_DONE)
-       {
+       if (pDbHandle->stepQuery() != MSG_ERR_DB_DONE) {
                pDbHandle->finalizeQuery();
                return 0;
        }
@@ -102,51 +95,44 @@ unsigned int MsgStoAddMessageTable(MsgDbHandler *pDbHandle, const MSG_MESSAGE_IN
 }
 
 
-MSG_ERROR_T MsgStoSetReadStatus(MsgDbHandler *pDbHandle, MSG_MESSAGE_ID_T MsgId, bool bRead)
+msg_error_t MsgStoSetReadStatus(MsgDbHandler *pDbHandle, msg_message_id_t msgId, bool bRead)
 {
        char sqlQuery[MAX_QUERY_LEN+1];
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
        snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET READ_STATUS = %d WHERE MSG_ID = %d;",
-                                       MSGFW_MESSAGE_TABLE_NAME, (int)bRead, MsgId);
+                       MSGFW_MESSAGE_TABLE_NAME, (int)bRead, msgId);
 
        if (pDbHandle->execQuery(sqlQuery) != MSG_SUCCESS)
                return MSG_ERR_DB_EXEC;
 
        // Get MAIN_TYPE, SUB_TYPE, STORAGE_ID
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
-       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT A.MAIN_TYPE, A.SUB_TYPE, B.CONTACT_ID, B.ADDRESS_ID \
-                                       FROM %s A, %s B \
-                                    WHERE A.MSG_ID = %d AND A.ADDRESS_ID = B.ADDRESS_ID;",
-                       MSGFW_MESSAGE_TABLE_NAME, MSGFW_ADDRESS_TABLE_NAME, MsgId);
+       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT A.MAIN_TYPE, A.SUB_TYPE, B.CONV_ID \
+                       FROM %s A, %s B WHERE A.MSG_ID = %d AND A.CONV_ID = B.CONV_ID;",
+                       MSGFW_MESSAGE_TABLE_NAME, MSGFW_CONVERSATION_TABLE_NAME, msgId);
 
        if (pDbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS)
                return MSG_ERR_DB_PREPARE;
 
        MSG_MESSAGE_TYPE_S msgType;
-       MSG_CONTACT_ID_T contactId;
-       unsigned int addrId;
+       msg_thread_id_t convId;
 
-       if (pDbHandle->stepQuery() == MSG_ERR_DB_ROW)
-       {
+       if (pDbHandle->stepQuery() == MSG_ERR_DB_ROW) {
                msgType.mainType = pDbHandle->columnInt(0);
                msgType.subType = pDbHandle->columnInt(1);
-               contactId = pDbHandle->columnInt(2);
-               addrId = pDbHandle->columnInt(3);
-       }
-       else
-       {
+               convId = pDbHandle->columnInt(2);
+       } else {
                pDbHandle->finalizeQuery();
                return MSG_ERR_DB_STEP;
        }
 
        pDbHandle->finalizeQuery();
 
-       MSG_DEBUG("Main Type:[%d] SubType:[%d] ContactId:[%d] AddrId:[%d]", msgType.mainType, msgType.subType, contactId, addrId);
+       MSG_DEBUG("Main Type:[%d] SubType:[%d] ConvId:[%d]", msgType.mainType, msgType.subType, convId);
 
-       if (MsgStoUpdateAddress(pDbHandle, addrId) != MSG_SUCCESS)
-       {
-               MSG_DEBUG("MsgStoUpdateAddress() Error");
+       if (MsgStoUpdateConversation(pDbHandle, convId) != MSG_SUCCESS) {
+               MSG_DEBUG("MsgStoUpdateConversation() Error");
                return MSG_ERR_STORAGE_ERROR;
        }
 
@@ -157,33 +143,29 @@ MSG_ERROR_T MsgStoSetReadStatus(MsgDbHandler *pDbHandle, MSG_MESSAGE_ID_T MsgId,
 
        MsgSettingSetIndicator(smsCnt, mmsCnt);
 
-       MsgDeleteNotiByMsgId(MsgId);
+       MsgDeleteNotiByMsgId(msgId);
 
        return MSG_SUCCESS;
 }
 
 
-MSG_ERROR_T MsgStoGetOldestMessage(MsgDbHandler *pDbHandle, const MSG_MESSAGE_INFO_S *pMsgInfo, MSG_MESSAGE_ID_T *pMsgId)
+msg_error_t MsgStoGetOldestMessage(MsgDbHandler *pDbHandle, const MSG_MESSAGE_INFO_S *pMsgInfo, msg_message_id_t *pMsgId)
 {
        char sqlQuery[MAX_QUERY_LEN+1];
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
-       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT MSG_ID \
-                                                                      FROM %s \
-                                                                   WHERE SUB_TYPE = %d AND FOLDER_ID = %d AND STORAGE_ID = %d AND PROTECTED = 0 \
-                                                                    ORDER BY DISPLAY_TIME ASC",
-                               MSGFW_MESSAGE_TABLE_NAME, pMsgInfo->msgType.subType, pMsgInfo->folderId, MSG_STORAGE_PHONE);
+       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT MSG_ID FROM %s \
+                       WHERE SUB_TYPE = %d AND FOLDER_ID = %d AND STORAGE_ID = %d AND PROTECTED = 0 \
+                       ORDER BY DISPLAY_TIME ASC",
+                       MSGFW_MESSAGE_TABLE_NAME, pMsgInfo->msgType.subType, pMsgInfo->folderId, MSG_STORAGE_PHONE);
 
        if (pDbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS)
                return MSG_ERR_DB_PREPARE;
 
-       if (pDbHandle->stepQuery() == MSG_ERR_DB_ROW)
-       {
+       if (pDbHandle->stepQuery() == MSG_ERR_DB_ROW) {
                *pMsgId = pDbHandle->columnInt(0);
-       }
-       else
-       {
+       } else {
                pDbHandle->finalizeQuery();
                return MSG_ERR_DB_STEP;
        }
@@ -194,16 +176,15 @@ MSG_ERROR_T MsgStoGetOldestMessage(MsgDbHandler *pDbHandle, const MSG_MESSAGE_IN
 }
 
 
-MSG_ERROR_T MsgStoCheckMsgCntFull(MsgDbHandler *pDbHandle, const MSG_MESSAGE_TYPE_S* pMsgType, MSG_FOLDER_ID_T FolderId)
+msg_error_t MsgStoCheckMsgCntFull(MsgDbHandler *pDbHandle, const MSG_MESSAGE_TYPE_S* pMsgType, msg_folder_id_t folderId)
 {
        MSG_BEGIN();
 
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        struct statfs buf = {0};
 
-       if (statfs(MSG_DATA_ROOT_PATH, &buf) == -1)
-       {
+       if (statfs(MSG_DATA_ROOT_PATH, &buf) == -1) {
                MSG_DEBUG("statfs(\"%s\") failed - %d", MSG_DATA_ROOT_PATH);
                return MSG_ERR_STORAGE_ERROR;
        }
@@ -218,18 +199,15 @@ MSG_ERROR_T MsgStoCheckMsgCntFull(MsgDbHandler *pDbHandle, const MSG_MESSAGE_TYP
        else if(freeSpace < MMS_MINIMUM_SPACE && pMsgType->mainType == MSG_MMS_TYPE)
                err = MSG_ERR_MESSAGE_COUNT_FULL;
 
-       return err;
-
        MSG_END();
 
        return err;
 }
 
 
-MSG_ERROR_T MsgStoCountMsgByLimitCategory(MsgDbHandler *pDbHandle, const MSG_MESSAGE_TYPE_S *pMsgType, int *pMsgCount, MSG_FOLDER_ID_T folderId )
+msg_error_t MsgStoCountMsgByLimitCategory(MsgDbHandler *pDbHandle, const MSG_MESSAGE_TYPE_S *pMsgType, int *pMsgCount, msg_folder_id_t folderId)
 {
-       if (pMsgType == NULL)
-       {
+       if (pMsgType == NULL) {
                MSG_DEBUG("pMsgType is NULL");
                return MSG_ERR_NULL_POINTER;
        }
@@ -239,45 +217,33 @@ MSG_ERROR_T MsgStoCountMsgByLimitCategory(MsgDbHandler *pDbHandle, const MSG_MES
        char sqlQuery[MAX_QUERY_LEN+1];
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
-       if ((pMsgType->mainType == MSG_SMS_TYPE) && (pMsgType->subType == MSG_WAP_SI_SMS ||pMsgType->subType == MSG_WAP_SL_SMS)) // PUSH
-       {
+       if ((pMsgType->mainType == MSG_SMS_TYPE) && (pMsgType->subType == MSG_WAP_SI_SMS ||pMsgType->subType == MSG_WAP_SL_SMS)) { // PUSH
                snprintf(sqlQuery, sizeof(sqlQuery), "SELECT COUNT(MSG_ID) FROM %s WHERE MAIN_TYPE = %d AND SUB_TYPE IN (%d, %d) AND FOLDER_ID = %d;",
                                MSGFW_MESSAGE_TABLE_NAME, pMsgType->mainType, MSG_WAP_SI_SMS, MSG_WAP_SL_SMS, MSG_INBOX_ID);
-       }
-       else if ((pMsgType->mainType == MSG_SMS_TYPE) && (pMsgType->subType == MSG_CB_SMS)) // CB
-       {
+       } else if ((pMsgType->mainType == MSG_SMS_TYPE) && (pMsgType->subType == MSG_CB_SMS)) { // CB
                snprintf(sqlQuery, sizeof(sqlQuery), "SELECT COUNT(MSG_ID) FROM %s WHERE MAIN_TYPE = %d AND SUB_TYPE IN (%d) AND FOLDER_ID = %d;",
                                MSGFW_MESSAGE_TABLE_NAME, pMsgType->mainType, MSG_CB_SMS, MSG_CBMSGBOX_ID);
-       }
-       else if ((pMsgType->mainType == MSG_SMS_TYPE) && (pMsgType->subType == MSG_SYNCML_CP)) // Provision
-       {
+       } else if ((pMsgType->mainType == MSG_SMS_TYPE) && (pMsgType->subType == MSG_SYNCML_CP)) { // Provision
                snprintf(sqlQuery, sizeof(sqlQuery), "SELECT COUNT(MSG_ID) FROM %s WHERE MAIN_TYPE = %d AND SUB_TYPE IN (%d) AND FOLDER_ID = %d;",
                                MSGFW_MESSAGE_TABLE_NAME, pMsgType->mainType, MSG_SYNCML_CP, MSG_INBOX_ID);
-       }
-       else if ((pMsgType->mainType == MSG_SMS_TYPE)) // SMS
-       {
+       } else if ((pMsgType->mainType == MSG_SMS_TYPE)) { // SMS
                snprintf(sqlQuery, sizeof(sqlQuery), "SELECT COUNT(MSG_ID) FROM %s WHERE MAIN_TYPE = %d AND SUB_TYPE NOT IN (%d, %d, %d, %d) AND FOLDER_ID = %d;",
                                MSGFW_MESSAGE_TABLE_NAME, pMsgType->mainType, MSG_WAP_SI_SMS, MSG_WAP_SL_SMS, MSG_CB_SMS, MSG_SYNCML_CP, MSG_INBOX_ID); // etc SMS
-       }
-       else if ((pMsgType->mainType == MSG_MMS_TYPE) && (pMsgType->subType == MSG_SENDREQ_MMS || pMsgType->subType == MSG_SENDCONF_MMS || pMsgType->subType == MSG_RETRIEVE_AUTOCONF_MMS || pMsgType->subType == MSG_RETRIEVE_MANUALCONF_MMS || pMsgType->subType == MSG_NOTIFICATIONIND_MMS)) // MMS
-       {
+       } else if ((pMsgType->mainType == MSG_MMS_TYPE) &&
+                       (pMsgType->subType == MSG_SENDREQ_MMS || pMsgType->subType == MSG_SENDCONF_MMS || pMsgType->subType == MSG_RETRIEVE_AUTOCONF_MMS ||
+                                       pMsgType->subType == MSG_RETRIEVE_MANUALCONF_MMS || pMsgType->subType == MSG_NOTIFICATIONIND_MMS)) { // MMS
                snprintf(sqlQuery, sizeof(sqlQuery), "SELECT COUNT(MSG_ID) FROM %s WHERE MAIN_TYPE = %d AND SUB_TYPE IN (%d, %d, %d, %d, %d) AND FOLDER_ID = %d;",
                                MSGFW_MESSAGE_TABLE_NAME, pMsgType->mainType, MSG_SENDREQ_MMS, MSG_SENDCONF_MMS, MSG_RETRIEVE_AUTOCONF_MMS, MSG_RETRIEVE_MANUALCONF_MMS, MSG_NOTIFICATIONIND_MMS, folderId);
-       }
-       else
-       {
+       } else {
                return MSG_ERR_INVALID_PARAMETER;
        }
 
        if (pDbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS)
                return MSG_ERR_DB_PREPARE;
 
-       if (pDbHandle->stepQuery() == MSG_ERR_DB_ROW)
-       {
+       if (pDbHandle->stepQuery() == MSG_ERR_DB_ROW) {
                *pMsgCount = pDbHandle->columnInt(0);
-       }
-       else
-       {
+       } else {
                pDbHandle->finalizeQuery();
                return MSG_ERR_DB_STEP;
        }
@@ -288,12 +254,12 @@ MSG_ERROR_T MsgStoCountMsgByLimitCategory(MsgDbHandler *pDbHandle, const MSG_MES
 }
 
 
-int MsgStoCheckMsgCntLimit(const MSG_MESSAGE_TYPE_S* pMsgType, MSG_FOLDER_ID_T FolderId)
+int MsgStoCheckMsgCntLimit(const MSG_MESSAGE_TYPE_S* pMsgType, msg_folder_id_t folderId)
 {
        int msgboxType = -1;
        int msgType= -1;
 
-       switch (FolderId)
+       switch (folderId)
        {
                case MSG_INBOX_ID :
                        msgboxType = MSG_COUNT_LIMIT_INBOX_TYPE;
@@ -316,7 +282,7 @@ int MsgStoCheckMsgCntLimit(const MSG_MESSAGE_TYPE_S* pMsgType, MSG_FOLDER_ID_T F
                break;
 
                default:
-                       MSG_DEBUG("Unknown mailbox Type [%d]", FolderId);
+                       MSG_DEBUG("Unknown mailbox Type [%d]", folderId);
                return -1;
        }
 
@@ -368,68 +334,328 @@ int MsgStoCheckMsgCntLimit(const MSG_MESSAGE_TYPE_S* pMsgType, MSG_FOLDER_ID_T F
 }
 
 
-MSG_ERROR_T MsgStoAddAddress(MsgDbHandler *pDbHandle, const MSG_ADDRESS_INFO_S *pAddrInfo, unsigned int *pAddrId)
+msg_error_t MsgStoAddAddress(MsgDbHandler *pDbHandle, const MSG_MESSAGE_INFO_S *pMsg, msg_thread_id_t *pConvId)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        char sqlQuery[MAX_QUERY_LEN+1];
 
        // Check if new address or not
-       if (MsgExistAddress(pDbHandle, pAddrInfo->addressVal, pAddrId) == true)
-       {
-               MSG_DEBUG("The address already exists. ID : [%d], Value : [%s]", *pAddrId, pAddrInfo->addressVal);
+       if (MsgExistAddress(pDbHandle, pMsg, pConvId) == true) {
+               MSG_DEBUG("The address already exists. Conversation ID : [%d]", *pConvId);
                return err;
        }
 
-       // Get Contact Info
-       MSG_CONTACT_INFO_S contactInfo = {0};
-
-       err = MsgGetContactInfo(pAddrInfo, &contactInfo);
+       MSG_DEBUG("Conversation ID : [%d]", *pConvId);
 
-       if (err != MSG_SUCCESS)
-       {
-               MSG_DEBUG("MsgGetContactInfo() fail [%d]", err);
+       /* conversation insert */
+       err = MsgStoAddConversation(pDbHandle, pConvId);
+       if (err != MSG_SUCCESS) {
+               MSG_DEBUG("MsgStoAddConversation() fail [%d]", err);
                return err;
        }
 
-       if (pDbHandle->getRowId(MSGFW_ADDRESS_TABLE_NAME, pAddrId) != MSG_SUCCESS)
-       {
-               return err;
+       /* insert address in loop */
+       for (int i=0; i<pMsg->nAddressCnt; i++) {
+
+               unsigned int addrId;
+               MSG_CONTACT_INFO_S contactInfo = {0};
+
+               // Get Contact Info
+               err = MsgGetContactInfo(&(pMsg->addressList[i]), &contactInfo);
+
+               if (err != MSG_SUCCESS) {
+                       MSG_DEBUG("MsgGetContactInfo() fail [%d]", err);
+                       return err;
+               }
+
+               if (pDbHandle->getRowId(MSGFW_ADDRESS_TABLE_NAME, &addrId) != MSG_SUCCESS) {
+                       return err;
+               }
+
+               // Add Address
+               memset(sqlQuery, 0x00, sizeof(sqlQuery));
+               snprintf(sqlQuery, sizeof(sqlQuery), "INSERT INTO %s VALUES (%d, %d, %d, %d, '%s', %d, ?, ?, ?, '%s', 0);",
+                                       MSGFW_ADDRESS_TABLE_NAME, addrId, *pConvId, pMsg->addressList[i].addressType, pMsg->addressList[i].recipientType, pMsg->addressList[i].addressVal,
+                                       contactInfo.contactId, contactInfo.imagePath);
+
+               MSG_DEBUG("Add Address Info. [%s]", sqlQuery);
+
+               if (pDbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS)
+                       return MSG_ERR_DB_PREPARE;
+
+               pDbHandle->bindText(contactInfo.displayName, 1);
+               pDbHandle->bindText(contactInfo.firstName, 2);
+               pDbHandle->bindText(contactInfo.lastName, 3);
+
+               if (pDbHandle->stepQuery() != MSG_ERR_DB_DONE) {
+                       pDbHandle->finalizeQuery();
+                       return MSG_ERR_DB_STEP;
+               }
+
+               pDbHandle->finalizeQuery();
+
+               // set conversation display name by conv id
+               MsgStoSetConversationDisplayName(pDbHandle, *pConvId);
+
        }
 
-       // Add Address
+       return err;
+}
+
+msg_error_t MsgStoGetAddressByMsgId(MsgDbHandler *pDbHandle, msg_message_id_t msgId, int contactNameOrder, int *nAddressCnt, MSG_ADDRESS_INFO_S *pAddress)
+{
+       char sqlQuery[MAX_QUERY_LEN+1];
+       char firstName[MAX_DISPLAY_NAME_LEN+1];
+       char lastName[MAX_DISPLAY_NAME_LEN+1];
+
+       *nAddressCnt = 0;
+
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
-       snprintf(sqlQuery, sizeof(sqlQuery), "INSERT INTO %s VALUES (%d, %d, %d, '%s', %d, ?, ?, ?, '%s', 0, 0, 0, 0, 0, 0, 0, 0, '');",
-                               MSGFW_ADDRESS_TABLE_NAME, *pAddrId, pAddrInfo->addressType, pAddrInfo->recipientType, pAddrInfo->addressVal,
-                               contactInfo.contactId, contactInfo.imagePath);
+       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT A.ADDRESS_TYPE, A.RECIPIENT_TYPE, \
+                               A.CONTACT_ID, A.ADDRESS_VAL, A.DISPLAY_NAME, A.FIRST_NAME, A.LAST_NAME \
+                               FROM %s A, %s B WHERE A.CONV_ID = B.CONV_ID AND B.MSG_ID = %d;",
+                               MSGFW_ADDRESS_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME, msgId);
 
-       if (pDbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS)
+       if (pDbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS) {
+               MSG_DEBUG("Query Failed [%s]", sqlQuery);
                return MSG_ERR_DB_PREPARE;
+       }
 
-       pDbHandle->bindText(contactInfo.displayName, 1);
-       pDbHandle->bindText(contactInfo.firstName, 2);
-       pDbHandle->bindText(contactInfo.lastName, 3);
+       while (pDbHandle->stepQuery() == MSG_ERR_DB_ROW) {
+               memset(firstName, 0x00, sizeof(firstName));
+               memset(lastName, 0x00, sizeof(lastName));
 
-       if (pDbHandle->stepQuery() != MSG_ERR_DB_DONE)
-       {
-               pDbHandle->finalizeQuery();
-               MSG_DEBUG("Add Address Info. Fail [%s]", sqlQuery);
-               return MSG_ERR_DB_STEP;
+               pAddress[*nAddressCnt].addressType = pDbHandle->columnInt(0);
+               pAddress[*nAddressCnt].recipientType = pDbHandle->columnInt(1);
+               pAddress[*nAddressCnt].contactId = pDbHandle->columnInt(2);
+
+               if (pDbHandle->columnText(3) != NULL)
+                       strncpy(pAddress[*nAddressCnt].addressVal, (char *)pDbHandle->columnText(3), MAX_ADDRESS_VAL_LEN);
+
+               if (pDbHandle->columnText(4) != NULL && ((char *)pDbHandle->columnText(4))[0]!='\0') {
+                       MSG_DEBUG("displayName  : [%s]", pDbHandle->columnText(4));
+                       strncpy(pAddress[*nAddressCnt].displayName, (char *)pDbHandle->columnText(4), MAX_DISPLAY_NAME_LEN);
+               } else {
+                       if (pDbHandle->columnText(5) != NULL)
+                                       strncpy(firstName, (char *)pDbHandle->columnText(5), MAX_DISPLAY_NAME_LEN);
+
+                       if (pDbHandle->columnText(6) != NULL)
+                                       strncpy(lastName, (char *)pDbHandle->columnText(6), MAX_DISPLAY_NAME_LEN);
+
+                       if (contactNameOrder == 0) {
+                               if (strlen(firstName) > 0) {
+                                       strncpy(pAddress[*nAddressCnt].displayName, firstName, MAX_DISPLAY_NAME_LEN);
+                               }
+                               if (strlen(lastName) > 0) {
+                                       strncat(pAddress[*nAddressCnt].displayName, " ", MAX_DISPLAY_NAME_LEN-strlen(pAddress[*nAddressCnt].displayName));
+                                       strncat(pAddress[*nAddressCnt].displayName, lastName, MAX_DISPLAY_NAME_LEN-strlen(pAddress[*nAddressCnt].displayName));
+                               }
+                       } else if (contactNameOrder == 1) {
+                               if (strlen(lastName) > 0) {
+                                       strncpy(pAddress[*nAddressCnt].displayName, lastName, MAX_DISPLAY_NAME_LEN);
+                                       strncat(pAddress[*nAddressCnt].displayName, " ", MAX_DISPLAY_NAME_LEN-strlen(pAddress[*nAddressCnt].displayName));
+                               }
+
+                               if (strlen(firstName) > 0) {
+                                       strncat(pAddress[*nAddressCnt].displayName, firstName, MAX_DISPLAY_NAME_LEN-strlen(pAddress[*nAddressCnt].displayName));
+                               }
+                       }
+               }
+
+               (*nAddressCnt)++;
        }
 
        pDbHandle->finalizeQuery();
 
-       return err;
+       return MSG_SUCCESS;
+}
+
+msg_error_t MsgStoGetAddressByMsgId(MsgDbHandler *pDbHandle, msg_message_id_t msgId, int contactNameOrder, msg_struct_list_s *pAddress)
+{
+       char sqlQuery[MAX_QUERY_LEN+1];
+       char firstName[MAX_DISPLAY_NAME_LEN+1];
+       char lastName[MAX_DISPLAY_NAME_LEN+1];
+
+       pAddress->nCount = 0;
+       pAddress->nCount = NULL;
+
+       memset(sqlQuery, 0x00, sizeof(sqlQuery));
+       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT A.ADDRESS_TYPE, A.RECIPIENT_TYPE, \
+                       A.CONTACT_ID, A.ADDRESS_VAL, A.DISPLAY_NAME, A.FIRST_NAME, A.LAST_NAME \
+                       FROM %s A, %s B WHERE A.CONV_ID = B.CONV_ID AND B.MSG_ID = %d;",
+                       MSGFW_ADDRESS_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME, msgId);
+
+       if (pDbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS) {
+               MSG_DEBUG("Query Failed [%s]", sqlQuery);
+               return MSG_ERR_DB_PREPARE;
+       }
+
+       msg_struct_s *pTmp = NULL;
+       MSG_ADDRESS_INFO_S *pAddr = NULL;
+
+       pAddress->msg_struct_info = (msg_struct_t *)new char[sizeof(msg_struct_t) * MAX_TO_ADDRESS_CNT];
+
+       for (int i = 0; i < MAX_TO_ADDRESS_CNT; i++) {
+               pAddress->msg_struct_info[i] = (msg_struct_t)new char[sizeof(msg_struct_s)];
+               pTmp = (msg_struct_s *)pAddress->msg_struct_info[i];
+               pTmp->type = MSG_STRUCT_ADDRESS_INFO;
+               pTmp->data = new char[sizeof(MSG_ADDRESS_INFO_S)];
+               memset(pTmp->data, 0x00, sizeof(MSG_ADDRESS_INFO_S));
+       }
+
+
+       while (pDbHandle->stepQuery() == MSG_ERR_DB_ROW) {
+               memset(firstName, 0x00, sizeof(firstName));
+               memset(lastName, 0x00, sizeof(lastName));
+
+               pTmp = (msg_struct_s *)pAddress->msg_struct_info[pAddress->nCount];
+               pAddr = (MSG_ADDRESS_INFO_S *)pTmp->data;
+
+               pAddr->addressType = pDbHandle->columnInt(0);
+               pAddr->recipientType = pDbHandle->columnInt(1);
+               pAddr->contactId = pDbHandle->columnInt(2);
+
+               if (pDbHandle->columnText(3) != NULL)
+                                       strncpy(pAddr->addressVal, (char *)pDbHandle->columnText(3), MAX_ADDRESS_VAL_LEN);
+
+               if (pDbHandle->columnText(4) != NULL && ((char *)pDbHandle->columnText(4))[0]!='\0') {
+                                       MSG_DEBUG("displayName  : [%s]", pDbHandle->columnText(4));
+                                       strncpy(pAddr->displayName, (char *)pDbHandle->columnText(4), MAX_DISPLAY_NAME_LEN);
+               } else {
+                       if (pDbHandle->columnText(5) != NULL)
+                               strncpy(firstName, (char *)pDbHandle->columnText(5), MAX_DISPLAY_NAME_LEN);
+
+                       if (pDbHandle->columnText(6) != NULL)
+                               strncpy(lastName, (char *)pDbHandle->columnText(6), MAX_DISPLAY_NAME_LEN);
+
+                       if (contactNameOrder == 0) {
+                               if (strlen(firstName) > 0) {
+                                       strncpy(pAddr->displayName, firstName, MAX_DISPLAY_NAME_LEN);
+                               }
+
+                               if (strlen(lastName) > 0) {
+                                       strncat(pAddr->displayName, " ", MAX_DISPLAY_NAME_LEN-strlen(pAddr->displayName));
+                                       strncat(pAddr->displayName, lastName, MAX_DISPLAY_NAME_LEN-strlen(pAddr->displayName));
+                               }
+                       } else if (contactNameOrder == 1) {
+                               if (strlen(lastName) > 0) {
+                                       strncpy(pAddr->displayName, lastName, MAX_DISPLAY_NAME_LEN);
+                                       strncat(pAddr->displayName, " ", MAX_DISPLAY_NAME_LEN-strlen(pAddr->displayName));
+                               }
+
+                               if (strlen(firstName) > 0) {
+                                       strncat(pAddr->displayName, firstName, MAX_DISPLAY_NAME_LEN-strlen(pAddr->displayName));
+                               }
+                       }
+               }
+
+               pAddress->nCount++;
+       }
+
+       pDbHandle->finalizeQuery();
+
+       return MSG_SUCCESS;
+}
+
+
+msg_error_t MsgStoGetAddressByConvId(MsgDbHandler *pDbHandle, msg_thread_id_t convId, int contactNameOrder, msg_struct_list_s *pAddrlist)
+{
+       char sqlQuery[MAX_QUERY_LEN+1];
+       char firstName[MAX_DISPLAY_NAME_LEN+1];
+       char lastName[MAX_DISPLAY_NAME_LEN+1];
+       int index = 7;
+       int rowCnt = 0;
+
+       pAddrlist->nCount = 0;
+       pAddrlist->msg_struct_info = NULL;
+
+       memset(sqlQuery, 0x00, sizeof(sqlQuery));
+       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT ADDRESS_TYPE, RECIPIENT_TYPE, \
+                       CONTACT_ID, ADDRESS_VAL, DISPLAY_NAME, FIRST_NAME, LAST_NAME \
+                       FROM %s WHERE CONV_ID  = %d;",
+                       MSGFW_ADDRESS_TABLE_NAME, convId);
+
+       msg_error_t  err = pDbHandle->getTable(sqlQuery, &rowCnt);
+
+       if (err == MSG_ERR_DB_NORECORD) {
+               pDbHandle->freeTable();
+               return MSG_SUCCESS;
+       } else if (err != MSG_SUCCESS) {
+               MSG_DEBUG("sqlQuery is - %s", sqlQuery);
+               pDbHandle->freeTable();
+               return err;
+       }
+
+       pAddrlist->nCount = rowCnt;
+
+       MSG_DEBUG("pAddrlist->nCount [%d]", pAddrlist->nCount);
+
+       msg_struct_s *pTmp = NULL;
+       MSG_ADDRESS_INFO_S *pAddr = NULL;
+
+       pAddrlist->msg_struct_info = (msg_struct_t *)new char[sizeof(msg_struct_t) * MAX_TO_ADDRESS_CNT];
+
+       for (int i = 0; i < MAX_TO_ADDRESS_CNT; i++) {
+               pAddrlist->msg_struct_info[i] = (msg_struct_t)new char[sizeof(msg_struct_s)];
+               pTmp = (msg_struct_s *)pAddrlist->msg_struct_info[i];
+               pTmp->type = MSG_STRUCT_ADDRESS_INFO;
+               pTmp->data = new char[sizeof(MSG_ADDRESS_INFO_S)];
+               memset(pTmp->data, 0x00, sizeof(MSG_ADDRESS_INFO_S));
+       }
+
+       for (int i = 0; i < rowCnt; i++) {
+               pTmp = (msg_struct_s *)pAddrlist->msg_struct_info[i];
+               pAddr = (MSG_ADDRESS_INFO_S *)pTmp->data;
+
+               pAddr->addressType = pDbHandle->getColumnToInt(index++);
+               pAddr->recipientType = pDbHandle->getColumnToInt(index++);
+               pAddr->contactId = pDbHandle->getColumnToInt(index++);
+               pDbHandle->getColumnToString(index++, MAX_ADDRESS_VAL_LEN, pAddr->addressVal);
+               pDbHandle->getColumnToString(index++, MAX_DISPLAY_NAME_LEN, pAddr->displayName);
+               if(!strlen(pAddr->displayName))
+               {
+                       pDbHandle->getColumnToString(index++,MAX_DISPLAY_NAME_LEN, firstName);
+                       pDbHandle->getColumnToString(index++,MAX_DISPLAY_NAME_LEN, lastName);
+
+                       if (contactNameOrder == 0) {
+                               if (strlen(firstName) > 0) {
+                                       strncpy(pAddr->displayName, firstName, MAX_DISPLAY_NAME_LEN);
+                               }
+
+                               if (strlen(lastName) > 0) {
+                                       strncat(pAddr->displayName, " ", MAX_DISPLAY_NAME_LEN-strlen(pAddr->displayName));
+                                       strncat(pAddr->displayName, lastName, MAX_DISPLAY_NAME_LEN-strlen(pAddr->displayName));
+                               }
+                       } else if (contactNameOrder == 1) {
+                               if (strlen(lastName) > 0) {
+                                       strncpy(pAddr->displayName, lastName, MAX_DISPLAY_NAME_LEN);
+                                       strncat(pAddr->displayName, " ", MAX_DISPLAY_NAME_LEN-strlen(pAddr->displayName));
+                               }
+
+                               if (strlen(firstName) > 0) {
+                                       strncat(pAddr->displayName, firstName, MAX_DISPLAY_NAME_LEN-strlen(pAddr->displayName));
+                               }
+                       }
+               }
+
+       }
+       pDbHandle->freeTable();
+
+       return MSG_SUCCESS;
 }
 
 
-MSG_ERROR_T MsgStoUpdateAddress(MsgDbHandler *pDbHandle, unsigned int AddrId)
+/* Have to use trigger for this function. */
+msg_error_t MsgStoUpdateConversation(MsgDbHandler *pDbHandle, msg_thread_id_t convId)
 {
        MSG_BEGIN();
 
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
-       int unreadCnt = 0, smsCnt = 0, mmsCnt = 0;
+       int unreadCnt = 0;
+       int smsCnt = 0;
+       int mmsCnt = 0;
 
        char msgText[MAX_THREAD_DATA_LEN+1];
        char sqlQuery[MAX_QUERY_LEN+1];
@@ -437,23 +663,17 @@ MSG_ERROR_T MsgStoUpdateAddress(MsgDbHandler *pDbHandle, unsigned int AddrId)
        // Get Unread Count
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
-       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT COUNT(MSG_ID) FROM %s \
-                                                               WHERE ADDRESS_ID = %d \
-                                                                    AND FOLDER_ID = %d \
-                                                                    AND READ_STATUS = 0;",
-                               MSGFW_MESSAGE_TABLE_NAME, AddrId, MSG_INBOX_ID);
+       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT COUNT(MSG_ID) FROM %s WHERE CONV_ID = %d AND FOLDER_ID = %d AND READ_STATUS = 0;",
+                       MSGFW_MESSAGE_TABLE_NAME, convId, MSG_INBOX_ID);
 
        if (pDbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS)
                return MSG_ERR_DB_PREPARE;
 
        err = pDbHandle->stepQuery();
 
-       if (err == MSG_ERR_DB_ROW)
-       {
+       if (err == MSG_ERR_DB_ROW) {
                unreadCnt = pDbHandle->columnInt(0);
-       }
-       else if (err != MSG_ERR_DB_DONE)
-       {
+       } else if (err != MSG_ERR_DB_DONE) {
                pDbHandle->finalizeQuery();
                return MSG_ERR_DB_STEP;
        }
@@ -463,23 +683,18 @@ MSG_ERROR_T MsgStoUpdateAddress(MsgDbHandler *pDbHandle, unsigned int AddrId)
        // Get SMS Count
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
-       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT COUNT(MSG_ID) FROM %s \
-                                                               WHERE ADDRESS_ID = %d \
-                                                                    AND MAIN_TYPE = %d \
-                                                                    AND FOLDER_ID > 0 AND FOLDER_ID < %d;",
-                               MSGFW_MESSAGE_TABLE_NAME, AddrId, MSG_SMS_TYPE, MSG_CBMSGBOX_ID);
+       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT COUNT(MSG_ID) FROM %s WHERE CONV_ID = %d AND MAIN_TYPE = %d AND FOLDER_ID > 0 AND FOLDER_ID < %d;",
+                       MSGFW_MESSAGE_TABLE_NAME, convId, MSG_SMS_TYPE, MSG_SPAMBOX_ID);
 
        if (pDbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS)
                return MSG_ERR_DB_PREPARE;
 
        err = pDbHandle->stepQuery();
 
-       if (err == MSG_ERR_DB_ROW)
-       {
+       if (err == MSG_ERR_DB_ROW) {
                smsCnt = pDbHandle->columnInt(0);
        }
-       else if (err != MSG_ERR_DB_DONE)
-       {
+       else if (err != MSG_ERR_DB_DONE) {
                pDbHandle->finalizeQuery();
                return MSG_ERR_DB_STEP;
        }
@@ -490,24 +705,17 @@ MSG_ERROR_T MsgStoUpdateAddress(MsgDbHandler *pDbHandle, unsigned int AddrId)
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
        snprintf(sqlQuery, sizeof(sqlQuery), "SELECT COUNT(MSG_ID) FROM %s \
-                                                               WHERE ADDRESS_ID = %d \
-                                                                    AND MAIN_TYPE = %d \
-                                                                    AND SUB_TYPE NOT IN (%d, %d, %d) \
-                                                                    AND FOLDER_ID > 0 AND FOLDER_ID < %d;",
-                               MSGFW_MESSAGE_TABLE_NAME, AddrId, MSG_MMS_TYPE, MSG_DELIVERYIND_MMS,
-                               MSG_READRECIND_MMS, MSG_READORGIND_MMS, MSG_CBMSGBOX_ID);
+                       WHERE CONV_ID = %d AND MAIN_TYPE = %d AND SUB_TYPE NOT IN (%d, %d, %d) AND FOLDER_ID > 0 AND FOLDER_ID < %d;",
+                       MSGFW_MESSAGE_TABLE_NAME, convId, MSG_MMS_TYPE, MSG_DELIVERYIND_MMS, MSG_READRECIND_MMS, MSG_READORGIND_MMS, MSG_SPAMBOX_ID);
 
        if (pDbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS)
                return MSG_ERR_DB_PREPARE;
 
        err = pDbHandle->stepQuery();
 
-       if (err == MSG_ERR_DB_ROW)
-       {
+       if (err == MSG_ERR_DB_ROW) {
                mmsCnt = pDbHandle->columnInt(0);
-       }
-       else if (err != MSG_ERR_DB_DONE)
-       {
+       } else if (err != MSG_ERR_DB_DONE) {
                pDbHandle->finalizeQuery();
                return MSG_ERR_DB_STEP;
        }
@@ -517,24 +725,21 @@ MSG_ERROR_T MsgStoUpdateAddress(MsgDbHandler *pDbHandle, unsigned int AddrId)
        // Get Latest Msg Data
        MSG_MAIN_TYPE_T mainType = MSG_UNKNOWN_TYPE;
        MSG_SUB_TYPE_T subType = MSG_NORMAL_SMS;
-       MSG_DIRECTION_TYPE_T direction = MSG_DIRECTION_TYPE_MO;
+       msg_direction_type_t direction = MSG_DIRECTION_TYPE_MO;
        time_t msgTime = 0;
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
        snprintf(sqlQuery, sizeof(sqlQuery), "SELECT MAIN_TYPE, SUB_TYPE, MSG_DIRECTION, DISPLAY_TIME, SUBJECT, MSG_TEXT FROM %s \
-                                     WHERE ADDRESS_ID = %d \
-                                     AND FOLDER_ID > 0 AND FOLDER_ID < %d \
-                                     ORDER BY DISPLAY_TIME DESC;",
-                               MSGFW_MESSAGE_TABLE_NAME, AddrId, MSG_CBMSGBOX_ID);
+                       WHERE CONV_ID = %d AND FOLDER_ID > 0 AND FOLDER_ID < %d ORDER BY DISPLAY_TIME DESC;",
+                       MSGFW_MESSAGE_TABLE_NAME, convId, MSG_SPAMBOX_ID);
 
        if (pDbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS)
                return MSG_ERR_DB_PREPARE;
 
        err = pDbHandle->stepQuery();
 
-       if (err == MSG_ERR_DB_ROW)
-       {
+       if (err == MSG_ERR_DB_ROW) {
                mainType = pDbHandle->columnInt(0);
                subType = pDbHandle->columnInt(1);
                direction = pDbHandle->columnInt(2);
@@ -543,27 +748,20 @@ MSG_ERROR_T MsgStoUpdateAddress(MsgDbHandler *pDbHandle, unsigned int AddrId)
 
                memset(msgText, 0x00, sizeof(msgText));
 
-               if (mainType == MSG_SMS_TYPE)
-               {
+               if (mainType == MSG_SMS_TYPE) {
                        if (pDbHandle->columnText(5) != NULL)
                                strncpy(msgText, (char*)pDbHandle->columnText(5), MAX_THREAD_DATA_LEN);
-               }
-               else if (mainType == MSG_MMS_TYPE)
-               {
-                       if (pDbHandle->columnText(4) != NULL)
-                       {
+               } else if (mainType == MSG_MMS_TYPE) {
+                       if (pDbHandle->columnText(4) != NULL) {
                                strncpy(msgText, (char*)pDbHandle->columnText(4), MAX_THREAD_DATA_LEN);
                        }
 
-                       if ((strlen(msgText) <= 0) && (pDbHandle->columnText(5) != NULL) && (subType != MSG_NOTIFICATIONIND_MMS))
-                       {
+                       if ((strlen(msgText) <= 0) && (pDbHandle->columnText(5) != NULL) && (subType != MSG_NOTIFICATIONIND_MMS)) {
                                memset(msgText, 0x00, sizeof(msgText));
                                strncpy(msgText, (char*)pDbHandle->columnText(5), MAX_THREAD_DATA_LEN);
                        }
                }
-       }
-       else if (err != MSG_ERR_DB_DONE)
-       {
+       } else if (err != MSG_ERR_DB_DONE) {
                pDbHandle->finalizeQuery();
                return MSG_ERR_DB_STEP;
        }
@@ -573,17 +771,18 @@ MSG_ERROR_T MsgStoUpdateAddress(MsgDbHandler *pDbHandle, unsigned int AddrId)
        // Update Address Table
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
-       snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET UNREAD_CNT = %d, SMS_CNT = %d, MMS_CNT = %d, MAIN_TYPE = %d, SUB_TYPE = %d, MSG_DIRECTION = %d, MSG_TIME = %ld, MSG_TEXT = ? \
-                                     WHERE ADDRESS_ID = %d;",
-                               MSGFW_ADDRESS_TABLE_NAME, unreadCnt, smsCnt, mmsCnt, mainType, subType, direction, msgTime, AddrId);
+       snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET \
+                       UNREAD_CNT = %d, SMS_CNT = %d, MMS_CNT = %d, MAIN_TYPE = %d, SUB_TYPE = %d, MSG_DIRECTION = %d, DISPLAY_TIME = %ld, MSG_TEXT = ? \
+                       WHERE CONV_ID = %d;", MSGFW_CONVERSATION_TABLE_NAME, unreadCnt, smsCnt, mmsCnt, mainType, subType, direction, msgTime, convId);
 
-       if (pDbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS)
+       if (pDbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS) {
+               MSG_DEBUG("Query Failed [%s]", sqlQuery);
                return MSG_ERR_DB_PREPARE;
+       }
 
        pDbHandle->bindText(msgText, 1);
 
-       if (pDbHandle->stepQuery() != MSG_ERR_DB_DONE)
-       {
+       if (pDbHandle->stepQuery() != MSG_ERR_DB_DONE) {
                pDbHandle->finalizeQuery();
                MSG_DEBUG("Update Address Info. Fail [%d] [%s]", err, sqlQuery);
                return MSG_ERR_DB_STEP;
@@ -597,18 +796,23 @@ MSG_ERROR_T MsgStoUpdateAddress(MsgDbHandler *pDbHandle, unsigned int AddrId)
 }
 
 
-MSG_ERROR_T MsgStoClearAddressTable(MsgDbHandler *pDbHandle)
+/* consider to replcae this function to trigger. */
+msg_error_t MsgStoClearConversationTable(MsgDbHandler *pDbHandle)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        char sqlQuery[MAX_QUERY_LEN+1];
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
        snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s \
-                                    WHERE ADDRESS_ID NOT IN (SELECT ADDRESS_ID FROM %s) \
-                                         AND ADDRESS_ID <> 0;",
-                               MSGFW_ADDRESS_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME);
+                       WHERE CONV_ID NOT IN (SELECT CONV_ID FROM %s) AND CONV_ID <> 0;",
+                       MSGFW_CONVERSATION_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME);
+
+       err = pDbHandle->execQuery(sqlQuery);
+
+       snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE CONV_ID NOT IN (SELECT CONV_ID FROM %s);",
+                       MSGFW_ADDRESS_TABLE_NAME, MSGFW_CONVERSATION_TABLE_NAME);
 
        err = pDbHandle->execQuery(sqlQuery);
 
@@ -629,71 +833,159 @@ void MsgConvertNumber(const char* pSrcNum, char* pDestNum)
        pDestNum[i] = '\0';
 }
 
-
-bool MsgExistAddress(MsgDbHandler *pDbHandle, const char *pAddress, unsigned int *pAddrId)
+/* Change the function name to conversation related. */
+bool MsgExistAddress(MsgDbHandler *pDbHandle, const MSG_MESSAGE_INFO_S *pMsg, msg_thread_id_t *pConvId)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        char sqlQuery[MAX_QUERY_LEN+1];
 
-       *pAddrId = 0;
+       *pConvId = 0;
 
-       if (strlen(pAddress) > MAX_PRECONFIG_NUM)
-       {
-               char newPhoneNum[MAX_PRECONFIG_NUM+1];
+       if(pMsg->nAddressCnt == 1) {
+               if (strlen(pMsg->addressList[0].addressVal) > MAX_PRECONFIG_NUM) {
+                       char newPhoneNum[MAX_PRECONFIG_NUM+1];
 
-               memset(newPhoneNum, 0x00, sizeof(newPhoneNum));
+                       memset(newPhoneNum, 0x00, sizeof(newPhoneNum));
 
-               MsgConvertNumber(pAddress, newPhoneNum);
+                       MsgConvertNumber(pMsg->addressList[0].addressVal, newPhoneNum);
 
-               memset(sqlQuery, 0x00, sizeof(sqlQuery));
+                       memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
-               snprintf(sqlQuery, sizeof(sqlQuery), "SELECT ADDRESS_ID FROM %s WHERE ADDRESS_VAL LIKE '%%%%%s';",
-                                               MSGFW_ADDRESS_TABLE_NAME, newPhoneNum);
-       }
-       else
-       {
-               memset(sqlQuery, 0x00, sizeof(sqlQuery));
+                       snprintf(sqlQuery, sizeof(sqlQuery),
+                                       "SELECT CONV_ID FROM (SELECT B.CONV_ID FROM %s A, %s B WHERE A.ADDRESS_VAL LIKE '%%%%%s' AND A.CONV_ID=B.CONV_ID) GROUP BY CONV_ID HAVING COUNT(CONV_ID)=1;",
+                                       MSGFW_ADDRESS_TABLE_NAME, MSGFW_ADDRESS_TABLE_NAME, newPhoneNum);
+               } else {
+                       memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
-               snprintf(sqlQuery, sizeof(sqlQuery), "SELECT ADDRESS_ID FROM %s WHERE ADDRESS_VAL = '%s';",
-                                               MSGFW_ADDRESS_TABLE_NAME, pAddress);
-       }
+                       snprintf(sqlQuery, sizeof(sqlQuery),
+                                       "SELECT CONV_ID FROM (SELECT B.CONV_ID FROM %s A, %s B WHERE A.ADDRESS_VAL = '%s' AND A.CONV_ID=B.CONV_ID) GROUP BY CONV_ID HAVING COUNT(CONV_ID)=1;",
+                                       MSGFW_ADDRESS_TABLE_NAME, MSGFW_ADDRESS_TABLE_NAME, pMsg->addressList[0].addressVal);
+               }
 
-       int rowCnt = 0, addrId = 0;
+               int rowCnt = 0;
+               msg_thread_id_t convId = 0;
+               err = pDbHandle->getTable(sqlQuery, &rowCnt);
 
-       err = pDbHandle->getTable(sqlQuery, &rowCnt);
+               /* No record or other error */
+               if (err != MSG_SUCCESS) {
+                       MSG_DEBUG("Query Failed [%s]", sqlQuery);
+                       pDbHandle->freeTable();
+                       return false;
+               }
 
-       // No record or other error
-       if (err != MSG_SUCCESS)
-       {
-               pDbHandle->freeTable();
-               return false;
-       }
+               if(rowCnt > 0) {
+                       convId = pDbHandle->getColumnToInt(1);
 
-       addrId = pDbHandle->getColumnToInt(1);
+                       MSG_DEBUG("CONV_ID : [%d]", convId);
 
-       MSG_DEBUG("AddressId : [%d]", addrId);
+                       if (convId > 0) {
+                               *pConvId = convId;
+                               pDbHandle->freeTable();
+                               return true;
+                       } else {
+                               pDbHandle->freeTable();
+                               return false;
+                       }
 
-       if (addrId > 0)
-       {
-               *pAddrId = addrId;
+                       pDbHandle->freeTable();
+               }
 
+       } else { /* multiple address */
+               if (strlen(pMsg->addressList[0].addressVal) > MAX_PRECONFIG_NUM) {
+                       char newPhoneNum[MAX_PRECONFIG_NUM+1];
+
+                       memset(newPhoneNum, 0x00, sizeof(newPhoneNum));
+
+                       MsgConvertNumber(pMsg->addressList[0].addressVal, newPhoneNum);
+
+                       memset(sqlQuery, 0x00, sizeof(sqlQuery));
+
+                       snprintf(sqlQuery, sizeof(sqlQuery),
+                                       "SELECT CONV_ID FROM (SELECT B.CONV_ID FROM %s A, %s B WHERE A.ADDRESS_VAL LIKE '%%%%%s' AND A.CONV_ID=B.CONV_ID) GROUP BY CONV_ID HAVING COUNT(CONV_ID)=%d;",
+                                       MSGFW_ADDRESS_TABLE_NAME, MSGFW_ADDRESS_TABLE_NAME, newPhoneNum, pMsg->nAddressCnt);
+               } else {
+                       memset(sqlQuery, 0x00, sizeof(sqlQuery));
+
+                       snprintf(sqlQuery, sizeof(sqlQuery),
+                                       "SELECT CONV_ID FROM (SELECT B.CONV_ID FROM %s A, %s B WHERE A.ADDRESS_VAL = '%s' AND A.CONV_ID=B.CONV_ID) GROUP BY CONV_ID HAVING COUNT(CONV_ID)=%d;",
+                                       MSGFW_ADDRESS_TABLE_NAME, MSGFW_ADDRESS_TABLE_NAME, pMsg->addressList[0].addressVal, pMsg->nAddressCnt);
+               }
+
+               int rowCnt = 0;
+               int convId = 0;
+
+               MSG_DEBUG("Query [%s]", sqlQuery);
+
+               err = pDbHandle->getTable(sqlQuery, &rowCnt);
+
+               /* No record or other error */
+               if (err != MSG_SUCCESS) {
+                       MSG_DEBUG("Query Failed [%s]", sqlQuery);
+                       pDbHandle->freeTable();
+                       return false;
+               }
+
+               for (int i = 1; i <= rowCnt; i++) {
+                       convId = pDbHandle->getColumnToInt(i);
+
+                       memset(sqlQuery, 0x00, sizeof(sqlQuery));
+
+                       snprintf(sqlQuery, sizeof(sqlQuery),
+                                       "SELECT COUNT(*) FROM %s WHERE CONV_ID=%d AND (",
+                                       MSGFW_ADDRESS_TABLE_NAME, convId);
+
+                       for (int j = 0; j<(pMsg->nAddressCnt); j++ ) {
+
+                               if (j!=0)
+                                       strncat(sqlQuery, "OR ", MAX_QUERY_LEN-strlen(sqlQuery));
+
+                               if (strlen(pMsg->addressList[j].addressVal) > MAX_PRECONFIG_NUM) {
+
+                                       strncat(sqlQuery, "ADDRESS_VAL LIKE '%%%%", MAX_QUERY_LEN-strlen(sqlQuery));
+
+                                       char newPhoneNum[MAX_PRECONFIG_NUM+1];
+                                       memset(newPhoneNum, 0x00, sizeof(newPhoneNum));
+                                       MsgConvertNumber(pMsg->addressList[j].addressVal, newPhoneNum);
+
+                                       strncat(sqlQuery, newPhoneNum, MAX_QUERY_LEN-strlen(sqlQuery));
+
+                                       strncat(sqlQuery, "' ", MAX_QUERY_LEN-strlen(sqlQuery));
+                               } else {
+                                       strncat(sqlQuery, "ADDRESS_VAL = '", MAX_QUERY_LEN-strlen(sqlQuery));
+
+                                       strncat(sqlQuery, pMsg->addressList[j].addressVal, MAX_QUERY_LEN-strlen(sqlQuery));
+
+                                       strncat(sqlQuery, "' ", MAX_QUERY_LEN-strlen(sqlQuery));
+                               }
+                       }
+                       strncat(sqlQuery, ");", MAX_QUERY_LEN-strlen(sqlQuery));
+                       MSG_DEBUG("Query [%s]", sqlQuery);
+                       if (pDbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS) {
+                               MSG_DEBUG("Query Failed [%s]", sqlQuery);
+                               pDbHandle->freeTable();
+                               pDbHandle->finalizeQuery();
+                               return false;
+                       }
+
+                       if (pDbHandle->stepQuery() == MSG_ERR_DB_ROW) {
+                               if (pMsg->nAddressCnt == pDbHandle->columnInt(0)) {
+                                       *pConvId = convId;
+                                       pDbHandle->finalizeQuery();
+                                       pDbHandle->freeTable();
+                                       return true;
+                               }
+                       }
+                       pDbHandle->finalizeQuery();
+               }
                pDbHandle->freeTable();
-               return true;
-       }
-       else
-       {
-               pDbHandle->freeTable();
-               return false;
        }
 
-       pDbHandle->freeTable();
-
        return false;
 }
 
 
-int MsgStoGetUnreadCnt(MsgDbHandler *pDbHandle, MSG_MAIN_TYPE_T MsgType)
+int MsgStoGetUnreadCnt(MsgDbHandler *pDbHandle, MSG_MAIN_TYPE_T msgType)
 {
        int msgCnt = 0;
 
@@ -701,30 +993,22 @@ int MsgStoGetUnreadCnt(MsgDbHandler *pDbHandle, MSG_MAIN_TYPE_T MsgType)
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
-       if (MsgType == MSG_SMS_TYPE)
-       {
+       if (msgType == MSG_SMS_TYPE) {
                snprintf(sqlQuery, sizeof(sqlQuery), "SELECT COUNT(MSG_ID) FROM %s \
-                                                                       WHERE MAIN_TYPE = %d AND SUB_TYPE IN (%d, %d, %d, %d, %d, %d, %d) AND \
-                                                                       FOLDER_ID = %d AND READ_STATUS = 0;",
-                                                                       MSGFW_MESSAGE_TABLE_NAME, MSG_SMS_TYPE, MSG_NORMAL_SMS, MSG_STATUS_REPORT_SMS, MSG_CONCAT_SIM_SMS, MSG_WAP_SI_SMS, MSG_WAP_SL_SMS, MSG_MWI_VOICE_SMS, MSG_SYNCML_CP, MSG_INBOX_ID);
-       }
-       else if (MsgType == MSG_MMS_TYPE)
-       {
+                               WHERE MAIN_TYPE = %d AND SUB_TYPE IN (%d, %d, %d, %d, %d, %d, %d) AND FOLDER_ID = %d AND READ_STATUS = 0;",
+                               MSGFW_MESSAGE_TABLE_NAME, MSG_SMS_TYPE, MSG_NORMAL_SMS, MSG_STATUS_REPORT_SMS, MSG_CONCAT_SIM_SMS, MSG_WAP_SI_SMS, MSG_WAP_SL_SMS, MSG_MWI_VOICE_SMS, MSG_SYNCML_CP, MSG_INBOX_ID);
+       } else if (msgType == MSG_MMS_TYPE) {
                snprintf(sqlQuery, sizeof(sqlQuery), "SELECT COUNT(MSG_ID) FROM %s \
-                                                                       WHERE MAIN_TYPE = %d AND SUB_TYPE IN (%d, %d, %d) AND \
-                                                                       FOLDER_ID = %d AND READ_STATUS = 0;",
-                                                                       MSGFW_MESSAGE_TABLE_NAME, MSG_MMS_TYPE, MSG_RETRIEVE_AUTOCONF_MMS, MSG_RETRIEVE_MANUALCONF_MMS, MSG_NOTIFICATIONIND_MMS, MSG_INBOX_ID);
+                               WHERE MAIN_TYPE = %d AND SUB_TYPE IN (%d, %d, %d) AND FOLDER_ID = %d AND READ_STATUS = 0;",
+                               MSGFW_MESSAGE_TABLE_NAME, MSG_MMS_TYPE, MSG_RETRIEVE_AUTOCONF_MMS, MSG_RETRIEVE_MANUALCONF_MMS, MSG_NOTIFICATIONIND_MMS, MSG_INBOX_ID);
        }
 
        if (pDbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS)
                return 0;
 
-       if (pDbHandle->stepQuery() == MSG_ERR_DB_ROW)
-       {
+       if (pDbHandle->stepQuery() == MSG_ERR_DB_ROW) {
                msgCnt = pDbHandle->columnInt(0);
-       }
-       else
-       {
+       } else {
                pDbHandle->finalizeQuery();
                return 0;
        }
@@ -735,33 +1019,28 @@ int MsgStoGetUnreadCnt(MsgDbHandler *pDbHandle, MSG_MAIN_TYPE_T MsgType)
 }
 
 
-MSG_ERROR_T MsgStoAddContactInfo(MsgDbHandler *pDbHandle, MSG_CONTACT_INFO_S *pContactInfo, const char *pNumber)
+msg_error_t MsgStoAddContactInfo(MsgDbHandler *pDbHandle, MSG_CONTACT_INFO_S *pContactInfo, const char *pNumber)
 {
        char newPhoneNum[MAX_PRECONFIG_NUM+1];
        char sqlQuery[MAX_QUERY_LEN+1];
 
-       if (strlen(pNumber) > MAX_PRECONFIG_NUM)
-       {
+       if (strlen(pNumber) > MAX_PRECONFIG_NUM) {
                memset(newPhoneNum, 0x00, sizeof(newPhoneNum));
                MsgConvertNumber(pNumber, newPhoneNum);
 
                MSG_DEBUG("Phone Number to Compare : [%s]", newPhoneNum);
 
                memset(sqlQuery, 0x00, sizeof(sqlQuery));
-               snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE MSG_ADDRESS_TABLE SET CONTACT_ID = %d, DISPLAY_NAME = ?, FIRST_NAME = ?, LAST_NAME = ?, IMAGE_PATH = '%s' \
-                                                                               WHERE ADDRESS_VAL LIKE '%%%%%s';",
-                                                                       pContactInfo->contactId,
-                                                                       pContactInfo->imagePath,
-                                                                       newPhoneNum);
-       }
-       else
-       {
+               snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET \
+                               CONTACT_ID = %d, DISPLAY_NAME = ?, FIRST_NAME = ?, LAST_NAME = ?, IMAGE_PATH = '%s' \
+                               WHERE ADDRESS_VAL LIKE '%%%%%s';",
+                               MSGFW_ADDRESS_TABLE_NAME, pContactInfo->contactId, pContactInfo->imagePath, newPhoneNum);
+       } else {
                memset(sqlQuery, 0x00, sizeof(sqlQuery));
-               snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE MSG_ADDRESS_TABLE SET CONTACT_ID = %d, DISPLAY_NAME = ?, FIRST_NAME = ?, LAST_NAME = ?, IMAGE_PATH = '%s' \
-                                                                               WHERE ADDRESS_VAL = '%s';",
-                                                                       pContactInfo->contactId,
-                                                                       pContactInfo->imagePath,
-                                                                       pNumber);
+               snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET \
+                               CONTACT_ID = %d, DISPLAY_NAME = ?, FIRST_NAME = ?, LAST_NAME = ?, IMAGE_PATH = '%s' \
+                               WHERE ADDRESS_VAL = '%s';",
+                               MSGFW_ADDRESS_TABLE_NAME, pContactInfo->contactId, pContactInfo->imagePath, pNumber);
        }
 
        if (pDbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS)
@@ -773,8 +1052,7 @@ MSG_ERROR_T MsgStoAddContactInfo(MsgDbHandler *pDbHandle, MSG_CONTACT_INFO_S *pC
 
        pDbHandle->bindText(pContactInfo->lastName, 3);
 
-       if (pDbHandle->stepQuery() != MSG_ERR_DB_DONE)
-       {
+       if (pDbHandle->stepQuery() != MSG_ERR_DB_DONE) {
                pDbHandle->finalizeQuery();
                MSG_DEBUG("Update contact Info. Fail [%s]", sqlQuery);
                return MSG_ERR_DB_STEP;
@@ -786,26 +1064,48 @@ MSG_ERROR_T MsgStoAddContactInfo(MsgDbHandler *pDbHandle, MSG_CONTACT_INFO_S *pC
 }
 
 
-MSG_ERROR_T MsgStoClearContactInfo(MsgDbHandler *pDbHandle, int ContactId)
+msg_error_t MsgStoClearContactInfo(MsgDbHandler *pDbHandle, int contactId)
 {
+       msg_error_t err = MSG_SUCCESS;
+
        char sqlQuery[MAX_QUERY_LEN+1];
+       int rowCnt = 0;
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
-       snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE MSG_ADDRESS_TABLE SET CONTACT_ID = 0, DISPLAY_NAME = '', FIRST_NAME = '', LAST_NAME = '', IMAGE_PATH = '' \
-                               WHERE CONTACT_ID = %d;", ContactId);
+       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT DISTINCT(CONV_ID) FROM %s WHERE CONTACT_ID = %d;",
+                       MSGFW_ADDRESS_TABLE_NAME, contactId);
 
-       if (pDbHandle->execQuery(sqlQuery) != MSG_SUCCESS)
-       {
+       err = pDbHandle->getTable(sqlQuery, &rowCnt);
+
+       if (err != MSG_SUCCESS) {
+               pDbHandle->freeTable();
+               MSG_DEBUG("[Error]Failed to Get Table");
+               return err;
+       }
+
+       memset(sqlQuery, 0x00, sizeof(sqlQuery));
+       snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET \
+                       CONTACT_ID = 0, DISPLAY_NAME = '', FIRST_NAME = '', LAST_NAME = '', IMAGE_PATH = '' \
+                       WHERE CONTACT_ID = %d;",
+                       MSGFW_ADDRESS_TABLE_NAME, contactId);
+
+       if (pDbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
                MSG_DEBUG("Fail to execute query");
                return MSG_ERR_DB_EXEC;
        }
 
-       return MSG_SUCCESS;
+       MsgDbHandler tmpDbHandle;
+       for (int i=1; i<=rowCnt; i++)
+               MsgStoSetConversationDisplayName(&tmpDbHandle, (msg_thread_id_t)pDbHandle->getColumnToInt(i));
+
+       pDbHandle->freeTable();
+
+       return err;
 }
 
 
-MSG_ERROR_T MsgStoClearContactInfo(MsgDbHandler *pDbHandle, int ContactId, const char *pNumber)
+msg_error_t MsgStoClearContactInfo(MsgDbHandler *pDbHandle, int contactId, const char *pNumber)
 {
        char newPhoneNum[MAX_PRECONFIG_NUM+1];
        char sqlQuery[MAX_QUERY_LEN+1];
@@ -813,23 +1113,23 @@ MSG_ERROR_T MsgStoClearContactInfo(MsgDbHandler *pDbHandle, int ContactId, const
        memset(newPhoneNum, 0x00, sizeof(newPhoneNum));
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
-       if (strlen(pNumber) > MAX_PRECONFIG_NUM)
-       {
+       if (strlen(pNumber) > MAX_PRECONFIG_NUM) {
                MsgConvertNumber(pNumber, newPhoneNum);
 
                MSG_DEBUG("Phone Number to Compare : [%s]", newPhoneNum);
 
-               snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE MSG_ADDRESS_TABLE SET CONTACT_ID = 0, DISPLAY_NAME = '', FIRST_NAME = '', LAST_NAME = '', IMAGE_PATH = '' \
-                               WHERE CONTACT_ID = %d AND ADDRESS_VAL NOT LIKE '%%%s';", ContactId, newPhoneNum);
-       }
-       else
-       {
-               snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE MSG_ADDRESS_TABLE SET CONTACT_ID = 0, DISPLAY_NAME = '', FIRST_NAME = '', LAST_NAME = '', IMAGE_PATH = '' \
-                               WHERE CONTACT_ID = %d AND ADDRESS_VAL <> '%s';", ContactId, pNumber);
+               snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET \
+                               CONTACT_ID = 0, DISPLAY_NAME = '', FIRST_NAME = '', LAST_NAME = '', IMAGE_PATH = '' \
+                               WHERE CONTACT_ID = %d AND ADDRESS_VAL NOT LIKE '%%%s';",
+                               MSGFW_ADDRESS_TABLE_NAME, contactId, newPhoneNum);
+       } else {
+               snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET \
+                               CONTACT_ID = 0, DISPLAY_NAME = '', FIRST_NAME = '', LAST_NAME = '', IMAGE_PATH = '' \
+                               WHERE CONTACT_ID = %d AND ADDRESS_VAL <> '%s';",
+                               MSGFW_ADDRESS_TABLE_NAME, contactId, pNumber);
        }
 
-       if (pDbHandle->execQuery(sqlQuery) != MSG_SUCCESS)
-       {
+       if (pDbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
                MSG_DEBUG("Fail to execute query");
                return MSG_ERR_DB_EXEC;
        }
@@ -838,28 +1138,23 @@ MSG_ERROR_T MsgStoClearContactInfo(MsgDbHandler *pDbHandle, int ContactId, const
 }
 
 
-MSG_ERROR_T MsgStoGetMmsRawFilePath(MsgDbHandler *pDbHandle, MSG_MESSAGE_ID_T msgId, char *pFilePath)
+msg_error_t MsgStoGetMmsRawFilePath(MsgDbHandler *pDbHandle, msg_message_id_t msgId, char *pFilePath)
 {
        char sqlQuery[MAX_QUERY_LEN+1];
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
-       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT FILE_PATH FROM %s WHERE REFERENCE_ID IN \
-                               (SELECT REFERENCE_ID FROM %s WHERE MSG_ID = %d);",
-                               MMS_PLUGIN_MESSAGE_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME, msgId);
+       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT A.FILE_PATH FROM %s A, %s B \
+                       WHERE A.MSG_ID = B.MSG_ID AND B.MSG_ID = %d;",
+                       MMS_PLUGIN_MESSAGE_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME, msgId);
 
        if (pDbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS)
                return MSG_ERR_DB_PREPARE;
 
-       if (pDbHandle->stepQuery() == MSG_ERR_DB_ROW)
-       {
+       if (pDbHandle->stepQuery() == MSG_ERR_DB_ROW) {
                if (pDbHandle->columnText(0) != NULL)
-               {
                        strncpy(pFilePath, (char*)pDbHandle->columnText(0), MSG_FILEPATH_LEN_MAX);
-               }
-       }
-       else
-       {
+       } else {
                pDbHandle->finalizeQuery();
                return MSG_ERR_DB_STEP;
        }
@@ -870,9 +1165,9 @@ MSG_ERROR_T MsgStoGetMmsRawFilePath(MsgDbHandler *pDbHandle, MSG_MESSAGE_ID_T ms
 }
 
 
-bool MsgStoCheckReadReportRequested(MsgDbHandler *pDbHandle, MSG_MESSAGE_ID_T MsgId)
+bool MsgStoCheckReadReportRequested(MsgDbHandler *pDbHandle, msg_message_id_t msgId)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        char sqlQuery[MAX_QUERY_LEN+1];
        int rowCnt = 0;
@@ -880,21 +1175,19 @@ bool MsgStoCheckReadReportRequested(MsgDbHandler *pDbHandle, MSG_MESSAGE_ID_T Ms
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
-       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT ASK_READ_REPLY FROM %s WHERE REFERENCE_ID IN \
-                               (SELECT REFERENCE_ID FROM %s WHERE MSG_ID = %d);",
-                               MMS_PLUGIN_ATTRIBUTE_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME, MsgId);
+       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT A.ASK_READ_REPLY FROM %s A, %s B \
+                       WHERE A.MSG_ID = B.MSG_ID AND B.MSG_ID = %d;",
+                       MMS_PLUGIN_MESSAGE_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME, msgId);
 
        err = pDbHandle->getTable(sqlQuery, &rowCnt);
 
-       if (err != MSG_SUCCESS && err != MSG_ERR_DB_NORECORD)
-       {
+       if (err != MSG_SUCCESS && err != MSG_ERR_DB_NORECORD) {
                pDbHandle->freeTable();
                MSG_DEBUG("[Error]Failed to Get Table");
                return bReadReportRequested;
        }
 
-       if (rowCnt != 1)
-       {
+       if (rowCnt != 1) {
                pDbHandle->freeTable();
                MSG_DEBUG("[Error]MSG_ERR_DB_NORECORD");
                return bReadReportRequested;
@@ -908,9 +1201,9 @@ bool MsgStoCheckReadReportRequested(MsgDbHandler *pDbHandle, MSG_MESSAGE_ID_T Ms
 }
 
 
-bool MsgStoCheckReadReportIsSent(MsgDbHandler *pDbHandle, MSG_MESSAGE_ID_T MsgId)
+bool MsgStoCheckReadReportIsSent(MsgDbHandler *pDbHandle, msg_message_id_t msgId)
 {
-       MSG_ERROR_T err = MSG_SUCCESS;
+       msg_error_t err = MSG_SUCCESS;
 
        char sqlQuery[MAX_QUERY_LEN+1];
 
@@ -919,21 +1212,19 @@ bool MsgStoCheckReadReportIsSent(MsgDbHandler *pDbHandle, MSG_MESSAGE_ID_T MsgId
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
-       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT READ_REPORT_SENT FROM %s WHERE REFERENCE_ID IN \
-                               (SELECT REFERENCE_ID FROM %s WHERE MSG_ID = %d);",
-                               MMS_PLUGIN_ATTRIBUTE_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME, MsgId);
+       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT A.READ_REPORT_SENT FROM %s A, %s B \
+                       WHERE A.MSG_ID = B.MSG_ID AND B.MSG_ID = %d;",
+                       MMS_PLUGIN_MESSAGE_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME, msgId);
 
        err = pDbHandle->getTable(sqlQuery, &rowCnt);
 
-       if (err != MSG_SUCCESS && err != MSG_ERR_DB_NORECORD)
-       {
+       if (err != MSG_SUCCESS && err != MSG_ERR_DB_NORECORD) {
                pDbHandle->freeTable();
                MSG_DEBUG("[Error]Failed to Get Table");
                return bReadReportIsSent;
        }
 
-       if (rowCnt != 1)
-       {
+       if (rowCnt != 1) {
                pDbHandle->freeTable();
                MSG_DEBUG("[Error]MSG_ERR_DB_NORECORD");
                return bReadReportIsSent;
@@ -946,6 +1237,168 @@ bool MsgStoCheckReadReportIsSent(MsgDbHandler *pDbHandle, MSG_MESSAGE_ID_T MsgId
        return bReadReportIsSent;
 }
 
+
+msg_error_t MsgStoAddConversation(MsgDbHandler *pDbHandle, msg_thread_id_t *pConvId)
+{
+       char sqlQuery[MAX_QUERY_LEN+1];
+
+       if (pDbHandle->getRowId(MSGFW_CONVERSATION_TABLE_NAME, pConvId) != MSG_SUCCESS) {
+               return MSG_ERR_DB_EXEC;
+       }
+
+       // Add Conversation
+       memset(sqlQuery, 0x00, sizeof(sqlQuery));
+       snprintf(sqlQuery, sizeof(sqlQuery), "INSERT INTO %s VALUES (%d, 0, 0, 0, 0, 0, 0, 0, '', '');",
+                       MSGFW_CONVERSATION_TABLE_NAME, *pConvId);
+
+       if (pDbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
+               MSG_DEBUG("Query Failed. [%s]", sqlQuery);
+               return MSG_ERR_DB_EXEC;
+       }
+
+       return MSG_SUCCESS;
+}
+
+
+msg_error_t MsgStoSetConversationDisplayName(MsgDbHandler *pDbHandle, int contactId)
+{
+       msg_error_t err = MSG_SUCCESS;
+       int rowCnt = 0;
+       char displayName[MAX_DISPLAY_NAME_LEN+1];
+       char sqlQuery[MAX_QUERY_LEN+1];
+
+       MSG_DEBUG("contactId [%d]", contactId);
+
+       memset(sqlQuery, 0x00, sizeof(sqlQuery));
+       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT DISTINCT(CONV_ID) FROM %s WHERE CONTACT_ID = %d;",
+                       MSGFW_ADDRESS_TABLE_NAME, contactId);
+
+       err = pDbHandle->getTable(sqlQuery, &rowCnt);
+
+       if (err != MSG_SUCCESS && err != MSG_ERR_DB_NORECORD) {
+               pDbHandle->freeTable();
+               MSG_DEBUG("Query Failed [%s]", sqlQuery);
+               return err;
+       }
+
+       int order = MsgGetContactNameOrder();
+       msg_struct_s *pAddrInfo = NULL;
+       MSG_ADDRESS_INFO_S *address = NULL;
+
+       for (int i = 1; i <= rowCnt; i++)
+       {
+               memset(displayName, 0x00, sizeof(displayName));
+               MsgDbHandler tmpDbHandle;
+               msg_struct_list_s addressList = {0,};
+               MsgStoGetAddressByConvId(&tmpDbHandle, (msg_thread_id_t)pDbHandle->getColumnToInt(i), order, &addressList);
+
+               for (int j = 0; j < addressList.nCount; j++)
+               {
+                       if (j >0)
+                               strncat(displayName, ", ", MAX_DISPLAY_NAME_LEN-strlen(displayName));
+
+                       pAddrInfo = (msg_struct_s *)addressList.msg_struct_info[j];
+                       address = (MSG_ADDRESS_INFO_S *)pAddrInfo->data;
+
+                       if (address->displayName[0] == '\0')
+                               strncat(displayName, address->addressVal, MAX_DISPLAY_NAME_LEN-strlen(displayName));
+                       else
+                               strncat(displayName, address->displayName, MAX_DISPLAY_NAME_LEN-strlen(displayName));
+               }
+
+               memset(sqlQuery, 0x00, sizeof(sqlQuery));
+               snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET DISPLAY_NAME = ? WHERE CONV_ID = %d;",
+                               MSGFW_CONVERSATION_TABLE_NAME, pDbHandle->getColumnToInt(i));
+
+               if (pDbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS) {
+                       MSG_DEBUG("Query Failed [%s]", sqlQuery);
+                       return MSG_ERR_DB_PREPARE;
+               }
+
+               pDbHandle->bindText(displayName, 1);
+
+               if (pDbHandle->stepQuery() != MSG_ERR_DB_DONE) {
+                       pDbHandle->finalizeQuery();
+                       MSG_DEBUG("Update Conversation disply name. Fail [%s]", sqlQuery);
+                       return MSG_ERR_DB_STEP;
+               }
+
+               pDbHandle->finalizeQuery();
+
+               // free address list
+               for(int j = 0; j < MAX_TO_ADDRESS_CNT; j++){
+                       msg_struct_s *pStruct = (msg_struct_s *)addressList.msg_struct_info[j];
+                       delete [] (MSG_ADDRESS_INFO_S *)pStruct->data;
+                       delete [] (msg_struct_s *)pStruct;
+               }
+       }
+
+       pDbHandle->freeTable();
+
+       return err;
+}
+
+
+msg_error_t MsgStoSetConversationDisplayName(MsgDbHandler *pDbHandle, msg_thread_id_t convId)
+{
+       msg_error_t err = MSG_SUCCESS;
+
+       char displayName[MAX_DISPLAY_NAME_LEN+1];
+       char sqlQuery[MAX_QUERY_LEN+1];
+
+       msg_struct_list_s addressList = {0,};
+
+       int order = MsgGetContactNameOrder();
+       msg_struct_s *pAddrInfo = NULL;
+       MSG_ADDRESS_INFO_S *address = NULL;
+
+       memset(displayName, 0x00, sizeof(displayName));
+
+       MsgStoGetAddressByConvId(pDbHandle, convId, order, &addressList);
+
+       for (int j = 0; j < addressList.nCount; j++)
+       {
+               if (j >0)
+                       strncat(displayName, ", ", MAX_DISPLAY_NAME_LEN-strlen(displayName));
+
+               pAddrInfo = (msg_struct_s *)addressList.msg_struct_info[j];
+               address = (MSG_ADDRESS_INFO_S *)pAddrInfo->data;
+
+               if (address->displayName[0] == '\0')
+                       strncat(displayName, address->addressVal, MAX_DISPLAY_NAME_LEN-strlen(displayName));
+               else
+                       strncat(displayName, address->displayName, MAX_DISPLAY_NAME_LEN-strlen(displayName));
+       }
+
+       memset(sqlQuery, 0x00, sizeof(sqlQuery));
+       snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET DISPLAY_NAME = ? WHERE CONV_ID = %d;",
+                       MSGFW_CONVERSATION_TABLE_NAME, convId);
+
+       if (pDbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS) {
+               MSG_DEBUG("Query Failed [%s]", sqlQuery);
+               return MSG_ERR_DB_PREPARE;
+       }
+
+       pDbHandle->bindText(displayName, 1);
+
+       if (pDbHandle->stepQuery() != MSG_ERR_DB_DONE) {
+               pDbHandle->finalizeQuery();
+               MSG_DEBUG("Update Conversation disply name. Fail [%s]", sqlQuery);
+               return MSG_ERR_DB_STEP;
+       }
+
+       pDbHandle->finalizeQuery();
+
+       for(int j = 0; j < MAX_TO_ADDRESS_CNT; j++){
+               msg_struct_s *pStruct = (msg_struct_s *)addressList.msg_struct_info[j];
+               delete [] (MSG_ADDRESS_INFO_S *)pStruct->data;
+               delete [] (msg_struct_s *)pStruct;
+       }
+
+       return err;
+}
+
+
 char *MsgStoReplaceString(const char *origStr, const char *oldStr, const char *newStr)
 {
        if (origStr == NULL)
@@ -957,7 +1410,6 @@ char *MsgStoReplaceString(const char *origStr, const char *oldStr, const char *n
        int matchedCnt = 0;
        int oldStrLen = 0;
        int newStrLen = 0;
-       int replaceSize = 0;
 
        if (g_strcmp0(oldStr, newStr) != 0) {
                oldStrLen = strlen(oldStr);
diff --git a/version.sh b/version.sh
deleted file mode 100755 (executable)
index b503b14..0000000
+++ /dev/null
@@ -1 +0,0 @@
-sed -n '1p' ./debian/changelog  | cut -f2 -d "(" | cut -f1 -d ")"