karm

#include <task.h>

Inherits TQObject, and TQListViewItem.

Signals

void totalTimesChanged (long minutesSession, long minutes)
 
void deletingTask (Task *thisTask)
 

Public Member Functions

 Task (const TQString &taskame, long minutes, long sessionTime, DesktopList desktops, TaskView *parent=0)
 
 Task (const TQString &taskame, long minutes, long sessionTime, DesktopList desktops, Task *parent=0)
 
 Task (KCal::Todo *incident, TaskView *parent)
 
TaskfirstChild () const
 
TasknextSibling () const
 
Taskparent () const
 
TaskViewtaskView () const
 
TQString uid () const
 
void setUid (const TQString uid)
 
void cut ()
 
void move (Task *destination)
 
void paste (Task *destination)
 
int compare (TQListViewItem *i, int col, bool ascending) const
 
void changeTime (long minutes, KarmStorage *storage)
 
void changeTimes (long minutesSession, long minutes, KarmStorage *storage=0)
 
void changeTotalTimes (long minutesSession, long minutes)
 
void resetTimes ()
 
long time () const
 
long totalTime () const
 
long sessionTime () const
 
long totalSessionTime () const
 
TQDateTime startTime () const
 
void startNewSession ()
 
void setDesktopList (DesktopList dl)
 
DesktopList getDesktops () const
 
TQString getDesktopStr () const
 
void setName (const TQString &name, KarmStorage *storage)
 
TQString name () const
 
TQString fullName () const
 
void update ()
 
void setRunning (bool on, KarmStorage *storage, TQDateTime whenStarted=TQDateTime::currentDateTime(), TQDateTime whenStopped=TQDateTime::currentDateTime())
 
bool isRunning () const
 
bool parseIncidence (KCal::Incidence *, long &minutes, long &sessionMinutes, TQString &name, DesktopList &desktops, int &percent_complete)
 
KCal::Todo * asTodo (KCal::Todo *calendar) const
 
void addComment (TQString comment, KarmStorage *storage)
 
TQString comment () const
 
bool isRoot () const
 
bool remove (TQPtrList< Task > &activeTasks, KarmStorage *storage)
 
void setPercentComplete (const int percent, KarmStorage *storage)
 
void setPixmapProgress ()
 
bool isComplete ()
 
void removeFromView ()
 
TQDateTime lastStart ()
 

Protected Slots

void updateActiveIcon ()
 

Protected Member Functions

void changeParentTotalTimes (long minutesSession, long minutes)
 

Detailed Description

A class representing a task.

A "Task" object stores information about a task such as it's name, total and session times.

It can log when the task is started, stoped or deleted.

If a task is associated with some desktop's activity it can remember that too.

It can also contain subtasks - these are managed using the TQListViewItem class.

Definition at line 41 of file task.h.

Member Function Documentation

◆ addComment()

void Task::addComment ( TQString  comment,
KarmStorage storage 
)

Add a comment to this task.

Definition at line 420 of file task.cpp.

◆ asTodo()

KCal::Todo * Task::asTodo ( KCal::Todo *  calendar) const

Load the todo passed in with this tasks info.

Definition at line 296 of file task.cpp.

◆ changeTime()

void Task::changeTime ( long  minutes,
KarmStorage storage 
)

Change task time.

Adds minutes to both total time and session time.

Parameters
minutesminutes to add to - may be negative
storagePointer to KarmStorage instance. If zero, don't save changes.

Definition at line 208 of file task.cpp.

◆ changeTimes()

void Task::changeTimes ( long  minutesSession,
long  minutes,
KarmStorage storage = 0 
)

Add minutes to time and session time, and write to storage.

Parameters
minutesSessionminutes to add to task session time
minutesminutes to add to task time
storagePointer to KarmStorage instance. If zero, don't save changes.

Definition at line 213 of file task.cpp.

◆ changeTotalTimes()

void Task::changeTotalTimes ( long  minutesSession,
long  minutes 
)

adds minutes to total and session time

Parameters
minutesSessionminutes to add to task total session time
minutesminutes to add to task total time

Definition at line 224 of file task.cpp.

◆ comment()

TQString Task::comment ( ) const

Retrieve the entire comment for the task.

Definition at line 426 of file task.cpp.

◆ compare()

int Task::compare ( TQListViewItem *  i,
int  col,
bool  ascending 
) const

Sort times numerically, not alphabetically.


Definition at line 431 of file task.cpp.

◆ cut()

void Task::cut ( )

cut Task out of parent Task or the TaskView

Definition at line 389 of file task.cpp.

◆ deletingTask

void Task::deletingTask ( Task thisTask)
signal

signal that we're about to delete a task

◆ firstChild()

Task* Task::firstChild ( ) const
inline

return parent Task or null in case of TaskView.

same as TQListViewItem::parent()

Definition at line 60 of file task.h.

◆ fullName()

TQString Task::fullName ( ) const

Returns that task name, prefixed by parent tree up to root.

Task names are seperated by a forward slash: /

Definition at line 288 of file task.cpp.

◆ isComplete()

bool Task::isComplete ( )

Return true if task is complete (percent complete equals 100).


Definition at line 194 of file task.cpp.

◆ isRoot()

bool Task::isRoot ( ) const
inline

tells you whether this task is the root of the task tree

Definition at line 209 of file task.h.

◆ isRunning()

bool Task::isRunning ( ) const

return the state of a task - if it's running or not

Returns
true or false depending on whether the task is running

Definition at line 132 of file task.cpp.

◆ lastStart()

TQDateTime Task::lastStart ( )
inline

delivers when the task was started last

Definition at line 238 of file task.h.

◆ move()

void Task::move ( Task destination)

cut Task out of parent Task or the TaskView and into the destination Task

Definition at line 399 of file task.cpp.

◆ name()

TQString Task::name ( ) const
inline

returns the name of this task.

Returns
a pointer to the name.

Definition at line 162 of file task.h.

◆ paste()

void Task::paste ( Task destination)

insert Task into the destination Task

Definition at line 405 of file task.cpp.

◆ remove()

bool Task::remove ( TQPtrList< Task > &  activeTasks,
KarmStorage storage 
)

remove Task with all it's children

Parameters
activeTasks- list of aktive tasks
storagea pointer to a KarmStorage object.

Definition at line 258 of file task.cpp.

◆ removeFromView()

void Task::removeFromView ( )

Remove current task and all it's children from the view.


Definition at line 196 of file task.cpp.

◆ resetTimes()

void Task::resetTimes ( )

Reset all times to 0.

Definition at line 236 of file task.cpp.

◆ setName()

void Task::setName ( const TQString &  name,
KarmStorage storage 
)

sets the name of the task

Parameters
namea pointer to the name. A deep copy will be made.
storagea pointer to a KarmStorage object.

Definition at line 137 of file task.cpp.

◆ setPercentComplete()

void Task::setPercentComplete ( const int  percent,
KarmStorage storage 
)

Update percent complete for this task.

Tasks that are complete (i.e., percent = 100) do not show up in taskview. If percent NULL, set to zero. If greater than 100, set to

  1. If less than zero, set to zero.

Definition at line 149 of file task.cpp.

◆ setPixmapProgress()

void Task::setPixmapProgress ( )

Sets an appropriate icon for this task based on its level of completion.

Definition at line 184 of file task.cpp.

◆ setRunning()

void Task::setRunning ( bool  on,
KarmStorage storage,
TQDateTime  whenStarted = TQDateTime::currentDateTime(),
TQDateTime  whenStopped = TQDateTime::currentDateTime() 
)

starts or stops a task

Parameters
ontrue or false for starting or stopping a task
storagea pointer to a KarmStorage object.
whenStartedtime when the task was started. Normally TQDateTime::currentDateTime, but if calendar has been changed by another program and being reloaded the task is set to running with another start date

Definition at line 97 of file task.cpp.

◆ setUid()

void Task::setUid ( const TQString  uid)

Set unique id for the task.

The uid is the key used to update the storage.

Parameters
uidThe new unique id.

Definition at line 128 of file task.cpp.

◆ startNewSession()

void Task::startNewSession ( )
inline

sets session time to zero.

Definition at line 140 of file task.h.

◆ startTime()

TQDateTime Task::startTime ( ) const
inline

Return time the task was started.

Definition at line 137 of file task.h.

◆ taskView()

TaskView* Task::taskView ( ) const
inline

Return task view for this task.

Definition at line 65 of file task.h.

◆ uid()

TQString Task::uid ( ) const
inline

Return unique iCalendar Todo ID for this task.

Definition at line 70 of file task.h.

◆ update()

void Task::update ( )

Update the display of the task (all columns) in the UI.

Definition at line 411 of file task.cpp.

◆ updateActiveIcon

void Task::updateActiveIcon ( )
protectedslot

animate the active icon

Definition at line 282 of file task.cpp.


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