epoc32/include/msventry.h
branchSymbian2
changeset 3 e1b950c65cb4
parent 2 2fe1408b6811
child 4 837f303aceeb
     1.1 --- a/epoc32/include/msventry.h	Tue Mar 16 16:12:26 2010 +0000
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,182 +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 -#ifndef __MSVENTRY_H__
    1.20 -#define __MSVENTRY_H__
    1.21 -
    1.22 -
    1.23 -
    1.24 -#if !defined(__E32BASE_H__)
    1.25 -#include <e32base.h>
    1.26 -#endif
    1.27 -
    1.28 -#if !defined(__MSVSTORE_H__)
    1.29 -#include <msvstore.h>
    1.30 -#endif
    1.31 -
    1.32 -//////////////////////////////////////
    1.33 -// Forward declarations
    1.34 -class CMsvStore;
    1.35 -class CMsvCopyMoveEntriesBase;
    1.36 -class CMsvServer;
    1.37 -
    1.38 -//**********************************
    1.39 -// CMsvServerEntry
    1.40 -//**********************************
    1.41 -//
    1.42 -//
    1.43 -//
    1.44 -
    1.45 -class CMsvServerEntry : public CActive, public MMsvStoreObserver
    1.46 -/** Accesses and acts upon a particular Message Server entry. 
    1.47 -
    1.48 -It provides similar 
    1.49 -functionality to that which CMsvEntry gives to client-side programs. The current 
    1.50 -entry that a CMsvServerEntry object relates is similarly referred to as its 
    1.51 -context. 
    1.52 -
    1.53 -A difference to note is that CMsvEntry functions, when used on a remote context, 
    1.54 -can result in requests to Server-side MTMs to change data on a remote server, 
    1.55 -as well as the local Message Server index. Naturally, as CMsvServerEntry is 
    1.56 -designed to be used by Server-side MTMs themselves, its comparable functions 
    1.57 -only alter the Message Server index.
    1.58 -
    1.59 -A CBaseServerMTM-derived object gets an initial CMsvServerEntry on construction. 
    1.60 -It can get further CMsvServerEntry objects by calling NewEntryL(). The context 
    1.61 -can be changed by SetEntry().
    1.62 -
    1.63 -The context is locked, preventing it being accessed by other MTMs. The lock 
    1.64 -is released when the object is deleted, or the context changes.
    1.65 -
    1.66 -As with CMsvEntry, CBaseServerMTM functions can be divided into two broad 
    1.67 -groups. The first provides means to access the various types of storage associated 
    1.68 -with an entry. The second provides a means to discover and access other entries 
    1.69 -that the entry owns (its children).  
    1.70 -@publishedAll
    1.71 -@released
    1.72 -*/
    1.73 -	{
    1.74 -public:
    1.75 -	IMPORT_C static CMsvServerEntry* NewL(CMsvServer& aServer, TMsvId aId);
    1.76 -	~CMsvServerEntry();
    1.77 -	//
    1.78 -	// Set and get the current context
    1.79 -	IMPORT_C TInt SetEntry(TMsvId aId);
    1.80 -	inline const TMsvEntry& Entry() const;
    1.81 -	IMPORT_C TMsvId OwningService() const;
    1.82 -	//
    1.83 -	// current entry only functions
    1.84 -	IMPORT_C TInt ChangeEntry(const TMsvEntry& aEntry, TSecureId aOwnerId);
    1.85 -	IMPORT_C TInt ChangeEntry(const TMsvEntry& aEntry);
    1.86 -	
    1.87 -
    1.88 -	//
    1.89 -	// child entry only functions
    1.90 -	IMPORT_C TInt CreateEntry(TMsvEntry& aEntry);
    1.91 -	IMPORT_C TInt CreateEntry(TMsvEntry& aEntry, TSecureId aOwnerId);
    1.92 -	IMPORT_C TInt CreateEntry(TMsvEntry& aEntry, TSecureId aOwnerId, TBool aBulk);
    1.93 -	IMPORT_C TInt DeleteEntry(TMsvId aId);
    1.94 -	IMPORT_C TInt DeleteEntries(CMsvEntrySelection& aSelection);
    1.95 -	IMPORT_C TInt MoveEntryWithinService(TMsvId aId, TMsvId aDestination);
    1.96 -	IMPORT_C TInt MoveEntriesWithinService(CMsvEntrySelection& aSelection, TMsvId aDestination);
    1.97 -	IMPORT_C TInt ChangeAttributes(const CMsvEntrySelection& aSelection, TUint aSetAttributes, TUint aClearAttributes);
    1.98 -	IMPORT_C void MoveEntryL(TMsvId aId, TMsvId aDestination, TRequestStatus& aObserverStatus);
    1.99 -	IMPORT_C void MoveEntriesL(const CMsvEntrySelection& aSelection, TMsvId aDestination, TRequestStatus& aObserverStatus);
   1.100 -	IMPORT_C void CopyEntryL(TMsvId aId, TMsvId aDestination, TRequestStatus& aObserverStatus);
   1.101 -	IMPORT_C void CopyEntryL(TMsvId aId, TMsvId aDestination, TMsvId& aCompletedEntry, TRequestStatus& aObserverStatus);
   1.102 -	IMPORT_C void CopyEntriesL(const CMsvEntrySelection& aSelection, TMsvId aDestination, TRequestStatus& aObserverStatus);
   1.103 -	IMPORT_C void CopyEntriesL(const CMsvEntrySelection& aSelection, TMsvId aDestination, CMsvEntrySelection& aCompletedSelection, TRequestStatus& aObserverStatus);
   1.104 -	IMPORT_C TInt GetEntryFromId(TMsvId aId,TMsvEntry*& aEntry);
   1.105 -	//
   1.106 -	// read and write the store associated with the context
   1.107 -	IMPORT_C CMsvStore* ReadStoreL();
   1.108 -	IMPORT_C CMsvStore* EditStoreL();
   1.109 -	//
   1.110 -	// List the children of the context 
   1.111 -	inline const TMsvSelectionOrdering& Sort();
   1.112 -	inline void SetSort(TMsvSelectionOrdering& aOrdering);
   1.113 -	inline void SetMtm(TUid aMtm);
   1.114 -	IMPORT_C TInt GetChildren(CMsvEntrySelection& aSelection);
   1.115 -	//
   1.116 -	IMPORT_C TInt GetChildrenWithService(TMsvId aServiceId, CMsvEntrySelection& aSelection);
   1.117 -	IMPORT_C TInt GetChildrenWithMtm(TUid aMtm, CMsvEntrySelection& aSelection);
   1.118 -	IMPORT_C TInt GetChildrenWithType(TUid aType, CMsvEntrySelection& aSelection);
   1.119 -	//
   1.120 -	// Spawns a new CMsvServerEntry object
   1.121 -	IMPORT_C CMsvServerEntry* NewEntryL(TMsvId aId);
   1.122 -	// 
   1.123 -	// from MMsvStoreObserver
   1.124 -	void HandleStoreEvent(MMsvStoreObserver::TMsvStoreEvent aEvent, TMsvId aId);
   1.125 -	//
   1.126 -	//
   1.127 -
   1.128 -	IMPORT_C TBool HasStoreL() const;
   1.129 -	//
   1.130 -	IMPORT_C RFs& FileSession();
   1.131 -	//
   1.132 -	// Methods for creating and changing entries in bulk
   1.133 -	// (e.g. during email header downloading)
   1.134 -	IMPORT_C TInt CreateEntryBulk(TMsvEntry& aEntry, TSecureId aOwnerId);
   1.135 -
   1.136 -	IMPORT_C TInt CreateEntryBulk(TMsvEntry& aEntry);
   1.137 -
   1.138 -	IMPORT_C TInt ChangeEntryBulk(const TMsvEntry& aEntry, TSecureId aOwnerId);
   1.139 -	IMPORT_C TInt ChangeEntryBulk(const TMsvEntry& aEntry);
   1.140 -	
   1.141 -	IMPORT_C void CompleteBulk();
   1.142 -
   1.143 -protected:
   1.144 -	CMsvServerEntry(CMsvServer& aIndex);
   1.145 -	void ConstructL(TMsvId aId);
   1.146 -	//
   1.147 -	void RunL();
   1.148 -	void DoCancel();
   1.149 -	//
   1.150 -private:
   1.151 -	TInt IncreaseBufferSizes(TInt aNewDescriptionSize, TInt aNewDetailsSize);
   1.152 -	TBool AreChildren(const CMsvEntrySelection& aSelection) const;
   1.153 -	TBool IsAChild(TMsvId aId) const;
   1.154 -	void DoMoveEntryL(TMsvId aId, TMsvId aDestination);
   1.155 -	void DoDeleteEntryL(TMsvId aId, CMsvEntrySelection*& aDeleted, CMsvEntrySelection*& aMoved);
   1.156 -	void DoDeleteEntriesL(CMsvEntrySelection& aSelection, CMsvEntrySelection*& aDeleted, CMsvEntrySelection*& aMoved);
   1.157 -	void DoMoveEntriesL(CMsvEntrySelection& aSelection, TMsvId aDestination, CMsvEntrySelection*& aMoved);
   1.158 -	TInt DoGetChildren(TMsvId aServiceId, TUid aMtm, TUid aType, CMsvEntrySelection& aSelection);
   1.159 -	void DoGetChildrenL(TMsvId aServiceId, TUid aMtm, TUid aType, CMsvEntrySelection& aSelection);
   1.160 -	void DoCopyEntriesL(const CMsvEntrySelection& aSelection, TMsvId aDestination, TRequestStatus& aObserverStatus);
   1.161 -	TInt DoChangeEntry(const TMsvEntry& aEntry, TSecureId aOwnerId, TBool aForcedUpdate, TBool aBulk);
   1.162 -
   1.163 -	//
   1.164 -private:
   1.165 -	TBool iLockedStore;
   1.166 -	TMsvSelectionOrdering iOrdering;
   1.167 -	TMsvEntry iEntry;
   1.168 -	HBufC* iDescription;
   1.169 -	HBufC* iDetails;
   1.170 -	CMsvServer& iServer;
   1.171 -	CMsvStore* iStore;
   1.172 -	TUid iMtm;
   1.173 -	CMsvCopyMoveEntriesBase* iCopyMove;
   1.174 -	TMsvId iSource;
   1.175 -	enum { EMsvIdle, EMsvMoving, EMsvCopying } iEntryState;
   1.176 -	TRequestStatus* iObserverStatus;
   1.177 -	CMsvEntrySelection* iCompletedSelection;
   1.178 -	TMsvId* iCompletedEntryId;
   1.179 -	TSecureId	iContextOwnerId;
   1.180 -	};
   1.181 -
   1.182 -
   1.183 -#include <msventry.inl>
   1.184 -
   1.185 -#endif // __MSVENTRY_H__