Task Class Reference
A class representing a task. More...
#include <task.h>
Inheritance diagram for Task:


Signals | |
void | totalTimesChanged (long minutesSession, long minutes) |
void | deletingTask (Task *thisTask) |
Public Member Functions | |
constructors | Task (const QString &taskame, long minutes, long sessionTime, DesktopList desktops, TaskView *parent=0) |
Task (const QString &taskame, long minutes, long sessionTime, DesktopList desktops, Task *parent=0) | |
Task (KCal::Todo *incident, TaskView *parent) | |
Task * | firstChild () const |
Task * | nextSibling () const |
Task * | parent () const |
TaskView * | taskView () 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 |
timing related functions void | changeTime (long minutes, KarmStorage *storage) |
void | changeTimes (long minutesSession, long minutes, KarmStorage *storage=0) |
void | changeTotalTimes (long minutesSession, long minutes) |
void | resetTimes () |
returns the times accumulated by the task *return total time in minutes *long | time () const |
long | totalTime () const |
long | sessionTime () const |
long | totalSessionTime () const |
QDateTime | startTime () const |
void | startNewSession () |
desktop related functions void | setDesktopList (DesktopList dl) |
DesktopList | getDesktops () const |
QString | getDesktopStr () const |
name related functions void | setName (const QString &name, KarmStorage *storage) |
QString | name () const |
QString | fullName () const |
void | update () |
the state of a Task running void | setRunning (bool on, KarmStorage *storage) |
bool | isRunning () const |
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) |
bool | isComplete () |
void | removeFromView () |
Public Attributes | |
the state of a Task | stopped |
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 QListViewItem class.
Definition at line 41 of file task.h.
Member Function Documentation
|
return parent Task or null in case of TaskView. same as QListViewItem::parent() |
|
Return task view for this task.
|
|
Return unique iCalendar Todo ID for this task.
Definition at line 69 of file task.h. Referenced by KarmStorage::loadFromFlatFile(), and TaskView::newTask(). |
|
Set unique id for the task. The uid is the key used to update the storage.
Definition at line 121 of file task.cpp. Referenced by KarmStorage::loadFromFlatFile(), and TaskView::newTask(). |
|
cut Task out of parent Task or the TaskView
Definition at line 370 of file task.cpp. Referenced by move(). |
|
cut Task out of parent Task or the TaskView and into the destination Task
|
|
insert Task into the destination Task
Definition at line 386 of file task.cpp. Referenced by move(). |
|
Sort times numerically, not alphabetically.
Definition at line 412 of file task.cpp. References sessionTime(), time(), totalSessionTime(), and totalTime(). |
|
Change task time. Adds minutes to both total time and session time.
Definition at line 192 of file task.cpp. References changeTimes(). |
|
Add minutes to time and session time, and write to storage.
Definition at line 197 of file task.cpp. References KarmStorage::changeTime(), and changeTotalTimes(). Referenced by changeTime(), KarmStorage::loadFromFlatFile(), and startNewSession(). |
|
adds minutes to total and session time
Definition at line 208 of file task.cpp. References update(). Referenced by changeTimes(). |
|
Reset all times to 0.
Definition at line 220 of file task.cpp. References update(). Referenced by TaskView::resetTimeForAllTasks(). |
|
Return time the task was started.
Definition at line 136 of file task.h. Referenced by KarmStorage::stopTimer(). |
|
sets session time to zero.
Definition at line 139 of file task.h. References changeTimes(). Referenced by TaskView::startNewSession(). |
|
sets the name of the task
Definition at line 130 of file task.cpp. References KarmStorage::setName(), and update(). |
|
returns the name of this task.
Definition at line 160 of file task.h. Referenced by asTodo(), TaskView::deleteTask(), fullName(), and KarmStorage::loadFromFlatFile(). |
|
Returns that task name, prefixed by parent tree up to root. Task names are seperated by a forward slash: / |
|
Update the display of the task (all columns) in the UI.
Definition at line 392 of file task.cpp. Referenced by changeTotalTimes(), resetTimes(), and setName(). |
|
starts or stops a task
Definition at line 99 of file task.cpp. References KarmStorage::startTimer(), KarmStorage::stopTimer(), and updateActiveIcon(). Referenced by remove(), and setPercentComplete(). |
|
return the state of a task - if it's running or not
Definition at line 125 of file task.cpp. Referenced by remove(), and setPercentComplete(). |
|
Load the todo passed in with this tasks info.
Definition at line 280 of file task.cpp. References name(). |
|
Add a comment to this task.
Definition at line 401 of file task.cpp. References KarmStorage::addComment(). |
|
Retrieve the entire comment for the task.
|
|
tells you whether this task is the root of the task tree
Definition at line 201 of file task.h. Referenced by fullName(). |
|
remove Task with all it's children
Definition at line 242 of file task.cpp. References isRunning(), KarmStorage::removeTask(), and setRunning(). Referenced by TaskView::deleteTask(). |
|
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 142 of file task.cpp. References isRunning(), and setRunning(). Referenced by TaskView::deleteTask(). |
|
Return true if task is complete (percent complete equals 100).
|
|
Remove current task and all it's children from the view.
Definition at line 180 of file task.cpp. Referenced by TaskView::deleteTask(). |
|
signal that we're about to delete a task
|
|
animate the active icon
Definition at line 266 of file task.cpp. Referenced by setRunning(). |
The documentation for this class was generated from the following files: