|
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: CNcdEntityRefParser implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "ncd_pp_subscriptionimpl.h" |
|
20 #include "ncd_pp_subscriptiondetails.h" |
|
21 #include "ncd_pp_purchase.h" |
|
22 #include "ncd_cp_query.h" |
|
23 #include "ncdprotocolutils.h" |
|
24 #include "ncdprotocoltypes.h" |
|
25 |
|
26 CNcdPreminetProtocolSubscriptionImpl* |
|
27 CNcdPreminetProtocolSubscriptionImpl::NewL() |
|
28 { |
|
29 CNcdPreminetProtocolSubscriptionImpl* self = |
|
30 new (ELeave) CNcdPreminetProtocolSubscriptionImpl; |
|
31 CleanupStack::PushL( self ); |
|
32 self->ConstructL(); |
|
33 CleanupStack::Pop( self ); |
|
34 return self; |
|
35 } |
|
36 |
|
37 CNcdPreminetProtocolSubscriptionImpl* |
|
38 CNcdPreminetProtocolSubscriptionImpl::NewLC() |
|
39 { |
|
40 CNcdPreminetProtocolSubscriptionImpl* self = |
|
41 new (ELeave) CNcdPreminetProtocolSubscriptionImpl; |
|
42 CleanupStack::PushL( self ); |
|
43 self->ConstructL(); |
|
44 return self; |
|
45 } |
|
46 |
|
47 void CNcdPreminetProtocolSubscriptionImpl::ConstructL() |
|
48 { |
|
49 NcdProtocolUtils::AssignEmptyDesL( iNamespace ); |
|
50 NcdProtocolUtils::AssignEmptyDesL( iEntityId ); |
|
51 NcdProtocolUtils::AssignEmptyDesL( iPurchaseOptionId ); |
|
52 NcdProtocolUtils::AssignEmptyDesL( iTimestamp ); |
|
53 NcdProtocolUtils::AssignEmptyDesL( iExpiredOn ); |
|
54 } |
|
55 |
|
56 CNcdPreminetProtocolSubscriptionImpl::CNcdPreminetProtocolSubscriptionImpl() |
|
57 : CBase(), iType(ENotSubscribable), iCancelled(EFalse) |
|
58 { |
|
59 } |
|
60 |
|
61 CNcdPreminetProtocolSubscriptionImpl::~CNcdPreminetProtocolSubscriptionImpl() |
|
62 { |
|
63 delete iNamespace; |
|
64 delete iEntityId; |
|
65 delete iPurchaseOptionId; |
|
66 delete iTimestamp; |
|
67 delete iExpiredOn; |
|
68 delete iTotalUsageRights; |
|
69 delete iRemainingUsageRights; |
|
70 } |
|
71 |
|
72 const TDesC& CNcdPreminetProtocolSubscriptionImpl::Namespace() const |
|
73 { |
|
74 DASSERT((iNamespace)); |
|
75 return *iNamespace; |
|
76 } |
|
77 |
|
78 const TDesC& CNcdPreminetProtocolSubscriptionImpl::EntityId() const |
|
79 { |
|
80 DASSERT((iEntityId)); |
|
81 return *iEntityId; |
|
82 } |
|
83 |
|
84 const TDesC& CNcdPreminetProtocolSubscriptionImpl::PurchaseOptionId() const |
|
85 { |
|
86 DASSERT((iPurchaseOptionId)); |
|
87 return *iPurchaseOptionId; |
|
88 } |
|
89 |
|
90 const TDesC& CNcdPreminetProtocolSubscriptionImpl::Timestamp() const |
|
91 { |
|
92 DASSERT((iTimestamp)); |
|
93 return *iTimestamp; |
|
94 } |
|
95 |
|
96 TNcdSubscriptionType CNcdPreminetProtocolSubscriptionImpl::Type() const |
|
97 { |
|
98 return iType; |
|
99 } |
|
100 |
|
101 TBool CNcdPreminetProtocolSubscriptionImpl::Cancelled() const |
|
102 { |
|
103 return iCancelled; |
|
104 } |
|
105 |
|
106 const MNcdPreminetProtocolSubscriptionDetails* |
|
107 CNcdPreminetProtocolSubscriptionImpl::TotalUsageRights() const |
|
108 { |
|
109 return iTotalUsageRights; |
|
110 } |
|
111 |
|
112 const MNcdPreminetProtocolSubscriptionDetails* |
|
113 CNcdPreminetProtocolSubscriptionImpl::RemainingUsageRights() const |
|
114 { |
|
115 return iRemainingUsageRights; |
|
116 } |
|
117 |
|
118 |
|
119 const TDesC& CNcdPreminetProtocolSubscriptionImpl::ExpiredOn() const |
|
120 { |
|
121 DASSERT((iExpiredOn)); |
|
122 return *iExpiredOn; |
|
123 } |
|
124 |
|
125 const MNcdPreminetProtocolSubscriptionDetails* |
|
126 CNcdPreminetProtocolSubscriptionImpl::UsageRights() const |
|
127 { |
|
128 return iTotalUsageRights; |
|
129 } |