korganizer Library API Documentation

kolistview.h

00001 /*
00002     This file is part of KOrganizer.
00003     Copyright (c) 1999 Preston Brown
00004     Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, 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 #ifndef _KOLISTVIEW_H
00025 #define _KOLISTVIEW_H
00026 
00027 #include <qdict.h>
00028 #include <qtooltip.h>
00029 
00030 #include <libkcal/incidence.h>
00031 
00032 #include "koeventview.h"
00033 #include "customlistviewitem.h"
00034 
00035 using namespace KCal;
00036 
00037 typedef CustomListViewItem<Incidence *> KOListViewItem;
00038 
00039 class KOListView;
00040 
00041 class KOListViewToolTip : public QToolTip
00042 {
00043   public:
00044     KOListViewToolTip (QWidget* parent, KListView* lv );
00045 
00046   protected:
00047     void maybeTip( const QPoint & pos);
00048 
00049   private:
00050     KListView* eventlist;
00051 };
00052 
00053 
00058 class ListItemVisitor : public Incidence::Visitor
00059 {
00060   public:
00061     ListItemVisitor(KOListViewItem *);
00062     ~ListItemVisitor();
00063 
00064     bool visit(Event *);
00065     bool visit(Todo *);
00066     bool visit(Journal *);
00067 
00068   private:
00069     KOListViewItem *mItem;
00070 };
00071 
00082 class KOListView : public KOEventView
00083 {
00084     Q_OBJECT
00085   public:
00086     KOListView(Calendar *calendar, QWidget *parent = 0,
00087                const char *name = 0);
00088     ~KOListView();
00089 
00090     virtual int maxDatesHint();
00091     virtual int currentDateCount();
00092     virtual Incidence::List selectedIncidences();
00093     virtual DateList selectedDates();
00094 
00095     void showDates(bool show);
00096 
00097     virtual void printPreview(CalPrinter *calPrinter,
00098                               const QDate &, const QDate &);
00099 
00100     void readSettings(KConfig *config);
00101     void writeSettings(KConfig *config);
00102 
00103     void clear();
00104 
00105   public slots:
00106     virtual void updateView();
00107     virtual void showDates( const QDate &start, const QDate &end );
00108     virtual void showIncidences( const Incidence::List &incidenceList );
00109 
00110     void clearSelection();
00111 
00112     void showDates();
00113     void hideDates();
00114 
00115     void changeIncidenceDisplay(Incidence *, int);
00116 
00117     void defaultItemAction(QListViewItem *item);
00118     void popupMenu(QListViewItem *item,const QPoint &,int);
00119 
00120   protected slots:
00121     void processSelectionChange();
00122 
00123   protected:
00124     void addIncidences( const Incidence::List & );
00125     void addIncidence(Incidence *);
00126     KOListViewItem *getItemForIncidence(Incidence *incidence);
00127 
00128   private:
00129     KListView *mListView;
00130     KOEventPopupMenu *mPopupMenu;
00131     KOListViewItem *mActiveItem;
00132     QDict<Incidence> mUidDict;
00133     DateList mSelectedDates;
00134 };
00135 
00136 #endif
KDE Logo
This file is part of the documentation for korganizer Library Version 3.3.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Mon Apr 4 04:49:27 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003