1 /*
2  * Copyright (c) 2021-2023 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 OHOS_FORM_FWK_FORM_SUPPLY_STUB_H
17 #define OHOS_FORM_FWK_FORM_SUPPLY_STUB_H
18 
19 #include <map>
20 #include "form_supply_interface.h"
21 #include "iremote_object.h"
22 #include "iremote_stub.h"
23 
24 namespace OHOS {
25 namespace AppExecFwk {
26 /**
27  * @class FormSupplyStub
28  * form supply service stub.
29  */
30 class FormSupplyStub : public IRemoteStub<IFormSupply> {
31 public:
32     FormSupplyStub();
33     virtual ~FormSupplyStub();
34     /**
35      * @brief handle remote request.
36      * @param data input param.
37      * @param reply output param.
38      * @param option message option.
39      * @return Returns ERR_OK on success, others on failure.
40      */
41     virtual int OnRemoteRequest(
42         uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option);
43 
44 private:
45     /**
46      * @brief handle OnAcquire message.
47      * @param data input param.
48      * @param reply output param.
49      * @return Returns ERR_OK on success, others on failure.
50      */
51     int HandleOnAcquire(MessageParcel &data, MessageParcel &reply);
52     /**
53      * @brief handle OnEventHandle message.
54      * @param data input param.
55      * @param reply output param.
56      * @return Returns ERR_OK on success, others on failure.
57      */
58     int HandleOnEventHandle(MessageParcel &data, MessageParcel &reply);
59     /**
60      * @brief handle OnAcquireStateResult message.
61      * @param data input param.
62      * @param reply output param.
63      * @return Returns ERR_OK on success, others on failure.
64      */
65     int HandleOnAcquireStateResult(MessageParcel &data, MessageParcel &reply);
66     /**
67      * @brief handle OnShareAcquire message.
68      * @param data input param.
69      * @param reply output param.
70      * @return Returns ERR_OK on success, others on failure.
71      */
72     int32_t HandleOnShareAcquire(MessageParcel &data, MessageParcel &reply);
73     /**
74      * @brief handle OnRenderTaskDone message.
75      * @param data input param.
76      * @param reply output param.
77      * @return Returns ERR_OK on success, others on failure.
78      */
79     int32_t HandleOnRenderTaskDone(MessageParcel &data, MessageParcel &reply);
80 
81     /**
82      * @brief handle OnShareAcquire message.
83      * @param data input param.
84      * @param reply output param.
85      * @return Returns ERR_OK on success, others on failure.
86      */
87     int32_t HandleOnAcquireDataResult(MessageParcel &data, MessageParcel &reply);
88     /**
89      * @brief handle OnStopRenderingTaskDone message.
90      * @param data input param.
91      * @param reply output param.
92      * @return Returns ERR_OK on success, others on failure.
93      */
94     int32_t HandleOnStopRenderingTaskDone(MessageParcel &data, MessageParcel &reply);
95 
96     /**
97      * @brief handle OnRenderingBlock message.
98      * @param data input param.
99      * @param reply output param.
100      * @return Returns ERR_OK on success, others on failure.
101      */
102     int32_t HandleOnRenderingBlock(MessageParcel &data, MessageParcel &reply);
103 
104     /**
105      * @brief handle OnRecycleForm message.
106      * @param data input param.
107      * @param reply output param.
108      * @return Returns ERR_OK on success, others on failure.
109      */
110     int32_t HandleOnRecycleForm(MessageParcel &data, MessageParcel &reply);
111 
112     /**
113      * @brief Trigger card recover when configuration changes occur.
114      * @param data input param.
115      * @param reply output param.
116      * @return Returns ERR_OK on success, others on failure.
117      */
118     int32_t HandleOnRecoverFormsByConfigUpdate(MessageParcel &data, MessageParcel &reply);
119 
120     int32_t HandleOnNotifyRefreshForm(MessageParcel &data, MessageParcel &reply);
121 
122 private:
123     DISALLOW_COPY_AND_MOVE(FormSupplyStub);
124 };
125 }  // namespace AppExecFwk
126 }  // namespace OHOS
127 #endif  // OHOS_FORM_FWK_FORM_SUPPLY_STUB_H
128