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/. */
7 #ifndef mozilla_dom_PaymentAddress_h
8 #define mozilla_dom_PaymentAddress_h
10 #include "nsPIDOMWindow.h"
11 #include "nsWrapperCache.h"
16 class PaymentAddress final
: public nsISupports
, public nsWrapperCache
{
18 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
19 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(PaymentAddress
)
21 PaymentAddress(nsPIDOMWindowInner
* aWindow
, const nsAString
& aCountry
,
22 const nsTArray
<nsString
>& aAddressLine
,
23 const nsAString
& aRegion
, const nsAString
& aRegionCode
,
24 const nsAString
& aCity
, const nsAString
& aDependentLocality
,
25 const nsAString
& aPostalCode
, const nsAString
& aSortingCode
,
26 const nsAString
& aOrganization
, const nsAString
& aRecipient
,
27 const nsAString
& aPhone
);
29 nsPIDOMWindowInner
* GetParentObject() const { return mOwner
; }
31 virtual JSObject
* WrapObject(JSContext
* aCx
,
32 JS::Handle
<JSObject
*> aGivenProto
) override
;
35 void GetCountry(nsAString
& aRetVal
) const;
37 void GetAddressLine(nsTArray
<nsString
>& aRetVal
) const;
39 void GetRegion(nsAString
& aRetVal
) const;
41 void GetRegionCode(nsAString
& aRetVal
) const;
43 void GetCity(nsAString
& aRetVal
) const;
45 void GetDependentLocality(nsAString
& aRetVal
) const;
47 void GetPostalCode(nsAString
& aRetVal
) const;
49 void GetSortingCode(nsAString
& aRetVal
) const;
51 void GetOrganization(nsAString
& aRetVal
) const;
53 void GetRecipient(nsAString
& aRetVal
) const;
55 void GetPhone(nsAString
& aRetVal
) const;
61 nsTArray
<nsString
> mAddressLine
;
65 nsString mDependentLocality
;
67 nsString mSortingCode
;
68 nsString mOrganization
;
72 nsCOMPtr
<nsPIDOMWindowInner
> mOwner
;
76 } // namespace mozilla
78 #endif // mozilla_dom_PaymentAddress_h