1 /*
2  * Copyright (c) 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_JS_FORM_STATE_OBSERVER_STUB_H
17 #define OHOS_FORM_FWK_JS_FORM_STATE_OBSERVER_STUB_H
18 
19 #include <map>
20 #include <mutex>
21 #include <vector>
22 #include "js_form_state_observer_interface.h"
23 #include "iremote_object.h"
24 #include "iremote_stub.h"
25 
26 namespace OHOS {
27 namespace AbilityRuntime {
28 class JsFormStateObserverStub : public IRemoteStub<IJsFormStateObserver> {
29 public:
30     JsFormStateObserverStub();
31     virtual ~JsFormStateObserverStub();
32 
33     virtual int OnRemoteRequest(
34         uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option);
35 
36     int32_t HandleOnAddForm(MessageParcel &data, MessageParcel &reply);
37 
38     int32_t HandleOnRemoveForm(MessageParcel &data, MessageParcel &reply);
39 
40     int32_t HandleNotifyWhetherFormsVisible(MessageParcel &data, MessageParcel &reply);
41 
42     int32_t HandleOnFormClick(MessageParcel &data, MessageParcel &reply);
43 private:
44     DISALLOW_COPY_AND_MOVE(JsFormStateObserverStub);
45 template<typename T>
46     int32_t GetParcelableInfos(MessageParcel &reply, std::vector<T> &parcelableInfos);
47 };
48 }  // namespace AbilityRuntime
49 }  // namespace OHOS
50 #endif  // OHOS_FORM_FWK_JS_FORM_STATE_OBSERVER_STUB_H
51