本文整理汇总了C++中TCalTime::TimeLocalL方法的典型用法代码示例。如果您正苦于以下问题:C++ TCalTime::TimeLocalL方法的具体用法?C++ TCalTime::TimeLocalL怎么用?C++ TCalTime::TimeLocalL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TCalTime
的用法示例。
在下文中一共展示了TCalTime::TimeLocalL方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetUntil
/** Sets the repeat's end date.
Only one of the until or count parameters may be set. Setting the until date will reset the count parameter.
If the until date is set to TCalTime::MaxTime() the rule will repeat forever.
@param aEndDate The end date, as a TCalTime so it may be accessed in utc or system local time.
@publishedAll
@released
@capability None
*/
EXPORT_C void TCalRRule::SetUntil(const TCalTime& aEndDate)
{
//"-1" means only until time has been set
iCount = -1;
if (aEndDate.TimeUtcL() == TCalTime::MaxTime() || aEndDate.TimeLocalL() == TCalTime::MaxTime())
{
iCount = 0;
}
iUntil = aEndDate;
}
示例2: ExtractInstancesL
// Helper method
// Extract all instances given by Guids in iCurrentTestData
void CDummyCalendarApp::ExtractInstancesL()
{
TCalTime startDate;
startDate.SetTimeLocalL(iCurrentTestData->iStartDate);
TCalTime endDate;
endDate.SetTimeLocalL(iCurrentTestData->iEndDate);
CalCommon::TCalTimeRange timeRange(startDate, endDate);
RPointerArray<CCalInstance> instanceArray;
if (iCurrentTestData->iSearchString)
{
CCalInstanceView::TCalSearchParams searchParams(*iCurrentTestData->iSearchString, iCurrentTestData->iSearchBehaviour);
iInstanceView->FindInstanceL(instanceArray,
(CalCommon::TCalViewFilter)iCurrentTestData->iFilter,
timeRange,
searchParams);
}
else
{
iInstanceView->FindInstanceL(instanceArray,
(CalCommon::TCalViewFilter)iCurrentTestData->iFilter,
timeRange);
}
TBuf<26> startBuf;
TBuf<26> endBuf;
startDate.TimeLocalL().FormatL(startBuf,KFormatDate());
endDate.TimeLocalL().FormatL(endBuf,KFormatDate());
test.Printf(_L("Checking instances between %S and %S\n"), &startBuf, &endBuf);
if (instanceArray.Count() == 0)
{
test.Printf(_L("No instances found\n"));
}
else
{
TInt instanceCount = 0;
TTime instTime;
TBuf<26> instBuf;
while (instanceCount < instanceArray.Count())
{
CCalInstance* inst = instanceArray[instanceCount];
CleanupStack::PushL(inst);
instTime = inst->Time().TimeLocalL();
instTime.FormatL(instBuf,KFormatDate());
TBuf<62> rptType;
TCalRRule rptDef;
if (!inst->Entry().GetRRuleL(rptDef))
{
rptType.Copy(_L("One off"));
}
else
{
switch (rptDef.Type())
{
case TCalRRule::EDaily:
rptType.Format(_L("Daily every %d days"), rptDef.Interval());
break;
case TCalRRule::EWeekly:
rptType.Format(_L("Weekly every %d weeks"), rptDef.Interval());
break;
case TCalRRule::EMonthly:
rptType.Format(_L("MonthlyByDates every %d months"), rptDef.Interval());
break;
case TCalRRule::EYearly:
rptType.Format(_L("YearlyByDate every %d years"), rptDef.Interval());
break;
default:
ASSERT(0);
break;
}
}
test.Printf(_L("One instance is on %S, %d:%d - %S"), &instBuf, instTime.DateTime().Hour(), instTime.DateTime().Minute(), &rptType);
if (iCurrentTestData->iTimes.Find(instTime) == KErrNotFound)
{
test.Printf(_L("THIS ENTRY WAS NOT EXPECTED\n"));
test(0);
}
instanceCount++;
CleanupStack::Pop(inst);
}
if (iCurrentTestData->iFunction)
ASSERT(iCurrentTestData->iFunction->CallBack() == 0);
}
if (instanceArray.Count() != iCurrentTestData->iTimes.Count())
{
//.........这里部分代码省略.........
示例3: AddEntryL
void CDummyCalendarApp::AddEntryL(TInt aNumToAdd, TBool isParent, TBool isRepeat)
{
test.Next(_L("Adding entries"));
TBuf<50> summary;
TBuf<50> location;
TBuf<50> description;
iEntries.ResetAndDestroy();
for (TInt index=0; index<aNumToAdd; index++)
{
TBuf8<255> buf;
buf.Append(_L("GuidId"));
buf.AppendNum(index);
HBufC8* guid = buf.AllocLC(); // need to be pushed to ...
CCalEntry::TType entryType=(index%2==0)?CCalEntry::ETodo:CCalEntry::EAppt;
CCalEntry* entry = NULL;
if(isParent)
{
entry = CreateCalEntryL(entryType, guid);
}
else
{
TTime localTime(KRecurrIdLocalTime);
TCalTime recurrenceId;
recurrenceId.SetTimeLocalL(localTime);
entry = CCalEntry::NewL(entryType, guid, CCalEntry::EMethodAdd, 1, recurrenceId, CalCommon::EThisAndFuture);
}
CleanupStack::Pop(guid);
iEntries.AppendL(entry);
TInt year = -1;
TInt month = -1;
TInt day = -1;
if (isParent)
{
year = index % 5 + 2001; // Any year in the range: 2001 - 2005
month = index % 12;
day = index % 28;
}
else
{
// if this is a child entry, use the recurrence local time as the entry start time
// so it won't be out of range
TCalTime recurrId = entry->RecurrenceIdL();
TDateTime localTime = recurrId.TimeLocalL().DateTime();
year = localTime.Year();
month = localTime.Month();
day = localTime.Day();
}
TTime start(TDateTime(year, (TMonth)month, day, 0, 0, 0, 0));
TTime end(TDateTime(year, (TMonth)month, day, 0, 0, 0, 0));
end += TTimeIntervalDays(1);
SetEntryStartAndEndTimeL(entry,start,end);
RandomText(summary);
entry->SetSummaryL(summary);
RandomText(location);
entry->SetLocationL(location);
RandomText(description);
entry->SetDescriptionL(description);
if(isRepeat)
{
//create a daily repeat rule and make sure its repeat start\end date is within the deleting time range
TCalRRule rpt(TCalRRule::EDaily);
rpt.SetInterval(1);
TCalTime repeatStart;
TCalTime repeatend;
if(isParent)
{
//make sure the repeat time is within the delete time range
repeatStart.SetTimeLocalL(TDateTime(2000, EJune, 0, 0, 0, 0, 0));
repeatend.SetTimeLocalL(TDateTime(2006, EJune, 0, 0, 0, 0, 0));
}
else if (index<aNumToAdd/2)
{
// if this is a child entry, use the entry's recurrance time as repeating rule
// start time
TCalTime recurrId = entry->RecurrenceIdL();
// make sure the repeat time is within the delete time range for the first half entries
repeatStart.SetTimeLocalL(recurrId.TimeLocalL()); // June 1, 2003 00:00:00
repeatend.SetTimeLocalL(recurrId.TimeLocalL() + TTimeIntervalMonths(1)); // July 1, 2003 00:00:00
}
else
{
//make sure the repeat time is out of the delete time range for the second half entries
repeatStart.SetTimeLocalL(TDateTime(2003, EJune, 0, 0, 0, 0, 0));
repeatend.SetTimeLocalL(TDateTime(2007, EJune, 0, 0, 0, 0, 0));
}
//.........这里部分代码省略.........