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 
00038 class KOListViewItem : public CustomListViewItem<Incidence*>
00039 {
00040   public:
00041       KOListViewItem ( Incidence* data, KListView *parent)
00042           :CustomListViewItem<Incidence*>( data, parent )
00043       {
00044       }
00045       Incidence * incidence() {
00046           return data();
00047       }
00048       QDate itemDate() { return QDate(); }
00049 };
00050 
00051 class KOListView;
00052 
00053 class KOListViewToolTip : public QToolTip
00054 {
00055   public:
00056     KOListViewToolTip (QWidget* parent, KListView* lv );
00057 
00058   protected:
00059     void maybeTip( const QPoint & pos);
00060 
00061   private:
00062     KListView* eventlist;
00063 };
00064 
00065 
00070 class ListItemVisitor : public Incidence::Visitor
00071 {
00072   public:
00073     ListItemVisitor(KOListViewItem *);
00074     ~ListItemVisitor();
00075 
00076     bool visit(Event *);
00077     bool visit(Todo *);
00078     bool visit(Journal *);
00079 
00080   private:
00081     KOListViewItem *mItem;
00082 };
00083 
00094 class KOListView : public KOEventView
00095 {
00096     Q_OBJECT
00097   public:
00098     KOListView(Calendar *calendar, QWidget *parent = 0,
00099                const char *name = 0);
00100     ~KOListView();
00101 
00102     virtual int maxDatesHint();
00103     virtual int currentDateCount();
00104     virtual Incidence::List selectedIncidences();
00105     virtual DateList selectedDates();
00106 
00107     void showDates(bool show);
00108 
00109     virtual void printPreview(CalPrinter *calPrinter,
00110                               const QDate &, const QDate &);
00111 
00112     void readSettings(KConfig *config);
00113     void writeSettings(KConfig *config);
00114 
00115     void clear();
00116 
00117   public slots:
00118     virtual void updateView();
00119     virtual void showDates( const QDate &start, const QDate &end );
00120     virtual void showIncidences( const Incidence::List &incidenceList );
00121 
00122     void clearSelection();
00123 
00124     void showDates();
00125     void hideDates();
00126 
00127     void changeIncidenceDisplay(Incidence *, int);
00128 
00129     void defaultItemAction(QListViewItem *item);
00130     void popupMenu(QListViewItem *item,const QPoint &,int);
00131 
00132   protected slots:
00133     void processSelectionChange();
00134 
00135   protected:
00136     void addIncidences( const Incidence::List & );
00137     void addIncidence(Incidence *);
00138     KOListViewItem *getItemForIncidence(Incidence *incidence);
00139 
00140   private:
00141     KListView *mListView;
00142     KOEventPopupMenu *mPopupMenu;
00143     KOListViewItem *mActiveItem;
00144     QDict<Incidence> mUidDict;
00145     DateList mSelectedDates;
00146 };
00147 
00148 #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 Wed Jan 31 15:55:49 2007 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003