25 #ifndef KOAGENDAITEM_H
26 #define KOAGENDAITEM_H
30 #include <tqdatetime.h>
33 class TQDragEnterEvent;
45 int mStartCellXLeft, mStartCellXRight;
46 int mStartCellYTop, mStartCellYBottom;
47 KOAgendaItem *mFirstMultiItem;
48 KOAgendaItem *mPrevMultiItem;
49 KOAgendaItem *mNextMultiItem;
50 KOAgendaItem *mLastMultiItem;
75 class KOAgendaItem :
public TQWidget,
public KOrg::CellItem
82 int itemPos,
int itemCount,
83 const char *name = 0, WFlags f = 0 );
85 int cellXLeft()
const {
return mCellXLeft; }
86 int cellXRight()
const {
return mCellXRight; }
87 int cellYTop()
const {
return mCellYTop; }
88 int cellYBottom()
const {
return mCellYBottom; }
89 int cellHeight()
const;
90 int cellWidth()
const;
92 int itemPos()
const {
return mItemPos; }
93 int itemCount()
const {
return mItemCount; }
95 void setCellXY(
int X,
int YTop,
int YBottom);
96 void setCellY(
int YTop,
int YBottom);
97 void setCellX(
int XLeft,
int XRight);
98 void setCellXRight(
int xright);
107 void moveRelative(
int dx,
int dy);
108 void expandTop(
int dy);
109 void expandBottom(
int dy);
110 void expandLeft(
int dx);
111 void expandRight(
int dx);
114 KOAgendaItem *prevMoveItem()
const {
return (mStartMoveInfo)?(mStartMoveInfo->mPrevMultiItem):0; }
115 KOAgendaItem *nextMoveItem()
const {
return (mStartMoveInfo)?(mStartMoveInfo->mNextMultiItem):0; }
116 MultiItemInfo *moveInfo()
const {
return mStartMoveInfo; }
117 void setMultiItem(KOAgendaItem *first,KOAgendaItem *prev,
118 KOAgendaItem *next, KOAgendaItem *last);
119 KOAgendaItem *prependMoveItem(KOAgendaItem*);
120 KOAgendaItem *appendMoveItem(KOAgendaItem*);
121 KOAgendaItem *removeMoveItem(KOAgendaItem*);
122 KOAgendaItem *firstMultiItem()
const {
return (mMultiItemInfo)?(mMultiItemInfo->mFirstMultiItem):0; }
123 KOAgendaItem *prevMultiItem()
const {
return (mMultiItemInfo)?(mMultiItemInfo->mPrevMultiItem):0; }
124 KOAgendaItem *nextMultiItem()
const {
return (mMultiItemInfo)?(mMultiItemInfo->mNextMultiItem):0; }
125 KOAgendaItem *lastMultiItem()
const {
return (mMultiItemInfo)?(mMultiItemInfo->mLastMultiItem):0; }
127 bool dissociateFromMultiItem();
130 Incidence *incidence()
const {
return mIncidence; }
131 TQDate itemDate() {
return mDate; }
134 void setItemDate(
const TQDate &qd );
136 void setText (
const TQString & text ) { mLabelText = text; }
137 TQString text () {
return mLabelText; }
139 static TQToolTipGroup *toolTipGroup();
141 TQPtrList<KOAgendaItem> conflictItems();
142 void setConflictItems(TQPtrList<KOAgendaItem>);
143 void addConflictItem(KOAgendaItem *ci);
145 TQString label()
const;
147 bool overlaps( KOrg::CellItem * )
const;
149 void setResourceColor(
const TQColor& color ) { mResourceColor = color; }
150 TQColor resourceColor() {
return mResourceColor;}
152 void removeAgendaItem( KOAgendaItem* );
153 void showAgendaItem( KOAgendaItem* );
157 void select(
bool=
true);
158 void addAttendee(
const TQString & );
161 void dragEnterEvent(TQDragEnterEvent *e);
162 void dropEvent(TQDropEvent *e);
163 void paintEvent(TQPaintEvent *e);
164 void paintFrame(TQPainter *p,
const TQColor &color);
165 void paintEventIcon(TQPainter *p,
int &x,
int ft);
166 void paintTodoIcon(TQPainter *p,
int &x,
int ft);
167 void paintAlarmIcon(TQPainter *p,
int &x,
int ft);
170 void paintIcons(TQPainter *p,
int &x,
int ft);
175 void startMovePrivate();
176 void resetMovePrivate();
177 void endMovePrivate();
181 int mCellXLeft, mCellXRight;
182 int mCellYTop, mCellYBottom;
188 bool mIconAlarm, mIconRecur, mIconReadonly;
189 bool mIconReply, mIconGroup, mIconGroupTentative;
190 bool mIconOrganizer, mSpecialEvent;
198 MultiItemInfo* mMultiItemInfo;
201 MultiItemInfo* mStartMoveInfo;
203 TQColor mResourceColor;
205 static TQToolTipGroup *mToolTipGroup;
208 TQPtrList<KOAgendaItem> mConflictItems;
210 static TQPixmap *alarmPxmp;
211 static TQPixmap *recurPxmp;
212 static TQPixmap *readonlyPxmp;
213 static TQPixmap *replyPxmp;
214 static TQPixmap *groupPxmp;
215 static TQPixmap *groupPxmpTentative;
216 static TQPixmap *organizerPxmp;