1 /*
2  * Copyright (c) 2024 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 NWEB_AUTOFILL_H
17 #define NWEB_AUTOFILL_H
18 
19 #include <string>
20 
21 namespace OHOS::NWeb {
22 
23 const std::string NWEB_VIEW_DATA_KEY_FOCUS = "focus";
24 const std::string NWEB_VIEW_DATA_KEY_RECT_X = "x";
25 const std::string NWEB_VIEW_DATA_KEY_RECT_Y = "y";
26 const std::string NWEB_VIEW_DATA_KEY_RECT_W = "width";
27 const std::string NWEB_VIEW_DATA_KEY_RECT_H = "height";
28 const std::string NWEB_VIEW_DATA_KEY_VALUE = "value";
29 const std::string NWEB_VIEW_DATA_KEY_PLACEHOLDER = "placeholder";
30 
31 const std::string NWEB_AUTOFILL_EVENT_SAVE = "save";
32 const std::string NWEB_AUTOFILL_EVENT_FILL = "fill";
33 const std::string NWEB_AUTOFILL_EVENT_UPDATE = "update";
34 const std::string NWEB_AUTOFILL_EVENT_CLOSE = "close";
35 
36 const std::string NWEB_AUTOFILL_EVENT_TYPE = "event";
37 const std::string NWEB_AUTOFILL_PAGE_URL = "pageUrl";
38 const std::string NWEB_AUTOFILL_IS_USER_SELECTED = "isUserSelected";
39 const std::string NWEB_AUTOFILL_IS_OTHER_ACCOUNT = "isOtherAccount";
40 const std::string NWEB_AUTOFILL_EVENT_SOURCE = "source";
41 const std::string NWEB_AUTOFILL_FOR_LOGIN = "login";
42 
43 const std::string NWEB_AUTOFILL_STREET_ADDRESS = "street-address";
44 const std::string NWEB_AUTOFILL_ADDRESS_LEVEL_3 = "address-level3";
45 const std::string NWEB_AUTOFILL_ADDRESS_LEVEL_2 = "address-level2";
46 const std::string NWEB_AUTOFILL_ADDRESS_LEVEL_1 = "address-level1";
47 const std::string NWEB_AUTOFILL_COUNTRY = "country";
48 const std::string NWEB_AUTOFILL_NAME = "name";
49 const std::string NWEB_AUTOFILL_FAMILY_NAME = "family-name";
50 const std::string NWEB_AUTOFILL_GIVEN_NAME = "given-name";
51 const std::string NWEB_AUTOFILL_TEL_NATIONAL = "tel-national";
52 const std::string NWEB_AUTOFILL_TEL = "tel";
53 const std::string NWEB_AUTOFILL_TEL_COUNTRY_CODE = "tel-country-code";
54 const std::string NWEB_AUTOFILL_EMAIL = "email";
55 const std::string NWEB_AUTOFILL_CC_NUMBER = "cc-number";
56 const std::string NWEB_AUTOFILL_ID_CARD_NUMBER = "id-card-number";
57 const std::string NWEB_AUTOFILL_NICKNAME = "nickname";
58 const std::string NWEB_AUTOFILL_USERNAME = "username";
59 const std::string NWEB_AUTOFILL_PASSWORD = "password";
60 const std::string NWEB_AUTOFILL_NEW_PASSWORD = "new-password";
61 const std::string NWEB_AUTOFILL_DETAIL_INFO_WITHOUT_STREET = "detail-info-without-street";
62 const std::string NWEB_AUTOFILL_FORMAT_ADDRESS = "format-address";
63 
64 enum NWebAutofillEvent {
65     UNKNOWN = 0,
66     SAVE,
67     FILL,
68     UPDATE,
69     CLOSE,
70 };
71 
72 } // namespace OHOS::NWeb
73 
74 #endif // NWEB_AUTOFILL_H