1/* 2 * Copyright (c) 2022-2024 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 16/** 17 * @file 18 * @kit AbilityKit 19 */ 20 21import contextConstant from "./@ohos.app.ability.contextConstant"; 22import image from "./@ohos.multimedia.image"; 23import bundleManager from './@ohos.bundle.bundleManager'; 24 25/** 26 * StartOptions is the basic communication component of the system. 27 * 28 * @syscap SystemCapability.Ability.AbilityRuntime.Core 29 * @stagemodelonly 30 * @since 9 31 */ 32/** 33 * StartOptions is the basic communication component of the system. 34 * 35 * @syscap SystemCapability.Ability.AbilityRuntime.Core 36 * @stagemodelonly 37 * @atomicservice 38 * @since 11 39 */ 40export default class StartOptions { 41 /** 42 * The type of {@link ohos.app.ability.AbilityConstant#WindowMode} 43 * {@link ohos.app.ability.AbilityConstant#WindowMode.WINDOW_MODE_SPLIT_PRIMARY} and 44 * {@link ohos.app.ability.AbilityConstant#WindowMode.WINDOW_MODE_SPLIT_SECONDARY} are 45 * valid only in intra-app redirection scenarios. 46 * 47 * @type { ?number } 48 * @syscap SystemCapability.Ability.AbilityRuntime.Core 49 * @stagemodelonly 50 * @since 12 51 */ 52 windowMode?: number; 53 54 /** 55 * The type of displayId 56 * 57 * @type { ?number } 58 * @syscap SystemCapability.Ability.AbilityRuntime.Core 59 * @stagemodelonly 60 * @since 9 61 */ 62 /** 63 * The type of displayId 64 * 65 * @type { ?number } 66 * @syscap SystemCapability.Ability.AbilityRuntime.Core 67 * @stagemodelonly 68 * @atomicservice 69 * @since 11 70 */ 71 displayId?: number; 72 73 /** 74 * The target ability with animation or without 75 * 76 * @type { ?boolean } 77 * @syscap SystemCapability.Ability.AbilityRuntime.Core 78 * @stagemodelonly 79 * @since 11 80 */ 81 withAnimation?: boolean; 82 83 /** 84 * The left position of window rectangle 85 * 86 * @type { ?number } 87 * @syscap SystemCapability.Ability.AbilityRuntime.Core 88 * @stagemodelonly 89 * @since 11 90 */ 91 windowLeft?: number; 92 93 /** 94 * The top position of window rectangle 95 * 96 * @type { ?number } 97 * @syscap SystemCapability.Ability.AbilityRuntime.Core 98 * @stagemodelonly 99 * @since 11 100 */ 101 windowTop?: number; 102 103 /** 104 * The width of window rectangle 105 * 106 * @type { ?number } 107 * @syscap SystemCapability.Ability.AbilityRuntime.Core 108 * @stagemodelonly 109 * @since 11 110 */ 111 windowWidth?: number; 112 113 /** 114 * The height of window rectangle 115 * 116 * @type { ?number } 117 * @syscap SystemCapability.Ability.AbilityRuntime.Core 118 * @stagemodelonly 119 * @since 11 120 */ 121 windowHeight?: number; 122 123 /** 124 * Indicates the cold startup window is focused. 125 * 126 * @type { ?boolean } 127 * @syscap SystemCapability.Ability.AbilityRuntime.Core 128 * @systemapi 129 * @stagemodelonly 130 * @since 12 131 */ 132 windowFocused?: boolean; 133 134 /** 135 * The process mode. 136 * This property only takes effect when calling UIAbilityContext.startAbility. 137 * The properties processMode and startupVisibility must be set simultaneously. 138 * 139 * @type { ?contextConstant.ProcessMode } 140 * @syscap SystemCapability.Ability.AbilityRuntime.Core 141 * @stagemodelonly 142 * @since 12 143 */ 144 processMode?: contextConstant.ProcessMode; 145 146 /** 147 * The ability visibility after the new process startup. 148 * This property only takes effect when calling UIAbilityContext.startAbility. 149 * The properties processMode and startupVisibility must be set simultaneously. 150 * 151 * @type { ?contextConstant.StartupVisibility } 152 * @syscap SystemCapability.Ability.AbilityRuntime.Core 153 * @stagemodelonly 154 * @since 12 155 */ 156 startupVisibility?: contextConstant.StartupVisibility; 157 158 /** 159 * The start window Icon. 160 * 161 * @type { ?image.PixelMap } 162 * @syscap SystemCapability.Ability.AbilityRuntime.Core 163 * @stagemodelonly 164 * @since 14 165 */ 166 startWindowIcon?: image.PixelMap; 167 168 /** 169 * The start window backgroundColor. 170 * 171 * @type { ?string } 172 * @syscap SystemCapability.Ability.AbilityRuntime.Core 173 * @stagemodelonly 174 * @since 14 175 */ 176 startWindowBackgroundColor?: string; 177 178 /** 179 * The support window modes. 180 * 181 * @type { ?Array<bundleManager.SupportWindowMode> } 182 * @syscap SystemCapability.Ability.AbilityRuntime.Core 183 * @stagemodelonly 184 * @since 14 185 */ 186 supportWindowModes?: Array<bundleManager.SupportWindowMode>; 187 188 /** 189 * The min width of window rectangle. 190 * 191 * @type { ?number } 192 * @syscap SystemCapability.Ability.AbilityRuntime.Core 193 * @stagemodelonly 194 * @since 17 195 */ 196 minWindowWidth?: number; 197 198 /** 199 * The min height of window rectangle. 200 * 201 * @type { ?number } 202 * @syscap SystemCapability.Ability.AbilityRuntime.Core 203 * @stagemodelonly 204 * @since 17 205 */ 206 minWindowHeight?: number; 207 208 /** 209 * The max width of window rectangle. 210 * 211 * @type { ?number } 212 * @syscap SystemCapability.Ability.AbilityRuntime.Core 213 * @stagemodelonly 214 * @since 17 215 */ 216 maxWindowWidth?: number; 217 218 /** 219 * The max height of window rectangle. 220 * 221 * @type { ?number } 222 * @syscap SystemCapability.Ability.AbilityRuntime.Core 223 * @stagemodelonly 224 * @since 17 225 */ 226 maxWindowHeight?: number; 227}