apply tizen c coding rule
[platform/core/messaging/msg-service.git] / include / common / MsgStorageTypes.h
1 /*
2  * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
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 /**
22  *      @file           MsgStorageTypes.h
23  *      @brief          Defines transport types of messaging framework
24  *      @version        1.0
25  */
26
27
28 /**
29  *      @section                Introduction
30  *      - Introduction : Overview on Messaging Storage Types
31  *      @section                Program
32  *      - Program : Messaging Storage Types Reference
33  */
34
35 /*==================================================================================================
36                                                                                         INCLUDE FILES
37 ==================================================================================================*/
38 #include <time.h>
39
40 #include "MsgTypes.h"
41
42 #include "msg_storage_types.h"
43
44
45 /**
46  *      @ingroup                MESSAGING_FRAMEWORK
47  *      @defgroup       MESSAGING_STORAGE_TYPES Messaging Storage Types
48  *      @{
49  */
50 /*==================================================================================================
51                                                                                         STRUCTURES
52 ==================================================================================================*/
53
54 /**
55  *      @brief  Represents the count of read/unread messages.
56  */
57 typedef struct {
58         int     nReadCnt;               /**< The count of read messages */
59         int     nUnreadCnt;             /**< The count of unread messages */
60         int     nSms;                   /**< The count of sms type messages */
61         int     nMms;                   /**< The count of mms type messages */
62 } MSG_COUNT_INFO_S;
63
64
65 /**
66  *      @brief  Represents a reject message information.
67  */
68 typedef struct {
69         msg_message_id_t                msgId;                          /**< Indicates the unique message ID. */
70         char                                            msgText[MAX_MSG_TEXT_LEN+1];    /**< Indicates the message text. */
71         time_t                                  displayTime;
72 } MSG_REJECT_MSG_INFO_S;
73
74
75 /**
76  *      @brief  Represents folder information.
77  */
78 typedef struct {
79         msg_folder_id_t folderId;                       /**< Indicates the unique folder ID. */
80         char                            folderName[MAX_FOLDER_NAME_SIZE+1];     /**< Indicates the name of the folder. */
81         msg_folder_type_t       folderType;             /**< Indicates the folder type. */
82 } MSG_FOLDER_INFO_S;
83
84
85 /**
86  *      @brief  Represents contact information.
87  */
88 typedef struct {
89         msg_contact_id_t        contactId;                                                      /**< Indicates the unique contact ID. */
90         int                                             addrbookId;                                                     /**< Indicates the address book ID. */
91         char                                    firstName[MAX_DISPLAY_NAME_LEN+1];              /**< Indicates the first name of contact. */
92         char                                    lastName[MAX_DISPLAY_NAME_LEN+1];               /**< Indicates the last name of contact. */
93         char                                    middleName[MAX_DISPLAY_NAME_LEN+1];             /**< Indicates the middle name of contact. */
94         char                                    prefix[MAX_DISPLAY_NAME_LEN+1];         /**< Indicates the prefix of contact. */
95         char                                    suffix[MAX_DISPLAY_NAME_LEN+1];         /**< Indicates the suffix of contact. */
96         char                                    imagePath[MAX_IMAGE_PATH_LEN+1];                /**< Indicates the image path of contact. */
97         char                                            alerttonePath[MSG_FILEPATH_LEN_MAX+1];          /**< Indicates the message alert tone path of contact. */
98         char                                            vibrationPath[MSG_FILEPATH_LEN_MAX+1];          /**< Indicates the vibration path of contact. */
99 } MSG_CONTACT_INFO_S;
100
101
102 /**
103  *      @brief  Represents a sort rule. \n
104  *      The sort rule structure includes a sort type and a sort order. \n
105  *      Applications can use the sort rule when querying messages.
106  */
107 typedef struct {
108         msg_sort_type_t sortType;               /**< Indicates the sort type, See enum _MSG_SORT_TYPE_E */
109         bool                                    bAscending;             /**< Indicates the sort order which is ascending or descending */
110 } MSG_SORT_RULE_S;
111
112
113 /**
114  *      @brief  Represents SIM ID List.
115  */
116 typedef struct {
117         unsigned int            count;                                                                          /**< The total number of SIM Msg ID*/
118         msg_sim_id_t    simId[MAX_SEGMENT_NUM];                                         /**< The SIM Msg ID List */
119 } SMS_SIM_ID_LIST_S;
120
121
122 /**
123  *      @brief  Represents recipien list information.
124  */
125 typedef struct {
126         int                                             recipientCnt;
127         MSG_ADDRESS_INFO_S*     recipientAddr;
128 } MSG_RECIPIENTS_LIST_S;
129
130
131 /**
132  *      @brief  Represents Message list condition values.
133  */
134 typedef struct {
135         msg_folder_id_t                 folderId;
136         msg_thread_id_t                 threadId;
137         msg_storage_id_t                        storageId;
138         msg_message_type_t      msgType;
139         bool                                                            bProtected;
140         bool                                                            bScheduled;
141         char                                                            *pAddressVal;
142         char                                                            *pTextVal;
143         bool                                                            bAnd;
144         time_t                                                  fromTime;
145         time_t                                                  toTime;
146         int                                                             offset;
147         int                                                             limit;
148         msg_struct_t                                    sortRule;
149         int                                                     simIndex;
150 } MSG_LIST_CONDITION_S;
151
152
153 typedef struct {
154         int appcode;
155         char appid[MAX_WAPPUSH_ID_LEN];
156 } PUSH_APPLICATION_INFO_S;
157
158 #endif /* MSG_STORAGE_TYPES_H */
159