• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 FOUNDATION_ACE_INTERFACE_INNERKITS_FORM_RENDERER_DELEGATE_STUB_H
17 #define FOUNDATION_ACE_INTERFACE_INNERKITS_FORM_RENDERER_DELEGATE_STUB_H
18 
19 #include <map>
20 
21 #include "form_renderer_delegate_interface.h"
22 #include "iremote_object.h"
23 #include "iremote_stub.h"
24 
25 #include "base/utils/macros.h"
26 
27 namespace OHOS {
28 namespace Ace {
29 struct AccessibilityParentRectInfo;
30 /**
31  * @class FormRendererDelegateStub
32  * Form renderer delegate stub.
33  */
34 class ACE_EXPORT FormRendererDelegateStub : public IRemoteStub<IFormRendererDelegate> {
35 public:
36     FormRendererDelegateStub();
37     ~FormRendererDelegateStub() override;
38     /**
39      * @brief handle remote request.
40      * @param data input param.
41      * @param reply output param.
42      * @param option message option.
43      * @return Returns ERR_OK on success, others on failure.
44      */
45     int32_t OnRemoteRequest(uint32_t code, MessageParcel& data, MessageParcel& reply, MessageOption& option) override;
46 
47 private:
48     int32_t HandleOnSurfaceCreate(MessageParcel& data, MessageParcel& reply);
49     int32_t HandleOnSurfaceReuse(MessageParcel& data, MessageParcel& reply);
50     int32_t HandleOnSurfaceRelease(MessageParcel& data, MessageParcel& reply);
51     int32_t HandleOnActionEvent(MessageParcel& data, MessageParcel& reply);
52     int32_t HandleOnError(MessageParcel& data, MessageParcel& reply);
53     int32_t HandleOnSurfaceChange(MessageParcel& data, MessageParcel& reply);
54     int32_t HandleOnSurfaceDetach(MessageParcel& data, MessageParcel& reply);
55     int32_t HandleOnFormLinkInfoUpdate(MessageParcel& data, MessageParcel& reply);
56     int32_t HandleOnGetRectRelativeToWindow(MessageParcel& data, MessageParcel& reply);
57     int32_t HandleOnCheckManagerDelegate(MessageParcel& data, MessageParcel& reply);
58     int32_t HandleOnUpdateFormDone(MessageParcel& data, MessageParcel& reply);
59 
60     using FormRendererDelegateFunc = int32_t (FormRendererDelegateStub::*)(MessageParcel& data, MessageParcel& reply);
61     std::map<uint32_t, FormRendererDelegateFunc> memberFuncMap_;
62 
63     DISALLOW_COPY_AND_MOVE(FormRendererDelegateStub);
64 };
65 } // namespace Ace
66 } // namespace OHOS
67 #endif // FOUNDATION_ACE_INTERFACE_INNERKITS_FORM_RENDERER_DELEGATE_STUB_H
68