kontact

kcmkontactknt.h

00001 /*
00002     This file is part of Kontact.
00003     Copyright (c) 2003 Tobias Koenig <tokoe@kde.org>
00004 
00005     This program is free software; you can redistribute it and/or modify
00006     it under the terms of the GNU General Public License as published by
00007     the Free Software Foundation; either version 2 of the License, or
00008     (at your option) any later version.
00009 
00010     This program is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00013     GNU General Public License for more details.
00014 
00015     You should have received a copy of the GNU General Public License
00016     along with this program; if not, write to the Free Software
00017     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00018 
00019     As a special exception, permission is given to link this program
00020     with any edition of TQt, and distribute the resulting executable,
00021     without including the source code for TQt in the source distribution.
00022 */
00023 
00024 #ifndef KCMKONTACTKNT_H
00025 #define KCMKONTACTKNT_H
00026 
00027 #include <kcmodule.h>
00028 
00029 class TQListViewItem;
00030 class TQSpinxBox;
00031 
00032 class KAboutData;
00033 class KListView;
00034 class KPushButton;
00035 
00036 class NewsItem;
00037 
00038 class KCMKontactKNT : public KCModule
00039 {
00040   Q_OBJECT
00041   TQ_OBJECT
00042 
00043   public:
00044     KCMKontactKNT( TQWidget *parent = 0, const char *name = 0 );
00045 
00046     virtual void load();
00047     virtual void save();
00048     virtual void defaults();
00049     virtual const KAboutData* aboutData() const;
00050 
00051   private slots:
00052     void addNews();
00053     void removeNews();
00054     void newFeed();
00055     void deleteFeed();
00056 
00057     void selectedChanged( TQListViewItem *item );
00058     void allCurrentChanged( TQListViewItem *item );
00059 
00060     void modified();
00061 
00062   private:
00063     void initGUI();
00064     void loadNews();
00065     void loadCustomNews();
00066     void storeCustomNews();
00067     void scanNews();
00068 
00069     bool dcopActive() const;
00070 
00071     KListView *mAllNews;
00072     KListView *mSelectedNews;
00073     TQListViewItem *mCustomItem;
00074 
00075     KPushButton *mAddButton;
00076     KPushButton *mRemoveButton;
00077     KPushButton *mNewButton;
00078     KPushButton *mDeleteButton;
00079     TQSpinBox *mUpdateInterval;
00080     TQSpinBox *mArticleCount;
00081 
00082     TQMap<TQString, TQString> mFeedMap;
00083     TQValueList<NewsItem*> mCustomFeeds;
00084 };
00085 
00086 class NewsEditDialog : public KDialogBase
00087 {
00088   Q_OBJECT
00089   TQ_OBJECT
00090 
00091   public:
00092     NewsEditDialog( const TQString&, const TQString&, TQWidget *parent );
00093     TQString title() const;
00094     TQString url() const;
00095 
00096   private slots:
00097     void modified();
00098 
00099   private:
00100     TQLineEdit *mTitle;
00101     TQLineEdit *mURL;
00102 };
00103 
00104 #endif