1.1 --- a/epoc32/include/mclient.h Wed Mar 31 12:27:01 2010 +0100
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,178 +0,0 @@
1.4 -// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 -// All rights reserved.
1.6 -// This component and the accompanying materials are made available
1.7 -// 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
1.8 -// which accompanies this distribution, and is available
1.9 -// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.10 -//
1.11 -// Initial Contributors:
1.12 -// Nokia Corporation - initial contribution.
1.13 -//
1.14 -// Contributors:
1.15 -//
1.16 -// Description:
1.17 -//
1.18 -
1.19 -#if !defined(__MCLIENT_H__)
1.20 -#define __MCLIENT_H__
1.21 -
1.22 -#if !defined(__E32BASE_H__)
1.23 -#include <e32base.h>
1.24 -#endif
1.25 -
1.26 -#if !defined(__MSVSTD_H__)
1.27 -#include <msvstd.h>
1.28 -#endif
1.29 -
1.30 -#if !defined(__MSVIPC_H__)
1.31 -#include <msvipc.h>
1.32 -#endif
1.33 -
1.34 -#if !defined(__MSVREG_H__)
1.35 -#include <msvreg.h>
1.36 -#endif
1.37 -
1.38 -#include <mmsvstoremanager.h>
1.39 -#include <tnonoperationmtmdata.h>
1.40 -
1.41 -// Forward declarations
1.42 -class CMsvClientEntry;
1.43 -class TCapabilitySet;
1.44 -class TMsvSystemProgress;
1.45 -
1.46 -//**********************************
1.47 -//RMsvSession
1.48 -//**********************************
1.49 -//
1.50 -// NOTE most functions are exported for test purposes only
1.51 -//
1.52 -/**
1.53 -Low level client-side API to access the message server.
1.54 -
1.55 -It should not be used directly by client applications. They should use higher-level helper classes such as
1.56 -CMsvSession, CMsEntry, and CMsvStore. These helper classes access the message server through RMsvServerSession.
1.57 -
1.58 -@internalTechnology
1.59 -*/
1.60 -class RMsvServerSession : public RSessionBase, public MRegisteredMtmDllObserver, public MMsvStoreManager
1.61 - {
1.62 -public:
1.63 - IMPORT_C RMsvServerSession();
1.64 - IMPORT_C virtual ~RMsvServerSession();
1.65 - IMPORT_C TInt Connect(RFs& aFs);
1.66 - IMPORT_C TVersion Version() const;
1.67 - // Synchronous message
1.68 - IMPORT_C TInt GetEntry(TMsvId aId, TMsvId& aService, TMsvEntry& aEntry);
1.69 - IMPORT_C TInt GetChildren(TMsvId aId, CArrayPtrFlat<CMsvClientEntry>& aEntries, const TMsvSelectionOrdering& aOrdering);
1.70 - IMPORT_C TInt LockEntry(TMsvId aId);
1.71 - IMPORT_C TInt ReleaseEntry(TMsvId aId);
1.72 - IMPORT_C TInt ReadStore(TMsvId aId);
1.73 - IMPORT_C TInt LockStore(TMsvId aId);
1.74 - IMPORT_C TInt ReleaseStore(TMsvId aId);
1.75 - TInt DecStoreReaderCount(TMsvId aId);
1.76 - IMPORT_C TInt OperationProgress(TMsvOp aId, TDes8& aProgress);
1.77 - IMPORT_C TInt OperationSystemProgress(TMsvOp aId, TMsvSystemProgress& aProgress);
1.78 - IMPORT_C TInt OperationCompletion(TMsvOp aId, TDes8& aProgress);
1.79 - IMPORT_C TInt CancelOperation(TMsvOp aId, TDes8& aProgress);
1.80 - IMPORT_C TInt CancelSessionEventRequest();
1.81 - IMPORT_C TInt OperationMtmL(TMsvId aId1, TMsvId aId2, TUid& aMtm, TMsvId& aService);
1.82 - inline TInt OperationMtmL(TMsvId aId1, TUid& aMtm, TMsvId& aService);
1.83 - IMPORT_C void CreateEntryL(const TMsvEntry& aEntry, TMsvOp aOperationId, TSecureId aOwnerId);
1.84 - IMPORT_C void ChangeEntryL(const TMsvEntry& aEntry, TMsvOp aOperationId, TSecureId aOwnerId);
1.85 - IMPORT_C void MoveEntriesL(const CMsvEntrySelection& aSelection, TMsvId aTarget, TMsvOp aOperationId);
1.86 - IMPORT_C void CopyEntriesL(const CMsvEntrySelection& aSelection, TMsvId aTarget, TMsvOp aOperationId);
1.87 - IMPORT_C void DeleteEntriesL(const CMsvEntrySelection& aSelection, TMsvOp aOperationId);
1.88 - IMPORT_C void ChangeAttributesL(const CMsvEntrySelection& aSelection, TUint aSetAttributes, TUint aClearAttributes);
1.89 - IMPORT_C void GetChildIdsL(TMsvId aId, const CMsvEntryFilter& aFilter, CMsvEntrySelection& aSelection);
1.90 - TInt OutstandingOperationsL();
1.91 - // Asynchronous messages
1.92 - IMPORT_C void CreateEntryL(const TMsvEntry& aEntry, TMsvOp aOperationId, TSecureId aOwnerId, TRequestStatus& aRequestStatus);
1.93 - IMPORT_C void ChangeEntryL(const TMsvEntry& aEntry, TMsvOp aOperationId, TSecureId aOwnerId, TRequestStatus& aRequestStatus);
1.94 - IMPORT_C void DeleteEntriesL(const CMsvEntrySelection& aSelection, TMsvOp aOperationId, TRequestStatus& aRequestStatus);
1.95 - IMPORT_C void MoveEntriesL(const CMsvEntrySelection& aSelection, TMsvId aTarget, TMsvOp aOperationId, TRequestStatus& aRequestStatus);
1.96 - IMPORT_C void CopyEntriesL(const CMsvEntrySelection& aSelection, TMsvId aTarget, TMsvOp aOperationId, TRequestStatus& aRequestStatus);
1.97 - IMPORT_C void TransferCommandL(const CMsvEntrySelection& aSelection, TInt aCommandId, const TDesC8& aParameter, TMsvOp aOperationId, TRequestStatus& aStatus);
1.98 - IMPORT_C TInt TransferCommandL(const CMsvEntrySelection& aSelection, TInt aCommandId, const TDesC8& aParameter, TMsvOp aOperationId);
1.99 - IMPORT_C void QueueSessionEventRequest(TDes8& aChange, TDes8& aSequence, TRequestStatus& aRequestStatus);
1.100 - void ChangeDriveL(TInt aDrive, TMsvOp aOperationId, TRequestStatus& aRequestStatus);
1.101 - void CopyStoreL(const TDriveUnit& aDrive, TMsvOp aOperationId, TRequestStatus& aStatus);
1.102 - void DeleteStoreL(const TDriveUnit& aDrive, TMsvOp aOperationId, TRequestStatus& aStatus);
1.103 - // MTM
1.104 - IMPORT_C TInt FillRegisteredMtmDllArray(TUid aMtmDllTypeUid,CRegisteredMtmDllArray& aRegisteredMtmDllArray,TTimeIntervalMicroSeconds32 aTimeoutMicroSeconds32); // Fill array with Dlls whose second uid is aMtmDllTypeUid
1.105 - IMPORT_C TInt InstallMtmGroup(const TDesC& aFullName);
1.106 - IMPORT_C TInt DeInstallMtmGroup(const TDesC& aFullName);
1.107 - IMPORT_C TInt UseMtmGroup(TUid aMtmTypeUid);
1.108 - IMPORT_C TInt ReleaseMtmGroup(TUid aMtmTypeUid);
1.109 - IMPORT_C CMtmGroupData* GetMtmGroupDataL(TUid aMtmTypeUid);
1.110 - void GetMtmRequiredCapabilitiesL(TUid aMtmTypeUid, TCapabilitySet& aCapSet) const;
1.111 - TBool GetAndClearIndexCorruptFlagL();
1.112 - TBool DriveContainsStoreL(TDriveUnit aDrive);
1.113 - // Server
1.114 - IMPORT_C void CloseMessageServer();
1.115 - IMPORT_C void RemoveEntry(TMsvId aId);
1.116 - IMPORT_C TInt GetMessageDirectory(TDes& aDirectory);
1.117 - TInt SetSessionAsObserver();
1.118 - TUint32 NotifySequenceL();
1.119 - IMPORT_C TInt SetReceiveEntryEvents(TBool aReceive);
1.120 - // Services
1.121 - IMPORT_C TInt StopService(TMsvId aServiceId);
1.122 - IMPORT_C TBool ServiceActive(TMsvId aServiceId);
1.123 - IMPORT_C TInt ServiceProgress(TMsvId aServiceId, TDes8& aProgress);
1.124 - //
1.125 - IMPORT_C void SetFailure(TInt aType, TInt aArg1 = 0, TInt aArg2 = 0, TInt aArg3 = 0);
1.126 - TInt GetMessageDrive();
1.127 -
1.128 - TInt GetNonOperationMtmData(TMsvId aServiceId, const TNonOperationMtmDataType& aType, TDes8& aMtmData);
1.129 -
1.130 - // from MMsvStoreManager
1.131 - IMPORT_C TBool CreateAttachmentForWriteL(TMsvId aEntryId, TDes& aFilename, RFile& aFile);
1.132 - IMPORT_C void ReplaceAttachmentForWriteL(TMsvId aEntryId, TDes& aFilename, RFile& aFile);
1.133 - IMPORT_C void OpenAttachmentL(TMsvId aEntryId, const TDesC& aFilePath, RFile& aFile);
1.134 - IMPORT_C void OpenAttachmentForWriteL(TMsvId aEntryId, const TDesC& aFilePath, RFile& aFile);
1.135 - IMPORT_C TInt DeleteAttachment(TMsvId aEntryId, const TDesC& aFilePath);
1.136 - IMPORT_C TInt RenameAttachment(TMsvId aEntryId, const TDesC& aOldFilePath, const TDesC& aNewName);
1.137 - IMPORT_C TBool FileExistsL(const TDesC& aFilePath);
1.138 - IMPORT_C void AttachmentFilePathL(TMsvId aEntryId, TDes& aFilePath);
1.139 - IMPORT_C TInt OpenFileStoreForRead(TMsvId aEntryId, RFile& aFile);
1.140 - IMPORT_C void OpenTempStoreFileL(TMsvId aEntryId, RFile& aFile);
1.141 - IMPORT_C void ReplaceFileStoreL(TMsvId aEntryId);
1.142 - IMPORT_C void DeleteFileStoreL(TMsvId aEntryId);
1.143 - IMPORT_C TBool FileStoreExistsL(TMsvId aEntryId) const;
1.144 - IMPORT_C TBool MessageStoreDrivePresentL();
1.145 - IMPORT_C TBool CreateShareProtectedAttachmentForWriteL(TMsvId aEntryId, TDes& aFilename, RFile& aFile);
1.146 - IMPORT_C void BodyTextFilePathL(TMsvId aBodyTextId, TDes& aFilePath);
1.147 - IMPORT_C void OpenBodyTextFileForReadL(RFile& aFile, TMsvId aBodyTextId, const TDesC& aFilePath);
1.148 - IMPORT_C void CreatePlainTextFileL(RFile& aFile, TMsvId aBodyTextId);
1.149 - IMPORT_C void DeletePlainTextFileL(TMsvId aBodyTextId);
1.150 - IMPORT_C void ReplacePlainTextFileL(TMsvId aBodyTextId);
1.151 -private:
1.152 - void DoGetChildrenL(TMsvId aId, CArrayPtrFlat<CMsvClientEntry>& aEntries, const TMsvSelectionOrdering& aOrdering);
1.153 - void DoGetRemainingChildrenL(TPckgBuf<TMsvChildrenDetails>& aDetails, CArrayPtrFlat<CMsvClientEntry>& aEntries);
1.154 - void PackEntryIntoBufferL(const TMsvEntry& aEntry);
1.155 - void SendEntryDataL(TMsvOp aOperationId, const TMsvEntry& aEntry);
1.156 - void SendOperationDataL(TMsvOp aOperationId, const CMsvEntrySelection& aSelection, TInt aParameter1=0, TInt aParameter2=0);
1.157 - void SendCommandDataL(TMsvOp aOperationId, const CMsvEntrySelection& aSelection, TInt aCommand, const TDesC8& aParameter);
1.158 - void TestSlotAvailableL();
1.159 - void PackOperationDataL(const CMsvEntrySelection& aSelection, TInt aParameter1, TInt aParameter2);
1.160 - void DoGetEntryL(TMsvId aId, TMsvId& aService, TMsvEntry& aEntry);
1.161 -
1.162 -private:
1.163 - HBufC8* iBuffer;
1.164 - };
1.165 -
1.166 -/**
1.167 -Gets the MTM that would perform an operation on a specified entry.
1.168 -
1.169 -@param aId1 ID of the entry
1.170 -@param aMtm On return, the UID of the MTM that would be used
1.171 -@param aService On return, the ID of the service that would be used
1.172 -@return System wide error code
1.173 -
1.174 -@capability None
1.175 -*/
1.176 -inline TInt RMsvServerSession::OperationMtmL(TMsvId aId1, TUid& aMtm, TMsvId& aService)
1.177 - {
1.178 - return OperationMtmL(aId1, aId1, aMtm, aService);
1.179 - }
1.180 -
1.181 -#endif // __MCLIENT_H__