35 #include "KDGanttViewTaskLinkGroup.h"
36 #include "KDGanttXMLTools.h"
37 #include "KDGanttView.h"
39 TQDict<KDGanttViewTaskLinkGroup> KDGanttViewTaskLinkGroup::sGroupDict;
63 if (!myTaskLinkList.isEmpty()) {
64 myTaskLinkList.first()->from().first()->myGanttView->removeTaskLinkGroup(
this);
124 TQPtrListIterator<KDGanttViewTaskLink> it(myTaskLinkList);
125 for ( ; it.current(); ++it ) {
126 it.current()->setVisible(show);
154 TQPtrListIterator<KDGanttViewTaskLink> it(myTaskLinkList);
155 for ( ; it.current(); ++it )
172 return ishighlighted;
185 TQPtrListIterator<KDGanttViewTaskLink> it(myTaskLinkList);
186 for ( ; it.current(); ++it )
187 it.current()->setColor(
color);
217 TQPtrListIterator<KDGanttViewTaskLink> it(myTaskLinkList);
218 for ( ; it.current(); ++it )
219 it.current()->setHighlightColor(
color);
248 myTaskLinkList.append (link);
260 myTaskLinkList.remove(link);
275 return sGroupDict.find( name );
286 TQDomElement& parentElement )
288 TQDomElement taskLinkGroupElement = doc.createElement(
"TaskLink" );
289 parentElement.appendChild( taskLinkGroupElement );
291 KDGanttXML::createBoolNode( doc, taskLinkGroupElement,
"Highlight",
293 KDGanttXML::createColorNode( doc, taskLinkGroupElement,
"Color",
color() );
294 KDGanttXML::createColorNode( doc, taskLinkGroupElement,
"HighlightColor",
296 KDGanttXML::createBoolNode( doc, taskLinkGroupElement,
"Visible",
298 KDGanttXML::createStringNode( doc, taskLinkGroupElement,
"Name", _name );
311 TQDomNode node = element.firstChild();
315 while( !node.isNull() ) {
316 TQDomElement element = node.toElement();
317 if( !element.isNull() ) {
318 TQString tagName = element.tagName();
319 if( tagName ==
"Highlight" ) {
321 if( KDGanttXML::readBoolNode( element, value ) )
323 }
else if( tagName ==
"Visible" ) {
325 if( KDGanttXML::readBoolNode( element, value ) )
327 }
else if( tagName ==
"Color" ) {
329 if( KDGanttXML::readColorNode( element, value ) )
331 }
else if( tagName ==
"HighlightColor" ) {
333 if( KDGanttXML::readColorNode( element, value ) )
335 }
else if( tagName ==
"Name" ) {
337 if( KDGanttXML::readStringNode( element, value ) )
340 tqDebug(
"Unrecognized tag name: %s", tagName.latin1() );
344 node = node.nextSibling();
348 if( !name.isEmpty() )
369 if( !_name.isEmpty() )
371 sGroupDict.remove( _name );
374 if ( name.isEmpty() || sGroupDict.find( name ) ) {
376 newName.sprintf(
"%p", (
void* )
this );
377 while( sGroupDict.find( newName ) ) {
383 sGroupDict.insert( newName,
this );
static KDGanttViewTaskLinkGroup * find(const TQString &name)
KDGanttViewTaskLinkGroup()
void insert(KDGanttViewTaskLink *)
void setHighlightColor(const TQColor &color)
static KDGanttViewTaskLinkGroup * createFromDomElement(TQDomElement &)
void generateAndInsertName(const TQString &name)
bool remove(KDGanttViewTaskLink *)
void setVisible(bool show)
void setHighlight(bool highlight)
void setColor(const TQColor &color)
void createNode(TQDomDocument &doc, TQDomElement &parentElement)
~KDGanttViewTaskLinkGroup()
TQColor highlightColor() const
void setGroup(KDGanttViewTaskLinkGroup *)
KDGanttViewTaskLinkGroup * group()