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 OHOS_FORM_FWK_FORM_PROVIDER_STUB_H
17 #define OHOS_FORM_FWK_FORM_PROVIDER_STUB_H
18 
19 #include <map>
20 
21 #include "form_provider_interface.h"
22 #include "iremote_object.h"
23 #include "iremote_stub.h"
24 
25 namespace OHOS {
26 namespace AppExecFwk {
27 /**
28  * @class FormProviderStub
29  * form provider service stub.
30  */
31 class FormProviderStub : public IRemoteStub<IFormProvider> {
32 public:
33     FormProviderStub();
34     virtual ~FormProviderStub();
35     /**
36      * @brief handle remote request.
37      * @param data input param.
38      * @param reply output param.
39      * @param option message option.
40      * @return Returns ERR_OK on success, others on failure.
41      */
42     virtual int OnRemoteRequest(
43         uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option);
44 
45 private:
46     /**
47      * @brief handle AcquireProviderFormInfo message.
48      * @param data input param.
49      * @param reply output param.
50      * @return Returns ERR_OK on success, others on failure.
51      */
52     int HandleAcquireProviderFormInfo(MessageParcel &data, MessageParcel &reply);
53     /**
54      * @brief handle NotifyFormDelete message.
55      * @param data input param.
56      * @param reply output param.
57      * @return Returns ERR_OK on success, others on failure.
58      */
59     int HandleNotifyFormDelete(MessageParcel &data, MessageParcel &reply);
60     /**
61      * @brief handle NotifyFormsDelete message.
62      * @param data input param.
63      * @param reply output param.
64      * @return Returns ERR_OK on success, others on failure.
65      */
66     int HandleNotifyFormsDelete(MessageParcel &data, MessageParcel &reply);
67     /**
68      * @brief handle NotifyFormUpdate message.
69      * @param data input param.
70      * @param reply output param.
71      * @return Returns ERR_OK on success, others on failure.
72      */
73     int HandleNotifyFormUpdate(MessageParcel &data, MessageParcel &reply);
74 
75     /**
76      * @brief handle EventNotify message.
77      * @param data input param.
78      * @param reply output param.
79      * @return Returns ERR_OK on success, others on failure.
80      */
81     int HandleEventNotify(MessageParcel &data, MessageParcel &reply);
82 
83     /**
84      * @brief handle NotifyFormCastTempForm message.
85      * @param data input param.
86      * @param reply output param.
87      * @return Returns ERR_OK on success, others on failure.
88      */
89     int HandleNotifyFormCastTempForm(MessageParcel &data, MessageParcel &reply);
90     /**
91      * @brief handle NotifyFormCastTempForm message.
92      * @param data input param.
93      * @param reply output param.
94      * @return Returns ERR_OK on success, others on failure.
95      */
96     int HandleFireFormEvent(MessageParcel &data, MessageParcel &reply);
97     /**
98      * @brief handle AcquireState message.
99      * @param data input param.
100      * @param reply output param.
101      * @return Returns ERR_OK on success, others on failure.
102      */
103     int HandleAcquireState(MessageParcel &data, MessageParcel &reply);
104 
105     /**
106      * @brief Handle request provider share form info message.
107      * @param data input param.
108      * @param reply output param.
109      * @return Returns ERR_OK on success, others on failure.
110      */
111     int32_t HandleAcquireShareFormData(MessageParcel &data, MessageParcel &reply);
112 
113     /**
114      * @brief Handle request provider adquire form data.
115      * @param data input param.
116      * @param reply output param.
117      * @return Returns ERR_OK on success, others on failure.
118      */
119     int32_t HandleAcquireFormData(MessageParcel &data, MessageParcel &reply);
120 private:
121     DISALLOW_COPY_AND_MOVE(FormProviderStub);
122 };
123 }  // namespace AppExecFwk
124 }  // namespace OHOS
125 #endif  // OHOS_FORM_FWK_FORM_PROVIDER_STUB_H
126