kdgantt
KDGanttViewTaskLinkGroup.h
00001 /* -*- Mode: C++ -*- 00002 $Id: KDGanttViewTaskLinkGroup.h 360310 2004-11-04 09:53:53Z danders $ 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 distributed and/or modified under the terms of the 00012 ** GNU General Public License version 2 as published by the Free Software 00013 ** Foundation and appearing in the file LICENSE.GPL included in the 00014 ** packaging of this file. 00015 ** 00016 ** Licensees holding valid commercial KDGantt licenses may use this file in 00017 ** accordance with the KDGantt Commercial License Agreement provided with 00018 ** the Software. 00019 ** 00020 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00021 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00022 ** 00023 ** See http://www.klaralvdalens-datakonsult.se/Public/products/ for 00024 ** information about KDGantt Commercial License Agreements. 00025 ** 00026 ** Contact info@klaralvdalens-datakonsult.se if any conditions of this 00027 ** licensing are not clear to you. 00028 ** 00029 ** As a special exception, permission is given to link this program 00030 ** with any edition of Qt, and distribute the resulting executable, 00031 ** without including the source code for Qt in the source distribution. 00032 ** 00033 **********************************************************************/ 00034 00035 #ifndef KDGANTTVIEWTASKLINKGROUP_H 00036 #define KDGANTTVIEWTASKLINKGROUP_H 00037 00038 #include "KDGanttViewTaskLink.h" 00039 #include <qptrlist.h> 00040 #include <qdict.h> 00041 00042 class KDTimeTableWidget; 00043 class KDGanttView; 00044 00045 class KDGanttViewTaskLinkGroup : public QObject 00046 { 00047 public: 00048 KDGanttViewTaskLinkGroup( const QString& name ); 00049 KDGanttViewTaskLinkGroup(); 00050 ~KDGanttViewTaskLinkGroup(); 00051 void insert (KDGanttViewTaskLink*) ; 00052 bool remove (KDGanttViewTaskLink*); 00053 00054 void setVisible( bool show ); 00055 bool visible() const; 00056 00057 void setHighlight( bool highlight ); 00058 bool highlight() const; 00059 00060 void setColor( const QColor& color ); 00061 QColor color() const; 00062 void setHighlightColor( const QColor& color ); 00063 QColor highlightColor() const; 00064 00065 static KDGanttViewTaskLinkGroup* find( const QString& name ); 00066 00067 void createNode( QDomDocument& doc, 00068 QDomElement& parentElement ); 00069 static KDGanttViewTaskLinkGroup* createFromDomElement( QDomElement& ); 00070 00071 void generateAndInsertName( const QString& name ); 00072 00073 private: 00074 friend class KDTimeTableWidget; 00075 friend class KDGanttViewTaskLink; 00076 00077 bool isvisible,ishighlighted; 00078 QColor myColor, myColorHL; 00079 QPtrList<KDGanttViewTaskLink> myTaskLinkList; 00080 QString _name; 00081 00082 void insertItem(KDGanttViewTaskLink*); 00083 void removeItem (KDGanttViewTaskLink*); 00084 00085 static QDict<KDGanttViewTaskLinkGroup> sGroupDict; 00086 }; 00087 00088 #endif