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 |
#if !defined(__MCLIENT_H__)
|
williamr@2
|
17 |
#define __MCLIENT_H__
|
williamr@2
|
18 |
|
williamr@2
|
19 |
#if !defined(__E32BASE_H__)
|
williamr@2
|
20 |
#include <e32base.h>
|
williamr@2
|
21 |
#endif
|
williamr@2
|
22 |
|
williamr@2
|
23 |
#if !defined(__MSVSTD_H__)
|
williamr@2
|
24 |
#include <msvstd.h>
|
williamr@2
|
25 |
#endif
|
williamr@2
|
26 |
|
williamr@2
|
27 |
#if !defined(__MSVIPC_H__)
|
williamr@2
|
28 |
#include <msvipc.h>
|
williamr@2
|
29 |
#endif
|
williamr@2
|
30 |
|
williamr@2
|
31 |
#if !defined(__MSVREG_H__)
|
williamr@2
|
32 |
#include <msvreg.h>
|
williamr@2
|
33 |
#endif
|
williamr@2
|
34 |
|
williamr@2
|
35 |
#include <mmsvstoremanager.h>
|
williamr@2
|
36 |
#include <tnonoperationmtmdata.h>
|
williamr@2
|
37 |
|
williamr@2
|
38 |
// Forward declarations
|
williamr@2
|
39 |
class CMsvClientEntry;
|
williamr@2
|
40 |
class TCapabilitySet;
|
williamr@2
|
41 |
class TMsvSystemProgress;
|
williamr@2
|
42 |
|
williamr@2
|
43 |
//**********************************
|
williamr@2
|
44 |
//RMsvSession
|
williamr@2
|
45 |
//**********************************
|
williamr@2
|
46 |
//
|
williamr@2
|
47 |
// NOTE most functions are exported for test purposes only
|
williamr@2
|
48 |
//
|
williamr@2
|
49 |
/**
|
williamr@2
|
50 |
Low level client-side API to access the message server.
|
williamr@2
|
51 |
|
williamr@2
|
52 |
It should not be used directly by client applications. They should use higher-level helper classes such as
|
williamr@2
|
53 |
CMsvSession, CMsEntry, and CMsvStore. These helper classes access the message server through RMsvServerSession.
|
williamr@2
|
54 |
|
williamr@2
|
55 |
@internalTechnology
|
williamr@2
|
56 |
*/
|
williamr@2
|
57 |
class RMsvServerSession : public RSessionBase, public MRegisteredMtmDllObserver, public MMsvStoreManager
|
williamr@2
|
58 |
{
|
williamr@2
|
59 |
public:
|
williamr@2
|
60 |
IMPORT_C RMsvServerSession();
|
williamr@2
|
61 |
IMPORT_C virtual ~RMsvServerSession();
|
williamr@2
|
62 |
IMPORT_C TInt Connect(RFs& aFs);
|
williamr@2
|
63 |
IMPORT_C TVersion Version() const;
|
williamr@2
|
64 |
// Synchronous message
|
williamr@2
|
65 |
IMPORT_C TInt GetEntry(TMsvId aId, TMsvId& aService, TMsvEntry& aEntry);
|
williamr@2
|
66 |
IMPORT_C TInt GetChildren(TMsvId aId, CArrayPtrFlat<CMsvClientEntry>& aEntries, const TMsvSelectionOrdering& aOrdering);
|
williamr@2
|
67 |
IMPORT_C TInt LockEntry(TMsvId aId);
|
williamr@2
|
68 |
IMPORT_C TInt ReleaseEntry(TMsvId aId);
|
williamr@2
|
69 |
IMPORT_C TInt ReadStore(TMsvId aId);
|
williamr@2
|
70 |
IMPORT_C TInt LockStore(TMsvId aId);
|
williamr@2
|
71 |
IMPORT_C TInt ReleaseStore(TMsvId aId);
|
williamr@2
|
72 |
TInt DecStoreReaderCount(TMsvId aId);
|
williamr@2
|
73 |
IMPORT_C TInt OperationProgress(TMsvOp aId, TDes8& aProgress);
|
williamr@2
|
74 |
IMPORT_C TInt OperationSystemProgress(TMsvOp aId, TMsvSystemProgress& aProgress);
|
williamr@2
|
75 |
IMPORT_C TInt OperationCompletion(TMsvOp aId, TDes8& aProgress);
|
williamr@2
|
76 |
IMPORT_C TInt CancelOperation(TMsvOp aId, TDes8& aProgress);
|
williamr@2
|
77 |
IMPORT_C TInt CancelSessionEventRequest();
|
williamr@2
|
78 |
IMPORT_C TInt OperationMtmL(TMsvId aId1, TMsvId aId2, TUid& aMtm, TMsvId& aService);
|
williamr@2
|
79 |
inline TInt OperationMtmL(TMsvId aId1, TUid& aMtm, TMsvId& aService);
|
williamr@2
|
80 |
IMPORT_C void CreateEntryL(const TMsvEntry& aEntry, TMsvOp aOperationId, TSecureId aOwnerId);
|
williamr@2
|
81 |
IMPORT_C void ChangeEntryL(const TMsvEntry& aEntry, TMsvOp aOperationId, TSecureId aOwnerId);
|
williamr@2
|
82 |
IMPORT_C void MoveEntriesL(const CMsvEntrySelection& aSelection, TMsvId aTarget, TMsvOp aOperationId);
|
williamr@2
|
83 |
IMPORT_C void CopyEntriesL(const CMsvEntrySelection& aSelection, TMsvId aTarget, TMsvOp aOperationId);
|
williamr@2
|
84 |
IMPORT_C void DeleteEntriesL(const CMsvEntrySelection& aSelection, TMsvOp aOperationId);
|
williamr@2
|
85 |
IMPORT_C void ChangeAttributesL(const CMsvEntrySelection& aSelection, TUint aSetAttributes, TUint aClearAttributes);
|
williamr@2
|
86 |
IMPORT_C void GetChildIdsL(TMsvId aId, const CMsvEntryFilter& aFilter, CMsvEntrySelection& aSelection);
|
williamr@2
|
87 |
TInt OutstandingOperationsL();
|
williamr@2
|
88 |
// Asynchronous messages
|
williamr@2
|
89 |
IMPORT_C void CreateEntryL(const TMsvEntry& aEntry, TMsvOp aOperationId, TSecureId aOwnerId, TRequestStatus& aRequestStatus);
|
williamr@2
|
90 |
IMPORT_C void ChangeEntryL(const TMsvEntry& aEntry, TMsvOp aOperationId, TSecureId aOwnerId, TRequestStatus& aRequestStatus);
|
williamr@2
|
91 |
IMPORT_C void DeleteEntriesL(const CMsvEntrySelection& aSelection, TMsvOp aOperationId, TRequestStatus& aRequestStatus);
|
williamr@2
|
92 |
IMPORT_C void MoveEntriesL(const CMsvEntrySelection& aSelection, TMsvId aTarget, TMsvOp aOperationId, TRequestStatus& aRequestStatus);
|
williamr@2
|
93 |
IMPORT_C void CopyEntriesL(const CMsvEntrySelection& aSelection, TMsvId aTarget, TMsvOp aOperationId, TRequestStatus& aRequestStatus);
|
williamr@2
|
94 |
IMPORT_C void TransferCommandL(const CMsvEntrySelection& aSelection, TInt aCommandId, const TDesC8& aParameter, TMsvOp aOperationId, TRequestStatus& aStatus);
|
williamr@2
|
95 |
IMPORT_C TInt TransferCommandL(const CMsvEntrySelection& aSelection, TInt aCommandId, const TDesC8& aParameter, TMsvOp aOperationId);
|
williamr@2
|
96 |
IMPORT_C void QueueSessionEventRequest(TDes8& aChange, TDes8& aSequence, TRequestStatus& aRequestStatus);
|
williamr@2
|
97 |
void ChangeDriveL(TInt aDrive, TMsvOp aOperationId, TRequestStatus& aRequestStatus);
|
williamr@2
|
98 |
void CopyStoreL(const TDriveUnit& aDrive, TMsvOp aOperationId, TRequestStatus& aStatus);
|
williamr@2
|
99 |
void DeleteStoreL(const TDriveUnit& aDrive, TMsvOp aOperationId, TRequestStatus& aStatus);
|
williamr@2
|
100 |
// MTM
|
williamr@2
|
101 |
IMPORT_C TInt FillRegisteredMtmDllArray(TUid aMtmDllTypeUid,CRegisteredMtmDllArray& aRegisteredMtmDllArray,TTimeIntervalMicroSeconds32 aTimeoutMicroSeconds32); // Fill array with Dlls whose second uid is aMtmDllTypeUid
|
williamr@2
|
102 |
IMPORT_C TInt InstallMtmGroup(const TDesC& aFullName);
|
williamr@2
|
103 |
IMPORT_C TInt DeInstallMtmGroup(const TDesC& aFullName);
|
williamr@2
|
104 |
IMPORT_C TInt UseMtmGroup(TUid aMtmTypeUid);
|
williamr@2
|
105 |
IMPORT_C TInt ReleaseMtmGroup(TUid aMtmTypeUid);
|
williamr@2
|
106 |
IMPORT_C CMtmGroupData* GetMtmGroupDataL(TUid aMtmTypeUid);
|
williamr@2
|
107 |
void GetMtmRequiredCapabilitiesL(TUid aMtmTypeUid, TCapabilitySet& aCapSet) const;
|
williamr@2
|
108 |
TBool GetAndClearIndexCorruptFlagL();
|
williamr@2
|
109 |
TBool DriveContainsStoreL(TDriveUnit aDrive);
|
williamr@2
|
110 |
// Server
|
williamr@2
|
111 |
IMPORT_C void CloseMessageServer();
|
williamr@2
|
112 |
IMPORT_C void RemoveEntry(TMsvId aId);
|
williamr@2
|
113 |
IMPORT_C TInt GetMessageDirectory(TDes& aDirectory);
|
williamr@2
|
114 |
TInt SetSessionAsObserver();
|
williamr@2
|
115 |
TUint32 NotifySequenceL();
|
williamr@2
|
116 |
IMPORT_C TInt SetReceiveEntryEvents(TBool aReceive);
|
williamr@2
|
117 |
// Services
|
williamr@2
|
118 |
IMPORT_C TInt StopService(TMsvId aServiceId);
|
williamr@2
|
119 |
IMPORT_C TBool ServiceActive(TMsvId aServiceId);
|
williamr@2
|
120 |
IMPORT_C TInt ServiceProgress(TMsvId aServiceId, TDes8& aProgress);
|
williamr@2
|
121 |
//
|
williamr@2
|
122 |
IMPORT_C void SetFailure(TInt aType, TInt aArg1 = 0, TInt aArg2 = 0, TInt aArg3 = 0);
|
williamr@2
|
123 |
TInt GetMessageDrive();
|
williamr@2
|
124 |
|
williamr@2
|
125 |
TInt GetNonOperationMtmData(TMsvId aServiceId, const TNonOperationMtmDataType& aType, TDes8& aMtmData);
|
williamr@2
|
126 |
|
williamr@2
|
127 |
// from MMsvStoreManager
|
williamr@2
|
128 |
IMPORT_C TBool CreateAttachmentForWriteL(TMsvId aEntryId, TDes& aFilename, RFile& aFile);
|
williamr@2
|
129 |
IMPORT_C void ReplaceAttachmentForWriteL(TMsvId aEntryId, TDes& aFilename, RFile& aFile);
|
williamr@2
|
130 |
IMPORT_C void OpenAttachmentL(TMsvId aEntryId, const TDesC& aFilePath, RFile& aFile);
|
williamr@2
|
131 |
IMPORT_C void OpenAttachmentForWriteL(TMsvId aEntryId, const TDesC& aFilePath, RFile& aFile);
|
williamr@2
|
132 |
IMPORT_C TInt DeleteAttachment(TMsvId aEntryId, const TDesC& aFilePath);
|
williamr@2
|
133 |
IMPORT_C TInt RenameAttachment(TMsvId aEntryId, const TDesC& aOldFilePath, const TDesC& aNewName);
|
williamr@2
|
134 |
IMPORT_C TBool FileExistsL(const TDesC& aFilePath);
|
williamr@2
|
135 |
IMPORT_C void AttachmentFilePathL(TMsvId aEntryId, TDes& aFilePath);
|
williamr@2
|
136 |
IMPORT_C TInt OpenFileStoreForRead(TMsvId aEntryId, RFile& aFile);
|
williamr@2
|
137 |
IMPORT_C void OpenTempStoreFileL(TMsvId aEntryId, RFile& aFile);
|
williamr@2
|
138 |
IMPORT_C void ReplaceFileStoreL(TMsvId aEntryId);
|
williamr@2
|
139 |
IMPORT_C void DeleteFileStoreL(TMsvId aEntryId);
|
williamr@2
|
140 |
IMPORT_C TBool FileStoreExistsL(TMsvId aEntryId) const;
|
williamr@2
|
141 |
IMPORT_C TBool MessageStoreDrivePresentL();
|
williamr@2
|
142 |
IMPORT_C TBool CreateShareProtectedAttachmentForWriteL(TMsvId aEntryId, TDes& aFilename, RFile& aFile);
|
williamr@2
|
143 |
IMPORT_C void BodyTextFilePathL(TMsvId aBodyTextId, TDes& aFilePath);
|
williamr@2
|
144 |
IMPORT_C void OpenBodyTextFileForReadL(RFile& aFile, TMsvId aBodyTextId, const TDesC& aFilePath);
|
williamr@2
|
145 |
IMPORT_C void CreatePlainTextFileL(RFile& aFile, TMsvId aBodyTextId);
|
williamr@2
|
146 |
IMPORT_C void DeletePlainTextFileL(TMsvId aBodyTextId);
|
williamr@2
|
147 |
IMPORT_C void ReplacePlainTextFileL(TMsvId aBodyTextId);
|
williamr@2
|
148 |
private:
|
williamr@2
|
149 |
void DoGetChildrenL(TMsvId aId, CArrayPtrFlat<CMsvClientEntry>& aEntries, const TMsvSelectionOrdering& aOrdering);
|
williamr@2
|
150 |
void DoGetRemainingChildrenL(TPckgBuf<TMsvChildrenDetails>& aDetails, CArrayPtrFlat<CMsvClientEntry>& aEntries);
|
williamr@2
|
151 |
void PackEntryIntoBufferL(const TMsvEntry& aEntry);
|
williamr@2
|
152 |
void SendEntryDataL(TMsvOp aOperationId, const TMsvEntry& aEntry);
|
williamr@2
|
153 |
void SendOperationDataL(TMsvOp aOperationId, const CMsvEntrySelection& aSelection, TInt aParameter1=0, TInt aParameter2=0);
|
williamr@2
|
154 |
void SendCommandDataL(TMsvOp aOperationId, const CMsvEntrySelection& aSelection, TInt aCommand, const TDesC8& aParameter);
|
williamr@2
|
155 |
void TestSlotAvailableL();
|
williamr@2
|
156 |
void PackOperationDataL(const CMsvEntrySelection& aSelection, TInt aParameter1, TInt aParameter2);
|
williamr@2
|
157 |
void DoGetEntryL(TMsvId aId, TMsvId& aService, TMsvEntry& aEntry);
|
williamr@2
|
158 |
|
williamr@2
|
159 |
private:
|
williamr@2
|
160 |
HBufC8* iBuffer;
|
williamr@2
|
161 |
};
|
williamr@2
|
162 |
|
williamr@2
|
163 |
/**
|
williamr@2
|
164 |
Gets the MTM that would perform an operation on a specified entry.
|
williamr@2
|
165 |
|
williamr@2
|
166 |
@param aId1 ID of the entry
|
williamr@2
|
167 |
@param aMtm On return, the UID of the MTM that would be used
|
williamr@2
|
168 |
@param aService On return, the ID of the service that would be used
|
williamr@2
|
169 |
@return System wide error code
|
williamr@2
|
170 |
|
williamr@2
|
171 |
@capability None
|
williamr@2
|
172 |
*/
|
williamr@2
|
173 |
inline TInt RMsvServerSession::OperationMtmL(TMsvId aId1, TUid& aMtm, TMsvId& aService)
|
williamr@2
|
174 |
{
|
williamr@2
|
175 |
return OperationMtmL(aId1, aId1, aMtm, aService);
|
williamr@2
|
176 |
}
|
williamr@2
|
177 |
|
williamr@2
|
178 |
#endif // __MCLIENT_H__
|