|
1 /* |
|
2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef NCD_PP_PURCHASE_H |
|
19 #define NCD_PP_PURCHASE_H |
|
20 |
|
21 #include "ncdprotocoltypes.h" |
|
22 #include "ncdpaymentmethod.h" |
|
23 |
|
24 class MNcdPreminetProtocolDownload; |
|
25 class MNcdConfigurationProtocolQuery; |
|
26 class CNcdString; |
|
27 |
|
28 class MNcdPreminetProtocolSmsDetails |
|
29 { |
|
30 public: |
|
31 |
|
32 /** |
|
33 * Destructor |
|
34 */ |
|
35 virtual ~MNcdPreminetProtocolSmsDetails() {} |
|
36 |
|
37 /** |
|
38 * Get SMS destination address |
|
39 * @return Address string (usually the phone number) |
|
40 */ |
|
41 virtual const TDesC& Address() const = 0; |
|
42 |
|
43 /** |
|
44 * Get SMS message |
|
45 * @return Message string |
|
46 */ |
|
47 virtual const TDesC& Message() const = 0; |
|
48 |
|
49 /** |
|
50 * Clones the object. |
|
51 * @return The new object. |
|
52 */ |
|
53 virtual MNcdPreminetProtocolSmsDetails* CloneL() const = 0; |
|
54 }; |
|
55 |
|
56 |
|
57 class MNcdPreminetProtocolPayment |
|
58 { |
|
59 public: |
|
60 |
|
61 /** |
|
62 * Destructor |
|
63 */ |
|
64 virtual ~MNcdPreminetProtocolPayment() {} |
|
65 |
|
66 /** |
|
67 * Payment method |
|
68 * @return Method type |
|
69 * @see MNcdPaymentMethod::TNcdPaymentMethodType |
|
70 */ |
|
71 virtual MNcdPaymentMethod::TNcdPaymentMethodType Method() const = 0; |
|
72 |
|
73 /** |
|
74 * Payment query ID |
|
75 * @return Query ID or KNullDesC |
|
76 */ |
|
77 virtual const TDesC& QueryId() const = 0; |
|
78 |
|
79 /** |
|
80 * Payment name |
|
81 * @return Name |
|
82 */ |
|
83 virtual const CNcdString& Name() const = 0; |
|
84 |
|
85 /** |
|
86 * SMS Details of payment |
|
87 * @param aIndex Index of SMS details element. Leaves if index is out of bounds. |
|
88 * @return SMS details object reference |
|
89 */ |
|
90 virtual const MNcdPreminetProtocolSmsDetails& |
|
91 SmsDetailsL(TInt aIndex) const = 0; |
|
92 |
|
93 /** |
|
94 * Amount of SMS details |
|
95 * @return SMS details count |
|
96 */ |
|
97 virtual TInt SmsDetailsCount() const = 0; |
|
98 |
|
99 /** |
|
100 * Clones the object. |
|
101 * @return The new object. |
|
102 */ |
|
103 virtual MNcdPreminetProtocolPayment* CloneL() const = 0; |
|
104 }; |
|
105 |
|
106 |
|
107 class MNcdPreminetProtocolPurchaseEntity |
|
108 { |
|
109 public: |
|
110 |
|
111 /** |
|
112 * Destructor |
|
113 */ |
|
114 virtual ~MNcdPreminetProtocolPurchaseEntity() {} |
|
115 |
|
116 /** |
|
117 * Ticket for purchase |
|
118 * @return Ticket ID or KNullDesC |
|
119 */ |
|
120 virtual const TDesC& Ticket() const = 0; |
|
121 |
|
122 /** |
|
123 * Purchase entity ID |
|
124 * @return ID or KNullDesC |
|
125 */ |
|
126 virtual const TDesC& Id() const = 0; |
|
127 |
|
128 /** |
|
129 * Purchase delivery methods |
|
130 * @return Array of available methods |
|
131 */ |
|
132 virtual const RArray<TNcdDeliveryMethod>& |
|
133 DeliveryMethods() const = 0; |
|
134 |
|
135 /** |
|
136 * Purchase download details |
|
137 * @param aIndex Index of downloads. Leaves if index is out of bounds. |
|
138 * @return Download object reference. |
|
139 * @see DownloadDetailsCount() |
|
140 */ |
|
141 virtual const MNcdPreminetProtocolDownload& |
|
142 DownloadDetailsL(TInt aIndex) const = 0; |
|
143 |
|
144 /** |
|
145 * Purchase download details count |
|
146 * @return Amount of download details |
|
147 */ |
|
148 virtual TInt DownloadDetailsCount() const = 0; |
|
149 |
|
150 /** |
|
151 * Price of purchase entity |
|
152 * @return Price string or KNullDesC |
|
153 */ |
|
154 virtual const TDesC& Price() const = 0; |
|
155 |
|
156 /** |
|
157 * Price currency string |
|
158 * @return Currency string or KNullDesC |
|
159 */ |
|
160 virtual const TDesC& PriceCurrency() const = 0; |
|
161 |
|
162 /** |
|
163 * Price and currency as one string |
|
164 * @return Price text or KNullDesC |
|
165 */ |
|
166 virtual const TDesC& PriceText() const = 0; |
|
167 }; |
|
168 |
|
169 |
|
170 class MNcdPreminetProtocolPurchaseInformation |
|
171 { |
|
172 public: |
|
173 |
|
174 /** |
|
175 * Destructor |
|
176 */ |
|
177 virtual ~MNcdPreminetProtocolPurchaseInformation() {} |
|
178 |
|
179 /** |
|
180 * Purchase information URI |
|
181 * @return URI or KNullDesC |
|
182 */ |
|
183 virtual const TDesC& Uri() const = 0; |
|
184 |
|
185 /** |
|
186 * Purchase information namespace |
|
187 * @return Namespace or KNullDesC |
|
188 */ |
|
189 virtual const TDesC& Namespace() const = 0; |
|
190 |
|
191 /** |
|
192 * Does this purchase initiate a new session |
|
193 * @return True of false |
|
194 */ |
|
195 virtual TBool InitiateSession() const = 0; |
|
196 |
|
197 /** |
|
198 * Get payment object for this purchase. |
|
199 * @param aIndex Index of purchase. Leaves if index is out of bounds. |
|
200 * @return Payment object reference |
|
201 * @see PaymentCount() |
|
202 */ |
|
203 virtual const MNcdPreminetProtocolPayment& |
|
204 PaymentL(TInt aIndex) const = 0; |
|
205 |
|
206 /** |
|
207 * Amount of available payments for this purchase. |
|
208 * @return Amount of payments |
|
209 */ |
|
210 virtual TInt PaymentCount() const = 0; |
|
211 |
|
212 /** |
|
213 * Get purchase disclaimer. Ownership is NOT transferred. |
|
214 * @return Disclaimer object pointer or NULL. |
|
215 */ |
|
216 virtual const MNcdConfigurationProtocolQuery* |
|
217 Disclaimer() const = 0; |
|
218 |
|
219 /** |
|
220 * Total price of purchase. |
|
221 * @return Price or KNullDesC |
|
222 */ |
|
223 virtual const TDesC& TotalPrice() const = 0; |
|
224 |
|
225 /** |
|
226 * Currency of total price. |
|
227 * @return Currency string or KNullDesC |
|
228 */ |
|
229 virtual const TDesC& TotalPriceCurrency() const = 0; |
|
230 |
|
231 |
|
232 /** |
|
233 * Get specific entity of this purchase. |
|
234 * NOTE: Currently only one entity per purchase is supported. |
|
235 * |
|
236 * @param aIndex Index of entity. Leaves if index is out of bounds. |
|
237 * @return Purchase entity. |
|
238 * @see EntityCount() |
|
239 */ |
|
240 virtual const MNcdPreminetProtocolPurchaseEntity& |
|
241 EntityL(TInt aIndex) const = 0; |
|
242 |
|
243 /** |
|
244 * Amount of entities in this purchase |
|
245 * @return Entity count. |
|
246 */ |
|
247 virtual TInt EntityCount() const = 0; |
|
248 |
|
249 /** |
|
250 * Purchase transaction ID |
|
251 * @return ID or KNullDesC |
|
252 */ |
|
253 virtual const TDesC& TransactionId() const = 0; |
|
254 |
|
255 /** |
|
256 * Purchase query ID |
|
257 * @return ID or KNullDesC |
|
258 */ |
|
259 virtual const TDesC& QueryId() const = 0; |
|
260 }; |
|
261 |
|
262 |
|
263 class MNcdPreminetProtocolPurchaseProcessed |
|
264 { |
|
265 public: |
|
266 |
|
267 /** |
|
268 * Destructor |
|
269 */ |
|
270 virtual ~MNcdPreminetProtocolPurchaseProcessed() {} |
|
271 |
|
272 /** |
|
273 * Purchase result code |
|
274 * @return Result code |
|
275 */ |
|
276 virtual TInt ResultCode() const = 0; |
|
277 |
|
278 /** |
|
279 * Information of processed purchase. |
|
280 * Ownership is NOT transferred. |
|
281 * @return Information object pointer or NULL if not available. |
|
282 */ |
|
283 virtual const MNcdConfigurationProtocolQuery* |
|
284 Information() const = 0; |
|
285 |
|
286 /** |
|
287 * Get specific entity of this purchase. |
|
288 * NOTE: Currently only one entity per purchase is supported. |
|
289 * |
|
290 * @param aIndex Index of entity. Leaves if index is out of bounds. |
|
291 * @return Purchase entity. |
|
292 * @see EntityCount() |
|
293 */ |
|
294 virtual const MNcdPreminetProtocolPurchaseEntity& |
|
295 EntityL(TInt aIndex) const = 0; |
|
296 |
|
297 /** |
|
298 * Amount of entities in this purchase |
|
299 * @return Entity count. |
|
300 */ |
|
301 virtual TInt EntityCount() const = 0; |
|
302 |
|
303 /** |
|
304 * Purchase transaction ID |
|
305 * @return ID or KNullDesC |
|
306 */ |
|
307 virtual const TDesC& TransactionId() const = 0; |
|
308 |
|
309 /** |
|
310 * Purchase query ID |
|
311 * @return ID or KNullDesC |
|
312 */ |
|
313 virtual const TDesC& QueryId() const = 0; |
|
314 }; |
|
315 |
|
316 |
|
317 class MNcdPreminetProtocolPurchase |
|
318 { |
|
319 public: |
|
320 |
|
321 /** |
|
322 * Destructor |
|
323 */ |
|
324 virtual ~MNcdPreminetProtocolPurchase() {} |
|
325 |
|
326 }; |
|
327 |
|
328 #endif //NCD_PP_PURCHASE_H |