本文整理汇总了C++中TMsvEntry::Scheduled方法的典型用法代码示例。如果您正苦于以下问题:C++ TMsvEntry::Scheduled方法的具体用法?C++ TMsvEntry::Scheduled怎么用?C++ TMsvEntry::Scheduled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TMsvEntry
的用法示例。
在下文中一共展示了TMsvEntry::Scheduled方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddTaskL
void CMsvSendExe::AddTaskL(const TMsvSchedulePackage& aPackage)
{
CMsvEntry* cEntry = NULL;
TRAPD(err, cEntry = iSession->GetEntryL(aPackage.iId));
if (err != KErrNotFound)
{
User::LeaveIfError(err);
CleanupStack::PushL(cEntry);
TMsvEntry entry = cEntry->Entry();
const TInt sendState = entry.SendingState();
//Only send the message if sending state is Scheduled or Resend.
if (entry.Scheduled() && (sendState == KMsvSendStateScheduled || sendState == KMsvSendStateResend))
{
entry.SetSendingState(KMsvSendStateWaiting);
// Fix for DEF000924: Need to be able to send/cancel an sms while another is being sent
if (entry.iServiceId == KMsvLocalServiceIndexEntryId && entry.iRelatedId != KMsvNullIndexEntryId)
{
SCHSENDLOG( FLog(iFileName, _L("Changing service from %x to %x"), entry.iServiceId, entry.iRelatedId));
entry.iServiceId = entry.iRelatedId;
}
else
{
SCHSENDLOG( FLog(iFileName, _L("Not changing service from %x (related=%x)"), entry.iServiceId, entry.iRelatedId));
}
// End of fix
cEntry->ChangeL(entry);
AddTaskL(aPackage, entry.iMtm);
SCHSENDLOG(FLog(iFileName, _L("\t\tMsg=%d [Mtm=%d SendState=%d]"), aPackage.iId, entry.iMtm.iUid, entry.SendingState()));
}
else
{
SCHSENDLOG(FLog(iFileName, _L("\t\tIGNORING Msg=%d (Mtm=%d SendState=%d Scheduled=%d)"), aPackage.iId, entry.iMtm.iUid, sendState, entry.Scheduled()));
}
CleanupStack::PopAndDestroy(cEntry);
}
else
{
SCHSENDLOG(FLog(iFileName, _L("\t\tIGNORING Msg=%d: NOT FOUND"), aPackage.iId));
}
}
示例2: CheckScheduleL
/**
Verifies that the schedule information stored in specified messages is the
same as that on the task scheduler.
@param aSelection
Array of message IDs that need to be checked against the task scheduler.
@panic ScheduleSend-DLL 0
The array of message IDs is empty.
Debug build only.
*/
EXPORT_C void CMsvScheduleSend::CheckScheduleL(const CMsvEntrySelection& aSelection)
{
__ASSERT_DEBUG(aSelection.Count(), gPanic(EMessageSelectionEmpty));
GetMessagesL(aSelection); //Leaves with KErrNotFound if there are no messages returned in iSchEntries
TInt entryCount = iSchEntries->Count();
SCHSENDLOG(FLog(_L8("Asked to check schedule for %d msgs"), entryCount));
ConnectAndRegisterL();
while (entryCount--)
{
TBool found = EFalse;
TTsTime schTime;
CMsvScheduledEntry& sEntry = *iSchEntries->At(entryCount);
if (!sEntry.iData.IsReset())
{
TSchedulerItemRef ref;
TInt size = 0;
TTaskInfo info;
TInt err = iScheduler.GetTaskDataSize(sEntry.iData.iTaskId, size);
if (!err)
{
HBufC* buf = HBufC::NewLC(size);
TPtr ptr = buf->Des();
User::LeaveIfError(iScheduler.GetTaskInfoL(sEntry.iData.iTaskId, info, ptr, ref, schTime));
CleanupStack::PopAndDestroy(buf);
found = ETrue;
}
else if (err != KErrNotFound)
{
User::Leave(err);
}
}
if (iServerEntry.SetEntry(sEntry.Id()) == KErrNone)
{
TMsvEntry entry = iServerEntry.Entry();
TInt sendingState = entry.SendingState();
if (sendingState == KMsvSendStateScheduled || sendingState == KMsvSendStateResend || entry.Scheduled())
{
if (found)
{
entry.SetScheduled(ETrue);
entry.iDate = schTime.GetUtcTime();
User::LeaveIfError(iServerEntry.ChangeEntry(entry));
}
else
{
entry.SetScheduled(EFalse);
entry.SetSendingState(KMsvSendStateUnknown);
entry.iDate.UniversalTime();
User::LeaveIfError(iServerEntry.ChangeEntry(entry));
SendingCompleteL(sEntry, EFalse);
}
}
}
}
}