Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

repeatentry.h

Go to the documentation of this file.
00001 /*
00002                              This file is part of the Opie Project
00003 
00004                              Copyright (C) Opie Team <opie-devel@handhelds.org>
00005               =.
00006             .=l.
00007            .>+-=
00008  _;:,     .>    :=|.         This program is free software; you can
00009 .> <`_,   >  .   <=          redistribute it and/or  modify it under
00010 :`=1 )Y*s>-.--   :           the terms of the GNU Library General Public
00011 .="- .-=="i,     .._         License as published by the Free Software
00012  - .   .-<_>     .<>         Foundation; either version 2 of the License,
00013      ._= =}       :          or (at your option) any later version.
00014     .%`+i>       _;_.
00015     .i_,=:_.      -<s.       This program is distributed in the hope that
00016      +  .  -:.       =       it will be useful,  but WITHOUT ANY WARRANTY;
00017     : ..    .:,     . . .    without even the implied warranty of
00018     =_        +     =;=|`    MERCHANTABILITY or FITNESS FOR A
00019   _.=:.       :    :=>`:     PARTICULAR PURPOSE. See the GNU
00020 ..}^=.=       =       ;      Library General Public License for more
00021 ++=   -.     .`     .:       details.
00022 :     =  ...= . :.=-
00023  -.   .:....=;==+<;          You should have received a copy of the GNU
00024   -_. . .   )=.  =           Library General Public License along with
00025     --        :-=`           this library; see the file COPYING.LIB.
00026                              If not, write to the Free Software Foundation,
00027                              Inc., 59 Temple Place - Suite 330,
00028                              Boston, MA 02111-1307, USA.
00029 */
00030 
00031 #ifndef REPEATENTRY_H
00032 #define REPEATENTRY_H
00033 
00034 #include "repeatentrybase.h"
00035 
00036 #include <qpe/event.h>
00037 
00038 #include <qcheckbox.h>
00039 #include <qbuttongroup.h>
00040 #include <qdatetime.h>
00041 #include <qlist.h>
00042 #include <qtoolbutton.h>
00043 
00044 class DateBookMonth;
00045 
00046 class RepeatEntry : public RepeatEntryBase
00047 {
00048     Q_OBJECT
00049 public:
00050     RepeatEntry( bool startOnMonday,
00051                  const QDate &start, QWidget *parent = 0, const char *name = 0,
00052                  bool modal = TRUE, WFlags fl = 0 );
00053     RepeatEntry( bool startOnMonday,
00054                  const Event::RepeatPattern &rp, const QDate &start,
00055                  QWidget *parent = 0, const char *name = 0, bool modal = TRUE,
00056                  WFlags fl = 0 );
00057     ~RepeatEntry();
00058 
00059     Event::RepeatPattern repeatPattern();
00060     QDate endDate() { return end; };
00061 
00062 public slots:
00063     void slotSetRType( int );
00064     void endDateChanged( int, int, int );
00065     void slotNoEnd( bool unused );
00066 
00067 private slots:
00068     void setupRepeatLabel( const QString& );
00069     void setupRepeatLabel( int );
00070     void slotWeekLabel();
00071     void slotMonthLabel( int );
00072     void slotChangeStartOfWeek( bool onMonday );
00073 
00074 private:
00075     void setupNone();
00076     void setupDaily();
00077     void setupWeekly();
00078     void setupMonthly();
00079     void setupYearly();
00080 
00081     enum repeatButtons { NONE, DAY, WEEK, MONTH, YEAR };
00082     void init();
00083     inline void hideExtras();
00084     void showRepeatStuff();
00085 
00086     QList<QToolButton> listRTypeButtons;
00087     QList<QToolButton> listExtra;
00088     QDate start;    // only used in one spot...
00089     QDate end;
00090     repeatButtons currInterval;
00091     bool startWeekOnMonday;
00092     DateBookMonth *repeatPicker;
00093 };
00094 
00095 inline void RepeatEntry::hideExtras()
00096 {
00097     // hide the extra buttons...
00098     fraExtra->hide();
00099     chkNoEnd->hide();
00100     QListIterator<QToolButton> it( listExtra );
00101     for ( ; *it; ++it ) {
00102         (*it)->hide();
00103         (*it)->setOn( FALSE );
00104     }
00105 
00106 }
00107 
00108 #endif

Generated on Sat Nov 5 16:15:49 2005 for OPIE by  doxygen 1.4.2