• 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_ELEMENT_OPERATOR_CALLBACK_H
17 #define ACCESSIBILITY_ELEMENT_OPERATOR_CALLBACK_H
18 
19 #include <cstdint>
20 #include <list>
21 #include <string>
22 
23 #include "accessibility_element_info.h"
24 
25 namespace OHOS {
26 namespace Accessibility {
27 /*
28 * The class supply the callback to feedback the result from UI to AA.
29 */
30 class AccessibilityElementOperatorCallback {
31 public:
32     /**
33      * @brief Set the element information by accessibility id to AA.
34      * @param infos The element info searched by accessibility id.
35      * @param requestId The request id from AA, it is used to match with request and response.
36      * @return
37      */
38     virtual void SetSearchElementInfoByAccessibilityIdResult(const std::list<AccessibilityElementInfo> &infos,
39         const int requestId) = 0;
40 
41     /**
42      * @brief Set the element information matched with text to AA.
43      * @param infos The element information searched matched with text.
44      * @param requestId The request id from AA, it is used to match with request and response.
45      * @return
46      */
47     virtual void SetSearchElementInfoByTextResult(const std::list<AccessibilityElementInfo> &infos,
48         const int requestId) = 0;
49 
50     /**
51      * @brief Set the element information matched with focus type to AA.
52      * @param info The element information searched matched with focus type.
53      * @param requestId The request id from AA, it is used to match with request and response.
54      * @return
55      */
56     virtual void SetFindFocusedElementInfoResult(const AccessibilityElementInfo &info, const int requestId) = 0;
57 
58     /**
59      * @brief Set the element information by focus direction to AA.
60      * @param info The element information searched by focus direction.
61      * @param requestId The request id from AA, it is used to match with request and response.
62      * @return
63      */
64     virtual void SetFocusMoveSearchResult(const AccessibilityElementInfo &info, const int requestId) = 0;
65 
66     /**
67      * @brief Set the result of action executed to AA.
68      * @param succeeded True: The action is executed successfully; otherwise is false.
69      * @param requestId The request id from AA, it is used to match with request and response.
70      * @return
71      */
72     virtual void SetExecuteActionResult(const bool succeeded, const int requestId) = 0;
73 };
74 } // namespace Accessibility
75 } // namesapce OHOS
76 #endif