123b3eb3cSopenharmony_ci/* 223b3eb3cSopenharmony_ci * Copyright (c) 2024 Huawei Device Co., Ltd. 323b3eb3cSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 423b3eb3cSopenharmony_ci * you may not use this file except in compliance with the License. 523b3eb3cSopenharmony_ci * You may obtain a copy of the License at 623b3eb3cSopenharmony_ci * 723b3eb3cSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 823b3eb3cSopenharmony_ci * 923b3eb3cSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 1023b3eb3cSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 1123b3eb3cSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1223b3eb3cSopenharmony_ci * See the License for the specific language governing permissions and 1323b3eb3cSopenharmony_ci * limitations under the License. 1423b3eb3cSopenharmony_ci */ 1523b3eb3cSopenharmony_ci 1623b3eb3cSopenharmony_ciif (!('finalizeConstruction' in ViewPU.prototype)) { 1723b3eb3cSopenharmony_ci Reflect.set(ViewPU.prototype, 'finalizeConstruction', () => {}); 1823b3eb3cSopenharmony_ci} 1923b3eb3cSopenharmony_ciconst display = globalThis.requireNapi('display'); 2023b3eb3cSopenharmony_ciconst window = globalThis.requireNapi('window'); 2123b3eb3cSopenharmony_ciconst hilog = globalThis.requireNapi('hilog'); 2223b3eb3cSopenharmony_ciconst LengthMetrics = globalThis.requireNapi('arkui.node').LengthMetrics; 2323b3eb3cSopenharmony_ciconst curves = globalThis.requireNativeModule('ohos.curves'); 2423b3eb3cSopenharmony_ciconst mediaQuery = requireNapi('mediaquery'); 2523b3eb3cSopenharmony_ciexport var ExtraRegionPosition; 2623b3eb3cSopenharmony_ci(function (k3) { 2723b3eb3cSopenharmony_ci k3[(k3['TOP'] = 1)] = 'TOP'; 2823b3eb3cSopenharmony_ci k3[(k3['BOTTOM'] = 2)] = 'BOTTOM'; 2923b3eb3cSopenharmony_ci})(ExtraRegionPosition || (ExtraRegionPosition = {})); 3023b3eb3cSopenharmony_ciexport var PresetSplitRatio; 3123b3eb3cSopenharmony_ci(function (s4) { 3223b3eb3cSopenharmony_ci s4[(s4['LAYOUT_1V1'] = 1)] = 'LAYOUT_1V1'; 3323b3eb3cSopenharmony_ci s4[(s4['LAYOUT_2V3'] = 0.6666666666666666)] = 'LAYOUT_2V3'; 3423b3eb3cSopenharmony_ci s4[(s4['LAYOUT_3V2'] = 1.5)] = 'LAYOUT_3V2'; 3523b3eb3cSopenharmony_ci})(PresetSplitRatio || (PresetSplitRatio = {})); 3623b3eb3cSopenharmony_cifunction withDefaultValue(h3, i3) { 3723b3eb3cSopenharmony_ci if (h3 === void 0 || h3 === null) { 3823b3eb3cSopenharmony_ci return i3; 3923b3eb3cSopenharmony_ci } 4023b3eb3cSopenharmony_ci return h3; 4123b3eb3cSopenharmony_ci} 4223b3eb3cSopenharmony_cifunction getSplitRatio(f3, g3) { 4323b3eb3cSopenharmony_ci if (f3 === void 0 || f3 === null) { 4423b3eb3cSopenharmony_ci return g3; 4523b3eb3cSopenharmony_ci } 4623b3eb3cSopenharmony_ci if (f3 <= 0) { 4723b3eb3cSopenharmony_ci return g3; 4823b3eb3cSopenharmony_ci } 4923b3eb3cSopenharmony_ci return f3; 5023b3eb3cSopenharmony_ci} 5123b3eb3cSopenharmony_ciclass Logger { 5223b3eb3cSopenharmony_ci static debug(d3, ...e3) { 5323b3eb3cSopenharmony_ci return hilog.debug(0x3900, 'FoldSplitContainer', d3, ...e3); 5423b3eb3cSopenharmony_ci } 5523b3eb3cSopenharmony_ci static info(b3, ...c3) { 5623b3eb3cSopenharmony_ci return hilog.info(0x3900, 'FoldSplitContainer', b3, ...c3); 5723b3eb3cSopenharmony_ci } 5823b3eb3cSopenharmony_ci static error(z2, ...a3) { 5923b3eb3cSopenharmony_ci return hilog.error(0x3900, 'FoldSplitContainer', z2, ...a3); 6023b3eb3cSopenharmony_ci } 6123b3eb3cSopenharmony_ci} 6223b3eb3cSopenharmony_cifunction initLayout() { 6323b3eb3cSopenharmony_ci return { 6423b3eb3cSopenharmony_ci size: { width: 0, height: 0 }, 6523b3eb3cSopenharmony_ci position: { x: 0, y: 0 }, 6623b3eb3cSopenharmony_ci }; 6723b3eb3cSopenharmony_ci} 6823b3eb3cSopenharmony_ciexport class FoldSplitContainer extends ViewPU { 6923b3eb3cSopenharmony_ci constructor(t2, u2, v2, w2 = -1, x2 = undefined, y2) { 7023b3eb3cSopenharmony_ci super(t2, v2, w2, y2); 7123b3eb3cSopenharmony_ci if (typeof x2 === 'function') { 7223b3eb3cSopenharmony_ci this.paramsGenerator_ = x2; 7323b3eb3cSopenharmony_ci } 7423b3eb3cSopenharmony_ci this.primary = undefined; 7523b3eb3cSopenharmony_ci this.secondary = undefined; 7623b3eb3cSopenharmony_ci this.extra = undefined; 7723b3eb3cSopenharmony_ci this.__expandedLayoutOptions = new SynchedPropertyObjectOneWayPU( 7823b3eb3cSopenharmony_ci u2.expandedLayoutOptions, 7923b3eb3cSopenharmony_ci this, 8023b3eb3cSopenharmony_ci 'expandedLayoutOptions' 8123b3eb3cSopenharmony_ci ); 8223b3eb3cSopenharmony_ci this.__hoverModeLayoutOptions = new SynchedPropertyObjectOneWayPU( 8323b3eb3cSopenharmony_ci u2.hoverModeLayoutOptions, 8423b3eb3cSopenharmony_ci this, 8523b3eb3cSopenharmony_ci 'hoverModeLayoutOptions' 8623b3eb3cSopenharmony_ci ); 8723b3eb3cSopenharmony_ci this.__foldedLayoutOptions = new SynchedPropertyObjectOneWayPU( 8823b3eb3cSopenharmony_ci u2.foldedLayoutOptions, 8923b3eb3cSopenharmony_ci this, 9023b3eb3cSopenharmony_ci 'foldedLayoutOptions' 9123b3eb3cSopenharmony_ci ); 9223b3eb3cSopenharmony_ci this.__animationOptions = new SynchedPropertyObjectOneWayPU( 9323b3eb3cSopenharmony_ci u2.animationOptions, 9423b3eb3cSopenharmony_ci this, 9523b3eb3cSopenharmony_ci 'animationOptions' 9623b3eb3cSopenharmony_ci ); 9723b3eb3cSopenharmony_ci this.onHoverStatusChange = () => {}; 9823b3eb3cSopenharmony_ci this.__primaryLayout = new ObservedPropertyObjectPU( 9923b3eb3cSopenharmony_ci initLayout(), 10023b3eb3cSopenharmony_ci this, 10123b3eb3cSopenharmony_ci 'primaryLayout' 10223b3eb3cSopenharmony_ci ); 10323b3eb3cSopenharmony_ci this.__secondaryLayout = new ObservedPropertyObjectPU( 10423b3eb3cSopenharmony_ci initLayout(), 10523b3eb3cSopenharmony_ci this, 10623b3eb3cSopenharmony_ci 'secondaryLayout' 10723b3eb3cSopenharmony_ci ); 10823b3eb3cSopenharmony_ci this.__extraLayout = new ObservedPropertyObjectPU( 10923b3eb3cSopenharmony_ci initLayout(), 11023b3eb3cSopenharmony_ci this, 11123b3eb3cSopenharmony_ci 'extraLayout' 11223b3eb3cSopenharmony_ci ); 11323b3eb3cSopenharmony_ci this.__extraOpacity = new ObservedPropertySimplePU(1, this, 'extraOpacity'); 11423b3eb3cSopenharmony_ci this.windowStatusType = window.WindowStatusType.UNDEFINED; 11523b3eb3cSopenharmony_ci this.foldStatus = display.FoldStatus.FOLD_STATUS_UNKNOWN; 11623b3eb3cSopenharmony_ci this.windowInstance = undefined; 11723b3eb3cSopenharmony_ci this.containerSize = { width: 0, height: 0 }; 11823b3eb3cSopenharmony_ci this.containerGlobalPosition = { x: 0, y: 0 }; 11923b3eb3cSopenharmony_ci this.listener = undefined; 12023b3eb3cSopenharmony_ci this.isSmallScreen = false; 12123b3eb3cSopenharmony_ci this.isHoverMode = undefined; 12223b3eb3cSopenharmony_ci this.setInitiallyProvidedValue(u2); 12323b3eb3cSopenharmony_ci this.declareWatch('expandedLayoutOptions', this.updateLayout); 12423b3eb3cSopenharmony_ci this.declareWatch('hoverModeLayoutOptions', this.updateLayout); 12523b3eb3cSopenharmony_ci this.declareWatch('foldedLayoutOptions', this.updateLayout); 12623b3eb3cSopenharmony_ci this.finalizeConstruction(); 12723b3eb3cSopenharmony_ci } 12823b3eb3cSopenharmony_ci setInitiallyProvidedValue(s2) { 12923b3eb3cSopenharmony_ci if (s2.primary !== undefined) { 13023b3eb3cSopenharmony_ci this.primary = s2.primary; 13123b3eb3cSopenharmony_ci } 13223b3eb3cSopenharmony_ci if (s2.secondary !== undefined) { 13323b3eb3cSopenharmony_ci this.secondary = s2.secondary; 13423b3eb3cSopenharmony_ci } 13523b3eb3cSopenharmony_ci if (s2.extra !== undefined) { 13623b3eb3cSopenharmony_ci this.extra = s2.extra; 13723b3eb3cSopenharmony_ci } 13823b3eb3cSopenharmony_ci if (s2.expandedLayoutOptions === undefined) { 13923b3eb3cSopenharmony_ci this.__expandedLayoutOptions.set({ 14023b3eb3cSopenharmony_ci horizontalSplitRatio: PresetSplitRatio.LAYOUT_3V2, 14123b3eb3cSopenharmony_ci verticalSplitRatio: PresetSplitRatio.LAYOUT_1V1, 14223b3eb3cSopenharmony_ci isExtraRegionPerpendicular: true, 14323b3eb3cSopenharmony_ci extraRegionPosition: ExtraRegionPosition.TOP, 14423b3eb3cSopenharmony_ci }); 14523b3eb3cSopenharmony_ci } 14623b3eb3cSopenharmony_ci if (s2.hoverModeLayoutOptions === undefined) { 14723b3eb3cSopenharmony_ci this.__hoverModeLayoutOptions.set({ 14823b3eb3cSopenharmony_ci horizontalSplitRatio: PresetSplitRatio.LAYOUT_3V2, 14923b3eb3cSopenharmony_ci showExtraRegion: false, 15023b3eb3cSopenharmony_ci extraRegionPosition: ExtraRegionPosition.TOP, 15123b3eb3cSopenharmony_ci }); 15223b3eb3cSopenharmony_ci } 15323b3eb3cSopenharmony_ci if (s2.foldedLayoutOptions === undefined) { 15423b3eb3cSopenharmony_ci this.__foldedLayoutOptions.set({ 15523b3eb3cSopenharmony_ci verticalSplitRatio: PresetSplitRatio.LAYOUT_1V1, 15623b3eb3cSopenharmony_ci }); 15723b3eb3cSopenharmony_ci } 15823b3eb3cSopenharmony_ci if (s2.animationOptions === undefined) { 15923b3eb3cSopenharmony_ci this.__animationOptions.set(undefined); 16023b3eb3cSopenharmony_ci } 16123b3eb3cSopenharmony_ci if (s2.onHoverStatusChange !== undefined) { 16223b3eb3cSopenharmony_ci this.onHoverStatusChange = s2.onHoverStatusChange; 16323b3eb3cSopenharmony_ci } 16423b3eb3cSopenharmony_ci if (s2.primaryLayout !== undefined) { 16523b3eb3cSopenharmony_ci this.primaryLayout = s2.primaryLayout; 16623b3eb3cSopenharmony_ci } 16723b3eb3cSopenharmony_ci if (s2.secondaryLayout !== undefined) { 16823b3eb3cSopenharmony_ci this.secondaryLayout = s2.secondaryLayout; 16923b3eb3cSopenharmony_ci } 17023b3eb3cSopenharmony_ci if (s2.extraLayout !== undefined) { 17123b3eb3cSopenharmony_ci this.extraLayout = s2.extraLayout; 17223b3eb3cSopenharmony_ci } 17323b3eb3cSopenharmony_ci if (s2.extraOpacity !== undefined) { 17423b3eb3cSopenharmony_ci this.extraOpacity = s2.extraOpacity; 17523b3eb3cSopenharmony_ci } 17623b3eb3cSopenharmony_ci if (s2.windowStatusType !== undefined) { 17723b3eb3cSopenharmony_ci this.windowStatusType = s2.windowStatusType; 17823b3eb3cSopenharmony_ci } 17923b3eb3cSopenharmony_ci if (s2.foldStatus !== undefined) { 18023b3eb3cSopenharmony_ci this.foldStatus = s2.foldStatus; 18123b3eb3cSopenharmony_ci } 18223b3eb3cSopenharmony_ci if (s2.windowInstance !== undefined) { 18323b3eb3cSopenharmony_ci this.windowInstance = s2.windowInstance; 18423b3eb3cSopenharmony_ci } 18523b3eb3cSopenharmony_ci if (s2.containerSize !== undefined) { 18623b3eb3cSopenharmony_ci this.containerSize = s2.containerSize; 18723b3eb3cSopenharmony_ci } 18823b3eb3cSopenharmony_ci if (s2.containerGlobalPosition !== undefined) { 18923b3eb3cSopenharmony_ci this.containerGlobalPosition = s2.containerGlobalPosition; 19023b3eb3cSopenharmony_ci } 19123b3eb3cSopenharmony_ci if (s2.listener !== undefined) { 19223b3eb3cSopenharmony_ci this.listener = s2.listener; 19323b3eb3cSopenharmony_ci } 19423b3eb3cSopenharmony_ci if (s2.isSmallScreen !== undefined) { 19523b3eb3cSopenharmony_ci this.isSmallScreen = s2.isSmallScreen; 19623b3eb3cSopenharmony_ci } 19723b3eb3cSopenharmony_ci if (s2.isHoverMode !== undefined) { 19823b3eb3cSopenharmony_ci this.isHoverMode = s2.isHoverMode; 19923b3eb3cSopenharmony_ci } 20023b3eb3cSopenharmony_ci } 20123b3eb3cSopenharmony_ci updateStateVars(r2) { 20223b3eb3cSopenharmony_ci this.__expandedLayoutOptions.reset(r2.expandedLayoutOptions); 20323b3eb3cSopenharmony_ci this.__hoverModeLayoutOptions.reset(r2.hoverModeLayoutOptions); 20423b3eb3cSopenharmony_ci this.__foldedLayoutOptions.reset(r2.foldedLayoutOptions); 20523b3eb3cSopenharmony_ci this.__animationOptions.reset(r2.animationOptions); 20623b3eb3cSopenharmony_ci } 20723b3eb3cSopenharmony_ci purgeVariableDependenciesOnElmtId(q2) { 20823b3eb3cSopenharmony_ci this.__expandedLayoutOptions.purgeDependencyOnElmtId(q2); 20923b3eb3cSopenharmony_ci this.__hoverModeLayoutOptions.purgeDependencyOnElmtId(q2); 21023b3eb3cSopenharmony_ci this.__foldedLayoutOptions.purgeDependencyOnElmtId(q2); 21123b3eb3cSopenharmony_ci this.__animationOptions.purgeDependencyOnElmtId(q2); 21223b3eb3cSopenharmony_ci this.__primaryLayout.purgeDependencyOnElmtId(q2); 21323b3eb3cSopenharmony_ci this.__secondaryLayout.purgeDependencyOnElmtId(q2); 21423b3eb3cSopenharmony_ci this.__extraLayout.purgeDependencyOnElmtId(q2); 21523b3eb3cSopenharmony_ci this.__extraOpacity.purgeDependencyOnElmtId(q2); 21623b3eb3cSopenharmony_ci } 21723b3eb3cSopenharmony_ci aboutToBeDeleted() { 21823b3eb3cSopenharmony_ci this.__expandedLayoutOptions.aboutToBeDeleted(); 21923b3eb3cSopenharmony_ci this.__hoverModeLayoutOptions.aboutToBeDeleted(); 22023b3eb3cSopenharmony_ci this.__foldedLayoutOptions.aboutToBeDeleted(); 22123b3eb3cSopenharmony_ci this.__animationOptions.aboutToBeDeleted(); 22223b3eb3cSopenharmony_ci this.__primaryLayout.aboutToBeDeleted(); 22323b3eb3cSopenharmony_ci this.__secondaryLayout.aboutToBeDeleted(); 22423b3eb3cSopenharmony_ci this.__extraLayout.aboutToBeDeleted(); 22523b3eb3cSopenharmony_ci this.__extraOpacity.aboutToBeDeleted(); 22623b3eb3cSopenharmony_ci SubscriberManager.Get().delete(this.id__()); 22723b3eb3cSopenharmony_ci this.aboutToBeDeletedInternal(); 22823b3eb3cSopenharmony_ci } 22923b3eb3cSopenharmony_ci get expandedLayoutOptions() { 23023b3eb3cSopenharmony_ci return this.__expandedLayoutOptions.get(); 23123b3eb3cSopenharmony_ci } 23223b3eb3cSopenharmony_ci set expandedLayoutOptions(p2) { 23323b3eb3cSopenharmony_ci this.__expandedLayoutOptions.set(p2); 23423b3eb3cSopenharmony_ci } 23523b3eb3cSopenharmony_ci get hoverModeLayoutOptions() { 23623b3eb3cSopenharmony_ci return this.__hoverModeLayoutOptions.get(); 23723b3eb3cSopenharmony_ci } 23823b3eb3cSopenharmony_ci set hoverModeLayoutOptions(f1) { 23923b3eb3cSopenharmony_ci this.__hoverModeLayoutOptions.set(f1); 24023b3eb3cSopenharmony_ci } 24123b3eb3cSopenharmony_ci get foldedLayoutOptions() { 24223b3eb3cSopenharmony_ci return this.__foldedLayoutOptions.get(); 24323b3eb3cSopenharmony_ci } 24423b3eb3cSopenharmony_ci set foldedLayoutOptions(n2) { 24523b3eb3cSopenharmony_ci this.__foldedLayoutOptions.set(n2); 24623b3eb3cSopenharmony_ci } 24723b3eb3cSopenharmony_ci get animationOptions() { 24823b3eb3cSopenharmony_ci return this.__animationOptions.get(); 24923b3eb3cSopenharmony_ci } 25023b3eb3cSopenharmony_ci set animationOptions(n4) { 25123b3eb3cSopenharmony_ci this.__animationOptions.set(n4); 25223b3eb3cSopenharmony_ci } 25323b3eb3cSopenharmony_ci get primaryLayout() { 25423b3eb3cSopenharmony_ci return this.__primaryLayout.get(); 25523b3eb3cSopenharmony_ci } 25623b3eb3cSopenharmony_ci set primaryLayout(m2) { 25723b3eb3cSopenharmony_ci this.__primaryLayout.set(m2); 25823b3eb3cSopenharmony_ci } 25923b3eb3cSopenharmony_ci get secondaryLayout() { 26023b3eb3cSopenharmony_ci return this.__secondaryLayout.get(); 26123b3eb3cSopenharmony_ci } 26223b3eb3cSopenharmony_ci set secondaryLayout(l2) { 26323b3eb3cSopenharmony_ci this.__secondaryLayout.set(l2); 26423b3eb3cSopenharmony_ci } 26523b3eb3cSopenharmony_ci get extraLayout() { 26623b3eb3cSopenharmony_ci return this.__extraLayout.get(); 26723b3eb3cSopenharmony_ci } 26823b3eb3cSopenharmony_ci set extraLayout(k2) { 26923b3eb3cSopenharmony_ci this.__extraLayout.set(k2); 27023b3eb3cSopenharmony_ci } 27123b3eb3cSopenharmony_ci get extraOpacity() { 27223b3eb3cSopenharmony_ci return this.__extraOpacity.get(); 27323b3eb3cSopenharmony_ci } 27423b3eb3cSopenharmony_ci set extraOpacity(l1) { 27523b3eb3cSopenharmony_ci this.__extraOpacity.set(l1); 27623b3eb3cSopenharmony_ci } 27723b3eb3cSopenharmony_ci aboutToAppear() { 27823b3eb3cSopenharmony_ci this.listener = mediaQuery.matchMediaSync('(width<=600vp)'); 27923b3eb3cSopenharmony_ci this.isSmallScreen = this.listener.matches; 28023b3eb3cSopenharmony_ci this.listener.on('change', (m4) => { 28123b3eb3cSopenharmony_ci this.isSmallScreen = m4.matches; 28223b3eb3cSopenharmony_ci }); 28323b3eb3cSopenharmony_ci this.foldStatus = display.getFoldStatus(); 28423b3eb3cSopenharmony_ci display.on('foldStatusChange', (j4) => { 28523b3eb3cSopenharmony_ci if (this.foldStatus !== j4) { 28623b3eb3cSopenharmony_ci this.foldStatus = j4; 28723b3eb3cSopenharmony_ci this.updateLayout(); 28823b3eb3cSopenharmony_ci this.updatePreferredOrientation(); 28923b3eb3cSopenharmony_ci } 29023b3eb3cSopenharmony_ci }); 29123b3eb3cSopenharmony_ci window.getLastWindow(this.getUIContext().getHostContext(), (e4, f4) => { 29223b3eb3cSopenharmony_ci if (e4 && e4.code) { 29323b3eb3cSopenharmony_ci Logger.error( 29423b3eb3cSopenharmony_ci 'Failed to get window instance, error code: %{public}d', 29523b3eb3cSopenharmony_ci e4.code 29623b3eb3cSopenharmony_ci ); 29723b3eb3cSopenharmony_ci return; 29823b3eb3cSopenharmony_ci } 29923b3eb3cSopenharmony_ci const g4 = f4.getWindowProperties().id; 30023b3eb3cSopenharmony_ci if (g4 < 0) { 30123b3eb3cSopenharmony_ci Logger.error( 30223b3eb3cSopenharmony_ci 'Failed to get window instance because the window id is invalid. window id: %{public}d', 30323b3eb3cSopenharmony_ci g4 30423b3eb3cSopenharmony_ci ); 30523b3eb3cSopenharmony_ci return; 30623b3eb3cSopenharmony_ci } 30723b3eb3cSopenharmony_ci this.windowInstance = f4; 30823b3eb3cSopenharmony_ci this.updatePreferredOrientation(); 30923b3eb3cSopenharmony_ci this.windowInstance.on('windowStatusChange', (i4) => { 31023b3eb3cSopenharmony_ci this.windowStatusType = i4; 31123b3eb3cSopenharmony_ci }); 31223b3eb3cSopenharmony_ci }); 31323b3eb3cSopenharmony_ci } 31423b3eb3cSopenharmony_ci aboutToDisappear() { 31523b3eb3cSopenharmony_ci if (this.listener) { 31623b3eb3cSopenharmony_ci this.listener.off('change'); 31723b3eb3cSopenharmony_ci this.listener = undefined; 31823b3eb3cSopenharmony_ci } 31923b3eb3cSopenharmony_ci display.off('foldStatusChange'); 32023b3eb3cSopenharmony_ci if (this.windowInstance) { 32123b3eb3cSopenharmony_ci this.windowInstance.off('windowStatusChange'); 32223b3eb3cSopenharmony_ci } 32323b3eb3cSopenharmony_ci } 32423b3eb3cSopenharmony_ci initialRender() { 32523b3eb3cSopenharmony_ci this.observeComponentCreation2((y1, z1) => { 32623b3eb3cSopenharmony_ci Stack.create(); 32723b3eb3cSopenharmony_ci Stack.id('$$FoldSplitContainer$Stack$$'); 32823b3eb3cSopenharmony_ci Stack.width('100%'); 32923b3eb3cSopenharmony_ci Stack.height('100%'); 33023b3eb3cSopenharmony_ci Stack.onSizeChange((b2, d4) => { 33123b3eb3cSopenharmony_ci this.updateContainerSize(d4); 33223b3eb3cSopenharmony_ci this.updateContainerPosition(); 33323b3eb3cSopenharmony_ci this.updateLayout(); 33423b3eb3cSopenharmony_ci }); 33523b3eb3cSopenharmony_ci }, Stack); 33623b3eb3cSopenharmony_ci this.observeComponentCreation2((w1, x1) => { 33723b3eb3cSopenharmony_ci Column.create(); 33823b3eb3cSopenharmony_ci Column.size(this.primaryLayout.size); 33923b3eb3cSopenharmony_ci Column.position({ 34023b3eb3cSopenharmony_ci start: LengthMetrics.vp(this.primaryLayout.position.x), 34123b3eb3cSopenharmony_ci top: LengthMetrics.vp(this.primaryLayout.position.y), 34223b3eb3cSopenharmony_ci }); 34323b3eb3cSopenharmony_ci Column.clip(true); 34423b3eb3cSopenharmony_ci }, Column); 34523b3eb3cSopenharmony_ci this.observeComponentCreation2((u1, v1) => { 34623b3eb3cSopenharmony_ci If.create(); 34723b3eb3cSopenharmony_ci if (this.primary) { 34823b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(0, () => { 34923b3eb3cSopenharmony_ci this.primary.bind(this)(this); 35023b3eb3cSopenharmony_ci }); 35123b3eb3cSopenharmony_ci } else { 35223b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(1, () => {}); 35323b3eb3cSopenharmony_ci } 35423b3eb3cSopenharmony_ci }, If); 35523b3eb3cSopenharmony_ci If.pop(); 35623b3eb3cSopenharmony_ci Column.pop(); 35723b3eb3cSopenharmony_ci this.observeComponentCreation2((n1, o1) => { 35823b3eb3cSopenharmony_ci Column.create(); 35923b3eb3cSopenharmony_ci Column.size(this.secondaryLayout.size); 36023b3eb3cSopenharmony_ci Column.position({ 36123b3eb3cSopenharmony_ci start: LengthMetrics.vp(this.secondaryLayout.position.x), 36223b3eb3cSopenharmony_ci top: LengthMetrics.vp(this.secondaryLayout.position.y), 36323b3eb3cSopenharmony_ci }); 36423b3eb3cSopenharmony_ci Column.clip(true); 36523b3eb3cSopenharmony_ci }, Column); 36623b3eb3cSopenharmony_ci this.observeComponentCreation2((u3, v3) => { 36723b3eb3cSopenharmony_ci If.create(); 36823b3eb3cSopenharmony_ci if (this.secondary) { 36923b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(0, () => { 37023b3eb3cSopenharmony_ci this.secondary.bind(this)(this); 37123b3eb3cSopenharmony_ci }); 37223b3eb3cSopenharmony_ci } else { 37323b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(1, () => {}); 37423b3eb3cSopenharmony_ci } 37523b3eb3cSopenharmony_ci }, If); 37623b3eb3cSopenharmony_ci If.pop(); 37723b3eb3cSopenharmony_ci Column.pop(); 37823b3eb3cSopenharmony_ci this.observeComponentCreation2((i2, j2) => { 37923b3eb3cSopenharmony_ci If.create(); 38023b3eb3cSopenharmony_ci if (this.extra) { 38123b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(0, () => { 38223b3eb3cSopenharmony_ci this.observeComponentCreation2((n3, o3) => { 38323b3eb3cSopenharmony_ci Column.create(); 38423b3eb3cSopenharmony_ci Context.animation({ curve: Curve.Linear, duration: 250 }); 38523b3eb3cSopenharmony_ci Column.opacity(this.extraOpacity); 38623b3eb3cSopenharmony_ci Context.animation(null); 38723b3eb3cSopenharmony_ci Column.size(this.extraLayout.size); 38823b3eb3cSopenharmony_ci Column.position({ 38923b3eb3cSopenharmony_ci start: LengthMetrics.vp(this.extraLayout.position.x), 39023b3eb3cSopenharmony_ci top: LengthMetrics.vp(this.extraLayout.position.y), 39123b3eb3cSopenharmony_ci }); 39223b3eb3cSopenharmony_ci Column.clip(true); 39323b3eb3cSopenharmony_ci }, Column); 39423b3eb3cSopenharmony_ci this.extra?.bind(this)?.(this); 39523b3eb3cSopenharmony_ci Column.pop(); 39623b3eb3cSopenharmony_ci }); 39723b3eb3cSopenharmony_ci } else { 39823b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(1, () => {}); 39923b3eb3cSopenharmony_ci } 40023b3eb3cSopenharmony_ci }, If); 40123b3eb3cSopenharmony_ci If.pop(); 40223b3eb3cSopenharmony_ci Stack.pop(); 40323b3eb3cSopenharmony_ci } 40423b3eb3cSopenharmony_ci dispatchHoverStatusChange(b4) { 40523b3eb3cSopenharmony_ci if (this.onHoverStatusChange) { 40623b3eb3cSopenharmony_ci this.onHoverStatusChange({ 40723b3eb3cSopenharmony_ci foldStatus: this.foldStatus, 40823b3eb3cSopenharmony_ci isHoverMode: b4, 40923b3eb3cSopenharmony_ci appRotation: display.getDefaultDisplaySync().rotation, 41023b3eb3cSopenharmony_ci windowStatusType: this.windowStatusType, 41123b3eb3cSopenharmony_ci }); 41223b3eb3cSopenharmony_ci } 41323b3eb3cSopenharmony_ci } 41423b3eb3cSopenharmony_ci hasExtraRegion() { 41523b3eb3cSopenharmony_ci return !!this.extra; 41623b3eb3cSopenharmony_ci } 41723b3eb3cSopenharmony_ci async updatePreferredOrientation() { 41823b3eb3cSopenharmony_ci if (this.windowInstance) { 41923b3eb3cSopenharmony_ci try { 42023b3eb3cSopenharmony_ci if (this.foldStatus === display.FoldStatus.FOLD_STATUS_FOLDED) { 42123b3eb3cSopenharmony_ci await this.windowInstance.setPreferredOrientation( 42223b3eb3cSopenharmony_ci window.Orientation.AUTO_ROTATION_PORTRAIT 42323b3eb3cSopenharmony_ci ); 42423b3eb3cSopenharmony_ci } else { 42523b3eb3cSopenharmony_ci await this.windowInstance.setPreferredOrientation( 42623b3eb3cSopenharmony_ci window.Orientation.AUTO_ROTATION 42723b3eb3cSopenharmony_ci ); 42823b3eb3cSopenharmony_ci } 42923b3eb3cSopenharmony_ci } catch (i1) { 43023b3eb3cSopenharmony_ci Logger.error('Failed to update preferred orientation.'); 43123b3eb3cSopenharmony_ci } 43223b3eb3cSopenharmony_ci } 43323b3eb3cSopenharmony_ci } 43423b3eb3cSopenharmony_ci updateContainerSize(a4) { 43523b3eb3cSopenharmony_ci this.containerSize.width = a4.width; 43623b3eb3cSopenharmony_ci this.containerSize.height = a4.height; 43723b3eb3cSopenharmony_ci } 43823b3eb3cSopenharmony_ci updateContainerPosition() { 43923b3eb3cSopenharmony_ci const y3 = this.getUIContext(); 44023b3eb3cSopenharmony_ci const z3 = y3.getFrameNodeById('$$FoldSplitContainer$Stack$$'); 44123b3eb3cSopenharmony_ci if (z3) { 44223b3eb3cSopenharmony_ci this.containerGlobalPosition = z3.getPositionToWindow(); 44323b3eb3cSopenharmony_ci } 44423b3eb3cSopenharmony_ci } 44523b3eb3cSopenharmony_ci updateLayout() { 44623b3eb3cSopenharmony_ci let t1 = false; 44723b3eb3cSopenharmony_ci let g1; 44823b3eb3cSopenharmony_ci if (this.isSmallScreen) { 44923b3eb3cSopenharmony_ci g1 = this.getFoldedRegionLayouts(); 45023b3eb3cSopenharmony_ci } else { 45123b3eb3cSopenharmony_ci if (this.foldStatus === display.FoldStatus.FOLD_STATUS_EXPANDED) { 45223b3eb3cSopenharmony_ci g1 = this.getExpandedRegionLayouts(); 45323b3eb3cSopenharmony_ci } else if ( 45423b3eb3cSopenharmony_ci this.foldStatus === display.FoldStatus.FOLD_STATUS_HALF_FOLDED 45523b3eb3cSopenharmony_ci ) { 45623b3eb3cSopenharmony_ci if (this.isPortraitOrientation()) { 45723b3eb3cSopenharmony_ci g1 = this.getExpandedRegionLayouts(); 45823b3eb3cSopenharmony_ci } else { 45923b3eb3cSopenharmony_ci g1 = this.getHoverModeRegionLayouts(); 46023b3eb3cSopenharmony_ci t1 = true; 46123b3eb3cSopenharmony_ci } 46223b3eb3cSopenharmony_ci } else if (this.foldStatus === display.FoldStatus.FOLD_STATUS_FOLDED) { 46323b3eb3cSopenharmony_ci g1 = this.getFoldedRegionLayouts(); 46423b3eb3cSopenharmony_ci } else { 46523b3eb3cSopenharmony_ci g1 = this.getExpandedRegionLayouts(); 46623b3eb3cSopenharmony_ci } 46723b3eb3cSopenharmony_ci } 46823b3eb3cSopenharmony_ci if (this.animationOptions === null) { 46923b3eb3cSopenharmony_ci this.primaryLayout = g1.primary; 47023b3eb3cSopenharmony_ci this.secondaryLayout = g1.secondary; 47123b3eb3cSopenharmony_ci this.extraLayout = g1.extra; 47223b3eb3cSopenharmony_ci } else if (this.animationOptions === void 0) { 47323b3eb3cSopenharmony_ci Context.animateTo({ curve: curves.springMotion(0.35, 1, 0) }, () => { 47423b3eb3cSopenharmony_ci this.primaryLayout = g1.primary; 47523b3eb3cSopenharmony_ci this.secondaryLayout = g1.secondary; 47623b3eb3cSopenharmony_ci this.extraLayout = g1.extra; 47723b3eb3cSopenharmony_ci }); 47823b3eb3cSopenharmony_ci } else { 47923b3eb3cSopenharmony_ci Context.animateTo(this.animationOptions, () => { 48023b3eb3cSopenharmony_ci this.primaryLayout = g1.primary; 48123b3eb3cSopenharmony_ci this.secondaryLayout = g1.secondary; 48223b3eb3cSopenharmony_ci this.extraLayout = g1.extra; 48323b3eb3cSopenharmony_ci }); 48423b3eb3cSopenharmony_ci } 48523b3eb3cSopenharmony_ci if (this.isHoverMode !== t1) { 48623b3eb3cSopenharmony_ci this.dispatchHoverStatusChange(t1); 48723b3eb3cSopenharmony_ci this.isHoverMode = t1; 48823b3eb3cSopenharmony_ci } 48923b3eb3cSopenharmony_ci if (t1 && !this.hoverModeLayoutOptions.showExtraRegion) { 49023b3eb3cSopenharmony_ci this.extraOpacity = 0; 49123b3eb3cSopenharmony_ci } else { 49223b3eb3cSopenharmony_ci this.extraOpacity = 1; 49323b3eb3cSopenharmony_ci } 49423b3eb3cSopenharmony_ci } 49523b3eb3cSopenharmony_ci getExpandedRegionLayouts() { 49623b3eb3cSopenharmony_ci const x = this.containerSize.width; 49723b3eb3cSopenharmony_ci const y = this.containerSize.height; 49823b3eb3cSopenharmony_ci const z = initLayout(); 49923b3eb3cSopenharmony_ci const a1 = initLayout(); 50023b3eb3cSopenharmony_ci const b1 = initLayout(); 50123b3eb3cSopenharmony_ci const c1 = getSplitRatio( 50223b3eb3cSopenharmony_ci this.expandedLayoutOptions.horizontalSplitRatio, 50323b3eb3cSopenharmony_ci PresetSplitRatio.LAYOUT_3V2 50423b3eb3cSopenharmony_ci ); 50523b3eb3cSopenharmony_ci const d1 = getSplitRatio( 50623b3eb3cSopenharmony_ci this.expandedLayoutOptions.verticalSplitRatio, 50723b3eb3cSopenharmony_ci PresetSplitRatio.LAYOUT_1V1 50823b3eb3cSopenharmony_ci ); 50923b3eb3cSopenharmony_ci if (this.hasExtraRegion()) { 51023b3eb3cSopenharmony_ci b1.size.width = x / (c1 + 1); 51123b3eb3cSopenharmony_ci } else { 51223b3eb3cSopenharmony_ci b1.size.width = 0; 51323b3eb3cSopenharmony_ci } 51423b3eb3cSopenharmony_ci a1.size.height = y / (d1 + 1); 51523b3eb3cSopenharmony_ci z.size.height = y - a1.size.height; 51623b3eb3cSopenharmony_ci z.position.x = 0; 51723b3eb3cSopenharmony_ci a1.position.x = 0; 51823b3eb3cSopenharmony_ci z.position.y = 0; 51923b3eb3cSopenharmony_ci a1.position.y = z.size.height; 52023b3eb3cSopenharmony_ci const e1 = withDefaultValue( 52123b3eb3cSopenharmony_ci this.expandedLayoutOptions.isExtraRegionPerpendicular, 52223b3eb3cSopenharmony_ci true 52323b3eb3cSopenharmony_ci ); 52423b3eb3cSopenharmony_ci if (e1) { 52523b3eb3cSopenharmony_ci z.size.width = x - b1.size.width; 52623b3eb3cSopenharmony_ci a1.size.width = x - b1.size.width; 52723b3eb3cSopenharmony_ci b1.size.height = y; 52823b3eb3cSopenharmony_ci b1.position.x = z.size.width; 52923b3eb3cSopenharmony_ci b1.position.y = 0; 53023b3eb3cSopenharmony_ci } else { 53123b3eb3cSopenharmony_ci const j1 = withDefaultValue( 53223b3eb3cSopenharmony_ci this.expandedLayoutOptions.extraRegionPosition, 53323b3eb3cSopenharmony_ci ExtraRegionPosition.TOP 53423b3eb3cSopenharmony_ci ); 53523b3eb3cSopenharmony_ci if (j1 === ExtraRegionPosition.BOTTOM) { 53623b3eb3cSopenharmony_ci z.size.width = x; 53723b3eb3cSopenharmony_ci a1.size.width = x - b1.size.width; 53823b3eb3cSopenharmony_ci b1.size.height = a1.size.height; 53923b3eb3cSopenharmony_ci b1.position.x = a1.size.width; 54023b3eb3cSopenharmony_ci b1.position.y = z.size.height; 54123b3eb3cSopenharmony_ci } else { 54223b3eb3cSopenharmony_ci z.size.width = x - b1.size.width; 54323b3eb3cSopenharmony_ci a1.size.width = x; 54423b3eb3cSopenharmony_ci b1.size.height = z.size.height; 54523b3eb3cSopenharmony_ci b1.position.x = z.size.width; 54623b3eb3cSopenharmony_ci b1.position.y = 0; 54723b3eb3cSopenharmony_ci } 54823b3eb3cSopenharmony_ci } 54923b3eb3cSopenharmony_ci return { primary: z, secondary: a1, extra: b1 }; 55023b3eb3cSopenharmony_ci } 55123b3eb3cSopenharmony_ci getHoverModeRegionLayouts() { 55223b3eb3cSopenharmony_ci const o = this.containerSize.width; 55323b3eb3cSopenharmony_ci const p = this.containerSize.height; 55423b3eb3cSopenharmony_ci const q = initLayout(); 55523b3eb3cSopenharmony_ci const r = initLayout(); 55623b3eb3cSopenharmony_ci const s = initLayout(); 55723b3eb3cSopenharmony_ci const t = this.getCreaseRegionRect(); 55823b3eb3cSopenharmony_ci q.position.x = 0; 55923b3eb3cSopenharmony_ci q.position.y = 0; 56023b3eb3cSopenharmony_ci r.position.x = 0; 56123b3eb3cSopenharmony_ci r.position.y = t.top + t.height; 56223b3eb3cSopenharmony_ci r.size.height = p - r.position.y; 56323b3eb3cSopenharmony_ci q.size.height = t.top; 56423b3eb3cSopenharmony_ci const u = withDefaultValue( 56523b3eb3cSopenharmony_ci this.hoverModeLayoutOptions.showExtraRegion, 56623b3eb3cSopenharmony_ci false 56723b3eb3cSopenharmony_ci ); 56823b3eb3cSopenharmony_ci if (!u) { 56923b3eb3cSopenharmony_ci q.size.width = o; 57023b3eb3cSopenharmony_ci r.size.width = o; 57123b3eb3cSopenharmony_ci s.position.x = o; 57223b3eb3cSopenharmony_ci const r1 = withDefaultValue( 57323b3eb3cSopenharmony_ci this.expandedLayoutOptions.isExtraRegionPerpendicular, 57423b3eb3cSopenharmony_ci true 57523b3eb3cSopenharmony_ci ); 57623b3eb3cSopenharmony_ci if (r1) { 57723b3eb3cSopenharmony_ci s.size.height = this.extraLayout.size.height; 57823b3eb3cSopenharmony_ci } else { 57923b3eb3cSopenharmony_ci const s1 = withDefaultValue( 58023b3eb3cSopenharmony_ci this.expandedLayoutOptions.extraRegionPosition, 58123b3eb3cSopenharmony_ci ExtraRegionPosition.TOP 58223b3eb3cSopenharmony_ci ); 58323b3eb3cSopenharmony_ci if (s1 === ExtraRegionPosition.BOTTOM) { 58423b3eb3cSopenharmony_ci s.size.height = r.size.height; 58523b3eb3cSopenharmony_ci s.position.y = r.position.y; 58623b3eb3cSopenharmony_ci } else { 58723b3eb3cSopenharmony_ci s.size.height = q.size.height; 58823b3eb3cSopenharmony_ci s.position.y = 0; 58923b3eb3cSopenharmony_ci } 59023b3eb3cSopenharmony_ci } 59123b3eb3cSopenharmony_ci } else { 59223b3eb3cSopenharmony_ci const p1 = getSplitRatio( 59323b3eb3cSopenharmony_ci this.hoverModeLayoutOptions.horizontalSplitRatio, 59423b3eb3cSopenharmony_ci PresetSplitRatio.LAYOUT_3V2 59523b3eb3cSopenharmony_ci ); 59623b3eb3cSopenharmony_ci const q1 = withDefaultValue( 59723b3eb3cSopenharmony_ci this.hoverModeLayoutOptions.extraRegionPosition, 59823b3eb3cSopenharmony_ci ExtraRegionPosition.TOP 59923b3eb3cSopenharmony_ci ); 60023b3eb3cSopenharmony_ci if (this.hasExtraRegion()) { 60123b3eb3cSopenharmony_ci s.size.width = o / (p1 + 1); 60223b3eb3cSopenharmony_ci } else { 60323b3eb3cSopenharmony_ci s.size.width = 0; 60423b3eb3cSopenharmony_ci } 60523b3eb3cSopenharmony_ci if (q1 === ExtraRegionPosition.BOTTOM) { 60623b3eb3cSopenharmony_ci q.size.width = o; 60723b3eb3cSopenharmony_ci r.size.width = o - s.size.width; 60823b3eb3cSopenharmony_ci s.size.height = r.size.height; 60923b3eb3cSopenharmony_ci s.position.x = r.size.width; 61023b3eb3cSopenharmony_ci s.position.y = r.position.y; 61123b3eb3cSopenharmony_ci } else { 61223b3eb3cSopenharmony_ci s.size.height = q.size.height; 61323b3eb3cSopenharmony_ci q.size.width = o - s.size.width; 61423b3eb3cSopenharmony_ci r.size.width = o; 61523b3eb3cSopenharmony_ci s.position.x = q.position.x + q.size.width; 61623b3eb3cSopenharmony_ci s.position.y = 0; 61723b3eb3cSopenharmony_ci } 61823b3eb3cSopenharmony_ci } 61923b3eb3cSopenharmony_ci return { primary: q, secondary: r, extra: s }; 62023b3eb3cSopenharmony_ci } 62123b3eb3cSopenharmony_ci getFoldedRegionLayouts() { 62223b3eb3cSopenharmony_ci const i = this.containerSize.width; 62323b3eb3cSopenharmony_ci const j = this.containerSize.height; 62423b3eb3cSopenharmony_ci const k = initLayout(); 62523b3eb3cSopenharmony_ci const l = initLayout(); 62623b3eb3cSopenharmony_ci const m = initLayout(); 62723b3eb3cSopenharmony_ci const n = getSplitRatio( 62823b3eb3cSopenharmony_ci this.foldedLayoutOptions.verticalSplitRatio, 62923b3eb3cSopenharmony_ci PresetSplitRatio.LAYOUT_1V1 63023b3eb3cSopenharmony_ci ); 63123b3eb3cSopenharmony_ci l.size.height = j / (n + 1); 63223b3eb3cSopenharmony_ci k.size.height = j - l.size.height; 63323b3eb3cSopenharmony_ci m.size.height = 0; 63423b3eb3cSopenharmony_ci k.size.width = i; 63523b3eb3cSopenharmony_ci l.size.width = i; 63623b3eb3cSopenharmony_ci m.size.width = 0; 63723b3eb3cSopenharmony_ci k.position.x = 0; 63823b3eb3cSopenharmony_ci l.position.x = 0; 63923b3eb3cSopenharmony_ci m.position.x = i; 64023b3eb3cSopenharmony_ci k.position.y = 0; 64123b3eb3cSopenharmony_ci l.position.y = k.size.height; 64223b3eb3cSopenharmony_ci m.position.y = 0; 64323b3eb3cSopenharmony_ci return { primary: k, secondary: l, extra: m }; 64423b3eb3cSopenharmony_ci } 64523b3eb3cSopenharmony_ci getCreaseRegionRect() { 64623b3eb3cSopenharmony_ci const b = display.getCurrentFoldCreaseRegion(); 64723b3eb3cSopenharmony_ci const c = b.creaseRects; 64823b3eb3cSopenharmony_ci let d = 0; 64923b3eb3cSopenharmony_ci let e = 0; 65023b3eb3cSopenharmony_ci let f = 0; 65123b3eb3cSopenharmony_ci let g = 0; 65223b3eb3cSopenharmony_ci if (c && c.length) { 65323b3eb3cSopenharmony_ci const h = c[0]; 65423b3eb3cSopenharmony_ci d = px2vp(h.left) - this.containerGlobalPosition.x; 65523b3eb3cSopenharmony_ci e = px2vp(h.top) - this.containerGlobalPosition.y; 65623b3eb3cSopenharmony_ci f = px2vp(h.width); 65723b3eb3cSopenharmony_ci g = px2vp(h.height); 65823b3eb3cSopenharmony_ci } 65923b3eb3cSopenharmony_ci return { left: d, top: e, width: f, height: g }; 66023b3eb3cSopenharmony_ci } 66123b3eb3cSopenharmony_ci isPortraitOrientation() { 66223b3eb3cSopenharmony_ci const a = display.getDefaultDisplaySync(); 66323b3eb3cSopenharmony_ci switch (a.orientation) { 66423b3eb3cSopenharmony_ci case display.Orientation.PORTRAIT: 66523b3eb3cSopenharmony_ci case display.Orientation.PORTRAIT_INVERTED: 66623b3eb3cSopenharmony_ci return true; 66723b3eb3cSopenharmony_ci case display.Orientation.LANDSCAPE: 66823b3eb3cSopenharmony_ci case display.Orientation.LANDSCAPE_INVERTED: 66923b3eb3cSopenharmony_ci default: 67023b3eb3cSopenharmony_ci return false; 67123b3eb3cSopenharmony_ci } 67223b3eb3cSopenharmony_ci } 67323b3eb3cSopenharmony_ci rerender() { 67423b3eb3cSopenharmony_ci this.updateDirtyElements(); 67523b3eb3cSopenharmony_ci } 67623b3eb3cSopenharmony_ci} 67723b3eb3cSopenharmony_ci 67823b3eb3cSopenharmony_ciexport default { ExtraRegionPosition, PresetSplitRatio, FoldSplitContainer }; 679