#include <task.h>
Inherits TQObject, and TQListViewItem.
Signals |
void | totalTimesChanged (long minutesSession, long minutes) |
void | deletingTask (Task *thisTask) |
Public Member Functions |
Task * | firstChild () const |
Task * | nextSibling () const |
Task * | parent () const |
TaskView * | taskView () 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 | update () |
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 () |
|
| 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) |
|
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 | setRunning (bool on, KarmStorage *storage, TQDateTime whenStarted=TQDateTime::currentDateTime(), TQDateTime whenStopped=TQDateTime::currentDateTime()) |
bool | isRunning () const |
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
void Task::addComment |
( |
TQString |
comment, |
|
|
KarmStorage * |
storage |
|
) |
| |
Add a comment to this task.
Definition at line 420 of file task.cpp.
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.
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 208 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 213 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 224 of file task.cpp.
TQString Task::comment |
( |
| ) |
const |
Retrieve the entire comment for the task.
Definition at line 426 of file task.cpp.
int Task::compare |
( |
TQListViewItem * |
i, |
|
|
int |
col, |
|
|
bool |
ascending |
|
) |
| const |
Sort times numerically, not alphabetically.
Definition at line 431 of file task.cpp.
void Task::deletingTask |
( |
Task * |
thisTask | ) |
|
|
signal |
signal that we're about to delete a task
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.
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.
bool Task::isComplete |
( |
| ) |
|
Return true if task is complete (percent complete equals 100).
Definition at line 194 of file task.cpp.
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.
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.
TQDateTime Task::lastStart |
( |
| ) |
|
|
inline |
delivers when the task was started last
Definition at line 238 of file task.h.
void Task::move |
( |
Task * |
destination | ) |
|
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.
void Task::paste |
( |
Task * |
destination | ) |
|
bool Task::remove |
( |
TQPtrList< 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 258 of file task.cpp.
void Task::removeFromView |
( |
| ) |
|
Remove current task and all it's children from the view.
Definition at line 196 of file task.cpp.
void Task::resetTimes |
( |
| ) |
|
Reset all times to 0.
Definition at line 236 of file task.cpp.
void Task::setName |
( |
const TQString & |
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 137 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
- If less than zero, set to zero.
Definition at line 149 of file task.cpp.
void Task::setPixmapProgress |
( |
| ) |
|
Sets an appropriate icon for this task based on its level of completion.
Definition at line 184 of file task.cpp.
void Task::setRunning |
( |
bool |
on, |
|
|
KarmStorage * |
storage, |
|
|
TQDateTime |
whenStarted = TQDateTime::currentDateTime() , |
|
|
TQDateTime |
whenStopped = TQDateTime::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 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.
void Task::setUid |
( |
const TQString |
uid | ) |
|
Set unique id for the task.
The uid is the key used to update the storage.
- Parameters
-
Definition at line 128 of file task.cpp.
void Task::startNewSession |
( |
| ) |
|
|
inline |
sets session time to zero.
Definition at line 140 of file task.h.
TQDateTime Task::startTime |
( |
| ) |
const |
|
inline |
Return time the task was started.
Definition at line 137 of file task.h.
Return task view for this task.
Definition at line 65 of file task.h.
TQString Task::uid |
( |
| ) |
const |
|
inline |
Return unique iCalendar Todo ID for this task.
Definition at line 70 of file task.h.
Update the display of the task (all columns) in the UI.
Definition at line 411 of file task.cpp.
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:
|