From 460c52653ab0dcca6f19a4f492ed2c5e4e963ab0 Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- korganizer/koattendeeeditor.h | 124 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 korganizer/koattendeeeditor.h (limited to 'korganizer/koattendeeeditor.h') diff --git a/korganizer/koattendeeeditor.h b/korganizer/koattendeeeditor.h new file mode 100644 index 000000000..d7eb8cbdc --- /dev/null +++ b/korganizer/koattendeeeditor.h @@ -0,0 +1,124 @@ +/* + Copyright (c) 2000,2001 Cornelius Schumacher + Copyright (C) 2003-2004 Reinhold Kainhofer + Copyright (c) 2007 Volker Krause + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + +#ifndef KOATTENDEEEDITOR_H +#define KOATTENDEEEDITOR_H + +#include +#include + +class QBoxLayout; +class QComboBox; +class QCheckBox; +class QLabel; +class QPushButton; +class QHBox; + +namespace KPIM { + class AddresseeLineEdit; +} + +namespace KABC { + class Addressee; +} + +namespace KCal { + class Incidence; +} + +/** + Common base class for attendee editor and free busy view. +*/ +class KOAttendeeEditor : public QWidget +{ + Q_OBJECT + public: + KOAttendeeEditor( QWidget *parent, const char *name = 0 ); + + virtual void insertAttendee( KCal::Attendee* attendee, bool fetchFB = true ) = 0; + + virtual void readEvent( KCal::Incidence *incidence ); + virtual void writeEvent( KCal::Incidence *incidence ); + + /** return a clone of the event with attendees to be canceld*/ + void cancelAttendeeEvent( KCal::Incidence *incidence ); + + public slots: + void acceptForMe(); + void declineForMe(); + + signals: + void updateAttendeeSummary( int count ); + + protected: + void initOrganizerWidgets( QWidget *parent, QBoxLayout *layout ); + void initEditWidgets( QWidget *parent, QBoxLayout *layout ); + + /** Reads values from a KABC::Addressee and inserts a new Attendee + * item into the listview with those items. Used when adding attendees + * from the addressbook and expanding distribution lists. + * The optional Attendee parameter can be used to pass in default values + * to be used by the new Attendee. */ + void insertAttendeeFromAddressee( const KABC::Addressee &a, const KCal::Attendee* at=0 ); + + void fillOrganizerCombo(); + + virtual KCal::Attendee* currentAttendee() const = 0; + virtual void updateCurrentItem() = 0; + + virtual void changeStatusForMe( KCal::Attendee::PartStat status ) = 0; + + virtual bool eventFilter( QObject *, QEvent *); + + protected slots: + void addNewAttendee(); + void openAddressBook(); + + void setEnableAttendeeInput( bool enabled ); + void updateAttendeeInput(); + void clearAttendeeInput(); + void fillAttendeeInput( KCal::Attendee *a ); + void updateAttendee(); + + protected: + KPIM::AddresseeLineEdit *mNameEdit; + QString mUid; + QComboBox* mRoleCombo; + QCheckBox* mRsvpButton; + QComboBox* mStatusCombo; + + QHBox* mOrganizerHBox; + QComboBox *mOrganizerCombo; // either we organize it (combo shown) + QLabel *mOrganizerLabel; // or someone else does (just a label is shown) + + QLabel* mDelegateLabel; + + QPushButton* mAddButton; + QPushButton* mRemoveButton; + QPushButton* mAddressBookButton; + + QPtrList mdelAttendees; + QPtrList mnewAttendees; + + private: + bool mDisableItemUpdate; +}; + +#endif -- cgit v1.2.1