kitchensync
calendarfilter.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef CALENDARFILTER_H
00023 #define CALENDARFILTER_H
00024
00025 #include "filter.h"
00026
00027 class KListView;
00028
00029 namespace KSync {
00030
00031 class CalendarSyncee;
00032
00033 class CalendarConfigWidget : public QWidget
00034 {
00035 Q_OBJECT
00036
00037 public:
00038 CalendarConfigWidget( QWidget *parent, const char *name );
00039
00040 void setCategories( const QStringList &categories );
00041
00042 void setSelectedCategories( const QStringList &categories );
00043 QStringList selectedCategories() const;
00044
00045 void setStartDate( const QDate& );
00046 QDate startDate() const;
00047
00048 void setEndDate( const QDate& );
00049 QDate endDate() const;
00050
00051 void setUseDate( bool );
00052 bool useDate() const;
00053
00054 private slots:
00055 void useDateChanged( bool );
00056
00057 private:
00058 KListView *mView;
00059 QLabel *mStartLabel;
00060 KDateEdit *mStartDate;
00061 QLabel *mEndLabel;
00062 KDateEdit *mEndDate;
00063 QCheckBox *mUseDate;
00064 };
00065
00066
00067 class CalendarFilter : public Filter
00068 {
00069 public:
00070 CalendarFilter( QObject *parent );
00071 virtual ~CalendarFilter();
00072
00073 virtual bool supports( Syncee *syncee );
00074 virtual QWidget *configWidget( QWidget *parent );
00075 virtual void configWidgetClosed( QWidget *widget );
00076
00077 virtual void convert( Syncee* );
00078 virtual void reconvert( Syncee* );
00079
00080 QString type() const { return "calendar"; }
00081
00082 private:
00083 void doLoad();
00084 void doSave();
00085
00086 void filterSyncee( CalendarSyncee*, const QStringList&,
00087 const QDate&, const QDate& );
00088 void unfilterSyncee( CalendarSyncee* );
00089
00090 CalendarSyncEntry::PtrList mFilteredEntries;
00091 QStringList mSelectedCategories;
00092 bool mFilterByDate;
00093 QDate mStartDate;
00094 QDate mEndDate;
00095 };
00096
00097 }
00098
00099 #endif
|