Diffstat (limited to 'core/pim/datebook/datebookday.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/datebook/datebookday.h | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/core/pim/datebook/datebookday.h b/core/pim/datebook/datebookday.h index be7cc45..db1cd04 100644 --- a/core/pim/datebook/datebookday.h +++ b/core/pim/datebook/datebookday.h | |||
@@ -37,13 +37,13 @@ class QResizeEvent; | |||
37 | class DateBookDayView : public QTable | 37 | class DateBookDayView : public QTable |
38 | { | 38 | { |
39 | Q_OBJECT | 39 | Q_OBJECT |
40 | public: | 40 | public: |
41 | DateBookDayView( bool hourClock, QWidget *parent, const char *name ); | 41 | DateBookDayView( bool hourClock, QWidget *parent, const char *name ); |
42 | bool whichClock() const; | 42 | bool whichClock() const; |
43 | 43 | ||
44 | void setRowStyle( int style ); | 44 | void setRowStyle( int style ); |
45 | 45 | ||
46 | public slots: | 46 | public slots: |
47 | void moveUp(); | 47 | void moveUp(); |
48 | void moveDown(); | 48 | void moveDown(); |
49 | 49 | ||
@@ -52,13 +52,13 @@ signals: | |||
52 | void sigCapturedKey( const QString &txt ); | 52 | void sigCapturedKey( const QString &txt ); |
53 | protected slots: | 53 | protected slots: |
54 | void slotChangeClock( bool ); | 54 | void slotChangeClock( bool ); |
55 | protected: | 55 | protected: |
56 | virtual void paintCell( QPainter *p, int row, int col, const QRect &cr, bool selected ); | 56 | virtual void paintCell( QPainter *p, int row, int col, const QRect &cr, bool selected ); |
57 | virtual void paintFocus( QPainter *p, const QRect &cr ); | 57 | virtual void paintFocus( QPainter *p, const QRect &cr ); |
58 | 58 | ||
59 | virtual void resizeEvent( QResizeEvent *e ); | 59 | virtual void resizeEvent( QResizeEvent *e ); |
60 | void keyPressEvent( QKeyEvent *e ); | 60 | void keyPressEvent( QKeyEvent *e ); |
61 | void initHeader(); | 61 | void initHeader(); |
62 | private: | 62 | private: |
63 | bool ampm; | 63 | bool ampm; |
64 | }; | 64 | }; |
@@ -73,23 +73,34 @@ public: | |||
73 | ~DateBookDayWidget(); | 73 | ~DateBookDayWidget(); |
74 | 74 | ||
75 | const QRect &geometry() { return geom; } | 75 | const QRect &geometry() { return geom; } |
76 | void setGeometry( const QRect &r ); | 76 | void setGeometry( const QRect &r ); |
77 | 77 | ||
78 | const EffectiveEvent &event() const { return ev; } | 78 | const EffectiveEvent &event() const { return ev; } |
79 | 79 | ||
80 | signals: | 80 | signals: |
81 | void deleteMe( const Event &e ); | 81 | void deleteMe( const Event &e ); |
82 | void editMe( const Event &e ); | 82 | void editMe( const Event &e ); |
83 | void beamMe( const Event &e ); | 83 | void beamMe( const Event &e ); |
84 | 84 | ||
85 | protected: | 85 | protected: |
86 | void paintEvent( QPaintEvent *e ); | 86 | void paintEvent( QPaintEvent *e ); |
87 | void mousePressEvent( QMouseEvent *e ); | 87 | void mousePressEvent( QMouseEvent *e ); |
88 | 88 | ||
89 | private: | 89 | private: |
90 | /** | ||
91 | * Sets the text for an all day Event | ||
92 | * All day events have no time associated | ||
93 | */ | ||
94 | void setAllDayText( QString& text ); | ||
95 | |||
96 | /** | ||
97 | * Sets the EventText | ||
98 | * it got a start and an end Time | ||
99 | */ | ||
100 | void setEventText( QString& text ); | ||
90 | const EffectiveEvent ev; | 101 | const EffectiveEvent ev; |
91 | DateBookDay *dateBook; | 102 | DateBookDay *dateBook; |
92 | QString text; | 103 | QString text; |
93 | QRect geom; | 104 | QRect geom; |
94 | }; | 105 | }; |
95 | 106 | ||
@@ -103,40 +114,40 @@ public: | |||
103 | ~DateBookDayTimeMarker(); | 114 | ~DateBookDayTimeMarker(); |
104 | 115 | ||
105 | const QRect &geometry() { return geom; } | 116 | const QRect &geometry() { return geom; } |
106 | void setGeometry( const QRect &r ); | 117 | void setGeometry( const QRect &r ); |
107 | void setTime( const QTime &t ); | 118 | void setTime( const QTime &t ); |
108 | 119 | ||
109 | signals: | 120 | signals: |
110 | 121 | ||
111 | protected: | 122 | protected: |
112 | void paintEvent( QPaintEvent *e ); | 123 | void paintEvent( QPaintEvent *e ); |
113 | 124 | ||
114 | private: | 125 | private: |
115 | QRect geom; | 126 | QRect geom; |
116 | QTime time; | 127 | QTime time; |
117 | DateBookDay *dateBook; | 128 | DateBookDay *dateBook; |
118 | }; | 129 | }; |
119 | 130 | ||
120 | //reimplemented the compareItems function so that it sorts DayWidgets by geometry heights | 131 | //reimplemented the compareItems function so that it sorts DayWidgets by geometry heights |
121 | class WidgetListClass : public QList<DateBookDayWidget> | 132 | class WidgetListClass : public QList<DateBookDayWidget> |
122 | { | 133 | { |
123 | private: | 134 | private: |
124 | 135 | ||
125 | int compareItems( QCollection::Item s1, QCollection::Item s2 ) | 136 | int compareItems( QCollection::Item s1, QCollection::Item s2 ) |
126 | { | 137 | { |
127 | //hmm, don't punish me for that ;) | 138 | //hmm, don't punish me for that ;) |
128 | if (reinterpret_cast<DateBookDayWidget*>(s1)->geometry().height() > reinterpret_cast<DateBookDayWidget*>(s2)->geometry().height()) | 139 | if (reinterpret_cast<DateBookDayWidget*>(s1)->geometry().height() > reinterpret_cast<DateBookDayWidget*>(s2)->geometry().height()) |
129 | { | 140 | { |
130 | return -1; | 141 | return -1; |
131 | } else | 142 | } else |
132 | { | 143 | { |
133 | return 1; | 144 | return 1; |
134 | } | 145 | } |
135 | } | 146 | } |
136 | 147 | ||
137 | 148 | ||
138 | }; | 149 | }; |
139 | 150 | ||
140 | class DateBookDay : public QVBox | 151 | class DateBookDay : public QVBox |
141 | { | 152 | { |
142 | Q_OBJECT | 153 | Q_OBJECT |