• 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 { FormLayoutConfig } from '@ohos/common';
17import { BaseModulePreLoader } from '@ohos/common';
18import { layoutConfigManager } from '@ohos/common';
19import { FormStyleConfig } from './FormStyleConfig';
20
21/**
22 * Form layer initialization loader
23 */
24class FormPreLoader extends BaseModulePreLoader {
25
26  /**
27   * Add configuration objects to layout configuration management class.
28   */
29  protected loadConfig(): void {
30    layoutConfigManager.addConfigToManager(FormLayoutConfig.getInstance());
31    layoutConfigManager.addConfigToManager(FormStyleConfig.getInstance());
32  }
33
34  /**
35   * Initialize load data.
36   */
37  protected loadData(): void {
38  }
39
40  /**
41   * Release module config and data.
42   */
43  releaseConfigAndData(): void {
44    layoutConfigManager.removeConfigFromManager();
45  }
46}
47
48export const formPreLoader = new FormPreLoader();