korganizer Library API Documentation

koeditorrecurrence.h

00001 /*
00002     This file is part of KOrganizer.
00003     Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
00004 
00005     This program is free software; you can redistribute it and/or modify
00006     it under the terms of the GNU General Public License as published by
00007     the Free Software Foundation; either version 2 of the License, or
00008     (at your option) any later version.
00009 
00010     This program is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00013     GNU General Public License for more details.
00014 
00015     You should have received a copy of the GNU General Public License
00016     along with this program; if not, write to the Free Software
00017     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00018 
00019     As a special exception, permission is given to link this program
00020     with any edition of Qt, and distribute the resulting executable,
00021     without including the source code for Qt in the source distribution.
00022 */
00023 #ifndef _KOEDITORRECURRENCE_H
00024 #define _KOEDITORRECURRENCE_H
00025 
00026 #include <qframe.h>
00027 #include <qlabel.h>
00028 #include <qcheckbox.h>
00029 #include <qpushbutton.h>
00030 #include <qgroupbox.h>
00031 #include <qlineedit.h>
00032 #include <qcombobox.h>
00033 #include <qmultilineedit.h>
00034 #include <qlistview.h>
00035 #include <qradiobutton.h>
00036 
00037 #include <libkcal/event.h>
00038 
00039 #include "ktimeedit.h"
00040 
00041 class QWidgetStack;
00042 
00043 class KDateEdit;
00044 
00045 using namespace KCal;
00046 
00047 class KOEditorRecurrence : public QWidget
00048 {
00049     Q_OBJECT
00050   public:
00051     KOEditorRecurrence (int spacing=8,QWidget* parent=0,const char* name=0);
00052     virtual ~KOEditorRecurrence();
00053 
00055     void setDefaults(QDateTime from,QDateTime to,bool allday);
00057     void readEvent(Event *);
00059     void writeEvent(Event *);
00060 
00062     bool validateInput();
00063 
00064   public slots:
00065     virtual void setEnabled(bool);
00066     void setDateTimes(QDateTime start,QDateTime end);
00067     void setDateTimeStr(const QString &);
00068   
00069   signals:
00070     void dateTimesChanged(QDateTime start,QDateTime end);
00071   
00072   protected slots:
00073     void showDaily(bool);
00074     void showWeekly(bool);
00075     void showMonthly(bool);
00076     void showYearly(bool);
00077     void disableRange(bool);
00078     void enableDurationRange(bool);
00079     void enableDateRange(bool);
00080     void addException();
00081     void changeException();
00082     void deleteException();
00083   
00084   protected:
00085     void unsetAllCheckboxes();
00086     void checkDay(int day);
00087     void getCheckedDays(QBitArray &rDays);
00088     void setCheckedDays(QBitArray &rDays);
00089   
00090     void initMain();
00091     void initDaily();
00092     void initWeekly();
00093     void initMonthly();
00094     void initYearly();
00095     void initExceptions();
00096   
00097     void initLayout();
00098 
00099   private:
00100 //    QDate *dateFromText(QString text);
00101     
00102     /* stuff to hold the appointment time setting widgets. */
00103     QGroupBox* timeGroupBox;
00104     QLabel *dateTimeLabel;
00105   
00106     /* main rule box and choices. */
00107     QGroupBox*    ruleGroupBox;
00108     QFrame*       ruleFrame;
00109     QWidgetStack* ruleStack;
00110     QButtonGroup* ruleButtonGroup;
00111     QRadioButton* dailyButton;
00112     QRadioButton* weeklyButton;
00113     QRadioButton* monthlyButton;
00114     QRadioButton* yearlyButton;
00115     
00116     QFrame* ruleSepFrame;
00117     
00118     /* daily rule choices */
00119     QFrame*       dailyFrame;
00120     QLabel*       everyNDays;
00121     QLineEdit*    nDaysEntry;
00122     QLabel*       nDaysLabel;
00123   
00124     /* weekly rule choices */
00125     QFrame*       weeklyFrame;
00126     QLabel*       everyNWeeks;
00127     QLineEdit*    nWeeksEntry;
00128     QLabel*       nWeeksLabel;
00129     QCheckBox*    sundayBox;
00130     QCheckBox*    mondayBox;
00131     QCheckBox*    tuesdayBox;
00132     QCheckBox*    wednesdayBox;
00133     QCheckBox*    thursdayBox;
00134     QCheckBox*    fridayBox;
00135     QCheckBox*    saturdayBox;
00136   
00137     /* monthly rule choices */
00138     QFrame*       monthlyFrame;
00139     QButtonGroup* monthlyButtonGroup;
00140     QRadioButton* onNthDay;
00141     QComboBox*    nthDayEntry;
00142     QLabel*       nthDayLabel;
00143     QRadioButton* onNthTypeOfDay;
00144     QComboBox*    nthNumberEntry;
00145     QComboBox*    nthTypeOfDayEntry;
00146     QLabel*       monthCommonLabel;
00147     QLineEdit*    nMonthsEntry;
00148     QLabel*       nMonthsLabel;
00149     
00150     /* yearly rule choices */
00151     QFrame*       yearlyFrame;
00152     QLabel       *yearCommonLabel;
00153     QButtonGroup *yearlyButtonGroup;
00154     QRadioButton *yearMonthButton;
00155     QRadioButton *yearDayButton;
00156     QComboBox    *yearMonthComboBox;
00157     QLineEdit    *yearDayLineEdit;
00158     QLineEdit    *nYearsEntry;
00159     QLabel       *yearsLabel;
00160 
00161     /* advanced rule choices */
00162     QCheckBox* advancedRuleButton;
00163     QLineEdit* advancedRuleEdit;
00164   
00165     /* range stuff */
00166     QGroupBox*    rangeGroupBox;
00167     QButtonGroup* rangeButtonGroup;
00168     QLabel*       startDateLabel;
00169 //    KDateEdit*    startDateEdit;
00170     QRadioButton* noEndDateButton;
00171     QRadioButton* endDurationButton;
00172     QLineEdit*    endDurationEdit;
00173     QLabel*       endDurationLabel;
00174     QRadioButton* endDateButton;
00175     KDateEdit*    endDateEdit;
00176   
00177     /* exception stuff */
00178     QGroupBox* exceptionGroupBox;
00179     KDateEdit *exceptionDateEdit;
00180     QPushButton* addExceptionButton;
00181     QPushButton* changeExceptionButton;
00182     QPushButton* deleteExceptionButton;
00183     QPushButton* exceptionDateButton;
00184     QListBox *exceptionList;
00185     DateList mExceptionDates;
00186 
00187     // current start and end date and time
00188     QDateTime currStartDateTime;
00189     QDateTime currEndDateTime;
00190 
00191     bool mEnabled;
00192 
00193     int mSpacing;
00194 };
00195 
00196 #endif
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.4.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Sat Oct 18 02:47:31 2003 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001