address.h revision ba5b9a6411cb1792fd21f0a078d7a25cd1ceec16
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
15namespace autofill {
16
17// A form group that stores address information.
18class Address : public FormGroup {
19 public:
20  Address();
21  Address(const Address& address);
22  virtual ~Address();
23
24  Address& operator=(const Address& address);
25
26  // FormGroup:
27  virtual base::string16 GetRawInfo(ServerFieldType type) const OVERRIDE;
28  virtual void SetRawInfo(ServerFieldType type,
29                          const base::string16& value) OVERRIDE;
30  virtual base::string16 GetInfo(const AutofillType& type,
31                           const std::string& app_locale) const OVERRIDE;
32  virtual bool SetInfo(const AutofillType& type,
33                       const base::string16& value,
34                       const std::string& app_locale) OVERRIDE;
35  virtual void GetMatchingTypes(
36      const base::string16& text,
37      const std::string& app_locale,
38      ServerFieldTypeSet* matching_types) const OVERRIDE;
39
40 private:
41  // FormGroup:
42  virtual void GetSupportedTypes(
43      ServerFieldTypeSet* supported_types) const OVERRIDE;
44
45  // The address, sans country info.
46  base::string16 line1_;
47  base::string16 line2_;
48  base::string16 city_;
49  base::string16 state_;
50  base::string16 zip_code_;
51
52  // The ISO 3166 2-letter country code, or an empty string if there is no
53  // country data specified for this address.
54  std::string country_code_;
55};
56
57}  // namespace autofill
58
59#endif  // COMPONENTS_AUTOFILL_CORE_BROWSER_ADDRESS_H_
60