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