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 namespace KABC {
00050     class Addressee;
00051 }
00052 
00053 typedef CustomListViewItem<KCal::Attendee *> AttendeeListItem;
00054 
00055 
00061 class KOAttendeeListView : public KListView
00062 {
00063 Q_OBJECT
00064 public:
00065   KOAttendeeListView (QWidget *parent=0, const char *name=0);
00066   virtual ~KOAttendeeListView();
00067   virtual void addAttendee( const QString& newAttendee );
00068 public slots:
00069   virtual void contentsDragEnterEvent( QDragEnterEvent *e );
00070   virtual void dragEnterEvent( QDragEnterEvent *e );
00071   virtual void contentsDropEvent( QDropEvent *e );
00072   virtual void dropEvent( QDropEvent *e );
00073   virtual void contentsDragMoveEvent(QDragMoveEvent *e);
00074 signals:
00075   void dropped(Attendee*);
00076 };
00077 
00078 
00079 class KOEditorDetails : public QWidget
00080 {
00081     Q_OBJECT
00082   public:
00083     KOEditorDetails (int spacing = 8,QWidget* parent = 0, const char* name = 0);
00084     virtual ~KOEditorDetails();
00085 
00087     void setDefaults();
00089     void readEvent(Incidence *);
00091     void writeEvent(Incidence *);
00092 
00094     void cancelAttendeeEvent(Incidence *);
00096     bool validateInput();
00097 
00099     void setFreeBusyWidget( KOEditorFreeBusy * );
00100 
00102     bool hasAttendees();
00103 
00104   public slots:
00105     void insertAttendee(Attendee *);
00106 
00112     void insertAttendeeFromAddressee( const KABC::Addressee& , const Attendee* at=0 );
00113 
00114   protected slots:
00115     void addNewAttendee();
00116     void removeAttendee();
00117     void openAddressBook();
00118     void updateAttendeeInput();
00119     void clearAttendeeInput();
00120     void fillAttendeeInput(AttendeeListItem *);
00121     void updateAttendeeItem();
00122     void setEnableAttendeeInput(bool);
00123 
00124   protected:
00125     virtual bool eventFilter( QObject *, QEvent *);
00126     void fillOrganizerCombo();
00127 
00128     void insertAttendee( Attendee*, bool goodEmailAddress );
00129 
00130   private:
00131     bool mDisableItemUpdate;
00132 
00133     KPIM::AddresseeLineEdit *mNameEdit;
00134     QString mUid;
00135     KListView *mListView;
00136     QComboBox* mRoleCombo;
00137     QCheckBox* mRsvpButton;
00138     QComboBox* mStatusCombo;
00139     QHBox* mOrganizerHBox;
00140     QComboBox *mOrganizerCombo; // either we organize it (combo shown)
00141     QLabel *mOrganizerLabel; // or someone else does (just a label is shown)
00142 
00143     QPushButton* mAddButton;
00144     QPushButton* mRemoveButton;
00145     QPushButton* mAddressBookButton;
00146 
00147     QPtrList<Attendee> mdelAttendees;
00148 
00149     KOEditorFreeBusy *mFreeBusy;
00150 };
00151 
00152 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys