|
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 |
|
19 #ifndef C_NCDLOADNODEOPERATIONPROXY_H |
|
20 #define C_NCDLOADNODEOPERATIONPROXY_H |
|
21 |
|
22 #include <e32base.h> |
|
23 |
|
24 #include "catalogsbaseimpl.h" |
|
25 #include "ncdbaseoperationproxy.h" |
|
26 #include "ncdsearchoperation.h" |
|
27 #include "ncdoperationimpl.h" |
|
28 #include "ncdconfigurationdata.h" |
|
29 |
|
30 class CDesC16ArrayFlat; |
|
31 class CNcdNodeIdentifier; |
|
32 class CNcdNodeProxy; |
|
33 class CNcdNodeManagerProxy; |
|
34 |
|
35 /** |
|
36 * Load node operation proxy. |
|
37 * |
|
38 * Client side implementation for load node operation. |
|
39 * |
|
40 * @lib ?library |
|
41 * @since S60 ?S60_version *** for example, S60 v3.0 |
|
42 */ |
|
43 class CNcdLoadNodeOperationProxy : |
|
44 public CNcdOperation< MNcdSearchOperation >, |
|
45 public MNcdConfigurationData |
|
46 { |
|
47 |
|
48 public: |
|
49 |
|
50 /** |
|
51 * Constructor |
|
52 * |
|
53 * @param aSession is the session that is used between |
|
54 * the proxy and the server. |
|
55 * @param aHandle is the handle that identifies the serverside |
|
56 * object that this proxy uses. |
|
57 * @param aRemoveHandler An observer that is called during destruction. |
|
58 * @param aNode The node this operation was started from. |
|
59 * @param aLocalizer The client localizer. |
|
60 */ |
|
61 static CNcdLoadNodeOperationProxy* NewL( MCatalogsClientServer& aSession, |
|
62 TInt aHandle, |
|
63 MNcdOperationProxyRemoveHandler* aRemoveHandler, |
|
64 CNcdNodeProxy* aNode, |
|
65 CNcdNodeManagerProxy* aNodeManager, |
|
66 TBool aSearch, |
|
67 MNcdClientLocalizer* aLocalizer ); |
|
68 /** |
|
69 * Constructor |
|
70 * |
|
71 * @param aSession is the session that is used between |
|
72 * the proxy and the server. |
|
73 * @param aHandle is the handle that identifies the serverside |
|
74 * object that this proxy uses. |
|
75 * @param aRemoveHandler An observer that is called during destruction. |
|
76 * @param aNode The node this operation was started from. |
|
77 * @param aLocalizer The client localizer. |
|
78 */ |
|
79 static CNcdLoadNodeOperationProxy* NewLC( MCatalogsClientServer& aSession, |
|
80 TInt aHandle, |
|
81 MNcdOperationProxyRemoveHandler* aRemoveHandler, |
|
82 CNcdNodeProxy* aNode, |
|
83 CNcdNodeManagerProxy* aNodeManager, |
|
84 TBool aSearch, |
|
85 MNcdClientLocalizer* aLocalizer ); |
|
86 |
|
87 /** |
|
88 * Adds an observer. |
|
89 */ |
|
90 virtual void AddObserverL( MNcdLoadNodeOperationObserver* aObserver ); |
|
91 |
|
92 /** |
|
93 * Removes an observer. |
|
94 */ |
|
95 virtual TInt RemoveObserver( MNcdLoadNodeOperationObserver* aObserver ); |
|
96 |
|
97 public: // from MNcdConfigurationData |
|
98 |
|
99 /** |
|
100 * @see MNcdConfigurationData |
|
101 */ |
|
102 virtual HBufC8* ProtocolResponseDataL(); |
|
103 |
|
104 |
|
105 public: // from MNcdOperation |
|
106 |
|
107 /** |
|
108 * @see MNcdOperation::OperationType |
|
109 */ |
|
110 TNcdInterfaceId OperationType() const; |
|
111 |
|
112 public: // from MNcdSearchOperation |
|
113 |
|
114 /** |
|
115 * @see MNcdSearchOperation::SearchRootNodeL |
|
116 */ |
|
117 MNcdNodeContainer* SearchRootNodeL(); |
|
118 |
|
119 public: // from MNcdOperation |
|
120 |
|
121 |
|
122 |
|
123 public: // from CCatalogsBase |
|
124 const TAny* QueryInterfaceL( TInt aInterfaceId ) const; |
|
125 |
|
126 protected: |
|
127 |
|
128 /** |
|
129 * Constructor |
|
130 * |
|
131 */ |
|
132 CNcdLoadNodeOperationProxy( TBool aSearch, MNcdClientLocalizer* aLocalizer ); |
|
133 |
|
134 virtual ~CNcdLoadNodeOperationProxy(); |
|
135 |
|
136 |
|
137 /** |
|
138 * ConstructL |
|
139 * |
|
140 * @param aSession is the session that is used between |
|
141 * the proxy and the server. |
|
142 * @param aHandle is the handle that identifies the serverside |
|
143 * object that this proxy uses. |
|
144 * @param aRemoveHandler An observer that is called during destruction. |
|
145 * @param aNode The node this operation was started from. |
|
146 */ |
|
147 void ConstructL( MCatalogsClientServer& aSession, |
|
148 TInt aHandle, |
|
149 MNcdOperationProxyRemoveHandler* aRemoveHandler, |
|
150 CNcdNodeProxy* aNode, |
|
151 CNcdNodeManagerProxy* aNodeManager ); |
|
152 |
|
153 protected: // from CNcdBaseOperationProxy |
|
154 |
|
155 /** |
|
156 * @see CNcdBaseOperationProxy::HandleCompletedMessage |
|
157 */ |
|
158 virtual void HandleCompletedMessage( |
|
159 TNcdOperationMessageCompletionId aCompletionId, |
|
160 RReadStream& aReadStream, |
|
161 TInt aDataLength ); |
|
162 |
|
163 /** |
|
164 * @see CNcdBaseOperationProxy::ProgressCallback |
|
165 */ |
|
166 virtual void ProgressCallback(); |
|
167 |
|
168 /** |
|
169 * @see CNcdBaseOperationProxy::QueryReceivedCallback |
|
170 */ |
|
171 virtual void QueryReceivedCallback( CNcdQuery* aQuery ); |
|
172 |
|
173 /** |
|
174 * @see CNcdBaseOperationProxy::CompleteCallback |
|
175 */ |
|
176 virtual void CompleteCallback( TInt aError ); |
|
177 |
|
178 |
|
179 private: // data |
|
180 |
|
181 /** |
|
182 * Operation observers, for callbacks. |
|
183 * Observers not own. |
|
184 */ |
|
185 RPointerArray<MNcdLoadNodeOperationObserver> iObservers; |
|
186 |
|
187 /** |
|
188 * Recently loaded nodes's ids are temporarily stored here. |
|
189 */ |
|
190 RPointerArray<CNcdNodeIdentifier> iLoadedNodes; |
|
191 |
|
192 CNcdNodeManagerProxy* iNodeManager; |
|
193 |
|
194 /** |
|
195 * Flag that indicates whether an op is a plain load or search. |
|
196 */ |
|
197 TBool iSearch; |
|
198 |
|
199 |
|
200 }; |
|
201 |
|
202 #endif // C_NCDLOADNODEOPERATIONPROXY_H |