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 <qlistview.h>
00028 #include <qmap.h>
00029 #include <qdict.h>
00030 #include <qtooltip.h>
00031 
00032 #include <klistview.h>
00033 
00034 #include <libkcal/incidence.h>
00035 
00036 #include "koprefs.h"
00037 #include "koeventview.h"
00038 #include "customlistviewitem.h"
00039 
00040 using namespace KCal;
00041 
00042 typedef CustomListViewItem<Incidence *> KOListViewItem;
00043 
00044 class KOListView;
00045 
00046 class KOListViewToolTip : public QToolTip
00047 {
00048   public:
00049     KOListViewToolTip (QWidget* parent, KListView* lv );
00050 
00051   protected:
00052     void maybeTip( const QPoint & pos);
00053 
00054   private:
00055     KListView* eventlist;
00056 };
00057 
00058 
00063 class ListItemVisitor : public Incidence::Visitor
00064 {
00065   public:
00066     ListItemVisitor(KOListViewItem *);
00067     ~ListItemVisitor();
00068 
00069     bool visit(Event *);
00070     bool visit(Todo *);
00071     bool visit(Journal *);
00072 
00073   private:
00074     KOListViewItem *mItem;
00075 };
00076 
00087 class KOListView : public KOEventView
00088 {
00089     Q_OBJECT
00090   public:
00091     KOListView(Calendar *calendar, QWidget *parent = 0,
00092            const char *name = 0);
00093     ~KOListView();
00094 
00095     virtual int maxDatesHint();
00096     virtual int currentDateCount();
00097     virtual Incidence::List selectedIncidences();
00098     virtual DateList selectedDates();
00099 
00100     void showDates(bool show);
00101 
00102     virtual void printPreview(CalPrinter *calPrinter,
00103                               const QDate &, const QDate &);
00104 
00105     void readSettings(KConfig *config);
00106     void writeSettings(KConfig *config);
00107 
00108     void clear();
00109 
00110   public slots:
00111     virtual void updateView();
00112     virtual void showDates( const QDate &start, const QDate &end );
00113     virtual void showEvents( const Event::List & );
00114     void showIncidences( const Incidence::List &eventList );
00115 
00116     void clearSelection();
00117 
00118     void showDates();
00119     void hideDates();
00120 
00121     void changeEventDisplay(Event *, int);
00122 
00123     void defaultItemAction(QListViewItem *item);
00124     void popupMenu(QListViewItem *item,const QPoint &,int);
00125 
00126   protected slots:
00127     void processSelectionChange();
00128 
00129   protected:
00130     void addEvents( const Event::List & );
00131     void addTodos( const Todo::List & );
00132     void addIncidences( const Incidence::List & );
00133     void addIncidence(Incidence *);
00134     KOListViewItem *getItemForEvent(Event *event);
00135 
00136   private:
00137     KListView *mListView;
00138     KOEventPopupMenu *mPopupMenu;
00139     KOListViewItem *mActiveItem;
00140     QDict<Incidence> mUidDict;
00141 };
00142 
00143 #endif
KDE Logo
This file is part of the documentation for korganizer Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat May 1 11:38:30 2004 by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2003