• 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
16let ExtensionContext = requireNapi('application.ExtensionContext');
17
18class AccessibilityExtensionContext extends ExtensionContext {
19  constructor(obj) {
20    super(obj);
21  }
22
23  setTargetBundleName(targetNames, callback) {
24    console.log('setTargetBundleName');
25    return this.__context_impl__.setTargetBundleName(targetNames, callback);
26  }
27
28  getFocusElement(isAccessibilityFocus, callback) {
29    console.log('getFocusElement');
30    return this.__context_impl__.getFocusElement(isAccessibilityFocus, callback);
31  }
32
33  getWindowRootElement(windowId, callback) {
34    console.log('getWindowRootElement');
35    return this.__context_impl__.getWindowRootElement(windowId, callback);
36  }
37
38  getWindows(displayId, callback) {
39    console.log('getWindows');
40    return this.__context_impl__.getWindows(displayId, callback);
41  }
42
43  injectGesture(gesture, callback) {
44    console.log('injectGesture');
45    return this.__context_impl__.injectGesture(gesture, callback);
46  }
47
48  injectGestureSync(gesture, callback) {
49    console.log('injectGestureSync');
50    return this.__context_impl__.injectGestureSync(gesture, callback);
51  }
52
53  startAbility(want, callback) {
54    console.log('startAbility');
55    return this.__context_impl__.startAbility(want, callback);
56  }
57
58  enableScreenCurtain(isEnable) {
59    console.log('enableScreenCurtain');
60    return this.__context_impl__.enableScreenCurtain(isEnable);
61  }
62
63  getElements(windowId, elementId) {
64    console.log('getElements');
65    return this.__context_impl__.getElements(windowId, elementId);
66  }
67
68  getDefaultFocusedElementIds(windowId) {
69    console.log('getDefaultFocusedElementIds');
70    return this.__context_impl__.getDefaultFocusedElementIds(windowId);
71  }
72
73  holdRunningLockSync() {
74    console.log('HoldRunningLock');
75    return this.__context_impl__.holdRunningLockSync();
76  }
77
78  unholdRunningLockSync() {
79    console.log('unholdRunningLockSync');
80    return this.__context_impl__.unholdRunningLockSync();
81  }
82
83  on(type, callback) {
84    console.log('on');
85    return this.__context_impl__.on(type, callback);
86  }
87
88  off(type, callback) {
89    console.log('off');
90    return this.__context_impl__.off(type, callback);
91  }
92
93  notifyDisconnect() {
94    console.log('notifyDisconnect');
95    return this.__context_impl__.notifyDisconnect();
96  }
97
98  getAccessibilityFocusedElement(callback) {
99    console.log('getAccessibilityFocusedElement');
100    return this.__context_impl__.getAccessibilityFocusedElement(callback);
101  }
102
103  getRootInActiveWindow(windowId, callback) {
104    console.log('getRootInActiveWindow');
105    return this.__context_impl__.getRootInActiveWindow(windowId, callback);
106  }
107
108  getAccessibilityWindowsSync(displayId) {
109    console.log('getAccessibilityWindowsSync');
110    return this.__context_impl__.getAccessibilityWindowsSync(displayId);
111  }
112}
113
114export default AccessibilityExtensionContext;