本文整理汇总了C++中TCalTime类的典型用法代码示例。如果您正苦于以下问题:C++ TCalTime类的具体用法?C++ TCalTime怎么用?C++ TCalTime使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TCalTime类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: calTimeRange
/**
* Delete all Instances in the calendar file
*/
void CTestCalInterimApiModifier::DeleteInstancesL()
{
CCalInstanceView* instanceView = CCalInstanceView::NewL(GetSession(), *this);
CleanupStack::PushL(instanceView);
CActiveScheduler::Start();
TInt err;
RPointerArray<CCalInstance> instanceArray;
TCalTime calStartDateTime;
calStartDateTime.SetTimeLocalL(TCalTime::MinTime());
TCalTime calEndDateTime;
calEndDateTime.SetTimeLocalL(TCalTime::MaxTime());
CalCommon::TCalTimeRange calTimeRange(calStartDateTime, calEndDateTime);
CleanupStack::PushL(TCleanupItem(ResetAndDestroyInstanceArray, &instanceArray));
instanceView->FindInstanceL(instanceArray, CalCommon::EIncludeAll, calTimeRange);
if(instanceArray.Count() != 0)
{
TRAP(err, instanceView->DeleteL(instanceArray[0], CalCommon::EThisAndAll));
instanceArray.Remove(0);
if(err != KErrNone)
{
iTestStep->ERR_PRINTF2(KErrDeleteOperation,err);
iTestStep->SetTestStepResult(EFail);
}
}
else
{
iTestStep->WARN_PRINTF1(KWarnInstancesNotFound);
}
CleanupStack::PopAndDestroy();// instanceArray
CleanupStack::PopAndDestroy(); // instanceView
}
示例2: JELOG2
// -----------------------------------------------------------------------------
// CPIMAgnToDoAdapter::AddDefaultValuesToEntryL
// (other items were commented in a header)
// -----------------------------------------------------------------------------
//
void CPIMAgnToDoAdapter::AddDefaultValuesToEntryL(const MPIMItemData& aData,
CCalEntry& aEntry) const
{
JELOG2(EPim);
// Calendar creates medium priority ToDos by default
if (!aData.CountValues(EPIMToDoPriority))
{
aEntry.SetPriorityL(EPIMToDoNativePriorityMedium);
}
// Calendar uses private synchronization by default
if (!aData.CountValues(EPIMToDoClass))
{
aEntry.SetReplicationStatusL(CCalEntry::EPrivate);
}
// Calendar does not support timed ToDo so the time is set to 00:00 o'clock
if (!aData.CountValues(EPIMToDoDue))
{
TTime thisTime;
thisTime.HomeTime();
// Set time to calendar specific due time. Currently this is the start
// of the date. Note that No conversion needed since time is local
TCalTime calThisTime;
// Set time as local time since acquired above as local time
calThisTime.SetTimeLocalL(StartOfDay(thisTime));
aEntry.SetStartAndEndTimeL(calThisTime, calThisTime);
}
if (!aData.CountValues(EPIMToDoCompletionDate) && !aData.CountValues(
EPIMToDoCompleted))
{
aEntry.SetCompletedL(EFalse, aEntry.CompletedTimeL());
}
}
示例3: KGUID
void CBadRRule::CreateChild1L()
{
TInt num ;
TCalTime recId;
recId.SetTimeUtcL(TTime(TDateTime(2006, EJanuary, 9, 10, 1, 0, 0))); // creating recurrence id
HBufC8* guid1 = KGUID().AllocLC(); // ownership of guid1 gets transferred
CCalEntry *entry1 = CCalEntry::NewL(CCalEntry::EEvent, guid1, CCalEntry::EMethodNone, 0, recId, CalCommon::EThisOnly);
CleanupStack::Pop(guid1);
CleanupStack::PushL(entry1) ;
TCalTime startTime3 ;
TCalTime endTime3 ;
startTime3.SetTimeUtcL(TTime(TDateTime(2006, EJanuary, 7, 10, 2, 0, 0))) ;
endTime3.SetTimeUtcL(startTime3.TimeUtcL() + TTimeIntervalHours(1)) ;
entry1->SetStartAndEndTimeL(startTime3, endTime3) ;
RPointerArray<CCalEntry> entryarr1 ;
entryarr1.AppendL(entry1) ;
iCalEntryView->StoreL(entryarr1, num) ;
entryarr1.Close() ;
CleanupStack::PopAndDestroy(entry1) ;
}
示例4: TRAPD
void CDummyCalendarApp::DeleteAllTodosL()
{
delete iTestLib;
iTestLib = NULL;
TBuf<60> dtBuf;
iTestLib = CCalTestLibrary::NewL();
TRAPD(err, iTestLib->PIMTestServer().DeleteFileL(KCalendarFile2));
if(err != KErrNotFound || err != KErrPathNotFound)
{
User::LeaveIfError(err);
}
iTestLib->PIMTestServer().CopyFileL(KOriginalDeleteCalendar, _L("c:\\private\\10003A5B\\tcal_delete_calendar_copy"));
iTestLib->RegisterCalFileL(KCalendarFile2);
iTestLib->OpenFileL(KCalendarFile2);
iTestLib->PIMTestServer().SetTimeZoneL(_L8("Europe/Helsinki"));
TCalTime minTime;
minTime.SetTimeUtcL(TCalTime::MinTime());
TCalTime maxTime;
maxTime.SetTimeUtcL(TCalTime::MaxTime());
CalCommon::TCalTimeRange timeRange(minTime, maxTime);
CalCommon::TCalViewFilter filter = CalCommon::EIncludeAll;
//DeleteL has to be placed in the end of the function
//because it is a long running operation and it needs
//to wait for callback in order to go to the next step.
iTestLib->SynCGetEntryViewL().DeleteL(timeRange, filter, *this);
}
示例5: range
void CDummyCalendarApp::DeleteEntryL(const TTime& aStart,const TTime& aEnd, CalCommon::TCalViewFilter aFilter)
{
TCalTime startTime;
TCalTime endTime;
startTime.SetTimeLocalL(aStart);
endTime.SetTimeLocalL(aEnd);
CalCommon::TCalTimeRange range(startTime,endTime);
iProgressNotifications = 0;
iLocalEntryView->DeleteL(range, aFilter, *this);
}
示例6: transformToDetailL
void OrganizerJournalTimeTransform::transformToDetailL(const CCalEntry& entry, QOrganizerItem *item)
{
if (item->type() == QOrganizerItemType::TypeJournal)
{
TCalTime dtstamp = entry.DTStampL(); // TODO: is DTStamp correct?
if (dtstamp.TimeUtcL() != Time::NullTTime()) {
QOrganizerJournalTime range;
range.setEntryDateTime(toQDateTimeL(entry.DTStampL()));
item->saveDetail(&range);
}
}
}
示例7: 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;
}
示例8: CheckTimezoneRules
TInt CheckTimezoneRules(const CCalEntry& aCalEntry)
{
//See if timezone rules are present, if they are then times should be UTC and not floating
//
CTzRules* tzRules = aCalEntry.TzRulesL();
TCalTime startTime = aCalEntry.StartTimeL();
if (tzRules)
{
test (startTime.TimeMode() != TCalTime::EFloating);
}
return KErrNone;
}
示例9: KGUIDInc081869
void CDummyCalendarApp::RepeatExceptedEntryCreateL()
{
test.Next(_L("Add entry, repeat twice, set excepted and delete"));
iEntries.ResetAndDestroy();
// Create new calendar entry.
CCalEntry* entry = NULL;
HBufC8* guid = KGUIDInc081869().AllocLC();
entry = CreateCalEntryL(CCalEntry::EAppt, guid);
CleanupStack::Pop(guid);
iEntries.AppendL(entry);
// Set start and end date.
TTime start(TDateTime(2006, EMarch, 6, 10, 0, 0, 0));
TTime end(TDateTime(2006, EMarch, 6, 14, 0, 0, 0));
SetEntryStartAndEndTimeL(entry, start, end);
TBuf<50> summary;
RandomText(summary);
entry->SetSummaryL(summary);
TBuf<50> location;
RandomText(location);
entry->SetLocationL(location);
TBuf<50> description;
RandomText(description);
entry->SetDescriptionL(description);
// Create a daily repeating rule that occurs for 2 days.
TCalRRule rpt(TCalRRule::EDaily);
rpt.SetInterval(1);
rpt.SetCount(2);
// Make sure the repeat time is within the delete time range.
TCalTime repeatStart;
TCalTime repeatEnd;
repeatStart.SetTimeLocalL(TDateTime(2006, EMarch, 6, 0, 0, 0, 0));
repeatEnd.SetTimeLocalL(TDateTime(2006, EMarch, 8, 0, 0, 0, 0));
rpt.SetDtStart(repeatStart);
rpt.SetUntil(repeatEnd);
entry->SetRRuleL(rpt);
// Store the entry. Because it repeats over 2 days, there will
// be 2 entries.
TInt entriesStored(0);
SynCGetEntryViewL().StoreL(iEntries, entriesStored);
test(entriesStored == iEntries.Count());
}
示例10: if
/**
* Converts the TTime to TCalTime based on the time mode given
@param aTimeData TTime variable to be set in the specified time mode
@param aCalTimeData time that is set in the specified time mode
@param aTimeMode time mode of the entry
*/
void CTestCalInterimApiSuiteStepBase::SetCalTimeL(const TTime& aTimeData, TCalTime& aCalTimeData, TCalTime::TTimeMode aTimeMode)
{
if(aTimeMode == TCalTime::EFloating)
{
aCalTimeData.SetTimeLocalFloatingL(aTimeData);
}
else if(aTimeMode == TCalTime::EFixedTimeZone)
{
aCalTimeData.SetTimeLocalL(aTimeData);
}
else
{
aCalTimeData.SetTimeUtcL(aTimeData);
}
}
示例11: KNumEntriesToAdd
void CDummyCalendarApp::DeleteAllMemosBeginL()
{
test.Printf(_L("Test: DeleteAllMemosBeginL\r\n"));
//Add 1000 entries
test.Printf(_L("Adding 1000 Memos...\r\n"));
const TInt KNumEntriesToAdd(1000);
iTestLib->OpenFileL(KCalendarFile);
for (TInt i(0) ; i < KNumEntriesToAdd ; ++i)
{
HBufC8* guid = NULL;
CCalEntry* entry = iTestLib->CreateCalEntryL(CCalEntry::EReminder, guid);
CleanupStack::PushL(entry);
SetEntryStartAndEndTimeL(entry,
TDateTime(2005, ESeptember, 12, 0, 0, 0, 0),
TDateTime(2005, ESeptember, 12, 1, 0, 0, 0));
RPointerArray<CCalEntry> entryArray;
CleanupClosePushL(entryArray);
entryArray.AppendL(entry);
TInt num;
iTestLib->SynCGetEntryViewL().StoreL(entryArray, num);
CleanupStack::PopAndDestroy(&entryArray);
CleanupStack::PopAndDestroy(entry);
test.Printf(_L("."));
}
TCalTime minTime;
minTime.SetTimeUtcL(TCalTime::MinTime());
TCalTime maxTime;
maxTime.SetTimeUtcL(TCalTime::MaxTime());
CalCommon::TCalTimeRange timeRange(minTime, maxTime);
iActive->SetStep(CAppActive::EDeleteAllMemosMiddle);
//Attempt to delete all the entries
test.Printf(_L("Deleting all the entries...\r\n"));
iTestLib->SynCGetEntryViewL().DeleteL(timeRange, CCalEntry::EReminder, *this);
CActiveScheduler::Start();
delete iTestLib;
iTestLib = NULL;
}
示例12: CleanupClosePushL
/**
* Delete entries by local uids
*/
void CTestCalInterimApiModifier::DeleteEntriesByArrayOfLocalUidsL()
{
RArray<TCalLocalUid> localUids;
CleanupClosePushL(localUids);
TCalTime minTime;
minTime.SetTimeUtcL(TCalTime::MinTime());
iEntryView->GetIdsModifiedSinceDateL(minTime, localUids);
TInt numSuccessfulDeleted(0);
TRAPD(err, iEntryView->DeleteL(localUids, numSuccessfulDeleted));
if(err != KErrNone)
{
iTestStep->ERR_PRINTF2(KErrDeleteOperation,err);
iTestStep->SetTestStepResult(EFail);
}
CleanupStack::PopAndDestroy(&localUids); // Close()
}
示例13: _LIT
void CCalOOMTest::TestFindInstancesL(const TDesC& aFindStartTime, const TDesC& aFindEndTime, CalCommon::TCalViewFilter aFilter)
{
test.Next(_L("OOM tests for FindInstanceL"));
_LIT(KSearchText, "summary");
TCalTime findSt;
findSt.SetTimeLocalL(TTime(aFindStartTime));
TCalTime findEnd;
findEnd.SetTimeLocalL(TTime(aFindEndTime));
CalCommon::TCalTimeRange range(findSt, findEnd);
RPointerArray<CCalInstance> instances;
CCalInstanceView::TCalSearchParams params(KSearchText, CalCommon::EFoldedTextSearch);
CCalInstanceView& view = iTestLib->SynCGetInstanceViewL();
TInt tryCount = 1;
TInt err = 0;
// OOM LOOP
for ( ;; )
{
RDebug::Printf("%d", tryCount);
instances.ResetAndDestroy();
__UHEAP_SETFAIL(RHeap::EFailNext, tryCount);
__UHEAP_MARK;
TRAP(err, view.FindInstanceL(instances, aFilter, range, params));
if( instances.Count()>0 )
{
instances.ResetAndDestroy(); //we are responsible for Cleanup of this array
}
__UHEAP_MARKEND;
if ( err==KErrNone )
{
__UHEAP_RESET;
RDebug::Printf("Memory allocation testing for FindInstance is done");
break;
}
test(err == KErrNoMemory);
__UHEAP_SETFAIL(RHeap::ENone, 0);
tryCount++;
}
// OOM LOOP
}
示例14: CopyExceptionDatesToPimL
// -----------------------------------------------------------------------------
// CopyExceptionDatesToPimL
// Copies Agenda exception dates to a PIM API repeat rule.
// Returns: void
// -----------------------------------------------------------------------------
//
void CopyExceptionDatesToPimL(const CCalEntry& aAgnEntry,
MPIMRepeatRuleData& aPimRepeatRuleData)
{
JELOG2(EPim);
RArray<TCalTime> agnExceptionDates;
aAgnEntry.GetExceptionDatesL(agnExceptionDates);
CleanupClosePushL(agnExceptionDates);
const TInt numExceptions = agnExceptionDates.Count();
for (TInt i = 0; i < numExceptions; i++)
{
TCalTime agnExceptionDate = agnExceptionDates[i];
TTime pimExceptionDate = agnExceptionDate.TimeUtcL();
aPimRepeatRuleData.AddExceptDateL(pimExceptionDate);
}
CleanupStack::PopAndDestroy(); // agnExceptionDates close
}
示例15: CleanupClosePushL
void CMultiThreadTestApp::FetchEntryL(CCalEntryView& aView, RPointerArray<CCalEntry>& aEntries)
{
RArray<TCalLocalUid> entryIds;
CleanupClosePushL(entryIds);
TCalTime minTime;
minTime.SetTimeUtcL(TCalTime::MinTime());
aView.GetIdsModifiedSinceDateL(minTime, entryIds);
TInt count = entryIds.Count();
for (TInt ii = 0; ii<count; ++ii)
{
CCalEntry* entry = aView.FetchL(entryIds[ii]);
aEntries.AppendL(entry);
}
CleanupStack::PopAndDestroy(&entryIds);
}