1// Copyright (C) 2013 Google Inc.
2//
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#ifndef I18N_ADDRESSINPUT_ADDRESS_FIELD_H_
16#define I18N_ADDRESSINPUT_ADDRESS_FIELD_H_
17
18#include <iosfwd>
19
20namespace i18n {
21namespace addressinput {
22
23// Address field types, ordered by size, from largest to smallest.
24enum AddressField {
25  COUNTRY,             // Country code.
26  ADMIN_AREA,          // Administrative area such as a state, province,
27                       // island, etc.
28  LOCALITY,            // City or locality.
29  DEPENDENT_LOCALITY,  // Dependent locality (may be an inner-city district or
30                       // a suburb).
31  SORTING_CODE,        // Sorting code.
32  POSTAL_CODE,         // Zip or postal code.
33  STREET_ADDRESS,      // Street address lines.
34  ORGANIZATION,        // Organization, company, firm, institution, etc.
35  RECIPIENT            // Name.
36};
37
38}  // namespace addressinput
39}  // namespace i18n
40
41// Produces human-readable output in logging, for example in unit tests. Prints
42// what you would expect for valid fields, e.g. "COUNTRY" for COUNTRY. For
43// invalid values, prints "[INVALID ENUM VALUE x]".
44std::ostream& operator<<(std::ostream& o,
45                         i18n::addressinput::AddressField field);
46
47#endif  // I18N_ADDRESSINPUT_ADDRESS_FIELD_H_
48