korganizer

koeditorgeneralevent.h
1 /*
2  This file is part of KOrganizer.
3  Copyright (c) 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 _KOEDITORGENERALEVENT_H
25 #define _KOEDITORGENERALEVENT_H
26 
27 #include "koeditorgeneral.h"
28 #include <tqdatetime.h>
29 
30 class TQLabel;
31 class KDateEdit;
32 class KTimeEdit;
33 class TQCheckBox;
34 class TQComboBox;
35 class TQBoxLayout;
36 
37 namespace KCal {
38 class Event;
39 }
40 using namespace KCal;
41 
42 class KOEditorGeneralEvent : public KOEditorGeneral
43 {
44  TQ_OBJECT
45 
46  public:
47  KOEditorGeneralEvent (TQObject* parent=0,const char* name=0);
48  virtual ~KOEditorGeneralEvent();
49 
50  void initTime(TQWidget *,TQBoxLayout *);
51  void initClass(TQWidget *,TQBoxLayout *);
52  void initInvitationBar( TQWidget* parent, TQBoxLayout *layout );
53 
54  void finishSetup();
55 
57  void setDefaults( const TQDateTime &from, const TQDateTime &to, bool allDay );
62  void readEvent( Event *event, Calendar *calendar, const TQDate &date, bool tmpl = false );
64  void writeEvent( Event * );
65 
67  bool validateInput();
68 
69  void updateRecurrenceSummary( Event *event );
70 
71  TQFrame* invitationBar() const { return mInvitationBar; }
72 
73  public slots:
74  void setDateTimes( const TQDateTime &start, const TQDateTime &end );
75  void setDuration();
76 
77  protected slots:
78  void timeStuffDisable( bool disable );
79  void associateTime( bool time );
80 
81  void startTimeChanged( TQTime );
82  void startDateChanged( const TQDate& );
83  void endTimeChanged( TQTime );
84  void endDateChanged( const TQDate& );
85 
86  void emitDateTimeStr();
87 
88  signals:
89  void allDayChanged(bool);
90  void dateTimeStrChanged( const TQString & );
91  void dateTimesChanged( const TQDateTime &start, const TQDateTime &end );
92  void editRecurrence();
93  void acceptInvitation();
94  void declineInvitation();
95 
96  private:
97  TQLabel *mStartDateLabel;
98  TQLabel *mEndDateLabel;
99  KDateEdit *mStartDateEdit;
100  KDateEdit *mEndDateEdit;
101  KTimeEdit *mStartTimeEdit;
102  KTimeEdit *mEndTimeEdit;
103  TQLabel *mDurationLabel;
104  TQCheckBox *mAlldayEventCheckbox;
105  TQComboBox *mFreeTimeCombo;
106  TQFrame *mInvitationBar;
107 
108  // current start and end date and time
109  TQDateTime mCurrStartDateTime;
110  TQDateTime mCurrEndDateTime;
111 };
112 
113 #endif