karm

Task Class Reference

#include <task.h>

List of all members.


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 QListViewItem class.

Definition at line 43 of file task.h.


Signals

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

Public Member Functions

 ~Task ()
TaskfirstChild () const
TasknextSibling () const
Taskparent () const
TaskViewtaskView () const
QString uid () const
void setUid (const QString uid)
void cut ()
void move (Task *destination)
void paste (Task *destination)
int compare (QListViewItem *i, int col, bool ascending) const
void update ()
bool parseIncidence (KCal::Incidence *, long &minutes, long &sessionMinutes, QString &name, DesktopList &desktops, int &percent_complete)
KCal::Todo * asTodo (KCal::Todo *calendar) const
void addComment (QString comment, KarmStorage *storage)
QString comment () const
bool isRoot () const
bool remove (QPtrList< Task > &activeTasks, KarmStorage *storage)
void setPercentComplete (const int percent, KarmStorage *storage)
void setPixmapProgress ()
bool isComplete ()
void removeFromView ()
QDateTime lastStart ()
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
QDateTime startTime () const
void startNewSession ()
void setDesktopList (DesktopList dl)
DesktopList getDesktops () const
QString getDesktopStr () const
void setName (const QString &name, KarmStorage *storage)
QString name () const
QString fullName () const
void setRunning (bool on, KarmStorage *storage, QDateTime whenStarted=QDateTime::currentDateTime(), QDateTime whenStopped=QDateTime::currentDateTime())
bool isRunning () const

Protected Slots

void updateActiveIcon ()

Protected Member Functions

void changeParentTotalTimes (long minutesSession, long minutes)

Member Function Documentation

Task* Task::firstChild (  )  const [inline]

return parent Task or null in case of TaskView.

same as QListViewItem::parent()

Definition at line 61 of file task.h.

TaskView* Task::taskView (  )  const [inline]

Return task view for this task.

Definition at line 66 of file task.h.

QString Task::uid (  )  const [inline]

Return unique iCalendar Todo ID for this task.

Definition at line 71 of file task.h.

void Task::setUid ( const QString  uid  ) 

Set unique id for the task.

The uid is the key used to update the storage.

Parameters:
uid The new unique id.

Definition at line 122 of file task.cpp.

void Task::cut (  ) 

cut Task out of parent Task or the TaskView

Definition at line 383 of file task.cpp.

void Task::move ( Task destination  ) 

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

Definition at line 393 of file task.cpp.

void Task::paste ( Task destination  ) 

insert Task into the destination Task

Definition at line 399 of file task.cpp.

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

Sort times numerically, not alphabetically.

Definition at line 425 of file task.cpp.

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

Change task time.

Adds minutes to both total time and session time.

Parameters:
minutes minutes to add to - may be negative
storage Pointer to KarmStorage instance. If zero, don't save changes.

Definition at line 202 of file task.cpp.

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

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

Parameters:
minutesSession minutes to add to task session time
minutes minutes to add to task time
storage Pointer to KarmStorage instance. If zero, don't save changes.

Definition at line 207 of file task.cpp.

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

adds minutes to total and session time

Parameters:
minutesSession minutes to add to task total session time
minutes minutes to add to task total time

Definition at line 218 of file task.cpp.

void Task::resetTimes (  ) 

Reset all times to 0.

Definition at line 230 of file task.cpp.

QDateTime Task::startTime (  )  const [inline]

Return time the task was started.

Definition at line 138 of file task.h.

void Task::startNewSession (  )  [inline]

sets session time to zero.

Definition at line 141 of file task.h.

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

sets the name of the task

Parameters:
name a pointer to the name. A deep copy will be made.
storage a pointer to a KarmStorage object.

Definition at line 131 of file task.cpp.

QString Task::name (  )  const [inline]

returns the name of this task.

Returns:
a pointer to the name.

Definition at line 163 of file task.h.

QString 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 282 of file task.cpp.

void Task::update (  ) 

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

Definition at line 405 of file task.cpp.

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

starts or stops a task

Parameters:
on true or false for starting or stopping a task
storage a pointer to a KarmStorage object.
whenStarted time when the task was started. Normally QDateTime::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.

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 126 of file task.cpp.

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

Load the todo passed in with this tasks info.

Definition at line 290 of file task.cpp.

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

Add a comment to this task.

Definition at line 414 of file task.cpp.

QString Task::comment (  )  const

Retrieve the entire comment for the task.

Definition at line 420 of file task.cpp.

bool Task::isRoot (  )  const [inline]

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

Definition at line 210 of file task.h.

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

remove Task with all it's children

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

Definition at line 252 of file task.cpp.

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 100. If less than zero, set to zero.

Definition at line 143 of file task.cpp.

void Task::setPixmapProgress (  ) 

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

Definition at line 178 of file task.cpp.

bool Task::isComplete (  ) 

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

Definition at line 188 of file task.cpp.

void Task::removeFromView (  ) 

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

Definition at line 190 of file task.cpp.

QDateTime Task::lastStart (  )  [inline]

delivers when the task was started last

Definition at line 239 of file task.h.

void Task::deletingTask ( Task thisTask  )  [signal]

signal that we're about to delete a task

void Task::updateActiveIcon (  )  [protected, slot]

animate the active icon

Definition at line 276 of file task.cpp.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys