korganizer

koeditorgeneralevent.h

00001 /*
00002     This file is part of KOrganizer.
00003     Copyright (c) 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 _KOEDITORGENERALEVENT_H
00025 #define _KOEDITORGENERALEVENT_H
00026 
00027 #include "koeditorgeneral.h"
00028 #include <qdatetime.h>
00029 
00030 class QLabel;
00031 class KDateEdit;
00032 class KTimeEdit;
00033 class QCheckBox;
00034 class QComboBox;
00035 class QBoxLayout;
00036 
00037 namespace KCal {
00038 class Event;
00039 }
00040 using namespace KCal;
00041 
00042 class KOEditorGeneralEvent : public KOEditorGeneral
00043 {
00044     Q_OBJECT
00045   public:
00046     KOEditorGeneralEvent (QObject* parent=0,const char* name=0);
00047     virtual ~KOEditorGeneralEvent();
00048 
00049     void initTime(QWidget *,QBoxLayout *);
00050     void initClass(QWidget *,QBoxLayout *);
00051     void initInvitationBar( QWidget* parent, QBoxLayout *layout );
00052 
00053     void finishSetup();
00054 
00056     void setDefaults( const QDateTime &from, const QDateTime &to, bool allDay );
00061     void readEvent( Event *event, Calendar *calendar, bool tmpl = false );
00063     void writeEvent( Event * );
00064 
00066     bool validateInput();
00067 
00068     void updateRecurrenceSummary( const QString &summary );
00069 
00070     QFrame* invitationBar() const { return mInvitationBar; }
00071 
00072   public slots:
00073     void setDateTimes( const QDateTime &start, const QDateTime &end );
00074     void setDuration();
00075 
00076   protected slots:
00077     void timeStuffDisable( bool disable );
00078     void associateTime( bool time );
00079 
00080     void startTimeChanged( QTime );
00081     void startDateChanged( const QDate& );
00082     void endTimeChanged( QTime );
00083     void endDateChanged( const QDate& );
00084 
00085     void emitDateTimeStr();
00086 
00087   signals:
00088     void allDayChanged(bool);
00089     void dateTimeStrChanged( const QString & );
00090     void dateTimesChanged( const QDateTime &start, const QDateTime &end );
00091     void editRecurrence();
00092     void acceptInvitation();
00093     void declineInvitation();
00094 
00095   private:
00096     QLabel                  *mStartDateLabel;
00097     QLabel                  *mEndDateLabel;
00098     KDateEdit               *mStartDateEdit;
00099     KDateEdit               *mEndDateEdit;
00100     KTimeEdit               *mStartTimeEdit;
00101     KTimeEdit               *mEndTimeEdit;
00102     QLabel                  *mDurationLabel;
00103     QCheckBox               *mAlldayEventCheckbox;
00104     QComboBox               *mFreeTimeCombo;
00105     QLabel                  *mRecurrenceSummary;
00106     QFrame                  *mInvitationBar;
00107 
00108     // current start and end date and time
00109     QDateTime mCurrStartDateTime;
00110     QDateTime mCurrEndDateTime;
00111 };
00112 
00113 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys