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 { ILayoutConfig } from '@ohos/common'; 17import { CommonConstants } from '@ohos/common'; 18 19/** 20 * Dock list mode configuration 21 */ 22export default class SmartDockModeConfig extends ILayoutConfig { 23 /** 24 * Dock list mode configuration index 25 */ 26 static SMART_DOCK_MODE_CONFIG = 'SmartDockModeConfig'; 27 28 protected constructor() { 29 super(); 30 } 31 32 /** 33 * Get the Dock list mode configuration instance 34 */ 35 static getInstance(): SmartDockModeConfig { 36 if (globalThis.SmartDockModeConfig == null) { 37 globalThis.SmartDockModeConfig = new SmartDockModeConfig(); 38 globalThis.SmartDockModeConfig.initConfig(); 39 } 40 return globalThis.SmartDockModeConfig; 41 } 42 43 initConfig(): void { 44 const config = this.loadPersistConfig(); 45 } 46 47 getConfigLevel(): string { 48 return CommonConstants.LAYOUT_CONFIG_LEVEL_COMMON; 49 } 50 51 getConfigType(): number { 52 return CommonConstants.LAYOUT_CONFIG_TYPE_MODE; 53 } 54 55 getConfigName(): string { 56 return SmartDockModeConfig.SMART_DOCK_MODE_CONFIG; 57 } 58 59 protected getPersistConfigJson(): string { 60 const persistConfig = { 61 }; 62 return JSON.stringify(persistConfig); 63 } 64} 65