kgantt

#include <KGanttItem.h>

Inherits TQObject.

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 TQString &text, const TQDateTime &start, const TQDateTime &end)
 
 KGanttItem (KGanttItem *parentItem, const TQString &text, const TQDateTime &start, long durationMin)
 
 ~KGanttItem ()
 
KGanttRelationaddRelation (KGanttItem *from, KGanttItem *to, const TQString &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 TQBrush &brush)
 
TQBrush & getBrush ()
 
TQBrush & getSelectBrush ()
 
void setPen (const TQPen &pen)
 
TQPen & getPen ()
 
void setTextPen (const TQPen &pen)
 
TQPen & getTextPen ()
 
void setText (const TQString &text)
 
TQString getText ()
 
TQDateTime getStart ()
 
TQDateTime getEnd ()
 
void setStart (const TQDateTime &start)
 
void setEnd (const TQDateTime &end)
 
void setHeight (int h)
 
int getHeight ()
 
int getTotalHeight ()
 
int getWidth ()
 
TQPtrList< KGanttItem > & getSubItems ()
 
TQPtrList< KGanttRelation > & getRelations ()
 
void startTransaction ()
 
void endTransaction ()
 
void dump (TQTextOStream &cout, const TQString &pre)
 

Static Public Member Functions

static TQString 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 54 of file KGanttItem.h.

Member Enumeration Documentation

◆ Change

Enumerator
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 64 of file KGanttItem.h.

◆ Style

Enumerator
DrawNothing 

Set item invisible.

DrawBorder 

Draw border.

DrawHandleWSubitems 

Draw handle only if item contains subitems.

Definition at line 111 of file KGanttItem.h.

Constructor & Destructor Documentation

◆ KGanttItem() [1/2]

KGanttItem::KGanttItem ( KGanttItem parentItem,
const TQString &  text,
const TQDateTime &  start,
const TQDateTime &  end 
)

Constructor.

Definition at line 15 of file KGanttItem.cpp.

◆ KGanttItem() [2/2]

KGanttItem::KGanttItem ( KGanttItem parentItem,
const TQString &  text,
const TQDateTime &  start,
long  durationMin 
)

Constructor.

Definition at line 25 of file KGanttItem.cpp.

◆ ~KGanttItem()

KGanttItem::~KGanttItem ( )

Destructor.

Definition at line 67 of file KGanttItem.cpp.

Member Function Documentation

◆ addRelation()

KGanttRelation * KGanttItem::addRelation ( KGanttItem from,
KGanttItem to,
const TQString &  text 
)

Add relation between two subitems.

Definition at line 90 of file KGanttItem.cpp.

◆ ChangeAsString()

TQString KGanttItem::ChangeAsString ( Change  c)
static

Return a given change as a string.

Definition at line 599 of file KGanttItem.cpp.

◆ changed

void KGanttItem::changed ( KGanttItem ,
KGanttItem::Change   
)
signal

Item has changed.

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

◆ destroyed

void KGanttItem::destroyed ( KGanttItem )
signal

Item will be deleted.

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

◆ dump()

void KGanttItem::dump ( TQTextOStream &  cout,
const TQString &  pre 
)

Dump to cout.

Definition at line 565 of file KGanttItem.cpp.

◆ endTransaction()

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.

◆ getBrush()

TQBrush& KGanttItem::getBrush ( )
inline

Get brush that is used for filling the item.

Definition at line 274 of file KGanttItem.h.

◆ getEnd()

TQDateTime KGanttItem::getEnd ( )

Get date of ending.

Definition at line 220 of file KGanttItem.cpp.

◆ getHeight()

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 393 of file KGanttItem.h.

◆ getRelations()

TQPtrList<KGanttRelation>& KGanttItem::getRelations ( )
inline

Get list of relations.

Definition at line 431 of file KGanttItem.h.

◆ getSelectBrush()

TQBrush& KGanttItem::getSelectBrush ( )
inline

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

Definition at line 284 of file KGanttItem.h.

◆ getStart()

TQDateTime 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.

◆ getStyle()

int KGanttItem::getStyle ( )
inline

Get drawing style.

Definition at line 256 of file KGanttItem.h.

◆ getSubItems()

TQPtrList<KGanttItem>& KGanttItem::getSubItems ( )
inline

Get list of subitems.

Definition at line 421 of file KGanttItem.h.

◆ getText()

TQString KGanttItem::getText ( )
inline

Get text.

Definition at line 340 of file KGanttItem.h.

◆ getTotalHeight()

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.

◆ getWidth()

int KGanttItem::getWidth ( )

Get width in minutes.

Definition at line 550 of file KGanttItem.cpp.

◆ isEditable()

bool KGanttItem::isEditable ( )
inline

Returns if item is editable.

See also setEditable().

Definition at line 209 of file KGanttItem.h.

◆ isOpen()

bool KGanttItem::isOpen ( )
inline

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

Definition at line 178 of file KGanttItem.h.

◆ isSelected()

bool KGanttItem::isSelected ( )
inline

Returns true if item is selected.

Definition at line 219 of file KGanttItem.h.

◆ open()

void KGanttItem::open ( bool  f)

Open / Close item.

Draw/don't draw subitems.

Definition at line 435 of file KGanttItem.cpp.

◆ select()

void KGanttItem::select ( bool  f)

Select/unselect item.

Definition at line 450 of file KGanttItem.cpp.

◆ setBrush()

void KGanttItem::setBrush ( const TQBrush &  brush)

Set brush for filling.

Definition at line 503 of file KGanttItem.cpp.

◆ setEditable()

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 199 of file KGanttItem.h.

◆ setEnd()

void KGanttItem::setEnd ( const TQDateTime &  end)

Set time/date of end.

Definition at line 269 of file KGanttItem.cpp.

◆ setHeight()

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.

◆ setMode()

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.

◆ setPen()

void KGanttItem::setPen ( const TQPen &  pen)

Set pen for border.

Definition at line 512 of file KGanttItem.cpp.

◆ setStart()

void KGanttItem::setStart ( const TQDateTime &  start)

Set time/date of start.

Definition at line 232 of file KGanttItem.cpp.

◆ setStyle()

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

Set drawing style.

Definition at line 480 of file KGanttItem.cpp.

◆ setText()

void KGanttItem::setText ( const TQString &  text)

Set text.

Definition at line 422 of file KGanttItem.cpp.

◆ startTransaction()

void KGanttItem::startTransaction ( )
inline

Start a transaction.

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

Definition at line 441 of file KGanttItem.h.


The documentation for this class was generated from the following files: