• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/**
2 * Copyright (c) 2021-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 { CommonConstants } from '@ohos/common';
17import PadRecentsModeInfo from '../configs/PadRecentsModeInfo';
18import RecentModeFeatureConfig from './RecentModeFeatureConfig';
19
20/**
21 * Pad recents mode configuration.
22 */
23export default class RecentModePadConfig extends RecentModeFeatureConfig {
24
25  protected constructor() {
26    super();
27    this.mRecentMissionsRowType = PadRecentsModeInfo.padRecentMissionsRowConfig;
28  }
29
30  /**
31   * Get recent mode configuration instance.
32   *
33   * @return {object} RecentModePadConfig singleton
34   */
35  static getInstance(): RecentModePadConfig {
36    if (globalThis.RecentModePadConfigInstance == null) {
37      globalThis.RecentModePadConfigInstance = new RecentModePadConfig();
38      globalThis.RecentModePadConfigInstance.initConfig();
39    }
40    return globalThis.RecentModePadConfigInstance;
41  }
42
43  /**
44   * Get recent mode configuration level.
45   *
46   * @return {string} product-level layout configuration
47   */
48  getConfigLevel(): string {
49    return CommonConstants.LAYOUT_CONFIG_LEVEL_PRODUCT;
50  }
51}
52