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 FOUNDATION_ACE_FRAMEWORKS_BASE_VIEW_DATA_WRAP_H 17 #define FOUNDATION_ACE_FRAMEWORKS_BASE_VIEW_DATA_WRAP_H 18 19 #include "base/memory/ace_type.h" 20 #include "base/view_data/page_node_info_wrap.h" 21 22 namespace OHOS::AbilityBase { 23 struct ViewData; 24 } // namespace OHOS::AbilityBase 25 26 namespace OHOS::Ace { 27 class ACE_EXPORT ViewDataWrap : public AceType { 28 DECLARE_ACE_TYPE(ViewDataWrap, AceType); 29 30 public: 31 static RefPtr<ViewDataWrap> CreateViewDataWrap(); 32 static RefPtr<ViewDataWrap> CreateViewDataWrap(const AbilityBase::ViewData& viewData); 33 SetBundleName(const std::string & bundleName)34 virtual void SetBundleName(const std::string& bundleName) {} 35 virtual const std::string& GetBundleName() const = 0; 36 SetModuleName(const std::string & moduleName)37 virtual void SetModuleName(const std::string& moduleName) {} 38 virtual const std::string& GetModuleName() const = 0; 39 SetAbilityName(const std::string & abilityName)40 virtual void SetAbilityName(const std::string& abilityName) {} 41 virtual const std::string& GetAbilityName() const = 0; 42 SetPageUrl(const std::string & pageUrl)43 virtual void SetPageUrl(const std::string& pageUrl) {} 44 virtual const std::string& GetPageUrl() const = 0; 45 AddPageNodeInfoWrap(RefPtr<PageNodeInfoWrap> pageNodeInfoWrap)46 virtual void AddPageNodeInfoWrap(RefPtr<PageNodeInfoWrap> pageNodeInfoWrap) {} 47 virtual const std::vector<RefPtr<PageNodeInfoWrap>>& GetPageNodeInfoWraps() = 0; 48 }; 49 } // namespace OHOS::Ace 50 #endif // FOUNDATION_ACE_FRAMEWORKS_BASE_VIEW_DATA_WRAP_H 51