korganizer
koeditordetails.h
00001 /* 00002 This file is part of KOrganizer. 00003 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> 00004 Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com> 00005 00006 This program is free software; you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation; either version 2 of the License, or 00009 (at your option) any later version. 00010 00011 This program is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with this program; if not, write to the Free Software 00018 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00019 00020 As a special exception, permission is given to link this program 00021 with any edition of Qt, and distribute the resulting executable, 00022 without including the source code for Qt in the source distribution. 00023 */ 00024 #ifndef _KOEDITORDETAILS_H 00025 #define _KOEDITORDETAILS_H 00026 00027 #include <klistview.h> 00028 #include "customlistviewitem.h" 00029 #include "koattendeeeditor.h" 00030 00031 #include <libkcal/attendee.h> 00032 00033 class QPushButton; 00034 class QCheckBox; 00035 class QLineEdit; 00036 class QLabel; 00037 class QComboBox; 00038 class QHBox; 00039 class KDateEdit; 00040 class KOEditorFreeBusy; 00041 00042 namespace KCal { 00043 class Attendee; 00044 class Incidence; 00045 } 00046 using namespace KCal; 00047 00048 namespace KPIM { 00049 class AddresseeLineEdit; 00050 } 00051 00052 typedef CustomListViewItem<KCal::Attendee *> AttendeeListItem; 00053 00054 00060 class KOAttendeeListView : public KListView 00061 { 00062 Q_OBJECT 00063 public: 00064 KOAttendeeListView (QWidget *parent=0, const char *name=0); 00065 virtual ~KOAttendeeListView(); 00066 virtual void addAttendee( const QString& newAttendee ); 00067 public slots: 00068 virtual void contentsDragEnterEvent( QDragEnterEvent *e ); 00069 virtual void dragEnterEvent( QDragEnterEvent *e ); 00070 virtual void contentsDropEvent( QDropEvent *e ); 00071 virtual void dropEvent( QDropEvent *e ); 00072 virtual void contentsDragMoveEvent(QDragMoveEvent *e); 00073 signals: 00074 void dropped(Attendee*); 00075 }; 00076 00077 00078 class KOEditorDetails : public KOAttendeeEditor 00079 { 00080 Q_OBJECT 00081 public: 00082 KOEditorDetails (int spacing = 8,QWidget* parent = 0, const char* name = 0); 00083 virtual ~KOEditorDetails(); 00084 00086 void setDefaults(); 00088 void readEvent(Incidence *); 00090 void writeEvent(Incidence *); 00091 00093 bool validateInput(); 00094 00096 bool hasAttendees(); 00097 00098 void insertAttendee( Attendee*, bool goodEmailAddress = true ); 00099 00100 protected slots: 00101 void removeAttendee(); 00102 void slotInsertAttendee( Attendee *a ); 00103 00104 protected: 00105 void changeStatusForMe( Attendee::PartStat status ); 00106 00107 KCal::Attendee* currentAttendee() const; 00108 /* reimpl */ 00109 bool hasExampleAttendee() const; 00110 void updateCurrentItem(); 00111 00112 private: 00113 bool mDisableItemUpdate; 00114 00115 KListView *mListView; 00116 // KOEditorFreeBusy *mFreeBusy; 00117 }; 00118 00119 #endif