korganizer
koeditorfreebusy.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef KOEDITORFREEBUSY_H
00025 #define KOEDITORFREEBUSY_H
00026
00027 #include <qwidget.h>
00028 #include <qdatetime.h>
00029 #include <qtimer.h>
00030
00031 class KDIntervalColorRectangle;
00032 class QLabel;
00033 class KDGanttView;
00034 class KDGanttViewItem;
00035 class FreeBusyItem;
00036
00037 namespace KCal {
00038 class FreeBusy;
00039 class Attendee;
00040 }
00041
00042
00043 class KOEditorFreeBusy : public QWidget
00044 {
00045 Q_OBJECT
00046 public:
00047 KOEditorFreeBusy( int spacing = 8, QWidget *parent = 0,
00048 const char *name = 0 );
00049 virtual ~KOEditorFreeBusy();
00050
00051 void setUpdateEnabled( bool enabled );
00052 bool updateEnabled() const;
00053
00054 void insertAttendee( KCal::Attendee *, bool readFBList );
00055 void removeAttendee( KCal::Attendee * );
00056 void updateAttendee( KCal::Attendee * );
00057 void clearAttendees();
00058
00059 void readEvent( KCal::Event * );
00060
00061 void triggerReload();
00062 void cancelReload();
00063
00064 signals:
00065 void dateTimesChanged( const QDateTime &, const QDateTime & );
00066
00067 public slots:
00068 void slotInsertFreeBusy( KCal::FreeBusy *fb, const QString &email );
00069
00070 void setDateTimes( const QDateTime &, const QDateTime & );
00071
00072 void editFreeBusyUrl( KDGanttViewItem *item );
00073
00074 protected slots:
00075 void slotUpdateGanttView( const QDateTime &, const QDateTime & );
00076 void slotScaleChanged( int );
00077 void slotCenterOnStart() ;
00078 void slotZoomToTime();
00079 void slotPickDate();
00080
00081
00082 void manualReload();
00083
00084 void autoReload();
00085 void slotIntervalColorRectangleMoved( const QDateTime& start, const QDateTime& end );
00086
00087 protected:
00088 void timerEvent( QTimerEvent* );
00089
00090 private:
00091 void updateFreeBusyData( FreeBusyItem * );
00092
00093 bool findFreeSlot( QDateTime &dtFrom, QDateTime &dtTo );
00094 bool tryDate( QDateTime &tryFrom, QDateTime &tryTo );
00095 bool tryDate( FreeBusyItem *attendee,
00096 QDateTime &tryFrom, QDateTime &tryTo );
00097 void updateStatusSummary();
00098 void reload();
00099 KDGanttView *mGanttView;
00100 KDIntervalColorRectangle* mEventRectangle;
00101 QLabel *mStatusSummaryLabel;
00102 bool mIsOrganizer;
00103 QComboBox *scaleCombo;
00104
00105 QDateTime mDtStart, mDtEnd;
00106
00107 QTimer mReloadTimer;
00108
00109 bool mForceDownload;
00110 };
00111
00112 #endif
|