summaryrefslogtreecommitdiffstats
path: root/korganizer/interfaces/korganizer
diff options
context:
space:
mode:
Diffstat (limited to 'korganizer/interfaces/korganizer')
-rw-r--r--korganizer/interfaces/korganizer/Makefile.am6
-rw-r--r--korganizer/interfaces/korganizer/baseview.h254
-rw-r--r--korganizer/interfaces/korganizer/calendarviewbase.h63
-rw-r--r--korganizer/interfaces/korganizer/corehelper.h52
-rw-r--r--korganizer/interfaces/korganizer/incidencechangerbase.h77
-rw-r--r--korganizer/interfaces/korganizer/korganizerpart.desktop66
-rw-r--r--korganizer/interfaces/korganizer/korgprintplugin.desktop66
-rw-r--r--korganizer/interfaces/korganizer/mainwindow.h99
-rw-r--r--korganizer/interfaces/korganizer/part.h71
-rw-r--r--korganizer/interfaces/korganizer/printplugin.h172
10 files changed, 926 insertions, 0 deletions
diff --git a/korganizer/interfaces/korganizer/Makefile.am b/korganizer/interfaces/korganizer/Makefile.am
new file mode 100644
index 00000000..1833d0b7
--- /dev/null
+++ b/korganizer/interfaces/korganizer/Makefile.am
@@ -0,0 +1,6 @@
+
+korginclude_HEADERS = part.h baseview.h calendarviewbase.h mainwindow.h corehelper.h printplugin.h
+korgincludedir = $(includedir)/korganizer
+
+servicetypedir = $(kde_servicetypesdir)
+servicetype_DATA = korganizerpart.desktop korgprintplugin.desktop
diff --git a/korganizer/interfaces/korganizer/baseview.h b/korganizer/interfaces/korganizer/baseview.h
new file mode 100644
index 00000000..abaa8591
--- /dev/null
+++ b/korganizer/interfaces/korganizer/baseview.h
@@ -0,0 +1,254 @@
+/*
+ This file is part of the KOrganizer interfaces.
+
+ Copyright (c) 1999,2001,2003 Cornelius Schumacher <schumacher@kde.org>
+ Copyright (C) 2004 Reinhold Kainhofer <reinhold@kainhofer.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+#ifndef KORG_BASEVIEW_H
+#define KORG_BASEVIEW_H
+
+#include <qwidget.h>
+#include <qptrlist.h>
+#include <qvaluelist.h>
+
+#include <klocale.h>
+#include <kdebug.h>
+#include <kmessagebox.h>
+#include <kdepimmacros.h>
+#include "korganizer/incidencechangerbase.h"
+
+#include "printplugin.h"
+
+#include <libkcal/event.h>
+
+using namespace KCal;
+
+namespace KCal { class Calendar; }
+
+namespace KOrg {
+
+
+/**
+ This class provides an interface for all views being displayed within the main
+ calendar view. It has functions to update the view, to specify date range and
+ other display parameter and to return selected objects. An important class,
+ which inherits KOBaseView is KOEventView, which provides the interface for all
+ views of event data like the agenda or the month view.
+
+ @short Base class for calendar views
+ @author Preston Brown, Cornelius Schumacher
+ @see KOTodoView, KOEventView, KOListView, KOAgendaView, KOMonthView
+*/
+class KDE_EXPORT BaseView : public QWidget
+{
+ Q_OBJECT
+ public:
+ /**
+ Constructs a view.
+
+ @param cal Pointer to the calendar object from which events
+ will be retrieved for display.
+ @param parent parent widget.
+ @param name name of this widget.
+ */
+ BaseView( Calendar *cal, QWidget *parent = 0,
+ const char *name = 0 )
+ : QWidget( parent, name ), mCalendar( cal ), mChanger( 0 ) {}
+
+ /**
+ Destructor. Views will do view-specific cleanups here.
+ */
+ virtual ~BaseView() {}
+
+ virtual void setCalendar( Calendar *cal ) { mCalendar = cal; }
+ /**
+ Return calendar object of this view.
+ */
+ virtual Calendar *calendar() { return mCalendar; }
+
+ /**
+ @return a list of selected events. Most views can probably only
+ select a single event at a time, but some may be able to select
+ more than one.
+ */
+ virtual Incidence::List selectedIncidences() = 0;
+
+ /**
+ @return a list of the dates of selected events. Most views can probably only
+ select a single event at a time, but some may be able to select
+ more than one.
+ */
+ virtual DateList selectedDates() = 0;
+
+ virtual CalPrinterBase::PrintType printType()
+ {
+ return CalPrinterBase::Month;
+ }
+
+ /**
+ Return number of currently shown dates. A return value of 0 means no idea.
+ */
+ virtual int currentDateCount() = 0;
+
+ /** Return if this view is a view for displaying events. */
+ virtual bool isEventView() { return false; }
+
+ public slots:
+ /**
+ Show incidences for the given date range. The date range actually shown may be
+ different from the requested range, depending on the particular requirements
+ of the view.
+
+ @param start Start of date range.
+ @param end End of date range.
+ */
+ virtual void showDates( const QDate &start, const QDate &end ) = 0;
+
+ /**
+ Show given incidences. Depending on the actual view it might not be possible to
+ show all given events.
+
+ @param incidenceList a list of incidences to show.
+ */
+ virtual void showIncidences( const Incidence::List &incidenceList ) = 0;
+
+ /**
+ Updates the current display to reflect changes that may have happened
+ in the calendar since the last display refresh.
+ */
+ virtual void updateView() = 0;
+ virtual void dayPassed( const QDate & ) { updateView(); }
+
+ /**
+ Assign a new incidence change helper object.
+ */
+ virtual void setIncidenceChanger( IncidenceChangerBase *changer ) { mChanger = changer; }
+
+ /**
+ Write all unsaved data back to calendar store.
+ */
+ virtual void flushView() {}
+
+ /**
+ Updates the current display to reflect the changes to one particular incidence.
+ */
+ virtual void changeIncidenceDisplay( Incidence *, int ) = 0;
+
+ /**
+ Re-reads the KOrganizer configuration and picks up relevant
+ changes which are applicable to the view.
+ */
+ virtual void updateConfig() {}
+
+ /**
+ Clear selection. The incidenceSelected signal is not emitted.
+ */
+ virtual void clearSelection() {}
+
+ /**
+ Set the default start/end date/time for new events. Return true if anything was changed
+ */
+ virtual bool eventDurationHint(QDateTime &/*startDt*/, QDateTime &/*endDt*/, bool &/*allDay*/) { return false; }
+
+ signals:
+ void incidenceSelected( Incidence * );
+
+ /**
+ * instructs the receiver to show the incidence in read-only mode.
+ */
+ void showIncidenceSignal(Incidence *);
+
+ /**
+ * instructs the receiver to begin editing the incidence specified in
+ * some manner. Doesn't make sense to connect to more than one
+ * receiver.
+ */
+ void editIncidenceSignal(Incidence *);
+
+ /**
+ * instructs the receiver to delete the Incidence in some manner; some
+ * possibilities include automatically, with a confirmation dialog
+ * box, etc. Doesn't make sense to connect to more than one receiver.
+ */
+ void deleteIncidenceSignal(Incidence *);
+
+ /**
+ * instructs the receiver to cut the Incidence
+ */
+ void cutIncidenceSignal(Incidence *);
+
+ /**
+ * instructs the receiver to copy the incidence
+ */
+ void copyIncidenceSignal(Incidence *);
+
+ /**
+ * instructs the receiver to paste the incidence
+ */
+ void pasteIncidenceSignal();
+
+ /**
+ * instructs the receiver to toggle the alarms of the Incidence.
+ */
+ void toggleAlarmSignal(Incidence *);
+ /** Dissociate from a recurring incidence the occurrence on the given
+ date to a new incidence */
+ void dissociateOccurrenceSignal( Incidence *, const QDate & );
+ /** Dissociate from a recurring incidence all occurrences after the given
+ date to a new incidence */
+ void dissociateFutureOccurrenceSignal( Incidence *, const QDate & );
+
+ void startMultiModify( const QString & );
+ void endMultiModify();
+
+ /**
+ * instructs the receiver to create a new event. Doesn't make
+ * sense to connect to more than one receiver.
+ */
+ void newEventSignal();
+ /**
+ * instructs the receiver to create a new event with the specified beginning
+ * time. Doesn't make sense to connect to more than one receiver.
+ */
+ void newEventSignal( const QDate & );
+ /**
+ * instructs the receiver to create a new event with the specified beginning
+ * time. Doesn't make sense to connect to more than one receiver.
+ */
+ void newEventSignal( const QDateTime & );
+ /**
+ * instructs the receiver to create a new event, with the specified
+ * beginning end ending times. Doesn't make sense to connect to more
+ * than one receiver.
+ */
+ void newEventSignal( const QDateTime &, const QDateTime & );
+
+ void newTodoSignal( const QDate & );
+ void newSubTodoSignal( Todo * );
+
+ void newJournalSignal( const QDate & );
+
+ private:
+ Calendar *mCalendar;
+ protected:
+ IncidenceChangerBase *mChanger;
+};
+
+}
+
+#endif
diff --git a/korganizer/interfaces/korganizer/calendarviewbase.h b/korganizer/interfaces/korganizer/calendarviewbase.h
new file mode 100644
index 00000000..fe0cd496
--- /dev/null
+++ b/korganizer/interfaces/korganizer/calendarviewbase.h
@@ -0,0 +1,63 @@
+/*
+ This file is part of the KOrganizer interfaces.
+
+ Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
+ Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+#ifndef KORG_CALENDARVIEWBASE_H
+#define KORG_CALENDARVIEWBASE_H
+
+#include <qwidget.h>
+
+#include <libkcal/calendar.h>
+
+#include <korganizer/baseview.h>
+
+namespace KOrg {
+
+/**
+ @short interface for main calendar view widget
+ @author Cornelius Schumacher
+*/
+class CalendarViewBase : public QWidget
+{
+ public:
+ CalendarViewBase( QWidget *parent, const char *name )
+ : QWidget( parent, name ) {}
+ virtual ~CalendarViewBase() {}
+
+ virtual KCal::Calendar *calendar() = 0;
+
+ virtual QDate startDate() = 0;
+ virtual QDate endDate() = 0;
+
+ virtual Incidence *currentSelection() = 0;
+
+ virtual void addView( KOrg::BaseView * ) = 0;
+
+ /** changes the view to be the currently selected view */
+ virtual void showView( KOrg::BaseView * ) = 0;
+
+ public slots:
+ virtual void updateView() = 0;
+ virtual void updateCategories() = 0;
+};
+
+}
+
+#endif
diff --git a/korganizer/interfaces/korganizer/corehelper.h b/korganizer/interfaces/korganizer/corehelper.h
new file mode 100644
index 00000000..2ab83906
--- /dev/null
+++ b/korganizer/interfaces/korganizer/corehelper.h
@@ -0,0 +1,52 @@
+/*
+ This file is part of KOrganizer.
+ Copyright (c) 2004 Reinhold Kainhofer <reinhold@kainhofer.com>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ As a special exception, permission is given to link this program
+ with any edition of Qt, and distribute the resulting executable,
+ without including the source code for Qt in the source distribution.
+*/
+#ifndef KORG_COREHELPER_H
+#define KORG_COREHELPER_H
+
+#include <qstring.h>
+#include <qdatetime.h>
+#include <qcolor.h>
+#include "printplugin.h"
+
+class KCalendarSytstem;
+
+namespace KOrg {
+
+class CoreHelper
+{
+ public:
+ CoreHelper() {}
+ virtual ~CoreHelper() {}
+
+ virtual QColor defaultEventColor() = 0;
+ virtual QColor textColor( const QColor &bgColor ) = 0;
+ virtual QColor categoryColor( const QStringList &cats ) = 0;
+ virtual QString holidayString( const QDate &dt ) = 0;
+ virtual QTime dayStart() = 0;
+ virtual const KCalendarSystem *calendarSystem() = 0;
+ virtual KOrg::PrintPlugin::List loadPrintPlugins() = 0;
+ virtual bool isWorkingDay( const QDate &dt ) = 0;
+};
+
+}
+#endif
diff --git a/korganizer/interfaces/korganizer/incidencechangerbase.h b/korganizer/interfaces/korganizer/incidencechangerbase.h
new file mode 100644
index 00000000..9aeaf243
--- /dev/null
+++ b/korganizer/interfaces/korganizer/incidencechangerbase.h
@@ -0,0 +1,77 @@
+/*
+ This file is part of the KOrganizer interfaces.
+
+ Copyright (c) 2004 Reinhold Kainhofer <reinhold@kainhofer.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+#ifndef KORG_INCIDENCECHANGERBASE_H
+#define KORG_INCIDENCECHANGERBASE_H
+
+#include <libkcal/scheduler.h>
+#include <qobject.h>
+
+class QWidget;
+namespace KCal {
+class Calendar;
+class Incidence;
+}
+using namespace KCal;
+
+namespace KOrg {
+
+class IncidenceChangerBase : public QObject
+{
+Q_OBJECT
+public:
+ IncidenceChangerBase( Calendar*cal, QObject *parent = 0 ) :
+ QObject( parent ), mCalendar( cal ) {}
+ virtual ~IncidenceChangerBase() {}
+
+ virtual bool sendGroupwareMessage( Incidence *incidence,
+ KCal::Scheduler::Method method, bool deleting = false ) = 0;
+
+ virtual bool beginChange( Incidence * incidence ) = 0;
+ virtual bool endChange( Incidence *incidence ) = 0;
+
+ virtual bool addIncidence( Incidence *incidence, QWidget *parent = 0 ) = 0;
+ virtual bool changeIncidence( Incidence *newinc, Incidence *oldinc,
+ int action = -1 ) = 0;
+ virtual bool deleteIncidence( Incidence *incidence ) = 0;
+ virtual bool cutIncidence( Incidence *incidence ) = 0;
+
+/*
+ static bool incidencesEqual( Incidence *inc1, Incidence *inc2 );
+ static bool assignIncidence( Incidence *inc1, Incidence *inc2 );
+*/
+signals:
+ void incidenceAdded( Incidence * );
+ void incidenceChanged( Incidence *oldInc, Incidence *newInc, int );
+ void incidenceChanged( Incidence *oldInc, Incidence *newInc );
+ void incidenceToBeDeleted( Incidence * );
+ void incidenceDeleted( Incidence * );
+
+ void schedule( Scheduler::Method method, Incidence *incidence );
+protected:
+ Calendar *mCalendar;
+};
+
+
+
+
+}
+
+#endif
diff --git a/korganizer/interfaces/korganizer/korganizerpart.desktop b/korganizer/interfaces/korganizer/korganizerpart.desktop
new file mode 100644
index 00000000..7cb419de
--- /dev/null
+++ b/korganizer/interfaces/korganizer/korganizerpart.desktop
@@ -0,0 +1,66 @@
+[Desktop Entry]
+Type=ServiceType
+X-KDE-ServiceType=KOrganizer/Part
+Comment=KOrganizer Part
+Comment[af]=Korganizer Deel
+Comment[be]=Частка "K Арганізатар"
+Comment[bg]=Модул KOrganizer
+Comment[br]=Perzh KOrganizer
+Comment[bs]=KOrganizer dio
+Comment[ca]=Part de KOrganizer
+Comment[cy]=KTrefnydd Part
+Comment[da]=KOrganizer-del
+Comment[de]=KOrganizer-Komponente
+Comment[eo]=Organizilo-parto
+Comment[es]=Parte de KOrganizer
+Comment[et]=KOrganizeri komponent
+Comment[eu]=KOrganizer zatia
+Comment[fa]=بخش KOrganizer
+Comment[fr]=Composant KOrganizer
+Comment[gl]=Parte de KOrganizer
+Comment[he]=רכיב KOrganizer
+Comment[hi]=के-आर्गेनाइज़र हिस्सा
+Comment[hr]=KOrganizer komponenta
+Comment[hu]=KOrganizer objektum
+Comment[is]=KOrganizer hluti
+Comment[it]=Parte di KOrganizer
+Comment[ja]=KOrganizer パート
+Comment[ka]=KOrganizer კომპონენტი
+Comment[kk]=KOrganizer бөлшегі
+Comment[km]=ផ្នែក​របស់ KOrganizer
+Comment[lt]=KOrganizer dalis
+Comment[lv]=KOrganizer Daļa
+Comment[mk]=Дел од КОрганизатор
+Comment[ms]=Bahagian KOrganizer
+Comment[mt]=Parti ta' KOrganizer
+Comment[nb]=KOrganizerdel
+Comment[nds]=KOrganizer-Komponent
+Comment[ne]=केडीई आयोजक भाग
+Comment[nn]=KOrganizer-del
+Comment[nso]=Seripa sa KMokopanyi
+Comment[pl]=Moduł KOrganizera
+Comment[pt]=Componente do KOrganizer
+Comment[pt_BR]=Componente do KOrganizer
+Comment[ro]=Componentă KOrganizer
+Comment[ru]=Компонент органайзера
+Comment[se]=KOrganizer-oassi
+Comment[sk]=Part KOrganizer
+Comment[sl]=Del KOrganizerja
+Comment[sr]=Део KOrganizer-а
+Comment[sr@Latn]=Deo KOrganizer-a
+Comment[sv]=Korganizer-del
+Comment[ta]=கேஅமைப்பாளர் பகுதி
+Comment[tg]=Қисмати органайзер
+Comment[tr]=KOrganizer Parçası
+Comment[uk]=Складова KOrganizer
+Comment[ven]=Tshipida tsha mudzudzanyi wa K
+Comment[xh]=Indawana yeKOrganizer
+Comment[zh_CN]=KOrganizer 部件
+Comment[zh_TW]=KOrganizer 組件
+Comment[zu]=KUmgqugquzeleli Wengxenye
+
+[PropertyDef::X-KDE-KOrganizer-HasSettings]
+Type=bool
+
+[PropertyDef::X-KDE-PluginInterfaceVersion]
+Type=int
diff --git a/korganizer/interfaces/korganizer/korgprintplugin.desktop b/korganizer/interfaces/korganizer/korgprintplugin.desktop
new file mode 100644
index 00000000..ffa520d3
--- /dev/null
+++ b/korganizer/interfaces/korganizer/korgprintplugin.desktop
@@ -0,0 +1,66 @@
+[Desktop Entry]
+Type=ServiceType
+X-KDE-ServiceType=KOrganizer/PrintPlugin
+Comment=KOrganizer Part
+Comment[af]=Korganizer Deel
+Comment[be]=Частка "K Арганізатар"
+Comment[bg]=Модул KOrganizer
+Comment[br]=Perzh KOrganizer
+Comment[bs]=KOrganizer dio
+Comment[ca]=Part de KOrganizer
+Comment[cy]=KTrefnydd Part
+Comment[da]=KOrganizer-del
+Comment[de]=KOrganizer-Komponente
+Comment[eo]=Organizilo-parto
+Comment[es]=Parte de KOrganizer
+Comment[et]=KOrganizeri komponent
+Comment[eu]=KOrganizer zatia
+Comment[fa]=بخش KOrganizer
+Comment[fr]=Composant KOrganizer
+Comment[gl]=Parte de KOrganizer
+Comment[he]=רכיב KOrganizer
+Comment[hi]=के-आर्गेनाइज़र हिस्सा
+Comment[hr]=KOrganizer komponenta
+Comment[hu]=KOrganizer objektum
+Comment[is]=KOrganizer hluti
+Comment[it]=Parte di KOrganizer
+Comment[ja]=KOrganizer パート
+Comment[ka]=KOrganizer კომპონენტი
+Comment[kk]=KOrganizer бөлшегі
+Comment[km]=ផ្នែក​របស់ KOrganizer
+Comment[lt]=KOrganizer dalis
+Comment[lv]=KOrganizer Daļa
+Comment[mk]=Дел од КОрганизатор
+Comment[ms]=Bahagian KOrganizer
+Comment[mt]=Parti ta' KOrganizer
+Comment[nb]=KOrganizerdel
+Comment[nds]=KOrganizer-Komponent
+Comment[ne]=केडीई आयोजक भाग
+Comment[nn]=KOrganizer-del
+Comment[nso]=Seripa sa KMokopanyi
+Comment[pl]=Moduł KOrganizera
+Comment[pt]=Componente do KOrganizer
+Comment[pt_BR]=Componente do KOrganizer
+Comment[ro]=Componentă KOrganizer
+Comment[ru]=Компонент органайзера
+Comment[se]=KOrganizer-oassi
+Comment[sk]=Part KOrganizer
+Comment[sl]=Del KOrganizerja
+Comment[sr]=Део KOrganizer-а
+Comment[sr@Latn]=Deo KOrganizer-a
+Comment[sv]=Korganizer-del
+Comment[ta]=கேஅமைப்பாளர் பகுதி
+Comment[tg]=Қисмати органайзер
+Comment[tr]=KOrganizer Parçası
+Comment[uk]=Складова KOrganizer
+Comment[ven]=Tshipida tsha mudzudzanyi wa K
+Comment[xh]=Indawana yeKOrganizer
+Comment[zh_CN]=KOrganizer 部件
+Comment[zh_TW]=KOrganizer 組件
+Comment[zu]=KUmgqugquzeleli Wengxenye
+
+[PropertyDef::X-KDE-KOrganizer-HasSettings]
+Type=bool
+
+[PropertyDef::X-KDE-PluginInterfaceVersion]
+Type=int
diff --git a/korganizer/interfaces/korganizer/mainwindow.h b/korganizer/interfaces/korganizer/mainwindow.h
new file mode 100644
index 00000000..cbfb7915
--- /dev/null
+++ b/korganizer/interfaces/korganizer/mainwindow.h
@@ -0,0 +1,99 @@
+/*
+ This file is part of the KOrganizer interfaces.
+ Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+#ifndef KORG_MAINWINDOW_H
+#define KORG_MAINWINDOW_H
+
+#include <kxmlguiclient.h>
+
+#include <qwidget.h>
+
+class KActionCollection;
+class KAction;
+
+class ActionManager;
+
+namespace KOrg {
+
+class CalendarViewBase;
+
+/**
+ @short interface for korganizer main window
+ @author Cornelius Schumacher
+*/
+class MainWindow
+{
+ public:
+ MainWindow() : mDocument( true ) {}
+ virtual ~MainWindow() {}
+
+ virtual void init( bool hasDocument ) { Q_UNUSED( hasDocument ); }
+
+ virtual CalendarViewBase *view() const = 0;
+
+ /** Load calendar file from URL. Merge into current calendar, if \a merge is true. */
+ virtual bool openURL( const KURL &url, bool merge = false ) = 0;
+ /** Save calendar file to URL of current calendar */
+ virtual bool saveURL() = 0;
+ /** Save calendar file to URL */
+ virtual bool saveAsURL( const KURL &kurl ) = 0;
+
+ /** Get current URL */
+ virtual KURL getCurrentURL() const = 0;
+
+ /**
+ Return XML GUI factory of this main window.
+ */
+ virtual KXMLGUIFactory *mainGuiFactory() = 0;
+ /**
+ Return XML GUI client of this main window.
+ */
+ virtual KXMLGUIClient *mainGuiClient() = 0;
+ /**
+ Return widget whcih represents this main window.
+ */
+ virtual QWidget *topLevelWidget() = 0;
+ /**
+ Return ActionManager of this main window.
+ */
+ virtual ActionManager *actionManager() = 0;
+ /**
+ Return actionCollection of this main window.
+ */
+ virtual KActionCollection *getActionCollection() const = 0;
+ /**
+ Show status mesage in status bar.
+ */
+ virtual void showStatusMessage( const QString &message ) = 0;
+
+ /**
+ Set window title.
+ */
+ virtual void setTitle() = 0;
+
+ void setHasDocument( bool d ) { mDocument = d; }
+ bool hasDocument() const { return mDocument; }
+
+ private:
+ bool mDocument;
+};
+
+}
+
+#endif
diff --git a/korganizer/interfaces/korganizer/part.h b/korganizer/interfaces/korganizer/part.h
new file mode 100644
index 00000000..5db42929
--- /dev/null
+++ b/korganizer/interfaces/korganizer/part.h
@@ -0,0 +1,71 @@
+/*
+ This file is part of the KOrganizer interfaces.
+
+ Copyright (c) 2001,2003 Cornelius Schumacher <schumacher@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+#ifndef KORG_PART_H
+#define KORG_PART_H
+
+#include <qstring.h>
+
+#include <klibloader.h>
+#include <kparts/part.h>
+
+#include <korganizer/mainwindow.h>
+
+namespace KOrg {
+
+class Part : public KParts::Part
+{
+ public:
+ static int interfaceVersion() { return 2; }
+ static QString serviceType() { return "KOrganizer/Part"; }
+
+ typedef QPtrList<Part> List;
+
+ Part( MainWindow *parent, const char *name )
+ : KParts::Part( parent?(parent->topLevelWidget()):0, name ), mMainWindow( parent ) {}
+
+ virtual ~Part() {}
+
+ virtual QString info() = 0;
+ /** short name of the part, used as category in the keybindings dialog */
+ virtual QString shortInfo() = 0;
+
+ MainWindow *mainWindow() { return mMainWindow; }
+
+ private:
+ MainWindow *mMainWindow;
+};
+
+class PartFactory : public KLibFactory
+{
+ public:
+ virtual Part *create( MainWindow *parent, const char *name = 0 ) = 0;
+
+ protected:
+ virtual QObject *createObject( QObject *, const char *,const char *,
+ const QStringList & )
+ {
+ return 0;
+ }
+};
+
+}
+
+#endif
diff --git a/korganizer/interfaces/korganizer/printplugin.h b/korganizer/interfaces/korganizer/printplugin.h
new file mode 100644
index 00000000..0a7abd44
--- /dev/null
+++ b/korganizer/interfaces/korganizer/printplugin.h
@@ -0,0 +1,172 @@
+/*
+ This file is part of KOrganizer.
+
+ Copyright (c) 2003 Reinhold Kainhofer <reinhold@kainhofer.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+#ifndef PRINTPLUGINBASE_H
+#define PRINTPLUGINBASE_H
+
+#ifndef KORG_NOPRINTER
+
+#include <qdatetime.h>
+#include <kprinter.h>
+#include <calendar/plugin.h>
+#include <libkcal/incidence.h>
+
+namespace KCal {
+class Calendar;
+}
+
+namespace KOrg {
+class CoreHelper;
+
+/**
+ Base class of KOrganizer printer class.
+*/
+class CalPrinterBase
+{
+ public:
+ enum PrintType { Incidence = 100, Day=200, Week=300, Month=400, Todolist=1000, Journallist=2000 };
+};
+
+/**
+ Base class for KOrganizer printing classes. Each sub class represents one
+ calendar print format.
+*/
+class PrintPlugin : public KOrg::Plugin
+{
+ public:
+ PrintPlugin() : KOrg::Plugin(), mConfigWidget(0), mCoreHelper(0), mPrinter(0),
+ mCalendar(0), mConfig(0) {}
+ virtual ~PrintPlugin() {}
+
+ typedef QPtrList<PrintPlugin> List;
+ static int interfaceVersion() { return 2; }
+ static QString serviceType() { return "KOrganizer/PrintPlugin"; }
+
+ virtual void setKOrgCoreHelper( KOrg::CoreHelper*helper ) { mCoreHelper = helper; }
+ virtual void setConfig( KConfig *cfg ) { mConfig = cfg; }
+ virtual void setCalendar( KCal::Calendar *cal ) { mCalendar = cal; }
+ virtual void setSelectedIncidences( KCal::Incidence::List inc ) { mSelectedIncidences = inc; }
+ virtual KCal::Incidence::List selectedIncidences() const { return mSelectedIncidences; }
+
+
+ /**
+ Returns short description of print format.
+ */
+ virtual QString description() = 0;
+ /**
+ Returns long description of print format.
+ */
+ virtual QString info() = 0;
+
+ /**
+ Returns the sort ID of the plugin. This value will be used to identify
+ the config widget in the widget stack, and to sort the plugin name in the
+ print style selection list.
+ If another plugin uses the same ID or a value of -1 is returned, a unique
+ (negative) ID will be automatically generated and thus the position of
+ the plugin in the selection list is undefined.
+ */
+ virtual int sortID() { return -1; }
+
+ /**
+ Returns true if the plugin should be enabled; false otherwise.
+ */
+ virtual bool enabled() { return false; }
+
+ QWidget *configWidget( QWidget *w )
+ {
+ if ( !mConfigWidget ) {
+ mConfigWidget = createConfigWidget( w );
+ setSettingsWidget();
+ }
+ return mConfigWidget;
+ }
+ /* Create the config widget. setSettingsWidget will be automatically
+ called on it */
+ virtual QWidget *createConfigWidget( QWidget * ) = 0;
+
+ /**
+ Actually do the printing.
+ */
+ virtual void doPrint( KPrinter *printer ) = 0;
+
+ /**
+ Orientation of printout. Default is Portrait. If your plugin wants
+ to use some other orientation as default (e.g. depending on some
+ config settings), implement this function in your subclass and
+ return the desired orientation.
+ */
+ virtual KPrinter::Orientation defaultOrientation() { return KPrinter::Portrait; }
+
+ /**
+ Load complete config.
+ */
+ virtual void doLoadConfig() {};
+ /**
+ Save complete config.
+ */
+ virtual void doSaveConfig() {};
+
+
+ public:
+ /**
+ Read settings from configuration widget and apply them to current object.
+ */
+ virtual void readSettingsWidget() {}
+ /**
+ Set configuration widget to reflect settings of current object.
+ */
+ virtual void setSettingsWidget() {}
+
+ /**
+ Set date range which should be printed.
+ */
+ virtual void setDateRange( const QDate &from, const QDate &to )
+ {
+ mFromDate = from;
+ mToDate = to;
+ }
+
+ protected:
+ QDate mFromDate;
+ QDate mToDate;
+
+ protected:
+ QWidget *mConfigWidget;
+ KOrg::CoreHelper *mCoreHelper;
+ /** The printer object. This will only be available in the doPrint method
+ of the selected plugin */
+ KPrinter *mPrinter;
+ KCal::Calendar *mCalendar;
+ KCal::Incidence::List mSelectedIncidences;
+ KConfig *mConfig;
+};
+
+class PrintPluginFactory : public PluginFactory
+{
+ public:
+ virtual PrintPlugin *create() = 0;
+};
+
+}
+
+#endif
+
+#endif