korganizer

kolistview.h

00001 /*
00002     This file is part of KOrganizer.
00003 
00004     Copyright (c) 1999 Preston Brown <pbrown@kde.org>
00005     Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
00006     Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
00007 
00008     This program is free software; you can redistribute it and/or modify
00009     it under the terms of the GNU General Public License as published by
00010     the Free Software Foundation; either version 2 of the License, or
00011     (at your option) any later version.
00012 
00013     This program is distributed in the hope that it will be useful,
00014     but WITHOUT ANY WARRANTY; without even the implied warranty of
00015     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00016     GNU General Public License for more details.
00017 
00018     You should have received a copy of the GNU General Public License
00019     along with this program; if not, write to the Free Software
00020     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00021 
00022     As a special exception, permission is given to link this program
00023     with any edition of Qt, and distribute the resulting executable,
00024     without including the source code for Qt in the source distribution.
00025 */
00026 #ifndef _KOLISTVIEW_H
00027 #define _KOLISTVIEW_H
00028 
00029 #include <qdict.h>
00030 #include <qmap.h>
00031 #include <qtooltip.h>
00032 
00033 #include <libkcal/incidence.h>
00034 
00035 #include "koeventview.h"
00036 #include "customlistviewitem.h"
00037 
00038 using namespace KCal;
00039 
00040 typedef CustomListViewItem<Incidence *> KOListViewItem;
00041 
00042 class KOListView;
00043 
00044 class KOListViewToolTip : public QToolTip
00045 {
00046   public:
00047     KOListViewToolTip (QWidget* parent, Calendar *calendar, KListView* lv );
00048 
00049   protected:
00050     void maybeTip( const QPoint & pos);
00051 
00052   private:
00053     Calendar *mCalendar;
00054     KListView* eventlist;
00055 };
00056 
00057 
00068 class KOListView : public KOEventView
00069 {
00070     Q_OBJECT
00071   public:
00072     KOListView(Calendar *calendar, QWidget *parent = 0,
00073                const char *name = 0);
00074     ~KOListView();
00075 
00076     virtual int maxDatesHint();
00077     virtual int currentDateCount();
00078     virtual Incidence::List selectedIncidences();
00079     virtual DateList selectedIncidenceDates();
00080 
00081     void showDates(bool show);
00082 
00083     void readSettings(KConfig *config);
00084     void writeSettings(KConfig *config);
00085 
00086     void clear();
00087 
00088   public slots:
00089     virtual void updateView();
00090     virtual void showDates( const QDate &start, const QDate &end );
00091     virtual void showIncidences( const Incidence::List &incidenceList, const QDate &date );
00092 
00093     void clearSelection();
00094 
00095     void showDates();
00096     void hideDates();
00097 
00098     void changeIncidenceDisplay(Incidence *, int);
00099 
00100     void defaultItemAction(QListViewItem *item);
00101     void popupMenu(QListViewItem *item,const QPoint &,int);
00102 
00103   protected slots:
00104     void processSelectionChange();
00105 
00106   protected:
00107     void addIncidences(const Incidence::List &, const QDate &date);
00108     void addIncidence(Incidence *,  const QDate &date);
00109     KOListViewItem *getItemForIncidence(Incidence *incidence);
00110 
00111   private:
00112     class ListItemVisitor;
00113     KListView *mListView;
00114     KOEventPopupMenu *mPopupMenu;
00115     KOListViewItem *mActiveItem;
00116     QDict<Incidence> mUidDict;
00117     QMap<QString, QDate>mDateList;
00118     DateList mSelectedDates;
00119 };
00120 
00121 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys