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 QDateTime;
00032 
00033 namespace KPIM {
00034 class CategorySelectDialog;
00035 class DesignerFields;
00036 class EmbeddedURLPage;
00037 }
00038 
00039 namespace KOrg { class IncidenceChangerBase; }
00040 
00041 class KOEditorDetails;
00042 class KOAttendeeEditor;
00043 
00044 namespace KCal {
00045 class Calendar;
00046 class CalendarLocal;
00047 class Incidence;
00048 }
00049 using namespace KCal;
00050 using namespace KOrg;
00051 
00055 class KOIncidenceEditor : public KDialogBase
00056 {
00057     Q_OBJECT
00058   public:
00062     KOIncidenceEditor( const QString &caption, Calendar *calendar,
00063                        QWidget *parent );
00064     virtual ~KOIncidenceEditor();
00065 
00067     virtual void modified (int /*change*/=0) {}
00068 
00069     virtual void reload() = 0;
00070 
00071     virtual void selectInvitationCounterProposal( bool enable );
00072     virtual void selectCreateTask( bool enable );
00073 
00074   public slots:
00076     virtual void editIncidence(Incidence *, Calendar *) = 0;
00077     virtual void setIncidenceChanger( IncidenceChangerBase *changer ) {
00078         mChanger = changer; }
00080     virtual void init() = 0;
00084     void addAttachments( const QStringList &attachments,
00085                          const QStringList& mimeTypes = QStringList(),
00086                          bool inlineAttachment = false );
00090     void addAttendees( const QStringList &attendees );
00091 
00092 
00093   signals:
00094     void deleteAttendee( Incidence * );
00095 
00096     void editCategories();
00097     void updateCategoryConfig();
00098     void dialogClose( Incidence * );
00099     void editCanceled( Incidence * );
00100 
00101     void deleteIncidenceSignal( Incidence * );
00102     void signalAddAttachments( const QStringList &attachments,
00103                                const QStringList& mimeTypes = QStringList(),
00104                                bool inlineAttachment = false );
00105 
00106 
00107   protected slots:
00108     void slotApply();
00109     void slotOk();
00110     void slotCancel();
00111     void openURL( const KURL &url );
00112 
00113     virtual void slotManageTemplates();
00114 
00115     virtual void slotSaveTemplate( const QString & ) = 0;
00116     virtual void slotLoadTemplate( const QString& );
00117     virtual void slotTemplatesChanged( const QStringList& );
00118 
00119   protected:
00120     virtual QString type() { return QString::null; }
00121     virtual QStringList& templates() const = 0;
00122     virtual void loadTemplate( /*const*/ CalendarLocal& ) = 0;
00123 
00124     void setupAttendeesTab();
00125     void setupDesignerTabs( const QString &type );
00126 
00127     void saveAsTemplate( Incidence *, const QString &name );
00128 
00129     void readDesignerFields( Incidence *i );
00130     void writeDesignerFields( Incidence *i );
00131     // Returns the page widget. To remove the tab, just delete that one.
00132     QWidget *addDesignerTab( const QString &uifile );
00133 
00134     void setupEmbeddedURLPage( const QString &label, const QString &url,
00135                                const QString &mimetype );
00136     void createEmbeddedURLPages( Incidence *i );
00137 
00141     virtual bool processInput() { return false; }
00142 
00143     virtual void processCancel() {}
00144 
00145     void cancelRemovedAttendees( Incidence *incidence );
00146 
00147     Calendar *mCalendar;
00148 
00149     KOEditorDetails *mDetails;
00150     KOAttendeeEditor *mAttendeeEditor;
00151     KOrg::IncidenceChangerBase *mChanger;
00152 
00153     QPtrList<KPIM::DesignerFields> mDesignerFields;
00154     QMap<QWidget*, KPIM::DesignerFields*> mDesignerFieldForWidget;
00155     QPtrList<QWidget> mEmbeddedURLPages;
00156     QPtrList<QWidget> mAttachedDesignerFields;
00157     bool mIsCounter;
00158     bool mIsCreateTask;
00159 };
00160 
00161 #endif
00162 
00163 
KDE Home | KDE Accessibility Home | Description of Access Keys