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 00030 class QPushButton; 00031 class QCheckBox; 00032 class QLineEdit; 00033 class QLabel; 00034 class QComboBox; 00035 class QHBox; 00036 class KDateEdit; 00037 class KOEditorFreeBusy; 00038 00039 namespace KCal { 00040 class Attendee; 00041 class Incidence; 00042 } 00043 using namespace KCal; 00044 00045 namespace KPIM { 00046 class AddresseeLineEdit; 00047 } 00048 00049 typedef CustomListViewItem<KCal::Attendee *> AttendeeListItem; 00050 00051 00057 class KOAttendeeListView : public KListView 00058 { 00059 Q_OBJECT 00060 public: 00061 KOAttendeeListView (QWidget *parent=0, const char *name=0); 00062 virtual ~KOAttendeeListView(); 00063 virtual void addAttendee( const QString& newAttendee ); 00064 public slots: 00065 virtual void contentsDragEnterEvent( QDragEnterEvent *e ); 00066 virtual void dragEnterEvent( QDragEnterEvent *e ); 00067 virtual void contentsDropEvent( QDropEvent *e ); 00068 virtual void dropEvent( QDropEvent *e ); 00069 virtual void contentsDragMoveEvent(QDragMoveEvent *e); 00070 signals: 00071 void dropped(Attendee*); 00072 }; 00073 00074 00075 class KOEditorDetails : public QWidget 00076 { 00077 Q_OBJECT 00078 public: 00079 KOEditorDetails (int spacing = 8,QWidget* parent = 0, const char* name = 0); 00080 virtual ~KOEditorDetails(); 00081 00083 void setDefaults(); 00085 void readEvent(Incidence *); 00087 void writeEvent(Incidence *); 00088 00090 void cancelAttendeeEvent(Incidence *); 00092 bool validateInput(); 00093 00095 void setFreeBusyWidget( KOEditorFreeBusy * ); 00096 00098 bool hasAttendees(); 00099 00100 public slots: 00101 void insertAttendee(Attendee *); 00102 00103 protected slots: 00104 void addNewAttendee(); 00105 void removeAttendee(); 00106 void openAddressBook(); 00107 void updateAttendeeInput(); 00108 void clearAttendeeInput(); 00109 void fillAttendeeInput(AttendeeListItem *); 00110 void updateAttendeeItem(); 00111 void setEnableAttendeeInput(bool); 00112 00113 protected: 00114 virtual bool eventFilter( QObject *, QEvent *); 00115 void fillOrganizerCombo(); 00116 00117 void insertAttendee( Attendee*, bool goodEmailAddress ); 00118 00119 private: 00120 bool mDisableItemUpdate; 00121 00122 KPIM::AddresseeLineEdit *mNameEdit; 00123 QString mUid; 00124 KListView *mListView; 00125 QComboBox* mRoleCombo; 00126 QCheckBox* mRsvpButton; 00127 QComboBox* mStatusCombo; 00128 QHBox* mOrganizerHBox; 00129 QComboBox *mOrganizerCombo; // either we organize it (combo shown) 00130 QLabel *mOrganizerLabel; // or someone else does (just a label is shown) 00131 00132 QPushButton* mAddButton; 00133 QPushButton* mRemoveButton; 00134 QPushButton* mAddressBookButton; 00135 00136 QPtrList<Attendee> mdelAttendees; 00137 00138 KOEditorFreeBusy *mFreeBusy; 00139 }; 00140 00141 #endif