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 type { FunctionId } from '@ohos/common/src/main/ets/default/featureservice/FunctionId';
20import type { IModeMap } from '@ohos/common/src/main/ets/default/featureservice/IModeMap';
21
22export class ModeMap implements IModeMap {
23  private photoMode: PhotoMode = new PhotoMode();
24  private videoMode: VideoMode = new VideoMode();
25  private multiMode: MultiMode = new MultiMode();
26
27  public getFunctions(mode: string): FunctionId[] {
28    switch (mode) {
29      case 'PHOTO':
30        return this.photoMode.getFunctions();
31        break;
32      case 'VIDEO':
33        return this.videoMode.getFunctions();
34        break;
35      case 'MULTI':
36        return this.multiMode.getFunctions();
37        break;
38      default:
39        return [];
40    }
41  }
42}