sdsummarywidget.h
1 /*
2  This file is part of Kontact.
3  Copyright (c) 2003 Tobias Koenig <tokoe@kde.org>
4  Copyright (c) 2004 Allen Winter <winter@kde.org>
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program; if not, write to the Free Software
18  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 
20  As a special exception, permission is given to link this program
21  with any edition of TQt, and distribute the resulting executable,
22  without including the source code for TQt in the source distribution.
23 */
24 
25 #ifndef SDSUMMARYWIDGET_H
26 #define SDSUMMARYWIDGET_H
27 
28 #include <tqptrlist.h>
29 #include <tqwidget.h>
30 
32 #include <libkholidays/kholidays.h>
33 
34 #include "summary.h"
35 
36 namespace Kontact {
37  class Plugin;
38 }
39 
40 class TQGridLayout;
41 class TQLabel;
42 
43 class SDSummaryWidget : public Kontact::Summary
44 {
45  TQ_OBJECT
46 
47 
48  public:
49  SDSummaryWidget( Kontact::Plugin *plugin, TQWidget *parent,
50  const char *name = 0 );
51 
52  TQStringList configModules() const;
53  void configUpdated();
54  void updateSummary( bool force = false ) { Q_UNUSED( force ); updateView(); }
55 
56  protected:
57  virtual bool eventFilter( TQObject *obj, TQEvent* e );
58 
59  private slots:
60  void updateView();
61  void popupMenu( const TQString &uid );
62  void mailContact( const TQString &uid );
63  void viewContact( const TQString &uid );
64 
65  private:
66  int span( KCal::Event *event );
67  int dayof( KCal::Event *event, const TQDate &date );
68  bool initHolidays();
69  void dateDiff( const TQDate &date, int &days, int &years );
70  TQGridLayout *mLayout;
71  TQPtrList<TQLabel> mLabels;
72  Kontact::Plugin *mPlugin;
73  KCal::CalendarResources *mCalendar;
74  int mDaysAhead;
75  bool mShowBirthdaysFromKAB;
76  bool mShowBirthdaysFromCal;
77  bool mShowAnniversariesFromKAB;
78  bool mShowAnniversariesFromCal;
79  bool mShowHolidays;
80  bool mShowSpecialsFromCal;
81 
82  KHolidays *mHolidays;
83 };
84 
85 #endif
Base class for all Plugins in Kontact.
Definition: plugin.h:59
Summary widget for display in the Summary View plugin.
Definition: summary.h:37
virtual TQStringList configModules() const
Return list of strings identifying configuration modules for this summary part.
Definition: summary.h:64
virtual void updateSummary(bool force=false)
This is called if the displayed information should be updated.
Definition: summary.h:73