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 Container; 28 29 class AcePage : public virtual AceType { 30 DECLARE_ACE_TYPE(AcePage, AceType); 31 32 public: AcePage(int32_t pageId)33 explicit AcePage(int32_t pageId) : pageId_(pageId) {} 34 ~AcePage() override = default; 35 36 virtual RefPtr<PageComponent> BuildPage(const std::string& content) = 0; 37 GetPageId()38 int32_t GetPageId() const 39 { 40 return pageId_; 41 } 42 SetSubStage(bool useSubStage)43 void SetSubStage(bool useSubStage) 44 { 45 useSubStage_ = useSubStage; 46 } 47 GetSubStageFlag()48 bool GetSubStageFlag() const 49 { 50 return useSubStage_; 51 } 52 53 private: 54 int32_t pageId_ = 0; 55 bool useSubStage_ = false; 56 57 ACE_DISALLOW_COPY_AND_MOVE(AcePage); 58 }; 59 60 } // namespace OHOS::Ace 61 62 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMMON_ACE_PAGE_H 63