1 /* 2 * Copyright (c) 2022 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 UI_APPEARANCE_ABILITY_INTERFACE_H 17 #define UI_APPEARANCE_ABILITY_INTERFACE_H 18 19 #include <iremote_broker.h> 20 #include <string> 21 22 namespace OHOS { 23 namespace ArkUi::UiAppearance { 24 class UiAppearanceAbilityInterface : public IRemoteBroker { 25 public: 26 enum DarkMode { 27 ALWAYS_DARK = 0, 28 ALWAYS_LIGHT = 1, 29 UNKNOWN = 2, 30 }; 31 32 enum ErrCode { 33 SUCCEEDED = 0, 34 PERMISSION_ERR = 201, 35 INVALID_ARG = 401, 36 SYS_ERR = 500001, 37 }; 38 39 virtual int32_t SetDarkMode(DarkMode mode) = 0; 40 virtual int32_t GetDarkMode() = 0; 41 virtual int32_t GetFontScale(std::string &fontScale) = 0; 42 virtual int32_t SetFontScale(std::string &fontScale) = 0; 43 virtual int32_t GetFontWeightScale(std::string &fontWeightScale) = 0; 44 virtual int32_t SetFontWeightScale(std::string &fontWeightScale) = 0; 45 46 public: 47 DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.UiAppearance.UiAppearanceAbilityInterface"); 48 }; 49 } // namespace ArkUi::UiAppearance 50 } // namespace OHOS 51 #endif // UI_APPEARANCE_ABILITY_INTERFACE_H