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 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 KListView
00061 {
00062 Q_OBJECT
00063 public:
00064   KOAttendeeListView (TQWidget *parent=0, const char *name=0);
00065   virtual ~KOAttendeeListView();
00066   virtual void addAttendee( const TQString& newAttendee );
00067 public slots:
00068   virtual void contentsDragEnterEvent( TQDragEnterEvent *e );
00069   virtual void dragEnterEvent( TQDragEnterEvent *e );
00070   virtual void contentsDropEvent( TQDropEvent *e );
00071   virtual void dropEvent( TQDropEvent *e );
00072   virtual void contentsDragMoveEvent(TQDragMoveEvent *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,TQWidget* 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 *a, bool goodEmailAddress = true );
00099     void removeAttendee( Attendee *a );
00100 
00101   protected slots:
00102     void removeAttendee();
00103     void slotInsertAttendee( Attendee *a );
00104 
00105   protected:
00106     void setSelected ( int index );
00107     int selectedIndex();
00108     void changeStatusForMe( Attendee::PartStat status );
00109 
00110     KCal::Attendee* currentAttendee() const;
00111     /* reimpl */
00112     TQListViewItem* hasExampleAttendee() const;
00113     void updateCurrentItem();
00114 
00115   private:
00116     bool mDisableItemUpdate;
00117 
00118     KListView *mListView;
00119 //     KOEditorFreeBusy *mFreeBusy;
00120 };
00121 
00122 #endif