• 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 /**
30  * @class FormRendererDelegateStub
31  * Form renderer delegate stub.
32  */
33 class ACE_EXPORT FormRendererDelegateStub : public IRemoteStub<IFormRendererDelegate> {
34 public:
35     FormRendererDelegateStub();
36     ~FormRendererDelegateStub() override;
37     /**
38      * @brief handle remote request.
39      * @param data input param.
40      * @param reply output param.
41      * @param option message option.
42      * @return Returns ERR_OK on success, others on failure.
43      */
44     int32_t OnRemoteRequest(uint32_t code, MessageParcel& data, MessageParcel& reply, MessageOption& option) override;
45 
46 private:
47     int32_t HandleOnSurfaceCreate(MessageParcel& data, MessageParcel& reply);
48     int32_t HandleOnSurfaceReuse(MessageParcel& data, MessageParcel& reply);
49     int32_t HandleOnSurfaceRelease(MessageParcel& data, MessageParcel& reply);
50     int32_t HandleOnActionEvent(MessageParcel& data, MessageParcel& reply);
51     int32_t HandleOnError(MessageParcel& data, MessageParcel& reply);
52     int32_t HandleOnSurfaceChange(MessageParcel& data, MessageParcel& reply);
53     int32_t HandleOnSurfaceDetach(MessageParcel& data, MessageParcel& reply);
54     int32_t HandleOnFormLinkInfoUpdate(MessageParcel& data, MessageParcel& reply);
55     int32_t HandleOnGetRectRelativeToWindow(MessageParcel& data, MessageParcel& reply);
56 
57     using FormRendererDelegateFunc = int32_t (FormRendererDelegateStub::*)(MessageParcel& data, MessageParcel& reply);
58     std::map<uint32_t, FormRendererDelegateFunc> memberFuncMap_;
59 
60     DISALLOW_COPY_AND_MOVE(FormRendererDelegateStub);
61 };
62 } // namespace Ace
63 } // namespace OHOS
64 #endif // FOUNDATION_ACE_INTERFACE_INNERKITS_FORM_RENDERER_DELEGATE_STUB_H
65