|
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: ?Description |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_NCDSUBSCRIPTIONOPERATIONPROXY_H |
|
20 #define C_NCDSUBSCRIPTIONOPERATIONPROXY_H |
|
21 |
|
22 #include "ncdbaseoperationproxy.h" |
|
23 #include "ncdoperationimpl.h" |
|
24 #include "ncdsubscriptionoperation.h" |
|
25 #include "ncdoperationdatatypes.h" |
|
26 |
|
27 class MNcdSubscriptionOperationObserver; |
|
28 class CNcdSubscriptionManagerProxy; |
|
29 |
|
30 class CNcdSubscriptionOperationProxy : |
|
31 public CNcdOperation< MNcdSubscriptionOperation > |
|
32 { |
|
33 public: |
|
34 |
|
35 /** |
|
36 * Constructor. |
|
37 * |
|
38 * @param aSession is the session that is used between the proxy and the |
|
39 * server. |
|
40 * @param aSubscriptionType Subscription type. |
|
41 * @param aHandle is the handle that identifies the serverside object that |
|
42 * this proxy uses. |
|
43 * @param aRemoveHandler An observer that is called during destruction. |
|
44 * @param aNode The node this operation was started from. |
|
45 * @param aObserver Subscription operation observer. |
|
46 * @param aPurchaseOptionId ID of the purchase option used to purchase the |
|
47 * subscription. |
|
48 * @param aClientLocalizer The client localizer. |
|
49 */ |
|
50 static CNcdSubscriptionOperationProxy* NewL( |
|
51 MCatalogsClientServer& aSession, |
|
52 MNcdSubscriptionOperation::TType aSubscriptionType, |
|
53 TInt aHandle, |
|
54 MNcdOperationProxyRemoveHandler* aRemoveHandler, |
|
55 MNcdSubscriptionOperationObserver& aObserver, |
|
56 CNcdSubscriptionManagerProxy* aSubscriptionManager, |
|
57 CNcdNodeManagerProxy* aNodeManager, |
|
58 MNcdClientLocalizer* aClientLocalizer ); |
|
59 |
|
60 /** |
|
61 * Constructor. |
|
62 * |
|
63 * @param aSession is the session that is used between the proxy and the |
|
64 * server. |
|
65 * @param aSubscriptionType Subscription type. |
|
66 * @param aHandle is the handle that identifies the serverside object that |
|
67 * this proxy uses. |
|
68 * @param aRemoveHandler An observer that is called during destruction. |
|
69 * @param aNode The node this operation was started from. |
|
70 * @param aObserver Subscription operation observer. |
|
71 * @param aPurchaseOptionId ID of the purchase option used to purchase the |
|
72 * subscription. |
|
73 * @param aClientLocalizer The client localizer. |
|
74 */ |
|
75 static CNcdSubscriptionOperationProxy* NewLC( |
|
76 MCatalogsClientServer& aSession, |
|
77 MNcdSubscriptionOperation::TType aSubscriptionType, |
|
78 TInt aHandle, |
|
79 MNcdOperationProxyRemoveHandler* aRemoveHandler, |
|
80 MNcdSubscriptionOperationObserver& aObserver, |
|
81 CNcdSubscriptionManagerProxy* aSubscriptionManager, |
|
82 CNcdNodeManagerProxy* aNodeManager, |
|
83 MNcdClientLocalizer* aClientLocalizer ); |
|
84 |
|
85 |
|
86 public: // From MNcdSubscriptionOperation |
|
87 |
|
88 /** |
|
89 * @see MNcdSubscriptionOperation::SubscriptionOperationType |
|
90 */ |
|
91 MNcdSubscriptionOperation::TType SubscriptionOperationType() const; |
|
92 |
|
93 |
|
94 public: // From MNcdOperation |
|
95 |
|
96 /** |
|
97 * @see MNcdOperation::OperationType |
|
98 */ |
|
99 TNcdInterfaceId OperationType() const; |
|
100 |
|
101 |
|
102 protected: // Constructor and destructor |
|
103 |
|
104 /** |
|
105 * Constructor. |
|
106 * |
|
107 * @param aSubscriptionType Subscription type. |
|
108 */ |
|
109 CNcdSubscriptionOperationProxy( |
|
110 MNcdSubscriptionOperationObserver& aObserver, |
|
111 MNcdClientLocalizer* aClientLocalizer ); |
|
112 |
|
113 virtual ~CNcdSubscriptionOperationProxy(); |
|
114 |
|
115 |
|
116 /** |
|
117 * ConstructL. |
|
118 * |
|
119 * @param aSession is the session that is used between the proxy and the |
|
120 * server. |
|
121 * @param aSubscriptionType Subscription type. |
|
122 * @param aHandle is the handle that identifies the serverside object that |
|
123 * this proxy uses. |
|
124 * @param aRemoveHandler An observer that is called during destruction. |
|
125 * @param aObserver Subscription operation observer. |
|
126 * @param aPurchaseOptionId ID of the purchase option used to purchase the |
|
127 * subscription. |
|
128 */ |
|
129 void ConstructL( |
|
130 MCatalogsClientServer& aSession, |
|
131 MNcdSubscriptionOperation::TType aSubscriptionType, |
|
132 TInt aHandle, |
|
133 MNcdOperationProxyRemoveHandler* aRemoveHandler, |
|
134 CNcdSubscriptionManagerProxy* aSubscriptionManager, |
|
135 CNcdNodeManagerProxy* aNodeManager ); |
|
136 |
|
137 |
|
138 |
|
139 protected: // From CNcdBaseOperationProxy |
|
140 |
|
141 |
|
142 /** |
|
143 * @see CNcdBaseOperationProxy::ProgressCallback |
|
144 */ |
|
145 void ProgressCallback(); |
|
146 |
|
147 |
|
148 /** |
|
149 * @see CNcdBaseOperationProxy::QueryReceivedCallback |
|
150 */ |
|
151 void QueryReceivedCallback( CNcdQuery* aQuery ); |
|
152 |
|
153 |
|
154 /** |
|
155 * @see CNcdBaseOperationProxy::CompleteCallback |
|
156 */ |
|
157 void CompleteCallback( TInt aError ); |
|
158 |
|
159 |
|
160 private: // data |
|
161 |
|
162 /** |
|
163 * Operation observer, for callbacks. |
|
164 * Observer not own. |
|
165 */ |
|
166 MNcdSubscriptionOperationObserver& iObserver; |
|
167 |
|
168 /** |
|
169 * Subscription type. |
|
170 */ |
|
171 MNcdSubscriptionOperation::TType iSubscriptionOperationType; |
|
172 |
|
173 /** |
|
174 * Subscription manager. Not own. |
|
175 */ |
|
176 CNcdSubscriptionManagerProxy* iSubscriptionManager; |
|
177 |
|
178 }; |
|
179 |
|
180 #endif // C_NCDSUBSCRIPTIONOPERATIONPROXY_H |