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 - Relator 218779efd5Sopenharmony_ci */ 228779efd5Sopenharmony_ciexport class Relation extends DataType { 238779efd5Sopenharmony_ci static readonly CONTENT_ITEM_TYPE: string = 'relation'; 248779efd5Sopenharmony_ci static readonly CONTENT_ITEM_TYPE_ID: number = DataItemType.RELATION; 258779efd5Sopenharmony_ci static readonly NAME: string = DataType.DATA; 268779efd5Sopenharmony_ci static readonly TYPE_ASSISTANT: number = 1; 278779efd5Sopenharmony_ci static readonly TYPE_BROTHER: number = 2; 288779efd5Sopenharmony_ci static readonly TYPE_CHILD: number = 3; 298779efd5Sopenharmony_ci static readonly TYPE_PARTNER: number = 4; 308779efd5Sopenharmony_ci static readonly TYPE_FATHER: number= 5; 318779efd5Sopenharmony_ci static readonly TYPE_FRIEND: number = 6; 328779efd5Sopenharmony_ci static readonly TYPE_MANAGER: number = 7; 338779efd5Sopenharmony_ci static readonly TYPE_MOTHER: number = 8 348779efd5Sopenharmony_ci static readonly TYPE_PARENTS: number = 9; 358779efd5Sopenharmony_ci static readonly TYPE_DOMESTIC_PARTNER: number = 10; 368779efd5Sopenharmony_ci static readonly TYPE_REFERRED_BY: number = 11; 378779efd5Sopenharmony_ci static readonly TYPE_RELATIVE: number = 12; 388779efd5Sopenharmony_ci static readonly TYPE_SISTERS: number = 13; 398779efd5Sopenharmony_ci static readonly TYPE_SPOUSES: number = 14; 408779efd5Sopenharmony_ci 418779efd5Sopenharmony_ci static getTypeLabelResource(type: number) { 428779efd5Sopenharmony_ci switch (type) { 438779efd5Sopenharmony_ci case Relation.TYPE_CHILD: 448779efd5Sopenharmony_ci return $r('app.string.relationship_type_children'); 458779efd5Sopenharmony_ci case Relation.TYPE_DOMESTIC_PARTNER: 468779efd5Sopenharmony_ci return $r('app.string.relationship_type_partner'); 478779efd5Sopenharmony_ci case Relation.TYPE_ASSISTANT: 488779efd5Sopenharmony_ci return $r('app.string.relationship_type_assistant'); 498779efd5Sopenharmony_ci case Relation.TYPE_BROTHER: 508779efd5Sopenharmony_ci return $r('app.string.relationship_type_brother'); 518779efd5Sopenharmony_ci case Relation.TYPE_PARTNER: 528779efd5Sopenharmony_ci return $r('app.string.relationship_type_mates'); 538779efd5Sopenharmony_ci case Relation.TYPE_FATHER: 548779efd5Sopenharmony_ci return $r('app.string.relationship_type_father'); 558779efd5Sopenharmony_ci case Relation.TYPE_FRIEND: 568779efd5Sopenharmony_ci return $r('app.string.relationship_type_friend'); 578779efd5Sopenharmony_ci case Relation.TYPE_MANAGER: 588779efd5Sopenharmony_ci return $r('app.string.relationship_type_bosses'); 598779efd5Sopenharmony_ci case Relation.TYPE_MOTHER: 608779efd5Sopenharmony_ci return $r('app.string.relationship_type_mother'); 618779efd5Sopenharmony_ci case Relation.TYPE_PARENTS: 628779efd5Sopenharmony_ci return $r('app.string.relationship_type_parents'); 638779efd5Sopenharmony_ci case Relation.TYPE_REFERRED_BY: 648779efd5Sopenharmony_ci return $r('app.string.relationship_type_introducer'); 658779efd5Sopenharmony_ci case Relation.TYPE_RELATIVE: 668779efd5Sopenharmony_ci return $r('app.string.relationship_type_kinship'); 678779efd5Sopenharmony_ci case Relation.TYPE_SISTERS: 688779efd5Sopenharmony_ci return $r('app.string.relationship_type_sisters'); 698779efd5Sopenharmony_ci case Relation.TYPE_SPOUSES: 708779efd5Sopenharmony_ci return $r('app.string.relationship_type_spouses'); 718779efd5Sopenharmony_ci case Relation.TYPE_CUSTOM: 728779efd5Sopenharmony_ci return $r('app.string.relationship_type_custom'); 738779efd5Sopenharmony_ci default: 748779efd5Sopenharmony_ci return $r('app.string.relationship_type_custom'); 758779efd5Sopenharmony_ci } 768779efd5Sopenharmony_ci } 778779efd5Sopenharmony_ci 788779efd5Sopenharmony_ci constructor() { 798779efd5Sopenharmony_ci super(); 808779efd5Sopenharmony_ci } 818779efd5Sopenharmony_ci}