PaymentAddress.h (2311B)
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */ 3 /* This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 #ifndef mozilla_dom_PaymentAddress_h 8 #define mozilla_dom_PaymentAddress_h 9 10 #include "nsPIDOMWindow.h" 11 #include "nsWrapperCache.h" 12 13 namespace mozilla::dom { 14 15 class PaymentAddress final : public nsISupports, public nsWrapperCache { 16 public: 17 NS_DECL_CYCLE_COLLECTING_ISUPPORTS 18 NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(PaymentAddress) 19 20 PaymentAddress(nsPIDOMWindowInner* aWindow, const nsAString& aCountry, 21 const nsTArray<nsString>& aAddressLine, 22 const nsAString& aRegion, const nsAString& aRegionCode, 23 const nsAString& aCity, const nsAString& aDependentLocality, 24 const nsAString& aPostalCode, const nsAString& aSortingCode, 25 const nsAString& aOrganization, const nsAString& aRecipient, 26 const nsAString& aPhone); 27 28 nsPIDOMWindowInner* GetParentObject() const { return mOwner; } 29 30 virtual JSObject* WrapObject(JSContext* aCx, 31 JS::Handle<JSObject*> aGivenProto) override; 32 33 // Getter functions 34 void GetCountry(nsAString& aRetVal) const; 35 36 void GetAddressLine(nsTArray<nsString>& aRetVal) const; 37 38 void GetRegion(nsAString& aRetVal) const; 39 40 void GetRegionCode(nsAString& aRetVal) const; 41 42 void GetCity(nsAString& aRetVal) const; 43 44 void GetDependentLocality(nsAString& aRetVal) const; 45 46 void GetPostalCode(nsAString& aRetVal) const; 47 48 void GetSortingCode(nsAString& aRetVal) const; 49 50 void GetOrganization(nsAString& aRetVal) const; 51 52 void GetRecipient(nsAString& aRetVal) const; 53 54 void GetPhone(nsAString& aRetVal) const; 55 56 private: 57 ~PaymentAddress(); 58 59 nsString mCountry; 60 nsTArray<nsString> mAddressLine; 61 nsString mRegion; 62 nsString mRegionCode; 63 nsString mCity; 64 nsString mDependentLocality; 65 nsString mPostalCode; 66 nsString mSortingCode; 67 nsString mOrganization; 68 nsString mRecipient; 69 nsString mPhone; 70 71 nsCOMPtr<nsPIDOMWindowInner> mOwner; 72 }; 73 74 } // namespace mozilla::dom 75 76 #endif // mozilla_dom_PaymentAddress_h