korganizer Library API Documentation

baseview.h

00001 /*
00002     This file is part of the KOrganizer interfaces.
00003 
00004     Copyright (c) 1999,2001,2003 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 
00024 #include <qwidget.h>
00025 #include <qptrlist.h>
00026 #include <qvaluelist.h>
00027 
00028 #include <klocale.h>
00029 #include <kdebug.h>
00030 #include <kmessagebox.h>
00031 
00032 #include <libkcal/event.h>
00033 #include <libkcal/calendar.h>
00034 
00035 using namespace KCal;
00036 
00037 class CalPrinter;
00038 
00039 namespace KOrg {
00040 
00044 class CalPrinterBase
00045 {
00046   public:
00047     enum PrintType { Day, Week, Month, Todolist };
00048 };
00049 
00050 
00062 class BaseView : public QWidget
00063 {
00064     Q_OBJECT
00065   public:
00074     BaseView( Calendar *cal, QWidget *parent = 0, const char *name = 0 )
00075       : QWidget( parent, name ), mCalendar( cal ) {}
00076 
00080     virtual ~BaseView() {}
00081 
00082     virtual void setCalendar( Calendar *cal ) { mCalendar = cal; }
00086     virtual Calendar *calendar() { return mCalendar; }
00087 
00093     virtual Incidence::List selectedIncidences() = 0;
00094 
00100     virtual DateList selectedDates() = 0;
00101 
00109 /*
00110   The date parameters should be determined by the view itself and not given as
00111   parameters. At the moment I just move the code from the topwidget to the
00112   individual views.
00113 */
00114     virtual void printPreview( CalPrinter *, const QDate &, const QDate & )
00115     {
00116       KMessageBox::sorry(this, i18n("Unfortunately, we don't handle printing for\n"
00117                                     "that view yet.\n"));
00118     }
00119 
00125     virtual void print( CalPrinter * )
00126     {
00127       KMessageBox::sorry(this, i18n("Unfortunately, we don't handle printing for\n"
00128                                     "that view yet.\n"));
00129     }
00130 
00131     virtual CalPrinterBase::PrintType printType()
00132     {
00133       return CalPrinterBase::Month;
00134     }
00135 
00139     virtual int currentDateCount() = 0;
00140 
00142     virtual bool isEventView() { return false; }
00143 
00144   public slots:
00153     virtual void showDates( const QDate &start, const QDate &end ) = 0;
00154 
00161     virtual void showIncidences( const Incidence::List &eventList ) = 0;
00162 
00167     virtual void updateView() = 0;
00168     virtual void dayPassed( QDate ) { updateView(); }
00169 
00173     virtual void flushView() {}
00174 
00178     virtual void changeIncidenceDisplay( Incidence *, int ) = 0;
00179 
00184     virtual void updateConfig() {}
00185 
00189     virtual void clearSelection() {}
00190 
00194     virtual bool eventDurationHint(QDateTime &/*startDt*/, QDateTime &/*endDt*/, bool &/*allDay*/) { return false; }
00195 
00196   signals:
00197     void incidenceSelected( Incidence * );
00198 
00202     void showIncidenceSignal(Incidence *);
00203 
00209     void editIncidenceSignal(Incidence *);
00210 
00216     void deleteIncidenceSignal(Incidence *);
00217  
00221     void toggleAlarmSignal(Incidence *);
00222 
00223     void incidenceAdded( Incidence* );
00224     void incidenceChanged( Incidence*, Incidence*, int );
00225     void incidenceChanged( Incidence*, Incidence* );
00226     void incidenceDeleted( Incidence* );
00227     void incidenceToBeDeleted( Incidence* );
00228 
00229     void startMultiModify( const QString & );
00230     void endMultiModify();
00231 
00236     void newEventSignal();
00241     void newEventSignal(QDate);
00246     void newEventSignal(QDateTime);
00252     void newEventSignal(QDateTime, QDateTime);
00253 
00254     void newTodoSignal( QDate );
00255     void newSubTodoSignal( Todo * );
00256 
00257   private:
00258     Calendar *mCalendar;
00259 };
00260 
00261 }
00262 
00263 #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 Thu May 3 20:24:50 2007 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003