• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdepim
  • Sitemap
  • Contact Us
 

kdgantt1

KDGanttViewSubwidgets.h

Go to the documentation of this file.
00001 /* -*- Mode: C++ -*-
00002    $Id: KDGanttViewSubwidgets.h 836291 2008-07-22 04:34:42Z pradeepto $
00003    KDGantt - a multi-platform charting engine
00004 */
00005 
00006 /****************************************************************************
00007  ** Copyright (C)  2002-2004 Klarälvdalens Datakonsult AB.  All rights reserved.
00008  **
00009  ** This file is part of the KDGantt library.
00010  **
00011  ** This file may be used under the terms of the GNU General Public
00012  ** License versions 2.0 or 3.0 as published by the Free Software
00013  ** Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3
00014  ** included in the packaging of this file.  Alternatively you may (at
00015  ** your option) use any later version of the GNU General Public
00016  ** License if such license has been publicly approved by
00017  ** Klarälvdalens Datakonsult AB (or its successors, if any).
00018  ** 
00019  ** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
00020  ** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
00021  ** A PARTICULAR PURPOSE. Klarälvdalens Datakonsult AB reserves all rights
00022  ** not expressly granted herein.
00023  ** 
00024  ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00025  ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00026  **
00027  ** As a special exception, permission is given to link this program
00028  ** with any edition of Qt, and distribute the resulting executable,
00029  ** without including the source code for Qt in the source distribution.
00030  **
00031  **********************************************************************/
00032 
00033 
00034 #ifndef KDGANTTVIEWSUBWIDGETS_H
00035 #define KDGANTTVIEWSUBWIDGETS_H
00036 
00037 
00038 #include <QWidget>
00039 #include <QSplitter>
00040 #include <QEvent>
00041 #include <QWhatsThis>
00042 #include <QTimer>
00043 #include <QLayout>
00044 #include <QLabel>
00045 #include <QBrush>
00046 
00047 #include "kdgantt_qt3_compat.h"
00048 
00049 
00050 #include "KDGanttView.h"
00051 #include "KDGanttViewTaskLink.h"
00052 #include "KDGanttViewTaskLinkGroup.h"
00053 #include "KDGanttViewSummaryItem.h"
00054 #include "KDGanttSemiSizingControl.h"
00055 #include "KDGanttViewItemDrag.h"
00056 
00057 #define Type_is_KDGanttGridItem 1
00058 #define Type_is_KDGanttViewItem 2
00059 #define Type_is_KDGanttTaskLink 3
00060 
00061 class KDIntervalColorRectangle;
00062 class KDCanvasWhatsThis;
00063 class KDCanvasRectangle;
00064 class KDTimeHeaderToolTip;
00065 class KActionCollection;
00066 class KSelectAction;
00067 
00068 class KDTimeHeaderWidget : public QWidget
00069 {
00070    Q_OBJECT
00071 
00072 public:
00073    typedef KDGanttView::Scale Scale;
00074    typedef KDGanttView::YearFormat YearFormat;
00075    typedef KDGanttView::HourFormat HourFormat;
00076    typedef KDGanttView::ShowTicksType ShowTicksType;
00077    struct DateTimeColor {
00078      QDateTime datetime;
00079      QDateTime end;
00080      QColor color;
00081      Scale minScaleView;
00082      Scale maxScaleView;
00083      //KDCanvasLine* canvasLine;
00084      KDCanvasRectangle* canvasRect;
00085        int priority;
00086    };
00087    typedef QValueList<DateTimeColor> ColumnColorList;
00088    typedef QValueList<KDIntervalColorRectangle *> IntervalColorList;
00089    /*
00090      enum Scale { Minute, Hour, Day, Week, Month, Auto };
00091      enum YearFormat { FourDigit, TwoDigit, TwoDigitApostrophe };
00092      enum HourFormat { Hour_24, Hour_12 };
00093    */
00094 
00095    KDTimeHeaderWidget (QWidget* parent,KDGanttView* gant);
00096   ~KDTimeHeaderWidget();
00097 
00098    QString getToolTipText(QPoint p);
00099    void zoomToFit();
00100    void zoom(double, bool absolute = true);
00101    void zoomToSelection( const QDateTime& startTime, const QDateTime &endTime);
00102    void performZoomToSelection( const QDateTime& startTime, const QDateTime &endTime);
00103    void zoomToSelectionAndSetStartEnd( const QDateTime &start, const QDateTime &end);
00104    double zoomFactor();
00105    void setAutoScaleMinorTickCount( int count );
00106    int autoScaleMinorTickCount();
00107    void setHorizonStart( const QDateTime& start );
00108    QDateTime horizonStart() const;
00109    void setHorizonEnd( const QDateTime& start );
00110    QDateTime horizonEnd() const;
00111 
00112    void setMaximumScale( Scale );
00113    KDTimeHeaderWidget::Scale maximumScale() const;
00114    void setMinimumScale( Scale );
00115    KDTimeHeaderWidget::Scale minimumScale() const;
00116    KDTimeHeaderWidget::Scale scale() const;
00117    void setMajorScaleCount( int count );
00118    int majorScaleCount() const;
00119    void setMinorScaleCount( int count );
00120    int minorScaleCount() const;
00121    void setMinimumColumnWidth( int width );
00122    int minimumColumnWidth() const;
00123    void setYearFormat( YearFormat format );
00124    YearFormat yearFormat() const;
00125    void setHourFormat( HourFormat format );
00126    HourFormat hourFormat() const;
00127    void setShowTicks( ShowTicksType show = KDGanttView::ShowMajorTicks );
00128    ShowTicksType showTicks() const;
00129    void setScale( Scale unit, bool update = true );
00130    void setColumnBackgroundColor( const QDateTime& column,
00131                   const QColor& color,
00132                   Scale mini =  KDGanttView::Second ,
00133                   Scale maxi =  KDGanttView::Month);
00134 #if 0
00135    // This API has been replaced with KDIntervalColorRectangle and addIntervalBackgroundColor
00136     void setIntervalBackgroundColor( const QDateTime& start,
00137                                      const QDateTime& end,
00138                                      const QColor& color,
00139                                      int priority = 0,
00140                                      Scale mini =  KDGanttView::Second ,
00141                                      Scale maxi =  KDGanttView::Month);
00142    bool changeBackgroundInterval( const QDateTime& oldstart,
00143                   const QDateTime& oldend,
00144                   const QDateTime& newstart,
00145                   const QDateTime& newend );
00146    bool deleteBackgroundInterval( const QDateTime& start,
00147                   const QDateTime& end );
00148 #endif
00149    void addIntervalBackgroundColor( KDIntervalColorRectangle* newItem );
00150    void clearBackgroundColor();
00151    QColor columnBackgroundColor( const QDateTime& column ) const;
00152    void setWeekendBackgroundColor( const QColor& color );
00153    QColor weekendBackgroundColor() const;
00154    void setWeekdayBackgroundColor( const QColor& color, int weekday );
00155    QColor weekdayBackgroundColor(int weekday) const;
00156    void setWeekendDays( int start, int end );
00157    void weekendDays( int& start, int& end ) const;
00158    void computeTicks(bool doNotComputeRealScale = false);
00159    void paintEvent(QPaintEvent *);
00160    int getCoordX(QDate);
00161    int getCoordX(QDateTime);
00162    QDateTime getDateTimeForIndex(int coordX, bool local = true );
00163    void setShowPopupMenu( bool show, bool showZoom, bool showScale,bool showTime,
00164                           bool showYear,bool showGrid, bool showPrint);
00165    bool registerStartTime();
00166    bool registerEndTime();
00167    bool showPopupMenu() const;
00168    ColumnColorList columnBackgroundColorList() const {
00169       return ccList;
00170     }
00171    IntervalColorList intervalBackgroundColorList() const {
00172       return icList;
00173    }
00174    QColor weekdayColor[8];
00175    void repaintMe(int left, int wid, QPainter *p = 0);
00176 
00177     void centerDateTime( const QDateTime& center, bool changeHorizon = false );
00178 
00179     void setTooltipDateTimeFormat( const QString& fmt );
00180     const QString tooltipDateTimeFormat();
00181 
00182     const QString dateFormatMonth();
00183     void setDateFormatMonth( const QString& fmt );
00184     const QString dateFormatWeek();
00185     void setDateFormatWeek( const QString& fmt );
00186     const QString dateFormatDay();
00187     void setDateFormatDay( const QString& fmt );
00188     const QString datetimeFormatHour();
00189     void setDatetimeFormatHour( const QString& fmt );
00190     const QString datetimeFormatMinute();
00191     void setDatetimeFormatMinute( const QString& fmt );
00192     const QString datetimeFormatSecond();
00193     void setDatetimeFormatSecond( const QString& fmt );
00194 
00195     void setWeekStartsMonday( bool b );
00196     bool weekStartsMonday();
00197     void setWeekScaleShowNumber( bool b );
00198     bool weekScaleShowNumber();
00199 
00200     QDate yesterday() const;
00201     QDate today() const;
00202     QDate tomorrow() const;
00203     QDate currentWeek() const;
00204     QDate lastWeek() const;
00205     QDate currentMonth() const;
00206     QDate lastMonth() const;
00207     QDate currentYear() const;
00208     QDate lastYear() const;
00209 
00210     void pendingPaint();
00211 
00212 public slots:
00213     void checkWidth( int );
00214     void addTickRight( int num = 1 );
00215     void addTickLeft( int num = 1 );
00216     void preparePopupMenu();
00217 
00218     void center(const QDate &dt);
00219     void centerToday() { center(today()); }
00220     void centerYesterday() { center(yesterday()); }
00221     void centerCurrentWeek() { center(currentWeek()); }
00222     void centerLastWeek() { center(lastWeek()); }
00223     void centerCurrentMonth() { center(currentMonth()); }
00224     void centerLastMonth() { center(lastMonth()); }
00225     void centerCurrentYear() { center(currentYear()); }
00226     void centerLastYear() { center(lastYear()); }
00227 
00228     void zoomTo( Scale unit, const QDate &start, const QDate &end );
00229     void showToday() { zoomTo( KDGanttView::Hour, today(), tomorrow() ); }
00230     void showYesterday() { zoomTo( KDGanttView::Hour, yesterday(), today() ); }
00231     void showCurrentWeek() { zoomTo( KDGanttView::Day, currentWeek(), currentWeek().addDays( 7 ) ); }
00232     void showLastWeek() { zoomTo( KDGanttView::Day, lastWeek(), currentWeek() ); }
00233     void showCurrentMonth() { zoomTo( KDGanttView::Day, currentMonth(), currentMonth().addMonths( 1) ); }
00234     void showLastMonth() { zoomTo( KDGanttView::Day, lastMonth(), currentMonth() ); }
00235     void showCurrentYear() { zoomTo( KDGanttView::Month, currentYear(), currentYear().addYears( 1) ); }
00236     void showLastYear() { zoomTo( KDGanttView::Month, lastYear(), currentYear() ); }
00237 
00238     void zoom1() { zoom(1.0); }
00239     void zoom2() { zoom(2.0,false); }
00240     void zoomOut2() { zoom(0.5,false); }
00241     void zoom6() { zoom(6.0,false); }
00242     void zoomOut6() { zoom(0.16666,false); }
00243     void zoom12() { zoom(12.0,false); }
00244     void zoomOut12() { zoom(0.08333,false); }
00245 
00246     void gridSettings( int i );
00247 
00248     void setScale( int i );
00249     void setHourFormat( int i );
00250     void setYearFormat( int i );
00251 
00252 signals:
00253     void sizeChanged( int );
00254 
00255 private:
00256     friend class KDTimeTableWidget;
00257     friend class KDGanttViewItem;
00258     friend class KDGanttView;
00259     friend class KDGanttCanvasView; // calls computeIntervals
00260     virtual void mousePressEvent ( QMouseEvent * e );
00261     virtual void mouseReleaseEvent ( QMouseEvent * e );
00262     virtual void mouseDoubleClickEvent ( QMouseEvent * e );
00263     virtual void mouseMoveEvent ( QMouseEvent * e );
00264     double secsFromTo( QDateTime begin, QDateTime end );
00265     void updateTimeTable();
00266     void computeIntervals( int height );
00267     bool getColumnColor(QColor& col,int coordLow, int coordHigh);
00268     void moveTimeLineTo(int x);
00269     //void  mousePressEvent ( QMouseEvent * ) ;
00270     void resizeEvent ( QResizeEvent * ) ;
00271     QValueList<int> majorTicks;
00272     QValueList<QString> minorText;
00273     QValueList<QString> majorText;
00274     QDateTime myHorizonStart, myHorizonEnd, myRealEnd,myRealStart;
00275     QDateTime myCenterDateTime;
00276     void saveCenterDateTime();
00277     Scale myScale,myRealScale,myMaxScale,myMinScale;
00278     YearFormat myYearFormat;
00279     HourFormat myHourFormat;
00280     int myMinimumColumWidth;
00281     ShowTicksType flagShowTicks;
00282     bool flagShowPopupMenu;
00283     bool flagShowZoom, flagShowScale ,flagShowTime ,flagShowYear;
00284     bool flagShowGrid ,flagShowPrint;
00285     bool flagStartTimeSet,flagEndTimeSet;
00286     QColor myWeekendBackgroundColor;
00287     int myWeekendDaysStart, myWeekendDaysEnd;
00288     ColumnColorList ccList;
00289     IntervalColorList icList;
00290     int myMinorScaleCount,myMajorScaleCount;
00291     int myRealMinorScaleCount,myRealMajorScaleCount;
00292     bool flagDoNotRecomputeAfterChange,flagDoNotRepaintAfterChange;
00293     QString getYear(QDate);
00294     QString getHour(QTime);
00295     QString getHourMinutes(QTime);
00296     int  getMaxTextWidth( const QString& format, int mode );
00297     QFont myFont();
00298     int getWeekOfYear( const QDate& date );
00299     QDateTime getEvenTimeDate(QDateTime ,Scale);
00300     void computeRealScale(QDateTime start);
00301     int myGridMinorWidth;
00302     int myMajorGridHeight;
00303     KDGanttView* myGanttView;
00304     double myZoomFactor;
00305     int myAutoScaleMinorTickcount;
00306     bool flagZoomToFit;
00307     int mySizeHint;
00308     int myMinimumWidth;
00309     int getTickTime();
00310     QDateTime addMajorTickTime( const QDateTime& dt, int fac );
00311     KDTimeHeaderToolTip* myToolTip;
00312     bool mouseDown;
00313     int beginMouseDown;
00314     int endMouseDown;
00315     bool autoComputeTimeLine;
00316     QPixmap paintPix;
00317     QString mDateFormatMonth;
00318     QString mDateFormatWeek;
00319     QString mDateFormatDay;
00320     QString mDatetimeFormatHour;
00321     QString mDatetimeFormatMinute;
00322     QString mDatetimeFormatSecond;
00323     int mMaxWidFormatMonth;
00324     int mMaxWidFormatWeek;
00325     int mMaxWidFormatDay;
00326     int mMaxWidtimeFormatHour;
00327     int mMaxWidtimeFormatMinute;
00328     int mMaxWidtimeFormatSecond;
00329     QString mTooltipDateFormat;
00330     bool mWeekStartsMonday;
00331     bool mWeekScaleShowNumber;
00332 
00333     QMenu *myPopupMenu;
00334     KActionCollection *actionCollection;
00335     KSelectAction *mGridAction, *mScaleAction, *mTimeFormatAction, *mYearFormatAction;
00336     QAction *mGotoAction, *mTimespanAction, *mZoomAction, *mPrintAction;
00337 
00338 };
00339 
00340 /* KDTimeTableWidget */
00341 class KDListView ;
00342 
00343 class KDTimeTableWidget : public QCanvas
00344 {
00345    Q_OBJECT
00346 
00347 public:
00348    KDTimeTableWidget (QWidget* parent,KDGanttView* my);
00349    ~KDTimeTableWidget ();
00350     void setBlockUpdating( bool block = true );
00351     bool blockUpdating();
00352     void inc_blockUpdating();
00353     void dec_blockUpdating();
00354     void setShowTaskLinks( bool show );
00355     bool showTaskLinks();
00356     QPtrList<KDGanttViewTaskLink>taskLinks();
00357     void removeItemFromTasklinks( KDGanttViewItem * );
00358     void setHorBackgroundLines( int count, QBrush brush );
00359     int horBackgroundLines( QBrush& brush );
00360 
00361     void setNoInformationBrush( const QBrush& brush );
00362     QBrush noInformationBrush() const;
00363 
00364     int getCoordX( QDateTime dt );
00365 
00366     int minimumHeight();
00367     void computeTaskLinksForItem( KDGanttViewItem * );
00368 
00369 signals:
00370    void   heightComputed( int );
00371 
00372 public slots:
00373 void updateSlot();
00374     void simpleUpdateSlot();
00375     void updateMyContent();
00376     void forceUpdate();
00377     void simpleUpdate();
00378 #if QT_VERSION < 0x040000
00379     void expandItem(QListViewItem * );
00380     void collapseItem(QListViewItem * );
00381 #else
00382     void expandItem(Q3ListViewItem * );
00383     void collapseItem(Q3ListViewItem * );
00384 #endif
00385     void resetWidth( int );
00386     void checkHeight( int );
00387 private:
00388     friend class KDGanttViewTaskLink;
00389     friend class KDTimeHeaderWidget;
00390     friend class KDGanttView;
00391     friend class KDGanttViewTaskItem;
00392     KDGanttView* myGanttView;
00393 
00394     bool taskLinksVisible;
00395 
00396     QPtrList<KDGanttViewTaskLink> myTaskLinkList;
00397 
00398     QPtrList<KDCanvasLine> verGridList;
00399     QPtrList<KDCanvasLine> horGridList;
00400     QPtrList<KDCanvasRectangle> horDenseList;
00401     QPtrList<KDCanvasRectangle> showNoInfoList;
00402     int denseLineCount;
00403     QBrush denseLineBrush, noInfoLineBrush;
00404     QPtrList<KDCanvasRectangle> columnColorList;
00405 
00406     int computeHeight();
00407     void computeVerticalGrid();
00408     void computeHorizontalGrid();
00409     void computeDenseLines();
00410     void computeShowNoInformation();
00411     void computeTaskLinks();
00412     void computeMinorGrid();
00413     void computeMajorGrid();
00414 
00415     void showMajorGrid();
00416     void showMinorGrid();
00417     void hideGrid();
00418 
00419     QPen gridPen;
00420     int maximumComputedGridHeight;
00421     int mMinimumHeight;
00422     int int_blockUpdating;
00423     bool flag_blockUpdating;
00424     int pendingHeight;
00425     int pendingWidth;
00426     QTimer *mUpdateTimer;
00427     QTimer *mSimpleUpdateTimer;
00428 
00429 };
00430 
00431 class KDLegendWidget : public KDGanttSemiSizingControl
00432 {
00433    Q_OBJECT
00434 
00435 public:
00436   KDLegendWidget ( QWidget* parent, KDGanttMinimizeSplitter* legendParent );
00437   void showMe(bool);
00438   bool isShown();
00439   void addLegendItem( KDGanttViewItem::Shape shape, const QColor& shapeColor, const QString& text );
00440     void addLegendItem( KDGanttViewItem::Shape shape, const QColor& shapeColor, const QString& text,
00441                         KDGanttViewItem::Shape shape2, const QColor& shapeColor2,const QString& text2 );
00442   void clearLegend();
00443   void setFont( QFont );
00444   void drawToPainter( QPainter *p );
00445   void setAsDockwindow( bool dockwin );
00446   bool asDockwindow();
00447   QDockWindow* dockwindow();
00448   QSize legendSize();
00449   QSize legendSizeHint();
00450  private:
00451   QGroupBox * myLegend;
00452   QLabel* myLabel;
00453   QScrollView * scroll;
00454   QDockWindow* dock;
00455   KDGanttMinimizeSplitter* myLegendParent;
00456 };
00457 
00458 class KDGanttView;
00459 class KDListView : public QListView
00460 {
00461    Q_OBJECT
00462 
00463 public:
00464    KDListView (QWidget* parent,KDGanttView* gv );
00465    KDGanttView* myGanttView;
00466     QSize minimumSizeHint () const;
00467    void drawToPainter( QPainter *p );
00468    void setCalendarMode( bool mode );
00469   bool calendarMode() { return _calendarMode; }
00470   QString getWhatsThisText(QPoint p);
00471   void setOpen ( QListViewItem * item, bool open );
00472   void dragEnterEvent ( QDragEnterEvent * );
00473   void dragMoveEvent ( QDragMoveEvent * );
00474   void dragLeaveEvent ( QDragLeaveEvent * );
00475   void dropEvent ( QDropEvent * );
00476   QDragObject * dragObject ();
00477   void startDrag ();
00478   void paintemptyarea ( QPainter * p, const QRect & rect ){ QListView::paintEmptyArea( p, rect );}
00479 private slots:
00480   void dragItem( QListViewItem * );
00481  private:
00482    void resizeEvent ( QResizeEvent * ) ;
00483   void contentsMouseDoubleClickEvent ( QMouseEvent * e );
00484   bool _calendarMode;
00485 
00486 
00487 
00488 };
00489 
00490 
00491 class KDCanvasText : public QCanvasText
00492 {
00493 public:
00494     KDCanvasText( KDTimeTableWidget* canvas, void* parentItem, int type );
00495     int myParentType;
00496     void* myParentItem;
00497     void updateItem() { update(); }
00498 };
00499 
00500 
00501 class KDCanvasLine : public QCanvasLine
00502 {
00503 public:
00504     KDCanvasLine( KDTimeTableWidget* canvas, void* parentItem, int type );
00505     int myParentType;
00506     void* myParentItem;
00507     void updateItem() { update(); }
00508 };
00509 
00510 
00511 class KDCanvasPolygonItem: public QCanvasPolygonalItem
00512 {
00513 public:
00514     KDCanvasPolygonItem( KDTimeTableWidget* canvas, void* parentItem,
00515                          int type );
00516     int myParentType;
00517     void* myParentItem;
00518     void updateItem() { update(); }
00519 };
00520 
00521 
00522 class KDCanvasPolygon: public QCanvasPolygon
00523 {
00524 public:
00525     KDCanvasPolygon( KDTimeTableWidget* canvas, void* parentItem, int type );
00526     int myParentType;
00527     void* myParentItem;
00528     void updateItem() { update(); }
00529 };
00530 
00531 
00532 class KDCanvasEllipse: public QCanvasEllipse
00533 {
00534 public:
00535     KDCanvasEllipse( KDTimeTableWidget* canvas, void* parentItem, int type );
00536     int myParentType;
00537     void* myParentItem;
00538     void updateItem() { update(); }
00539 };
00540 
00541 
00542 class KDCanvasRectangle: public QCanvasRectangle
00543 {
00544 public:
00545     KDCanvasRectangle( KDTimeTableWidget* canvas, void* parentItem, int type );
00546     int myParentType;
00547     void* myParentItem;
00548     void updateItem() { update(); }
00549 };
00550 
00551 
00552 // Interval-color-rectangle, such as the one used in the freebusy view for the current event
00553 class KDIntervalColorRectangle: public KDCanvasRectangle
00554 {
00555 public:
00556   KDIntervalColorRectangle( KDGanttView* view );
00557 
00558   void setDateTimes( const QDateTime& start,
00559                      const QDateTime& end );
00560   QDateTime start() const { return mStart; }
00561   QDateTime end() const { return mEnd; }
00562 
00563   void setColor( const QColor& color );
00564   QColor color() const { return mColor; }
00565 
00566   enum HitTest { Start, Middle, End };
00567   HitTest hitTest( KDTimeHeaderWidget* timeHeader, const QPoint& pos ) const;
00568 
00569   void layout( KDTimeHeaderWidget* timeHeader, int height );
00570 
00571   static const int RTTI = 0x0c58;
00572   /*reimp*/ int rtti() const { return RTTI; }
00573 
00574 private:
00575   QColor mColor;
00576   QDateTime mStart;
00577   QDateTime mEnd;
00578 };
00579 
00580 class KDCanvasToolTip;
00581 
00582 class KDGanttCanvasView : public QCanvasView
00583 {
00584     Q_OBJECT
00585 
00586 public:
00587     KDGanttCanvasView(KDGanttView* sender, QCanvas* canvas = 0, QWidget* parent = 0, const char* name = 0 );
00588     ~KDGanttCanvasView();
00589     QString getToolTipText(QPoint p);
00590     QString getWhatsThisText(QPoint p);
00591     void drawToPainter ( QPainter * p );
00592     void resetCutPaste( KDGanttViewItem* );
00593     void setShowPopupMenu( bool show );
00594     bool showPopupMenu();
00595     void cutItem (  KDGanttViewItem* );
00596     void insertItemAsRoot( KDGanttViewItem* );
00597     void insertItemAsChild( KDGanttViewItem* , KDGanttViewItem* );
00598     void insertItemAfter( KDGanttViewItem* , KDGanttViewItem* );
00599     void setMyVScrollBarMode ( ScrollBarMode );
00600     ScrollBarMode myVScrollBarMode () const;
00601 
00602     void setConnectorEnabled(int connector, bool on);
00603     bool isConnectorEnabled(int connector) const;
00604     void setAllConnectorsEnabled(bool on);
00605 
00606 protected:
00607     friend class KDGanttView;
00608     friend class KDListView;
00609     virtual void contentsMousePressEvent ( QMouseEvent * ) ;
00610     virtual void contentsMouseReleaseEvent ( QMouseEvent * );
00611     virtual void contentsMouseDoubleClickEvent ( QMouseEvent * );
00612     virtual void contentsMouseMoveEvent ( QMouseEvent * ) ;
00613     virtual void viewportPaintEvent ( QPaintEvent * pe );
00614     void resizeEvent ( QResizeEvent * ) ;
00615     void set_MouseTracking(bool on);
00616     int getType(QCanvasItem*);
00617     KDGanttViewItem* getItem(QCanvasItem*);
00618     KDGanttViewTaskLink* getLink(QCanvasItem*);
00619     KDGanttView* mySignalSender;
00620     KDGanttViewItem* currentItem, *lastClickedItem, *cuttedItem;
00621     QCanvasRectangle* movingItem;
00622     KDGanttViewTaskItem* movingGVItem;
00623     QPoint movingStart;
00624     QDateTime movingStartDate;
00625     enum MovingOperation { Moving, ResizingLeft, ResizingRight };
00626     MovingOperation movingOperation;
00627     KDGanttViewTaskLink* currentLink;
00628     KDGanttViewItem::Connector currentConnector;
00629     KDCanvasWhatsThis* myWhatsThis;
00630     QMenu* onItem;
00631     bool _showItemAddPopupMenu;
00632     int myMyContentsHeight;
00633     bool autoScrollEnabled;
00634     bool mouseDown;
00635 
00636 signals:
00637   void heightResized( int );
00638   void widthResized( int );
00639 
00640 public slots:
00641   void set_Mouse_Tracking(bool on);
00642   void moveMyContent( int, int );
00643   void setMyContentsHeight( int );
00644   void updateHorScrollBar();
00645 private slots: