• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025 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 FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_ENGINE_FUNCTION_JS_ACCESSIBILITY_FUNCTION_H
17 #define FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_ENGINE_FUNCTION_JS_ACCESSIBILITY_FUNCTION_H
18 
19 #include "frameworks/bridge/declarative_frontend/engine/functions/js_function.h"
20 
21 namespace OHOS::Ace::Framework {
22 class JsAccessibilityActionInterceptFunction : public JsFunction {
23     DECLARE_ACE_TYPE(JsAccessibilityActionInterceptFunction, JsFunction);
24 
25 public:
JsAccessibilityActionInterceptFunction(const JSRef<JSFunc> & jsFunction)26     explicit JsAccessibilityActionInterceptFunction(const JSRef<JSFunc>& jsFunction)
27         : JsFunction(JSRef<JSObject>(), jsFunction) {}
28 
29     ~JsAccessibilityActionInterceptFunction() override = default;
30 
Execute()31     void Execute()
32     {
33         ExecuteJS();
34     }
35 
36     AccessibilityActionInterceptResult Execute(AccessibilityInterfaceAction action);
37 };
38 
39 class JsAccessibilityHoverTransparentFunction : public JsFunction {
40     DECLARE_ACE_TYPE(JsAccessibilityHoverTransparentFunction, JsFunction);
41 
42 public:
JsAccessibilityHoverTransparentFunction(const JSRef<JSFunc> & jsFunction)43     explicit JsAccessibilityHoverTransparentFunction(const JSRef<JSFunc>& jsFunction)
44         : JsFunction(JSRef<JSObject>(), jsFunction) {}
45 
46     ~JsAccessibilityHoverTransparentFunction() override = default;
47 
Execute()48     void Execute()
49     {
50         ExecuteJS();
51     }
52 
53     void Execute(TouchEventInfo& info);
54 };
55 } // namespace OHOS::Ace::Framework
56 
57 #endif // FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_ENGINE_FUNCTION_JS_ACCESSIBILITY_FUNCTION_H
58