26 #ifndef _KOMONTHVIEW_H
27 #define _KOMONTHVIEW_H
29 #include <tqlistbox.h>
30 #include <tqptrvector.h>
31 #include <tqtooltip.h>
32 #include "koeventview.h"
34 class KNoScrollListBox;
36 class KOMonthCellToolTip :
public TQToolTip
39 KOMonthCellToolTip (TQWidget* parent,
Calendar *calendar,
const TQDate &date, KNoScrollListBox* lv );
42 void maybeTip(
const TQPoint & pos);
47 KNoScrollListBox* eventlist;
51 class KNoScrollListBox:
public TQListBox
56 KNoScrollListBox(TQWidget *parent=0,
const char *name=0);
57 ~KNoScrollListBox() {}
59 void setBackground(
bool primary,
bool workday );
67 void keyPressEvent(TQKeyEvent *);
68 void keyReleaseEvent(TQKeyEvent *);
69 void mousePressEvent(TQMouseEvent *);
70 void resizeEvent(TQResizeEvent *);
71 void contentsMouseDoubleClickEvent( TQMouseEvent * e );
78 class MonthViewItem:
public TQListBoxItem
81 MonthViewItem(
Incidence *,
const TQDateTime &qd,
const TQString & title );
83 void setEvent(
bool on) { mEvent = on; }
84 void setTodo(
bool on) { mTodo = on; }
85 void setTodoDone(
bool on) { mTodoDone = on; }
86 void setRecur(
bool on) { mRecur = on; }
87 void setAlarm(
bool on) { mAlarm = on; }
88 void setReply(
bool on) { mReply = on; }
90 void setPalette(
const TQPalette &p) { mPalette = p; }
91 TQPalette palette()
const {
return mPalette; }
93 Incidence *incidence()
const {
return mIncidence; }
94 TQDateTime incidenceDateTime() {
return mDateTime; }
96 void setResourceColor( TQColor& color ) { mResourceColor = color; }
97 TQColor &resourceColor() {
return mResourceColor; }
99 virtual void paint(TQPainter *);
100 virtual int height(
const TQListBox *)
const;
101 virtual int width(
const TQListBox *)
const;
103 TQColor mResourceColor;
112 TQPixmap mEventPixmap;
113 TQPixmap mBirthdayPixmap;
114 TQPixmap mAnniversaryPixmap;
115 TQPixmap mTodoPixmap;
116 TQPixmap mTodoDonePixmap;
117 TQPixmap mAlarmPixmap;
118 TQPixmap mRecurPixmap;
119 TQPixmap mReplyPixmap;
122 TQDateTime mDateTime;
125 TQColor catColor()
const;
140 class CreateItemVisitor;
144 void setDate(
const TQDate & );
190 void enableScrollBars(
bool );
193 TQDate selectedIncidenceDate();
205 const TQDate &
date );
211 void setFrameWidth();
212 void resizeEvent( TQResizeEvent * );
215 void defaultAction( TQListBoxItem * );
216 void contextMenu( TQListBoxItem * );
224 TQString mHolidayString;
227 KNoScrollListBox *mItemList;
233 TQPalette mHolidayPalette;
234 TQPalette mStandardPalette;
235 TQPalette mTodayPalette;
269 virtual bool eventDurationHint(TQDateTime &startDt, TQDateTime &endDt,
bool &allDay);
272 virtual void updateView();
273 virtual void updateConfig();
274 virtual void showDates(
const TQDate &start,
const TQDate &end);
275 virtual void showIncidences(
const Incidence::List &incidenceList,
const TQDate &date );
277 void changeIncidenceDisplay(
Incidence *,
int);
278 void changeIncidenceDisplayAdded(
Incidence *, MonthViewCell::CreateItemVisitor&);
280 void clearSelection();
283 void showGeneralContextMenu();
288 void processSelectionChange();
291 void resizeEvent(TQResizeEvent *);
294 void updateDayLabels();
297 void showLabel(
bool show );
299 class GetDateVisitor;
305 TQPtrVector<MonthViewCell> mCells;
306 TQMap<TQDate,MonthViewCell *> mDateToCell;
307 TQPtrVector<TQLabel> mDayLabels;
309 bool mShortDayLabels;
310 int mWidthLongDayLabel;
313 TQDate mSelectedDate;
317 KOEventPopupMenu *mEventContextMenu;
KOEventView is the abstract base class from which all other calendar views for event data are derived...
The class KOMonthView represents the monthly view in KOrganizer.
virtual bool eventDurationHint(TQDateTime &startDt, TQDateTime &endDt, bool &allDay)
Set the default start/end date/time for new events.
virtual DateList selectedIncidenceDates()
Returns dates of the currently selected events.
virtual TQDateTime selectionEnd()
Returns the end of the selection, or an invalid TQDateTime if there is no selection or the view doesn...
virtual int currentDateCount()
Returns number of currently shown dates.
virtual Incidence::List selectedIncidences()
Returns the currently selected events.
virtual int maxDatesHint()
Returns maximum number of days supported by the komonthview.
virtual TQDateTime selectionStart()
Returns the start of the selection, or an invalid TQDateTime if there is no selection or the view doe...
This class represents one day in KOrganizer's month view.
void setPrimary(bool primary)
Set this cell as primary if primary is true.
void removeIncidence(Incidence *)
Removes an incidence from the cell.
void setHolidayString(const TQString &name)
Sets the holiday name to this cell.
void addIncidence(Incidence *incidence, MonthViewCell::CreateItemVisitor &v, int multiDay=0)
Adds an incidence to the cell.
void setHoliday(bool)
Make this cell show as a holiday.
void newEventSignal(ResourceCalendar *res, const TQString &subResource, const TQDate &date)
Notify the view manager that we want to create a new event, so an editor will pop up.
KOMonthView * monthView()
void setDate(const TQDate &)
Sets the date of the cell.