62
|
1 |
// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
2 |
// All rights reserved.
|
|
3 |
// This component and the accompanying materials are made available
|
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
|
5 |
// which accompanies this distribution, and is available
|
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
7 |
//
|
|
8 |
// Initial Contributors:
|
|
9 |
// Nokia Corporation - initial contribution.
|
|
10 |
//
|
|
11 |
// Contributors:
|
|
12 |
//
|
|
13 |
// Description:
|
|
14 |
//
|
|
15 |
|
|
16 |
#if !defined(__MCLIENT_H__)
|
|
17 |
#define __MCLIENT_H__
|
|
18 |
|
|
19 |
#if !defined(__E32BASE_H__)
|
|
20 |
#include <e32base.h>
|
|
21 |
#endif
|
|
22 |
|
|
23 |
#if !defined(__MSVSTD_H__)
|
|
24 |
#include <msvstd.h>
|
|
25 |
#endif
|
|
26 |
|
|
27 |
#if !defined(__MSVIPC_H__)
|
|
28 |
#include <msvipc.h>
|
|
29 |
#endif
|
|
30 |
|
|
31 |
#if !defined(__MSVREG_H__)
|
|
32 |
#include <msvreg.h>
|
|
33 |
#endif
|
|
34 |
|
|
35 |
#include <mmsvstoremanager.h>
|
|
36 |
#include <tnonoperationmtmdata.h>
|
|
37 |
|
|
38 |
|
|
39 |
|
|
40 |
#if !defined(__MSVSEARCHSORTQUERY_H__)
|
|
41 |
#include <msvsearchsortquery.h>
|
|
42 |
#endif
|
|
43 |
class CMsvSearchSortQuery;
|
|
44 |
class CMSvSearchSortOperation;
|
|
45 |
|
|
46 |
// Forward declarations
|
|
47 |
class CMsvClientEntry;
|
|
48 |
class TCapabilitySet;
|
|
49 |
class TMsvSystemProgress;
|
|
50 |
|
|
51 |
|
|
52 |
//**********************************
|
|
53 |
//RMsvSession
|
|
54 |
//**********************************
|
|
55 |
//
|
|
56 |
// NOTE most functions are exported for test purposes only
|
|
57 |
//
|
|
58 |
/**
|
|
59 |
Low level client-side API to access the message server.
|
|
60 |
|
|
61 |
It should not be used directly by client applications. They should use higher-level helper classes such as
|
|
62 |
CMsvSession, CMsEntry, and CMsvStore. These helper classes access the message server through RMsvServerSession.
|
|
63 |
|
|
64 |
@internalTechnology
|
|
65 |
*/
|
|
66 |
class RMsvServerSession : public RSessionBase, public MRegisteredMtmDllObserver, public MMsvStoreManager
|
|
67 |
{
|
|
68 |
public:
|
|
69 |
IMPORT_C RMsvServerSession();
|
|
70 |
IMPORT_C virtual ~RMsvServerSession();
|
|
71 |
IMPORT_C TInt Connect(RFs& aFs);
|
|
72 |
IMPORT_C TVersion Version() const;
|
|
73 |
// Synchronous message
|
|
74 |
IMPORT_C TInt GetEntry(TMsvId aId, TMsvId& aService, TMsvEntry& aEntry);
|
|
75 |
IMPORT_C TInt GetChildren(TMsvId aId, CArrayPtrFlat<CMsvClientEntry>& aEntries, const TMsvSelectionOrdering& aOrdering);
|
|
76 |
IMPORT_C TInt LockEntry(TMsvId aId);
|
|
77 |
IMPORT_C TInt ReleaseEntry(TMsvId aId);
|
|
78 |
IMPORT_C TInt ReadStore(TMsvId aId);
|
|
79 |
IMPORT_C TInt LockStore(TMsvId aId);
|
|
80 |
IMPORT_C TInt ReleaseStore(TMsvId aId);
|
|
81 |
TInt DecStoreReaderCount(TMsvId aId);
|
|
82 |
IMPORT_C TInt OperationProgress(TMsvOp aId, TDes8& aProgress);
|
|
83 |
IMPORT_C TInt OperationSystemProgress(TMsvOp aId, TMsvSystemProgress& aProgress);
|
|
84 |
IMPORT_C TInt OperationCompletion(TMsvOp aId, TDes8& aProgress);
|
|
85 |
IMPORT_C TInt CancelOperation(TMsvOp aId, TDes8& aProgress);
|
|
86 |
IMPORT_C TInt CancelSessionEventRequest();
|
|
87 |
IMPORT_C TInt OperationMtmL(TMsvId aId1, TMsvId aId2, TUid& aMtm, TMsvId& aService);
|
|
88 |
inline TInt OperationMtmL(TMsvId aId1, TUid& aMtm, TMsvId& aService);
|
|
89 |
IMPORT_C void CreateEntryL(const TMsvEntry& aEntry, TMsvOp aOperationId, TSecureId aOwnerId);
|
|
90 |
IMPORT_C void ChangeEntryL(const TMsvEntry& aEntry, TMsvOp aOperationId, TSecureId aOwnerId);
|
|
91 |
IMPORT_C void MoveEntriesL(const CMsvEntrySelection& aSelection, TMsvId aTarget, TMsvOp aOperationId);
|
|
92 |
IMPORT_C void CopyEntriesL(const CMsvEntrySelection& aSelection, TMsvId aTarget, TMsvOp aOperationId);
|
|
93 |
IMPORT_C void DeleteEntriesL(const CMsvEntrySelection& aSelection, TMsvOp aOperationId);
|
|
94 |
IMPORT_C void ChangeAttributesL(const CMsvEntrySelection& aSelection, TUint aSetAttributes, TUint aClearAttributes);
|
|
95 |
IMPORT_C void GetChildIdsL(TMsvId aId, const CMsvEntryFilter& aFilter, CMsvEntrySelection& aSelection);
|
|
96 |
void ChangeDriveL(TInt aDrive, TMsvOp aOperationId, TRequestStatus& aRequestStatus);
|
|
97 |
|
|
98 |
TInt OutstandingOperationsL();
|
|
99 |
// Asynchronous messages
|
|
100 |
IMPORT_C void CreateEntryL(const TMsvEntry& aEntry, TMsvOp aOperationId, TSecureId aOwnerId, TRequestStatus& aRequestStatus);
|
|
101 |
IMPORT_C void ChangeEntryL(const TMsvEntry& aEntry, TMsvOp aOperationId, TSecureId aOwnerId, TRequestStatus& aRequestStatus);
|
|
102 |
void ChangeEntriesL(const CMsvEntrySelection& aSelection,TBool aMark, TMsvOp aOperationId, TSecureId aOwnerId, TRequestStatus& aRequestStatus);
|
|
103 |
|
|
104 |
IMPORT_C void DeleteEntriesL(const CMsvEntrySelection& aSelection, TMsvOp aOperationId, TRequestStatus& aRequestStatus);
|
|
105 |
IMPORT_C void MoveEntriesL(const CMsvEntrySelection& aSelection, TMsvId aTarget, TMsvOp aOperationId, TRequestStatus& aRequestStatus);
|
|
106 |
IMPORT_C void CopyEntriesL(const CMsvEntrySelection& aSelection, TMsvId aTarget, TMsvOp aOperationId, TRequestStatus& aRequestStatus);
|
|
107 |
IMPORT_C void TransferCommandL(const CMsvEntrySelection& aSelection, TInt aCommandId, const TDesC8& aParameter, TMsvOp aOperationId, TRequestStatus& aStatus);
|
|
108 |
IMPORT_C TInt TransferCommandL(const CMsvEntrySelection& aSelection, TInt aCommandId, const TDesC8& aParameter, TMsvOp aOperationId);
|
|
109 |
IMPORT_C void QueueSessionEventRequest(TDes8& aChange, TDes8& aSequence, TRequestStatus& aRequestStatus);
|
|
110 |
void CopyStoreL(const TDriveUnit& aDrive, TMsvOp aOperationId, TRequestStatus& aStatus);
|
|
111 |
void DeleteStoreL(const TDriveUnit& aDrive, TMsvOp aOperationId, TRequestStatus& aStatus);
|
|
112 |
|
|
113 |
//search sort
|
|
114 |
void SearchSortRequestOnHeaderBodyL(const CMsvSearchSortQuery* aQuery, TMsvOp aOperationId, TBool aMarkQuery, TRequestStatus& aRequestStatus);
|
|
115 |
void SearchSortRequestOnEntryL(const CMsvSearchSortQuery* aQuery, TMsvOp aOperationId, TBool aMarkQuery, TInt aIterator, TRequestStatus& aRequestStatus);
|
|
116 |
void GetResultsForQueryId(TInt& aQueryId, TMsvOp aOperationId, TInt aIterator, TRequestStatus& aRequestStatus);
|
|
117 |
void GetResultAsIdL(RArray<TMsvId>& aId);
|
|
118 |
void GetResultAsIdL(RArray<TMsvId>& aId, TInt& aResultStatus);
|
|
119 |
void GetSearchSortRequestQueryIdL(TInt& aQueryId);
|
|
120 |
void UnmarkSearchSortRequestQueryIdL(TInt aQueryId);
|
|
121 |
void SendResultantListL(TMsvOp aOperationId, RArray<TMsvIdWithSortField> aTMsvIdWithSortField, TRequestStatus& aRequestStatus);
|
|
122 |
void SendNewResultsToServerForSortL(TMsvOp aOperationId, RArray<TMsvId>& aIdArray, TRequestStatus& aRequestStatus);
|
|
123 |
void GetResultCountL(TInt& aCount);
|
|
124 |
void GetNextIdL(TMsvId& aId, TInt& aCount);
|
|
125 |
void GetNextEntryL(TMsvEntry& aEntry, TInt& aCount);
|
|
126 |
void GetQueryFromServerL(TMsvOp aOperationId, TInt aQueryId, CMsvSearchSortQuery* aQuery);
|
|
127 |
void SearchSortOperationProgressL(TMsvOp aOperationId, TInt aOperationProgress);
|
|
128 |
int CancelSearchSortOperation(TMsvOp aOperationId);
|
|
129 |
|
|
130 |
// MTM
|
|
131 |
IMPORT_C TInt FillRegisteredMtmDllArray(TUid aMtmDllTypeUid,CRegisteredMtmDllArray& aRegisteredMtmDllArray,TTimeIntervalMicroSeconds32 aTimeoutMicroSeconds32); // Fill array with Dlls whose second uid is aMtmDllTypeUid
|
|
132 |
IMPORT_C TInt InstallMtmGroup(const TDesC& aFullName);
|
|
133 |
IMPORT_C TInt DeInstallMtmGroup(const TDesC& aFullName);
|
|
134 |
IMPORT_C TInt UseMtmGroup(TUid aMtmTypeUid);
|
|
135 |
IMPORT_C TInt ReleaseMtmGroup(TUid aMtmTypeUid);
|
|
136 |
IMPORT_C CMtmGroupData* GetMtmGroupDataL(TUid aMtmTypeUid);
|
|
137 |
void GetMtmRequiredCapabilitiesL(TUid aMtmTypeUid, TCapabilitySet& aCapSet) const;
|
|
138 |
TBool GetAndClearIndexCorruptFlagL();
|
|
139 |
TBool DriveContainsStoreL(TDriveUnit aDrive);
|
|
140 |
// Server
|
|
141 |
IMPORT_C void CloseMessageServer();
|
|
142 |
IMPORT_C void RemoveEntry(TMsvId aId);
|
|
143 |
IMPORT_C TInt GetMessageDirectory(TDes& aDirectory);
|
|
144 |
TInt SetSessionAsObserver();
|
|
145 |
TUint32 NotifySequenceL();
|
|
146 |
IMPORT_C TInt SetReceiveEntryEvents(TBool aReceive);
|
|
147 |
// Services
|
|
148 |
IMPORT_C TInt StopService(TMsvId aServiceId);
|
|
149 |
IMPORT_C TBool ServiceActive(TMsvId aServiceId);
|
|
150 |
IMPORT_C TInt ServiceProgress(TMsvId aServiceId, TDes8& aProgress);
|
|
151 |
//
|
|
152 |
IMPORT_C void SetFailure(TInt aType, TInt aArg1 = 0, TInt aArg2 = 0, TInt aArg3 = 0);
|
|
153 |
TInt GetMessageDrive();
|
|
154 |
|
|
155 |
TInt GetNonOperationMtmData(TMsvId aServiceId, const TNonOperationMtmDataType& aType, TDes8& aMtmData);
|
|
156 |
|
|
157 |
// from MMsvStoreManager
|
|
158 |
IMPORT_C TBool CreateAttachmentForWriteL(TMsvId aEntryId, TDes& aFilename, RFile& aFile);
|
|
159 |
IMPORT_C void ReplaceAttachmentForWriteL(TMsvId aEntryId, TDes& aFilename, RFile& aFile);
|
|
160 |
IMPORT_C void OpenAttachmentL(TMsvId aEntryId, const TDesC& aFilePath, RFile& aFile);
|
|
161 |
IMPORT_C void OpenAttachmentForWriteL(TMsvId aEntryId, const TDesC& aFilePath, RFile& aFile);
|
|
162 |
IMPORT_C TInt DeleteAttachment(TMsvId aEntryId, const TDesC& aFilePath);
|
|
163 |
IMPORT_C TInt RenameAttachment(TMsvId aEntryId, const TDesC& aOldFilePath, const TDesC& aNewName);
|
|
164 |
IMPORT_C TBool FileExistsL(const TDesC& aFilePath);
|
|
165 |
IMPORT_C void AttachmentFilePathL(TMsvId aEntryId, TDes& aFilePath);
|
|
166 |
IMPORT_C TInt OpenFileStoreForRead(TMsvId aEntryId, RFile& aFile);
|
|
167 |
IMPORT_C void OpenTempStoreFileL(TMsvId aEntryId, RFile& aFile);
|
|
168 |
IMPORT_C void ReplaceFileStoreL(TMsvId aEntryId);
|
|
169 |
IMPORT_C void DeleteFileStoreL(TMsvId aEntryId);
|
|
170 |
IMPORT_C TBool FileStoreExistsL(TMsvId aEntryId) const;
|
|
171 |
IMPORT_C TBool MessageStoreDrivePresentL();
|
|
172 |
IMPORT_C TBool CreateShareProtectedAttachmentForWriteL(TMsvId aEntryId, TDes& aFilename, RFile& aFile);
|
|
173 |
IMPORT_C void BodyTextFilePathL(TMsvId aBodyTextId, TDes& aFilePath);
|
|
174 |
IMPORT_C void OpenBodyTextFileForReadL(RFile& aFile, TMsvId aBodyTextId, const TDesC& aFilePath);
|
|
175 |
IMPORT_C void CreatePlainTextFileL(RFile& aFile, TMsvId aBodyTextId);
|
|
176 |
IMPORT_C void DeletePlainTextFileL(TMsvId aBodyTextId);
|
|
177 |
IMPORT_C void ReplacePlainTextFileL(TMsvId aBodyTextId);
|
|
178 |
|
|
179 |
// Changed for PREQ 557. Preferred list related APIs.
|
|
180 |
#if (defined SYMBIAN_MSGS_ENHANCED_REMOVABLE_MEDIA_SUPPORT)
|
|
181 |
IMPORT_C TInt GetChildrenAll(TMsvId aId, CArrayPtrFlat<CMsvClientEntry>& aEntries, const TMsvSelectionOrdering& aOrdering);
|
|
182 |
IMPORT_C void GetChildIdsAllL(TMsvId aId, const CMsvEntryFilter& aFilter, CMsvEntrySelection& aSelection);
|
|
183 |
IMPORT_C void CurrentDriveInfoL(TDriveNumber& aDriveNumber, TUint& aPriority);
|
|
184 |
IMPORT_C void DriveListL(RArray<TDriveNumber>& aDriveList);
|
|
185 |
IMPORT_C void AvailableDriveListL(RArray<TDriveNumber>& aDriveList);
|
|
186 |
IMPORT_C void AddDriveL(TDriveNumber aDriveNumber, TUint& aPriority);
|
|
187 |
IMPORT_C void RemoveDriveL(TDriveNumber aDriveNumber);
|
|
188 |
IMPORT_C void UpdateDrivePriorityL(TDriveNumber aDriveNumber, TUint& aPriority);
|
|
189 |
#if (defined SYMBIAN_MESSAGESTORE_UNIT_TESTCODE)
|
|
190 |
void ResetRepositoryL();
|
|
191 |
IMPORT_C void PrintCache();
|
|
192 |
#endif
|
|
193 |
#endif // #if (defined SYMBIAN_MSGS_ENHANCED_REMOVABLE_MEDIA_SUPPORT)
|
|
194 |
|
|
195 |
#if (defined SYMBIAN_MESSAGESTORE_HEADER_BODY_USING_SQLDB)
|
|
196 |
void CreateStoreL(const TUid& aMtmId, const RPointerArray<CFieldPair>& aFieldDetails);
|
|
197 |
TBool DoesStoreExistsL(const TUid& aMtmId);
|
|
198 |
void LastErrorMessageL(HBufC*& aErrorMsg);
|
|
199 |
|
|
200 |
// Function from MMsvStoreManager
|
|
201 |
IMPORT_C void CreateHeaderEntryL(const TUid& aMtmId, TMsvId aEntryId, const RPointerArray<CHeaderFields>& aFieldPairList);
|
|
202 |
IMPORT_C void LoadHeaderEntryL(const TUid& aMtmId, TMsvId aEntryId, RPointerArray<CHeaderFields>& aFieldPairList);
|
|
203 |
IMPORT_C void DeleteHeaderEntryL(const TUid& aMtmId, TMsvId aEntryId);
|
|
204 |
IMPORT_C void UpdateHeaderEntryL(const TUid& aMtmId, TMsvId aEntryId, const RPointerArray<CHeaderFields>& aFieldPairList);
|
|
205 |
IMPORT_C TBool DoesAnyStoreExists(TMsvId aId, TUid aMtmId);
|
|
206 |
IMPORT_C TBool DoesHeaderTableExist(const TUid& aMtmId);
|
|
207 |
|
|
208 |
void GetConvertibleDriveListL(RArray<TDriveNumber>& aDriveList);
|
|
209 |
void ConvertMessageStore(TDriveNumber aDriveList,TRequestStatus& aRequestStatus);
|
|
210 |
void GetConversionStatusL(TDriveNumber aDrive);
|
|
211 |
TInt CancelConversion(TDriveNumber aDrive);
|
|
212 |
#endif
|
|
213 |
private:
|
|
214 |
void DoGetChildrenL(TMsvId aId, CArrayPtrFlat<CMsvClientEntry>& aEntries, const TMsvSelectionOrdering& aOrdering);
|
|
215 |
void DoGetRemainingChildrenL(TPckgBuf<TMsvChildrenDetails>& aDetails, CArrayPtrFlat<CMsvClientEntry>& aEntries);
|
|
216 |
void PackEntryIntoBufferL(const TMsvEntry& aEntry);
|
|
217 |
void SendEntryDataL(TMsvOp aOperationId, const TMsvEntry& aEntry);
|
|
218 |
void SendOperationDataL(TMsvOp aOperationId, const CMsvEntrySelection& aSelection, TInt aParameter1=0, TInt aParameter2=0);
|
|
219 |
void SendCommandDataL(TMsvOp aOperationId, const CMsvEntrySelection& aSelection, TInt aCommand, const TDesC8& aParameter);
|
|
220 |
void TestSlotAvailableL();
|
|
221 |
void PackOperationDataL(const CMsvEntrySelection& aSelection, TInt aParameter1, TInt aParameter2);
|
|
222 |
|
|
223 |
#if (defined SYMBIAN_MSGS_ENHANCED_REMOVABLE_MEDIA_SUPPORT)
|
|
224 |
void DoGetChildrenAllL(TMsvId aId, CArrayPtrFlat<CMsvClientEntry>& aEntries, const TMsvSelectionOrdering& aOrdering);
|
|
225 |
#endif
|
|
226 |
|
|
227 |
private:
|
|
228 |
HBufC8* iBuffer;
|
|
229 |
};
|
|
230 |
|
|
231 |
/**
|
|
232 |
Gets the MTM that would perform an operation on a specified entry.
|
|
233 |
|
|
234 |
@param aId1 ID of the entry
|
|
235 |
@param aMtm On return, the UID of the MTM that would be used
|
|
236 |
@param aService On return, the ID of the service that would be used
|
|
237 |
@return System wide error code
|
|
238 |
|
|
239 |
@capability None
|
|
240 |
*/
|
|
241 |
inline TInt RMsvServerSession::OperationMtmL(TMsvId aId1, TUid& aMtm, TMsvId& aService)
|
|
242 |
{
|
|
243 |
return OperationMtmL(aId1, aId1, aMtm, aService);
|
|
244 |
}
|
|
245 |
|
|
246 |
#endif // __MCLIENT_H__
|
|
247 |
|