korganizer Library API Documentation

baseview.h

00001 /*
00002     This file is part of the KOrganizer interfaces.
00003     Copyright (c) 1999 Cornelius Schumacher <schumacher@kde.org>
00004     Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
00005 
00006     This library is free software; you can redistribute it and/or
00007     modify it under the terms of the GNU Library General Public
00008     License as published by the Free Software Foundation; either
00009     version 2 of the License, or (at your option) any later version.
00010 
00011     This library 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 GNU
00014     Library General Public License for more details.
00015 
00016     You should have received a copy of the GNU Library General Public License
00017     along with this library; see the file COPYING.LIB.  If not, write to
00018     the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00019     Boston, MA 02111-1307, USA.
00020 */
00021 #ifndef KORG_BASEVIEW_H
00022 #define KORG_BASEVIEW_H
00023 // $Id: baseview.h,v 1.7 2002/06/11 10:14:46 schwann Exp $
00024 // KOBaseView is the abstract base class of all calendar views.
00025 
00026 #include <qwidget.h>
00027 #include <qptrlist.h>
00028 #include <qvaluelist.h>
00029 
00030 #include <klocale.h>
00031 #include <kdebug.h>
00032 #include <kmessagebox.h>
00033 
00034 #include <libkcal/event.h>
00035 #include <libkcal/calendar.h>
00036 
00037 using namespace KCal;
00038 
00039 class CalPrinter;
00040 
00041 namespace KOrg {
00042 
00054 class BaseView : public QWidget
00055 {
00056     Q_OBJECT
00057   public:
00066     BaseView(Calendar *cal, QWidget *parent = 0, const char *name = 0) :
00067         QWidget(parent, name), mCalendar(cal) {}
00068 
00072     virtual ~BaseView() {}
00073 
00077     Calendar *calendar() { return mCalendar; }
00078   
00084     virtual QPtrList<Incidence> selectedIncidences() = 0;
00085   
00091     virtual DateList selectedDates() = 0;
00092     
00100 /*
00101   The date parameters should be determined by the view itself and not given as
00102   parameters. At the moment I just move the code from the topwidget to the
00103   individual views.
00104 */
00105     virtual void printPreview(CalPrinter *, 
00106                               const QDate &, const QDate &)
00107     {
00108       KMessageBox::sorry(this, i18n("Unfortunately, we don't handle printing for\n"
00109                                     "that view yet.\n"));
00110     }
00111     
00117     virtual void print(CalPrinter *)
00118     {
00119       KMessageBox::sorry(this, i18n("Unfortunately, we don't handle printing for\n"
00120                                     "that view yet.\n"));
00121     }
00122 
00126     virtual int currentDateCount() = 0;
00127 
00129     virtual bool isEventView() { return false; }
00130     
00131   public slots:
00140     virtual void showDates( const QDate &start, const QDate &end ) = 0;
00141 
00148     virtual void showEvents(QPtrList<Event> eventList) = 0;
00149 
00154     virtual void updateView() = 0;
00155   
00159     virtual void flushView() {}
00160   
00164     virtual void changeEventDisplay(Event *, int) = 0;
00165   
00170     virtual void updateConfig() {}
00171 
00175     virtual void clearSelection() {}
00176     
00177   signals:
00178     void incidenceSelected( Incidence * );
00179 
00180   private:
00181     Calendar *mCalendar;
00182 };
00183 
00184 }  
00185 #endif
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Sun Feb 15 11:41:08 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001