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;
37 class KOMonthCellToolTip :
public TQToolTip
40 KOMonthCellToolTip (TQWidget* parent,
Calendar *calendar,
const TQDate &date, KNoScrollListBox* lv,
MonthViewCell* cl);
43 void maybeTip(
const TQPoint & pos);
48 KNoScrollListBox* eventlist;
53 class KNoScrollListBox:
public TQListBox
58 KNoScrollListBox(TQWidget *parent=0,
const char *name=0);
59 ~KNoScrollListBox() {}
61 void setBackground(
bool primary,
bool workday );
69 void keyPressEvent(TQKeyEvent *);
70 void keyReleaseEvent(TQKeyEvent *);
71 void mousePressEvent(TQMouseEvent *);
72 void resizeEvent(TQResizeEvent *);
73 void contentsMouseDoubleClickEvent( TQMouseEvent * e );
80 class MonthViewItem:
public TQListBoxItem
83 MonthViewItem(
Incidence *,
const TQDateTime &qd,
const TQString & title );
85 void setEvent(
bool on) { mEvent = on; }
86 void setTodo(
bool on) { mTodo = on; }
87 void setTodoDone(
bool on) { mTodoDone = on; }
88 void setRecur(
bool on) { mRecur = on; }
89 void setAlarm(
bool on) { mAlarm = on; }
90 void setReply(
bool on) { mReply = on; }
92 void setPalette(
const TQPalette &p) { mPalette = p; }
93 TQPalette palette()
const {
return mPalette; }
95 Incidence *incidence()
const {
return mIncidence; }
96 TQDateTime incidenceDateTime() {
return mDateTime; }
98 void setResourceColor( TQColor& color ) { mResourceColor = color; }
99 TQColor &resourceColor() {
return mResourceColor; }
101 virtual void paint(TQPainter *);
102 virtual int height(
const TQListBox *)
const;
103 virtual int width(
const TQListBox *)
const;
105 TQColor mResourceColor;
114 TQPixmap mEventPixmap;
115 TQPixmap mBirthdayPixmap;
116 TQPixmap mAnniversaryPixmap;
117 TQPixmap mTodoPixmap;
118 TQPixmap mTodoDonePixmap;
119 TQPixmap mAlarmPixmap;
120 TQPixmap mRecurPixmap;
121 TQPixmap mReplyPixmap;
124 TQDateTime mDateTime;
127 TQColor catColor()
const;
142 class CreateItemVisitor;
145 TQString holidayString( ) {
return mHolidayString; }
148 void setDate(
const TQDate & );
162 void setPrimary(
bool primary );
166 bool isPrimary()
const;
169 void setHoliday(
bool );
175 void setHolidayString(
const TQString &name );
185 void addIncidence(
Incidence *incidence, MonthViewCell::CreateItemVisitor&v,
int multiDay = 0 );
194 void enableScrollBars(
bool );
197 TQDate selectedIncidenceDate();
209 const TQDate &date );
215 void setFrameWidth();
216 void resizeEvent( TQResizeEvent * );
219 void defaultAction( TQListBoxItem * );
220 void contextMenu( TQListBoxItem * );
228 TQString mHolidayString;
231 KNoScrollListBox *mItemList;
237 TQPalette mHolidayPalette;
238 TQPalette mStandardPalette;
239 TQPalette mTodayPalette;
258 virtual int maxDatesHint();
261 virtual int currentDateCount();
264 virtual Incidence::List selectedIncidences();
267 virtual DateList selectedIncidenceDates();
269 virtual TQDateTime selectionStart();
271 virtual TQDateTime selectionEnd();
273 virtual bool eventDurationHint(TQDateTime &startDt, TQDateTime &endDt,
bool &allDay);
276 virtual void updateView();
277 virtual void updateConfig();
278 virtual void showDates(
const TQDate &start,
const TQDate &end);
279 virtual void showIncidences(
const Incidence::List &incidenceList,
const TQDate &date );
281 void changeIncidenceDisplay(
Incidence *,
int);
282 void changeIncidenceDisplayAdded(
Incidence *, MonthViewCell::CreateItemVisitor&);
284 void clearSelection();
287 void showGeneralContextMenu();
292 void processSelectionChange();
295 void resizeEvent(TQResizeEvent *);
298 void updateDayLabels();
301 void showLabel(
bool show );
303 class GetDateVisitor;
309 TQPtrVector<MonthViewCell> mCells;
310 TQMap<TQDate,MonthViewCell *> mDateToCell;
311 TQPtrVector<TQLabel> mDayLabels;
313 bool mShortDayLabels;
314 int mWidthLongDayLabel;
317 TQDate mSelectedDate;
321 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.