summaryrefslogtreecommitdiffabout
path: root/korganizer/koagenda.h
Unidiff
Diffstat (limited to 'korganizer/koagenda.h') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagenda.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/korganizer/koagenda.h b/korganizer/koagenda.h
index 111242f..12943d7 100644
--- a/korganizer/koagenda.h
+++ b/korganizer/koagenda.h
@@ -105,129 +105,132 @@ class KOAgenda : public QScrollView
105 105
106 void clear(); 106 void clear();
107 107
108 void clearSelection(); 108 void clearSelection();
109 void hideUnused(); 109 void hideUnused();
110 110
111 /** Calculates the minimum width */ 111 /** Calculates the minimum width */
112 virtual int minimumWidth() const; 112 virtual int minimumWidth() const;
113 /** Update configuration from preference settings */ 113 /** Update configuration from preference settings */
114 void updateConfig(); 114 void updateConfig();
115 115
116 void checkScrollBoundaries(); 116 void checkScrollBoundaries();
117 117
118 void setHolidayMask(QMemArray<bool> *); 118 void setHolidayMask(QMemArray<bool> *);
119 void setDateList(const DateList &selectedDates); 119 void setDateList(const DateList &selectedDates);
120 DateList dateList() const; 120 DateList dateList() const;
121 void drawContentsToPainter( QPainter* paint = 0, bool backgroundOnly = false); 121 void drawContentsToPainter( QPainter* paint = 0, bool backgroundOnly = false);
122 void finishUpdate(); 122 void finishUpdate();
123 void printSelection(); 123 void printSelection();
124 void storePosition(); 124 void storePosition();
125 void restorePosition(); 125 void restorePosition();
126 126
127 127
128 public slots: 128 public slots:
129 void newItem( int );
129 void moveChild( QWidget *, int, int ); 130 void moveChild( QWidget *, int, int );
130 void scrollUp(); 131 void scrollUp();
131 void scrollDown(); 132 void scrollDown();
132 void updateTodo( Todo * t, int , bool ); 133 void updateTodo( Todo * t, int , bool );
133 void popupAlarm(); 134 void popupAlarm();
134 135
135 void checkScrollBoundaries(int); 136 void checkScrollBoundaries(int);
136 137
137 /** Deselect selected items. This function does not emit any signals. */ 138 /** Deselect selected items. This function does not emit any signals. */
138 void deselectItem(); 139 void deselectItem();
139 /** Select item. If the argument is 0, the currently selected item gets 140 /** Select item. If the argument is 0, the currently selected item gets
140 deselected. This function emits the itemSelected(bool) signal to inform 141 deselected. This function emits the itemSelected(bool) signal to inform
141 about selection/deseelction of events. */ 142 about selection/deseelction of events. */
142 void selectItem(KOAgendaItem *); 143 void selectItem(KOAgendaItem *);
143 void finishResize(); 144 void finishResize();
144 145
145 signals: 146 signals:
146 void newEventSignal(); 147 void newEventSignal();
147 void newEventSignal(int gx,int gy); 148 void newEventSignal(int gx,int gy);
149 void newTodoSignal(int gx,int gy);
148 void newEventSignal(int gxStart, int gyStart, int gxEnd, int gyEnd); 150 void newEventSignal(int gxStart, int gyStart, int gxEnd, int gyEnd);
149 void newTimeSpanSignal(int gxStart, int gyStart, int gxEnd, int gyEnd); 151 void newTimeSpanSignal(int gxStart, int gyStart, int gxEnd, int gyEnd);
150 void newStartSelectSignal(); 152 void newStartSelectSignal();
151 void showIncidenceSignal(Incidence *); 153 void showIncidenceSignal(Incidence *);
152 void editIncidenceSignal(Incidence *); 154 void editIncidenceSignal(Incidence *);
153 void deleteIncidenceSignal(Incidence *); 155 void deleteIncidenceSignal(Incidence *);
154 void showIncidencePopupSignal(Incidence *); 156 void showIncidencePopupSignal(Incidence *);
155 157
156 void itemModified(KOAgendaItem *item, int ); 158 void itemModified(KOAgendaItem *item, int );
157 void incidenceSelected(Incidence *); 159 void incidenceSelected(Incidence *);
158 160
159 void lowerYChanged(int); 161 void lowerYChanged(int);
160 void upperYChanged(int); 162 void upperYChanged(int);
161 163
162 void startDragSignal(Incidence *); 164 void startDragSignal(Incidence *);
163 void addToCalSignal(Incidence *, Incidence *); 165 void addToCalSignal(Incidence *, Incidence *);
164 void resizedSignal(); 166 void resizedSignal();
165 167
166 protected: 168 protected:
167 QPainter mPixPainter; 169 QPainter mPixPainter;
168 QPixmap mPaintPixmap; 170 QPixmap mPaintPixmap;
169 QPixmap mHighlightPixmap; 171 QPixmap mHighlightPixmap;
170 void drawContents(QPainter *p,int cx, int cy, int cw, int ch); 172 void drawContents(QPainter *p,int cx, int cy, int cw, int ch);
171 virtual void resizeEvent ( QResizeEvent * ); 173 virtual void resizeEvent ( QResizeEvent * );
172 174
173 /** Handles mouse events. Called from eventFilter */ 175 /** Handles mouse events. Called from eventFilter */
174 virtual bool eventFilter_mouse ( QObject *, QMouseEvent * ); 176 virtual bool eventFilter_mouse ( QObject *, QMouseEvent * );
175 177
176 /** Start selecting time span. */ 178 /** Start selecting time span. */
177 void startSelectAction(QPoint viewportPos); 179 void startSelectAction(QPoint viewportPos);
178 180
179 /** Select time span. */ 181 /** Select time span. */
180 void performSelectAction(QPoint viewportPos); 182 void performSelectAction(QPoint viewportPos);
181 183
182 /** Emd selecting time span. */ 184 /** Emd selecting time span. */
183 void endSelectAction(); 185 void endSelectAction( bool emitNewEvent = false );
184 186
185 /** Start moving/resizing agenda item */ 187 /** Start moving/resizing agenda item */
186 void startItemAction(QPoint viewportPos); 188 void startItemAction(QPoint viewportPos);
187 189
188 /** Move/resize agenda item */ 190 /** Move/resize agenda item */
189 void performItemAction(QPoint viewportPos); 191 void performItemAction(QPoint viewportPos);
190 192
191 /** End moving/resizing agenda item */ 193 /** End moving/resizing agenda item */
192 void endItemAction(); 194 void endItemAction();
193 195
194 /** Set cursor, when no item action is in progress */ 196 /** Set cursor, when no item action is in progress */
195 void setNoActionCursor(KOAgendaItem *moveItem,QPoint viewportPos); 197 void setNoActionCursor(KOAgendaItem *moveItem,QPoint viewportPos);
196 198
197 /** Place agenda item in agenda and adjust other cells if necessary */ 199 /** Place agenda item in agenda and adjust other cells if necessary */
198 void placeSubCells(KOAgendaItem *placeItem); 200 void placeSubCells(KOAgendaItem *placeItem);
199 201
200 /** Process the keyevent, including the ignored keyevents of eventwidgets. 202 /** Process the keyevent, including the ignored keyevents of eventwidgets.
201 * Implements pgup/pgdn and cursor key navigation in the view. 203 * Implements pgup/pgdn and cursor key navigation in the view.
202 */ 204 */
203 void keyPressEvent( QKeyEvent * ); 205 void keyPressEvent( QKeyEvent * );
204 206
205 void calculateWorkingHours(); 207 void calculateWorkingHours();
206 208
207 virtual void contentsMousePressEvent ( QMouseEvent * ); 209 virtual void contentsMousePressEvent ( QMouseEvent * );
208 210
209 private: 211 private:
212 bool blockNewEvent;
210 void init(); 213 void init();
211 void marcus_bains(); 214 void marcus_bains();
212 bool mAllDayMode; 215 bool mAllDayMode;
213 bool blockResize; 216 bool blockResize;
214 QTimer mResizeTimer; 217 QTimer mResizeTimer;
215 double mContentPosition; 218 double mContentPosition;
216 219
217 // Width and height of agenda cells 220 // Width and height of agenda cells
218 int mGridSpacingX; 221 int mGridSpacingX;
219 int mGridSpacingY; 222 int mGridSpacingY;
220 223
221 // size of border, where mouse action will resize the KOAgendaItem 224 // size of border, where mouse action will resize the KOAgendaItem
222 int mResizeBorderWidth; 225 int mResizeBorderWidth;
223 226
224 // size of border, where mouse mve will cause a scroll of the agenda 227 // size of border, where mouse mve will cause a scroll of the agenda
225 int mScrollBorderWidth; 228 int mScrollBorderWidth;
226 int mScrollDelay; 229 int mScrollDelay;
227 int mScrollOffset; 230 int mScrollOffset;
228 231
229 QTimer mScrollUpTimer; 232 QTimer mScrollUpTimer;
230 QTimer mScrollDownTimer; 233 QTimer mScrollDownTimer;
231 234
232 // Number of Columns/Rows of agenda grid 235 // Number of Columns/Rows of agenda grid
233 int mColumns; 236 int mColumns;
@@ -253,34 +256,35 @@ class KOAgenda : public QScrollView
253 DateList mSelectedDates; 256 DateList mSelectedDates;
254 257
255 // The KOAgendaItem, which has been right-clicked last 258 // The KOAgendaItem, which has been right-clicked last
256 KOAgendaItem *mClickedItem; 259 KOAgendaItem *mClickedItem;
257 260
258 // The KOAgendaItem, which is being moved/resized 261 // The KOAgendaItem, which is being moved/resized
259 QGuardedPtr<KOAgendaItem> mActionItem; 262 QGuardedPtr<KOAgendaItem> mActionItem;
260 263
261 // Currently selected item 264 // Currently selected item
262 QGuardedPtr<KOAgendaItem> mSelectedItem; 265 QGuardedPtr<KOAgendaItem> mSelectedItem;
263 266
264 // The Marcus Bains Line widget. 267 // The Marcus Bains Line widget.
265 MarcusBains *mMarcusBains; 268 MarcusBains *mMarcusBains;
266 void computeSizes(); 269 void computeSizes();
267 270
268 MouseActionType mActionType; 271 MouseActionType mActionType;
269 272
270 bool mItemMoved; 273 bool mItemMoved;
271 274
272 // List of all Items contained in agenda 275 // List of all Items contained in agenda
273 QPtrList<KOAgendaItem> mItems; 276 QPtrList<KOAgendaItem> mItems;
274 QPtrList<KOAgendaItem> mUnusedItems; 277 QPtrList<KOAgendaItem> mUnusedItems;
275 KOAgendaItem* getNewItem(Incidence * event,QDate qd, QWidget* viewport); 278 KOAgendaItem* getNewItem(Incidence * event,QDate qd, QWidget* viewport);
276 QPopupMenu *mItemPopup; // Right mouse button popup menu for KOAgendaItems 279 QPopupMenu *mItemPopup; // Right mouse button popup menu for KOAgendaItems
280 QPopupMenu *mNewItemPopup;
277 281
278 int mOldLowerScrollValue; 282 int mOldLowerScrollValue;
279 int mOldUpperScrollValue; 283 int mOldUpperScrollValue;
280 KOAgendaItem * getItemForTodo ( Todo * todo ); 284 KOAgendaItem * getItemForTodo ( Todo * todo );
281 QMemArray<bool> *mHolidayMask; 285 QMemArray<bool> *mHolidayMask;
282 int mCurPixWid; 286 int mCurPixWid;
283 int mCurPixHei; 287 int mCurPixHei;
284}; 288};
285 289
286#endif // KOAGENDA_H 290#endif // KOAGENDA_H