TBool CSmsReplyToStep::CheckMessageL()
	{

	INFO_PRINTF1(_L("Received new message in Inbox - should be status report..."));
		
	TMsvSelectionOrdering ordering;	
	ordering.ShowInvisibleEntries();
	CMsvEntry* entry = CMsvEntry::NewL(*iSession, KMsvGlobalInBoxIndexEntryId,ordering);
	CleanupStack::PushL(entry);
	
	CMsvEntrySelection* msvEntrySelection;
	msvEntrySelection=entry->ChildrenL();
	CleanupStack::PushL(msvEntrySelection);
	
	// Check how many mesasges there are - should be just 1
	TInt count = msvEntrySelection->Count();
	INFO_PRINTF3(_L("Number of new messages: %d, should be: %d"), count, 1);

	// Restore the message
	CSmsHeader* header = CSmsHeader::NewL(CSmsPDU::ESmsDeliver, *iTestUtils->iRichText);
	CleanupStack::PushL(header);
	entry->SetEntryL((*msvEntrySelection)[0]);

	CMsvStore* store = entry->ReadStoreL();
	CleanupStack::PushL(store);	
	header->RestoreL(*store);
	
	if(store->HasBodyTextL())
		{
		store->RestoreBodyTextL(*iTestUtils->iRichText);	
		}
		
	TBuf<KSmsDescriptionLength> desc;
	User::LeaveIfError(TSmsUtilities::GetDescription(header->Message(), desc));
	
	//Check for a reply address field
	CSmsReplyAddressOperations& operations = STATIC_CAST(CSmsReplyAddressOperations&,header->Message().GetOperationsForIEL(CSmsInformationElement::ESmsReplyAddressFormat));
	TBool result=operations.ContainsReplyAddressIEL();

	CleanupStack::PopAndDestroy(4,entry);	
	return result;	
	}
void TestUniDataModelVCalPlugin::CreateBioEntryClientSideL(TMsvEntry& aEntry,
                                                           CRichText& aBody)
{
		if (inbox)
			{
				iMsvEntry->SetEntryL(KMsvGlobalInBoxIndexEntryId);
			}
		else if (drafts)
			{
				iMsvEntry->SetEntryL(KMsvDraftEntryId);
			}
		//  Get the global inbox.   

		iMsvEntry->CreateL(aEntry);
		iMsvEntry->SetEntryL(aEntry.Id());

		// Save all the changes
		CMsvStore* store = iMsvEntry->EditStoreL();
		CleanupStack::PushL(store);

		if (store->HasBodyTextL())
			{
				store->DeleteBodyTextL();
			}

		CPlainText* pText = CPlainText::NewL();
		CleanupStack::PushL(pText);

		if (inbox)
			{
				CSmsHeader* smsHeader = CSmsHeader::NewL(CSmsPDU::ESmsDeliver, *pText);
				CleanupStack::PushL(smsHeader);
				smsHeader->SetFromAddressL(*tempNumber);
				smsHeader->StoreL(*store);
				
			}
		else if (drafts)
			{

			QString recepient(TEST_MSG_FROM1);
			QString recepient2(TEST_MSG_FROM2);
			QString alias(TEST_MSG_ALIAS1);

			HBufC* addr = XQConversions::qStringToS60Desc(recepient);
			HBufC* addr2 = XQConversions::qStringToS60Desc(recepient2);
			HBufC* alias1 = XQConversions::qStringToS60Desc(alias);

			CSmsHeader* smsHeader = CSmsHeader::NewL(CSmsPDU::ESmsSubmit, *pText);
			CleanupStack::PushL(smsHeader);

			CSmsNumber* number1 = CSmsNumber::NewL(); // create the instance
			CleanupStack::PushL(number1);

			number1->SetNameL(TPtrC());
			number1->SetAddressL(*addr);
			smsHeader->Recipients().AppendL(number1);
			CleanupStack::Pop(number1);

			CSmsNumber* number2 = CSmsNumber::NewL();
			CleanupStack::PushL(number2);

			number2->SetNameL(*alias1);
			number2->SetAddressL(*addr2);

			smsHeader->Recipients().AppendL(number2);
			CleanupStack::Pop(number2);
			smsHeader->StoreL(*store);

			}

    store->StoreBodyTextL(aBody);
    store->CommitL();

    CleanupStack::PopAndDestroy(3); //store - close the store

    aEntry.SetComplete(ETrue);
    // Update the entry
    iMsvEntry->ChangeL(aEntry);
    iMsvEntry->SetEntryL(KMsvRootIndexEntryId);
}