Modify flora license version.
[platform/core/messaging/msg-service.git] / include / mapi / msg_storage_types.h
1 /*
2 * Copyright 2012-2013  Samsung Electronics Co., Ltd
3 *
4 * Licensed under the Flora License, Version 1.1 (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 #ifndef MSG_STORAGE_TYPES_H_
18 #define MSG_STORAGE_TYPES_H_
19
20 /*==================================================================================================
21                                          INCLUDE FILES
22 ==================================================================================================*/
23
24 #include "msg_types.h"
25
26 /*==================================================================================================
27                                          STRUCTURES
28 ==================================================================================================*/
29
30 /**
31  *      @brief  Represents message id list.
32  */
33 typedef struct
34 {
35         int                                     nCount;                         /**< The count of message id informatioin */
36         msg_message_id_t        *msgIdList;                     /**< The pointer to message id informatioin */
37 }msg_id_list_s;
38
39
40 /*==================================================================================================
41                                          TYPES
42 ==================================================================================================*/
43
44 /**
45  *      @brief  Represents a folder type. \n
46  *      The values for this type SHOULD be in _MSG_FOLDER_TYPE_E.
47  */
48 typedef unsigned char msg_folder_type_t;
49
50
51 /**
52  *      @brief  Represents a sort type. \n
53  *      The values for this type SHOULD be in \ref _MSG_SORT_TYPE_E.
54  */
55 typedef unsigned char msg_sort_type_t;
56
57
58 /**
59  *      @brief  Represents a Saved SIM message ID.
60  */
61 typedef signed short msg_sim_id_t;
62
63
64 /**
65  *      @brief  Represents a message type for quick panel. \n
66  *      The values for this type SHOULD be in \ref _MSG_QUICKPANEL_TYPE_E.
67  */
68 typedef unsigned char msg_quickpanel_type_t;
69
70
71 /**
72  *      @brief  Represents a storage change CB type. \n
73  *      The values for this type SHOULD be in \ref _MSG_STORAGE_CHANGE_TYPE_E.
74  */
75 typedef unsigned char msg_storage_change_type_t;
76
77
78 /** @brief      Prototype of the function that will be called when the database of message framework is changed.
79  *      Applications SHOULD implement this callback function and register it into Message handle.
80  *      For how to register this callback function, please refer to msg_reg_storage_change_callback.
81  *      The callback function runs in the application process, not in the framework process.
82  *      @param[in]      handle is Message handle.
83  *      @param[in]      user_param is a pointer to user data.
84  *      @return void
85  */
86 typedef void (*msg_storage_change_cb)(msg_handle_t handle, msg_storage_change_type_t storageChangeType, msg_id_list_s *pMsgIdList, void *user_param);
87
88
89 /*==================================================================================================
90                                          ENUMS
91 ==================================================================================================*/
92
93 /**
94  *      @brief  Represents the values of a storage type. \n
95  *      This enum is used as the value of msg_storage_id_t.
96  */
97 enum _MSG_STORAGE_ID_E
98 {
99         MSG_STORAGE_UNKNOWN = 0,                /**< Storage Id is unknown. */
100         MSG_STORAGE_PHONE,                      /**< Storage Id is Phone. */
101         MSG_STORAGE_SIM,                                /**< Storage Id is SIM card. */
102 };
103
104
105 /**
106  *      @brief  Represents the values of a storage type. \n
107  *      This enum is used as the value of msg_folder_id_t.
108  */
109 enum _MSG_FOLDER_ID_E
110 {
111         MSG_IOSBOX_ID = -1,                     /**< Indicates INBOX, OUTBOX and SENTBOX group folder id. (Only for search option.) */
112         MSG_ALLBOX_ID = 0,                              /**< Indicates INBOX, OUTBOX, SENTBOX and DRAFTBOX group folder id. (Only for search option.) */
113         MSG_INBOX_ID = 1,
114         MSG_OUTBOX_ID = 2,
115         MSG_SENTBOX_ID = 3,
116         MSG_DRAFT_ID = 4,
117         MSG_CBMSGBOX_ID = 5,
118         MSG_SPAMBOX_ID = 6,
119         MSG_SMS_TEMPLATE_ID = 7,
120         MSG_MMS_TEMPLATE_ID = 8,
121
122         // new folder should be placed here
123
124         MSG_MAX_FOLDER_ID
125 };
126
127
128 /**
129  *      @brief  Represents the values of a folder type. \n
130  *      This enum is used as the value of msg_folder_type_t.
131  */
132 enum _MSG_FOLDER_TYPE_E
133 {
134         MSG_FOLDER_TYPE_INBOX = 1,              /**< Inbox folder */
135         MSG_FOLDER_TYPE_OUTBOX,         /**< Outbox folder */
136         MSG_FOLDER_TYPE_DRAFT,          /**< Draft folder */
137         MSG_FOLDER_TYPE_SPAMBOX,                /**< Spambox folder */
138         MSG_FOLDER_TYPE_TEMPLATE,               /**< Template folder */
139         MSG_FOLDER_TYPE_USER_DEF                /**< Folder which is created by a user */
140 };
141
142
143 /**
144  *      @brief  Represents the values of a sort type. \n
145  *      This enum is used as the value of msg_sort_type_t.
146  */
147 enum _MSG_SORT_TYPE_E
148 {
149         MSG_SORT_BY_UNKNOWN = 0,                        /**< Unknown sort type */
150         MSG_SORT_BY_DISPLAY_FROM,               /**< Sort by display from */
151         MSG_SORT_BY_DISPLAY_TO,                 /**< Sort by display to */
152         MSG_SORT_BY_DISPLAY_TIME,                       /**< Sort by display time */
153         MSG_SORT_BY_MSG_TYPE,                           /**< Sort by msg type */
154         MSG_SORT_BY_READ_STATUS,                        /**< Sort by read status */
155         MSG_SORT_BY_STORAGE_TYPE,               /**< Sort by storage type */
156         MSG_SORT_BY_THREAD_NAME,                        /**< Sort by name for thread view*/
157         MSG_SORT_BY_THREAD_DATE,                        /**< Sort by date for thread view*/
158         MSG_SORT_BY_THREAD_COUNT,               /**< Sort by count for thread view*/
159 };
160
161
162 /**
163  *      @brief  Represents the values of a message type for quick panel. \n
164  *      This enum is used as the value of msg_quickpanel_type_t.
165  */
166 enum _MSG_QUICKPANEL_TYPE_E
167 {
168         MSG_QUICKPANEL_SMS = 0,
169         MSG_QUICKPANEL_MMS,
170         MSG_QUICKPANEL_DELIVER_REP,
171         MSG_QUICKPANEL_READ_REP,
172         MSG_QUICKPANEL_VOICEMAIL,
173         MSG_QUICKPANEL_MMS_NOTI,
174 };
175
176 /**
177  *      @}
178  */
179 enum _MSG_COUNT_LIMIT_MAILBOX_TYPE_E
180 {
181         MSG_COUNT_LIMIT_INBOX_TYPE,
182         MSG_COUNT_LIMIT_OUTBOX_TYPE,
183         MSG_COUNT_LIMIT_SENTBOX_TYPE,
184         MSG_COUNT_LIMIT_DRAFTBOX_TYPE,
185         MSG_COUNT_LIMIT_CBMSGBOX_TYPE,
186         MSG_COUNT_LIMIT_MAILBOX_TYPE_MAX,
187 };
188
189 enum _MSG_COUNT_LIMIT_MSG_TYPE_E
190 {
191         MSG_COUNT_LIMIT_SMS_TYPE,
192         MSG_COUNT_LIMIT_MMS_TYPE,
193         MSG_COUNT_LIMIT_CB_TYPE,
194         MSG_COUNT_LIMIT_WAPPUSH_TYPE,
195         MSG_COUNT_LIMIT_PROVISION_TYPE,
196         MSG_COUNT_LIMIT_MSG_TYPE_MAX,
197 };
198
199 enum _MSG_STORAGE_CHANGE_TYPE_E
200 {
201         // msg data
202         MSG_STORAGE_CHANGE_INSERT = 1,
203         MSG_STORAGE_CHANGE_UPDATE,
204         MSG_STORAGE_CHANGE_DELETE,
205
206         // thread data
207         MSG_STORAGE_CHANGE_CONTACT,
208 };
209
210
211 #endif /* MSG_STORAGE_TYPES_H_ */