summaryrefslogtreecommitdiffabout
path: root/korganizer/koagendaitem.h
authorzautrix <zautrix>2005-02-23 21:53:18 (UTC)
committer zautrix <zautrix>2005-02-23 21:53:18 (UTC)
commit4a9bf75c2ef12a40be3aea1d147f3703aee48638 (patch) (unidiff)
tree62b2e4d0b63487ff2818c18f8bc1a3233df46e76 /korganizer/koagendaitem.h
parent31f24d21cd23bb7e4033e7ffa000e6c979133ce7 (diff)
downloadkdepimpi-4a9bf75c2ef12a40be3aea1d147f3703aee48638.zip
kdepimpi-4a9bf75c2ef12a40be3aea1d147f3703aee48638.tar.gz
kdepimpi-4a9bf75c2ef12a40be3aea1d147f3703aee48638.tar.bz2
morelayout fixes
Diffstat (limited to 'korganizer/koagendaitem.h') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/koagendaitem.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/korganizer/koagendaitem.h b/korganizer/koagendaitem.h
index 5b8f420..b4dba79 100644
--- a/korganizer/koagendaitem.h
+++ b/korganizer/koagendaitem.h
@@ -14,148 +14,149 @@
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
30class QToolTipGroup; 30class QToolTipGroup;
31class QDragEnterEvent; 31class QDragEnterEvent;
32class QDropEvent; 32class QDropEvent;
33 33
34using namespace KCal; 34using namespace KCal;
35 35
36/* 36/*
37 The KOAgendaItem has to make sure that it receives all mouse events, which are 37 The KOAgendaItem has to make sure that it receives all mouse events, which are
38 to be used for dragging and resizing. That means it has to be installed as 38 to be used for dragging and resizing. That means it has to be installed as
39 eventfiler for its children, if it has children, and it has to pass mouse 39 eventfiler for its children, if it has children, and it has to pass mouse
40 events from the cildren to itself. See eventFilter(). 40 events from the cildren to itself. See eventFilter().
41*/ 41*/
42class KOAgendaItem : public QWidget 42class KOAgendaItem : public QWidget
43{ 43{
44 Q_OBJECT 44 Q_OBJECT
45 public: 45 public:
46 KOAgendaItem(Incidence *incidence, QDate qd, QWidget *parent, bool allday, const char *name=0, 46 KOAgendaItem(Incidence *incidence, QDate qd, QWidget *parent, bool allday, const char *name=0,
47 WFlags f=0 ); 47 WFlags f=0 );
48 ~KOAgendaItem(); 48 ~KOAgendaItem();
49 QString getWhatsThisText(); 49 QString getWhatsThisText();
50 void init ( Incidence *incidence, QDate qd ); 50 void init ( Incidence *incidence, QDate qd );
51 int cellX() { return mCellX; } 51 int cellX() { return mCellX; }
52 int cellXWidth() { return mCellXWidth; } 52 int cellXWidth() { return mCellXWidth; }
53 int cellYTop() { return mCellYTop; } 53 int cellYTop() { return mCellYTop; }
54 int cellYBottom() { return mCellYBottom; } 54 int cellYBottom() { return mCellYBottom; }
55 int cellHeight(); 55 int cellHeight();
56 int cellWidth(); 56 int cellWidth();
57 int subCell() { return mSubCell; } 57 int subCell() { return mSubCell; }
58 int subCells() { return mSubCells; } 58 int subCells() { return mSubCells; }
59 59
60 void setCellXY(int X, int YTop, int YBottom); 60 void setCellXY(int X, int YTop, int YBottom);
61 void setCellY(int YTop, int YBottom); 61 void setCellY(int YTop, int YBottom);
62 void setCellX(int XLeft, int XRight); 62 void setCellX(int XLeft, int XRight);
63 void setCellXWidth(int xwidth); 63 void setCellXWidth(int xwidth);
64 void setSubCell(int subCell); 64 void setSubCell(int subCell);
65 void setSubCells(int subCells); 65 void setSubCells(int subCells);
66 66
67 /** Start movement */ 67 /** Start movement */
68 void startMove(); 68 void startMove();
69 /** Reset to original values */ 69 /** Reset to original values */
70 void resetMove(); 70 void resetMove();
71 71
72 void moveRelative(int dx,int dy); 72 void moveRelative(int dx,int dy);
73 void expandTop(int dy); 73 void expandTop(int dy);
74 void expandBottom(int dy); 74 void expandBottom(int dy);
75 void expandLeft(int dx); 75 void expandLeft(int dx);
76 void expandRight(int dx); 76 void expandRight(int dx);
77 int mLastMoveXPos; 77 int mLastMoveXPos;
78 78
79 void setMultiItem(KOAgendaItem *first,KOAgendaItem *next, 79 void setMultiItem(KOAgendaItem *first,KOAgendaItem *next,
80 KOAgendaItem *last); 80 KOAgendaItem *last);
81 KOAgendaItem *firstMultiItem() { return mFirstMultiItem; } 81 KOAgendaItem *firstMultiItem() { return mFirstMultiItem; }
82 KOAgendaItem *nextMultiItem() { return mNextMultiItem; } 82 KOAgendaItem *nextMultiItem() { return mNextMultiItem; }
83 KOAgendaItem *lastMultiItem() { return mLastMultiItem; } 83 KOAgendaItem *lastMultiItem() { return mLastMultiItem; }
84 84
85 Incidence *incidence() const { return mIncidence; } 85 Incidence *incidence() const { return mIncidence; }
86 QDate itemDate() { return mDate; } 86 QDate itemDate() { return mDate; }
87 87
88 /** Update the date of this item's occurence (not in the event) */ 88 /** Update the date of this item's occurence (not in the event) */
89 void setItemDate(QDate qd); 89 void setItemDate(QDate qd);
90 90
91 void setText ( const QString & text ) { mDisplayedText = text; } 91 void setText ( const QString & text ) { mDisplayedText = text; }
92 QString text () { return mDisplayedText; } 92 QString text () { return mDisplayedText; }
93 93
94 virtual bool eventFilter ( QObject *, QEvent * ); 94 virtual bool eventFilter ( QObject *, QEvent * );
95 95
96 static QToolTipGroup *toolTipGroup(); 96 static QToolTipGroup *toolTipGroup();
97 97
98 QPtrList<KOAgendaItem> conflictItems(); 98 QPtrList<KOAgendaItem> conflictItems();
99 void setConflictItems(QPtrList<KOAgendaItem>); 99 void setConflictItems(QPtrList<KOAgendaItem>);
100 void addConflictItem(KOAgendaItem *ci); 100 void addConflictItem(KOAgendaItem *ci);
101 void paintMe( bool, QPainter* painter = 0 ); 101 void paintMe( bool, QPainter* painter = 0 );
102 void repaintMe(); 102 void repaintMe();
103 static void resizePixmap( int, int ); 103 static void resizePixmap( int, int );
104 static QPixmap * paintPix(); 104 static QPixmap * paintPix();
105 static QPixmap * paintPixSel(); 105 static QPixmap * paintPixSel();
106 static QPixmap * paintPixAllday(); 106 static QPixmap * paintPixAllday();
107 void updateItem(); 107 void updateItem();
108 void computeText(); 108 void computeText();
109 void recreateIncidence(); 109 void recreateIncidence();
110 bool checkLayout();
110 public slots: 111 public slots:
111 bool updateIcons( QPainter *, bool ); 112 bool updateIcons( QPainter *, bool );
112 void select(bool=true); 113 void select(bool=true);
113 114
114 protected: 115 protected:
115 void dragEnterEvent(QDragEnterEvent *e); 116 void dragEnterEvent(QDragEnterEvent *e);
116 void dropEvent(QDropEvent *e); 117 void dropEvent(QDropEvent *e);
117 void paintEvent ( QPaintEvent * ); 118 void paintEvent ( QPaintEvent * );
118 void resizeEvent ( QResizeEvent *ev ); 119 void resizeEvent ( QResizeEvent *ev );
119 120
120 private: 121 private:
121 bool mAllDay; 122 bool mAllDay;
122 int mCellX; 123 int mCellX;
123 int mCellXWidth; 124 int mCellXWidth;
124 int mCellYTop,mCellYBottom; 125 int mCellYTop,mCellYBottom;
125 int mSubCell; // subcell number of this item 126 int mSubCell; // subcell number of this item
126 int mSubCells; // Total number of subcells in cell of this item 127 int mSubCells; // Total number of subcells in cell of this item
127 int xPaintCoord; 128 int xPaintCoord;
128 int yPaintCoord; 129 int yPaintCoord;
129 int wPaintCoord; 130 int wPaintCoord;
130 int hPaintCoord; 131 int hPaintCoord;
131 // Variables to remember start position 132 // Variables to remember start position
132 int mStartCellX; 133 int mStartCellX;
133 int mStartCellXWidth; 134 int mStartCellXWidth;
134 int mStartCellYTop,mStartCellYBottom; 135 int mStartCellYTop,mStartCellYBottom;
135 int mLastMovePos; 136 int mLastMovePos;
136 137
137 // Multi item pointers 138 // Multi item pointers
138 KOAgendaItem *mFirstMultiItem; 139 KOAgendaItem *mFirstMultiItem;
139 KOAgendaItem *mNextMultiItem; 140 KOAgendaItem *mNextMultiItem;
140 KOAgendaItem *mLastMultiItem; 141 KOAgendaItem *mLastMultiItem;
141 142
142 int mFontPixelSize; 143 int mFontPixelSize;
143 Incidence *mIncidence; // corresponding event or todo 144 Incidence *mIncidence; // corresponding event or todo
144 QDate mDate; //date this events occurs (for recurrence) 145 QDate mDate; //date this events occurs (for recurrence)
145 //void showIcon( QLabel*, int ); 146 //void showIcon( QLabel*, int );
146 //QLabel *mTodoIconLabel; 147 //QLabel *mTodoIconLabel;
147 //QLabel *mItemLabel; 148 //QLabel *mItemLabel;
148 //QWidget *mIconBox; 149 //QWidget *mIconBox;
149 //QLabel *mIconAlarm,*mIconRecur,*mIconReadonly; 150 //QLabel *mIconAlarm,*mIconRecur,*mIconReadonly;
150 //QLabel *mIconReply,*mIconGroup,*mIconOrganizer; 151 //QLabel *mIconReply,*mIconGroup,*mIconOrganizer;
151 //QLabel *mIconMoreInfo; 152 //QLabel *mIconMoreInfo;
152 static QToolTipGroup *mToolTipGroup; 153 static QToolTipGroup *mToolTipGroup;
153 154
154 QColor mBackgroundColor; 155 QColor mBackgroundColor;
155 QColorGroup mColorGroup; 156 QColorGroup mColorGroup;
156 QString mDisplayedText; 157 QString mDisplayedText;
157 bool mSelected; 158 bool mSelected;
158 QPtrList<KOAgendaItem> mConflictItems; 159 QPtrList<KOAgendaItem> mConflictItems;
159}; 160};
160 161
161#endif // KOAGENDAITEM_H 162#endif // KOAGENDAITEM_H