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 { 17 CommonConstants, 18 PresetStyleConstants, 19 AppGridStyleConfig 20} from '@ohos/common'; 21import PageDesktopConstants from './constants/PageDesktopConstants'; 22 23/** 24 * Work control grid style configuration class 25 */ 26export class PageDesktopGridStyleConfig extends AppGridStyleConfig { 27 /** 28 * margin 29 */ 30 mMargin = PresetStyleConstants.DEFAULT_LAYOUT_MARGIN; 31 32 mDesktopMarginTop = PresetStyleConstants.DEFAULT_ICON_PADDING_TOP; 33 34 mPaddingTop = PresetStyleConstants.DEFAULT_APP_TOP_RATIO; 35 36 protected constructor() { 37 super(); 38 } 39 40 /** 41 * Get workspace style instance 42 */ 43 static getInstance(): PageDesktopGridStyleConfig { 44 if (globalThis.PageDesktopGridStyleConfig == null) { 45 globalThis.PageDesktopGridStyleConfig = new PageDesktopGridStyleConfig(); 46 globalThis.PageDesktopGridStyleConfig.initConfig(); 47 } 48 return globalThis.PageDesktopGridStyleConfig; 49 } 50 51 initConfig(): void { 52 } 53 54 getConfigLevel(): string { 55 return CommonConstants.LAYOUT_CONFIG_LEVEL_FEATURE; 56 } 57 58 getFeatureName(): string { 59 return PageDesktopConstants.FEATURE_NAME; 60 } 61}