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 #ifndef BASE_NOTIFICATION_DISTRIBUTED_NOTIFICATION_SERVICE_FRAMEWORKS_ANS_CORE_INCLUDE_REMINDER_TIMER_INFO_H
17 #define BASE_NOTIFICATION_DISTRIBUTED_NOTIFICATION_SERVICE_FRAMEWORKS_ANS_CORE_INCLUDE_REMINDER_TIMER_INFO_H
18 
19 #include "advanced_notification_service.h"
20 #include "itimer_info.h"
21 #include "notification_request.h"
22 #include "reminder_request.h"
23 
24 namespace OHOS {
25 namespace Notification {
26 class ReminderTimerInfo : public MiscServices::ITimerInfo {
27 public:
ReminderTimerInfo()28     ReminderTimerInfo() {};
~ReminderTimerInfo()29     virtual ~ReminderTimerInfo() {};
30 
31     ReminderTimerInfo(ReminderTimerInfo &other) = delete;
32     ReminderTimerInfo& operator = (const ReminderTimerInfo &other) = delete;
33 
SetAction(const std::string & action)34     inline void SetAction(const std::string &action)
35     {
36         action_ = action;
37     }
38 
SetPid(const int32_t pid)39     inline void SetPid(const int32_t pid)
40     {
41         pid_ = pid;
42     }
43 
SetUid(const int32_t uid)44     inline void SetUid(const int32_t uid)
45     {
46         uid_ = uid;
47     }
48 
SetBundleName(const std::string & bundleName)49     inline void SetBundleName(const std::string &bundleName)
50     {
51         bundleName_ = bundleName;
52     }
53 
54     /**
55      * When timing is up, this function will execute as call back.
56      */
57     void OnTrigger() override;
58 
59     /**
60      * Indicates the timing type.
61      */
62     void SetType(const int32_t &type) override;
63 
64     /**
65      * Indicates the repeat policy.
66      */
67     void SetRepeat(bool repeat) override;
68 
69     /**
70      * Indicates the interval time for repeat timing.
71      */
72     void SetInterval(const uint64_t &interval) override;
73 
74     /**
75      * Indicates the want agent information.
76      */
77     void SetWantAgent(std::shared_ptr<OHOS::AbilityRuntime::WantAgent::WantAgent> wantAgent) override;
78 
79 private:
80     std::string action_;
81     int32_t pid_ {-1};
82     int32_t uid_ {-1};
83     std::string bundleName_;
84 };
85 } // namespace OHOS
86 } // namespace Notification
87 
88 #endif  // BASE_NOTIFICATION_DISTRIBUTED_NOTIFICATION_SERVICE_FRAMEWORKS_ANS_CORE_INCLUDE_REMINDER_TIMER_INFO_H
89