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       * @brief Whether in advanced security status
121       */
122      static constexpr const char *IS_ADVANCED_SECURITY = "is_advanced_security";
123  };
124  
125  class SmsSubsection {
126  public:
127      /**
128       * @brief Id
129       */
130      static constexpr const char *ID = "id";
131      /**
132       * @brief Card slot index number
133       */
134      static constexpr const char *SLOT_ID = "slot_id";
135      /**
136       * @brief SMS subsection id
137       */
138      static constexpr const char *SMS_SUBSECTION_ID = "sms_subsection_id";
139      /**
140       * @brief Recipient number
141       */
142      static constexpr const char *RECEIVER_NUMBER = "receiver_number";
143      /**
144       * @brief Sender number
145       */
146      static constexpr const char *SENDER_NUMBER = "sender_number";
147      /**
148       * @brief Sender or not 0 - Recipient 1 - Sender
149       */
150      static constexpr const char *IS_SENDER = "is_sender";
151      /**
152       * @brief Sending start time
153       */
154      static constexpr const char *START_TIME = "start_time";
155      /**
156       * @brief Sending end time
157       */
158      static constexpr const char *END_TIME = "end_time";
159      /**
160       * @brief PDU string of the sms message
161       */
162      static constexpr const char *REW_PUD = "raw_pdu";
163      /**
164       * @brief Formatted data
165       */
166      static constexpr const char *FORMAT = "format";
167      /**
168       * @brief Destination port
169       */
170      static constexpr const char *DEST_PORT = "dest_port";
171      /**
172       * @brief Section index
173       */
174      static constexpr const char *SUBSECTION_INDEX = "subsection_index";
175      /**
176       * @brief Mms size
177       */
178      static constexpr const char *SIZE = "size";
179  };
180  
181  class MmsProtocol {
182  public:
183      /**
184       * @brief Id
185       */
186      static constexpr const char *ID = "id";
187      /**
188       * @brief Blind carbon copy
189       */
190      static constexpr const char *BCC = "bcc";
191      /**
192       * @brief Carbon copy
193       */
194      static constexpr const char *CC = "cc";
195      /**
196       * @brief Content location
197       */
198      static constexpr const char *CONTENT_LOCATION = "content_location";
199      /**
200       * @brief Date
201       */
202      static constexpr const char *DATE = "date";
203      /**
204       * @brief Delivery report
205       */
206      static constexpr const char *DELIVERY_REPORT = "delivery_report";
207      /**
208       * @brief Delivery time
209       */
210      static constexpr const char *DELIVERY_TIME = "delivery_time";
211      /**
212       * @brief Expiration
213       */
214      static constexpr const char *EXPIRY = "expiry";
215      /**
216       * @brief Mms type
217       */
218      static constexpr const char *TYPE = "type";
219      /**
220       * @brief SerialNumber
221       */
222      static constexpr const char *SERIAL_NUMBER = "serial_number";
223      /**
224       * @brief Mms category
225       */
226      static constexpr const char *CATEGORY = "category";
227      /**
228       * @brief Mms version
229       */
230      static constexpr const char *VERSION = "version";
231      /**
232       * @brief Mms size
233       */
234      static constexpr const char *SIZE = "size";
235      /**
236       * @brief Mms priority
237       */
238      static constexpr const char *PRIORITY = "priority";
239      /**
240       * @brief Request a read receipt or not
241       */
242      static constexpr const char *READ_REPLY = "read_reply";
243      /**
244       * @brief Allow delivery reports or not
245       */
246      static constexpr const char *REPORT_ALLOWED = "report_allowed";
247      /**
248       * @brief Mms response status
249       */
250      static constexpr const char *RESPONSE_STATUS = "response_status";
251      /**
252       * @brief Mms response text
253       */
254      static constexpr const char *RESPONSE_TEXT = "response_text";
255      /**
256       * @brief Sender visibility
257       */
258      static constexpr const char *SENDER_VISIBILITY = "sender_visibility";
259  };
260  
261  class MmsPart {
262  public:
263      /**
264       * @brief Id
265       */
266      static constexpr const char *ID = "id";
267      /**
268       * @brief Mms data subscript
269       */
270      static constexpr const char *PART_INDEX = "part_index";
271      /**
272       * @brief Mms size
273       */
274      static constexpr const char *PART_SIZE = "part_size";
275      /**
276       * @brief Audio/Video recording time
277       */
278      static constexpr const char *RECORDING_TIME = "recording_time";
279      /**
280       * @brief 0: theme; 1: picture; 2: video; 3: audio; 4: text; 5: business card
281       */
282      static constexpr const char *TYPE = "type";
283      /**
284       * @brief Local storage path
285       */
286      static constexpr const char *LOCATION_PATH = "location_path";
287      /**
288       * @brief Sending success status
289       */
290      static constexpr const char *STATE = "state";
291      /**
292       * @brief Encoding or not
293       */
294      static constexpr const char *ENCODE = "encode";
295      /**
296       * @brief Mms text content
297       */
298      static constexpr const char *CONTENT = "content";
299  };
300  
301  class Session {
302  public:
303      static constexpr const char *ID = "id";
304      static constexpr const char *TIME = "time";
305      static constexpr const char *TELEPHONE = "telephone";
306      static constexpr const char *CONTENT = "content";
307      static constexpr const char *CONTACTS_NUM = "contacts_num";
308      static constexpr const char *SMS_TYPE = "sms_type";
309      static constexpr const char *UNREAD_COUNT = "unread_count";
310      static constexpr const char *SENDING_STATUS = "sending_status";
311      static constexpr const char *HAS_DRAFT = "has_draft";
312      static constexpr const char *HAS_LOCK = "has_lock";
313      static constexpr const char *MESSAGE_COUNT = "message_count";
314      static constexpr const char *HAS_MMS = "has_mms";
315      static constexpr const char *HAS_ATTACHMENT = "has_attachment";
316  };
317  
318  class MmsPdu {
319  public:
320      /**
321       * @brief Mms Pdu Id
322       */
323      static constexpr const char *ID = "id";
324      /**
325       * @brief Mms Pdu Content
326       */
327      static constexpr const char *PDU_CONTENT = "pdu_content";
328  };
329  
330  constexpr const char *TABLE_SMS_MMS_INFO = "sms_mms_info";
331  constexpr const char *TABLE_SMS_SUBSECTION = "sms_subsection";
332  constexpr const char *TABLE_MMS_PROTOCOL = "mms_protocol";
333  constexpr const char *TABLE_MMS_PART = "mms_part";
334  constexpr const char *TABLE_SESSION = "session";
335  constexpr const char *TABLE_MMS_PDU = "mms_pdu";
336  constexpr const char *SMS_MMS_URI = "datashare:///com.ohos.smsmmsability";
337  } // namespace Telephony
338  } // namespace OHOS
339  #endif // DATA_STORAGE_SMS_DATA_H
340