00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
#ifndef INCOMINGDIALOG_H
00020
#define INCOMINGDIALOG_H
00021
00022
#include <qlistview.h>
00023
00024
#include <libkcal/calendar.h>
00025
#include <libkcal/scheduler.h>
00026
00027
#include "incomingdialog_base.h"
00028
#include "outgoingdialog.h"
00029
00030
using namespace KCal;
00031
00032
class ScheduleItemIn :
public QListViewItem
00033 {
00034
public:
00035 ScheduleItemIn(QListView *parent,IncidenceBase *ev,Scheduler::Method method,
00036 ScheduleMessage::Status status);
00037
virtual ~ScheduleItemIn() {}
00038
00039 IncidenceBase *event() {
return mIncidence; }
00040 Scheduler::Method method() {
return mMethod; }
00041 ScheduleMessage::Status status() {
return mStatus; }
00042
00043
private:
00044 IncidenceBase *mIncidence;
00045 Scheduler::Method mMethod;
00046 ScheduleMessage::Status mStatus;
00047 };
00048
00049
00054 class ScheduleItemVisitor :
public Incidence::Visitor
00055 {
00056
public:
00057
ScheduleItemVisitor(ScheduleItemIn *);
00058 ~
ScheduleItemVisitor();
00059
00060
bool visit(Event *);
00061
bool visit(Todo *);
00062
bool visit(Journal *);
00063
00064
private:
00065 ScheduleItemIn *mItem;
00066 };
00067
00068
00069
00070
class IncomingDialog :
public IncomingDialog_base
00071 {
00072 Q_OBJECT
00073
public:
00074 IncomingDialog(Calendar *calendar,OutgoingDialog *outgoing,
00075 QWidget* parent=0,
const char* name=0,
bool modal=
false,WFlags fl=0);
00076 ~IncomingDialog();
00077
00078
void setOutgoingDialog(OutgoingDialog *outgoing);
00079
00080 signals:
00081
void calendarUpdated();
00082
void numMessagesChanged(
int);
00083
public slots:
00084
void retrieve();
00085
00086
protected slots:
00087
void acceptAllMessages();
00088
void acceptMessage();
00089
void rejectMessage();
00090
void showEvent(QListViewItem *);
00091
00092
protected:
00093
bool acceptMessage(ScheduleItemIn *item);
00094
bool incomeRefresh(ScheduleItemIn *item);
00095
bool incomeCounter(ScheduleItemIn *item);
00096
bool incomeDeclineCounter(ScheduleItemIn *item);
00097
bool incomeAdd(ScheduleItemIn *item);
00098
bool incomeRequest(ScheduleItemIn *item);
00099
bool incomeDefault(ScheduleItemIn *item);
00100
bool automaticAction(ScheduleItemIn *item);
00101
00102
private:
00103
bool checkAttendeesInAddressbook(IncidenceBase *inc);
00104
bool checkOrganizerInAddressbook(QString organizer);
00105 Calendar *mCalendar;
00106 Scheduler *mScheduler;
00107 OutgoingDialog *mOutgoing;
00108 };
00109
00110
#endif // INCOMINGDIALOG_H