korganizer

koeditordetails.h
1 /*
2  This file is part of KOrganizer.
3  Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
4  Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
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  As a special exception, permission is given to link this program
21  with any edition of TQt, and distribute the resulting executable,
22  without including the source code for TQt in the source distribution.
23 */
24 #ifndef _KOEDITORDETAILS_H
25 #define _KOEDITORDETAILS_H
26 
27 #include <tdelistview.h>
28 #include "customlistviewitem.h"
29 #include "koattendeeeditor.h"
30 
31 #include <libkcal/attendee.h>
32 
33 class TQPushButton;
34 class TQCheckBox;
35 class TQLineEdit;
36 class TQLabel;
37 class TQComboBox;
38 class TQHBox;
39 class KDateEdit;
40 class KOEditorFreeBusy;
41 
42 namespace KCal {
43 class Attendee;
44 class Incidence;
45 }
46 using namespace KCal;
47 
48 namespace KPIM {
49 class AddresseeLineEdit;
50 }
51 
52 typedef CustomListViewItem<KCal::Attendee *> AttendeeListItem;
53 
54 
60 class KOAttendeeListView : public TDEListView
61 {
62 TQ_OBJECT
63 
64 public:
65  KOAttendeeListView (TQWidget *parent=0, const char *name=0);
66  virtual ~KOAttendeeListView();
67  virtual void addAttendee( const TQString& newAttendee );
68 public slots:
69  virtual void contentsDragEnterEvent( TQDragEnterEvent *e );
70  virtual void dragEnterEvent( TQDragEnterEvent *e );
71  virtual void contentsDropEvent( TQDropEvent *e );
72  virtual void dropEvent( TQDropEvent *e );
73  virtual void contentsDragMoveEvent(TQDragMoveEvent *e);
74 signals:
75  void dropped(Attendee*);
76 };
77 
78 
79 class KOEditorDetails : public KOAttendeeEditor
80 {
81  TQ_OBJECT
82 
83  public:
84  KOEditorDetails (int spacing = 8,TQWidget* parent = 0, const char* name = 0);
85  virtual ~KOEditorDetails();
86 
88  void setDefaults();
90  void readEvent(Incidence *);
92  void writeEvent(Incidence *);
93 
95  bool validateInput();
96 
98  bool hasAttendees();
99 
100  void insertAttendee( Attendee *a, bool goodEmailAddress = true );
101  void removeAttendee( Attendee *a );
102 
103  protected slots:
104  void removeAttendee();
105  void slotInsertAttendee( Attendee *a );
106 
107  protected:
108  void setSelected ( int index );
109  int selectedIndex();
110  void changeStatusForMe( Attendee::PartStat status );
111 
112  KCal::Attendee* currentAttendee() const;
113  /* reimpl */
114  TQListViewItem* hasExampleAttendee() const;
115  void updateCurrentItem();
116 
117  private:
118  bool mDisableItemUpdate;
119 
120  TDEListView *mListView;
121 // KOEditorFreeBusy *mFreeBusy;
122 };
123 
124 #endif
Common base class for attendee editor and free busy view.
KOAttendeeListView is a child class of TDEListView which supports dropping of attendees (e....