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