1 /* 2 * Copyright (c) 2025 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 #ifndef ABILITY_RUNTIME_START_OPTIONS_IMPL_H 17 #define ABILITY_RUNTIME_START_OPTIONS_IMPL_H 18 19 #include "ability_manager/include/start_options.h" 20 #include "ability_runtime_common.h" 21 #include "context_constant.h" 22 23 #ifdef __cplusplus 24 extern "C" { 25 #endif 26 27 struct OH_PixelmapNative; 28 typedef struct OH_PixelmapNative OH_PixelmapNative; 29 30 struct AbilityRuntime_StartOptions { 31 public: 32 AbilityRuntime_StartOptions(); 33 OHOS::AAFwk::StartOptions GetInnerStartOptions(); 34 35 AbilityRuntime_ErrorCode SetStartOptionsWindowMode(AbilityRuntime_WindowMode windowMode); 36 AbilityRuntime_ErrorCode GetStartOptionsWindowMode(AbilityRuntime_WindowMode &windowMode); 37 AbilityRuntime_ErrorCode SetStartOptionsDisplayId(int32_t displayId); 38 AbilityRuntime_ErrorCode GetStartOptionsDisplayId(int32_t &displayId); 39 AbilityRuntime_ErrorCode SetStartOptionsWithAnimation(bool withAnimation); 40 AbilityRuntime_ErrorCode GetStartOptionsWithAnimation(bool &withAnimation); 41 AbilityRuntime_ErrorCode SetStartOptionsWindowLeft(int32_t windowLeft); 42 AbilityRuntime_ErrorCode GetStartOptionsWindowLeft(int32_t &windowLeft); 43 AbilityRuntime_ErrorCode SetStartOptionsWindowTop(int32_t windowTop); 44 AbilityRuntime_ErrorCode GetStartOptionsWindowTop(int32_t &windowTop); 45 AbilityRuntime_ErrorCode SetStartOptionsWindowHeight(int32_t windowHeight); 46 AbilityRuntime_ErrorCode GetStartOptionsWindowHeight(int32_t &windowHeight); 47 AbilityRuntime_ErrorCode SetStartOptionsWindowWidth(int32_t windowWidth); 48 AbilityRuntime_ErrorCode GetStartOptionsWindowWidth(int32_t &windowWidth); 49 AbilityRuntime_ErrorCode SetStartOptionsStartVisibility(AbilityRuntime_StartVisibility startVisibility); 50 AbilityRuntime_ErrorCode GetStartOptionsStartVisibility(AbilityRuntime_StartVisibility &startVisibility); 51 AbilityRuntime_ErrorCode SetStartOptionsStartWindowIcon(OH_PixelmapNative *startWindowIcon); 52 AbilityRuntime_ErrorCode GetStartOptionsStartWindowIcon(OH_PixelmapNative **startWindowIcon); 53 AbilityRuntime_ErrorCode SetStartOptionsStartWindowBackgroundColor(const char *startWindowBackgroundColor); 54 AbilityRuntime_ErrorCode GetStartOptionsStartWindowBackgroundColor(char **startWindowBackgroundColor, 55 size_t &size); 56 AbilityRuntime_ErrorCode SetStartOptionsSupportedWindowModes( 57 AbilityRuntime_SupportedWindowMode *supportedWindowModes, size_t size); 58 AbilityRuntime_ErrorCode GetStartOptionsSupportedWindowModes( 59 AbilityRuntime_SupportedWindowMode **supportedWindowModes, size_t &size); 60 AbilityRuntime_ErrorCode SetStartOptionsMinWindowWidth(int32_t minWindowWidth); 61 AbilityRuntime_ErrorCode GetStartOptionsMinWindowWidth(int32_t &minWindowWidth); 62 AbilityRuntime_ErrorCode SetStartOptionsMaxWindowWidth(int32_t maxWindowWidth); 63 AbilityRuntime_ErrorCode GetStartOptionsMaxWindowWidth(int32_t &maxWindowWidth); 64 AbilityRuntime_ErrorCode SetStartOptionsMinWindowHeight(int32_t minWindowHeight); 65 AbilityRuntime_ErrorCode GetStartOptionsMinWindowHeight(int32_t &minWindowHeight); 66 AbilityRuntime_ErrorCode SetStartOptionsMaxWindowHeight(int32_t maxWindowHeight); 67 AbilityRuntime_ErrorCode GetStartOptionsMaxWindowHeight(int32_t &maxWindowHeight); 68 69 private: 70 OHOS::AAFwk::StartOptions options; 71 }; 72 73 #ifdef __cplusplus 74 } // extern "C" 75 #endif 76 77 #endif // ABILITY_RUNTIME_START_OPTIONS_IMPL_H