kontact

sdsummarywidget.h

00001 /*
00002     This file is part of Kontact.
00003     Copyright (c) 2003 Tobias Koenig <tokoe@kde.org>
00004     Copyright (c) 2004 Allen Winter <winter@kde.org>
00005 
00006     This program is free software; you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation; either version 2 of the License, or
00009     (at your option) any later version.
00010 
00011     This program is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00014     GNU General Public License for more details.
00015 
00016     You should have received a copy of the GNU General Public License
00017     along with this program; if not, write to the Free Software
00018     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019 
00020     As a special exception, permission is given to link this program
00021     with any edition of Qt, and distribute the resulting executable,
00022     without including the source code for Qt in the source distribution.
00023 */
00024 
00025 #ifndef SDSUMMARYWIDGET_H
00026 #define SDSUMMARYWIDGET_H
00027 
00028 #include <qptrlist.h>
00029 #include <qwidget.h>
00030 
00031 #include <libkcal/calendarresources.h>
00032 #include <libkholidays/kholidays.h>
00033 
00034 #include "summary.h"
00035 
00036 namespace Kontact {
00037   class Plugin;
00038 }
00039 
00040 class QGridLayout;
00041 class QLabel;
00042 
00043 class SDSummaryWidget : public Kontact::Summary
00044 {
00045   Q_OBJECT
00046 
00047   public:
00048     SDSummaryWidget( Kontact::Plugin *plugin, QWidget *parent,
00049                      const char *name = 0 );
00050 
00051     QStringList configModules() const;
00052     void configUpdated();
00053     void updateSummary( bool force = false ) { Q_UNUSED( force ); updateView(); }
00054 
00055   protected:
00056     virtual bool eventFilter( QObject *obj, QEvent* e );
00057 
00058   private slots:
00059     void updateView();
00060     void popupMenu( const QString &uid );
00061     void mailContact( const QString &uid );
00062     void viewContact( const QString &uid );
00063 
00064   private:
00065     int span( KCal::Event *event );
00066     int dayof( KCal::Event *event, const QDate &date );
00067     bool initHolidays();
00068     void dateDiff( const QDate &date, int &days, int &years );
00069     QGridLayout *mLayout;
00070     QPtrList<QLabel> mLabels;
00071     Kontact::Plugin *mPlugin;
00072     KCal::CalendarResources *mCalendar;
00073     int mDaysAhead;
00074     bool mShowBirthdaysFromKAB;
00075     bool mShowBirthdaysFromCal;
00076     bool mShowAnniversariesFromKAB;
00077     bool mShowAnniversariesFromCal;
00078     bool mShowHolidays;
00079     bool mShowSpecialsFromCal;
00080 
00081     KHolidays::KHolidays *mHolidays;
00082 };
00083 
00084 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys