1 /*
2  * Copyright (C) 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 ACCESSIBILITY_ABILITY_MANAGER_CAPTION_OBSERVER_STUB_H
17 #define ACCESSIBILITY_ABILITY_MANAGER_CAPTION_OBSERVER_STUB_H
18 
19 #include "i_accessible_ability_manager_caption_observer.h"
20 #include "iremote_stub.h"
21 
22 namespace OHOS {
23 namespace Accessibility {
24 class AccessibleAbilityManagerCaptionObserverStub : public IRemoteStub<IAccessibleAbilityManagerCaptionObserver> {
25 public:
26     /**
27      * @brief construct function
28      * @param object The object of IPC
29      */
30     AccessibleAbilityManagerCaptionObserverStub();
31 
32     /**
33      * @brief destruct function
34      */
35     virtual ~AccessibleAbilityManagerCaptionObserverStub() = default;
36 
37     /**
38      * @brief Receive the event from proxy by IPC mechanism.
39      * @param code The code is matched with the process function.
40      * @param data The data of process communication
41      * @param reply The response of IPC request
42      * @param option The option parameter of IPC,such as: async,sync
43      */
44     int OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply,
45         MessageOption &option) override;
46 
47 private:
48     /**
49      * @brief Handle the IPC request for the function:HandleOnStateChanged.
50      * @param data The data of process communication
51      * @param reply The response of IPC request
52      * @return NO_ERROR: successful; otherwise is failed.
53      */
54     ErrCode HandleOnCaptionPropertyChanged(MessageParcel &data, MessageParcel &reply);
55 };
56 } // namespace Accessibility
57 } // namespace OHOS
58 #endif // ACCESSIBILITY_ABILITY_MANAGER_CAPTION_OBSERVER_STUB_H