author | zautrix <zautrix> | 2005-07-05 08:37:52 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-07-05 08:37:52 (UTC) |
commit | 7e49703511de87f624cc8813b18ebbfcc01752cd (patch) (unidiff) | |
tree | 896918396dbf518f6358a066f93a04bd4185f535 /korganizer/koagenda.h | |
parent | 28ca4c37fb0e131b2978584992840b3fdca21d3e (diff) | |
download | kdepimpi-7e49703511de87f624cc8813b18ebbfcc01752cd.zip kdepimpi-7e49703511de87f624cc8813b18ebbfcc01752cd.tar.gz kdepimpi-7e49703511de87f624cc8813b18ebbfcc01752cd.tar.bz2 |
fixxx
-rw-r--r-- | korganizer/koagenda.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/korganizer/koagenda.h b/korganizer/koagenda.h index 5d813b2..0e3aed8 100644 --- a/korganizer/koagenda.h +++ b/korganizer/koagenda.h | |||
@@ -30,97 +30,97 @@ | |||
30 | #include <qpixmap.h> | 30 | #include <qpixmap.h> |
31 | #include <qguardedptr.h> | 31 | #include <qguardedptr.h> |
32 | 32 | ||
33 | #include "koagendaitem.h" | 33 | #include "koagendaitem.h" |
34 | #include "koeventview.h" | 34 | #include "koeventview.h" |
35 | 35 | ||
36 | class QPopupMenu; | 36 | class QPopupMenu; |
37 | class QTime; | 37 | class QTime; |
38 | class KConfig; | 38 | class KConfig; |
39 | class QFrame; | 39 | class QFrame; |
40 | class KOAgenda; | 40 | class KOAgenda; |
41 | class KCal::Event; | 41 | class KCal::Event; |
42 | class KCal::Todo; | 42 | class KCal::Todo; |
43 | 43 | ||
44 | using namespace KCal; | 44 | using namespace KCal; |
45 | 45 | ||
46 | class MarcusBains : public QFrame { | 46 | class MarcusBains : public QFrame { |
47 | Q_OBJECT | 47 | Q_OBJECT |
48 | public: | 48 | public: |
49 | MarcusBains(KOAgenda *agenda=0,const char *name=0); | 49 | MarcusBains(KOAgenda *agenda=0,const char *name=0); |
50 | virtual ~MarcusBains(); | 50 | virtual ~MarcusBains(); |
51 | 51 | ||
52 | public slots: | 52 | public slots: |
53 | void updateLocation(bool recalculate=false); | 53 | void updateLocation(bool recalculate=false); |
54 | void updateLoc(); | 54 | void updateLoc(); |
55 | 55 | ||
56 | private: | 56 | private: |
57 | int todayColumn(); | 57 | int todayColumn(); |
58 | QTimer *minutes; | 58 | QTimer *minutes; |
59 | QLabel *mTimeBox; | 59 | QLabel *mTimeBox; |
60 | KOAgenda *agenda; | 60 | KOAgenda *agenda; |
61 | QTime oldTime; | 61 | QTime oldTime; |
62 | int oldToday; | 62 | int oldToday; |
63 | }; | 63 | }; |
64 | 64 | ||
65 | 65 | ||
66 | class KOAgenda : public QScrollView | 66 | class KOAgenda : public QScrollView |
67 | { | 67 | { |
68 | Q_OBJECT | 68 | Q_OBJECT |
69 | public: | 69 | public: |
70 | enum MouseActionType { NOP, MOVE, SELECT, | 70 | enum MouseActionType { NOP, MOVE, SELECT, |
71 | RESIZETOP, RESIZEBOTTOM, RESIZELEFT, RESIZERIGHT }; | 71 | RESIZETOP, RESIZEBOTTOM, RESIZELEFT, RESIZERIGHT }; |
72 | 72 | ||
73 | KOAgenda ( int columns, int rows, int columnSize, QWidget * parent=0, | 73 | KOAgenda ( int columns, int rows, int columnSize, QWidget * parent=0, |
74 | const char * name=0, WFlags f=0 ); | 74 | const char * name=0, WFlags f=0 ); |
75 | KOAgenda ( int columns, QWidget * parent=0, | 75 | KOAgenda ( int columns, QWidget * parent=0, |
76 | const char * name=0, WFlags f=0 ); | 76 | const char * name=0, WFlags f=0 ); |
77 | virtual ~KOAgenda(); | 77 | virtual ~KOAgenda(); |
78 | static bool mInvalidPixmap; | 78 | bool mInvalidPixmap; |
79 | 79 | ||
80 | Incidence *selectedIncidence() const; | 80 | Incidence *selectedIncidence() const; |
81 | QDate selectedIncidenceDate() const; | 81 | QDate selectedIncidenceDate() const; |
82 | 82 | ||
83 | virtual bool eventFilter ( QObject *, QEvent * ); | 83 | virtual bool eventFilter ( QObject *, QEvent * ); |
84 | 84 | ||
85 | void contentsToGrid (int x, int y, int& gx, int& gy); | 85 | void contentsToGrid (int x, int y, int& gx, int& gy); |
86 | void gridToContents (int gx, int gy, int& x, int& y); | 86 | void gridToContents (int gx, int gy, int& x, int& y); |
87 | 87 | ||
88 | int timeToY (const QTime &time); | 88 | int timeToY (const QTime &time); |
89 | QTime gyToTime (int y); | 89 | QTime gyToTime (int y); |
90 | 90 | ||
91 | void setStartHour(int startHour); | 91 | void setStartHour(int startHour); |
92 | 92 | ||
93 | KOAgendaItem *insertItem (Incidence *event,QDate qd,int X,int YTop,int YBottom); | 93 | KOAgendaItem *insertItem (Incidence *event,QDate qd,int X,int YTop,int YBottom); |
94 | KOAgendaItem *insertAllDayItem (Incidence *event,QDate qd,int XBegin,int XEnd); | 94 | KOAgendaItem *insertAllDayItem (Incidence *event,QDate qd,int XBegin,int XEnd); |
95 | void insertMultiItem (Event *event,QDate qd,int XBegin,int XEnd, | 95 | void insertMultiItem (Event *event,QDate qd,int XBegin,int XEnd, |
96 | int YTop,int YBottom); | 96 | int YTop,int YBottom); |
97 | 97 | ||
98 | void changeColumns(int columns); | 98 | void changeColumns(int columns); |
99 | 99 | ||
100 | int columns() { return mColumns; } | 100 | int columns() { return mColumns; } |
101 | int rows() { return mRows; } | 101 | int rows() { return mRows; } |
102 | 102 | ||
103 | int gridSpacingX() const { return mGridSpacingX; } | 103 | int gridSpacingX() const { return mGridSpacingX; } |
104 | int gridSpacingY() const { return mGridSpacingY; } | 104 | int gridSpacingY() const { return mGridSpacingY; } |
105 | 105 | ||
106 | // virtual QSizePolicy sizePolicy() const; | 106 | // virtual QSizePolicy sizePolicy() const; |
107 | 107 | ||
108 | void clear(); | 108 | void clear(); |
109 | 109 | ||
110 | void clearSelection(); | 110 | void clearSelection(); |
111 | void hideUnused(); | 111 | void hideUnused(); |
112 | 112 | ||
113 | /** Calculates the minimum width */ | 113 | /** Calculates the minimum width */ |
114 | virtual int minimumWidth() const; | 114 | virtual int minimumWidth() const; |
115 | /** Update configuration from preference settings */ | 115 | /** Update configuration from preference settings */ |
116 | void updateConfig(); | 116 | void updateConfig(); |
117 | 117 | ||
118 | void checkScrollBoundaries(); | 118 | void checkScrollBoundaries(); |
119 | 119 | ||
120 | void setHolidayMask(QMemArray<bool> *); | 120 | void setHolidayMask(QMemArray<bool> *); |
121 | void setDateList(const DateList &selectedDates); | 121 | void setDateList(const DateList &selectedDates); |
122 | DateList dateList() const; | 122 | DateList dateList() const; |
123 | void drawContentsToPainter( QPainter* paint = 0, bool backgroundOnly = false); | 123 | void drawContentsToPainter( QPainter* paint = 0, bool backgroundOnly = false); |
124 | void finishUpdate(); | 124 | void finishUpdate(); |
125 | void printSelection(); | 125 | void printSelection(); |
126 | void storePosition(); | 126 | void storePosition(); |
@@ -129,96 +129,97 @@ class KOAgenda : public QScrollView | |||
129 | void shrinkPixmap(); | 129 | void shrinkPixmap(); |
130 | 130 | ||
131 | public slots: | 131 | public slots: |
132 | void slotContentMove(int,int); | 132 | void slotContentMove(int,int); |
133 | void categoryChanged(Incidence * inc); | 133 | void categoryChanged(Incidence * inc); |
134 | void slotClearSelection(); | 134 | void slotClearSelection(); |
135 | void popupMenu(); | 135 | void popupMenu(); |
136 | void newItem( int ); | 136 | void newItem( int ); |
137 | void moveChild( QWidget *, int, int ); | 137 | void moveChild( QWidget *, int, int ); |
138 | void scrollUp(); | 138 | void scrollUp(); |
139 | void scrollDown(); | 139 | void scrollDown(); |
140 | void updateTodo( Todo * t, int , bool ); | 140 | void updateTodo( Todo * t, int , bool ); |
141 | void popupAlarm(); | 141 | void popupAlarm(); |
142 | 142 | ||
143 | void checkScrollBoundaries(int); | 143 | void checkScrollBoundaries(int); |
144 | 144 | ||
145 | /** Deselect selected items. This function does not emit any signals. */ | 145 | /** Deselect selected items. This function does not emit any signals. */ |
146 | void deselectItem(); | 146 | void deselectItem(); |
147 | /** Select item. If the argument is 0, the currently selected item gets | 147 | /** Select item. If the argument is 0, the currently selected item gets |
148 | deselected. This function emits the itemSelected(bool) signal to inform | 148 | deselected. This function emits the itemSelected(bool) signal to inform |
149 | about selection/deseelction of events. */ | 149 | about selection/deseelction of events. */ |
150 | void selectItem(KOAgendaItem *); | 150 | void selectItem(KOAgendaItem *); |
151 | void finishResize(); | 151 | void finishResize(); |
152 | 152 | ||
153 | signals: | 153 | signals: |
154 | void signalClearSelection(); | 154 | void signalClearSelection(); |
155 | void showDateView( int, int); | 155 | void showDateView( int, int); |
156 | void newEventSignal(); | 156 | void newEventSignal(); |
157 | void newEventSignal(int gx,int gy); | 157 | void newEventSignal(int gx,int gy); |
158 | void newTodoSignal(int gx,int gy); | 158 | void newTodoSignal(int gx,int gy); |
159 | void newEventSignal(int gxStart, int gyStart, int gxEnd, int gyEnd); | 159 | void newEventSignal(int gxStart, int gyStart, int gxEnd, int gyEnd); |
160 | void newTimeSpanSignal(int gxStart, int gyStart, int gxEnd, int gyEnd); | 160 | void newTimeSpanSignal(int gxStart, int gyStart, int gxEnd, int gyEnd); |
161 | void newStartSelectSignal(); | 161 | void newStartSelectSignal(); |
162 | void showIncidenceSignal(Incidence *); | 162 | void showIncidenceSignal(Incidence *); |
163 | void editIncidenceSignal(Incidence *); | 163 | void editIncidenceSignal(Incidence *); |
164 | void deleteIncidenceSignal(Incidence *); | 164 | void deleteIncidenceSignal(Incidence *); |
165 | void showIncidencePopupSignal(Incidence *); | 165 | void showIncidencePopupSignal(Incidence *); |
166 | 166 | ||
167 | void itemModified(KOAgendaItem *item, int ); | 167 | void itemModified(KOAgendaItem *item, int ); |
168 | void incidenceSelected(Incidence *); | 168 | void incidenceSelected(Incidence *); |
169 | 169 | ||
170 | void lowerYChanged(int); | 170 | void lowerYChanged(int); |
171 | void upperYChanged(int); | 171 | void upperYChanged(int); |
172 | 172 | ||
173 | void startDragSignal(Incidence *); | 173 | void startDragSignal(Incidence *); |
174 | void addToCalSignal(Incidence *, Incidence *); | 174 | void addToCalSignal(Incidence *, Incidence *); |
175 | void resizedSignal(); | 175 | void resizedSignal(); |
176 | void updateViewSignal(); | 176 | void updateViewSignal(); |
177 | void sendPing(); | ||
177 | 178 | ||
178 | protected: | 179 | protected: |
179 | KOEventPopupMenu * mAllAgendaPopup; | 180 | KOEventPopupMenu * mAllAgendaPopup; |
180 | QPainter mPixPainter; | 181 | QPainter mPixPainter; |
181 | QPixmap mPaintPixmap; | 182 | QPixmap mPaintPixmap; |
182 | QPixmap mHighlightPixmap; | 183 | QPixmap mHighlightPixmap; |
183 | void drawContents(QPainter *p,int cx, int cy, int cw, int ch); | 184 | void drawContents(QPainter *p,int cx, int cy, int cw, int ch); |
184 | virtual void resizeEvent ( QResizeEvent * ); | 185 | virtual void resizeEvent ( QResizeEvent * ); |
185 | 186 | ||
186 | /** Handles mouse events. Called from eventFilter */ | 187 | /** Handles mouse events. Called from eventFilter */ |
187 | virtual bool eventFilter_mouse ( QObject *, QMouseEvent * ); | 188 | virtual bool eventFilter_mouse ( QObject *, QMouseEvent * ); |
188 | 189 | ||
189 | /** Start selecting time span. */ | 190 | /** Start selecting time span. */ |
190 | void startSelectAction(QPoint viewportPos); | 191 | void startSelectAction(QPoint viewportPos); |
191 | 192 | ||
192 | /** Select time span. */ | 193 | /** Select time span. */ |
193 | void performSelectAction(QPoint viewportPos); | 194 | void performSelectAction(QPoint viewportPos); |
194 | 195 | ||
195 | /** Emd selecting time span. */ | 196 | /** Emd selecting time span. */ |
196 | void endSelectAction( bool emitNewEvent = false ); | 197 | void endSelectAction( bool emitNewEvent = false ); |
197 | 198 | ||
198 | /** Start moving/resizing agenda item */ | 199 | /** Start moving/resizing agenda item */ |
199 | void startItemAction(QPoint viewportPos); | 200 | void startItemAction(QPoint viewportPos); |
200 | 201 | ||
201 | /** Move/resize agenda item */ | 202 | /** Move/resize agenda item */ |
202 | void performItemAction(QPoint viewportPos); | 203 | void performItemAction(QPoint viewportPos); |
203 | 204 | ||
204 | /** End moving/resizing agenda item */ | 205 | /** End moving/resizing agenda item */ |
205 | void endItemAction(); | 206 | void endItemAction(); |
206 | 207 | ||
207 | /** Set cursor, when no item action is in progress */ | 208 | /** Set cursor, when no item action is in progress */ |
208 | void setNoActionCursor(KOAgendaItem *moveItem,QPoint viewportPos); | 209 | void setNoActionCursor(KOAgendaItem *moveItem,QPoint viewportPos); |
209 | 210 | ||
210 | /** Place agenda item in agenda and adjust other cells if necessary */ | 211 | /** Place agenda item in agenda and adjust other cells if necessary */ |
211 | void placeSubCells(KOAgendaItem *placeItem); | 212 | void placeSubCells(KOAgendaItem *placeItem); |
212 | 213 | ||
213 | /** Process the keyevent, including the ignored keyevents of eventwidgets. | 214 | /** Process the keyevent, including the ignored keyevents of eventwidgets. |
214 | * Implements pgup/pgdn and cursor key navigation in the view. | 215 | * Implements pgup/pgdn and cursor key navigation in the view. |
215 | */ | 216 | */ |
216 | void keyPressEvent( QKeyEvent * ); | 217 | void keyPressEvent( QKeyEvent * ); |
217 | 218 | ||
218 | void calculateWorkingHours(); | 219 | void calculateWorkingHours(); |
219 | 220 | ||
220 | virtual void contentsMousePressEvent ( QMouseEvent * ); | 221 | virtual void contentsMousePressEvent ( QMouseEvent * ); |
221 | 222 | ||
222 | private: | 223 | private: |
223 | void init(); | 224 | void init(); |
224 | void marcus_bains(); | 225 | void marcus_bains(); |