williamr@2
|
1 |
// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
2 |
// All rights reserved.
|
williamr@2
|
3 |
// This component and the accompanying materials are made available
|
williamr@2
|
4 |
// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
|
williamr@2
|
5 |
// which accompanies this distribution, and is available
|
williamr@2
|
6 |
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
|
williamr@2
|
7 |
//
|
williamr@2
|
8 |
// Initial Contributors:
|
williamr@2
|
9 |
// Nokia Corporation - initial contribution.
|
williamr@2
|
10 |
//
|
williamr@2
|
11 |
// Contributors:
|
williamr@2
|
12 |
//
|
williamr@2
|
13 |
// Description:
|
williamr@2
|
14 |
//
|
williamr@2
|
15 |
|
williamr@2
|
16 |
#ifndef __MTSR_H__
|
williamr@2
|
17 |
#define __MTSR_H__
|
williamr@2
|
18 |
|
williamr@2
|
19 |
#include <e32base.h>
|
williamr@2
|
20 |
#include <badesca.h>
|
williamr@2
|
21 |
#include <msvstd.h>
|
williamr@2
|
22 |
#include <msvreg.h>
|
williamr@2
|
23 |
#include <tnonoperationmtmdata.h>
|
williamr@2
|
24 |
|
williamr@2
|
25 |
// forward declarations
|
williamr@2
|
26 |
class RWriteStream;
|
williamr@2
|
27 |
class RReadStream;
|
williamr@2
|
28 |
class RFs;
|
williamr@2
|
29 |
class CDictionaryFileStore;
|
williamr@2
|
30 |
class CInstalledMtmGroup;
|
williamr@2
|
31 |
class CMsvServerEntry;
|
williamr@2
|
32 |
class TMsvSystemProgress;
|
williamr@2
|
33 |
|
williamr@2
|
34 |
class CBaseServerMtm : public CActive
|
williamr@2
|
35 |
/** Base class for Server-side MTM components. Server-side MTMs provide all message
|
williamr@2
|
36 |
transport functionality for a particular messaging protocol.
|
williamr@2
|
37 |
|
williamr@2
|
38 |
MTM implementers implement a derived class to provide such functionality for
|
williamr@2
|
39 |
their message protocol. Writers of message client applications are never concerned
|
williamr@2
|
40 |
with this class and its sub-classes, as these are only accessed by the Message
|
williamr@2
|
41 |
Server.
|
williamr@2
|
42 |
|
williamr@2
|
43 |
Each MTM interprets the generic commands in different ways. For example, a
|
williamr@2
|
44 |
Fax MTM would transmit a fax when asked to copy a fax from a local folder
|
williamr@2
|
45 |
to a fax service. For the same function, an IMAP MTM would create a copy of
|
williamr@2
|
46 |
the message on the remote server and update the message index to show the
|
williamr@2
|
47 |
copy of the message on the remote server. An important initial design task
|
williamr@2
|
48 |
is to the map the functions to the functionality provided by the protocol.
|
williamr@2
|
49 |
|
williamr@2
|
50 |
Server-side MTM functions are called by the Message Server as a result of
|
williamr@2
|
51 |
a client request that requires some remote operation with the MTM's protocol.
|
williamr@2
|
52 |
The following steps give a simplified view of the usual sequence of events:
|
williamr@2
|
53 |
|
williamr@2
|
54 |
1. the Message Server instantiates a Server-side MTM object through the factory
|
williamr@2
|
55 |
function
|
williamr@2
|
56 |
|
williamr@2
|
57 |
2. the Message Server calls the appropriate asynchronous function on the Server-side
|
williamr@2
|
58 |
MTM interface, passing a TRequestStatus argument
|
williamr@2
|
59 |
|
williamr@2
|
60 |
3. the Server-side MTM function typically starts whatever asynchronous communications
|
williamr@2
|
61 |
it requires and returns
|
williamr@2
|
62 |
|
williamr@2
|
63 |
4. the Server-side MTM is signalled when the asynchronous communications complete,
|
williamr@2
|
64 |
and handles the result
|
williamr@2
|
65 |
|
williamr@2
|
66 |
5. the Server-side MTM signals the Message Server, through the TRequestStatus
|
williamr@2
|
67 |
passed earlier
|
williamr@2
|
68 |
|
williamr@2
|
69 |
6. the Message Server deletes the Server-side MTM object
|
williamr@2
|
70 |
|
williamr@2
|
71 |
To qualify this somewhat:
|
williamr@2
|
72 |
|
williamr@2
|
73 |
1. it is up to the Server-side MTM implementation to decide how to translate
|
williamr@2
|
74 |
data back and forth between the formats used by Message Server (index entry,
|
williamr@2
|
75 |
message store, binary files), and that required by the protocol; this is another
|
williamr@2
|
76 |
important design task
|
williamr@2
|
77 |
|
williamr@2
|
78 |
2. depending on the protocol being used, the communications sequence can be of
|
williamr@2
|
79 |
considerable complexity; typically it requires division into a number of asynchronous
|
williamr@2
|
80 |
steps
|
williamr@2
|
81 |
|
williamr@2
|
82 |
3. for greater efficiency where further commands are shortly expected, deletion
|
williamr@2
|
83 |
of the Server-side MTM object can be prevented
|
williamr@2
|
84 |
|
williamr@2
|
85 |
For asynchronous requests, a Server-side MTM should always complete the TRequestStatus
|
williamr@2
|
86 |
with KErrNone. Any errors should be returned in the progress information.
|
williamr@2
|
87 |
|
williamr@2
|
88 |
Note the following significant groups of functions:
|
williamr@2
|
89 |
|
williamr@2
|
90 |
1. Copy and move from remote functions: CopyToLocalL() and MoveToLocalL() are
|
williamr@2
|
91 |
called by the Message Server to get a selection of entries from a remote location.
|
williamr@2
|
92 |
For many protocols, this should be interpreted as message retrieval. For protocols
|
williamr@2
|
93 |
where messages exist on a remote server, this function is typically used to
|
williamr@2
|
94 |
download specific messages, after an initial connection has downloaded message
|
williamr@2
|
95 |
headers.
|
williamr@2
|
96 |
|
williamr@2
|
97 |
2. Copy and move to remote functions: CopyFromLocalL() and MoveFromLocalL() are
|
williamr@2
|
98 |
called by the Message Server to copy/move a selection of entries to a remote
|
williamr@2
|
99 |
location. For many protocols, this should be interpreted as message sending.
|
williamr@2
|
100 |
|
williamr@2
|
101 |
3. Copy and move within remote functions: CopyWithinServiceL() and MoveWithinServiceL()
|
williamr@2
|
102 |
are called by the Message Server to copy a selection of entries within a remote
|
williamr@2
|
103 |
service. An example of their use might be for a user rearranging messages
|
williamr@2
|
104 |
within remote folders.
|
williamr@2
|
105 |
@publishedAll
|
williamr@2
|
106 |
@released
|
williamr@2
|
107 |
*/
|
williamr@2
|
108 |
{
|
williamr@2
|
109 |
public:
|
williamr@2
|
110 |
IMPORT_C ~CBaseServerMtm();
|
williamr@2
|
111 |
//
|
williamr@2
|
112 |
/** Copies a selection of entries from a remote location to a local location. This
|
williamr@2
|
113 |
will only be meaningful for some protocols.
|
williamr@2
|
114 |
|
williamr@2
|
115 |
Requirements:
|
williamr@2
|
116 |
|
williamr@2
|
117 |
Implementations should provide this function if the messaging protocol supports
|
williamr@2
|
118 |
retrieval of remote entries. If this is not supported, implementations should
|
williamr@2
|
119 |
leave with KErrNotSupported.
|
williamr@2
|
120 |
|
williamr@2
|
121 |
Implementations of this function have three fundamental steps:
|
williamr@2
|
122 |
|
williamr@2
|
123 |
1. doing the transfer operation using the appropriate communications protocols
|
williamr@2
|
124 |
|
williamr@2
|
125 |
2. converting protocol-specific data into the three-part storage format (index
|
williamr@2
|
126 |
entry, message store, binary files) required by the Message Server
|
williamr@2
|
127 |
|
williamr@2
|
128 |
3. updating entries in the Message Server
|
williamr@2
|
129 |
|
williamr@2
|
130 |
@param aSelection The collection of message index entries for which the copy/moving
|
williamr@2
|
131 |
is required.
|
williamr@2
|
132 |
@param aDestination The entry ID to which the selection is to be copied
|
williamr@2
|
133 |
@param aStatus Asynchronous completion word for the operation
|
williamr@2
|
134 |
@leave KErrNotSupported The Server-side MTM does not support this operation
|
williamr@2
|
135 |
@leave Other leave codes Dependent on implementation */
|
williamr@2
|
136 |
virtual void CopyToLocalL(const CMsvEntrySelection& aSelection,TMsvId aDestination, TRequestStatus& aStatus)=0;
|
williamr@2
|
137 |
/** Copies a selection of entries from a local location to a remote location.
|
williamr@2
|
138 |
|
williamr@2
|
139 |
Requirements:
|
williamr@2
|
140 |
|
williamr@2
|
141 |
Implementations should provide this function if the messaging protocol supports
|
williamr@2
|
142 |
retrieval of remote entries. If this is not supported, implementations should
|
williamr@2
|
143 |
leave with KErrNotSupported.
|
williamr@2
|
144 |
|
williamr@2
|
145 |
Implementations of this function have three fundamental steps:
|
williamr@2
|
146 |
|
williamr@2
|
147 |
1. reading entry data
|
williamr@2
|
148 |
|
williamr@2
|
149 |
2. converting entry data from the Message Server format into that required by
|
williamr@2
|
150 |
the protocol
|
williamr@2
|
151 |
|
williamr@2
|
152 |
3. doing the transfer operation using the appropriate communications protocols
|
williamr@2
|
153 |
|
williamr@2
|
154 |
@param aSelection The collection of message index entries for which the copy
|
williamr@2
|
155 |
is required
|
williamr@2
|
156 |
@param aDestination The entry ID of the service by which the entries should
|
williamr@2
|
157 |
be transferred
|
williamr@2
|
158 |
@param aStatus Asynchronous completion word for the operation
|
williamr@2
|
159 |
@leave KErrNotSupported The Server-side MTM does not support this operation
|
williamr@2
|
160 |
@leave Other leave codes Dependent on implementation */
|
williamr@2
|
161 |
virtual void CopyFromLocalL(const CMsvEntrySelection& aSelection,TMsvId aDestination, TRequestStatus& aStatus)=0;
|
williamr@2
|
162 |
/** Copies a selection of entries within a remote location.
|
williamr@2
|
163 |
|
williamr@2
|
164 |
Requirements:
|
williamr@2
|
165 |
|
williamr@2
|
166 |
Implementations should provide this function if the messaging protocol supports
|
williamr@2
|
167 |
the ability to copy entries within a remote service. If this is not supported,
|
williamr@2
|
168 |
implementations should leave with KErrNotSupported.
|
williamr@2
|
169 |
|
williamr@2
|
170 |
@param aSelection The collection of message index entries for which the copy
|
williamr@2
|
171 |
is required
|
williamr@2
|
172 |
@param aDestination The server entry ID to which the selection is to be copied
|
williamr@2
|
173 |
@param aStatus Asynchronous completion word for the operation
|
williamr@2
|
174 |
@leave KErrNotSupported The Server-side MTM does not support this operation
|
williamr@2
|
175 |
@leave Other leave codes Dependent on implementation */
|
williamr@2
|
176 |
virtual void CopyWithinServiceL(const CMsvEntrySelection& aSelection,TMsvId aDestination, TRequestStatus& aStatus)=0;
|
williamr@2
|
177 |
/** Deletes each entry in the supplied selection when called by the message Server.
|
williamr@2
|
178 |
If any of the entries in the selection is a parent entry, then all its children
|
williamr@2
|
179 |
should also be deleted, recursively to the bottom of the ownership tree.
|
williamr@2
|
180 |
|
williamr@2
|
181 |
Implementations should provide this function if the messaging protocol supports
|
williamr@2
|
182 |
deletion of remote entries. If this is not supported, implementations should
|
williamr@2
|
183 |
leave with KErrNotSupported.
|
williamr@2
|
184 |
|
williamr@2
|
185 |
@param aSelection The collection of entries that are to be deleted.
|
williamr@2
|
186 |
@param aStatus Asynchronous completion object.
|
williamr@2
|
187 |
@leave KErrNotSupported The Server-side MTM does not support this operation
|
williamr@2
|
188 |
@leave Other leave codes Dependent on implementation */
|
williamr@2
|
189 |
virtual void DeleteAllL(const CMsvEntrySelection& aSelection, TRequestStatus& aStatus)=0;
|
williamr@2
|
190 |
/** Creates a new remote entry with relevant data when called by the Message Server.
|
williamr@2
|
191 |
|
williamr@2
|
192 |
Implementations should provide this function if the messaging protocol supports
|
williamr@2
|
193 |
creation of remote entries. If this is not supported, implementations should
|
williamr@2
|
194 |
leave with KErrNotSupported.
|
williamr@2
|
195 |
|
williamr@2
|
196 |
As with ChangeL(), the Server-side MTM implementation must decide what information
|
williamr@2
|
197 |
in the TMsvEntry is relevant to the remote entry, and translate it appropriately
|
williamr@2
|
198 |
for the specific protocol. Most of the data contained in the TMsvEntry is
|
williamr@2
|
199 |
specific to the Message Server, and would probably have no direct correlation
|
williamr@2
|
200 |
with the protocol's own storage format. For example, for a folder, probably
|
williamr@2
|
201 |
only the name and parent are needed, so if the protocol supports creation
|
williamr@2
|
202 |
of remote folders, the implementation could:
|
williamr@2
|
203 |
|
williamr@2
|
204 |
1. check for a folder type entry
|
williamr@2
|
205 |
|
williamr@2
|
206 |
2. get the folder name and parent details from aNewEntry
|
williamr@2
|
207 |
|
williamr@2
|
208 |
3. initiate a protocol-specific action to create the remote folder
|
williamr@2
|
209 |
|
williamr@2
|
210 |
@param aNewEntry Data by which to create entry
|
williamr@2
|
211 |
@param aStatus Asynchronous completion word for the operation.
|
williamr@2
|
212 |
@leave KErrNotSupported The Server-side MTM does not support this operation
|
williamr@2
|
213 |
@leave Other leave codes Dependent on implementation */
|
williamr@2
|
214 |
virtual void CreateL(TMsvEntry aNewEntry, TRequestStatus& aStatus)=0;
|
williamr@2
|
215 |
/** Updates a remote entry with relevant data when called by the Message Server.
|
williamr@2
|
216 |
|
williamr@2
|
217 |
Implementations should provide this function if the messaging protocol supports
|
williamr@2
|
218 |
updating of remote entries. If this is not supported, implementations should
|
williamr@2
|
219 |
leave with KErrNotSupported.
|
williamr@2
|
220 |
|
williamr@2
|
221 |
The Server-side MTM implementation must decide what information in the TMsvEntry
|
williamr@2
|
222 |
is relevant to the remote entry, and translate it appropriately for the specific
|
williamr@2
|
223 |
protocol. Most of the data contained in the TMsvEntry is specific to the Symbian
|
williamr@2
|
224 |
OS Message Server, and would probably have no direct correlation with the
|
williamr@2
|
225 |
protocol's own storage format. Some entry data may however be useful. For
|
williamr@2
|
226 |
example, if the protocol supports remote renaming of folders, the implementation
|
williamr@2
|
227 |
could:
|
williamr@2
|
228 |
|
williamr@2
|
229 |
1. check for a folder type entry
|
williamr@2
|
230 |
|
williamr@2
|
231 |
2. extract the folder name from aNewEntry.iDetails
|
williamr@2
|
232 |
|
williamr@2
|
233 |
3. check if the folder name has changed by comparing the new name with iDetails
|
williamr@2
|
234 |
in the index entry currently; if not, complete with KErrNone
|
williamr@2
|
235 |
|
williamr@2
|
236 |
4. initiate a protocol-specific action to rename the remote folder
|
williamr@2
|
237 |
|
williamr@2
|
238 |
The implementation should also always update the local Message Server index
|
williamr@2
|
239 |
through CMsvServerEntry::ChangeL().
|
williamr@2
|
240 |
|
williamr@2
|
241 |
@param aNewEntry Data by which to update entry
|
williamr@2
|
242 |
@param aStatus Asynchronous completion word for the operation.
|
williamr@2
|
243 |
@leave KErrNotSupported The Server-side MTM does not support this operation
|
williamr@2
|
244 |
@leave Other leave codes Dependent on implementation */
|
williamr@2
|
245 |
virtual void ChangeL(TMsvEntry aNewEntry, TRequestStatus& aStatus)=0;
|
williamr@2
|
246 |
//
|
williamr@2
|
247 |
/** Executes an MTM-specific operation on a selection of entries when called by
|
williamr@2
|
248 |
the Message Server.
|
williamr@2
|
249 |
|
williamr@2
|
250 |
The call is made as a response to a client program invoking an MTM-specific
|
williamr@2
|
251 |
operation through CBaseMtm::InvokeSyncFunctionL()/InvokeAsyncFunctionL().
|
williamr@2
|
252 |
The aSelection, aCommand, and aParameter arguments pass the values of the
|
williamr@2
|
253 |
original aSelection, aFunctionId, and aParameter respectively arguments from
|
williamr@2
|
254 |
such a call. The use (if any) of the aSelection and aParameter arguments by
|
williamr@2
|
255 |
the function depends on the command.
|
williamr@2
|
256 |
|
williamr@2
|
257 |
@param aSelection A selection of message entries on which the command is to
|
williamr@2
|
258 |
be executed
|
williamr@2
|
259 |
@param aCommand The MTM-specific command to be carried out
|
williamr@2
|
260 |
@param aParameter Command-specific parameters
|
williamr@2
|
261 |
@param aStatus Asynchronous completion word for the operation */
|
williamr@2
|
262 |
virtual void StartCommandL(CMsvEntrySelection& aSelection, TInt aCommand, const TDesC8& aParameter, TRequestStatus& aStatus)=0;
|
williamr@2
|
263 |
//
|
williamr@2
|
264 |
/** Tests if the Server-side MTM object should be deleted when called by the Message
|
williamr@2
|
265 |
Server
|
williamr@2
|
266 |
|
williamr@2
|
267 |
It is useful to stop the MTM being deleted when more commands are expected
|
williamr@2
|
268 |
shortly. This would be the case, for example, after receiving a command to
|
williamr@2
|
269 |
go online.
|
williamr@2
|
270 |
|
williamr@2
|
271 |
If there are no more commands expected by the Server-side MTM object, then
|
williamr@2
|
272 |
the function should return EFalse, and the Message Server will delete it.
|
williamr@2
|
273 |
|
williamr@2
|
274 |
@return ETrue: the MTM object should not be deleted EFalse: the MTM object
|
williamr@2
|
275 |
can be deleted */
|
williamr@2
|
276 |
virtual TBool CommandExpected()=0;
|
williamr@2
|
277 |
//
|
williamr@2
|
278 |
/** This function is called by the Message Server to get progress information for
|
williamr@2
|
279 |
the current asynchronous operation.
|
williamr@2
|
280 |
|
williamr@2
|
281 |
The call is made as a response to a client program requesting progress information
|
williamr@2
|
282 |
through CMsvOperation::ProgressL(). The packing format used in the TDesC8
|
williamr@2
|
283 |
is MTM-specific. Only the implementation of the User Interface MTM progress
|
williamr@2
|
284 |
information functions need to understand the format.
|
williamr@2
|
285 |
|
williamr@2
|
286 |
The progress buffer should have a maximum size of 256 bytes.
|
williamr@2
|
287 |
|
williamr@2
|
288 |
@return Progress information on current asynchronous operation
|
williamr@2
|
289 |
@see CBaseMtmUi::DisplayProgressSummary()
|
williamr@2
|
290 |
@see CBaseMtmUi::GetProgress() */
|
williamr@2
|
291 |
virtual const TDesC8& Progress()=0;
|
williamr@2
|
292 |
//
|
williamr@2
|
293 |
/** Moves a selection of entries from a remote location to a local location.
|
williamr@2
|
294 |
|
williamr@2
|
295 |
Requirements:
|
williamr@2
|
296 |
|
williamr@2
|
297 |
Implementations should provide this function if the messaging protocol supports
|
williamr@2
|
298 |
retrieval of remote entries. If this is not supported, implementations should
|
williamr@2
|
299 |
leave with KErrNotSupported.
|
williamr@2
|
300 |
|
williamr@2
|
301 |
Implementations of this function have three fundamental steps:
|
williamr@2
|
302 |
|
williamr@2
|
303 |
1. doing the transfer operation using the appropriate communications protocols
|
williamr@2
|
304 |
|
williamr@2
|
305 |
2. converting protocol-specific data into the three-part storage format (index
|
williamr@2
|
306 |
entry, message store, binary files) required by the Message Server
|
williamr@2
|
307 |
|
williamr@2
|
308 |
3. updating entries in the Message Server
|
williamr@2
|
309 |
|
williamr@2
|
310 |
MoveToLocalL() should differ from CopyToLocalL() in additionally deleting
|
williamr@2
|
311 |
the original remote data.
|
williamr@2
|
312 |
|
williamr@2
|
313 |
@param aSelection The collection of message index entries for which the moving
|
williamr@2
|
314 |
is required.
|
williamr@2
|
315 |
@param aDestination The entry ID to which the selection is to be copied/moved
|
williamr@2
|
316 |
@param aStatus Asynchronous completion word for the operation
|
williamr@2
|
317 |
@leave KErrNotSupported The Server-side MTM does not support this operation
|
williamr@2
|
318 |
@leave Other leave codes Dependent on implementation */
|
williamr@2
|
319 |
virtual void MoveToLocalL(const CMsvEntrySelection& aSelection,TMsvId aDestination, TRequestStatus& aStatus)=0;
|
williamr@2
|
320 |
/** Moves a selection of entries from a local location to a remote location.
|
williamr@2
|
321 |
|
williamr@2
|
322 |
Requirements:
|
williamr@2
|
323 |
|
williamr@2
|
324 |
Implementations should provide this function if the messaging protocol supports
|
williamr@2
|
325 |
retrieval of remote entries. If this is not supported, implementations should
|
williamr@2
|
326 |
leave with KErrNotSupported.
|
williamr@2
|
327 |
|
williamr@2
|
328 |
Implementations of this function have three fundamental steps:
|
williamr@2
|
329 |
|
williamr@2
|
330 |
1. reading entry data
|
williamr@2
|
331 |
|
williamr@2
|
332 |
2. converting entry data from the Message Server format into that required by
|
williamr@2
|
333 |
the protocol
|
williamr@2
|
334 |
|
williamr@2
|
335 |
3. doing the transfer operation using the appropriate communications protocols
|
williamr@2
|
336 |
|
williamr@2
|
337 |
The implementation of MoveFromLocalL() should differ from CopyFromLocalL()
|
williamr@2
|
338 |
in additionally deleting the original local data.
|
williamr@2
|
339 |
|
williamr@2
|
340 |
@param aSelection The collection of message index entries for which the move
|
williamr@2
|
341 |
is required
|
williamr@2
|
342 |
@param aDestination The entry ID of the service by which the entries should
|
williamr@2
|
343 |
be transferred
|
williamr@2
|
344 |
@param aStatus Asynchronous completion word for the operation
|
williamr@2
|
345 |
@leave KErrNotSupported The Server-side MTM does not support this operation
|
williamr@2
|
346 |
@leave Other leave codes Dependent on implementation */
|
williamr@2
|
347 |
virtual void MoveFromLocalL(const CMsvEntrySelection& aSelection,TMsvId aDestination, TRequestStatus& aStatus)=0;
|
williamr@2
|
348 |
/** Moves a selection of entries within a remote location.
|
williamr@2
|
349 |
|
williamr@2
|
350 |
Requirements:
|
williamr@2
|
351 |
|
williamr@2
|
352 |
Implementations should provide this function if the messaging protocol supports
|
williamr@2
|
353 |
the ability to move entries within a remote service. If this is not supported,
|
williamr@2
|
354 |
implementations should leave with KErrNotSupported.
|
williamr@2
|
355 |
|
williamr@2
|
356 |
The implementation of MoveWithinServiceL() should differ from CopyWithinServiceL()
|
williamr@2
|
357 |
in additionally deleting the original data.
|
williamr@2
|
358 |
|
williamr@2
|
359 |
@param aSelection The collection of message index entries for which the move
|
williamr@2
|
360 |
is required
|
williamr@2
|
361 |
@param aDestination The server entry ID to which the selection is to be moved
|
williamr@2
|
362 |
@param aStatus Asynchronous completion word for the operation
|
williamr@2
|
363 |
@leave KErrNotSupported The Server-side MTM does not support this operation
|
williamr@2
|
364 |
@leave Other leave codes Dependent on implementation */
|
williamr@2
|
365 |
virtual void MoveWithinServiceL(const CMsvEntrySelection& aSelection,TMsvId aDestination, TRequestStatus& aStatus)=0;
|
williamr@2
|
366 |
|
williamr@2
|
367 |
IMPORT_C TInt SystemProgress(TMsvSystemProgress& aOutSysProg);
|
williamr@2
|
368 |
TInt GetNonOperationMtmData(TNonOperationMtmDataType& aMtmDataType, TPtrC8& aResultBuffer);
|
williamr@2
|
369 |
|
williamr@2
|
370 |
protected:
|
williamr@2
|
371 |
IMPORT_C CBaseServerMtm(CRegisteredMtmDll& aRegisteredMtmDll, CMsvServerEntry* aServerEntry);
|
williamr@2
|
372 |
/** Handles the completion of any asynchronous requests that it makes. It is called
|
williamr@2
|
373 |
from the base class RunL() .
|
williamr@2
|
374 |
|
williamr@2
|
375 |
Note that any leaves made by this function result in DoComplete() being called
|
williamr@2
|
376 |
with the leave code. */
|
williamr@2
|
377 |
virtual void DoRunL()=0;
|
williamr@2
|
378 |
/** Called by the base class RunL() if DoRunL() leaves.
|
williamr@2
|
379 |
|
williamr@2
|
380 |
It should be implemented to handle this error. For example, progress information
|
williamr@2
|
381 |
could be updated to reflect the problem.
|
williamr@2
|
382 |
|
williamr@2
|
383 |
@param aError The leave code given by DoRunL(). */
|
williamr@2
|
384 |
virtual void DoComplete(TInt aError)=0;
|
williamr@2
|
385 |
//
|
williamr@2
|
386 |
IMPORT_C TInt Extension_(TUint aExtensionId, TAny *&a0, TAny *a1);
|
williamr@2
|
387 |
//
|
williamr@2
|
388 |
private:
|
williamr@2
|
389 |
// from CActive
|
williamr@2
|
390 |
IMPORT_C void RunL();
|
williamr@2
|
391 |
IMPORT_C TInt RunError(TInt aError);
|
williamr@2
|
392 |
//
|
williamr@2
|
393 |
protected:
|
williamr@2
|
394 |
/** The entry on which to operate. It is set in the constructor.
|
williamr@2
|
395 |
|
williamr@2
|
396 |
The destructor deletes this member. */
|
williamr@2
|
397 |
CMsvServerEntry* iServerEntry;
|
williamr@2
|
398 |
|
williamr@2
|
399 |
// Method used for extension: called by non virtual methods that need
|
williamr@2
|
400 |
// to have a polymorphic behaviour.
|
williamr@2
|
401 |
IMPORT_C virtual TAny* GetInterface(TUid aUid);
|
williamr@2
|
402 |
//
|
williamr@2
|
403 |
private:
|
williamr@2
|
404 |
CRegisteredMtmDll& iRegisteredMtmDll;
|
williamr@2
|
405 |
|
williamr@2
|
406 |
private:
|
williamr@2
|
407 |
// Extra data member to allow for future extensions
|
williamr@2
|
408 |
TAny* iExtensionData;
|
williamr@2
|
409 |
};
|
williamr@2
|
410 |
|
williamr@2
|
411 |
|
williamr@2
|
412 |
class CServerMtmDllRegistry : public CMtmDllRegistry
|
williamr@2
|
413 |
/**
|
williamr@2
|
414 |
@publishedAll
|
williamr@2
|
415 |
@released
|
williamr@2
|
416 |
*/
|
williamr@2
|
417 |
{
|
williamr@2
|
418 |
friend class CMtmRegistryControl;
|
williamr@2
|
419 |
public:
|
williamr@2
|
420 |
IMPORT_C static CServerMtmDllRegistry* NewL(RFs& aFs,TTimeIntervalMicroSeconds32 aTimeoutMicroSeconds32=KMsvDefaultTimeoutMicroSeconds32);
|
williamr@2
|
421 |
IMPORT_C ~CServerMtmDllRegistry();
|
williamr@2
|
422 |
IMPORT_C CBaseServerMtm* NewServerMtmL(TUid aMtmTypeUid, CMsvServerEntry* aInitialEntry);
|
williamr@2
|
423 |
//
|
williamr@2
|
424 |
protected:
|
williamr@2
|
425 |
CServerMtmDllRegistry(RFs& aFs,TTimeIntervalMicroSeconds32 aTimeoutMicroSeconds32);
|
williamr@2
|
426 |
//
|
williamr@2
|
427 |
private:
|
williamr@2
|
428 |
CBaseServerMtm* NewMtmL(const RLibrary& aLib, CMsvServerEntry* aServerEntry, CRegisteredMtmDll& aReg) const;
|
williamr@2
|
429 |
};
|
williamr@2
|
430 |
|
williamr@2
|
431 |
|
williamr@2
|
432 |
class CInstalledMtmGroupArray : public CArrayPtrFlat<CInstalledMtmGroup>
|
williamr@2
|
433 |
/**
|
williamr@2
|
434 |
@internalComponent
|
williamr@2
|
435 |
@released
|
williamr@2
|
436 |
*/
|
williamr@2
|
437 |
{
|
williamr@2
|
438 |
public:
|
williamr@2
|
439 |
CInstalledMtmGroupArray();
|
williamr@2
|
440 |
~CInstalledMtmGroupArray();
|
williamr@2
|
441 |
void AddInstalledMtmGroupL(CInstalledMtmGroup* aInstalledMtmGroup);
|
williamr@2
|
442 |
};
|
williamr@2
|
443 |
|
williamr@2
|
444 |
//**********************************
|
williamr@2
|
445 |
// CMsvMtmCache
|
williamr@2
|
446 |
//**********************************
|
williamr@2
|
447 |
|
williamr@2
|
448 |
|
williamr@2
|
449 |
//**********************************
|
williamr@2
|
450 |
// CMtmRegistryControl
|
williamr@2
|
451 |
//**********************************
|
williamr@2
|
452 |
|
williamr@2
|
453 |
class CMtmRegistryControl : public CBase, public MRegisteredMtmDllObserver
|
williamr@2
|
454 |
/**
|
williamr@2
|
455 |
@publishedAll
|
williamr@2
|
456 |
@released
|
williamr@2
|
457 |
*/
|
williamr@2
|
458 |
{
|
williamr@2
|
459 |
public:
|
williamr@2
|
460 |
IMPORT_C static CMtmRegistryControl* NewL(RFs& anFs,CServerMtmDllRegistry& aServerMtmDllRegistry);
|
williamr@2
|
461 |
IMPORT_C ~CMtmRegistryControl();
|
williamr@2
|
462 |
|
williamr@2
|
463 |
IMPORT_C TInt InstallMtmGroup(const TDesC& aFullName,TUid& aMtmTypeUid);
|
williamr@2
|
464 |
IMPORT_C TInt FullNameToMtmTypeUid(const TDesC& aFullName,TUid& aMtmTypeUid) const;
|
williamr@2
|
465 |
IMPORT_C TInt DeInstallMtmGroup(TUid aMtmTypeUid); // returns error on storing registry
|
williamr@2
|
466 |
|
williamr@2
|
467 |
IMPORT_C TInt UseMtmGroup(TUid aMtmTypeUid);
|
williamr@2
|
468 |
IMPORT_C TInt ReleaseMtmGroup(TUid aMtmTypeUid);
|
williamr@2
|
469 |
IMPORT_C TBool IsInUse(TUid aMtmTypeUid) const;
|
williamr@2
|
470 |
|
williamr@2
|
471 |
IMPORT_C TInt FillRegisteredMtmDllArray(TUid aMtmDllTypeUid,CRegisteredMtmDllArray& aRegisteredMtmDllArray,TTimeIntervalMicroSeconds32 aTimeoutMicroSeconds32=0); // Fill array with Dlls whose second uid is aMtmDllTypeUid
|
williamr@2
|
472 |
IMPORT_C CMtmGroupData* GetMtmGroupDataL(TUid aMtmTypeUid) const;
|
williamr@2
|
473 |
const CMtmGroupData& GetMtmGroupDataReferenceL(TUid aMtmTypeUid) const;
|
williamr@2
|
474 |
|
williamr@2
|
475 |
IMPORT_C void StoreRegistryL() const;
|
williamr@2
|
476 |
IMPORT_C void RestoreRegistryL();
|
williamr@2
|
477 |
|
williamr@2
|
478 |
IMPORT_C void InternalizeL(RReadStream& aStream);
|
williamr@2
|
479 |
IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
|
williamr@2
|
480 |
|
williamr@2
|
481 |
private:
|
williamr@2
|
482 |
CMtmRegistryControl(RFs& anFs,CServerMtmDllRegistry& aServerMtmDllRegistry);
|
williamr@2
|
483 |
void ConstructL();
|
williamr@2
|
484 |
TInt MtmTypeUidToIndex(TUid aMtmTypeUid) const;
|
williamr@2
|
485 |
TInt UidTypeToIndex(TUidType aUidType) const;
|
williamr@2
|
486 |
void DoInstallMtmGroupL(const TDesC& aFullName,TUid& aMtmTypeUid);
|
williamr@2
|
487 |
CMtmGroupData* ReadDataFileStoreL(const TDesC& aFullName) const;
|
williamr@2
|
488 |
void DoDeInstallMtmGroupL(TUid aMtmTypeUid);
|
williamr@2
|
489 |
void DoInternalizeL(RReadStream& aStream);
|
williamr@2
|
490 |
void AddInstalledMtmGroupL(CInstalledMtmGroup* aInstalledMtmGroup);
|
williamr@2
|
491 |
void RemoveInstalledMtmGroup(TUid aMtmTypeUid);
|
williamr@2
|
492 |
TBool IsResFileL(const TDesC& aFullName) const;
|
williamr@2
|
493 |
TUid DoFindMtmTypeUidL(const TDesC& aFullName) const;
|
williamr@2
|
494 |
|
williamr@2
|
495 |
CMtmGroupData *LoadMTMFileL(const TDesC& aFullName, TUid &aUid);
|
williamr@2
|
496 |
CMtmGroupData *LoadDatFileL(const TDesC& aFullName, TUid &aUid);
|
williamr@2
|
497 |
CMtmGroupData *LoadResFileL(const TDesC& aFullName, TUid &aUid);
|
williamr@2
|
498 |
private:
|
williamr@2
|
499 |
RFs& iFs;
|
williamr@2
|
500 |
CInstalledMtmGroupArray iInstalledMtmGroupArray;
|
williamr@2
|
501 |
CServerMtmDllRegistry& iServerMtmDllRegistry;
|
williamr@2
|
502 |
};
|
williamr@2
|
503 |
|
williamr@2
|
504 |
#endif // __MTSR_H__
|