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 TQWidget; 00029 class TQSpinBox; 00030 class TQCheckBox; 00031 class TQVBoxLayout; 00032 class TQSpacerItem; 00033 class TQSignalMapper; 00034 00035 class KURLRequester; 00036 class KPushButton; 00037 class KLineEdit; 00038 00039 class LocalCalendar : public TQWidget 00040 { 00041 Q_OBJECT 00042 00043 00044 public: 00045 LocalCalendar( TQWidget *parent = 0 ); 00046 LocalCalendar( const TQString &path, 00047 const TQString &defaultcal, 00048 const TQString &days, TQWidget *parent = 0 ); 00049 00050 KURLRequester *mPathRequester; 00051 TQCheckBox *mDaysCheckBox; 00052 TQSpinBox *mDaysSpinBox; 00053 TQCheckBox *mDefaultCheckBox; 00054 00055 signals: 00056 void deleteRequest( LocalCalendar* ); 00057 00058 private slots: 00059 void deleteWidget(); 00060 void toggleDays( bool days ); 00061 00062 private: 00063 void initGui(); 00064 }; 00065 00066 class WebdavCalendar : public TQWidget 00067 { 00068 Q_OBJECT 00069 00070 00071 public: 00072 WebdavCalendar( TQWidget *parent = 0 ); 00073 WebdavCalendar( const TQString &username, 00074 const TQString &password, 00075 const TQString &url, 00076 const TQString &defaultcal, 00077 const TQString &days, TQWidget *parent = 0 ); 00078 00079 KLineEdit *mUrl; 00080 TQCheckBox *mDaysCheckBox; 00081 TQSpinBox *mDaysSpinBox; 00082 TQCheckBox *mDefaultCheckBox; 00083 KLineEdit *mUsername; 00084 KLineEdit *mPassword; 00085 00086 signals: 00087 void deleteRequest( WebdavCalendar* ); 00088 00089 private slots: 00090 void deleteWidget(); 00091 void toggleDays( bool state ); 00092 00093 private: 00094 void initGui(); 00095 }; 00096 00097 class ConfigGuiSunbird : public ConfigGui 00098 { 00099 Q_OBJECT 00100 00101 00102 public: 00103 ConfigGuiSunbird( const QSync::Member &, TQWidget *parent ); 00104 00105 void load( const TQString &xml ); 00106 00107 TQString save() const; 00108 00109 public slots: 00110 void addLocalCalendar(); 00111 void addWebdavCalendar(); 00112 00113 void delLocalCalendar( LocalCalendar* ); 00114 void delWebdavCalendar( WebdavCalendar* ); 00115 00116 private: 00117 TQValueList<LocalCalendar*> mLocalList; 00118 TQValueList<WebdavCalendar*> mWebdavList; 00119 00120 TQWidget *mLocalWidget; 00121 TQWidget *mWebdavWidget; 00122 00123 TQVBoxLayout *mLocalLayout; 00124 TQVBoxLayout *mWebdavLayout; 00125 00126 KPushButton *mLocalAddButton; 00127 KPushButton *mWebdavAddButton; 00128 00129 TQSpacerItem *mLocalSpacer; 00130 TQSpacerItem *mWebdavSpacer; 00131 }; 00132 00133 #endif