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 { Event } from '../../../../../../../../common/src/main/ets/default/event/EventUtil'; 17import { ItemComponentData, ActionData, FilterData 18} from '../../../../../../../../common/src/main/ets/plugindatasource/common/Constants'; 19 20export default class Constants { 21 static readonly EMPTY_AREA_POSITION_LEFT = 'left'; 22 static readonly EMPTY_AREA_POSITION_CENTER = 'center'; 23 static readonly EMPTY_AREA_POSITION_RIGHT = 'right'; 24 static readonly GROUP_ID_LEFT = 1; 25 static readonly GROUP_ID_CENTER = 2; 26 static readonly GROUP_ID_RIGHT = 3; 27 static readonly VERTICAL_COMPONENT_HEIGHT_VP = 58; 28 static readonly PLUGIN_COMPONENT_ICON_WIDTH = 32; 29 static readonly PLUGIN_COMPONENT_OWNER_WANT_KEY = 'StatusBar_PluginComponentOwnerWant'; 30} 31 32export type StatusBarComponentData = ItemComponentData & { 33 isShowLabel: boolean; 34 isShowIcon: boolean; 35 canSelect: boolean; 36 relationWindowId: string; 37 actionData?: ActionData & { 38 selectedClickAction?: Event; 39 }; 40}; 41 42export class StatusBarData { 43 displayWidth: number; 44 displayHeight: number; 45 showHorizontal: boolean; 46 ableToMaximize: boolean; 47 realWidth: number; 48 realHeight: number; 49 left: number; 50 top: number; 51} 52 53export class StatusBarBackgroundData { 54 backgroundColor = '#FFFF0000'; 55 width = 0; 56} 57 58export class StatusBarComponentGroupContentData { 59 contentColor = '#FFFFFFFF'; 60 width = 0; 61} 62 63export interface LayoutGroup { 64 id: number; 65 Components: string[]; 66} 67 68export interface DropdownRange { 69 startPosition: number; 70 endPosition: number; 71} 72 73export interface StatusBarConfig { 74 LayoutGroups: LayoutGroup[]; 75 LocalSlots: string[]; 76 MetaSlots: FilterData[]; 77 emptyPosition: { 78 x1: number; 79 x2: number; 80 y1: number; 81 y2: number 82 }; 83 dropdownRanges?: { 84 notification: DropdownRange; 85 control: DropdownRange 86 } 87} 88 89export class defaultIconItemStatus { 90 selected: false 91}