author | zautrix <zautrix> | 2005-03-25 05:47:45 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-25 05:47:45 (UTC) |
commit | e3b935f4e24086117213662e670ab26cb2ad8822 (patch) (unidiff) | |
tree | d20ad8e8dd09cc3efb9f9e57568d4d009048d518 /korganizer/komonthview.h | |
parent | 658354b7112aff72f0fadd924c82b977d803bc27 (diff) | |
download | kdepimpi-e3b935f4e24086117213662e670ab26cb2ad8822.zip kdepimpi-e3b935f4e24086117213662e670ab26cb2ad8822.tar.gz kdepimpi-e3b935f4e24086117213662e670ab26cb2ad8822.tar.bz2 |
mal sehn...
-rw-r--r-- | korganizer/komonthview.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h index 89912e0..b997c1a 100644 --- a/korganizer/komonthview.h +++ b/korganizer/komonthview.h | |||
@@ -48,208 +48,214 @@ class KOWeekButton : public QPushButton | |||
48 | { | 48 | { |
49 | Q_OBJECT | 49 | Q_OBJECT |
50 | public: | 50 | public: |
51 | KOWeekButton( QWidget *parent=0, const char *name=0 ) : | 51 | KOWeekButton( QWidget *parent=0, const char *name=0 ) : |
52 | QPushButton( parent, name) | 52 | QPushButton( parent, name) |
53 | { | 53 | { |
54 | connect( this, SIGNAL( clicked() ), | 54 | connect( this, SIGNAL( clicked() ), |
55 | SLOT( bottonClicked() )); | 55 | SLOT( bottonClicked() )); |
56 | mNumber = -1; | 56 | mNumber = -1; |
57 | } | 57 | } |
58 | void setWeekNum ( int num ) {mNumber = num; setText( QString::number ( num ));} | 58 | void setWeekNum ( int num ) {mNumber = num; setText( QString::number ( num ));} |
59 | int getWeekNum() { return mNumber;} | 59 | int getWeekNum() { return mNumber;} |
60 | signals: | 60 | signals: |
61 | void selectWeekNum ( int ); | 61 | void selectWeekNum ( int ); |
62 | private: | 62 | private: |
63 | int mNumber; | 63 | int mNumber; |
64 | private slots : | 64 | private slots : |
65 | void bottonClicked() { if ( mNumber > 0 ) emit selectWeekNum ( mNumber ); } | 65 | void bottonClicked() { if ( mNumber > 0 ) emit selectWeekNum ( mNumber ); } |
66 | }; | 66 | }; |
67 | 67 | ||
68 | class KNoScrollListBox: public QListBox | 68 | class KNoScrollListBox: public QListBox |
69 | { | 69 | { |
70 | Q_OBJECT | 70 | Q_OBJECT |
71 | public: | 71 | public: |
72 | KNoScrollListBox(QWidget *parent=0, const char *name=0); | 72 | KNoScrollListBox(QWidget *parent=0, const char *name=0); |
73 | ~KNoScrollListBox(); | 73 | ~KNoScrollListBox(); |
74 | QString getWhatsThisText(QPoint p) ; | 74 | QString getWhatsThisText(QPoint p) ; |
75 | 75 | ||
76 | signals: | 76 | signals: |
77 | void shiftDown(); | 77 | void shiftDown(); |
78 | void shiftUp(); | 78 | void shiftUp(); |
79 | void rightClick(); | 79 | void rightClick(); |
80 | 80 | ||
81 | protected slots: | 81 | protected slots: |
82 | void oneDown(); | 82 | void oneDown(); |
83 | void keyPressEvent(QKeyEvent *); | 83 | void keyPressEvent(QKeyEvent *); |
84 | void keyReleaseEvent(QKeyEvent *); | 84 | void keyReleaseEvent(QKeyEvent *); |
85 | void mousePressEvent(QMouseEvent *); | 85 | void mousePressEvent(QMouseEvent *); |
86 | 86 | ||
87 | private: | 87 | private: |
88 | KNOWhatsThis * mWT; | 88 | KNOWhatsThis * mWT; |
89 | }; | 89 | }; |
90 | 90 | ||
91 | 91 | ||
92 | class MonthViewItem: public QListBoxItem | 92 | class MonthViewItem: public QListBoxItem |
93 | { | 93 | { |
94 | public: | 94 | public: |
95 | MonthViewItem( Incidence *, QDate qd, const QString & title ); | 95 | MonthViewItem( Incidence *, QDate qd, const QString & title ); |
96 | 96 | void recycle( Incidence *incidence, QDate qd, const QString & s); | |
97 | void setRecur(bool on) { mRecur = on; } | 97 | void setRecur(bool on) { mRecur = on; } |
98 | void setAlarm(bool on) { mAlarm = on; } | 98 | void setAlarm(bool on) { mAlarm = on; } |
99 | void setReply(bool on) { mReply = on; } | 99 | void setReply(bool on) { mReply = on; } |
100 | void setMoreInfo(bool on) { mInfo = on; } | 100 | void setMoreInfo(bool on) { mInfo = on; } |
101 | void setMultiDay(int type) { mMultiday = type; } | 101 | void setMultiDay(int type) { mMultiday = type; } |
102 | void setBlockRepaint(bool on) { mblockRepaint = on; } | ||
102 | 103 | ||
103 | 104 | ||
104 | void setPalette(const QPalette &p) { mPalette = p; } | 105 | void setPalette(const QPalette &p) { mPalette = p; } |
105 | QPalette palette() const { return mPalette; } | 106 | QPalette palette() const { return mPalette; } |
106 | 107 | ||
107 | Incidence *incidence() const { return mIncidence; } | 108 | Incidence *incidence() const { return mIncidence; } |
108 | QDate incidenceDate() { return mDate; } | 109 | QDate incidenceDate() { return mDate; } |
109 | 110 | ||
110 | protected: | 111 | protected: |
111 | virtual void paint(QPainter *); | 112 | virtual void paint(QPainter *); |
112 | virtual int height(const QListBox *) const; | 113 | virtual int height(const QListBox *) const; |
113 | virtual int width(const QListBox *) const; | 114 | virtual int width(const QListBox *) const; |
114 | 115 | ||
115 | private: | 116 | private: |
117 | bool mblockRepaint; | ||
116 | int mMultiday; | 118 | int mMultiday; |
117 | bool mRecur; | 119 | bool mRecur; |
118 | bool mAlarm; | 120 | bool mAlarm; |
119 | bool mReply; | 121 | bool mReply; |
120 | bool mInfo; | 122 | bool mInfo; |
121 | 123 | ||
122 | QPalette mPalette; | 124 | QPalette mPalette; |
123 | QDate mDate; | 125 | QDate mDate; |
124 | 126 | ||
125 | Incidence *mIncidence; | 127 | Incidence *mIncidence; |
126 | }; | 128 | }; |
127 | 129 | ||
128 | 130 | ||
129 | class KOMonthView; | 131 | class KOMonthView; |
130 | 132 | ||
131 | class MonthViewCell : public QWidget | 133 | class MonthViewCell : public KNoScrollListBox |
132 | { | 134 | { |
133 | Q_OBJECT | 135 | Q_OBJECT |
134 | public: | 136 | public: |
135 | MonthViewCell(KOMonthView *,QWidget* ); | 137 | MonthViewCell(KOMonthView *,QWidget* ); |
138 | ~MonthViewCell() {mAvailItemList.setAutoDelete( true );} | ||
136 | 139 | ||
137 | void setDate( const QDate & ); | 140 | void setDate( const QDate & ); |
138 | QDate date() const; | 141 | QDate date() const; |
139 | 142 | ||
140 | void setPrimary( bool ); | 143 | void setPrimary( bool ); |
141 | bool isPrimary() const; | 144 | bool isPrimary() const; |
142 | 145 | ||
143 | void setHoliday( bool ); | 146 | void setHoliday( bool ); |
144 | void setHoliday( const QString & ); | 147 | void setHoliday( const QString & ); |
145 | 148 | ||
146 | void updateCell(); | 149 | void updateCell(); |
147 | void startUpdateCell(); | 150 | void startUpdateCell(); |
148 | void finishUpdateCell(); | 151 | void finishUpdateCell(); |
152 | void repaintfinishUpdateCell(); | ||
149 | void insertEvent(Event *); | 153 | void insertEvent(Event *); |
150 | void insertTodo(Todo *); | 154 | void insertTodo(Todo *); |
151 | 155 | ||
152 | void updateConfig( bool bigFont = false ); | 156 | void updateConfig( bool bigFont = false ); |
153 | 157 | ||
154 | void enableScrollBars( bool ); | 158 | void enableScrollBars( bool ); |
155 | 159 | ||
156 | Incidence *selectedIncidence(); | 160 | Incidence *selectedIncidence(); |
157 | QDate selectedIncidenceDate(); | 161 | QDate selectedIncidenceDate(); |
158 | 162 | ||
159 | void deselect(); | 163 | void deselect(); |
160 | void select(); | 164 | void select(); |
161 | 165 | ||
162 | #ifdef DESKTOP_VERSION | 166 | #ifdef DESKTOP_VERSION |
163 | static QToolTipGroup *toolTipGroup(); | 167 | static QToolTipGroup *toolTipGroup(); |
164 | #endif | 168 | #endif |
165 | signals: | 169 | signals: |
166 | void defaultAction( Incidence * ); | 170 | void defaultAction( Incidence * ); |
167 | void newEventSignal( QDateTime ); | 171 | void newEventSignal( QDateTime ); |
168 | void showDaySignal( QDate ); | 172 | void showDaySignal( QDate ); |
169 | 173 | ||
170 | protected: | 174 | protected: |
171 | QStringList mToolTip; | 175 | QStringList mToolTip; |
172 | void resizeEvent( QResizeEvent * ); | 176 | void resizeEvent( QResizeEvent * ); |
173 | 177 | ||
174 | 178 | ||
175 | public slots: | 179 | public slots: |
176 | void showDay(); | 180 | void showDay(); |
177 | 181 | ||
178 | protected slots: | 182 | protected slots: |
179 | void defaultAction( QListBoxItem * ); | 183 | void defaultAction( QListBoxItem * ); |
180 | void contextMenu( QListBoxItem * ); | 184 | void contextMenu( QListBoxItem * ); |
181 | void selection( QListBoxItem * ); | 185 | void selection( QListBoxItem * ); |
182 | void cellClicked( QListBoxItem * ); | 186 | void cellClicked( QListBoxItem * ); |
183 | void newEvent(); | 187 | void newEvent(); |
184 | 188 | ||
185 | private: | 189 | private: |
190 | MonthViewItem* mCurrentAvailItem; | ||
191 | QPtrList <MonthViewItem> mAvailItemList; | ||
186 | KOMonthView *mMonthView; | 192 | KOMonthView *mMonthView; |
193 | int currentPalette; | ||
187 | 194 | ||
188 | QDate mDate; | 195 | QDate mDate; |
189 | bool mPrimary; | 196 | bool mPrimary; |
190 | bool mHoliday; | 197 | bool mHoliday; |
191 | QString mHolidayString; | 198 | QString mHolidayString; |
192 | 199 | ||
193 | //QLabel *mLabel; | 200 | //QLabel *mLabel; |
194 | QPushButton *mLabel; | 201 | QPushButton *mLabel; |
195 | QListBox *mItemList; | 202 | //QListBox *mItemList; |
196 | #ifdef DESKTOP_VERSION | 203 | #ifdef DESKTOP_VERSION |
197 | static QToolTipGroup *mToolTipGroup; | 204 | static QToolTipGroup *mToolTipGroup; |
198 | #endif | 205 | #endif |
199 | QSize mLabelSize; | 206 | QSize mLabelSize; |
200 | QSize mLabelBigSize; | 207 | QSize mLabelBigSize; |
201 | QPalette mHolidayPalette; | 208 | QPalette mHolidayPalette; |
202 | QPalette mStandardPalette; | 209 | QPalette mStandardPalette; |
203 | QPalette mPrimaryPalette; | 210 | QPalette mPrimaryPalette; |
204 | QPalette mNonPrimaryPalette; | 211 | QPalette mNonPrimaryPalette; |
205 | void setMyPalette(); | 212 | void setMyPalette(); |
206 | QPalette getPalette (); | 213 | QPalette getPalette (); |
207 | void keyPressEvent ( QKeyEvent * ) ; | ||
208 | 214 | ||
209 | }; | 215 | }; |
210 | 216 | ||
211 | 217 | ||
212 | class KOMonthView: public KOEventView | 218 | class KOMonthView: public KOEventView |
213 | { | 219 | { |
214 | Q_OBJECT | 220 | Q_OBJECT |
215 | public: | 221 | public: |
216 | KOMonthView(Calendar *cal, QWidget *parent = 0, const char *name = 0 ); | 222 | KOMonthView(Calendar *cal, QWidget *parent = 0, const char *name = 0 ); |
217 | ~KOMonthView(); | 223 | ~KOMonthView(); |
218 | 224 | ||
219 | /** Returns maximum number of days supported by the komonthview */ | 225 | /** Returns maximum number of days supported by the komonthview */ |
220 | virtual int maxDatesHint(); | 226 | virtual int maxDatesHint(); |
221 | 227 | ||
222 | /** Returns number of currently shown dates. */ | 228 | /** Returns number of currently shown dates. */ |
223 | virtual int currentDateCount(); | 229 | virtual int currentDateCount(); |
224 | 230 | ||
225 | /** returns the currently selected events */ | 231 | /** returns the currently selected events */ |
226 | virtual QPtrList<Incidence> selectedIncidences(); | 232 | virtual QPtrList<Incidence> selectedIncidences(); |
227 | 233 | ||
228 | /** returns dates of the currently selected events */ | 234 | /** returns dates of the currently selected events */ |
229 | virtual DateList selectedDates(); | 235 | virtual DateList selectedDates(); |
230 | 236 | ||
231 | virtual void printPreview(CalPrinter *calPrinter, | 237 | virtual void printPreview(CalPrinter *calPrinter, |
232 | const QDate &, const QDate &); | 238 | const QDate &, const QDate &); |
233 | bool isMonthView() { return !mShowWeekView; } | 239 | bool isMonthView() { return !mShowWeekView; } |
234 | bool isUpdatePossible() { return updatePossible; } | 240 | bool isUpdatePossible() { return updatePossible; } |
235 | 241 | ||
236 | MonthViewCell * selectedCell(); | 242 | MonthViewCell * selectedCell(); |
237 | bool skipResize; | 243 | bool skipResize; |
238 | NavigatorBar* navigatorBar() { return mNavigatorBar ;} | 244 | NavigatorBar* navigatorBar() { return mNavigatorBar ;} |
239 | public slots: | 245 | public slots: |
240 | virtual void updateView(); | 246 | virtual void updateView(); |
241 | virtual void updateConfig(); | 247 | virtual void updateConfig(); |
242 | virtual void showDates(const QDate &start, const QDate &end); | 248 | virtual void showDates(const QDate &start, const QDate &end); |
243 | virtual void showEvents(QPtrList<Event> eventList); | 249 | virtual void showEvents(QPtrList<Event> eventList); |
244 | 250 | ||
245 | void changeEventDisplay(Event *, int); | 251 | void changeEventDisplay(Event *, int); |
246 | 252 | ||
247 | void clearSelection(); | 253 | void clearSelection(); |
248 | 254 | ||
249 | void showContextMenu( Incidence * ); | 255 | void showContextMenu( Incidence * ); |
250 | 256 | ||
251 | void setSelectedCell( MonthViewCell * ); | 257 | void setSelectedCell( MonthViewCell * ); |
252 | void switchView(); | 258 | void switchView(); |
253 | 259 | ||
254 | protected slots: | 260 | protected slots: |
255 | void slotComputeLayout(); | 261 | void slotComputeLayout(); |