KDE PIM / Developers / API Docs / karm

Task Class Reference

A class representing a task. More...

#include <task.h>

Inherits QObject, and QListViewItem.

List of all members.

Signals

Public Member Functions

Protected Slots

Protected Member Functions


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.


Constructor & Destructor Documentation

Task::Task const QString &  taskame,
long  minutes,
long  sessionTime,
DesktopList  desktops,
TaskView parent = 0
 

constructors


Member Function Documentation

Task* Task::firstChild  )  const [inline]
 

return parent Task or null in case of TaskView.

same as QListViewItem::parent()

TaskView* Task::taskView  )  const [inline]
 

Return task view for this task.

QString Task::uid  )  const [inline]
 

Return unique iCalendar Todo ID for this task.

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.

void Task::cut  ) 
 

cut Task out of parent Task or the TaskView

void Task::move Task destination  ) 
 

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

void Task::paste Task destination  ) 
 

insert Task into the destination Task

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

Sort times numerically, not alphabetically.

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.

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.

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

void Task::resetTimes  ) 
 

Reset all times to 0.

long Task::time  )  const [inline]
 

returns the times accumulated by the task

Returns:
total time in minutes

QDateTime Task::startTime  )  const [inline]
 

Return time the task was started.

void Task::startNewSession  )  [inline]
 

sets session time to zero.

void Task::setDesktopList DesktopList  dl  ) 
 

desktop related functions

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.

QString Task::name  )  const [inline]
 

returns the name of this task.

Returns:
a pointer to the name.

QString Task::fullName  )  const
 

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

Task names are seperated by a forward slash: /

void Task::update  ) 
 

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

void Task::setRunning bool  on,
KarmStorage storage
 

starts or stops a task

Parameters:
on true or false for starting or stopping a task
storage a pointer to a KarmStorage object.

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

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

Load the todo passed in with this tasks info.

void Task::addComment QString  comment,
KarmStorage storage
 

Add a comment to this task.

QString Task::comment  )  const
 

Retrieve the entire comment for the task.

bool Task::isRoot  )  const [inline]
 

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

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.

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.

bool Task::isComplete  ) 
 

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

void Task::removeFromView  ) 
 

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

void Task::deletingTask Task thisTask  )  [signal]
 

signal that we're about to delete a task

void Task::updateActiveIcon  )  [protected, slot]
 

animate the active icon


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