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., 675 Mass Ave, Cambridge, MA 02139, 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 <qlistview.h>
00028 #include <qmap.h>
00029 #include <qdict.h>
00030 
00031 #include <klistview.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 
00046 class ListItemVisitor : public Incidence::Visitor
00047 {
00048   public:
00049     ListItemVisitor(KOListViewItem *);
00050     ~ListItemVisitor();
00051     
00052     bool visit(Event *);
00053     bool visit(Todo *);
00054     bool visit(Journal *);
00055 
00056   private:
00057     KOListViewItem *mItem;
00058 };
00059 
00070 class KOListView : public KOEventView
00071 {
00072     Q_OBJECT
00073   public:
00074     KOListView(Calendar *calendar, QWidget *parent = 0, 
00075                const char *name = 0);
00076     ~KOListView();
00077 
00078     virtual int maxDatesHint();
00079     virtual int currentDateCount();
00080     virtual QPtrList<Incidence> selectedIncidences();
00081     virtual DateList selectedDates();
00082     
00083     void showDates(bool show);
00084 
00085     virtual void printPreview(CalPrinter *calPrinter,
00086                               const QDate &, const QDate &);
00087     
00088     void readSettings(KConfig *config);
00089     void writeSettings(KConfig *config);
00090 
00091     void clear();
00092 
00093   public slots:
00094     virtual void updateView();
00095     virtual void showDates(const QDate &start, const QDate &end);
00096     virtual void showEvents(QPtrList<Event> eventList);
00097 
00098     void clearSelection();
00099 
00100     void showDates();
00101     void hideDates();
00102 
00103     void changeEventDisplay(Event *, int);
00104   
00105     void defaultItemAction(QListViewItem *item);
00106     void popupMenu(QListViewItem *item,const QPoint &,int);
00107 
00108   protected slots:
00109     void processSelectionChange();
00110 
00111   protected:
00112     void addEvents(QPtrList<Event> eventList);
00113     void addTodos(QPtrList<Todo> eventList);
00114     void addIncidence(Incidence *);
00115     KOListViewItem *getItemForEvent(Event *event);
00116 
00117   private:
00118     KListView *mListView;
00119     KOEventPopupMenu *mPopupMenu;
00120     KOListViewItem *mActiveItem;
00121     QDict<Incidence> mUidDict;
00122 };
00123 
00124 #endif
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.4.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Sat Oct 18 02:47:31 2003 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001