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 TQt, and distribute the resulting executable, 00023 without including the source code for TQt 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 TQDate; 00032 class TQDateTime; 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 00061 public: 00065 KOIncidenceEditor( const TQString &caption, Calendar *calendar, 00066 TQWidget *parent ); 00067 virtual ~KOIncidenceEditor(); 00068 00070 virtual void modified() {} 00071 00072 virtual void reload() = 0; 00073 00074 virtual void setResource( ResourceCalendar *res, const TQString &subRes ); 00075 virtual void selectInvitationCounterProposal( bool enable ); 00076 virtual void selectCreateTask( bool enable ); 00077 00090 void setRecurringIncidence( Incidence *originalIncidence, Incidence *incAfterDissociation ); 00091 00092 public slots: 00094 virtual void editIncidence(Incidence *, const TQDate &, Calendar *) = 0; 00095 virtual void setIncidenceChanger( IncidenceChangerBase *changer ) { 00096 mChanger = changer; } 00098 virtual void init() = 0; 00102 void addAttachments( const TQStringList &attachments, 00103 const TQStringList& mimeTypes = TQStringList(), 00104 bool inlineAttachment = false ); 00108 void addAttendees( const TQStringList &attendees ); 00109 00110 signals: 00111 void deleteAttendee( Incidence * ); 00112 00113 void editCategories(); 00114 void updateCategoryConfig(); 00115 void dialogClose( Incidence * ); 00116 void editCanceled( Incidence * ); 00117 00118 void deleteIncidenceSignal( Incidence * ); 00119 void signalAddAttachments( const TQStringList &attachments, 00120 const TQStringList& mimeTypes = TQStringList(), 00121 bool inlineAttachment = false ); 00122 00123 00124 protected slots: 00125 void slotApply(); 00126 void slotOk(); 00127 void slotCancel(); 00128 void openURL( const KURL &url ); 00129 00130 virtual void slotManageTemplates(); 00131 00132 virtual void slotSaveTemplate( const TQString & ) = 0; 00133 virtual void slotLoadTemplate( const TQString& ); 00134 virtual void slotTemplatesChanged( const TQStringList& ); 00135 00136 protected: 00137 virtual TQString type() { return TQString(); } 00138 virtual TQStringList& templates() const = 0; 00139 virtual void loadTemplate( /*const*/ CalendarLocal& ) = 0; 00140 00141 void setupAttendeesTab(); 00142 void setupDesignerTabs( const TQString &type ); 00143 00144 void saveAsTemplate( Incidence *, const TQString &name ); 00145 00146 void readDesignerFields( Incidence *i ); 00147 void writeDesignerFields( Incidence *i ); 00148 // Returns the page widget. To remove the tab, just delete that one. 00149 TQWidget *addDesignerTab( const TQString &uifile ); 00150 00151 void setupEmbeddedURLPage( const TQString &label, const TQString &url, 00152 const TQString &mimetype ); 00153 void createEmbeddedURLPages( Incidence *i ); 00154 00158 virtual bool processInput() { return false; } 00159 00160 virtual void processCancel() {} 00161 00162 void cancelRemovedAttendees( Incidence *incidence ); 00163 00164 Calendar *mCalendar; 00165 00166 KOEditorDetails *mDetails; 00167 KOAttendeeEditor *mAttendeeEditor; 00168 KOrg::IncidenceChangerBase *mChanger; 00169 00170 TQPtrList<KPIM::DesignerFields> mDesignerFields; 00171 TQMap<TQWidget*, KPIM::DesignerFields*> mDesignerFieldForWidget; 00172 TQPtrList<TQWidget> mEmbeddedURLPages; 00173 TQPtrList<TQWidget> mAttachedDesignerFields; 00174 ResourceCalendar *mResource; 00175 TQString mSubResource; 00176 bool mIsCounter; 00177 bool mIsCreateTask; 00178 00179 Incidence *mRecurIncidence; 00180 Incidence *mRecurIncidenceAfterDissoc; 00181 00182 }; 00183 00184 #endif 00185 00186