korganizer

koincidenceeditor.h
1/*
2 This file is part of KOrganizer.
3
4 Copyright (c) 2001,2003 Cornelius Schumacher <schumacher@kde.org>
5 Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20
21 As a special exception, permission is given to link this program
22 with any edition of TQt, and distribute the resulting executable,
23 without including the source code for TQt in the source distribution.
24*/
25#ifndef KOINCIDENCEEDITOR_H
26#define KOINCIDENCEEDITOR_H
27
28#include <kdialogbase.h>
29#include <kurl.h>
30
31class TQDate;
32class TQDateTime;
33
34namespace KPIM {
35class CategorySelectDialog;
36class DesignerFields;
37class EmbeddedURLPage;
38}
39
40namespace KOrg { class IncidenceChangerBase; }
41
42class KOEditorDetails;
44
45namespace KCal {
46 class Calendar;
47 class CalendarLocal;
48 class Incidence;
49 class ResourceCalendar;
50}
51using namespace KCal;
52using namespace KOrg;
53
57class KOIncidenceEditor : public KDialogBase
58{
59 TQ_OBJECT
60
61 public:
65 KOIncidenceEditor( const TQString &caption, Calendar *calendar,
66 TQWidget *parent );
67 virtual ~KOIncidenceEditor();
68
70 virtual void modified() {}
71
72 virtual void reload() = 0;
73
74 virtual void setResource( ResourceCalendar *res, const TQString &subRes );
75 virtual void selectInvitationCounterProposal( bool enable );
76 virtual void selectCreateTask( bool enable );
77
90 void setRecurringIncidence( Incidence *originalIncidence, Incidence *incAfterDissociation );
91
92 public slots:
94 virtual void editIncidence(Incidence *, const TQDate &, Calendar *) = 0;
95 virtual void setIncidenceChanger( IncidenceChangerBase *changer ) {
96 mChanger = changer; }
98 virtual void init() = 0;
102 void addAttachments( const TQStringList &attachments,
103 const TQStringList& mimeTypes = TQStringList(),
104 bool inlineAttachment = false );
108 void addAttendees( const TQStringList &attendees );
109
110 signals:
111 void deleteAttendee( Incidence * );
112
113 void editCategories();
114 void updateCategoryConfig();
115 void dialogClose( Incidence * );
116 void editCanceled( Incidence * );
117
118 void deleteIncidenceSignal( Incidence * );
119 void signalAddAttachments( const TQStringList &attachments,
120 const TQStringList& mimeTypes = TQStringList(),
121 bool inlineAttachment = false );
122
123
124 protected slots:
125 void slotApply();
126 void slotOk();
127 void slotCancel();
128 void openURL( const KURL &url );
129
130 virtual void slotManageTemplates();
131
132 virtual void slotSaveTemplate( const TQString & ) = 0;
133 virtual void slotLoadTemplate( const TQString& );
134 virtual void slotTemplatesChanged( const TQStringList& );
135
136 protected:
137 virtual TQString type() { return TQString(); }
138 virtual TQStringList& templates() const = 0;
139 virtual void loadTemplate( /*const*/ CalendarLocal& ) = 0;
140
141 void setupAttendeesTab();
142 void setupDesignerTabs( const TQString &type );
143
144 void saveAsTemplate( Incidence *, const TQString &name );
145
146 void readDesignerFields( Incidence *i );
147 void writeDesignerFields( Incidence *i );
148 // Returns the page widget. To remove the tab, just delete that one.
149 TQWidget *addDesignerTab( const TQString &uifile );
150
151 void setupEmbeddedURLPage( const TQString &label, const TQString &url,
152 const TQString &mimetype );
153 void createEmbeddedURLPages( Incidence *i );
154
158 virtual bool processInput() { return false; }
159
160 virtual void processCancel() {}
161
162 void cancelRemovedAttendees( Incidence *incidence );
163
164 Calendar *mCalendar;
165
166 KOEditorDetails *mDetails;
167 KOAttendeeEditor *mAttendeeEditor;
168 KOrg::IncidenceChangerBase *mChanger;
169
170 TQPtrList<KPIM::DesignerFields> mDesignerFields;
171 TQMap<TQWidget*, KPIM::DesignerFields*> mDesignerFieldForWidget;
172 TQPtrList<TQWidget> mEmbeddedURLPages;
173 TQPtrList<TQWidget> mAttachedDesignerFields;
174 ResourceCalendar *mResource;
175 TQString mSubResource;
176 bool mIsCounter;
177 bool mIsCreateTask;
178
179 Incidence *mRecurIncidence;
180 Incidence *mRecurIncidenceAfterDissoc;
181
182};
183
184#endif
185
186
Common base class for attendee editor and free busy view.
This is the base class for the calendar component editors.
virtual void modified()
This incidence has been modified externally.
KOIncidenceEditor(const TQString &caption, Calendar *calendar, TQWidget *parent)
Construct new IncidenceEditor.
void setRecurringIncidence(Incidence *originalIncidence, Incidence *incAfterDissociation)
This should be called when editing only one occurrence of a recurring incidence, before showing the e...
void addAttendees(const TQStringList &attendees)
Adds attendees to the editor.
void addAttachments(const TQStringList &attachments, const TQStringList &mimeTypes=TQStringList(), bool inlineAttachment=false)
Adds attachments to the editor.
virtual void editIncidence(Incidence *, const TQDate &, Calendar *)=0
Edit an existing todo.
virtual void init()=0
Initialize editor.
virtual bool processInput()
Process user input and create or update event.