• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-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_CALENDAR_CALENDAR_THEME_H
17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_CALENDAR_CALENDAR_THEME_H
18 
19 #include "base/geometry/dimension.h"
20 #include "core/components/common/properties/color.h"
21 #include "core/components/common/properties/decoration.h"
22 #include "core/components/theme/theme.h"
23 #include "core/components/theme/theme_constants.h"
24 #include "core/components/theme/theme_constants_defines.h"
25 
26 namespace OHOS::Ace {
27 namespace {
28 
29 constexpr Color DEFAULT_DAY_COLOR = Color(0xE1181819);
30 constexpr Color DEFAULT_NON_CURRENT_MONTH_DAY_COLOR = Color(0x4B181819);
31 constexpr Color DEFAULT_WEEKEND_DAY_COLOR = Color(0x7D181819);
32 constexpr Color DEFAULT_WEEKEND_LUNAR_COLOR = Color(0x7D181819);
33 constexpr Color DEFAULT_NON_CURRENT_MONTH_LUNAR_COLOR = Color(0x75181819);
34 constexpr Color DEFAULT_LUNAR_COLOR = Color(0x96181819);
35 constexpr Color DEFAULT_CALENDAR_WEEK_COLOR = Color(0xffa0a1a5);
36 constexpr Color DEFAULT_CALENDAR_DAY_COLOR = Color(0xffeaebed);
37 constexpr Color DEFAULT_CALENDAR_LUNAR_COLOR = Color(0xffa0a1a5);
38 constexpr Color DEFAULT_CALENDAR_WEEKEND_DAY_COLOR = Color(0xff808080);
39 constexpr Color DEFAULT_CALENDAR_WEEKEND_LUNAR_COLOR = Color(0xff808080);
40 constexpr Color DEFAULT_CALENDAR_TODAY_DAY_FOCUS_COLOR = Color(0xffffffff);
41 constexpr Color DEFAULT_CALENDAR_TODAY_LUNAR_FOCUS_COLOR = Color(0xffffffff);
42 constexpr Color DEFAULT_CALENDAR_TODAY_DAY_UNFOCUS_COLOR = Color(0xff0a59f7);
43 constexpr Color DEFAULT_CALENDAR_TODAY_LUNAR_UNFOCUS_COLOR = Color(0xff0a59f7);
44 constexpr Color DEFAULT_CALENDAR_WORK_MARK_COLOR = Color(0xffe84026);
45 constexpr Color DEFAULT_CALENDAR_OFF_MARK_COLOR = Color(0xff0a59f7);
46 constexpr Color DEFAULT_CALENDAR_NONCURRENT_MONTH_WORK_MARK_COLOR = Color(0x33e84026);
47 constexpr Color DEFAULT_CALENDAR_NONCURRENT_MONTH_OFF_MARK_COLOR = Color(0x330a59f7);
48 constexpr Color DEFAULT_CALENDAR_NONCURRENT_MONTH_DAY_COLOR = Color(0xff555e6b);
49 constexpr Color DEFAULT_CALENDAR_NONCURRENT_MONTH_LUNAR_COLOR = Color(0xff555e6b);
50 constexpr Color DEFAULT_CALENDAR_FOCUS_AREA_BACKGROUND_COLOR = Color(0xff5ea1ff);
51 constexpr Color DEFAULT_CALENDAR_BLUR_AREA_BACKGROUND_COLOR = Color(0xffffffff);
52 constexpr float DEFAULT_CALENDAR_DISABLED_OPACITY = 0.4f;
53 } // namespace
54 
55 struct CalendarThemeStructure {
56     std::string dayFontWeight = "500";
57     std::string lunarDayFontWeight = "500";
58     std::string workStateFontWeight = "500";
59     std::string monday;
60     std::string tuesday;
61     std::string wednesday;
62     std::string thursday;
63     std::string friday;
64     std::string saturday;
65     std::string sunday;
66     std::string nextYear;
67     std::string nextMonth;
68     std::string preYear;
69     std::string preMonth;
70     std::string today;
71     Color weekColor;
72     Color dayColor;
73     Color lunarColor;
74     Color weekendDayColor;
75     Color weekendLunarColor;
76     Color todayColor;
77     Color todayLunarColor;
78     Color nonCurrentMonthDayColor;
79     Color nonCurrentMonthLunarColor;
80     Color workDayMarkColor;
81     Color offDayMarkColor;
82     Color nonCurrentMonthWorkDayMarkColor;
83     Color nonCurrentMonthOffDayMarkColor;
84     Color focusedDayColor;
85     Color focusedLunarColor;
86     Color focusedAreaBackgroundColor;
87     Color blurAreaBackgroundColor;
88     Color titleTextColor;
89     Color touchColor;
90     Color markLunarColor;
91     Color clickEffectColor;
92     Color simpleWorkTextColor;
93     Color simpleOffTextColor;
94     Dimension weekFontSize;
95     Dimension dayFontSize;
96     Dimension lunarDayFontSize;
97     Dimension workDayMarkSize;
98     Dimension offDayMarkSize;
99     Dimension focusedAreaRadius;
100     Dimension topPadding;
101     Dimension workStateWidth;
102     Dimension workStateHorizontalMovingDistance;
103     Dimension workStateVerticalMovingDistance;
104     Dimension colSpace;
105     Dimension weekHeight;
106     Dimension dayHeight;
107     Dimension weekWidth;
108     Dimension dayWidth;
109     Dimension weekAndDayRowSpace;
110     Dimension dailyFiveRowSpace;
111     Dimension dailySixRowSpace;
112     Dimension gregorianCalendarHeight;
113     Dimension lunarHeight;
114     Dimension arrowHeight;
115     Dimension arrowWidth;
116     Dimension buttonWidth;
117     Dimension buttonHeight;
118     Dimension titleFontSize;
119     Dimension workStateOffset;
120     Dimension dayYAxisOffset;
121     Dimension lunarDayYAxisOffset;
122     Dimension underscoreXAxisOffset;
123     Dimension underscoreYAxisOffset;
124     Dimension scheduleMarkerXAxisOffset;
125     Dimension scheduleMarkerYAxisOffset;
126     Dimension underscoreWidth;
127     Dimension underscoreLength;
128     Dimension scheduleMarkerRadius;
129     Dimension touchCircleStrokeWidth;
130     Dimension boundaryRowOffset;
131     Dimension boundaryColOffset;
132 };
133 
134 class CalendarTheme : public virtual Theme {
135     DECLARE_ACE_TYPE(CalendarTheme, Theme);
136 
137 public:
138     ~CalendarTheme() override = default;
139     class Builder {
140     public:
141         Builder() = default;
142         ~Builder() = default;
143 
Build(const RefPtr<ThemeConstants> & themeConstants)144         RefPtr<CalendarTheme> Build(const RefPtr<ThemeConstants>& themeConstants) const
145         {
146             RefPtr<CalendarTheme> theme = AceType::MakeRefPtr<CalendarTheme>();
147             if (!themeConstants) {
148                 return theme;
149             }
150             theme = AceType::MakeRefPtr<CalendarTheme>();
151             ParseNewPattern(themeConstants, theme);
152             ParsePattern(themeConstants, theme);
153             return theme;
154         }
155     private:
ParseCardTheme(const RefPtr<ThemeConstants> & themeConstants,const RefPtr<CalendarTheme> & theme)156         void ParseCardTheme(const RefPtr<ThemeConstants>& themeConstants, const RefPtr<CalendarTheme>& theme) const
157         {
158             RefPtr<ThemeStyle> pattern = themeConstants->GetPatternByName(THEME_PATTERN_CALENDAR);
159             if (!pattern) {
160                 LOGW("find pattern of calendar fail");
161                 return;
162             }
163             // Card theme
164             theme->cardCalendarTheme_.focusedAreaBackgroundColor =
165                 pattern->GetAttr<Color>("card_area_bg_color_focused", Color::BLUE);
166             theme->cardCalendarTheme_.dayColor =
167                 pattern->GetAttr<Color>("card_day_color", DEFAULT_DAY_COLOR);
168             theme->cardCalendarTheme_.weekColor =
169                 pattern->GetAttr<Color>("card_week_color", Color::BLACK);
170             theme->cardCalendarTheme_.nonCurrentMonthDayColor =
171                 pattern->GetAttr<Color>("card_uncurrent_month_day_color", DEFAULT_NON_CURRENT_MONTH_DAY_COLOR);
172             theme->cardCalendarTheme_.weekendDayColor =
173                 pattern->GetAttr<Color>("card_weekend_color", DEFAULT_WEEKEND_DAY_COLOR);
174             theme->cardCalendarTheme_.weekendLunarColor =
175                 pattern->GetAttr<Color>("card_weekend_lunar_color", DEFAULT_WEEKEND_LUNAR_COLOR);
176             theme->cardCalendarTheme_.nonCurrentMonthLunarColor =
177                 pattern->GetAttr<Color>("card_uncurrent_month_lunar_color", DEFAULT_NON_CURRENT_MONTH_LUNAR_COLOR);
178             theme->cardCalendarTheme_.todayColor =
179                 pattern->GetAttr<Color>("card_today_color", Color::WHITE);
180             theme->cardCalendarTheme_.todayLunarColor =
181                 pattern->GetAttr<Color>("card_today_lunar_color", Color::WHITE);
182             theme->cardCalendarTheme_.lunarColor =
183                 pattern->GetAttr<Color>("card_lunar_color", DEFAULT_LUNAR_COLOR);
184             theme->cardCalendarTheme_.markLunarColor =
185                 pattern->GetAttr<Color>("card_mark_lunar_color", Color::BLUE);
186             theme->cardCalendarTheme_.titleTextColor =
187                 pattern->GetAttr<Color>("card_title_text_color", Color::BLACK);
188             theme->cardCalendarTheme_.clickEffectColor =
189                 pattern->GetAttr<Color>("card_switch_button_bg_color_clicked", Color::TRANSPARENT);
190         }
191 
ParseNormalTheme(const RefPtr<ThemeConstants> & themeConstants,const RefPtr<CalendarTheme> & theme)192         void ParseNormalTheme(const RefPtr<ThemeConstants>& themeConstants, const RefPtr<CalendarTheme>& theme) const
193         {
194             RefPtr<ThemeStyle> pattern = themeConstants->GetPatternByName(THEME_PATTERN_CALENDAR);
195             if (!pattern) {
196                 LOGW("find pattern of calendar fail");
197                 return;
198             }
199             // Normal theme
200             theme->calendarTheme_.dayColor = pattern->GetAttr<Color>(CALENDAR_DAY_COLOR, DEFAULT_CALENDAR_DAY_COLOR);
201             theme->calendarTheme_.weekColor = pattern->GetAttr<Color>(CALENDAR_WEEK_COLOR, DEFAULT_CALENDAR_WEEK_COLOR);
202             theme->calendarTheme_.lunarColor =
203                 pattern->GetAttr<Color>(CALENDAR_LUNAR_COLOR, DEFAULT_CALENDAR_LUNAR_COLOR);
204             theme->calendarTheme_.weekendDayColor =
205                 pattern->GetAttr<Color>(CALENDAR_WEEKEND_DAY_COLOR, DEFAULT_CALENDAR_WEEKEND_DAY_COLOR);
206             theme->calendarTheme_.weekendLunarColor =
207                 pattern->GetAttr<Color>(CALENDAR_WEEKEND_LUNAR_COLOR, DEFAULT_CALENDAR_WEEKEND_LUNAR_COLOR);
208             theme->calendarTheme_.focusedDayColor =
209                 pattern->GetAttr<Color>(CALENDAR_TODAY_DAY_FOCUS_COLOR, DEFAULT_CALENDAR_TODAY_DAY_FOCUS_COLOR);
210             theme->calendarTheme_.focusedLunarColor =
211                 pattern->GetAttr<Color>(CALENDAR_TODAY_LUNAR_FOCUS_COLOR, DEFAULT_CALENDAR_TODAY_LUNAR_FOCUS_COLOR);
212             theme->calendarTheme_.todayColor =
213                 pattern->GetAttr<Color>(CALENDAR_TODAY_DAY_UNFOCUS_COLOR, DEFAULT_CALENDAR_TODAY_DAY_UNFOCUS_COLOR);
214             theme->calendarTheme_.todayLunarColor =
215                 pattern->GetAttr<Color>(CALENDAR_TODAY_LUNAR_UNFOCUS_COLOR, DEFAULT_CALENDAR_TODAY_LUNAR_UNFOCUS_COLOR);
216             theme->calendarTheme_.workDayMarkColor =
217                 pattern->GetAttr<Color>(CALENDAR_WORK_MARK_COLOR, DEFAULT_CALENDAR_WORK_MARK_COLOR);
218             theme->calendarTheme_.offDayMarkColor =
219                 pattern->GetAttr<Color>(CALENDAR_OFF_MARK_COLOR, DEFAULT_CALENDAR_OFF_MARK_COLOR);
220             theme->calendarTheme_.nonCurrentMonthWorkDayMarkColor = pattern->GetAttr<Color>(
221                 CALENDAR_NONCURRENT_MONTH_WORK_MARK_COLOR, DEFAULT_CALENDAR_NONCURRENT_MONTH_WORK_MARK_COLOR);
222             theme->calendarTheme_.nonCurrentMonthOffDayMarkColor = pattern->GetAttr<Color>(
223                 CALENDAR_NONCURRENT_MONTH_OFF_MARK_COLOR, DEFAULT_CALENDAR_NONCURRENT_MONTH_OFF_MARK_COLOR);
224             theme->calendarTheme_.nonCurrentMonthDayColor = pattern->GetAttr<Color>(
225                 CALENDAR_NONCURRENT_MONTH_DAY_COLOR, DEFAULT_CALENDAR_NONCURRENT_MONTH_DAY_COLOR);
226             theme->calendarTheme_.nonCurrentMonthLunarColor = pattern->GetAttr<Color>(
227                 CALENDAR_NONCURRENT_MONTH_LUNAR_COLOR, DEFAULT_CALENDAR_NONCURRENT_MONTH_LUNAR_COLOR);
228             theme->calendarTheme_.focusedAreaBackgroundColor = pattern->GetAttr<Color>(
229                 CALENDAR_FOCUS_AREA_BACKGROUND_COLOR, DEFAULT_CALENDAR_FOCUS_AREA_BACKGROUND_COLOR);
230             theme->calendarTheme_.blurAreaBackgroundColor = pattern->GetAttr<Color>(
231                 CALENDAR_BLUR_AREA_BACKGROUND_COLOR, DEFAULT_CALENDAR_BLUR_AREA_BACKGROUND_COLOR);
232             theme->calendarTheme_.monday = pattern->GetAttr<std::string>("calendar_picker_mon", "");
233             theme->calendarTheme_.tuesday = pattern->GetAttr<std::string>("calendar_picker_tue", "");
234             theme->calendarTheme_.wednesday = pattern->GetAttr<std::string>("calendar_picker_wed", "");
235             theme->calendarTheme_.thursday = pattern->GetAttr<std::string>("calendar_picker_thu", "");
236             theme->calendarTheme_.friday = pattern->GetAttr<std::string>("calendar_picker_fri", "");
237             theme->calendarTheme_.saturday = pattern->GetAttr<std::string>("calendar_picker_sat", "");
238             theme->calendarTheme_.sunday = pattern->GetAttr<std::string>("calendar_picker_sun", "");
239             theme->calendarTheme_.nextYear = pattern->GetAttr<std::string>("general_next_year", "");
240             theme->calendarTheme_.nextMonth = pattern->GetAttr<std::string>("general_next_month", "");
241             theme->calendarTheme_.preYear = pattern->GetAttr<std::string>("general_pre_year", "");
242             theme->calendarTheme_.preMonth = pattern->GetAttr<std::string>("general_pre_month", "");
243             theme->calendarTheme_.today = pattern->GetAttr<std::string>("general_today", "");
244         }
245 
ParseCalenderPickerFirstPart(const RefPtr<ThemeConstants> & themeConstants,const RefPtr<CalendarTheme> & theme)246         void ParseCalenderPickerFirstPart(const RefPtr<ThemeConstants>& themeConstants,
247             const RefPtr<CalendarTheme>& theme) const
248         {
249             RefPtr<ThemeStyle> pattern = themeConstants->GetPatternByName(THEME_PATTERN_CALENDAR);
250             if (!pattern) {
251                 LOGW("find pattern of calendar fail");
252                 return;
253             }
254             theme->entryBorderColor_ = pattern->GetAttr<Color>("calendar_picker_entry_border_color", Color());
255             theme->entryArrowColor_ = pattern->GetAttr<Color>("calendar_picker_entry_arrow_color", Color());
256             theme->selectBackgroundColor_ = pattern->GetAttr<Color>(
257                 "calendar_picker_select_background_color", Color());
258             theme->dialogBackgroundColor_ = pattern->GetAttr<Color>(
259                 "calendar_picker_dialog_background_color", Color());
260             theme->calendarTitleFontColor_ = pattern->GetAttr<Color>("calendar_picker_title_font_color", Color());
261             Color currentMonthColor = pattern->GetAttr<Color>("calendar_picker_title_font_color", Color());
262             theme->textCurrentMonthColor_ = currentMonthColor.BlendOpacity(
263                 pattern->GetAttr<double>("calendar_picker_attribute_alpha_content_primary", 0.0));
264             theme->textNonCurrentMonthColor_ = currentMonthColor.BlendOpacity(
265                 pattern->GetAttr<double>("calendar_picker_attribute_alpha_content_tertiary", 0.0));
266             Color textSelectedDayColor = pattern->GetAttr<Color>("calendar_picker_text_selected_day_color", Color());
267             theme->textSelectedDayColor_ = textSelectedDayColor;
268             theme->textNonCurrentMonthTodayColor_ = textSelectedDayColor.BlendOpacity(
269                 pattern->GetAttr<double>("interactive_disable", DEFAULT_CALENDAR_DISABLED_OPACITY));
270             theme->textCurrentDayColor_ = pattern->GetAttr<Color>("calendar_picker_text_current_day_color", Color());
271             theme->backgroundKeyFocusedColor_ = pattern->GetAttr<Color>(
272                 "calendar_picker_background_key_focused_color", Color());
273             Color backgroundSelectedTodayColor = pattern->GetAttr<Color>(
274                 "calendar_picker_background_selected_focused_color", Color());
275             theme->dialogButtonBackgroundColor_ = pattern->GetAttr<Color>(
276                 "calendar_picker_dialog_button_bg_color", Color());
277             theme->backgroundSelectedTodayColor_ = backgroundSelectedTodayColor;
278             theme->backgroundDisabledMarkTodayColor_ = backgroundSelectedTodayColor.BlendOpacity(
279                 pattern->GetAttr<double>("interactive_disable", DEFAULT_CALENDAR_DISABLED_OPACITY));
280             theme->backgroundSelectedNotTodayColor_ = backgroundSelectedTodayColor.BlendOpacity(
281                 pattern->GetAttr<double>("calendar_picker_attribute_alpha_highlight_bg", 0.0));
282             theme->backgroundHoverColor_ = pattern->GetAttr<Color>("calendar_picker_background_hover_color", Color());
283             theme->backgroundPressColor_ = pattern->GetAttr<Color>("calendar_picker_background_press_color", Color());
284             theme->entryFontColor_ = pattern->GetAttr<Color>("calendar_picker_entry_font_color", Color());
285             theme->dialogDividerColor_ = pattern->GetAttr<Color>("calendar_picker_dialog_divider_color", Color());
286             theme->entryHeight_ = pattern->GetAttr<Dimension>("calendar_picker_entry_height", 0.0_vp);
287             theme->entryBorderWidth_ = pattern->GetAttr<Dimension>("calendar_picker_entry_border_width", 0.0_vp);
288             theme->entryBorderRadius_ = pattern->GetAttr<Dimension>("calendar_picker_entry_border_radius", 0.0_vp);
289             theme->entryButtonWidth_ = pattern->GetAttr<Dimension>("calendar_picker_entry_button_width", 0.0_vp);
290             theme->entryArrowHeight_ = pattern->GetAttr<Dimension>("calendar_picker_entry_arrow_height", 0.0_vp);
291             theme->entryArrowwidth_ = pattern->GetAttr<Dimension>("calendar_picker_entry_arrow_width", 0.0_vp);
292         }
ParseCalenderPickerSecondPart(const RefPtr<ThemeConstants> & themeConstants,const RefPtr<CalendarTheme> & theme)293         void ParseCalenderPickerSecondPart(const RefPtr<ThemeConstants>& themeConstants,
294             const RefPtr<CalendarTheme>& theme) const
295         {
296             RefPtr<ThemeStyle> pattern = themeConstants->GetPatternByName(THEME_PATTERN_CALENDAR);
297             if (!pattern) {
298                 LOGW("find pattern of calendar fail");
299                 return;
300             }
301             theme->entryDateLeftRightMargin_ = pattern->GetAttr<Dimension>(
302                 "calendar_picker_entry_date_left_right_margin", 0.0_vp);
303             theme->entryDateTopBottomMargin_ = pattern->GetAttr<Dimension>(
304                 "calendar_picker_entry_date_top_bottom_margin", 0.0_vp);
305             theme->dialogMargin_ = pattern->GetAttr<Dimension>("calendar_picker_dialog_margin", 0.0_vp);
306             theme->calendarPickerDayWidthOrHeight_ = pattern->GetAttr<Dimension>(
307                 "calendar_picker_day_width_height", 0.0_vp);
308             theme->calendarPickerDayLargeWidthOrHeight_ =
309                 pattern->GetAttr<Dimension>("calendar_picker_day_large_width_height", 40.0_vp);
310             theme->calendarDayFontSize_ = pattern->GetAttr<Dimension>("calendar_picker_day_font_size", 0.0_vp);
311             theme->calendarSmallWeekFontSize_ =
312                 pattern->GetAttr<Dimension>("calendar_picker_small_day_font_size", 14.0_vp);
313             theme->distanceBetweenContainterAndDate_ = pattern->GetAttr<Dimension>(
314                 "calendar_picker_distance_between_container_and_date", 0.0_vp);
315             theme->distanceBetweenTitleAndDate_ = pattern->GetAttr<Dimension>(
316                 "calendar_picker_distance_between_title_and_date", 0.0_vp);
317             theme->dalendarContainerHeight_ = pattern->GetAttr<Dimension>("calendar_picker_container_height", 0.0_vp);
318             theme->calendarLargeContainerHeight_ =
319                 pattern->GetAttr<Dimension>("calendar_picker_large_container_height", 316.0_vp);
320             theme->calendarLargerContainerHeight_ =
321                 pattern->GetAttr<Dimension>("calendar_picker_larger_container_height", 337.0_vp);
322             theme->calendarTitleFontSize_ = pattern->GetAttr<Dimension>("calendar_picker_title_font_size", 0.0_vp);
323             theme->calendarTitleRowHeight_ = pattern->GetAttr<Dimension>("calendar_picker_title_row_height", 0.0_vp);
324             theme->calendarTitleLargeRowHeight_ =
325                 pattern->GetAttr<Dimension>("calendar_picker_title_large_row_height", 94.0_vp);
326             theme->calendarTitleLargerRowHeight_ =
327                 pattern->GetAttr<Dimension>("calendar_picker_title_larger_row_height", 106.0_vp);
328         }
329 
ParseCalenderPickerThirdPart(const RefPtr<ThemeConstants> & themeConstants,const RefPtr<CalendarTheme> & theme)330         void ParseCalenderPickerThirdPart(const RefPtr<ThemeConstants>& themeConstants,
331             const RefPtr<CalendarTheme>& theme) const
332         {
333             RefPtr<ThemeStyle> pattern = themeConstants->GetPatternByName(THEME_PATTERN_CALENDAR);
334             if (!pattern) {
335                 LOGW("find pattern of calendar fail");
336                 return;
337             }
338             theme->calendarTitleRowTopPadding_ = pattern->GetAttr<Dimension>(
339                 "calendar_picker_title_row_top_padding", 0.0_vp);
340             theme->calendarTitleRowLeftRightPadding_ = pattern->GetAttr<Dimension>(
341                 "calendar_picker_title_row_left_right_padding", 0.0_vp);
342             theme->calendarTitleTextPadding_ = pattern->GetAttr<Dimension>(
343                 "calendar_picker_title_text_padding", 0.0_vp);
344             theme->calendarTitleImagePadding_ = pattern->GetAttr<Dimension>(
345                 "calendar_picker_title_image_padding", 0.0_vp);
346             theme->calendarImageWidthHeight_ = pattern->GetAttr<Dimension>(
347                 "calendar_picker_image_width_height", 0.0_vp);
348             theme->calendarActionRowTopPadding_ = pattern->GetAttr<Dimension>(
349                 "calendar_picker_action_row_top_padding", 0.0_vp);
350             theme->calendarActionRowBottomLeftRightPadding_ = pattern->GetAttr<Dimension>(
351                 "calendar_picker_action_row_bottom_left_right_padding", 0.0_vp);
352             theme->calendarActionRowHeight_ = pattern->GetAttr<Dimension>("calendar_picker_action_row_height", 0.0_vp);
353             theme->calendarActionLargeRowHeight_ =
354                 pattern->GetAttr<Dimension>("calendar_picker_action_large_row_height", 48.0_vp);
355             theme->calendarDayRadius_ = pattern->GetAttr<Dimension>("calendar_picker_day_radius", 0.0_vp);
356             theme->calendarDayKeyFocusedWidth_ = pattern->GetAttr<Dimension>("calendar_day_key_focused_width", 0.0_vp);
357             theme->calendarLargeDayKeyFocusedWidth_ =
358                 pattern->GetAttr<Dimension>("calendar_large_day_key_focused_width", 44.0_vp);
359             theme->calendarDayKeyFocusedPenWidth_ = pattern->GetAttr<Dimension>(
360                 "calendar_day_key_focused_pen_width", 0.0_vp);
361             theme->entryFontSize_ = pattern->GetAttr<Dimension>("calendar_picker_entry_font_size", 0.0_fp);
362             theme->dialogBorderRadius_ = pattern->GetAttr<Dimension>("calendar_picker_dialog_border_radius", 0.0_vp);
363             theme->calendarPickerDialogBlurStyle_ = pattern->GetAttr<int>(
364                 "calendar_picker_dialog_background_blur_style", static_cast<int>(BlurStyle::COMPONENT_ULTRA_THICK));
365         }
366 
ParsePattern(const RefPtr<ThemeConstants> & themeConstants,const RefPtr<CalendarTheme> & theme)367         void ParsePattern(const RefPtr<ThemeConstants>& themeConstants, const RefPtr<CalendarTheme>& theme) const
368         {
369             RefPtr<ThemeStyle> pattern = themeConstants->GetPatternByName(THEME_PATTERN_CALENDAR);
370             if (!pattern) {
371                 LOGW("find pattern of calendar fail");
372                 return;
373             }
374             // Card theme
375             ParseCardTheme(themeConstants, theme);
376             // Normal theme
377             ParseNormalTheme(themeConstants, theme);
378             // calendar picker
379             ParseCalenderPickerFirstPart(themeConstants, theme);
380             ParseCalenderPickerSecondPart(themeConstants, theme);
381             ParseCalenderPickerThirdPart(themeConstants, theme);
382         }
383 
ParseCalendarThemePattern(const RefPtr<ThemeConstants> & themeConstants,const RefPtr<CalendarTheme> & theme)384         void ParseCalendarThemePattern(const RefPtr<ThemeConstants>& themeConstants,
385             const RefPtr<CalendarTheme>& theme) const
386         {
387             RefPtr<ThemeStyle> pattern = themeConstants->GetPatternByName(THEME_PATTERN_CALENDAR);
388             CHECK_NULL_VOID(pattern);
389             theme->calendarTheme_.weekFontSize = pattern->GetAttr<Dimension>("calendar_week_font_size", 14.0_fp);
390             theme->calendarTheme_.dayFontSize = pattern->GetAttr<Dimension>("calendar_day_font_size", 18.0_fp);
391             theme->calendarTheme_.lunarDayFontSize = pattern->GetAttr<Dimension>("calendar_lunar_font_size", 12.0_fp);
392             theme->calendarTheme_.workDayMarkSize =
393                 pattern->GetAttr<Dimension>("calendar_work_day_mark_font_size", 10.0_fp);
394             theme->calendarTheme_.offDayMarkSize =
395                 pattern->GetAttr<Dimension>("calendar_off_day_mark_font_size", 10.0_fp);
396             theme->calendarTheme_.focusedAreaRadius =
397                 pattern->GetAttr<Dimension>("calendar_focused_area_radius", 24.0_vp);
398             theme->calendarTheme_.topPadding = pattern->GetAttr<Dimension>("top_padding", 16.0_vp);
399             theme->calendarTheme_.workStateWidth = pattern->GetAttr<Dimension>("work_state_width", 16.0_vp);
400             theme->calendarTheme_.workStateHorizontalMovingDistance =
401                 pattern->GetAttr<Dimension>("work_state_horizontal_moving_distance", 2.0_vp);
402             theme->calendarTheme_.workStateVerticalMovingDistance =
403                 pattern->GetAttr<Dimension>("work_state_vertical_moving_distance", 16.0_vp);
404             theme->calendarTheme_.colSpace = pattern->GetAttr<Dimension>("column_space", 39.0_vp);
405             theme->calendarTheme_.weekHeight = pattern->GetAttr<Dimension>("week_height", 19.0_vp);
406             theme->calendarTheme_.dayHeight = pattern->GetAttr<Dimension>("day_height", 41.0_vp);
407             theme->calendarTheme_.weekWidth = pattern->GetAttr<Dimension>("week_width", 48.0_vp);
408             theme->calendarTheme_.dayWidth = pattern->GetAttr<Dimension>("day_width", 48.0_vp);
409             theme->calendarTheme_.weekAndDayRowSpace = pattern->GetAttr<Dimension>("week_and_day_space", 12.0_vp);
410             theme->calendarTheme_.dailyFiveRowSpace = pattern->GetAttr<Dimension>("five_row_space", 20.0_vp);
411             theme->calendarTheme_.dailySixRowSpace = pattern->GetAttr<Dimension>("six_row_space", 10.0_vp);
412             theme->calendarTheme_.gregorianCalendarHeight = pattern->GetAttr<Dimension>("gregorian_height", 25.0_vp);
413             theme->calendarTheme_.dayFontWeight = pattern->GetAttr<std::string>("day_font_weight", "500");
414             theme->calendarTheme_.lunarDayFontWeight = pattern->GetAttr<std::string>("lunar_day_font_weight", "500");
415             theme->calendarTheme_.workStateFontWeight = pattern->GetAttr<std::string>("work_state_font_weight", "400");
416             theme->calendarTheme_.workStateOffset =
417                 pattern->GetAttr<Dimension>("work_state_center_adjustment", 0.0_vp);
418             theme->calendarTheme_.dayYAxisOffset = pattern->GetAttr<Dimension>("day_yaxis_offset", 4.0_vp);
419             theme->calendarTheme_.lunarDayYAxisOffset = pattern->GetAttr<Dimension>("lunar_day_yaxis_offset", 23.0_vp);
420             theme->calendarTheme_.underscoreXAxisOffset =
421                 pattern->GetAttr<Dimension>("underscore_xaxis_offset", 12.0_vp);
422             theme->calendarTheme_.underscoreYAxisOffset =
423                 pattern->GetAttr<Dimension>("underscore_yaxis_offset", 36.0_vp);
424             theme->calendarTheme_.scheduleMarkerXAxisOffset =
425                 pattern->GetAttr<Dimension>("schedule_marker_xaxis_offset", 22.0_vp);
426             theme->calendarTheme_.scheduleMarkerYAxisOffset =
427                 pattern->GetAttr<Dimension>("schedule_marker_yaxis_offset", 40.0_vp);
428             theme->calendarTheme_.touchCircleStrokeWidth =
429                 pattern->GetAttr<Dimension>("touch_circle_stroke_width", 1.0_vp);
430             theme->calendarTheme_.lunarHeight = pattern->GetAttr<Dimension>("lunar_height", 14.0_vp);
431             theme->calendarTheme_.underscoreWidth = pattern->GetAttr<Dimension>("underscore_width", 1.0_vp);
432             theme->calendarTheme_.underscoreLength = pattern->GetAttr<Dimension>("underscore_length", 20.0_vp);
433             theme->calendarTheme_.scheduleMarkerRadius =
434                 pattern->GetAttr<Dimension>("schedule_marker_radius", 2.0_vp);
435         }
436 
ParseCardCalendarThemePattern(const RefPtr<ThemeConstants> & themeConstants,const RefPtr<CalendarTheme> & theme)437         void ParseCardCalendarThemePattern(const RefPtr<ThemeConstants>& themeConstants,
438             const RefPtr<CalendarTheme>& theme) const
439         {
440             RefPtr<ThemeStyle> pattern = themeConstants->GetPatternByName(THEME_PATTERN_CALENDAR);
441             CHECK_NULL_VOID(pattern);
442             theme->cardCalendarTheme_.arrowHeight = pattern->GetAttr<Dimension>("arrow_height", 16.0_vp);
443             theme->cardCalendarTheme_.arrowWidth = pattern->GetAttr<Dimension>("arrow_width", 16.0_vp);
444             theme->cardCalendarTheme_.buttonHeight =
445                 pattern->GetAttr<Dimension>("card_calendar_button_height", 32.0_vp);
446             theme->cardCalendarTheme_.buttonWidth =
447                 pattern->GetAttr<Dimension>("card_calendar_button_width", 32.0_vp);
448             theme->cardCalendarTheme_.titleFontSize =
449                 pattern->GetAttr<Dimension>("card_calendar_title_font_size", 16.0_vp);
450             theme->cardCalendarTheme_.focusedDayColor =
451                 pattern->GetAttr<Color>("today_day_focus_color", Color(0xFFFFFFFF));
452             theme->cardCalendarTheme_.touchColor = pattern->GetAttr<Color>("calendar_touch_color", Color(0x320A59F7));
453             theme->cardCalendarTheme_.topPadding = pattern->GetAttr<Dimension>("card_calendar_top_padding", 0.0_vp);
454             theme->cardCalendarTheme_.weekHeight = pattern->GetAttr<Dimension>("card_calendar_week_height", 14.0_vp);
455             theme->cardCalendarTheme_.dayHeight = pattern->GetAttr<Dimension>("card_calendar_day_height", 44.0_vp);
456             theme->cardCalendarTheme_.weekWidth = pattern->GetAttr<Dimension>("card_calendar_week_width", 44.0_vp);
457             theme->cardCalendarTheme_.dayWidth = pattern->GetAttr<Dimension>("card_calendar_day_width", 44.0_vp);
458             theme->cardCalendarTheme_.focusedAreaRadius =
459                 pattern->GetAttr<Dimension>("card_calendar_focus_area_radius", 22.0_vp);
460             theme->cardCalendarTheme_.weekFontSize =
461                 pattern->GetAttr<Dimension>("card_calendar_week_font_size", 10.0_fp);
462             theme->cardCalendarTheme_.dayFontSize =
463                 pattern->GetAttr<Dimension>("card_calendar_day_font_size", 16.0_vp);
464             theme->cardCalendarTheme_.gregorianCalendarHeight =
465                 pattern->GetAttr<Dimension>("card_calendar_gregorian_height", 24.0_vp);
466             theme->cardCalendarTheme_.lunarDayFontSize =
467                 pattern->GetAttr<Dimension>("card_calendar_lunar_font_size", 10.0_vp);
468             theme->cardCalendarTheme_.workDayMarkColor = pattern->GetAttr<Color>("work_mark_color", Color(0xffe83f26));
469             theme->cardCalendarTheme_.weekAndDayRowSpace =
470                 pattern->GetAttr<Dimension>("card_calendar_week_day_row_space", 4.0_vp);
471             theme->cardCalendarTheme_.dailyFiveRowSpace =
472                 pattern->GetAttr<Dimension>("card_calendar_daily_five_row_space", 10.0_vp);
473             theme->cardCalendarTheme_.dayYAxisOffset = pattern->GetAttr<Dimension>("day_yaxis_offset", 4.0_vp);
474             theme->cardCalendarTheme_.lunarDayYAxisOffset =
475                 pattern->GetAttr<Dimension>("lunar_day_yaxis_offset", 23.0_vp);
476             theme->cardCalendarTheme_.underscoreXAxisOffset =
477                 pattern->GetAttr<Dimension>("underscore_xaxis_offset", 12.0_vp);
478             theme->cardCalendarTheme_.underscoreYAxisOffset =
479                 pattern->GetAttr<Dimension>("underscore_yaxis_offset", 36.0_vp);
480             theme->cardCalendarTheme_.scheduleMarkerXAxisOffset =
481                 pattern->GetAttr<Dimension>("schedule_marker_xaxis_offset", 22.0_vp);
482             theme->cardCalendarTheme_.scheduleMarkerYAxisOffset =
483                 pattern->GetAttr<Dimension>("schedule_marker_yaxis_offset", 40.0_vp);
484         }
485 
ParseNewPattern(const RefPtr<ThemeConstants> & themeConstants,const RefPtr<CalendarTheme> & theme)486         void ParseNewPattern(const RefPtr<ThemeConstants>& themeConstants, const RefPtr<CalendarTheme>& theme) const
487         {
488             RefPtr<ThemeStyle> pattern = themeConstants->GetPatternByName(THEME_PATTERN_CALENDAR);
489             if (!pattern) {
490                 LOGW("find pattern of calendar fail");
491                 return;
492             }
493             ParseCalendarThemePattern(themeConstants, theme);
494             ParseCardCalendarThemePattern(themeConstants, theme);
495             theme->cardCalendarTheme_.lunarHeight = pattern->GetAttr<Dimension>("lunar_height", 14.0_vp);
496             theme->cardCalendarTheme_.underscoreWidth = pattern->GetAttr<Dimension>("underscore_width", 1.0_vp);
497             theme->cardCalendarTheme_.underscoreLength = pattern->GetAttr<Dimension>("underscore_length", 20.0_vp);
498             theme->cardCalendarTheme_.scheduleMarkerRadius =
499                 pattern->GetAttr<Dimension>("schedule_marker_radius", 2.0_vp);
500             theme->cardCalendarTheme_.boundaryColOffset =
501                 pattern->GetAttr<Dimension>("boundary_col_offset", 50.0_vp);
502             std::string isButtonTransparent =
503                 pattern->GetAttr<std::string>("calendar_picker_dialog_button_transparent", "true");
504             theme->isButtonTransparent_ = (isButtonTransparent == "true");
505             std::string isDividerTransparent =
506                 pattern->GetAttr<std::string>("calendar_picker_dialog_divider_transparent", "false");
507             theme->isDividerTransparent_ = (isDividerTransparent == "true");
508             theme->calendarPickerLargeScale_ = pattern->GetAttr<double>("calendar_picker_large_scale", 1.75);
509             theme->calendarPickerLargerScale_ = pattern->GetAttr<double>("calendar_picker_larger_scale", 2.0);
510         }
511     };
512 
GetCalendarTheme()513     CalendarThemeStructure& GetCalendarTheme()
514     {
515         return calendarTheme_;
516     }
517 
GetCardCalendarTheme()518     CalendarThemeStructure& GetCardCalendarTheme()
519     {
520         return cardCalendarTheme_;
521     }
522 
GetEntryHeight()523     const Dimension& GetEntryHeight() const
524     {
525         return entryHeight_;
526     }
527 
GetEntryBorderWidth()528     const Dimension& GetEntryBorderWidth() const
529     {
530         return entryBorderWidth_;
531     }
532 
GetEntryBorderColor()533     const Color& GetEntryBorderColor() const
534     {
535         return entryBorderColor_;
536     }
537 
GetEntryBorderRadius()538     const Dimension& GetEntryBorderRadius() const
539     {
540         return entryBorderRadius_;
541     }
542 
GetEntryButtonWidth()543     const Dimension& GetEntryButtonWidth() const
544     {
545         return entryButtonWidth_;
546     }
547 
GetEntryDateTopBottomMargin()548     const Dimension& GetEntryDateTopBottomMargin() const
549     {
550         return entryDateTopBottomMargin_;
551     }
552 
GetEntryDateLeftRightMargin()553     const Dimension& GetEntryDateLeftRightMargin() const
554     {
555         return entryDateLeftRightMargin_;
556     }
557 
GetEntryArrowWidth()558     const Dimension& GetEntryArrowWidth() const
559     {
560         return entryArrowwidth_;
561     }
562 
GetEntryArrowHeight()563     const Dimension& GetEntryArrowHeight() const
564     {
565         return entryArrowHeight_;
566     }
567 
GetEntryArrowColor()568     const Color& GetEntryArrowColor() const
569     {
570         return entryArrowColor_;
571     }
572 
GetDialogMargin()573     const Dimension& GetDialogMargin() const
574     {
575         return dialogMargin_;
576     }
577 
GetSelectBackgroundColor()578     const Color& GetSelectBackgroundColor() const
579     {
580         return selectBackgroundColor_;
581     }
582 
GetCalendarPickerDayWidthOrHeight()583     const Dimension& GetCalendarPickerDayWidthOrHeight() const
584     {
585         return calendarPickerDayWidthOrHeight_;
586     }
587 
GetCalendarPickerDayLargeWidthOrHeight()588     const Dimension& GetCalendarPickerDayLargeWidthOrHeight() const
589     {
590         return calendarPickerDayLargeWidthOrHeight_;
591     }
592 
GetCalendarDayFontSize()593     const Dimension& GetCalendarDayFontSize() const
594     {
595         return calendarDayFontSize_;
596     }
597 
GetCalendarSmallDayFontSize()598     const Dimension& GetCalendarSmallDayFontSize() const
599     {
600         return calendarSmallWeekFontSize_;
601     }
602 
GetDistanceBetweenContainterAndDate()603     const Dimension& GetDistanceBetweenContainterAndDate() const
604     {
605         return distanceBetweenContainterAndDate_;
606     }
607 
GetDistanceBetweenTitleAndDate()608     const Dimension& GetDistanceBetweenTitleAndDate() const
609     {
610         return distanceBetweenTitleAndDate_;
611     }
612 
GetCalendarContainerHeight()613     const Dimension& GetCalendarContainerHeight() const
614     {
615         return dalendarContainerHeight_;
616     }
617 
GetCalendarLargeContainerHeight()618     const Dimension& GetCalendarLargeContainerHeight() const
619     {
620         return calendarLargeContainerHeight_;
621     }
622 
GetCalendarLargerContainerHeight()623     const Dimension& GetCalendarLargerContainerHeight() const
624     {
625         return calendarLargerContainerHeight_;
626     }
627 
GetCalendarTitleFontSize()628     const Dimension& GetCalendarTitleFontSize() const
629     {
630         return calendarTitleFontSize_;
631     }
632 
GetCalendarTitleRowHeight()633     const Dimension& GetCalendarTitleRowHeight() const
634     {
635         return calendarTitleRowHeight_;
636     }
637 
GetCalendarTitleLargeRowHeight()638     const Dimension& GetCalendarTitleLargeRowHeight() const
639     {
640         return calendarTitleLargeRowHeight_;
641     }
642 
GetCalendarTitleLargerRowHeight()643     const Dimension& GetCalendarTitleLargerRowHeight() const
644     {
645         return calendarTitleLargerRowHeight_;
646     }
647 
GetCalendarTitleRowTopPadding()648     const Dimension& GetCalendarTitleRowTopPadding() const
649     {
650         return calendarTitleRowTopPadding_;
651     }
652 
GetCalendarTitleRowLeftRightPadding()653     const Dimension& GetCalendarTitleRowLeftRightPadding() const
654     {
655         return calendarTitleRowLeftRightPadding_;
656     }
657 
GetCalendarTitleTextPadding()658     const Dimension& GetCalendarTitleTextPadding() const
659     {
660         return calendarTitleTextPadding_;
661     }
662 
GetCalendarTitleImagePadding()663     const Dimension& GetCalendarTitleImagePadding() const
664     {
665         return calendarTitleImagePadding_;
666     }
667 
GetCalendarImageWidthHeight()668     const Dimension& GetCalendarImageWidthHeight() const
669     {
670         return calendarImageWidthHeight_;
671     }
672 
GetCalendarActionRowTopPadding()673     const Dimension& GetCalendarActionRowTopPadding() const
674     {
675         return calendarActionRowTopPadding_;
676     }
677 
GetCalendarActionRowBottomLeftRightPadding()678     const Dimension& GetCalendarActionRowBottomLeftRightPadding() const
679     {
680         return calendarActionRowBottomLeftRightPadding_;
681     }
682 
GetCalendarActionRowHeight()683     const Dimension& GetCalendarActionRowHeight() const
684     {
685         return calendarActionRowHeight_;
686     }
687 
GetCalendarActionLargeRowHeight()688     const Dimension& GetCalendarActionLargeRowHeight() const
689     {
690         return calendarActionLargeRowHeight_;
691     }
692 
GetCalendarDayRadius()693     const Dimension& GetCalendarDayRadius() const
694     {
695         return calendarDayRadius_;
696     }
697 
GetCalendarDayKeyFocusedWidth()698     const Dimension& GetCalendarDayKeyFocusedWidth() const
699     {
700         return calendarDayKeyFocusedWidth_;
701     }
702 
GetCalendarLargeDayKeyFocusedWidth()703     const Dimension& GetCalendarLargeDayKeyFocusedWidth() const
704     {
705         return calendarLargeDayKeyFocusedWidth_;
706     }
707 
GetCalendarDayKeyFocusedPenWidth()708     const Dimension& GetCalendarDayKeyFocusedPenWidth() const
709     {
710         return calendarDayKeyFocusedPenWidth_;
711     }
712 
GetEntryFontSize()713     const Dimension& GetEntryFontSize() const
714     {
715         return entryFontSize_;
716     }
717 
GetDialogBorderRadius()718     const Dimension& GetDialogBorderRadius() const
719     {
720         return dialogBorderRadius_;
721     }
722 
GetDialogBackgroundColor()723     const Color& GetDialogBackgroundColor() const
724     {
725         return dialogBackgroundColor_;
726     }
727 
GetCalendarTitleFontColor()728     const Color& GetCalendarTitleFontColor() const
729     {
730         return calendarTitleFontColor_;
731     }
732 
GetTextCurrentMonthColor()733     const Color& GetTextCurrentMonthColor() const
734     {
735         return textCurrentMonthColor_;
736     }
737 
GetTextNonCurrentMonthColor()738     const Color& GetTextNonCurrentMonthColor() const
739     {
740         return textNonCurrentMonthColor_;
741     }
742 
GetTextNonCurrentMonthTodayColor()743     const Color& GetTextNonCurrentMonthTodayColor() const
744     {
745         return textNonCurrentMonthTodayColor_;
746     }
747 
GetTextSelectedDayColor()748     const Color& GetTextSelectedDayColor() const
749     {
750         return textSelectedDayColor_;
751     }
752 
GetTextCurrentDayColor()753     const Color& GetTextCurrentDayColor() const
754     {
755         return textCurrentDayColor_;
756     }
757 
GetBackgroundKeyFocusedColor()758     const Color& GetBackgroundKeyFocusedColor() const
759     {
760         return backgroundKeyFocusedColor_;
761     }
762 
GetBackgroundSelectedTodayColor()763     const Color& GetBackgroundSelectedTodayColor() const
764     {
765         return backgroundSelectedTodayColor_;
766     }
767 
GetBackgroundDisabledMarkTodayColor()768     const Color& GetBackgroundDisabledMarkTodayColor() const
769     {
770         return backgroundDisabledMarkTodayColor_;
771     }
772 
GetBackgroundSelectedNotTodayColor()773     const Color& GetBackgroundSelectedNotTodayColor() const
774     {
775         return backgroundSelectedNotTodayColor_;
776     }
777 
GetBackgroundHoverColor()778     const Color& GetBackgroundHoverColor() const
779     {
780         return backgroundHoverColor_;
781     }
782 
GetBackgroundPressColor()783     const Color& GetBackgroundPressColor() const
784     {
785         return backgroundPressColor_;
786     }
787 
GetEntryFontColor()788     const Color& GetEntryFontColor() const
789     {
790         return entryFontColor_;
791     }
792 
GetDialogDividerColor()793     const Color& GetDialogDividerColor() const
794     {
795         return dialogDividerColor_;
796     }
797 
GetDialogButtonBackgroundColor()798     const Color& GetDialogButtonBackgroundColor() const
799     {
800         return dialogButtonBackgroundColor_;
801     }
802 
GetIsButtonTransparent()803     bool GetIsButtonTransparent() const
804     {
805         return isButtonTransparent_;
806     }
807 
GetIsDividerTransparent()808     bool GetIsDividerTransparent() const
809     {
810         return isDividerTransparent_;
811     }
812 
GetCalendarPickerLargeScale()813     double GetCalendarPickerLargeScale() const
814     {
815         return calendarPickerLargeScale_;
816     }
817 
GetCalendarPickerLargerScale()818     double GetCalendarPickerLargerScale() const
819     {
820         return calendarPickerLargerScale_;
821     }
822 
GetCalendarPickerDialogBlurStyle()823     int GetCalendarPickerDialogBlurStyle() const
824     {
825         return calendarPickerDialogBlurStyle_;
826     }
827 
828 protected:
829     CalendarTheme() = default;
830 
831 private:
832     CalendarThemeStructure calendarTheme_;
833     CalendarThemeStructure cardCalendarTheme_;
834     Color entryBorderColor_;
835     Color entryArrowColor_;
836     Color selectBackgroundColor_;
837     Color dialogBackgroundColor_;
838     Color calendarTitleFontColor_;
839     Color textCurrentMonthColor_;
840     Color textNonCurrentMonthColor_;
841     Color textNonCurrentMonthTodayColor_;
842     Color textSelectedDayColor_;
843     Color textCurrentDayColor_;
844     Color backgroundKeyFocusedColor_;
845     Color backgroundSelectedTodayColor_;
846     Color backgroundDisabledMarkTodayColor_;
847     Color backgroundSelectedNotTodayColor_;
848     Color backgroundHoverColor_;
849     Color backgroundPressColor_;
850     Color entryFontColor_;
851     Color dialogDividerColor_;
852     Color dialogButtonBackgroundColor_;
853     Dimension entryHeight_;
854     Dimension entryBorderWidth_;
855     Dimension entryBorderRadius_;
856     Dimension entryButtonWidth_;
857     Dimension entryArrowHeight_;
858     Dimension entryArrowwidth_;
859     Dimension entryDateLeftRightMargin_;
860     Dimension entryDateTopBottomMargin_;
861     Dimension dialogMargin_;
862     Dimension calendarPickerDayWidthOrHeight_;
863     Dimension calendarPickerDayLargeWidthOrHeight_;
864     Dimension calendarDayFontSize_;
865     Dimension calendarSmallWeekFontSize_;
866     Dimension distanceBetweenContainterAndDate_;
867     Dimension distanceBetweenTitleAndDate_;
868     Dimension dalendarContainerHeight_;
869     Dimension calendarLargeContainerHeight_;
870     Dimension calendarLargerContainerHeight_;
871     Dimension calendarTitleFontSize_;
872     Dimension calendarTitleRowHeight_;
873     Dimension calendarTitleLargeRowHeight_;
874     Dimension calendarTitleLargerRowHeight_;
875     Dimension calendarTitleRowTopPadding_;
876     Dimension calendarTitleRowLeftRightPadding_;
877     Dimension calendarTitleTextPadding_;
878     Dimension calendarTitleImagePadding_;
879     Dimension calendarImageWidthHeight_;
880     Dimension calendarActionRowTopPadding_;
881     Dimension calendarActionRowBottomLeftRightPadding_;
882     Dimension calendarActionRowHeight_;
883     Dimension calendarActionLargeRowHeight_;
884     Dimension calendarDayRadius_;
885     Dimension calendarDayKeyFocusedWidth_;
886     Dimension calendarLargeDayKeyFocusedWidth_;
887     Dimension calendarDayKeyFocusedPenWidth_;
888     Dimension entryFontSize_;
889     Dimension dialogBorderRadius_;
890     bool isButtonTransparent_ = true;
891     bool isDividerTransparent_ = false;
892     double calendarPickerLargeScale_ = 0.0;
893     double calendarPickerLargerScale_ = 0.0;
894     int calendarPickerDialogBlurStyle_ = static_cast<int>(BlurStyle::COMPONENT_ULTRA_THICK);
895 };
896 
897 } // namespace OHOS::Ace
898 
899 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_CALENDAR_CALENDAR_THEME_H
900