1c29fa5a6Sopenharmony_ci /*
2c29fa5a6Sopenharmony_ci * Copyright (c) 2022 Huawei Device Co., Ltd.
3c29fa5a6Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4c29fa5a6Sopenharmony_ci * you may not use this file except in compliance with the License.
5c29fa5a6Sopenharmony_ci * You may obtain a copy of the License at
6c29fa5a6Sopenharmony_ci *
7c29fa5a6Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0
8c29fa5a6Sopenharmony_ci *
9c29fa5a6Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10c29fa5a6Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11c29fa5a6Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12c29fa5a6Sopenharmony_ci * See the License for the specific language governing permissions and
13c29fa5a6Sopenharmony_ci * limitations under the License.
14c29fa5a6Sopenharmony_ci */
15c29fa5a6Sopenharmony_ci
16c29fa5a6Sopenharmony_ci#ifndef NAPI_CONSTANTS_H
17c29fa5a6Sopenharmony_ci#define NAPI_CONSTANTS_H
18c29fa5a6Sopenharmony_ci
19c29fa5a6Sopenharmony_ci#include <cstddef>
20c29fa5a6Sopenharmony_ci#include <string_view>
21c29fa5a6Sopenharmony_ci
22c29fa5a6Sopenharmony_cinamespace OHOS {
23c29fa5a6Sopenharmony_cinamespace MMI {
24c29fa5a6Sopenharmony_ciinline constexpr std::string_view CALL_FUNCTION = "napi_call_function";
25c29fa5a6Sopenharmony_ciinline constexpr std::string_view CREATE_OBJECT = "napi_create_object";
26c29fa5a6Sopenharmony_ciinline constexpr std::string_view CREATE_INT32 = "napi_create_int32";
27c29fa5a6Sopenharmony_ciinline constexpr std::string_view CREATE_UINT32 = "napi_create_uint32";
28c29fa5a6Sopenharmony_ciinline constexpr std::string_view CREATE_INT64 = "napi_create_int64";
29c29fa5a6Sopenharmony_ciinline constexpr std::string_view CREATE_PROMISE = "napi_create_promise";
30c29fa5a6Sopenharmony_ciinline constexpr std::string_view CREATE_REFERENCE = "napi_create_reference";
31c29fa5a6Sopenharmony_ciinline constexpr std::string_view CREATE_ASYNC_WORK = "napi_create_async_work";
32c29fa5a6Sopenharmony_ciinline constexpr std::string_view DEFINE_PROPERTIES = "napi_define_properties";
33c29fa5a6Sopenharmony_ciinline constexpr std::string_view DEFINE_CLASS = "napi_define_class";
34c29fa5a6Sopenharmony_ciinline constexpr std::string_view DELETE_REFERENCE = "napi_delete_reference";
35c29fa5a6Sopenharmony_ciinline constexpr std::string_view GET_CB_INFO = "napi_get_cb_info";
36c29fa5a6Sopenharmony_ciinline constexpr std::string_view GET_VALUE_BOOL = "napi_get_value_bool";
37c29fa5a6Sopenharmony_ciinline constexpr std::string_view GET_GLOBAL = "napi_get_global";
38c29fa5a6Sopenharmony_ciinline constexpr std::string_view GET_REFERENCE_VALUE = "napi_get_reference_value";
39c29fa5a6Sopenharmony_ciinline constexpr std::string_view GET_BOOLEAN = "napi_get_boolean";
40c29fa5a6Sopenharmony_ciinline constexpr std::string_view GET_VALUE_INT32 = "napi_get_value_int32";
41c29fa5a6Sopenharmony_ciinline constexpr std::string_view GET_UV_EVENT_LOOP = "napi_get_uv_event_loop";
42c29fa5a6Sopenharmony_ciinline constexpr std::string_view GET_UNDEFINED = "napi_get_undefined";
43c29fa5a6Sopenharmony_ciinline constexpr std::string_view GET_NAMED_PROPERTY = "napi_get_named_property";
44c29fa5a6Sopenharmony_ciinline constexpr std::string_view HAS_NAMED_PROPERTY = "napi_has_named_property";
45c29fa5a6Sopenharmony_ciinline constexpr std::string_view NEW_INSTANCE = "napi_new_instance";
46c29fa5a6Sopenharmony_ciinline constexpr std::string_view QUEUE_ASYNC_WORK = "napi_queue_async_work";
47c29fa5a6Sopenharmony_ciinline constexpr std::string_view RESOLVE_DEFERRED = "napi_resolve_deferred";
48c29fa5a6Sopenharmony_ciinline constexpr std::string_view REJECT_DEFERRED = "napi_reject_deferred";
49c29fa5a6Sopenharmony_ciinline constexpr std::string_view REFERENCE_REF = "napi_reference_ref";
50c29fa5a6Sopenharmony_ciinline constexpr std::string_view REFERENCE_UNREF = "napi_reference_unref";
51c29fa5a6Sopenharmony_ciinline constexpr std::string_view SET_NAMED_PROPERTY = "napi_set_named_property";
52c29fa5a6Sopenharmony_ciinline constexpr std::string_view STRICT_EQUALS = "napi_strict_equals";
53c29fa5a6Sopenharmony_ciinline constexpr std::string_view TYPEOF = "napi_typeof";
54c29fa5a6Sopenharmony_ciinline constexpr std::string_view UNWRAP = "napi_unwrap";
55c29fa5a6Sopenharmony_ciinline constexpr std::string_view WRAP = "napi_wrap";
56c29fa5a6Sopenharmony_ciinline constexpr std::string_view GET_VALUE_STRING_UTF8 = "napi_get_value_string_utf8";
57c29fa5a6Sopenharmony_ciinline constexpr std::string_view GET_ARRAY_LENGTH = "napi_get_array_length";
58c29fa5a6Sopenharmony_ciinline constexpr std::string_view GET_ELEMENT = "napi_get_element";
59c29fa5a6Sopenharmony_ciinline constexpr std::string_view CREATE_ARRAY = "napi_create_array";
60c29fa5a6Sopenharmony_ciinline constexpr std::string_view SET_ELEMENT = "napi_set_element";
61c29fa5a6Sopenharmony_ciinline constexpr std::string_view CREATE_STRING_UTF8 = "napi_create_string_utf8";
62c29fa5a6Sopenharmony_ciinline const std::string CHANGED_TYPE = "change";
63c29fa5a6Sopenharmony_ciinline const std::string SUBSCRIBE_TYPE = "key";
64c29fa5a6Sopenharmony_ciinline const std::string HOTKEY_SUBSCRIBE_TYPE = "hotkeyChange";
65c29fa5a6Sopenharmony_ciinline constexpr std::string_view DELETE_ASYNC_WORK = "napi_delete_async_work";
66c29fa5a6Sopenharmony_ciinline constexpr std::string_view COERCE_TO_BOOL = "napi_coerce_to_bool";
67c29fa5a6Sopenharmony_ciinline constexpr std::string_view CREATE_ERROR = "napi_create_error";
68c29fa5a6Sopenharmony_ciinline const std::string TOUCH_SWIPE_GESTURE = "touchscreenSwipe";
69c29fa5a6Sopenharmony_ciinline const std::string TOUCH_PINCH_GESTURE = "touchscreenPinch";
70c29fa5a6Sopenharmony_ciinline const std::string TOUCH_ALL_GESTURE = "touchAllGesture";
71c29fa5a6Sopenharmony_ci
72c29fa5a6Sopenharmony_ciinline constexpr size_t MAX_STRING_LEN { 1024 };
73c29fa5a6Sopenharmony_ci
74c29fa5a6Sopenharmony_ciinline constexpr int SUCCESS { 0 };
75c29fa5a6Sopenharmony_ciinline constexpr int FAILED { -1 };
76c29fa5a6Sopenharmony_ciinline constexpr int32_t ANR_DISPATCH = 0;
77c29fa5a6Sopenharmony_ciinline constexpr int32_t ANR_MONITOR = 1;
78c29fa5a6Sopenharmony_ci
79c29fa5a6Sopenharmony_ciinline constexpr uint32_t EVDEV_UDEV_TAG_KEYBOARD = (1 << 1);
80c29fa5a6Sopenharmony_ciinline constexpr uint32_t EVDEV_UDEV_TAG_MOUSE = (1 << 2);
81c29fa5a6Sopenharmony_ciinline constexpr uint32_t EVDEV_UDEV_TAG_TOUCHPAD = (1 << 3);
82c29fa5a6Sopenharmony_ci} // namespace MMI
83c29fa5a6Sopenharmony_ci} // namespace OHOS
84c29fa5a6Sopenharmony_ci#endif // NAPI_CONSTANTS_H
85