summaryrefslogtreecommitdiff
path: root/libopie/pim/test/oevent_test.cpp
blob: d83ee0badf72ca9541061d779dc0bfbd4d5d838f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <qdatetime.h>

#include "../oevent.h"
#include "../odatebookaccess.h"

int main(int argc, char* argv ) {
    ODateBookAccess acc;
    if(!acc.load() ) qWarning("could not load");

    ODateBookAccess::List::Iterator it;
    ODateBookAccess::List list = acc.allRecords();

    for( it = list.begin(); it != list.end(); ++it ){
	OEvent ev = (*it);
	qWarning("Summary: %s",ev.description().latin1() );
	qWarning("Start: %s End: %s",ev.startDateTime().toString().latin1(), ev.endDateTime().toString().latin1() );
	qWarning("All Day: %d",ev.isAllDay() );

    }
    QDate date1(2003,02,01 );
    QDate date2(2003,03,01 );

    OEffectiveEvent::ValueList effList = acc.effectiveEvents( date1,date2 );
    OEffectiveEvent::ValueList::Iterator effIt;

    for( effIt = effList.begin(); effIt != effList.end(); ++effIt ){
	OEffectiveEvent ef = (*effIt);
	qWarning("Summary: %s", ef.description().latin1() );
	qWarning("Date: %s", ef.date().toString().latin1() );
    }

    return 0;
}