// Copyright 2020 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_DATA_MODEL_AUTOFILL_STRUCTURED_ADDRESS_NAME_H_ #define COMPONENTS_AUTOFILL_CORE_BROWSER_DATA_MODEL_AUTOFILL_STRUCTURED_ADDRESS_NAME_H_ #include <string> #include <vector> #include "components/autofill/core/browser/data_model/autofill_feature_guarded_address_component.h" #include "components/autofill/core/browser/data_model/autofill_structured_address_component.h" #include "components/autofill/core/browser/field_types.h" namespace re2 { class RE2; } // namespace re2 namespace autofill { // Atomic components that represents the first name. class NameFirst : public AddressComponent { … }; // Atomic component that represents the middle name. class NameMiddle : public AddressComponent { … }; // Atomic component that represents the first part of a last name. class NameLastFirst : public AddressComponent { … }; // Atomic component that represents the conjunction in a Hispanic/Latinx // surname. class NameLastConjunction : public AddressComponent { … }; // Atomic component that represents the second part of a surname. class NameLastSecond : public AddressComponent { … }; // Compound that represent a last name. It contains a first and second last name // and a conjunction as it is used in Hispanic/Latinx names. Note, that compound // family names like Miller-Smith are not supposed to be split up into two // components. If a name contains only a single component, the component is // stored in the second part by default. // // +-------+ // | _LAST | // +-------- // / | \ // / | \ // / | \ // +--------+ +-----------+ +---------+ // | _FIRST | | _CONJUNC. | | _SECOND | // +--------+ +-----------+ +---------+ // class NameLast : public AddressComponent { … }; // Compound that represents a full name. It contains a honorific, a first // name, a middle name and a last name. The last name is a compound itself. // // +------------+ // | NAME_FULL | // +------------+ // / | \ // / | \ // / | \ // +------------+ +-------------+ +-----------+ // | NAME_FIRST | | NAME_MIDDLE | | NAME_LAST | // +------------+ +-------------+ +-----------+ // / | \ // / | \ // / | \ // / | \ // +--------+ +--------------+ +---------+ // | _FIRST | | _CONJUNCTION | | _SECOND | // +--------+ +--------------+ +---------+ // class NameFull : public AddressComponent { … }; } // namespace autofill #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_DATA_MODEL_AUTOFILL_STRUCTURED_ADDRESS_NAME_H_