-rw-r--r-- | korganizer/incomingdialog.h | 110 |
1 files changed, 110 insertions, 0 deletions
diff --git a/korganizer/incomingdialog.h b/korganizer/incomingdialog.h new file mode 100644 index 0000000..413ce6a --- a/dev/null +++ b/korganizer/incomingdialog.h | |||
@@ -0,0 +1,110 @@ | |||
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 | #ifndef INCOMINGDIALOG_H | ||
20 | #define INCOMINGDIALOG_H | ||
21 | |||
22 | #include <qlistview.h> | ||
23 | |||
24 | #include <libkcal/calendar.h> | ||
25 | #include <libkcal/scheduler.h> | ||
26 | |||
27 | #include "incomingdialog_base.h" | ||
28 | #include "outgoingdialog.h" | ||
29 | |||
30 | using namespace KCal; | ||
31 | |||
32 | class ScheduleItemIn : public QListViewItem | ||
33 | { | ||
34 | public: | ||
35 | ScheduleItemIn(QListView *parent,IncidenceBase *ev,Scheduler::Method method, | ||
36 | ScheduleMessage::Status status); | ||
37 | virtual ~ScheduleItemIn() {} | ||
38 | |||
39 | IncidenceBase *event() { return mIncidence; } | ||
40 | Scheduler::Method method() { return mMethod; } | ||
41 | ScheduleMessage::Status status() { return mStatus; } | ||
42 | |||
43 | private: | ||
44 | IncidenceBase *mIncidence; | ||
45 | Scheduler::Method mMethod; | ||
46 | ScheduleMessage::Status mStatus; | ||
47 | }; | ||
48 | |||
49 | |||
50 | /** | ||
51 | This class provides the initialisation of a ScheduleItemIn for calendar | ||
52 | components using the Incidence::Visitor. | ||
53 | */ | ||
54 | class ScheduleItemVisitor : public Incidence::Visitor | ||
55 | { | ||
56 | public: | ||
57 | ScheduleItemVisitor(ScheduleItemIn *); | ||
58 | ~ScheduleItemVisitor(); | ||
59 | |||
60 | bool visit(Event *); | ||
61 | bool visit(Todo *); | ||
62 | bool visit(Journal *); | ||
63 | |||
64 | private: | ||
65 | ScheduleItemIn *mItem; | ||
66 | }; | ||
67 | |||
68 | |||
69 | |||
70 | class IncomingDialog : public IncomingDialog_base | ||
71 | { | ||
72 | Q_OBJECT | ||
73 | public: | ||
74 | IncomingDialog(Calendar *calendar,OutgoingDialog *outgoing, | ||
75 | QWidget* parent=0,const char* name=0,bool modal=false,WFlags fl=0); | ||
76 | ~IncomingDialog(); | ||
77 | |||
78 | void setOutgoingDialog(OutgoingDialog *outgoing); | ||
79 | |||
80 | signals: | ||
81 | void calendarUpdated(); | ||
82 | void numMessagesChanged(int); | ||
83 | public slots: | ||
84 | void retrieve(); | ||
85 | |||
86 | protected slots: | ||
87 | void acceptAllMessages(); | ||
88 | void acceptMessage(); | ||
89 | void rejectMessage(); | ||
90 | void showEvent(QListViewItem *); | ||
91 | |||
92 | protected: | ||
93 | bool acceptMessage(ScheduleItemIn *item); | ||
94 | bool incomeRefresh(ScheduleItemIn *item); | ||
95 | bool incomeCounter(ScheduleItemIn *item); | ||
96 | bool incomeDeclineCounter(ScheduleItemIn *item); | ||
97 | bool incomeAdd(ScheduleItemIn *item); | ||
98 | bool incomeRequest(ScheduleItemIn *item); | ||
99 | bool incomeDefault(ScheduleItemIn *item); | ||
100 | bool automaticAction(ScheduleItemIn *item); | ||
101 | |||
102 | private: | ||
103 | bool checkAttendeesInAddressbook(IncidenceBase *inc); | ||
104 | bool checkOrganizerInAddressbook(QString organizer); | ||
105 | Calendar *mCalendar; | ||
106 | Scheduler *mScheduler; | ||
107 | OutgoingDialog *mOutgoing; | ||
108 | }; | ||
109 | |||
110 | #endif // INCOMINGDIALOG_H | ||