korganizer

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         Copyright (C) 2004           Reinhold Kainhofer   <reinhold@kainhofer.com>
00006 
00007     This library is free software; you can redistribute it and/or
00008     modify it under the terms of the GNU Library General Public
00009     License as published by the Free Software Foundation; either
00010     version 2 of the License, or (at your option) any later version.
00011 
00012     This library is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015     Library General Public License for more details.
00016 
00017     You should have received a copy of the GNU Library General Public License
00018     along with this library; see the file COPYING.LIB.  If not, write to
00019     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00020     Boston, MA 02110-1301, USA.
00021 */
00022 #ifndef KORG_BASEVIEW_H
00023 #define KORG_BASEVIEW_H
00024 
00025 #include <qwidget.h>
00026 #include <qptrlist.h>
00027 #include <qvaluelist.h>
00028 
00029 #include <klocale.h>
00030 #include <kdebug.h>
00031 #include <kmessagebox.h>
00032 #include <kdepimmacros.h>
00033 #include "korganizer/incidencechangerbase.h"
00034 
00035 #include <libkcal/event.h>
00036 
00037 using namespace KCal;
00038 
00039 namespace KCal { class Calendar; }
00040 class CalPrinter;
00041 
00042 namespace KOrg {
00043 
00047 class CalPrinterBase
00048 {
00049   public:
00050     enum PrintType { Day, Week, Month, Todolist };
00051 };
00052 
00053 
00065 class KDE_EXPORT BaseView : public QWidget
00066 {
00067     Q_OBJECT
00068   public:
00077     BaseView( Calendar *cal, QWidget *parent = 0,
00078               const char *name = 0 )
00079       : QWidget( parent, name ), mCalendar( cal ), mChanger( 0 ) {}
00080 
00084     virtual ~BaseView() {}
00085 
00086     virtual void setCalendar( Calendar *cal ) { mCalendar = cal; }
00090     virtual Calendar *calendar() { return mCalendar; }
00091 
00097     virtual Incidence::List selectedIncidences() = 0;
00098 
00104     virtual DateList selectedDates() = 0;
00105 
00106     virtual CalPrinterBase::PrintType printType()
00107     {
00108       return CalPrinterBase::Month;
00109     }
00110 
00114     virtual int currentDateCount() = 0;
00115 
00117     virtual bool isEventView() { return false; }
00118 
00119   public slots:
00128     virtual void showDates( const QDate &start, const QDate &end ) = 0;
00129 
00136     virtual void showIncidences( const Incidence::List &incidenceList ) = 0;
00137 
00142     virtual void updateView() = 0;
00143     virtual void dayPassed( const QDate & ) { updateView(); }
00144 
00148     virtual void setIncidenceChanger( IncidenceChangerBase *changer ) { mChanger = changer; }
00149 
00153     virtual void flushView() {}
00154 
00158     virtual void changeIncidenceDisplay( Incidence *, int ) = 0;
00159 
00164     virtual void updateConfig() {}
00165 
00169     virtual void clearSelection() {}
00170 
00174     virtual bool eventDurationHint(QDateTime &/*startDt*/, QDateTime &/*endDt*/, bool &/*allDay*/) { return false; }
00175 
00176   signals:
00177     void incidenceSelected( Incidence * );
00178 
00182     void showIncidenceSignal(Incidence *);
00183 
00189     void editIncidenceSignal(Incidence *);
00190 
00196     void deleteIncidenceSignal(Incidence *);
00197 
00201     void cutIncidenceSignal(Incidence *);
00202 
00206     void copyIncidenceSignal(Incidence *);
00207 
00211     void toggleAlarmSignal(Incidence *);
00214     void dissociateOccurrenceSignal( Incidence *, const QDate & );
00217     void dissociateFutureOccurrenceSignal( Incidence *, const QDate & );
00218 
00219     void startMultiModify( const QString & );
00220     void endMultiModify();
00221 
00226     void newEventSignal();
00231     void newEventSignal( const QDate & );
00236     void newEventSignal( const QDateTime & );
00242     void newEventSignal( const QDateTime &, const QDateTime & );
00243 
00244     void newTodoSignal( const QDate & );
00245     void newSubTodoSignal( Todo * );
00246 
00247     void newJournalSignal( const QDate & );
00248 
00249   private:
00250     Calendar *mCalendar;
00251   protected:
00252     IncidenceChangerBase *mChanger;
00253 };
00254 
00255 }
00256 
00257 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys