• 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_HTML_ELEMENT = "htmlItem";
32 const std::string ACTION_ARGU_SET_TEXT = "setText";
33 const std::string ACTION_ARGU_MOVE_UNIT = "textMoveUnit";
34 
35 // HtmlItemType
36 const std::string HTML_ITEM_INVALID = "invalid";
37 const std::string HTML_ITEM_LINK = "link";
38 const std::string HTML_ITEM_CONTROL = "control";
39 const std::string HTML_ITEM_GRAPHIC = "graphic";
40 const std::string HTML_ITEM_LIST_ITEM = "listItem";
41 const std::string HTML_ITEM_LIST = "list";
42 const std::string HTML_ITEM_TABLE = "table";
43 const std::string HTML_ITEM_COMBOX = "combox";
44 const std::string HTML_ITEM_HEADING = "heading";
45 const std::string HTML_ITEM_BUTTON = "button";
46 const std::string HTML_ITEM_CHECKBOX = "checkBox";
47 const std::string HTML_ITEM_LANDMARK = "landmark";
48 const std::string HTML_ITEM_TEXT_FIELD = "textField";
49 const std::string HTML_ITEM_FOCUSABLE = "focusable";
50 const std::string HTML_ITEM_H1 = "h1";
51 const std::string HTML_ITEM_H2 = "h2";
52 const std::string HTML_ITEM_H3 = "h3";
53 const std::string HTML_ITEM_H4 = "h4";
54 const std::string HTML_ITEM_H5 = "h5";
55 const std::string HTML_ITEM_H6 = "h6";
56 const std::string HTML_ITEM_UNKOWN = "unknown";
57 
58 const std::string OHOS_PERMISSION_READ_ACCESSIBILITY_CONFIG = "ohos.permission.READ_ACCESSIBILITY_CONFIG";
59 const std::string OHOS_PERMISSION_WRITE_ACCESSIBILITY_CONFIG = "ohos.permission.WRITE_ACCESSIBILITY_CONFIG";
60 
61 const int32_t PREFETCH_PREDECESSORS = 1 << 0;
62 const int32_t PREFETCH_SIBLINGS = 1 << 1;
63 const int32_t PREFETCH_CHILDREN = 1 << 2;
64 const int32_t UNDEFINED = -1;
65 const int32_t GET_SOURCE_PREFETCH_MODE = PREFETCH_PREDECESSORS | PREFETCH_SIBLINGS | PREFETCH_CHILDREN;
66 const int32_t UNDEFINED_SELECTION_INDEX = -1;
67 const int32_t UNDEFINED_ITEM_ID = 0x1FFFFFF;
68 const int32_t ROOT_ITEM_ID = -1;
69 const int32_t MAX_TEXT_LENGTH = 500;
70 const int32_t HOST_VIEW_ID = -1;
71 const int32_t ROOT_NODE_ID = -1;
72 
73 // Focus types
74 const int32_t FOCUS_TYPE_INVALID = -1;
75 const int32_t FOCUS_TYPE_INPUT = 1 << 0;
76 const int32_t FOCUS_TYPE_ACCESSIBILITY = 1 << 1;
77 
78 // grid mode
79 const int32_t SELECTION_MODE_NONE = 0;
80 const int32_t SELECTION_MODE_SINGLE = 1;
81 const int32_t SELECTION_MODE_MULTIPLE = 2;
82 
83 const int32_t INVALID_WINDOW_ID = -1;
84 const int32_t ANY_WINDOW_ID = -2;
85 const int32_t ACTIVE_WINDOW_ID = 0x7FFFFFFF;
86 
87 const uint32_t STATE_ACCESSIBILITY_ENABLED = 0x00000001;
88 const uint32_t STATE_EXPLORATION_ENABLED = 0x00000002;
89 const uint32_t STATE_CAPTION_ENABLED = 0x00000004;
90 const uint32_t STATE_KEYEVENT_ENABLED = 0x00000008;
91 const uint32_t STATE_GESTURE_ENABLED = 0x00000010;
92 const uint32_t STATE_SCREENMAGNIFIER_ENABLED = 0x00000020;
93 const uint32_t STATE_MOUSEKEY_ENABLED = 0x00000040;
94 const uint32_t STATE_SHORTKEY_ENABLED = 0x00000080;
95 const uint32_t STATE_HIGHCONTRAST_ENABLED = 0x00000100;
96 const uint32_t STATE_INVETRTCOLOR_ENABLED = 0x00000200;
97 const uint32_t STATE_ANIMATIONOFF_ENABLED = 0x00000400;
98 const uint32_t STATE_AUDIOMONO_ENABLED = 0x00000800;
99 
100 const int32_t INVALID_CHANNEL_ID = 0xFFFFFFFF;
101 } // namespace Accessibility
102 } // namespace OHOS