korganizer

koincidenceeditor.h

00001 /*
00002     This file is part of KOrganizer.
00003 
00004     Copyright (c) 2001,2003 Cornelius Schumacher <schumacher@kde.org>
00005     Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
00006 
00007     This program is free software; you can redistribute it and/or modify
00008     it under the terms of the GNU General Public License as published by
00009     the Free Software Foundation; either version 2 of the License, or
00010     (at your option) any later version.
00011 
00012     This program 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
00015     GNU General Public License for more details.
00016 
00017     You should have received a copy of the GNU General Public License
00018     along with this program; if not, write to the Free Software
00019     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00020 
00021     As a special exception, permission is given to link this program
00022     with any edition of Qt, and distribute the resulting executable,
00023     without including the source code for Qt in the source distribution.
00024 */
00025 #ifndef KOINCIDENCEEDITOR_H
00026 #define KOINCIDENCEEDITOR_H
00027 
00028 #include <kdialogbase.h>
00029 #include <kurl.h>
00030 
00031 class QDate;
00032 class QDateTime;
00033 
00034 namespace KPIM {
00035 class CategorySelectDialog;
00036 class DesignerFields;
00037 class EmbeddedURLPage;
00038 }
00039 
00040 namespace KOrg { class IncidenceChangerBase; }
00041 
00042 class KOEditorDetails;
00043 class KOAttendeeEditor;
00044 
00045 namespace KCal {
00046   class Calendar;
00047   class CalendarLocal;
00048   class Incidence;
00049   class ResourceCalendar;
00050 }
00051 using namespace KCal;
00052 using namespace KOrg;
00053 
00057 class KOIncidenceEditor : public KDialogBase
00058 {
00059   Q_OBJECT
00060   public:
00064     KOIncidenceEditor( const QString &caption, Calendar *calendar,
00065                        QWidget *parent );
00066     virtual ~KOIncidenceEditor();
00067 
00069     virtual void modified() {}
00070 
00071     virtual void reload() = 0;
00072 
00073     virtual void setResource( ResourceCalendar *res, const QString &subRes );
00074     virtual void selectInvitationCounterProposal( bool enable );
00075     virtual void selectCreateTask( bool enable );
00076 
00089     void setRecurringIncidence( Incidence *originalIncidence, Incidence *incAfterDissociation );
00090 
00091   public slots:
00093     virtual void editIncidence(Incidence *, const QDate &, Calendar *) = 0;
00094     virtual void setIncidenceChanger( IncidenceChangerBase *changer ) {
00095         mChanger = changer; }
00097     virtual void init() = 0;
00101     void addAttachments( const QStringList &attachments,
00102                          const QStringList& mimeTypes = QStringList(),
00103                          bool inlineAttachment = false );
00107     void addAttendees( const QStringList &attendees );
00108 
00109   signals:
00110     void deleteAttendee( Incidence * );
00111 
00112     void editCategories();
00113     void updateCategoryConfig();
00114     void dialogClose( Incidence * );
00115     void editCanceled( Incidence * );
00116 
00117     void deleteIncidenceSignal( Incidence * );
00118     void signalAddAttachments( const QStringList &attachments,
00119                                const QStringList& mimeTypes = QStringList(),
00120                                bool inlineAttachment = false );
00121 
00122 
00123   protected slots:
00124     void slotApply();
00125     void slotOk();
00126     void slotCancel();
00127     void openURL( const KURL &url );
00128 
00129     virtual void slotManageTemplates();
00130 
00131     virtual void slotSaveTemplate( const QString & ) = 0;
00132     virtual void slotLoadTemplate( const QString& );
00133     virtual void slotTemplatesChanged( const QStringList& );
00134 
00135   protected:
00136     virtual QString type() { return QString::null; }
00137     virtual QStringList& templates() const = 0;
00138     virtual void loadTemplate( /*const*/ CalendarLocal& ) = 0;
00139 
00140     void setupAttendeesTab();
00141     void setupDesignerTabs( const QString &type );
00142 
00143     void saveAsTemplate( Incidence *, const QString &name );
00144 
00145     void readDesignerFields( Incidence *i );
00146     void writeDesignerFields( Incidence *i );
00147     // Returns the page widget. To remove the tab, just delete that one.
00148     QWidget *addDesignerTab( const QString &uifile );
00149 
00150     void setupEmbeddedURLPage( const QString &label, const QString &url,
00151                                const QString &mimetype );
00152     void createEmbeddedURLPages( Incidence *i );
00153 
00157     virtual bool processInput() { return false; }
00158 
00159     virtual void processCancel() {}
00160 
00161     void cancelRemovedAttendees( Incidence *incidence );
00162 
00163     Calendar *mCalendar;
00164 
00165     KOEditorDetails *mDetails;
00166     KOAttendeeEditor *mAttendeeEditor;
00167     KOrg::IncidenceChangerBase *mChanger;
00168 
00169     QPtrList<KPIM::DesignerFields> mDesignerFields;
00170     QMap<QWidget*, KPIM::DesignerFields*> mDesignerFieldForWidget;
00171     QPtrList<QWidget> mEmbeddedURLPages;
00172     QPtrList<QWidget> mAttachedDesignerFields;
00173     ResourceCalendar *mResource;
00174     QString mSubResource;
00175     bool mIsCounter;
00176     bool mIsCreateTask;
00177 
00178     Incidence *mRecurIncidence;
00179     Incidence *mRecurIncidenceAfterDissoc;
00180 
00181 };
00182 
00183 #endif
00184 
00185 
KDE Home | KDE Accessibility Home | Description of Access Keys