Diffstat (limited to 'core/pim/datebook/modules/monthview/odatebookmonth.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/datebook/modules/monthview/odatebookmonth.h | 132 |
1 files changed, 132 insertions, 0 deletions
diff --git a/core/pim/datebook/modules/monthview/odatebookmonth.h b/core/pim/datebook/modules/monthview/odatebookmonth.h new file mode 100644 index 0000000..e967abe --- a/dev/null +++ b/core/pim/datebook/modules/monthview/odatebookmonth.h | |||
@@ -0,0 +1,132 @@ | |||
1 | /* this is a straight copy of datemonthview. We can not make child of | ||
2 | * it 'cause the origin view isn't virtual in any form. | ||
3 | */ | ||
4 | /********************************************************************** | ||
5 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. | ||
6 | ** | ||
7 | ** This file is part of the Qtopia Environment. | ||
8 | ** | ||
9 | ** This file may be distributed and/or modified under the terms of the | ||
10 | ** GNU General Public License version 2 as published by the Free Software | ||
11 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
12 | ** packaging of this file. | ||
13 | ** | ||
14 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
15 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
16 | ** | ||
17 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
18 | ** | ||
19 | ** Contact info@trolltech.com if any conditions of this licensing are | ||
20 | ** not clear to you. | ||
21 | ** | ||
22 | **********************************************************************/ | ||
23 | #ifndef ODATEBOOKMONTH | ||
24 | #define ODATEBOOKMONTH | ||
25 | |||
26 | #include <qtopia/private/event.h> | ||
27 | #include <qpe/datebookmonth.h> | ||
28 | |||
29 | #include <qvbox.h> | ||
30 | #include <qhbox.h> | ||
31 | #include <qdatetime.h> | ||
32 | #include <qvaluelist.h> | ||
33 | #include <qtable.h> | ||
34 | #include <qpushbutton.h> | ||
35 | #include <qpopupmenu.h> | ||
36 | |||
37 | #include <qpe/calendar.h> | ||
38 | #include <qpe/timestring.h> | ||
39 | |||
40 | class QToolButton; | ||
41 | class QComboBox; | ||
42 | class QSpinBox; | ||
43 | class Event; | ||
44 | class DateBookDB; | ||
45 | class DateBookDBHoliday; | ||
46 | |||
47 | class ODateBookMonthTablePrivate; | ||
48 | class ODateBookMonthTable : public QTable | ||
49 | { | ||
50 | Q_OBJECT | ||
51 | |||
52 | public: | ||
53 | ODateBookMonthTable( QWidget *parent = 0, const char *name = 0, | ||
54 | DateBookDBHoliday *newDb = 0 ); | ||
55 | virtual ~ODateBookMonthTable(); | ||
56 | void setDate( int y, int m, int d ); | ||
57 | void redraw(); | ||
58 | |||
59 | QSize minimumSizeHint() const { return sizeHint(); } | ||
60 | QSize minimumSize() const { return sizeHint(); } | ||
61 | void getDate( int& y, int &m, int &d ) const {y=selYear;m=selMonth;d=selDay;} | ||
62 | void setWeekStart( bool onMonday ); | ||
63 | signals: | ||
64 | void dateClicked( int year, int month, int day ); | ||
65 | |||
66 | protected: | ||
67 | virtual void viewportMouseReleaseEvent( QMouseEvent * ); | ||
68 | |||
69 | protected slots: | ||
70 | |||
71 | virtual void keyPressEvent(QKeyEvent *e ) { | ||
72 | e->ignore(); | ||
73 | } | ||
74 | |||
75 | private slots: | ||
76 | void dayClicked( int row, int col ); | ||
77 | void dragDay( int row, int col ); | ||
78 | |||
79 | private: | ||
80 | void setupTable(); | ||
81 | void setupLabels(); | ||
82 | |||
83 | void findDay( int day, int &row, int &col ); | ||
84 | void getEvents(); | ||
85 | void changeDaySelection( int row, int col ); | ||
86 | |||
87 | int year, month, day; | ||
88 | int selYear, selMonth, selDay; | ||
89 | QValueList<Event> monthsEvents; // not used anymore... | ||
90 | DateBookDBHoliday *db; | ||
91 | ODateBookMonthTablePrivate *d; | ||
92 | }; | ||
93 | |||
94 | class ODateBookMonthPrivate; | ||
95 | class ODateBookMonth : public QVBox | ||
96 | { | ||
97 | Q_OBJECT | ||
98 | |||
99 | public: | ||
100 | /* ac = Auto Close */ | ||
101 | ODateBookMonth( QWidget *parent = 0, const char *name = 0, bool ac = FALSE, | ||
102 | DateBookDBHoliday *data = 0 ); | ||
103 | virtual ~ODateBookMonth(); | ||
104 | QDate selectedDate() const; | ||
105 | |||
106 | signals: | ||
107 | /* ### FIXME add a signal with QDate -zecke */ | ||
108 | void dateClicked( int year, int month, int day ); | ||
109 | |||
110 | public slots: | ||
111 | void setDate( int y, int m ); | ||
112 | void setDate( int y, int m, int d ); | ||
113 | void setDate( QDate ); | ||
114 | void redraw(); | ||
115 | void slotWeekChange( bool ); | ||
116 | |||
117 | protected slots: | ||
118 | virtual void keyPressEvent(QKeyEvent *e); | ||
119 | |||
120 | private slots: | ||
121 | void forwardDateClicked( int y, int m, int d ) { emit dateClicked( y, m, d ); } | ||
122 | void finalDate(int, int, int); | ||
123 | |||
124 | private: | ||
125 | DateBookMonthHeader *header; | ||
126 | ODateBookMonthTable *table; | ||
127 | int year, month, day; | ||
128 | bool autoClose; | ||
129 | class ODateBookMonthPrivate *d; | ||
130 | }; | ||
131 | |||
132 | #endif | ||