00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
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;
00090 DateBookDBHoliday *db;
00091 ODateBookMonthTablePrivate *d;
00092 };
00093
00094 class ODateBookMonthPrivate;
00095 class ODateBookMonth : public QVBox
00096 {
00097 Q_OBJECT
00098
00099 public:
00100
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
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