From 460c52653ab0dcca6f19a4f492ed2c5e4e963ab0 Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- korganizer/interfaces/Makefile.am | 1 + korganizer/interfaces/calendar/Makefile.am | 6 + .../interfaces/calendar/calendardecoration.desktop | 66 ++++++ .../interfaces/calendar/calendardecoration.h | 84 +++++++ .../interfaces/calendar/calendarplugin.desktop | 74 ++++++ korganizer/interfaces/calendar/plugin.h | 58 +++++ korganizer/interfaces/korganizer/Makefile.am | 6 + korganizer/interfaces/korganizer/baseview.h | 254 +++++++++++++++++++++ .../interfaces/korganizer/calendarviewbase.h | 63 +++++ korganizer/interfaces/korganizer/corehelper.h | 52 +++++ .../interfaces/korganizer/incidencechangerbase.h | 77 +++++++ .../interfaces/korganizer/korganizerpart.desktop | 66 ++++++ .../interfaces/korganizer/korgprintplugin.desktop | 66 ++++++ korganizer/interfaces/korganizer/mainwindow.h | 99 ++++++++ korganizer/interfaces/korganizer/part.h | 71 ++++++ korganizer/interfaces/korganizer/printplugin.h | 172 ++++++++++++++ 16 files changed, 1215 insertions(+) create mode 100644 korganizer/interfaces/Makefile.am create mode 100644 korganizer/interfaces/calendar/Makefile.am create mode 100644 korganizer/interfaces/calendar/calendardecoration.desktop create mode 100644 korganizer/interfaces/calendar/calendardecoration.h create mode 100644 korganizer/interfaces/calendar/calendarplugin.desktop create mode 100644 korganizer/interfaces/calendar/plugin.h create mode 100644 korganizer/interfaces/korganizer/Makefile.am create mode 100644 korganizer/interfaces/korganizer/baseview.h create mode 100644 korganizer/interfaces/korganizer/calendarviewbase.h create mode 100644 korganizer/interfaces/korganizer/corehelper.h create mode 100644 korganizer/interfaces/korganizer/incidencechangerbase.h create mode 100644 korganizer/interfaces/korganizer/korganizerpart.desktop create mode 100644 korganizer/interfaces/korganizer/korgprintplugin.desktop create mode 100644 korganizer/interfaces/korganizer/mainwindow.h create mode 100644 korganizer/interfaces/korganizer/part.h create mode 100644 korganizer/interfaces/korganizer/printplugin.h (limited to 'korganizer/interfaces') diff --git a/korganizer/interfaces/Makefile.am b/korganizer/interfaces/Makefile.am new file mode 100644 index 00000000..ed117460 --- /dev/null +++ b/korganizer/interfaces/Makefile.am @@ -0,0 +1 @@ +SUBDIRS=calendar korganizer diff --git a/korganizer/interfaces/calendar/Makefile.am b/korganizer/interfaces/calendar/Makefile.am new file mode 100644 index 00000000..d39a76a9 --- /dev/null +++ b/korganizer/interfaces/calendar/Makefile.am @@ -0,0 +1,6 @@ + +calinclude_HEADERS = plugin.h calendardecoration.h +calincludedir = $(includedir)/calendar + +servicetypedir = $(kde_servicetypesdir) +servicetype_DATA = calendarplugin.desktop calendardecoration.desktop diff --git a/korganizer/interfaces/calendar/calendardecoration.desktop b/korganizer/interfaces/calendar/calendardecoration.desktop new file mode 100644 index 00000000..e9763878 --- /dev/null +++ b/korganizer/interfaces/calendar/calendardecoration.desktop @@ -0,0 +1,66 @@ +[Desktop Entry] +Type=ServiceType +X-KDE-ServiceType=Calendar/Decoration +Comment=Calendar Decoration Plugin +Comment[af]=Kalender Versiering Inplak +Comment[bg]=Приставка за декорация на календара +Comment[br]=Lugent kinkladur an deiziadur +Comment[bs]=Dodatak za ukrašavanje kalendara +Comment[ca]=Endollable de decoració del calendari +Comment[cs]=Modul dekorace kalendáře +Comment[cy]=Ategyn Addurniad Calendr +Comment[da]=Calendar-dekorations-plugin +Comment[de]=Dekoration für den Kalender +Comment[el]=Πρόσθετο διακόσμησης ημερολογίου +Comment[eo]=Kalendarornama kromaĵo +Comment[es]=Plugin de decoración de calendario +Comment[et]=Kalendri dekoratsiooni plugin +Comment[eu]=Egutegi apainketa plugin-a +Comment[fa]=وصلۀ تزئین تقویم +Comment[fi]=Kalenteritekstin koristeluliitännäinen +Comment[fr]=Module de décoration d'agenda +Comment[fy]=Agindadekoraasjeplugin +Comment[gl]=Extensión para a Decoración do Calendario +Comment[he]=תוסף קישוטי לוח שנה +Comment[hi]=कैलेन्डर सजावट प्लगइन +Comment[hr]=Dodatak za dekoraciju kalendara +Comment[hu]=Naptármegjelenési bővítőmodul +Comment[is]=Íforrit til að skreyta texta dagatals +Comment[it]=Plugin di decorazione del calendario +Comment[ja]=カレンダー装飾プラグイン +Comment[ka]=კალენდრის გაფორმების მოდული +Comment[kk]=Күнтізбені безендіру модулі +Comment[km]=កម្មវិធី​ជំនួយ​សម្រាប់​តុបតែង​ប្រតិទិន +Comment[lt]=vCalendar dekoracijų priedas +Comment[lv]=Kalendāra Dekorāciju Iespraudnis +Comment[mk]=Приклучок за декорација на календар +Comment[ms]=Plugin Hiasan Kalendar +Comment[mt]=Plagin ta' dekorazzjoni tal-kalendarju +Comment[nb]=Calendar dekorasjonsprogramtillegg +Comment[nds]=Dekoratschoon för den Kalenner +Comment[ne]=क्यालेन्डर सजावट प्लगइन +Comment[nl]=Agendadecoratieplugin +Comment[nn]=Tilleggsmodul for kalenderpynt +Comment[nso]=Plugin ya Kgabiso ya Tshupamabaka +Comment[pl]=Wtyczka do dekoracji kalendarza +Comment[pt]='Plugin' de Decoração do Calendário +Comment[pt_BR]=Plug-in para Decoração do Calendário +Comment[ro]=Modul decorare calendar +Comment[ru]=Оформление календаря +Comment[se]=Kaleandarčiŋaid lassemoduvla +Comment[sk]=Modul pre skrášlenie kalendára +Comment[sl]=Vstavek besedilnega okrasa za Koledar +Comment[sr]=Прикључак за декорацију календара +Comment[sr@Latn]=Priključak za dekoraciju kalendara +Comment[sv]=Insticksprogram för kalenderdekoration +Comment[ta]=நாள்காட்டி அலங்கார சொருகுப்பொருள் +Comment[tg]=Модул барои ороиш додани тақвимот +Comment[th]=โปรแกรมเสริมตกแต่งบันทึกประจำวัน +Comment[tr]=Takvim Dekorasyon Eklentisi +Comment[uk]=Втулок прикрас календаря +Comment[ven]=Pulagini yo khavhisiwaho ya khalenda +Comment[vi]=Plugin phối trí lịch +Comment[xh]=Ikhalenda Yohombiso lwe Plugin +Comment[zh_CN]=日历装饰插件 +Comment[zh_TW]=行事曆文字裝飾外掛程式 +Comment[zu]=Ikhalenda Yeplagi Yokuhlobisa diff --git a/korganizer/interfaces/calendar/calendardecoration.h b/korganizer/interfaces/calendar/calendardecoration.h new file mode 100644 index 00000000..a6f487b7 --- /dev/null +++ b/korganizer/interfaces/calendar/calendardecoration.h @@ -0,0 +1,84 @@ +/* + This file is part of the KOrganizer interfaces. + + Copyright (c) 2001,2003 Cornelius Schumacher + + 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_CALENDARDECORATION_H +#define KORG_CALENDARDECORATION_H + +#include +#include +#include + +#include + +#include "plugin.h" + +namespace KOrg { + +/** + This class provides the interface for a date dependent decoration. + + It provides entities like texts and pictures for a given date. Implementations + can implement all functions or only a subset. +*/ +class CalendarDecoration : public Plugin +{ + public: + static int interfaceVersion() { return 2; } + static QString serviceType() { return "Calendar/Decoration"; } + + typedef QPtrList List; + + CalendarDecoration() {} + virtual ~CalendarDecoration() {} + + /** + Return a short text for a given date, ususally only a few words. + */ + virtual QString shortText( const QDate & ) { return QString::null; } + /** + Return along text for a given date. This text can be of any length, but + usually it will have one or a few paragraphs. + */ + virtual QString longText( const QDate & ) { return QString::null; } + + /** + Return a small pixmap. The size should be something like 30x30 pixels. + */ + virtual QPixmap smallPixmap( const QDate &) { return QPixmap(); } + /** + Return a large pixmap. The size should be something like 300x300 pixels. + */ + virtual QPixmap largePixmap( const QDate &) { return QPixmap(); } + + /** + Return a small widget. It should have the size of a pushbutton. + */ + virtual QWidget *smallWidget( QWidget *, const QDate & ) { return 0; } +}; + +class CalendarDecorationFactory : public PluginFactory +{ + public: + virtual CalendarDecoration *create() = 0; +}; + +} + +#endif diff --git a/korganizer/interfaces/calendar/calendarplugin.desktop b/korganizer/interfaces/calendar/calendarplugin.desktop new file mode 100644 index 00000000..765fced7 --- /dev/null +++ b/korganizer/interfaces/calendar/calendarplugin.desktop @@ -0,0 +1,74 @@ +[Desktop Entry] +Type=ServiceType +X-KDE-ServiceType=Calendar/Plugin +Comment=Calendar Plugin +Comment[af]=Kalender Inplak +Comment[az]=Təqvim Əlavəsi +Comment[be]=Дапаўненне "Календар" +Comment[bg]=Приставка за календар +Comment[br]=Lugent an deiziadur +Comment[bs]=Dodatak za kalendar +Comment[ca]=Endollable calendari +Comment[cs]=Kalendářový modul +Comment[cy]=Ategyn Calendr +Comment[da]=Calendar-plugin +Comment[de]=Kalender-Modul +Comment[el]=Πρόσθετο ημερολογίου +Comment[eo]=Kalendaro-kromaĵo +Comment[es]=Plugin de calendario +Comment[et]=Kalendriplugin +Comment[eu]=Egutegi plugin-a +Comment[fa]=وصلۀ تقویم +Comment[fi]=Kalenteriliitännäinen +Comment[fr]=Module d'agenda +Comment[fy]=Agindaplugin +Comment[gl]=Extensión de Calendario +Comment[he]=תוסף לוח שנה +Comment[hi]=कैलेन्डर प्लगइन +Comment[hr]=Kalendar dodatak +Comment[hu]=Naptárkezelő bővítőmodul +Comment[is]=Dagatals íforrit +Comment[it]=Plugin calendario +Comment[ja]=カレンダープラグイン +Comment[ka]=კალენდრის მოდული +Comment[kk]=Күнтізбе модулі +Comment[km]=កម្មវិធី​ជំនួយ​ប្រតិទិន +Comment[ko]=달력 플러그인 +Comment[lt]=iCalendar priedas +Comment[lv]=Kalendāra Iespraudnis +Comment[mk]=Приклучок за календар +Comment[ms]=Plugin Kalendar +Comment[mt]=Plagin tal-kalendarju +Comment[nb]=Calendar-programtillegg +Comment[nds]=Kalenner-Moduul +Comment[ne]=क्यालेन्डर प्लगइन +Comment[nl]=Agendaplugin +Comment[nn]=Kalendermodul +Comment[nso]=Plugin ya Tshupamabaka +Comment[pl]=Wtyczka do kalendarza +Comment[pt]='Plugin' de Calendário +Comment[pt_BR]=Plug-in de Calendário +Comment[ro]=Modul calendar +Comment[ru]=Модуль календаря +Comment[se]=Kaleandarlassemoduvla +Comment[sk]=Modul Calendar +Comment[sl]=Vstavek za Koledar +Comment[sr]=Прикључак за календар +Comment[sr@Latn]=Priključak za kalendar +Comment[sv]=Insticksprogram för kalender +Comment[ta]=நாள்காட்டி சொருகுப்பொருள் +Comment[tg]=Модул барои тақвимот +Comment[th]=โปรแกรมเสริมบันทึกประจำวัน +Comment[tr]=Takvim Eklentisi +Comment[uk]=Втулок календаря +Comment[uz]=Kalendar plagini +Comment[uz@cyrillic]=Календар плагини +Comment[ven]=U pulaga ha khalenda +Comment[vi]=Plugin lịch +Comment[xh]=Ikhalenda ye Plugin +Comment[zh_CN]=日历插件 +Comment[zh_TW]=行事曆外掛程式 +Comment[zu]=Iplagi Yekhalanda + +[PropertyDef::X-KDE-KOrganizer-HasSettings] +Type=bool diff --git a/korganizer/interfaces/calendar/plugin.h b/korganizer/interfaces/calendar/plugin.h new file mode 100644 index 00000000..478b8646 --- /dev/null +++ b/korganizer/interfaces/calendar/plugin.h @@ -0,0 +1,58 @@ +/* + This file is part of the KOrganizer interfaces. + + Copyright (c) 2001,2003 Cornelius Schumacher + + 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_PLUGIN_H +#define KORG_PLUGIN_H + +#include +#include + +namespace KOrg { + +class Plugin +{ + public: + static int interfaceVersion() { return 2; } + static QString serviceType() { return "Calendar/Plugin"; } + + Plugin() {} + virtual ~Plugin() {} + + virtual QString info() = 0; + + virtual void configure( QWidget * ) {} +}; + +class PluginFactory : public KLibFactory +{ + public: + virtual Plugin *create() = 0; + + protected: + virtual QObject *createObject( QObject *, const char *,const char *, + const QStringList & ) + { + return 0; + } +}; + +} + +#endif 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 + Copyright (C) 2004 Reinhold Kainhofer + + 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 +#include +#include + +#include +#include +#include +#include +#include "korganizer/incidencechangerbase.h" + +#include "printplugin.h" + +#include + +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 + Copyright (C) 2003-2004 Reinhold Kainhofer + + 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 + +#include + +#include + +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 + + 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 +#include +#include +#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 + + 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 +#include + +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 + + 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 + +#include + +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 + + 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 + +#include +#include + +#include + +namespace KOrg { + +class Part : public KParts::Part +{ + public: + static int interfaceVersion() { return 2; } + static QString serviceType() { return "KOrganizer/Part"; } + + typedef QPtrList 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 + + 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 +#include +#include +#include + +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 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 -- cgit v1.2.3