18779efd5Sopenharmony_ci/**
28779efd5Sopenharmony_ci * Copyright (c) 2022 Huawei Device Co., Ltd.
38779efd5Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
48779efd5Sopenharmony_ci * you may not use this file except in compliance with the License.
58779efd5Sopenharmony_ci * You may obtain a copy of the License at
68779efd5Sopenharmony_ci *
78779efd5Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
88779efd5Sopenharmony_ci *
98779efd5Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
108779efd5Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
118779efd5Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
128779efd5Sopenharmony_ci * See the License for the specific language governing permissions and
138779efd5Sopenharmony_ci * limitations under the License.
148779efd5Sopenharmony_ci */
158779efd5Sopenharmony_ci
168779efd5Sopenharmony_ciimport DataType from './DataType';
178779efd5Sopenharmony_ciimport {DataItemType} from './DataType';
188779efd5Sopenharmony_ci
198779efd5Sopenharmony_ci/**
208779efd5Sopenharmony_ci * Phone Data Type
218779efd5Sopenharmony_ci */
228779efd5Sopenharmony_ciexport class Phone extends DataType {
238779efd5Sopenharmony_ci  static readonly CONTENT_ITEM_TYPE: string = 'phone';
248779efd5Sopenharmony_ci  static readonly CONTENT_ITEM_TYPE_ID: number = DataItemType.PHONE;
258779efd5Sopenharmony_ci  static readonly NUMBER: string = DataType.DATA;
268779efd5Sopenharmony_ci  static readonly TYPE_MOBILE: number = 1;
278779efd5Sopenharmony_ci  static readonly TYPE_HOME: number = 2;
288779efd5Sopenharmony_ci  static readonly TYPE_WORK: number = 3;
298779efd5Sopenharmony_ci  static readonly TYPE_FAX_WORK: number = 4;
308779efd5Sopenharmony_ci  static readonly TYPE_FAX_HOME: number = 5;
318779efd5Sopenharmony_ci  static readonly TYPE_PAGER: number = 6;
328779efd5Sopenharmony_ci  static readonly TYPE_OTHER: number = 7;
338779efd5Sopenharmony_ci  static readonly TYPE_MAIN: number = 12;
348779efd5Sopenharmony_ci  static readonly TYPE_CUSTOM: number = 99;
358779efd5Sopenharmony_ci
368779efd5Sopenharmony_ci  static getTypeLabelResource(type: number) {
378779efd5Sopenharmony_ci    switch (type) {
388779efd5Sopenharmony_ci      case Phone.TYPE_HOME:
398779efd5Sopenharmony_ci        return $r('app.string.phone_type_home');
408779efd5Sopenharmony_ci      case Phone.TYPE_MOBILE:
418779efd5Sopenharmony_ci        return $r('app.string.phone_type_mobile');
428779efd5Sopenharmony_ci      case Phone.TYPE_WORK:
438779efd5Sopenharmony_ci        return $r('app.string.phone_type_work');
448779efd5Sopenharmony_ci      case Phone.TYPE_FAX_WORK:
458779efd5Sopenharmony_ci        return $r('app.string.phone_type_fax_work');
468779efd5Sopenharmony_ci      case Phone.TYPE_FAX_HOME:
478779efd5Sopenharmony_ci        return $r('app.string.phone_type_fax_home');
488779efd5Sopenharmony_ci      case Phone.TYPE_PAGER:
498779efd5Sopenharmony_ci        return $r('app.string.phone_type_pager');
508779efd5Sopenharmony_ci      case Phone.TYPE_OTHER:
518779efd5Sopenharmony_ci        return $r('app.string.phone_type_other');
528779efd5Sopenharmony_ci      case Phone.TYPE_MAIN:
538779efd5Sopenharmony_ci        return $r('app.string.phone_type_main');
548779efd5Sopenharmony_ci      default:
558779efd5Sopenharmony_ci        return $r('app.string.phone_type_custom');
568779efd5Sopenharmony_ci    }
578779efd5Sopenharmony_ci  }
588779efd5Sopenharmony_ci
598779efd5Sopenharmony_ci  constructor() {
608779efd5Sopenharmony_ci    super();
618779efd5Sopenharmony_ci  }
628779efd5Sopenharmony_ci}