kitchensync

configguisunbird.h

00001 /*
00002     This file is part of KitchenSync.
00003 
00004     Copyright (c) 2007 Tobias Koenig <tokoe@kde.org>
00005     Copyright (c) 2007 Anirudh Ramesh <abattoir@abattoir.in>
00006 
00007     This program is free software; you can redistribute it and/or modify
00008     it under the terms of the GNU General Public License as published by
00009     the Free Software Foundation; either version 2 of the License, or
00010     (at your option) any later version.
00011 
00012     This program is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00015     GNU General Public License for more details.
00016 
00017     You should have received a copy of the GNU General Public License
00018     along with this program; if not, write to the Free Software
00019     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
00020     USA.
00021 */
00022 
00023 #ifndef CONFIGGUISUNBIRD_H
00024 #define CONFIGGUISUNBIRD_H
00025 
00026 #include "configgui.h"
00027 
00028 class QWidget;
00029 class QSpinBox;
00030 class QCheckBox;
00031 class QVBoxLayout;
00032 class QSpacerItem;
00033 class QSignalMapper;
00034 
00035 class KURLRequester;
00036 class KPushButton;
00037 class KLineEdit;
00038 
00039 class LocalCalendar : public QWidget
00040 {
00041   Q_OBJECT
00042 
00043   public:
00044     LocalCalendar( QWidget *parent = 0 );
00045     LocalCalendar( const QString &path,
00046                    const QString &defaultcal,
00047                    const QString &days, QWidget *parent = 0 );
00048 
00049     KURLRequester *mPathRequester;
00050     QCheckBox *mDaysCheckBox;
00051     QSpinBox *mDaysSpinBox;
00052     QCheckBox *mDefaultCheckBox;
00053 
00054   signals:
00055     void deleteRequest( LocalCalendar* );
00056 
00057   private slots:
00058     void deleteWidget();
00059     void toggleDays( bool days );
00060 
00061   private:
00062     void initGui();
00063 };
00064 
00065 class WebdavCalendar : public QWidget
00066 {
00067   Q_OBJECT
00068 
00069   public:
00070     WebdavCalendar( QWidget *parent = 0 );
00071     WebdavCalendar( const QString &username,
00072                     const QString &password,
00073                     const QString &url,
00074                     const QString &defaultcal,
00075                     const QString &days, QWidget *parent = 0 );
00076 
00077     KLineEdit *mUrl;
00078     QCheckBox *mDaysCheckBox;
00079     QSpinBox *mDaysSpinBox;
00080     QCheckBox *mDefaultCheckBox;
00081     KLineEdit *mUsername;
00082     KLineEdit *mPassword;
00083 
00084   signals:
00085     void deleteRequest( WebdavCalendar* );
00086 
00087   private slots:
00088     void deleteWidget();
00089     void toggleDays( bool state );
00090 
00091   private:
00092     void initGui();
00093 };
00094 
00095 class ConfigGuiSunbird : public ConfigGui
00096 {
00097   Q_OBJECT
00098 
00099   public:
00100     ConfigGuiSunbird( const QSync::Member &, QWidget *parent );
00101 
00102     void load( const QString &xml );
00103 
00104     QString save() const;
00105 
00106   public slots:
00107     void addLocalCalendar();
00108     void addWebdavCalendar();
00109 
00110     void delLocalCalendar( LocalCalendar* );
00111     void delWebdavCalendar( WebdavCalendar* );
00112 
00113   private:
00114     QValueList<LocalCalendar*> mLocalList;
00115     QValueList<WebdavCalendar*> mWebdavList;
00116 
00117     QWidget *mLocalWidget;
00118     QWidget *mWebdavWidget;
00119 
00120     QVBoxLayout *mLocalLayout;
00121     QVBoxLayout *mWebdavLayout;
00122 
00123     KPushButton *mLocalAddButton;
00124     KPushButton *mWebdavAddButton;
00125 
00126     QSpacerItem *mLocalSpacer;
00127     QSpacerItem *mWebdavSpacer;
00128 };
00129 
00130 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys