8 #include <tqptrvector.h>
10 #include <tqdatetime.h>
13 #include "desktoplist.h"
41 class Task :
public TQObject,
public TQListViewItem
48 Task(
const TQString& taskame,
long minutes,
long sessionTime,
49 DesktopList desktops,
TaskView* parent = 0);
50 Task(
const TQString& taskame,
long minutes,
long sessionTime,
51 DesktopList desktops,
Task* parent = 0);
61 Task* nextSibling()
const {
return (
Task*)TQListViewItem::nextSibling(); }
62 Task* parent()
const {
return (
Task*)TQListViewItem::parent(); }
66 return static_cast<TaskView *
>( listView() );
70 TQString
uid()
const {
return _uid; }
90 int compare ( TQListViewItem * i,
int col,
bool ascending )
const;
112 (
long minutesSession,
long minutes,
KarmStorage* storage=0);
129 long time()
const {
return _time; };
130 long totalTime()
const {
return _totalTime; };
131 long sessionTime()
const {
return _sessionTime; };
132 long totalSessionTime()
const {
return _totalSessionTime; };
145 void setDesktopList ( DesktopList dl );
146 DesktopList getDesktops()
const {
return _desktops;}
148 TQString getDesktopStr()
const;
162 TQString
name()
const {
return _name; };
185 void setRunning(
bool on,
KarmStorage* storage, TQDateTime whenStarted=TQDateTime::currentDateTime(), TQDateTime whenStopped=TQDateTime::currentDateTime());
193 bool parseIncidence(KCal::Incidence*,
long& minutes,
194 long& sessionMinutes, TQString&
name, DesktopList& desktops,
195 int& percent_complete);
200 KCal::Todo*
asTodo(KCal::Todo* calendar)
const;
209 bool isRoot()
const {
return parent() == 0; }
241 void changeParentTotalTimes(
long minutesSession,
long minutes );
244 void totalTimesChanged(
long minutesSession,
long minutes);
260 int _percentcomplete;
262 long totalTimeInSeconds()
const {
return _totalTime * 60; }
265 void noNegativeTimes();
268 void init(
const TQString& taskame,
long minutes,
long sessionTime,
269 DesktopList desktops,
int percent_complete);
276 TQDateTime _lastStart;
280 long _totalSessionTime;
287 DesktopList _desktops;
290 static TQPtrVector<TQPixmap> *icons;
Singleton to store/retrieve KArm data to/from persistent storage.
Container and interface for the tasks.
A class representing a task.
void addComment(TQString comment, KarmStorage *storage)
Add a comment to this task.
TQDateTime lastStart()
delivers when the task was started last
void changeTimes(long minutesSession, long minutes, KarmStorage *storage=0)
Add minutes to time and session time, and write to storage.
void resetTimes()
Reset all times to 0.
void setRunning(bool on, KarmStorage *storage, TQDateTime whenStarted=TQDateTime::currentDateTime(), TQDateTime whenStopped=TQDateTime::currentDateTime())
starts or stops a task
bool isComplete()
Return true if task is complete (percent complete equals 100).
void changeTime(long minutes, KarmStorage *storage)
Change task time.
void update()
Update the display of the task (all columns) in the UI.
void removeFromView()
Remove current task and all it's children from the view.
TQString name() const
returns the name of this task.
Task * firstChild() const
return parent Task or null in case of TaskView.
TQDateTime startTime() const
Return time the task was started.
KCal::Todo * asTodo(KCal::Todo *calendar) const
Load the todo passed in with this tasks info.
void updateActiveIcon()
animate the active icon
void setName(const TQString &name, KarmStorage *storage)
sets the name of the task
TQString fullName() const
Returns that task name, prefixed by parent tree up to root.
void setPixmapProgress()
Sets an appropriate icon for this task based on its level of completion.
bool isRoot() const
tells you whether this task is the root of the task tree
void changeTotalTimes(long minutesSession, long minutes)
adds minutes to total and session time
TQString uid() const
Return unique iCalendar Todo ID for this task.
void setPercentComplete(const int percent, KarmStorage *storage)
Update percent complete for this task.
TaskView * taskView() const
Return task view for this task.
int compare(TQListViewItem *i, int col, bool ascending) const
Sort times numerically, not alphabetically.
void move(Task *destination)
cut Task out of parent Task or the TaskView and into the destination Task
void paste(Task *destination)
insert Task into the destination Task
bool isRunning() const
return the state of a task - if it's running or not
void cut()
cut Task out of parent Task or the TaskView
bool remove(TQPtrList< Task > &activeTasks, KarmStorage *storage)
remove Task with all it's children
TQString comment() const
Retrieve the entire comment for the task.
void deletingTask(Task *thisTask)
signal that we're about to delete a task
void startNewSession()
sets session time to zero.
void setUid(const TQString uid)
Set unique id for the task.