コード例 #1
0
void CMsvSendExe::RestoreScheduleSettingsL(TMsvId aServiceId, const TUid& aMtm, CMsvScheduleSettings& aSettings)
	{
	TMsvSelectionOrdering order;
	order.SetShowInvisibleEntries(ETrue);
	CMsvEntry* cEntry = CMsvEntry::NewL(*iSession, KMsvRootIndexEntryId, order);
	CleanupStack::PushL(cEntry);

	if (aServiceId == KMsvLocalServiceIndexEntryId)
		{
		const TInt count = cEntry->Count();

		for (TInt i = 0; i < count; i++)
			{
			const TMsvEntry& entry = (*cEntry)[i];
			if (entry.iType == KUidMsvServiceEntry && entry.iMtm == aMtm)
				{
				aServiceId = entry.Id();
				break;
				}
			}
		}

	if (aServiceId == KMsvLocalServiceIndexEntryId)
		User::Leave(KErrNotFound);
	
	CRepository* repository = CRepository::NewLC(aMtm);
	TMsvScheduleSettingsUtils::LoadScheduleSettingsL(aSettings, *repository);
	CleanupStack::PopAndDestroy(2, cEntry); // repository, cEntry
	}
コード例 #2
0
void CMsvTestUtils::ShowChildrenL(const CMsvEntry& aEntry, TInt aStart, TInt& aMore, TInt aMaxCount)
	{
	iRTest.Printf(_L("Parent: "));

	DisplayChildL(aEntry.Entry());

	iRTest.Printf(KMsvTestUtilsNewLine);
	iRTest.Printf(KMsvTestUtilsNewLine);

	if (!aEntry.Entry().Owner())
		return;

	TInt count = aEntry.Count() - aStart;

	if (aMaxCount > 0)
		count = Min(count, aMaxCount);

	for (TInt i = aStart; i < count + aStart; i++)
		{
		TBuf<16> prefix;
		prefix.Zero();
		prefix.AppendNum(i - aStart);
		prefix.Append(_L(". ("));
		prefix.AppendFormat(_L("%2d"), i + 1),
		prefix.Append(_L("/"));
		prefix.AppendFormat(_L("%2d"), aEntry.Count()),
		prefix.Append(_L(")"));
		iRTest.Printf(prefix);
		DisplayChildL(aEntry[i]);
		iRTest.Printf(KMsvTestUtilsNewLine);
		}

	aMore = aEntry.Count() - aStart - aMaxCount;

	if (aMore > 0)
		iRTest.Printf(_L("...%d more...\n"), aMore);
	}
コード例 #3
0
ファイル: SMS_Monitor.cpp プロジェクト: DrJukka/Symbian_Codes
/*
-----------------------------------------------------------------------------
----------------------------------------------------------------------------
*/
void CSMSMonitor::CheckInboxL(void)
{	
	TInt smsCount(0),mmsCount(0);

	CMsvEntry* Entrie = iSession->GetEntryL(KMsvGlobalInBoxIndexEntryId);
	if(Entrie)
	{
		CleanupStack::PushL(Entrie);
		
		if(Entrie->Count())
		{
			TMsvSelectionOrdering MySortType;
			
			MySortType.SetSorting(EMsvSortByDate);
			
			Entrie->SetSortTypeL(MySortType);
			
			CMsvEntrySelection* entries = Entrie->ChildrenL();
			if(entries)
			{
				CleanupStack::PushL(entries);
		 
				for(TInt i = (entries->Count() - 1); i >= 0; i--)
				{
					if(Entrie->ChildDataL(entries->At(i)).Unread())
					{	
						if(Entrie->ChildDataL(entries->At(i)).iMtm == KUidMsgTypeSMS)
						{
							smsCount++;
						}
						else if(Entrie->ChildDataL(entries->At(i)).iMtm == KUidMsgTypeMultimedia)
						{
							mmsCount++;
						}
					}
				} 
			
				CleanupStack::PopAndDestroy(entries);
			}
		}
		
		CleanupStack::PopAndDestroy(1);//Entrie
	}
	
	if(iObserver){
		iObserver->InboxChangedL(smsCount,mmsCount);
	}
}
コード例 #4
0
void CTestUTCParse::TraverseL(const TMsvId aTMsvId)
	{
	//open the entry, dont sort
	TMsvSelectionOrdering ordering;	
	ordering.SetSorting(EMsvSortByNone);
	CMsvEntry* entry = CMsvEntry::NewL(*iSession, aTMsvId,ordering);
	CleanupStack::PushL(entry);
	
	//retrieve the entries children
	CMsvEntrySelection* msvEntrySelection;
	msvEntrySelection=entry->ChildrenL();
	CleanupStack::PushL(msvEntrySelection);
	TInt count = entry->Count();
	
	CMsvEntry* child;
	TMsvEntry childDetails;

	//for each child test if its a message entry
	for(TInt i=0;i<count;i++)
		{
		child=iSession->GetEntryL((*msvEntrySelection)[i]);
		childDetails=child->Entry();
		
		if(childDetails.iType==KUidMsvMessageEntry)
			{
			iMessageEntryCount++;
			iTimeList->AppendL(childDetails.iDate);
			PrintEntryTime(&childDetails.iDate);
			}
		//recursive call
		TraverseL(childDetails.Id());
		if(child)
			{
			delete child;
			}
		}
			
	CleanupStack::PopAndDestroy(msvEntrySelection);
	CleanupStack::PopAndDestroy(entry);
		
	}
コード例 #5
0
void CTestUTCSort::RemoveDefaultEntryL()
	{
	
	TMsvSelectionOrdering ordering;	
	
		//sort the gloabl inbox by date
	CMsvEntry* inboxEntry = CMsvEntry::NewL(*iSession, KMsvDraftEntryIdValue,ordering);
	CleanupStack::PushL(inboxEntry);
	
	if(inboxEntry->Count()==1)
		{
		CMsvEntrySelection* mvEntrySelection;
		mvEntrySelection=inboxEntry->ChildrenL();
		CleanupStack::PushL(mvEntrySelection);
		CMsvEntry* child;		
		child=iSession->GetEntryL((*mvEntrySelection)[0]);
		iSession->RemoveEntry(child->EntryId());
		delete child;
		CleanupStack::PopAndDestroy(mvEntrySelection);
		}
	
	CleanupStack::PopAndDestroy(inboxEntry);
		
	}
コード例 #6
0
TInt CMsvTestUtils::DoNavigateMessageStoreL(TMsvId& aParent, TInt& aStart)
	{
	TMsvSelectionOrdering order;
	order.SetShowInvisibleEntries(ETrue);
	CMsvEntry* parent = CMsvEntry::NewL(*iMsvSession, aParent, order);
	CleanupStack::PushL(parent);

	iRTest.Printf(KMsvTestUtilsNewLine);
	TInt more = 0;
	const TInt KMax = 10;
	ShowChildrenL(*parent, aStart, more, KMax);
	iRTest.Printf(KMsvTestUtilsNewLine);

	iRTest.Printf(_L("Select a message or '.' (for parent) or 'N'ext or 'P'revious or e'X'it\n"));

	const TInt count = Min(KMax, parent->Count() - aStart);
	const TChar startChar = '0';
	const TChar endChar = startChar + count - 1;
	const TChar key = iRTest.Getch();

	TInt ret = KErrNotFound;

	if (key >= '0' && key <= endChar)
		{
		iRTest.Printf(KMsvTestUtilsNewLine);

		TMsvEntry entry((*parent)[key - startChar + aStart]);

		if (entry.Owner())
			{
			aStart = 0;
			aParent = entry.Id();
			}
		else
			{
			DisplayChildDetailsL(entry);
			}

		ret = KErrNone;
		}
	else if (key == '.')
		{
		aStart = 0;
		if (aParent != KMsvRootIndexEntryId)
			aParent = parent->Entry().Parent();

		ret = KErrNone;
		}
	else if (key == 'n' || key == 'N')
		{
		if (more > 0)
			{
			aStart += KMax;
			}

		ret = KErrNone;
		}
	else if (key == 'p' || key == 'P')
		{
		if (aStart > 0)
			{
			aStart -= KMax;
			}

		ret = KErrNone;
		}
	else if (key == 'x' || key == 'X')
		{
		ret = KErrDied;
		}

	CleanupStack::PopAndDestroy(parent);
	return ret;
	}