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"
13 namespace mozilla::dom
{
15 class PaymentAddress final
: public nsISupports
, public nsWrapperCache
{
17 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
18 NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(PaymentAddress
)
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
);
28 nsPIDOMWindowInner
* GetParentObject() const { return mOwner
; }
30 virtual JSObject
* WrapObject(JSContext
* aCx
,
31 JS::Handle
<JSObject
*> aGivenProto
) override
;
34 void GetCountry(nsAString
& aRetVal
) const;
36 void GetAddressLine(nsTArray
<nsString
>& aRetVal
) const;
38 void GetRegion(nsAString
& aRetVal
) const;
40 void GetRegionCode(nsAString
& aRetVal
) const;
42 void GetCity(nsAString
& aRetVal
) const;
44 void GetDependentLocality(nsAString
& aRetVal
) const;
46 void GetPostalCode(nsAString
& aRetVal
) const;
48 void GetSortingCode(nsAString
& aRetVal
) const;
50 void GetOrganization(nsAString
& aRetVal
) const;
52 void GetRecipient(nsAString
& aRetVal
) const;
54 void GetPhone(nsAString
& aRetVal
) const;
60 nsTArray
<nsString
> mAddressLine
;
64 nsString mDependentLocality
;
66 nsString mSortingCode
;
67 nsString mOrganization
;
71 nsCOMPtr
<nsPIDOMWindowInner
> mOwner
;
74 } // namespace mozilla::dom
76 #endif // mozilla_dom_PaymentAddress_h