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 #ifndef BASE_NOTIFICATION_DISTRIBUTED_NOTIFICATION_SERVICE_INTERFACES_INNER_API_SWING_CALLBACK_STUB_H
16 #define BASE_NOTIFICATION_DISTRIBUTED_NOTIFICATION_SERVICE_INTERFACES_INNER_API_SWING_CALLBACK_STUB_H
17 #ifdef NOTIFICATION_SMART_REMINDER_SUPPORTED
18 
19 #include <iremote_object.h>
20 #include <iremote_stub.h>
21 
22 #include "distributed_notification_service_ipc_interface_code.h"
23 #include "swing_callback_interface.h"
24 #include "swing_callback_stub.h"
25 
26 namespace OHOS {
27 namespace Notification {
28 /**
29  * @class SwingCallBackStub
30  * SwingCallBack Stub.
31  */
32 class SwingCallBackStub : public IRemoteStub<ISwingCallBack> {
33 public:
34     SwingCallBackStub(std::function<void(bool, int)> swingCallback);
35     SwingCallBackStub();
36     virtual ~SwingCallBackStub();
37 
38     /**
39      * OnUpdateStatus, update status.
40      *
41      * @param isEnable enable swing.
42      * @param triggerMode trigger mode.
43      * @return Returns true success, false fail.
44      */
45     int32_t OnUpdateStatus(bool isEnable, int triggerMode) override;
46 
47     /**
48      * OnUpdateStatus, update status.
49      *
50      * @param isEnable enable swing.
51      * @param triggerMode trigger mode.
52      * @return Returns true success, false fail.
53      */
54     int OnRemoteRequest(
55         uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
56 
57 private:
58     std::function<void(bool, int)> swingCallback_;
59     DISALLOW_COPY_AND_MOVE(SwingCallBackStub);
60 };
61 }  // namespace Notification
62 }  // namespace OHOS
63 #endif  // BASE_NOTIFICATION_DISTRIBUTED_NOTIFICATION_SERVICE_INTERFACES_INNER_API_SWING_CALLBACK_STUB_H
64 #endif