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_INDEXER_POPUP_LIST_COMPONENT_H
17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_V2_INDEXER_POPUP_LIST_COMPONENT_H
18 
19 #include <list>
20 
21 #include "base/geometry/axis.h"
22 #include "base/utils/noncopyable.h"
23 #include "core/components_v2/common/common_def.h"
24 #include "core/pipeline/base/component_group.h"
25 
26 namespace OHOS::Ace::V2 {
27 inline constexpr double POPUP_BOX_RADIUS_SIZE = 0.0;
28 inline constexpr double POPUP_BORDER_RADIUS_SIZE = 12.0;
29 
30 class ACE_EXPORT PopupListComponent : public ComponentGroup {
DECLARE_ACE_TYPE(V2::PopupListComponent,ComponentGroup)31     DECLARE_ACE_TYPE(V2::PopupListComponent, ComponentGroup)
32 
33 public:
34     PopupListComponent()
35     {
36         BuildBackground();
37     };
38     ~PopupListComponent() = default;
39 
40     RefPtr<RenderNode> CreateRenderNode() override;
41     RefPtr<Element> CreateElement() override;
42 
43     ACE_DEFINE_COMPONENT_PROP(Direction, Axis, Axis::VERTICAL);
44     ACE_DEFINE_COMPONENT_PROP(EdgeEffect, EdgeEffect, EdgeEffect::SPRING);
45 
SetPopupSelectedEvent(const EventMarker & event)46     void SetPopupSelectedEvent(const EventMarker& event)
47     {
48         popupSelectedEvent_ = event;
49     }
50 
GetPopupSelectedEvent()51     const EventMarker& GetPopupSelectedEvent() const
52     {
53         return popupSelectedEvent_;
54     }
55 
56 private:
57     void BuildBackground();
58 
59     EventMarker popupSelectedEvent_;
60 
61     ACE_DISALLOW_COPY_AND_MOVE(PopupListComponent);
62 };
63 } // namespace OHOS::Ace::V2
64 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_V2_INDEXER_POPUP_LIST_COMPONENT_H
65