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 */ 20import contextConstant from "./@ohos.app.ability.contextConstant"; 21import image from "./@ohos.multimedia.image"; 22import bundleManager from './@ohos.bundle.bundleManager'; 23/*** if arkts 1.1 */ 24import CompletionHandler from './@ohos.app.ability.CompletionHandler'; 25import window from './@ohos.window'; 26/*** endif */ 27 28/** 29 * StartOptions is the basic communication component of the system. 30 * 31 * @syscap SystemCapability.Ability.AbilityRuntime.Core 32 * @stagemodelonly 33 * @since 9 34 */ 35/** 36 * StartOptions is the basic communication component of the system. 37 * 38 * @syscap SystemCapability.Ability.AbilityRuntime.Core 39 * @stagemodelonly 40 * @atomicservice 41 * @since arkts {'1.1':'11', '1.2':'20'} 42 * @arkts 1.1&1.2 43 */ 44export default class StartOptions { 45 /** 46 * The type of {@link ohos.app.ability.AbilityConstant#WindowMode} 47 * {@link ohos.app.ability.AbilityConstant#WindowMode.WINDOW_MODE_SPLIT_PRIMARY} and 48 * {@link ohos.app.ability.AbilityConstant#WindowMode.WINDOW_MODE_SPLIT_SECONDARY} are 49 * valid only in intra-app redirection scenarios. 50 * 51 * @type { ?number } 52 * @syscap SystemCapability.Ability.AbilityRuntime.Core 53 * @stagemodelonly 54 * @since arkts {'1.1':'12', '1.2':'20'} 55 * @arkts 1.1&1.2 56 */ 57 windowMode?: number; 58 59 /** 60 * The type of displayId 61 * 62 * @type { ?number } 63 * @syscap SystemCapability.Ability.AbilityRuntime.Core 64 * @stagemodelonly 65 * @since 9 66 */ 67 /** 68 * The type of displayId 69 * 70 * @type { ?number } 71 * @syscap SystemCapability.Ability.AbilityRuntime.Core 72 * @stagemodelonly 73 * @atomicservice 74 * @since arkts {'1.1':'11', '1.2':'20'} 75 * @arkts 1.1&1.2 76 */ 77 displayId?: number; 78 79 /** 80 * The target ability with animation or without 81 * 82 * @type { ?boolean } 83 * @syscap SystemCapability.Ability.AbilityRuntime.Core 84 * @stagemodelonly 85 * @since arkts {'1.1':'11', '1.2':'20'} 86 * @arkts 1.1&1.2 87 */ 88 withAnimation?: boolean; 89 90 /** 91 * The left position of window rectangle 92 * 93 * @type { ?number } 94 * @syscap SystemCapability.Ability.AbilityRuntime.Core 95 * @stagemodelonly 96 * @since arkts {'1.1':'11', '1.2':'20'} 97 * @arkts 1.1&1.2 98 */ 99 windowLeft?: number; 100 101 /** 102 * The top position of window rectangle 103 * 104 * @type { ?number } 105 * @syscap SystemCapability.Ability.AbilityRuntime.Core 106 * @stagemodelonly 107 * @since arkts {'1.1':'11', '1.2':'20'} 108 * @arkts 1.1&1.2 109 */ 110 windowTop?: number; 111 112 /** 113 * The width of window rectangle 114 * 115 * @type { ?number } 116 * @syscap SystemCapability.Ability.AbilityRuntime.Core 117 * @stagemodelonly 118 * @since arkts {'1.1':'11', '1.2':'20'} 119 * @arkts 1.1&1.2 120 */ 121 windowWidth?: number; 122 123 /** 124 * The height of window rectangle 125 * 126 * @type { ?number } 127 * @syscap SystemCapability.Ability.AbilityRuntime.Core 128 * @stagemodelonly 129 * @since arkts {'1.1':'11', '1.2':'20'} 130 * @arkts 1.1&1.2 131 */ 132 windowHeight?: number; 133 134 /** 135 * Indicates the cold startup window is focused. 136 * 137 * @type { ?boolean } 138 * @syscap SystemCapability.Ability.AbilityRuntime.Core 139 * @systemapi 140 * @stagemodelonly 141 * @since arkts {'1.1':'12', '1.2':'20'} 142 * @arkts 1.1&1.2 143 */ 144 windowFocused?: boolean; 145 146 /** 147 * The process mode. 148 * This property only takes effect when calling UIAbilityContext.startAbility. 149 * The properties processMode and startupVisibility must be set simultaneously. 150 * 151 * @type { ?contextConstant.ProcessMode } 152 * @syscap SystemCapability.Ability.AbilityRuntime.Core 153 * @stagemodelonly 154 * @since arkts {'1.1':'12', '1.2':'20'} 155 * @arkts 1.1&1.2 156 */ 157 processMode?: contextConstant.ProcessMode; 158 159 /** 160 * The ability visibility after the new process startup. 161 * This property only takes effect when calling UIAbilityContext.startAbility. 162 * The properties processMode and startupVisibility must be set simultaneously. 163 * 164 * @type { ?contextConstant.StartupVisibility } 165 * @syscap SystemCapability.Ability.AbilityRuntime.Core 166 * @stagemodelonly 167 * @since arkts {'1.1':'12', '1.2':'20'} 168 * @arkts 1.1&1.2 169 */ 170 startupVisibility?: contextConstant.StartupVisibility; 171 172 /** 173 * The start window Icon. 174 * 175 * @type { ?image.PixelMap } 176 * @syscap SystemCapability.Ability.AbilityRuntime.Core 177 * @stagemodelonly 178 * @since arkts {'1.1':'14', '1.2':'20'} 179 * @arkts 1.1&1.2 180 */ 181 startWindowIcon?: image.PixelMap; 182 183 /** 184 * The start window backgroundColor. 185 * 186 * @type { ?string } 187 * @syscap SystemCapability.Ability.AbilityRuntime.Core 188 * @stagemodelonly 189 * @since arkts {'1.1':'14', '1.2':'20'} 190 * @arkts 1.1&1.2 191 */ 192 startWindowBackgroundColor?: string; 193 194 /** 195 * The support window modes. 196 * 197 * @type { ?Array<bundleManager.SupportWindowMode> } 198 * @syscap SystemCapability.Ability.AbilityRuntime.Core 199 * @stagemodelonly 200 * @since arkts {'1.1':'14', '1.2':'20'} 201 * @arkts 1.1&1.2 202 */ 203 supportWindowModes?: Array<bundleManager.SupportWindowMode>; 204 205 /** 206 * The min width of window rectangle. 207 * 208 * @type { ?number } 209 * @syscap SystemCapability.Ability.AbilityRuntime.Core 210 * @stagemodelonly 211 * @since arkts{ '1.1':'17','1.2':'20'} 212 * @arkts 1.1&1.2 213 */ 214 minWindowWidth?: number; 215 216 /** 217 * The min height of window rectangle. 218 * 219 * @type { ?number } 220 * @syscap SystemCapability.Ability.AbilityRuntime.Core 221 * @stagemodelonly 222 * @since arkts{ '1.1':'17','1.2':'20'} 223 * @arkts 1.1&1.2 224 */ 225 minWindowHeight?: number; 226 227 /** 228 * The max width of window rectangle. 229 * 230 * @type { ?number } 231 * @syscap SystemCapability.Ability.AbilityRuntime.Core 232 * @stagemodelonly 233 * @since arkts{ '1.1':'17','1.2':'20'} 234 * @arkts 1.1&1.2 235 */ 236 maxWindowWidth?: number; 237 238 /** 239 * The max height of window rectangle. 240 * 241 * @type { ?number } 242 * @syscap SystemCapability.Ability.AbilityRuntime.Core 243 * @stagemodelonly 244 * @since arkts{ '1.1':'17','1.2':'20'} 245 * @arkts 1.1&1.2 246 */ 247 maxWindowHeight?: number; 248 249 /** 250 * The completion handler of StartAbility. 251 * 252 * @type { ?CompletionHandler } 253 * @syscap SystemCapability.Ability.AbilityRuntime.Core 254 * @stagemodelonly 255 * @atomicservice 256 * @since 20 257 */ 258 completionHandler?: CompletionHandler; 259 260 /** 261 * Hide start window or not when launch ability from same bundle. 262 * 263 * @type { ?boolean } 264 * @syscap SystemCapability.Ability.AbilityRuntime.Core 265 * @stagemodelonly 266 * @since 20 267 */ 268 hideStartWindow?: boolean; 269 270 /** 271 * Indicates the window creation parameters during application startup. 272 * 273 * @type { ?window.WindowCreateParams } 274 * @syscap SystemCapability.Ability.AbilityRuntime.Core 275 * @stagemodelonly 276 * @since 20 277 */ 278 windowCreateParams?: window.WindowCreateParams; 279}