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

kdgantt

kdganttitemdelegate.h

Go to the documentation of this file.
00001 /****************************************************************************
00002  ** Copyright (C) 2001-2006 Klarälvdalens Datakonsult AB.  All rights reserved.
00003  **
00004  ** This file is part of the KD Gantt library.
00005  **
00006  ** This file may be used under the terms of the GNU General Public
00007  ** License versions 2.0 or 3.0 as published by the Free Software
00008  ** Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3
00009  ** included in the packaging of this file.  Alternatively you may (at
00010  ** your option) use any later version of the GNU General Public
00011  ** License if such license has been publicly approved by
00012  ** Klarälvdalens Datakonsult AB (or its successors, if any).
00013  ** 
00014  ** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
00015  ** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
00016  ** A PARTICULAR PURPOSE. Klarälvdalens Datakonsult AB reserves all rights
00017  ** not expressly granted herein.
00018  ** 
00019  ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00020  ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00021  **
00022  **********************************************************************/
00023 #ifndef KDGANTTITEMDELEGATE_H
00024 #define KDGANTTITEMDELEGATE_H
00025 
00026 #include <QItemDelegate>
00027 #include <QBrush>
00028 #include <QPen>
00029 #include <QDebug>
00030 
00031 #include "kdgantt_export.h"
00032 #include "kdganttglobal.h"
00033 
00034 namespace KDGantt {
00035     class StyleOptionGanttItem;
00036     class Constraint;
00037 
00038     class KDGANTT_EXPORT ItemDelegate : public QItemDelegate {
00039         Q_OBJECT
00040         KDGANTT_DECLARE_PRIVATE_BASE_POLYMORPHIC( ItemDelegate )
00041     public:
00042         enum InteractionState { State_None = 0,
00043                                 State_Move,
00044                                 State_ExtendLeft,
00045                                 State_ExtendRight,
00046                                 State_DragConstraint
00047         };
00048 
00049         explicit ItemDelegate( QObject* parent = 0 );
00050         virtual ~ItemDelegate();
00051 
00052         void setDefaultBrush( ItemType type, const QBrush& brush );
00053         QBrush defaultBrush( ItemType type ) const;
00054 
00055         void setDefaultPen( ItemType type, const QPen& pen );
00056         QPen defaultPen( ItemType type ) const;
00057 
00058         virtual Span itemBoundingSpan(const StyleOptionGanttItem& opt, const QModelIndex& idx) const;
00059         virtual QRectF constraintBoundingRect( const QPointF& start, const QPointF& end, const Constraint &constraint ) const;
00060         virtual InteractionState interactionStateFor( const QPointF& pos,
00061                               const StyleOptionGanttItem& opt,
00062                               const QModelIndex& idx ) const;
00063 
00064         virtual void paintGanttItem( QPainter* p, const StyleOptionGanttItem& opt, const QModelIndex& idx );
00065         virtual void paintConstraintItem( QPainter* p, const QStyleOptionGraphicsItem& opt,
00066                                           const QPointF& start, const QPointF& end, const Constraint &constraint );
00067         
00068     protected:
00069         void paintFinishStartConstraint( QPainter* p, const QStyleOptionGraphicsItem& opt,
00070                 const QPointF& start, const QPointF& end, const Constraint &constraint );
00071         QPolygonF finishStartLine( const QPointF& start, const QPointF& end ) const;
00072         QPolygonF finishStartArrow( const QPointF& start, const QPointF& end ) const;
00073 
00074         void paintFinishFinishConstraint( QPainter* p, const QStyleOptionGraphicsItem& opt,
00075                 const QPointF& start, const QPointF& end, const Constraint &constraint );
00076         QPolygonF finishFinishLine( const QPointF& start, const QPointF& end ) const;
00077         QPolygonF finishFinishArrow( const QPointF& start, const QPointF& end ) const;
00078         
00079         void paintStartStartConstraint( QPainter* p, const QStyleOptionGraphicsItem& opt,
00080                 const QPointF& start, const QPointF& end, const Constraint &constraint );
00081         QPolygonF startStartLine( const QPointF& start, const QPointF& end ) const;
00082         QPolygonF startStartArrow( const QPointF& start, const QPointF& end ) const;
00083         
00084         void paintStartFinishConstraint( QPainter* p, const QStyleOptionGraphicsItem& opt,
00085                 const QPointF& start, const QPointF& end, const Constraint &constraint );
00086         QPolygonF startFinishLine( const QPointF& start, const QPointF& end ) const;
00087         QPolygonF startFinishArrow( const QPointF& start, const QPointF& end ) const;
00088 
00089         
00090     };
00091 }
00092 
00093 #ifndef QT_NO_DEBUG_STREAM
00094 QDebug operator<<( QDebug dbg, KDGantt::ItemDelegate::InteractionState );
00095 #endif
00096 
00097 #endif /* KDGANTTITEMDELEGATE_H */
00098 

kdgantt

Skip menu "kdgantt"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdepim

Skip menu "kdepim"
  • akonadi
  •   clients
  •   kabc
  •   kcal
  •   kcm
  • akregator
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt
  • kdgantt1
  • kjots
  • kleopatra
  • kmail
  • kmobiletools
  • knode
  • knotes
  • kontact
  • kontactinterfaces
  • korganizer
  •   korgac
  • kpilot
  • ktimetracker
  •   doc
  • libkdepim
  • libkholidays
  • libkleo
  • libkpgp
  • maildir
Generated for kdepim by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal