1/* 2 * Copyright (c) 2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16import { PhotoMode } from '@ohos/photo' 17import { VideoMode } from '@ohos/video' 18import { MultiMode } from '@ohos/multi' 19import { FunctionId } from '@ohos/common/src/main/ets/default/featureservice/FunctionId' 20import { IModeMap } from '@ohos/common/src/main/ets/default/featureservice/IModeMap' 21 22export class ModeMap implements IModeMap { 23 private TAG: string = '[Mode]:' 24 private photoMode: PhotoMode = new PhotoMode() 25 private videoMode: VideoMode = new VideoMode() 26 private multiMode: MultiMode = new MultiMode() 27 28 public getFunctions(mode: string): FunctionId[] { 29 switch (mode) { 30 case 'PHOTO': 31 return this.photoMode.getFunctions() 32 break; 33 case 'VIDEO': 34 return this.videoMode.getFunctions() 35 break; 36 case 'MULTI': 37 return this.multiMode.getFunctions() 38 break; 39 default: 40 return [] 41 } 42 } 43}