Bug 1472338: part 2) Change `clipboard.readText()` to read from the clipboard asynchr...
[gecko.git] / dom / payments / PaymentActionResponse.h
blob2e6a9295b1ce9b5050c2c16992413093c715a4ae
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 {
15 namespace dom {
17 class PaymentRequestParent;
19 class PaymentResponseData : public nsIPaymentResponseData {
20 public:
21 NS_DECL_ISUPPORTS
22 NS_DECL_NSIPAYMENTRESPONSEDATA
24 PaymentResponseData() = default;
26 protected:
27 virtual ~PaymentResponseData() = default;
29 uint32_t mType;
32 class GeneralResponseData final : public PaymentResponseData,
33 public nsIGeneralResponseData {
34 public:
35 NS_DECL_ISUPPORTS_INHERITED
36 NS_FORWARD_NSIPAYMENTRESPONSEDATA(PaymentResponseData::)
37 NS_DECL_NSIGENERALRESPONSEDATA
39 GeneralResponseData();
41 private:
42 ~GeneralResponseData() = default;
44 nsString mData;
47 class BasicCardResponseData final : public nsIBasicCardResponseData,
48 public PaymentResponseData {
49 public:
50 NS_DECL_ISUPPORTS_INHERITED
51 NS_FORWARD_NSIPAYMENTRESPONSEDATA(PaymentResponseData::)
52 NS_DECL_NSIBASICCARDRESPONSEDATA
54 BasicCardResponseData();
56 private:
57 ~BasicCardResponseData() = default;
59 nsString mCardholderName;
60 nsString mCardNumber;
61 nsString mExpiryMonth;
62 nsString mExpiryYear;
63 nsString mCardSecurityCode;
64 nsCOMPtr<nsIPaymentAddress> mBillingAddress;
67 class PaymentActionResponse : public nsIPaymentActionResponse {
68 public:
69 NS_DECL_ISUPPORTS
70 NS_DECL_NSIPAYMENTACTIONRESPONSE
72 PaymentActionResponse();
74 protected:
75 virtual ~PaymentActionResponse() = default;
77 nsString mRequestId;
78 uint32_t mType;
81 class PaymentCanMakeActionResponse final
82 : public nsIPaymentCanMakeActionResponse,
83 public PaymentActionResponse {
84 public:
85 NS_DECL_ISUPPORTS_INHERITED
86 NS_FORWARD_NSIPAYMENTACTIONRESPONSE(PaymentActionResponse::)
87 NS_DECL_NSIPAYMENTCANMAKEACTIONRESPONSE
89 PaymentCanMakeActionResponse();
91 private:
92 ~PaymentCanMakeActionResponse() = default;
94 bool mResult;
97 class PaymentShowActionResponse final : public nsIPaymentShowActionResponse,
98 public PaymentActionResponse {
99 public:
100 NS_DECL_ISUPPORTS_INHERITED
101 NS_FORWARD_NSIPAYMENTACTIONRESPONSE(PaymentActionResponse::)
102 NS_DECL_NSIPAYMENTSHOWACTIONRESPONSE
104 PaymentShowActionResponse();
106 private:
107 ~PaymentShowActionResponse() = default;
109 uint32_t mAcceptStatus;
110 nsString mMethodName;
111 nsCOMPtr<nsIPaymentResponseData> mData;
112 nsString mPayerName;
113 nsString mPayerEmail;
114 nsString mPayerPhone;
117 class PaymentAbortActionResponse final : public nsIPaymentAbortActionResponse,
118 public PaymentActionResponse {
119 public:
120 NS_DECL_ISUPPORTS_INHERITED
121 NS_FORWARD_NSIPAYMENTACTIONRESPONSE(PaymentActionResponse::)
122 NS_DECL_NSIPAYMENTABORTACTIONRESPONSE
124 PaymentAbortActionResponse();
126 private:
127 ~PaymentAbortActionResponse() = default;
129 uint32_t mAbortStatus;
132 class PaymentCompleteActionResponse final
133 : public nsIPaymentCompleteActionResponse,
134 public PaymentActionResponse {
135 public:
136 NS_DECL_ISUPPORTS_INHERITED
137 NS_FORWARD_NSIPAYMENTACTIONRESPONSE(PaymentActionResponse::)
138 NS_DECL_NSIPAYMENTCOMPLETEACTIONRESPONSE
140 PaymentCompleteActionResponse();
142 private:
143 ~PaymentCompleteActionResponse() = default;
145 uint32_t mCompleteStatus;
148 class MethodChangeDetails : public nsIMethodChangeDetails {
149 public:
150 NS_DECL_ISUPPORTS
151 NS_DECL_NSIMETHODCHANGEDETAILS
153 MethodChangeDetails() = default;
155 protected:
156 virtual ~MethodChangeDetails() = default;
158 uint32_t mType;
161 class GeneralMethodChangeDetails final : public MethodChangeDetails,
162 public nsIGeneralChangeDetails {
163 public:
164 NS_DECL_ISUPPORTS_INHERITED
165 NS_FORWARD_NSIMETHODCHANGEDETAILS(MethodChangeDetails::)
166 NS_DECL_NSIGENERALCHANGEDETAILS
168 GeneralMethodChangeDetails();
170 private:
171 ~GeneralMethodChangeDetails() = default;
173 nsString mDetails;
176 class BasicCardMethodChangeDetails final : public MethodChangeDetails,
177 public nsIBasicCardChangeDetails {
178 public:
179 NS_DECL_ISUPPORTS_INHERITED
180 NS_FORWARD_NSIMETHODCHANGEDETAILS(MethodChangeDetails::)
181 NS_DECL_NSIBASICCARDCHANGEDETAILS
183 BasicCardMethodChangeDetails();
185 private:
186 ~BasicCardMethodChangeDetails() = default;
188 nsCOMPtr<nsIPaymentAddress> mBillingAddress;
191 } // namespace dom
192 } // end of namespace mozilla
194 #endif