kitchensync

configguisunbird.h
1 /*
2  This file is part of KitchenSync.
3 
4  Copyright (c) 2007 Tobias Koenig <tokoe@kde.org>
5  Copyright (c) 2007 Anirudh Ramesh <abattoir@abattoir.in>
6 
7  This program is free software; you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation; either version 2 of the License, or
10  (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
20  USA.
21 */
22 
23 #ifndef CONFIGGUISUNBIRD_H
24 #define CONFIGGUISUNBIRD_H
25 
26 #include "configgui.h"
27 
28 class TQWidget;
29 class TQSpinBox;
30 class TQCheckBox;
31 class TQVBoxLayout;
32 class TQSpacerItem;
33 class TQSignalMapper;
34 
35 class KURLRequester;
36 class KPushButton;
37 class KLineEdit;
38 
39 class LocalCalendar : public TQWidget
40 {
41  Q_OBJECT
42 
43 
44  public:
45  LocalCalendar( TQWidget *parent = 0 );
46  LocalCalendar( const TQString &path,
47  const TQString &defaultcal,
48  const TQString &days, TQWidget *parent = 0 );
49 
50  KURLRequester *mPathRequester;
51  TQCheckBox *mDaysCheckBox;
52  TQSpinBox *mDaysSpinBox;
53  TQCheckBox *mDefaultCheckBox;
54 
55  signals:
56  void deleteRequest( LocalCalendar* );
57 
58  private slots:
59  void deleteWidget();
60  void toggleDays( bool days );
61 
62  private:
63  void initGui();
64 };
65 
66 class WebdavCalendar : public TQWidget
67 {
68  Q_OBJECT
69 
70 
71  public:
72  WebdavCalendar( TQWidget *parent = 0 );
73  WebdavCalendar( const TQString &username,
74  const TQString &password,
75  const TQString &url,
76  const TQString &defaultcal,
77  const TQString &days, TQWidget *parent = 0 );
78 
79  KLineEdit *mUrl;
80  TQCheckBox *mDaysCheckBox;
81  TQSpinBox *mDaysSpinBox;
82  TQCheckBox *mDefaultCheckBox;
83  KLineEdit *mUsername;
84  KLineEdit *mPassword;
85 
86  signals:
87  void deleteRequest( WebdavCalendar* );
88 
89  private slots:
90  void deleteWidget();
91  void toggleDays( bool state );
92 
93  private:
94  void initGui();
95 };
96 
97 class ConfigGuiSunbird : public ConfigGui
98 {
99  Q_OBJECT
100 
101 
102  public:
103  ConfigGuiSunbird( const QSync::Member &, TQWidget *parent );
104 
105  void load( const TQString &xml );
106 
107  TQString save() const;
108 
109  public slots:
110  void addLocalCalendar();
111  void addWebdavCalendar();
112 
113  void delLocalCalendar( LocalCalendar* );
114  void delWebdavCalendar( WebdavCalendar* );
115 
116  private:
117  TQValueList<LocalCalendar*> mLocalList;
118  TQValueList<WebdavCalendar*> mWebdavList;
119 
120  TQWidget *mLocalWidget;
121  TQWidget *mWebdavWidget;
122 
123  TQVBoxLayout *mLocalLayout;
124  TQVBoxLayout *mWebdavLayout;
125 
126  KPushButton *mLocalAddButton;
127  KPushButton *mWebdavAddButton;
128 
129  TQSpacerItem *mLocalSpacer;
130  TQSpacerItem *mWebdavSpacer;
131 };
132 
133 #endif