1 /* 2 * Copyright (c) 2023 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 OHOS_GLOBAL_I18N_II18N_SERVICE_ABILITY_H 17 #define OHOS_GLOBAL_I18N_II18N_SERVICE_ABILITY_H 18 19 #include <string> 20 #include "i18n_types.h" 21 #include "iremote_broker.h" 22 23 namespace OHOS { 24 namespace Global { 25 namespace I18n { 26 class II18nServiceAbility : public IRemoteBroker { 27 public: 28 // The following are the service interfaces provided by i18n service. 29 virtual I18nErrorCode SetSystemLanguage(const std::string &language) = 0; 30 virtual I18nErrorCode SetSystemRegion(const std::string ®ion) = 0; 31 virtual I18nErrorCode SetSystemLocale(const std::string &locale) = 0; 32 virtual I18nErrorCode Set24HourClock(const std::string &flag) = 0; 33 virtual I18nErrorCode SetUsingLocalDigit(bool flag) = 0; 34 virtual I18nErrorCode AddPreferredLanguage(const std::string &language, int32_t index) = 0; 35 virtual I18nErrorCode RemovePreferredLanguage(int32_t index) = 0; 36 37 // I18n service request code. 38 enum class ILocaleConfigAbilityCode { 39 SET_SYSTEM_LANGUAGE = 0, 40 SET_SYSTEM_REGION = 1, 41 SET_SYSTEM_LOCALE = 2, 42 SET_24_HOUR_CLOCK = 3, 43 SET_USING_LOCAL_DIGIT = 4, 44 ADD_PREFERRED_LANGUAGE = 5, 45 REMOVE_PREFERRED_LANGUAGE = 6, 46 VERIFY_LIBPHONENUMBER_UPDATE = 7, 47 }; 48 49 DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.global.II18nServiceAbility"); 50 }; 51 } // namespace I18n 52 } // namespace Global 53 } // namespace OHOS 54 #endif // OHOS_GLOBAL_I18N_II18N_SERVICE_ABILITY_H