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 & );
158 void setPrimary(
bool primary );
162 bool isPrimary()
const;
165 void setHoliday(
bool );
171 void setHolidayString(
const TQString &name );
181 void addIncidence(
Incidence *incidence, MonthViewCell::CreateItemVisitor&v,
int multiDay = 0 );
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;
254 virtual int maxDatesHint();
257 virtual int currentDateCount();
260 virtual Incidence::List selectedIncidences();
263 virtual DateList selectedIncidenceDates();
265 virtual TQDateTime selectionStart();
267 virtual TQDateTime selectionEnd();
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;
KOMonthView * monthView()
The class KOMonthView represents the monthly view in KOrganizer.
KOEventView is the abstract base class from which all other calendar views for event data are derived...
This class represents one day in KOrganizer's month view.