| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2010 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 CHROME_BROWSER_AUTOFILL_AUTOFILL_ADDRESS_MODEL_MAC_ | |
| 6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_ADDRESS_MODEL_MAC_ | |
| 7 #pragma once | |
| 8 | |
| 9 #import <Cocoa/Cocoa.h> | |
| 10 | |
| 11 class AutoFillProfile; | |
| 12 | |
| 13 // A "model" class used with bindings mechanism and the | |
| 14 // |AutoFillAddressViewController| to achieve the form-like view | |
| 15 // of autofill data in the Chrome options UI. | |
| 16 // Model objects are initialized from a given profile using the designated | |
| 17 // initializer |initWithProfile:|. | |
| 18 // Users of this class must be prepared to handle nil string return values. | |
| 19 // The KVO/bindings mechanisms expect this and deal with nil string values | |
| 20 // appropriately. | |
| 21 @interface AutoFillAddressModel : NSObject { | |
| 22 @private | |
| 23 // These are not scoped_nsobjects because we use them via KVO/bindings. | |
| 24 NSString* fullName_; | |
| 25 NSString* email_; | |
| 26 NSString* companyName_; | |
| 27 NSString* addressLine1_; | |
| 28 NSString* addressLine2_; | |
| 29 NSString* addressCity_; | |
| 30 NSString* addressState_; | |
| 31 NSString* addressZip_; | |
| 32 NSString* addressCountry_; | |
| 33 NSString* phoneWholeNumber_; | |
| 34 NSString* faxWholeNumber_; | |
| 35 } | |
| 36 | |
| 37 @property(nonatomic, copy) NSString* fullName; | |
| 38 @property(nonatomic, copy) NSString* email; | |
| 39 @property(nonatomic, copy) NSString* companyName; | |
| 40 @property(nonatomic, copy) NSString* addressLine1; | |
| 41 @property(nonatomic, copy) NSString* addressLine2; | |
| 42 @property(nonatomic, copy) NSString* addressCity; | |
| 43 @property(nonatomic, copy) NSString* addressState; | |
| 44 @property(nonatomic, copy) NSString* addressZip; | |
| 45 @property(nonatomic, copy) NSString* addressCountry; | |
| 46 @property(nonatomic, copy) NSString* phoneWholeNumber; | |
| 47 @property(nonatomic, copy) NSString* faxWholeNumber; | |
| 48 | |
| 49 // The designated initializer. Initializes the property strings to values | |
| 50 // retrieved from the |profile|. | |
| 51 - (id)initWithProfile:(const AutoFillProfile&)profile; | |
| 52 | |
| 53 // This method copies internal NSString property values into the | |
| 54 // |profile| object's fields as appropriate. |profile| should never be NULL. | |
| 55 - (void)copyModelToProfile:(AutoFillProfile*)profile; | |
| 56 | |
| 57 @end | |
| 58 | |
| 59 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_ADDRESS_MODEL_MAC_ | |
| OLD | NEW |