kontact
sdsummarywidget.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef SDSUMMARYWIDGET_H
00027 #define SDSUMMARYWIDGET_H
00028
00029 #include <kontactinterfaces/summary.h>
00030 #include <libkholidays/kholidays.h>
00031
00032 namespace Kontact {
00033 class Plugin;
00034 }
00035 namespace KCal {
00036 class Event;
00037 class CalendarResources;
00038 class ResourceCalendar;
00039 }
00040 class QEvent;
00041 class QGridLayout;
00042 class QLabel;
00043 class QWidget;
00044
00045 class SDSummaryWidget : public Kontact::Summary
00046 {
00047 Q_OBJECT
00048
00049 public:
00050 SDSummaryWidget( Kontact::Plugin *plugin, QWidget *parent );
00051
00052 QStringList configModules() const;
00053 void configUpdated();
00054 void updateSummary( bool force = false )
00055 {
00056 Q_UNUSED( force );
00057 updateView();
00058 }
00059
00060 protected:
00061 virtual bool eventFilter( QObject *obj, QEvent *e );
00062
00063 private slots:
00064 void updateView();
00065 void popupMenu( const QString &uid );
00066 void mailContact( const QString &uid );
00067 void viewContact( const QString &uid );
00068
00069 private:
00070 int span( KCal::Event *event );
00071 int dayof( KCal::Event *event, const QDate &date );
00072 bool initHolidays();
00073 void dateDiff( const QDate &date, int &days, int &years );
00074 KCal::ResourceCalendar *usingBirthdayResource();
00075 bool check( KCal::ResourceCalendar *cal, const QDate &date, const QString &summary );
00076 QGridLayout *mLayout;
00077 QList<QLabel*> mLabels;
00078 Kontact::Plugin *mPlugin;
00079 KCal::CalendarResources *mCalendar;
00080 int mDaysAhead;
00081 bool mShowBirthdaysFromKAB;
00082 bool mShowBirthdaysFromCal;
00083 bool mShowAnniversariesFromKAB;
00084 bool mShowAnniversariesFromCal;
00085 bool mShowHolidays;
00086 bool mShowSpecialsFromCal;
00087
00088 LibKHolidays::KHolidays *mHolidays;
00089 };
00090
00091 #endif