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 TQt, and distribute the resulting executable, 00022 without including the source code for TQt in the source distribution. 00023 */ 00024 #ifndef _KOEDITORDETAILS_H 00025 #define _KOEDITORDETAILS_H 00026 00027 #include <tdelistview.h> 00028 #include "customlistviewitem.h" 00029 #include "koattendeeeditor.h" 00030 00031 #include <libkcal/attendee.h> 00032 00033 class TQPushButton; 00034 class TQCheckBox; 00035 class TQLineEdit; 00036 class TQLabel; 00037 class TQComboBox; 00038 class TQHBox; 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 TDEListView 00061 { 00062 Q_OBJECT 00063 00064 public: 00065 KOAttendeeListView (TQWidget *parent=0, const char *name=0); 00066 virtual ~KOAttendeeListView(); 00067 virtual void addAttendee( const TQString& newAttendee ); 00068 public slots: 00069 virtual void contentsDragEnterEvent( TQDragEnterEvent *e ); 00070 virtual void dragEnterEvent( TQDragEnterEvent *e ); 00071 virtual void contentsDropEvent( TQDropEvent *e ); 00072 virtual void dropEvent( TQDropEvent *e ); 00073 virtual void contentsDragMoveEvent(TQDragMoveEvent *e); 00074 signals: 00075 void dropped(Attendee*); 00076 }; 00077 00078 00079 class KOEditorDetails : public KOAttendeeEditor 00080 { 00081 Q_OBJECT 00082 00083 public: 00084 KOEditorDetails (int spacing = 8,TQWidget* parent = 0, const char* name = 0); 00085 virtual ~KOEditorDetails(); 00086 00088 void setDefaults(); 00090 void readEvent(Incidence *); 00092 void writeEvent(Incidence *); 00093 00095 bool validateInput(); 00096 00098 bool hasAttendees(); 00099 00100 void insertAttendee( Attendee *a, bool goodEmailAddress = true ); 00101 void removeAttendee( Attendee *a ); 00102 00103 protected slots: 00104 void removeAttendee(); 00105 void slotInsertAttendee( Attendee *a ); 00106 00107 protected: 00108 void setSelected ( int index ); 00109 int selectedIndex(); 00110 void changeStatusForMe( Attendee::PartStat status ); 00111 00112 KCal::Attendee* currentAttendee() const; 00113 /* reimpl */ 00114 TQListViewItem* hasExampleAttendee() const; 00115 void updateCurrentItem(); 00116 00117 private: 00118 bool mDisableItemUpdate; 00119 00120 TDEListView *mListView; 00121 // KOEditorFreeBusy *mFreeBusy; 00122 }; 00123 00124 #endif