• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-2022 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *    http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef DATA_STORAGE_SMS_DATA_H
17 #define DATA_STORAGE_SMS_DATA_H
18 
19 namespace OHOS {
20 namespace Telephony {
21 class SmsMmsInfo {
22 public:
23     /**
24      * @brief Message id
25      */
26     static constexpr const char *MSG_ID = "msg_id";
27     /**
28      * @brief Card slot index number
29      */
30     static constexpr const char *SLOT_ID = "slot_id";
31     /**
32      * @brief Recipient number
33      */
34     static constexpr const char *RECEIVER_NUMBER = "receiver_number";
35     /**
36      * @brief Sender number
37      */
38     static constexpr const char *SENDER_NUMBER = "sender_number";
39     /**
40      * @brief Sender or not 0 - Recipient 1 - Sender
41      */
42     static constexpr const char *IS_SENDER = "is_sender";
43     /**
44      * @brief Sending start time
45      */
46     static constexpr const char *START_TIME = "start_time";
47     /**
48      * @brief Sending end time
49      */
50     static constexpr const char *END_TIME = "end_time";
51     /**
52      * @brief Message type
53      */
54     static constexpr const char *MSG_TYPE = "msg_type";
55     /**
56      * @brief SMS type 0-Common,1-Notice
57      */
58     static constexpr const char *SMS_TYPE = "sms_type";
59     /**
60      * @brief Message title
61      */
62     static constexpr const char *MSG_TITLE = "msg_title";
63     /**
64      * @brief Message content
65      */
66     static constexpr const char *MSG_CONTENT = "msg_content";
67     /**
68      * @brief Message state
69      */
70     static constexpr const char *MSG_STATE = "msg_state";
71     /**
72      * @brief Message code
73      */
74     static constexpr const char *MSG_CODE = "msg_code";
75     /**
76      * @brief Locked or not
77      */
78     static constexpr const char *IS_LOCK = "is_lock";
79     /**
80      * @brief Readed or not
81      */
82     static constexpr const char *IS_READ = "is_read";
83     /**
84      * @brief Collected or not
85      */
86     static constexpr const char *IS_COLLECT = "is_collect";
87     /**
88      * @brief Session type 0 - Common 1 - broadcast 2 - Group Sending
89      */
90     static constexpr const char *SESSION_TYPE = "session_type";
91     /**
92      * @brief Retry times
93      */
94     static constexpr const char *RETRY_NUMBER = "retry_number";
95     /**
96      * @brief Operator service number
97      */
98     static constexpr const char *OPERATOR_SERVICE_NUMBER = "operator_service_number";
99     /**
100      * @brief Session id
101      */
102     static constexpr const char *SESSION_ID = "session_id";
103     /**
104      * @brief Group id
105      */
106     static constexpr const char *GROUP_ID = "group_id";
107     /**
108      * @brief Device id
109      */
110     static constexpr const char *DEVICE_ID = "device_id";
111     /**
112      * @brief Branch 0 - NO 1 - Yes
113      */
114     static constexpr const char *IS_SUBSECTION = "is_subsection";
115     /**
116      * @brief Whether to send a report
117      */
118     static constexpr const char *IS_SEND_REPORT = "is_send_report";
119 };
120 
121 class SmsSubsection {
122 public:
123     /**
124      * @brief Id
125      */
126     static constexpr const char *ID = "id";
127     /**
128      * @brief Card slot index number
129      */
130     static constexpr const char *SLOT_ID = "slot_id";
131     /**
132      * @brief SMS subsection id
133      */
134     static constexpr const char *SMS_SUBSECTION_ID = "sms_subsection_id";
135     /**
136      * @brief Recipient number
137      */
138     static constexpr const char *RECEIVER_NUMBER = "receiver_number";
139     /**
140      * @brief Sender number
141      */
142     static constexpr const char *SENDER_NUMBER = "sender_number";
143     /**
144      * @brief Sender or not 0 - Recipient 1 - Sender
145      */
146     static constexpr const char *IS_SENDER = "is_sender";
147     /**
148      * @brief Sending start time
149      */
150     static constexpr const char *START_TIME = "start_time";
151     /**
152      * @brief Sending end time
153      */
154     static constexpr const char *END_TIME = "end_time";
155     /**
156      * @brief PDU string of the sms message
157      */
158     static constexpr const char *REW_PUD = "raw_pdu";
159     /**
160      * @brief Formatted data
161      */
162     static constexpr const char *FORMAT = "format";
163     /**
164      * @brief Destination port
165      */
166     static constexpr const char *DEST_PORT = "dest_port";
167     /**
168      * @brief Section index
169      */
170     static constexpr const char *SUBSECTION_INDEX = "subsection_index";
171     /**
172      * @brief Mms size
173      */
174     static constexpr const char *SIZE = "size";
175 };
176 
177 class MmsProtocol {
178 public:
179     /**
180      * @brief Id
181      */
182     static constexpr const char *ID = "id";
183     /**
184      * @brief Blind carbon copy
185      */
186     static constexpr const char *BCC = "bcc";
187     /**
188      * @brief Carbon copy
189      */
190     static constexpr const char *CC = "cc";
191     /**
192      * @brief Content location
193      */
194     static constexpr const char *CONTENT_LOCATION = "content_location";
195     /**
196      * @brief Date
197      */
198     static constexpr const char *DATE = "date";
199     /**
200      * @brief Delivery report
201      */
202     static constexpr const char *DELIVERY_REPORT = "delivery_report";
203     /**
204      * @brief Delivery time
205      */
206     static constexpr const char *DELIVERY_TIME = "delivery_time";
207     /**
208      * @brief Expiration
209      */
210     static constexpr const char *EXPIRY = "expiry";
211     /**
212      * @brief Mms type
213      */
214     static constexpr const char *TYPE = "type";
215     /**
216      * @brief SerialNumber
217      */
218     static constexpr const char *SERIAL_NUMBER = "serial_number";
219     /**
220      * @brief Mms category
221      */
222     static constexpr const char *CATEGORY = "category";
223     /**
224      * @brief Mms version
225      */
226     static constexpr const char *VERSION = "version";
227     /**
228      * @brief Mms size
229      */
230     static constexpr const char *SIZE = "size";
231     /**
232      * @brief Mms priority
233      */
234     static constexpr const char *PRIORITY = "priority";
235     /**
236      * @brief Request a read receipt or not
237      */
238     static constexpr const char *READ_REPLY = "read_reply";
239     /**
240      * @brief Allow delivery reports or not
241      */
242     static constexpr const char *REPORT_ALLOWED = "report_allowed";
243     /**
244      * @brief Mms response status
245      */
246     static constexpr const char *RESPONSE_STATUS = "response_status";
247     /**
248      * @brief Mms response text
249      */
250     static constexpr const char *RESPONSE_TEXT = "response_text";
251     /**
252      * @brief Sender visibility
253      */
254     static constexpr const char *SENDER_VISIBILITY = "sender_visibility";
255 };
256 
257 class MmsPart {
258 public:
259     /**
260      * @brief Id
261      */
262     static constexpr const char *ID = "id";
263     /**
264      * @brief Mms data subscript
265      */
266     static constexpr const char *PART_INDEX = "part_index";
267     /**
268      * @brief Mms size
269      */
270     static constexpr const char *PART_SIZE = "part_size";
271     /**
272      * @brief Audio/Video recording time
273      */
274     static constexpr const char *RECORDING_TIME = "recording_time";
275     /**
276      * @brief 0: theme; 1: picture; 2: video; 3: audio; 4: text; 5: business card
277      */
278     static constexpr const char *TYPE = "type";
279     /**
280      * @brief Local storage path
281      */
282     static constexpr const char *LOCATION_PATH = "location_path";
283     /**
284      * @brief Sending success status
285      */
286     static constexpr const char *STATE = "state";
287     /**
288      * @brief Encoding or not
289      */
290     static constexpr const char *ENCODE = "encode";
291     /**
292      * @brief Mms text content
293      */
294     static constexpr const char *CONTENT = "content";
295 };
296 
297 class Session {
298 public:
299     static constexpr const char *ID = "id";
300     static constexpr const char *TIME = "time";
301     static constexpr const char *TELEPHONE = "telephone";
302     static constexpr const char *CONTENT = "content";
303     static constexpr const char *CONTACTS_NUM = "contacts_num";
304     static constexpr const char *SMS_TYPE = "sms_type";
305     static constexpr const char *UNREAD_COUNT = "unread_count";
306     static constexpr const char *SENDING_STATUS = "sending_status";
307     static constexpr const char *HAS_DRAFT = "has_draft";
308     static constexpr const char *HAS_LOCK = "has_lock";
309     static constexpr const char *MESSAGE_COUNT = "message_count";
310     static constexpr const char *HAS_MMS = "has_mms";
311     static constexpr const char *HAS_ATTACHMENT = "has_attachment";
312 };
313 
314 class MmsPdu {
315 public:
316     /**
317      * @brief Mms Pdu Id
318      */
319     static constexpr const char *ID = "id";
320     /**
321      * @brief Mms Pdu Content
322      */
323     static constexpr const char *PDU_CONTENT = "pdu_content";
324 };
325 
326 constexpr const char *TABLE_SMS_MMS_INFO = "sms_mms_info";
327 constexpr const char *TABLE_SMS_SUBSECTION = "sms_subsection";
328 constexpr const char *TABLE_MMS_PROTOCOL = "mms_protocol";
329 constexpr const char *TABLE_MMS_PART = "mms_part";
330 constexpr const char *TABLE_SESSION = "session";
331 constexpr const char *TABLE_MMS_PDU = "mms_pdu";
332 constexpr const char *SMS_MMS_URI = "datashare:///com.ohos.smsmmsability";
333 } // namespace Telephony
334 } // namespace OHOS
335 #endif // DATA_STORAGE_SMS_DATA_H
336