• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# start_options.h
2
3
4## Overview
5
6The file declares the StartOptions struct and related functions.
7
8**File to include**: <AbilityKit/ability_runtime/start_options.h>
9
10**Library**: libability_runtime.so
11
12**System capability**: SystemCapability.Ability.AbilityRuntime.Core
13
14**Since**: 17
15
16**Related module**: [AbilityRuntime](_ability_runtime.md)
17
18## Summary
19
20### Files
21
22| Name                                               | Description                                                        |
23| --------------------------------------------------- | ------------------------------------------------------------ |
24| [start_options.h](start__options_8h.md) | Declares the StartOptions struct.<br>**File to include**: <AbilityKit/ability_runtime/start_options.h><br>**Library**: libability_runtime.so|
25
26### Structs
27
28| Name                                                        | Description                        |
29| ------------------------------------------------------------ | ---------------------------- |
30| [AbilityRuntime_StartOptions](_ability_runtime.md#abilityruntime_startoptions)  | StartOptions struct.|
31
32### Functions
33
34| Name                                                        | Description                        |
35| ------------------------------------------------------------ | ---------------------------- |
36| [AbilityRuntime_StartOptions*](_ability_runtime.md#abilityruntime_startoptions) [OH_AbilityRuntime_CreateStartOptions](_ability_runtime.md#oh_abilityruntime_createstartoptions)(void) | Creates the StartOptions struct required for starting the UIAbility of the current application.|
37| [AbilityRuntime_ErrorCode](_ability_runtime.md#abilityruntime_errorcode) [OH_AbilityRuntime_DestroyStartOptions](_ability_runtime.md#oh_abilityruntime_destroystartoptions)([AbilityRuntime_StartOptions](_ability_runtime.md#abilityruntime_startoptions) **startOptions) | Destroys a StartOptions struct.|
38| [AbilityRuntime_ErrorCode](_ability_runtime.md#abilityruntime_errorcode) [OH_AbilityRuntime_SetStartOptionsWindowMode](_ability_runtime.md#oh_abilityruntime_setstartoptionswindowmode)([AbilityRuntime_StartOptions](_ability_runtime.md#abilityruntime_startoptions) *startOptions, [AbilityRuntime_WindowMode](_ability_runtime.md#abilityruntime_windowmode) windowMode) | Sets the window mode for starting an ability.|
39| [AbilityRuntime_ErrorCode](_ability_runtime.md#abilityruntime_errorcode) [OH_AbilityRuntime_GetStartOptionsWindowMode](_ability_runtime.md#oh_abilityruntime_getstartoptionswindowmode)([AbilityRuntime_StartOptions](_ability_runtime.md#abilityruntime_startoptions) *startOptions, [AbilityRuntime_WindowMode](_ability_runtime.md#abilityruntime_windowmode) &windowMode) | Obtains the window mode for starting an ability.|
40| [AbilityRuntime_ErrorCode](_ability_runtime.md#abilityruntime_errorcode) [OH_AbilityRuntime_SetStartOptionsDisplayId](_ability_runtime.md#oh_abilityruntime_setstartoptionsdisplayid)([AbilityRuntime_StartOptions](_ability_runtime.md#abilityruntime_startoptions) *startOptions, int32_t displayId) | Sets the ID of the display where the window is launched when the ability is started.|
41| [AbilityRuntime_ErrorCode](_ability_runtime.md#abilityruntime_errorcode) [OH_AbilityRuntime_GetStartOptionsDisplayId](_ability_runtime.md#oh_abilityruntime_getstartoptionsdisplayid)([AbilityRuntime_StartOptions](_ability_runtime.md#abilityruntime_startoptions) *startOptions, int32_t &displayId) | Obtains the ID of the display where the window is launched when the ability is started.|
42| [AbilityRuntime_ErrorCode](_ability_runtime.md#abilityruntime_errorcode) [OH_AbilityRuntime_SetStartOptionsWithAnimation](_ability_runtime.md#oh_abilityruntime_setstartoptionswithanimation)([AbilityRuntime_StartOptions](_ability_runtime.md#abilityruntime_startoptions) *startOptions, bool withAnimation) | Sets whether to use animation effects when an ability is started.|
43| [AbilityRuntime_ErrorCode](_ability_runtime.md#abilityruntime_errorcode) [OH_AbilityRuntime_GetStartOptionsWithAnimation](_ability_runtime.md#oh_abilityruntime_getstartoptionswithanimation)([AbilityRuntime_StartOptions](_ability_runtime.md#abilityruntime_startoptions) *startOptions, bool &withAnimation) | Checks whether animation effects are used when an ability is started.|
44| [AbilityRuntime_ErrorCode](_ability_runtime.md#abilityruntime_errorcode) [OH_AbilityRuntime_SetStartOptionsWindowLeft](_ability_runtime.md#oh_abilityruntime_setstartoptionswindowleft)([AbilityRuntime_StartOptions](_ability_runtime.md#abilityruntime_startoptions) *startOptions, int32_t windowLeft) | Sets the left position of the window when the ability is started, in px.|
45| [AbilityRuntime_ErrorCode](_ability_runtime.md#abilityruntime_errorcode) [OH_AbilityRuntime_GetStartOptionsWindowLeft](_ability_runtime.md#oh_abilityruntime_getstartoptionswindowleft)([AbilityRuntime_StartOptions](_ability_runtime.md#abilityruntime_startoptions) *startOptions, int32_t &windowLeft) | Obtains the left position of the window when the ability is started, in px.|
46| [AbilityRuntime_ErrorCode](_ability_runtime.md#abilityruntime_errorcode) [OH_AbilityRuntime_SetStartOptionsWindowTop](_ability_runtime.md#oh_abilityruntime_setstartoptionswindowtop)([AbilityRuntime_StartOptions](_ability_runtime.md#abilityruntime_startoptions) *startOptions, int32_t windowTop) | Sets the top position of the window when the ability is started, in px.|
47| [AbilityRuntime_ErrorCode](_ability_runtime.md#abilityruntime_errorcode) [OH_AbilityRuntime_GetStartOptionsWindowTop](_ability_runtime.md#oh_abilityruntime_getstartoptionswindowtop)([AbilityRuntime_StartOptions](_ability_runtime.md#abilityruntime_startoptions) *startOptions, int32_t &windowTop) | Obtains the top position of the window when the ability is started, in px.|
48| [AbilityRuntime_ErrorCode](_ability_runtime.md#abilityruntime_errorcode) [OH_AbilityRuntime_SetStartOptionsWindowHeight](_ability_runtime.md#oh_abilityruntime_setstartoptionswindowheight)([AbilityRuntime_StartOptions](_ability_runtime.md#abilityruntime_startoptions) *startOptions, int32_t windowHeight) | Sets the height of the window when the ability is started, in px.|
49| [AbilityRuntime_ErrorCode](_ability_runtime.md#abilityruntime_errorcode) [OH_AbilityRuntime_GetStartOptionsWindowHeight](_ability_runtime.md#oh_abilityruntime_getstartoptionswindowheight)([AbilityRuntime_StartOptions](_ability_runtime.md#abilityruntime_startoptions) *startOptions, int32_t &windowHeight) | Obtains the height of the window when the ability is started, in px.|
50| [AbilityRuntime_ErrorCode](_ability_runtime.md#abilityruntime_errorcode) [OH_AbilityRuntime_SetStartOptionsWindowWidth](_ability_runtime.md#oh_abilityruntime_setstartoptionswindowwidth)([AbilityRuntime_StartOptions](_ability_runtime.md#abilityruntime_startoptions) *startOptions, int32_t windowWidth) | Sets the width of the window when the ability is started, in px.|
51| [AbilityRuntime_ErrorCode](_ability_runtime.md#abilityruntime_errorcode) [OH_AbilityRuntime_GetStartOptionsWindowWidth](_ability_runtime.md#oh_abilityruntime_getstartoptionswindowwidth)([AbilityRuntime_StartOptions](_ability_runtime.md#abilityruntime_startoptions) *startOptions, int32_t &windowWidth) | Obtains the width of the window when the ability is started, in px.|
52| [AbilityRuntime_ErrorCode](_ability_runtime.md#abilityruntime_errorcode) [OH_AbilityRuntime_SetStartOptionsStartVisibility](_ability_runtime.md#oh_abilityruntime_setstartoptionsstartvisibility)([AbilityRuntime_StartOptions](_ability_runtime.md#abilityruntime_startoptions) *startOptions, [AbilityRuntime_StartVisibility](_ability_runtime.md#abilityruntime_startvisibility) startVisibility) | Sets the visibility of the window and dock bar icons when the ability is started.|
53| [AbilityRuntime_ErrorCode](_ability_runtime.md#abilityruntime_errorcode) [OH_AbilityRuntime_GetStartOptionsStartVisibility](_ability_runtime.md#oh_abilityruntime_getstartoptionsstartvisibility)([AbilityRuntime_StartOptions](_ability_runtime.md#abilityruntime_startoptions) *startOptions, [AbilityRuntime_StartVisibility](_ability_runtime.md#abilityruntime_startvisibility) &startVisibility) | Obtains the visibility of the window and dock bar icons when the ability is started.|
54| [AbilityRuntime_ErrorCode](_ability_runtime.md#abilityruntime_errorcode) [OH_AbilityRuntime_SetStartOptionsStartWindowIcon](_ability_runtime.md#oh_abilityruntime_setstartoptionsstartwindowicon)([AbilityRuntime_StartOptions](_ability_runtime.md#abilityruntime_startoptions) *startOptions, [OH_PixelmapNative](../apis-image-kit/capi-image-nativemodule-oh-pixelmapnative.md) *startWindowIcon) | Sets the startup icon of the window when the ability is started.|
55| [AbilityRuntime_ErrorCode](_ability_runtime.md#abilityruntime_errorcode) [OH_AbilityRuntime_GetStartOptionsStartWindowIcon](_ability_runtime.md#oh_abilityruntime_getstartoptionsstartwindowicon)([AbilityRuntime_StartOptions](_ability_runtime.md#abilityruntime_startoptions) *startOptions, [OH_PixelmapNative](../apis-image-kit/capi-image-nativemodule-oh-pixelmapnative.md) **startWindowIcon) | Obtains the startup icon of the window when the ability is started.|
56| [AbilityRuntime_ErrorCode](_ability_runtime.md#abilityruntime_errorcode) [OH_AbilityRuntime_SetStartOptionsStartWindowBackgroundColor](_ability_runtime.md#oh_abilityruntime_setstartoptionsstartwindowbackgroundcolor)([AbilityRuntime_StartOptions](_ability_runtime.md#abilityruntime_startoptions) *startOptions, const char *startWindowBackgroundColor) | Sets the background color of the window when the ability is started.|
57| [AbilityRuntime_ErrorCode](_ability_runtime.md#abilityruntime_errorcode) [OH_AbilityRuntime_GetStartOptionsStartWindowBackgroundColor](_ability_runtime.md#oh_abilityruntime_getstartoptionsstartwindowbackgroundcolor)([AbilityRuntime_StartOptions](_ability_runtime.md#abilityruntime_startoptions) *startOptions, char **startWindowBackgroundColor, size_t &size) | Obtains the background color of the window when the ability is started.|
58| [AbilityRuntime_ErrorCode](_ability_runtime.md#abilityruntime_errorcode) [OH_AbilityRuntime_SetStartOptionsSupportedWindowModes](_ability_runtime.md#oh_abilityruntime_setstartoptionssupportedwindowmodes)([AbilityRuntime_StartOptions](_ability_runtime.md#abilityruntime_startoptions) *startOptions, [AbilityRuntime_SupportedWindowMode](_ability_runtime.md#abilityruntime_supportedwindowmode) *supportedWindowModes, size_t size) | Sets the window modes supported by the ability when it is started.|
59| [AbilityRuntime_ErrorCode](_ability_runtime.md#abilityruntime_errorcode) [OH_AbilityRuntime_GetStartOptionsSupportedWindowModes](_ability_runtime.md#oh_abilityruntime_getstartoptionssupportedwindowmodes)([AbilityRuntime_StartOptions](_ability_runtime.md#abilityruntime_startoptions) *startOptions, [AbilityRuntime_SupportedWindowMode](_ability_runtime.md#abilityruntime_supportedwindowmode) **supportedWindowModes, size_t &size) | Obtains the window modes supported by the ability when it is started.|
60| [AbilityRuntime_ErrorCode](_ability_runtime.md#abilityruntime_errorcode) [OH_AbilityRuntime_SetStartOptionsMinWindowWidth](_ability_runtime.md#oh_abilityruntime_setstartoptionsminwindowwidth)([AbilityRuntime_StartOptions](_ability_runtime.md#abilityruntime_startoptions) *startOptions, int32_t minWindowWidth) | Sets the minimum window width for starting the ability, in vp.|
61| [AbilityRuntime_ErrorCode](_ability_runtime.md#abilityruntime_errorcode) [OH_AbilityRuntime_GetStartOptionsMinWindowWidth](_ability_runtime.md#oh_abilityruntime_getstartoptionsminwindowwidth)([AbilityRuntime_StartOptions](_ability_runtime.md#abilityruntime_startoptions) *startOptions, int32_t &minWindowWidth) | Obtains the minimum window width for starting the ability, in vp.|
62| [AbilityRuntime_ErrorCode](_ability_runtime.md#abilityruntime_errorcode) [OH_AbilityRuntime_SetStartOptionsMaxWindowWidth](_ability_runtime.md#oh_abilityruntime_setstartoptionsmaxwindowwidth)([AbilityRuntime_StartOptions](_ability_runtime.md#abilityruntime_startoptions) *startOptions, int32_t maxWindowWidth) | Sets the maximum window width for starting the ability, in vp.|
63| [AbilityRuntime_ErrorCode](_ability_runtime.md#abilityruntime_errorcode) [OH_AbilityRuntime_GetStartOptionsMaxWindowWidth](_ability_runtime.md#oh_abilityruntime_getstartoptionsmaxwindowwidth)([AbilityRuntime_StartOptions](_ability_runtime.md#abilityruntime_startoptions) *startOptions, int32_t &maxWindowWidth) | Obtains the maximum window width for starting the ability, in vp.|
64| [AbilityRuntime_ErrorCode](_ability_runtime.md#abilityruntime_errorcode) [OH_AbilityRuntime_SetStartOptionsMinWindowHeight](_ability_runtime.md#oh_abilityruntime_setstartoptionsminwindowheight)([AbilityRuntime_StartOptions](_ability_runtime.md#abilityruntime_startoptions) *startOptions, int32_t minWindowHeight) | Sets the minimum window height for starting the ability, in vp.|
65| [AbilityRuntime_ErrorCode](_ability_runtime.md#abilityruntime_errorcode) [OH_AbilityRuntime_GetStartOptionsMinWindowHeight](_ability_runtime.md#oh_abilityruntime_getstartoptionsminwindowheight)([AbilityRuntime_StartOptions](_ability_runtime.md#abilityruntime_startoptions) *startOptions, int32_t &minWindowHeight) | Obtains the minimum window height for starting the ability, in vp.|
66| [AbilityRuntime_ErrorCode](_ability_runtime.md#abilityruntime_errorcode) [OH_AbilityRuntime_SetStartOptionsMaxWindowHeight](_ability_runtime.md#oh_abilityruntime_setstartoptionsmaxwindowheight)([AbilityRuntime_StartOptions](_ability_runtime.md#abilityruntime_startoptions) *startOptions, int32_t maxWindowHeig) | Sets the maximum window height for starting the ability, in vp.|
67| [AbilityRuntime_ErrorCode](_ability_runtime.md#abilityruntime_errorcode) [OH_AbilityRuntime_GetStartOptionsMaxWindowHeight](_ability_runtime.md#oh_abilityruntime_getstartoptionsmaxwindowheight)([AbilityRuntime_StartOptions](_ability_runtime.md#abilityruntime_startoptions) *startOptions, int32_t &maxWindowHeight) | Obtains the maximum window height for starting the ability, in vp.|
68