OLD | NEW |
---|---|
1 // Copyright (C) 2013 Google Inc. | 1 // Copyright (C) 2013 Google Inc. |
2 // | 2 // |
3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
4 // you may not use this file except in compliance with 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 | 5 // You may obtain a copy of the License at |
6 // | 6 // |
7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
8 // | 8 // |
9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 // See the License for the specific language governing permissions and | 12 // See the License for the specific language governing permissions and |
13 // limitations under the License. | 13 // limitations under the License. |
14 | 14 |
15 #ifndef I18N_ADDRESSINPUT_ADDRESS_UI_COMPONENT_H_ | 15 #ifndef I18N_ADDRESSINPUT_ADDRESS_UI_COMPONENT_H_ |
16 #define I18N_ADDRESSINPUT_ADDRESS_UI_COMPONENT_H_ | 16 #define I18N_ADDRESSINPUT_ADDRESS_UI_COMPONENT_H_ |
17 | 17 |
18 #include <libaddressinput/address_field.h> | 18 #include <libaddressinput/address_field.h> |
19 | 19 |
20 #include <string> | |
21 | |
22 namespace i18n { | 20 namespace i18n { |
23 namespace addressinput { | 21 namespace addressinput { |
24 | 22 |
25 // A description of an input field in an address form. The user of the library | 23 // A description of an input field in an address form. The user of the library |
26 // will use a list of these elements to layout the address form input fields. | 24 // will use a list of these elements to layout the address form input fields. |
27 struct AddressUiComponent { | 25 struct AddressUiComponent { |
28 // The types of hints for how large the field should be in a multiline address | 26 // The types of hints for how large the field should be in a multiline address |
29 // form. | 27 // form. |
30 enum LengthHint { | 28 enum LengthHint { |
31 HINT_LONG, // The field should take up the whole line. | 29 HINT_LONG, // The field should take up the whole line. |
32 HINT_SHORT // The field does not need to take up the whole line. | 30 HINT_SHORT // The field does not need to take up the whole line. |
33 }; | 31 }; |
34 | 32 |
35 // The address field type for this UI component, for example LOCALITY. | 33 // The address field type for this UI component, for example LOCALITY. |
36 AddressField field; | 34 AddressField field; |
37 | 35 |
38 // The name of the field, for example "City". | 36 // The ID of the string for the name of the field, for example "City". |
please use gerrit instead
2014/01/14 00:00:43
The example should be IDS_LIBADDRESSINPUT_I18N_LOC
Evan Stade
2014/01/14 00:42:05
Done.
| |
39 std::string name; | 37 int name_id; |
40 | 38 |
41 // The hint for how large the input field should be in a multiline address | 39 // The hint for how large the input field should be in a multiline address |
42 // form. | 40 // form. |
43 LengthHint length_hint; | 41 LengthHint length_hint; |
44 }; | 42 }; |
45 | 43 |
46 } // namespace addressinput | 44 } // namespace addressinput |
47 } // namespace i18n | 45 } // namespace i18n |
48 | 46 |
49 #endif // I18N_ADDRESSINPUT_ADDRESS_UI_COMPONENT_H_ | 47 #endif // I18N_ADDRESSINPUT_ADDRESS_UI_COMPONENT_H_ |
OLD | NEW |