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 "koattendeeeditor.h"
00028
00029 #include <qwidget.h>
00030 #include <qdatetime.h>
00031 #include <qtimer.h>
00032
00033 class KDIntervalColorRectangle;
00034 class QLabel;
00035 class KDGanttView;
00036 class KDGanttViewItem;
00037 class FreeBusyItem;
00038
00039 namespace KCal {
00040 class FreeBusy;
00041 class Attendee;
00042 }
00043
00044
00045 class KOEditorFreeBusy : public KOAttendeeEditor
00046 {
00047 Q_OBJECT
00048 public:
00049 KOEditorFreeBusy( int spacing = 8, QWidget *parent = 0,
00050 const char *name = 0 );
00051 virtual ~KOEditorFreeBusy();
00052
00053 void setUpdateEnabled( bool enabled );
00054 bool updateEnabled() const;
00055
00056 void insertAttendee( KCal::Attendee *, bool readFBList = true );
00057 void removeAttendee( KCal::Attendee * );
00058 void clearAttendees();
00059
00060 void readEvent( KCal::Event * );
00061 void writeEvent( KCal::Event *event );
00062
00063 void triggerReload();
00064 void cancelReload();
00065
00066 virtual void setOrganizer(const QString &newOrganizer);
00067 signals:
00068 void dateTimesChanged( const QDateTime &, const QDateTime & );
00069
00070 public slots:
00071 void slotInsertFreeBusy( KCal::FreeBusy *fb, const QString &email );
00072
00073 void setDateTimes( const QDateTime &, const QDateTime & );
00074
00075 void editFreeBusyUrl( KDGanttViewItem *item );
00076
00077 protected slots:
00078 void slotUpdateGanttView( const QDateTime &, const QDateTime & );
00079 void slotScaleChanged( int );
00080 void slotCenterOnStart() ;
00081 void slotZoomToTime();
00082 void slotPickDate();
00083 void showAttendeeStatusMenu();
00084
00085
00086 void manualReload();
00087
00088 void autoReload();
00089 void slotIntervalColorRectangleMoved( const QDateTime& start, const QDateTime& end );
00090
00091 void removeAttendee();
00092 void listViewClicked( int button, KDGanttViewItem* item );
00093
00094 protected:
00095 void timerEvent( QTimerEvent* );
00096 KCal::Attendee* currentAttendee() const;
00097
00098 QListViewItem* hasExampleAttendee() const;
00099 void updateCurrentItem();
00100 void clearSelection() const;
00101 void setSelected ( int index );
00102 int selectedIndex();
00103 void changeStatusForMe( KCal::Attendee::PartStat status );
00104 virtual bool eventFilter( QObject *watched, QEvent *event );
00105
00106 private slots:
00107 void slotOrganizerChanged( const QString &newOrganizer );
00108 private:
00109 void updateFreeBusyData( FreeBusyItem * );
00110
00111 bool findFreeSlot( QDateTime &dtFrom, QDateTime &dtTo );
00112 bool tryDate( QDateTime &tryFrom, QDateTime &tryTo );
00113 bool tryDate( FreeBusyItem *attendee,
00114 QDateTime &tryFrom, QDateTime &tryTo );
00115 void updateStatusSummary();
00116 void reload();
00117 int participantCount();
00118 KDGanttView *mGanttView;
00119 KDIntervalColorRectangle* mEventRectangle;
00120 QLabel *mStatusSummaryLabel;
00121 bool mIsOrganizer;
00122 QComboBox *scaleCombo;
00123
00124 QDateTime mDtStart, mDtEnd;
00125
00126 QTimer mReloadTimer;
00127
00128 bool mForceDownload;
00129
00130 QString mCurrentOrganizer;
00131 };
00132
00133 #endif
|