• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdepim
  • Sitemap
  • Contact Us
 

kalarm

recurrenceeditprivate.h

Go to the documentation of this file.
00001 /*
00002  *  recurrenceeditprivate.h  -  private classes for recurrenceedit.cpp
00003  *  Program:  kalarm
00004  *  Copyright © 2003,2005,2007 by David Jarvie <software@astrojar.org.uk>
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 along
00017  *  with this program; if not, write to the Free Software Foundation, Inc.,
00018  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019  */
00020 
00021 #ifndef RECURRENCEEDITPRIVATE_H
00022 #define RECURRENCEEDITPRIVATE_H
00023 
00024 #include <QList>
00025 #include <QFrame>
00026 #include <QBitArray>
00027 
00028 class QLabel;
00029 class QWidget;
00030 class QVBoxLayout;
00031 class ButtonGroup;
00032 class RadioButton;
00033 class ComboBox;
00034 class CheckBox;
00035 class SpinBox;
00036 class TimeSpinBox;
00037 class QString;
00038 
00039 
00040 class NoRule : public QFrame
00041 {
00042     public:
00043         explicit NoRule(QWidget* parent) : QFrame(parent) { }
00044         virtual int      frequency() const       { return 0; }
00045 };
00046 
00047 class Rule : public NoRule
00048 {
00049         Q_OBJECT
00050     public:
00051         Rule(const QString& freqText, const QString& freqWhatsThis, bool time, bool readOnly,
00052              QWidget* parent);
00053         int              frequency() const;
00054         void             setFrequency(int);
00055         virtual void     setFrequencyFocus()     { mSpinBox->setFocus(); }
00056         QVBoxLayout*     layout() const          { return mLayout; }
00057         virtual QWidget* validate(QString&)      { return 0; }
00058         virtual void     saveState();
00059         virtual bool     stateChanged() const;
00060     signals:
00061         void             frequencyChanged();
00062     private:
00063         QWidget*         mSpinBox;
00064         SpinBox*         mIntSpinBox;
00065         TimeSpinBox*     mTimeSpinBox;
00066         QVBoxLayout*     mLayout;
00067         // Saved state of all controls
00068         int              mSavedFrequency;    // frequency for the selected rule
00069 };
00070 
00071 // Subdaily rule choices
00072 class SubDailyRule : public Rule
00073 {
00074         Q_OBJECT
00075     public:
00076         SubDailyRule(bool readOnly, QWidget* parent);
00077 };
00078 
00079 // Daily/weekly rule choices base class
00080 class DayWeekRule : public Rule
00081 {
00082         Q_OBJECT
00083     public:
00084         DayWeekRule(const QString& freqText, const QString& freqWhatsThis, const QString& daysWhatsThis,
00085                     bool readOnly, QWidget* parent);
00086         QBitArray        days() const;
00087         void             setDays(bool);
00088         void             setDays(const QBitArray& days);
00089         void             setDay(int dayOfWeek);
00090         virtual QWidget* validate(QString& errorMessage);
00091         virtual void     saveState();
00092         virtual bool     stateChanged() const;
00093     private:
00094         CheckBox*        mDayBox[7];
00095         // Saved state of all controls
00096         QBitArray        mSavedDays;         // ticked days for weekly rule
00097 };
00098 
00099 // Daily rule choices
00100 class DailyRule : public DayWeekRule
00101 {
00102     public:
00103         DailyRule(bool readOnly, QWidget* parent);
00104 };
00105 
00106 // Weekly rule choices
00107 class WeeklyRule : public DayWeekRule
00108 {
00109     public:
00110         WeeklyRule(bool readOnly, QWidget* parent);
00111 };
00112 
00113 // Monthly/yearly rule choices base class
00114 class MonthYearRule : public Rule
00115 {
00116         Q_OBJECT
00117     public:
00118         enum DayPosType { DATE, POS };
00119 
00120         MonthYearRule(const QString& freqText, const QString& freqWhatsThis, bool allowEveryWeek,
00121                       bool readOnly, QWidget* parent);
00122         DayPosType       type() const;
00123         int              date() const;       // if date in month is selected
00124         int              week() const;       // if position is selected
00125         int              dayOfWeek() const;  // if position is selected
00126         void             setType(DayPosType);
00127         void             setDate(int dayOfMonth);
00128         void             setPosition(int week, int dayOfWeek);
00129         void             setDefaultValues(int dayOfMonth, int dayOfWeek);
00130         virtual void     saveState();
00131         virtual bool     stateChanged() const;
00132     signals:
00133         void             typeChanged(DayPosType);
00134     protected:
00135         DayPosType       buttonType(QAbstractButton* b) const  { return b == mDayButton ? DATE : POS; }
00136         virtual void     daySelected(int /*day*/)  { }
00137     protected slots:
00138         virtual void     clicked(QAbstractButton*);
00139     private slots:
00140         virtual void     slotDaySelected(int index);
00141     private:
00142         void             enableSelection(DayPosType);
00143 
00144         ButtonGroup*     mButtonGroup;
00145         RadioButton*     mDayButton;
00146         RadioButton*     mPosButton;
00147         ComboBox*        mDayCombo;
00148         ComboBox*        mWeekCombo;
00149         ComboBox*        mDayOfWeekCombo;
00150         bool             mEveryWeek;         // "Every" week is allowed
00151         // Saved state of all controls
00152         int              mSavedType;         // whether day-of-month or month position radio button was selected
00153         int              mSavedDay;          // chosen day of month selected item
00154         int              mSavedWeek;         // chosen month position: selected week item
00155         int              mSavedWeekDay;      // chosen month position: selected day of week
00156 };
00157 
00158 // Monthly rule choices
00159 class MonthlyRule : public MonthYearRule
00160 {
00161     public:
00162         MonthlyRule(bool readOnly, QWidget* parent);
00163 };
00164 
00165 // Yearly rule choices
00166 class YearlyRule : public MonthYearRule
00167 {
00168         Q_OBJECT
00169     public:
00170         YearlyRule(bool readOnly, QWidget* parent);
00171         QList<int>       months() const;
00172         void             setMonths(const QList<int>& months);
00173         void             setDefaultValues(int dayOfMonth, int dayOfWeek, int month);
00174         Preferences::Feb29Type feb29Type() const;
00175         void             setFeb29Type(Preferences::Feb29Type);
00176         virtual QWidget* validate(QString& errorMessage);
00177         virtual void     saveState();
00178         virtual bool     stateChanged() const;
00179     protected:
00180         virtual void     daySelected(int day);
00181     protected slots:
00182         virtual void     clicked(QAbstractButton*);
00183     private slots:
00184         void             enableFeb29();
00185     private:
00186         CheckBox*        mMonthBox[12];
00187         QLabel*          mFeb29Label;
00188         ComboBox*        mFeb29Combo;
00189         // Saved state of all controls
00190         QList<int>       mSavedMonths;       // ticked months for yearly rule
00191         int              mSavedFeb29Type;    // February 29th recurrence type
00192 };
00193 
00194 #endif // RECURRENCEEDITPRIVATE_H

kalarm

Skip menu "kalarm"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

kdepim

Skip menu "kdepim"
  • akonadi
  •   clients
  •   kabc
  •   kcal
  •   kcm
  • akregator
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt
  • kdgantt1
  • kjots
  • kleopatra
  • kmail
  • kmobiletools
  • knode
  • knotes
  • kontact
  • kontactinterfaces
  • korganizer
  •   korgac
  • kpilot
  • ktimetracker
  • libkdepim
  • libkholidays
  • libkleo
  • libkpgp
  • maildir
Generated for kdepim by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal