1/** 2 * Copyright (c) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16import DataType from './DataType'; 17import {DataItemType} from './DataType'; 18 19/** 20 * Important Holiday Data Types 21 */ 22export class Event extends DataType { 23 static readonly CONTENT_ITEM_TYPE: string = 'contact_event'; 24 static readonly CONTENT_ITEM_TYPE_ID: number = DataItemType.EVENT; 25 static readonly START_DATE: string = DataType.DATA; 26 static readonly TYPE_ANNIVERSARY: number = 1; 27 static readonly TYPE_OTHER: number = 2; 28 static readonly TYPE_BIRTHDAY: number = 3; 29 static readonly TYPE_LUNARBIRTHDAY: number = 4; 30 31 static getTypeLabelResource(type: number) { 32 switch (type) { 33 case Event.TYPE_ANNIVERSARY: 34 return $r('app.string.phone_type_home'); 35 case Event.TYPE_BIRTHDAY: 36 return $r('app.string.phone_type_mobile'); 37 case Event.TYPE_OTHER: 38 return $r('app.string.phone_type_work'); 39 default: 40 return $r('app.string.phone_type_custom'); 41 } 42 } 43 44 constructor() { 45 super(); 46 } 47}