Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / components / autofill / core / browser / address.h
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_ADDRESS_H_
6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_ADDRESS_H_
7
8 #include <string>
9 #include <vector>
10
11 #include "base/compiler_specific.h"
12 #include "base/strings/string16.h"
13 #include "components/autofill/core/browser/form_group.h"
14
15 namespace autofill {
16
17 // A form group that stores address information.
18 class Address : public FormGroup {
19  public:
20   Address();
21   Address(const Address& address);
22   ~Address() override;
23
24   Address& operator=(const Address& address);
25
26   // FormGroup:
27   base::string16 GetRawInfo(ServerFieldType type) const override;
28   void SetRawInfo(ServerFieldType type, const base::string16& value) override;
29   base::string16 GetInfo(const AutofillType& type,
30                          const std::string& app_locale) const override;
31   bool SetInfo(const AutofillType& type,
32                const base::string16& value,
33                const std::string& app_locale) override;
34   void GetMatchingTypes(const base::string16& text,
35                         const std::string& app_locale,
36                         ServerFieldTypeSet* matching_types) const override;
37
38  private:
39   // FormGroup:
40   void GetSupportedTypes(ServerFieldTypeSet* supported_types) const override;
41
42   // Trims any trailing newlines from |street_address_|.
43   void TrimStreetAddress();
44
45   // The lines of the street address.
46   std::vector<base::string16> street_address_;
47   // A subdivision of city, e.g. inner-city district or suburb.
48   base::string16 dependent_locality_;
49   base::string16 city_;
50   base::string16 state_;
51   base::string16 zip_code_;
52   // Similar to a ZIP code, but used by entities that might not be
53   // geographically contiguous.  The canonical example is CEDEX in France.
54   base::string16 sorting_code_;
55
56   // The ISO 3166 2-letter country code, or an empty string if there is no
57   // country data specified for this address.
58   std::string country_code_;
59 };
60
61 }  // namespace autofill
62
63 #endif  // COMPONENTS_AUTOFILL_CORE_BROWSER_ADDRESS_H_