1/* 2 * Copyright (C) 2021-2023 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 16import {AsyncCallback} from "./basic"; 17 18/** 19 * Provides the capabilities and methods for obtaining Short Message Service (SMS) management objects. 20 * 21 * @namespace sms 22 * @syscap SystemCapability.Telephony.SmsMms 23 * @since 6 24 */ 25declare namespace sms { 26 /** 27 * Splits a long SMS message into multiple fragments. 28 * 29 * <p>If the length of an SMS message exceeds the maximum length allowed (140 bytes), 30 * the SMS message is split into multiple segments for processing. 31 * 32 * @permission ohos.permission.SEND_MESSAGES 33 * @param { string } content - Indicates the short message content, which cannot be {@code null}. 34 * @param { AsyncCallback<Array<string>> } callback - Indicates the callback for getting a list of split segments, 35 * which can be combined into a complete SMS message; 36 * returns an empty string if no permission is granted or the short message content is {@code null}. 37 * @throws { BusinessError } 201 - Permission denied. 38 * @throws { BusinessError } 202 - Non-system applications use system APIs. 39 * @throws { BusinessError } 401 - Parameter error. 40 * @throws { BusinessError } 8300001 - Invalid parameter value. 41 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 42 * @throws { BusinessError } 8300003 - System internal error. 43 * @throws { BusinessError } 8300999 - Unknown error code. 44 * @syscap SystemCapability.Telephony.SmsMms 45 * @systemapi Hide this for inner system use. 46 * @since 8 47 */ 48 function splitMessage(content: string, callback: AsyncCallback<Array<string>>): void; 49 50 /** 51 * Splits a long SMS message into multiple fragments. 52 * 53 * <p>If the length of an SMS message exceeds the maximum length allowed (140 bytes), 54 * the SMS message is split into multiple segments for processing. 55 * 56 * @permission ohos.permission.SEND_MESSAGES 57 * @param { string } content - Indicates the short message content, which cannot be {@code null}. 58 * @returns { Promise<Array<string>> } Returns a list of split segments, which can be combined into a complete SMS 59 * message; returns an empty string if no permission is granted or the short message content is {@code null}. 60 * @throws { BusinessError } 201 - Permission denied. 61 * @throws { BusinessError } 202 - Non-system applications use system APIs. 62 * @throws { BusinessError } 401 - Parameter error. 63 * @throws { BusinessError } 8300001 - Invalid parameter value. 64 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 65 * @throws { BusinessError } 8300003 - System internal error. 66 * @throws { BusinessError } 8300999 - Unknown error code. 67 * @syscap SystemCapability.Telephony.SmsMms 68 * @systemapi Hide this for inner system use. 69 * @since 8 70 */ 71 function splitMessage(content: string): Promise<Array<string>>; 72 73 /** 74 * Creates an SMS message instance based on the protocol data unit (PDU) and the specified SMS protocol. 75 * 76 * <p>After receiving the original PDU data, the system creates an SMS message instance according to the specified 77 * SMS protocol. 78 * 79 * @param { Array<number> } pdu - Indicates the original data, which is obtained from the received SMS. 80 * @param { string } specification - Indicates the SMS protocol type. The value {@code 3gpp} indicates GSM/UMTS/LTE 81 * SMS, and the value {@code 3gpp2} indicates CDMA/LTE SMS. 82 * @param { AsyncCallback<ShortMessage> } callback - Indicates the callback for getting an SMS message instance; 83 * returns {@code null} if {@code pdu} is empty or {@code specification} is not supported. 84 * @throws { BusinessError } 401 - Parameter error. 85 * @throws { BusinessError } 8300001 - Invalid parameter value. 86 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 87 * @throws { BusinessError } 8300003 - System internal error. 88 * @throws { BusinessError } 8300999 - Unknown error code. 89 * @syscap SystemCapability.Telephony.SmsMms 90 * @since 6 91 */ 92 function createMessage(pdu: Array<number>, specification: string, callback: AsyncCallback<ShortMessage>): void; 93 94 /** 95 * Creates an SMS message instance based on the protocol data unit (PDU) and the specified SMS protocol. 96 * 97 * <p>After receiving the original PDU data, the system creates an SMS message instance according to the specified 98 * SMS protocol. 99 * 100 * @param { Array<number> } pdu - Indicates the original data, which is obtained from the received SMS. 101 * @param { string } specification - Indicates the SMS protocol type. The value {@code 3gpp} indicates GSM/UMTS/LTE 102 * SMS, and the value {@code 3gpp2} indicates CDMA/LTE SMS. 103 * @returns { Promise<ShortMessage> } Returns an SMS message instance; 104 * returns {@code null} if {@code pdu} is empty or {@code specification} is not supported. 105 * @throws { BusinessError } 401 - Parameter error. 106 * @throws { BusinessError } 8300001 - Invalid parameter value. 107 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 108 * @throws { BusinessError } 8300003 - System internal error. 109 * @throws { BusinessError } 8300999 - Unknown error code. 110 * @syscap SystemCapability.Telephony.SmsMms 111 * @since 6 112 */ 113 function createMessage(pdu: Array<number>, specification: string): Promise<ShortMessage>; 114 115 /** 116 * Sends a text or data SMS message. 117 * 118 * <p>This method checks whether the length of an SMS message exceeds the maximum length. If the 119 * maximum length is exceeded, the SMS message is split into multiple parts and sent separately. 120 * 121 * @permission ohos.permission.SEND_MESSAGES 122 * @param { SendMessageOptions } options - Indicates the parameters and callback for sending the SMS message. 123 * @throws { BusinessError } 201 - Permission denied. 124 * @throws { BusinessError } 401 - Parameter error. 125 * @throws { BusinessError } 8300001 - Invalid parameter value. 126 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 127 * @throws { BusinessError } 8300003 - System internal error. 128 * @throws { BusinessError } 8300999 - Unknown error code. 129 * @syscap SystemCapability.Telephony.SmsMms 130 * @since 6 131 * @deprecated since 10 132 * @useinstead telephony.sms#sendShortMessage 133 */ 134 function sendMessage(options: SendMessageOptions): void; 135 136 /** 137 * Sends a text or data SMS message. 138 * 139 * <p>This method checks whether the length of an SMS message exceeds the maximum length. If the 140 * maximum length is exceeded, the SMS message is split into multiple parts and sent separately. 141 * 142 * @permission ohos.permission.SEND_MESSAGES 143 * @param { SendMessageOptions } options - Indicates the parameters and callback for sending the SMS message. 144 * @param { AsyncCallback<void> } callback - The callback of sendShortMessage. 145 * @throws { BusinessError } 201 - Permission denied. 146 * @throws { BusinessError } 401 - Parameter error. 147 * @throws { BusinessError } 8300001 - Invalid parameter value. 148 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 149 * @throws { BusinessError } 8300003 - System internal error. 150 * @throws { BusinessError } 8300999 - Unknown error code. 151 * @syscap SystemCapability.Telephony.SmsMms 152 * @since 10 153 */ 154 function sendShortMessage(options: SendMessageOptions, callback: AsyncCallback<void>): void; 155 156 /** 157 * Sends a text or data SMS message. 158 * 159 * <p>This method checks whether the length of an SMS message exceeds the maximum length. If the 160 * maximum length is exceeded, the SMS message is split into multiple parts and sent separately. 161 * 162 * @permission ohos.permission.SEND_MESSAGES 163 * @param { SendMessageOptions } options - Indicates the parameters and callback for sending the SMS message. 164 * @returns { Promise<void> } The promise returned by the sendShortMessage. 165 * @throws { BusinessError } 201 - Permission denied. 166 * @throws { BusinessError } 401 - Parameter error. 167 * @throws { BusinessError } 8300001 - Invalid parameter value. 168 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 169 * @throws { BusinessError } 8300003 - System internal error. 170 * @throws { BusinessError } 8300999 - Unknown error code. 171 * @syscap SystemCapability.Telephony.SmsMms 172 * @since 10 173 */ 174 function sendShortMessage(options: SendMessageOptions): Promise<void>; 175 176 /** 177 * Sets the default SIM card for sending SMS messages. You can obtain the default SIM card by 178 * using {@code getDefaultSmsSlotId}. 179 * 180 * @permission ohos.permission.SET_TELEPHONY_STATE 181 * @param { number } slotId - Indicates the default SIM card for sending SMS messages. The value {@code 0} indicates 182 * card slot 1, and the value {@code 1} indicates card slot 2. 183 * @param { AsyncCallback<void> } callback - The callback of setDefaultSmsSlotId. 184 * @throws { BusinessError } 201 - Permission denied. 185 * @throws { BusinessError } 202 - Non-system applications use system APIs. 186 * @throws { BusinessError } 401 - Parameter error. 187 * @throws { BusinessError } 8300001 - Invalid parameter value. 188 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 189 * @throws { BusinessError } 8300003 - System internal error. 190 * @throws { BusinessError } 8300004 - Do not have sim card. 191 * @throws { BusinessError } 8300999 - Unknown error code. 192 * @syscap SystemCapability.Telephony.SmsMms 193 * @systemapi Hide this for inner system use. 194 * @since 7 195 */ 196 function setDefaultSmsSlotId(slotId: number, callback: AsyncCallback<void>): void; 197 198 /** 199 * Sets the default SIM card for sending SMS messages. You can obtain the default SIM card by 200 * using {@code getDefaultSmsSlotId}. 201 * 202 * @permission ohos.permission.SET_TELEPHONY_STATE 203 * @param { number } slotId - Indicates the default SIM card for sending SMS messages. The value {@code 0} indicates 204 * card slot 1, and the value {@code 1} indicates card slot 2. 205 * @returns { Promise<void> } The promise returned by the setDefaultSmsSlotId. 206 * @throws { BusinessError } 201 - Permission denied. 207 * @throws { BusinessError } 202 - Non-system applications use system APIs. 208 * @throws { BusinessError } 401 - Parameter error. 209 * @throws { BusinessError } 8300001 - Invalid parameter value. 210 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 211 * @throws { BusinessError } 8300003 - System internal error. 212 * @throws { BusinessError } 8300004 - Do not have sim card. 213 * @throws { BusinessError } 8300999 - Unknown error code. 214 * @syscap SystemCapability.Telephony.SmsMms 215 * @systemapi Hide this for inner system use. 216 * @since 7 217 */ 218 function setDefaultSmsSlotId(slotId: number): Promise<void>; 219 220 /** 221 * Obtains the default SIM card for sending SMS messages. 222 * 223 * @param { AsyncCallback<number> } callback - Indicates the callback for getting the default SIM card for sending SMS 224 * messages. 225 * Returns {@code 0} if the default SIM card for sending SMS messages is in card slot 1; 226 * returns {@code 1} if the default SIM card for sending SMS messages is in card slot 2. 227 * @syscap SystemCapability.Telephony.SmsMms 228 * @since 7 229 */ 230 function getDefaultSmsSlotId(callback: AsyncCallback<number>): void; 231 232 /** 233 * Obtains the default SIM card for sending SMS messages. 234 * 235 * @returns { Promise<number> } Returns {@code 0} if the default SIM card for sending SMS messages is in card slot 1; 236 * returns {@code 1} if the default SIM card for sending SMS messages is in card slot 2. 237 * @syscap SystemCapability.Telephony.SmsMms 238 * @since 7 239 */ 240 function getDefaultSmsSlotId(): Promise<number>; 241 242 /** 243 * Sets the address for the Short Message Service Center (SMSC) based on a specified slot ID. 244 * 245 * @permission ohos.permission.SET_TELEPHONY_STATE 246 * @param { number } slotId - Indicates the ID of the slot holding the SIM card for sending SMS messages. 247 * @param { string } smscAddr - Indicates the SMSC address. 248 * @param { AsyncCallback<void> } callback - The callback of setSmscAddr. 249 * @throws { BusinessError } 201 - Permission denied. 250 * @throws { BusinessError } 202 - Non-system applications use system APIs. 251 * @throws { BusinessError } 401 - Parameter error. 252 * @throws { BusinessError } 8300001 - Invalid parameter value. 253 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 254 * @throws { BusinessError } 8300003 - System internal error. 255 * @throws { BusinessError } 8300999 - Unknown error code. 256 * @syscap SystemCapability.Telephony.SmsMms 257 * @systemapi Hide this for inner system use. 258 * @since 7 259 */ 260 function setSmscAddr(slotId: number, smscAddr: string, callback: AsyncCallback<void>): void; 261 262 /** 263 * Sets the address for the Short Message Service Center (SMSC) based on a specified slot ID. 264 * 265 * @permission ohos.permission.SET_TELEPHONY_STATE 266 * @param { number } slotId - Indicates the ID of the slot holding the SIM card for sending SMS messages. 267 * @param { string } smscAddr - Indicates the SMSC address. 268 * @returns { Promise<void> } The promise returned by the setSmscAddr. 269 * @throws { BusinessError } 201 - Permission denied. 270 * @throws { BusinessError } 202 - Non-system applications use system APIs. 271 * @throws { BusinessError } 401 - Parameter error. 272 * @throws { BusinessError } 8300001 - Invalid parameter value. 273 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 274 * @throws { BusinessError } 8300003 - System internal error. 275 * @throws { BusinessError } 8300999 - Unknown error code. 276 * @syscap SystemCapability.Telephony.SmsMms 277 * @systemapi Hide this for inner system use. 278 * @since 7 279 */ 280 function setSmscAddr(slotId: number, smscAddr: string): Promise<void>; 281 282 /** 283 * Obtains the SMSC address based on a specified slot ID. 284 * 285 * @permission ohos.permission.GET_TELEPHONY_STATE 286 * @param { number } slotId - Indicates the ID of the slot holding the SIM card for sending SMS messages. 287 * @param { AsyncCallback<string> } callback - Indicates the callback for getting the SMSC address. 288 * @throws { BusinessError } 201 - Permission denied. 289 * @throws { BusinessError } 202 - Non-system applications use system APIs. 290 * @throws { BusinessError } 401 - Parameter error. 291 * @throws { BusinessError } 8300001 - Invalid parameter value. 292 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 293 * @throws { BusinessError } 8300003 - System internal error. 294 * @throws { BusinessError } 8300999 - Unknown error code. 295 * @syscap SystemCapability.Telephony.SmsMms 296 * @systemapi Hide this for inner system use. 297 * @since 7 298 */ 299 function getSmscAddr(slotId: number, callback: AsyncCallback<string>): void; 300 301 /** 302 * Obtains the SMSC address based on a specified slot ID. 303 * 304 * @permission ohos.permission.GET_TELEPHONY_STATE 305 * @param { number } slotId - Indicates the ID of the slot holding the SIM card for sending SMS messages. 306 * @returns { Promise<string> } Returns the SMSC address. 307 * @throws { BusinessError } 201 - Permission denied. 308 * @throws { BusinessError } 202 - Non-system applications use system APIs. 309 * @throws { BusinessError } 401 - Parameter error. 310 * @throws { BusinessError } 8300001 - Invalid parameter value. 311 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 312 * @throws { BusinessError } 8300003 - System internal error. 313 * @throws { BusinessError } 8300999 - Unknown error code. 314 * @syscap SystemCapability.Telephony.SmsMms 315 * @systemapi Hide this for inner system use. 316 * @since 7 317 */ 318 function getSmscAddr(slotId: number): Promise<string>; 319 320 /** 321 * Returns whether a device is capable of sending and receiving SMS messages. 322 * 323 * @returns { boolean } Returns {@code true} if the device is capable of sending and receiving SMS messages; 324 * returns {@code false} otherwise. 325 * @syscap SystemCapability.Telephony.SmsMms 326 * @since 7 327 */ 328 function hasSmsCapability(): boolean; 329 330 /** 331 * Add an SMS Message to SIM card. 332 * 333 * @permission ohos.permission.RECEIVE_SMS and ohos.permission.SEND_MESSAGES 334 * @param { SimMessageOptions } options - Indicates SIM message options. 335 * @param { AsyncCallback<void> } callback - The callback of addSimMessage. 336 * @throws { BusinessError } 201 - Permission denied. 337 * @throws { BusinessError } 202 - Non-system applications use system APIs. 338 * @throws { BusinessError } 401 - Parameter error. 339 * @throws { BusinessError } 8300001 - Invalid parameter value. 340 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 341 * @throws { BusinessError } 8300003 - System internal error. 342 * @throws { BusinessError } 8300999 - Unknown error code. 343 * @syscap SystemCapability.Telephony.SmsMms 344 * @systemapi Hide this for inner system use. 345 * @since 7 346 */ 347 function addSimMessage(options: SimMessageOptions, callback: AsyncCallback<void>): void; 348 349 /** 350 * Add an SMS Message to SIM card. 351 * 352 * @permission ohos.permission.RECEIVE_SMS and ohos.permission.SEND_MESSAGES 353 * @param { SimMessageOptions } options - Indicates SIM message options. 354 * @returns { Promise<void> } The promise returned by the addSimMessage. 355 * @throws { BusinessError } 201 - Permission denied. 356 * @throws { BusinessError } 202 - Non-system applications use system APIs. 357 * @throws { BusinessError } 401 - Parameter error. 358 * @throws { BusinessError } 8300001 - Invalid parameter value. 359 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 360 * @throws { BusinessError } 8300003 - System internal error. 361 * @throws { BusinessError } 8300999 - Unknown error code. 362 * @syscap SystemCapability.Telephony.SmsMms 363 * @systemapi Hide this for inner system use. 364 * @since 7 365 */ 366 function addSimMessage(options: SimMessageOptions): Promise<void>; 367 368 /** 369 * Delete an SMS Message from the SIM card. 370 * 371 * @permission ohos.permission.RECEIVE_SMS and ohos.permission.SEND_MESSAGES 372 * @param { number } slotId - Indicates the card slot index number, ranging from 0 to the maximum card slot index 373 * number supported by the device. 374 * @param { number } msgIndex - Indicates the message index. 375 * @param { AsyncCallback<void> } callback - The callback of delSimMessage. 376 * @throws { BusinessError } 201 - Permission denied. 377 * @throws { BusinessError } 202 - Non-system applications use system APIs. 378 * @throws { BusinessError } 401 - Parameter error. 379 * @throws { BusinessError } 8300001 - Invalid parameter value. 380 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 381 * @throws { BusinessError } 8300003 - System internal error. 382 * @throws { BusinessError } 8300999 - Unknown error code. 383 * @syscap SystemCapability.Telephony.SmsMms 384 * @systemapi Hide this for inner system use. 385 * @since 7 386 */ 387 function delSimMessage(slotId: number, msgIndex: number, callback: AsyncCallback<void>): void; 388 389 /** 390 * Delete an SMS Message from the SIM card. 391 * 392 * @permission ohos.permission.RECEIVE_SMS and ohos.permission.SEND_MESSAGES 393 * @param { number } slotId - Indicates the card slot index number, ranging from 0 to the maximum card slot index 394 * number supported by the device. 395 * @param { number } msgIndex - Indicates the message index. 396 * @returns { Promise<void> } The promise returned by the delSimMessage. 397 * @throws { BusinessError } 201 - Permission denied. 398 * @throws { BusinessError } 202 - Non-system applications use system APIs. 399 * @throws { BusinessError } 401 - Parameter error. 400 * @throws { BusinessError } 8300001 - Invalid parameter value. 401 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 402 * @throws { BusinessError } 8300003 - System internal error. 403 * @throws { BusinessError } 8300999 - Unknown error code. 404 * @syscap SystemCapability.Telephony.SmsMms 405 * @systemapi Hide this for inner system use. 406 * @since 7 407 */ 408 function delSimMessage(slotId: number, msgIndex: number): Promise<void>; 409 410 /** 411 * Update a SIM SMS of SIM card. 412 * 413 * @permission ohos.permission.RECEIVE_SMS and ohos.permission.SEND_MESSAGES 414 * @param { UpdateSimMessageOptions } options - Indicates update SIM message options. 415 * @param { AsyncCallback<void> } callback - The callback of updateSimMessage. 416 * @throws { BusinessError } 201 - Permission denied. 417 * @throws { BusinessError } 202 - Non-system applications use system APIs. 418 * @throws { BusinessError } 401 - Parameter error. 419 * @throws { BusinessError } 8300001 - Invalid parameter value. 420 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 421 * @throws { BusinessError } 8300003 - System internal error. 422 * @throws { BusinessError } 8300999 - Unknown error code. 423 * @syscap SystemCapability.Telephony.SmsMms 424 * @systemapi Hide this for inner system use. 425 * @since 7 426 */ 427 function updateSimMessage(options: UpdateSimMessageOptions, callback: AsyncCallback<void>): void; 428 429 /** 430 * Update a SIM SMS of SIM card. 431 * 432 * @permission ohos.permission.RECEIVE_SMS and ohos.permission.SEND_MESSAGES 433 * @param { UpdateSimMessageOptions } options - Indicates update SIM message options. 434 * @returns { Promise<void> } The promise returned by the updateSimMessage. 435 * @throws { BusinessError } 201 - Permission denied. 436 * @throws { BusinessError } 202 - Non-system applications use system APIs. 437 * @throws { BusinessError } 401 - Parameter error. 438 * @throws { BusinessError } 8300001 - Invalid parameter value. 439 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 440 * @throws { BusinessError } 8300003 - System internal error. 441 * @throws { BusinessError } 8300999 - Unknown error code. 442 * @syscap SystemCapability.Telephony.SmsMms 443 * @systemapi Hide this for inner system use. 444 * @since 7 445 */ 446 function updateSimMessage(options: UpdateSimMessageOptions): Promise<void>; 447 448 /** 449 * Get all SMS records in SIM. 450 * 451 * @permission ohos.permission.RECEIVE_SMS 452 * @param { number } slotId - Indicates the card slot index number, ranging from 0 to the maximum card slot index 453 * number supported by the device. 454 * @param { AsyncCallback<Array<SimShortMessage>> } callback - Indicates the callback for getting a 455 * {@code SimShortMessage} object. 456 * @throws { BusinessError } 201 - Permission denied. 457 * @throws { BusinessError } 202 - Non-system applications use system APIs. 458 * @throws { BusinessError } 401 - Parameter error. 459 * @throws { BusinessError } 8300001 - Invalid parameter value. 460 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 461 * @throws { BusinessError } 8300003 - System internal error. 462 * @throws { BusinessError } 8300999 - Unknown error code. 463 * @syscap SystemCapability.Telephony.SmsMms 464 * @systemapi Hide this for inner system use. 465 * @since 7 466 */ 467 function getAllSimMessages(slotId: number, callback: AsyncCallback<Array<SimShortMessage>>): void; 468 469 /** 470 * Get all SMS records in SIM. 471 * 472 * @permission ohos.permission.RECEIVE_SMS 473 * @param { number } slotId - Indicates the card slot index number, ranging from 0 to the maximum card slot index 474 * number supported by the device. 475 * @returns { Promise<Array<SimShortMessage>> } Returns a {@code SimShortMessage} object. 476 * @throws { BusinessError } 201 - Permission denied. 477 * @throws { BusinessError } 202 - Non-system applications use system APIs. 478 * @throws { BusinessError } 401 - Parameter error. 479 * @throws { BusinessError } 8300001 - Invalid parameter value. 480 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 481 * @throws { BusinessError } 8300003 - System internal error. 482 * @throws { BusinessError } 8300999 - Unknown error code. 483 * @syscap SystemCapability.Telephony.SmsMms 484 * @systemapi Hide this for inner system use. 485 * @since 7 486 */ 487 function getAllSimMessages(slotId: number): Promise<Array<SimShortMessage>>; 488 489 /** 490 * Turn on or off Cell BroadCast. 491 * 492 * @permission ohos.permission.RECEIVE_SMS 493 * @param { CBConfigOptions } options - Indicates cell broadcast configuration options. 494 * @param { AsyncCallback<void> } callback - The callback of setCBConfig. 495 * @throws { BusinessError } 201 - Permission denied. 496 * @throws { BusinessError } 202 - Non-system applications use system APIs. 497 * @throws { BusinessError } 401 - Parameter error. 498 * @throws { BusinessError } 8300001 - Invalid parameter value. 499 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 500 * @throws { BusinessError } 8300003 - System internal error. 501 * @throws { BusinessError } 8300999 - Unknown error code. 502 * @syscap SystemCapability.Telephony.SmsMms 503 * @systemapi Hide this for inner system use. 504 * @since 7 505 */ 506 function setCBConfig(options: CBConfigOptions, callback: AsyncCallback<void>): void; 507 508 /** 509 * Turn on or off Cell BroadCast. 510 * 511 * @permission ohos.permission.RECEIVE_SMS 512 * @param { CBConfigOptions } options - Indicates cell broadcast configuration options. 513 * @returns { Promise<void> } The promise returned by the setCBConfig. 514 * @throws { BusinessError } 201 - Permission denied. 515 * @throws { BusinessError } 202 - Non-system applications use system APIs. 516 * @throws { BusinessError } 401 - Parameter error. 517 * @throws { BusinessError } 8300001 - Invalid parameter value. 518 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 519 * @throws { BusinessError } 8300003 - System internal error. 520 * @throws { BusinessError } 8300999 - Unknown error code. 521 * @syscap SystemCapability.Telephony.SmsMms 522 * @systemapi Hide this for inner system use. 523 * @since 7 524 */ 525 function setCBConfig(options: CBConfigOptions): Promise<void>; 526 527 /** 528 * Get an SMS segment encode relation information. 529 * 530 * @permission ohos.permission.GET_TELEPHONY_STATE 531 * @param { number } slotId - Indicates the card slot index number, ranging from 0 to the maximum card slot index 532 * number supported by the device. 533 * @param { string } message - Indicates short message. 534 * @param { boolean } force7bit - Indicates whether to use 7 bit encoding. 535 * @param { AsyncCallback<SmsSegmentsInfo> } callback - Indicates the callback for getting a {@code SmsSegmentsInfo} 536 * object. 537 * @throws { BusinessError } 201 - Permission denied. 538 * @throws { BusinessError } 202 - Non-system applications use system APIs. 539 * @throws { BusinessError } 401 - Parameter error. 540 * @throws { BusinessError } 8300001 - Invalid parameter value. 541 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 542 * @throws { BusinessError } 8300003 - System internal error. 543 * @throws { BusinessError } 8300999 - Unknown error code. 544 * @syscap SystemCapability.Telephony.SmsMms 545 * @systemapi Hide this for inner system use. 546 * @since 8 547 */ 548 function getSmsSegmentsInfo(slotId: number, message: string, force7bit: boolean, callback: AsyncCallback<SmsSegmentsInfo>): void; 549 550 /** 551 * Get an SMS segment encode relation information. 552 * 553 * @permission ohos.permission.GET_TELEPHONY_STATE 554 * @param { number } slotId - Indicates the card slot index number, ranging from 0 to the maximum card slot index 555 * number supported by the device. 556 * @param { string } message - Indicates short message. 557 * @param { boolean } force7bit - Indicates whether to use 7 bit encoding. 558 * @returns { Promise<SmsSegmentsInfo> } Returns a {@code SmsSegmentsInfo} object. 559 * @throws { BusinessError } 201 - Permission denied. 560 * @throws { BusinessError } 202 - Non-system applications use system APIs. 561 * @throws { BusinessError } 401 - Parameter error. 562 * @throws { BusinessError } 8300001 - Invalid parameter value. 563 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 564 * @throws { BusinessError } 8300003 - System internal error. 565 * @throws { BusinessError } 8300999 - Unknown error code. 566 * @syscap SystemCapability.Telephony.SmsMms 567 * @systemapi Hide this for inner system use. 568 * @since 8 569 */ 570 function getSmsSegmentsInfo(slotId: number, message: string, force7bit: boolean): Promise<SmsSegmentsInfo>; 571 572 /** 573 * SMS over IMS is supported if IMS is registered and SMS is supported on IMS. 574 * 575 * @param { number } slotId - Indicates the default SIM card for Ims Sms. The value {@code 0} indicates card slot 1, 576 * and the value {@code 1} indicates card slot 2. 577 * @param { AsyncCallback<boolean> } callback - Indicates the callback of isImsSmsSupported. 578 * Returns {@code true} if SMS over IMS is supported, {@code false} otherwise. 579 * @throws { BusinessError } 202 - Non-system applications use system APIs. 580 * @throws { BusinessError } 401 - Parameter error. 581 * @throws { BusinessError } 8300001 - Invalid parameter value. 582 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 583 * @throws { BusinessError } 8300003 - System internal error. 584 * @throws { BusinessError } 8300999 - Unknown error code. 585 * @syscap SystemCapability.Telephony.SmsMms 586 * @systemapi Hide this for inner system use. 587 * @since 8 588 */ 589 function isImsSmsSupported(slotId: number, callback: AsyncCallback<boolean>): void; 590 591 /** 592 * SMS over IMS is supported if IMS is registered and SMS is supported on IMS. 593 * 594 * @param { number } slotId - Indicates the default SIM card for Ims Sms. The value {@code 0} indicates card slot 1, 595 * and the value {@code 1} indicates card slot 2. 596 * @returns { Promise<boolean> } Returns {@code true} if SMS over IMS is supported, {@code false} otherwise. 597 * @throws { BusinessError } 202 - Non-system applications use system APIs. 598 * @throws { BusinessError } 401 - Parameter error. 599 * @throws { BusinessError } 8300001 - Invalid parameter value. 600 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 601 * @throws { BusinessError } 8300003 - System internal error. 602 * @throws { BusinessError } 8300999 - Unknown error code. 603 * @syscap SystemCapability.Telephony.SmsMms 604 * @systemapi Hide this for inner system use. 605 * @since 8 606 */ 607 function isImsSmsSupported(slotId: number): Promise<boolean>; 608 609 /** 610 * Gets SMS format supported on IMS. SMS over IMS format is either 3GPP or 3GPP2. 611 * 612 * @permission ohos.permission.GET_TELEPHONY_STATE 613 * @param { AsyncCallback<string> } callback - Indicates the callback for getting format, 3gpp, 3gpp2 or unknown. 614 * @throws { BusinessError } 201 - Permission denied. 615 * @throws { BusinessError } 202 - Non-system applications use system APIs. 616 * @throws { BusinessError } 401 - Parameter error. 617 * @throws { BusinessError } 8300001 - Invalid parameter value. 618 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 619 * @throws { BusinessError } 8300003 - System internal error. 620 * @throws { BusinessError } 8300999 - Unknown error code. 621 * @syscap SystemCapability.Telephony.SmsMms 622 * @systemapi Hide this for inner system use. 623 * @since 8 624 */ 625 function getImsShortMessageFormat(callback: AsyncCallback<string>): void; 626 627 /** 628 * Gets SMS format supported on IMS. SMS over IMS format is either 3GPP or 3GPP2. 629 * 630 * @permission ohos.permission.GET_TELEPHONY_STATE 631 * @returns { Promise<string> } Returns format, 3gpp, 3gpp2 or unknown. 632 * @throws { BusinessError } 201 - Permission denied. 633 * @throws { BusinessError } 202 - Non-system applications use system APIs. 634 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 635 * @throws { BusinessError } 8300003 - System internal error. 636 * @throws { BusinessError } 8300999 - Unknown error code. 637 * @syscap SystemCapability.Telephony.SmsMms 638 * @systemapi Hide this for inner system use. 639 * @since 8 640 */ 641 function getImsShortMessageFormat(): Promise<string>; 642 643 /** 644 * Decode the message content. 645 * 646 * @param { string | Array<number> } mmsFilePathName - Indicates the path name of the multimedia message file. 647 * @param { AsyncCallback<MmsInformation> } callback - Indicates the callback for getting a {@code MmsInformation} 648 * object. 649 * @throws { BusinessError } 202 - Non-system applications use system APIs. 650 * @throws { BusinessError } 401 - Parameter error. 651 * @throws { BusinessError } 8300001 - Invalid parameter value. 652 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 653 * @throws { BusinessError } 8300003 - System internal error. 654 * @throws { BusinessError } 8300999 - Unknown error code. 655 * @syscap SystemCapability.Telephony.SmsMms 656 * @systemapi Hide this for inner system use. 657 * @since 8 658 */ 659 function decodeMms(mmsFilePathName: string | Array<number>, callback: AsyncCallback<MmsInformation>): void; 660 661 /** 662 * Decode the message content. 663 * 664 * @param { string | Array<number> } mmsFilePathName - Indicates the path name of the multimedia message file. 665 * @returns { Promise<MmsInformation> } Returns a {@code MmsInformation} object. 666 * @throws { BusinessError } 202 - Non-system applications use system APIs. 667 * @throws { BusinessError } 401 - Parameter error. 668 * @throws { BusinessError } 8300001 - Invalid parameter value. 669 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 670 * @throws { BusinessError } 8300003 - System internal error. 671 * @throws { BusinessError } 8300999 - Unknown error code. 672 * @syscap SystemCapability.Telephony.SmsMms 673 * @systemapi Hide this for inner system use. 674 * @since 8 675 */ 676 function decodeMms(mmsFilePathName: string | Array<number>): Promise<MmsInformation>; 677 678 /** 679 * Encode the message content. 680 * 681 * @param { MmsInformation } mms - Indicates MMS messages. 682 * @param { AsyncCallback<Array<number>> } callback - Indicates the callback for getting the result of MMS encoding. 683 * @throws { BusinessError } 202 - Non-system applications use system APIs. 684 * @throws { BusinessError } 401 - Parameter error. 685 * @throws { BusinessError } 8300001 - Invalid parameter value. 686 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 687 * @throws { BusinessError } 8300003 - System internal error. 688 * @throws { BusinessError } 8300999 - Unknown error code. 689 * @syscap SystemCapability.Telephony.SmsMms 690 * @systemapi Hide this for inner system use. 691 * @since 8 692 */ 693 function encodeMms(mms: MmsInformation, callback: AsyncCallback<Array<number>>): void; 694 695 /** 696 * Encode the message content. 697 * 698 * @param { MmsInformation } mms - Indicates MMS messages. 699 * @returns { Promise<Array<number>> } Returns the result of MMS encoding. 700 * @throws { BusinessError } 202 - Non-system applications use system APIs. 701 * @throws { BusinessError } 401 - Parameter error. 702 * @throws { BusinessError } 8300001 - Invalid parameter value. 703 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 704 * @throws { BusinessError } 8300003 - System internal error. 705 * @throws { BusinessError } 8300999 - Unknown error code. 706 * @syscap SystemCapability.Telephony.SmsMms 707 * @systemapi Hide this for inner system use. 708 * @since 8 709 */ 710 function encodeMms(mms: MmsInformation): Promise<Array<number>>; 711 712 /** 713 * Obtains the default SIM ID for sending SMS messages. 714 * 715 * @param { AsyncCallback<number> } callback - Returns the SIM ID of the default sms sim and 716 * SIM ID will increase from 1. 717 * @throws { BusinessError } 401 - Parameter error. 718 * @throws { BusinessError } 8300001 - Invalid parameter value. 719 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 720 * @throws { BusinessError } 8300003 - System internal error. 721 * @throws { BusinessError } 8300004 - Do not have sim card. 722 * @throws { BusinessError } 8300999 - Unknown error code. 723 * @throws { BusinessError } 8301001 - SIM card is not activated. 724 * @syscap SystemCapability.Telephony.SmsMms 725 * @since 10 726 */ 727 function getDefaultSmsSimId(callback: AsyncCallback<number>): void; 728 729 /** 730 * Obtains the default SIM ID for sending SMS messages. 731 * 732 * @returns { Promise<number> } Returns the SIM ID of the default sms sim and 733 * SIM ID will increase from 1. 734 * @throws { BusinessError } 8300001 - Invalid parameter value. 735 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 736 * @throws { BusinessError } 8300003 - System internal error. 737 * @throws { BusinessError } 8300004 - Do not have sim card. 738 * @throws { BusinessError } 8300999 - Unknown error code. 739 * @throws { BusinessError } 8301001 - SIM card is not activated. 740 * @syscap SystemCapability.Telephony.SmsMms 741 * @since 10 742 */ 743 function getDefaultSmsSimId(): Promise<number>; 744 745 /** 746 * Defines the MMS message information. 747 * 748 * @interface MmsInformation 749 * @syscap SystemCapability.Telephony.SmsMms 750 * @systemapi Hide this for inner system use. 751 * @since 8 752 */ 753 export interface MmsInformation { 754 /** 755 * Indicates the message type for the MMS message. 756 * 757 * @type { MessageType } 758 * @syscap SystemCapability.Telephony.SmsMms 759 * @systemapi Hide this for inner system use. 760 * @since 8 761 */ 762 messageType: MessageType; 763 764 /** 765 * Indicates the PDU header type for the MMS message. 766 * 767 * @type { MmsSendReq | MmsSendConf | MmsNotificationInd | MmsRespInd | MmsRetrieveConf | MmsAcknowledgeInd | 768 * MmsDeliveryInd | MmsReadOrigInd | MmsReadRecInd } 769 * @syscap SystemCapability.Telephony.SmsMms 770 * @systemapi Hide this for inner system use. 771 * @since 8 772 */ 773 mmsType: MmsSendReq | MmsSendConf | MmsNotificationInd | MmsRespInd | MmsRetrieveConf | MmsAcknowledgeInd | MmsDeliveryInd | MmsReadOrigInd | MmsReadRecInd; 774 775 /** 776 * Indicates the attachment for the MMS message. 777 * 778 * @type { ?Array<MmsAttachment> } 779 * @syscap SystemCapability.Telephony.SmsMms 780 * @systemapi Hide this for inner system use. 781 * @since 8 782 */ 783 attachment?: Array<MmsAttachment>; 784 } 785 786 /** 787 * Sends an MMS message. 788 * 789 * @permission ohos.permission.SEND_MESSAGES 790 * @param { MmsParam } mmsParam - Indicates the parameters of the MMS message. 791 * @param { AsyncCallback<void> } callback - The callback of sendMms. For error code, see MmsFailCode. 792 * @throws { BusinessError } 201 - Permission denied. 793 * @throws { BusinessError } 401 - Parameter error. 794 * @throws { BusinessError } 8300001 - Invalid parameter value. 795 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 796 * @throws { BusinessError } 8300003 - System internal error. 797 * @throws { BusinessError } 8300999 - Unknown error code. 798 * @syscap SystemCapability.Telephony.SmsMms 799 * @since 11 800 */ 801 function sendMms(mmsParam: MmsParam, callback: AsyncCallback<void>): void; 802 803 /** 804 * Sends an MMS message. 805 * 806 * @permission ohos.permission.SEND_MESSAGES 807 * @param { MmsParam } mmsParam - Indicates the parameters of the MMS message. 808 * @returns { Promise<void> } The promise returned by the sendMms. 809 * @throws { BusinessError } 201 - Permission denied. 810 * @throws { BusinessError } 401 - Parameter error. 811 * @throws { BusinessError } 8300001 - Invalid parameter value. 812 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 813 * @throws { BusinessError } 8300003 - System internal error. 814 * @throws { BusinessError } 8300999 - Unknown error code. 815 * @syscap SystemCapability.Telephony.SmsMms 816 * @since 11 817 */ 818 function sendMms(mmsParam: MmsParam): Promise<void>; 819 820 /** 821 * Downloads an MMS message. 822 * 823 * @permission ohos.permission.RECEIVE_MMS 824 * @param { MmsParam } mmsParam - Indicates the parameters of the MMS message. 825 * @param { AsyncCallback<void> } callback - The callback of downloadMms. For error code, see MmsFailCode. 826 * @throws { BusinessError } 201 - Permission denied. 827 * @throws { BusinessError } 401 - Parameter error. 828 * @throws { BusinessError } 8300001 - Invalid parameter value. 829 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 830 * @throws { BusinessError } 8300003 - System internal error. 831 * @throws { BusinessError } 8300999 - Unknown error code. 832 * @syscap SystemCapability.Telephony.SmsMms 833 * @since 11 834 */ 835 function downloadMms(mmsParam: MmsParam, callback: AsyncCallback<void>): void; 836 837 /** 838 * Downloads an MMS message. 839 * 840 * @permission ohos.permission.RECEIVE_MMS 841 * @param { MmsParam } - Indicates the parameters of the MMS message. 842 * @returns { Promise<void> } The promise returned by the downloadMms. For error code, see MmsFailCode. 843 * @throws { BusinessError } 201 - Permission denied. 844 * @throws { BusinessError } 401 - Parameter error. 845 * @throws { BusinessError } 8300001 - Invalid parameter value. 846 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 847 * @throws { BusinessError } 8300003 - System internal error. 848 * @throws { BusinessError } 8300999 - Unknown error code. 849 * @syscap SystemCapability.Telephony.SmsMms 850 * @since 11 851 */ 852 function downloadMms(mmsParam: MmsParam): Promise<void>; 853 854 /** 855 * Defines the MMS message param. 856 * 857 * @interface MmsParam 858 * @syscap SystemCapability.Telephony.SmsMms 859 * @since 10 860 */ 861 export interface MmsParam { 862 /** 863 * Indicates the ID of the SIM card slot used for sending the MMS message. 864 * 865 * @type { number } 866 * @syscap SystemCapability.Telephony.SmsMms 867 * @since 11 868 */ 869 slotId: number; 870 871 /** 872 * Indicates the MMSC used for sending the MMS message. 873 * 874 * @type { string } 875 * @syscap SystemCapability.Telephony.SmsMms 876 * @since 11 877 */ 878 mmsc: string; 879 880 /** 881 * Indicates the MMS pdu url used for sending the MMS message. 882 * 883 * @type { string } 884 * @syscap SystemCapability.Telephony.SmsMms 885 * @since 11 886 */ 887 data: string; 888 889 /** 890 * Indicates the MMS UA and MMS UaProf used for sending the MMS message. 891 * 892 * @type { ?MmsConfig } 893 * @syscap SystemCapability.Telephony.SmsMms 894 * @since 11 895 */ 896 mmsConfig?: MmsConfig; 897 } 898 899 /** 900 * Defines the MMS message config. 901 * 902 * @interface MmsConfig 903 * @syscap SystemCapability.Telephony.SmsMms 904 * @since 10 905 */ 906 export interface MmsConfig { 907 /** 908 * Indicates the user agent used for the MMS message. 909 * 910 * @type { string } 911 * @syscap SystemCapability.Telephony.SmsMms 912 * @since 11 913 */ 914 userAgent: string; 915 916 /** 917 * Indicates the user agent profile for the MMS message. 918 * 919 * @type { string } 920 * @syscap SystemCapability.Telephony.SmsMms 921 * @since 11 922 */ 923 userAgentProfile: string; 924 } 925 926 /** 927 * Defines an MMS message sending request. 928 * 929 * @interface MmsSendReq 930 * @syscap SystemCapability.Telephony.SmsMms 931 * @systemapi Hide this for inner system use. 932 * @since 8 933 */ 934 export interface MmsSendReq { 935 /** 936 * Indicates the source address for the MMS message sending request. 937 * 938 * @type { MmsAddress } 939 * @syscap SystemCapability.Telephony.SmsMms 940 * @systemapi Hide this for inner system use. 941 * @since 8 942 */ 943 from: MmsAddress; 944 945 /** 946 * Indicates the transaction ID for the MMS message sending request. 947 * 948 * @type { string } 949 * @syscap SystemCapability.Telephony.SmsMms 950 * @systemapi Hide this for inner system use. 951 * @since 8 952 */ 953 transactionId: string; 954 955 /** 956 * Indicates the content type for the MMS message sending request. 957 * 958 * @type { string } 959 * @syscap SystemCapability.Telephony.SmsMms 960 * @systemapi Hide this for inner system use. 961 * @since 8 962 */ 963 contentType: string; 964 965 /** 966 * Indicates the version for the MMS message sending request. 967 * 968 * @type { MmsVersionType } 969 * @syscap SystemCapability.Telephony.SmsMms 970 * @systemapi Hide this for inner system use. 971 * @since 8 972 */ 973 version: MmsVersionType; 974 975 /** 976 * Indicates the destination address for the MMS message sending request. 977 * 978 * @type { ?Array<MmsAddress> } 979 * @syscap SystemCapability.Telephony.SmsMms 980 * @systemapi Hide this for inner system use. 981 * @since 8 982 */ 983 to?: Array<MmsAddress>; 984 985 /** 986 * Indicates the date for the MMS message sending request. 987 * 988 * @type { ?number } 989 * @syscap SystemCapability.Telephony.SmsMms 990 * @systemapi Hide this for inner system use. 991 * @since 8 992 */ 993 date?: number; 994 995 /** 996 * Indicates the carbon copy address for the MMS message sending request. 997 * 998 * @type { ?Array<MmsAddress> } 999 * @syscap SystemCapability.Telephony.SmsMms 1000 * @systemapi Hide this for inner system use. 1001 * @since 8 1002 */ 1003 cc?: Array<MmsAddress>; 1004 1005 /** 1006 * Indicates the blind carbon copy address for the MMS message sending request. 1007 * 1008 * @type { ?Array<MmsAddress> } 1009 * @syscap SystemCapability.Telephony.SmsMms 1010 * @systemapi Hide this for inner system use. 1011 * @since 8 1012 */ 1013 bcc?: Array<MmsAddress>; 1014 1015 /** 1016 * Indicates the subject for the MMS message sending request. 1017 * 1018 * @type { ?string } 1019 * @syscap SystemCapability.Telephony.SmsMms 1020 * @systemapi Hide this for inner system use. 1021 * @since 8 1022 */ 1023 subject?: string; 1024 1025 /** 1026 * Indicates the message class for the MMS message sending request. 1027 * 1028 * @type { ?number } 1029 * @syscap SystemCapability.Telephony.SmsMms 1030 * @systemapi Hide this for inner system use. 1031 * @since 8 1032 */ 1033 messageClass?: number; 1034 1035 /** 1036 * Indicates the expiration for the MMS message sending request. 1037 * 1038 * @type { ?number } 1039 * @syscap SystemCapability.Telephony.SmsMms 1040 * @systemapi Hide this for inner system use. 1041 * @since 8 1042 */ 1043 expiry?: number; 1044 1045 /** 1046 * Indicates the priority for the MMS message sending request. 1047 * 1048 * @type { ?MmsPriorityType } 1049 * @syscap SystemCapability.Telephony.SmsMms 1050 * @systemapi Hide this for inner system use. 1051 * @since 8 1052 */ 1053 priority?: MmsPriorityType; 1054 1055 /** 1056 * Indicates the sender visibility for the MMS message sending request. 1057 * 1058 * @type { ?number } 1059 * @syscap SystemCapability.Telephony.SmsMms 1060 * @systemapi Hide this for inner system use. 1061 * @since 8 1062 */ 1063 senderVisibility?: number; 1064 1065 /** 1066 * Indicates the delivery report for the MMS message sending request. 1067 * 1068 * @type { ?number } 1069 * @syscap SystemCapability.Telephony.SmsMms 1070 * @systemapi Hide this for inner system use. 1071 * @since 8 1072 */ 1073 deliveryReport?: number; 1074 1075 /** 1076 * Indicates the read report for the MMS message sending request. 1077 * 1078 * @type { ?number } 1079 * @syscap SystemCapability.Telephony.SmsMms 1080 * @systemapi Hide this for inner system use. 1081 * @since 8 1082 */ 1083 readReport?: number; 1084 } 1085 1086 /** 1087 * Defines the MMS message sending configuration. 1088 * 1089 * @interface MmsSendConf 1090 * @syscap SystemCapability.Telephony.SmsMms 1091 * @systemapi Hide this for inner system use. 1092 * @since 8 1093 */ 1094 export interface MmsSendConf { 1095 /** 1096 * Indicates the response status for the MMS message sending configuration. 1097 * 1098 * @type { number } 1099 * @syscap SystemCapability.Telephony.SmsMms 1100 * @systemapi Hide this for inner system use. 1101 * @since 8 1102 */ 1103 responseState: number; 1104 1105 /** 1106 * Indicates the transaction ID for the MMS message sending configuration. 1107 * 1108 * @type { string } 1109 * @syscap SystemCapability.Telephony.SmsMms 1110 * @systemapi Hide this for inner system use. 1111 * @since 8 1112 */ 1113 transactionId: string; 1114 1115 /** 1116 * Indicates the version for the MMS message sending configuration. 1117 * 1118 * @type { MmsVersionType } 1119 * @syscap SystemCapability.Telephony.SmsMms 1120 * @systemapi Hide this for inner system use. 1121 * @since 8 1122 */ 1123 version: MmsVersionType; 1124 1125 /** 1126 * Indicates the message ID for the MMS message sending configuration. 1127 * 1128 * @type { ?string } 1129 * @syscap SystemCapability.Telephony.SmsMms 1130 * @systemapi Hide this for inner system use. 1131 * @since 8 1132 */ 1133 messageId?: string; 1134 } 1135 1136 /** 1137 * Defines an MMS notification indication. 1138 * 1139 * @interface MmsNotificationInd 1140 * @syscap SystemCapability.Telephony.SmsMms 1141 * @systemapi Hide this for inner system use. 1142 * @since 8 1143 */ 1144 export interface MmsNotificationInd { 1145 /** 1146 * Indicates the transaction ID for the MMS notification indication. 1147 * 1148 * @type { string } 1149 * @syscap SystemCapability.Telephony.SmsMms 1150 * @systemapi Hide this for inner system use. 1151 * @since 8 1152 */ 1153 transactionId: string; 1154 1155 /** 1156 * Indicates the message class for the MMS notification indication. 1157 * 1158 * @type { number } 1159 * @syscap SystemCapability.Telephony.SmsMms 1160 * @systemapi Hide this for inner system use. 1161 * @since 8 1162 */ 1163 messageClass: number; 1164 1165 /** 1166 * Indicates the message size for the MMS notification indication. 1167 * 1168 * @type { number } 1169 * @syscap SystemCapability.Telephony.SmsMms 1170 * @systemapi Hide this for inner system use. 1171 * @since 8 1172 */ 1173 messageSize: number; 1174 1175 /** 1176 * Indicates the expiration for the MMS notification indication. 1177 * 1178 * @type { number } 1179 * @syscap SystemCapability.Telephony.SmsMms 1180 * @systemapi Hide this for inner system use. 1181 * @since 8 1182 */ 1183 expiry: number; 1184 1185 /** 1186 * Indicates the content location for the MMS notification indication. 1187 * 1188 * @type { string } 1189 * @syscap SystemCapability.Telephony.SmsMms 1190 * @systemapi Hide this for inner system use. 1191 * @since 8 1192 */ 1193 contentLocation: string; 1194 1195 /** 1196 * Indicates the version for the MMS notification indication. 1197 * 1198 * @type { MmsVersionType } 1199 * @syscap SystemCapability.Telephony.SmsMms 1200 * @systemapi Hide this for inner system use. 1201 * @since 8 1202 */ 1203 version: MmsVersionType; 1204 1205 /** 1206 * Indicates the source address for the MMS notification indication. 1207 * 1208 * @type { ?MmsAddress } 1209 * @syscap SystemCapability.Telephony.SmsMms 1210 * @systemapi Hide this for inner system use. 1211 * @since 8 1212 */ 1213 from?: MmsAddress; 1214 1215 /** 1216 * Indicates the subject for the MMS notification indication. 1217 * 1218 * @type { ?string } 1219 * @syscap SystemCapability.Telephony.SmsMms 1220 * @systemapi Hide this for inner system use. 1221 * @since 8 1222 */ 1223 subject?: string; 1224 1225 /** 1226 * Indicates the status report for the MMS notification indication. 1227 * 1228 * @type { ?number } 1229 * @syscap SystemCapability.Telephony.SmsMms 1230 * @systemapi Hide this for inner system use. 1231 * @since 8 1232 */ 1233 deliveryReport?: number; 1234 1235 /** 1236 * Indicates the content class for the MMS notification indication. 1237 * 1238 * @type { ?number } 1239 * @syscap SystemCapability.Telephony.SmsMms 1240 * @systemapi Hide this for inner system use. 1241 * @since 8 1242 */ 1243 contentClass?: number; 1244 } 1245 1246 /** 1247 * Defines an MMS response indication. 1248 * 1249 * @interface MmsRespInd 1250 * @syscap SystemCapability.Telephony.SmsMms 1251 * @systemapi Hide this for inner system use. 1252 * @since 8 1253 */ 1254 export interface MmsRespInd { 1255 /** 1256 * Indicates the event ID for the MMS response indication. 1257 * 1258 * @type { string } 1259 * @syscap SystemCapability.Telephony.SmsMms 1260 * @systemapi Hide this for inner system use. 1261 * @since 8 1262 */ 1263 transactionId: string; 1264 1265 /** 1266 * Indicates the status for the MMS response indication. 1267 * 1268 * @type { number } 1269 * @syscap SystemCapability.Telephony.SmsMms 1270 * @systemapi Hide this for inner system use. 1271 * @since 8 1272 */ 1273 status: number; 1274 1275 /** 1276 * Indicates the version for the MMS response indication. 1277 * 1278 * @type { MmsVersionType } 1279 * @syscap SystemCapability.Telephony.SmsMms 1280 * @systemapi Hide this for inner system use. 1281 * @since 8 1282 */ 1283 version: MmsVersionType; 1284 1285 /** 1286 * Indicates the report allowed for the MMS response indication. 1287 * 1288 * @type { ?ReportType } 1289 * @syscap SystemCapability.Telephony.SmsMms 1290 * @systemapi Hide this for inner system use. 1291 * @since 8 1292 */ 1293 reportAllowed?: ReportType; 1294 } 1295 1296 /** 1297 * Defines the MMS message retrieval configuration. 1298 * 1299 * @interface MmsRetrieveConf 1300 * @syscap SystemCapability.Telephony.SmsMms 1301 * @systemapi Hide this for inner system use. 1302 * @since 8 1303 */ 1304 export interface MmsRetrieveConf { 1305 /** 1306 * Indicates the transaction ID for the MMS message retrieval configuration. 1307 * 1308 * @type { string } 1309 * @syscap SystemCapability.Telephony.SmsMms 1310 * @systemapi Hide this for inner system use. 1311 * @since 8 1312 */ 1313 transactionId: string; 1314 1315 /** 1316 * Indicates the message ID for the MMS message retrieval configuration. 1317 * 1318 * @type { string } 1319 * @syscap SystemCapability.Telephony.SmsMms 1320 * @systemapi Hide this for inner system use. 1321 * @since 8 1322 */ 1323 messageId: string; 1324 1325 /** 1326 * Indicates the date for the MMS message retrieval configuration. 1327 * 1328 * @type { number } 1329 * @syscap SystemCapability.Telephony.SmsMms 1330 * @systemapi Hide this for inner system use. 1331 * @since 8 1332 */ 1333 date: number; 1334 1335 /** 1336 * Indicates the content type for the MMS message retrieval configuration. 1337 * 1338 * @type { string } 1339 * @syscap SystemCapability.Telephony.SmsMms 1340 * @systemapi Hide this for inner system use. 1341 * @since 8 1342 */ 1343 contentType: string; 1344 1345 /** 1346 * Indicates the destination address for the MMS message retrieval configuration. 1347 * 1348 * @type { Array<MmsAddress> } 1349 * @syscap SystemCapability.Telephony.SmsMms 1350 * @systemapi Hide this for inner system use. 1351 * @since 8 1352 */ 1353 to: Array<MmsAddress>; 1354 1355 /** 1356 * Indicates the version for the MMS message retrieval configuration. 1357 * 1358 * @type { MmsVersionType } 1359 * @syscap SystemCapability.Telephony.SmsMms 1360 * @systemapi Hide this for inner system use. 1361 * @since 8 1362 */ 1363 version: MmsVersionType; 1364 1365 /** 1366 * Indicates the source address for the MMS message retrieval configuration. 1367 * 1368 * @type { ?MmsAddress } 1369 * @syscap SystemCapability.Telephony.SmsMms 1370 * @systemapi Hide this for inner system use. 1371 * @since 8 1372 */ 1373 from?: MmsAddress; 1374 1375 /** 1376 * Indicates the carbon copy address for the MMS message retrieval configuration. 1377 * 1378 * @type { ?Array<MmsAddress> } 1379 * @syscap SystemCapability.Telephony.SmsMms 1380 * @systemapi Hide this for inner system use. 1381 * @since 8 1382 */ 1383 cc?: Array<MmsAddress>; 1384 1385 /** 1386 * Indicates the subject for the MMS message retrieval configuration. 1387 * 1388 * @type { ?string } 1389 * @syscap SystemCapability.Telephony.SmsMms 1390 * @systemapi Hide this for inner system use. 1391 * @since 8 1392 */ 1393 subject?: string; 1394 1395 /** 1396 * Indicates the priority for the MMS message retrieval configuration. 1397 * 1398 * @type { ?MmsPriorityType } 1399 * @syscap SystemCapability.Telephony.SmsMms 1400 * @systemapi Hide this for inner system use. 1401 * @since 8 1402 */ 1403 priority?: MmsPriorityType; 1404 1405 /** 1406 * Indicates the status report for the MMS message retrieval configuration. 1407 * 1408 * @type { ?number } 1409 * @syscap SystemCapability.Telephony.SmsMms 1410 * @systemapi Hide this for inner system use. 1411 * @since 8 1412 */ 1413 deliveryReport?: number; 1414 1415 /** 1416 * Indicates the read report for the MMS message retrieval configuration. 1417 * 1418 * @type { ?number } 1419 * @syscap SystemCapability.Telephony.SmsMms 1420 * @systemapi Hide this for inner system use. 1421 * @since 8 1422 */ 1423 readReport?: number; 1424 1425 /** 1426 * Indicates the retrieval status for the MMS message retrieval configuration. 1427 * 1428 * @type { ?number } 1429 * @syscap SystemCapability.Telephony.SmsMms 1430 * @systemapi Hide this for inner system use. 1431 * @since 8 1432 */ 1433 retrieveStatus?: number; 1434 1435 /** 1436 * Indicates the retrieval text for the MMS message retrieval configuration. 1437 * 1438 * @type { ?string } 1439 * @syscap SystemCapability.Telephony.SmsMms 1440 * @systemapi Hide this for inner system use. 1441 * @since 8 1442 */ 1443 retrieveText?: string; 1444 } 1445 1446 /** 1447 * Defines an MMS confirmation indication. 1448 * 1449 * @interface MmsAcknowledgeInd 1450 * @syscap SystemCapability.Telephony.SmsMms 1451 * @systemapi Hide this for inner system use. 1452 * @since 8 1453 */ 1454 export interface MmsAcknowledgeInd { 1455 /** 1456 * Indicates the transaction ID for the MMS confirmation indication. 1457 * 1458 * @type { string } 1459 * @syscap SystemCapability.Telephony.SmsMms 1460 * @systemapi Hide this for inner system use. 1461 * @since 8 1462 */ 1463 transactionId: string; 1464 1465 /** 1466 * Indicates the version for the MMS confirmation indication. 1467 * 1468 * @type { MmsVersionType } 1469 * @syscap SystemCapability.Telephony.SmsMms 1470 * @systemapi Hide this for inner system use. 1471 * @since 8 1472 */ 1473 version: MmsVersionType; 1474 1475 /** 1476 * Indicates the report allowed for the MMS confirmation indication. 1477 * 1478 * @type { ?ReportType } 1479 * @syscap SystemCapability.Telephony.SmsMms 1480 * @systemapi Hide this for inner system use. 1481 * @since 8 1482 */ 1483 reportAllowed?: ReportType; 1484 } 1485 1486 /** 1487 * Defines an MMS message delivery indication. 1488 * 1489 * @interface MmsDeliveryInd 1490 * @syscap SystemCapability.Telephony.SmsMms 1491 * @systemapi Hide this for inner system use. 1492 * @since 8 1493 */ 1494 export interface MmsDeliveryInd { 1495 /** 1496 * Indicates the message ID for the MMS message delivery indication. 1497 * 1498 * @type { string } 1499 * @syscap SystemCapability.Telephony.SmsMms 1500 * @systemapi Hide this for inner system use. 1501 * @since 8 1502 */ 1503 messageId: string; 1504 1505 /** 1506 * Indicates the date for the MMS message delivery indication. 1507 * 1508 * @type { number } 1509 * @syscap SystemCapability.Telephony.SmsMms 1510 * @systemapi Hide this for inner system use. 1511 * @since 8 1512 */ 1513 date: number; 1514 1515 /** 1516 * Indicates the destination address for the MMS message delivery indication. 1517 * 1518 * @type { Array<MmsAddress> } 1519 * @syscap SystemCapability.Telephony.SmsMms 1520 * @systemapi Hide this for inner system use. 1521 * @since 8 1522 */ 1523 to: Array<MmsAddress>; 1524 1525 /** 1526 * Indicates the status for the MMS message delivery indication. 1527 * 1528 * @type { number } 1529 * @syscap SystemCapability.Telephony.SmsMms 1530 * @systemapi Hide this for inner system use. 1531 * @since 8 1532 */ 1533 status: number; 1534 1535 /** 1536 * Indicates the version for the MMS message delivery indication. 1537 * 1538 * @type { MmsVersionType } 1539 * @syscap SystemCapability.Telephony.SmsMms 1540 * @systemapi Hide this for inner system use. 1541 * @since 8 1542 */ 1543 version: MmsVersionType; 1544 } 1545 1546 /** 1547 * Defines the original MMS message reading indication. 1548 * 1549 * @interface MmsReadOrigInd 1550 * @syscap SystemCapability.Telephony.SmsMms 1551 * @systemapi Hide this for inner system use. 1552 * @since 8 1553 */ 1554 export interface MmsReadOrigInd { 1555 /** 1556 * Indicates the version for the original MMS message reading indication. 1557 * 1558 * @type { MmsVersionType } 1559 * @syscap SystemCapability.Telephony.SmsMms 1560 * @systemapi Hide this for inner system use. 1561 * @since 8 1562 */ 1563 version: MmsVersionType; 1564 1565 /** 1566 * Indicates the message ID for the original MMS message reading indication. 1567 * 1568 * @type { string } 1569 * @syscap SystemCapability.Telephony.SmsMms 1570 * @systemapi Hide this for inner system use. 1571 * @since 8 1572 */ 1573 messageId: string; 1574 1575 /** 1576 * Indicates the destination address for the original MMS message reading indication. 1577 * 1578 * @type { Array<MmsAddress> } 1579 * @syscap SystemCapability.Telephony.SmsMms 1580 * @systemapi Hide this for inner system use. 1581 * @since 8 1582 */ 1583 to: Array<MmsAddress>; 1584 1585 /** 1586 * Indicates the source address for the original MMS message reading indication. 1587 * 1588 * @type { MmsAddress } 1589 * @syscap SystemCapability.Telephony.SmsMms 1590 * @systemapi Hide this for inner system use. 1591 * @since 8 1592 */ 1593 from: MmsAddress; 1594 1595 /** 1596 * Indicates the date for the original MMS message reading indication. 1597 * 1598 * @type { number } 1599 * @syscap SystemCapability.Telephony.SmsMms 1600 * @systemapi Hide this for inner system use. 1601 * @since 8 1602 */ 1603 date: number; 1604 1605 /** 1606 * Indicates the read status for the original MMS message reading indication. 1607 * 1608 * @type { number } 1609 * @syscap SystemCapability.Telephony.SmsMms 1610 * @systemapi Hide this for inner system use. 1611 * @since 8 1612 */ 1613 readStatus: number; 1614 } 1615 1616 /** 1617 * Defines the MMS message reading indication. 1618 * 1619 * @interface MmsReadRecInd 1620 * @syscap SystemCapability.Telephony.SmsMms 1621 * @systemapi Hide this for inner system use. 1622 * @since 8 1623 */ 1624 export interface MmsReadRecInd { 1625 /** 1626 * Indicates the version for the MMS message reading indication. 1627 * 1628 * @type { MmsVersionType } 1629 * @syscap SystemCapability.Telephony.SmsMms 1630 * @systemapi Hide this for inner system use. 1631 * @since 8 1632 */ 1633 version: MmsVersionType; 1634 1635 /** 1636 * Indicates the message ID for the MMS message reading indication. 1637 * 1638 * @type { string } 1639 * @syscap SystemCapability.Telephony.SmsMms 1640 * @systemapi Hide this for inner system use. 1641 * @since 8 1642 */ 1643 messageId: string; 1644 1645 /** 1646 * Indicates the destination address for the MMS message reading indication. 1647 * 1648 * @type { Array<MmsAddress> } 1649 * @syscap SystemCapability.Telephony.SmsMms 1650 * @systemapi Hide this for inner system use. 1651 * @since 8 1652 */ 1653 to: Array<MmsAddress>; 1654 1655 /** 1656 * Indicates the source address for the MMS message reading indication. 1657 * 1658 * @type { MmsAddress } 1659 * @syscap SystemCapability.Telephony.SmsMms 1660 * @systemapi Hide this for inner system use. 1661 * @since 8 1662 */ 1663 from: MmsAddress; 1664 1665 /** 1666 * Indicates the read status for the MMS message reading indication. 1667 * 1668 * @type { number } 1669 * @syscap SystemCapability.Telephony.SmsMms 1670 * @systemapi Hide this for inner system use. 1671 * @since 8 1672 */ 1673 readStatus: number; 1674 1675 /** 1676 * Indicates the date for the MMS message reading indication. 1677 * 1678 * @type { ?number } 1679 * @syscap SystemCapability.Telephony.SmsMms 1680 * @systemapi Hide this for inner system use. 1681 * @since 8 1682 */ 1683 date?: number; 1684 } 1685 1686 /** 1687 * Defines the attachment of an MMS message. 1688 * 1689 * @interface MmsAttachment 1690 * @syscap SystemCapability.Telephony.SmsMms 1691 * @systemapi Hide this for inner system use. 1692 * @since 8 1693 */ 1694 export interface MmsAttachment { 1695 /** 1696 * Indicates the content ID for the attachment. 1697 * 1698 * @type { string } 1699 * @syscap SystemCapability.Telephony.SmsMms 1700 * @systemapi Hide this for inner system use. 1701 * @since 8 1702 */ 1703 contentId: string; 1704 1705 /** 1706 * Indicates the content location. 1707 * 1708 * @type { string } 1709 * @syscap SystemCapability.Telephony.SmsMms 1710 * @systemapi Hide this for inner system use. 1711 * @since 8 1712 */ 1713 contentLocation: string; 1714 1715 /** 1716 * Indicates the content disposition for the attachment. 1717 * 1718 * @type { DispositionType } 1719 * @syscap SystemCapability.Telephony.SmsMms 1720 * @systemapi Hide this for inner system use. 1721 * @since 8 1722 */ 1723 contentDisposition: DispositionType; 1724 1725 /** 1726 * Indicates the encoding for content transfer. 1727 * 1728 * @type { string } 1729 * @syscap SystemCapability.Telephony.SmsMms 1730 * @systemapi Hide this for inner system use. 1731 * @since 8 1732 */ 1733 contentTransferEncoding: string; 1734 1735 /** 1736 * Indicates the content type for the attachment. 1737 * 1738 * @type { string } 1739 * @syscap SystemCapability.Telephony.SmsMms 1740 * @systemapi Hide this for inner system use. 1741 * @since 8 1742 */ 1743 contentType: string; 1744 1745 /** 1746 * Indicates whether the synchronized multimedia integration language is used. 1747 * 1748 * @type { boolean } 1749 * @syscap SystemCapability.Telephony.SmsMms 1750 * @systemapi Hide this for inner system use. 1751 * @since 8 1752 */ 1753 isSmil: boolean; 1754 1755 /** 1756 * Indicates the path for the attachment. 1757 * 1758 * @type { ?string } 1759 * @syscap SystemCapability.Telephony.SmsMms 1760 * @systemapi Hide this for inner system use. 1761 * @since 8 1762 */ 1763 path?: string; 1764 1765 /** 1766 * Indicates whether the message is in the buffer. 1767 * 1768 * @type { ?Array<number> } 1769 * @syscap SystemCapability.Telephony.SmsMms 1770 * @systemapi Hide this for inner system use. 1771 * @since 8 1772 */ 1773 inBuff?: Array<number>; 1774 1775 /** 1776 * Indicates the file name for the attachment. 1777 * 1778 * @type { ?string } 1779 * @syscap SystemCapability.Telephony.SmsMms 1780 * @systemapi Hide this for inner system use. 1781 * @since 8 1782 */ 1783 fileName?: string; 1784 1785 /** 1786 * Indicates the character set for the attachment. 1787 * 1788 * @type { ?MmsCharSets } 1789 * @syscap SystemCapability.Telephony.SmsMms 1790 * @systemapi Hide this for inner system use. 1791 * @since 8 1792 */ 1793 charset?: MmsCharSets; 1794 } 1795 1796 /** 1797 * Defines an MMSC address. 1798 * 1799 * @interface MmsAddress 1800 * @syscap SystemCapability.Telephony.SmsMms 1801 * @systemapi Hide this for inner system use. 1802 * @since 8 1803 */ 1804 export interface MmsAddress { 1805 /** 1806 * Indicates the network address for the MMSC address. 1807 * 1808 * @type { string } 1809 * @syscap SystemCapability.Telephony.SmsMms 1810 * @systemapi Hide this for inner system use. 1811 * @since 8 1812 */ 1813 address: string; 1814 1815 /** 1816 * Indicates the character set for the MMSC address. 1817 * 1818 * @type { MmsCharSets } 1819 * @syscap SystemCapability.Telephony.SmsMms 1820 * @systemapi Hide this for inner system use. 1821 * @since 8 1822 */ 1823 charset: MmsCharSets; 1824 } 1825 1826 /** 1827 * Enumerates message type. 1828 * 1829 * @enum { number } 1830 * @syscap SystemCapability.Telephony.SmsMms 1831 * @systemapi Hide this for inner system use. 1832 * @since 8 1833 */ 1834 export enum MessageType { 1835 /** 1836 * Indicates an MMS message sending request. 1837 * 1838 * @syscap SystemCapability.Telephony.SmsMms 1839 * @systemapi Hide this for inner system use. 1840 * @since 8 1841 */ 1842 TYPE_MMS_SEND_REQ = 128, 1843 1844 /** 1845 * Indicates an MMS message sending configuration. 1846 * 1847 * @syscap SystemCapability.Telephony.SmsMms 1848 * @systemapi Hide this for inner system use. 1849 * @since 8 1850 */ 1851 TYPE_MMS_SEND_CONF, 1852 1853 /** 1854 * Indicates an MMS notification. 1855 * 1856 * @syscap SystemCapability.Telephony.SmsMms 1857 * @systemapi Hide this for inner system use. 1858 * @since 8 1859 */ 1860 TYPE_MMS_NOTIFICATION_IND, 1861 1862 /** 1863 * Indicates an MMS message response. 1864 * 1865 * @syscap SystemCapability.Telephony.SmsMms 1866 * @systemapi Hide this for inner system use. 1867 * @since 8 1868 */ 1869 TYPE_MMS_RESP_IND, 1870 1871 /** 1872 * Indicates an MMS message retrieval configuration. 1873 * 1874 * @syscap SystemCapability.Telephony.SmsMms 1875 * @systemapi Hide this for inner system use. 1876 * @since 8 1877 */ 1878 TYPE_MMS_RETRIEVE_CONF, 1879 1880 /** 1881 * Indicates the type of multimedia message confirmation index. 1882 * 1883 * @syscap SystemCapability.Telephony.SmsMms 1884 * @systemapi Hide this for inner system use. 1885 * @since 8 1886 */ 1887 TYPE_MMS_ACKNOWLEDGE_IND, 1888 1889 /** 1890 * Indicates an MMS message delivery. 1891 * 1892 * @syscap SystemCapability.Telephony.SmsMms 1893 * @systemapi Hide this for inner system use. 1894 * @since 8 1895 */ 1896 TYPE_MMS_DELIVERY_IND, 1897 1898 /** 1899 * Indicates an MMS message read report on the recipient side. 1900 * 1901 * @syscap SystemCapability.Telephony.SmsMms 1902 * @systemapi Hide this for inner system use. 1903 * @since 8 1904 */ 1905 TYPE_MMS_READ_REC_IND, 1906 1907 /** 1908 * Indicates an original MMS message read report on the originating side. 1909 * 1910 * @syscap SystemCapability.Telephony.SmsMms 1911 * @systemapi Hide this for inner system use. 1912 * @since 8 1913 */ 1914 TYPE_MMS_READ_ORIG_IND, 1915 } 1916 1917 /** 1918 * Enumerates MMS fail code. 1919 * 1920 * @enum { number } 1921 * @syscap SystemCapability.Telephony.SmsMms 1922 * @since 9 1923 */ 1924 export enum MmsFailCode { 1925 /** 1926 * Indicates that no error occurred during send or download MMS. 1927 * 1928 * @syscap SystemCapability.Telephony.SmsMms 1929 * @since 9 1930 */ 1931 MMS_FAIL_NONE_ERROR = 0, 1932 1933 /** 1934 * Indicates an unknown error occurred during send or download MMS. 1935 * 1936 * @syscap SystemCapability.Telephony.SmsMms 1937 * @since 9 1938 */ 1939 MMS_FAIL_UNKNOWN_ERROR, 1940 1941 /** 1942 * Indicates an apn invalid error occurred during the MMS network setup. 1943 * 1944 * @syscap SystemCapability.Telephony.SmsMms 1945 * @since 9 1946 */ 1947 MMS_FAIL_APN_INVALID, 1948 1949 /** 1950 * Indicates an error occurred during the MMS connection setup. 1951 * 1952 * @syscap SystemCapability.Telephony.SmsMms 1953 * @since 9 1954 */ 1955 MMS_FAIL_CONNECT_MMS_ERROR, 1956 1957 /** 1958 * Indicates an error occurred during the HTTP client setup. 1959 * 1960 * @syscap SystemCapability.Telephony.SmsMms 1961 * @since 9 1962 */ 1963 MMS_FAIL_HTTP_ERROR, 1964 1965 /** 1966 * Indicates an I/O error occurred during reading the PDU. 1967 * 1968 * @syscap SystemCapability.Telephony.SmsMms 1969 * @since 9 1970 */ 1971 MMS_FAIL_IO_ERROR, 1972 1973 /** 1974 * Indicates an error occurred while retrying sending or downloading the MMS. 1975 * 1976 * @syscap SystemCapability.Telephony.SmsMms 1977 * @since 9 1978 */ 1979 MMS_FAIL_RETRY_ERROR, 1980 1981 /** 1982 * Indicates that the MMS configuration values could not be loaded. 1983 * 1984 * @syscap SystemCapability.Telephony.SmsMms 1985 * @since 9 1986 */ 1987 MMS_FAIL_CONFIGURATION_ERROR, 1988 1989 /** 1990 * Indicates that there is no data network for MMS. 1991 * 1992 * @syscap SystemCapability.Telephony.SmsMms 1993 * @since 9 1994 */ 1995 MMS_FAIL_DATA_NETWORK_ERROR, 1996 } 1997 1998 /** 1999 * Enumerates MMS message priorities. 2000 * 2001 * @enum { number } 2002 * @syscap SystemCapability.Telephony.SmsMms 2003 * @systemapi Hide this for inner system use. 2004 * @since 8 2005 */ 2006 export enum MmsPriorityType { 2007 /** 2008 * Indicates low priority. 2009 * 2010 * @syscap SystemCapability.Telephony.SmsMms 2011 * @systemapi Hide this for inner system use. 2012 * @since 8 2013 */ 2014 MMS_LOW = 128, 2015 2016 /** 2017 * Indicates normal priority. 2018 * 2019 * @syscap SystemCapability.Telephony.SmsMms 2020 * @systemapi Hide this for inner system use. 2021 * @since 8 2022 */ 2023 MMS_NORMAL, 2024 2025 /** 2026 * Indicates high priority. 2027 * 2028 * @syscap SystemCapability.Telephony.SmsMms 2029 * @systemapi Hide this for inner system use. 2030 * @since 8 2031 */ 2032 MMS_HIGH, 2033 } 2034 2035 /** 2036 * Enumerates MMS versions. 2037 * 2038 * @enum { number } 2039 * @syscap SystemCapability.Telephony.SmsMms 2040 * @systemapi Hide this for inner system use. 2041 * @since 8 2042 */ 2043 export enum MmsVersionType { 2044 /** 2045 * Indicates MMS version 1_0. 2046 * 2047 * @syscap SystemCapability.Telephony.SmsMms 2048 * @systemapi Hide this for inner system use. 2049 * @since 8 2050 */ 2051 MMS_VERSION_1_0 = 0x10, 2052 2053 /** 2054 * Indicates MMS version 1_1. 2055 * 2056 * @syscap SystemCapability.Telephony.SmsMms 2057 * @systemapi Hide this for inner system use. 2058 * @since 8 2059 */ 2060 MMS_VERSION_1_1, 2061 2062 /** 2063 * Indicates MMS version 1_2. 2064 * 2065 * @syscap SystemCapability.Telephony.SmsMms 2066 * @systemapi Hide this for inner system use. 2067 * @since 8 2068 */ 2069 MMS_VERSION_1_2, 2070 2071 /** 2072 * Indicates MMS version 1_3. 2073 * 2074 * @syscap SystemCapability.Telephony.SmsMms 2075 * @systemapi Hide this for inner system use. 2076 * @since 8 2077 */ 2078 MMS_VERSION_1_3, 2079 } 2080 2081 /** 2082 * Enumerates MMS character sets. 2083 * 2084 * @enum { number } 2085 * @syscap SystemCapability.Telephony.SmsMms 2086 * @systemapi Hide this for inner system use. 2087 * @since 8 2088 */ 2089 export enum MmsCharSets { 2090 /** 2091 * Indicates the BIG5 format. 2092 * 2093 * @syscap SystemCapability.Telephony.SmsMms 2094 * @systemapi Hide this for inner system use. 2095 * @since 8 2096 */ 2097 BIG5 = 0X07EA, 2098 2099 /** 2100 * Indicates the ISO_10646_UCS_2 format. 2101 * 2102 * @syscap SystemCapability.Telephony.SmsMms 2103 * @systemapi Hide this for inner system use. 2104 * @since 8 2105 */ 2106 ISO_10646_UCS_2 = 0X03E8, 2107 2108 /** 2109 * Indicates the ISO_8859_1 format. 2110 * 2111 * @syscap SystemCapability.Telephony.SmsMms 2112 * @systemapi Hide this for inner system use. 2113 * @since 8 2114 */ 2115 ISO_8859_1 = 0X04, 2116 2117 /** 2118 * Indicates the ISO_8859_2 format. 2119 * 2120 * @syscap SystemCapability.Telephony.SmsMms 2121 * @systemapi Hide this for inner system use. 2122 * @since 8 2123 */ 2124 ISO_8859_2, 2125 2126 /** 2127 * Indicates the ISO_8859_3 format. 2128 * 2129 * @syscap SystemCapability.Telephony.SmsMms 2130 * @systemapi Hide this for inner system use. 2131 * @since 8 2132 */ 2133 ISO_8859_3, 2134 2135 /** 2136 * Indicates the ISO_8859_4 format. 2137 * 2138 * @syscap SystemCapability.Telephony.SmsMms 2139 * @systemapi Hide this for inner system use. 2140 * @since 8 2141 */ 2142 ISO_8859_4, 2143 2144 /** 2145 * Indicates the ISO_8859_5 format. 2146 * 2147 * @syscap SystemCapability.Telephony.SmsMms 2148 * @systemapi Hide this for inner system use. 2149 * @since 8 2150 */ 2151 ISO_8859_5, 2152 2153 /** 2154 * Indicates the ISO_8859_6 format. 2155 * 2156 * @syscap SystemCapability.Telephony.SmsMms 2157 * @systemapi Hide this for inner system use. 2158 * @since 8 2159 */ 2160 ISO_8859_6, 2161 2162 /** 2163 * Indicates the ISO_8859_7 format. 2164 * 2165 * @syscap SystemCapability.Telephony.SmsMms 2166 * @systemapi Hide this for inner system use. 2167 * @since 8 2168 */ 2169 ISO_8859_7, 2170 2171 /** 2172 * Indicates the ISO_8859_8 format. 2173 * 2174 * @syscap SystemCapability.Telephony.SmsMms 2175 * @systemapi Hide this for inner system use. 2176 * @since 8 2177 */ 2178 ISO_8859_8, 2179 2180 /** 2181 * Indicates the ISO_8859_9 format. 2182 * 2183 * @syscap SystemCapability.Telephony.SmsMms 2184 * @systemapi Hide this for inner system use. 2185 * @since 8 2186 */ 2187 ISO_8859_9, 2188 2189 /** 2190 * Indicates the SHIFT_JIS format. 2191 * 2192 * @syscap SystemCapability.Telephony.SmsMms 2193 * @systemapi Hide this for inner system use. 2194 * @since 8 2195 */ 2196 SHIFT_JIS = 0X11, 2197 2198 /** 2199 * Indicates the US_ASCII format. 2200 * 2201 * @syscap SystemCapability.Telephony.SmsMms 2202 * @systemapi Hide this for inner system use. 2203 * @since 8 2204 */ 2205 US_ASCII = 0X03, 2206 2207 /** 2208 * Indicates the UTF_8 format. 2209 * 2210 * @syscap SystemCapability.Telephony.SmsMms 2211 * @systemapi Hide this for inner system use. 2212 * @since 8 2213 */ 2214 UTF_8 = 0X6A, 2215 } 2216 2217 /** 2218 * Enumerates disposition types. 2219 * 2220 * @enum { number } 2221 * @syscap SystemCapability.Telephony.SmsMms 2222 * @systemapi Hide this for inner system use. 2223 * @since 8 2224 */ 2225 export enum DispositionType { 2226 /** 2227 * Indicates the data source type. 2228 * 2229 * @syscap SystemCapability.Telephony.SmsMms 2230 * @systemapi Hide this for inner system use. 2231 * @since 8 2232 */ 2233 FROM_DATA = 0, 2234 2235 /** 2236 * Indicates the attachment type. 2237 * 2238 * @syscap SystemCapability.Telephony.SmsMms 2239 * @systemapi Hide this for inner system use. 2240 * @since 8 2241 */ 2242 ATTACHMENT, 2243 2244 /** 2245 * Indicates the inlining type. 2246 * 2247 * @syscap SystemCapability.Telephony.SmsMms 2248 * @systemapi Hide this for inner system use. 2249 * @since 8 2250 */ 2251 INLINE, 2252 } 2253 2254 /** 2255 * Enumerates report types. 2256 * 2257 * @enum { number } 2258 * @syscap SystemCapability.Telephony.SmsMms 2259 * @systemapi Hide this for inner system use. 2260 * @since 8 2261 */ 2262 export enum ReportType { 2263 /** 2264 * Indicates that a report is required. 2265 * 2266 * @syscap SystemCapability.Telephony.SmsMms 2267 * @systemapi Hide this for inner system use. 2268 * @since 8 2269 */ 2270 MMS_YES = 128, 2271 2272 /** 2273 * Indicates that a report is not required. 2274 * 2275 * @syscap SystemCapability.Telephony.SmsMms 2276 * @systemapi Hide this for inner system use. 2277 * @since 8 2278 */ 2279 MMS_NO, 2280 } 2281 2282 /** 2283 * Defines the cell broadcast configuration options. 2284 * 2285 * @interface CBConfigOptions 2286 * @syscap SystemCapability.Telephony.SmsMms 2287 * @systemapi Hide this for inner system use. 2288 * @since 7 2289 */ 2290 export interface CBConfigOptions { 2291 /** 2292 * Indicates the card slot ID for the cell broadcast configuration options. 2293 * 2294 * @type { number } 2295 * @syscap SystemCapability.Telephony.SmsMms 2296 * @systemapi Hide this for inner system use. 2297 * @since 7 2298 */ 2299 slotId: number; 2300 2301 /** 2302 * Indicates whether to enable cell broadcast. 2303 * 2304 * @type { boolean } 2305 * @syscap SystemCapability.Telephony.SmsMms 2306 * @systemapi Hide this for inner system use. 2307 * @since 7 2308 */ 2309 enable: boolean; 2310 2311 /** 2312 * Indicates the start message ID for the cell broadcast configuration options. 2313 * 2314 * @type { number } 2315 * @syscap SystemCapability.Telephony.SmsMms 2316 * @systemapi Hide this for inner system use. 2317 * @since 7 2318 */ 2319 startMessageId: number; 2320 2321 /** 2322 * Indicates the end message ID for the cell broadcast configuration options. 2323 * 2324 * @type { number } 2325 * @syscap SystemCapability.Telephony.SmsMms 2326 * @systemapi Hide this for inner system use. 2327 * @since 7 2328 */ 2329 endMessageId: number; 2330 2331 /** 2332 * Indicates the RAN type for the cell broadcast configuration options. 2333 * 2334 * @type { RanType } 2335 * @syscap SystemCapability.Telephony.SmsMms 2336 * @systemapi Hide this for inner system use. 2337 * @since 7 2338 */ 2339 ranType: RanType; 2340 } 2341 2342 /** 2343 * Defines the SIM message options. 2344 * 2345 * @interface SimMessageOptions 2346 * @syscap SystemCapability.Telephony.SmsMms 2347 * @systemapi Hide this for inner system use. 2348 * @since 7 2349 */ 2350 export interface SimMessageOptions { 2351 /** 2352 * Indicates the card slot ID for the SIM message options. 2353 * 2354 * @type { number } 2355 * @syscap SystemCapability.Telephony.SmsMms 2356 * @systemapi Hide this for inner system use. 2357 * @since 7 2358 */ 2359 slotId: number; 2360 2361 /** 2362 * Indicates the short message service center for the SIM message options. 2363 * 2364 * @type { string } 2365 * @syscap SystemCapability.Telephony.SmsMms 2366 * @systemapi Hide this for inner system use. 2367 * @since 7 2368 */ 2369 smsc: string; 2370 2371 /** 2372 * Indicates the protocol data unit for the SIM message options. 2373 * 2374 * @type { string } 2375 * @syscap SystemCapability.Telephony.SmsMms 2376 * @systemapi Hide this for inner system use. 2377 * @since 7 2378 */ 2379 pdu: string; 2380 2381 /** 2382 * Indicates the status for the SIM message options. 2383 * 2384 * @type { SimMessageStatus } 2385 * @syscap SystemCapability.Telephony.SmsMms 2386 * @systemapi Hide this for inner system use. 2387 * @since 7 2388 */ 2389 status: SimMessageStatus; 2390 } 2391 2392 /** 2393 * Defines the updating SIM message options. 2394 * 2395 * @interface UpdateSimMessageOptions 2396 * @syscap SystemCapability.Telephony.SmsMms 2397 * @systemapi Hide this for inner system use. 2398 * @since 7 2399 */ 2400 export interface UpdateSimMessageOptions { 2401 /** 2402 * Indicates the card slot ID for the updating SIM message options. 2403 * 2404 * @type { number } 2405 * @syscap SystemCapability.Telephony.SmsMms 2406 * @systemapi Hide this for inner system use. 2407 * @since 7 2408 */ 2409 slotId: number; 2410 2411 /** 2412 * Indicates the message index for the updating SIM message options. 2413 * 2414 * @type { number } 2415 * @syscap SystemCapability.Telephony.SmsMms 2416 * @systemapi Hide this for inner system use. 2417 * @since 7 2418 */ 2419 msgIndex: number; 2420 2421 /** 2422 * Indicates the new status for the updating SIM message options. 2423 * 2424 * @type { SimMessageStatus } 2425 * @syscap SystemCapability.Telephony.SmsMms 2426 * @systemapi Hide this for inner system use. 2427 * @since 7 2428 */ 2429 newStatus: SimMessageStatus; 2430 2431 /** 2432 * Indicates the protocol data unit for the updating SIM message options. 2433 * 2434 * @type { string } 2435 * @syscap SystemCapability.Telephony.SmsMms 2436 * @systemapi Hide this for inner system use. 2437 * @since 7 2438 */ 2439 pdu: string; 2440 2441 /** 2442 * Indicates the short message service center for the updating SIM message options. 2443 * 2444 * @type { string } 2445 * @syscap SystemCapability.Telephony.SmsMms 2446 * @systemapi Hide this for inner system use. 2447 * @since 7 2448 */ 2449 smsc: string; 2450 } 2451 2452 /** 2453 * Defines an SMS message instance. 2454 * 2455 * @interface ShortMessage 2456 * @syscap SystemCapability.Telephony.SmsMms 2457 * @since 6 2458 */ 2459 export interface ShortMessage { 2460 /** 2461 * Indicates the SMS message body. 2462 * 2463 * @type { string } 2464 * @syscap SystemCapability.Telephony.SmsMms 2465 * @since 6 2466 */ 2467 visibleMessageBody: string; 2468 2469 /** 2470 * Indicates the address of the sender, which is to be displayed on the UI. 2471 * 2472 * @type { string } 2473 * @syscap SystemCapability.Telephony.SmsMms 2474 * @since 6 2475 */ 2476 visibleRawAddress: string; 2477 2478 /** 2479 * Indicates the SMS type. 2480 * 2481 * @type { ShortMessageClass } 2482 * @syscap SystemCapability.Telephony.SmsMms 2483 * @since 6 2484 */ 2485 messageClass: ShortMessageClass; 2486 2487 /** 2488 * Indicates the protocol identifier. 2489 * 2490 * @type { number } 2491 * @syscap SystemCapability.Telephony.SmsMms 2492 * @since 6 2493 */ 2494 protocolId: number; 2495 2496 /** 2497 * Indicates the short message service center (SMSC) address. 2498 * 2499 * @type { string } 2500 * @syscap SystemCapability.Telephony.SmsMms 2501 * @since 6 2502 */ 2503 scAddress: string; 2504 2505 /** 2506 * Indicates the SMSC timestamp. 2507 * 2508 * @type { number } 2509 * @syscap SystemCapability.Telephony.SmsMms 2510 * @since 6 2511 */ 2512 scTimestamp: number; 2513 2514 /** 2515 * Indicates whether the received SMS is a "replace short message". 2516 * 2517 * @type { boolean } 2518 * @syscap SystemCapability.Telephony.SmsMms 2519 * @since 6 2520 */ 2521 isReplaceMessage: boolean; 2522 2523 /** 2524 * Indicates whether the received SMS contains "TP-Reply-Path". 2525 * 2526 * @type { boolean } 2527 * @syscap SystemCapability.Telephony.SmsMms 2528 * @since 6 2529 */ 2530 hasReplyPath: boolean; 2531 2532 /** 2533 * Indicates Protocol Data Units (PDUs) from an SMS message. 2534 * 2535 * @type { Array<number> } 2536 * @syscap SystemCapability.Telephony.SmsMms 2537 * @since 6 2538 */ 2539 pdu: Array<number>; 2540 2541 /** 2542 * Indicates the SMS message status from the SMS-STATUS-REPORT message sent by the 2543 * Short Message Service Center (SMSC). 2544 * 2545 * @type { number } 2546 * @syscap SystemCapability.Telephony.SmsMms 2547 * @since 6 2548 */ 2549 status: number; 2550 2551 /** 2552 * Indicates whether the current message is SMS-STATUS-REPORT. 2553 * 2554 * @type { boolean } 2555 * @syscap SystemCapability.Telephony.SmsMms 2556 * @since 6 2557 */ 2558 isSmsStatusReportMessage: boolean; 2559 } 2560 2561 /** 2562 * Defines a SIM message. 2563 * 2564 * @interface SimShortMessage 2565 * @syscap SystemCapability.Telephony.SmsMms 2566 * @systemapi Hide this for inner system use. 2567 * @since 7 2568 */ 2569 export interface SimShortMessage { 2570 /** 2571 * Indicates the SMS message in the SIM. 2572 * 2573 * @type { ShortMessage } 2574 * @syscap SystemCapability.Telephony.SmsMms 2575 * @systemapi Hide this for inner system use. 2576 * @since 7 2577 */ 2578 shortMessage: ShortMessage; 2579 2580 /** 2581 * Indicates the storage status of SMS messages in the SIM. 2582 * 2583 * @type { SimMessageStatus } 2584 * @syscap SystemCapability.Telephony.SmsMms 2585 * @systemapi Hide this for inner system use. 2586 * @since 7 2587 */ 2588 simMessageStatus: SimMessageStatus; 2589 2590 /** 2591 * Indicates the index of SMS messages in the SIM. 2592 * 2593 * @type { number } 2594 * @syscap SystemCapability.Telephony.SmsMms 2595 * @systemapi Hide this for inner system use. 2596 * @since 7 2597 */ 2598 indexOnSim: number; 2599 } 2600 2601 /** 2602 * Defines the SIM message status. 2603 * 2604 * @enum { number } 2605 * @syscap SystemCapability.Telephony.SmsMms 2606 * @systemapi Hide this for inner system use. 2607 * @since 7 2608 */ 2609 export enum SimMessageStatus { 2610 /** 2611 * Status free space on SIM. 2612 * 2613 * @syscap SystemCapability.Telephony.SmsMms 2614 * @systemapi Hide this for inner system use. 2615 * @since 7 2616 */ 2617 SIM_MESSAGE_STATUS_FREE = 0, 2618 2619 /** 2620 * Indicates a read message. 2621 * 2622 * @syscap SystemCapability.Telephony.SmsMms 2623 * @systemapi Hide this for inner system use. 2624 * @since 7 2625 */ 2626 SIM_MESSAGE_STATUS_READ = 1, 2627 2628 /** 2629 * Indicates an unread message. 2630 * 2631 * @syscap SystemCapability.Telephony.SmsMms 2632 * @systemapi Hide this for inner system use. 2633 * @since 7 2634 */ 2635 SIM_MESSAGE_STATUS_UNREAD = 3, 2636 2637 /** 2638 * Indicates a sent message (only applicable to SMS). 2639 * 2640 * @syscap SystemCapability.Telephony.SmsMms 2641 * @systemapi Hide this for inner system use. 2642 * @since 7 2643 */ 2644 SIM_MESSAGE_STATUS_SENT = 5, 2645 2646 /** 2647 * Indicates an unsent message (only applicable to SMS). 2648 * 2649 * @syscap SystemCapability.Telephony.SmsMms 2650 * @systemapi Hide this for inner system use. 2651 * @since 7 2652 */ 2653 SIM_MESSAGE_STATUS_UNSENT = 7, 2654 } 2655 2656 /** 2657 * Enumerates SMS message types. 2658 * 2659 * @enum { number } 2660 * @syscap SystemCapability.Telephony.SmsMms 2661 * @since 6 2662 */ 2663 export enum ShortMessageClass { 2664 /** 2665 * Indicates an unknown type. 2666 * 2667 * @syscap SystemCapability.Telephony.SmsMms 2668 * @since 6 2669 */ 2670 UNKNOWN, 2671 2672 /** 2673 * Indicates an instant message, which is displayed immediately after being received. 2674 * 2675 * @syscap SystemCapability.Telephony.SmsMms 2676 * @since 6 2677 */ 2678 INSTANT_MESSAGE, 2679 2680 /** 2681 * Indicates an SMS message that can be stored on the device or SIM card based on the storage status. 2682 * 2683 * @syscap SystemCapability.Telephony.SmsMms 2684 * @since 6 2685 */ 2686 OPTIONAL_MESSAGE, 2687 2688 /** 2689 * Indicates an SMS message containing SIM card information, which is to be stored in a SIM card. 2690 * 2691 * @syscap SystemCapability.Telephony.SmsMms 2692 * @since 6 2693 */ 2694 SIM_MESSAGE, 2695 2696 /** 2697 * Indicates an SMS message to be forwarded to another device. 2698 * 2699 * @syscap SystemCapability.Telephony.SmsMms 2700 * @since 6 2701 */ 2702 FORWARD_MESSAGE 2703 } 2704 2705 /** 2706 * Provides the options (including callbacks) for sending an SMS message. 2707 * 2708 * @interface SendMessageOptions 2709 * @syscap SystemCapability.Telephony.SmsMms 2710 * @since 6 2711 */ 2712 export interface SendMessageOptions { 2713 /** 2714 * Indicates the ID of the SIM card slot used for sending the SMS message. 2715 * 2716 * @type { number } 2717 * @syscap SystemCapability.Telephony.SmsMms 2718 * @since 6 2719 */ 2720 slotId: number; 2721 2722 /** 2723 * Indicates the address to which the SMS message is sent. 2724 * 2725 * @type { string } 2726 * @syscap SystemCapability.Telephony.SmsMms 2727 * @since 6 2728 */ 2729 destinationHost: string; 2730 2731 /** 2732 * Indicates the SMSC address. If the value is {@code null}, the default SMSC address of the SIM card. 2733 * 2734 * @type { ?string } 2735 * @syscap SystemCapability.Telephony.SmsMms 2736 * @since 6 2737 */ 2738 serviceCenter?: string; 2739 2740 /** 2741 * If the content is a string, this is a short message. If the content is a byte array, this is a data message. 2742 * 2743 * @type { string | Array<number> } 2744 * @syscap SystemCapability.Telephony.SmsMms 2745 * @since 6 2746 */ 2747 content: string | Array<number>; 2748 2749 /** 2750 * If send data message, destinationPort is mandatory. Otherwise is optional. 2751 * 2752 * @type { ?number } 2753 * @syscap SystemCapability.Telephony.SmsMms 2754 * @since 6 2755 */ 2756 destinationPort?: number; 2757 2758 /** 2759 * Indicates the callback invoked after the SMS message is sent. 2760 * 2761 * @type { ?AsyncCallback<ISendShortMessageCallback> } 2762 * @syscap SystemCapability.Telephony.SmsMms 2763 * @since 6 2764 */ 2765 sendCallback?: AsyncCallback<ISendShortMessageCallback>; 2766 2767 /** 2768 * Indicates the callback invoked after the SMS message is delivered. 2769 * 2770 * @type { ?AsyncCallback<IDeliveryShortMessageCallback> } 2771 * @syscap SystemCapability.Telephony.SmsMms 2772 * @since 6 2773 */ 2774 deliveryCallback?: AsyncCallback<IDeliveryShortMessageCallback>; 2775 } 2776 2777 /** 2778 * Provides the callback for the SMS message sending result. 2779 * 2780 * @interface ISendShortMessageCallback 2781 * @syscap SystemCapability.Telephony.SmsMms 2782 * @since 6 2783 */ 2784 export interface ISendShortMessageCallback { 2785 /** 2786 * Indicates the SMS message sending result. 2787 * 2788 * @type { SendSmsResult } 2789 * @syscap SystemCapability.Telephony.SmsMms 2790 * @since 6 2791 */ 2792 result: SendSmsResult; 2793 2794 /** 2795 * Indicates the URI to store the sent SMS message. 2796 * 2797 * @type { string } 2798 * @syscap SystemCapability.Telephony.SmsMms 2799 * @since 6 2800 */ 2801 url: string; 2802 2803 /** 2804 * Specifies whether this is the last part of a multi-part SMS message. 2805 * 2806 * @type { boolean } 2807 * @syscap SystemCapability.Telephony.SmsMms 2808 * @since 6 2809 */ 2810 isLastPart: boolean; 2811 } 2812 2813 /** 2814 * Provides the callback for the SMS message delivery report. 2815 * 2816 * @interface IDeliveryShortMessageCallback 2817 * @syscap SystemCapability.Telephony.SmsMms 2818 * @since 6 2819 */ 2820 export interface IDeliveryShortMessageCallback { 2821 /** 2822 * Indicates the SMS delivery report. 2823 * 2824 * @type { Array<number> } 2825 * @syscap SystemCapability.Telephony.SmsMms 2826 * @since 6 2827 */ 2828 pdu: Array<number>; 2829 } 2830 2831 /** 2832 * Enumerates SMS message sending results. 2833 * 2834 * @enum { number } 2835 * @syscap SystemCapability.Telephony.SmsMms 2836 * @since 6 2837 */ 2838 export enum SendSmsResult { 2839 /** 2840 * Indicates that the SMS message is successfully sent. 2841 * 2842 * @syscap SystemCapability.Telephony.SmsMms 2843 * @since 6 2844 */ 2845 SEND_SMS_SUCCESS = 0, 2846 2847 /** 2848 * Indicates that sending the SMS message fails due to an unknown reason. 2849 * 2850 * @syscap SystemCapability.Telephony.SmsMms 2851 * @since 6 2852 */ 2853 SEND_SMS_FAILURE_UNKNOWN = 1, 2854 2855 /** 2856 * Indicates that sending the SMS fails because the modem is powered off. 2857 * 2858 * @syscap SystemCapability.Telephony.SmsMms 2859 * @since 6 2860 */ 2861 SEND_SMS_FAILURE_RADIO_OFF = 2, 2862 2863 /** 2864 * Indicates that sending the SMS message fails because the network is unavailable 2865 * or does not support sending or reception of SMS messages. 2866 * 2867 * @syscap SystemCapability.Telephony.SmsMms 2868 * @since 6 2869 */ 2870 SEND_SMS_FAILURE_SERVICE_UNAVAILABLE = 3 2871 } 2872 2873 /** 2874 * Enumerates RAN type. 2875 * 2876 * @enum { number } 2877 * @syscap SystemCapability.Telephony.SmsMms 2878 * @systemapi Hide this for inner system use. 2879 * @since 7 2880 */ 2881 export enum RanType { 2882 /** 2883 * Indicates GSM type. 2884 * 2885 * @syscap SystemCapability.Telephony.SmsMms 2886 * @systemapi Hide this for inner system use. 2887 * @since 7 2888 */ 2889 TYPE_GSM = 1, 2890 2891 /** 2892 * Indicates CDMA type. 2893 * 2894 * @syscap SystemCapability.Telephony.SmsMms 2895 * @systemapi Hide this for inner system use. 2896 * @since 7 2897 */ 2898 TYPE_CDMA = 2, 2899 } 2900 2901 /** 2902 * Defines the SMS message segment information. 2903 * 2904 * @interface SmsSegmentsInfo 2905 * @syscap SystemCapability.Telephony.SmsMms 2906 * @systemapi Hide this for inner system use. 2907 * @since 8 2908 */ 2909 export interface SmsSegmentsInfo { 2910 /** 2911 * Indicates the split count for the SMS message segment information. 2912 * 2913 * @type { number } 2914 * @syscap SystemCapability.Telephony.SmsMms 2915 * @systemapi Hide this for inner system use. 2916 * @since 8 2917 */ 2918 splitCount: number; 2919 2920 /** 2921 * Indicates the encoding count for the SMS message segment information. 2922 * 2923 * @type { number } 2924 * @syscap SystemCapability.Telephony.SmsMms 2925 * @systemapi Hide this for inner system use. 2926 * @since 8 2927 */ 2928 encodeCount: number; 2929 2930 /** 2931 * Indicates the remaining encoding count for the SMS message segment information. 2932 * 2933 * @type { number } 2934 * @syscap SystemCapability.Telephony.SmsMms 2935 * @systemapi Hide this for inner system use. 2936 * @since 8 2937 */ 2938 encodeCountRemaining: number; 2939 2940 /** 2941 * Indicates the encoding scheme for the SMS message segment information. 2942 * 2943 * @type { SmsEncodingScheme } 2944 * @syscap SystemCapability.Telephony.SmsMms 2945 * @systemapi Hide this for inner system use. 2946 * @since 8 2947 */ 2948 scheme: SmsEncodingScheme; 2949 } 2950 2951 /** 2952 * Enumerates SMS encoding schemes. 2953 * 2954 * @enum { number } 2955 * @syscap SystemCapability.Telephony.SmsMms 2956 * @systemapi Hide this for inner system use. 2957 * @since 8 2958 */ 2959 export enum SmsEncodingScheme { 2960 /** 2961 * Indicates an unknown encoding schemes. 2962 * 2963 * @syscap SystemCapability.Telephony.SmsMms 2964 * @systemapi Hide this for inner system use. 2965 * @since 8 2966 */ 2967 SMS_ENCODING_UNKNOWN = 0, 2968 2969 /** 2970 * Indicates that the encoding schemes is 7-digit. 2971 * 2972 * @syscap SystemCapability.Telephony.SmsMms 2973 * @systemapi Hide this for inner system use. 2974 * @since 8 2975 */ 2976 SMS_ENCODING_7BIT, 2977 2978 /** 2979 * Indicates that the encoding schemes is 8-digit. 2980 * 2981 * @syscap SystemCapability.Telephony.SmsMms 2982 * @systemapi Hide this for inner system use. 2983 * @since 8 2984 */ 2985 SMS_ENCODING_8BIT, 2986 2987 /** 2988 * Indicates that the encoding schemes is 16-digit. 2989 * 2990 * @syscap SystemCapability.Telephony.SmsMms 2991 * @systemapi Hide this for inner system use. 2992 * @since 8 2993 */ 2994 SMS_ENCODING_16BIT, 2995 } 2996} 2997 2998export default sms; 2999