1 /*
2  * Copyright (C) 2024 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 "alarm_timer.h"
17 
18 namespace OHOS::ArkUi::UiAppearance {
OnTrigger()19 void AlarmTimer::OnTrigger()
20 {
21     if (callBack_) {
22         callBack_();
23     }
24 }
25 
SetCallbackInfo(const std::function<void ()> & callBack)26 void AlarmTimer::SetCallbackInfo(const std::function<void()>& callBack)
27 {
28     callBack_ = callBack;
29 }
30 
SetType(const int & type)31 void AlarmTimer::SetType(const int& type)
32 {
33     this->type = type;
34 }
35 
SetRepeat(bool repeat)36 void AlarmTimer::SetRepeat(bool repeat)
37 {
38     this->repeat = repeat;
39 }
40 
SetInterval(const uint64_t & interval)41 void AlarmTimer::SetInterval(const uint64_t& interval)
42 {
43     this->interval = interval;
44 }
45 
SetWantAgent(std::shared_ptr<AbilityRuntime::WantAgent::WantAgent> wantAgent)46 void AlarmTimer::SetWantAgent(std::shared_ptr<AbilityRuntime::WantAgent::WantAgent> wantAgent)
47 {
48     this->wantAgent = wantAgent;
49 }
50 } // namespace OHOS::ArkUi::UiAppearance
51