kcmkontactknt.h
1 /*
2  This file is part of Kontact.
3  Copyright (c) 2003 Tobias Koenig <tokoe@kde.org>
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 
19  As a special exception, permission is given to link this program
20  with any edition of TQt, and distribute the resulting executable,
21  without including the source code for TQt in the source distribution.
22 */
23 
24 #ifndef KCMKONTACTKNT_H
25 #define KCMKONTACTKNT_H
26 
27 #include <tdecmodule.h>
28 
29 class TQListViewItem;
30 class TQSpinxBox;
31 
32 class TDEAboutData;
33 class TDEListView;
34 class KPushButton;
35 
36 class NewsItem;
37 
38 class KCMKontactKNT : public TDECModule
39 {
40  TQ_OBJECT
41 
42 
43  public:
44  KCMKontactKNT( TQWidget *parent = 0, const char *name = 0 );
45 
46  virtual void load();
47  virtual void save();
48  virtual void defaults();
49  virtual const TDEAboutData* aboutData() const;
50 
51  private slots:
52  void addNews();
53  void removeNews();
54  void newFeed();
55  void deleteFeed();
56 
57  void selectedChanged( TQListViewItem *item );
58  void allCurrentChanged( TQListViewItem *item );
59 
60  void modified();
61 
62  private:
63  void initGUI();
64  void loadNews();
65  void loadCustomNews();
66  void storeCustomNews();
67  void scanNews();
68 
69  bool dcopActive() const;
70 
71  TDEListView *mAllNews;
72  TDEListView *mSelectedNews;
73  TQListViewItem *mCustomItem;
74 
75  KPushButton *mAddButton;
76  KPushButton *mRemoveButton;
77  KPushButton *mNewButton;
78  KPushButton *mDeleteButton;
79  TQSpinBox *mUpdateInterval;
80  TQSpinBox *mArticleCount;
81 
82  TQMap<TQString, TQString> mFeedMap;
83  TQValueList<NewsItem*> mCustomFeeds;
84 };
85 
86 class NewsEditDialog : public KDialogBase
87 {
88  TQ_OBJECT
89 
90 
91  public:
92  NewsEditDialog( const TQString&, const TQString&, TQWidget *parent );
93  TQString title() const;
94  TQString url() const;
95 
96  private slots:
97  void modified();
98 
99  private:
100  TQLineEdit *mTitle;
101  TQLineEdit *mURL;
102 };
103 
104 #endif