Delete draft messages before saving draft message
[apps/home/message-app.git] / composer / include / msg-ui-composer-message.h
1 /*
2  * Copyright 2012  Samsung Electronics Co., Ltd
3  *
4  * Licensed under the Flora License, Version 1.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *    http://floralicense.org/license
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17
18 #ifndef __MSG_UI_COMPOSER_MSG_H_
19 #define __MSG_UI_COMPOSER_MSG_H_
20
21 #include "msg-ui-composer-data.h"
22
23
24 /******************************
25  * structures
26  *******************************/
27
28 typedef struct _COMPOSER_SMIL_REGION_S_ {
29         char szID[MAX_SMIL_REGION_ID + 1];
30         int left;
31         int top;
32         int width;
33         int height;
34         int bgcolor;
35 } MSG_COMP_REGION_S;
36
37 enum __COMPOSER_CONFIG_TYPE_E {
38         COMPOSER_CONFIG_TYPE_GENERAL = MSG_GENERAL_OPT,
39         COMPOSER_CONFIG_TYPE_SMS_SEND = MSG_SMS_SENDOPT,
40         COMPOSER_CONFIG_TYPE_SMSC_LIST = MSG_SMSC_LIST,
41         COMPOSER_CONFIG_TYPE_MMS_SEND = MSG_MMS_SENDOPT,
42         COMPOSER_CONFIG_TYPE_MMS_RECIEVE = MSG_MMS_RECVOPT,
43         COMPOSER_CONFIG_TYPE_MMS_CLASS = MSG_MMS_CLASSOPT,
44         COMPOSER_CONFIG_TYPE_MMS_STYLE = MSG_MMS_STYLEOPT,
45         COMPOSER_CONFIG_TYPE_PUSHMSG = MSG_PUSHMSG_OPT,
46         COMPOSER_CONFIG_TYPE_CBMSG = MSG_CBMSG_OPT,
47         COMPOSER_CONFIG_TYPE_VOICEMAIL = MSG_VOICEMAIL_OPT,
48         COMPOSER_CONFIG_TYPE_MMS_SIZE = MSG_MSGSIZE_OPT,
49 };
50
51 enum __COMPOSER_CREATION_MODE_E {
52         COMPOSER_CREATIONMODE_RESTRICTED = MSG_CREATION_MODE_RESTRICTED,
53         COMPOSER_CREATIONMODE_WARNING = MSG_CREATION_MODE_WARNING,
54         COMPOSER_CREATIONMODE_FREE = MSG_CREATION_MODE_FREE,
55 };
56
57 /*****************************
58  *      structures
59  ***************************/
60 COMPOSER_RETURN_TYPE_E msg_ui_composer_message_init();
61 COMPOSER_RETURN_TYPE_E msg_ui_composer_message_destroy();
62 COMPOSER_RETURN_TYPE_E msg_ui_composer_create_new_message();
63 COMPOSER_RETURN_TYPE_E msg_ui_composer_release_message();
64
65 /* Msg type*/
66 COMPOSER_RETURN_TYPE_E msg_ui_composer_message_set_msg_type(COMPOSER_MSG_TYPE_E msg_type);
67
68 /* Recipient*/
69 COMPOSER_RETURN_TYPE_E msg_ui_composer_message_add_address(char *number);
70 GSList *msg_ui_composer_message_get_address();
71
72 /* SMS*/
73 COMPOSER_RETURN_TYPE_E msg_ui_composer_message_set_sms_body(char *body_text);
74
75 /* MMS - attachment*/
76 COMPOSER_RETURN_TYPE_E msg_ui_composer_message_add_attachments(const char *filepath, int filetype);
77 COMPOSER_RETURN_TYPE_E msg_ui_composer_message_set_attach_count(int attach_count);
78
79 /* MMS - subject*/
80 COMPOSER_RETURN_TYPE_E msg_ui_composer_message_set_subject(char *subject, int length);
81
82 /* MMS - body*/
83 COMPOSER_RETURN_TYPE_E msg_ui_composer_message_set_page_count(int page_count);
84 COMPOSER_RETURN_TYPE_E msg_ui_composer_message_set_is_text_top(bool isTextTop);
85 COMPOSER_RETURN_TYPE_E msg_ui_composer_message_mms_set_text(const char *text, int nPage);
86 COMPOSER_RETURN_TYPE_E msg_ui_composer_message_mms_set_media(const char *file_path, COMPOSER_MEDIA_TYPE_E media_type, int nPage);
87 COMPOSER_RETURN_TYPE_E msg_ui_composer_message_mms_set_page_duration(int nPage, int duration);
88
89 /* save send*/
90 COMPOSER_RETURN_TYPE_E msg_ui_composer_get_thread_id_by_address(msg_handle_t msg_handle, GSList *addr_list, msg_thread_id_t *tid);
91 COMPOSER_RETURN_TYPE_E msg_ui_composer_delete_draft_message(msg_handle_t msg_handle, msg_thread_id_t tid);
92 COMPOSER_RETURN_TYPE_E msg_ui_composer_save_message(msg_handle_t msg_handle, int msg_id);
93 COMPOSER_RETURN_TYPE_E msg_ui_composer_get_message_data(MSG_COMPOSER_VIEW_DATA_S *cd);
94
95 COMPOSER_RETURN_TYPE_E msg_ui_composer_message_make_and_send(msg_handle_t msg_handle, int msg_id, msg_thread_id_t *tid);
96
97 msg_struct_t msg_ui_composer_message_make_preview(msg_handle_t msg_handle);
98 COMPOSER_RETURN_TYPE_E msg_ui_composer_message_set_loaded_data(void *composer_data, bool set_recipient);
99 COMPOSER_RETURN_TYPE_E msg_ui_composer_message_set_page_data(void *composer_data, int page);
100 COMPOSER_RETURN_TYPE_E msg_ui_composer_message_load_message(msg_handle_t msg_handle, int msgID);
101
102 #endif /*__MSG_UI_COMPOSER_MSG_H_*/