kontact

summarywidget.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 SUMMARYWIDGET_H
00025 #define SUMMARYWIDGET_H
00026 
00027 #include <tqmap.h>
00028 #include <tqtimer.h>
00029 #include <tqwidget.h>
00030 
00031 #include <dcopobject.h>
00032 #include <kurllabel.h>
00033 #include <tdeparts/part.h>
00034 
00035 #include "plugin.h"
00036 #include "summary.h"
00037 
00038 class TQGridLayout;
00039 class TQString;
00040 
00041 class SummaryWidget : public Kontact::Summary, public DCOPObject
00042 {
00043   Q_OBJECT
00044 //  
00045   K_DCOP
00046 
00047   public:
00048     SummaryWidget( Kontact::Plugin *plugin, TQWidget *parent, const char *name = 0 );
00049 
00050     int summaryHeight() const { return 1; }
00051     TQStringList configModules() const;
00052 
00053   k_dcop_hidden:
00054     void slotUnreadCountChanged();
00055 
00056   protected:
00057     virtual bool eventFilter( TQObject *obj, TQEvent* e );
00058 
00059   public slots:
00060     virtual void updateSummary( bool force );
00061 
00062   private slots:
00063     void selectFolder( const TQString& );
00064 
00065   private:
00066     void updateFolderList( const TQStringList& folders );
00067 
00068     TQPtrList<TQLabel> mLabels;
00069     TQGridLayout *mLayout;
00070     Kontact::Plugin *mPlugin;
00071     int mTimeOfLastMessageCountUpdate;
00072 };
00073 
00074 #endif