• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 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_NG_PATTERNS_DATE_PICKER_DATE_PICKER_MODEL_NG_VIEW_H
17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PATTERNS_DATE_PICKER_DATE_PICKER_MODEL_NG_VIEW_H
18 #include "base/utils/macros.h"
19 #include "core/components/common/layout/constants.h"
20 #include "core/components/picker/picker_base_component.h"
21 #include "core/components_ng/pattern/picker/datepicker_event_hub.h"
22 #include "core/components_ng/pattern/picker/datepicker_layout_property.h"
23 #include "core/components_ng/pattern/picker/picker_model.h"
24 
25 namespace OHOS::Ace::NG {
26 class ACE_EXPORT DatePickerModelNG : public DatePickerModel {
27 public:
28     void CreateDatePicker(RefPtr<PickerTheme> theme) override;
CreateTimePicker(RefPtr<PickerTheme> theme)29     void CreateTimePicker(RefPtr<PickerTheme> theme) override {};
30     void SetStartDate(const PickerDate& value) override;
31     void SetEndDate(const PickerDate& value) override;
32     void SetSelectedDate(const PickerDate& value) override;
33     void SetShowLunar(bool lunar) override;
34     void SetOnChange(DateChangeEvent&& onChange) override;
SetSelectedTime(const PickerTime & selectedTime)35     void SetSelectedTime(const PickerTime& selectedTime) override {};
SetHour24(bool value)36     void SetHour24(bool value) override {};
37 
38 private:
39     static RefPtr<FrameNode> CreateStackNode();
40     static RefPtr<FrameNode> CreateButtonNode();
41 };
42 } // namespace OHOS::Ace::NG
43 
44 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PATTERNS_DATE_PICKER_DATE_PICKER_MODEL_NG_VIEW_H