author | zautrix <zautrix> | 2004-06-26 19:01:18 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-06-26 19:01:18 (UTC) |
commit | b9aad1f15dc600e4dbe4c62d3fcced6363188ba3 (patch) (unidiff) | |
tree | 2c3d4004fb21c72cba65793859f9bcd8ffd3a49c /korganizer/koeventeditor.h | |
download | kdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.zip kdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.tar.gz kdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.tar.bz2 |
Initial revision
-rw-r--r-- | korganizer/koeventeditor.h | 118 |
1 files changed, 118 insertions, 0 deletions
diff --git a/korganizer/koeventeditor.h b/korganizer/koeventeditor.h new file mode 100644 index 0000000..5303c27 --- a/dev/null +++ b/korganizer/koeventeditor.h | |||
@@ -0,0 +1,118 @@ | |||
1 | /* | ||
2 | This file is part of KOrganizer. | ||
3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> | ||
4 | |||
5 | This program is free software; you can redistribute it and/or modify | ||
6 | it under the terms of the GNU General Public License as published by | ||
7 | the Free Software Foundation; either version 2 of the License, or | ||
8 | (at your option) any later version. | ||
9 | |||
10 | This program is distributed in the hope that it will be useful, | ||
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | GNU General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU General Public License | ||
16 | along with this program; if not, write to the Free Software | ||
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
18 | |||
19 | As a special exception, permission is given to link this program | ||
20 | with any edition of Qt, and distribute the resulting executable, | ||
21 | without including the source code for Qt in the source distribution. | ||
22 | */ | ||
23 | #ifndef _KOEVENTEDITOR_H | ||
24 | #define _KOEVENTEDITOR_H | ||
25 | |||
26 | #include <kdialogbase.h> | ||
27 | |||
28 | #include <qdatetime.h> | ||
29 | |||
30 | #include <libkcal/calendar.h> | ||
31 | |||
32 | #include "koeditorgeneralevent.h" | ||
33 | #include "koeditordetails.h" | ||
34 | #include "koeditorrecurrence.h" | ||
35 | #include "koincidenceeditor.h" | ||
36 | |||
37 | class SaveTemplateDialog; | ||
38 | |||
39 | using namespace KCal; | ||
40 | |||
41 | /** | ||
42 | This class provides a dialog for editing an event. | ||
43 | */ | ||
44 | class KOEventEditor : public KOIncidenceEditor | ||
45 | { | ||
46 | Q_OBJECT | ||
47 | public: | ||
48 | /** | ||
49 | Construct new event editor. | ||
50 | */ | ||
51 | KOEventEditor( Calendar *calendar, QWidget *parent ); | ||
52 | virtual ~KOEventEditor(void); | ||
53 | |||
54 | void init(); | ||
55 | |||
56 | void reload(); | ||
57 | |||
58 | /** | ||
59 | Clear eventwin for new event, and preset the dates and times with hint | ||
60 | */ | ||
61 | void newEvent( QDateTime from, QDateTime to, bool allDay = false ); | ||
62 | /** | ||
63 | Edit an existing event. | ||
64 | */ | ||
65 | void editEvent( Event * , bool showDescription = false); | ||
66 | |||
67 | /** | ||
68 | Set widgets to default values | ||
69 | */ | ||
70 | void setDefaults( QDateTime from, QDateTime to, bool allDay ); | ||
71 | |||
72 | /** | ||
73 | Read event object and setup widgets accordingly. If tmpl is true, the | ||
74 | event is read as template, i.e. the time and date information isn't set. | ||
75 | */ | ||
76 | void readEvent( Event *, bool tmpl = false ); | ||
77 | /** | ||
78 | Write event settings to event object | ||
79 | */ | ||
80 | void writeEvent( Event * ); | ||
81 | |||
82 | void setCategories( QString s ); | ||
83 | void setSecrecy( int ); | ||
84 | signals: | ||
85 | void eventAdded(Event *); | ||
86 | void eventChanged(Event *); | ||
87 | void eventToBeDeleted(Event *); | ||
88 | void eventDeleted(); | ||
89 | void deleteAttendee(Incidence *); | ||
90 | |||
91 | protected slots: | ||
92 | void loadDefaults(); | ||
93 | void deleteEvent(); | ||
94 | |||
95 | void slotLoadTemplate(); | ||
96 | void slotSaveTemplate(); | ||
97 | |||
98 | void saveTemplate( const QString & ); | ||
99 | |||
100 | protected: | ||
101 | void setupGeneral(); | ||
102 | void setupRecurrence(); | ||
103 | |||
104 | /** Check if the input is valid. */ | ||
105 | bool validateInput(); | ||
106 | /** Process user input and create or update event. Returns false if input | ||
107 | * is not valid */ | ||
108 | bool processInput( bool ); | ||
109 | int msgItemDelete(); | ||
110 | |||
111 | private: | ||
112 | Event *mEvent; | ||
113 | |||
114 | KOEditorGeneralEvent *mGeneral; | ||
115 | KOEditorRecurrence *mRecurrence; | ||
116 | }; | ||
117 | |||
118 | #endif | ||