summaryrefslogtreecommitdiff
path: root/core/pim/datebook/datebookday.h
Unidiff
Diffstat (limited to 'core/pim/datebook/datebookday.h') (more/less context) (show whitespace changes)
-rw-r--r--core/pim/datebook/datebookday.h52
1 files changed, 51 insertions, 1 deletions
diff --git a/core/pim/datebook/datebookday.h b/core/pim/datebook/datebookday.h
index 531fded..db0f3b6 100644
--- a/core/pim/datebook/datebookday.h
+++ b/core/pim/datebook/datebookday.h
@@ -55,2 +55,3 @@ protected:
55 virtual void paintFocus( QPainter *p, const QRect &cr ); 55 virtual void paintFocus( QPainter *p, const QRect &cr );
56
56 virtual void resizeEvent( QResizeEvent *e ); 57 virtual void resizeEvent( QResizeEvent *e );
@@ -92,2 +93,46 @@ private:
92 93
94//Marker for current time in the dayview
95class DateBookDayTimeMarker : public QWidget
96{
97 Q_OBJECT
98
99public:
100 DateBookDayTimeMarker( DateBookDay *db );
101 ~DateBookDayTimeMarker();
102
103 const QRect &geometry() { return geom; }
104 void setGeometry( const QRect &r );
105 void setTime( const QTime &t );
106
107signals:
108
109protected:
110 void paintEvent( QPaintEvent *e );
111
112private:
113 QRect geom;
114 QTime time;
115 DateBookDay *dateBook;
116};
117
118//reimplemented the compareItems function so that it sorts DayWidgets by geometry heights
119class WidgetListClass : public QList<DateBookDayWidget>
120 {
121 private:
122
123 int compareItems( QCollection::Item s1, QCollection::Item s2 )
124 {
125 //hmm, don't punish me for that ;)
126 if (reinterpret_cast<DateBookDayWidget*>(s1)->geometry().height() > reinterpret_cast<DateBookDayWidget*>(s2)->geometry().height())
127 {
128 return -1;
129 } else
130 {
131 return 1;
132 }
133 }
134
135
136};
137
93class DateBookDay : public QVBox 138class DateBookDay : public QVBox
@@ -104,2 +149,4 @@ public:
104 int startViewTime() const; 149 int startViewTime() const;
150 void setSelectedWidget( DateBookDayWidget * );
151 DateBookDayWidget * getSelectedWidget( void );
105 152
@@ -110,2 +157,3 @@ public slots:
110 void slotWeekChanged( bool bStartOnMonday ); 157 void slotWeekChanged( bool bStartOnMonday );
158 void updateView();//updates TimeMarker and DayWidget-colors
111 159
@@ -133,4 +181,6 @@ private:
133 DateBookDB *db; 181 DateBookDB *db;
134 QList<DateBookDayWidget> widgetList; 182 WidgetListClass widgetList;//reimplemented QList for sorting widgets by height
135 int startTime; 183 int startTime;
184 DateBookDayWidget *selectedWidget; //actual selected widget (obviously)
185 DateBookDayTimeMarker *timeMarker;//marker for current time
136}; 186};