• 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 */
15import { CommonConstants } from '@ohos/common';
16import { FormLayoutConfig } from '@ohos/common';
17import FormConstants from './constants/FormConstants';
18
19const TAG = 'FormDetailLayoutConfig';
20
21/**
22 * Form information data model.
23 */
24export class FormDetailLayoutConfig extends FormLayoutConfig{
25
26  private constructor() {
27    super();
28  }
29
30  /**
31   * Get form detail layout info object.
32   *
33   * @return Single instance of form data model
34   */
35  static getInstance(): FormDetailLayoutConfig {
36    if (globalThis.FormDetailLayoutConfigInstance == null) {
37      globalThis.FormDetailLayoutConfigInstance = new FormDetailLayoutConfig();
38      globalThis.FormDetailLayoutConfigInstance.initConfig();
39    }
40    return globalThis.FormDetailLayoutConfigInstance;
41  }
42
43  /**
44   * Init recent mode configuration.
45   */
46  initConfig(): void {
47  }
48
49  /**
50   * Get form detail layout configuration level.
51   *
52   * @return {string} feature-level layout configuration
53   */
54  getConfigLevel(): string {
55    return CommonConstants.LAYOUT_CONFIG_LEVEL_FEATURE;
56  }
57
58  /**
59   * Get form detail layout configuration feature name.
60   *
61   * @return {string} feature name
62   */
63  getFeatureName(): string {
64    return FormConstants.FEATURE_NAME;
65  }
66}