kgantt Library API Documentation

KGanttItem Class Reference

KGanttItem. More...

#include <KGanttItem.h>

List of all members.

Public Types

enum  Change {
  NoChange = 0, StartChanged = 1, EndChanged = 2, HeightChanged = 4,
  TotalHeightChanged = 8, StyleChanged = 16, TextChanged = 32, ModeChanged = 64,
  MinChanged = 128, MaxChanged = 256, Opened = 512, Closed = 1024,
  Selected = 2048, Unselected = 4096, Unknown = 8192, RelationAdded = 16384,
  RelationRemoved = 32768
}
enum  Style {
  DrawNothing = 0, DrawBorder = 1, DrawFilled = 2, DrawText = 4,
  DrawHandle = 16, DrawHandleWSubitems = 32, DrawAll = 255
}
enum  Mode { Normal, Rubberband }

Signals

void changed (KGanttItem *, KGanttItem::Change)
void destroyed (KGanttItem *)

Public Member Functions

 KGanttItem (KGanttItem *parentItem, const QString &text, const QDateTime &start, const QDateTime &end)
 KGanttItem (KGanttItem *parentItem, const QString &text, const QDateTime &start, long durationMin)
 ~KGanttItem ()
KGanttRelationaddRelation (KGanttItem *from, KGanttItem *to, const QString &text)
bool isOpen ()
void open (bool f)
void setEditable (bool f)
bool isEditable ()
bool isSelected ()
void select (bool f)
void setMode (Mode flag)
void setStyle (int flag, bool includeSubitems=false)
int getStyle ()
void setBrush (const QBrush &brush)
QBrush & getBrush ()
QBrush & getSelectBrush ()
void setPen (const QPen &pen)
QPen & getPen ()
void setTextPen (const QPen &pen)
QPen & getTextPen ()
void setText (const QString &text)
QString getText ()
QDateTime getStart ()
QDateTime getEnd ()
void setStart (const QDateTime &start)
void setEnd (const QDateTime &end)
void setHeight (int h)
int getHeight ()
int getTotalHeight ()
int getWidth ()
QPtrList< KGanttItem > & getSubItems ()
QPtrList< KGanttRelation > & getRelations ()
void startTransaction ()
void endTransaction ()
void dump (QTextOStream &cout, const QString &pre)

Static Public Member Functions

QString ChangeAsString (Change c)


Detailed Description

KGanttItem.

This class describes a item. It contains dates on which the item starts and ends. It also contains attributes that gouverns the graphical representation in a gantt diagramm.

Definition at line 53 of file KGanttItem.h.


Member Enumeration Documentation

enum KGanttItem::Change
 

Enumeration values:
HeightChanged  Height for this item has changed.

The height doesn't include the subitems.

TotalHeightChanged  Total height has changed.

This happens if the item was opened, closed or subitems has been added or removed while item is open.

StyleChanged  Style for drawing has changed.
Opened  Draw item including subitems.
Closed  Draw item without subitems.
Selected  Item has been selected.
Unselected  Item has been unselected.
Unknown  Changes may occurred but the types are unknown.
RelationAdded  Relation between two subitems has been added.
RelationRemoved  Relation between two subitems has been removed.

Definition at line 62 of file KGanttItem.h.

enum KGanttItem::Style
 

Enumeration values:
DrawNothing  Set item invisible.
DrawBorder  Draw border.
DrawHandleWSubitems  Draw handle only if item contains subitems.

Definition at line 109 of file KGanttItem.h.


Constructor & Destructor Documentation

KGanttItem::KGanttItem KGanttItem parentItem,
const QString &  text,
const QDateTime &  start,
const QDateTime &  end
 

Constructor.

Definition at line 15 of file KGanttItem.cpp.

References KGanttItem().

Referenced by KGanttItem().

KGanttItem::KGanttItem KGanttItem parentItem,
const QString &  text,
const QDateTime &  start,
long  durationMin
 

Constructor.

Definition at line 25 of file KGanttItem.cpp.

References KGanttItem().

KGanttItem::~KGanttItem  ) 
 

Destructor.

Definition at line 67 of file KGanttItem.cpp.

References destroyed(), getText(), and unregisterItem().


Member Function Documentation

KGanttRelation * KGanttItem::addRelation KGanttItem from,
KGanttItem to,
const QString &  text
 

Add relation between two subitems.

Definition at line 90 of file KGanttItem.cpp.

References addRelation(), changed(), destroyed(), and RelationAdded.

Referenced by addRelation().

bool KGanttItem::isOpen  )  [inline]
 

Returns true if item is open (subitems has to be drawn).

Definition at line 176 of file KGanttItem.h.

Referenced by getTotalHeight().

void KGanttItem::open bool  f  ) 
 

Open / Close item.

Draw/don't draw subitems.

Definition at line 435 of file KGanttItem.cpp.

References changed(), Closed, open(), and Opened.

Referenced by open().

void KGanttItem::setEditable bool  f  )  [inline]
 

Set item editable or not.

If item is not editable these methods have no effect : setStart(), setEnd(), setText(), select(), setMode(), setStyle(), setHeight(),

Definition at line 197 of file KGanttItem.h.

References setEditable().

Referenced by setEditable().

bool KGanttItem::isEditable  )  [inline]
 

Returns if item is editable.

See also setEditable().

Definition at line 207 of file KGanttItem.h.

bool KGanttItem::isSelected  )  [inline]
 

Returns true if item is selected.

Definition at line 217 of file KGanttItem.h.

void KGanttItem::select bool  f  ) 
 

Select/unselect item.

Definition at line 450 of file KGanttItem.cpp.

References changed(), select(), Selected, and Unselected.

Referenced by select().

void KGanttItem::setMode Mode  flag  ) 
 

Set mode.

If mode is 'Rubberband' and the number of subtaks is greater than 0, the start and end of the item is determined by the start and end of the earliest/latest subitem.
Default is 'Normal'.

Definition at line 466 of file KGanttItem.cpp.

References changed(), and setMode().

Referenced by KGantt::KGantt(), and setMode().

void KGanttItem::setStyle int  flag,
bool  includeSubitems = false
 

Set drawing style.

Definition at line 480 of file KGanttItem.cpp.

References changed(), setStyle(), and StyleChanged.

Referenced by setStyle().

int KGanttItem::getStyle  )  [inline]
 

Get drawing style.

Definition at line 254 of file KGanttItem.h.

void KGanttItem::setBrush const QBrush &  brush  ) 
 

Set brush for filling.

Definition at line 503 of file KGanttItem.cpp.

References setBrush().

Referenced by setBrush().

QBrush& KGanttItem::getBrush  )  [inline]
 

Get brush that is used for filling the item.

Definition at line 272 of file KGanttItem.h.

QBrush& KGanttItem::getSelectBrush  )  [inline]
 

Get brush which has to be used for drawing this item as selected.

Definition at line 282 of file KGanttItem.h.

void KGanttItem::setPen const QPen &  pen  ) 
 

Set pen for border.

Definition at line 512 of file KGanttItem.cpp.

References setPen().

Referenced by setPen().

void KGanttItem::setText const QString &  text  ) 
 

Set text.

Definition at line 422 of file KGanttItem.cpp.

References changed(), and setText().

Referenced by setText().

QString KGanttItem::getText  )  [inline]
 

Get text.

Definition at line 338 of file KGanttItem.h.

Referenced by KGanttRelation::dump(), and ~KGanttItem().

QDateTime KGanttItem::getStart  ) 
 

Get date of starting.

If mode == ´Rubberband´ and this item contains subitems, start of the item is determined by the start of the earliest subitem.

Definition at line 208 of file KGanttItem.cpp.

Referenced by dump(), KGantt::dumpItems(), and getWidth().

QDateTime KGanttItem::getEnd  ) 
 

Get date of ending.

Definition at line 220 of file KGanttItem.cpp.

Referenced by dump(), KGantt::dumpItems(), and getWidth().

void KGanttItem::setStart const QDateTime &  start  ) 
 

Set time/date of start.

Definition at line 232 of file KGanttItem.cpp.

References changed(), and setStart().

Referenced by setStart().

void KGanttItem::setEnd const QDateTime &  end  ) 
 

Set time/date of end.

Definition at line 269 of file KGanttItem.cpp.

References changed(), and setEnd().

Referenced by setEnd().

void KGanttItem::setHeight int  h  ) 
 

Set height.

Set height in pixel. These are scaled when this item is drawn by the barview.

Definition at line 521 of file KGanttItem.cpp.

References changed(), HeightChanged, and setHeight().

Referenced by setHeight().

int KGanttItem::getHeight  )  [inline]
 

Get height.

Returns the height in pixel of this item. This does not include the height of any subitems; getTotalHeight() returns that if the subitems have to be drawn.

Definition at line 391 of file KGanttItem.h.

int KGanttItem::getTotalHeight  ) 
 

Get total height.

Returns the total height of this object in pixel, including any visible subitems. Notice, that the pixels are no screen pixel since the barview scales the height of a item.

Definition at line 534 of file KGanttItem.cpp.

References isOpen().

int KGanttItem::getWidth  ) 
 

Get width in minutes.

Definition at line 550 of file KGanttItem.cpp.

References getEnd(), and getStart().

QPtrList<KGanttItem>& KGanttItem::getSubItems  )  [inline]
 

Get list of subitems.

Definition at line 419 of file KGanttItem.h.

QPtrList<KGanttRelation>& KGanttItem::getRelations  )  [inline]
 

Get list of relations.

Definition at line 429 of file KGanttItem.h.

void KGanttItem::startTransaction  )  [inline]
 

Start a transaction.

If you want to add a lot of subitems -> block signals

Definition at line 439 of file KGanttItem.h.

void KGanttItem::endTransaction  ) 
 

End a transaction.

If you started a transaction and all signals have been blocked by method startTransaction(), invoke endTransaction() to unblock signals.
Signal changed(this,Unknown) is emitted.

Definition at line 119 of file KGanttItem.cpp.

References changed(), and Unknown.

QString KGanttItem::ChangeAsString Change  c  )  [static]
 

Return a given change as a string.

Definition at line 599 of file KGanttItem.cpp.

References ChangeAsString(), Closed, HeightChanged, Opened, Selected, StyleChanged, TotalHeightChanged, Unknown, and Unselected.

Referenced by ChangeAsString().

void KGanttItem::dump QTextOStream &  cout,
const QString &  pre
 

Dump to cout.

Definition at line 565 of file KGanttItem.cpp.

References KGanttRelation::dump(), dump(), getEnd(), and getStart().

Referenced by dump(), and KGantt::dumpItems().

void KGanttItem::changed KGanttItem ,
KGanttItem::Change 
[signal]
 

Item has changed.

This signal is emitted if any of the items properties have been changed.

Referenced by addRelation(), endTransaction(), open(), select(), setEnd(), setHeight(), setMode(), setStart(), setStyle(), and setText().

void KGanttItem::destroyed KGanttItem  )  [signal]
 

Item will be deleted.

This signal will be emitted immediately before the object will be deleted.

Referenced by addRelation(), and ~KGanttItem().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kgantt Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Jul 28 23:57:42 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003