Backed out changeset 5c8bf24bb247 (bug 1923942) for causing generate failures. CLOSED...
[gecko.git] / dom / payments / PaymentActionResponse.h
blob09c0f0d7c120645d71ab0907e9d24c3547820584
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_PaymentActionResponse_h
8 #define mozilla_dom_PaymentActionResponse_h
10 #include "nsCOMPtr.h"
11 #include "nsIPaymentActionResponse.h"
12 #include "nsString.h"
14 namespace mozilla::dom {
16 class PaymentRequestParent;
18 class PaymentResponseData : public nsIPaymentResponseData {
19 public:
20 NS_DECL_ISUPPORTS
21 NS_DECL_NSIPAYMENTRESPONSEDATA
23 PaymentResponseData() = default;
25 protected:
26 virtual ~PaymentResponseData() = default;
28 uint32_t mType;
31 class GeneralResponseData final : public PaymentResponseData,
32 public nsIGeneralResponseData {
33 public:
34 NS_DECL_ISUPPORTS_INHERITED
35 NS_FORWARD_NSIPAYMENTRESPONSEDATA(PaymentResponseData::)
36 NS_DECL_NSIGENERALRESPONSEDATA
38 GeneralResponseData();
40 private:
41 ~GeneralResponseData() = default;
43 nsString mData;
46 class BasicCardResponseData final : public nsIBasicCardResponseData,
47 public PaymentResponseData {
48 public:
49 NS_DECL_ISUPPORTS_INHERITED
50 NS_FORWARD_NSIPAYMENTRESPONSEDATA(PaymentResponseData::)
51 NS_DECL_NSIBASICCARDRESPONSEDATA
53 BasicCardResponseData();
55 private:
56 ~BasicCardResponseData() = default;
58 nsString mCardholderName;
59 nsString mCardNumber;
60 nsString mExpiryMonth;
61 nsString mExpiryYear;
62 nsString mCardSecurityCode;
63 nsCOMPtr<nsIPaymentAddress> mBillingAddress;
66 class PaymentActionResponse : public nsIPaymentActionResponse {
67 public:
68 NS_DECL_ISUPPORTS
69 NS_DECL_NSIPAYMENTACTIONRESPONSE
71 PaymentActionResponse();
73 protected:
74 virtual ~PaymentActionResponse() = default;
76 nsString mRequestId;
77 uint32_t mType;
80 class PaymentCanMakeActionResponse final
81 : public nsIPaymentCanMakeActionResponse,
82 public PaymentActionResponse {
83 public:
84 NS_DECL_ISUPPORTS_INHERITED
85 NS_FORWARD_NSIPAYMENTACTIONRESPONSE(PaymentActionResponse::)
86 NS_DECL_NSIPAYMENTCANMAKEACTIONRESPONSE
88 PaymentCanMakeActionResponse();
90 private:
91 ~PaymentCanMakeActionResponse() = default;
93 bool mResult;
96 class PaymentShowActionResponse final : public nsIPaymentShowActionResponse,
97 public PaymentActionResponse {
98 public:
99 NS_DECL_ISUPPORTS_INHERITED
100 NS_FORWARD_NSIPAYMENTACTIONRESPONSE(PaymentActionResponse::)
101 NS_DECL_NSIPAYMENTSHOWACTIONRESPONSE
103 PaymentShowActionResponse();
105 private:
106 ~PaymentShowActionResponse() = default;
108 uint32_t mAcceptStatus;
109 nsString mMethodName;
110 nsCOMPtr<nsIPaymentResponseData> mData;
111 nsString mPayerName;
112 nsString mPayerEmail;
113 nsString mPayerPhone;
116 class PaymentAbortActionResponse final : public nsIPaymentAbortActionResponse,
117 public PaymentActionResponse {
118 public:
119 NS_DECL_ISUPPORTS_INHERITED
120 NS_FORWARD_NSIPAYMENTACTIONRESPONSE(PaymentActionResponse::)
121 NS_DECL_NSIPAYMENTABORTACTIONRESPONSE
123 PaymentAbortActionResponse();
125 private:
126 ~PaymentAbortActionResponse() = default;
128 uint32_t mAbortStatus;
131 class PaymentCompleteActionResponse final
132 : public nsIPaymentCompleteActionResponse,
133 public PaymentActionResponse {
134 public:
135 NS_DECL_ISUPPORTS_INHERITED
136 NS_FORWARD_NSIPAYMENTACTIONRESPONSE(PaymentActionResponse::)
137 NS_DECL_NSIPAYMENTCOMPLETEACTIONRESPONSE
139 PaymentCompleteActionResponse();
141 private:
142 ~PaymentCompleteActionResponse() = default;
144 uint32_t mCompleteStatus;
147 class MethodChangeDetails : public nsIMethodChangeDetails {
148 public:
149 NS_DECL_ISUPPORTS
150 NS_DECL_NSIMETHODCHANGEDETAILS
152 MethodChangeDetails() = default;
154 protected:
155 virtual ~MethodChangeDetails() = default;
157 uint32_t mType;
160 class GeneralMethodChangeDetails final : public MethodChangeDetails,
161 public nsIGeneralChangeDetails {
162 public:
163 NS_DECL_ISUPPORTS_INHERITED
164 NS_FORWARD_NSIMETHODCHANGEDETAILS(MethodChangeDetails::)
165 NS_DECL_NSIGENERALCHANGEDETAILS
167 GeneralMethodChangeDetails();
169 private:
170 ~GeneralMethodChangeDetails() = default;
172 nsString mDetails;
175 class BasicCardMethodChangeDetails final : public MethodChangeDetails,
176 public nsIBasicCardChangeDetails {
177 public:
178 NS_DECL_ISUPPORTS_INHERITED
179 NS_FORWARD_NSIMETHODCHANGEDETAILS(MethodChangeDetails::)
180 NS_DECL_NSIBASICCARDCHANGEDETAILS
182 BasicCardMethodChangeDetails();
184 private:
185 ~BasicCardMethodChangeDetails() = default;
187 nsCOMPtr<nsIPaymentAddress> mBillingAddress;
190 } // namespace mozilla::dom
192 #endif