Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/dom/payments/PaymentActionResponse.h
Line
Count
Source (jump to first uncovered line)
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_PaymentActionResponse_h
8
#define mozilla_dom_PaymentActionResponse_h
9
10
#include "nsIPaymentActionResponse.h"
11
12
namespace mozilla {
13
namespace dom {
14
15
class PaymentRequestParent;
16
17
class PaymentResponseData : public nsIPaymentResponseData
18
{
19
public:
20
  NS_DECL_ISUPPORTS
21
  NS_DECL_NSIPAYMENTRESPONSEDATA
22
23
0
  PaymentResponseData() = default;
24
25
protected:
26
0
  virtual ~PaymentResponseData() = default;
27
28
  uint32_t mType;
29
};
30
31
class GeneralResponseData final : public PaymentResponseData
32
                                , public nsIGeneralResponseData
33
{
34
public:
35
  NS_DECL_ISUPPORTS_INHERITED
36
  NS_FORWARD_NSIPAYMENTRESPONSEDATA(PaymentResponseData::)
37
  NS_DECL_NSIGENERALRESPONSEDATA
38
39
  GeneralResponseData();
40
41
private:
42
0
  ~GeneralResponseData() = default;
43
44
  nsString mData;
45
};
46
47
class BasicCardResponseData final : public nsIBasicCardResponseData
48
                                  , public PaymentResponseData
49
{
50
public:
51
  NS_DECL_ISUPPORTS_INHERITED
52
  NS_FORWARD_NSIPAYMENTRESPONSEDATA(PaymentResponseData::)
53
  NS_DECL_NSIBASICCARDRESPONSEDATA
54
55
  BasicCardResponseData();
56
57
private:
58
0
  ~BasicCardResponseData() = default;
59
60
  nsString mData;
61
  nsCOMPtr<nsIPaymentAddress> mBillingAddress;
62
};
63
64
class PaymentActionResponse : public nsIPaymentActionResponse
65
{
66
public:
67
  NS_DECL_ISUPPORTS
68
  NS_DECL_NSIPAYMENTACTIONRESPONSE
69
70
  PaymentActionResponse();
71
72
protected:
73
0
  virtual ~PaymentActionResponse() = default;
74
75
  nsString mRequestId;
76
  uint32_t mType;
77
};
78
79
class PaymentCanMakeActionResponse final : public nsIPaymentCanMakeActionResponse
80
                                         , public PaymentActionResponse
81
{
82
public:
83
  NS_DECL_ISUPPORTS_INHERITED
84
  NS_FORWARD_NSIPAYMENTACTIONRESPONSE(PaymentActionResponse::)
85
  NS_DECL_NSIPAYMENTCANMAKEACTIONRESPONSE
86
87
  PaymentCanMakeActionResponse();
88
89
private:
90
0
  ~PaymentCanMakeActionResponse() = default;
91
92
  bool mResult;
93
};
94
95
class PaymentShowActionResponse final : public nsIPaymentShowActionResponse
96
                                      , public PaymentActionResponse
97
{
98
public:
99
  NS_DECL_ISUPPORTS_INHERITED
100
  NS_FORWARD_NSIPAYMENTACTIONRESPONSE(PaymentActionResponse::)
101
  NS_DECL_NSIPAYMENTSHOWACTIONRESPONSE
102
103
  PaymentShowActionResponse();
104
105
private:
106
0
  ~PaymentShowActionResponse() = default;
107
108
  uint32_t mAcceptStatus;
109
  nsString mMethodName;
110
  nsString mData;
111
  nsString mPayerName;
112
  nsString mPayerEmail;
113
  nsString mPayerPhone;
114
};
115
116
class PaymentAbortActionResponse final : public nsIPaymentAbortActionResponse
117
                                       , public PaymentActionResponse
118
{
119
public:
120
  NS_DECL_ISUPPORTS_INHERITED
121
  NS_FORWARD_NSIPAYMENTACTIONRESPONSE(PaymentActionResponse::)
122
  NS_DECL_NSIPAYMENTABORTACTIONRESPONSE
123
124
  PaymentAbortActionResponse();
125
126
private:
127
0
  ~PaymentAbortActionResponse() = default;
128
129
  uint32_t mAbortStatus;
130
};
131
132
class PaymentCompleteActionResponse final : public nsIPaymentCompleteActionResponse
133
                                          , public PaymentActionResponse
134
{
135
public:
136
  NS_DECL_ISUPPORTS_INHERITED
137
  NS_FORWARD_NSIPAYMENTACTIONRESPONSE(PaymentActionResponse::)
138
  NS_DECL_NSIPAYMENTCOMPLETEACTIONRESPONSE
139
140
  PaymentCompleteActionResponse();
141
142
private:
143
0
  ~PaymentCompleteActionResponse() = default;
144
145
  uint32_t mCompleteStatus;
146
};
147
148
} // end of dom
149
} // end of namespace mozilla
150
151
#endif