korganizer

koattendeeeditor.h
1 /*
2  Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
3  Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
4  Copyright (c) 2007 Volker Krause <vkrause@kde.org>
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program; if not, write to the Free Software
18  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 */
20 
21 #ifndef KOATTENDEEEDITOR_H
22 #define KOATTENDEEEDITOR_H
23 
24 #include <tqwidget.h>
25 #include <libkcal/attendee.h>
26 #include <tdeabc/addressee.h>
27 
28 class TQBoxLayout;
29 class TQComboBox;
30 class TQCheckBox;
31 class TQLabel;
32 class TQPushButton;
33 class TQHBox;
34 class TQListViewItem;
35 
36 namespace KPIM {
37  class AddresseeLineEdit;
38 }
39 
40 namespace KCal {
41  class Incidence;
42 }
43 
47 class KOAttendeeEditor : public TQWidget
48 {
49  TQ_OBJECT
50 
51  public:
52  KOAttendeeEditor( TQWidget *parent, const char *name = 0 );
53 
54  virtual void insertAttendee( KCal::Attendee *attendee, bool fetchFB = true ) = 0;
55  virtual void removeAttendee( KCal::Attendee *attendee ) = 0;
56 
57  virtual void readEvent( KCal::Incidence *incidence );
58  virtual void writeEvent( KCal::Incidence *incidence );
59 
61  void cancelAttendeeEvent( KCal::Incidence *incidence );
62 
63  public slots:
64  void acceptForMe();
65  void declineForMe();
66 
67  signals:
68  void updateAttendeeSummary( int count );
69 
70  protected:
71  void initOrganizerWidgets( TQWidget *parent, TQBoxLayout *layout );
72  void initEditWidgets( TQWidget *parent, TQBoxLayout *layout );
73 
79  void insertAttendeeFromAddressee( const TDEABC::Addressee &a, const KCal::Attendee* at=0 );
80 
81  void fillOrganizerCombo();
82  virtual TQListViewItem* hasExampleAttendee() const = 0;
83  bool isExampleAttendee( const KCal::Attendee* ) const;
84  virtual KCal::Attendee* currentAttendee() const = 0;
85  virtual void updateCurrentItem() = 0;
86 
87  virtual void setSelected ( int index ) = 0;
88  virtual int selectedIndex() = 0;
89  virtual void changeStatusForMe( KCal::Attendee::PartStat status ) = 0;
90 
91  virtual bool eventFilter( TQObject *, TQEvent *);
92 
93  protected slots:
94  void addNewAttendee();
95  void openAddressBook();
96 
97  void setEnableAttendeeInput( bool enabled );
98  void updateAttendeeInput();
99  void clearAttendeeInput();
100  void fillAttendeeInput( KCal::Attendee *a );
101  void expandAttendee();
102  void updateAttendee();
103 
104  protected:
105  KPIM::AddresseeLineEdit *mNameEdit;
106  TQString mUid;
107  TQComboBox* mRoleCombo;
108  TQCheckBox* mRsvpButton;
109  TQComboBox* mStatusCombo;
110 
111  TQHBox* mOrganizerHBox;
112  TQComboBox *mOrganizerCombo; // either we organize it (combo shown)
113  TQLabel *mOrganizerLabel; // or someone else does (just a label is shown)
114 
115  TQLabel* mDelegateLabel;
116 
117  TQPushButton* mAddButton;
118  TQPushButton* mRemoveButton;
119  TQPushButton* mAddressBookButton;
120 
121  TQPtrList<KCal::Attendee> mdelAttendees;
122  TQPtrList<KCal::Attendee> mnewAttendees;
123 
124  private:
125  TDEABC::Addressee::List expandDistList( const TQString &text ) const;
126  bool mDisableItemUpdate;
127 };
128 
129 #endif
Common base class for attendee editor and free busy view.
void insertAttendeeFromAddressee(const TDEABC::Addressee &a, const KCal::Attendee *at=0)
Reads values from a TDEABC::Addressee and inserts a new Attendee item into the listview with those it...
void cancelAttendeeEvent(KCal::Incidence *incidence)
return a clone of the event with attendees to be canceld