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_FRAMEWORKS_CORE_COMMON_ACE_PAGE_H 17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMMON_ACE_PAGE_H 18 19 #include <string> 20 21 #include "base/memory/ace_type.h" 22 #include "base/utils/noncopyable.h" 23 #include "core/components/page/page_component.h" 24 25 namespace OHOS::Ace { 26 27 class AcePage : public virtual AceType { 28 DECLARE_ACE_TYPE(AcePage, AceType); 29 30 public: AcePage(int32_t pageId)31 explicit AcePage(int32_t pageId) : pageId_(pageId) {} 32 ~AcePage() override = default; 33 34 virtual RefPtr<PageComponent> BuildPage(const std::string& content) = 0; 35 GetPageId()36 int32_t GetPageId() const 37 { 38 return pageId_; 39 } 40 SetSubStage(bool useSubStage)41 void SetSubStage(bool useSubStage) 42 { 43 useSubStage_ = useSubStage; 44 } 45 GetSubStageFlag()46 bool GetSubStageFlag() const 47 { 48 return useSubStage_; 49 } 50 51 private: 52 int32_t pageId_ = 0; 53 bool useSubStage_ = false; 54 55 ACE_DISALLOW_COPY_AND_MOVE(AcePage); 56 }; 57 58 } // namespace OHOS::Ace 59 60 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMMON_ACE_PAGE_H 61