kitchensync

calendarfilter.h

00001 /*
00002     This file is part of KitchenSync.
00003 
00004     Copyright (c) 2005 Tobias Koenig <tokoe@kde.org>
00005 
00006     This library is free software; you can redistribute it and/or
00007     modify it under the terms of the GNU Library General Public
00008     License as published by the Free Software Foundation; either
00009     version 2 of the License, or (at your option) any later version.
00010 
00011     This library is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014     Library General Public License for more details.
00015 
00016     You should have received a copy of the GNU Library General Public License
00017     along with this library; see the file COPYING.LIB.  If not, write to
00018     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019     Boston, MA 02110-1301, USA.
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
KDE Home | KDE Accessibility Home | Description of Access Keys