-rw-r--r-- | korganizer/koagendaitem.h | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/korganizer/koagendaitem.h b/korganizer/koagendaitem.h index dc2316a..7103abe 100644 --- a/korganizer/koagendaitem.h +++ b/korganizer/koagendaitem.h | |||
@@ -10,157 +10,156 @@ | |||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | */ | 18 | */ |
19 | #ifndef KOAGENDAITEM_H | 19 | #ifndef KOAGENDAITEM_H |
20 | #define KOAGENDAITEM_H | 20 | #define KOAGENDAITEM_H |
21 | 21 | ||
22 | #include <qframe.h> | 22 | #include <qframe.h> |
23 | #include <qlabel.h> | 23 | #include <qlabel.h> |
24 | #include <qpixmap.h> | 24 | #include <qpixmap.h> |
25 | #include <qdatetime.h> | 25 | #include <qdatetime.h> |
26 | #include <qpalette.h> | 26 | #include <qpalette.h> |
27 | 27 | ||
28 | #include <libkcal/incidence.h> | 28 | #include <libkcal/incidence.h> |
29 | 29 | ||
30 | class KOAgendaItemWhatsThis; | 30 | class KOAgendaItemWhatsThis; |
31 | class QToolTipGroup; | 31 | class QToolTipGroup; |
32 | class QDragEnterEvent; | 32 | class QDragEnterEvent; |
33 | class QDropEvent; | 33 | class QDropEvent; |
34 | 34 | ||
35 | using namespace KCal; | 35 | using namespace KCal; |
36 | 36 | ||
37 | /* | 37 | /* |
38 | The KOAgendaItem has to make sure that it receives all mouse events, which are | 38 | The KOAgendaItem has to make sure that it receives all mouse events, which are |
39 | to be used for dragging and resizing. That means it has to be installed as | 39 | to be used for dragging and resizing. That means it has to be installed as |
40 | eventfiler for its children, if it has children, and it has to pass mouse | 40 | eventfiler for its children, if it has children, and it has to pass mouse |
41 | events from the cildren to itself. See eventFilter(). | 41 | events from the cildren to itself. See eventFilter(). |
42 | */ | 42 | */ |
43 | class KOAgendaItem : public QWidget | 43 | class KOAgendaItem : public QWidget |
44 | { | 44 | { |
45 | Q_OBJECT | 45 | Q_OBJECT |
46 | public: | 46 | public: |
47 | KOAgendaItem(Incidence *incidence, QDate qd, QWidget *parent, bool allday, const char *name=0, | 47 | KOAgendaItem(Incidence *incidence, QDate qd, QWidget *parent, bool allday, const char *name=0, |
48 | WFlags f=0 ); | 48 | WFlags f=0 ); |
49 | ~KOAgendaItem(); | 49 | ~KOAgendaItem(); |
50 | QString getWhatsThisText(); | 50 | QString getWhatsThisText(); |
51 | void init ( Incidence *incidence, QDate qd ); | 51 | void init ( Incidence *incidence, QDate qd ); |
52 | int cellX() { return mCellX; } | 52 | int cellX() { return mCellX; } |
53 | int cellXWidth() { return mCellXWidth; } | 53 | int cellXWidth() { return mCellXWidth; } |
54 | int cellYTop() { return mCellYTop; } | 54 | int cellYTop() { return mCellYTop; } |
55 | int cellYBottom() { return mCellYBottom; } | 55 | int cellYBottom() { return mCellYBottom; } |
56 | int cellHeight(); | 56 | int cellHeight(); |
57 | int cellWidth(); | 57 | int cellWidth(); |
58 | int subCell() { return mSubCell; } | 58 | int subCell() { return mSubCell; } |
59 | int subCells() { return mSubCells; } | 59 | int subCells() { return mSubCells; } |
60 | 60 | ||
61 | void setCellXY(int X, int YTop, int YBottom); | 61 | void setCellXY(int X, int YTop, int YBottom); |
62 | void setCellY(int YTop, int YBottom); | 62 | void setCellY(int YTop, int YBottom); |
63 | void setCellX(int XLeft, int XRight); | 63 | void setCellX(int XLeft, int XRight); |
64 | void setCellXWidth(int xwidth); | 64 | void setCellXWidth(int xwidth); |
65 | void setSubCell(int subCell); | 65 | void setSubCell(int subCell); |
66 | void setSubCells(int subCells); | 66 | void setSubCells(int subCells); |
67 | 67 | ||
68 | /** Start movement */ | 68 | /** Start movement */ |
69 | void startMove(); | 69 | void startMove(); |
70 | /** Reset to original values */ | 70 | /** Reset to original values */ |
71 | void resetMove(); | 71 | void resetMove(); |
72 | 72 | ||
73 | void moveRelative(int dx,int dy); | 73 | void moveRelative(int dx,int dy); |
74 | void expandTop(int dy); | 74 | void expandTop(int dy); |
75 | void expandBottom(int dy); | 75 | void expandBottom(int dy); |
76 | void expandLeft(int dx); | 76 | void expandLeft(int dx); |
77 | void expandRight(int dx); | 77 | void expandRight(int dx); |
78 | int mLastMoveXPos; | 78 | int mLastMoveXPos; |
79 | 79 | ||
80 | void setMultiItem(KOAgendaItem *first,KOAgendaItem *next, | 80 | void setMultiItem(KOAgendaItem *first,KOAgendaItem *next, |
81 | KOAgendaItem *last); | 81 | KOAgendaItem *last); |
82 | KOAgendaItem *firstMultiItem() { return mFirstMultiItem; } | 82 | KOAgendaItem *firstMultiItem() { return mFirstMultiItem; } |
83 | KOAgendaItem *nextMultiItem() { return mNextMultiItem; } | 83 | KOAgendaItem *nextMultiItem() { return mNextMultiItem; } |
84 | KOAgendaItem *lastMultiItem() { return mLastMultiItem; } | 84 | KOAgendaItem *lastMultiItem() { return mLastMultiItem; } |
85 | 85 | ||
86 | Incidence *incidence() const { return mIncidence; } | 86 | Incidence *incidence() const { return mIncidence; } |
87 | QDate itemDate() { return mDate; } | 87 | QDate itemDate() { return mDate; } |
88 | 88 | ||
89 | /** Update the date of this item's occurence (not in the event) */ | 89 | /** Update the date of this item's occurence (not in the event) */ |
90 | void setItemDate(QDate qd); | 90 | void setItemDate(QDate qd); |
91 | 91 | ||
92 | void setText ( const QString & text ) { mDisplayedText = text; } | 92 | void setText ( const QString & text ) { mDisplayedText = text; } |
93 | QString text () { return mDisplayedText; } | 93 | QString text () { return mDisplayedText; } |
94 | 94 | ||
95 | virtual bool eventFilter ( QObject *, QEvent * ); | 95 | virtual bool eventFilter ( QObject *, QEvent * ); |
96 | 96 | ||
97 | static QToolTipGroup *toolTipGroup(); | 97 | static QToolTipGroup *toolTipGroup(); |
98 | 98 | ||
99 | QPtrList<KOAgendaItem> conflictItems(); | 99 | QPtrList<KOAgendaItem> conflictItems(); |
100 | void setConflictItems(QPtrList<KOAgendaItem>); | 100 | void setConflictItems(QPtrList<KOAgendaItem>); |
101 | void addConflictItem(KOAgendaItem *ci); | 101 | void addConflictItem(KOAgendaItem *ci); |
102 | void paintMe( bool, QPainter* painter = 0 ); | 102 | void paintMe( bool, QPainter* painter = 0 ); |
103 | void repaintMe(); | 103 | void repaintMe(); |
104 | static void resizePixmap( int, int ); | 104 | static void resizePixmap( int, int ); |
105 | static QPixmap * paintPix(); | 105 | static QPixmap * paintPix(); |
106 | static QPixmap * paintPixSel(); | ||
107 | static QPixmap * paintPixAllday(); | 106 | static QPixmap * paintPixAllday(); |
108 | void updateItem(); | 107 | void updateItem(); |
109 | void computeText(); | 108 | void computeText(); |
110 | void recreateIncidence(); | 109 | void recreateIncidence(); |
111 | bool checkLayout(); | 110 | bool checkLayout(); |
112 | void initColor (); | 111 | void initColor (); |
113 | public slots: | 112 | public slots: |
114 | bool updateIcons( QPainter *, bool ); | 113 | bool updateIcons( QPainter *, bool ); |
115 | void select(bool=true); | 114 | void select(bool=true); |
116 | 115 | ||
117 | protected: | 116 | protected: |
118 | void dragEnterEvent(QDragEnterEvent *e); | 117 | void dragEnterEvent(QDragEnterEvent *e); |
119 | void dropEvent(QDropEvent *e); | 118 | void dropEvent(QDropEvent *e); |
120 | void paintEvent ( QPaintEvent * ); | 119 | void paintEvent ( QPaintEvent * ); |
121 | void resizeEvent ( QResizeEvent *ev ); | 120 | void resizeEvent ( QResizeEvent *ev ); |
122 | 121 | ||
123 | private: | 122 | private: |
124 | KOAgendaItemWhatsThis* mKOAgendaItemWhatsThis; | 123 | KOAgendaItemWhatsThis* mKOAgendaItemWhatsThis; |
125 | bool mAllDay; | 124 | bool mAllDay; |
126 | bool mWhiteText; | 125 | bool mWhiteText; |
127 | int mCellX; | 126 | int mCellX; |
128 | int mCellXWidth; | 127 | int mCellXWidth; |
129 | int mCellYTop,mCellYBottom; | 128 | int mCellYTop,mCellYBottom; |
130 | int mSubCell; // subcell number of this item | 129 | int mSubCell; // subcell number of this item |
131 | int mSubCells; // Total number of subcells in cell of this item | 130 | int mSubCells; // Total number of subcells in cell of this item |
132 | int xPaintCoord; | 131 | int xPaintCoord; |
133 | int yPaintCoord; | 132 | int yPaintCoord; |
134 | int wPaintCoord; | 133 | int wPaintCoord; |
135 | int hPaintCoord; | 134 | int hPaintCoord; |
136 | // Variables to remember start position | 135 | // Variables to remember start position |
137 | int mStartCellX; | 136 | int mStartCellX; |
138 | int mStartCellXWidth; | 137 | int mStartCellXWidth; |
139 | int mStartCellYTop,mStartCellYBottom; | 138 | int mStartCellYTop,mStartCellYBottom; |
140 | int mLastMovePos; | 139 | int mLastMovePos; |
141 | 140 | ||
142 | // Multi item pointers | 141 | // Multi item pointers |
143 | KOAgendaItem *mFirstMultiItem; | 142 | KOAgendaItem *mFirstMultiItem; |
144 | KOAgendaItem *mNextMultiItem; | 143 | KOAgendaItem *mNextMultiItem; |
145 | KOAgendaItem *mLastMultiItem; | 144 | KOAgendaItem *mLastMultiItem; |
146 | 145 | ||
147 | int mFontPixelSize; | 146 | int mFontPixelSize; |
148 | Incidence *mIncidence; // corresponding event or todo | 147 | Incidence *mIncidence; // corresponding event or todo |
149 | QDate mDate; //date this events occurs (for recurrence) | 148 | QDate mDate; //date this events occurs (for recurrence) |
150 | //void showIcon( QLabel*, int ); | 149 | //void showIcon( QLabel*, int ); |
151 | //QLabel *mTodoIconLabel; | 150 | //QLabel *mTodoIconLabel; |
152 | //QLabel *mItemLabel; | 151 | //QLabel *mItemLabel; |
153 | //QWidget *mIconBox; | 152 | //QWidget *mIconBox; |
154 | //QLabel *mIconAlarm,*mIconRecur,*mIconReadonly; | 153 | //QLabel *mIconAlarm,*mIconRecur,*mIconReadonly; |
155 | //QLabel *mIconReply,*mIconGroup,*mIconOrganizer; | 154 | //QLabel *mIconReply,*mIconGroup,*mIconOrganizer; |
156 | //QLabel *mIconMoreInfo; | 155 | //QLabel *mIconMoreInfo; |
157 | static QToolTipGroup *mToolTipGroup; | 156 | static QToolTipGroup *mToolTipGroup; |
158 | 157 | ||
159 | QColor mBackgroundColor; | 158 | QColor mBackgroundColor; |
160 | QColorGroup mColorGroup; | 159 | QColorGroup mColorGroup; |
161 | QString mDisplayedText; | 160 | QString mDisplayedText; |
162 | bool mSelected; | 161 | bool mSelected; |
163 | QPtrList<KOAgendaItem> mConflictItems; | 162 | QPtrList<KOAgendaItem> mConflictItems; |
164 | }; | 163 | }; |
165 | 164 | ||
166 | #endif // KOAGENDAITEM_H | 165 | #endif // KOAGENDAITEM_H |