• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

ktimetracker

Signals | Public Member Functions | Protected Slots | Protected Member Functions | List of all members
Task Class Reference

#include <task.h>

Inheritance diagram for Task:
Inheritance graph
[legend]

Signals

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

Public Member Functions

 Task (const QString &taskname, const QString &taskdescription, long minutes, long sessionTime, DesktopList desktops, TaskView *parent=0, bool konsolemode=false)
 
 Task (const QString &taskname, const QString &taskdescription, long minutes, long sessionTime, DesktopList desktops, Task *parent=0)
 
 Task (const KCalCore::Todo::Ptr &incident, TaskView *parent, bool konsolemode=false)
 
 ~Task ()
 
void addComment (const QString &comment, timetrackerstorage *storage)
 
KCalCore::Todo::Ptr asTodo (const KCalCore::Todo::Ptr &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 (const KCalCore::Incidence::Ptr &, long &minutes, long &sessionMinutes, QString &sessionStartTiMe, QString &name, QString &description, DesktopList &desktops, int &percent_complete, int &priority)
 
void paste (Task *destination)
 
int percentComplete () const
 
int priority () const
 
bool remove (timetrackerstorage *storage)
 
void setDescription (QString desc, timetrackerstorage *storage)
 
void setPercentComplete (const int percent, timetrackerstorage *storage)
 
void setPixmapProgress ()
 
void setPriority (int priority)
 
void setUid (const QString &uid)
 
TaskView * taskView () const
 
QString uid () const
 
void update ()
 
void changeTime (long minutes, timetrackerstorage *storage)
 
void changeTimes (long minutesSession, long minutes, timetrackerstorage *storage=0)
 
void changeTotalTimes (long minutesSession, long minutes)
 
QString addTime (long minutes)
 
QString addTotalTime (long minutes)
 
QString addSessionTime (long minutes)
 
QString addTotalSessionTime (long minutes)
 
QString setTime (long minutes)
 
void setTotalTime (long minutes)
 
void setTotalSessionTime (long minutes)
 
QString recalculatetotaltime ()
 
QString recalculatetotalsessiontime ()
 
QString setSessionTime (long minutes)
 
void resetTimes ()
 
long time () const
 
long totalTime () const
 
long sessionTime () const
 
long totalSessionTime () const
 
KDateTime sessionStartTiMe () const
 
QDateTime startTime () const
 
void startNewSession ()
 
void setDesktopList (DesktopList dl)
 
DesktopList desktops () const
 
QString getDesktopStr () const
 
void setName (const QString &name, timetrackerstorage *storage)
 
void setDescription (const QString &description)
 
QString name () const
 
QString description () const
 
QString fullName () const
 
void setRunning (bool on, timetrackerstorage *storage, const QDateTime &when=QDateTime::currentDateTime())
 
void resumeRunning ()
 
bool isRunning () const
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
 QObject (QObject *parent, const char *name)
 
virtual  ~QObject ()
 
bool blockSignals (bool block)
 
QObject * child (const char *objName, const char *inheritsClass, bool recursiveSearch) const
 
const QObjectList & children () const
 
const char * className () const
 
bool connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const QObject *receiver, const char *method)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method)
 
void dumpObjectInfo ()
 
void dumpObjectTree ()
 
QList< QByteArray > dynamicPropertyNames () const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
T findChild (const QString &name) const
 
QList< T > findChildren (const QRegExp &regExp) const
 
QList< T > findChildren (const QString &name) const
 
bool inherits (const char *className) const
 
void insertChild (QObject *object)
 
void installEventFilter (QObject *filterObj)
 
bool isA (const char *className) const
 
bool isWidgetType () const
 
void killTimer (int id)
 
virtual const QMetaObject * metaObject () const
 
void moveToThread (QThread *targetThread)
 
const char * name () const
 
const char * name (const char *defaultName) const
 
QString objectName () const
 
QObject * parent () const
 
QVariant property (const char *name) const
 
void removeChild (QObject *object)
 
void removeEventFilter (QObject *obj)
 
void setName (const char *name)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const
 
int startTimer (int interval)
 
QThread * thread () const
 
- Public Member Functions inherited from QTreeWidgetItem
 QTreeWidgetItem (int type)
 
 QTreeWidgetItem (const QStringList &strings, int type)
 
 QTreeWidgetItem (QTreeWidget *parent, const QStringList &strings, int type)
 
 QTreeWidgetItem (QTreeWidgetItem *parent, QTreeWidgetItem *preceding, int type)
 
 QTreeWidgetItem (const QTreeWidgetItem &other)
 
 QTreeWidgetItem (QTreeWidget *parent, QTreeWidgetItem *preceding, int type)
 
 QTreeWidgetItem (QTreeWidget *parent, int type)
 
 QTreeWidgetItem (QTreeWidgetItem *parent, int type)
 
 QTreeWidgetItem (QTreeWidgetItem *parent, const QStringList &strings, int type)
 
virtual  ~QTreeWidgetItem ()
 
void addChild (QTreeWidgetItem *child)
 
void addChildren (const QList< QTreeWidgetItem * > &children)
 
QBrush background (int column) const
 
QColor backgroundColor (int column) const
 
Qt::CheckState checkState (int column) const
 
QTreeWidgetItem * child (int index) const
 
int childCount () const
 
QTreeWidgetItem::ChildIndicatorPolicy childIndicatorPolicy () const
 
virtual QTreeWidgetItem * clone () const
 
int columnCount () const
 
virtual QVariant data (int column, int role) const
 
Qt::ItemFlags flags () const
 
QFont font (int column) const
 
QBrush foreground (int column) const
 
QIcon icon (int column) const
 
int indexOfChild (QTreeWidgetItem *child) const
 
void insertChild (int index, QTreeWidgetItem *child)
 
void insertChildren (int index, const QList< QTreeWidgetItem * > &children)
 
bool isDisabled () const
 
bool isExpanded () const
 
bool isFirstColumnSpanned () const
 
bool isHidden () const
 
bool isSelected () const
 
QTreeWidgetItem & operator= (const QTreeWidgetItem &other)
 
QTreeWidgetItem * parent () const
 
virtual void read (QDataStream &in)
 
void removeChild (QTreeWidgetItem *child)
 
void setBackground (int column, const QBrush &brush)
 
void setBackgroundColor (int column, const QColor &color)
 
void setCheckState (int column, Qt::CheckState state)
 
void setChildIndicatorPolicy (QTreeWidgetItem::ChildIndicatorPolicy policy)
 
virtual void setData (int column, int role, const QVariant &value)
 
void setDisabled (bool disabled)
 
void setExpanded (bool expand)
 
void setFirstColumnSpanned (bool span)
 
void setFlags (QFlags< Qt::ItemFlag > flags)
 
void setFont (int column, const QFont &font)
 
void setForeground (int column, const QBrush &brush)
 
void setHidden (bool hide)
 
void setIcon (int column, const QIcon &icon)
 
void setSelected (bool select)
 
void setSizeHint (int column, const QSize &size)
 
void setStatusTip (int column, const QString &statusTip)
 
void setText (int column, const QString &text)
 
void setTextAlignment (int column, int alignment)
 
void setTextColor (int column, const QColor &color)
 
void setToolTip (int column, const QString &toolTip)
 
void setWhatsThis (int column, const QString &whatsThis)
 
QSize sizeHint (int column) const
 
void sortChildren (int column, Qt::SortOrder order)
 
QString statusTip (int column) const
 
QTreeWidgetItem * takeChild (int index)
 
QList< QTreeWidgetItem * > takeChildren ()
 
QString text (int column) const
 
int textAlignment (int column) const
 
QColor textColor (int column) const
 
QString toolTip (int column) const
 
QTreeWidget * treeWidget () const
 
int type () const
 
QString whatsThis (int column) const
 
virtual void write (QDataStream &out) const
 

Protected Slots

void updateActiveIcon ()
 

Protected Member Functions

void changeParentTotalTimes (long minutesSession, long minutes)
 
- Protected Member Functions inherited from QObject
bool checkConnectArgs (const char *signal, const QObject *object, const char *method)
 
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const char *signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const char *signal)
 
int receivers (const char *signal) const
 
QObject * sender () const
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *event)
 
- Protected Member Functions inherited from QTreeWidgetItem
void emitDataChanged ()
 

Additional Inherited Members

- Static Public Member Functions inherited from QObject
bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
- Static Protected Member Functions inherited from QObject
QByteArray normalizeSignalSlot (const char *signalSlot)
 
- Properties inherited from QObject
 objectName
 

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 54 of file task.h.

Constructor & Destructor Documentation

Task::Task ( const QString &  taskname,
const QString &  taskdescription,
long  minutes,
long  sessionTime,
DesktopList  desktops,
TaskView *  parent = 0,
bool  konsolemode = false 
)

Definition at line 42 of file task.cpp.

Task::Task ( const QString &  taskname,
const QString &  taskdescription,
long  minutes,
long  sessionTime,
DesktopList  desktops,
Task *  parent = 0 
)

Definition at line 49 of file task.cpp.

Task::Task ( const KCalCore::Todo::Ptr &  incident,
TaskView *  parent,
bool  konsolemode = false 
)

Definition at line 56 of file task.cpp.

Task::~Task ( )

Definition at line 143 of file task.cpp.

Member Function Documentation

void Task::addComment ( const QString &  comment,
timetrackerstorage *  storage 
)

Add a comment to this task.

A comment is called "description" in the context of KCalCore::ToDo

Definition at line 647 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
minutesminutes to add to the session time
Returns
A QString with the error message, in case of no error an empty QString.

Definition at line 331 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
minutesminutes to add to the time
Returns
A QString with the error message, in case of no error an empty QString.

Definition at line 311 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
minutesminutes to add to the session time
Returns
A QString with the error message, in case of no error an empty QString.

Definition at line 341 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
minutesminutes to add to the time
Returns
A QString with the error message, in case of no error an empty QString.

Definition at line 321 of file task.cpp.

KCalCore::Todo::Ptr Task::asTodo ( const KCalCore::Todo::Ptr &  calendar) const

Load the todo passed in with this tasks info.

Definition at line 480 of file task.cpp.

void Task::changeParentTotalTimes ( long  minutesSession,
long  minutes 
)
protected

Definition at line 436 of file task.cpp.

void Task::changeTime ( long  minutes,
timetrackerstorage *  storage 
)

Change task time.

Adds minutes to both total time and session time by adding an event.

Parameters
minutesminutes to add to - may be negative
storagePointer to timetrackerstorage instance. If zero, don't save changes.

Definition at line 407 of file task.cpp.

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

Add minutes to time and session time by adding an event, and write to storage.

Parameters
minutesSessionminutes to add to task session time
minutesminutes to add to task time
storagePointer to timetrackerstorage instance. If zero, don't save changes.

Definition at line 393 of file task.cpp.

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

adds minutes to total and session time by adding an event

Parameters
minutesSessionminutes to add to task total session time
minutesminutes to add to task total time

Definition at line 412 of file task.cpp.

QString Task::comment ( ) const

Retrieve the entire comment for the task.

Definition at line 680 of file task.cpp.

void Task::cut ( )

cut Task out of parent Task or the TaskView

Definition at line 602 of file task.cpp.

void Task::delete_recursive ( )

Definition at line 149 of file task.cpp.

void Task::deletingTask ( Task *  thisTask)
signal

signal that we're about to delete a task

int Task::depth ( )

Definition at line 73 of file task.cpp.

QString Task::description ( ) const

returns the description of this task.

Returns
a pointer to the description.

Definition at line 700 of file task.cpp.

DesktopList Task::desktops ( ) const

Definition at line 715 of file task.cpp.

QString Task::fullName ( ) const

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

Task names are separated by a forward slash: /

Definition at line 472 of file task.cpp.

QString Task::getDesktopStr ( ) const

Definition at line 586 of file task.cpp.

bool Task::isComplete ( )

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

Definition at line 304 of file task.cpp.

bool Task::isRoot ( ) const
inline

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

Definition at line 315 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 208 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 623 of file task.cpp.

QString Task::name ( ) const

returns the name of this task.

Returns
a pointer to the name.

Definition at line 695 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 71 of file task.h.

bool Task::parseIncidence ( const KCalCore::Incidence::Ptr &  incident,
long &  minutes,
long &  sessionMinutes,
QString &  sessionStartTiMe,
QString &  name,
QString &  description,
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 513 of file task.cpp.

void Task::paste ( Task *  destination)

insert Task into the destination Task

Definition at line 614 of file task.cpp.

int Task::percentComplete ( ) const

Definition at line 685 of file task.cpp.

int Task::priority ( ) const

Definition at line 690 of file task.cpp.

QString Task::recalculatetotalsessiontime ( )

A recursive function to calculate the total session time of a task.

Definition at line 372 of file task.cpp.

QString Task::recalculatetotaltime ( )

A recursive function to calculate the total time of a task.

Definition at line 361 of file task.cpp.

bool Task::remove ( timetrackerstorage *  storage)

remove Task with all it's children

Parameters
storagea pointer to a timetrackerstorage object.

Definition at line 444 of file task.cpp.

void Task::resetTimes ( )

Reset all times to 0 and adjust parent task's totalTiMes.

Definition at line 424 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 189 of file task.cpp.

KDateTime Task::sessionStartTiMe ( ) const

Definition at line 710 of file task.cpp.

long Task::sessionTime ( ) const
inline

Definition at line 207 of file task.h.

void Task::setDescription ( const QString &  description)

sets the description of the task

Definition at line 226 of file task.cpp.

void Task::setDescription ( QString  desc,
timetrackerstorage *  storage 
)

Set a task's description A description is a comment.

void Task::setDesktopList ( DesktopList  dl)

Definition at line 306 of file task.cpp.

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

sets the name of the task

Parameters
namea pointer to the name. A deep copy will be made.
storagea pointer to a timetrackerstorage object.

Definition at line 213 of file task.cpp.

void Task::setPercentComplete ( const int  percent,
timetrackerstorage *  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

  1. If less than zero, set to zero.

Definition at line 238 of file task.cpp.

void Task::setPixmapProgress ( )

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

Definition at line 284 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 269 of file task.cpp.

void Task::setRunning ( bool  on,
timetrackerstorage *  storage,
const QDateTime &  when = QDateTime::currentDateTime() 
)

starts or stops a task

Parameters
ontrue or false for starting or stopping a task
storagea pointer to a timetrackerstorage object.
whentime 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 159 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
minutesminutes to set session time to

Definition at line 383 of file task.cpp.

QString Task::setTime ( long  minutes)

Sets the time (not session time).

This does not add an event.

Parameters
minutesminutes to set time to

Definition at line 351 of file task.cpp.

void Task::setTotalSessionTime ( long  minutes)
inline

Sets the total session time, does not change the parent's total session time.

This means the parent's total session time can run out of sync.

Definition at line 179 of file task.h.

void Task::setTotalTime ( long  minutes)
inline

Sets the total time, does not change the parent's total time.

This means the parent's total time can run out of sync.

Definition at line 174 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
uidThe new unique id.

Definition at line 203 of file task.cpp.

void Task::startNewSession ( )

sets session time to zero.

Definition at line 653 of file task.cpp.

QDateTime Task::startTime ( ) const

Return time the task was started.

Definition at line 705 of file task.cpp.

TaskView* Task::taskView ( ) const
inline

Return task view for this task.

Definition at line 74 of file task.h.

long Task::time ( ) const
inline
Returns
time in minutes

Definition at line 204 of file task.h.

long Task::totalSessionTime ( ) const
inline

Definition at line 208 of file task.h.

long Task::totalTime ( ) const
inline
Returns
total time in minutes

Definition at line 206 of file task.h.

void Task::totalTimesChanged ( long  minutesSession,
long  minutes 
)
signal
QString Task::uid ( ) const

Return unique iCalendar Todo ID for this task.

Definition at line 675 of file task.cpp.

void Task::update ( )

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

Definition at line 632 of file task.cpp.

void Task::updateActiveIcon ( )
protectedslot

animate the active icon

Definition at line 466 of file task.cpp.


The documentation for this class was generated from the following files:
  • task.h
  • task.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:31:35 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

ktimetracker

Skip menu "ktimetracker"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer
  • pimprint

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal