korganizer Library API Documentation

kodaymatrix.h

00001 /* 00002 This file is part of KOrganizer. 00003 00004 Copyright (c) 2001 Eitzenberger Thomas <thomas.eitzenberger@siemens.at> 00005 Copyright (c) 2003 Cornelius Schumacher <schumacher@kde.org> 00006 00007 This program is free software; you can redistribute it and/or modify 00008 it under the terms of the GNU General Public License as published by 00009 the Free Software Foundation; either version 2 of the License, or 00010 (at your option) any later version. 00011 00012 This program is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with this program; if not, write to the Free Software 00019 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00020 00021 As a special exception, permission is given to link this program 00022 with any edition of Qt, and distribute the resulting executable, 00023 without including the source code for Qt in the source distribution. 00024 */ 00025 #ifndef KODAYMATRIX_H 00026 #define KODAYMATRIX_H 00027 00028 #include <libkcal/incidencebase.h> 00029 00030 #include <qframe.h> 00031 #include <qcolor.h> 00032 #include <qtooltip.h> 00033 #include <qmap.h> 00034 00035 class QDragEnterEvent; 00036 class QDragMoveEvent; 00037 class QDragLeaveEvent; 00038 class QDropEvent; 00039 00040 class KODayMatrix; 00041 00042 namespace KCal { 00043 class Incidence; 00044 class Calendar; 00045 } 00046 using namespace KCal; 00047 00048 00054 class DynamicTip : public QToolTip 00055 { 00056 public: 00062 DynamicTip( QWidget *parent ); 00063 00064 protected: 00071 void maybeTip( const QPoint &pos ); 00072 00073 private: 00075 KODayMatrix *mMatrix; 00076 }; 00077 00103 class KODayMatrix: public QFrame 00104 { 00105 Q_OBJECT 00106 public: 00116 KODayMatrix( QWidget *parent, const char *name ); 00117 00120 ~KODayMatrix(); 00121 00126 void setCalendar( Calendar * ); 00127 00135 void updateView( QDate actdate ); 00136 00141 void updateEvents(); 00142 00146 const QDate& getDate( int offset ); 00147 00151 QString getHolidayLabel( int offset ); 00152 00156 void addSelectedDaysTo( DateList & ); 00157 00162 void setSelectedDaysFrom( const QDate &start, const QDate &end ); 00163 00167 void clearSelection(); 00168 00172 bool isTodayVisible() const { return mToday >= 0; } 00173 00180 bool isBeginningOfMonth() const { return mToday <= 8; } 00181 bool isEndOfMonth() const { return mToday >= 27; } 00182 00183 public slots: 00187 void updateView(); 00188 00193 void recalculateToday(); 00194 00195 signals: 00201 void selected( const KCal::DateList &daylist ); 00202 00207 void incidenceDropped( Incidence * ); 00213 void incidenceDroppedMove( Incidence *oldincidence, Incidence *newincidence ); 00214 00215 protected: 00216 void paintEvent( QPaintEvent *ev ); 00217 00218 void mousePressEvent( QMouseEvent *e ); 00219 00220 void mouseReleaseEvent( QMouseEvent *e ); 00221 00222 void mouseMoveEvent( QMouseEvent *e ); 00223 00224 void dragEnterEvent( QDragEnterEvent * ); 00225 00226 void dragMoveEvent( QDragMoveEvent * ); 00227 00228 void dragLeaveEvent( QDragLeaveEvent * ); 00229 00230 void dropEvent( QDropEvent * ); 00231 00232 void resizeEvent( QResizeEvent * ); 00233 00234 private: 00240 int getDayIndexFrom( int x, int y ); 00241 00247 QColor getShadedColor( QColor color ); 00248 00251 static const int NUMDAYS; 00252 00254 Calendar *mCalendar; 00255 00257 QDate mStartDate; 00258 00260 QString *mDayLabels; 00261 00264 QDate *mDays; 00265 00269 int *mEvents; 00270 00272 QMap<int,QString> mHolidays; 00273 00275 int mToday; 00276 00279 int mSelInit; 00280 00283 static const int NOSELECTION; 00284 00286 int mSelStart; 00287 00289 int mSelEnd; 00290 00292 DynamicTip* mToolTip; 00293 00294 00296 QColor mDefaultBackColor; 00297 00299 QColor mDefaultTextColor; 00300 00302 QColor mDefaultTextColorShaded; 00303 00305 QColor mHolidayColorShaded; 00306 00308 QColor mSelectedDaysColor; 00309 00311 int mTodayMarginWidth; 00312 00316 QRect mDaySize; 00317 }; 00318 00319 #endif
KDE Logo
This file is part of the documentation for korganizer Library Version 3.3.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Aug 27 12:53:22 2004 by doxygen 1.3.8 written by Dimitri van Heesch, © 1997-2003