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