korganizer

multiagendaview.h
1/*
2 Copyright (c) 2007 Volker Krause <vkrause@kde.org>
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17*/
18
19#ifndef KORG_MULTIAGENDAVIEW_H_H
20#define KORG_MULTIAGENDAVIEW_H_H
21
22#include "agendaview.h"
23#include "calendarview.h"
24
25class TQScrollView;
26class TQHBox;
27class TQSplitter;
28class KOAgendaView;
29class TimeLabels;
30class TQScrollBar;
31
32namespace KCal {
33 class ResourceCalendar;
34}
35
36namespace KOrg {
37
42{
43 TQ_OBJECT
44
45 public:
46 explicit MultiAgendaView( Calendar* cal, CalendarView *calendarView,
47 TQWidget *parent = 0, const char *name = 0 );
49
50 KOAgendaView *selectedAgendaView();
51 void deSelectAgendaView() { mSelectedAgendaView = 0; }
52 Incidence::List selectedIncidences();
53 DateList selectedIncidenceDates();
54 int currentDateCount();
55 int maxDatesHint();
56
57 bool eventDurationHint(TQDateTime &startDt, TQDateTime &endDt, bool &allDay);
58
59 void setTypeAheadReceiver( TQObject *o );
60
61 public slots:
62 void showDates( const TQDate &start, const TQDate &end );
63 void showIncidences( const Incidence::List &incidenceList, const TQDate &date );
64 void updateView();
65 void changeIncidenceDisplay( Incidence *incidence, int mode );
66 void updateConfig();
67
68 void setIncidenceChanger( IncidenceChangerBase *changer );
69
70 void finishTypeAhead();
71
72 void show();
73
74 void resourcesChanged();
75
76 protected:
77 void resizeEvent( TQResizeEvent *ev );
78 bool eventFilter( TQObject *obj, TQEvent *event );
79
80 private:
81 void addView( const TQString &label, KCal::ResourceCalendar *res, const TQString &subRes = TQString() );
82 void deleteViews();
83 void recreateViews();
84 void setupViews();
85 void resizeScrollView( const TQSize &size );
86 void installSplitterEventFilter( TQSplitter *splitter );
87
88 private slots:
89 void slotSelectionChanged();
90 void slotClearTimeSpanSelection();
91 void resizeSplitters();
92 void resizeSpacers( int );
93 void setupScrollBar();
94 void zoomView( const int delta, const TQPoint &pos, const TQt::Orientation ori );
95 void slotResizeScrollView();
96
97 private:
98 KOAgendaView *mSelectedAgendaView;
99 TQValueList<KOAgendaView*> mAgendaViews;
100 TQValueList<TQWidget*> mAgendaWidgets;
101 TQHBox *mTopBox;
102 TQScrollView *mScrollView;
103 TimeLabels *mTimeLabels;
104 TQSplitter *mLeftSplitter, *mRightSplitter;
105 TQSplitter *mLastMovedSplitter;
106 TQScrollBar *mScrollBar;
107 TQWidget *mLeftTopSpacer, *mRightTopSpacer;
108 TQWidget *mLeftBottomSpacer, *mRightBottomSpacer;
109 TQDate mStartDate, mEndDate;
110 bool mUpdateOnShow;
111 bool mPendingChanges;
112 CalendarView *mCalendarView;
113};
114
115}
116
117#endif
This is the main calendar widget.
Definition: calendarview.h:82
KOAgendaView is the agenda-like view used to display events in a single one or multi-day view.
Definition: koagendaview.h:109
Base class for single/multi agenda views.
Definition: agendaview.h:28
Shows one agenda for every resource side-by-side.
Incidence::List selectedIncidences()
int currentDateCount()
Return number of currently shown dates.
int maxDatesHint()
provides a hint back to the caller on the maximum number of dates that the view supports.
bool eventDurationHint(TQDateTime &startDt, TQDateTime &endDt, bool &allDay)
Set the default start/end date/time for new events.