当前位置: 首页>>代码示例>>C++>>正文


C++ CCalEntry::GetExceptionDatesL方法代码示例

本文整理汇总了C++中CCalEntry::GetExceptionDatesL方法的典型用法代码示例。如果您正苦于以下问题:C++ CCalEntry::GetExceptionDatesL方法的具体用法?C++ CCalEntry::GetExceptionDatesL怎么用?C++ CCalEntry::GetExceptionDatesL使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CCalEntry的用法示例。


在下文中一共展示了CCalEntry::GetExceptionDatesL方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: 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
}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:23,代码来源:cpimagneventadapter.cpp

示例2: writeStream

TVerdict CTestCalInterimApiDEF064928Step::doTestStepL()
	{
	CActiveScheduler* scheduler = new(ELeave)CActiveScheduler;
	CleanupStack::PushL(scheduler);  
	CActiveScheduler::Install(scheduler);

	iSession  = CCalSession::NewL();
	
	CTestCalInterimApiCallbackForAlarms* alarmCallback = CTestCalInterimApiCallbackForAlarms::NewL(this);
	CleanupStack::PushL(alarmCallback); 

	OpenSessionFileL();
	iEntryView = CCalEntryView::NewL(*iSession,*alarmCallback);
	
	SetTestStepResult(EFail);
	
	CActiveScheduler::Add(alarmCallback);
	CActiveScheduler::Start();
	
	TUint seqNo = 1;
	HBufC8* pGUID1= KAlarmExportTestGUID1().AllocLC();
	CCalEntry* entry1 = CCalEntry::NewL(CCalEntry::EAppt, pGUID1,
	                                    CCalEntry::EMethodAdd, seqNo);
	CleanupStack::Pop(pGUID1); // entry takes ownership
	CleanupStack::PushL(entry1);                                   

	TDateTime entryStart1(2006, EJuly, 6, 15, 0, 0, 0);
	TCalTime  calStart1;
	calStart1.SetTimeLocalL(entryStart1);
	TDateTime entryStop1(2006, EJuly, 6, 16, 0, 0, 0);
	TCalTime calStop1;
	calStop1.SetTimeLocalL(entryStop1);
	entry1->SetStartAndEndTimeL(calStart1, calStop1);

	TCalRRule* rpt = new (ELeave) TCalRRule(TCalRRule::EDaily);
	CleanupStack::PushL(rpt); 

	rpt->SetInterval(1);
	TCalTime startTime;
	startTime.SetTimeLocalL(TDateTime(2006, EJuly, 6, 0, 0, 0, 0));
	rpt->SetDtStart(startTime);
	TCalTime endTime;
	endTime.SetTimeLocalL(TDateTime(2006, EJuly, 10, 0, 0, 0, 0));
	rpt->SetUntil(endTime);
	entry1->SetRRuleL(*rpt); // doesn't take ownership

	CleanupStack::PopAndDestroy(rpt); 
	
	SaveToAgendaL(entry1, EFalse);

	seqNo++;
	HBufC8* pGUID2= KAlarmExportTestGUID2().AllocLC();
	TDateTime entryTime2(2006, EJuly, 9, 15, 0, 0, 0);
	TCalTime  calTime2;
	calTime2.SetTimeLocalL(entryTime2);
	CCalEntry* entry2 = CCalEntry::NewL(CCalEntry::EAppt, pGUID2,
	                                    CCalEntry::EMethodAdd, seqNo, calTime2, 
	                                    CalCommon::EThisOnly);
	CleanupStack::Pop(pGUID2); // entry takes ownership
	CleanupStack::PushL(entry2);                                   

	CreateExceptionDateL(entry2, entry1);

	RArray<TCalTime> exDateList1;
	CleanupClosePushL(exDateList1);
	entry1->GetExceptionDatesL(exDateList1);
	TESTL(exDateList1[0].TimeLocalL() == calTime2.TimeLocalL());
	CleanupStack::PopAndDestroy();

	//build the CCalDataExchange object and Export
	RFs   fs;
	fs.Connect();
	CleanupClosePushL(fs);
	
	CCalDataExchange* dataExchange = CCalDataExchange::NewL(*iSession);
	CleanupStack::PushL(dataExchange); 
	RFile outFile;
	CleanupClosePushL(outFile);
	TInt err = outFile.Replace(fs, KEntryExportFile, EFileWrite);
	RFileWriteStream writeStream(outFile);
	CleanupClosePushL(writeStream);
	
	INFO_PRINTF1(KExporting);
	RPointerArray<CCalEntry> firstEntryArray;
	CleanupStack::PushL(TCleanupItem(CloseAndDeleteRPtrArrayEntries, &firstEntryArray));
	iEntryView->FetchL(entry1->UidL(), firstEntryArray);
		
	dataExchange->ExportL(KUidVCalendar, writeStream, firstEntryArray);
	
	writeStream.CommitL();
	
	// check that the exception date was stored correctly
	CCalEntry *fetchedEntry = firstEntryArray[0];
	RArray<TCalTime> exDateList2;
	fetchedEntry->GetExceptionDatesL(exDateList2);
	CleanupClosePushL(exDateList2);
	TESTL(exDateList2[0].TimeLocalL() == calTime2.TimeLocalL());
	
	CleanupStack::PopAndDestroy();
	CleanupStack::PopAndDestroy();
//.........这里部分代码省略.........
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:101,代码来源:TestCalInterimApiExceptionStep.cpp


注:本文中的CCalEntry::GetExceptionDatesL方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。