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 QSplitter;
00027 class KOAgendaView;
00028 class TimeLabels;
00029 class QScrollBar;
00030 
00031 namespace KCal {
00032   class ResourceCalendar;
00033 }
00034 
00035 namespace KOrg {
00036 
00040 class MultiAgendaView : public AgendaView
00041 {
00042   Q_OBJECT
00043   public:
00044     explicit MultiAgendaView( Calendar* cal, QWidget *parent = 0, const char *name = 0 );
00045     ~MultiAgendaView();
00046 
00047     Incidence::List selectedIncidences();
00048     DateList selectedDates();
00049     int currentDateCount();
00050     int maxDatesHint();
00051 
00052     bool eventDurationHint(QDateTime &startDt, QDateTime &endDt, bool &allDay);
00053 
00054     void setTypeAheadReceiver( QObject *o );
00055 
00056   public slots:
00057     void showDates( const QDate &start, const QDate &end );
00058     void showIncidences( const Incidence::List &incidenceList );
00059     void updateView();
00060     void changeIncidenceDisplay( Incidence *incidence, int mode );
00061     void updateConfig();
00062 
00063     void setIncidenceChanger( IncidenceChangerBase *changer );
00064 
00065     void finishTypeAhead();
00066 
00067     void show();
00068 
00069   protected:
00070     void resizeEvent( QResizeEvent *ev );
00071     bool eventFilter( QObject *obj, QEvent *event );
00072 
00073   private:
00074     void addView( const QString &label, KCal::ResourceCalendar *res, const QString &subRes = QString::null );
00075     void deleteViews();
00076     void recreateViews();
00077     void setupViews();
00078     void resizeScrollView( const QSize &size );
00079     void installSplitterEventFilter( QSplitter *splitter );
00080 
00081   private slots:
00082     void slotSelectionChanged();
00083     void slotClearTimeSpanSelection();
00084     void resizeSplitters();
00085     void zoomView( const int delta, const QPoint &pos, const Qt::Orientation ori );
00086     void slotResizeScrollView();
00087 
00088   private:
00089     QValueList<KOAgendaView*> mAgendaViews;
00090     QValueList<QWidget*> mAgendaWidgets;
00091     QHBox *mTopBox;
00092     QScrollView *mScrollView;
00093     TimeLabels *mTimeLabels;
00094     QSplitter *mLeftSplitter, *mRightSplitter;
00095     QSplitter *mLastMovedSplitter;
00096     QScrollBar *mScrollBar;
00097     QWidget *mLeftBottomSpacer, *mRightBottomSpacer;
00098     QDate mStartDate, mEndDate;
00099     bool mUpdateOnShow;
00100 };
00101 
00102 }
00103 
00104 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys