• 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 #include "accessibility_constants.h"
17 
18 namespace OHOS {
19 namespace Accessibility {
20 // text move step
21 const std::string MOVE_UNIT_CHARACTER = "char";
22 const std::string MOVE_UNIT_WORD = "word";
23 const std::string MOVE_UNIT_LINE = "line";
24 const std::string MOVE_UNIT_PAGE = "page";
25 const std::string MOVE_UNIT_PARAGRAPH = "paragraph";
26 
27 // Operation Arguments Type
28 const std::string ACTION_ARGU_INVALID = "invalid";
29 const std::string ACTION_ARGU_SELECT_TEXT_START = "selectTextBegin";
30 const std::string ACTION_ARGU_SELECT_TEXT_END = "selectTextEnd";
31 const std::string ACTION_ARGU_SELECT_TEXT_INFORWARD = "selectTextInForWard";
32 const std::string ACTION_ARGU_SET_OFFSET = "offset";
33 const std::string ACTION_ARGU_HTML_ELEMENT = "htmlItem";
34 const std::string ACTION_ARGU_SET_TEXT = "setText";
35 const std::string ACTION_ARGU_MOVE_UNIT = "textMoveUnit";
36 const std::string ACTION_ARGU_SPAN_ID = "spanId";
37 const std::string ACTION_ARGU_CLICK_ENHANCE_DATA = "enhanceData";
38 const std::string ACTION_ARGU_CLICK_TIMESTAMP = "timeStamp";
39 
40 // HtmlItemType
41 const std::string HTML_ITEM_INVALID = "invalid";
42 const std::string HTML_ITEM_LINK = "link";
43 const std::string HTML_ITEM_CONTROL = "control";
44 const std::string HTML_ITEM_GRAPHIC = "graphic";
45 const std::string HTML_ITEM_LIST_ITEM = "listItem";
46 const std::string HTML_ITEM_LIST = "list";
47 const std::string HTML_ITEM_TABLE = "table";
48 const std::string HTML_ITEM_COMBOX = "combox";
49 const std::string HTML_ITEM_HEADING = "heading";
50 const std::string HTML_ITEM_BUTTON = "button";
51 const std::string HTML_ITEM_CHECKBOX = "checkBox";
52 const std::string HTML_ITEM_LANDMARK = "landmark";
53 const std::string HTML_ITEM_TEXT_FIELD = "textField";
54 const std::string HTML_ITEM_FOCUSABLE = "focusable";
55 const std::string HTML_ITEM_H1 = "h1";
56 const std::string HTML_ITEM_H2 = "h2";
57 const std::string HTML_ITEM_H3 = "h3";
58 const std::string HTML_ITEM_H4 = "h4";
59 const std::string HTML_ITEM_H5 = "h5";
60 const std::string HTML_ITEM_H6 = "h6";
61 const std::string HTML_ITEM_UNKOWN = "unknown";
62 
63 const std::string OHOS_PERMISSION_READ_ACCESSIBILITY_CONFIG = "ohos.permission.READ_ACCESSIBILITY_CONFIG";
64 const std::string OHOS_PERMISSION_WRITE_ACCESSIBILITY_CONFIG = "ohos.permission.WRITE_ACCESSIBILITY_CONFIG";
65 const std::string OHOS_PERMISSION_QUERY_ACCESSIBILITY_ELEMENT = "ohos.permission.QUERY_ACCESSIBILITY_ELEMENT";
66 const std::string OHOS_PERMISSION_MANAGE_SECURE_SETTINGS = "ohos.permission.MANAGE_SECURE_SETTINGS";
67 const std::string OHOS_PERMISSION_MANAGE_SETTINGS = "ohos.permission.MANAGE_SETTINGS";
68 const std::string OHOS_PERMISSION_ACCESSIBILITY_EXTENSION_ABILITY = "ohos.permission.ACCESSIBILITY_EXTENSION_ABILITY";
69 
70 const int32_t PREFETCH_PREDECESSORS = 1 << 0;
71 const int32_t PREFETCH_SIBLINGS = 1 << 1;
72 const int32_t PREFETCH_CHILDREN = 1 << 2;
73 const int32_t PREFETCH_RECURSIVE_CHILDREN = 1 << 3;
74 const int32_t PREFETCH_RECURSIVE_CHILDREN_REDUCED = 1 << 4;
75 const int32_t GET_SOURCE_MODE = PREFETCH_RECURSIVE_CHILDREN | PREFETCH_PREDECESSORS;
76 const int32_t UNDEFINED = -1;
77 const int32_t GET_SOURCE_PREFETCH_MODE = PREFETCH_PREDECESSORS | PREFETCH_SIBLINGS | PREFETCH_CHILDREN;
78 const int32_t UNDEFINED_SELECTION_INDEX = -1;
79 const int32_t UNDEFINED_ITEM_ID = 0x1FFFFFF;
80 const int32_t ROOT_ITEM_ID = -1;
81 const int32_t MAX_TEXT_LENGTH = 500;
82 const int32_t HOST_VIEW_ID = -1;
83 const int64_t ROOT_NODE_ID = -1;
84 
85 // Focus types
86 const int32_t FOCUS_TYPE_INVALID = -1;
87 const int32_t FOCUS_TYPE_INPUT = 1 << 0;
88 const int32_t FOCUS_TYPE_ACCESSIBILITY = 1 << 1;
89 
90 // grid mode
91 const int32_t SELECTION_MODE_NONE = 0;
92 const int32_t SELECTION_MODE_SINGLE = 1;
93 const int32_t SELECTION_MODE_MULTIPLE = 2;
94 
95 const int32_t INVALID_WINDOW_ID = -1;
96 const int32_t INVALID_TREE_ID = -1;
97 const int32_t ANY_WINDOW_ID = -2;
98 const int32_t ACTIVE_WINDOW_ID = 0x7FFFFFFF;
99 
100 const uint32_t STATE_ACCESSIBILITY_ENABLED = 0x00000001;
101 const uint32_t STATE_EXPLORATION_ENABLED = 0x00000002;
102 const uint32_t STATE_CAPTION_ENABLED = 0x00000004;
103 const uint32_t STATE_KEYEVENT_ENABLED = 0x00000008;
104 const uint32_t STATE_GESTURE_ENABLED = 0x00000010;
105 const uint32_t STATE_SCREENMAGNIFIER_ENABLED = 0x00000020;
106 const uint32_t STATE_MOUSEKEY_ENABLED = 0x00000040;
107 const uint32_t STATE_SHORTKEY_ENABLED = 0x00000080;
108 const uint32_t STATE_HIGHCONTRAST_ENABLED = 0x00000100;
109 const uint32_t STATE_INVETRTCOLOR_ENABLED = 0x00000200;
110 const uint32_t STATE_ANIMATIONOFF_ENABLED = 0x00000400;
111 const uint32_t STATE_AUDIOMONO_ENABLED = 0x00000800;
112 const uint32_t STATE_DALTONIZATION_STATE_ENABLED = 0x00001000;
113 const uint32_t STATE_IGNORE_REPEAT_CLICK_ENABLED = 0x00002000;
114 const uint32_t STATE_SCREENREADER_ENABLED = 0x00004000;
115 const uint32_t STATE_SINGLE_CLICK_MODE_ENABLED = 0x00008000;
116 const uint32_t STATE_CONFIG_EVENT_CHANGE = 0x00010000;
117 
118 const int32_t INVALID_CHANNEL_ID = 0xFFFFFFFF;
119 const int32_t MAX_ALLOW_SIZE = 1024 * 1000;
120 } // namespace Accessibility
121 } // namespace OHOS