• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #include "core/components/text_clock/text_clock_component.h"
17 
18 #include "core/components/text_clock/render_text_clock.h"
19 #include "core/components/text_clock/text_clock_element.h"
20 
21 namespace OHOS::Ace {
CreateElement()22 RefPtr<Element> TextClockComponent::CreateElement()
23 {
24     return AceType::MakeRefPtr<TextClockElement>();
25 }
26 
CreateRenderNode()27 RefPtr<RenderNode> TextClockComponent::CreateRenderNode()
28 {
29     return RenderTextClock::Create();
30 }
31 
SetHoursWest(int32_t hoursWest)32 void TextClockComponent::SetHoursWest(int32_t hoursWest)
33 {
34     hoursWest_ = hoursWest;
35 }
36 
GetHoursWest() const37 int32_t TextClockComponent::GetHoursWest() const
38 {
39     return hoursWest_;
40 }
41 
SetFormat(const std::string & format)42 void TextClockComponent::SetFormat(const std::string& format)
43 {
44     format_ = format;
45 }
46 
GetFormat() const47 std::string TextClockComponent::GetFormat() const
48 {
49     return format_;
50 }
51 
SetTextClockController(RefPtr<TextClockController> textClockController)52 void TextClockComponent::SetTextClockController(RefPtr<TextClockController> textClockController)
53 {
54     textClockController_ = textClockController;
55 }
56 
GetTextClockController() const57 RefPtr<TextClockController> TextClockComponent::GetTextClockController() const
58 {
59     return textClockController_;
60 }
61 } // namespace OHOS::Ace