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_COMPONENTS_V2_TABS_TAB_CONTENT_ITEM_ELEMENT_H
17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_V2_TABS_TAB_CONTENT_ITEM_ELEMENT_H
18 
19 #include "core/components_v2/tabs/tabs_component.h"
20 
21 namespace OHOS::Ace::V2 {
22 
23 class TabContentItemElement : public ColumnElement {
24     DECLARE_ACE_TYPE(TabContentItemElement, ColumnElement);
25 
26 public:
27     void Update() override;
28 
GetIcon()29     const std::string& GetIcon() const
30     {
31         return barIcon_;
32     }
33 
GetText()34     const std::string& GetText() const
35     {
36         return barText_;
37     }
38 
39     void PerformBuild() override;
40 
GetBarElementId()41     ElementIdType GetBarElementId() const
42     {
43         return tabBarItemElementId_;
44     }
45 
SetBarElementId(ElementIdType id)46     void SetBarElementId(ElementIdType id)
47     {
48         tabBarItemElementId_ = id;
49     }
50 
51 private:
52     std::string barIcon_;
53     std::string barText_;
54     ElementIdType tabBarItemElementId_ = ElementRegister::UndefinedElementId;
55 };
56 
57 } // namespace OHOS::Ace::V2
58 
59 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_V2_TABS_TAB_CONTENT_ITEM_ELEMENT_H
60