korganizer
multiagendaview.h
00001 /* 00002 Copyright (c) 2007 Volker Krause <vkrause@kde.org> 00003 00004 This program is free software; you can redistribute it and/or modify 00005 it under the terms of the GNU General Public License as published by 00006 the Free Software Foundation; either version 2 of the License, or 00007 (at your option) any later version. 00008 00009 This program is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 GNU General Public License for more details. 00013 00014 You should have received a copy of the GNU General Public License 00015 along with this program; if not, write to the Free Software 00016 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00017 */ 00018 00019 #ifndef KORG_MULTIAGENDAVIEW_H_H 00020 #define KORG_MULTIAGENDAVIEW_H_H 00021 00022 #include "agendaview.h" 00023 00024 class QScrollView; 00025 class QHBox; 00026 class KOAgendaView; 00027 00028 namespace KCal { 00029 class ResourceCalendar; 00030 } 00031 00032 namespace KOrg { 00033 00037 class MultiAgendaView : public AgendaView 00038 { 00039 Q_OBJECT 00040 public: 00041 explicit MultiAgendaView( Calendar* cal, QWidget *parent = 0, const char *name = 0 ); 00042 ~MultiAgendaView(); 00043 00044 Incidence::List selectedIncidences(); 00045 DateList selectedDates(); 00046 int currentDateCount(); 00047 int maxDatesHint(); 00048 00049 bool eventDurationHint(QDateTime &startDt, QDateTime &endDt, bool &allDay); 00050 00051 void setTypeAheadReceiver( QObject *o ); 00052 00053 public slots: 00054 void showDates( const QDate &start, const QDate &end ); 00055 void showIncidences( const Incidence::List &incidenceList ); 00056 void updateView(); 00057 void changeIncidenceDisplay( Incidence *incidence, int mode ); 00058 00059 void setIncidenceChanger( IncidenceChangerBase *changer ); 00060 00061 void finishTypeAhead(); 00062 00063 protected: 00064 void resizeEvent( QResizeEvent *ev ); 00065 00066 private: 00067 void addView( const QString &label, KCal::ResourceCalendar *res, const QString &subRes = QString::null ); 00068 void deleteViews(); 00069 void recreateViews(); 00070 void setupViews(); 00071 void resizeScrollView( const QSize &size ); 00072 00073 private slots: 00074 void slotSelectionChanged(); 00075 void slotClearTimeSpanSelection(); 00076 00077 private: 00078 QValueList<KOAgendaView*> mAgendaViews; 00079 QValueList<QWidget*> mAgendaWidgets; 00080 QHBox *mTopBox; 00081 QScrollView *mScrollView; 00082 }; 00083 00084 } 00085 00086 #endif