ktimetracker
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 61 of file task.h.
|
Signals |
| void | deletingTask (Task *thisTask) |
| void | totalTimesChanged (long minutesSession, long minutes) |
Public Member Functions |
| void | addComment (const QString &comment, KarmStorage *storage) |
| KCal::Todo * | asTodo (KCal::Todo *calendar) const |
| QString | comment () const |
| void | cut () |
| void | delete_recursive () |
| int | depth () |
| bool | isComplete () |
| bool | isRoot () const |
| void | move (Task *destination) |
| Task * | parent () const |
| bool | parseIncidence (KCal::Incidence *, long &minutes, long &sessionMinutes, QString &sessionStartTiMe, QString &name, DesktopList &desktops, int &percent_complete, int &priority) |
| void | paste (Task *destination) |
| int | percentComplete () const |
| int | priority () const |
| bool | remove (KarmStorage *storage) |
| void | setDescription (QString desc, KarmStorage *storage) |
| void | setPercentComplete (const int percent, KarmStorage *storage) |
| void | setPixmapProgress () |
| void | setPriority (int priority) |
| void | setUid (const QString &uid) |
| TaskView * | taskView () const |
| QString | uid () const |
| void | update () |
| | ~Task () |
|
| QString | addSessionTime (long minutes) |
| QString | addTime (long minutes) |
| QString | addTotalSessionTime (long minutes) |
| QString | addTotalTime (long minutes) |
| void | changeTime (long minutes, KarmStorage *storage) |
| void | changeTimes (long minutesSession, long minutes, KarmStorage *storage=0) |
| void | changeTotalTimes (long minutesSession, long minutes) |
| void | resetTimes () |
| KDateTime | sessionStartTiMe () const |
| long | sessionTime () const |
| QString | setSessionTime (long minutes) |
| QString | setTime (long minutes) |
| void | startNewSession () |
| QDateTime | startTime () const |
| long | time () const |
| long | totalSessionTime () const |
| long | totalTime () const |
|
| DesktopList | desktops () const |
| QString | getDesktopStr () const |
| void | setDesktopList (DesktopList dl) |
|
| QString | fullName () const |
| QString | name () const |
| void | setName (const QString &name, KarmStorage *storage) |
|
| bool | isRunning () const |
| void | resumeRunning () |
| void | setRunning (bool on, KarmStorage *storage, const QDateTime &when=QDateTime::currentDateTime()) |
|
| | Task (KCal::Todo *incident, TaskView *parent, bool konsolemode=false) |
| | Task (const QString &taskame, long minutes, long sessionTime, DesktopList desktops, Task *parent=0) |
| | Task (const QString &taskame, long minutes, long sessionTime, DesktopList desktops, TaskView *parent=0, bool konsolemode=false) |
Protected Slots |
| void | updateActiveIcon () |
Protected Member Functions |
| void | changeParentTotalTimes (long minutesSession, long minutes) |
Constructor & Destructor Documentation
| Task::Task |
( |
const QString & |
taskame, |
|
|
long |
minutes, |
|
|
long |
sessionTime, |
|
|
DesktopList |
desktops, |
|
|
TaskView * |
parent = 0, |
|
|
bool |
konsolemode = false | |
|
) |
| | |
| Task::Task |
( |
const QString & |
taskame, |
|
|
long |
minutes, |
|
|
long |
sessionTime, |
|
|
DesktopList |
desktops, |
|
|
Task * |
parent = 0 | |
|
) |
| | |
| Task::Task |
( |
KCal::Todo * |
incident, |
|
|
TaskView * |
parent, |
|
|
bool |
konsolemode = false | |
|
) |
| | |
Member Function Documentation
Add a comment to this task.
A comment is called "description" in the context of KCal::ToDo
Definition at line 608 of file task.cpp.
| QString Task::addSessionTime |
( |
long |
minutes |
) |
|
Adds minutes to the task's session time and its supertasks' total session time.
This does not add an event.
- Parameters:
-
| minutes | minutes to add to the session time |
- Returns:
- A QString with the error message, in case of no error an empty QString.
Definition at line 310 of file task.cpp.
| QString Task::addTime |
( |
long |
minutes |
) |
|
Adds minutes to the time of the task and the total time of its supertasks.
This does not add an event.
- Parameters:
-
| minutes | minutes to add to the time |
- Returns:
- A QString with the error message, in case of no error an empty QString.
Definition at line 290 of file task.cpp.
| QString Task::addTotalSessionTime |
( |
long |
minutes |
) |
|
Adds minutes to the task's and its supertasks' total session time.
This does not add an event.
- Parameters:
-
| minutes | minutes to add to the session time |
- Returns:
- A QString with the error message, in case of no error an empty QString.
Definition at line 320 of file task.cpp.
| QString Task::addTotalTime |
( |
long |
minutes |
) |
|
Adds minutes to the total time of the task and its supertasks.
This does not add an event.
- Parameters:
-
| minutes | minutes to add to the time |
- Returns:
- A QString with the error message, in case of no error an empty QString.
Definition at line 300 of file task.cpp.
| KCal::Todo * Task::asTodo |
( |
KCal::Todo * |
calendar |
) |
const |
Load the todo passed in with this tasks info.
Definition at line 436 of file task.cpp.
| void Task::changeParentTotalTimes |
( |
long |
minutesSession, |
|
|
long |
minutes | |
|
) |
| | [protected] |
| void Task::changeTime |
( |
long |
minutes, |
|
|
KarmStorage * |
storage | |
|
) |
| | |
Change task time.
Adds minutes to both total time and session time by adding an event.
- Parameters:
-
| minutes | minutes to add to - may be negative |
| storage | Pointer to KarmStorage instance. If zero, don't save changes. |
Definition at line 285 of file task.cpp.
| void Task::changeTimes |
( |
long |
minutesSession, |
|
|
long |
minutes, |
|
|
KarmStorage * |
storage = 0 | |
|
) |
| | |
Add minutes to time and session time by adding an event, 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 350 of file task.cpp.
| void Task::changeTotalTimes |
( |
long |
minutesSession, |
|
|
long |
minutes | |
|
) |
| | |
adds minutes to total and session time by adding an event
- Parameters:
-
| minutesSession | minutes to add to task total session time |
| minutes | minutes to add to task total time |
Definition at line 364 of file task.cpp.
Retrieve the entire comment for the task.
Definition at line 626 of file task.cpp.
| void Task::delete_recursive |
( |
|
) |
|
| void Task::deletingTask |
( |
Task * |
thisTask |
) |
[signal] |
signal that we're about to delete a task
Returns that task name, prefixed by parent tree up to root.
Task names are separated by a forward slash: /
Definition at line 428 of file task.cpp.
| QString Task::getDesktopStr |
( |
|
) |
const |
| bool Task::isComplete |
( |
|
) |
|
Return true if task is complete (percent complete equals 100).
Definition at line 278 of file task.cpp.
| bool Task::isRoot |
( |
|
) |
const [inline] |
tells you whether this task is the root of the task tree
Definition at line 300 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 204 of file task.cpp.
| void Task::move |
( |
Task * |
destination |
) |
|
returns the name of this task.
- Returns:
- a pointer to the name.
Definition at line 641 of file task.cpp.
| Task* Task::parent |
( |
|
) |
const [inline] |
return parent Task or null in case of TaskView.
same as QListViewItem::parent()
Definition at line 79 of file task.h.
| bool Task::parseIncidence |
( |
KCal::Incidence * |
incident, |
|
|
long & |
minutes, |
|
|
long & |
sessionMinutes, |
|
|
QString & |
sessionStartTiMe, |
|
|
QString & |
name, |
|
|
DesktopList & |
desktops, |
|
|
int & |
percent_complete, |
|
|
int & |
priority | |
|
) |
| | |
Parses an incidence.
This is needed e.g. when you create a task out of a todo. You read the todo, extract its custom properties (like session time) and use these data to initialize the task.
Definition at line 471 of file task.cpp.
| void Task::paste |
( |
Task * |
destination |
) |
|
| int Task::percentComplete |
( |
|
) |
const |
| int Task::priority |
( |
|
) |
const |
remove Task with all it's children
- Parameters:
-
Definition at line 397 of file task.cpp.
| void Task::resetTimes |
( |
|
) |
|
Reset all times to 0 and adjust parent task's totalTiMes.
Definition at line 377 of file task.cpp.
| void Task::resumeRunning |
( |
|
) |
|
Resume the running state of a task.
This is the same as setrunning, but the storage is not modified.
Definition at line 185 of file task.cpp.
| KDateTime Task::sessionStartTiMe |
( |
|
) |
const |
| long Task::sessionTime |
( |
|
) |
const |
Set a task's description A description is a comment.
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 209 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 222 of file task.cpp.
| void Task::setPixmapProgress |
( |
|
) |
|
Sets an appropriate icon for this task based on its level of completion.
Definition at line 268 of file task.cpp.
| void Task::setPriority |
( |
int |
priority |
) |
|
Update priority for this task.
Priority is allowed from 0 to 9. 0 unspecified, 1 highest and 9 lowest.
Definition at line 253 of file task.cpp.
starts or stops a task
- Parameters:
-
| on | true or false for starting or stopping a task |
| storage | a pointer to a KarmStorage object. |
| when | time when the task was started or stopped. 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 155 of file task.cpp.
| QString Task::setSessionTime |
( |
long |
minutes |
) |
|
Sets the session time.
Set the session time without changing totalTime nor sessionTime. Do not change the parent's totalTime. Do not add an event. See also: changeTimes(long, long) and resetTimes
- Parameters:
-
| minutes | minutes to set session time to |
Definition at line 340 of file task.cpp.
| QString Task::setTime |
( |
long |
minutes |
) |
|
Sets the time (not session time).
This does not add an event.
- Parameters:
-
| minutes | minutes to set time to |
Definition at line 330 of file task.cpp.
| void Task::setUid |
( |
const QString & |
uid |
) |
|
Set unique id for the task.
The uid is the key used to update the storage.
- Parameters:
-
Definition at line 199 of file task.cpp.
| void Task::startNewSession |
( |
|
) |
|
sets session time to zero.
Definition at line 614 of file task.cpp.
Return time the task was started.
Definition at line 646 of file task.cpp.
| TaskView* Task::taskView |
( |
|
) |
const [inline] |
Return task view for this task.
Definition at line 82 of file task.h.
| long Task::time |
( |
|
) |
const |
| long Task::totalSessionTime |
( |
|
) |
const |
| long Task::totalTime |
( |
|
) |
const |
| void Task::totalTimesChanged |
( |
long |
minutesSession, |
|
|
long |
minutes | |
|
) |
| | [signal] |
Return unique iCalendar Todo ID for this task.
Definition at line 621 of file task.cpp.
Update the display of the task (all columns) in the UI.
Definition at line 593 of file task.cpp.
| void Task::updateActiveIcon |
( |
|
) |
[protected, slot] |
animate the active icon
Definition at line 422 of file task.cpp.
The documentation for this class was generated from the following files: