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 FOUNDATION_ACE_FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_NG_ENTRY_PAGE_INFO_H 17 #define FOUNDATION_ACE_FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_NG_ENTRY_PAGE_INFO_H 18 19 #include <cstdint> 20 #include <string> 21 #include <utility> 22 23 #include "base/memory/ace_type.h" 24 #include "base/utils/noncopyable.h" 25 #include "bridge/common/utils/source_map.h" 26 #include "core/components_ng/pattern/stage/page_info.h" 27 28 namespace OHOS::Ace::NG { 29 30 class ACE_EXPORT EntryPageInfo : public PageInfo { DECLARE_ACE_TYPE(EntryPageInfo,PageInfo)31 DECLARE_ACE_TYPE(EntryPageInfo, PageInfo) 32 public: 33 EntryPageInfo(int32_t pageId, const std::string& url, const std::string& path, std::string params) 34 : PageInfo(pageId, url, path), params_(std::move(params)) 35 {} 36 ~EntryPageInfo() override = default; 37 GetPageParams()38 const std::string& GetPageParams() const 39 { 40 return params_; 41 } 42 ReplacePageParams(const std::string & param)43 std::string ReplacePageParams(const std::string& param) 44 { 45 std::string old(std::move(params_)); 46 params_ = param; 47 return old; 48 } 49 SetPageMap(const RefPtr<Framework::RevSourceMap> & pageMap)50 void SetPageMap(const RefPtr<Framework::RevSourceMap>& pageMap) 51 { 52 pageMap_ = pageMap; 53 } 54 GetPageMap()55 const RefPtr<Framework::RevSourceMap>& GetPageMap() const 56 { 57 return pageMap_; 58 } 59 SetShowTime(int64_t time)60 void SetShowTime(int64_t time) 61 { 62 showTime_ = time; 63 } 64 GetShowTime()65 int64_t GetShowTime() const 66 { 67 return showTime_; 68 } 69 70 private: 71 std::string params_; 72 int64_t showTime_ = 0; 73 RefPtr<Framework::RevSourceMap> pageMap_; 74 75 ACE_DISALLOW_COPY_AND_MOVE(EntryPageInfo); 76 }; 77 78 } // namespace OHOS::Ace::NG 79 80 #endif // FOUNDATION_ACE_FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_NG_ENTRY_PAGE_INFO_H