• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_SERVICE_CAPTION_PROPERTY_STUB_H
17 #define ACCESSIBILITY_ABILITY_MANAGER_SERVICE_CAPTION_PROPERTY_STUB_H
18 
19 #include <cstdint>
20 #include <list>
21 
22 #include "accessible_ability_manager_service_caption_property_interface.h"
23 #include "accessibility_errorcode.h"
24 #include "iremote_stub.h"
25 #include "nocopyable.h"
26 
27 namespace OHOS {
28 namespace Accessibility {
29 class AccessibleAbilityManagerServiceCaptionPropertyStub
30     : public IRemoteStub<IAccessibleAbilityManagerServiceCaptionProperty> {
31 public:
32     /**
33      * @brief construct function
34      * @param object The object of IPC
35      * @return
36      */
37     AccessibleAbilityManagerServiceCaptionPropertyStub();
38 
39     /**
40      * @brief destruct function
41      * @param
42      * @return
43      */
44     virtual ~AccessibleAbilityManagerServiceCaptionPropertyStub() = default;
45 
46     /**
47      * @brief Receive the event from proxy by IPC mechanism.
48      * @param code The code is matched with the process function.
49      * @param data The data of process communication
50      * @param reply The response of IPC request
51      * @param option The option parameter of IPC,such as: async,sync
52      * @return
53      */
54     int OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply,
55         MessageOption &option) override;
56 
57     /**
58      * @brief Receive the caption property notify from AAMS and send it to the observer registered.
59      * @param caption The caption property.
60      * @return
61      */
62     void OnCaptionPropertyChanged(const CaptionProperty &caption) override;
63 private:
64     /**
65      * @brief Handle the IPC request for the function:HandleOnStateChanged.
66      * @param data The data of process communication
67      * @param reply The response of IPC request
68      * @return NO_ERROR: successful; otherwise is failed.
69      */
70     ErrCode HandleOnCaptionPropertyChanged(MessageParcel &data, MessageParcel &reply);
71 
72     DISALLOW_COPY_AND_MOVE(AccessibleAbilityManagerServiceCaptionPropertyStub);
73 };
74 } // namespace Accessibility
75 } // namespace OHOS
76 #endif
77