-rw-r--r-- | korganizer/kolistview.h | 42 |
1 files changed, 24 insertions, 18 deletions
diff --git a/korganizer/kolistview.h b/korganizer/kolistview.h index 99d0561..9fb0b00 100644 --- a/korganizer/kolistview.h +++ b/korganizer/kolistview.h | |||
@@ -19,19 +19,25 @@ | |||
19 | 19 | ||
20 | As a special exception, permission is given to link this program | 20 | As a special exception, permission is given to link this program |
21 | with any edition of Qt, and distribute the resulting executable, | 21 | with any edition of Qt, and distribute the resulting executable, |
22 | without including the source code for Qt in the source distribution. | 22 | without including the source code for Qt in the source distribution. |
23 | */ | 23 | */ |
24 | #ifndef _KOLISTVIEW_H | 24 | #ifndef _KOLISTVIEW_H |
25 | #define _KOLISTVIEW_H | 25 | #define _KOLISTVIEW_H |
26 | 26 | ||
27 | #include <qlistview.h> | 27 | #include <q3listview.h> |
28 | #include <qmap.h> | 28 | #include <qmap.h> |
29 | #include <qdict.h> | 29 | #include <q3dict.h> |
30 | //Added by qt3to4: | ||
31 | #include <QMouseEvent> | ||
32 | #include <Q3PtrList> | ||
33 | #include <Q3PopupMenu> | ||
34 | #include <QKeyEvent> | ||
35 | #include <Q3VBoxLayout> | ||
30 | 36 | ||
31 | #include <klistview.h> | 37 | #include <klistview.h> |
32 | 38 | ||
33 | #include <libkcal/incidence.h> | 39 | #include <libkcal/incidence.h> |
34 | 40 | ||
35 | #include "koeventview.h" | 41 | #include "koeventview.h" |
36 | #include "customlistviewitem.h" | 42 | #include "customlistviewitem.h" |
37 | 43 | ||
@@ -42,44 +48,44 @@ class KOListViewWhatsThis; | |||
42 | #include <qpushbutton.h> | 48 | #include <qpushbutton.h> |
43 | #include <qlayout.h> | 49 | #include <qlayout.h> |
44 | #include <qdialog.h> | 50 | #include <qdialog.h> |
45 | #include <qtimer.h> | 51 | #include <qtimer.h> |
46 | #include <qcombobox.h> | 52 | #include <qcombobox.h> |
47 | #include <qspinbox.h> | 53 | #include <qspinbox.h> |
48 | #include <qtooltip.h> | 54 | #include <qtooltip.h> |
49 | #include <qcheckbox.h> | 55 | #include <qcheckbox.h> |
50 | #include <qhbox.h> | 56 | #include <q3hbox.h> |
51 | #include <qlabel.h> | 57 | #include <qlabel.h> |
52 | #include <kiconloader.h> | 58 | #include <kiconloader.h> |
53 | #include "kfiledialog.h" | 59 | #include "kfiledialog.h" |
54 | #include "koprefs.h" | 60 | #include "koprefs.h" |
55 | class KOAlarmPrefs : public QDialog | 61 | class KOAlarmPrefs : public QDialog |
56 | { | 62 | { |
57 | Q_OBJECT | 63 | Q_OBJECT |
58 | public: | 64 | public: |
59 | KOAlarmPrefs( QWidget *par=0, const char *name=0 ) : | 65 | KOAlarmPrefs( QWidget *par=0, const char *name=0 ) : |
60 | QDialog( par, name, true ) | 66 | QDialog( par, name, true ) |
61 | { | 67 | { |
62 | setCaption( i18n("Alarm Options") ); | 68 | setCaption( i18n("Alarm Options") ); |
63 | QVBoxLayout* alarmLayout = new QVBoxLayout( this ); | 69 | Q3VBoxLayout* alarmLayout = new Q3VBoxLayout( this ); |
64 | alarmLayout->setSpacing( 3 ); | 70 | alarmLayout->setSpacing( 3 ); |
65 | alarmLayout->setMargin( 3 ); | 71 | alarmLayout->setMargin( 3 ); |
66 | QWidget *parent = this; | 72 | QWidget *parent = this; |
67 | mAlarmButton = new QCheckBox(i18n("Set reminder ON with offset to:"),parent); | 73 | mAlarmButton = new QCheckBox(i18n("Set reminder ON with offset to:"),parent); |
68 | alarmLayout->addWidget(mAlarmButton); | 74 | alarmLayout->addWidget(mAlarmButton); |
69 | mAlarmTimeEdit = new QSpinBox ( 0, 9999, 1, parent, "mAlarmTimeEdit " ) ; | 75 | mAlarmTimeEdit = new QSpinBox ( 0, 9999, 1, parent, "mAlarmTimeEdit " ) ; |
70 | mAlarmTimeEdit->setValue( 15 ); | 76 | mAlarmTimeEdit->setValue( 15 ); |
71 | alarmLayout->addWidget(mAlarmTimeEdit); | 77 | alarmLayout->addWidget(mAlarmTimeEdit); |
72 | mAlarmIncrCombo = new QComboBox(false, parent); | 78 | mAlarmIncrCombo = new QComboBox(false, parent); |
73 | mAlarmIncrCombo->insertItem(i18n("minute(s)")); | 79 | mAlarmIncrCombo->insertItem(i18n("minute(s)")); |
74 | mAlarmIncrCombo->insertItem(i18n("hour(s)")); | 80 | mAlarmIncrCombo->insertItem(i18n("hour(s)")); |
75 | mAlarmIncrCombo->insertItem(i18n("day(s)")); | 81 | mAlarmIncrCombo->insertItem(i18n("day(s)")); |
76 | alarmLayout->addWidget(mAlarmIncrCombo); | 82 | alarmLayout->addWidget(mAlarmIncrCombo); |
77 | QHBox * hb = new QHBox ( parent ); | 83 | Q3HBox * hb = new Q3HBox ( parent ); |
78 | alarmLayout->addWidget(hb); | 84 | alarmLayout->addWidget(hb); |
79 | mAlarmSoundButton = new QPushButton(hb); | 85 | mAlarmSoundButton = new QPushButton(hb); |
80 | mAlarmSoundButton->setPixmap(SmallIcon("playsound")); | 86 | mAlarmSoundButton->setPixmap(SmallIcon("playsound")); |
81 | mAlarmSoundButton->setToggleButton(true); | 87 | mAlarmSoundButton->setToggleButton(true); |
82 | connect(mAlarmSoundButton, SIGNAL(clicked()), SLOT(pickAlarmSound())); | 88 | connect(mAlarmSoundButton, SIGNAL(clicked()), SLOT(pickAlarmSound())); |
83 | mAlarmProgramButton = new QPushButton(hb); | 89 | mAlarmProgramButton = new QPushButton(hb); |
84 | mAlarmProgramButton->setPixmap(SmallIcon("run")); | 90 | mAlarmProgramButton->setPixmap(SmallIcon("run")); |
85 | mAlarmProgramButton->setToggleButton(true); | 91 | mAlarmProgramButton->setToggleButton(true); |
@@ -205,17 +211,17 @@ class ListItemVisitor : public Incidence::Visitor | |||
205 | */ | 211 | */ |
206 | class KOListView; | 212 | class KOListView; |
207 | 213 | ||
208 | class KOListViewListView : public KListView | 214 | class KOListViewListView : public KListView |
209 | { | 215 | { |
210 | Q_OBJECT | 216 | Q_OBJECT |
211 | public: | 217 | public: |
212 | KOListViewListView(KOListView * lv ); | 218 | KOListViewListView(KOListView * lv ); |
213 | bool hasMultiSelection(QListViewItem*); | 219 | bool hasMultiSelection(Q3ListViewItem*); |
214 | void printList(); | 220 | void printList(); |
215 | signals: | 221 | signals: |
216 | void newEvent(); | 222 | void newEvent(); |
217 | void showIncidence( Incidence* ); | 223 | void showIncidence( Incidence* ); |
218 | public slots: | 224 | public slots: |
219 | void popupMenu(); | 225 | void popupMenu(); |
220 | private: | 226 | private: |
221 | QPoint mEventPos; | 227 | QPoint mEventPos; |
@@ -235,46 +241,46 @@ class KOListView : public KOEventView | |||
235 | Q_OBJECT | 241 | Q_OBJECT |
236 | public: | 242 | public: |
237 | KOListView(Calendar *calendar, QWidget *parent = 0, | 243 | KOListView(Calendar *calendar, QWidget *parent = 0, |
238 | const char *name = 0); | 244 | const char *name = 0); |
239 | ~KOListView(); | 245 | ~KOListView(); |
240 | 246 | ||
241 | virtual int maxDatesHint(); | 247 | virtual int maxDatesHint(); |
242 | virtual int currentDateCount(); | 248 | virtual int currentDateCount(); |
243 | virtual QPtrList<Incidence> selectedIncidences(); | 249 | virtual Q3PtrList<Incidence> selectedIncidences(); |
244 | virtual DateList selectedDates(); | 250 | virtual DateList selectedDates(); |
245 | 251 | ||
246 | void showDates(bool show); | 252 | void showDates(bool show); |
247 | Incidence* currentItem(); | 253 | Incidence* currentItem(); |
248 | void addTodos(QPtrList<Todo> eventList); | 254 | void addTodos(Q3PtrList<Todo> eventList); |
249 | void addJournals(QPtrList<Journal> eventList); | 255 | void addJournals(Q3PtrList<Journal> eventList); |
250 | virtual void printPreview(CalPrinter *calPrinter, | 256 | virtual void printPreview(CalPrinter *calPrinter, |
251 | const QDate &, const QDate &); | 257 | const QDate &, const QDate &); |
252 | 258 | ||
253 | void readSettings(KConfig *config, QString setting = "KOListView Layout"); | 259 | void readSettings(KConfig *config, QString setting = "KOListView Layout"); |
254 | void writeSettings(KConfig *config, QString setting = "KOListView Layout"); | 260 | void writeSettings(KConfig *config, QString setting = "KOListView Layout"); |
255 | void updateList(); | 261 | void updateList(); |
256 | void clearList(); | 262 | void clearList(); |
257 | void setStartDate(const QDate &start); | 263 | void setStartDate(const QDate &start); |
258 | int count(); | 264 | int count(); |
259 | QString getWhatsThisText(QPoint p); | 265 | QString getWhatsThisText(QPoint p); |
260 | QPtrList<Incidence> KOListView::getSelectedIncidences( bool includeEvents = true, bool includeTodos = true , bool includeJournals = true, bool onlyDueTodos = false ); | 266 | Q3PtrList<Incidence> getSelectedIncidences( bool includeEvents = true, bool includeTodos = true , bool includeJournals = true, bool onlyDueTodos = false ); |
261 | void showCompletedTodos(); | 267 | void showCompletedTodos(); |
262 | signals: | 268 | signals: |
263 | void signalNewEvent(); | 269 | void signalNewEvent(); |
264 | void beamIncidenceList(QPtrList<Incidence>); | 270 | void beamIncidenceList(Q3PtrList<Incidence>); |
265 | 271 | ||
266 | public slots: | 272 | public slots: |
267 | void hideAll(); | 273 | void hideAll(); |
268 | void printList(); | 274 | void printList(); |
269 | void resetFocus(); | 275 | void resetFocus(); |
270 | virtual void updateView(); | 276 | virtual void updateView(); |
271 | virtual void showDates(const QDate &start, const QDate &end); | 277 | virtual void showDates(const QDate &start, const QDate &end); |
272 | virtual void showEvents(QPtrList<Event> eventList); | 278 | virtual void showEvents(Q3PtrList<Event> eventList); |
273 | void clearSelection(); | 279 | void clearSelection(); |
274 | void allSelection(); | 280 | void allSelection(); |
275 | 281 | ||
276 | void clear(); | 282 | void clear(); |
277 | void showDates(); | 283 | void showDates(); |
278 | void hideDates(); | 284 | void hideDates(); |
279 | void deleteAll(); | 285 | void deleteAll(); |
280 | void saveToFile(); | 286 | void saveToFile(); |
@@ -282,36 +288,36 @@ class KOListView : public KOEventView | |||
282 | void saveDescriptionToFile(); | 288 | void saveDescriptionToFile(); |
283 | void beamSelected(); | 289 | void beamSelected(); |
284 | void updateConfig(); | 290 | void updateConfig(); |
285 | void setCat(); | 291 | void setCat(); |
286 | void setAlarm(); | 292 | void setAlarm(); |
287 | void setCategories( bool removeOld ); | 293 | void setCategories( bool removeOld ); |
288 | void changeEventDisplay(Event *, int); | 294 | void changeEventDisplay(Event *, int); |
289 | 295 | ||
290 | void defaultItemAction(QListViewItem *item); | 296 | void defaultItemAction(Q3ListViewItem *item); |
291 | void popupMenu(QListViewItem *item,const QPoint &,int); | 297 | void popupMenu(Q3ListViewItem *item,const QPoint &,int); |
292 | void setCalendar( int c ); | 298 | void setCalendar( int c ); |
293 | void populateCalPopup(); | 299 | void populateCalPopup(); |
294 | 300 | ||
295 | protected slots: | 301 | protected slots: |
296 | void processSelectionChange(QListViewItem *); | 302 | void processSelectionChange(Q3ListViewItem *); |
297 | void catChanged( Incidence* ); | 303 | void catChanged( Incidence* ); |
298 | 304 | ||
299 | protected: | 305 | protected: |
300 | void writeToFile( bool iCal ); | 306 | void writeToFile( bool iCal ); |
301 | void addEvents(QPtrList<Event> eventList); | 307 | void addEvents(Q3PtrList<Event> eventList); |
302 | void addIncidence(Incidence *); | 308 | void addIncidence(Incidence *); |
303 | KOListViewItem *getItemForEvent(Incidence *event); | 309 | KOListViewItem *getItemForEvent(Incidence *event); |
304 | 310 | ||
305 | private: | 311 | private: |
306 | bool mForceShowCompletedTodos; | 312 | bool mForceShowCompletedTodos; |
307 | QPopupMenu* mCalPopup; | 313 | Q3PopupMenu* mCalPopup; |
308 | KOListViewWhatsThis *mKOListViewWhatsThis; | 314 | KOListViewWhatsThis *mKOListViewWhatsThis; |
309 | KOListViewListView *mListView; | 315 | KOListViewListView *mListView; |
310 | KOEventPopupMenu *mPopupMenu; | 316 | KOEventPopupMenu *mPopupMenu; |
311 | KOListViewItem *mActiveItem; | 317 | KOListViewItem *mActiveItem; |
312 | QDict<Incidence> mUidDict; | 318 | Q3Dict<Incidence> mUidDict; |
313 | QDate mStartDate; | 319 | QDate mStartDate; |
314 | void keyPressEvent ( QKeyEvent * ) ; | 320 | void keyPressEvent ( QKeyEvent * ) ; |
315 | }; | 321 | }; |
316 | 322 | ||
317 | #endif | 323 | #endif |