1 /* 2 * Copyright (c) 2021-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 FOUNDATION_ACE_ADAPTER_PREVIEW_ACE_APPLICATION_INFO_H 17 #define FOUNDATION_ACE_ADAPTER_PREVIEW_ACE_APPLICATION_INFO_H 18 19 #include "resource_manager.h" 20 21 #include "core/common/ace_application_info.h" 22 23 namespace OHOS::Ace::Platform { 24 25 class AceApplicationInfoImpl : public AceApplicationInfo { 26 public: 27 static AceApplicationInfoImpl& GetInstance(); 28 29 void SetLocale(const std::string& language, const std::string& countryOrRegion, const std::string& script, 30 const std::string& keywordsAndValues) override; 31 void ChangeLocale(const std::string& language, const std::string& countryOrRegion) override; 32 33 bool GetBundleInfo(const std::string& packageName, AceBundleInfo& bundleInfo) override; 34 double GetLifeTime() const override; 35 SetResourceManager(std::shared_ptr<Global::Resource::ResourceManager> & resourceManager)36 void SetResourceManager(std::shared_ptr<Global::Resource::ResourceManager>& resourceManager) 37 { 38 resourceManager_ = resourceManager; 39 } 40 41 void SetDebug(bool isDebugVersion, bool needDebugBreakpoint) override; 42 43 std::string GetJsEngineParam(const std::string& key) const override; 44 45 private: 46 std::shared_ptr<Global::Resource::ResourceManager> resourceManager_; 47 }; 48 49 } // namespace OHOS::Ace::Platform 50 51 #endif // #ifndef FOUNDATION_ACE_ADAPTER_PREVIEW_ACE_APPLICATION_INFO_H