1 /*
2  * Copyright (c) 2023 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_NG_PATTERNS_CALENDAR_CALENDAR_TYPE_DEFINE_H
17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PATTERNS_CALENDAR_CALENDAR_TYPE_DEFINE_H
18 
19 #include <cstdint>
20 #include <string>
21 
22 #include "base/geometry/dimension_offset.h"
23 #include "core/components/common/properties/text_style.h"
24 #include "core/components/picker/picker_data.h"
25 #include "core/components_ng/base/frame_node.h"
26 #include "core/components_ng/pattern/picker/picker_type_define.h"
27 
28 namespace OHOS::Ace::NG {
29 enum class CalendarEdgeAlign {
30     EDGE_ALIGN_START = 0,
31     EDGE_ALIGN_CENTER,
32     EDGE_ALIGN_END,
33 };
34 
35 enum class CalendarPickerSelectedType {
36     YEAR = 0,
37     MONTH,
38     DAY,
39     ADDBTN,
40     SUBBTN,
41     OTHER,
42 };
43 
44 struct CalendarSettingData {
45     PickerDate selectedDate = PickerDate::Current();
46     std::optional<Dimension> dayRadius;
47     WeakPtr<FrameNode> entryNode = nullptr;
48 };
49 
50 struct CalendarPickerOption {
51     CalendarSettingData data;
52     CalendarEdgeAlign alignType = CalendarEdgeAlign::EDGE_ALIGN_END;
53     DimensionOffset offset = DimensionOffset();
54     PickerTextStyle textStyle;
55 };
56 } // namespace OHOS::Ace::NG
57 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PATTERNS_CALENDAR_CALENDAR_TYPE_DEFINE_H
58