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