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 // TODO: Make some functions of KOrg::BaseView const 00063 class BaseView : public QWidget 00064 { 00065 Q_OBJECT 00066 public: 00075 BaseView( Calendar *cal, QWidget *parent = 0, const char *name = 0 ) 00076 : QWidget( parent, name ), mCalendar( cal ) {} 00077 00081 virtual ~BaseView() {} 00082 00083 virtual void setCalendar( Calendar *cal ) { mCalendar = cal; } 00087 virtual Calendar *calendar() { return mCalendar; } 00088 00094 virtual Incidence::List selectedIncidences() = 0; 00095 00101 virtual DateList selectedDates() = 0; 00102 00110 /* 00111 The date parameters should be determined by the view itself and not given as 00112 parameters. At the moment I just move the code from the topwidget to the 00113 individual views. 00114 */ 00115 virtual void printPreview( CalPrinter *, const QDate &, const QDate & ) 00116 { 00117 KMessageBox::sorry(this, i18n("Unfortunately, we don't handle printing for\n" 00118 "that view yet.\n")); 00119 } 00120 00126 virtual void print( CalPrinter * ) 00127 { 00128 KMessageBox::sorry(this, i18n("Unfortunately, we don't handle printing for\n" 00129 "that view yet.\n")); 00130 } 00131 00132 virtual CalPrinterBase::PrintType printType() 00133 { 00134 return CalPrinterBase::Month; 00135 } 00136 00140 virtual int currentDateCount() = 0; 00141 00143 virtual bool isEventView() { return false; } 00144 00145 public slots: 00154 virtual void showDates( const QDate &start, const QDate &end ) = 0; 00155 00162 virtual void showEvents( const Event::List &eventList ) = 0; 00163 00168 virtual void updateView() = 0; 00169 00173 virtual void flushView() {} 00174 00178 virtual void changeEventDisplay( Event *, int ) = 0; 00179 00184 virtual void updateConfig() {} 00185 00189 virtual void clearSelection() {} 00190 00191 signals: 00192 void incidenceSelected( Incidence * ); 00193 00194 private: 00195 Calendar *mCalendar; 00196 }; 00197 00198 } 00199 00200 #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 Wed Jul 28 23:58:12 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003