27 #include <tdeconfig.h>
28 #include <kstandarddirs.h>
29 #include <tdeconfig.h>
32 #include "timespanwidget.h"
33 #include "koglobals.h"
35 #include "kotimespanview.h"
36 #include "kotimespanview.moc"
38 KOTimeSpanView::KOTimeSpanView(
Calendar *calendar, TQWidget *parent,
42 TQBoxLayout *topLayout =
new TQVBoxLayout(
this );
44 mTimeSpanWidget =
new TimeSpanWidget(
this );
45 topLayout->addWidget( mTimeSpanWidget );
47 connect( mTimeSpanWidget, TQ_SIGNAL( dateRangeChanged() ), TQ_SLOT( updateView() ) );
50 KOTimeSpanView::~KOTimeSpanView()
54 void KOTimeSpanView::readSettings()
56 kdDebug(5850) <<
"KOTimeSpanView::readSettings()" << endl;
58 TDEConfig config(
"korganizerrc",
true,
false);
59 config.setGroup(
"Views");
61 TQValueList<int> sizes = config.readIntListEntry(
"Separator TimeSpanView");
62 if (sizes.count() == 2) {
63 mTimeSpanWidget->setSplitterSizes(sizes);
67 void KOTimeSpanView::writeSettings(TDEConfig *config)
71 config->setGroup(
"Views");
73 TQValueList<int> list = mTimeSpanWidget->splitterSizes();
74 config->writeEntry(
"Separator TimeSpanView",list);
77 int KOTimeSpanView::maxDatesHint()
82 int KOTimeSpanView::currentDateCount()
87 Incidence::List KOTimeSpanView::selectedIncidences()
89 Incidence::List selected;
94 void KOTimeSpanView::updateView()
96 insertItems( mTimeSpanWidget->startDateTime().date(),
97 mTimeSpanWidget->endDateTime().date() );
100 void KOTimeSpanView::showDates(
const TQDate &start,
const TQDate &end)
102 TQDate s = start.addDays( -2 );
103 TQDate e = end.addDays( 2 );
108 void KOTimeSpanView::insertItems(
const TQDate &start,
const TQDate &end)
110 mTimeSpanWidget->clear();
111 mTimeSpanWidget->setDateRange( start, end );
113 Event::List events = calendar()->
events( start, end );
114 Event::List::ConstIterator it;
115 for( it = events.begin(); it != events.end(); ++it ) {
116 mTimeSpanWidget->addItem( *it );
119 mTimeSpanWidget->updateView();
126 void KOTimeSpanView::changeIncidenceDisplay(
Incidence *,
int)
virtual Event::List events(EventSortField sortField=EventSortUnsorted, SortDirection sortDirection=SortDirectionAscending)
KOEventView is the abstract base class from which all other calendar views for event data are derived...
virtual void showIncidences(const Incidence::List &incidenceList, const TQDate &date)=0
Show given incidences.