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

odatebookmonth.h

Go to the documentation of this file.
00001 /* this is a straight copy of datemonthview. We can not make child of
00002  * it 'cause the origin view isn't virtual in any form.
00003  */
00004 /**********************************************************************
00005 ** Copyright (C) 2000-2002 Trolltech AS.  All rights reserved.
00006 **
00007 ** This file is part of the Qtopia Environment.
00008 **
00009 ** This file may be distributed and/or modified under the terms of the
00010 ** GNU General Public License version 2 as published by the Free Software
00011 ** Foundation and appearing in the file LICENSE.GPL included in the
00012 ** packaging of this file.
00013 **
00014 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00015 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00016 **
00017 ** See http://www.trolltech.com/gpl/ for GPL licensing information.
00018 **
00019 ** Contact info@trolltech.com if any conditions of this licensing are
00020 ** not clear to you.
00021 **
00022 **********************************************************************/
00023 #ifndef ODATEBOOKMONTH
00024 #define ODATEBOOKMONTH
00025 
00026 #include <qtopia/private/event.h>
00027 #include <qpe/datebookmonth.h>
00028 
00029 #include <qvbox.h>
00030 #include <qhbox.h>
00031 #include <qdatetime.h>
00032 #include <qvaluelist.h>
00033 #include <qtable.h>
00034 #include <qpushbutton.h>
00035 #include <qpopupmenu.h>
00036 
00037 #include <qpe/calendar.h>
00038 #include <qpe/timestring.h>
00039 
00040 class QToolButton;
00041 class QComboBox;
00042 class QSpinBox;
00043 class Event;
00044 class DateBookDB;
00045 class DateBookDBHoliday;
00046 
00047 class ODateBookMonthTablePrivate;
00048 class ODateBookMonthTable : public QTable
00049 {
00050     Q_OBJECT
00051 
00052 public:
00053     ODateBookMonthTable( QWidget *parent = 0, const char *name = 0,
00054                         DateBookDBHoliday *newDb = 0 );
00055     virtual ~ODateBookMonthTable();
00056     void setDate( int y, int m, int d );
00057     void redraw();
00058 
00059     QSize minimumSizeHint() const { return sizeHint(); }
00060     QSize minimumSize() const { return sizeHint(); }
00061     void  getDate( int& y, int &m, int &d ) const {y=selYear;m=selMonth;d=selDay;}
00062     void setWeekStart( bool onMonday );
00063 signals:
00064     void dateClicked( int year, int month, int day );
00065 
00066 protected:
00067     virtual void viewportMouseReleaseEvent( QMouseEvent * );
00068 
00069 protected slots:
00070 
00071     virtual void keyPressEvent(QKeyEvent *e ) {
00072     e->ignore();
00073     }
00074 
00075 private slots:
00076     void dayClicked( int row, int col );
00077     void dragDay( int row, int col );
00078 
00079 private:
00080     void setupTable();
00081     void setupLabels();
00082 
00083     void findDay( int day, int &row, int &col );
00084     void getEvents();
00085     void changeDaySelection( int row, int col );
00086 
00087     int year, month, day;
00088     int selYear, selMonth, selDay;
00089     QValueList<Event> monthsEvents; // not used anymore...
00090     DateBookDBHoliday *db;
00091     ODateBookMonthTablePrivate *d;
00092 };
00093 
00094 class ODateBookMonthPrivate;
00095 class ODateBookMonth : public QVBox
00096 {
00097     Q_OBJECT
00098 
00099 public:
00100     /* ac = Auto Close */
00101     ODateBookMonth( QWidget *parent = 0, const char *name = 0, bool ac = FALSE,
00102                    DateBookDBHoliday *data = 0 );
00103     virtual ~ODateBookMonth();
00104     QDate  selectedDate() const;
00105 
00106 signals:
00107     /* ### FIXME add a signal with QDate -zecke */
00108     void dateClicked( int year, int month, int day );
00109 
00110 public slots:
00111     void setDate( int y, int m );
00112     void setDate( int y, int m, int d );
00113     void setDate( QDate );
00114     void redraw();
00115     void slotWeekChange( bool );
00116 
00117 protected slots:
00118     virtual void keyPressEvent(QKeyEvent *e);
00119 
00120 private slots:
00121     void forwardDateClicked( int y, int m, int d ) { emit dateClicked(  y, m, d  ); }
00122     void finalDate(int, int, int);
00123 
00124 private:
00125     DateBookMonthHeader *header;
00126     ODateBookMonthTable *table;
00127     int year, month, day;
00128     bool autoClose;
00129     class ODateBookMonthPrivate *d;
00130 };
00131 
00132 #endif

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