Exemplo n.º 1
0
// Delete
void CImImap4Compound::DeleteL(TRequestStatus& aStatus, const CMsvEntrySelection& aSourceSel)
	{
	LOG_COMMANDS( (iSession->LogText(_L8("COMPOUND Delete selection"))));

	Queue(aStatus);

	// Save parameters
	iSource=aSourceSel[0];
	delete iSourceSel;
	iSourceSel = NULL;
	iSourceSel=aSourceSel.CopyL();
	iMessageSelection=iSelectionStillToDelete=aSourceSel.Count();

	// Find the offending source folder
	if ((iSourceFolder=FindFolderL(iSource))==NULL)
		{
		Complete(KErrNotFound);
		return;
		}

	// Select it
	iStep=0;
	iSequence=SeqDelete;
	DoRunL();
	}
Exemplo n.º 2
0
void CImImap4Compound::GenericCopyL(TRequestStatus& aStatus, const CMsvEntrySelection& aSourceSel, const TMsvId aDestination, TInt* aSequence)
	{
	DBG((iSession->LogText(_L8("CImImap4Compound::GenericCopyL()"))));
 	Queue(aStatus);

	// Save parameters
	iSource=aSourceSel[0];
	delete iSourceSel;
	iSourceSel = NULL;
	iSourceSel=aSourceSel.CopyL();
	iDestinationFolder=aDestination;
	iMessageSelection=iSelectionStillToCopy=iSelectionStillToDelete=aSourceSel.Count();

	// Check that selection elements are contiguous. Just call Copy on contiguous selections.
	
	iSourceFolder=FindFolderL((*iSourceSel)[iSelectionStillToCopy-1]);

	// Find the offending source folder
	if (iSourceFolder == NULL &&
		aSequence != SeqMoveFromLocal && aSequence != SeqCopyFromLocal)
		{
		Complete(KErrNotFound);
		return;
		}

	// Select it
	iStep=0;
	iSequence=aSequence;
	DoRunL();
	}
/**
Provides the sync class with an array of messages that are not to be fetched according
to the download rules. This function is called by the background sync controller if a
fetch command is received by the server MTM is performing a background synchronise, and
allows the sync operation to prevent attempts to simultaneously fetch the same message
via multiple imap sessions.

If message content fetch is already underway, then the array is passed to the 
CImapCompoundCopyToLocal object for immediate checking. The array is then stored
within this class and each subsequent copy to local operation is checked for matching
message id's.

Note that it is possible for a message ID to be remove from the passed entry selection
in the case that that message is currently being fetched at the time of calling this
function.

@param aSelection - the selection of messages that should not be autofetched
*/
void CImapCompoundSyncService::RemoveFromSelectionL(CMsvEntrySelection& aDeleteSel)
	{
	if (iCurrentStep == ESyncFolderAutoFetch ||
	    iCurrentStep == ESyncInboxAutoFetch  ||
	    iCurrentStep == ESyncFolderAutoFetchCheck)
		{
		((CImapCompoundCopyToLocal*)iImapCompound)->RemoveFromSelection(aDeleteSel);
		}

	// keep a copy of this selection to prevent future fetch clashes.
	delete iDoNotFetchSel;
	iDoNotFetchSel = aDeleteSel.CopyL();
	}
Exemplo n.º 4
0
void CSchSendTestWaitForState::DoStartL(const CMsvEntrySelection& aSelection, TTimeIntervalMicroSeconds32 aAfter, TBool aWaitForever)
	{
	iTest(iSendingStates.Count() != 0);

	iAfter = aAfter;
	iWaitForever = aWaitForever;

	delete iSelection;
	iSelection = NULL;
	iSelection = aSelection.CopyL();

	iTimer.After(iStatus, iAfter);
	SetActive();

	CActiveScheduler::Start();
	}
Exemplo n.º 5
0
EXPORT_C TInt CMsvServerEntry::ChangeAttributes(const CMsvEntrySelection& aSelection, TUint aSetAttributes, TUint aClearAttributes)
//
//
//
/** Provides a quick way to set or clear multiple fields in a selection of entries.

Fields to change are specified using a bitmask of TMsvAttribute values. Possible
fields that can be changed using this function are:

1. PC synchronisation

2. Visibility flag

3. Read flag

4. In-preparation flag

5. Connected flag

6. New flag

@param aSelection The entries to change
@param aSetAttributes A bitmask of the fields to set
@param aClearAttributes A bitmask of the fields to clear
@return KErrNone if successful, otherwise one of the system-wide error codes.
KErrNotFound if a specified entry does not exist.
@see TMsvAttribute */
	{
	__ASSERT_DEBUG(iEntry.Id()!=KMsvNullIndexEntryId, PanicServer(EMsvEntryWithNoContext11));

	// only change children
	if (!AreChildren(aSelection))
		return KErrNotFound;

	// get a copy of the selection
	CMsvEntrySelection* changedEntries=NULL;
	TRAPD(error, changedEntries = aSelection.CopyL());
	if (error)
		return error;

	// lock all the selection
	TInt count1=aSelection.Count();
	while (count1--)
		{
		error = iServer.IndexAdapter().LockEntry(aSelection.At(count1));
		if (error)
			break;
		}

	// change the attributes if all were locked
	if (error==KErrNone)
		{
		error = iServer.IndexAdapter().ChangeAttributes(*changedEntries, aSetAttributes, aClearAttributes);
		}

	// release all that were locked
	TInt count2=aSelection.Count();
	while (--count2>count1)
		{
		iServer.IndexAdapter().ReleaseEntry(aSelection.At(count2));
		}


	// notify server if any have been changed
	if (error==KErrNone && changedEntries->Count())
		iServer.NotifyChanged(EMsvEntriesChanged, *changedEntries, iEntry.Id());

	delete changedEntries;

	return error;
	}