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